@economic/taco 1.0.8 → 1.0.9

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 (371) hide show
  1. package/README.md +84 -84
  2. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  3. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  4. package/dist/esm/components/Badge/Badge.js.map +1 -1
  5. package/dist/esm/components/Banner/Banner.js.map +1 -1
  6. package/dist/esm/components/Banner/util.js +1 -1
  7. package/dist/esm/components/Banner/util.js.map +1 -1
  8. package/dist/esm/components/Button/Button.js.map +1 -1
  9. package/dist/esm/components/Button/util.js +18 -23
  10. package/dist/esm/components/Button/util.js.map +1 -1
  11. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  12. package/dist/esm/components/Card/Card.js.map +1 -1
  13. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  14. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  15. package/dist/esm/components/Combobox/useCombobox.js +67 -87
  16. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  17. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  18. package/dist/esm/components/Datepicker/useDatepicker.js +27 -34
  19. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  20. package/dist/esm/components/Dialog/Context.js +4 -4
  21. package/dist/esm/components/Dialog/Context.js.map +1 -1
  22. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  23. package/dist/esm/components/Dialog/components/Content.js +39 -44
  24. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  25. package/dist/esm/components/Dialog/components/Drawer.js +3 -3
  26. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  27. package/dist/esm/components/Dialog/components/Extra.js +2 -2
  28. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  29. package/dist/esm/components/Dialog/components/Trigger.js +2 -2
  30. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  31. package/dist/esm/components/Field/Field.js.map +1 -1
  32. package/dist/esm/components/Form/Form.js.map +1 -1
  33. package/dist/esm/components/Group/Group.js.map +1 -1
  34. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  35. package/dist/esm/components/HoverCard/HoverCard.js.map +1 -1
  36. package/dist/esm/components/Icon/Icon.js.map +1 -1
  37. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  38. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  39. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  40. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  41. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  42. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  43. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  44. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  45. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  46. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  47. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  48. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  49. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  50. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  51. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  52. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  53. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  54. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  55. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  56. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  57. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  58. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  59. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  60. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  61. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  62. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  63. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  64. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  65. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  66. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  67. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  68. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  69. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  70. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  71. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  72. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  73. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  74. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  75. package/dist/esm/components/Icon/components/CircleClose.js.map +1 -1
  76. package/dist/esm/components/Icon/components/CircleMinus.js.map +1 -1
  77. package/dist/esm/components/Icon/components/CirclePlus.js.map +1 -1
  78. package/dist/esm/components/Icon/components/CircleTick.js.map +1 -1
  79. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  80. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  81. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  82. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  83. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  84. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  85. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  86. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  87. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  88. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  89. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  90. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  91. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  92. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  93. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  94. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  95. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  96. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  97. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  98. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  99. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  100. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  101. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  102. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  103. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  104. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  105. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  106. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  107. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  108. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  109. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  110. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  111. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  112. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  113. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  114. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  115. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  116. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  117. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  118. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  119. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  120. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  121. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  122. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  123. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  124. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  125. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  126. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  127. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  128. package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
  129. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  130. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  131. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  132. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  133. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  134. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  135. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  136. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  137. package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
  138. package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
  139. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  140. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  141. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  142. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  143. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  144. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  145. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  146. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  147. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  148. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  149. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  150. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  151. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  152. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  153. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  154. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  155. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  156. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  157. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  158. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  159. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  160. package/dist/esm/components/Icon/components/List.js.map +1 -1
  161. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  162. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  163. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  164. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  165. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  166. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  167. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  168. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  169. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  170. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  171. package/dist/esm/components/Icon/components/More.js.map +1 -1
  172. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  173. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  174. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  175. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  176. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  177. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  178. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  179. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  180. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  181. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  182. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  183. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  184. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  185. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  186. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  187. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  188. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  189. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  190. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  191. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  192. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  193. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  194. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  195. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  196. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  197. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  198. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  199. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  200. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  201. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  202. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  203. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  204. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  205. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  206. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  207. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  208. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  209. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  210. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  211. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  212. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  213. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  214. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  215. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  217. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  218. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  219. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  220. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  221. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  222. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  223. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  224. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  225. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  226. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  227. package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
  228. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  229. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  230. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  231. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  232. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  233. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  234. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  235. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  236. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  237. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  238. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  239. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  240. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  241. package/dist/esm/components/Icon/components/index.js +4 -4
  242. package/dist/esm/components/Icon/components/index.js.map +1 -1
  243. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  244. package/dist/esm/components/Input/Input.js.map +1 -1
  245. package/dist/esm/components/Input/util.js +2 -2
  246. package/dist/esm/components/Input/util.js.map +1 -1
  247. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  248. package/dist/esm/components/Listbox/ScrollableList.js +64 -83
  249. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  250. package/dist/esm/components/Listbox/useListbox.js +51 -60
  251. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  252. package/dist/esm/components/Listbox/useMultiListbox.js +64 -91
  253. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  254. package/dist/esm/components/Listbox/useTypeahead.js +10 -9
  255. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  256. package/dist/esm/components/Listbox/util.js +48 -85
  257. package/dist/esm/components/Listbox/util.js.map +1 -1
  258. package/dist/esm/components/Menu/Context.js +2 -2
  259. package/dist/esm/components/Menu/Context.js.map +1 -1
  260. package/dist/esm/components/Menu/Menu.js.map +1 -1
  261. package/dist/esm/components/Menu/components/Checkbox.js +8 -9
  262. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  263. package/dist/esm/components/Menu/components/Content.js +10 -13
  264. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  265. package/dist/esm/components/Menu/components/Header.js +4 -4
  266. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  267. package/dist/esm/components/Menu/components/Item.js +34 -35
  268. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  269. package/dist/esm/components/Menu/components/Link.js +10 -11
  270. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  271. package/dist/esm/components/Menu/components/RadioGroup.js +16 -18
  272. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  273. package/dist/esm/components/Menu/components/Separator.js +4 -4
  274. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  275. package/dist/esm/components/Menu/components/Trigger.js +5 -5
  276. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  277. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  278. package/dist/esm/components/Pagination/PageNumbers.js +23 -28
  279. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  280. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  281. package/dist/esm/components/Pagination/usePagination.js +7 -21
  282. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  283. package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
  284. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  285. package/dist/esm/components/Popover/Popover.js.map +1 -1
  286. package/dist/esm/components/Popover/Primitives.js +7 -8
  287. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  288. package/dist/esm/components/Progress/Progress.js.map +1 -1
  289. package/dist/esm/components/Provider/Provider.js.map +1 -1
  290. package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
  291. package/dist/esm/components/SearchInput/SearchInput.js +1 -1
  292. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  293. package/dist/esm/components/Select/Select.js.map +1 -1
  294. package/dist/esm/components/Select/useSelect.js +63 -81
  295. package/dist/esm/components/Select/useSelect.js.map +1 -1
  296. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  297. package/dist/esm/components/Switch/Switch.js.map +1 -1
  298. package/dist/esm/components/Table/components/BaseTable.js +23 -30
  299. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  300. package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
  301. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  302. package/dist/esm/components/Table/components/Table.js +18 -25
  303. package/dist/esm/components/Table/components/Table.js.map +1 -1
  304. package/dist/esm/components/Table/components/WindowedTable.js +88 -104
  305. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  306. package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -146
  307. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  308. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
  309. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  310. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
  311. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  312. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +79 -89
  313. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  314. package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
  315. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  316. package/dist/esm/components/Table/hooks/useTable.js +119 -141
  317. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  318. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +12 -15
  319. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  320. package/dist/esm/components/Table/util/renderColumn.js +10 -10
  321. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  322. package/dist/esm/components/Table/util/renderRow.js +37 -46
  323. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  324. package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
  325. package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
  326. package/dist/esm/components/Table/util/sortTypes.js +23 -31
  327. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  328. package/dist/esm/components/Table/util.js +29 -41
  329. package/dist/esm/components/Table/util.js.map +1 -1
  330. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  331. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  332. package/dist/esm/components/Toast/Toast.js +20 -21
  333. package/dist/esm/components/Toast/Toast.js.map +1 -1
  334. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  335. package/dist/esm/components/Toast/util.js +2 -2
  336. package/dist/esm/components/Toast/util.js.map +1 -1
  337. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  338. package/dist/esm/components/Tour/Tour.js.map +1 -1
  339. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  340. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  341. package/dist/esm/index.css +661 -661
  342. package/dist/esm/index.js +1 -1
  343. package/dist/esm/primitives/Button.js +9 -13
  344. package/dist/esm/primitives/Button.js.map +1 -1
  345. package/dist/esm/utils/date.js.map +1 -1
  346. package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
  347. package/dist/esm/utils/hooks/useDraggable.js +16 -18
  348. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  349. package/dist/esm/utils/hooks/useDropTarget.js +7 -10
  350. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  351. package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  352. package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
  353. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  354. package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
  355. package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
  356. package/dist/esm/utils/hooks/useTimer.js +9 -17
  357. package/dist/esm/utils/hooks/useTimer.js.map +1 -1
  358. package/dist/esm/utils/input.js +7 -11
  359. package/dist/esm/utils/input.js.map +1 -1
  360. package/dist/esm/utils/mergeRefs.js +2 -2
  361. package/dist/esm/utils/mergeRefs.js.map +1 -1
  362. package/dist/esm/utils/taillwind.js +2 -2
  363. package/dist/esm/utils/taillwind.js.map +1 -1
  364. package/dist/index.css +661 -661
  365. package/dist/taco.cjs.development.js +1478 -1806
  366. package/dist/taco.cjs.development.js.map +1 -1
  367. package/dist/taco.cjs.production.min.js +1 -1
  368. package/dist/taco.cjs.production.min.js.map +1 -1
  369. package/package.json +2 -2
  370. package/plugins/tailwindcss-aria-attributes.js +73 -73
  371. package/tailwind.config.js +297 -297
@@ -3,18 +3,18 @@ import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
3
3
  import { useCurrentMenu } from '../Context.js';
4
4
  import { Trigger as Trigger$1 } from '@radix-ui/react-dropdown-menu';
5
5
 
6
- var Trigger = /*#__PURE__*/forwardRef(function MenuTrigger(props, ref) {
6
+ const Trigger = /*#__PURE__*/forwardRef(function MenuTrigger(props, ref) {
7
7
  var _props$children3, _props$children3$prop;
8
8
 
9
- var menu = useCurrentMenu();
10
- var internalRef = useProxiedRef(ref);
11
- useEffect(function () {
9
+ const menu = useCurrentMenu();
10
+ const internalRef = useProxiedRef(ref);
11
+ useEffect(() => {
12
12
  if (internalRef.current) {
13
13
  menu === null || menu === void 0 ? void 0 : menu.setMinWidth(internalRef.current.getBoundingClientRect().width);
14
14
  }
15
15
  }, [internalRef]); // set the appearance based on the trigger button
16
16
 
17
- useEffect(function () {
17
+ useEffect(() => {
18
18
  var _props$children, _props$children$props;
19
19
 
20
20
  if ((_props$children = props.children) !== null && _props$children !== void 0 && (_props$children$props = _props$children.props) !== null && _props$children$props !== void 0 && _props$children$props.appearance) {
@@ -1 +1 @@
1
- {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/Menu/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useCurrentMenu } from '../Context';\n\nexport type MenuTriggerProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'children'> & {\n children: React.ReactElement;\n};\n\nexport const Trigger = React.forwardRef(function MenuTrigger(props: MenuTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const menu = useCurrentMenu();\n const internalRef = useProxiedRef<HTMLButtonElement>(ref);\n\n React.useEffect(() => {\n if (internalRef.current) {\n menu?.setMinWidth(internalRef.current.getBoundingClientRect().width);\n }\n }, [internalRef]);\n\n // set the appearance based on the trigger button\n React.useEffect(() => {\n if (props.children?.props?.appearance) {\n menu?.setAppearance(props.children?.props?.appearance);\n }\n }, [props.children?.props?.appearance]);\n\n return <DropdownMenuPrimitive.Trigger {...props} asChild ref={internalRef} />;\n});\n"],"names":["Trigger","React","MenuTrigger","props","ref","menu","useCurrentMenu","internalRef","useProxiedRef","current","setMinWidth","getBoundingClientRect","width","children","appearance","setAppearance","DropdownMenuPrimitive","asChild"],"mappings":";;;;;IASaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;;;AACpC,MAAMC,IAAI,GAAGC,cAAc,EAA3B;AACA,MAAMC,WAAW,GAAGC,aAAa,CAAoBJ,GAApB,CAAjC;AAEAH,EAAAA,SAAA,CAAgB;AACZ,QAAIM,WAAW,CAACE,OAAhB,EAAyB;AACrBJ,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEK,WAAN,CAAkBH,WAAW,CAACE,OAAZ,CAAoBE,qBAApB,GAA4CC,KAA9D;AACH;AACJ,GAJD,EAIG,CAACL,WAAD,CAJH;;AAOAN,EAAAA,SAAA,CAAgB;;;AACZ,2BAAIE,KAAK,CAACU,QAAV,qEAAI,gBAAgBV,KAApB,kDAAI,sBAAuBW,UAA3B,EAAuC;AAAA;;AACnCT,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEU,aAAN,qBAAoBZ,KAAK,CAACU,QAA1B,8EAAoB,iBAAgBV,KAApC,0DAAoB,sBAAuBW,UAA3C;AACH;AACJ,GAJD,EAIG,qBAACX,KAAK,CAACU,QAAP,8EAAC,iBAAgBV,KAAjB,0DAAC,sBAAuBW,UAAxB,CAJH;AAMA,SAAOb,aAAA,CAACe,SAAD,oBAAmCb;AAAOc,IAAAA,OAAO;AAACb,IAAAA,GAAG,EAAEG;IAAvD,CAAP;AACH,CAlBsB;;;;"}
1
+ {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/Menu/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { useCurrentMenu } from '../Context';\r\n\r\nexport type MenuTriggerProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'children'> & {\r\n children: React.ReactElement;\r\n};\r\n\r\nexport const Trigger = React.forwardRef(function MenuTrigger(props: MenuTriggerProps, ref: React.Ref<HTMLButtonElement>) {\r\n const menu = useCurrentMenu();\r\n const internalRef = useProxiedRef<HTMLButtonElement>(ref);\r\n\r\n React.useEffect(() => {\r\n if (internalRef.current) {\r\n menu?.setMinWidth(internalRef.current.getBoundingClientRect().width);\r\n }\r\n }, [internalRef]);\r\n\r\n // set the appearance based on the trigger button\r\n React.useEffect(() => {\r\n if (props.children?.props?.appearance) {\r\n menu?.setAppearance(props.children?.props?.appearance);\r\n }\r\n }, [props.children?.props?.appearance]);\r\n\r\n return <DropdownMenuPrimitive.Trigger {...props} asChild ref={internalRef} />;\r\n});\r\n"],"names":["Trigger","React","MenuTrigger","props","ref","menu","useCurrentMenu","internalRef","useProxiedRef","current","setMinWidth","getBoundingClientRect","width","children","appearance","setAppearance","DropdownMenuPrimitive","asChild"],"mappings":";;;;;MASaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;;;AACpC,QAAMC,IAAI,GAAGC,cAAc,EAA3B;AACA,QAAMC,WAAW,GAAGC,aAAa,CAAoBJ,GAApB,CAAjC;AAEAH,EAAAA,SAAA,CAAgB;AACZ,QAAIM,WAAW,CAACE,OAAhB,EAAyB;AACrBJ,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEK,WAAN,CAAkBH,WAAW,CAACE,OAAZ,CAAoBE,qBAApB,GAA4CC,KAA9D;AACH;AACJ,GAJD,EAIG,CAACL,WAAD,CAJH;;AAOAN,EAAAA,SAAA,CAAgB;;;AACZ,2BAAIE,KAAK,CAACU,QAAV,qEAAI,gBAAgBV,KAApB,kDAAI,sBAAuBW,UAA3B,EAAuC;AAAA;;AACnCT,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEU,aAAN,qBAAoBZ,KAAK,CAACU,QAA1B,8EAAoB,iBAAgBV,KAApC,0DAAoB,sBAAuBW,UAA3C;AACH;AACJ,GAJD,EAIG,qBAACX,KAAK,CAACU,QAAP,8EAAC,iBAAgBV,KAAjB,0DAAC,sBAAuBW,UAAxB,CAJH;AAMA,SAAOb,aAAA,CAACe,SAAD,oBAAmCb;AAAOc,IAAAA,OAAO;AAACb,IAAAA,GAAG,EAAEG;IAAvD,CAAP;AACH,CAlBsB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.js","sources":["../../../../src/components/Navigation/Navigation.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { TreeviewProps, Treeview, TreeviewGroupProps, TreeviewItemProps } from '../Treeview/Treeview';\nimport { Icon } from '../Icon/Icon';\nimport { useDropTarget } from '../../utils/hooks/useDropTarget';\nimport './Navigation.css';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\n\n// Item\nexport type NavigationItemProps = Omit<TreeviewItemProps, 'prefix'> & {\n /** Change the style to indicate the link is selected */\n active?: boolean;\n /** Handler to be used when dropping a dragged element over the navigation link */\n onDrop?: React.DragEventHandler;\n /**\n * Small amount of information placed next to the text of the link.\n * This can be any valid react element, for e.g. a `span`.\n * Should be used to indicate a relevant information of the link,\n * for e.g. the number of unread notifications\n */\n postfix?: React.ReactNode;\n /**\n * Small amount of information placed before the text of the link.\n * This can be any valid react element, for e.g. a `span`.\n * Should be used to indicate a feedback for user,\n * for e.g. display some sort of visual informational state or a relevant icon.\n */\n prefix?: React.ReactNode;\n /** Target of the link */\n target?: string;\n};\n\nconst Item = React.forwardRef(function Item(props: NavigationItemProps, ref: React.Ref<HTMLAnchorElement>) {\n const { active, children, onDrop, postfix, prefix, role, ...otherProps } = props;\n const proxyRef = useProxiedRef<HTMLAnchorElement>(ref);\n const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);\n const isTreeitem = role === 'treeitem';\n const className = cn(\n 'yt-navigation__item cursor-pointer',\n {\n 'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,\n 'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,\n 'yt-navigation__item--active': active && !isDraggedOver,\n 'bg-grey-dark': isTreeitem && active && !isDraggedOver,\n 'yt-navigation__item--dropping bg-blue': isDraggedOver,\n },\n props.className\n );\n\n const handleClick = (event: React.MouseEvent<HTMLSpanElement>): void => {\n if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {\n return;\n }\n\n if (proxyRef.current) {\n proxyRef.current.click();\n }\n };\n\n return (\n <span {...dropTargetProps} className={className} onClick={handleClick} role={role}>\n {prefix && <span className=\"yt-navigation__item__prefix flex items-center\">{prefix}</span>}\n <a {...otherProps} className=\"block flex-grow truncate\" ref={proxyRef}>\n {children}\n </a>\n {postfix && <span className=\"yt-navigation__item__postfix ml-1\">{postfix}</span>}\n </span>\n );\n});\n\n// Panel\nexport type NavigationPanelProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst Panel = React.forwardRef(function Panel(props: NavigationPanelProps, ref: React.Ref<HTMLDivElement>) {\n return <div {...props} className={cn('w-full bg-white p-3', props.className)} ref={ref} />;\n});\n\n// Group\nexport type NavigationMenuGroupProps = TreeviewGroupProps;\n\nconst MenuGroup = React.forwardRef(function MenuGroup(props: NavigationMenuGroupProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n 'flex-shrink-0 space-y-1 outline-none',\n {\n 'bg-white pb-2': props.fixed,\n },\n props.className\n );\n const title = (expanded: boolean): JSX.Element => {\n const className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {\n 'mb-1': expanded,\n 'cursor-pointer hover:text-blue': !props.fixed,\n });\n\n return (\n <span className={className}>\n {typeof props.title === 'function' ? props.title(expanded) : props.title}\n {!props.fixed && <Icon name={expanded ? 'chevron-up' : 'chevron-down'} />}\n </span>\n );\n };\n\n return <Treeview.Group {...props} className={className} title={title} ref={ref} />;\n});\n\n// Menu\nexport type NavigationMenuProps = React.PropsWithChildren<TreeviewProps>;\n\nexport type ForwardedNavigationMenuWithStatics = React.ForwardRefExoticComponent<\n NavigationMenuProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Expandable region reprezenting a group of related links */\n Group: React.ForwardRefExoticComponent<NavigationMenuGroupProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nconst Menu = React.forwardRef(function Menu(props: NavigationMenuProps, ref: React.Ref<HTMLDivElement>) {\n const scrollableAreas = React.useMemo(() => {\n const scrollableAreas: any[] = [];\n\n React.Children.toArray(props.children)\n .filter(child => !!child)\n .map((child: React.ReactElement<NavigationMenuGroupProps>) => {\n if (child.props.fixed) {\n scrollableAreas.push(child);\n } else {\n const x = scrollableAreas[scrollableAreas.length - 1];\n if (Array.isArray(x)) {\n x.push(child);\n } else {\n scrollableAreas.push([child]);\n }\n }\n });\n\n return scrollableAreas;\n }, [props.children]);\n\n return (\n <Treeview\n {...props}\n className={cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className)}\n ref={ref}\n >\n {scrollableAreas.map((area, i) =>\n Array.isArray(area) ? (\n <div\n className=\"divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto\"\n key={i}\n >\n {area}\n </div>\n ) : (\n area\n )\n )}\n </Treeview>\n );\n}) as ForwardedNavigationMenuWithStatics;\n\nMenu.Group = MenuGroup;\n\n// Navigation\nexport type NavigationProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport type ForwardedNavigationWithStatics = React.ForwardRefExoticComponent<\n NavigationProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Navigation link */\n Item: React.ForwardRefExoticComponent<NavigationItemProps & React.RefAttributes<HTMLAnchorElement>>;\n /**\n * Container for the expandable groups that hold navigation links.\n * Should be used as a direct child of Navigation component, e.g. `Navigation.Menu`.\n * Should have the menu groups as a direct child, e.g. `Navigation.Menu.Group`\n */\n Menu: ForwardedNavigationMenuWithStatics;\n /**\n * Isolated container within the Navigation.\n * This can be used to create a region in the Navigation that is usually not scrollable, nor expandable,\n * containing useful information for user and quick actions\n */\n Panel: React.ForwardRefExoticComponent<NavigationPanelProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nexport const Navigation = React.forwardRef(function Navigation(props: NavigationProps, ref: React.Ref<HTMLDivElement>) {\n const { children, ...otherProps } = props;\n const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"navigation\" ref={ref}>\n {children}\n </div>\n );\n}) as ForwardedNavigationWithStatics;\n\nNavigation.Menu = Menu;\nNavigation.Item = Item;\nNavigation.Panel = Panel;\n"],"names":["Item","React","forwardRef","props","ref","active","children","onDrop","postfix","prefix","role","otherProps","proxyRef","useProxiedRef","useDropTarget","isDraggedOver","dropTargetProps","isTreeitem","className","cn","handleClick","event","target","HTMLAnchorElement","HTMLButtonElement","current","click","onClick","Panel","MenuGroup","fixed","title","expanded","Icon","name","Treeview","Group","Menu","scrollableAreas","useMemo","Children","toArray","filter","child","map","push","x","length","Array","isArray","area","i","key","Navigation"],"mappings":";;;;;;;;;;AAgCA,IAAMA,IAAI,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,IAAT,CAAcG,KAAd,EAA0CC,GAA1C;AAC1B,MAAQC,MAAR,GAA2EF,KAA3E,CAAQE,MAAR;AAAA,MAAgBC,QAAhB,GAA2EH,KAA3E,CAAgBG,QAAhB;AAAA,MAA0B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D,4BAAA,MAAA;AACIiB,MAAAA,SAAS,EAAC;AACVkC,MAAAA,GAAG,EAAED;KAFT,EAIKD,IAJL,CADJ,GAQIA,IATa;AAAA,GAApB,CALL,CADJ;AAoBH,CA1CY,CAAb;AA4CAb,IAAI,CAACD,KAAL,GAAaP,SAAb;IAwBawB,UAAU,gBAAGpD,cAAK,CAACC,UAAN,CAAiB,SAASmD,UAAT,CAAoBlD,KAApB,EAA4CC,GAA5C;AACvC,MAAQE,QAAR,GAAoCH,KAApC,CAAQG,QAAR;AAAA,MAAqBK,UAArB,iCAAoCR,KAApC;;AACA,MAAMe,SAAS,GAAGC,EAAE,CAAC,iEAAD,EAAoEhB,KAAK,CAACe,SAA1E,CAApB;AAEA,SACIjB,4BAAA,MAAA,oBAASU;AAAYO,IAAAA,SAAS,EAAEA;iBAAqB;AAAad,IAAAA,GAAG,EAAEA;IAAvE,EACKE,QADL,CADJ;AAKH,CATyB;AAW1B+C,UAAU,CAAChB,IAAX,GAAkBA,IAAlB;AACAgB,UAAU,CAACrD,IAAX,GAAkBA,IAAlB;AACAqD,UAAU,CAACzB,KAAX,GAAmBA,KAAnB;;;;"}
1
+ {"version":3,"file":"Navigation.js","sources":["../../../../src/components/Navigation/Navigation.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { TreeviewProps, Treeview, TreeviewGroupProps, TreeviewItemProps } from '../Treeview/Treeview';\r\nimport { Icon } from '../Icon/Icon';\r\nimport { useDropTarget } from '../../utils/hooks/useDropTarget';\r\nimport './Navigation.css';\r\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\r\n\r\n// Item\r\nexport type NavigationItemProps = Omit<TreeviewItemProps, 'prefix'> & {\r\n /** Change the style to indicate the link is selected */\r\n active?: boolean;\r\n /** Handler to be used when dropping a dragged element over the navigation link */\r\n onDrop?: React.DragEventHandler;\r\n /**\r\n * Small amount of information placed next to the text of the link.\r\n * This can be any valid react element, for e.g. a `span`.\r\n * Should be used to indicate a relevant information of the link,\r\n * for e.g. the number of unread notifications\r\n */\r\n postfix?: React.ReactNode;\r\n /**\r\n * Small amount of information placed before the text of the link.\r\n * This can be any valid react element, for e.g. a `span`.\r\n * Should be used to indicate a feedback for user,\r\n * for e.g. display some sort of visual informational state or a relevant icon.\r\n */\r\n prefix?: React.ReactNode;\r\n /** Target of the link */\r\n target?: string;\r\n};\r\n\r\nconst Item = React.forwardRef(function Item(props: NavigationItemProps, ref: React.Ref<HTMLAnchorElement>) {\r\n const { active, children, onDrop, postfix, prefix, role, ...otherProps } = props;\r\n const proxyRef = useProxiedRef<HTMLAnchorElement>(ref);\r\n const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);\r\n const isTreeitem = role === 'treeitem';\r\n const className = cn(\r\n 'yt-navigation__item cursor-pointer',\r\n {\r\n 'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,\r\n 'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,\r\n 'yt-navigation__item--active': active && !isDraggedOver,\r\n 'bg-grey-dark': isTreeitem && active && !isDraggedOver,\r\n 'yt-navigation__item--dropping bg-blue': isDraggedOver,\r\n },\r\n props.className\r\n );\r\n\r\n const handleClick = (event: React.MouseEvent<HTMLSpanElement>): void => {\r\n if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {\r\n return;\r\n }\r\n\r\n if (proxyRef.current) {\r\n proxyRef.current.click();\r\n }\r\n };\r\n\r\n return (\r\n <span {...dropTargetProps} className={className} onClick={handleClick} role={role}>\r\n {prefix && <span className=\"yt-navigation__item__prefix flex items-center\">{prefix}</span>}\r\n <a {...otherProps} className=\"block flex-grow truncate\" ref={proxyRef}>\r\n {children}\r\n </a>\r\n {postfix && <span className=\"yt-navigation__item__postfix ml-1\">{postfix}</span>}\r\n </span>\r\n );\r\n});\r\n\r\n// Panel\r\nexport type NavigationPanelProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nconst Panel = React.forwardRef(function Panel(props: NavigationPanelProps, ref: React.Ref<HTMLDivElement>) {\r\n return <div {...props} className={cn('w-full bg-white p-3', props.className)} ref={ref} />;\r\n});\r\n\r\n// Group\r\nexport type NavigationMenuGroupProps = TreeviewGroupProps;\r\n\r\nconst MenuGroup = React.forwardRef(function MenuGroup(props: NavigationMenuGroupProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn(\r\n 'flex-shrink-0 space-y-1 outline-none',\r\n {\r\n 'bg-white pb-2': props.fixed,\r\n },\r\n props.className\r\n );\r\n const title = (expanded: boolean): JSX.Element => {\r\n const className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {\r\n 'mb-1': expanded,\r\n 'cursor-pointer hover:text-blue': !props.fixed,\r\n });\r\n\r\n return (\r\n <span className={className}>\r\n {typeof props.title === 'function' ? props.title(expanded) : props.title}\r\n {!props.fixed && <Icon name={expanded ? 'chevron-up' : 'chevron-down'} />}\r\n </span>\r\n );\r\n };\r\n\r\n return <Treeview.Group {...props} className={className} title={title} ref={ref} />;\r\n});\r\n\r\n// Menu\r\nexport type NavigationMenuProps = React.PropsWithChildren<TreeviewProps>;\r\n\r\nexport type ForwardedNavigationMenuWithStatics = React.ForwardRefExoticComponent<\r\n NavigationMenuProps & React.RefAttributes<HTMLDivElement>\r\n> & {\r\n /** Expandable region reprezenting a group of related links */\r\n Group: React.ForwardRefExoticComponent<NavigationMenuGroupProps & React.RefAttributes<HTMLDivElement>>;\r\n};\r\n\r\nconst Menu = React.forwardRef(function Menu(props: NavigationMenuProps, ref: React.Ref<HTMLDivElement>) {\r\n const scrollableAreas = React.useMemo(() => {\r\n const scrollableAreas: any[] = [];\r\n\r\n React.Children.toArray(props.children)\r\n .filter(child => !!child)\r\n .map((child: React.ReactElement<NavigationMenuGroupProps>) => {\r\n if (child.props.fixed) {\r\n scrollableAreas.push(child);\r\n } else {\r\n const x = scrollableAreas[scrollableAreas.length - 1];\r\n if (Array.isArray(x)) {\r\n x.push(child);\r\n } else {\r\n scrollableAreas.push([child]);\r\n }\r\n }\r\n });\r\n\r\n return scrollableAreas;\r\n }, [props.children]);\r\n\r\n return (\r\n <Treeview\r\n {...props}\r\n className={cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className)}\r\n ref={ref}\r\n >\r\n {scrollableAreas.map((area, i) =>\r\n Array.isArray(area) ? (\r\n <div\r\n className=\"divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto\"\r\n key={i}\r\n >\r\n {area}\r\n </div>\r\n ) : (\r\n area\r\n )\r\n )}\r\n </Treeview>\r\n );\r\n}) as ForwardedNavigationMenuWithStatics;\r\n\r\nMenu.Group = MenuGroup;\r\n\r\n// Navigation\r\nexport type NavigationProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nexport type ForwardedNavigationWithStatics = React.ForwardRefExoticComponent<\r\n NavigationProps & React.RefAttributes<HTMLDivElement>\r\n> & {\r\n /** Navigation link */\r\n Item: React.ForwardRefExoticComponent<NavigationItemProps & React.RefAttributes<HTMLAnchorElement>>;\r\n /**\r\n * Container for the expandable groups that hold navigation links.\r\n * Should be used as a direct child of Navigation component, e.g. `Navigation.Menu`.\r\n * Should have the menu groups as a direct child, e.g. `Navigation.Menu.Group`\r\n */\r\n Menu: ForwardedNavigationMenuWithStatics;\r\n /**\r\n * Isolated container within the Navigation.\r\n * This can be used to create a region in the Navigation that is usually not scrollable, nor expandable,\r\n * containing useful information for user and quick actions\r\n */\r\n Panel: React.ForwardRefExoticComponent<NavigationPanelProps & React.RefAttributes<HTMLDivElement>>;\r\n};\r\n\r\nexport const Navigation = React.forwardRef(function Navigation(props: NavigationProps, ref: React.Ref<HTMLDivElement>) {\r\n const { children, ...otherProps } = props;\r\n const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);\r\n\r\n return (\r\n <div {...otherProps} className={className} data-taco=\"navigation\" ref={ref}>\r\n {children}\r\n </div>\r\n );\r\n}) as ForwardedNavigationWithStatics;\r\n\r\nNavigation.Menu = Menu;\r\nNavigation.Item = Item;\r\nNavigation.Panel = Panel;\r\n"],"names":["Item","React","forwardRef","props","ref","active","children","onDrop","postfix","prefix","role","otherProps","proxyRef","useProxiedRef","useDropTarget","isDraggedOver","dropTargetProps","isTreeitem","className","cn","handleClick","event","target","HTMLAnchorElement","HTMLButtonElement","current","click","onClick","Panel","MenuGroup","fixed","title","expanded","Icon","name","Treeview","Group","Menu","scrollableAreas","useMemo","Children","toArray","filter","child","map","push","x","length","Array","isArray","area","i","key","Navigation"],"mappings":";;;;;;;;;;AAgCA,IAAMA,IAAI,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,IAAT,CAAcG,KAAd,EAA0CC,GAA1C;AAC1B,MAAQC,MAAR,GAA2EF,KAA3E,CAAQE,MAAR;AAAA,MAAgBC,QAAhB,GAA2EH,KAA3E,CAAgBG,QAAhB;AAAA,MAA0BC,MAA1B,GAA2EJ,KAA3E,CAA0BI,MAA1B;AAAA,MAAkCC,OAAlC,GAA2EL,KAA3E,CAAkCK,OAAlC;AAAA,MAA2CC,MAA3C,GAA2EN,KAA3E,CAA2CM,MAA3C;AAAA,MAAmDC,IAAnD,GAA2EP,KAA3E,CAAmDO,IAAnD;AAAA,MAA4DC,UAA5D,iCAA2ER,KAA3E;;AACA,MAAMS,QAAQ,GAAGC,aAAa,CAAoBT,GAApB,CAA9B;;AACA,uBAAyCU,aAAa,CAACP,MAAD,CAAtD;AAAA,MAAOQ,aAAP;AAAA,MAAsBC,eAAtB;;AACA,MAAMC,UAAU,GAAGP,IAAI,KAAK,UAA5B;AACA,MAAMQ,SAAS,GAAGC,EAAE,CAChB,oCADgB,EAEhB;AACI,mEAA+DF,UADnE;AAEI,gGAA4F,CAACA,UAFjG;AAGI,mCAA+BZ,MAAM,IAAI,CAACU,aAH9C;AAII,oBAAgBE,UAAU,IAAIZ,MAAd,IAAwB,CAACU,aAJ7C;AAKI,6CAAyCA;AAL7C,GA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,GAAkBA,IAAlB;AACAqD,UAAU,CAACzB,KAAX,GAAmBA,KAAnB;;;;"}
@@ -2,11 +2,11 @@ import { createElement, Fragment } from 'react';
2
2
  import { Button } from '../Button/Button.js';
3
3
  import { useLocalization } from '../Provider/Provider.js';
4
4
 
5
- var createPageRange = function createPageRange(pageCount, pageNumber) {
6
- var lowerLimit = Math.min(pageNumber, pageCount);
7
- var upperLimit = Math.min(pageNumber, pageCount);
5
+ const createPageRange = (pageCount, pageNumber) => {
6
+ let lowerLimit = Math.min(pageNumber, pageCount);
7
+ let upperLimit = Math.min(pageNumber, pageCount);
8
8
 
9
- for (var b = 1; b < 5 && b < pageCount;) {
9
+ for (let b = 1; b < 5 && b < pageCount;) {
10
10
  if (lowerLimit > 1) {
11
11
  lowerLimit--;
12
12
  b++;
@@ -18,37 +18,32 @@ var createPageRange = function createPageRange(pageCount, pageNumber) {
18
18
  }
19
19
  }
20
20
 
21
- var range = [];
21
+ const range = [];
22
22
 
23
- for (var i = lowerLimit; i <= upperLimit; i++) {
23
+ for (let i = lowerLimit; i <= upperLimit; i++) {
24
24
  range.push(i);
25
25
  }
26
26
 
27
27
  return range;
28
28
  };
29
29
 
30
- var PageNumbers = function PageNumbers(_ref) {
31
- var _ref$currentPageIndex = _ref.currentPageIndex,
32
- currentPageIndex = _ref$currentPageIndex === void 0 ? 0 : _ref$currentPageIndex,
33
- handleClick = _ref.onClick,
34
- pageCount = _ref.pageCount;
35
- var range = createPageRange(pageCount, currentPageIndex + 1);
36
-
37
- var _useLocalization = useLocalization(),
38
- texts = _useLocalization.texts;
39
-
40
- return createElement(Fragment, null, range.map(function (pageNumber) {
41
- return createElement(Button, {
42
- appearance: pageNumber === currentPageIndex + 1 ? 'primary' : 'default',
43
- "aria-current": pageNumber === currentPageIndex + 1 ? 'page' : undefined,
44
- key: pageNumber,
45
- onClick: function onClick() {
46
- return handleClick(pageNumber - 1);
47
- },
48
- "aria-label": texts.pagination.actions.pageX.replace('[X]', String(pageNumber)),
49
- tooltip: texts.pagination.actions.pageX.replace('[X]', String(pageNumber))
50
- }, pageNumber);
51
- }));
30
+ const PageNumbers = ({
31
+ currentPageIndex = 0,
32
+ onClick: handleClick,
33
+ pageCount
34
+ }) => {
35
+ const range = createPageRange(pageCount, currentPageIndex + 1);
36
+ const {
37
+ texts
38
+ } = useLocalization();
39
+ return createElement(Fragment, null, range.map(pageNumber => createElement(Button, {
40
+ appearance: pageNumber === currentPageIndex + 1 ? 'primary' : 'default',
41
+ "aria-current": pageNumber === currentPageIndex + 1 ? 'page' : undefined,
42
+ key: pageNumber,
43
+ onClick: () => handleClick(pageNumber - 1),
44
+ "aria-label": texts.pagination.actions.pageX.replace('[X]', String(pageNumber)),
45
+ tooltip: texts.pagination.actions.pageX.replace('[X]', String(pageNumber))
46
+ }, pageNumber)));
52
47
  };
53
48
 
54
49
  export { PageNumbers };
@@ -1 +1 @@
1
- {"version":3,"file":"PageNumbers.js","sources":["../../../../src/components/Pagination/PageNumbers.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Button } from '../Button/Button';\nimport { useLocalization } from '../Provider/Provider';\n\ntype PageNumberProps = {\n currentPageIndex: number;\n onClick: (pageIndex: number) => void;\n pageCount: number;\n};\n\nconst createPageRange = (pageCount: number, pageNumber: number): number[] => {\n let lowerLimit = Math.min(pageNumber, pageCount);\n let upperLimit = Math.min(pageNumber, pageCount);\n\n for (let b = 1; b < 5 && b < pageCount; ) {\n if (lowerLimit > 1) {\n lowerLimit--;\n b++;\n }\n if (b < 5 && upperLimit < pageCount) {\n upperLimit++;\n b++;\n }\n }\n\n const range: number[] = [];\n\n for (let i = lowerLimit; i <= upperLimit; i++) {\n range.push(i);\n }\n\n return range;\n};\n\nexport const PageNumbers = ({ currentPageIndex = 0, onClick: handleClick, pageCount }: PageNumberProps): JSX.Element => {\n const range = createPageRange(pageCount, currentPageIndex + 1);\n const { texts } = useLocalization();\n\n return (\n <>\n {range.map((pageNumber: number) => (\n <Button\n appearance={pageNumber === currentPageIndex + 1 ? 'primary' : 'default'}\n aria-current={pageNumber === currentPageIndex + 1 ? 'page' : undefined}\n key={pageNumber}\n onClick={() => handleClick(pageNumber - 1)}\n aria-label={texts.pagination.actions.pageX.replace('[X]', String(pageNumber))}\n tooltip={texts.pagination.actions.pageX.replace('[X]', String(pageNumber))}\n >\n {pageNumber}\n </Button>\n ))}\n </>\n );\n};\n"],"names":["createPageRange","pageCount","pageNumber","lowerLimit","Math","min","upperLimit","b","range","i","push","PageNumbers","currentPageIndex","handleClick","onClick","useLocalization","texts","React","map","Button","appearance","undefined","key","pagination","actions","pageX","replace","String","tooltip"],"mappings":";;;;AAUA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,SAAD,EAAoBC,UAApB;AACpB,MAAIC,UAAU,GAAGC,IAAI,CAACC,GAAL,CAASH,UAAT,EAAqBD,SAArB,CAAjB;AACA,MAAIK,UAAU,GAAGF,IAAI,CAACC,GAAL,CAASH,UAAT,EAAqBD,SAArB,CAAjB;;AAEA,OAAK,IAAIM,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,CAAJ,IAASA,CAAC,GAAGN,SAA7B,GAA0C;AACtC,QAAIE,UAAU,GAAG,CAAjB,EAAoB;AAChBA,MAAAA,UAAU;AACVI,MAAAA,CAAC;AACJ;;AACD,QAAIA,CAAC,GAAG,CAAJ,IAASD,UAAU,GAAGL,SAA1B,EAAqC;AACjCK,MAAAA,UAAU;AACVC,MAAAA,CAAC;AACJ;AACJ;;AAED,MAAMC,KAAK,GAAa,EAAxB;;AAEA,OAAK,IAAIC,CAAC,GAAGN,UAAb,EAAyBM,CAAC,IAAIH,UAA9B,EAA0CG,CAAC,EAA3C,EAA+C;AAC3CD,IAAAA,KAAK,CAACE,IAAN,CAAWD,CAAX;AACH;;AAED,SAAOD,KAAP;AACH,CAtBD;;IAwBaG,WAAW,GAAG,SAAdA,WAAc;mCAAGC;MAAAA,sDAAmB;MAAYC,mBAATC;MAAsBb,iBAAAA;AACtE,MAAMO,KAAK,GAAGR,eAAe,CAACC,SAAD,EAAYW,gBAAgB,GAAG,CAA/B,CAA7B;;AACA,yBAAkBG,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AAEA,SACIC,aAAA,SAAA,MAAA,EACKT,KAAK,CAACU,GAAN,CAAU,UAAChB,UAAD;AAAA,WACPe,aAAA,CAACE,MAAD;AACIC,MAAAA,UAAU,EAAElB,UAAU,KAAKU,gBAAgB,GAAG,CAAlC,GAAsC,SAAtC,GAAkD;sBAChDV,UAAU,KAAKU,gBAAgB,GAAG,CAAlC,GAAsC,MAAtC,GAA+CS;AAC7DC,MAAAA,GAAG,EAAEpB;AACLY,MAAAA,OAAO,EAAE;AAAA,eAAMD,WAAW,CAACX,UAAU,GAAG,CAAd,CAAjB;AAAA;oBACGc,KAAK,CAACO,UAAN,CAAiBC,OAAjB,CAAyBC,KAAzB,CAA+BC,OAA/B,CAAuC,KAAvC,EAA8CC,MAAM,CAACzB,UAAD,CAApD;AACZ0B,MAAAA,OAAO,EAAEZ,KAAK,CAACO,UAAN,CAAiBC,OAAjB,CAAyBC,KAAzB,CAA+BC,OAA/B,CAAuC,KAAvC,EAA8CC,MAAM,CAACzB,UAAD,CAApD;KANb,EAQKA,UARL,CADO;AAAA,GAAV,CADL,CADJ;AAgBH;;;;"}
1
+ {"version":3,"file":"PageNumbers.js","sources":["../../../../src/components/Pagination/PageNumbers.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { Button } from '../Button/Button';\r\nimport { useLocalization } from '../Provider/Provider';\r\n\r\ntype PageNumberProps = {\r\n currentPageIndex: number;\r\n onClick: (pageIndex: number) => void;\r\n pageCount: number;\r\n};\r\n\r\nconst createPageRange = (pageCount: number, pageNumber: number): number[] => {\r\n let lowerLimit = Math.min(pageNumber, pageCount);\r\n let upperLimit = Math.min(pageNumber, pageCount);\r\n\r\n for (let b = 1; b < 5 && b < pageCount; ) {\r\n if (lowerLimit > 1) {\r\n lowerLimit--;\r\n b++;\r\n }\r\n if (b < 5 && upperLimit < pageCount) {\r\n upperLimit++;\r\n b++;\r\n }\r\n }\r\n\r\n const range: number[] = [];\r\n\r\n for (let i = lowerLimit; i <= upperLimit; i++) {\r\n range.push(i);\r\n }\r\n\r\n return range;\r\n};\r\n\r\nexport const PageNumbers = ({ currentPageIndex = 0, onClick: handleClick, pageCount }: PageNumberProps): JSX.Element => {\r\n const range = createPageRange(pageCount, currentPageIndex + 1);\r\n const { texts } = useLocalization();\r\n\r\n return (\r\n <>\r\n {range.map((pageNumber: number) => (\r\n <Button\r\n appearance={pageNumber === currentPageIndex + 1 ? 'primary' : 'default'}\r\n aria-current={pageNumber === currentPageIndex + 1 ? 'page' : undefined}\r\n key={pageNumber}\r\n onClick={() => handleClick(pageNumber - 1)}\r\n aria-label={texts.pagination.actions.pageX.replace('[X]', String(pageNumber))}\r\n tooltip={texts.pagination.actions.pageX.replace('[X]', String(pageNumber))}\r\n >\r\n {pageNumber}\r\n </Button>\r\n ))}\r\n </>\r\n );\r\n};\r\n"],"names":["createPageRange","pageCount","pageNumber","lowerLimit","Math","min","upperLimit","b","range","i","push","PageNumbers","currentPageIndex","onClick","handleClick","texts","useLocalization","React","map","Button","appearance","undefined","key","pagination","actions","pageX","replace","String","tooltip"],"mappings":";;;;AAUA,MAAMA,eAAe,GAAG,CAACC,SAAD,EAAoBC,UAApB;AACpB,MAAIC,UAAU,GAAGC,IAAI,CAACC,GAAL,CAASH,UAAT,EAAqBD,SAArB,CAAjB;AACA,MAAIK,UAAU,GAAGF,IAAI,CAACC,GAAL,CAASH,UAAT,EAAqBD,SAArB,CAAjB;;AAEA,OAAK,IAAIM,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,CAAJ,IAASA,CAAC,GAAGN,SAA7B,GAA0C;AACtC,QAAIE,UAAU,GAAG,CAAjB,EAAoB;AAChBA,MAAAA,UAAU;AACVI,MAAAA,CAAC;AACJ;;AACD,QAAIA,CAAC,GAAG,CAAJ,IAASD,UAAU,GAA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["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { PageNumbers } from './PageNumbers';\nimport { LocalizationTexts, useLocalization } from '../Provider/Provider';\nimport { Select } from '../Select/Select';\nimport { Group } from '../Group/Group';\nimport { IconButton } from '../IconButton/IconButton';\nimport { usePaginationValues } from './usePagination';\nimport { usePaginationShortcuts } from './usePaginationShortcuts';\n\nexport * from './usePagination';\n\nexport type PaginationTextsActions = {\n /**\n * Aria-label for first page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n firstPage: string;\n /**\n * Aria-label for first page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n firstPageWithShortcut: string;\n /**\n * Aria-label for next page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n nextPage: string;\n /**\n * Aria-label for next page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n nextPageWithShortcut: string;\n /**\n * Aria-label for previous page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n previousPage: string;\n /**\n * Aria-label for previous page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n previousPageWithShortcut: string;\n /**\n * Aria-label for last page action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n lastPage: string;\n /**\n * Aria-label for last page action button with shortcut.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n lastPageWithShortcut: string;\n /**\n * Aria-label for page X action button.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n pageX: string;\n};\n\nexport type PaginationTexts = {\n /**\n * Aria-label provided for page numbers and page actions group.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n label: string;\n /**\n * Aria-label provided for page size selection.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n pageSize: string;\n /**\n * Text that indicates the number of the first and last element displayed on the current page, out of total items\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n showingXofYofTotal: string;\n /**\n * Aria-labels provided for page action buttons.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n actions: PaginationTextsActions;\n};\n\nexport type PaginationProps = React.HTMLAttributes<HTMLDivElement> &\n usePaginationValues & {\n /** Indicate total number of items that will be paginated */\n length: number;\n /** Page size options */\n pageSizes?: number[];\n /** Shows page controls */\n showPageControls?: boolean;\n /** Shows page numbers between navigation buttons, which allows users to quickly navigate to a specific page */\n showPageNumbers?: boolean;\n /** Shows a dropdown with page sizes, which allows user to change the number of items displayed on the page */\n showPageSize?: boolean;\n /** Enable pagination shortcuts */\n dangerouslyHijackGlobalKeyboardNavigation?: boolean;\n };\n\nconst getShowingLabel = (length: number, pageIndex: number, pageSize: number, texts: LocalizationTexts): string => {\n const minItemIndex = pageIndex * pageSize + 1;\n const maxItemIndex = (pageIndex + 1) * pageSize;\n\n return texts.pagination.showingXofYofTotal\n .replace('[X]', length === 0 ? '0' : String(minItemIndex))\n .replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex))\n .replace('[total]', String(length));\n};\n\nexport const Pagination = React.forwardRef(function Pagination(props: PaginationProps, ref: React.Ref<HTMLDivElement>) {\n const {\n length,\n pageIndex,\n pageSize,\n pageSizes = [10, 25, 50, 100, 500],\n setPageIndex,\n setPageSize,\n showPageControls = true,\n showPageNumbers = true,\n showPageSize = true,\n dangerouslyHijackGlobalKeyboardNavigation = false,\n ...otherProps\n } = props;\n const { texts } = useLocalization();\n\n const maxPageIndex = Math.ceil(length / pageSize) - 1;\n const showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;\n\n usePaginationShortcuts({\n setPageIndex,\n maxPageIndex,\n pageIndex,\n dangerouslyHijackGlobalKeyboardNavigation,\n });\n\n const pageCount = Math.ceil(length / pageSize);\n const canPreviousPage = pageIndex > 0;\n const canNextPage = pageIndex < pageCount - 1;\n\n const className = cn('inline-flex relative justify-between items-center', props.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"pagination\" ref={ref}>\n {showPageSize && (\n <span className=\"mr-4\">\n {getShowingLabel(length, pageIndex, pageSize, texts)}\n <Select\n aria-label={texts.pagination.pageSize}\n className=\"ml-4 !w-20\"\n data={pageSizes.map(pageSize => ({\n text: String(pageSize),\n value: pageSize,\n }))}\n onChange={event => {\n setPageIndex(0);\n setPageSize(Number(event.target.value));\n }}\n value={pageSize}\n />\n </span>\n )}\n {showPageControls && (\n <Group as=\"nav\" aria-label={texts.pagination.label}>\n <IconButton\n appearance=\"default\"\n disabled={!canPreviousPage}\n icon=\"arrow-start\"\n onClick={() => setPageIndex(0)}\n aria-label={\n showShortcutTexts\n ? texts.pagination.actions.firstPageWithShortcut\n : texts.pagination.actions.firstPage\n }\n tooltip={\n showShortcutTexts\n ? texts.pagination.actions.firstPageWithShortcut\n : texts.pagination.actions.firstPage\n }\n />\n <IconButton\n appearance=\"default\"\n disabled={!canPreviousPage}\n icon=\"arrow-left\"\n onClick={() => setPageIndex(pageIndex - 1)}\n aria-label={\n showShortcutTexts\n ? texts.pagination.actions.previousPageWithShortcut\n : texts.pagination.actions.previousPage\n }\n tooltip={\n showShortcutTexts\n ? texts.pagination.actions.previousPageWithShortcut\n : texts.pagination.actions.previousPage\n }\n />\n {showPageNumbers && pageCount > 0 && (\n <PageNumbers pageCount={pageCount} currentPageIndex={pageIndex} onClick={setPageIndex} />\n )}\n <IconButton\n appearance=\"default\"\n disabled={!canNextPage}\n icon=\"arrow-right\"\n onClick={() => setPageIndex(pageIndex + 1)}\n aria-label={\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\n }\n tooltip={\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\n }\n />\n <IconButton\n appearance=\"default\"\n disabled={!canNextPage}\n icon=\"arrow-end\"\n onClick={() => setPageIndex(pageCount - 1)}\n aria-label={\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\n }\n tooltip={\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\n }\n />\n </Group>\n )}\n </div>\n );\n});\n"],"names":["getShowingLabel","length","pageIndex","pageSize","texts","minItemIndex","maxItemIndex","pagination","showingXofYofTotal","replace","String","Pagination","React","props","ref","pageSizes","setPageIndex","setPageSize","showPageControls","showPageNumbers","showPageSize","dangerouslyHijackGlobalKeyboardNavigation","otherProps","useLocalization","maxPageIndex","Math","ceil","showShortcutTexts","usePaginationShortcuts","pageCount","canPreviousPage","canNextPage","className","cn","Select","data","map","text","value","onChange","event","Number","target","Group","as","label","IconButton","appearance","disabled","icon","onClick","actions","firstPageWithShortcut","firstPage","tooltip","previousPageWithShortcut","previousPage","PageNumbers","currentPageIndex","nextPageWithShortcut","nextPage","lastPageWithShortcut","lastPage"],"mappings":";;;;;;;;;;;;;AAmGA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,MAAD,EAAiBC,SAAjB,EAAoCC,QAApC,EAAsDC,KAAtD;AACpB,MAAMC,YAAY,GAAGH,SAAS,GAAGC,QAAZ,GAAuB,CAA5C;AACA,MAAMG,YAAY,GAAG,CAACJ,SAAS,GAAG,CAAb,IAAkBC,QAAvC;AAEA,SAAOC,KAAK,CAACG,UAAN,CAAiBC,kBAAjB,CACFC,OADE,CACM,KADN,EACaR,MAAM,KAAK,CAAX,GAAe,GAAf,GAAqBS,MAAM,CAACL,YAAD,CADxC,EAEFI,OAFE,CAEM,KAFN,EAEaC,MAAM,CAACJ,YAAY,GAAGL,MAAf,GAAwBA,MAAxB,GAAiCK,YAAlC,CAFnB,EAGFG,OAHE,CAGM,SAHN,EAGiBC,MAAM,CAACT,MAAD,CAHvB,CAAP;AAIH,CARD;;IAUaU,UAAU,gBAAGC,UAAA,CAAiB,SAASD,UAAT,CAAoBE,KAApB,EAA4CC,GAA5C;AACvC,MACIb,MADJ,GAYIY,KAZJ,CACIZ,MADJ;AAAA,MAEIC,SAFJ,GAYIW,KAZJ,CAEIX,SAFJ;AAAA,MAGIC,QAHJ,GAYIU,KAZJ,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gDIhD,aAAA,CAACkC,UAAD;AACIC,IAAAA,UAAU,EAAC;AACXC,IAAAA,QAAQ,EAAE,CAACjB;AACXkB,IAAAA,IAAI,EAAC;AACLC,IAAAA,OAAO,EAAE;AAAA,aAAMlC,YAAY,CAACa,SAAS,GAAG,CAAb,CAAlB;AAAA;kBAELF,iBAAiB,GAAGvB,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBU,oBAA5B,GAAmDzD,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBW;AAEjGR,IAAAA,OAAO,EACH3B,iBAAiB,GAAGvB,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBU,oBAA5B,GAAmDzD,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBW;GATrG,CAhDJ,CApBR,CADJ;AAqFH,CArHyB;;;;"}
1
+ {"version":3,"file":"Pagination.js","sources":["../../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport { PageNumbers } from './PageNumbers';\r\nimport { LocalizationTexts, useLocalization } from '../Provider/Provider';\r\nimport { Select } from '../Select/Select';\r\nimport { Group } from '../Group/Group';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport { usePaginationValues } from './usePagination';\r\nimport { usePaginationShortcuts } from './usePaginationShortcuts';\r\n\r\nexport * from './usePagination';\r\n\r\nexport type PaginationTextsActions = {\r\n /**\r\n * Aria-label for first page action button.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n firstPage: string;\r\n /**\r\n * Aria-label for first page action button with shortcut.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n firstPageWithShortcut: string;\r\n /**\r\n * Aria-label for next page action button.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n nextPage: string;\r\n /**\r\n * Aria-label for next page action button with shortcut.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n nextPageWithShortcut: string;\r\n /**\r\n * Aria-label for previous page action button.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n previousPage: string;\r\n /**\r\n * Aria-label for previous page action button with shortcut.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n previousPageWithShortcut: string;\r\n /**\r\n * Aria-label for last page action button.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n lastPage: string;\r\n /**\r\n * Aria-label for last page action button with shortcut.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n lastPageWithShortcut: string;\r\n /**\r\n * Aria-label for page X action button.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n pageX: string;\r\n};\r\n\r\nexport type PaginationTexts = {\r\n /**\r\n * Aria-label provided for page numbers and page actions group.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n label: string;\r\n /**\r\n * Aria-label provided for page size selection.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n pageSize: string;\r\n /**\r\n * Text that indicates the number of the first and last element displayed on the current page, out of total items\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n showingXofYofTotal: string;\r\n /**\r\n * Aria-labels provided for page action buttons.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n actions: PaginationTextsActions;\r\n};\r\n\r\nexport type PaginationProps = React.HTMLAttributes<HTMLDivElement> &\r\n usePaginationValues & {\r\n /** Indicate total number of items that will be paginated */\r\n length: number;\r\n /** Page size options */\r\n pageSizes?: number[];\r\n /** Shows page controls */\r\n showPageControls?: boolean;\r\n /** Shows page numbers between navigation buttons, which allows users to quickly navigate to a specific page */\r\n showPageNumbers?: boolean;\r\n /** Shows a dropdown with page sizes, which allows user to change the number of items displayed on the page */\r\n showPageSize?: boolean;\r\n /** Enable pagination shortcuts */\r\n dangerouslyHijackGlobalKeyboardNavigation?: boolean;\r\n };\r\n\r\nconst getShowingLabel = (length: number, pageIndex: number, pageSize: number, texts: LocalizationTexts): string => {\r\n const minItemIndex = pageIndex * pageSize + 1;\r\n const maxItemIndex = (pageIndex + 1) * pageSize;\r\n\r\n return texts.pagination.showingXofYofTotal\r\n .replace('[X]', length === 0 ? '0' : String(minItemIndex))\r\n .replace('[Y]', String(maxItemIndex > length ? length : maxItemIndex))\r\n .replace('[total]', String(length));\r\n};\r\n\r\nexport const Pagination = React.forwardRef(function Pagination(props: PaginationProps, ref: React.Ref<HTMLDivElement>) {\r\n const {\r\n length,\r\n pageIndex,\r\n pageSize,\r\n pageSizes = [10, 25, 50, 100, 500],\r\n setPageIndex,\r\n setPageSize,\r\n showPageControls = true,\r\n showPageNumbers = true,\r\n showPageSize = true,\r\n dangerouslyHijackGlobalKeyboardNavigation = false,\r\n ...otherProps\r\n } = props;\r\n const { texts } = useLocalization();\r\n\r\n const maxPageIndex = Math.ceil(length / pageSize) - 1;\r\n const showShortcutTexts = dangerouslyHijackGlobalKeyboardNavigation;\r\n\r\n usePaginationShortcuts({\r\n setPageIndex,\r\n maxPageIndex,\r\n pageIndex,\r\n dangerouslyHijackGlobalKeyboardNavigation,\r\n });\r\n\r\n const pageCount = Math.ceil(length / pageSize);\r\n const canPreviousPage = pageIndex > 0;\r\n const canNextPage = pageIndex < pageCount - 1;\r\n\r\n const className = cn('inline-flex relative justify-between items-center', props.className);\r\n\r\n return (\r\n <div {...otherProps} className={className} data-taco=\"pagination\" ref={ref}>\r\n {showPageSize && (\r\n <span className=\"mr-4\">\r\n {getShowingLabel(length, pageIndex, pageSize, texts)}\r\n <Select\r\n aria-label={texts.pagination.pageSize}\r\n className=\"ml-4 !w-20\"\r\n data={pageSizes.map(pageSize => ({\r\n text: String(pageSize),\r\n value: pageSize,\r\n }))}\r\n onChange={event => {\r\n setPageIndex(0);\r\n setPageSize(Number(event.target.value));\r\n }}\r\n value={pageSize}\r\n />\r\n </span>\r\n )}\r\n {showPageControls && (\r\n <Group as=\"nav\" aria-label={texts.pagination.label}>\r\n <IconButton\r\n appearance=\"default\"\r\n disabled={!canPreviousPage}\r\n icon=\"arrow-start\"\r\n onClick={() => setPageIndex(0)}\r\n aria-label={\r\n showShortcutTexts\r\n ? texts.pagination.actions.firstPageWithShortcut\r\n : texts.pagination.actions.firstPage\r\n }\r\n tooltip={\r\n showShortcutTexts\r\n ? texts.pagination.actions.firstPageWithShortcut\r\n : texts.pagination.actions.firstPage\r\n }\r\n />\r\n <IconButton\r\n appearance=\"default\"\r\n disabled={!canPreviousPage}\r\n icon=\"arrow-left\"\r\n onClick={() => setPageIndex(pageIndex - 1)}\r\n aria-label={\r\n showShortcutTexts\r\n ? texts.pagination.actions.previousPageWithShortcut\r\n : texts.pagination.actions.previousPage\r\n }\r\n tooltip={\r\n showShortcutTexts\r\n ? texts.pagination.actions.previousPageWithShortcut\r\n : texts.pagination.actions.previousPage\r\n }\r\n />\r\n {showPageNumbers && pageCount > 0 && (\r\n <PageNumbers pageCount={pageCount} currentPageIndex={pageIndex} onClick={setPageIndex} />\r\n )}\r\n <IconButton\r\n appearance=\"default\"\r\n disabled={!canNextPage}\r\n icon=\"arrow-right\"\r\n onClick={() => setPageIndex(pageIndex + 1)}\r\n aria-label={\r\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\r\n }\r\n tooltip={\r\n showShortcutTexts ? texts.pagination.actions.nextPageWithShortcut : texts.pagination.actions.nextPage\r\n }\r\n />\r\n <IconButton\r\n appearance=\"default\"\r\n disabled={!canNextPage}\r\n icon=\"arrow-end\"\r\n onClick={() => setPageIndex(pageCount - 1)}\r\n aria-label={\r\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\r\n }\r\n tooltip={\r\n showShortcutTexts ? texts.pagination.actions.lastPageWithShortcut : texts.pagination.actions.lastPage\r\n }\r\n />\r\n </Group>\r\n )}\r\n </div>\r\n );\r\n});\r\n"],"names":["getShowingLabel","length","pageIndex","pageSize","texts","minItemIndex","maxItemIndex","pagination","showingXofYofTotal","replace","String","Pagination","React","props","ref","pageSizes","setPageIndex","setPageSize","showPageControls","showPageNumbers","showPageSize","dangerouslyHijackGlobalKeyboardNavigation","otherProps","useLocalization","maxPageIndex","Math","ceil","showShortcutTexts","usePaginationShortcuts","pageCount","canPreviousPage","canNextPage","className","cn","Select","data","map","text","value","onChange","event","Number","target","Group","as","label","IconButton","appearance","disabled","icon","onClick","actions","firstPageWithShortcut","firstPage","tooltip","previousPageWithShortcut","previousPage","PageNumbers","currentPageIndex","nextPageWithShortcut","nextPage","lastPageWithShortcut","lastPage"],"mappings":";;;;;;;;;;;;;AAmGA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,MAAD,EAAiBC,SAAjB,EAAoCC,QAApC,EAAsDC,KAAtD;AACpB,MAAMC,YAAY,GAAGH,SAAS,GAAGC,QAAZ,GAAuB,CAA5C;AACA,MAAMG,YAAY,GAAG,CAACJ,SAAS,GAAG,CAAb,IAAkBC,QAAvC;AAEA,SAAOC,KAAK,CAACG,UAAN,CAAiBC,kBAAjB,CACFC,OADE,CACM,KADN,EACaR,MAAM,KAAK,CAAX,GAAe,GAAf,GAAqBS,MAAM,CAACL,YAAD,CADxC,EAEFI,OAFE,CAEM,KAFN,EAEaC,MAAM,CAACJ,YAAY,GAAGL,MAAf,GAAwBA,MAAxB,GAAiCK,YAAlC,CAFnB,EAGFG,OAHE,CAGM,SAHN,EAGiBC,MAAM,CAACT,MAAD,CAHvB,CAAP;AAIH,CARD;;IAUaU,UAAU,gBAAGC,UAAA,CAAiB,SAASD,UAAT,CAAoBE,KAApB,EAA4CC,GAA5C;AACvC,MACIb,MADJ,GAYIY,KAZJ,CACIZ,MADJ;AAAA,MAEIC,SAFJ,GAYIW,KAZJ,CAEIX,SAFJ;AAAA,MAGIC,QAHJ,GAYIU,KAZJ,CAGIV,QAHJ;AAAA,yBAYIU,KAZJ,CAIIE,SAJJ;AAAA,MAIIA,SAJJ,iCAIgB,CAAC,EAAD,EAAK,EAAL,EAAS,EAAT,EAAa,GAAb,EAAkB,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E;AAAA,aAAMlC,YAAY,CAACa,SAAS,GAAG,CAAb,CAAlB;AAAA;kBAELF,iBAAiB,GAAGvB,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBU,oBAA5B,GAAmDzD,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBW;AAEjGR,IAAAA,OAAO,EACH3B,iBAAiB,GAAGvB,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBU,oBAA5B,GAAmDzD,KAAK,CAACG,UAAN,CAAiB4C,OAAjB,CAAyBW;GATrG,CAhDJ,CApBR,CADJ;AAqFH,CArHyB;;;;"}
@@ -1,27 +1,13 @@
1
1
  import React__default from 'react';
2
2
 
3
- var usePagination = function usePagination(initialPageIndex, initialPageSize) {
4
- if (initialPageIndex === void 0) {
5
- initialPageIndex = 0;
6
- }
7
-
8
- if (initialPageSize === void 0) {
9
- initialPageSize = 10;
10
- }
11
-
12
- var _React$useState = React__default.useState(initialPageIndex),
13
- pageIndex = _React$useState[0],
14
- setPageIndex = _React$useState[1];
15
-
16
- var _React$useState2 = React__default.useState(initialPageSize),
17
- pageSize = _React$useState2[0],
18
- setPageSize = _React$useState2[1];
19
-
3
+ const usePagination = (initialPageIndex = 0, initialPageSize = 10) => {
4
+ const [pageIndex, setPageIndex] = React__default.useState(initialPageIndex);
5
+ const [pageSize, setPageSize] = React__default.useState(initialPageSize);
20
6
  return {
21
- pageIndex: pageIndex,
22
- pageSize: pageSize,
23
- setPageIndex: setPageIndex,
24
- setPageSize: setPageSize
7
+ pageIndex,
8
+ pageSize,
9
+ setPageIndex,
10
+ setPageSize
25
11
  };
26
12
  };
27
13
 
@@ -1 +1 @@
1
- {"version":3,"file":"usePagination.js","sources":["../../../../src/components/Pagination/usePagination.tsx"],"sourcesContent":["import React from 'react';\n\nexport type usePaginationValues = {\n /** Current page index (zero based) */\n pageIndex: number;\n /** Number of items displayed on a page */\n pageSize: number;\n /** Handler called when navigating through pages */\n setPageIndex: (pageIndex: number) => void;\n /** Handler called when changing the size of the page */\n setPageSize: (size: number) => void;\n};\n\nexport const usePagination = (initialPageIndex = 0, initialPageSize = 10): usePaginationValues => {\n const [pageIndex, setPageIndex] = React.useState(initialPageIndex);\n const [pageSize, setPageSize] = React.useState(initialPageSize);\n\n return {\n pageIndex,\n pageSize,\n setPageIndex,\n setPageSize,\n };\n};\n"],"names":["usePagination","initialPageIndex","initialPageSize","React","useState","pageIndex","setPageIndex","pageSize","setPageSize"],"mappings":";;IAaaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,gBAAD,EAAuBC,eAAvB;MAACD;AAAAA,IAAAA,mBAAmB;;;MAAGC;AAAAA,IAAAA,kBAAkB;;;AAClE,wBAAkCC,cAAK,CAACC,QAAN,CAAeH,gBAAf,CAAlC;AAAA,MAAOI,SAAP;AAAA,MAAkBC,YAAlB;;AACA,yBAAgCH,cAAK,CAACC,QAAN,CAAeF,eAAf,CAAhC;AAAA,MAAOK,QAAP;AAAA,MAAiBC,WAAjB;;AAEA,SAAO;AACHH,IAAAA,SAAS,EAATA,SADG;AAEHE,IAAAA,QAAQ,EAARA,QAFG;AAGHD,IAAAA,YAAY,EAAZA,YAHG;AAIHE,IAAAA,WAAW,EAAXA;AAJG,GAAP;AAMH;;;;"}
1
+ {"version":3,"file":"usePagination.js","sources":["../../../../src/components/Pagination/usePagination.tsx"],"sourcesContent":["import React from 'react';\r\n\r\nexport type usePaginationValues = {\r\n /** Current page index (zero based) */\r\n pageIndex: number;\r\n /** Number of items displayed on a page */\r\n pageSize: number;\r\n /** Handler called when navigating through pages */\r\n setPageIndex: (pageIndex: number) => void;\r\n /** Handler called when changing the size of the page */\r\n setPageSize: (size: number) => void;\r\n};\r\n\r\nexport const usePagination = (initialPageIndex = 0, initialPageSize = 10): usePaginationValues => {\r\n const [pageIndex, setPageIndex] = React.useState(initialPageIndex);\r\n const [pageSize, setPageSize] = React.useState(initialPageSize);\r\n\r\n return {\r\n pageIndex,\r\n pageSize,\r\n setPageIndex,\r\n setPageSize,\r\n };\r\n};\r\n"],"names":["usePagination","initialPageIndex","initialPageSize","pageIndex","setPageIndex","React","useState","pageSize","setPageSize"],"mappings":";;MAaaA,aAAa,GAAG,CAACC,gBAAgB,GAAG,CAApB,EAAuBC,eAAe,GAAG,EAAzC;AACzB,QAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4BC,cAAK,CAACC,QAAN,CAAeL,gBAAf,CAAlC;AACA,QAAM,CAACM,QAAD,EAAWC,WAAX,IAA0BH,cAAK,CAACC,QAAN,CAAeJ,eAAf,CAAhC;AAEA,SAAO;AACHC,IAAAA,SADG;AAEHI,IAAAA,QAFG;AAGHH,IAAAA,YAHG;AAIHI,IAAAA;AAJG,GAAP;AAMH;;;;"}
@@ -1,13 +1,13 @@
1
1
  import React__default from 'react';
2
2
  import keycode from 'keycode';
3
3
 
4
- var usePaginationShortcuts = function usePaginationShortcuts(_ref) {
5
- var setPageIndex = _ref.setPageIndex,
6
- maxPageIndex = _ref.maxPageIndex,
7
- pageIndex = _ref.pageIndex,
8
- useGlobalKeyboardNavigation = _ref.dangerouslyHijackGlobalKeyboardNavigation;
9
-
10
- var onKeyDown = function onKeyDown(event) {
4
+ const usePaginationShortcuts = ({
5
+ setPageIndex,
6
+ maxPageIndex,
7
+ pageIndex,
8
+ dangerouslyHijackGlobalKeyboardNavigation: useGlobalKeyboardNavigation
9
+ }) => {
10
+ const onKeyDown = event => {
11
11
  if (setPageIndex && event.keyCode === keycode('home')) {
12
12
  event.preventDefault();
13
13
  setPageIndex(0);
@@ -33,12 +33,12 @@ var usePaginationShortcuts = function usePaginationShortcuts(_ref) {
33
33
  }
34
34
  };
35
35
 
36
- React__default.useEffect(function () {
36
+ React__default.useEffect(() => {
37
37
  if (useGlobalKeyboardNavigation) {
38
38
  window.addEventListener('keydown', onKeyDown);
39
39
  }
40
40
 
41
- return function () {
41
+ return () => {
42
42
  if (useGlobalKeyboardNavigation) {
43
43
  window.removeEventListener('keydown', onKeyDown);
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"usePaginationShortcuts.js","sources":["../../../../src/components/Pagination/usePaginationShortcuts.tsx"],"sourcesContent":["import React from 'react';\nimport keycode from 'keycode';\n\ninterface Props {\n setPageIndex: (pageIndex: number) => void;\n maxPageIndex: number;\n pageIndex: number;\n dangerouslyHijackGlobalKeyboardNavigation: boolean;\n}\n\nexport const usePaginationShortcuts = ({\n setPageIndex,\n maxPageIndex,\n pageIndex,\n dangerouslyHijackGlobalKeyboardNavigation: useGlobalKeyboardNavigation,\n}: Props) => {\n const onKeyDown = (event: KeyboardEvent): void => {\n if (setPageIndex && event.keyCode === keycode('home')) {\n event.preventDefault();\n setPageIndex(0);\n return;\n }\n\n if (setPageIndex && event.keyCode === keycode('end')) {\n event.preventDefault();\n setPageIndex(maxPageIndex);\n return;\n }\n\n if (setPageIndex && event.keyCode === keycode('page up')) {\n event.preventDefault();\n setPageIndex(Math.max(0, pageIndex - 1));\n return;\n }\n\n if (setPageIndex && event.keyCode === keycode('page down')) {\n event.preventDefault();\n setPageIndex(Math.min(maxPageIndex, pageIndex + 1));\n return;\n }\n };\n\n React.useEffect(() => {\n if (useGlobalKeyboardNavigation) {\n window.addEventListener('keydown', onKeyDown);\n }\n\n return () => {\n if (useGlobalKeyboardNavigation) {\n window.removeEventListener('keydown', onKeyDown);\n }\n };\n }, [onKeyDown, useGlobalKeyboardNavigation]);\n};\n"],"names":["usePaginationShortcuts","setPageIndex","maxPageIndex","pageIndex","useGlobalKeyboardNavigation","dangerouslyHijackGlobalKeyboardNavigation","onKeyDown","event","keyCode","keycode","preventDefault","Math","max","min","React","useEffect","window","addEventListener","removeEventListener"],"mappings":";;;IAUaA,sBAAsB,GAAG,SAAzBA,sBAAyB;MAClCC,oBAAAA;MACAC,oBAAAA;MACAC,iBAAAA;MAC2CC,mCAA3CC;;AAEA,MAAMC,SAAS,GAAG,SAAZA,SAAY,CAACC,KAAD;AACd,QAAIN,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,MAAD,CAA7C,EAAuD;AACnDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAAC,CAAD,CAAZ;AACA;AACH;;AAED,QAAIA,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,KAAD,CAA7C,EAAsD;AAClDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAACC,YAAD,CAAZ;AACA;AACH;;AAED,QAAID,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,SAAD,CAA7C,EAA0D;AACtDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAACU,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYT,SAAS,GAAG,CAAxB,CAAD,CAAZ;AACA;AACH;;AAED,QAAIF,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,WAAD,CAA7C,EAA4D;AACxDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAACU,IAAI,CAACE,GAAL,CAASX,YAAT,EAAuBC,SAAS,GAAG,CAAnC,CAAD,CAAZ;AACA;AACH;AACJ,GAxBD;;AA0BAW,EAAAA,cAAK,CAACC,SAAN,CAAgB;AACZ,QAAIX,2BAAJ,EAAiC;AAC7BY,MAAAA,MAAM,CAACC,gBAAP,CAAwB,SAAxB,EAAmCX,SAAnC;AACH;;AAED,WAAO;AACH,UAAIF,2BAAJ,EAAiC;AAC7BY,QAAAA,MAAM,CAACE,mBAAP,CAA2B,SAA3B,EAAsCZ,SAAtC;AACH;AACJ,KAJD;AAKH,GAVD,EAUG,CAACA,SAAD,EAAYF,2BAAZ,CAVH;AAWH;;;;"}
1
+ {"version":3,"file":"usePaginationShortcuts.js","sources":["../../../../src/components/Pagination/usePaginationShortcuts.tsx"],"sourcesContent":["import React from 'react';\r\nimport keycode from 'keycode';\r\n\r\ninterface Props {\r\n setPageIndex: (pageIndex: number) => void;\r\n maxPageIndex: number;\r\n pageIndex: number;\r\n dangerouslyHijackGlobalKeyboardNavigation: boolean;\r\n}\r\n\r\nexport const usePaginationShortcuts = ({\r\n setPageIndex,\r\n maxPageIndex,\r\n pageIndex,\r\n dangerouslyHijackGlobalKeyboardNavigation: useGlobalKeyboardNavigation,\r\n}: Props) => {\r\n const onKeyDown = (event: KeyboardEvent): void => {\r\n if (setPageIndex && event.keyCode === keycode('home')) {\r\n event.preventDefault();\r\n setPageIndex(0);\r\n return;\r\n }\r\n\r\n if (setPageIndex && event.keyCode === keycode('end')) {\r\n event.preventDefault();\r\n setPageIndex(maxPageIndex);\r\n return;\r\n }\r\n\r\n if (setPageIndex && event.keyCode === keycode('page up')) {\r\n event.preventDefault();\r\n setPageIndex(Math.max(0, pageIndex - 1));\r\n return;\r\n }\r\n\r\n if (setPageIndex && event.keyCode === keycode('page down')) {\r\n event.preventDefault();\r\n setPageIndex(Math.min(maxPageIndex, pageIndex + 1));\r\n return;\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n if (useGlobalKeyboardNavigation) {\r\n window.addEventListener('keydown', onKeyDown);\r\n }\r\n\r\n return () => {\r\n if (useGlobalKeyboardNavigation) {\r\n window.removeEventListener('keydown', onKeyDown);\r\n }\r\n };\r\n }, [onKeyDown, useGlobalKeyboardNavigation]);\r\n};\r\n"],"names":["usePaginationShortcuts","setPageIndex","maxPageIndex","pageIndex","dangerouslyHijackGlobalKeyboardNavigation","useGlobalKeyboardNavigation","onKeyDown","event","keyCode","keycode","preventDefault","Math","max","min","React","useEffect","window","addEventListener","removeEventListener"],"mappings":";;;MAUaA,sBAAsB,GAAG,CAAC;AACnCC,EAAAA,YADmC;AAEnCC,EAAAA,YAFmC;AAGnCC,EAAAA,SAHmC;AAInCC,EAAAA,yCAAyC,EAAEC;AAJR,CAAD;AAMlC,QAAMC,SAAS,GAAIC,KAAD;AACd,QAAIN,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,MAAD,CAA7C,EAAuD;AACnDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAAC,CAAD,CAAZ;AACA;AACH;;AAED,QAAIA,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,KAAD,CAA7C,EAAsD;AAClDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAACC,YAAD,CAAZ;AACA;AACH;;AAED,QAAID,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,SAAD,CAA7C,EAA0D;AACtDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAACU,IAAI,CAACC,GAAL,CAAS,CAAT,EAAYT,SAAS,GAAG,CAAxB,CAAD,CAAZ;AACA;AACH;;AAED,QAAIF,YAAY,IAAIM,KAAK,CAACC,OAAN,KAAkBC,OAAO,CAAC,WAAD,CAA7C,EAA4D;AACxDF,MAAAA,KAAK,CAACG,cAAN;AACAT,MAAAA,YAAY,CAACU,IAAI,CAACE,GAAL,CAASX,YAAT,EAAuBC,SAAS,GAAG,CAAnC,CAAD,CAAZ;AACA;AACH;AACJ,GAxBD;;AA0BAW,EAAAA,cAAK,CAACC,SAAN,CAAgB;AACZ,QAAIV,2BAAJ,EAAiC;AAC7BW,MAAAA,MAAM,CAACC,gBAAP,CAAwB,SAAxB,EAAmCX,SAAnC;AACH;;AAED,WAAO;AACH,UAAID,2BAAJ,EAAiC;AAC7BW,QAAAA,MAAM,CAACE,mBAAP,CAA2B,SAA3B,EAAsCZ,SAAtC;AACH;AACJ,KAJD;AAKH,GAVD,EAUG,CAACA,SAAD,EAAYD,2BAAZ,CAVH;AAWH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../..';\nimport { UnstyledArrow, UnstyledContent } from './Primitives';\nimport mergeRefs from '../../utils/mergeRefs';\n\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n props: {},\n ref: null,\n});\n\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Trigger = React.forwardRef(function PopoverTrigger(props: PopoverTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const context = React.useContext(PopoverContext);\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Trigger {...context.props} {...props} children={children} ref={mergeRefs([context.ref, ref])} asChild />\n );\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('hide'));\n };\n\n return children({ close, ref });\n});\n\nexport type PopoverContentRenderProps = { close: () => void };\nexport type PopoverContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('bg-white focus:border-blue-light', props.className);\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <PopoverPrimitive.Close asChild>\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\n </PopoverPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <UnstyledContent className={className} placement={props.placement} ref={ref}>\n {output}\n <UnstyledArrow className=\"text-white\" />\n </UnstyledContent>\n );\n});\n\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Close = React.forwardRef(\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\n )\n);\n\nexport type PopoverProps = React.PropsWithChildren<{\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n}>;\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\n};\n\nexport const Popover = React.forwardRef(function Popover(props: PopoverProps, ref: React.Ref<HTMLElement>) {\n const { children, trigger, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <PopoverContext.Provider value={context}>\n <PopoverPrimitive.Root>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </PopoverPrimitive.Root>\n </PopoverContext.Provider>\n );\n}) as ForwardedPopoverWithStatics;\nPopover.Trigger = Trigger;\nPopover.Content = Content;\nPopover.Close = Close;\n"],"names":["PopoverContext","React","props","ref","Trigger","PopoverTrigger","context","children","type","console","warn","name","PopoverPrimitive","mergeRefs","asChild","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","className","cn","output","UnstyledContent","placement","UnstyledArrow","Close","Popover","trigger","otherProps","Provider","value"],"mappings":";;;;;;;;AASA,IAAMA,cAAc,gBAAGC,aAAA,CAAyC;AAC5DC,EAAAA,KAAK,EAAE,EADqD;AAE5DC,EAAAA,GAAG,EAAE;AAFuD,CAAzC,CAAvB;AAMA,IAAMC,OAAO,gBAAGH,UAAA,CAAiB,SAASI,cAAT,CAAwBH,KAAxB,EAAoDC,GAApD;;;AAC7B,MAAMG,OAAO,GAAGL,UAAA,CAAiBD,cAAjB,CAAhB;AACA,MAAIO,QAAQ,GAAGL,KAAK,CAACK,QA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O,CAACxB,OAAR,GAAkBA,OAAlB;AACAwB,OAAO,CAACT,OAAR,GAAkBA,OAAlB;AACAS,OAAO,CAACD,KAAR,GAAgBA,KAAhB;;;;"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\r\nimport { Placement } from '../..';\r\nimport { UnstyledArrow, UnstyledContent } from './Primitives';\r\nimport mergeRefs from '../../utils/mergeRefs';\r\n\r\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\r\n\r\nconst PopoverContext = React.createContext<PopoverContextValue>({\r\n props: {},\r\n ref: null,\r\n});\r\n\r\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\r\nconst Trigger = React.forwardRef(function PopoverTrigger(props: PopoverTriggerProps, ref: React.Ref<HTMLButtonElement>) {\r\n const context = React.useContext(PopoverContext);\r\n let children = props.children;\r\n\r\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\r\n console.warn(\r\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\r\n );\r\n children = <span>{props.children}</span>;\r\n }\r\n\r\n return (\r\n <PopoverPrimitive.Trigger {...context.props} {...props} children={children} ref={mergeRefs([context.ref, ref])} asChild />\r\n );\r\n});\r\n\r\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\r\n const close = () => {\r\n onClick(new CustomEvent('hide'));\r\n };\r\n\r\n return children({ close, ref });\r\n});\r\n\r\nexport type PopoverContentRenderProps = { close: () => void };\r\nexport type PopoverContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\r\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\r\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\r\n placement?: Placement;\r\n};\r\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn('bg-white focus:border-blue-light', props.className);\r\n\r\n let output;\r\n\r\n if (typeof props.children === 'function') {\r\n output = (\r\n <PopoverPrimitive.Close asChild>\r\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\r\n </PopoverPrimitive.Close>\r\n );\r\n } else {\r\n output = props.children;\r\n }\r\n\r\n return (\r\n <UnstyledContent className={className} placement={props.placement} ref={ref}>\r\n {output}\r\n <UnstyledArrow className=\"text-white\" />\r\n </UnstyledContent>\r\n );\r\n});\r\n\r\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\r\nconst Close = React.forwardRef(\r\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\r\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\r\n )\r\n);\r\n\r\nexport type PopoverProps = React.PropsWithChildren<{\r\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\r\n trigger?: JSX.Element;\r\n}>;\r\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\r\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\r\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\r\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\r\n};\r\n\r\nexport const Popover = React.forwardRef(function Popover(props: PopoverProps, ref: React.Ref<HTMLElement>) {\r\n const { children, trigger, ...otherProps } = props;\r\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\r\n\r\n return (\r\n <PopoverContext.Provider value={context}>\r\n <PopoverPrimitive.Root>\r\n {trigger && <Trigger>{trigger}</Trigger>}\r\n {children}\r\n </PopoverPrimitive.Root>\r\n </PopoverContext.Provider>\r\n );\r\n}) as ForwardedPopoverWithStatics;\r\nPopover.Trigger = Trigger;\r\nPopover.Content = Content;\r\nPopover.Close = Close;\r\n"],"names":["PopoverContext","React","props","ref","Trigger","PopoverTrigger","context","children","type","console","warn","name","PopoverPrimitive","mergeRefs","asChild","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","className","cn","output","UnstyledContent","placement","UnstyledArrow","Close","Popover","trigger","otherProps","Provider","value"],"mappings":";;;;;;;;AASA,IAAMA,cAAc,gBAAGC,aAAA,CAAyC;AAC5DC,EAAAA,KAAK,EAAE,EADqD;AAE5DC,EAAAA,GAAG,EAAE;AAFuD,CAAzC,CAAvB;AAMA,IAAMC,OAAO,gBAAGH,UAAA,CAAiB,SAASI,cAAT,CAAwBH,KAAxB,EAAoDC,GAApD;;;AAC7B,MAAMG,OAAO,GAAGL,UAAA,CAAiBD,cAAjB,CAAhB;AACA,MAAIO,QAAQ,GAAGL,KAAK,CAACK,QAArB;;AAEA,MAAIN,cAAA,CAAqBC,KAAK,CAACK,QAA3B,KAAwC,2BAAOL,KAAK,CAACK,QAAb,oDAAO,gBAAgBC,IAAvB,MAAgC,UAA5E,EAAwF;AACpFC,IAAAA,OAAO,CAACC,IAAR,uHACwHR,KAAK,CAACK,QAAN,CAAeC,IAAf,CAAoBG,IAD5I,mDAC8LT,KAAK,CAACK,QAAN,CAAeC,IAAf,CAAoBG,IADlN;AAGAJ,IAAAA,QAAQ,GAAGN,aAAA,OAAA,MAAA,EAAOC,KAAK,CAACK,QAAb,CAAX;AACH;;AAED,SACIN,aAAA,CAACW,SAAD,oBAA8BN,OAAO,CAACJ,OAAWA;AAAOK,IAAAA,QAAQ,EAAEA;AAAUJ,IAAAA,GAAG,EAAEU,SAAS,CAAC,CAACP,OAAO,CAACH,GAAT,EAAcA,GAAd,CAAD;AAAsBW,IAAAA,OAAO;IAAvH,CADJ;AAGH,CAde,CAAhB;AAgBA,IAAMC,iBAAiB,gBAAGd,UAAA,CAAiB,SAASc,iBAAT,OAAuDZ,GAAvD;MAA6BI,gBAAAA;MAAUS,eAAAA;;A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QAAR,GAA6CL,KAA7C,CAAQK,QAAR;AAAA,MAAkBsB,OAAlB,GAA6C3B,KAA7C,CAAkB2B,OAAlB;AAAA,MAA8BC,UAA9B,iCAA6C5B,KAA7C;;AACA,MAAMI,OAAO,GAAGL,OAAA,CAAc;AAAA,WAAO;AAAEC,MAAAA,KAAK,EAAE4B,UAAT;AAAqB3B,MAAAA,GAAG,EAAHA;AAArB,KAAP;AAAA,GAAd,EAAkD,CAAC2B,UAAD,CAAlD,CAAhB;AAEA,SACI7B,aAAA,CAACD,cAAc,CAAC+B,QAAhB;AAAyBC,IAAAA,KAAK,EAAE1B;GAAhC,EACIL,aAAA,CAACW,IAAD,MAAA,EACKiB,OAAO,IAAI5B,aAAA,CAACG,OAAD,MAAA,EAAUyB,OAAV,CADhB,EAEKtB,QAFL,CADJ,CADJ;AAQH,CAZsB;AAavBqB,OAAO,CAACxB,OAAR,GAAkBA,OAAlB;AACAwB,OAAO,CAACT,OAAR,GAAkBA,OAAlB;AACAS,OAAO,CAACD,KAAR,GAAgBA,KAAhB;;;;"}
@@ -1,10 +1,8 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { forwardRef, createElement } from 'react';
3
2
  import cn from 'classnames';
4
3
  import { Arrow, Content } from '@radix-ui/react-popover';
5
4
 
6
- var _excluded = ["placement"];
7
- var UnstyledArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
5
+ const UnstyledArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
8
6
  return createElement(Arrow, {
9
7
  className: "pointer-events-none -mt-px",
10
8
  asChild: true,
@@ -25,11 +23,12 @@ var UnstyledArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref) {
25
23
  d: "M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"
26
24
  })));
27
25
  });
28
- var UnstyledContent = /*#__PURE__*/forwardRef(function PopoverContent(props, ref) {
29
- var side = props.placement,
30
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
31
-
32
- var className = cn('border border-transparent rounded p-3 yt-shadow focus:yt-focus outline-none group z-[996]', props.className);
26
+ const UnstyledContent = /*#__PURE__*/forwardRef(function PopoverContent(props, ref) {
27
+ const {
28
+ placement: side,
29
+ ...otherProps
30
+ } = props;
31
+ const className = cn('border border-transparent rounded p-3 yt-shadow focus:yt-focus outline-none group z-[996]', props.className);
33
32
  return createElement(Content, Object.assign({}, otherProps, {
34
33
  className: className,
35
34
  side: side,
@@ -1 +1 @@
1
- {"version":3,"file":"Primitives.js","sources":["../../../../src/components/Popover/Primitives.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../../types';\n\nexport const UnstyledArrow = React.forwardRef(function PopoverArrow(\n props: React.SVGAttributes<SVGElement>,\n ref: React.Ref<SVGSVGElement>\n) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none -mt-px\" asChild offset={2} width={30} height={11}>\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\" style={{ transform: 'rotateZ(180deg)' }}>\n <path\n className=\"text-grey-dark group-focus:text-blue-light fill-current\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"\n ></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"\n ></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n\nexport type UnstyledContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side'> & {\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nexport const UnstyledContent = React.forwardRef(function PopoverContent(\n props: UnstyledContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const { placement: side, ...otherProps } = props;\n\n const className = cn(\n 'border border-transparent rounded p-3 yt-shadow focus:yt-focus outline-none group z-[996]',\n props.className\n );\n\n return <PopoverPrimitive.Content {...otherProps} className={className} side={side} sideOffset={1} ref={ref} />;\n});\n"],"names":["UnstyledArrow","React","PopoverArrow","props","ref","PopoverPrimitive","className","asChild","offset","width","height","viewBox","style","transform","d","UnstyledContent","PopoverContent","side","placement","otherProps","cn","sideOffset"],"mappings":";;;;;;IAKaA,aAAa,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAC1CC,KAD0C,EAE1CC,GAF0C;AAI1C,SACIH,aAAA,CAACI,KAAD;AAAwBC,IAAAA,SAAS,EAAC;AAA6BC,IAAAA,OAAO;AAACC,IAAAA,MAAM,EAAE;AAAGC,IAAAA,KAAK,EAAE;AAAIC,IAAAA,MAAM,EAAE;GAArG,EACIT,aAAA,MAAA,oBAASE;AAAOC,IAAAA,GAAG,EAAEA;AAAKO,IAAAA,OAAO,EAAC;AAAaC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,SAAS,EAAE;AAAb;IAAtD,EACIZ,aAAA,OAAA;AACIK,IAAAA,SAAS,EAAC;AACVQ,IAAAA,CAAC,EAAC;GAFN,CADJ,EAKIb,aAAA,OAAA;AACIK,IAAAA,SAAS,EAAC;AACVQ,IAAAA,CAAC,EAAC;GAFN,CALJ,CADJ,CADJ;AAcH,CAlB4B;IAwBhBC,eAAe,gBAAGd,UAAA,CAAiB,SAASe,cAAT,CAC5Cb,KAD4C,EAE5CC,GAF4C;AAI5C,MAAmBa,IAAnB,GAA2Cd,KAA3C,CAAQe,SAAR;AAAA,MAA4BC,UAA5B,iCAA2ChB,KAA3C;;AAEA,MAAMG,SAAS,GAAGc,EAAE,CAChB,2FADgB,EAEhBjB,KAAK,CAACG,SAFU,CAApB;AAKA,SAAOL,aAAA,CAACI,OAAD,oBAA8Bc;AAAYb,IAAAA,SAAS,EAAEA;AAAWW,IAAAA,IAAI,EAAEA;AAAMI,IAAAA,UAAU,EAAE;AAAGjB,IAAAA,GAAG,EAAEA;IAAhG,CAAP;AACH,CAZ8B;;;;"}
1
+ {"version":3,"file":"Primitives.js","sources":["../../../../src/components/Popover/Primitives.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\r\nimport { Placement } from '../../types';\r\n\r\nexport const UnstyledArrow = React.forwardRef(function PopoverArrow(\r\n props: React.SVGAttributes<SVGElement>,\r\n ref: React.Ref<SVGSVGElement>\r\n) {\r\n return (\r\n <PopoverPrimitive.Arrow className=\"pointer-events-none -mt-px\" asChild offset={2} width={30} height={11}>\r\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\" style={{ transform: 'rotateZ(180deg)' }}>\r\n <path\r\n className=\"text-grey-dark group-focus:text-blue-light fill-current\"\r\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"\r\n ></path>\r\n <path\r\n className=\"fill-current\"\r\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"\r\n ></path>\r\n </svg>\r\n </PopoverPrimitive.Arrow>\r\n );\r\n});\r\n\r\nexport type UnstyledContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side'> & {\r\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\r\n placement?: Placement;\r\n};\r\nexport const UnstyledContent = React.forwardRef(function PopoverContent(\r\n props: UnstyledContentProps,\r\n ref: React.Ref<HTMLDivElement>\r\n) {\r\n const { placement: side, ...otherProps } = props;\r\n\r\n const className = cn(\r\n 'border border-transparent rounded p-3 yt-shadow focus:yt-focus outline-none group z-[996]',\r\n props.className\r\n );\r\n\r\n return <PopoverPrimitive.Content {...otherProps} className={className} side={side} sideOffset={1} ref={ref} />;\r\n});\r\n"],"names":["UnstyledArrow","React","PopoverArrow","props","ref","PopoverPrimitive","className","asChild","offset","width","height","viewBox","style","transform","d","UnstyledContent","PopoverContent","placement","side","otherProps","cn","sideOffset"],"mappings":";;;;MAKaA,aAAa,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAC1CC,KAD0C,EAE1CC,GAF0C;AAI1C,SACIH,aAAA,CAACI,KAAD;AAAwBC,IAAAA,SAAS,EAAC;AAA6BC,IAAAA,OAAO;AAACC,IAAAA,MAAM,EAAE;AAAGC,IAAAA,KAAK,EAAE;AAAIC,IAAAA,MAAM,EAAE;GAArG,EACIT,aAAA,MAAA,oBAASE;AAAOC,IAAAA,GAAG,EAAEA;AAAKO,IAAAA,OAAO,EAAC;AAAaC,IAAAA,KAAK,EAAE;AAAEC,MAAAA,SAAS,EAAE;AAAb;IAAtD,EACIZ,aAAA,OAAA;AACIK,IAAAA,SAAS,EAAC;AACVQ,IAAAA,CAAC,EAAC;GAFN,CADJ,EAKIb,aAAA,OAAA;AACIK,IAAAA,SAAS,EAAC;AACVQ,IAAAA,CAAC,EAAC;GAFN,CALJ,CADJ,CADJ;AAcH,CAlB4B;MAwBhBC,eAAe,gBAAGd,UAAA,CAAiB,SAASe,cAAT,CAC5Cb,KAD4C,EAE5CC,GAF4C;AAI5C,QAAM;AAAEa,IAAAA,SAAS,EAAEC,IAAb;AAAmB,OAAGC;AAAtB,MAAqChB,KAA3C;AAEA,QAAMG,SAAS,GAAGc,EAAE,CAChB,2FADgB,EAEhBjB,KAAK,CAACG,SAFU,CAApB;AAKA,SAAOL,aAAA,CAACI,OAAD,oBAA8Bc;AAAYb,IAAAA,SAAS,EAAEA;AAAWY,IAAAA,IAAI,EAAEA;AAAMG,IAAAA,UAAU,EAAE;AAAGjB,IAAAA,GAAG,EAAEA;IAAhG,CAAP;AACH,CAZ8B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport './Progress.css';\n\nexport type ProgressProps = React.HTMLAttributes<HTMLSpanElement> & {\n /**\n * Indicates how long (in milliseconds) a progress bar will take to progress through.\n * By default, progress bar has no duration\n */\n duration?: number;\n};\n\nexport const Progress = ({ duration = undefined, ...props }: ProgressProps): JSX.Element => {\n let style;\n\n if (duration) {\n style = {\n animationDuration: `${duration}ms`,\n };\n }\n\n const className = cn('bg-grey-light rounded block h-1 overflow-hidden w-full', props.className);\n\n const progressClassName = cn('yt-progress__bar block h-1', {\n \"w-full before:h-1 before:bg-grey-dark before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']\":\n !duration,\n [`w-0 bg-grey-dark animate-[progress_linear]`]: duration,\n });\n\n return (\n <span {...props} data-taco=\"progress\" className={className}>\n <span className={progressClassName} data-taco=\"progress-bar\" style={style} />\n </span>\n );\n};\n"],"names":["Progress","duration","undefined","props","style","animationDuration","className","cn","progressClassName","React"],"mappings":";;;;;IAYaA,QAAQ,GAAG,SAAXA,QAAW;;;2BAAGC;MAAAA,sCAAWC;MAAcC;;AAChD,MAAIC,KAAJ;;AAEA,MAAIH,QAAJ,EAAc;AACVG,IAAAA,KAAK,GAAG;AACJC,MAAAA,iBAAiB,EAAKJ,QAAL;AADb,KAAR;AAGH;;AAED,MAAMK,SAAS,GAAGC,EAAE,CAAC,wDAAD,EAA2DJ,KAAK,CAACG,SAAjE,CAApB;AAEA,MAAME,iBAAiB,GAAGD,EAAE,CAAC,4BAAD;AACxB,6JACI,CAACN;AAFmB,yDAGwBA,QAHxB,OAA5B;AAMA,SACIQ,4BAAA,OAAA,oBAAUN;iBAAiB;AAAWG,IAAAA,SAAS,EAAEA;IAAjD,EACIG,4BAAA,OAAA;AAAMH,IAAAA,SAAS,EAAEE;iBAA6B;AAAeJ,IAAAA,KAAK,EAAEA;GAApE,CADJ,CADJ;AAKH;;;;"}
1
+ {"version":3,"file":"Progress.js","sources":["../../../../src/components/Progress/Progress.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport './Progress.css';\r\n\r\nexport type ProgressProps = React.HTMLAttributes<HTMLSpanElement> & {\r\n /**\r\n * Indicates how long (in milliseconds) a progress bar will take to progress through.\r\n * By default, progress bar has no duration\r\n */\r\n duration?: number;\r\n};\r\n\r\nexport const Progress = ({ duration = undefined, ...props }: ProgressProps): JSX.Element => {\r\n let style;\r\n\r\n if (duration) {\r\n style = {\r\n animationDuration: `${duration}ms`,\r\n };\r\n }\r\n\r\n const className = cn('bg-grey-light rounded block h-1 overflow-hidden w-full', props.className);\r\n\r\n const progressClassName = cn('yt-progress__bar block h-1', {\r\n \"w-full before:h-1 before:bg-grey-dark before:block before:animate-[progress-indeterminate_2s_cubic-bezier(0.4,0,0.2,1)_infinite] before:content-[' ']\":\r\n !duration,\r\n [`w-0 bg-grey-dark animate-[progress_linear]`]: duration,\r\n });\r\n\r\n return (\r\n <span {...props} data-taco=\"progress\" className={className}>\r\n <span className={progressClassName} data-taco=\"progress-bar\" style={style} />\r\n </span>\r\n );\r\n};\r\n"],"names":["Progress","duration","undefined","props","style","animationDuration","className","cn","progressClassName","React"],"mappings":";;;;;IAYaA,QAAQ,GAAG,SAAXA,QAAW;;;2BAAGC;MAAAA,sCAAWC;MAAcC;;AAChD,MAAIC,KAAJ;;AAEA,MAAIH,QAAJ,EAAc;AACVG,IAAAA,KAAK,GAAG;AACJC,MAAAA,iBAAiB,EAAKJ,QAAL;AADb,KAAR;AAGH;;AAED,MAAMK,SAAS,GAAGC,EAAE,CAAC,wDAAD,EAA2DJ,KAAK,CAACG,SAAjE,CAApB;AAEA,MAAME,iBAAiB,GAAGD,EAAE,CAAC,4BAAD;AACxB,6JACI,CAACN;AAFmB,yDAGwBA,QAHxB,OAA5B;AAMA,SACIQ,4BAAA,OAAA,oBAAUN;iBAAiB;AAAWG,IAAAA,SAAS,EAAEA;IAAjD,EACIG,4BAAA,OAAA;AAAMH,IAAAA,SAAS,EAAEE;iBAA6B;AAAeJ,IAAAA,KAAK,EAAEA;GAApE,CADJ,CADJ;AAKH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","sources":["../../../../src/components/Provider/Provider.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Locale } from '../../types';\nimport { CalendarTexts } from '../Calendar/Calendar';\nimport { ComboboxTexts } from '../Combobox/Combobox';\nimport { DialogTexts } from '../Dialog/Dialog';\nimport { PaginationTexts } from '../Pagination/Pagination';\nimport { ListboxTexts } from '../Listbox/Listbox';\nimport { ToastsTexts } from '../Toast/Toast';\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\nimport { HangerTexts } from '../Hanger/Hanger';\nimport { SelectTexts } from '../Select/Select';\nimport { TourTexts } from '../Tour/Tour';\nimport { TableTexts } from '../Table/Table';\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\nimport { ToastProvider } from '../Toast/Toaster';\n\nexport type LocalizationTexts = {\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\n calendar: CalendarTexts;\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\n combobox: ComboboxTexts;\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\n datepicker: DatepickerTexts;\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\n hanger: HangerTexts;\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\n listbox: ListboxTexts;\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\n dialog: DialogTexts;\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\n pagination: PaginationTexts;\n /** Localized texts and aria-labels for [Table](component:table) component */\n table: TableTexts;\n /** Localized texts and aria-labels for [Select](component:select) component */\n select: SelectTexts;\n /** Localized texts and aria-labels for [Toast](component:toast) component */\n toasts: ToastsTexts;\n /** Localized texts and aria-labels for [Tour](component:tour) component */\n tour: TourTexts;\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\n searchInput: SearchInputTexts;\n};\n\nexport type Localization = {\n /**\n * Provide the language code used in application.\n * Default value is `en-GB`\n */\n locale: Locale;\n /** Provide the texts and aria-labels for components used within the provider */\n texts: LocalizationTexts;\n /** Provide the formatting */\n formatting: {\n /** Default value is `dd.mm.yy` */\n date: string;\n };\n};\nexport type Taco = {\n /** Define localized texts and formatted data in your application */\n localization: Localization;\n};\n\nexport const defaultLocalisationTexts = {\n calendar: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n actions: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n today: 'Today',\n },\n },\n combobox: {\n tooltip: 'Search in list',\n },\n datepicker: {\n calendar: 'Calendar',\n clear: 'Clear',\n expand: 'Show calendar',\n shortcuts: 'Shortcuts',\n },\n hanger: {\n close: 'Close',\n },\n listbox: {\n loading: 'Loading results...',\n empty: 'No results found',\n allOption: 'All',\n },\n dialog: {\n close: 'Close',\n drag: 'Drag',\n },\n pagination: {\n label: 'Pagination',\n pageSize: 'Items per page',\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\n actions: {\n firstPage: 'Goto first page',\n firstPageWithShortcut: 'Goto first page (Home)',\n previousPage: 'Goto previous page',\n previousPageWithShortcut: 'Goto previous page (Page Up)',\n nextPage: 'Goto next page',\n nextPageWithShortcut: 'Goto next page (Page Down)',\n lastPage: 'Goto last page',\n lastPageWithShortcut: 'Goto last page (End)',\n pageX: 'Goto page [X]',\n },\n },\n table: {\n actions: 'Other actions',\n edit: 'Edit (e)',\n copy: 'Copy (c)',\n del: 'Delete (del)',\n newSubRow: 'New row (shift + n)',\n loading: 'Loading...',\n },\n select: {\n allOptionsSelected: 'All',\n },\n toasts: {\n dismiss: 'Dismiss',\n },\n tour: {\n back: 'Back',\n close: 'Close',\n skip: 'Close and complete',\n last: 'Done',\n next: 'Next',\n open: 'Open',\n },\n searchInput: {\n inputLabel: 'Search...',\n },\n};\n\nconst defaultLocalizationContext: Localization = {\n locale: 'en-GB',\n texts: defaultLocalisationTexts,\n formatting: {\n date: 'dd.mm.yy',\n },\n};\n\nconst Context = React.createContext<Taco>({\n localization: defaultLocalizationContext,\n});\n\nexport type ProviderProps = {\n /** Content would be your application */\n children?: any;\n /** Define localized texts and formatted data in your application */\n localization?: Localization;\n};\n\nexport const Provider = (props: ProviderProps): JSX.Element => {\n const { children, localization = defaultLocalizationContext } = props;\n const value = React.useMemo(() => ({ localization }), [localization]);\n\n return (\n <Context.Provider value={value}>\n <ToastProvider>{children}</ToastProvider>\n </Context.Provider>\n );\n};\n\nexport const useTaco = (): Taco => React.useContext(Context);\nexport const useLocalization = (): Localization => useTaco().localization;\n"],"names":["defaultLocalisationTexts","calendar","months","weekdaysShort","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","hanger","close","listbox","loading","empty","allOption","dialog","drag","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","select","allOptionsSelected","toasts","dismiss","tour","back","skip","last","next","open","searchInput","inputLabel","defaultLocalizationContext","locale","texts","formatting","date","Context","React","localization","Provider","props","children","value","ToastProvider","useTaco","useLocalization"],"mappings":";;;IA+DaA,wBAAwB,GAAG;AACpCC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,MAAM,EAAE,CACJ,SADI,EAEJ,UAFI,EAGJ,OAHI,EAIJ,OAJI,EAKJ,KALI,EAMJ,MANI,EAOJ,MAPI,EAQJ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BF,YAAlB;AAAA,MAAkBA,YAAlB,oCAAiCP,0BAAjC;AACA,MAAMW,KAAK,GAAGL,OAAA,CAAc;AAAA,WAAO;AAAEC,MAAAA,YAAY,EAAZA;AAAF,KAAP;AAAA,GAAd,EAAwC,CAACA,YAAD,CAAxC,CAAd;AAEA,SACID,aAAA,CAACD,OAAO,CAACG,QAAT;AAAkBG,IAAAA,KAAK,EAAEA;GAAzB,EACIL,aAAA,CAACM,aAAD,MAAA,EAAgBF,QAAhB,CADJ,CADJ;AAKH;IAEYG,OAAO,GAAG,SAAVA,OAAU;AAAA,SAAYP,UAAA,CAAiBD,OAAjB,CAAZ;AAAA;IACVS,eAAe,GAAG,SAAlBA,eAAkB;AAAA,SAAoBD,OAAO,GAAGN,YAA9B;AAAA;;;;"}
1
+ {"version":3,"file":"Provider.js","sources":["../../../../src/components/Provider/Provider.tsx"],"sourcesContent":["import * as React from 'react';\r\n\r\nimport { Locale } from '../../types';\r\nimport { CalendarTexts } from '../Calendar/Calendar';\r\nimport { ComboboxTexts } from '../Combobox/Combobox';\r\nimport { DialogTexts } from '../Dialog/Dialog';\r\nimport { PaginationTexts } from '../Pagination/Pagination';\r\nimport { ListboxTexts } from '../Listbox/Listbox';\r\nimport { ToastsTexts } from '../Toast/Toast';\r\nimport { DatepickerTexts } from '../Datepicker/Datepicker';\r\nimport { HangerTexts } from '../Hanger/Hanger';\r\nimport { SelectTexts } from '../Select/Select';\r\nimport { TourTexts } from '../Tour/Tour';\r\nimport { TableTexts } from '../Table/Table';\r\nimport { SearchInputTexts } from '../SearchInput/SearchInput';\r\nimport { ToastProvider } from '../Toast/Toaster';\r\n\r\nexport type LocalizationTexts = {\r\n /** Localized texts and aria-labels for [Calendar](component:calendar) component */\r\n calendar: CalendarTexts;\r\n /** Localized texts and aria-labels for [Combobox](component:combobox) component */\r\n combobox: ComboboxTexts;\r\n /** Localized texts and aria-labels for [DatePicker](component:datepicker) component */\r\n datepicker: DatepickerTexts;\r\n /** Localized texts and aria-labels for [Hanger](component:hanger) component */\r\n hanger: HangerTexts;\r\n /** Localized texts and aria-labels for [Listbox](component:listbox) component */\r\n listbox: ListboxTexts;\r\n /** Localized texts and aria-labels for [Dialog](component:dialog) component */\r\n dialog: DialogTexts;\r\n /** Localized texts and aria-labels for [Pagination](component:pagination) component */\r\n pagination: PaginationTexts;\r\n /** Localized texts and aria-labels for [Table](component:table) component */\r\n table: TableTexts;\r\n /** Localized texts and aria-labels for [Select](component:select) component */\r\n select: SelectTexts;\r\n /** Localized texts and aria-labels for [Toast](component:toast) component */\r\n toasts: ToastsTexts;\r\n /** Localized texts and aria-labels for [Tour](component:tour) component */\r\n tour: TourTexts;\r\n /** Localized texts and aria-labels for [SearchInput](component:searchinput) component */\r\n searchInput: SearchInputTexts;\r\n};\r\n\r\nexport type Localization = {\r\n /**\r\n * Provide the language code used in application.\r\n * Default value is `en-GB`\r\n */\r\n locale: Locale;\r\n /** Provide the texts and aria-labels for components used within the provider */\r\n texts: LocalizationTexts;\r\n /** Provide the formatting */\r\n formatting: {\r\n /** Default value is `dd.mm.yy` */\r\n date: string;\r\n };\r\n};\r\nexport type Taco = {\r\n /** Define localized texts and formatted data in your application */\r\n localization: Localization;\r\n};\r\n\r\nexport const defaultLocalisationTexts = {\r\n calendar: {\r\n months: [\r\n 'January',\r\n 'February',\r\n 'March',\r\n 'April',\r\n 'May',\r\n 'June',\r\n 'July',\r\n 'August',\r\n 'September',\r\n 'October',\r\n 'November',\r\n 'December',\r\n ],\r\n weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\r\n actions: {\r\n previousMonth: 'Previous month',\r\n nextMonth: 'Next month',\r\n previousYear: 'Previous year',\r\n nextYear: 'Next year',\r\n today: 'Today',\r\n },\r\n },\r\n combobox: {\r\n tooltip: 'Search in list',\r\n },\r\n datepicker: {\r\n calendar: 'Calendar',\r\n clear: 'Clear',\r\n expand: 'Show calendar',\r\n shortcuts: 'Shortcuts',\r\n },\r\n hanger: {\r\n close: 'Close',\r\n },\r\n listbox: {\r\n loading: 'Loading results...',\r\n empty: 'No results found',\r\n allOption: 'All',\r\n },\r\n dialog: {\r\n close: 'Close',\r\n drag: 'Drag',\r\n },\r\n pagination: {\r\n label: 'Pagination',\r\n pageSize: 'Items per page',\r\n showingXofYofTotal: 'Showing [X] - [Y] of [total]',\r\n actions: {\r\n firstPage: 'Goto first page',\r\n firstPageWithShortcut: 'Goto first page (Home)',\r\n previousPage: 'Goto previous page',\r\n previousPageWithShortcut: 'Goto previous page (Page Up)',\r\n nextPage: 'Goto next page',\r\n nextPageWithShortcut: 'Goto next page (Page Down)',\r\n lastPage: 'Goto last page',\r\n lastPageWithShortcut: 'Goto last page (End)',\r\n pageX: 'Goto page [X]',\r\n },\r\n },\r\n table: {\r\n actions: 'Other actions',\r\n edit: 'Edit (e)',\r\n copy: 'Copy (c)',\r\n del: 'Delete (del)',\r\n newSubRow: 'New row (shift + n)',\r\n loading: 'Loading...',\r\n },\r\n select: {\r\n allOptionsSelected: 'All',\r\n },\r\n toasts: {\r\n dismiss: 'Dismiss',\r\n },\r\n tour: {\r\n back: 'Back',\r\n close: 'Close',\r\n skip: 'Close and complete',\r\n last: 'Done',\r\n next: 'Next',\r\n open: 'Open',\r\n },\r\n searchInput: {\r\n inputLabel: 'Search...',\r\n },\r\n};\r\n\r\nconst defaultLocalizationContext: Localization = {\r\n locale: 'en-GB',\r\n texts: defaultLocalisationTexts,\r\n formatting: {\r\n date: 'dd.mm.yy',\r\n },\r\n};\r\n\r\nconst Context = React.createContext<Taco>({\r\n localization: defaultLocalizationContext,\r\n});\r\n\r\nexport type ProviderProps = {\r\n /** Content would be your application */\r\n children?: any;\r\n /** Define localized texts and formatted data in your application */\r\n localization?: Localization;\r\n};\r\n\r\nexport const Provider = (props: ProviderProps): JSX.Element => {\r\n const { children, localization = defaultLocalizationContext } = props;\r\n const value = React.useMemo(() => ({ localization }), [localization]);\r\n\r\n return (\r\n <Context.Provider value={value}>\r\n <ToastProvider>{children}</ToastProvider>\r\n </Context.Provider>\r\n );\r\n};\r\n\r\nexport const useTaco = (): Taco => React.useContext(Context);\r\nexport const useLocalization = (): Localization => useTaco().localization;\r\n"],"names":["defaultLocalisationTexts","calendar","months","weekdaysShort","actions","previousMonth","nextMonth","previousYear","nextYear","today","combobox","tooltip","datepicker","clear","expand","shortcuts","hanger","close","listbox","loading","empty","allOption","dialog","drag","pagination","label","pageSize","showingXofYofTotal","firstPage","firstPageWithShortcut","previousPage","previousPageWithShortcut","nextPage","nextPageWithShortcut","lastPage","lastPageWithShortcut","pageX","table","edit","copy","del","newSubRow","select","allOptionsSelected","toasts","dismiss","tour","back","skip","last","next","open","searchInput","inputLabel","defaultLocalizationContext","locale","texts","formatting","date","Context","React","localization","Provider","props","children","value","ToastProvider","useTaco","useLocalization"],"mappings":";;;IA+DaA,wBAAwB,GAAG;AACpCC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,MAAM,EAAE,CACJ,SADI,EAEJ,UAFI,EAGJ,OAHI,EAIJ,OAJI,EAKJ,KALI,EAMJ,MANI,EAOJ,MAPI,EAQJ,QARI,EASJ,WATI,EAUJ,SAVI,EAWJ,UAXI,EAYJ,UAZI,CADF;AAeNC,IAAAA,aAAa,EAAE,CAAC,KAAD,EAAQ,KAAR,EAAe,KAAf,EAAsB,KAAtB,EAA6B,KAA7B,EAAoC,KAApC,EAA2C,KAA3C,CAfT;AAgBNC,IAAAA,OAAO,EAAE;AACLC,MAAAA,aAAa,EAAE,gBADV;AAELC,MAAAA,SAAS,EAAE,YAFN;AAGLC,MAAAA,YAAY,EAAE,eAHT;AAILC,MAAAA,QAAQ,EAAE,WAJL;AAKLC,MAAAA,KAAK,EAAE;AALF;AAhBH,GAD0B;AAyBpCC,EAAAA,QAAQ,EAAE;AACNC,IAAAA,OAAO,EAAE;AADH,GAzB0B;AA4BpCC,EAAAA,UAAU,EAAE;AACRX,IAAAA,QAAQ,EAAE,UADF;AAERY,IAAAA,KAAK,EAAE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