@economic/taco 1.1.5-alpha.1 → 1.1.5-alpha.102

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 (357) hide show
  1. package/dist/components/Icon/components/LogOut.d.ts +3 -0
  2. package/dist/components/Icon/components/Menu.d.ts +3 -0
  3. package/dist/components/Icon/components/Numbers.d.ts +3 -0
  4. package/dist/components/Icon/components/Profile.d.ts +3 -0
  5. package/dist/components/Icon/components/index.d.ts +1 -1
  6. package/dist/components/Input/Input.d.ts +1 -1
  7. package/dist/components/Menu/Menu.d.ts +2 -2
  8. package/dist/components/Menu/components/Item.d.ts +1 -1
  9. package/dist/components/Menu/components/Link.d.ts +1 -1
  10. package/dist/components/Tour/Tour.d.ts +2 -0
  11. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  12. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  13. package/dist/esm/components/Badge/Badge.js.map +1 -1
  14. package/dist/esm/components/Banner/Banner.js.map +1 -1
  15. package/dist/esm/components/Banner/util.js.map +1 -1
  16. package/dist/esm/components/Button/Button.js.map +1 -1
  17. package/dist/esm/components/Button/util.js.map +1 -1
  18. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  19. package/dist/esm/components/Card/Card.js +14 -13
  20. package/dist/esm/components/Card/Card.js.map +1 -1
  21. package/dist/esm/components/Checkbox/Checkbox.js +18 -15
  22. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  23. package/dist/esm/components/Combobox/Combobox.js +26 -23
  24. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  25. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  26. package/dist/esm/components/Datepicker/Datepicker.js +52 -48
  27. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  28. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  29. package/dist/esm/components/Dialog/Context.js.map +1 -1
  30. package/dist/esm/components/Dialog/Dialog.js +58 -39
  31. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  32. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  33. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  34. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  35. package/dist/esm/components/Dialog/components/Trigger.js +1 -1
  36. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  37. package/dist/esm/components/Field/Field.js +12 -10
  38. package/dist/esm/components/Field/Field.js.map +1 -1
  39. package/dist/esm/components/Form/Form.js +8 -6
  40. package/dist/esm/components/Form/Form.js.map +1 -1
  41. package/dist/esm/components/Group/Group.js +8 -6
  42. package/dist/esm/components/Group/Group.js.map +1 -1
  43. package/dist/esm/components/Hanger/Hanger.js +36 -28
  44. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  45. package/dist/esm/components/HoverCard/HoverCard.js +9 -8
  46. package/dist/esm/components/HoverCard/HoverCard.js.map +1 -1
  47. package/dist/esm/components/Icon/Icon.js +8 -7
  48. package/dist/esm/components/Icon/Icon.js.map +1 -1
  49. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  50. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  51. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  52. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  53. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  54. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  55. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  56. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  57. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  58. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  59. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  60. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  61. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  62. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  63. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  64. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  65. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  66. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  67. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  68. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  69. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  70. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  71. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  72. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  73. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  74. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  75. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  76. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  77. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  78. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  79. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  80. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  81. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  82. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  83. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  84. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  85. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  86. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  87. package/dist/esm/components/Icon/components/CircleClose.js.map +1 -1
  88. package/dist/esm/components/Icon/components/CircleMinus.js.map +1 -1
  89. package/dist/esm/components/Icon/components/CirclePlus.js.map +1 -1
  90. package/dist/esm/components/Icon/components/CircleTick.js.map +1 -1
  91. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  92. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  93. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  94. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  95. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  96. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  97. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  98. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  99. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  100. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  101. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  102. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  103. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  104. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  105. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  106. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  107. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  108. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  109. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  110. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  111. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  112. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  113. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  114. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  115. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  116. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  117. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  118. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  119. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  120. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  121. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  122. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  123. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  124. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  125. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  126. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  127. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  128. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  129. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  130. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  131. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  132. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  133. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  134. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  135. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  136. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  137. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  138. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  139. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  140. package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
  141. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  142. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  143. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  144. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  145. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  146. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  147. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  148. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  149. package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
  150. package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
  151. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  152. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  153. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  154. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  155. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  156. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  157. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  158. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  159. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  160. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  161. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  162. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  163. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  164. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  165. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  166. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  167. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  168. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  169. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  170. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  171. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  172. package/dist/esm/components/Icon/components/List.js.map +1 -1
  173. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  174. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  175. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  176. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  177. package/dist/esm/components/Icon/components/LogOut.js +20 -0
  178. package/dist/esm/components/Icon/components/LogOut.js.map +1 -0
  179. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  180. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  181. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  182. package/dist/esm/components/Icon/components/Menu.js +18 -0
  183. package/dist/esm/components/Icon/components/Menu.js.map +1 -0
  184. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  185. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  186. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  187. package/dist/esm/components/Icon/components/More.js.map +1 -1
  188. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  189. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  190. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  191. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  192. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  193. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  194. package/dist/esm/components/Icon/components/Numbers.js +18 -0
  195. package/dist/esm/components/Icon/components/Numbers.js.map +1 -0
  196. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  197. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  198. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  199. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  200. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  201. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  202. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  203. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  204. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  205. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  206. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  207. package/dist/esm/components/Icon/components/Profile.js +20 -0
  208. package/dist/esm/components/Icon/components/Profile.js.map +1 -0
  209. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  210. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  211. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  212. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  213. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  214. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  215. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  217. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  218. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  219. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  220. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  221. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  222. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  223. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  224. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  225. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  226. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  227. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  228. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  229. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  230. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  231. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  232. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  233. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  234. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  235. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  236. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  237. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  238. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  239. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  240. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  241. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  242. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  243. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  244. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  245. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  246. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  247. package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
  248. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  249. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  250. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  251. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  252. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  253. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  254. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  255. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  256. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  257. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  258. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  259. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  260. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  261. package/dist/esm/components/Icon/components/index.js +8 -0
  262. package/dist/esm/components/Icon/components/index.js.map +1 -1
  263. package/dist/esm/components/IconButton/IconButton.js +11 -9
  264. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  265. package/dist/esm/components/Input/Input.js +25 -25
  266. package/dist/esm/components/Input/Input.js.map +1 -1
  267. package/dist/esm/components/Listbox/Listbox.js +25 -24
  268. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  269. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  270. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  271. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  272. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  273. package/dist/esm/components/Menu/Context.js.map +1 -1
  274. package/dist/esm/components/Menu/Menu.js +34 -16
  275. package/dist/esm/components/Menu/Menu.js.map +1 -1
  276. package/dist/esm/components/Menu/components/Checkbox.js +1 -1
  277. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  278. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  279. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  280. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  281. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  282. package/dist/esm/components/Menu/components/RadioGroup.js +1 -1
  283. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  284. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  285. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  286. package/dist/esm/components/Navigation/Navigation.js +44 -35
  287. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  288. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  289. package/dist/esm/components/Pagination/Pagination.js +56 -39
  290. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  291. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  292. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  293. package/dist/esm/components/Popover/Popover.js +35 -30
  294. package/dist/esm/components/Popover/Popover.js.map +1 -1
  295. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  296. package/dist/esm/components/Progress/Progress.js +15 -11
  297. package/dist/esm/components/Progress/Progress.js.map +1 -1
  298. package/dist/esm/components/Provider/Provider.js +18 -13
  299. package/dist/esm/components/Provider/Provider.js.map +1 -1
  300. package/dist/esm/components/RadioGroup/RadioGroup.js +57 -45
  301. package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
  302. package/dist/esm/components/SearchInput/SearchInput.js +13 -10
  303. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  304. package/dist/esm/components/Select/Select.js +31 -30
  305. package/dist/esm/components/Select/Select.js.map +1 -1
  306. package/dist/esm/components/Select/useSelect.js.map +1 -1
  307. package/dist/esm/components/Spinner/Spinner.js +19 -12
  308. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  309. package/dist/esm/components/Switch/Switch.js +10 -9
  310. package/dist/esm/components/Switch/Switch.js.map +1 -1
  311. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  312. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  313. package/dist/esm/components/Table/components/Table.js.map +1 -1
  314. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  315. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  316. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  317. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  318. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  319. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  320. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  321. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  322. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  323. package/dist/esm/components/Tabs/Tabs.js +27 -25
  324. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  325. package/dist/esm/components/Textarea/Textarea.js +9 -11
  326. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  327. package/dist/esm/components/Toast/Toast.js +1 -1
  328. package/dist/esm/components/Toast/Toast.js.map +1 -1
  329. package/dist/esm/components/Toast/Toaster.js +118 -88
  330. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  331. package/dist/esm/components/Toast/util.js.map +1 -1
  332. package/dist/esm/components/Tooltip/Tooltip.js +8 -7
  333. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  334. package/dist/esm/components/Tour/Tour.js +52 -44
  335. package/dist/esm/components/Tour/Tour.js.map +1 -1
  336. package/dist/esm/components/Treeview/Treeview.js +36 -26
  337. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  338. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
  339. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  340. package/dist/esm/index.js +2 -0
  341. package/dist/esm/index.js.map +1 -1
  342. package/dist/esm/primitives/Button.js.map +1 -1
  343. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  344. package/dist/esm/utils/hooks/useDropTarget.js +10 -7
  345. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  346. package/dist/esm/utils/mergeRefs.js +3 -3
  347. package/dist/esm/utils/mergeRefs.js.map +1 -1
  348. package/dist/index.d.ts +3 -1
  349. package/dist/taco.cjs.development.js +945 -732
  350. package/dist/taco.cjs.development.js.map +1 -1
  351. package/dist/taco.cjs.production.min.js +1 -1
  352. package/dist/taco.cjs.production.min.js.map +1 -1
  353. package/dist/utils/mergeRefs.d.ts +1 -1
  354. package/dist/utils/tailwind.d.ts +1 -1
  355. package/package.json +4 -5
  356. package/tailwind.config.js +264 -260
  357. package/types.json +12 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Datepicker.js","sources":["../../../../src/components/Datepicker/Datepicker.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport { Calendar, CalendarProps } from '../Calendar/Calendar';\r\nimport { Input, InputProps } from '../Input/Input';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { useDatepicker } from './useDatepicker';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport { Popover } from '../Popover/Popover';\r\n\r\nexport type DatepickerTexts = {\r\n /** Aria-label for calendar */\r\n calendar: string;\r\n /** Clear button text */\r\n clear: string;\r\n /**\r\n * Aria-label for calendar icon button in the input.\r\n * Calendar will open when user clicks this icon button.\r\n */\r\n expand: string;\r\n /** Shortcut heading text */\r\n shortcuts: string;\r\n};\r\n\r\nexport type DatepickerProps = Omit<InputProps, 'value'> & {\r\n /** [Calendar](component:calendar) component associated with the DatePicker */\r\n calendar?: CalendarProps;\r\n /** List of shortcuts */\r\n shortcuts?: any;\r\n /** Title for the shortcuts panel */\r\n shortcutsText?: string;\r\n /** Handler to be called when the clear button is clicked */\r\n onReset?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n /**\r\n * Date value of the calendar.\r\n * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component\r\n */\r\n value?: Date;\r\n};\r\n\r\nexport const Datepicker = React.forwardRef(function Datepicker(props: DatepickerProps, ref: React.Ref<HTMLInputElement>) {\r\n const { className: externalClassName, onReset: handleReset, style, shortcuts, shortcutsText, ...otherProps } = props;\r\n const { calendar, input } = useDatepicker(otherProps, ref);\r\n const { texts } = useLocalization();\r\n const className = cn('inline-flex w-full text-black font-normal', externalClassName);\r\n\r\n return (\r\n <span className={className} data-taco=\"datepicker\" style={style}>\r\n <Input\r\n {...input}\r\n button={\r\n <Popover>\r\n <Popover.Trigger>\r\n <IconButton\r\n aria-label={texts.datepicker.expand}\r\n disabled={input.disabled || input.readOnly}\r\n icon=\"calendar\"\r\n />\r\n </Popover.Trigger>\r\n <Popover.Content>\r\n {({ close }) => (\r\n <div className=\"-m-3 flex\">\r\n <Calendar\r\n {...calendar}\r\n onChange={(date: Date, event?: React.MouseEvent<HTMLDivElement>) => {\r\n calendar.onChange(date, event);\r\n close();\r\n }}\r\n tabIndex={-1}\r\n />\r\n {shortcuts && (\r\n <div className=\"border-grey-dark flex flex-col border-l\">\r\n <span className=\"m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold\">\r\n {shortcutsText ?? texts.datepicker.shortcuts}\r\n </span>\r\n <ul>\r\n {shortcuts.map((shortcut, i) => (\r\n <li key={i}>\r\n <button\r\n className=\"hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs\"\r\n onClick={event => {\r\n event.persist();\r\n shortcut.onClick(event);\r\n close();\r\n }}\r\n >\r\n {shortcut.text}\r\n </button>\r\n </li>\r\n ))}\r\n </ul>\r\n {handleReset && (\r\n <button\r\n className=\"text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs\"\r\n onClick={event => {\r\n event.persist();\r\n handleReset(event);\r\n close();\r\n }}\r\n >\r\n {texts.datepicker.clear}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n </Popover.Content>\r\n </Popover>\r\n }\r\n />\r\n </span>\r\n );\r\n});\r\n"],"names":["Datepicker","React","props","ref","className","externalClassName","onReset","handleReset","style","shortcuts","shortcutsText","otherProps","calendar","input","useDatepicker","texts","useLocalization","cn","Input","button","Popover","Trigger","IconButton","datepicker","expand","disabled","readOnly","icon","Content","close","Calendar","onChange","date","event","tabIndex","map","shortcut","i","key","onClick","persist","text","clear"],"mappings":";;;;;;;;;MAuCaA,UAAU,gBAAGC,UAAA,CAAiB,SAASD,UAAT,CAAoBE,KAApB,EAA4CC,GAA5C;EACvC,MAAM;IAAEC,SAAS,EAAEC,iBAAb;IAAgCC,OAAO,EAAEC,WAAzC;IAAsDC,KAAtD;IAA6DC,SAA7D;IAAwEC,aAAxE;IAAuF,GAAGC;MAAeT,KAA/G;EACA,MAAM;IAAEU,QAAF;IAAYC;MAAUC,aAAa,CAACH,UAAD,EAAaR,GAAb,CAAzC;EACA,MAAM;IAAEY;MAAUC,eAAe,EAAjC;EACA,MAAMZ,SAAS,GAAGa,EAAE,CAAC,2CAAD,EAA8CZ,iBAA9C,CAApB;EAEA,OACIJ,aAAA,OAAA;IAAMG,SAAS,EAAEA;iBAAqB;IAAaI,KAAK,EAAEA;GAA1D,EACIP,aAAA,CAACiB,KAAD,oBACQL;IACJM,MAAM,EACFlB,aAAA,CAACmB,OAAD,MAAA,EACInB,aAAA,CAACmB,OAAO,CAACC,OAAT,MAAA,EACIpB,aAAA,CAACqB,UAAD;oBACgBP,KAAK,CAACQ,UAAN,C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Datepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Calendar, CalendarProps } from '../Calendar/Calendar';\nimport { Input, InputProps } from '../Input/Input';\nimport { useLocalization } from '../Provider/Provider';\nimport { useDatepicker } from './useDatepicker';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Popover } from '../Popover/Popover';\n\nexport type DatepickerTexts = {\n /** Aria-label for calendar */\n calendar: string;\n /** Clear button text */\n clear: string;\n /**\n * Aria-label for calendar icon button in the input.\n * Calendar will open when user clicks this icon button.\n */\n expand: string;\n /** Shortcut heading text */\n shortcuts: string;\n};\n\nexport type DatepickerProps = Omit<InputProps, 'value'> & {\n /** [Calendar](component:calendar) component associated with the DatePicker */\n calendar?: CalendarProps;\n /** List of shortcuts */\n shortcuts?: any;\n /** Title for the shortcuts panel */\n shortcutsText?: string;\n /** Handler to be called when the clear button is clicked */\n onReset?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Date value of the calendar.\n * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component\n */\n value?: Date;\n};\n\nexport const Datepicker = React.forwardRef(function Datepicker(props: DatepickerProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, onReset: handleReset, style, shortcuts, shortcutsText, ...otherProps } = props;\n const { calendar, input } = useDatepicker(otherProps, ref);\n const { texts } = useLocalization();\n const className = cn('inline-flex w-full text-black font-normal', externalClassName);\n\n return (\n <span className={className} data-taco=\"datepicker\" style={style}>\n <Input\n {...input}\n button={\n <Popover>\n <Popover.Trigger>\n <IconButton\n aria-label={texts.datepicker.expand}\n disabled={input.disabled || input.readOnly}\n icon=\"calendar\"\n />\n </Popover.Trigger>\n <Popover.Content>\n {({ close }) => (\n <div className=\"-m-3 flex\">\n <Calendar\n {...calendar}\n onChange={(date: Date, event?: React.MouseEvent<HTMLDivElement>) => {\n calendar.onChange(date, event);\n close();\n }}\n tabIndex={-1}\n />\n {shortcuts && (\n <div className=\"border-grey-dark flex flex-col border-l\">\n <span className=\"m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold\">\n {shortcutsText ?? texts.datepicker.shortcuts}\n </span>\n <ul>\n {shortcuts.map((shortcut, i) => (\n <li key={i}>\n <button\n className=\"hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs\"\n onClick={event => {\n event.persist();\n shortcut.onClick(event);\n close();\n }}\n >\n {shortcut.text}\n </button>\n </li>\n ))}\n </ul>\n {handleReset && (\n <button\n className=\"text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs\"\n onClick={event => {\n event.persist();\n handleReset(event);\n close();\n }}\n >\n {texts.datepicker.clear}\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </Popover.Content>\n </Popover>\n }\n />\n </span>\n );\n});\n"],"names":["Datepicker","React","props","ref","externalClassName","className","handleReset","onReset","style","shortcuts","shortcutsText","otherProps","useDatepicker","calendar","input","useLocalization","texts","cn","Input","button","Popover","Trigger","IconButton","datepicker","expand","disabled","readOnly","icon","Content","close","Calendar","onChange","date","event","tabIndex","map","shortcut","i","key","onClick","persist","text","clear"],"mappings":";;;;;;;;;;;IAuCaA,UAAU,gBAAGC,UAAA,CAAiB,SAASD,UAAT,CAAoBE,KAApB,EAA4CC,GAA5C;EACvC,IAAmBC,iBAAnB,GAA+GF,KAA/G,CAAQG,SAAR;MAA+CC,WAA/C,GAA+GJ,KAA/G,CAAsCK,OAAtC;MAA4DC,KAA5D,GAA+GN,KAA/G,CAA4DM,KAA5D;MAAmEC,SAAnE,GAA+GP,KAA/G,CAAmEO,SAAnE;MAA8EC,aAA9E,GAA+GR,KAA/G,CAA8EQ,aAA9E;MAAgGC,UAAhG,iCAA+GT,KAA/G;;EACA,qBAA4BU,aAAa,CAACD,UAAD,EAAaR,GAAb,CAAzC;MAAQU,QAAR,kBAAQA,QAAR;MAAkBC,KAAlB,kBAAkBA,KAAlB;;EACA,uBAAkBC,eAAe,EAAjC;MAAQC,KAAR,oBAAQA,KAA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,EAQKO,QAAQ,CAACK,IARd,CADJ,CADW;OAAd,CADL,CAJJ,EAoBKnC,WAAW,IACRL,aAAA,SAAA;QACII,SAAS,EAAC;QACVkC,OAAO,EAAE,iBAAAN,KAAK;UACVA,KAAK,CAACO,OAAN;UACAlC,WAAW,CAAC2B,KAAD,CAAX;UACAJ,KAAK;;OALb,EAQKb,KAAK,CAACO,UAAN,CAAiBmB,KARtB,CArBR,CAVR,CADH;KADL,CARJ;IAHR,CADJ,CADJ;AAmEH,CAzEyB;;;;"}
@@ -1 +1 @@
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;EAAEC,YAAY,EAAEC,CAAhB;EAAmBC,QAAnB;EAA6BC,MAA7B;EAAqCC,QAArC;EAA+CC,KAA/C;EAAsD,GAAGC;AAAzD,CADyB,EAEzBC,GAFyB;EA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AON,UAAU,CAACM,IAAlB,CAAzB,EAAkD,UAAlD,CAAlB;GADJ;;EAIA,MAAMa,aAAa,GAAIV,KAAD;IAClB,IAAIA,KAAK,CAACW,GAAN,KAAc,OAAlB,EAA2B;MACvBX,KAAK,CAACI,MAAN,CAAaQ,aAAb,CAA2B,IAAIC,KAAJ,CAAU,UAAV,EAAsB;QAAEC,OAAO,EAAE;OAAjC,CAA3B;;GAFR;;EAMA,MAAMC,UAAU,GAAe,EAC3B,GAAG5B,KADwB;IAE3B6B,YAAY,EAAE,KAFa;IAG3BhC,MAAM,EAAEe,eAHmB;IAI3Bd,QAAQ,EAAEqB,iBAJiB;IAK3BW,SAAS,EAAEP,aALgB;IAM3BtB,GAAG,EAAEC,QANsB;IAO3B6B,IAAI,EAAE,MAPqB;IAQ3BhC,KAAK,EAAEO;GARX;EAWA,MAAM0B,aAAa,GAAkB,EACjC,GAAGpC,QAD8B;IAEjCE,QAAQ,EAAEsB,YAFuB;IAGjCrB;GAHJ;EAMA,OAAO;IACHkC,KAAK,EAAEL,UADJ;IAEHhC,QAAQ,EAAEoC;GAFd;AAIH;;;;"}
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 handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\n }\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\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","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;EA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AAalB,KAAd,CAAhB;GADJ;;EAIA,MAAMqB,YAAY,GAAGV,IAAI;IACrBW,kBAAkB,CAACnB,QAAQ,CAACoB,OAAV,EAAmBb,MAAM,CAACC,IAAD,EAAON,UAAU,CAACM,IAAlB,CAAzB,EAAkD,UAAlD,CAAlB;GADJ;;EAIA,MAAMa,aAAa,GAAIV,KAAD;IAClB,IAAIA,KAAK,CAACW,GAAN,KAAc,OAAlB,EAA2B;MACvBX,KAAK,CAACI,MAAN,CAAaQ,aAAb,CAA2B,IAAIC,KAAJ,CAAU,UAAV,EAAsB;QAAEC,OAAO,EAAE;OAAjC,CAA3B;;GAFR;;EAMA,MAAMC,UAAU,GAAe,EAC3B,GAAG5B,KADwB;IAE3B6B,YAAY,EAAE,KAFa;IAG3BhC,MAAM,EAAEe,eAHmB;IAI3Bd,QAAQ,EAAEqB,iBAJiB;IAK3BW,SAAS,EAAEP,aALgB;IAM3BtB,GAAG,EAAEC,QANsB;IAO3B6B,IAAI,EAAE,MAPqB;IAQ3BhC,KAAK,EAAEO;GARX;EAWA,MAAM0B,aAAa,GAAkB,EACjC,GAAGpC,QAD8B;IAEjCE,QAAQ,EAAEsB,YAFuB;IAGjCrB;GAHJ;EAMA,OAAO;IACHkC,KAAK,EAAEL,UADJ;IAEHhC,QAAQ,EAAEoC;GAFd;AAIH;;;;"}
@@ -1 +1 @@
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: {\r\n open: false,\r\n toggle: () => {},\r\n },\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","open","toggle","elements","undefined","extra","onClose","props","ref","showCloseButton","size","useCurrentDialog"],"mappings":";;AAAA;MAsBaA,aAAa,gBAAGC,aAAA,CAAmC;EAC5DC,aAAa,EAAE,IAD6C;EAE5DC,SAAS,EAAE,KAFiD;EAG5DC,MAAM,EAAE;IACJC,IAAI,EAAE,KADF;IAEJC,MAAM,EAAE;GALgD;EAO5DC,QAAQ,EAAE;IACNH,MAAM,EAAEI,SADF;IAENC,KAAK,EAAED;GATiD;EAW5DE,OAAO,EAAE,QAXmD;EAY5DC,KAAK,EAAE,EAZqD;EAa5DC,GAAG,EAAE,IAbuD;EAc5DC,eAAe,EAAE,IAd2C;EAe5DC,IAAI,EAAE;AAfsD,CAAnC;MAkBhBC,gBAAgB,GAAG;EAC5B,OAAOd,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 */\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: {\n open: false,\n toggle: () => {},\n },\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","open","toggle","elements","undefined","extra","onClose","props","ref","showCloseButton","size","useCurrentDialog"],"mappings":";;AAAA;MAsBaA,aAAa,gBAAGC,aAAA,CAAmC;EAC5DC,aAAa,EAAE,IAD6C;EAE5DC,SAAS,EAAE,KAFiD;EAG5DC,MAAM,EAAE;IACJC,IAAI,EAAE,KADF;IAEJC,MAAM,EAAE;GALgD;EAO5DC,QAAQ,EAAE;IACNH,MAAM,EAAEI,SADF;IAENC,KAAK,EAAED;GATiD;EAW5DE,OAAO,EAAE,QAXmD;EAY5DC,KAAK,EAAE,EAZqD;EAa5DC,GAAG,EAAE,IAbuD;EAc5DC,eAAe,EAAE,IAd2C;EAe5DC,IAAI,EAAE;AAfsD,CAAnC;MAkBhBC,gBAAgB,GAAG;EAC5B,OAAOd,UAAA,CAAiBD,aAAjB,CAAP;AACH;;;;"}
@@ -1,3 +1,4 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, useMemo, Children, useState, createElement } from 'react';
2
3
  import { Root } from '@radix-ui/react-dialog';
3
4
  import { DialogContext } from './Context.js';
@@ -6,12 +7,14 @@ import { Content, Title, Footer, Close } from './components/Content.js';
6
7
  import { Drawer } from './components/Drawer.js';
7
8
  import { Extra } from './components/Extra.js';
8
9
 
9
- const useSeparatedChildren = initialChildren => {
10
- return useMemo(() => {
11
- const children = [];
12
- let drawer;
13
- let extra;
14
- Children.toArray(initialChildren).forEach(child => {
10
+ var _excluded = ["children", "closeOnEscape", "defaultOpen", "draggable", "onChange", "onClose", "open", "showCloseButton", "size", "trigger"];
11
+
12
+ var useSeparatedChildren = function useSeparatedChildren(initialChildren) {
13
+ return useMemo(function () {
14
+ var children = [];
15
+ var drawer;
16
+ var extra;
17
+ Children.toArray(initialChildren).forEach(function (child) {
15
18
  var _child$type, _child$type2;
16
19
 
17
20
  if (((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === Drawer.displayName) {
@@ -26,39 +29,55 @@ const useSeparatedChildren = initialChildren => {
26
29
  }, [initialChildren]);
27
30
  };
28
31
 
29
- const Dialog = /*#__PURE__*/forwardRef(function Dialog(props, ref) {
30
- const {
31
- children: initialChildren,
32
- closeOnEscape = true,
33
- defaultOpen,
34
- draggable = false,
35
- onChange,
36
- onClose,
37
- open,
38
- showCloseButton = true,
39
- size = 'sm',
40
- trigger,
41
- ...otherProps
42
- } = props;
43
- const [children, drawer, extra] = useSeparatedChildren(initialChildren);
44
- const [drawerOpen, setDrawerOpen] = useState(false);
45
- const context = useMemo(() => ({
46
- closeOnEscape,
47
- draggable,
48
- drawer: {
49
- open: drawerOpen,
50
- toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen)
51
- },
52
- elements: {
53
- drawer,
54
- extra
55
- },
56
- onClose,
57
- props: otherProps,
58
- showCloseButton,
59
- size,
60
- ref
61
- }), [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
32
+ var Dialog = /*#__PURE__*/forwardRef(function Dialog(props, ref) {
33
+ var initialChildren = props.children,
34
+ _props$closeOnEscape = props.closeOnEscape,
35
+ closeOnEscape = _props$closeOnEscape === void 0 ? true : _props$closeOnEscape,
36
+ defaultOpen = props.defaultOpen,
37
+ _props$draggable = props.draggable,
38
+ draggable = _props$draggable === void 0 ? false : _props$draggable,
39
+ onChange = props.onChange,
40
+ onClose = props.onClose,
41
+ open = props.open,
42
+ _props$showCloseButto = props.showCloseButton,
43
+ showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
44
+ _props$size = props.size,
45
+ size = _props$size === void 0 ? 'sm' : _props$size,
46
+ trigger = props.trigger,
47
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
48
+
49
+ var _useSeparatedChildren = useSeparatedChildren(initialChildren),
50
+ children = _useSeparatedChildren[0],
51
+ drawer = _useSeparatedChildren[1],
52
+ extra = _useSeparatedChildren[2];
53
+
54
+ var _React$useState = useState(false),
55
+ drawerOpen = _React$useState[0],
56
+ setDrawerOpen = _React$useState[1];
57
+
58
+ var context = useMemo(function () {
59
+ return {
60
+ closeOnEscape: closeOnEscape,
61
+ draggable: draggable,
62
+ drawer: {
63
+ open: drawerOpen,
64
+ toggle: function toggle() {
65
+ return setDrawerOpen(function (isDrawerOpen) {
66
+ return !isDrawerOpen;
67
+ });
68
+ }
69
+ },
70
+ elements: {
71
+ drawer: drawer,
72
+ extra: extra
73
+ },
74
+ onClose: onClose,
75
+ props: otherProps,
76
+ showCloseButton: showCloseButton,
77
+ size: size,
78
+ ref: ref
79
+ };
80
+ }, [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]);
62
81
  return createElement(DialogContext.Provider, {
63
82
  value: context
64
83
  }, createElement(Root, {
@@ -1 +1 @@
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, DialogDrawerRenderProps, 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 DialogCloseProps,\r\n DialogContentDrawerRenderProps,\r\n DialogContentProps,\r\n DialogContentRenderProps,\r\n DialogDrawerProps,\r\n DialogDrawerRenderProps,\r\n DialogFooterProps,\r\n DialogSize,\r\n DialogTitleProps,\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.toArray(initialChildren).forEach((child: any) => {\r\n if (child.type?.displayName === Drawer.displayName) {\r\n drawer = child;\r\n } else if (child.type?.displayName === Extra.displayName) {\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(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\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","toArray","forEach","child","type","displayName","Drawer","Extra","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","Close"],"mappings":";;;;;;;;AAgEA,MAAMA,oBAAoB,GAAGC,eAAe;EACxC,OAAOC,OAAA,CAAc;IACjB,MAAMC,QAAQ,GAAU,EAAxB;IACA,IAAIC,MAAJ;IACA,IAAIC,KAAJ;IAEAH,QAAA,CAAeI,OAAf,CAAuBL,eAAvB,EAAwCM,OAAxC,CAAiDC,KAAD;;;MAC5C,IAAI,gBAAAA,KAAK,CAACC,IAAN,4DAAYC,WAAZ,MAA4BC,MAAM,CAACD,WAAvC,EAAoD;QAChDN,MAAM,GAAGI,KAAT;OADJ,MAEO,IAAI,iBAAAA,KAAK,CAACC,IAAN,8DAAYC,WAAZ,MAA4BE,KAAK,CAACF,WAAtC,EAAmD;QACtDL,KAAK,GAAGG,KAAR;OADG,MAEA;QACHL,QAAQ,CAACU,IAAT,CAAcL,KAAd;;KANR;IAUA,OAAO,CAACL,QAAD,EAAWC,MAAX,EAAmBC,KAAnB,CAAP;GAfG,EAgBJ,CAACJ,eAAD,CAhBI,CAAP;AAiBH,CAlBD;;MA8Baa,MAAM,gBAAGZ,UAAA,CAAiB,SAASY,MAAT,CAAgBC,KAAhB,EAAoCC,GAApC;EACnC,MAAM;IACFb,QAAQ,EAAEF,eADR;IAEFgB,aAAa,GAAG,IAFd;IAGFC,WAHE;IAIFC,SAAS,GAAG,KAJV;IAKFC,QALE;IAMFC,OANE;IAOFC,IAPE;IAQFC,eAAe,GAAG,IARhB;IASFC,IAAI,GAAG,IATL;IAUFC,OAVE;IAWF,GAAGC;MACHX,KAZJ;EAaA,MAAM,CAACZ,QAAD,EAAWC,MAAX,EAAmBC,KAAnB,IAA4BL,oBAAoB,CAACC,eAAD,CAAtD;EACA,MAAM,CAAC0B,UAAD,EAAaC,aAAb,IAA8B1B,QAAA,CAAe,KAAf,CAApC;EAEA,MAAM2B,OAAO,GAAG3B,OAAA,CACZ,OAAO;IACHe,aADG;IAEHE,SAFG;IAGHf,MAAM,EAAE;MACJkB,IAAI,EAAEK,UADF;MAEJG,MAAM,EAAE,MAAMF,aAAa,CAACG,YAAY,IAAI,CAACA,YAAlB;KAL5B;IAOHC,QAAQ,EAAE;MACN5B,MADM;MAENC;KATD;IAWHgB,OAXG;IAYHN,KAAK,EAAEW,UAZJ;IAaHH,eAbG;IAcHC,IAdG;IAeHR;GAfJ,CADY,EAkBZ,CAACC,aAAD,EAAgBU,UAAhB,EAA4BR,SAA5B,EAAuCf,MAAvC,EAA+CC,KAA/C,EAAsDiB,IAAtD,EAA4DI,UAA5D,EAAwEH,eAAxE,CAlBY,CAAhB;EAqBA,OACIrB,aAAA,CAAC+B,aAAa,CAACC,QAAf;IAAwBC,KAAK,EAAEN;GAA/B,EACI3B,aAAA,CAACkC,IAAD;IAAsBlB,WAAW,EAAEA;IAAaI,IAAI,EAAEA;IAAMe,YAAY,EAAEjB;GAA1E,EACKK,OAAO,IAAIvB,aAAA,CAACoC,OAAD,MAAA,EAAUb,OAAV,CADhB,EAEKtB,QAFL,CADJ,CADJ;AAQH,CA9CqB;AAgDtBW,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,CAACF,KAAP,GAAeA,KAAf;AACAE,MAAM,CAACH,MAAP,GAAgBA,MAAhB;AACAG,MAAM,CAAC4B,KAAP,GAAeA,KAAf;;;;"}
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, DialogDrawerRenderProps, Drawer } from './components/Drawer';\nimport { DialogExtraProps, Extra } from './components/Extra';\nimport { DialogContext } from './Context';\nimport { DialogSize } from './types';\n\nexport {\n DialogCloseProps,\n DialogContentDrawerRenderProps,\n DialogContentProps,\n DialogContentRenderProps,\n DialogDrawerProps,\n DialogDrawerRenderProps,\n DialogFooterProps,\n DialogSize,\n DialogTitleProps,\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.toArray(initialChildren).forEach((child: any) => {\n if (child.type?.displayName === Drawer.displayName) {\n drawer = child;\n } else if (child.type?.displayName === Extra.displayName) {\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(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\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","toArray","forEach","child","type","displayName","Drawer","Extra","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","Close"],"mappings":";;;;;;;;;;;AAgEA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,eAAe;EACxC,OAAOC,OAAA,CAAc;IACjB,IAAMC,QAAQ,GAAU,EAAxB;IACA,IAAIC,MAAJ;IACA,IAAIC,KAAJ;IAEAH,QAAA,CAAeI,OAAf,CAAuBL,eAAvB,EAAwCM,OAAxC,CAAgD,UAACC,KAAD;;;MAC5C,IAAI,gBAAAA,KAAK,CAACC,IAAN,4DAAYC,WAAZ,MAA4BC,MAAM,CAACD,WAAvC,EAAoD;QAChDN,MAAM,GAAGI,KAAT;OADJ,MAEO,IAAI,iBAAAA,KAAK,CAACC,IAAN,8DAAYC,WAAZ,MAA4BE,KAAK,CAACF,WAAtC,EAAmD;QACtDL,KAAK,GAAGG,KAAR;OADG,MAEA;QACHL,QAAQ,CAACU,IAAT,CAAcL,KAAd;;KANR;IAUA,OAAO,CAACL,QAAD,EAAWC,MAAX,EAAmBC,KAAnB,CAAP;GAfG,EAgBJ,CAACJ,eAAD,CAhBI,CAAP;AAiBH,CAlBD;;IA8Baa,MAAM,gBAAGZ,UAAA,CAAiB,SAASY,MAAT,CAAgBC,KAAhB,EAAoCC,GAApC;EACnC,IACcf,eADd,GAYIc,KAZJ,CACIZ,QADJ;6BAYIY,KAZJ,CAEIE,aAFJ;MAEIA,aAFJ,qCAEoB,IAFpB;MAGIC,WAHJ,GAYIH,KAZJ,CAGIG,WAHJ;yBAYIH,KAZJ,CAIII,SAJJ;MAIIA,SAJJ,iC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YAAY,EAAEjB;GAA1E,EACKK,OAAO,IAAIvB,aAAA,CAACoC,OAAD,MAAA,EAAUb,OAAV,CADhB,EAEKtB,QAFL,CADJ,CADJ;AAQH,CA9CqB;AAgDtBW,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,CAACF,KAAP,GAAeA,KAAf;AACAE,MAAM,CAACH,MAAP,GAAgBA,MAAhB;AACAG,MAAM,CAAC4B,KAAP,GAAeA,KAAf;;;;"}
@@ -1 +1 @@
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 type { DialogContentProps as DialogPrimitiveContentProps } 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 { DialogContext, 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 = DialogContext['drawer'];\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(function RenderPropWrapper({ 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: DialogPrimitiveContentProps['onCloseAutoFocus'];\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 animate-[fade-in_150ms] z-[997]', {\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: KeyboardEvent) => {\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":";;;;;;;;;;;MAoBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;EAClC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAD,EAAgBH,KAAK,CAACE,SAAtB,CAApB;EACA,OAAOJ,aAAA,CAACM,OAAD,oBAA2BJ;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA7D,CAAP;AACH,CAHoB;MAMRI,MAAM,gBAAGP,UAAA,CAAiB,SAASQ,YAAT,CAAsBN,KAAtB,EAAgDC,GAAhD;EACnC,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAD,EAA0BH,KAAK,CAACE,SAAhC,CAApB;EACA,OACIJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA3C,EACKD,KAAK,CAACO,QADX,CADJ;AAKH,CAPqB;MAWTC,KAAK,gBAAGV,UAAA,CAAiB,SAASW,WAAT,CAAqBT,KAArB,EAA8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CAAC8B,KAA/B,GAAuCF;;IAVpD,EAaIrD,aAAA,MAAA;IAAKI,SAAS,EAAE+B;iBAA8B;GAA9C,EACKQ,MADL,EAEK/B,MAAM,CAACuC,SAAP,IACGnD,aAAA,MAAA,oBACQ2B;kBACQE,KAAK,CAACjB,MAAN,CAAa4C;IACzBpD,SAAS,EAAC;IAHd,CAHR,EASKQ,MAAM,CAAC6C,eAAP,GACGzD,aAAA,CAACM,OAAD;IAAuBQ,OAAO,EAAEF,MAAM,CAACG;IAASC,OAAO;GAAvD,EACIhB,aAAA,CAAC0D,UAAD;IACIC,UAAU,EAAC;kBACC9B,KAAK,CAACjB,MAAN,CAAaO;IACzBf,SAAS,EAAC;IACVwD,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';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport type { DialogContentProps as DialogPrimitiveContentProps } from '@radix-ui/react-dialog';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { useCurrentMenu } from '../../Menu/Context';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\n\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\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(function RenderPropWrapper({ 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: DialogPrimitiveContentProps['onCloseAutoFocus'];\n\n if (menu) {\n handleCloseAutoFocus = () => menu.close();\n }\n\n const className = cn('bg-white rounded relative mt-16 mx-auto animate-[fade-in_150ms] z-[997]', {\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: KeyboardEvent) => {\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","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":";;;;;;;;;;;MAoBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;EAClC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAD,EAAgBH,KAAK,CAACE,SAAtB,CAApB;EACA,OAAOJ,aAAA,CAACM,OAAD,oBAA2BJ;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA7D,CAAP;AACH,CAHoB;MAMRI,MAAM,gBAAGP,UAAA,CAAiB,SAASQ,YAAT,CAAsBN,KAAtB,EAAgDC,GAAhD;EACnC,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAD,EAA0BH,KAAK,CAACE,SAAhC,CAApB;EACA,OACIJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;IAAWD,GAAG,EAAEA;IAA3C,EACKD,KAAK,CAACO,QADX,CADJ;AAKH,CAPqB;MAWTC,KAAK,gBAAGV,UAAA,CAAiB,SAASW,WAAT,CAAqBT,KAArB,EAA8CC,GAA9C;EAClC,MAAMS,MAAM,GAAGC,gBAAgB,EAA/B;EAEA,OAAOb,aAAA,CAACM,OAAD;IAAuBQ,OAAO,EAAEF,MAAM,CAACG;KAAab;IAAOC,GAAG,EAAEA;IAAKa,OAAO;IAA5E,CAAP;AACH,CAJoB;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,CAAa4C;IACzBpD,SAAS,EAAC;IAHd,CAHR,EASKQ,MAAM,CAAC6C,eAAP,GACGzD,aAAA,CAACM,OAAD;IAAuBQ,OAAO,EAAEF,MAAM,CAACG;IAASC,OAAO;GAAvD,EACIhB,aAAA,CAAC0D,UAAD;IACIC,UAAU,EAAC;kBACC9B,KAAK,CAACjB,MAAN,CAAaO;IACzBf,SAAS,EAAC;IACVwD,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 +1 @@
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 { DialogContext, useCurrentDialog } from '../Context';\r\n\r\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\r\n\r\nexport type DialogDrawerProps = Omit<\r\n React.HTMLAttributes<HTMLDivElement>,\r\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\r\n> & {\r\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\r\n};\r\n\r\nconst 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 {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\r\n </motion.div>\r\n );\r\n});\r\nDrawer.displayName = 'DialogDrawer';\r\n\r\nexport { Drawer };\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","children","displayName"],"mappings":";;;;;MAcMA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAAsBC,KAAtB,EAAgDC,GAAhD;;;EAC5B,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;EACA,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBL,KAAK,CAACI,SAFU,CAApB;EAKA,OACIN,aAAA,CAACQ,MAAM,CAACC,GAAR,oBACQP;IACJI,SAAS,EAAEA;iBACD;mBACG,oBAACF,MAAM,CAACM,MAAR,2CAAC,eAAeC,IAAhB;IACbC,QAAQ,EAAE;MACNC,OAAO,EAAE;QACLC,IAAI,EAAE,MADD;QAELC,OAAO,EAAE,OAFJ;QAGLC,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAR;UAAmBC,QAAQ,EAAE;;OAJvC;MAMNC,MAAM,EAAE;QACJL,IAAI,EAAE,IADF;QAEJE,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAR;UAAmBC,QAAQ,EAAE;SAFrC;QAGJE,aAAa,EAAE;UACXL,OAAO,EAAE;;;;IAIrBM,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAP,4DAAeC,IAAf,GAAsB,SAAtB,GAAkC;IAC3CR,GAAG,EAAEA;IApBT,EAsBK,OAAOD,KAAK,CAACoB,QAAb,KAA0B,UAA1B,GAAuCpB,KAAK,CAACoB,QAAN,CAAelB,MAAM,CAACM,MAAtB,CAAvC,GAAuER,KAAK,CAACoB,QAtBlF,CADJ;AA0BH,CAjCc;AAkCfvB,MAAM,CAACwB,WAAP,GAAqB,cAArB;;;;"}
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 { DialogContext, useCurrentDialog } from '../Context';\n\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n> & {\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\n};\n\nconst 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 {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\n </motion.div>\n );\n});\nDrawer.displayName = 'DialogDrawer';\n\nexport { Drawer };\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","children","displayName"],"mappings":";;;;;MAcMA,MAAM,gBAAGC,UAAA,CAAiB,SAASC,YAAT,CAAsBC,KAAtB,EAAgDC,GAAhD;;;EAC5B,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;EACA,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGADgB,EAEhBL,KAAK,CAACI,SAFU,CAApB;EAKA,OACIN,aAAA,CAACQ,MAAM,CAACC,GAAR,oBACQP;IACJI,SAAS,EAAEA;iBACD;mBACG,oBAACF,MAAM,CAACM,MAAR,2CAAC,eAAeC,IAAhB;IACbC,QAAQ,EAAE;MACNC,OAAO,EAAE;QACLC,IAAI,EAAE,MADD;QAELC,OAAO,EAAE,OAFJ;QAGLC,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAR;UAAmBC,QAAQ,EAAE;;OAJvC;MAMNC,MAAM,EAAE;QACJL,IAAI,EAAE,IADF;QAEJE,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAR;UAAmBC,QAAQ,EAAE;SAFrC;QAGJE,aAAa,EAAE;UACXL,OAAO,EAAE;;;;IAIrBM,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAP,4DAAeC,IAAf,GAAsB,SAAtB,GAAkC;IAC3CR,GAAG,EAAEA;IApBT,EAsBK,OAAOD,KAAK,CAACoB,QAAb,KAA0B,UAA1B,GAAuCpB,KAAK,CAACoB,QAAN,CAAelB,MAAM,CAACM,MAAtB,CAAvC,GAAuER,KAAK,CAACoB,QAtBlF,CADJ;AA0BH,CAjCc;AAkCfvB,MAAM,CAACwB,WAAP,GAAqB,cAArB;;;;"}
@@ -1 +1 @@
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\nconst Extra = React.forwardRef(function DialogExtra(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\nExtra.displayName = 'DialogExtra';\r\n\r\nexport { Extra };\r\n"],"names":["Extra","React","DialogExtra","props","ref","className","cn","displayName"],"mappings":";;;MAKMA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;EAC3B,MAAMC,SAAS,GAAGC,EAAE,CAChB,6GADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;EAKA,OAAOJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;iBAAqB;IAAeD,GAAG,EAAEA;IAApE,CAAP;AACH,CAPa;AAQdJ,KAAK,CAACO,WAAN,GAAoB,aAApB;;;;"}
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\nconst Extra = React.forwardRef(function DialogExtra(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});\nExtra.displayName = 'DialogExtra';\n\nexport { Extra };\n"],"names":["Extra","React","DialogExtra","props","ref","className","cn","displayName"],"mappings":";;;MAKMA,KAAK,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;EAC3B,MAAMC,SAAS,GAAGC,EAAE,CAChB,6GADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;EAKA,OAAOJ,aAAA,MAAA,oBAASE;IAAOE,SAAS,EAAEA;iBAAqB;IAAeD,GAAG,EAAEA;IAApE,CAAP;AACH,CAPa;AAQdJ,KAAK,CAACO,WAAN,GAAoB,aAApB;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { forwardRef, createElement } from 'react';
2
- import mergeRefs from '../../../utils/mergeRefs.js';
2
+ 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
 
@@ -1 +1 @@
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;EACpC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;EACA,OAAOL,aAAA,CAACM,SAAD,oBAA6BF,MAAM,CAACF,OAAWA;IAAOC,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;IAAqBK,OAAO;IAAhG,CAAP;AACH,CAHsB;;;;"}
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":";;;;;MAOaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,aAAT,CAAuBC,KAAvB,EAAkDC,GAAlD;EACpC,MAAMC,MAAM,GAAGC,gBAAgB,EAA/B;EACA,OAAOL,aAAA,CAACM,SAAD,oBAA6BF,MAAM,CAACF,OAAWA;IAAOC,GAAG,EAAEI,SAAS,CAAC,CAACH,MAAM,CAACD,GAAR,EAAaA,GAAb,CAAD;IAAqBK,OAAO;IAAhG,CAAP;AACH,CAHsB;;;;"}
@@ -1,18 +1,20 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, createElement } from 'react';
2
3
  import cn from 'classnames';
3
4
 
4
- const Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
5
- const {
6
- disabled,
7
- children,
8
- invalid = false,
9
- message,
10
- ...otherProps
11
- } = props;
12
- const className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
5
+ var _excluded = ["disabled", "children", "invalid", "message"];
6
+ var Field = /*#__PURE__*/forwardRef(function Field(props, ref) {
7
+ var disabled = props.disabled,
8
+ children = props.children,
9
+ _props$invalid = props.invalid,
10
+ invalid = _props$invalid === void 0 ? false : _props$invalid,
11
+ message = props.message,
12
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
13
+
14
+ var className = cn('flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]', {
13
15
  'text-grey-dark': disabled
14
16
  }, props.className);
15
- const messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
17
+ var messageClassName = cn('h-4 text-xs text-left leading-normal font-normal truncate -mb-4', {
16
18
  'text-grey-darkest': !invalid,
17
19
  'text-red': invalid,
18
20
  'opacity-50': disabled
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../../src/components/Field/Field.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\n\r\nimport './Field.css';\r\n\r\nexport type FieldProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\r\n /** Content of the field */\r\n children: React.ReactNode;\r\n /**\tChanges the style to indicate the element is disabled */\r\n disabled?: boolean;\r\n /* Whether the input is in an invalid state */\r\n invalid?: boolean;\r\n /**\r\n * Text displayed below the children of Field.\r\n * Should be a short text that indicates feedback for user.\r\n */\r\n message?: string;\r\n};\r\n\r\nexport const Field = React.forwardRef(function Field(props: FieldProps, ref: React.Ref<HTMLLabelElement>) {\r\n const { disabled, children, invalid = false, message, ...otherProps } = props;\r\n const className = cn(\r\n 'flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]',\r\n {\r\n 'text-grey-dark': disabled,\r\n },\r\n props.className\r\n );\r\n const messageClassName = cn(\r\n 'h-4 text-xs text-left leading-normal font-normal truncate -mb-4',\r\n {\r\n 'text-grey-darkest': !invalid,\r\n 'text-red': invalid,\r\n 'opacity-50': disabled,\r\n },\r\n props.className\r\n );\r\n\r\n return (\r\n <label {...otherProps} className={className} data-taco=\"label\" ref={ref}>\r\n {children}\r\n {message && (\r\n <span className={messageClassName} role={invalid ? 'alert' : undefined}>\r\n {message}\r\n </span>\r\n )}\r\n </label>\r\n );\r\n});\r\n"],"names":["Field","React","props","ref","disabled","children","invalid","message","otherProps","className","cn","messageClassName","role","undefined"],"mappings":";;;MAmBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;EAClC,MAAM;IAAEC,QAAF;IAAYC,QAAZ;IAAsBC,OAAO,GAAG,KAAhC;IAAuCC,OAAvC;IAAgD,GAAGC;MAAeN,KAAxE;EACA,MAAMO,SAAS,GAAGC,EAAE,CAChB,8EADgB,EAEhB;IACI,kBAAkBN;GAHN,EAKhBF,KAAK,CAACO,SALU,CAApB;EAOA,MAAME,gBAAgB,GAAGD,EAAE,CACvB,iEADuB,EAEvB;IACI,qBAAqB,CAACJ,OAD1B;IAEI,YAAYA,OAFhB;IAGI,cAAcF;GALK,EAOvBF,KAAK,CAACO,SAPiB,CAA3B;EAUA,OACIR,aAAA,QAAA,oBAAWO;IAAYC,SAAS,EAAEA;iBAAqB;IAAQN,GAAG,EAAEA;IAApE,EACKE,QADL,EAEKE,OAAO,IACJN,aAAA,OAAA;IAAMQ,SAAS,EAAEE;IAAkBC,IAAI,EAAEN,OAAO,GAAG,OAAH,GAAaO;GAA7D,EACKN,OADL,CAHR,CADJ;AAUH,CA7BoB;;;;"}
1
+ {"version":3,"file":"Field.js","sources":["../../../../src/components/Field/Field.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport './Field.css';\n\nexport type FieldProps = React.LabelHTMLAttributes<HTMLLabelElement> & {\n /** Content of the field */\n children: React.ReactNode;\n /**\tChanges the style to indicate the element is disabled */\n disabled?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n /**\n * Text displayed below the children of Field.\n * Should be a short text that indicates feedback for user.\n */\n message?: string;\n};\n\nexport const Field = React.forwardRef(function Field(props: FieldProps, ref: React.Ref<HTMLLabelElement>) {\n const { disabled, children, invalid = false, message, ...otherProps } = props;\n const className = cn(\n 'flex flex-col font-bold text-xs leading-loose pb-4 min-h-[theme(spacing.18)]',\n {\n 'text-grey-dark': disabled,\n },\n props.className\n );\n const messageClassName = cn(\n 'h-4 text-xs text-left leading-normal font-normal truncate -mb-4',\n {\n 'text-grey-darkest': !invalid,\n 'text-red': invalid,\n 'opacity-50': disabled,\n },\n props.className\n );\n\n return (\n <label {...otherProps} className={className} data-taco=\"label\" ref={ref}>\n {children}\n {message && (\n <span className={messageClassName} role={invalid ? 'alert' : undefined}>\n {message}\n </span>\n )}\n </label>\n );\n});\n"],"names":["Field","React","props","ref","disabled","children","invalid","message","otherProps","className","cn","messageClassName","role","undefined"],"mappings":";;;;;IAmBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;EAClC,IAAQC,QAAR,GAAwEF,KAAxE,CAAQE,QAAR;MAAkBC,QAAlB,GAAwEH,KAAxE,CAAkBG,QAAlB;uBAAwEH,KAAxE,CAA4BI,OAA5B;MAA4BA,OAA5B,+BAAsC,KAAtC;MAA6CC,OAA7C,GAAwEL,KAAxE,CAA6CK,OAA7C;MAAyDC,UAAzD,iCAAwEN,KAAxE;;EACA,IAAMO,SAAS,GAAGC,EAAE,CAChB,8EADgB,EAEhB;IACI,kBAAkBN;GAHN,EAKhBF,KAAK,CAACO,SALU,CAApB;EAOA,IAAME,gBAAgB,GAAGD,EAAE,CACvB,iEADuB,EAEvB;IACI,qBAAqB,CAACJ,OAD1B;IAEI,YAAYA,OAFhB;IAGI,cAAcF;GALK,EAOvBF,KAAK,CAACO,SAPiB,CAA3B;EAUA,OACIR,aAAA,QAAA,oBAAWO;IAAYC,SAAS,EAAEA;iBAAqB;IAAQN,GAAG,EAAEA;IAApE,EACKE,QADL,EAEKE,OAAO,IACJN,aAAA,OAAA;IAAMQ,SAAS,EAAEE;IAAkBC,IAAI,EAAEN,OAAO,GAAG,OAAH,GAAaO;GAA7D,EACKN,OADL,CAHR,CADJ;AAUH,CA7BoB;;;;"}
@@ -1,12 +1,14 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, createElement } from 'react';
2
3
  import cn from 'classnames';
3
4
 
4
- const Form = /*#__PURE__*/forwardRef(function Form(props, ref) {
5
- const {
6
- horizontal = false,
7
- ...otherProps
8
- } = props;
9
- const className = cn('yt-form', {
5
+ var _excluded = ["horizontal"];
6
+ var Form = /*#__PURE__*/forwardRef(function Form(props, ref) {
7
+ var _props$horizontal = props.horizontal,
8
+ horizontal = _props$horizontal === void 0 ? false : _props$horizontal,
9
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
10
+
11
+ var className = cn('yt-form', {
10
12
  'yt-form--horizontal flex flex-wrap': horizontal
11
13
  }, props.className);
12
14
  return createElement("form", Object.assign({}, otherProps, {
@@ -1 +1 @@
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":";;;MAWaA,IAAI,gBAAGC,UAAA,CAAiB,SAASD,IAAT,CAAcE,KAAd,EAAgCC,GAAhC;EACjC,MAAM;IAAEC,UAAU,GAAG,KAAf;IAAsB,GAAGC;MAAeH,KAA9C;EACA,MAAMI,SAAS,GAAGC,EAAE,CAChB,SADgB,EAEhB;IACI,sCAAsCH;GAH1B,EAKhBF,KAAK,CAACI,SALU,CAApB;EAQA,OAAOL,aAAA,OAAA,oBAAUI;IAAYC,SAAS,EAAEA;iBAAqB;IAAOH,GAAG,EAAEA;IAAlE,CAAP;AACH,CAXmB;;;;"}
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;EACjC,wBAA8CD,KAA9C,CAAQE,UAAR;MAAQA,UAAR,kCAAqB,KAArB;MAA+BC,UAA/B,iCAA8CH,KAA9C;;EACA,IAAMI,SAAS,GAAGC,EAAE,CAChB,SADgB,EAEhB;IACI,sCAAsCH;GAH1B,EAKhBF,KAAK,CAACI,SALU,CAApB;EAQA,OAAOL,aAAA,OAAA,oBAAUI;IAAYC,SAAS,EAAEA;iBAAqB;IAAOH,GAAG,EAAEA;IAAlE,CAAP;AACH,CAXmB;;;;"}
@@ -1,12 +1,14 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, createElement } from 'react';
2
3
  import cn from 'classnames';
3
4
 
4
- const Group = /*#__PURE__*/forwardRef(function Group(props, ref) {
5
- const {
6
- as: Tag = 'span',
7
- ...otherProps
8
- } = props;
9
- const className = cn('flex ', props.className);
5
+ var _excluded = ["as"];
6
+ var Group = /*#__PURE__*/forwardRef(function Group(props, ref) {
7
+ var _props$as = props.as,
8
+ Tag = _props$as === void 0 ? 'span' : _props$as,
9
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
10
+
11
+ var className = cn('flex ', props.className);
10
12
  return createElement(Tag, Object.assign({}, otherProps, {
11
13
  className: className,
12
14
  "data-taco": "group",
@@ -1 +1 @@
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":";;;MAcaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;EAClC,MAAM;IAAEC,EAAE,EAAEC,GAAG,GAAG,MAAZ;IAAoB,GAAGC;MAAeJ,KAA5C;EACA,MAAMK,SAAS,GAAGC,EAAE,CAAC,OAAD,EAAUN,KAAK,CAACK,SAAhB,CAApB;EACA,OAAON,aAAA,CAACI,GAAD,oBAASC;IAAYC,SAAS,EAAEA;iBAAqB;IAAQJ,GAAG,EAAEA;IAAlE,CAAP;AACH,CAJoB;;;;"}
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;EAClC,gBAA4CD,KAA5C,CAAQE,EAAR;MAAYC,GAAZ,0BAAkB,MAAlB;MAA6BC,UAA7B,iCAA4CJ,KAA5C;;EACA,IAAMK,SAAS,GAAGC,EAAE,CAAC,OAAD,EAAUN,KAAK,CAACK,SAAhB,CAApB;EACA,OAAON,aAAA,CAACI,GAAD,oBAASC;IAAYC,SAAS,EAAEA;iBAAqB;IAAQJ,GAAG,EAAEA;IAAlE,CAAP;AACH,CAJoB;;;;"}
@@ -1,23 +1,25 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, createElement, useMemo, useState, useEffect, createContext, useContext, isValidElement } from 'react';
2
3
  import cn from 'classnames';
3
4
  import { IconButton } from '../IconButton/IconButton.js';
4
5
  import { useLocalization } from '../Provider/Provider.js';
5
6
  import { Root, Anchor as Anchor$1, Close } from '@radix-ui/react-popover';
6
7
  import { UnstyledContent, UnstyledArrow } from '../Popover/Primitives.js';
7
- import mergeRefs from '../../utils/mergeRefs.js';
8
+ import { mergeRefs } from '../../utils/mergeRefs.js';
8
9
 
9
- const HangerContext = /*#__PURE__*/createContext({
10
+ var _excluded = ["anchor", "children", "defaultOpen"];
11
+ var HangerContext = /*#__PURE__*/createContext({
10
12
  props: {},
11
13
  ref: null
12
14
  });
13
- const Anchor = /*#__PURE__*/forwardRef(function HangerAnchor(props, ref) {
15
+ var Anchor = /*#__PURE__*/forwardRef(function HangerAnchor(props, ref) {
14
16
  var _props$children;
15
17
 
16
- const context = useContext(HangerContext);
17
- let children = props.children;
18
+ var context = useContext(HangerContext);
19
+ var children = props.children;
18
20
 
19
21
  if (isValidElement(props.children) && typeof ((_props$children = props.children) === null || _props$children === void 0 ? void 0 : _props$children.type) === 'function') {
20
- console.warn(`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`);
22
+ console.warn("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");
21
23
  children = createElement("span", null, props.children);
22
24
  }
23
25
 
@@ -27,21 +29,22 @@ const Anchor = /*#__PURE__*/forwardRef(function HangerAnchor(props, ref) {
27
29
  asChild: true
28
30
  }));
29
31
  });
30
- const Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
31
- const className = cn('mb-1 text-base font-bold flex w-full', props.className);
32
+ var Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
33
+ var className = cn('mb-1 text-base font-bold flex w-full', props.className);
32
34
  return createElement("span", Object.assign({}, props, {
33
35
  className: className,
34
36
  ref: ref
35
37
  }));
36
38
  });
37
- const Content = /*#__PURE__*/forwardRef(function HangerContent(props, ref) {
38
- const context = useContext(HangerContext);
39
- const {
40
- texts
41
- } = useLocalization();
42
- const className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent max-w-sm', props.className);
39
+ var Content = /*#__PURE__*/forwardRef(function HangerContent(props, ref) {
40
+ var context = useContext(HangerContext);
43
41
 
44
- const handleInteractOutside = event => {
42
+ var _useLocalization = useLocalization(),
43
+ texts = _useLocalization.texts;
44
+
45
+ var className = cn('wcag-blue border border-transparent rounded p-3 pr-12 yt-shadow z-[996] focus:border-transparent max-w-sm', props.className);
46
+
47
+ var handleInteractOutside = function handleInteractOutside(event) {
45
48
  event.preventDefault();
46
49
  };
47
50
 
@@ -63,20 +66,25 @@ const Content = /*#__PURE__*/forwardRef(function HangerContent(props, ref) {
63
66
  onClick: context.props.onClose
64
67
  })));
65
68
  });
66
- const Hanger = /*#__PURE__*/forwardRef(function Hanger(props, ref) {
67
- const {
68
- anchor,
69
- children,
70
- defaultOpen = true,
71
- ...otherProps
72
- } = props;
73
- const context = useMemo(() => ({
74
- props: otherProps,
75
- ref
76
- }), [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
69
+ var Hanger = /*#__PURE__*/forwardRef(function Hanger(props, ref) {
70
+ var anchor = props.anchor,
71
+ children = props.children,
72
+ _props$defaultOpen = props.defaultOpen,
73
+ defaultOpen = _props$defaultOpen === void 0 ? true : _props$defaultOpen,
74
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
75
+
76
+ var context = useMemo(function () {
77
+ return {
78
+ props: otherProps,
79
+ ref: ref
80
+ };
81
+ }, [otherProps]); // we do this to ensure hangers are mounted after their containers, e.g. if the container is another portal
82
+
83
+ var _React$useState = useState(false),
84
+ open = _React$useState[0],
85
+ setOpen = _React$useState[1];
77
86
 
78
- const [open, setOpen] = useState(false);
79
- useEffect(() => {
87
+ useEffect(function () {
80
88
  if (defaultOpen) {
81
89
  setOpen(defaultOpen);
82
90
  }