@economic/taco 0.0.10-alpha.0 → 0.0.13-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/IconButton/IconButton.d.ts +10 -14
  3. package/dist/components/Menu/Menu.d.ts +1 -0
  4. package/dist/components/Menu/components/Item.d.ts +3 -0
  5. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  6. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  7. package/dist/esm/components/Badge/Badge.js.map +1 -1
  8. package/dist/esm/components/Banner/Banner.js +1 -1
  9. package/dist/esm/components/Banner/Banner.js.map +1 -1
  10. package/dist/esm/components/Banner/util.js +1 -1
  11. package/dist/esm/components/Banner/util.js.map +1 -1
  12. package/dist/esm/components/Button/Button.js.map +1 -1
  13. package/dist/esm/components/Button/util.js +57 -36
  14. package/dist/esm/components/Button/util.js.map +1 -1
  15. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  16. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  17. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  18. package/dist/esm/components/Combobox/useCombobox.js +64 -84
  19. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  20. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  21. package/dist/esm/components/Datepicker/useDatepicker.js +35 -33
  22. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  23. package/dist/esm/components/Dialog/Context.js +3 -3
  24. package/dist/esm/components/Dialog/Context.js.map +1 -1
  25. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  26. package/dist/esm/components/Dialog/components/Content.js +39 -44
  27. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  28. package/dist/esm/components/Dialog/components/Drawer.js +3 -3
  29. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  30. package/dist/esm/components/Dialog/components/Extra.js +2 -2
  31. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  32. package/dist/esm/components/Dialog/components/Trigger.js +2 -2
  33. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  34. package/dist/esm/components/Form/Form.js.map +1 -1
  35. package/dist/esm/components/Group/Group.js.map +1 -1
  36. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  37. package/dist/esm/components/Icon/Icon.js.map +1 -1
  38. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  39. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  40. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  41. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  42. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  43. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  44. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  45. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  46. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  47. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  48. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  49. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  50. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  51. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  52. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  53. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  54. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  55. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  56. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  57. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  58. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  59. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  60. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  61. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  62. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  63. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  64. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  65. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  66. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  67. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  68. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  69. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  70. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  71. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  72. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  73. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  74. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  75. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  76. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  77. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  78. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  79. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  80. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  81. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  82. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  83. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  84. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  85. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  86. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  87. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  88. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  89. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  90. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  91. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  92. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  93. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  94. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  95. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  96. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  97. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  98. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  99. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  100. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  101. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  102. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  103. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  104. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  105. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  106. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  107. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  108. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  109. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  110. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  111. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  112. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  113. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  114. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  115. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  116. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  117. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  118. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  119. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  120. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  121. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  122. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  123. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  124. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  125. package/dist/esm/components/Icon/components/ExportToExcelCopy.js.map +1 -1
  126. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  127. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  128. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  129. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  130. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  131. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  132. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  133. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  134. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  135. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  136. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  137. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  138. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  139. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  140. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  141. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  142. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  143. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  144. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  145. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  146. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  147. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  148. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  149. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  150. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  151. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  152. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  153. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  154. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  155. package/dist/esm/components/Icon/components/List.js.map +1 -1
  156. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  157. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  158. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  159. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  160. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  161. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  162. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  163. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  164. package/dist/esm/components/Icon/components/Minus.js.map +1 -1
  165. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  166. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  167. package/dist/esm/components/Icon/components/More.js.map +1 -1
  168. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  169. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  170. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  171. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  172. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  173. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  174. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  175. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  176. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  177. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  178. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  179. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  180. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  181. package/dist/esm/components/Icon/components/PlusCircle.js.map +1 -1
  182. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  183. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  184. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  185. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  186. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  187. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  188. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  189. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  190. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  191. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  192. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  193. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  194. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  195. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  196. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  197. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  198. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  199. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  200. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  201. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  202. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  203. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  204. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  205. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  206. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  207. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  208. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  209. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  210. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  211. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  212. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  213. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  214. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  215. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  217. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  218. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  219. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  220. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  221. package/dist/esm/components/Icon/components/Thumb.js.map +1 -1
  222. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  223. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  224. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  225. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  226. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  227. package/dist/esm/components/Icon/components/TickCircle.js.map +1 -1
  228. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  229. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  230. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  231. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  232. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  233. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  234. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  235. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  236. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  237. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  238. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  239. package/dist/esm/components/Icon/components/index.js +4 -4
  240. package/dist/esm/components/Icon/components/index.js.map +1 -1
  241. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  242. package/dist/esm/components/Input/Input.js.map +1 -1
  243. package/dist/esm/components/Input/util.js +9 -8
  244. package/dist/esm/components/Input/util.js.map +1 -1
  245. package/dist/esm/components/Label/Label.js.map +1 -1
  246. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  247. package/dist/esm/components/Listbox/ScrollableList.js +63 -82
  248. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  249. package/dist/esm/components/Listbox/useListbox.js +49 -58
  250. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  251. package/dist/esm/components/Listbox/useMultiListbox.js +63 -91
  252. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  253. package/dist/esm/components/Listbox/useTypeahead.js +10 -9
  254. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  255. package/dist/esm/components/Listbox/util.js +48 -84
  256. package/dist/esm/components/Listbox/util.js.map +1 -1
  257. package/dist/esm/components/Menu/Context.js +2 -2
  258. package/dist/esm/components/Menu/Context.js.map +1 -1
  259. package/dist/esm/components/Menu/Menu.js.map +1 -1
  260. package/dist/esm/components/Menu/components/Checkbox.js +8 -9
  261. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  262. package/dist/esm/components/Menu/components/Content.js +10 -13
  263. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  264. package/dist/esm/components/Menu/components/Header.js +4 -4
  265. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  266. package/dist/esm/components/Menu/components/Item.js +59 -43
  267. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  268. package/dist/esm/components/Menu/components/Link.js +7 -8
  269. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  270. package/dist/esm/components/Menu/components/RadioGroup.js +16 -18
  271. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  272. package/dist/esm/components/Menu/components/Separator.js +4 -4
  273. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  274. package/dist/esm/components/Menu/components/Trigger.js +5 -5
  275. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  276. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  277. package/dist/esm/components/Pagination/PageNumbers.js +23 -28
  278. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  279. package/dist/esm/components/Pagination/Pagination.js +39 -56
  280. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  281. package/dist/esm/components/Pagination/usePagination.js +7 -21
  282. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  283. package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
  284. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  285. package/dist/esm/components/Popover/Popover.js +29 -34
  286. package/dist/esm/components/Popover/Popover.js.map +1 -1
  287. package/dist/esm/components/Popover/Primitives.js +27 -30
  288. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  289. package/dist/esm/components/Progress/Progress.js +11 -15
  290. package/dist/esm/components/Progress/Progress.js.map +1 -1
  291. package/dist/esm/components/Provider/Provider.js +14 -19
  292. package/dist/esm/components/Provider/Provider.js.map +1 -1
  293. package/dist/esm/components/RadioGroup/RadioGroup.js +45 -57
  294. package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
  295. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  296. package/dist/esm/components/Select/Select.js +30 -31
  297. package/dist/esm/components/Select/Select.js.map +1 -1
  298. package/dist/esm/components/Select/useSelect.js +63 -82
  299. package/dist/esm/components/Select/useSelect.js.map +1 -1
  300. package/dist/esm/components/Spinner/Spinner.js +12 -19
  301. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  302. package/dist/esm/components/Switch/Switch.js +9 -10
  303. package/dist/esm/components/Switch/Switch.js.map +1 -1
  304. package/dist/esm/components/Table/components/BaseTable.js +23 -30
  305. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  306. package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
  307. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  308. package/dist/esm/components/Table/components/Table.js +18 -25
  309. package/dist/esm/components/Table/components/Table.js.map +1 -1
  310. package/dist/esm/components/Table/components/WindowedTable.js +88 -104
  311. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  312. package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -146
  313. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  314. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
  315. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  316. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
  317. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  318. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +80 -90
  319. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  320. package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
  321. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  322. package/dist/esm/components/Table/hooks/useTable.js +119 -141
  323. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  324. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +12 -15
  325. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  326. package/dist/esm/components/Table/util/renderColumn.js +10 -10
  327. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  328. package/dist/esm/components/Table/util/renderRow.js +37 -46
  329. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  330. package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
  331. package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
  332. package/dist/esm/components/Table/util/sortTypes.js +23 -31
  333. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  334. package/dist/esm/components/Table/util.js +29 -41
  335. package/dist/esm/components/Table/util.js.map +1 -1
  336. package/dist/esm/components/Tabs/Tabs.js +25 -27
  337. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  338. package/dist/esm/components/Textarea/Textarea.js +8 -6
  339. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  340. package/dist/esm/components/Toast/Toast.js +20 -21
  341. package/dist/esm/components/Toast/Toast.js.map +1 -1
  342. package/dist/esm/components/Toast/Toaster.js +88 -118
  343. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  344. package/dist/esm/components/Toast/util.js +2 -2
  345. package/dist/esm/components/Toast/util.js.map +1 -1
  346. package/dist/esm/components/Tooltip/Tooltip.js +7 -8
  347. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  348. package/dist/esm/components/Tour/Tour.js +44 -50
  349. package/dist/esm/components/Tour/Tour.js.map +1 -1
  350. package/dist/esm/components/Treeview/Treeview.js +26 -36
  351. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  352. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
  353. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  354. package/dist/esm/index.css +638 -638
  355. package/dist/esm/index.js +1 -1
  356. package/dist/esm/primitives/Button.js +9 -13
  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 +12 -20
  360. package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
  361. package/dist/esm/utils/hooks/useDraggable.js +16 -18
  362. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  363. package/dist/esm/utils/hooks/useDropTarget.js +7 -10
  364. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  365. package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  366. package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
  367. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  368. package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
  369. package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
  370. package/dist/esm/utils/hooks/useTimer.js +9 -17
  371. package/dist/esm/utils/hooks/useTimer.js.map +1 -1
  372. package/dist/esm/utils/input.js +7 -11
  373. package/dist/esm/utils/input.js.map +1 -1
  374. package/dist/esm/utils/mergeRefs.js +2 -2
  375. package/dist/esm/utils/mergeRefs.js.map +1 -1
  376. package/dist/esm/utils/taillwind.js +2 -2
  377. package/dist/esm/utils/taillwind.js.map +1 -1
  378. package/dist/index.css +638 -638
  379. package/dist/taco.cjs.development.js +1944 -2316
  380. package/dist/taco.cjs.development.js.map +1 -1
  381. package/dist/taco.cjs.production.min.js +1 -1
  382. package/dist/taco.cjs.production.min.js.map +1 -1
  383. package/dist/utils/tailwind.d.ts +1 -1
  384. package/package.json +2 -2
  385. package/plugins/tailwindcss-aria-attributes.js +73 -73
  386. package/tailwind.config.js +297 -297
  387. package/types.json +550 -454
@@ -1,31 +1,26 @@
1
- import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { useState, useEffect } from 'react';
3
2
  import { useLocalization } from '../Provider/Provider.js';
4
3
  import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
5
4
  import { setInputValueByRef } from '../../utils/input.js';
6
5
  import { format, parseFromCustomString } from '../../utils/date.js';
7
6
 
8
- var _excluded = ["defaultValue", "calendar", "onBlur", "onChange", "value"];
9
- var useDatepicker = function useDatepicker(_ref, ref) {
10
- var calendar = _ref.calendar,
11
- onBlur = _ref.onBlur,
12
- onChange = _ref.onChange,
13
- value = _ref.value,
14
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
15
-
16
- var inputRef = useProxiedRef(ref);
17
-
18
- var _useLocalization = useLocalization(),
19
- formatting = _useLocalization.formatting;
20
-
21
- var _React$useState = useState(value ? format(value, formatting.date) : ''),
22
- internalValue = _React$useState[0],
23
- setInternalValue = _React$useState[1]; // update internal value if it changed 'externally'
24
-
25
-
26
- useEffect(function () {
7
+ const useDatepicker = ({
8
+ defaultValue: _,
9
+ calendar,
10
+ onBlur,
11
+ onChange,
12
+ value,
13
+ ...props
14
+ }, ref) => {
15
+ const inputRef = useProxiedRef(ref);
16
+ const {
17
+ formatting
18
+ } = useLocalization();
19
+ const [internalValue, setInternalValue] = useState(value ? format(value, formatting.date) : ''); // update internal value if it changed 'externally'
20
+
21
+ useEffect(() => {
27
22
  if (value) {
28
- var formattedValue = format(value, formatting.date);
23
+ const formattedValue = format(value, formatting.date);
29
24
 
30
25
  if (formattedValue !== internalValue) {
31
26
  setInternalValue(formattedValue);
@@ -35,10 +30,10 @@ var useDatepicker = function useDatepicker(_ref, ref) {
35
30
  }
36
31
  }, [value]); // event handlers
37
32
 
38
- var handleInputBlur = function handleInputBlur(event) {
33
+ const handleInputBlur = event => {
39
34
  event.persist();
40
- var valueAsDate = parseFromCustomString(event.target.value);
41
- var formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
35
+ const valueAsDate = parseFromCustomString(event.target.value);
36
+ const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';
42
37
  event.target.value = formattedValue;
43
38
 
44
39
  if (onChange) {
@@ -54,28 +49,35 @@ var useDatepicker = function useDatepicker(_ref, ref) {
54
49
  }
55
50
  };
56
51
 
57
- var handleInputChange = function handleInputChange(event) {
52
+ const handleInputChange = event => {
58
53
  setInternalValue(event.target.value);
59
54
  };
60
55
 
61
- var handleChange = function handleChange(date) {
56
+ const handleChange = date => {
62
57
  setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');
63
58
  };
64
59
 
65
- var inputProps = _extends({}, props, {
60
+ const handleKeyDown = event => {
61
+ if (event.key === 'Enter') {
62
+ event.target.dispatchEvent(new Event('focusout', {
63
+ bubbles: true
64
+ }));
65
+ }
66
+ };
67
+
68
+ const inputProps = { ...props,
66
69
  autoComplete: 'off',
67
70
  onBlur: handleInputBlur,
68
71
  onChange: handleInputChange,
72
+ onKeyDown: handleKeyDown,
69
73
  ref: inputRef,
70
74
  type: 'text',
71
75
  value: internalValue
72
- });
73
-
74
- var calendarProps = _extends({}, calendar, {
76
+ };
77
+ const calendarProps = { ...calendar,
75
78
  onChange: handleChange,
76
- value: value
77
- });
78
-
79
+ value
80
+ };
79
81
  return {
80
82
  input: inputProps,
81
83
  calendar: calendarProps
@@ -1 +1 @@
1
- {"version":3,"file":"useDatepicker.js","sources":["../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { parseFromCustomString, format } from '../../utils/date';\nimport { useLocalization } from '../Provider/Provider';\nimport { setInputValueByRef } from '../../utils/input';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\nimport { DatepickerProps } from './Datepicker';\nimport { CalendarProps } from '../Calendar/Calendar';\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement> };\n\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\n calendar: CalendarProps;\n input: InputProps;\n};\n\nexport const useDatepicker = (\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\n ref: React.Ref<HTMLInputElement>\n): useDatepicker => {\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\n const { formatting } = useLocalization();\n const [internalValue, setInternalValue] = React.useState(value ? format(value, formatting.date) : '');\n\n // update internal value if it changed 'externally'\n React.useEffect(() => {\n if (value) {\n const formattedValue = format(value, formatting.date);\n\n if (formattedValue !== internalValue) {\n setInternalValue(formattedValue);\n }\n } else {\n setInternalValue('');\n }\n }, [value]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n const valueAsDate = parseFromCustomString(event.target.value);\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\n\n event.target.value = formattedValue;\n\n if (onChange) {\n (event as any).detail = valueAsDate;\n onChange(event);\n } else {\n // update the internal value to use the formatted date\n setInternalValue(formattedValue);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInternalValue(event.target.value);\n };\n\n const handleChange = date => {\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n ref: inputRef,\n type: 'text',\n value: internalValue,\n };\n\n const calendarProps: CalendarProps = {\n ...calendar,\n onChange: handleChange,\n value,\n };\n\n return {\n input: inputProps,\n calendar: calendarProps,\n };\n};\n"],"names":["useDatepicker","ref","calendar","onBlur","onChange","value","props","inputRef","useProxiedRef","useLocalization","formatting","React","format","date","internalValue","setInternalValue","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","detail","handleInputChange","handleChange","setInputValueByRef","current","inputProps","autoComplete","type","calendarProps","input"],"mappings":";;;;;;;;IAeaA,aAAa,GAAG,SAAhBA,aAAgB,OAEzBC,GAFyB;MACNC,gBAAAA;MAAUC,cAAAA;MAAQC,gBAAAA;MAAUC,aAAAA;MAAUC;;AAGzD,MAAMC,QAAQ,GAAGC,aAAa,CAAmBP,GAAnB,CAA9B;;AACA,yBAAuBQ,eAAe,EAAtC;AAAA,MAAQC,UAAR,oBAAQA,UAAR;;AACA,wBAA0CC,QAAA,CAAeN,KAAK,GAAGO,MAAM,CAACP,KAAD,EAAQK,UAAU,CAACG,IAAnB,CAAT,GAAoC,EAAxD,CAA1C;AAAA,MAAOC,aAAP;AAAA,MAAsBC,gBAAtB;;;AAGAJ,EAAAA,SAAA,CAAgB;AACZ,QAAIN,KAAJ,EAAW;AACP,UAAMW,cAAc,GAAGJ,MAAM,CAACP,KAAD,EAAQK,UAAU,CAACG,IAAnB,CAA7B;;AAEA,UAAIG,cAAc,KAAKF,aAAvB,EAAsC;AAClCC,QAAAA,g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AAAA,IAAI,EAAE,MANM;AAOZzB,IAAAA,KAAK,EAAES;AAPK,IAAhB;;AAUA,MAAMiB,aAAa,gBACZ7B,QADY;AAEfE,IAAAA,QAAQ,EAAEqB,YAFK;AAGfpB,IAAAA,KAAK,EAALA;AAHe,IAAnB;;AAMA,SAAO;AACH2B,IAAAA,KAAK,EAAEJ,UADJ;AAEH1B,IAAAA,QAAQ,EAAE6B;AAFP,GAAP;AAIH;;;;"}
1
+ {"version":3,"file":"useDatepicker.js","sources":["../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { parseFromCustomString, format } from '../../utils/date';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { setInputValueByRef } from '../../utils/input';\r\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\r\nimport { DatepickerProps } from './Datepicker';\r\nimport { CalendarProps } from '../Calendar/Calendar';\r\n\r\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement> };\r\n\r\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\r\n calendar: CalendarProps;\r\n input: InputProps;\r\n};\r\n\r\nexport const useDatepicker = (\r\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\r\n ref: React.Ref<HTMLInputElement>\r\n): useDatepicker => {\r\n const inputRef = useProxiedRef<HTMLInputElement>(ref);\r\n const { formatting } = useLocalization();\r\n const [internalValue, setInternalValue] = React.useState(value ? format(value, formatting.date) : '');\r\n\r\n // update internal value if it changed 'externally'\r\n React.useEffect(() => {\r\n if (value) {\r\n const formattedValue = format(value, formatting.date);\r\n\r\n if (formattedValue !== internalValue) {\r\n setInternalValue(formattedValue);\r\n }\r\n } else {\r\n setInternalValue('');\r\n }\r\n }, [value]);\r\n\r\n // event handlers\r\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n const valueAsDate = parseFromCustomString(event.target.value);\r\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\r\n\r\n event.target.value = formattedValue;\r\n\r\n if (onChange) {\r\n (event as any).detail = valueAsDate;\r\n onChange(event);\r\n } else {\r\n // update the internal value to use the formatted date\r\n setInternalValue(formattedValue);\r\n }\r\n\r\n if (onBlur) {\r\n onBlur(event);\r\n }\r\n };\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\r\n setInternalValue(event.target.value);\r\n };\r\n\r\n const handleChange = date => {\r\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\r\n };\r\n\r\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === 'Enter') {\r\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\r\n }\r\n };\r\n\r\n const inputProps: InputProps = {\r\n ...props,\r\n autoComplete: 'off',\r\n onBlur: handleInputBlur,\r\n onChange: handleInputChange,\r\n onKeyDown: handleKeyDown,\r\n ref: inputRef,\r\n type: 'text',\r\n value: internalValue,\r\n };\r\n\r\n const calendarProps: CalendarProps = {\r\n ...calendar,\r\n onChange: handleChange,\r\n value,\r\n };\r\n\r\n return {\r\n input: inputProps,\r\n calendar: calendarProps,\r\n };\r\n};\r\n"],"names":["useDatepicker","defaultValue","_","calendar","onBlur","onChange","value","props","ref","inputRef","useProxiedRef","formatting","useLocalization","internalValue","setInternalValue","React","format","date","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","detail","handleInputChange","handleChange","setInputValueByRef","current","handleKeyDown","key","dispatchEvent","Event","bubbles","inputProps","autoComplete","onKeyDown","type","calendarProps","input"],"mappings":";;;;;;MAeaA,aAAa,GAAG,CACzB;AAAEC,EAAAA,YAAY,EAAEC,CAAhB;AAAmBC,EAAAA,QAAnB;AAA6BC,EAAAA,MAA7B;AAAqCC,EAAAA,QAArC;AAA+CC,EAAAA,KAA/C;AAAsD,KAAGC;AAAzD,CADyB,EAEzBC,GAFyB;AAIzB,QAAMC,QAAQ,GA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AAIA,QAAMqB,YAAY,GAAGV,IAAI;AACrBW,IAAAA,kBAAkB,CAACnB,QAAQ,CAACoB,OAAV,EAAmBb,MAAM,CAACC,IAAD,EAAON,UAAU,CAACM,IAAlB,CAAzB,EAAkD,UAAlD,CAAlB;AACH,GAFD;;AAIA,QAAMa,aAAa,GAAIV,KAAD;AAClB,QAAIA,KAAK,CAACW,GAAN,KAAc,OAAlB,EAA2B;AACvBX,MAAAA,KAAK,CAACI,MAAN,CAAaQ,aAAb,CAA2B,IAAIC,KAAJ,CAAU,UAAV,EAAsB;AAAEC,QAAAA,OAAO,EAAE;AAAX,OAAtB,CAA3B;AACH;AACJ,GAJD;;AAMA,QAAMC,UAAU,GAAe,EAC3B,GAAG5B,KADwB;AAE3B6B,IAAAA,YAAY,EAAE,KAFa;AAG3BhC,IAAAA,MAAM,EAAEe,eAHmB;AAI3Bd,IAAAA,QAAQ,EAAEqB,iBAJiB;AAK3BW,IAAAA,SAAS,EAAEP,aALgB;AAM3BtB,IAAAA,GAAG,EAAEC,QANsB;AAO3B6B,IAAAA,IAAI,EAAE,MAPqB;AAQ3BhC,IAAAA,KAAK,EAAEO;AARoB,GAA/B;AAWA,QAAM0B,aAAa,GAAkB,EACjC,GAAGpC,QAD8B;AAEjCE,IAAAA,QAAQ,EAAEsB,YAFuB;AAGjCrB,IAAAA;AAHiC,GAArC;AAMA,SAAO;AACHkC,IAAAA,KAAK,EAAEL,UADJ;AAEHhC,IAAAA,QAAQ,EAAEoC;AAFP,GAAP;AAIH;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { createContext, useContext } from 'react';
2
2
 
3
3
  /* eslint-disable @typescript-eslint/no-empty-function */
4
- var DialogContext = /*#__PURE__*/createContext({
4
+ const DialogContext = /*#__PURE__*/createContext({
5
5
  closeOnEscape: true,
6
6
  draggable: false,
7
7
  drawer: undefined,
@@ -9,13 +9,13 @@ var DialogContext = /*#__PURE__*/createContext({
9
9
  drawer: undefined,
10
10
  extra: undefined
11
11
  },
12
- onClose: function onClose() {},
12
+ onClose: () => {},
13
13
  props: {},
14
14
  ref: null,
15
15
  showCloseButton: true,
16
16
  size: 'sm'
17
17
  });
18
- var useCurrentDialog = function useCurrentDialog() {
18
+ const useCurrentDialog = () => {
19
19
  return useContext(DialogContext);
20
20
  };
21
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sources":["../../../../src/components/Dialog/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport * as React from 'react';\nimport { DialogSize } from './types';\n\nexport type DialogContext = {\n closeOnEscape: boolean;\n draggable: boolean;\n drawer?: {\n open: boolean;\n toggle: () => void;\n };\n elements: {\n drawer?: React.ReactNode;\n extra?: React.ReactNode;\n };\n onClose?: () => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n showCloseButton: boolean;\n size: DialogSize;\n};\n\nexport const DialogContext = React.createContext<DialogContext>({\n closeOnEscape: true,\n draggable: false,\n drawer: undefined,\n elements: {\n drawer: undefined,\n extra: undefined,\n },\n onClose: () => {},\n props: {},\n ref: null,\n showCloseButton: true,\n size: 'sm',\n});\n\nexport const useCurrentDialog = () => {\n return React.useContext(DialogContext);\n};\n"],"names":["DialogContext","React","closeOnEscape","draggable","drawer","undefined","elements","extra","onClose","props","ref","showCloseButton","size","useCurrentDialog"],"mappings":";;AAAA;IAsBaA,aAAa,gBAAGC,aAAA,CAAmC;AAC5DC,EAAAA,aAAa,EAAE,IAD6C;AAE5DC,EAAAA,SAAS,EAAE,KAFiD;AAG5DC,EAAAA,MAAM,EAAEC,SAHoD;AAI5DC,EAAAA,QAAQ,EAAE;AACNF,IAAAA,MAAM,EAAEC,SADF;AAENE,IAAAA,KAAK,EAAEF;AAFD,GAJkD;AAQ5DG,EAAAA,OAAO,EAAE,qBARmD;AAS5DC,EAAAA,KAAK,EAAE,EATqD;AAU5DC,EAAAA,GAAG,EAAE,IAVuD;AAW5DC,EAAAA,eAAe,EAAE,IAX2C;AAY5DC,EAAAA,IAAI,EAAE;AAZsD,CAAnC;IAehBC,gBAAgB,GAAG,SAAnBA,gBAAmB;AAC5B,SAAOZ,UAAA,CAAiBD,aAAjB,CAAP;AACH;;;;"}
1
+ {"version":3,"file":"Context.js","sources":["../../../../src/components/Dialog/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\r\nimport * as React from 'react';\r\nimport { DialogSize } from './types';\r\n\r\nexport type DialogContext = {\r\n closeOnEscape: boolean;\r\n draggable: boolean;\r\n drawer?: {\r\n open: boolean;\r\n toggle: () => void;\r\n };\r\n elements: {\r\n drawer?: React.ReactNode;\r\n extra?: React.ReactNode;\r\n };\r\n onClose?: () => void;\r\n props: {};\r\n ref: React.Ref<HTMLElement>;\r\n showCloseButton: boolean;\r\n size: DialogSize;\r\n};\r\n\r\nexport const DialogContext = React.createContext<DialogContext>({\r\n closeOnEscape: true,\r\n draggable: false,\r\n drawer: undefined,\r\n elements: {\r\n drawer: undefined,\r\n extra: undefined,\r\n },\r\n onClose: () => {},\r\n props: {},\r\n ref: null,\r\n showCloseButton: true,\r\n size: 'sm',\r\n});\r\n\r\nexport const useCurrentDialog = () => {\r\n return React.useContext(DialogContext);\r\n};\r\n"],"names":["DialogContext","React","closeOnEscape","draggable","drawer","undefined","elements","extra","onClose","props","ref","showCloseButton","size","useCurrentDialog"],"mappings":";;AAAA;MAsBaA,aAAa,gBAAGC,aAAA,CAAmC;AAC5DC,EAAAA,aAAa,EAAE,IAD6C;AAE5DC,EAAAA,SAAS,EAAE,KAFiD;AAG5DC,EAAAA,MAAM,EAAEC,SAHoD;AAI5DC,EAAAA,QAAQ,EAAE;AACNF,IAAAA,MAAM,EAAEC,SADF;AAENE,IAAAA,KAAK,EAAEF;AAFD,GAJkD;AAQ5DG,EAAAA,OAAO,EAAE,QARmD;AAS5DC,EAAAA,KAAK,EAAE,EATqD;AAU5DC,EAAAA,GAAG,EAAE,IAVuD;AAW5DC,EAAAA,eAAe,EAAE,IAX2C;AAY5DC,EAAAA,IAAI,EAAE;AAZsD,CAAnC;MAehBC,gBAAgB,GAAG;AAC5B,SAAOZ,UAAA,CAAiBD,aAAjB,CAAP;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport './Dialog.css';\nimport { DialogTriggerProps, Trigger } from './components/Trigger';\nimport {\n Content,\n Title,\n Footer,\n Close,\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { DialogDrawerProps, Drawer } from './components/Drawer';\nimport { DialogExtraProps, Extra } from './components/Extra';\nimport { DialogContext } from './Context';\nimport { DialogSize } from './types';\n\nexport {\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n DialogSize,\n};\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** When `true`, pressing escape will close the dialog */\n closeOnEscape?: boolean;\n /** Set whether the dialog is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Called when the dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Shows the close icon button of the dialog */\n showCloseButton?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\n\nconst useSeparatedChildren = initialChildren => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.forEach(initialChildren, (child: any) => {\n if (child.type.displayName === 'Drawer') {\n drawer = child;\n } else if (child.type.displayName === 'Extra') {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const Dialog = React.forwardRef((props: DialogProps, ref: React.Ref<HTMLElement>): JSX.Element => {\n const {\n children: initialChildren,\n closeOnEscape = true,\n defaultOpen,\n draggable = false,\n onChange,\n onClose,\n open,\n showCloseButton = true,\n size = 'sm',\n trigger,\n ...otherProps\n } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n props: otherProps,\n showCloseButton,\n size,\n ref,\n }),\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\n );\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root defaultOpen={defaultOpen} open={open} onOpenChange={onChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = Drawer;\nDialog.Close = Close;\n"],"names":["useSeparatedChildren","initialChildren","React","children","drawer","extra","forEach","child","type","displayName","push","Dialog","props","ref","closeOnEscape","defaultOpen","draggable","onChange","onClose","open","showCloseButton","size","trigger","otherProps","drawerOpen","setDrawerOpen","context","toggle","isDrawerOpen","elements","DialogContext","Provider","value","DialogPrimitive","onOpenChange","Trigger","Content","Title","Footer","Extra","Drawer","Close"],"mappings":";;;;;;;;;;;AA8DA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,eAAe;AACxC,SAAOC,OAAA,CAAc;AACjB,QAAMC,QAAQ,GAAU,EAAxB;AACA,QAAIC,MAAJ;AACA,QAAIC,KAAJ;AAEAH,IAAAA,QAAA,CAAeI,OAAf,CAAuBL,eAAvB,EAAwC,UAACM,KAAD;AACpC,UAAIA,KAAK,CAACC,IAAN,CAAWC,WAAX,KAA2B,QAA/B,EAAyC;AACrCL,QAAAA,MAAM,GAAGG,KAAT;AACH,OAFD,MAEO,IAAIA,KAAK,CAACC,IAAN,CAAWC,WAAX,KAA2B,OAA/B,EAAwC;AAC3CJ,QAAAA,KAAK,GAAGE,KAAR;AACH,OAFM,MAEA;AACHJ,QAAAA,QAAQ,CAACO,IAAT,CAAcH,KAAd;AACH;AACJ,KARD;AAUA,WAAO,CAACJ,QAAD,EAAWC,MAAX,EAAmBC,KAAnB,CAAP;AACH,GAhBM,EAgBJ,CAACJ,eAAD,CAhBI,CAAP;AAiBH,CAlBD;;IA8BaU,MAAM,gBAAGT,UAAA,CAAiB,UAACU,KAAD,EAAqBC,GAArB;AACnC,MACcZ,eADd,GAYIW,KAZJ,CACIT,QADJ;AA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AAfA,eAbG;AAcHC,MAAAA,IAAI,EAAJA,IAdG;AAeHR,MAAAA,GAAG,EAAHA;AAfG,KAAP;AAAA,GADY,EAkBZ,CAACC,aAAD,EAAgBU,UAAhB,EAA4BR,SAA5B,EAAuCZ,MAAvC,EAA+CC,KAA/C,EAAsDc,IAAtD,EAA4DI,UAA5D,EAAwEH,eAAxE,CAlBY,CAAhB;AAqBA,SACIlB,aAAA,CAAC4B,aAAa,CAACC,QAAf;AAAwBC,IAAAA,KAAK,EAAEN;GAA/B,EACIxB,aAAA,CAAC+B,IAAD;AAAsBlB,IAAAA,WAAW,EAAEA;AAAaI,IAAAA,IAAI,EAAEA;AAAMe,IAAAA,YAAY,EAAEjB;GAA1E,EACKK,OAAO,IAAIpB,aAAA,CAACiC,OAAD,MAAA,EAAUb,OAAV,CADhB,EAEKnB,QAFL,CADJ,CADJ;AAQH,CA9CqB;AAgDtBQ,MAAM,CAACwB,OAAP,GAAiBA,OAAjB;AACAxB,MAAM,CAACyB,OAAP,GAAiBA,OAAjB;AACAzB,MAAM,CAAC0B,KAAP,GAAeA,KAAf;AACA1B,MAAM,CAAC2B,MAAP,GAAgBA,MAAhB;AACA3B,MAAM,CAAC4B,KAAP,GAAeA,KAAf;AACA5B,MAAM,CAAC6B,MAAP,GAAgBA,MAAhB;AACA7B,MAAM,CAAC8B,KAAP,GAAeA,KAAf;;;;"}
1
+ {"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\r\nimport './Dialog.css';\r\nimport { DialogTriggerProps, Trigger } from './components/Trigger';\r\nimport {\r\n Content,\r\n Title,\r\n Footer,\r\n Close,\r\n DialogContentProps,\r\n DialogContentRenderProps,\r\n DialogContentDrawerRenderProps,\r\n DialogTitleProps,\r\n DialogFooterProps,\r\n DialogCloseProps,\r\n} from './components/Content';\r\nimport { DialogDrawerProps, Drawer } from './components/Drawer';\r\nimport { DialogExtraProps, Extra } from './components/Extra';\r\nimport { DialogContext } from './Context';\r\nimport { DialogSize } from './types';\r\n\r\nexport {\r\n DialogContentProps,\r\n DialogContentRenderProps,\r\n DialogContentDrawerRenderProps,\r\n DialogTitleProps,\r\n DialogFooterProps,\r\n DialogCloseProps,\r\n DialogSize,\r\n};\r\n\r\nexport type DialogTexts = {\r\n /**\r\n * Aria-label for close icon button in dialog.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n close: string;\r\n drag: string;\r\n};\r\n\r\nexport type DialogProps = {\r\n children: React.ReactNode | React.ReactNode[];\r\n /** When `true`, pressing escape will close the dialog */\r\n closeOnEscape?: boolean;\r\n /** Set whether the dialog is open by default or not, use when not providing a trigger */\r\n defaultOpen?: boolean;\r\n /** Allows dragging the dialog around the screen (window constrained) */\r\n draggable?: boolean;\r\n /** Handler called when dialog closes by user interaction */\r\n onClose?: () => void;\r\n /** Called when the dialog opens or closes, must be used in conjunction with open */\r\n onChange?: (open: boolean) => void;\r\n /** Control the open state of the dialog from outside the component */\r\n open?: boolean;\r\n /** Shows the close icon button of the dialog */\r\n showCloseButton?: boolean;\r\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\r\n size?: DialogSize;\r\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\r\n trigger?: JSX.Element;\r\n};\r\n\r\nconst useSeparatedChildren = initialChildren => {\r\n return React.useMemo(() => {\r\n const children: any[] = [];\r\n let drawer;\r\n let extra;\r\n\r\n React.Children.forEach(initialChildren, (child: any) => {\r\n if (child.type.displayName === 'Drawer') {\r\n drawer = child;\r\n } else if (child.type.displayName === 'Extra') {\r\n extra = child;\r\n } else {\r\n children.push(child);\r\n }\r\n });\r\n\r\n return [children, drawer, extra];\r\n }, [initialChildren]);\r\n};\r\n\r\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\r\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\r\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\r\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\r\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\r\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\r\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\r\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\r\n};\r\n\r\nexport const Dialog = React.forwardRef((props: DialogProps, ref: React.Ref<HTMLElement>): JSX.Element => {\r\n const {\r\n children: initialChildren,\r\n closeOnEscape = true,\r\n defaultOpen,\r\n draggable = false,\r\n onChange,\r\n onClose,\r\n open,\r\n showCloseButton = true,\r\n size = 'sm',\r\n trigger,\r\n ...otherProps\r\n } = props;\r\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\r\n const [drawerOpen, setDrawerOpen] = React.useState(false);\r\n\r\n const context = React.useMemo(\r\n () => ({\r\n closeOnEscape,\r\n draggable,\r\n drawer: {\r\n open: drawerOpen,\r\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\r\n },\r\n elements: {\r\n drawer,\r\n extra,\r\n },\r\n onClose,\r\n props: otherProps,\r\n showCloseButton,\r\n size,\r\n ref,\r\n }),\r\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\r\n );\r\n\r\n return (\r\n <DialogContext.Provider value={context}>\r\n <DialogPrimitive.Root defaultOpen={defaultOpen} open={open} onOpenChange={onChange}>\r\n {trigger && <Trigger>{trigger}</Trigger>}\r\n {children}\r\n </DialogPrimitive.Root>\r\n </DialogContext.Provider>\r\n );\r\n}) as ForwardedDialogWithStatics;\r\n\r\nDialog.Trigger = Trigger;\r\nDialog.Content = Content;\r\nDialog.Title = Title;\r\nDialog.Footer = Footer;\r\nDialog.Extra = Extra;\r\nDialog.Drawer = Drawer;\r\nDialog.Close = Close;\r\n"],"names":["useSeparatedChildren","initialChildren","React","children","drawer","extra","forEach","child","type","displayName","push","Dialog","props","ref","closeOnEscape","defaultOpen","draggable","onChange","onClose","open","showCloseButton","size","trigger","otherProps","drawerOpen","setDrawerOpen","context","toggle","isDrawerOpen","elements","DialogContext","Provider","value","DialogPrimitive","onOpenChange","Trigger","Content","Title","Footer","Extra","Drawer","Close"],"mappings":";;;;;;;;;;;AA8DA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,eAAe;AACxC,SAAOC,OAAA,CAAc;AACjB,QAAMC,QAAQ,GAAU,EAAxB;AACA,QAAIC,MAAJ;AACA,QAAIC,KAAJ;AAEAH,IAAAA,QAAA,CAAeI,OAAf,CAAuBL,eAAvB,EAAwC,UAACM,KAAD;AACpC,UAAIA,KAAK,CAACC,IAAN,CAAWC,WAAX,KAA2B,QAA/B,EAAyC;AACrCL,QAAAA,MAAM,GAAGG,KAAT;AACH,OAFD,MAEO,IAAIA,KAAK,CAACC,IAAN,CAAWC,WAAX,KAA2B,OAA/B,EAAwC;AAC3CJ,QAAAA,KAAK,GAAGE,KAAR;AACH,OAFM,MAEA;AACHJ,QAAAA,QAAQ,CAACO,IAAT,CAAcH,KAAd;AACH;AACJ,KARD;AAUA,WAAO,CAACJ,QAAD,EAAWC,MAAX,EAAmBC,KAAnB,CAAP;AACH,GAhBM,EAgBJ,CAACJ,eAAD,CAhBI,CAAP;AAiBH,CAlBD;;IA8BaU,MAAM,gBAAGT,UAAA,CAAiB,UAACU,KAAD,EAAqBC,GAArB;AACnC,MACcZ,eADd,GAYIW,KAZJ,CACIT,QADJ;AAAA,6BAYIS,KAZJ,CAEIE,aAFJ;AAAA,MAEIA,aAFJ,qCAEoB,IAFpB;AAAA,MAGIC,WAHJ,GAYIH,KAZJ,CAGIG,WAHJ;AAAA,yBAYIH,KA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4BR,SAA5B,EAAuCZ,MAAvC,EAA+CC,KAA/C,EAAsDc,IAAtD,EAA4DI,UAA5D,EAAwEH,eAAxE,CAlBY,CAAhB;AAqBA,SACIlB,aAAA,CAAC4B,aAAa,CAACC,QAAf;AAAwBC,IAAAA,KAAK,EAAEN;GAA/B,EACIxB,aAAA,CAAC+B,IAAD;AAAsBlB,IAAAA,WAAW,EAAEA;AAAaI,IAAAA,IAAI,EAAEA;AAAMe,IAAAA,YAAY,EAAEjB;GAA1E,EACKK,OAAO,IAAIpB,aAAA,CAACiC,OAAD,MAAA,EAAUb,OAAV,CADhB,EAEKnB,QAFL,CADJ,CADJ;AAQH,CA9CqB;AAgDtBQ,MAAM,CAACwB,OAAP,GAAiBA,OAAjB;AACAxB,MAAM,CAACyB,OAAP,GAAiBA,OAAjB;AACAzB,MAAM,CAAC0B,KAAP,GAAeA,KAAf;AACA1B,MAAM,CAAC2B,MAAP,GAAgBA,MAAhB;AACA3B,MAAM,CAAC4B,KAAP,GAAeA,KAAf;AACA5B,MAAM,CAAC6B,MAAP,GAAgBA,MAAhB;AACA7B,MAAM,CAAC8B,KAAP,GAAeA,KAAf;;;;"}
@@ -1,4 +1,3 @@
1
- import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { forwardRef, createElement } from 'react';
3
2
  import cn from 'classnames';
4
3
  import { Backdrop } from '../../Backdrop/Backdrop.js';
@@ -10,22 +9,22 @@ import { useCurrentDialog } from '../Context.js';
10
9
  import { useDraggable } from '../../../utils/hooks/useDraggable.js';
11
10
  import { useCurrentMenu } from '../../Menu/Context.js';
12
11
 
13
- var Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
14
- var className = cn('text-center', props.className);
12
+ const Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
13
+ const className = cn('text-center', props.className);
15
14
  return createElement(Title$1, Object.assign({}, props, {
16
15
  className: className,
17
16
  ref: ref
18
17
  }));
19
18
  });
20
- var Footer = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
21
- var className = cn('mt-8 flex justify-end', props.className);
19
+ const Footer = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
20
+ const className = cn('mt-8 flex justify-end', props.className);
22
21
  return createElement("div", Object.assign({}, props, {
23
22
  className: className,
24
23
  ref: ref
25
24
  }), props.children);
26
25
  });
27
- var Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
28
- var dialog = useCurrentDialog();
26
+ const Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
27
+ const dialog = useCurrentDialog();
29
28
  return createElement(Close$1, Object.assign({
30
29
  onClick: dialog.onClose
31
30
  }, props, {
@@ -33,54 +32,52 @@ var Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
33
32
  asChild: true
34
33
  }));
35
34
  });
36
- var RenderPropWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
37
- var children = _ref.children,
38
- onClick = _ref.onClick,
39
- renderProps = _ref.renderProps;
40
-
41
- var close = function close() {
35
+ const RenderPropWrapper = /*#__PURE__*/forwardRef(({
36
+ children,
37
+ onClick,
38
+ renderProps
39
+ }, ref) => {
40
+ const close = () => {
42
41
  onClick(new CustomEvent('close'));
43
42
  };
44
43
 
45
- return children(_extends({
46
- close: close,
47
- ref: ref
48
- }, renderProps));
44
+ return children({
45
+ close,
46
+ ref,
47
+ ...renderProps
48
+ });
49
49
  });
50
- var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
51
- var dialog = useCurrentDialog();
52
- var internalRef = useProxiedRef(ref);
53
-
54
- var _useDraggable = useDraggable(internalRef),
55
- position = _useDraggable.position,
56
- dragHandleProps = _useDraggable.handleProps;
57
-
58
- var _useLocalization = useLocalization(),
59
- texts = _useLocalization.texts; // if the dialog was opened by a menu, we need to close the menu when the dialog closes
50
+ const Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
51
+ const dialog = useCurrentDialog();
52
+ const internalRef = useProxiedRef(ref);
53
+ const {
54
+ position,
55
+ handleProps: dragHandleProps
56
+ } = useDraggable(internalRef);
57
+ const {
58
+ texts
59
+ } = useLocalization(); // if the dialog was opened by a menu, we need to close the menu when the dialog closes
60
60
  // the menu is still open (and mounted) because it is the trigger for the dialog
61
61
 
62
-
63
- var menu = useCurrentMenu();
64
- var handleCloseAutoFocus;
62
+ const menu = useCurrentMenu();
63
+ let handleCloseAutoFocus;
65
64
 
66
65
  if (menu) {
67
- handleCloseAutoFocus = function handleCloseAutoFocus() {
68
- return menu.close();
69
- };
66
+ handleCloseAutoFocus = () => menu.close();
70
67
  }
71
68
 
72
- var className = cn('bg-white rounded relative mt-16 mx-auto', {
69
+ const className = cn('bg-white rounded relative mt-16 mx-auto', {
73
70
  'w-128 text-center justify-center': dialog.size === 'dialog',
74
71
  'w-xs': dialog.size === 'xs',
75
72
  'w-sm': dialog.size === 'sm',
76
73
  'w-md': dialog.size === 'md',
77
74
  'w-lg': dialog.size === 'lg'
78
75
  });
79
- var containerClassName = cn('bg-white p-6 rounded relative z-[999]', 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
76
+ const containerClassName = cn('bg-white p-6 rounded relative z-[999]', 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]', {
80
77
  'rounded-b-none': !!dialog.elements.extra
81
78
  }, props.className);
82
79
 
83
- var handleEscapeKeyDown = function handleEscapeKeyDown(event) {
80
+ const handleEscapeKeyDown = event => {
84
81
  if (!dialog.closeOnEscape) {
85
82
  event.preventDefault();
86
83
  } else if (dialog.onClose) {
@@ -89,11 +86,9 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
89
86
  }; // the chosen behaviour in taco is that outside clicks do not close the dialog
90
87
 
91
88
 
92
- var handleInteractOutside = function handleInteractOutside(event) {
93
- return event.preventDefault();
94
- };
89
+ const handleInteractOutside = event => event.preventDefault();
95
90
 
96
- var output;
91
+ let output;
97
92
 
98
93
  if (typeof props.children === 'function') {
99
94
  output = createElement(Close$1, {
@@ -115,10 +110,10 @@ var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
115
110
  onInteractOutside: handleInteractOutside,
116
111
  onCloseAutoFocus: handleCloseAutoFocus,
117
112
  ref: ref,
118
- style: _extends({}, props.style, {
119
- left: dialog.draggable ? position.x + "px" : undefined,
120
- top: dialog.draggable ? position.y + "px" : undefined
121
- })
113
+ style: { ...props.style,
114
+ left: dialog.draggable ? `${position.x}px` : undefined,
115
+ top: dialog.draggable ? `${position.y}px` : undefined
116
+ }
122
117
  }), createElement("div", {
123
118
  className: containerClassName,
124
119
  "data-taco": "dialog"
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sources":["../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\n\nexport type DialogContentDrawerRenderProps = {\n open: boolean;\n toggle: () => void;\n};\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: DialogContentDrawerRenderProps;\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('text-center', props.className);\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('mt-8 flex justify-end', props.className);\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\n </div>\n );\n});\n\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\n});\n\nconst RenderPropWrapper = React.forwardRef(({ children, onClick, renderProps }: any, ref) => {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useProxiedRef<HTMLDivElement>(ref);\n const { position, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n // if the dialog was opened by a menu, we need to close the menu when the dialog closes\n // the menu is still open (and mounted) because it is the trigger for the dialog\n const menu = useCurrentMenu();\n let handleCloseAutoFocus;\n\n if (menu) {\n handleCloseAutoFocus = () => menu.close();\n }\n\n const className = cn('bg-white rounded relative mt-16 mx-auto', {\n 'w-128 text-center justify-center': dialog.size === 'dialog',\n 'w-xs': dialog.size === 'xs',\n 'w-sm': dialog.size === 'sm',\n 'w-md': dialog.size === 'md',\n 'w-lg': dialog.size === 'lg',\n });\n\n const containerClassName = cn(\n 'bg-white p-6 rounded relative z-[999]',\n 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\n\n const handleEscapeKeyDown = event => {\n if (!dialog.closeOnEscape) {\n event.preventDefault();\n } else if (dialog.onClose) {\n dialog.onClose();\n }\n };\n\n // the chosen behaviour in taco is that outside clicks do not close the dialog\n const handleInteractOutside = event => event.preventDefault();\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <DialogPrimitive.Close asChild>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </DialogPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay asChild>\n <Backdrop>\n <DialogPrimitive.Content\n {...props}\n className={className}\n onEscapeKeyDown={handleEscapeKeyDown}\n onInteractOutside={handleInteractOutside}\n onCloseAutoFocus={handleCloseAutoFocus}\n ref={ref}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}\n >\n <div className={containerClassName} data-taco=\"dialog\">\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n aria-label={texts.dialog.drag}\n className=\"yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center\"\n />\n )}\n {dialog.showCloseButton ? (\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.dialog.close}\n className=\"absolute top-0 right-0 mt-2 mr-2\"\n icon=\"close\"\n />\n </DialogPrimitive.Close>\n ) : null}\n </div>\n {dialog.elements.drawer}\n {dialog.elements.extra}\n </DialogPrimitive.Content>\n </Backdrop>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","DialogTitle","props","ref","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useProxiedRef","useDraggable","position","dragHandleProps","handleProps","useLocalization","texts","menu","useCurrentMenu","handleCloseAutoFocus","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus","style","left","draggable","x","undefined","top","y","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;;IAsBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;AAClC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAD,EAAgBH,KAAK,CAACE,SAAtB,CAApB;AACA,SAAOJ,aAAA,CAACM,OAAD,oBAA2BJ;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA7D,CAAP;AACH,CAHoB;IAMRI,MAAM,gBAAGP,UAAA,CAAiB,SAASQ,YAAT,CAAsBN,KAAtB,EAAgDC,GAAhD;AACnC,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAD,EAA0BH,KAAK,CAACE,SAAhC,CAApB;AACA,SACIJ,aAAA,MAAA,oBAASE;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA3C,EACKD,KAAK,CAACO,QADX,CADJ;AAKH,CAPqB;IAWTC,KAAK,gBAAGV,UAAA,CAAiB,SAASW,WAAT,CAAqBT,KAArB,EAA8CC,GAA9C;AAClC,MAAMS,MAAM,GAAGC,gBAAgB,EAA/B;AAEA,SAAOb,aAAA,CAACM,OAAD;AAAuBQ,IAAAA,OAAO,EAAEF,MAAM,CAACG;KAAab;AAAOC,IAAAA,GAAG,EAAEA;AAAKa,IAAAA,OAAO;IAA5E,CAAP;AACH,CAJoB;AAMrB,IAAMC,iBAAiB,gBAAGjB,UAAA,CAAiB,gBAA0CG,GAA1C;MAAGM,gBAAAA;MAAUK,eAAAA;MAASI,mBAAAA;;AAC7D,MAAMC,KAAK,GAAG,SAARA,KAAQ;AACVL,IAAAA,OAAO,CAAC,IAAIM,WAAJ,CAAgB,OAAhB,CAAD,CAAP;AACH,GAFD;;AAIA,SAAOX,QAAQ;AAAGU,IAAAA,KAAK,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EK/B,MAAM,CAACuC,SAAP,IACGnD,aAAA,MAAA,oBACQ2B;kBACQG,KAAK,CAAClB,MAAN,CAAa4C;AACzBpD,IAAAA,SAAS,EAAC;IAHd,CAHR,EASKQ,MAAM,CAAC6C,eAAP,GACGzD,aAAA,CAACM,OAAD;AAAuBQ,IAAAA,OAAO,EAAEF,MAAM,CAACG;AAASC,IAAAA,OAAO;GAAvD,EACIhB,aAAA,CAAC0D,UAAD;AACIC,IAAAA,UAAU,EAAC;kBACC7B,KAAK,CAAClB,MAAN,CAAaO;AACzBf,IAAAA,SAAS,EAAC;AACVwD,IAAAA,IAAI,EAAC;GAJT,CADJ,CADH,GASG,IAlBR,CAbJ,EAiCKhD,MAAM,CAACwB,QAAP,CAAgBQ,MAjCrB,EAkCKhC,MAAM,CAACwB,QAAP,CAAgBC,KAlCrB,CADJ,CADJ,CADJ,CADJ;AA4CH,CAnGsB;;;;"}
1
+ {"version":3,"file":"Content.js","sources":["../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\r\nimport { useCurrentMenu } from '../../Menu/Context';\r\nimport { useCurrentDialog } from '../Context';\r\nimport { useLocalization } from '../../Provider/Provider';\r\nimport { IconButton } from '../../IconButton/IconButton';\r\nimport { Backdrop } from '../../Backdrop/Backdrop';\r\n\r\nexport type DialogContentDrawerRenderProps = {\r\n open: boolean;\r\n toggle: () => void;\r\n};\r\n\r\nexport type DialogContentRenderProps = {\r\n close: () => void;\r\n drawer?: DialogContentDrawerRenderProps;\r\n};\r\n\r\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\r\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\r\n const className = cn('text-center', props.className);\r\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\r\n});\r\n\r\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\r\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn('mt-8 flex justify-end', props.className);\r\n return (\r\n <div {...props} className={className} ref={ref}>\r\n {props.children}\r\n </div>\r\n );\r\n});\r\n\r\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\r\n\r\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\r\n const dialog = useCurrentDialog();\r\n\r\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\r\n});\r\n\r\nconst RenderPropWrapper = React.forwardRef(({ children, onClick, renderProps }: any, ref) => {\r\n const close = () => {\r\n onClick(new CustomEvent('close'));\r\n };\r\n\r\n return children({ close, ref, ...renderProps });\r\n});\r\n\r\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\r\n /** An accessible label to be announced when the dialog is opened */\r\n 'aria-label': string;\r\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\r\n};\r\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\r\n const dialog = useCurrentDialog();\r\n const internalRef = useProxiedRef<HTMLDivElement>(ref);\r\n const { position, handleProps: dragHandleProps } = useDraggable(internalRef);\r\n const { texts } = useLocalization();\r\n\r\n // if the dialog was opened by a menu, we need to close the menu when the dialog closes\r\n // the menu is still open (and mounted) because it is the trigger for the dialog\r\n const menu = useCurrentMenu();\r\n let handleCloseAutoFocus;\r\n\r\n if (menu) {\r\n handleCloseAutoFocus = () => menu.close();\r\n }\r\n\r\n const className = cn('bg-white rounded relative mt-16 mx-auto', {\r\n 'w-128 text-center justify-center': dialog.size === 'dialog',\r\n 'w-xs': dialog.size === 'xs',\r\n 'w-sm': dialog.size === 'sm',\r\n 'w-md': dialog.size === 'md',\r\n 'w-lg': dialog.size === 'lg',\r\n });\r\n\r\n const containerClassName = cn(\r\n 'bg-white p-6 rounded relative z-[999]',\r\n 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]',\r\n {\r\n 'rounded-b-none': !!dialog.elements.extra,\r\n },\r\n props.className\r\n );\r\n\r\n const handleEscapeKeyDown = event => {\r\n if (!dialog.closeOnEscape) {\r\n event.preventDefault();\r\n } else if (dialog.onClose) {\r\n dialog.onClose();\r\n }\r\n };\r\n\r\n // the chosen behaviour in taco is that outside clicks do not close the dialog\r\n const handleInteractOutside = event => event.preventDefault();\r\n\r\n let output;\r\n\r\n if (typeof props.children === 'function') {\r\n output = (\r\n <DialogPrimitive.Close asChild>\r\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\r\n </DialogPrimitive.Close>\r\n );\r\n } else {\r\n output = props.children;\r\n }\r\n\r\n return (\r\n <DialogPrimitive.Portal>\r\n <DialogPrimitive.Overlay asChild>\r\n <Backdrop>\r\n <DialogPrimitive.Content\r\n {...props}\r\n className={className}\r\n onEscapeKeyDown={handleEscapeKeyDown}\r\n onInteractOutside={handleInteractOutside}\r\n onCloseAutoFocus={handleCloseAutoFocus}\r\n ref={ref}\r\n style={{\r\n ...props.style,\r\n left: dialog.draggable ? `${position.x}px` : undefined,\r\n top: dialog.draggable ? `${position.y}px` : undefined,\r\n }}\r\n >\r\n <div className={containerClassName} data-taco=\"dialog\">\r\n {output}\r\n {dialog.draggable && (\r\n <div\r\n {...dragHandleProps}\r\n aria-label={texts.dialog.drag}\r\n className=\"yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center\"\r\n />\r\n )}\r\n {dialog.showCloseButton ? (\r\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\r\n <IconButton\r\n appearance=\"discrete\"\r\n aria-label={texts.dialog.close}\r\n className=\"absolute top-0 right-0 mt-2 mr-2\"\r\n icon=\"close\"\r\n />\r\n </DialogPrimitive.Close>\r\n ) : null}\r\n </div>\r\n {dialog.elements.drawer}\r\n {dialog.elements.extra}\r\n </DialogPrimitive.Content>\r\n </Backdrop>\r\n </DialogPrimitive.Overlay>\r\n </DialogPrimitive.Portal>\r\n );\r\n});\r\n"],"names":["Title","React","DialogTitle","props","ref","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useProxiedRef","position","handleProps","dragHandleProps","useDraggable","texts","useLocalization","menu","useCurrentMenu","handleCloseAutoFocus","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","onCloseAutoFocus","style","left","draggable","x","undefined","top","y","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;MAsBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;AAClC,QAAMC,SAAS,GAAGC,EAAE,CAAC,aAAD,EAAgBH,KAAK,CAACE,SAAtB,CAApB;AACA,SAAOJ,aAAA,CAACM,OAAD,oBAA2BJ;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA7D,CAAP;AACH,CAHoB;MAMRI,MAAM,gBAAGP,UAAA,CAAiB,SAASQ,YAAT,CAAsBN,KAAtB,EAAgDC,GAAhD;AACnC,QAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAD,EAA0BH,KAAK,CAACE,SAAhC,CAApB;AACA,SACIJ,aAAA,MAAA,oBAASE;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA3C,EACKD,KAAK,CAACO,QADX,CADJ;AAKH,CAPqB;MAWTC,KAAK,gBAAGV,UAA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jBS,IAAAA,iBAAiB,EAAEL;AACnBM,IAAAA,gBAAgB,EAAEf;AAClB9B,IAAAA,GAAG,EAAEA;AACL8C,IAAAA,KAAK,EAAE,EACH,GAAG/C,KAAK,CAAC+C,KADN;AAEHC,MAAAA,IAAI,EAAEtC,MAAM,CAACuC,SAAP,MAAsB1B,QAAQ,CAAC2B,KAA/B,GAAuCC,SAF1C;AAGHC,MAAAA,GAAG,EAAE1C,MAAM,CAACuC,SAAP,MAAsB1B,QAAQ,CAAC8B,KAA/B,GAAuCF;AAHzC;IAPX,EAaIrD,aAAA,MAAA;AAAKI,IAAAA,SAAS,EAAE+B;iBAA8B;GAA9C,EACKQ,MADL,EAEK/B,MAAM,CAACuC,SAAP,IACGnD,aAAA,MAAA,oBACQ2B;kBACQE,KAAK,CAACjB,MAAN,CAAa4C;AACzBpD,IAAAA,SAAS,EAAC;IAHd,CAHR,EASKQ,MAAM,CAAC6C,eAAP,GACGzD,aAAA,CAACM,OAAD;AAAuBQ,IAAAA,OAAO,EAAEF,MAAM,CAACG;AAASC,IAAAA,OAAO;GAAvD,EACIhB,aAAA,CAAC0D,UAAD;AACIC,IAAAA,UAAU,EAAC;kBACC9B,KAAK,CAACjB,MAAN,CAAaO;AACzBf,IAAAA,SAAS,EAAC;AACVwD,IAAAA,IAAI,EAAC;GAJT,CADJ,CADH,GASG,IAlBR,CAbJ,EAiCKhD,MAAM,CAACwB,QAAP,CAAgBQ,MAjCrB,EAkCKhC,MAAM,CAACwB,QAAP,CAAgBC,KAlCrB,CADJ,CADJ,CADJ,CADJ;AA4CH,CAnGsB;;;;"}
@@ -3,11 +3,11 @@ import cn from 'classnames';
3
3
  import { motion } from 'framer-motion';
4
4
  import { useCurrentDialog } from '../Context.js';
5
5
 
6
- var Drawer = /*#__PURE__*/forwardRef(function DialogDrawer(props, ref) {
6
+ const Drawer = /*#__PURE__*/forwardRef(function DialogDrawer(props, ref) {
7
7
  var _dialog$drawer, _dialog$drawer2;
8
8
 
9
- var dialog = useCurrentDialog();
10
- var className = cn('absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left', props.className);
9
+ const dialog = useCurrentDialog();
10
+ const className = cn('absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left', props.className);
11
11
  return createElement(motion.div, Object.assign({}, props, {
12
12
  className: className,
13
13
  "data-taco": "dialog-drawer",
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sources":["../../../../../src/components/Dialog/components/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { motion } from 'framer-motion';\nimport cn from 'classnames';\nimport { useCurrentDialog } from '../Context';\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n>;\n\nexport const Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const className = cn(\n 'absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\n props.className\n );\n\n return (\n <motion.div\n {...props}\n className={className}\n data-taco=\"dialog-drawer\"\n aria-hidden={!dialog.drawer?.open}\n variants={{\n visible: {\n left: '100%',\n display: 'block',\n transition: { ease: 'easeOut', duration: 0.2 },\n },\n hidden: {\n left: '0%',\n transition: { ease: 'easeOut', duration: 0.2 },\n transitionEnd: {\n display: 'none',\n },\n },\n }}\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\n ref={ref}\n />\n );\n});\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","className","cn","motion","div","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate"],"mappings":";;;;;IAUaA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAAsBC,KAAtB,EAAgDC,GAAhD;;;AACnC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;AACA,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBL,KAAK,CAACI,SAFU,CAApB;AAKA,SACIN,aAAA,CAACQ,MAAM,CAACC,GAAR,oBACQP;AACJI,IAAAA,SAAS,EAAEA;iBACD;mBACG,oBAACF,MAAM,CAACM,MAAR,2CAAC,eAAeC,IAAhB;AACbC,IAAAA,QAAQ,EAAE;AACNC,MAAAA,OAAO,EAAE;AACLC,QAAAA,IAAI,EAAE,MADD;AAELC,QAAAA,OAAO,EAAE,OAFJ;AAGLC,QAAAA,UAAU,EAAE;AAAEC,UAAAA,IAAI,EAAE,SAAR;AAAmBC,UAAAA,QAAQ,EAAE;AAA7B;AAHP,OADH;AAMNC,MAAAA,MAAM,EAAE;AACJL,QAAAA,IAAI,EAAE,IADF;AAEJE,QAAAA,UAAU,EAAE;AAAEC,UAAAA,IAAI,EAAE,SAAR;AAAmBC,UAAAA,QAAQ,EAAE;AAA7B,SAFR;AAGJE,QAAAA,aAAa,EAAE;AACXL,UAAAA,OAAO,EAAE;AADE;AAHX;AANF;AAcVM,IAAAA,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAP,4DAAeC,IAAf,GAAsB,SAAtB,GAAkC;AAC3CR,IAAAA,GAAG,EAAEA;IApBT,CADJ;AAwBH,CA/BqB;;;;"}
1
+ {"version":3,"file":"Drawer.js","sources":["../../../../../src/components/Dialog/components/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { motion } from 'framer-motion';\r\nimport cn from 'classnames';\r\nimport { useCurrentDialog } from '../Context';\r\n\r\nexport type DialogDrawerProps = Omit<\r\n React.HTMLAttributes<HTMLDivElement>,\r\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\r\n>;\r\n\r\nexport const Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\r\n const dialog = useCurrentDialog();\r\n const className = cn(\r\n 'absolute top-0 z-[998] -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\r\n props.className\r\n );\r\n\r\n return (\r\n <motion.div\r\n {...props}\r\n className={className}\r\n data-taco=\"dialog-drawer\"\r\n aria-hidden={!dialog.drawer?.open}\r\n variants={{\r\n visible: {\r\n left: '100%',\r\n display: 'block',\r\n transition: { ease: 'easeOut', duration: 0.2 },\r\n },\r\n hidden: {\r\n left: '0%',\r\n transition: { ease: 'easeOut', duration: 0.2 },\r\n transitionEnd: {\r\n display: 'none',\r\n },\r\n },\r\n }}\r\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\r\n ref={ref}\r\n />\r\n );\r\n});\r\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","className","cn","motion","div","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate"],"mappings":";;;;;MAUaA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAAsBC,KAAtB,EAAgDC,GAAhD;;;AACnC,QAAMC,MAAM,GAAGC,gBAAgB,EAA/B;AACA,QAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBL,KAAK,CAACI,SAFU,CAApB;AAKA,SACIN,aAAA,CAACQ,MAAM,CAACC,GAAR,oBACQP;AACJI,IAAAA,SAAS,EAAEA;iBACD;mBACG,oBAACF,MAAM,CAACM,MAAR,2CAAC,eAAeC,IAAhB;AACbC,IAAAA,QAAQ,EAAE;AACNC,MAAAA,OAAO,EAAE;AACLC,QAAAA,IAAI,EAAE,MADD;AAELC,QAAAA,OAAO,EAAE,OAFJ;AAGLC,QAAAA,UAAU,EAAE;AAAEC,UAAAA,IAAI,EAAE,SAAR;AAAmBC,UAAAA,QAAQ,EAAE;AAA7B;AAHP,OADH;AAMNC,MAAAA,MAAM,EAAE;AACJL,QAAAA,IAAI,EAAE,IADF;AAEJE,QAAAA,UAAU,EAAE;AAAEC,UAAAA,IAAI,EAAE,SAAR;AAAmBC,UAAAA,QAAQ,EAAE;AAA7B,SAFR;AAGJE,QAAAA,aAAa,EAAE;AACXL,UAAAA,OAAO,EAAE;AADE;AAHX;AANF;AAcVM,IAAAA,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAP,4DAAeC,IAAf,GAAsB,SAAtB,GAAkC;AAC3CR,IAAAA,GAAG,EAAEA;IApBT,CADJ;AAwBH,CA/BqB;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { forwardRef, createElement } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- var Extra = /*#__PURE__*/forwardRef(function (props, ref) {
5
- var className = cn('bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left', props.className);
4
+ const Extra = /*#__PURE__*/forwardRef(function (props, ref) {
5
+ const className = cn('bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left', props.className);
6
6
  return createElement("div", Object.assign({}, props, {
7
7
  className: className,
8
8
  "data-taco": "dialog-extra",
@@ -1 +1 @@
1
- {"version":3,"file":"Extra.js","sources":["../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Extra = React.forwardRef(function (props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n 'bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left',\n props.className\n );\n\n return <div {...props} className={className} data-taco=\"dialog-extra\" ref={ref} />;\n});\n"],"names":["Extra","React","props","ref","className","cn"],"mappings":";;;IAKaA,KAAK,gBAAGC,UAAA,CAAiB,UAAUC,KAAV,EAAmCC,GAAnC;AAClC,MAAMC,SAAS,GAAGC,EAAE,CAChB,6GADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;AAKA,SAAOH,aAAA,MAAA,oBAASC;AAAOE,IAAAA,SAAS,EAAEA;iBAAqB;AAAeD,IAAAA,GAAG,EAAEA;IAApE,CAAP;AACH,CAPoB;;;;"}
1
+ {"version":3,"file":"Extra.js","sources":["../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\n\r\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nexport const Extra = React.forwardRef(function (props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn(\r\n 'bg-grey-light yt-shadow-inset absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left',\r\n props.className\r\n );\r\n\r\n return <div {...props} className={className} data-taco=\"dialog-extra\" ref={ref} />;\r\n});\r\n"],"names":["Extra","React","props","ref","className","cn"],"mappings":";;;MAKaA,KAAK,gBAAGC,UAAA,CAAiB,UAAUC,KAAV,EAAmCC,GAAnC;AAClC,QAAMC,SAAS,GAAGC,EAAE,CAChB,6GADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;AAKA,SAAOH,aAAA,MAAA,oBAASC;AAAOE,IAAAA,SAAS,EAAEA;iBAAqB;AAAeD,IAAAA,GAAG,EAAEA;IAApE,CAAP;AACH,CAPoB;;;;"}
@@ -3,8 +3,8 @@ import mergeRefs from '../../../utils/mergeRefs.js';
3
3
  import { Trigger as Trigger$1 } from '@radix-ui/react-dialog';
4
4
  import { useCurrentDialog } from '../Context.js';
5
5
 
6
- var Trigger = /*#__PURE__*/forwardRef(function DialogTrigger(props, ref) {
7
- var dialog = useCurrentDialog();
6
+ const Trigger = /*#__PURE__*/forwardRef(function DialogTrigger(props, ref) {
7
+ const dialog = useCurrentDialog();
8
8
  return createElement(Trigger$1, Object.assign({}, dialog.props, props, {
9
9
  ref: mergeRefs([dialog.ref, ref]),
10
10
  asChild: true
@@ -1 +1 @@
1
- {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useCurrentDialog } from '../Context';\nimport mergeRefs from '../../../utils/mergeRefs';\n\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function DialogTrigger(props: DialogTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n return <DialogPrimitive.Trigger {...dialog.props} {...props} ref={mergeRefs([dialog.ref, ref])} asChild />;\n});\n"],"names":["Trigger","React","DialogTrigger","props","ref","dialog","useCurrentDialog","DialogPrimitive","mergeRefs","asChild"],"mappings":";;;;;IAOaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,aAAT,CAAuBC,KAAvB,EAAkDC,GAAlD;AACpC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;AACA,SAAOL,aAAA,CAACM,SAAD,oBAA6BF,MAAM,CAACF,OAAWA;AAAOC,IAAAA,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;AAAqBK,IAAAA,OAAO;IAAhG,CAAP;AACH,CAHsB;;;;"}
1
+ {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\r\nimport { useCurrentDialog } from '../Context';\r\nimport mergeRefs from '../../../utils/mergeRefs';\r\n\r\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\r\n\r\nexport const Trigger = React.forwardRef(function DialogTrigger(props: DialogTriggerProps, ref: React.Ref<HTMLButtonElement>) {\r\n const dialog = useCurrentDialog();\r\n return <DialogPrimitive.Trigger {...dialog.props} {...props} ref={mergeRefs([dialog.ref, ref])} asChild />;\r\n});\r\n"],"names":["Trigger","React","DialogTrigger","props","ref","dialog","useCurrentDialog","DialogPrimitive","mergeRefs","asChild"],"mappings":";;;;;MAOaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,aAAT,CAAuBC,KAAvB,EAAkDC,GAAlD;AACpC,QAAMC,MAAM,GAAGC,gBAAgB,EAA/B;AACA,SAAOL,aAAA,CAACM,SAAD,oBAA6BF,MAAM,CAACF,OAAWA;AAAOC,IAAAA,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;AAAqBK,IAAAA,OAAO;IAAhG,CAAP;AACH,CAHsB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../src/components/Form/Form.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport './Form.css';\n\nexport type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {\n /** Content should be composed of other Taco form elements */\n children: React.ReactNode;\n /** Display the form fields in a horizontal layout */\n horizontal?: boolean;\n};\n\nexport const Form = React.forwardRef(function Form(props: FormProps, ref: React.Ref<HTMLFormElement>) {\n const { horizontal = false, ...otherProps } = props;\n const className = cn(\n 'yt-form',\n {\n 'yt-form--horizontal flex flex-wrap': horizontal,\n },\n props.className\n );\n\n return <form {...otherProps} className={className} data-taco=\"form\" ref={ref} />;\n});\n"],"names":["Form","React","props","ref","horizontal","otherProps","className","cn"],"mappings":";;;;;IAWaA,IAAI,gBAAGC,UAAA,CAAiB,SAASD,IAAT,CAAcE,KAAd,EAAgCC,GAAhC;AACjC,0BAA8CD,KAA9C,CAAQE,UAAR;AAAA,MAAQA,UAAR,kCAAqB,KAArB;AAAA,MAA+BC,UAA/B,iCAA8CH,KAA9C;;AACA,MAAMI,SAAS,GAAGC,EAAE,CAChB,SADgB,EAEhB;AACI,0CAAsCH;AAD1C,GAFgB,EAKhBF,KAAK,CAACI,SALU,CAApB;AAQA,SAAOL,aAAA,OAAA,oBAAUI;AAAYC,IAAAA,SAAS,EAAEA;iBAAqB;AAAOH,IAAAA,GAAG,EAAEA;IAAlE,CAAP;AACH,CAXmB;;;;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/components/Form/Form.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport './Form.css';\r\n\r\nexport type FormProps = React.FormHTMLAttributes<HTMLFormElement> & {\r\n /** Content should be composed of other Taco form elements */\r\n children: React.ReactNode;\r\n /** Display the form fields in a horizontal layout */\r\n horizontal?: boolean;\r\n};\r\n\r\nexport const Form = React.forwardRef(function Form(props: FormProps, ref: React.Ref<HTMLFormElement>) {\r\n const { horizontal = false, ...otherProps } = props;\r\n const className = cn(\r\n 'yt-form',\r\n {\r\n 'yt-form--horizontal flex flex-wrap': horizontal,\r\n },\r\n props.className\r\n );\r\n\r\n return <form {...otherProps} className={className} data-taco=\"form\" ref={ref} />;\r\n});\r\n"],"names":["Form","React","props","ref","horizontal","otherProps","className","cn"],"mappings":";;;;;IAWaA,IAAI,gBAAGC,UAAA,CAAiB,SAASD,IAAT,CAAcE,KAAd,EAAgCC,GAAhC;AACjC,0BAA8CD,KAA9C,CAAQE,UAAR;AAAA,MAAQA,UAAR,kCAAqB,KAArB;AAAA,MAA+BC,UAA/B,iCAA8CH,KAA9C;;AACA,MAAMI,SAAS,GAAGC,EAAE,CAChB,SADgB,EAEhB;AACI,0CAAsCH;AAD1C,GAFgB,EAKhBF,KAAK,CAACI,SALU,CAApB;AAQA,SAAOL,aAAA,OAAA,oBAAUI;AAAYC,IAAAA,SAAS,EAAEA;iBAAqB;AAAOH,IAAAA,GAAG,EAAEA;IAAlE,CAAP;AACH,CAXmB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Group.js","sources":["../../../../src/components/Group/Group.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport './Group.css';\n\nexport type GroupProps = React.HTMLAttributes<HTMLElement> & {\n /**\n * Change what html tag element will render.\n * Default value is `span`\n */\n as?: 'div' | 'span' | 'nav';\n /** Content should be composed of other Taco elements */\n children: React.ReactNode;\n};\n\nexport const Group = React.forwardRef(function Group(props: GroupProps, ref: React.Ref<HTMLDivElement>) {\n const { as: Tag = 'span', ...otherProps } = props;\n const className = cn('flex ', props.className);\n return <Tag {...otherProps} className={className} data-taco=\"group\" ref={ref} />;\n});\n"],"names":["Group","React","props","ref","as","Tag","otherProps","className","cn"],"mappings":";;;;;IAcaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;AAClC,kBAA4CD,KAA5C,CAAQE,EAAR;AAAA,MAAYC,GAAZ,0BAAkB,MAAlB;AAAA,MAA6BC,UAA7B,iCAA4CJ,KAA5C;;AACA,MAAMK,SAAS,GAAGC,EAAE,CAAC,OAAD,EAAUN,KAAK,CAACK,SAAhB,CAApB;AACA,SAAON,aAAA,CAACI,GAAD,oBAASC;AAAYC,IAAAA,SAAS,EAAEA;iBAAqB;AAAQJ,IAAAA,GAAG,EAAEA;IAAlE,CAAP;AACH,CAJoB;;;;"}
1
+ {"version":3,"file":"Group.js","sources":["../../../../src/components/Group/Group.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport './Group.css';\r\n\r\nexport type GroupProps = React.HTMLAttributes<HTMLElement> & {\r\n /**\r\n * Change what html tag element will render.\r\n * Default value is `span`\r\n */\r\n as?: 'div' | 'span' | 'nav';\r\n /** Content should be composed of other Taco elements */\r\n children: React.ReactNode;\r\n};\r\n\r\nexport const Group = React.forwardRef(function Group(props: GroupProps, ref: React.Ref<HTMLDivElement>) {\r\n const { as: Tag = 'span', ...otherProps } = props;\r\n const className = cn('flex ', props.className);\r\n return <Tag {...otherProps} className={className} data-taco=\"group\" ref={ref} />;\r\n});\r\n"],"names":["Group","React","props","ref","as","Tag","otherProps","className","cn"],"mappings":";;;;;IAcaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;AAClC,kBAA4CD,KAA5C,CAAQE,EAAR;AAAA,MAAYC,GAAZ,0BAAkB,MAAlB;AAAA,MAA6BC,UAA7B,iCAA4CJ,KAA5C;;AACA,MAAMK,SAAS,GAAGC,EAAE,CAAC,OAAD,EAAUN,KAAK,CAACK,SAAhB,CAApB;AACA,SAAON,aAAA,CAACI,GAAD,oBAASC;AAAYC,IAAAA,SAAS,EAAEA;iBAAqB;AAAQJ,IAAAA,GAAG,EAAEA;IAAlE,CAAP;AACH,CAJoB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Hanger.js","sources":["../../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Placement } from '../..';\nimport { UnstyledArrow, UnstyledContent } from '../Popover/Primitives';\nimport { useLocalization } from '../Provider/Provider';\nimport './Hanger.css';\nimport mergeRefs from '../../utils/mergeRefs';\n\ntype HangerContextValue = {\n props: any;\n ref: React.Ref<HTMLElement>;\n};\nconst HangerContext = React.createContext<HangerContextValue>({\n props: {},\n ref: null,\n});\n\nexport type HangerTexts = {\n /** Aria-label for the close icon button of hanger */\n close: string;\n};\n\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;\nconst Anchor = React.forwardRef((props: HangerAnchorProps, ref: React.Ref<HTMLDivElement>) => {\n const context = React.useContext(HangerContext);\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Anchor {...context.props} {...props} children={children} ref={mergeRefs([context.ref, ref])} asChild />\n );\n});\n\nexport type CloseHandler = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | undefined;\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Handler called when user closes the hanger */\n onClose?: CloseHandler;\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\n placement?: Placement;\n};\n\nconst Content = React.forwardRef((props: HangerContentProps, ref: React.Ref<HTMLDivElement>) => {\n const { texts } = useLocalization();\n const className = cn(\n 'wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent',\n props.className\n );\n const handleInteractOutside = (event: CustomEvent): void => {\n event.preventDefault();\n };\n\n return (\n <UnstyledContent\n className={className}\n data-taco=\"hanger\"\n onInteractOutside={handleInteractOutside}\n placement={props.placement}\n ref={ref}\n >\n {props.children}\n <UnstyledArrow className=\"text-blue\" />\n <PopoverPrimitive.Close asChild>\n <IconButton\n appearance=\"primary\"\n aria-label={texts.hanger.close}\n className=\"absolute top-0 right-0 ml-2 mr-2 mt-2 text-white\"\n icon=\"close\"\n onClick={props.onClose}\n />\n </PopoverPrimitive.Close>\n </UnstyledContent>\n );\n});\n\nexport type HangerProps = React.PropsWithChildren<{\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\n anchor?: JSX.Element;\n}>;\n\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\n};\n\nexport const Hanger = React.forwardRef((props: HangerProps, ref: React.Ref<HTMLElement>): JSX.Element => {\n const { anchor, children, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <HangerContext.Provider value={context}>\n <PopoverPrimitive.Root defaultOpen>\n {anchor && <Anchor>{anchor}</Anchor>}\n {children}\n </PopoverPrimitive.Root>\n </HangerContext.Provider>\n );\n}) as ForwardedHangerWithStatics;\nHanger.Anchor = Anchor;\nHanger.Content = Content;\n"],"names":["HangerContext","React","props","ref","Anchor","context","children","type","console","warn","name","PopoverPrimitive","mergeRefs","asChild","Content","useLocalization","texts","className","cn","handleInteractOutside","event","preventDefault","UnstyledContent","onInteractOutside","placement","UnstyledArrow","IconButton","appearance","hanger","close","icon","onCl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B;AACA6B,MAAM,CAACnB,OAAP,GAAiBA,OAAjB;;;;"}
1
+ {"version":3,"file":"Hanger.js","sources":["../../../../src/components/Hanger/Hanger.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport { Placement } from '../..';\r\nimport { UnstyledArrow, UnstyledContent } from '../Popover/Primitives';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport './Hanger.css';\r\nimport mergeRefs from '../../utils/mergeRefs';\r\n\r\ntype HangerContextValue = {\r\n props: any;\r\n ref: React.Ref<HTMLElement>;\r\n};\r\nconst HangerContext = React.createContext<HangerContextValue>({\r\n props: {},\r\n ref: null,\r\n});\r\n\r\nexport type HangerTexts = {\r\n /** Aria-label for the close icon button of hanger */\r\n close: string;\r\n};\r\n\r\nexport type HangerAnchorProps = React.HTMLAttributes<HTMLDivElement>;\r\nconst Anchor = React.forwardRef((props: HangerAnchorProps, ref: React.Ref<HTMLDivElement>) => {\r\n const context = React.useContext(HangerContext);\r\n let children = props.children;\r\n\r\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\r\n console.warn(\r\n `Hanger.Anchor requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\r\n );\r\n children = <span>{props.children}</span>;\r\n }\r\n\r\n return (\r\n <PopoverPrimitive.Anchor {...context.props} {...props} children={children} ref={mergeRefs([context.ref, ref])} asChild />\r\n );\r\n});\r\n\r\nexport type CloseHandler = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | undefined;\r\nexport type HangerContentProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /** Handler called when user closes the hanger */\r\n onClose?: CloseHandler;\r\n /** Set the position of the Hanger relative to its achor. Default value is `bottom` */\r\n placement?: Placement;\r\n};\r\n\r\nconst Content = React.forwardRef((props: HangerContentProps, ref: React.Ref<HTMLDivElement>) => {\r\n const { texts } = useLocalization();\r\n const className = cn(\r\n 'wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent',\r\n props.className\r\n );\r\n const handleInteractOutside = (event: CustomEvent): void => {\r\n event.preventDefault();\r\n };\r\n\r\n return (\r\n <UnstyledContent\r\n className={className}\r\n data-taco=\"hanger\"\r\n onInteractOutside={handleInteractOutside}\r\n placement={props.placement}\r\n ref={ref}\r\n >\r\n {props.children}\r\n <UnstyledArrow className=\"text-blue\" />\r\n <PopoverPrimitive.Close asChild>\r\n <IconButton\r\n appearance=\"primary\"\r\n aria-label={texts.hanger.close}\r\n className=\"absolute top-0 right-0 ml-2 mr-2 mt-2 text-white\"\r\n icon=\"close\"\r\n onClick={props.onClose}\r\n />\r\n </PopoverPrimitive.Close>\r\n </UnstyledContent>\r\n );\r\n});\r\n\r\nexport type HangerProps = React.PropsWithChildren<{\r\n /** An anchor to be used for the hanger, should not be set if `children` already contains an anchor */\r\n anchor?: JSX.Element;\r\n}>;\r\n\r\nexport type ForwardedHangerWithStatics = React.ForwardRefExoticComponent<HangerProps & React.RefAttributes<HTMLElement>> & {\r\n Anchor: React.ForwardRefExoticComponent<HangerAnchorProps>;\r\n Content: React.ForwardRefExoticComponent<HangerContentProps>;\r\n};\r\n\r\nexport const Hanger = React.forwardRef((props: HangerProps, ref: React.Ref<HTMLElement>): JSX.Element => {\r\n const { anchor, children, ...otherProps } = props;\r\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\r\n\r\n return (\r\n <HangerContext.Provider value={context}>\r\n <PopoverPrimitive.Root defaultOpen>\r\n {anchor && <Anchor>{anchor}</Anchor>}\r\n {children}\r\n </PopoverPrimitive.Root>\r\n </HangerContext.Provider>\r\n );\r\n}) as ForwardedHangerWithStatics;\r\nHanger.Anchor = Anchor;\r\nHanger.Content = Content;\r\n"],"names":["HangerContext","React","props","ref","Anchor","context","children","type","console","warn","name","PopoverPrimitive","mergeRefs","asChild","Content","useLocalization","texts","className","cn","handleInteractOutside","event","preventDefault","UnstyledContent","onInteractOutside","placement","UnstyledArrow","IconButton","appearance","hanger","close","icon","onClick","onClose","Hanger","anchor","otherProps","Provider","value","defaultOpen"],"mappings":";;;;;;;;;;AAcA,IAAMA,aAAa,gBAAGC,aAAA,CAAwC;AAC1DC,EAAAA,KAAK,EAAE,EADmD;AAE1DC,EAAAA,GAAG,EAAE;AAFqD,CAAxC,CAAtB;AAWA,IAAMC,MAAM,gBAAGH,UAAA,CAAiB,UAACC,KAAD,EAA2BC,GAA3B;;;AAC5B,MAAME,OAAO,GAAGJ,UAAA,CAAiBD,aAAjB,CAAhB;AACA,MAAIM,QAAQ,GAAGJ,KAAK,CAACI,QAArB;;AAEA,MAAIL,cAAA,CAAqBC,KAAK,CAACI,QAA3B,KAAwC,2BAAOJ,KAAK,CAACI,QAAb,oDAAO,gBAAgBC,IAAvB,MAAgC,UAA5E,EAAwF;AACpFC,IAAAA,OAAO,CAACC,IAAR,qHACsHP,KAAK,CAACI,QAAN,CAAeC,IAAf,CAAoBG,IAD1I,mDAC4LR,KAAK,CAACI,QAAN,CAAeC,IAAf,CAAoBG,IADhN;AAGAJ,IAAAA,QAAQ,GAAGL,aAAA,OAAA,MAAA,EAAOC,KAAK,CAACI,QAAb,CAAX;AACH;;AAED,SACIL,aAAA,CAACU,QAAD,oBAA6BN,OAAO,CAACH,OAAWA;AAAOI,IAAAA,QAAQ,EAAEA;AAAUH,IAAAA,GAAG,EAAES,SAAS,CAAC,CAACP,OAAO,CAACF,GAAT,EAAcA,GAAd,CAAD;AAAsBU,IAAAA,OAAO;IAAtH,CADJ;AAGH,CAdc,CAAf;AAwBA,IAAMC,OAAO,gBAAGb,UAAA,CAAiB,UAACC,KAAD,EAA4BC,GAA5B;AAC7B,yBAAkBY,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AACA,MAAMC,SAAS,GAAGC,E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M,IAAIjC,aAAA,CAACG,MAAD,MAAA,EAAS8B,MAAT,CADf,EAEK5B,QAFL,CADJ,CADJ;AAQH,CAZqB;AAatB2B,MAAM,CAAC7B,MAAP,GAAgBA,MAAhB;AACA6B,MAAM,CAACnB,OAAP,GAAiBA,OAAjB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { IconName, icons } from './components/index';\n\nexport { icons } from './components/index';\nexport type { IconName } from './components/index';\n\nexport type IconProps = React.SVGAttributes<SVGSVGElement> & {\n /** Set what svg icon should be rendered */\n name: IconName; // this dynamic type causes the type extraction for props to fail\n};\n\nexport const Icon = React.forwardRef(function Icon(props: IconProps, ref: React.Ref<SVGSVGElement>) {\n const { name, ...otherProps } = props;\n const Component = icons[name];\n /* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */\n const className = cn('inline-flex h-[1.715em] w-[1.715em]', props.className, {\n 'p-[3px]': props.className?.includes('rounded-full'),\n });\n\n return Component ? (\n <Component {...otherProps} className={className} data-taco=\"icon\" focusable=\"false\" ref={ref} role=\"img\" />\n ) : null;\n});\n"],"names":["Icon","React","forwardRef","props","ref","name","otherProps","Component","icons","className","cn","includes","focusable","role"],"mappings":";;;;;;;IAYaA,IAAI,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,IAAT,CAAcG,KAAd,EAAgCC,GAAhC;;;AACjC,MAAQC,IAAR,GAAgCF,KAAhC,CAAQE,IAAR;AAAA,MAAiBC,UAAjB,iCAAgCH,KAAhC;;AACA,MAAMI,SAAS,GAAGC,KAAK,CAACH,IAAD,CAAvB;AACA;;AACA,MAAMI,SAAS,GAAGC,EAAE,CAAC,qCAAD,EAAwCP,KAAK,CAACM,SAA9C,EAAyD;AACzE,mCAAWN,KAAK,CAACM,SAAjB,qDAAW,iBAAiBE,QAAjB,CAA0B,cAA1B;AAD8D,GAAzD,CAApB;AAIA,SAAOJ,SAAS,GACZN,4BAAA,CAACM,SAAD,oBAAeD;AAAYG,IAAAA,SAAS,EAAEA;iBAAqB;AAAOG,IAAAA,SAAS,EAAC;AAAQR,IAAAA,GAAG,EAAEA;AAAKS,IAAAA,IAAI,EAAC;IAAnG,CADY,GAEZ,IAFJ;AAGH,CAXmB;;;;"}
1
+ {"version":3,"file":"Icon.js","sources":["../../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { IconName, icons } from './components/index';\r\n\r\nexport { icons } from './components/index';\r\nexport type { IconName } from './components/index';\r\n\r\nexport type IconProps = React.SVGAttributes<SVGSVGElement> & {\r\n /** Set what svg icon should be rendered */\r\n name: IconName; // this dynamic type causes the type extraction for props to fail\r\n};\r\n\r\nexport const Icon = React.forwardRef(function Icon(props: IconProps, ref: React.Ref<SVGSVGElement>) {\r\n const { name, ...otherProps } = props;\r\n const Component = icons[name];\r\n /* 24x24 _at the base body font_ - must be em so that they scale with font size - tailwind spacing uses rem */\r\n const className = cn('inline-flex h-[1.715em] w-[1.715em]', props.className, {\r\n 'p-[3px]': props.className?.includes('rounded-full'),\r\n });\r\n\r\n return Component ? (\r\n <Component {...otherProps} className={className} data-taco=\"icon\" focusable=\"false\" ref={ref} role=\"img\" />\r\n ) : null;\r\n});\r\n"],"names":["Icon","React","forwardRef","props","ref","name","otherProps","Component","icons","className","cn","includes","focusable","role"],"mappings":";;;;;;;IAYaA,IAAI,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,IAAT,CAAcG,KAAd,EAAgCC,GAAhC;;;AACjC,MAAQC,IAAR,GAAgCF,KAAhC,CAAQE,IAAR;AAAA,MAAiBC,UAAjB,iCAAgCH,KAAhC;;AACA,MAAMI,SAAS,GAAGC,KAAK,CAACH,IAAD,CAAvB;AACA;;AACA,MAAMI,SAAS,GAAGC,EAAE,CAAC,qCAAD,EAAwCP,KAAK,CAACM,SAA9C,EAAyD;AACzE,mCAAWN,KAAK,CAACM,SAAjB,qDAAW,iBAAiBE,QAAjB,CAA0B,cAA1B;AAD8D,GAAzD,CAApB;AAIA,SAAOJ,SAAS,GACZN,4BAAA,CAACM,SAAD,oBAAeD;AAAYG,IAAAA,SAAS,EAAEA;iBAAqB;AAAOG,IAAAA,SAAS,EAAC;AAAQR,IAAAA,GAAG,EAAEA;AAAKS,IAAAA,IAAI,EAAC;IAAnG,CADY,GAEZ,IAFJ;AAGH,CAXmB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccountPreview.js","sources":["../../../../../src/components/Icon/components/AccountPreview.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction IconAccountPreview(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\n <path\n d=\"M19.25 3c.966 0 1.75.784 1.75 1.75V11h-1.5V4.75a.25.25 0 00-.193-.243L19.25 4.5H4.75a.25.25 0 00-.243.193L4.5 4.75v14.5a.25.25 0 00.193.243l.057.007H11V21H4.75A1.75 1.75 0 013 19.25V4.75C3 3.784 3.784 3 4.75 3h14.5zm-4.5 7.25a4.5 4.5 0 013.632 7.158l.036-.05 2.362 2.362a.75.75 0 01-.976 1.133l-.084-.073-2.363-2.362-.112.077a4.5 4.5 0 11-2.495-8.245zm0 1.5a3 3 0 100 6 3 3 0 000-6zm-7 3.25a.75.75 0 110 1.5h-.5a.75.75 0 110-1.5h.5zm0-4a.75.75 0 110 1.5h-.5a.75.75 0 110-1.5h.5zm9-4a.75.75 0 110 1.5h-6.5a.75.75 0 010-1.5h6.5zm-9 0a.75.75 0 010 1.5h-.5a.75.75 0 010-1.5h.5z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport default React.forwardRef(IconAccountPreview);\n"],"names":["IconAccountPreview","props","svgRef","React","xmlns","viewBox","ref","d","fill","fillRule"],"mappings":";;AAEA,SAASA,kBAAT,CAA4BC,KAA5B,EAAkEC,MAAlE;AACI,SACIC,aAAA,MAAA;AAAKC,IAAAA,KAAK,EAAC;AAA6BC,IAAAA,OAAO,EAAC;AAAYC,IAAAA,GAAG,EAAEJ;KAAYD,MAA7E,EACIE,aAAA,OAAA;AACII,IAAAA,CAAC,EAAC;AACFC,IAAAA,IAAI,EAAC;AACLC,IAAAA,QAAQ,EAAC;GAHb,CADJ,CADJ;AASH;;AAED,kCAAeN,UAAA,CAAiBH,kBAAjB,CAAf;;;;"}
1
+ {"version":3,"file":"AccountPreview.js","sources":["../../../../../src/components/Icon/components/AccountPreview.tsx"],"sourcesContent":["import * as React from 'react';\r\n\r\nfunction IconAccountPreview(props: React.SVGProps<SVGSVGElement>, svgRef?: React.Ref<SVGSVGElement>): JSX.Element {\r\n return (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" ref={svgRef} {...props}>\r\n <path\r\n d=\"M19.25 3c.966 0 1.75.784 1.75 1.75V11h-1.5V4.75a.25.25 0 00-.193-.243L19.25 4.5H4.75a.25.25 0 00-.243.193L4.5 4.75v14.5a.25.25 0 00.193.243l.057.007H11V21H4.75A1.75 1.75 0 013 19.25V4.75C3 3.784 3.784 3 4.75 3h14.5zm-4.5 7.25a4.5 4.5 0 013.632 7.158l.036-.05 2.362 2.362a.75.75 0 01-.976 1.133l-.084-.073-2.363-2.362-.112.077a4.5 4.5 0 11-2.495-8.245zm0 1.5a3 3 0 100 6 3 3 0 000-6zm-7 3.25a.75.75 0 110 1.5h-.5a.75.75 0 110-1.5h.5zm0-4a.75.75 0 110 1.5h-.5a.75.75 0 110-1.5h.5zm9-4a.75.75 0 110 1.5h-6.5a.75.75 0 010-1.5h6.5zm-9 0a.75.75 0 010 1.5h-.5a.75.75 0 010-1.5h.5z\"\r\n fill=\"currentColor\"\r\n fillRule=\"evenodd\"\r\n />\r\n </svg>\r\n );\r\n}\r\n\r\nexport default React.forwardRef(IconAccountPreview);\r\n"],"names":["IconAccountPreview","props","svgRef","React","xmlns","viewBox","ref","d","fill","fillRule"],"mappings":";;AAEA,SAASA,kBAAT,CAA4BC,KAA5B,EAAkEC,MAAlE;AACI,SACIC,aAAA,MAAA;AAAKC,IAAAA,KAAK,EAAC;AAA6BC,IAAAA,OAAO,EAAC;AAAYC,IAAAA,GAAG,EAAEJ;KAAYD,MAA7E,EACIE,aAAA,OAAA;AACII,IAAAA,CAAC,EAAC;AACFC,IAAAA,IAAI,EAAC;AACLC,IAAAA,QAAQ,EAAC;GAHb,CADJ,CADJ;AASH;;AAED,kCAAeN,UAAA,CAAiBH,kBAAjB,CAAf;;;;"}