@economic/taco 0.0.20-alpha.0 → 0.0.21-alpha.0

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 (387) hide show
  1. package/README.md +84 -84
  2. package/dist/components/Icon/components/{ExportToExcelCopy.d.ts → ExportToPdf.d.ts} +0 -0
  3. package/dist/components/Icon/components/{Thumb.d.ts → InboxEinvoicing.d.ts} +0 -0
  4. package/dist/components/Icon/components/InboxScanning.d.ts +3 -0
  5. package/dist/components/Icon/components/ThumbUp.d.ts +3 -0
  6. package/dist/components/Icon/components/index.d.ts +1 -1
  7. package/dist/components/Input/Input.d.ts +1 -1
  8. package/dist/components/Menu/Menu.d.ts +2 -2
  9. package/dist/components/Menu/components/Item.d.ts +1 -1
  10. package/dist/components/Menu/components/Link.d.ts +1 -1
  11. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  12. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  13. package/dist/esm/components/Badge/Badge.js.map +1 -1
  14. package/dist/esm/components/Banner/Banner.js.map +1 -1
  15. package/dist/esm/components/Banner/util.js +1 -1
  16. package/dist/esm/components/Banner/util.js.map +1 -1
  17. package/dist/esm/components/Button/Button.js.map +1 -1
  18. package/dist/esm/components/Button/util.js +23 -18
  19. package/dist/esm/components/Button/util.js.map +1 -1
  20. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  21. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  22. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  23. package/dist/esm/components/Combobox/useCombobox.js +84 -64
  24. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  25. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  26. package/dist/esm/components/Datepicker/useDatepicker.js +34 -27
  27. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  28. package/dist/esm/components/Dialog/Context.js +3 -3
  29. package/dist/esm/components/Dialog/Context.js.map +1 -1
  30. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  31. package/dist/esm/components/Dialog/components/Content.js +44 -39
  32. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  33. package/dist/esm/components/Dialog/components/Drawer.js +3 -3
  34. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  35. package/dist/esm/components/Dialog/components/Extra.js +2 -2
  36. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  37. package/dist/esm/components/Dialog/components/Trigger.js +2 -2
  38. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  39. package/dist/esm/components/Field/Field.js.map +1 -1
  40. package/dist/esm/components/Form/Form.js.map +1 -1
  41. package/dist/esm/components/Group/Group.js.map +1 -1
  42. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  43. package/dist/esm/components/Icon/Icon.js.map +1 -1
  44. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  45. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  46. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  47. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  48. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  49. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  50. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  51. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  52. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  53. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  54. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  55. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  56. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  57. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  58. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  59. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  60. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  61. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  62. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  63. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  64. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  65. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  66. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  67. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  68. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  69. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  70. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  71. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  72. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  73. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  74. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  75. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  76. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  77. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  78. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  79. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  80. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  81. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  82. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  83. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  84. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  85. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  86. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  87. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  88. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  89. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  90. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  91. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  92. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  93. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  94. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  95. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  96. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  97. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  98. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  99. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  100. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  101. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  102. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  103. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  104. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  105. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  106. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  107. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  108. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  109. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  110. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  111. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  112. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  113. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  114. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  115. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  116. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  117. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  118. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  119. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  120. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  121. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  122. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  123. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  124. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  125. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  126. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  127. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  128. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  129. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  130. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  131. package/dist/esm/components/Icon/components/{ExportToExcelCopy.js → ExportToPdf.js} +4 -4
  132. package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -0
  133. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  134. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  135. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  136. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  137. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  138. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  139. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  140. package/dist/esm/components/Icon/components/Inbox.js +5 -3
  141. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  142. package/dist/esm/components/Icon/components/InboxEinvoicing.js +20 -0
  143. package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -0
  144. package/dist/esm/components/Icon/components/InboxScanning.js +20 -0
  145. package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -0
  146. package/dist/esm/components/Icon/components/InboxSmart.js +5 -3
  147. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  148. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  149. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  150. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  151. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  152. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  153. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  154. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  155. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  156. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  157. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  158. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  159. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  160. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  161. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  162. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  163. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  164. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  165. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  166. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  167. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  168. package/dist/esm/components/Icon/components/List.js.map +1 -1
  169. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  170. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  171. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  172. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  173. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  174. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  175. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  176. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  177. package/dist/esm/components/Icon/components/Minus.js.map +1 -1
  178. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  179. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  180. package/dist/esm/components/Icon/components/More.js.map +1 -1
  181. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  182. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  183. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  184. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  185. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  186. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  187. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  188. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  189. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  190. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  191. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  192. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  193. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  194. package/dist/esm/components/Icon/components/PlusCircle.js.map +1 -1
  195. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  196. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  197. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  198. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  199. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  200. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  201. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  202. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  203. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  204. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  205. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  206. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  207. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  208. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  209. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  210. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  211. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  212. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  213. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  214. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  215. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  217. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  218. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  219. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  220. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  221. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  222. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  223. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  224. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  225. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  226. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  227. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  228. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  229. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  230. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  231. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  232. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  233. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  234. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  235. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  236. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  237. package/dist/esm/components/Icon/components/{Thumb.js → ThumbUp.js} +4 -4
  238. package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -0
  239. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  240. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  241. package/dist/esm/components/Icon/components/TickCircle.js.map +1 -1
  242. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  243. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  244. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  245. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  246. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  247. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  248. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  249. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  250. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  251. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  252. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  253. package/dist/esm/components/Icon/components/index.js +12 -8
  254. package/dist/esm/components/Icon/components/index.js.map +1 -1
  255. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  256. package/dist/esm/components/Input/Input.js.map +1 -1
  257. package/dist/esm/components/Input/util.js +8 -9
  258. package/dist/esm/components/Input/util.js.map +1 -1
  259. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  260. package/dist/esm/components/Listbox/ScrollableList.js +82 -63
  261. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  262. package/dist/esm/components/Listbox/useListbox.js +58 -49
  263. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  264. package/dist/esm/components/Listbox/useMultiListbox.js +91 -63
  265. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  266. package/dist/esm/components/Listbox/useTypeahead.js +9 -10
  267. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  268. package/dist/esm/components/Listbox/util.js +84 -48
  269. package/dist/esm/components/Listbox/util.js.map +1 -1
  270. package/dist/esm/components/Menu/Context.js +2 -2
  271. package/dist/esm/components/Menu/Context.js.map +1 -1
  272. package/dist/esm/components/Menu/Menu.js.map +1 -1
  273. package/dist/esm/components/Menu/components/Checkbox.js +9 -8
  274. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  275. package/dist/esm/components/Menu/components/Content.js +13 -10
  276. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  277. package/dist/esm/components/Menu/components/Header.js +4 -4
  278. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  279. package/dist/esm/components/Menu/components/Item.js +35 -34
  280. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  281. package/dist/esm/components/Menu/components/Link.js +11 -10
  282. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  283. package/dist/esm/components/Menu/components/RadioGroup.js +18 -16
  284. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  285. package/dist/esm/components/Menu/components/Separator.js +4 -4
  286. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  287. package/dist/esm/components/Menu/components/Trigger.js +5 -5
  288. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  289. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  290. package/dist/esm/components/Pagination/PageNumbers.js +28 -23
  291. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  292. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  293. package/dist/esm/components/Pagination/usePagination.js +21 -7
  294. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  295. package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
  296. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  297. package/dist/esm/components/Popover/Popover.js.map +1 -1
  298. package/dist/esm/components/Popover/Primitives.js +8 -7
  299. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  300. package/dist/esm/components/Progress/Progress.js.map +1 -1
  301. package/dist/esm/components/Provider/Provider.js.map +1 -1
  302. package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
  303. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  304. package/dist/esm/components/Select/Select.js.map +1 -1
  305. package/dist/esm/components/Select/useSelect.js +82 -63
  306. package/dist/esm/components/Select/useSelect.js.map +1 -1
  307. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  308. package/dist/esm/components/Switch/Switch.js.map +1 -1
  309. package/dist/esm/components/Table/components/BaseTable.js +30 -23
  310. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  311. package/dist/esm/components/Table/components/PaginatedTable.js +7 -3
  312. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  313. package/dist/esm/components/Table/components/Table.js +25 -18
  314. package/dist/esm/components/Table/components/Table.js.map +1 -1
  315. package/dist/esm/components/Table/components/WindowedTable.js +104 -88
  316. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  317. package/dist/esm/components/Table/hooks/plugins/useRowActions.js +146 -122
  318. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  319. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +61 -57
  320. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  321. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +36 -39
  322. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  323. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +90 -80
  324. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  325. package/dist/esm/components/Table/hooks/useRowCreation.js +64 -29
  326. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  327. package/dist/esm/components/Table/hooks/useTable.js +141 -119
  328. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  329. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +15 -12
  330. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  331. package/dist/esm/components/Table/util/renderColumn.js +10 -10
  332. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  333. package/dist/esm/components/Table/util/renderRow.js +46 -37
  334. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  335. package/dist/esm/components/Table/util/rowIndexPath.js +16 -14
  336. package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
  337. package/dist/esm/components/Table/util/sortTypes.js +31 -23
  338. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  339. package/dist/esm/components/Table/util.js +41 -29
  340. package/dist/esm/components/Table/util.js.map +1 -1
  341. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  342. package/dist/esm/components/Textarea/Textarea.js +1 -0
  343. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  344. package/dist/esm/components/Toast/Toast.js +21 -20
  345. package/dist/esm/components/Toast/Toast.js.map +1 -1
  346. package/dist/esm/components/Toast/Toaster.js +3 -2
  347. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  348. package/dist/esm/components/Toast/util.js +2 -2
  349. package/dist/esm/components/Toast/util.js.map +1 -1
  350. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  351. package/dist/esm/components/Tour/Tour.js.map +1 -1
  352. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  353. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  354. package/dist/esm/index.css +642 -642
  355. package/dist/esm/index.js +1 -1
  356. package/dist/esm/primitives/Button.js +13 -9
  357. package/dist/esm/primitives/Button.js.map +1 -1
  358. package/dist/esm/utils/date.js.map +1 -1
  359. package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
  360. package/dist/esm/utils/hooks/useDraggable.js +18 -16
  361. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  362. package/dist/esm/utils/hooks/useDropTarget.js +10 -7
  363. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  364. package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  365. package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
  366. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  367. package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
  368. package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
  369. package/dist/esm/utils/hooks/useTimer.js +17 -9
  370. package/dist/esm/utils/hooks/useTimer.js.map +1 -1
  371. package/dist/esm/utils/input.js +11 -7
  372. package/dist/esm/utils/input.js.map +1 -1
  373. package/dist/esm/utils/mergeRefs.js +2 -2
  374. package/dist/esm/utils/mergeRefs.js.map +1 -1
  375. package/dist/esm/utils/taillwind.js +2 -2
  376. package/dist/esm/utils/taillwind.js.map +1 -1
  377. package/dist/index.css +642 -642
  378. package/dist/taco.cjs.development.js +1878 -1510
  379. package/dist/taco.cjs.development.js.map +1 -1
  380. package/dist/taco.cjs.production.min.js +1 -1
  381. package/dist/taco.cjs.production.min.js.map +1 -1
  382. package/package.json +2 -2
  383. package/plugins/tailwindcss-aria-attributes.js +73 -73
  384. package/tailwind.config.js +297 -297
  385. package/types.json +11 -3
  386. package/dist/esm/components/Icon/components/ExportToExcelCopy.js.map +0 -1
  387. package/dist/esm/components/Icon/components/Thumb.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\r\nimport { Orientation } from '../../types';\r\n\r\nexport type RadioGroupItemValue = string | number | boolean | null;\r\n\r\nexport const getRadioGroupItemValueAsString = (value: RadioGroupItemValue): string => (value === null ? '' : String(value));\r\n\r\nexport const findByValue = (values: RadioGroupItemValue[], valueAsString: string): RadioGroupItemValue =>\r\n values.find(value => getRadioGroupItemValueAsString(value) === valueAsString) as RadioGroupItemValue;\r\n\r\nconst RadioGroupContext = React.createContext({ disabled: false, invalid: false });\r\n\r\nexport type RadioGroupItemProps<T = HTMLButtonElement> = Omit<\r\n React.ButtonHTMLAttributes<T>,\r\n 'children' | 'onSelect' | 'value'\r\n> & {\r\n /** Label for the radio group item */\r\n children: React.ReactNode;\r\n /* Whether the radio group item is disabled */\r\n disabled?: boolean;\r\n /** Value of the radio button */\r\n value: RadioGroupItemValue;\r\n};\r\n\r\nconst RadioGroupItem = React.forwardRef(function RadioGroupItem(props: RadioGroupItemProps, ref: React.Ref<HTMLButtonElement>) {\r\n const context = React.useContext(RadioGroupContext);\r\n const { children, value, ...otherProps } = props;\r\n\r\n const disabled = context.disabled || props.disabled;\r\n\r\n const className = cn('flex items-center justify-center h-4 w-4 mr-2 rounded-full bg-white border-2 ', {\r\n 'border-grey-dark focus:border-blue focus:yt-focus aria-checked:bg-blue aria-checked:border-blue':\r\n !disabled && !context.invalid,\r\n 'border-grey cursor-not-allowed aria-checked:bg-grey-dark aria-checked:border-grey-dark': disabled,\r\n 'border-red text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red':\r\n context.invalid && !disabled,\r\n });\r\n const labelClassName = cn('flex items-center cursor-pointer', {\r\n 'cursor-not-allowed text-grey-dark': disabled,\r\n });\r\n\r\n return (\r\n <label className={labelClassName}>\r\n <RadioGroupPrimitive.Item\r\n {...otherProps}\r\n className={className}\r\n disabled={disabled}\r\n ref={ref}\r\n value={getRadioGroupItemValueAsString(value)}\r\n >\r\n <RadioGroupPrimitive.Indicator className=\"h-2 w-2 rounded-full bg-white\" />\r\n </RadioGroupPrimitive.Item>\r\n {children}\r\n </label>\r\n );\r\n});\r\n\r\ntype ReactGroupBaseChild = React.ReactElement<RadioGroupItemProps> | boolean | null;\r\n\r\ntype RadioGroupBaseProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> & {\r\n children: ReactGroupBaseChild[];\r\n /* Whether the radio group is disabled */\r\n disabled?: boolean;\r\n /* Whether the radio group is in an invalid state */\r\n invalid?: boolean;\r\n /** The name of the radio group, used when submitting an HTML form */\r\n name?: string;\r\n /**\r\n * Orientation of the radio group\r\n * @defaultValue vertical\r\n */\r\n orientation?: Orientation;\r\n /* Whether the radio group requires user input */\r\n required?: boolean;\r\n};\r\n\r\ninterface UncontrolledRadioGroupProps extends RadioGroupBaseProps {\r\n /* The default value (uncontrolled) */\r\n defaultValue?: RadioGroupItemValue;\r\n onChange?: never;\r\n value?: never;\r\n}\r\n\r\ninterface ControlledRadioGroupProps extends RadioGroupBaseProps {\r\n defaultValue?: never;\r\n /** Handler called when the value changes */\r\n onChange: (value: RadioGroupItemValue) => void;\r\n /** The current value (controlled) */\r\n value?: RadioGroupItemValue;\r\n}\r\n\r\nexport type RadioGroupProps = UncontrolledRadioGroupProps | ControlledRadioGroupProps;\r\n\r\nexport type ForwardedRadioGroupWithStatics = React.ForwardRefExoticComponent<\r\n RadioGroupProps & React.RefAttributes<HTMLDivElement>\r\n> & {\r\n /** Item component rendered in a `RadioGroup` component */\r\n Item: React.ForwardRefExoticComponent<RadioGroupItemProps>;\r\n};\r\n\r\nexport const useRadioGroup = (props: RadioGroupProps) => {\r\n const { children, defaultValue, disabled, invalid, onChange, orientation = 'vertical', value, ...otherProps } = props;\r\n\r\n const values = React.useMemo<RadioGroupItemValue[]>(() => {\r\n const radioGroupItemValues: RadioGroupItemValue[] = [];\r\n\r\n React.Children.forEach(children, child => {\r\n if (React.isValidElement(child)) {\r\n radioGroupItemValues.push(child.props.value);\r\n }\r\n });\r\n\r\n return radioGroupItemValues;\r\n }, [children]);\r\n\r\n const context = React.useMemo(() => ({ disabled: disabled ?? false, invalid: invalid ?? false }), [disabled, invalid]);\r\n\r\n let valueProps;\r\n\r\n if (onChange !== undefined) {\r\n const handleChange = (value: string): void => onChange(findByValue(values, value));\r\n\r\n valueProps = {\r\n onValueChange: handleChange,\r\n value: value !== undefined ? getRadioGroupItemValueAsString(value) : undefined,\r\n };\r\n } else {\r\n valueProps = {\r\n defaultValue: defaultValue !== undefined ? getRadioGroupItemValueAsString(defaultValue) : undefined,\r\n };\r\n }\r\n\r\n return {\r\n context,\r\n props: {\r\n ...otherProps,\r\n ...valueProps,\r\n children,\r\n orientation,\r\n },\r\n };\r\n};\r\n\r\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) {\r\n const { context, props: otherProps } = useRadioGroup(props);\r\n const className = cn(\r\n 'flex items-start',\r\n {\r\n 'flex-wrap space-x-4': otherProps.orientation === 'horizontal',\r\n 'flex-col space-y-2': otherProps.orientation === 'vertical',\r\n },\r\n otherProps.className\r\n );\r\n\r\n return (\r\n <RadioGroupContext.Provider value={context}>\r\n <RadioGroupPrimitive.Root {...otherProps} className={className} data-taco=\"radio-group\" ref={ref} />\r\n </RadioGroupContext.Provider>\r\n );\r\n}) as ForwardedRadioGroupWithStatics;\r\nRadioGroup.Item = RadioGroupItem;\r\n"],"names":["getRadioGroupItemValueAsString","value","String","findByValue","values","valueAsString","find","RadioGroupContext","React","disabled","invalid","RadioGroupItem","props","ref","context","children","otherProps","className","cn","labelClassName","RadioGroupPrimitive","useRadioGroup","defaultValue","onChange","orientation","radioGroupItemValues","forEach","child","push","valueProps","undefined","handleChange","onValueChange","RadioGroup","Provider","Item"],"mappings":";;;;;;;IAOaA,8BAA8B,GAAG,SAAjCA,8BAAiC,CAACC,KAAD;AAAA,SAAyCA,KAAK,KAAK,IAAV,GAAiB,EAAjB,GAAsBC,MAAM,CAACD,KAAD,CAArE;AAAA;IAEjCE,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD,EAAgCC,aAAhC;AAAA,SACvBD,MAAM,CAACE,IAAP,CAAY,UAAAL,KAAK;AAAA,WAAID,8BAA8B,CAACC,KAAD,CAA9B,KAA0CI,aAA9C;AAAA,GAAjB,CADuB;AAAA;AAG3B,IAAME,iBAAiB,gBAAGC,aAAA,CAAoB;AAAEC,EAAAA,QAAQ,EAAE,KAAZ;AAAmBC,EAAAA,O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8D6B;AAF5D,KAAb;AAIH,GAPD,MAOO;AACHD,IAAAA,UAAU,GAAG;AACTP,MAAAA,YAAY,EAAEA,YAAY,KAAKQ,SAAjB,GAA6B9B,8BAA8B,CAACsB,YAAD,CAA3D,GAA4EQ;AADjF,KAAb;AAGH;;AAED,SAAO;AACHhB,IAAAA,OAAO,EAAPA,OADG;AAEHF,IAAAA,KAAK,eACEI,UADF,EAEEa,UAFF;AAGDd,MAAAA,QAAQ,EAARA,QAHC;AAIDS,MAAAA,WAAW,EAAXA;AAJC;AAFF,GAAP;AASH;IAEYS,UAAU,gBAAGzB,UAAA,CAAiB,SAASyB,UAAT,CAAoBrB,KAApB,EAA4CC,GAA5C;AACvC,uBAAuCQ,aAAa,CAACT,KAAD,CAApD;AAAA,MAAQE,OAAR,kBAAQA,OAAR;AAAA,MAAwBE,UAAxB,kBAAiBJ,KAAjB;;AACA,MAAMK,SAAS,GAAGC,EAAE,CAChB,kBADgB,EAEhB;AACI,2BAAuBF,UAAU,CAACQ,WAAX,KAA2B,YADtD;AAEI,0BAAsBR,UAAU,CAACQ,WAAX,KAA2B;AAFrD,GAFgB,EAMhBR,UAAU,CAACC,SANK,CAApB;AASA,SACIT,aAAA,CAACD,iBAAiB,CAAC2B,QAAnB;AAA4BjC,IAAAA,KAAK,EAAEa;GAAnC,EACIN,aAAA,CAACY,IAAD,oBAA8BJ;AAAYC,IAAAA,SAAS,EAAEA;iBAAqB;AAAcJ,IAAAA,GAAG,EAAEA;IAA7F,CADJ,CADJ;AAKH,CAhByB;AAiB1BoB,UAAU,CAACE,IAAX,GAAkBxB,cAAlB;;;;"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Orientation } from '../../types';\n\nexport type RadioGroupItemValue = string | number | boolean | null;\n\nexport const getRadioGroupItemValueAsString = (value: RadioGroupItemValue): string => (value === null ? '' : String(value));\n\nexport const findByValue = (values: RadioGroupItemValue[], valueAsString: string): RadioGroupItemValue =>\n values.find(value => getRadioGroupItemValueAsString(value) === valueAsString) as RadioGroupItemValue;\n\nconst RadioGroupContext = React.createContext({ disabled: false, invalid: false });\n\nexport type RadioGroupItemProps<T = HTMLButtonElement> = Omit<\n React.ButtonHTMLAttributes<T>,\n 'children' | 'onSelect' | 'value'\n> & {\n /** Label for the radio group item */\n children: React.ReactNode;\n /* Whether the radio group item is disabled */\n disabled?: boolean;\n /** Value of the radio button */\n value: RadioGroupItemValue;\n};\n\nconst RadioGroupItem = React.forwardRef(function RadioGroupItem(props: RadioGroupItemProps, ref: React.Ref<HTMLButtonElement>) {\n const context = React.useContext(RadioGroupContext);\n const { children, value, ...otherProps } = props;\n\n const disabled = context.disabled || props.disabled;\n\n const className = cn('flex items-center justify-center h-4 w-4 mr-2 rounded-full bg-white border-2 ', {\n 'border-grey-dark focus:border-blue focus:yt-focus aria-checked:bg-blue aria-checked:border-blue':\n !disabled && !context.invalid,\n 'border-grey cursor-not-allowed aria-checked:bg-grey-dark aria-checked:border-grey-dark': disabled,\n 'border-red text-red focus:border-red focus:yt-focus-red aria-checked:bg-red aria-checked:border-red':\n context.invalid && !disabled,\n });\n const labelClassName = cn('flex items-center cursor-pointer', {\n 'cursor-not-allowed text-grey-dark': disabled,\n });\n\n return (\n <label className={labelClassName}>\n <RadioGroupPrimitive.Item\n {...otherProps}\n className={className}\n disabled={disabled}\n ref={ref}\n value={getRadioGroupItemValueAsString(value)}\n >\n <RadioGroupPrimitive.Indicator className=\"h-2 w-2 rounded-full bg-white\" />\n </RadioGroupPrimitive.Item>\n {children}\n </label>\n );\n});\n\ntype ReactGroupBaseChild = React.ReactElement<RadioGroupItemProps> | boolean | null;\n\ntype RadioGroupBaseProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> & {\n children: ReactGroupBaseChild[];\n /* Whether the radio group is disabled */\n disabled?: boolean;\n /* Whether the radio group is in an invalid state */\n invalid?: boolean;\n /** The name of the radio group, used when submitting an HTML form */\n name?: string;\n /**\n * Orientation of the radio group\n * @defaultValue vertical\n */\n orientation?: Orientation;\n /* Whether the radio group requires user input */\n required?: boolean;\n};\n\ninterface UncontrolledRadioGroupProps extends RadioGroupBaseProps {\n /* The default value (uncontrolled) */\n defaultValue?: RadioGroupItemValue;\n onChange?: never;\n value?: never;\n}\n\ninterface ControlledRadioGroupProps extends RadioGroupBaseProps {\n defaultValue?: never;\n /** Handler called when the value changes */\n onChange: (value: RadioGroupItemValue) => void;\n /** The current value (controlled) */\n value?: RadioGroupItemValue;\n}\n\nexport type RadioGroupProps = UncontrolledRadioGroupProps | ControlledRadioGroupProps;\n\nexport type ForwardedRadioGroupWithStatics = React.ForwardRefExoticComponent<\n RadioGroupProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Item component rendered in a `RadioGroup` component */\n Item: React.ForwardRefExoticComponent<RadioGroupItemProps>;\n};\n\nexport const useRadioGroup = (props: RadioGroupProps) => {\n const { children, defaultValue, disabled, invalid, onChange, orientation = 'vertical', value, ...otherProps } = props;\n\n const values = React.useMemo<RadioGroupItemValue[]>(() => {\n const radioGroupItemValues: RadioGroupItemValue[] = [];\n\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n radioGroupItemValues.push(child.props.value);\n }\n });\n\n return radioGroupItemValues;\n }, [children]);\n\n const context = React.useMemo(() => ({ disabled: disabled ?? false, invalid: invalid ?? false }), [disabled, invalid]);\n\n let valueProps;\n\n if (onChange !== undefined) {\n const handleChange = (value: string): void => onChange(findByValue(values, value));\n\n valueProps = {\n onValueChange: handleChange,\n value: value !== undefined ? getRadioGroupItemValueAsString(value) : undefined,\n };\n } else {\n valueProps = {\n defaultValue: defaultValue !== undefined ? getRadioGroupItemValueAsString(defaultValue) : undefined,\n };\n }\n\n return {\n context,\n props: {\n ...otherProps,\n ...valueProps,\n children,\n orientation,\n },\n };\n};\n\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { context, props: otherProps } = useRadioGroup(props);\n const className = cn(\n 'flex items-start',\n {\n 'flex-wrap space-x-4': otherProps.orientation === 'horizontal',\n 'flex-col space-y-2': otherProps.orientation === 'vertical',\n },\n otherProps.className\n );\n\n return (\n <RadioGroupContext.Provider value={context}>\n <RadioGroupPrimitive.Root {...otherProps} className={className} data-taco=\"radio-group\" ref={ref} />\n </RadioGroupContext.Provider>\n );\n}) as ForwardedRadioGroupWithStatics;\nRadioGroup.Item = RadioGroupItem;\n"],"names":["getRadioGroupItemValueAsString","value","String","findByValue","values","valueAsString","find","RadioGroupContext","React","disabled","invalid","RadioGroupItem","props","ref","context","children","otherProps","className","cn","labelClassName","RadioGroupPrimitive","useRadioGroup","defaultValue","onChange","orientation","radioGroupItemValues","forEach","child","push","valueProps","undefined","handleChange","onValueChange","RadioGroup","Provider","Item"],"mappings":";;;;;;;IAOaA,8BAA8B,GAAG,SAAjCA,8BAAiC,CAACC,KAAD;AAAA,SAAyCA,KAAK,KAAK,IAAV,GAAiB,EAAjB,GAAsBC,MAAM,CAACD,KAAD,CAArE;AAAA;IAEjCE,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD,EAAgCC,aAAhC;AAAA,SACvBD,MAAM,CAACE,IAAP,CAAY,UAAAL,KAAK;AAAA,WAAID,8BAA8B,CAACC,KAAD,CAA9B,KAA0CI,aAA9C;AAAA,GAAjB,CADuB;AAAA;AAG3B,IAAME,iBAAiB,gBAAGC,aAAA,CAAoB;AAAEC,EAAAA,QAAQ,EAAE,KAAZ;AAAmBC,EAAAA,OAAO,EAAE;AAA5B,CAApB,CAA1B;AAcA,IAAMC,cAAc,gBAAGH,UAAA,CAAiB,SAASG,cAAT,CAAwBC,KAAxB,EAAoDC,GAApD;AACpC,MAAMC,OAAO,GAAGN,UAAA,CAAiBD,iBAAjB,CAAhB;;AACA,MAAQQ,QAAR,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HhB,IAAAA,OAAO,EAAPA,OADG;AAEHF,IAAAA,KAAK,eACEI,UADF,EAEEa,UAFF;AAGDd,MAAAA,QAAQ,EAARA,QAHC;AAIDS,MAAAA,WAAW,EAAXA;AAJC;AAFF,GAAP;AASH;IAEYS,UAAU,gBAAGzB,UAAA,CAAiB,SAASyB,UAAT,CAAoBrB,KAApB,EAA4CC,GAA5C;AACvC,uBAAuCQ,aAAa,CAACT,KAAD,CAApD;AAAA,MAAQE,OAAR,kBAAQA,OAAR;AAAA,MAAwBE,UAAxB,kBAAiBJ,KAAjB;;AACA,MAAMK,SAAS,GAAGC,EAAE,CAChB,kBADgB,EAEhB;AACI,2BAAuBF,UAAU,CAACQ,WAAX,KAA2B,YADtD;AAEI,0BAAsBR,UAAU,CAACQ,WAAX,KAA2B;AAFrD,GAFgB,EAMhBR,UAAU,CAACC,SANK,CAApB;AASA,SACIT,aAAA,CAACD,iBAAiB,CAAC2B,QAAnB;AAA4BjC,IAAAA,KAAK,EAAEa;GAAnC,EACIN,aAAA,CAACY,IAAD,oBAA8BJ;AAAYC,IAAAA,SAAS,EAAEA;iBAAqB;AAAcJ,IAAAA,GAAG,EAAEA;IAA7F,CADJ,CADJ;AAKH,CAhByB;AAiB1BoB,UAAU,CAACE,IAAX,GAAkBxB,cAAlB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.js","sources":["../../../../src/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport keycode from 'keycode';\r\nimport { Input, InputProps, useLocalization, IconButton } from '../..';\r\n\r\nexport type SearchInputTexts = {\r\n /**\r\n * aria-label text for input\r\n */\r\n inputLabel: string;\r\n};\r\n\r\nexport type SearchInputProps = Omit<InputProps, 'icon'> & {\r\n /** Current input value will be passed to the method. In order to get the value, the component must be controlled otherwise value will always be undefined */\r\n onSearch?: (value: string | number | readonly string[] | undefined) => void;\r\n};\r\n\r\nexport const SearchInput = React.forwardRef(function SearchInput(\r\n { onSearch, ...props }: SearchInputProps,\r\n ref: React.Ref<HTMLInputElement>\r\n) {\r\n const { texts } = useLocalization();\r\n\r\n const handleClick = (): void => {\r\n if (!props.disabled) {\r\n onSearch?.(props.value);\r\n }\r\n };\r\n\r\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\r\n const isEnterKeyPressed = event.keyCode === keycode('enter');\r\n\r\n if (isEnterKeyPressed) {\r\n handleClick();\r\n }\r\n };\r\n\r\n return (\r\n <Input\r\n aria-label={texts.searchInput.inputLabel}\r\n {...props}\r\n button={\r\n <IconButton\r\n icon=\"search\"\r\n className=\"!border-transparent !bg-transparent\"\r\n disabled={props.disabled}\r\n onClick={handleClick}\r\n />\r\n }\r\n onKeyDown={handleKeyDown}\r\n ref={ref}\r\n type=\"search\"\r\n />\r\n );\r\n});\r\n"],"names":["SearchInput","React","ref","onSearch","props","useLocalization","texts","handleClick","disabled","value","handleKeyDown","event","isEnterKeyPressed","keyCode","keycode","Input","searchInput","inputLabel","button","IconButton","icon","className","onClick","onKeyDown","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBaA,WAAW,gBAAGC,UAAA,CAAiB,SAASD,WAAT,OAExCE,GAFwC;MACtCC,gBAAAA;MAAaC;;AAGf,yBAAkBC,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AAEA,MAAMC,WAAW,GAAG,SAAdA,WAAc;AAChB,QAAI,CAACH,KAAK,CAACI,QAAX,EAAqB;AACjBL,MAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGC,KAAK,CAACK,KAAT,CAAR;AACH;AACJ,GAJD;;AAMA,MAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;AAClB,QAAMC,iBAAiB,GAAGD,KAAK,CAACE,OAAN,KAAkBC,OAAO,CAAC,OAAD,CAAnD;;AAEA,QAAIF,iBAAJ,EAAuB;AACnBL,MAAAA,WAAW;AACd;AACJ,GAND;;AAQA,SACIN,aAAA,CAACc,KAAD;kBACgBT,KAAK,CAACU,WAAN,CAAkBC;KAC1Bb;AACJc,IAAAA,MAAM,EACFjB,aAAA,CAACkB,UAAD;AACIC,MAAAA,IAAI,EAAC;AACLC,MAAAA,SAAS,EAAC;AACVb,MAAAA,QAAQ,EAAEJ,KAAK,CAACI;AAChBc,MAAAA,OAAO,EAAEf;KAJb;AAOJgB,IAAAA,SAAS,EAAEb;AACXR,IAAAA,GAAG,EAAEA;AACLsB,IAAAA,IAAI,EAAC;IAbT,CADJ;AAiBH,CArC0B;;;;"}
1
+ {"version":3,"file":"SearchInput.js","sources":["../../../../src/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport keycode from 'keycode';\nimport { Input, InputProps, useLocalization, IconButton } from '../..';\n\nexport type SearchInputTexts = {\n /**\n * aria-label text for input\n */\n inputLabel: string;\n};\n\nexport type SearchInputProps = Omit<InputProps, 'icon'> & {\n /** Current input value will be passed to the method. In order to get the value, the component must be controlled otherwise value will always be undefined */\n onSearch?: (value: string | number | readonly string[] | undefined) => void;\n};\n\nexport const SearchInput = React.forwardRef(function SearchInput(\n { onSearch, ...props }: SearchInputProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const { texts } = useLocalization();\n\n const handleClick = (): void => {\n if (!props.disabled) {\n onSearch?.(props.value);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n const isEnterKeyPressed = event.keyCode === keycode('enter');\n\n if (isEnterKeyPressed) {\n handleClick();\n }\n };\n\n return (\n <Input\n aria-label={texts.searchInput.inputLabel}\n {...props}\n button={\n <IconButton\n icon=\"search\"\n className=\"!border-transparent !bg-transparent\"\n disabled={props.disabled}\n onClick={handleClick}\n />\n }\n onKeyDown={handleKeyDown}\n ref={ref}\n type=\"search\"\n />\n );\n});\n"],"names":["SearchInput","React","ref","onSearch","props","useLocalization","texts","handleClick","disabled","value","handleKeyDown","event","isEnterKeyPressed","keyCode","keycode","Input","searchInput","inputLabel","button","IconButton","icon","className","onClick","onKeyDown","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBaA,WAAW,gBAAGC,UAAA,CAAiB,SAASD,WAAT,OAExCE,GAFwC;MACtCC,gBAAAA;MAAaC;;AAGf,yBAAkBC,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AAEA,MAAMC,WAAW,GAAG,SAAdA,WAAc;AAChB,QAAI,CAACH,KAAK,CAACI,QAAX,EAAqB;AACjBL,MAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAGC,KAAK,CAACK,KAAT,CAAR;AACH;AACJ,GAJD;;AAMA,MAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;AAClB,QAAMC,iBAAiB,GAAGD,KAAK,CAACE,OAAN,KAAkBC,OAAO,CAAC,OAAD,CAAnD;;AAEA,QAAIF,iBAAJ,EAAuB;AACnBL,MAAAA,WAAW;AACd;AACJ,GAND;;AAQA,SACIN,aAAA,CAACc,KAAD;kBACgBT,KAAK,CAACU,WAAN,CAAkBC;KAC1Bb;AACJc,IAAAA,MAAM,EACFjB,aAAA,CAACkB,UAAD;AACIC,MAAAA,IAAI,EAAC;AACLC,MAAAA,SAAS,EAAC;AACVb,MAAAA,QAAQ,EAAEJ,KAAK,CAACI;AAChBc,MAAAA,OAAO,EAAEf;KAJb;AAOJgB,IAAAA,SAAS,EAAEb;AACXR,IAAAA,GAAG,EAAEA;AACLsB,IAAAA,IAAI,EAAC;IAbT,CADJ;AAiBH,CArC0B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\r\nimport { Icon } from '../Icon/Icon';\r\nimport { Listbox, MultiListbox, ListboxProps } from '../Listbox/Listbox';\r\nimport { useBoundingClientRectListener } from '../../utils/hooks/useBoundingClientRectListener';\r\nimport { useSelect } from './useSelect';\r\nimport { Combobox, ComboboxProps } from '../Combobox/Combobox';\r\nimport { Badge } from '../Badge/Badge';\r\nimport { getInputClasses } from '../Input/util';\r\n\r\nexport type SelectTexts = {\r\n /**\r\n * The text displayed when all options are selected when multiselect mode in on.\r\n */\r\n allOptionsSelected: string;\r\n};\r\n\r\nexport type BaseSelectProps = ListboxProps &\r\n Omit<ComboboxProps, 'inline'> & {\r\n /**\r\n * Allows to select multiple values.\r\n * All the selected values will be combined in a comma-seperated string as the value of the input.\r\n */\r\n multiselect?: boolean;\r\n };\r\n\r\nexport type SelectProps = BaseSelectProps & {\r\n /**\r\n * Creates an editable select.\r\n * Setting this will render a inline Combobox which will display the provided data on click/focus,\r\n * even if there is no value in the input.\r\n * After user starts typing, matching data will be displayed.\r\n */\r\n editable?: boolean;\r\n};\r\n\r\nconst BaseSelect = React.forwardRef(function BaseSelect(props: BaseSelectProps, ref: React.Ref<HTMLInputElement>) {\r\n const { autoFocus, className: externalClassName, highlighted, style, ...otherProps } = props;\r\n const { button, listbox, popover, input, text, more = 0 } = useSelect(otherProps, ref);\r\n const internalRef = React.useRef<HTMLButtonElement>(null);\r\n const selectDimensions = useBoundingClientRectListener(internalRef);\r\n const className = cn('inline-flex relative w-full', { 'yt-select--readonly': props.readOnly }, externalClassName);\r\n const inputClassname = cn(getInputClasses(props), 'text-left pr-0', {\r\n 'border-blue': popover.open,\r\n });\r\n\r\n React.useEffect(() => {\r\n if (autoFocus && internalRef.current) {\r\n internalRef.current.focus();\r\n }\r\n }, []);\r\n\r\n const renderMultiSelection = (): React.ReactNode => {\r\n return (\r\n <>\r\n <span className=\"flex-grow truncate text-left\">{text}</span>\r\n {more > 0 && <Badge className=\"ml-2\">{`+${more}`}</Badge>}\r\n </>\r\n );\r\n };\r\n\r\n const commonListboxProps = {\r\n ...listbox,\r\n className: 'w-auto',\r\n style: { minWidth: selectDimensions?.width },\r\n tabIndex: popover.open ? 0 : -1,\r\n };\r\n\r\n return (\r\n <span className={className} data-taco=\"select\" style={style}>\r\n <PopoverPrimitive.Root {...popover}>\r\n <PopoverPrimitive.Trigger {...button} className={inputClassname} ref={internalRef}>\r\n {props.multiselect ? renderMultiSelection() : <span className=\"flex-grow truncate text-left\">{text}</span>}\r\n <span className=\"flex h-8 w-8 items-center justify-center\">\r\n <Icon className=\"pointer-events-none\" name={popover.open ? 'chevron-up' : 'chevron-down'} />\r\n </span>\r\n </PopoverPrimitive.Trigger>\r\n <PopoverPrimitive.Content align=\"start\" sideOffset={4}>\r\n {props.multiselect ? <MultiListbox {...commonListboxProps} /> : <Listbox {...commonListboxProps} />}\r\n </PopoverPrimitive.Content>\r\n <input {...input} className=\"hidden\" type=\"text\" />\r\n </PopoverPrimitive.Root>\r\n </span>\r\n );\r\n});\r\n\r\nexport const Select = React.forwardRef(function Select(props: SelectProps, ref: React.Ref<HTMLInputElement>) {\r\n const { editable, ...otherProps } = props;\r\n\r\n if (editable) {\r\n return <Combobox {...otherProps} inline ref={ref} />;\r\n }\r\n\r\n return <BaseSelect {...otherProps} ref={ref} />;\r\n});\r\n"],"names":["BaseSelect","React","props","ref","autoFocus","externalClassName","className","style","otherProps","useSelect","button","listbox","popover","input","text","more","internalRef","selectDimensions","useBoundingClientRectListener","cn","readOnly","inputClassname","getInputClasses","open","current","focus","renderMultiSelection","Badge","commonListboxProps","minWidth","width","tabIndex","PopoverPrimitive","multiselect","Icon","name","align","sideOffset","MultiListbox","Listbox","type","Select","editable","Combobox","inline"],"mappings":";;;;;;;;;;;;;;AAqCA,IAAMA,UAAU,gBAAGC,UAAA,CAAiB,SAASD,UAAT,CAAoBE,KAApB,EAA4CC,GAA5C;AAChC,MAAQC,SAAR,GAAuFF,KAAvF,CAAQE,SAAR;AAAA,MAA8BC,iBAA9B,GAAuFH,KAAvF,CAAmBI,SAAnB;AAAA,MAA8DC,KAA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ACnC,MAAQuC,QAAR,GAAoCxC,KAApC,CAAQwC,QAAR;AAAA,MAAqBlC,UAArB,iCAAoCN,KAApC;;AAEA,MAAIwC,QAAJ,EAAc;AACV,WAAOzC,aAAA,CAAC0C,QAAD,oBAAcnC;AAAYoC,MAAAA,MAAM;AAACzC,MAAAA,GAAG,EAAEA;MAAtC,CAAP;AACH;;AAED,SAAOF,aAAA,CAACD,UAAD,oBAAgBQ;AAAYL,IAAAA,GAAG,EAAEA;IAAjC,CAAP;AACH,CARqB;;;;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Icon } from '../Icon/Icon';\nimport { Listbox, MultiListbox, ListboxProps } from '../Listbox/Listbox';\nimport { useBoundingClientRectListener } from '../../utils/hooks/useBoundingClientRectListener';\nimport { useSelect } from './useSelect';\nimport { Combobox, ComboboxProps } from '../Combobox/Combobox';\nimport { Badge } from '../Badge/Badge';\nimport { getInputClasses } from '../Input/util';\n\nexport type SelectTexts = {\n /**\n * The text displayed when all options are selected when multiselect mode in on.\n */\n allOptionsSelected: string;\n};\n\nexport type BaseSelectProps = ListboxProps &\n Omit<ComboboxProps, 'inline'> & {\n /**\n * Allows to select multiple values.\n * All the selected values will be combined in a comma-seperated string as the value of the input.\n */\n multiselect?: boolean;\n };\n\nexport type SelectProps = BaseSelectProps & {\n /**\n * Creates an editable select.\n * Setting this will render a inline Combobox which will display the provided data on click/focus,\n * even if there is no value in the input.\n * After user starts typing, matching data will be displayed.\n */\n editable?: boolean;\n};\n\nconst BaseSelect = React.forwardRef(function BaseSelect(props: BaseSelectProps, ref: React.Ref<HTMLInputElement>) {\n const { autoFocus, className: externalClassName, highlighted, style, ...otherProps } = props;\n const { button, listbox, popover, input, text, more = 0 } = useSelect(otherProps, ref);\n const internalRef = React.useRef<HTMLButtonElement>(null);\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn('inline-flex relative w-full', { 'yt-select--readonly': props.readOnly }, externalClassName);\n const inputClassname = cn(getInputClasses(props), 'text-left pr-0', {\n 'border-blue': popover.open,\n });\n\n React.useEffect(() => {\n if (autoFocus && internalRef.current) {\n internalRef.current.focus();\n }\n }, []);\n\n const renderMultiSelection = (): React.ReactNode => {\n return (\n <>\n <span className=\"flex-grow truncate text-left\">{text}</span>\n {more > 0 && <Badge className=\"ml-2\">{`+${more}`}</Badge>}\n </>\n );\n };\n\n const commonListboxProps = {\n ...listbox,\n className: 'w-auto',\n style: { minWidth: selectDimensions?.width },\n tabIndex: popover.open ? 0 : -1,\n };\n\n return (\n <span className={className} data-taco=\"select\" style={style}>\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Trigger {...button} className={inputClassname} ref={internalRef}>\n {props.multiselect ? renderMultiSelection() : <span className=\"flex-grow truncate text-left\">{text}</span>}\n <span className=\"flex h-8 w-8 items-center justify-center\">\n <Icon className=\"pointer-events-none\" name={popover.open ? 'chevron-up' : 'chevron-down'} />\n </span>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content align=\"start\" sideOffset={4}>\n {props.multiselect ? <MultiListbox {...commonListboxProps} /> : <Listbox {...commonListboxProps} />}\n </PopoverPrimitive.Content>\n <input {...input} className=\"hidden\" type=\"text\" />\n </PopoverPrimitive.Root>\n </span>\n );\n});\n\nexport const Select = React.forwardRef(function Select(props: SelectProps, ref: React.Ref<HTMLInputElement>) {\n const { editable, ...otherProps } = props;\n\n if (editable) {\n return <Combobox {...otherProps} inline ref={ref} />;\n }\n\n return <BaseSelect {...otherProps} ref={ref} />;\n});\n"],"names":["BaseSelect","React","props","ref","autoFocus","externalClassName","className","style","otherProps","useSelect","button","listbox","popover","input","text","more","internalRef","selectDimensions","useBoundingClientRectListener","cn","readOnly","inputClassname","getInputClasses","open","current","focus","renderMultiSelection","Badge","commonListboxProps","minWidth","width","tabIndex","PopoverPrimitive","multiselect","Icon","name","align","side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D3B,aAAA,CAACsC,OAAD,oBAAaX,mBAAb,CADpE,CAPJ,EAUI3B,aAAA,QAAA,oBAAWY;AAAOP,IAAAA,SAAS,EAAC;AAASkC,IAAAA,IAAI,EAAC;IAA1C,CAVJ,CADJ,CADJ;AAgBH,CAhDkB,CAAnB;IAkDaC,MAAM,gBAAGxC,UAAA,CAAiB,SAASwC,MAAT,CAAgBvC,KAAhB,EAAoCC,GAApC;AACnC,MAAQuC,QAAR,GAAoCxC,KAApC,CAAQwC,QAAR;AAAA,MAAqBlC,UAArB,iCAAoCN,KAApC;;AAEA,MAAIwC,QAAJ,EAAc;AACV,WAAOzC,aAAA,CAAC0C,QAAD,oBAAcnC;AAAYoC,MAAAA,MAAM;AAACzC,MAAAA,GAAG,EAAEA;MAAtC,CAAP;AACH;;AAED,SAAOF,aAAA,CAACD,UAAD,oBAAgBQ;AAAYL,IAAAA,GAAG,EAAEA;IAAjC,CAAP;AACH,CARqB;;;;"}
@@ -1,3 +1,4 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { useState, useMemo, useRef, useEffect, createElement, Fragment, cloneElement } from 'react';
2
3
  import cn from 'classnames';
3
4
  import { v4 } from 'uuid';
@@ -6,54 +7,65 @@ import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
6
7
  import keycode from 'keycode';
7
8
  import { useFlattenedData, setInputValueByRef, findByValue, sanitizeItem } from '../Listbox/util.js';
8
9
 
9
- const useSelect = ({
10
- 'aria-label': ariaLabel,
11
- 'aria-labelledby': ariaLabelledBy,
12
- data = [],
13
- defaultValue,
14
- disabled,
15
- emptyValue,
16
- id: nativeId,
17
- multiselect,
18
- onClick,
19
- onChange,
20
- readOnly,
21
- value = emptyValue,
22
- ...otherProps
23
- }, ref) => {
24
- const {
25
- texts
26
- } = useLocalization();
27
- const searchData = useFlattenedData(data);
28
- const inputRef = useProxiedRef(ref);
29
- const [open, setOpen] = useState(false);
30
- const id = useMemo(() => nativeId || `select_${v4()}`, [nativeId]);
31
- const internalInputRef = useRef(null);
32
- const buttonId = `${id}-button`; // support 'escape' resetting to the value that was set when the listbox opened
33
-
34
- const [lastValue, setLastValue] = useState(value);
35
- useEffect(() => {
10
+ var _excluded = ["aria-label", "aria-labelledby", "data", "defaultValue", "disabled", "emptyValue", "id", "multiselect", "onClick", "onChange", "readOnly", "value"];
11
+ var useSelect = function useSelect(_ref, ref) {
12
+ var ariaLabel = _ref['aria-label'],
13
+ ariaLabelledBy = _ref['aria-labelledby'],
14
+ _ref$data = _ref.data,
15
+ data = _ref$data === void 0 ? [] : _ref$data,
16
+ defaultValue = _ref.defaultValue,
17
+ disabled = _ref.disabled,
18
+ emptyValue = _ref.emptyValue,
19
+ nativeId = _ref.id,
20
+ multiselect = _ref.multiselect,
21
+ onChange = _ref.onChange,
22
+ readOnly = _ref.readOnly,
23
+ _ref$value = _ref.value,
24
+ value = _ref$value === void 0 ? emptyValue : _ref$value,
25
+ otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
26
+
27
+ var _useLocalization = useLocalization(),
28
+ texts = _useLocalization.texts;
29
+
30
+ var searchData = useFlattenedData(data);
31
+ var inputRef = useProxiedRef(ref);
32
+
33
+ var _React$useState = useState(false),
34
+ open = _React$useState[0],
35
+ setOpen = _React$useState[1];
36
+
37
+ var id = useMemo(function () {
38
+ return nativeId || "select_" + v4();
39
+ }, [nativeId]);
40
+ var internalInputRef = useRef(null);
41
+ var buttonId = id + "-button"; // support 'escape' resetting to the value that was set when the listbox opened
42
+
43
+ var _React$useState2 = useState(value),
44
+ lastValue = _React$useState2[0],
45
+ setLastValue = _React$useState2[1];
46
+
47
+ useEffect(function () {
36
48
  setLastValue(value);
37
49
  }, [open]);
38
- useEffect(() => {
50
+ useEffect(function () {
39
51
  if (defaultValue !== undefined && value === undefined) {
40
52
  setInputValueByRef(internalInputRef.current, defaultValue);
41
53
  }
42
54
  }, [defaultValue]);
43
- useEffect(() => {
55
+ useEffect(function () {
44
56
  if (value !== undefined) {
45
57
  setInputValueByRef(internalInputRef.current, value);
46
58
  }
47
59
  }, []); // event handlers
48
60
 
49
- const handleButtonKeyDown = event => {
61
+ var handleButtonKeyDown = function handleButtonKeyDown(event) {
50
62
  if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {
51
63
  event.preventDefault();
52
64
  setOpen(true);
53
65
  }
54
66
  };
55
67
 
56
- const handleListboxKeyDown = event => {
68
+ var handleListboxKeyDown = function handleListboxKeyDown(event) {
57
69
  switch (event.keyCode) {
58
70
  case keycode('escape'):
59
71
  {
@@ -84,7 +96,7 @@ const useSelect = ({
84
96
  }
85
97
  };
86
98
 
87
- const handleListboxClick = event => {
99
+ var handleListboxClick = function handleListboxClick(event) {
88
100
  event.preventDefault();
89
101
 
90
102
  if (!multiselect) {
@@ -92,14 +104,16 @@ const useSelect = ({
92
104
  }
93
105
  };
94
106
 
95
- let text = '';
96
- let more = 0;
107
+ var text = '';
108
+ var more = 0;
97
109
 
98
110
  if (value !== undefined) {
99
111
  if (multiselect) {
100
- const selectedValues = (value === null || value === void 0 ? void 0 : value.toString().split(',')) || [];
112
+ var selectedValues = (value === null || value === void 0 ? void 0 : value.toString().split(',')) || [];
101
113
 
102
- if (selectedValues.length === searchData.filter(item => !item.disabled).length) {
114
+ if (selectedValues.length === searchData.filter(function (item) {
115
+ return !item.disabled;
116
+ }).length) {
103
117
  text = texts.select.allOptionsSelected;
104
118
  } else {
105
119
  var _findByValue$text, _findByValue;
@@ -108,7 +122,7 @@ const useSelect = ({
108
122
  more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;
109
123
  }
110
124
  } else {
111
- const item = findByValue(searchData, value);
125
+ var item = findByValue(searchData, value);
112
126
 
113
127
  if (item) {
114
128
  text = item.icon ? createElement(Fragment, null, cloneElement(item.icon, {
@@ -118,24 +132,27 @@ const useSelect = ({
118
132
  }
119
133
  }
120
134
 
121
- const handleInputChange = event => {
135
+ var handleInputChange = function handleInputChange(event) {
122
136
  event.persist();
123
137
 
124
138
  if (onChange) {
125
139
  var _item$path$split, _item$path;
126
140
 
127
- const item = findByValue(searchData, event.target.value);
128
- event.detail = sanitizeItem(item);
129
- const indexes = (_item$path$split = item === null || item === void 0 ? void 0 : (_item$path = item.path) === null || _item$path === void 0 ? void 0 : _item$path.split('.')) !== null && _item$path$split !== void 0 ? _item$path$split : [];
141
+ var _item = findByValue(searchData, event.target.value);
142
+
143
+ event.detail = sanitizeItem(_item);
144
+ var indexes = (_item$path$split = _item === null || _item === void 0 ? void 0 : (_item$path = _item.path) === null || _item$path === void 0 ? void 0 : _item$path.split('.')) !== null && _item$path$split !== void 0 ? _item$path$split : [];
130
145
 
131
146
  if (indexes.length > 1) {
132
147
  // we don't want to map the current item
133
148
  indexes.pop(); // we need to rebuild the path as we map
134
149
 
135
- let lastPath;
136
- event.detail.parents = indexes.map(i => {
150
+ var lastPath;
151
+ event.detail.parents = indexes.map(function (i) {
137
152
  lastPath = lastPath ? [lastPath, i].join('.') : i;
138
- return sanitizeItem(searchData.find(i => i.path === lastPath));
153
+ return sanitizeItem(searchData.find(function (i) {
154
+ return i.path === lastPath;
155
+ }));
139
156
  });
140
157
  }
141
158
 
@@ -143,45 +160,47 @@ const useSelect = ({
143
160
  }
144
161
  };
145
162
 
146
- const button = {
163
+ var button = {
147
164
  'aria-haspopup': 'listbox',
148
- 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,
149
- 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,
150
- disabled,
165
+ 'aria-label': ariaLabel ? ariaLabel + " " + text : undefined,
166
+ 'aria-labelledby': ariaLabelledBy ? ariaLabelledBy + " " + buttonId : undefined,
167
+ disabled: disabled,
151
168
  id: buttonId,
152
169
  onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,
153
170
  type: 'button'
154
171
  };
155
- const listbox = { ...otherProps,
172
+
173
+ var listbox = _extends({}, otherProps, {
156
174
  'aria-label': ariaLabel,
157
175
  'aria-labelledby': ariaLabelledBy,
158
- data,
159
- disabled,
160
- emptyValue,
176
+ data: data,
177
+ disabled: disabled,
178
+ emptyValue: emptyValue,
161
179
  onClick: handleListboxClick,
162
- onChange: event => {
180
+ onChange: function onChange(event) {
163
181
  setInputValueByRef(internalInputRef.current, event.detail.value);
164
182
  },
165
183
  onKeyDown: handleListboxKeyDown,
166
184
  ref: inputRef,
167
- value,
168
- multiselect
169
- };
170
- const input = {
185
+ value: value,
186
+ multiselect: multiselect
187
+ });
188
+
189
+ var input = {
171
190
  onChange: handleInputChange,
172
191
  ref: internalInputRef,
173
192
  value: value !== null && value !== void 0 ? value : ''
174
193
  };
175
194
  return {
176
- button,
177
- listbox,
178
- input,
195
+ button: button,
196
+ listbox: listbox,
197
+ input: input,
179
198
  popover: {
180
- open,
199
+ open: open,
181
200
  onOpenChange: setOpen
182
201
  },
183
- text,
184
- more
202
+ text: text,
203
+ more: more
185
204
  };
186
205
  };
187
206
 
@@ -1 +1 @@
1
- {"version":3,"file":"useSelect.js","sources":["../../../../src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport keycode from 'keycode';\r\nimport cn from 'classnames';\r\nimport { v4 as uuid } from 'uuid';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { SelectProps } from './Select';\r\nimport { ListboxProps } from '../Listbox/Listbox';\r\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\r\nimport { setInputValueByRef, findByValue, useFlattenedData, sanitizeItem } from '../Listbox/util';\r\nimport { ScrollableListItemValue } from '../Listbox/ScrollableList';\r\n\r\ntype useSelect = React.HtmlHTMLAttributes<HTMLDivElement> & {\r\n button: React.ButtonHTMLAttributes<HTMLButtonElement>;\r\n listbox: ListboxProps;\r\n input: any;\r\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\r\n text: string | JSX.Element;\r\n more?: number;\r\n};\r\n\r\nexport const useSelect = (\r\n {\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data = [],\r\n defaultValue,\r\n disabled,\r\n emptyValue,\r\n id: nativeId,\r\n multiselect,\r\n onClick,\r\n onChange,\r\n readOnly,\r\n value = emptyValue,\r\n ...otherProps\r\n }: SelectProps,\r\n ref: React.Ref<HTMLInputElement>\r\n): useSelect => {\r\n const { texts } = useLocalization();\r\n const searchData = useFlattenedData(data);\r\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\r\n const [open, setOpen] = React.useState(false);\r\n const id = React.useMemo(() => nativeId || `select_${uuid()}`, [nativeId]);\r\n const internalInputRef = React.useRef(null);\r\n const buttonId = `${id}-button`;\r\n // support 'escape' resetting to the value that was set when the listbox opened\r\n const [lastValue, setLastValue] = React.useState<ScrollableListItemValue | undefined>(value);\r\n\r\n React.useEffect(() => {\r\n setLastValue(value);\r\n }, [open]);\r\n\r\n React.useEffect(() => {\r\n if (defaultValue !== undefined && value === undefined) {\r\n setInputValueByRef(internalInputRef.current, defaultValue);\r\n }\r\n }, [defaultValue]);\r\n\r\n React.useEffect(() => {\r\n if (value !== undefined) {\r\n setInputValueByRef(internalInputRef.current, value);\r\n }\r\n }, []);\r\n\r\n // event handlers\r\n const handleButtonKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>): void => {\r\n if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {\r\n event.preventDefault();\r\n setOpen(true);\r\n }\r\n };\r\n\r\n const handleListboxKeyDown = (event: React.KeyboardEvent<HTMLElement>): void => {\r\n switch (event.keyCode) {\r\n case keycode('escape'): {\r\n event.preventDefault();\r\n if (lastValue !== undefined) {\r\n setInputValueByRef(inputRef.current, lastValue);\r\n }\r\n\r\n setOpen(false);\r\n break;\r\n }\r\n\r\n case keycode('tab'):\r\n case keycode('enter'): {\r\n if (event.keyCode !== keycode('tab')) {\r\n event.preventDefault();\r\n }\r\n setOpen(false);\r\n break;\r\n }\r\n\r\n default:\r\n }\r\n\r\n if (otherProps.onKeyDown) {\r\n otherProps.onKeyDown(event);\r\n }\r\n };\r\n\r\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>): void => {\r\n event.preventDefault();\r\n if (!multiselect) {\r\n setOpen(false);\r\n }\r\n };\r\n\r\n let text: string | JSX.Element = '';\r\n let more = 0;\r\n\r\n if (value !== undefined) {\r\n if (multiselect) {\r\n const selectedValues = value?.toString().split(',') || [];\r\n\r\n if (selectedValues.length === searchData.filter(item => !item.disabled).length) {\r\n text = texts.select.allOptionsSelected;\r\n } else {\r\n text = findByValue(searchData, selectedValues[0])?.text ?? '';\r\n more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;\r\n }\r\n } else {\r\n const item = findByValue(searchData, value);\r\n\r\n if (item) {\r\n text = item.icon ? (\r\n <>\r\n {React.cloneElement(item.icon, {\r\n className: cn(item.icon.props.className, 'mr-1 -mt-px'),\r\n })}\r\n {item.text}\r\n </>\r\n ) : (\r\n item.text\r\n );\r\n }\r\n }\r\n }\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n if (onChange) {\r\n const item = findByValue(searchData, event.target.value);\r\n (event as any).detail = sanitizeItem(item);\r\n\r\n const indexes = item?.path?.split('.') ?? [];\r\n\r\n if (indexes.length > 1) {\r\n // we don't want to map the current item\r\n indexes.pop();\r\n // we need to rebuild the path as we map\r\n let lastPath: string;\r\n\r\n (event as any).detail.parents = indexes.map(i => {\r\n lastPath = lastPath ? [lastPath, i].join('.') : i;\r\n return sanitizeItem(searchData.find(i => i.path === lastPath));\r\n });\r\n }\r\n\r\n onChange(event);\r\n }\r\n };\r\n\r\n const button: React.ButtonHTMLAttributes<HTMLButtonElement> = {\r\n 'aria-haspopup': 'listbox' as const,\r\n 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,\r\n 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,\r\n disabled,\r\n id: buttonId,\r\n onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,\r\n type: 'button',\r\n };\r\n\r\n const listbox = {\r\n ...otherProps,\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data,\r\n disabled,\r\n emptyValue,\r\n onClick: handleListboxClick,\r\n onChange: event => {\r\n setInputValueByRef(internalInputRef.current, event.detail.value);\r\n },\r\n onKeyDown: handleListboxKeyDown,\r\n ref: inputRef,\r\n value,\r\n multiselect,\r\n };\r\n\r\n const input = {\r\n onChange: handleInputChange,\r\n ref: internalInputRef,\r\n value: value ?? '',\r\n };\r\n\r\n return {\r\n button,\r\n listbox,\r\n input,\r\n popover: {\r\n open,\r\n onOpenChange: setOpen,\r\n },\r\n text,\r\n more,\r\n };\r\n};\r\n"],"names":["useSelect","ariaLabel","ariaLabelledBy","data","defaultValue","disabled","emptyValue","id","nativeId","multiselect","onClick","onChange","readOnly","value","otherProps","ref","texts","useLocalization","searchData","useFlattenedData","inputRef","useProxiedRef","open","setOpen","React","uuid","internalInputRef","buttonId","lastValue","setLastValue","undefined","setInputValueByRef","current","handleButtonKeyDown","event","keyCode","keycode","preventDefault","handleListboxKeyDown","onKeyDown","handleListboxClick","text","more","selectedValues","toString","split","length","filter","item","select","allOptionsSelected","findByValue","icon","className","cn","props","handleInputChange","persist","target","detail","sanitizeItem","indexes","path","pop","lastPath","parents","map","i","join","find","button","type","listbox","input","popover","onOpenChange"],"mappings":";;;;;;;;MAoBaA,SAAS,GAAG,CACrB;AACI,gBAAcC,SADlB;AAEI,qBAAmBC,cAFvB;AAGIC,EAAAA,IAAI,GAAG,EAHX;AAIIC,EAAAA,YAJJ;AAKIC,EAAAA,QALJ;AAMIC,EAAAA,UANJ;AAOIC,EAAAA,EAAE,EAAEC,QAPR;AAQIC,EAAAA,WARJ;AASIC,EAAAA,OATJ;AAUIC,EAAAA,QAVJ;AAWIC,EAAAA,QAXJ;AAYIC,EAAAA,KAAK,GAAGP,UAZZ;AAaI,KAAGQ;AAbP,CADqB,EAgBrBC,GAhB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GAAG,EAAEK,QAZO;AAaZP,IAAAA,KAbY;AAcZJ,IAAAA;AAdY,GAAhB;AAiBA,QAAMgE,KAAK,GAAG;AACV9D,IAAAA,QAAQ,EAAE6C,iBADA;AAEVzC,IAAAA,GAAG,EAAEW,gBAFK;AAGVb,IAAAA,KAAK,EAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAW;AAHN,GAAd;AAMA,SAAO;AACHyD,IAAAA,MADG;AAEHE,IAAAA,OAFG;AAGHC,IAAAA,KAHG;AAIHC,IAAAA,OAAO,EAAE;AACLpD,MAAAA,IADK;AAELqD,MAAAA,YAAY,EAAEpD;AAFT,KAJN;AAQHkB,IAAAA,IARG;AASHC,IAAAA;AATG,GAAP;AAWH;;;;"}
1
+ {"version":3,"file":"useSelect.js","sources":["../../../../src/components/Select/useSelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport keycode from 'keycode';\nimport cn from 'classnames';\nimport { v4 as uuid } from 'uuid';\nimport { useLocalization } from '../Provider/Provider';\nimport { SelectProps } from './Select';\nimport { ListboxProps } from '../Listbox/Listbox';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\nimport { setInputValueByRef, findByValue, useFlattenedData, sanitizeItem } from '../Listbox/util';\nimport { ScrollableListItemValue } from '../Listbox/ScrollableList';\n\ntype useSelect = React.HtmlHTMLAttributes<HTMLDivElement> & {\n button: React.ButtonHTMLAttributes<HTMLButtonElement>;\n listbox: ListboxProps;\n input: any;\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n text: string | JSX.Element;\n more?: number;\n};\n\nexport const useSelect = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data = [],\n defaultValue,\n disabled,\n emptyValue,\n id: nativeId,\n multiselect,\n onClick,\n onChange,\n readOnly,\n value = emptyValue,\n ...otherProps\n }: SelectProps,\n ref: React.Ref<HTMLInputElement>\n): useSelect => {\n const { texts } = useLocalization();\n const searchData = useFlattenedData(data);\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\n const [open, setOpen] = React.useState(false);\n const id = React.useMemo(() => nativeId || `select_${uuid()}`, [nativeId]);\n const internalInputRef = React.useRef(null);\n const buttonId = `${id}-button`;\n // support 'escape' resetting to the value that was set when the listbox opened\n const [lastValue, setLastValue] = React.useState<ScrollableListItemValue | undefined>(value);\n\n React.useEffect(() => {\n setLastValue(value);\n }, [open]);\n\n React.useEffect(() => {\n if (defaultValue !== undefined && value === undefined) {\n setInputValueByRef(internalInputRef.current, defaultValue);\n }\n }, [defaultValue]);\n\n React.useEffect(() => {\n if (value !== undefined) {\n setInputValueByRef(internalInputRef.current, value);\n }\n }, []);\n\n // event handlers\n const handleButtonKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>): void => {\n if (event.keyCode === keycode('up') || event.keyCode === keycode('down')) {\n event.preventDefault();\n setOpen(true);\n }\n };\n\n const handleListboxKeyDown = (event: React.KeyboardEvent<HTMLElement>): void => {\n switch (event.keyCode) {\n case keycode('escape'): {\n event.preventDefault();\n if (lastValue !== undefined) {\n setInputValueByRef(inputRef.current, lastValue);\n }\n\n setOpen(false);\n break;\n }\n\n case keycode('tab'):\n case keycode('enter'): {\n if (event.keyCode !== keycode('tab')) {\n event.preventDefault();\n }\n setOpen(false);\n break;\n }\n\n default:\n }\n\n if (otherProps.onKeyDown) {\n otherProps.onKeyDown(event);\n }\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>): void => {\n event.preventDefault();\n if (!multiselect) {\n setOpen(false);\n }\n };\n\n let text: string | JSX.Element = '';\n let more = 0;\n\n if (value !== undefined) {\n if (multiselect) {\n const selectedValues = value?.toString().split(',') || [];\n\n if (selectedValues.length === searchData.filter(item => !item.disabled).length) {\n text = texts.select.allOptionsSelected;\n } else {\n text = findByValue(searchData, selectedValues[0])?.text ?? '';\n more = selectedValues.length > 1 ? selectedValues.length - 1 : 0;\n }\n } else {\n const item = findByValue(searchData, value);\n\n if (item) {\n text = item.icon ? (\n <>\n {React.cloneElement(item.icon, {\n className: cn(item.icon.props.className, 'mr-1 -mt-px'),\n })}\n {item.text}\n </>\n ) : (\n item.text\n );\n }\n }\n }\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (onChange) {\n const item = findByValue(searchData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const indexes = item?.path?.split('.') ?? [];\n\n if (indexes.length > 1) {\n // we don't want to map the current item\n indexes.pop();\n // we need to rebuild the path as we map\n let lastPath: string;\n\n (event as any).detail.parents = indexes.map(i => {\n lastPath = lastPath ? [lastPath, i].join('.') : i;\n return sanitizeItem(searchData.find(i => i.path === lastPath));\n });\n }\n\n onChange(event);\n }\n };\n\n const button: React.ButtonHTMLAttributes<HTMLButtonElement> = {\n 'aria-haspopup': 'listbox' as const,\n 'aria-label': ariaLabel ? `${ariaLabel} ${text}` : undefined,\n 'aria-labelledby': ariaLabelledBy ? `${ariaLabelledBy} ${buttonId}` : undefined,\n disabled,\n id: buttonId,\n onKeyDown: !disabled && !readOnly ? handleButtonKeyDown : undefined,\n type: 'button',\n };\n\n const listbox = {\n ...otherProps,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n emptyValue,\n onClick: handleListboxClick,\n onChange: event => {\n setInputValueByRef(internalInputRef.current, event.detail.value);\n },\n onKeyDown: handleListboxKeyDown,\n ref: inputRef,\n value,\n multiselect,\n };\n\n const input = {\n onChange: handleInputChange,\n ref: internalInputRef,\n value: value ?? '',\n };\n\n return {\n button,\n listbox,\n input,\n popover: {\n open,\n onOpenChange: setOpen,\n },\n text,\n more,\n };\n};\n"],"names":["useSelect","ref","ariaLabel","ariaLabelledBy","data","defaultValue","disabled","emptyValue","nativeId","id","multiselect","onChange","readOnly","value","otherProps","useLocalization","texts","searchData","useFlattenedData","inputRef","useProxiedRef","React","open","setOpen","uuid","internalInputRef","buttonId","lastValue","setLastValue","undefined","setInputValueByRef","current","handleButtonKeyDown","event","keyCode","keycode","preventDefault","handleListboxKeyDown","onKeyDown","handleListboxClick","text","more","selectedValues","toString","split","length","filter","item","select","allOptionsSelected","findByValue","icon","className","cn","props","handleInputChange","persist","target","detail","sanitizeItem","indexes","path","pop","lastPath","parents","map","i","join","find","button","type","listbox","onClick","input","popover","onOpenChange"],"mappings":";;;;;;;;;;IAoBaA,SAAS,GAAG,SAAZA,SAAY,OAgBrBC,GAhBqB;MAEHC,iBAAd;MACmBC,sBAAnB;uBACAC;MAAAA,8BAAO;MACPC,oBAAAA;MACAC,gBAAAA;MACAC,kBAAAA;MACIC,gBAAJC;MACAC,mBAAAA;MAEAC,gBAAAA;MACAC,gBAAAA;wBACAC;MAAAA,gCAAQN;MACLO;;AAIP,yBAAkBC,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AACA,MAAMC,UAAU,GAAGC,gBAAgB,CAACd,IAAD,CAAnC;AACA,MAAMe,QAAQ,GAAGC,aAAa,CAAmBnB,GAAnB,CAA9B;;AACA,wBAAwBoB,QAAA,CAAe,KAAf,CAAxB;AAAA,MAAOC,IAAP;AAAA,MAAaC,OAAb;;AACA,MAAMd,EAAE,GAAGY,OAAA,CAAc;AAAA,WAAMb,QAAQ,gBAAcgB,EAAI,EAAhC;AAAA,GAAd,EAAoD,CAAChB,QAAD,CAApD,CAAX;AACA,MAAMiB,gBAAgB,GAAGJ,MAAA,CAAa,IAAb,CAAzB;AACA,MAAMK,QAAQ,GAAMjB,EAAN,YAAd;;AAEA,yBAAkCY,QAAA,CAAoDR,KAApD,CAAlC;AAAA,MAAOc,SAAP;AAAA,MAAkBC,YAAlB;;AAEAP,EAAAA,SAAA,CAAgB;AACZO,IAAAA,YAAY,CAACf,KAAD,CAAZ;AACH,GAFD,EAEG,CAACS,IAAD,CAFH;AAIAD,EAAAA,SAAA,CAAgB;AACZ,QAAIhB,YAAY,KAAKwB,SAAjB,IAA8BhB,KAAK,KAAKgB,SAA5C,EAAuD;AACnDC,MAAAA,kBAAkB,CAAC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A;AATG,GAAP;AAWH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport './Spinner.css';\r\n\r\nexport type SpinnerProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /**\r\n * Define a delay in milliseconds after which the spinner is shown.\r\n * Default value is `500`ms\r\n */\r\n delay?: number;\r\n /** Define a text that will be displayed below spinner */\r\n label?: string;\r\n};\r\n\r\nexport const Spinner = React.forwardRef(function Spinner(props: SpinnerProps, ref: React.Ref<HTMLDivElement>) {\r\n const { delay = 500, label, ...otherProps } = props;\r\n const [visible, setVisibility] = React.useState(!delay);\r\n\r\n React.useEffect(() => {\r\n let timeout: number;\r\n\r\n if (delay) {\r\n timeout = window.setTimeout(() => setVisibility(true), delay);\r\n }\r\n\r\n return () => {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n }\r\n };\r\n }, [delay]);\r\n\r\n if (!visible) {\r\n return null;\r\n }\r\n\r\n const className = cn('inline-flex flex-col relative items-center', otherProps.className);\r\n\r\n return (\r\n <div {...otherProps} className={className} data-taco=\"spinner\" ref={ref}>\r\n <svg\r\n className=\"h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]\"\r\n viewBox=\"0 0 100 100\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <circle cx=\"50\" cy=\"50\" r=\"45\"></circle>\r\n </svg>\r\n {label && <span className=\"mt-4\">{label}</span>}\r\n </div>\r\n );\r\n});\r\n"],"names":["Spinner","React","forwardRef","props","ref","delay","label","otherProps","useState","visible","setVisibility","useEffect","timeout","window","setTimeout","clearTimeout","className","cn","viewBox","xmlns","cx","cy","r"],"mappings":";;;;;IAcaA,OAAO,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,OAAT,CAAiBG,KAAjB,EAAsCC,GAAtC;AACpC,qBAA8CD,KAA9C,CAAQE,KAAR;AAAA,MAAQA,KAAR,6BAAgB,GAAhB;AAAA,MAAqBC,KAArB,GAA8CH,KAA9C,CAAqBG,KAArB;AAAA,MAA+BC,UAA/B,iCAA8CJ,KAA9C;;AACA,wBAAiCF,cAAK,CAACO,QAAN,CAAe,CAACH,KAAhB,CAAjC;AAAA,MAAOI,OAAP;AAAA,MAAgBC,aAAhB;;AAEAT,EAAAA,cAAK,CAACU,SAAN,CAAgB;AACZ,QAAIC,OAAJ;;AAEA,QAAIP,KAAJ,EAAW;AACPO,MAAAA,OAAO,GAAGC,MAAM,CAACC,UAAP,CAAkB;AAAA,eAAMJ,aAAa,CAAC,IAAD,CAAnB;AAAA,OAAlB,EAA6CL,KAA7C,CAAV;AACH;;AAED,WAAO;AACH,UAAIO,OAAJ,EAAa;AACTG,QAAAA,YAAY,CAACH,OAAD,CAAZ;AACH;AACJ,KAJD;AAKH,GAZD,EAYG,CAACP,KAAD,CAZH;;AAcA,MAAI,CAACI,OAAL,EAAc;AACV,WAAO,IAAP;AACH;;AAED,MAAMO,SAAS,GAAGC,EAAE,CAAC,4CAAD,EAA+CV,UAAU,CAACS,SAA1D,CAApB;AAEA,SACIf,4BAAA,MAAA,oBAASM;AAAYS,IAAAA,SAAS,EAAEA;iBAAqB;AAAUZ,IAAAA,GAAG,EAAEA;IAApE,EACIH,4BAAA,MAAA;AACIe,IAAAA,SAAS,EAAC;AACVE,IAAAA,OAAO,EAAC;AACRC,IAAAA,KAAK,EAAC;GAHV,EAKIlB,4BAAA,SAAA;AAAQmB,IAAAA,EAAE,EAAC;AAAKC,IAAAA,EAAE,EAAC;AAAKC,IAAAA,CAAC,EAAC;GAA1B,CALJ,CADJ,EAQKhB,KAAK,IAAIL,4BAAA,OAAA;AAAMe,IAAAA,SAAS,EAAC;GAAhB,EAAwBV,KAAxB,CARd,CADJ;AAYH,CApCsB;;;;"}
1
+ {"version":3,"file":"Spinner.js","sources":["../../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport './Spinner.css';\n\nexport type SpinnerProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * Define a delay in milliseconds after which the spinner is shown.\n * Default value is `500`ms\n */\n delay?: number;\n /** Define a text that will be displayed below spinner */\n label?: string;\n};\n\nexport const Spinner = React.forwardRef(function Spinner(props: SpinnerProps, ref: React.Ref<HTMLDivElement>) {\n const { delay = 500, label, ...otherProps } = props;\n const [visible, setVisibility] = React.useState(!delay);\n\n React.useEffect(() => {\n let timeout: number;\n\n if (delay) {\n timeout = window.setTimeout(() => setVisibility(true), delay);\n }\n\n return () => {\n if (timeout) {\n clearTimeout(timeout);\n }\n };\n }, [delay]);\n\n if (!visible) {\n return null;\n }\n\n const className = cn('inline-flex flex-col relative items-center', otherProps.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"spinner\" ref={ref}>\n <svg\n className=\"h-10 w-10 animate-[spinnerRotation_2s_linear_infinite]\"\n viewBox=\"0 0 100 100\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle cx=\"50\" cy=\"50\" r=\"45\"></circle>\n </svg>\n {label && <span className=\"mt-4\">{label}</span>}\n </div>\n );\n});\n"],"names":["Spinner","React","forwardRef","props","ref","delay","label","otherProps","useState","visible","setVisibility","useEffect","timeout","window","setTimeout","clearTimeout","className","cn","viewBox","xmlns","cx","cy","r"],"mappings":";;;;;IAcaA,OAAO,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,OAAT,CAAiBG,KAAjB,EAAsCC,GAAtC;AACpC,qBAA8CD,KAA9C,CAAQE,KAAR;AAAA,MAAQA,KAAR,6BAAgB,GAAhB;AAAA,MAAqBC,KAArB,GAA8CH,KAA9C,CAAqBG,KAArB;AAAA,MAA+BC,UAA/B,iCAA8CJ,KAA9C;;AACA,wBAAiCF,cAAK,CAACO,QAAN,CAAe,CAACH,KAAhB,CAAjC;AAAA,MAAOI,OAAP;AAAA,MAAgBC,aAAhB;;AAEAT,EAAAA,cAAK,CAACU,SAAN,CAAgB;AACZ,QAAIC,OAAJ;;AAEA,QAAIP,KAAJ,EAAW;AACPO,MAAAA,OAAO,GAAGC,MAAM,CAACC,UAAP,CAAkB;AAAA,eAAMJ,aAAa,CAAC,IAAD,CAAnB;AAAA,OAAlB,EAA6CL,KAA7C,CAAV;AACH;;AAED,WAAO;AACH,UAAIO,OAAJ,EAAa;AACTG,QAAAA,YAAY,CAACH,OAAD,CAAZ;AACH;AACJ,KAJD;AAKH,GAZD,EAYG,CAACP,KAAD,CAZH;;AAcA,MAAI,CAACI,OAAL,EAAc;AACV,WAAO,IAAP;AACH;;AAED,MAAMO,SAAS,GAAGC,EAAE,CAAC,4CAAD,EAA+CV,UAAU,CAACS,SAA1D,CAApB;AAEA,SACIf,4BAAA,MAAA,oBAASM;AAAYS,IAAAA,SAAS,EAAEA;iBAAqB;AAAUZ,IAAAA,GAAG,EAAEA;IAApE,EACIH,4BAAA,MAAA;AACIe,IAAAA,SAAS,EAAC;AACVE,IAAAA,OAAO,EAAC;AACRC,IAAAA,KAAK,EAAC;GAHV,EAKIlB,4BAAA,SAAA;AAAQmB,IAAAA,EAAE,EAAC;AAAKC,IAAAA,EAAE,EAAC;AAAKC,IAAAA,CAAC,EAAC;GAA1B,CALJ,CADJ,EAQKhB,KAAK,IAAIL,4BAAA,OAAA;AAAMe,IAAAA,SAAS,EAAC;GAAhB,EAAwBV,KAAxB,CARd,CADJ;AAYH,CApCsB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PrimitiveSwitch from '@radix-ui/react-switch';\r\n\r\ntype SwitchBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\r\n /** Label for the switch */\r\n label?: React.ReactNode;\r\n /* Whether user input is required */\r\n required?: boolean;\r\n};\r\n\r\ninterface UncontrolledSwitchProps extends SwitchBaseProps {\r\n checked?: never;\r\n onChange?: never;\r\n /* The default checked state (uncontrolled) */\r\n defaultChecked?: boolean;\r\n}\r\n\r\ninterface ControlledSwitchProps extends SwitchBaseProps {\r\n defaultChecked?: never;\r\n /* The current checked state (controlled) */\r\n checked: boolean;\r\n /* Handler called when the checked state changes */\r\n onChange: (checked: boolean) => void;\r\n}\r\n\r\nexport type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;\r\n\r\nexport const Switch = React.forwardRef(function Switch(props: SwitchProps, ref: React.Ref<HTMLButtonElement>) {\r\n const { label, onChange, ...otherProps } = props;\r\n\r\n const className = cn(\r\n 'group h-6 w-10 flex rounded-full inline-flex',\r\n {\r\n 'mr-2': !!label,\r\n 'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,\r\n 'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled,\r\n },\r\n props.className\r\n );\r\n\r\n const element = (\r\n <PrimitiveSwitch.Root {...otherProps} className={className} onCheckedChange={onChange} ref={ref}>\r\n <PrimitiveSwitch.Thumb className=\"'will-change-transform transition-transform translate-x-1 group-aria-checked:translate-x-5 h-4 w-4 mt-1 bg-white rounded-full\" />\r\n </PrimitiveSwitch.Root>\r\n );\r\n\r\n if (label) {\r\n const labelClassName = cn('flex items-center cursor-pointer', {\r\n 'cursor-not-allowed text-grey-dark': props.disabled,\r\n });\r\n\r\n return (\r\n <label className={labelClassName}>\r\n {element}\r\n {label}\r\n </label>\r\n );\r\n }\r\n\r\n return element;\r\n});\r\n"],"names":["Switch","React","props","ref","label","onChange","otherProps","className","cn","disabled","element","PrimitiveSwitch","onCheckedChange","labelClassName"],"mappings":";;;;;;IA4BaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,MAAQC,KAAR,GAA2CF,KAA3C,CAAQE,KAAR;AAAA,MAAeC,QAAf,GAA2CH,KAA3C,CAAeG,QAAf;AAAA,MAA4BC,UAA5B,iCAA2CJ,KAA3C;;AAEA,MAAMK,SAAS,GAAGC,EAAE,CAChB,8CADgB,EAEhB;AACI,YAAQ,CAAC,CAACJ,KADd;AAEI,0DAAsD,CAACF,KAAK,CAACO,QAFjE;AAGI,mEAA+DP,KAAK,CAACO;AAHzE,GAFgB,EAOhBP,KAAK,CAACK,SAPU,CAApB;AAUA,MAAMG,OAAO,GACTT,aAAA,CAACU,IAAD,oBAA0BL;AAAYC,IAAAA,SAAS,EAAEA;AAAWK,IAAAA,eAAe,EAAEP;AAAUF,IAAAA,GAAG,EAAEA;IAA5F,EACIF,aAAA,CAACU,KAAD;AAAuBJ,IAAAA,SAAS,EAAC;GAAjC,CADJ,CADJ;;AAMA,MAAIH,KAAJ,EAAW;AACP,QAAMS,cAAc,GAAGL,EAAE,CAAC,kCAAD,EAAqC;AAC1D,2CAAqCN,KAAK,CAACO;AADe,KAArC,CAAzB;AAIA,WACIR,aAAA,QAAA;AAAOM,MAAAA,SAAS,EAAEM;KAAlB,EACKH,OADL,EAEKN,KAFL,CADJ;AAMH;;AAED,SAAOM,OAAP;AACH,CAjCqB;;;;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PrimitiveSwitch from '@radix-ui/react-switch';\n\ntype SwitchBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /** Label for the switch */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledSwitchProps extends SwitchBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledSwitchProps extends SwitchBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type SwitchProps = UncontrolledSwitchProps | ControlledSwitchProps;\n\nexport const Switch = React.forwardRef(function Switch(props: SwitchProps, ref: React.Ref<HTMLButtonElement>) {\n const { label, onChange, ...otherProps } = props;\n\n const className = cn(\n 'group h-6 w-10 flex rounded-full inline-flex',\n {\n 'mr-2': !!label,\n 'bg-grey-darker aria-checked:bg-blue focus:yt-focus': !props.disabled,\n 'bg-grey-light cursor-not-allowed aria-checked:bg-blue-light': props.disabled,\n },\n props.className\n );\n\n const element = (\n <PrimitiveSwitch.Root {...otherProps} className={className} onCheckedChange={onChange} ref={ref}>\n <PrimitiveSwitch.Thumb className=\"'will-change-transform transition-transform translate-x-1 group-aria-checked:translate-x-5 h-4 w-4 mt-1 bg-white rounded-full\" />\n </PrimitiveSwitch.Root>\n );\n\n if (label) {\n const labelClassName = cn('flex items-center cursor-pointer', {\n 'cursor-not-allowed text-grey-dark': props.disabled,\n });\n\n return (\n <label className={labelClassName}>\n {element}\n {label}\n </label>\n );\n }\n\n return element;\n});\n"],"names":["Switch","React","props","ref","label","onChange","otherProps","className","cn","disabled","element","PrimitiveSwitch","onCheckedChange","labelClassName"],"mappings":";;;;;;IA4BaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,MAAQC,KAAR,GAA2CF,KAA3C,CAAQE,KAAR;AAAA,MAAeC,QAAf,GAA2CH,KAA3C,CAAeG,QAAf;AAAA,MAA4BC,UAA5B,iCAA2CJ,KAA3C;;AAEA,MAAMK,SAAS,GAAGC,EAAE,CAChB,8CADgB,EAEhB;AACI,YAAQ,CAAC,CAACJ,KADd;AAEI,0DAAsD,CAACF,KAAK,CAACO,QAFjE;AAGI,mEAA+DP,KAAK,CAACO;AAHzE,GAFgB,EAOhBP,KAAK,CAACK,SAPU,CAApB;AAUA,MAAMG,OAAO,GACTT,aAAA,CAACU,IAAD,oBAA0BL;AAAYC,IAAAA,SAAS,EAAEA;AAAWK,IAAAA,eAAe,EAAEP;AAAUF,IAAAA,GAAG,EAAEA;IAA5F,EACIF,aAAA,CAACU,KAAD;AAAuBJ,IAAAA,SAAS,EAAC;GAAjC,CADJ,CADJ;;AAMA,MAAIH,KAAJ,EAAW;AACP,QAAMS,cAAc,GAAGL,EAAE,CAAC,kCAAD,EAAqC;AAC1D,2CAAqCN,KAAK,CAACO;AADe,KAArC,CAAzB;AAIA,WACIR,aAAA,QAAA;AAAOM,MAAAA,SAAS,EAAEM;KAAlB,EACKH,OADL,EAEKN,KAFL,CADJ;AAMH;;AAED,SAAOM,OAAP;AACH,CAjCqB;;;;"}
@@ -1,26 +1,29 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import React__default from 'react';
2
3
  import cn from 'classnames';
3
4
  import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
4
5
  import { Column } from '../util/renderColumn.js';
5
6
 
6
- const DefaultEmptyState = () => null;
7
- const BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props, ref) {
8
- const tableRef = useProxiedRef(ref);
9
- const {
10
- autoFocus,
11
- children,
12
- disableSorting: _,
13
- headerGroups,
14
- headerRef,
15
- bodyRef,
16
- ...otherProps
17
- } = props;
18
- React__default.useEffect(() => {
7
+ var _excluded = ["autoFocus", "children", "disableSorting", "headerGroups", "headerRef", "bodyRef"];
8
+ var DefaultEmptyState = function DefaultEmptyState() {
9
+ return null;
10
+ };
11
+ var BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(props, ref) {
12
+ var tableRef = useProxiedRef(ref);
13
+
14
+ var autoFocus = props.autoFocus,
15
+ children = props.children,
16
+ headerGroups = props.headerGroups,
17
+ headerRef = props.headerRef,
18
+ bodyRef = props.bodyRef,
19
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
20
+
21
+ React__default.useEffect(function () {
19
22
  if (autoFocus && tableRef.current) {
20
23
  tableRef.current.focus();
21
24
  }
22
25
  }, []);
23
- const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);
26
+ var className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);
24
27
  return React__default.createElement("div", Object.assign({}, otherProps, {
25
28
  role: "table",
26
29
  className: className,
@@ -29,15 +32,19 @@ const BaseTable = /*#__PURE__*/React__default.forwardRef(function BaseTable(prop
29
32
  role: "rowgroup",
30
33
  className: "yt-table__head",
31
34
  ref: headerRef
32
- }, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map((headerGroup, index) => React__default.createElement("div", {
33
- key: index,
34
- role: "row",
35
- className: "border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold"
36
- }, headerGroup.headers.map((cell, index) => React__default.createElement(Column, {
37
- key: index,
38
- index: index,
39
- cell: cell
40
- }))))), React__default.createElement("div", {
35
+ }, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(function (headerGroup, index) {
36
+ return React__default.createElement("div", {
37
+ key: index,
38
+ role: "row",
39
+ className: "border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold"
40
+ }, headerGroup.headers.map(function (cell, index) {
41
+ return React__default.createElement(Column, {
42
+ key: index,
43
+ index: index,
44
+ cell: cell
45
+ });
46
+ }));
47
+ })), React__default.createElement("div", {
41
48
  role: "rowgroup",
42
49
  className: "yt-table__body",
43
50
  ref: bodyRef
@@ -1 +1 @@
1
- {"version":3,"file":"BaseTable.js","sources":["../../../../../src/components/Table/components/BaseTable.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { HeaderGroup } from 'react-table';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { InternalBaseTable } from '../types';\r\nimport './Table.css';\r\nimport { Column } from '../util/renderColumn';\r\n\r\nexport const DefaultEmptyState = (): React.ReactNode => null;\r\n\r\nexport const BaseTable = React.forwardRef(function BaseTable(props: InternalBaseTable, ref: React.Ref<HTMLDivElement>) {\r\n const tableRef = useProxiedRef<HTMLDivElement>(ref);\r\n const { autoFocus, children, disableSorting: _, headerGroups, headerRef, bodyRef, ...otherProps } = props;\r\n\r\n React.useEffect(() => {\r\n if (autoFocus && tableRef.current) {\r\n tableRef.current.focus();\r\n }\r\n }, []);\r\n\r\n const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);\r\n\r\n return (\r\n <div {...otherProps} role=\"table\" className={className} ref={tableRef}>\r\n <div role=\"rowgroup\" className=\"yt-table__head\" ref={headerRef}>\r\n {headerGroups?.map((headerGroup: HeaderGroup<object>, index: number) => (\r\n <div\r\n key={index}\r\n role=\"row\"\r\n className=\"border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold\"\r\n >\r\n {headerGroup.headers.map((cell: any, index: number) => (\r\n <Column key={index} index={index} cell={cell} />\r\n ))}\r\n </div>\r\n ))}\r\n </div>\r\n\r\n <div role=\"rowgroup\" className=\"yt-table__body\" ref={bodyRef}>\r\n {children}\r\n </div>\r\n </div>\r\n );\r\n});\r\n"],"names":["DefaultEmptyState","BaseTable","React","forwardRef","props","ref","tableRef","useProxiedRef","autoFocus","children","disableSorting","_","headerGroups","headerRef","bodyRef","otherProps","useEffect","current","focus","className","cn","role","map","headerGroup","index","key","headers","cell","Column"],"mappings":";;;;;MAQaA,iBAAiB,GAAG,MAAuB;MAE3CC,SAAS,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,SAAT,CAAmBG,KAAnB,EAA6CC,GAA7C;AACtC,QAAMC,QAAQ,GAAGC,aAAa,CAAiBF,GAAjB,CAA9B;AACA,QAAM;AAAEG,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA,cAAc,EAAEC,CAAvC;AAA0CC,IAAAA,YAA1C;AAAwDC,IAAAA,SAAxD;AAAmEC,IAAAA,OAAnE;AAA4E,OAAGC;AAA/E,MAA8FX,KAApG;AAEAF,EAAAA,cAAK,CAACc,SAAN,CAAgB;AACZ,QAAIR,SAAS,IAAIF,QAAQ,CAACW,OAA1B,EAAmC;AAC/BX,MAAAA,QAAQ,CAACW,OAAT,CAAiBC,KAAjB;AACH;AACJ,GAJD,EAIG,EAJH;AAMA,QAAMC,SAAS,GAAGC,EAAE,CAAC,wDAAD,EAA2DhB,KAAK,CAACe,SAAjE,CAApB;AAEA,SACIjB,4BAAA,MAAA,oBAASa;AAAYM,IAAAA,IAAI,EAAC;AAAQF,IAAAA,SAAS,EAAEA;AAAWd,IAAAA,GAAG,EAAEC;IAA7D,EACIJ,4BAAA,MAAA;AAAKmB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBd,IAAAA,GAAG,EAAEQ;GAArD,EACKD,YADL,aACKA,YADL,uBACKA,YAAY,CAAEU,GAAd,CAAkB,CAACC,WAAD,EAAmCC,KAAnC,KACftB,4BAAA,MAAA;AACIuB,IAAAA,GAAG,EAAED;AACLH,IAAAA,IAAI,EAAC;AACLF,IAAAA,SAAS,EAAC;GAHd,EAKKI,WAAW,CAACG,OAAZ,CAAoBJ,GAApB,CAAwB,CAACK,IAAD,EAAYH,KAAZ,KACrBtB,4BAAA,CAAC0B,MAAD;AAAQH,IAAAA,GAAG,EAAED;AAAOA,IAAAA,KAAK,EAAEA;AAAOG,IAAAA,IAAI,EAAEA;GAAxC,CADH,CALL,CADH,CADL,CADJ,EAeIzB,4BAAA,MAAA;AAAKmB,IAAAA,IAAI,EAAC;AAAWF,IAAAA,SAAS,EAAC;AAAiBd,IAAAA,GAAG,EAAES;GAArD,EACKL,QADL,CAfJ,CADJ;AAqBH,CAjCwB;;;;"}
1
+ {"version":3,"file":"BaseTable.js","sources":["../../../../../src/components/Table/components/BaseTable.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { HeaderGroup } from 'react-table';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { InternalBaseTable } from '../types';\nimport './Table.css';\nimport { Column } from '../util/renderColumn';\n\nexport const DefaultEmptyState = (): React.ReactNode => null;\n\nexport const BaseTable = React.forwardRef(function BaseTable(props: InternalBaseTable, ref: React.Ref<HTMLDivElement>) {\n const tableRef = useProxiedRef<HTMLDivElement>(ref);\n const { autoFocus, children, disableSorting: _, headerGroups, headerRef, bodyRef, ...otherProps } = props;\n\n React.useEffect(() => {\n if (autoFocus && tableRef.current) {\n tableRef.current.focus();\n }\n }, []);\n\n const className = cn('yt-table flex flex-col focus:yt-focus focus:rounded-sm', props.className);\n\n return (\n <div {...otherProps} role=\"table\" className={className} ref={tableRef}>\n <div role=\"rowgroup\" className=\"yt-table__head\" ref={headerRef}>\n {headerGroups?.map((headerGroup: HeaderGroup<object>, index: number) => (\n <div\n key={index}\n role=\"row\"\n className=\"border-grey-light flex h-auto min-h-[2.5rem] w-full select-none border-b border-t-0 border-b-2 font-bold\"\n >\n {headerGroup.headers.map((cell: any, index: number) => (\n <Column key={index} index={index} cell={cell} />\n ))}\n </div>\n ))}\n </div>\n\n <div role=\"rowgroup\" className=\"yt-table__body\" ref={bodyRef}>\n {children}\n </div>\n </div>\n );\n});\n"],"names":["DefaultEmptyState","BaseTable","React","forwardRef","props","ref","tableRef","useProxiedRef","autoFocus","children","headerGroups","headerRef","bodyRef","otherProps","useEffect","current","focus","className","cn","role","map","headerGroup","index","key","headers","cell","Column"],"mappings":";;;;;;;IAQaA,iBAAiB,GAAG,SAApBA,iBAAoB;AAAA,SAAuB,IAAvB;AAAA;IAEpBC,SAAS,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,SAAT,CAAmBG,KAAnB,EAA6CC,GAA7C;AACtC,MAAMC,QAAQ,GAAGC,aAAa,CAAiBF,GAAjB,CAA9B;;AACA,MAAQG,SAAR,GAAoGJ,KAApG,CAAQI,SAAR;AAAA,MAAmBC,QAAnB,GAAoGL,KAApG,CAAmBK,QAAnB;AAAA,MAAgDC,YAAhD,GAAoGN,KAApG,CAAgDM,YAAhD;AAAA,MAA8DC,SAA9D,GAAoGP,KAApG,CAA8DO,SAA9D;AAAA,MAAyEC,OAAzE,GAAoG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able = /*#__PURE__*/React__default.forwardRef(function PaginatedTable(props, ref) {
4
+ var PaginatedTable = /*#__PURE__*/React__default.forwardRef(function PaginatedTable(props, ref) {
5
5
  return React__default.createElement(Table, Object.assign({}, props, {
6
6
  disablePagination: false,
7
7
  ref: ref
8
8
  }));
9
9
  });
10
10
 
11
- PaginatedTable.Column = () => null;
11
+ PaginatedTable.Column = function () {
12
+ return null;
13
+ };
12
14
 
13
- PaginatedTable.Group = () => null;
15
+ PaginatedTable.Group = function () {
16
+ return null;
17
+ };
14
18
 
15
19
  export { PaginatedTable };
16
20
  //# sourceMappingURL=PaginatedTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaginatedTable.js","sources":["../../../../../src/components/Table/components/PaginatedTable.tsx"],"sourcesContent":["import React from 'react';\r\nimport { ForwardedGenericTableWithStatics, TableProps, TableRef } from '../types';\r\nimport { Table } from './Table';\r\n\r\nexport const PaginatedTable = React.forwardRef(function PaginatedTable<T>(props: TableProps<T>, ref: React.Ref<TableRef>) {\r\n return <Table {...props} disablePagination={false} ref={ref} />;\r\n}) as ForwardedGenericTableWithStatics;\r\n\r\nPaginatedTable.Column = () => null;\r\nPaginatedTable.Group = () => null;\r\n"],"names":["PaginatedTable","React","forwardRef","props","ref","Table","disablePagination","Column","Group"],"mappings":";;;MAIaA,cAAc,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,cAAT,CAA2BG,KAA3B,EAAiDC,GAAjD;AAC3C,SAAOH,4BAAA,CAACI,KAAD,oBAAWF;AAAOG,IAAAA,iBAAiB,EAAE;AAAOF,IAAAA,GAAG,EAAEA;IAAjD,CAAP;AACH,CAF6B;;AAI9BJ,cAAc,CAACO,MAAf,GAAwB,MAAM,IAA9B;;AACAP,cAAc,CAACQ,KAAf,GAAuB,MAAM,IAA7B;;;;"}
1
+ {"version":3,"file":"PaginatedTable.js","sources":["../../../../../src/components/Table/components/PaginatedTable.tsx"],"sourcesContent":["import React from 'react';\nimport { ForwardedGenericTableWithStatics, TableProps, TableRef } from '../types';\nimport { Table } from './Table';\n\nexport const PaginatedTable = React.forwardRef(function PaginatedTable<T>(props: TableProps<T>, ref: React.Ref<TableRef>) {\n return <Table {...props} disablePagination={false} ref={ref} />;\n}) as ForwardedGenericTableWithStatics;\n\nPaginatedTable.Column = () => null;\nPaginatedTable.Group = () => null;\n"],"names":["PaginatedTable","React","forwardRef","props","ref","Table","disablePagination","Column","Group"],"mappings":";;;IAIaA,cAAc,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,cAAT,CAA2BG,KAA3B,EAAiDC,GAAjD;AAC3C,SAAOH,4BAAA,CAACI,KAAD,oBAAWF;AAAOG,IAAAA,iBAAiB,EAAE;AAAOF,IAAAA,GAAG,EAAEA;IAAjD,CAAP;AACH,CAF6B;;AAI9BJ,cAAc,CAACO,MAAf,GAAwB;AAAA,SAAM,IAAN;AAAA,CAAxB;;AACAP,cAAc,CAACQ,KAAf,GAAuB;AAAA,SAAM,IAAN;AAAA,CAAvB;;;;"}