@economic/taco 0.0.33-alpha.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (418) hide show
  1. package/README.md +84 -84
  2. package/dist/components/Hanger/Hanger.d.ts +3 -0
  3. package/dist/components/Icon/components/{Minus.d.ts → CircleClose.d.ts} +0 -0
  4. package/dist/components/Icon/components/{PlusCircle.d.ts → CircleMinus.d.ts} +0 -0
  5. package/dist/components/Icon/components/{TickCircle.d.ts → CirclePlus.d.ts} +0 -0
  6. package/dist/components/Icon/components/CircleTick.d.ts +3 -0
  7. package/dist/components/Icon/components/index.d.ts +1 -1
  8. package/dist/components/Input/Input.d.ts +1 -1
  9. package/dist/components/Menu/Menu.d.ts +2 -2
  10. package/dist/components/Menu/components/Item.d.ts +1 -1
  11. package/dist/components/Menu/components/Link.d.ts +1 -1
  12. package/dist/esm/components/Accordion/Accordion.js.map +1 -1
  13. package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
  14. package/dist/esm/components/Badge/Badge.js +1 -1
  15. package/dist/esm/components/Badge/Badge.js.map +1 -1
  16. package/dist/esm/components/Banner/Banner.js +6 -8
  17. package/dist/esm/components/Banner/Banner.js.map +1 -1
  18. package/dist/esm/components/Banner/util.js +5 -5
  19. package/dist/esm/components/Banner/util.js.map +1 -1
  20. package/dist/esm/components/Button/Button.js.map +1 -1
  21. package/dist/esm/components/Button/util.js +24 -19
  22. package/dist/esm/components/Button/util.js.map +1 -1
  23. package/dist/esm/components/Calendar/Calendar.js.map +1 -1
  24. package/dist/esm/components/Checkbox/Checkbox.js +21 -18
  25. package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
  26. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  27. package/dist/esm/components/Combobox/useCombobox.js +87 -67
  28. package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
  29. package/dist/esm/components/Datepicker/Datepicker.js +52 -50
  30. package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
  31. package/dist/esm/components/Datepicker/useDatepicker.js +34 -27
  32. package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
  33. package/dist/esm/components/Dialog/Context.js +4 -4
  34. package/dist/esm/components/Dialog/Context.js.map +1 -1
  35. package/dist/esm/components/Dialog/Dialog.js +58 -39
  36. package/dist/esm/components/Dialog/Dialog.js.map +1 -1
  37. package/dist/esm/components/Dialog/components/Content.js +44 -39
  38. package/dist/esm/components/Dialog/components/Content.js.map +1 -1
  39. package/dist/esm/components/Dialog/components/Drawer.js +3 -3
  40. package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
  41. package/dist/esm/components/Dialog/components/Extra.js +2 -2
  42. package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
  43. package/dist/esm/components/Dialog/components/Trigger.js +2 -2
  44. package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
  45. package/dist/esm/components/Field/Field.js +12 -10
  46. package/dist/esm/components/Field/Field.js.map +1 -1
  47. package/dist/esm/components/Form/Form.js +8 -6
  48. package/dist/esm/components/Form/Form.js.map +1 -1
  49. package/dist/esm/components/Group/Group.js +8 -6
  50. package/dist/esm/components/Group/Group.js.map +1 -1
  51. package/dist/esm/components/Hanger/Hanger.js +43 -27
  52. package/dist/esm/components/Hanger/Hanger.js.map +1 -1
  53. package/dist/esm/components/Icon/Icon.js +8 -7
  54. package/dist/esm/components/Icon/Icon.js.map +1 -1
  55. package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
  56. package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
  57. package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
  58. package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
  59. package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
  60. package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
  61. package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
  62. package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
  63. package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
  64. package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
  65. package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
  66. package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
  67. package/dist/esm/components/Icon/components/Attach.js.map +1 -1
  68. package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
  69. package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
  70. package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
  71. package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
  72. package/dist/esm/components/Icon/components/Basic.js.map +1 -1
  73. package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
  74. package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
  75. package/dist/esm/components/Icon/components/Book.js.map +1 -1
  76. package/dist/esm/components/Icon/components/Booking.js.map +1 -1
  77. package/dist/esm/components/Icon/components/Budget.js.map +1 -1
  78. package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
  79. package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
  80. package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
  81. package/dist/esm/components/Icon/components/Chat.js.map +1 -1
  82. package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
  83. package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
  84. package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
  85. package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
  86. package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
  87. package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  88. package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
  89. package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
  90. package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
  91. package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
  92. package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
  93. package/dist/esm/components/Icon/components/CircleClose.js +19 -0
  94. package/dist/esm/components/Icon/components/CircleClose.js.map +1 -0
  95. package/dist/esm/components/Icon/components/{Minus.js → CircleMinus.js} +4 -4
  96. package/dist/esm/components/Icon/components/CircleMinus.js.map +1 -0
  97. package/dist/esm/components/Icon/components/{PlusCircle.js → CirclePlus.js} +4 -4
  98. package/dist/esm/components/Icon/components/CirclePlus.js.map +1 -0
  99. package/dist/esm/components/Icon/components/{TickCircle.js → CircleTick.js} +4 -4
  100. package/dist/esm/components/Icon/components/CircleTick.js.map +1 -0
  101. package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
  102. package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
  103. package/dist/esm/components/Icon/components/Close.js.map +1 -1
  104. package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
  105. package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
  106. package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
  107. package/dist/esm/components/Icon/components/Copy.js.map +1 -1
  108. package/dist/esm/components/Icon/components/Courses.js.map +1 -1
  109. package/dist/esm/components/Icon/components/Credit.js.map +1 -1
  110. package/dist/esm/components/Icon/components/Delete.js.map +1 -1
  111. package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
  112. package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
  113. package/dist/esm/components/Icon/components/Developer.js.map +1 -1
  114. package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
  115. package/dist/esm/components/Icon/components/Document.js.map +1 -1
  116. package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
  117. package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  118. package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
  119. package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
  120. package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  121. package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
  122. package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
  123. package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
  124. package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
  125. package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  126. package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
  127. package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
  128. package/dist/esm/components/Icon/components/Download.js.map +1 -1
  129. package/dist/esm/components/Icon/components/Drag.js.map +1 -1
  130. package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
  131. package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
  132. package/dist/esm/components/Icon/components/Edit.js.map +1 -1
  133. package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  134. package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
  135. package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
  136. package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
  137. package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
  138. package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  139. package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  140. package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  141. package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  142. package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  143. package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  144. package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
  145. package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
  146. package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
  147. package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
  148. package/dist/esm/components/Icon/components/Export.js.map +1 -1
  149. package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
  150. package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
  151. package/dist/esm/components/Icon/components/Filter.js.map +1 -1
  152. package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
  153. package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
  154. package/dist/esm/components/Icon/components/Hash.js.map +1 -1
  155. package/dist/esm/components/Icon/components/Home.js.map +1 -1
  156. package/dist/esm/components/Icon/components/Images.js.map +1 -1
  157. package/dist/esm/components/Icon/components/Import.js.map +1 -1
  158. package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
  159. package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
  160. package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
  161. package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
  162. package/dist/esm/components/Icon/components/Info.js.map +1 -1
  163. package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
  164. package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
  165. package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
  166. package/dist/esm/components/Icon/components/Layout.js.map +1 -1
  167. package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
  168. package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
  169. package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
  170. package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
  171. package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
  172. package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  173. package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  174. package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  175. package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  176. package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  177. package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  178. package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  179. package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  180. package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
  181. package/dist/esm/components/Icon/components/Line.js.map +1 -1
  182. package/dist/esm/components/Icon/components/List.js.map +1 -1
  183. package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
  184. package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
  185. package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
  186. package/dist/esm/components/Icon/components/Log.js.map +1 -1
  187. package/dist/esm/components/Icon/components/Market.js.map +1 -1
  188. package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
  189. package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
  190. package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
  191. package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
  192. package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
  193. package/dist/esm/components/Icon/components/More.js.map +1 -1
  194. package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
  195. package/dist/esm/components/Icon/components/Move.js.map +1 -1
  196. package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
  197. package/dist/esm/components/Icon/components/Note.js.map +1 -1
  198. package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
  199. package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
  200. package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
  201. package/dist/esm/components/Icon/components/Period.js.map +1 -1
  202. package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
  203. package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
  204. package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
  205. package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
  206. package/dist/esm/components/Icon/components/Play.js.map +1 -1
  207. package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
  208. package/dist/esm/components/Icon/components/Print.js.map +1 -1
  209. package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
  210. package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
  211. package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
  212. package/dist/esm/components/Icon/components/Projects.js.map +1 -1
  213. package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
  214. package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
  215. package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  216. package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
  217. package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
  218. package/dist/esm/components/Icon/components/Report.js.map +1 -1
  219. package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
  220. package/dist/esm/components/Icon/components/Restore.js.map +1 -1
  221. package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
  222. package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
  223. package/dist/esm/components/Icon/components/Sales.js.map +1 -1
  224. package/dist/esm/components/Icon/components/Search.js.map +1 -1
  225. package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
  226. package/dist/esm/components/Icon/components/Secure.js.map +1 -1
  227. package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
  228. package/dist/esm/components/Icon/components/Settings.js.map +1 -1
  229. package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
  230. package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
  231. package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
  232. package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
  233. package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
  234. package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
  235. package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
  236. package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
  237. package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
  238. package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
  239. package/dist/esm/components/Icon/components/Star.js.map +1 -1
  240. package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
  241. package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
  242. package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
  243. package/dist/esm/components/Icon/components/Tag.js.map +1 -1
  244. package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
  245. package/dist/esm/components/Icon/components/Templates.js.map +1 -1
  246. package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
  247. package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
  248. package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
  249. package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
  250. package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
  251. package/dist/esm/components/Icon/components/Tick.js.map +1 -1
  252. package/dist/esm/components/Icon/components/Time.js.map +1 -1
  253. package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
  254. package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
  255. package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
  256. package/dist/esm/components/Icon/components/Undock.js.map +1 -1
  257. package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
  258. package/dist/esm/components/Icon/components/Warning.js.map +1 -1
  259. package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
  260. package/dist/esm/components/Icon/components/Website.js.map +1 -1
  261. package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
  262. package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
  263. package/dist/esm/components/Icon/components/index.js +12 -10
  264. package/dist/esm/components/Icon/components/index.js.map +1 -1
  265. package/dist/esm/components/IconButton/IconButton.js +11 -9
  266. package/dist/esm/components/IconButton/IconButton.js.map +1 -1
  267. package/dist/esm/components/Input/Input.js +25 -27
  268. package/dist/esm/components/Input/Input.js.map +1 -1
  269. package/dist/esm/components/Input/util.js +2 -2
  270. package/dist/esm/components/Input/util.js.map +1 -1
  271. package/dist/esm/components/Listbox/Listbox.js +25 -24
  272. package/dist/esm/components/Listbox/Listbox.js.map +1 -1
  273. package/dist/esm/components/Listbox/ScrollableList.js +83 -64
  274. package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
  275. package/dist/esm/components/Listbox/useListbox.js +60 -51
  276. package/dist/esm/components/Listbox/useListbox.js.map +1 -1
  277. package/dist/esm/components/Listbox/useMultiListbox.js +91 -64
  278. package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
  279. package/dist/esm/components/Listbox/useTypeahead.js +9 -10
  280. package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
  281. package/dist/esm/components/Listbox/util.js +85 -48
  282. package/dist/esm/components/Listbox/util.js.map +1 -1
  283. package/dist/esm/components/Menu/Context.js +2 -2
  284. package/dist/esm/components/Menu/Context.js.map +1 -1
  285. package/dist/esm/components/Menu/Menu.js +43 -20
  286. package/dist/esm/components/Menu/Menu.js.map +1 -1
  287. package/dist/esm/components/Menu/components/Checkbox.js +9 -8
  288. package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
  289. package/dist/esm/components/Menu/components/Content.js +13 -10
  290. package/dist/esm/components/Menu/components/Content.js.map +1 -1
  291. package/dist/esm/components/Menu/components/Header.js +4 -4
  292. package/dist/esm/components/Menu/components/Header.js.map +1 -1
  293. package/dist/esm/components/Menu/components/Item.js +35 -34
  294. package/dist/esm/components/Menu/components/Item.js.map +1 -1
  295. package/dist/esm/components/Menu/components/Link.js +11 -10
  296. package/dist/esm/components/Menu/components/Link.js.map +1 -1
  297. package/dist/esm/components/Menu/components/RadioGroup.js +18 -16
  298. package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
  299. package/dist/esm/components/Menu/components/Separator.js +4 -4
  300. package/dist/esm/components/Menu/components/Separator.js.map +1 -1
  301. package/dist/esm/components/Menu/components/Trigger.js +5 -5
  302. package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
  303. package/dist/esm/components/Navigation/Navigation.js +44 -35
  304. package/dist/esm/components/Navigation/Navigation.js.map +1 -1
  305. package/dist/esm/components/Pagination/PageNumbers.js +28 -23
  306. package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
  307. package/dist/esm/components/Pagination/Pagination.js +56 -39
  308. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  309. package/dist/esm/components/Pagination/usePagination.js +21 -7
  310. package/dist/esm/components/Pagination/usePagination.js.map +1 -1
  311. package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
  312. package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
  313. package/dist/esm/components/Popover/Popover.js +34 -29
  314. package/dist/esm/components/Popover/Popover.js.map +1 -1
  315. package/dist/esm/components/Popover/Primitives.js +8 -7
  316. package/dist/esm/components/Popover/Primitives.js.map +1 -1
  317. package/dist/esm/components/Progress/Progress.js +15 -11
  318. package/dist/esm/components/Progress/Progress.js.map +1 -1
  319. package/dist/esm/components/Provider/Provider.js +18 -13
  320. package/dist/esm/components/Provider/Provider.js.map +1 -1
  321. package/dist/esm/components/RadioGroup/RadioGroup.js +64 -52
  322. package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
  323. package/dist/esm/components/SearchInput/SearchInput.js +11 -10
  324. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  325. package/dist/esm/components/Select/Select.js +31 -30
  326. package/dist/esm/components/Select/Select.js.map +1 -1
  327. package/dist/esm/components/Select/useSelect.js +82 -64
  328. package/dist/esm/components/Select/useSelect.js.map +1 -1
  329. package/dist/esm/components/Spinner/Spinner.js +19 -12
  330. package/dist/esm/components/Spinner/Spinner.js.map +1 -1
  331. package/dist/esm/components/Switch/Switch.js +12 -11
  332. package/dist/esm/components/Switch/Switch.js.map +1 -1
  333. package/dist/esm/components/Table/components/BaseTable.js +30 -23
  334. package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
  335. package/dist/esm/components/Table/components/PaginatedTable.js +7 -3
  336. package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
  337. package/dist/esm/components/Table/components/Table.js +25 -18
  338. package/dist/esm/components/Table/components/Table.js.map +1 -1
  339. package/dist/esm/components/Table/components/WindowedTable.js +104 -88
  340. package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
  341. package/dist/esm/components/Table/hooks/plugins/useRowActions.js +146 -122
  342. package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
  343. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +61 -57
  344. package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
  345. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +36 -39
  346. package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  347. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +90 -80
  348. package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  349. package/dist/esm/components/Table/hooks/useRowCreation.js +64 -29
  350. package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
  351. package/dist/esm/components/Table/hooks/useTable.js +141 -119
  352. package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
  353. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +15 -12
  354. package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
  355. package/dist/esm/components/Table/util/renderColumn.js +10 -10
  356. package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
  357. package/dist/esm/components/Table/util/renderRow.js +46 -37
  358. package/dist/esm/components/Table/util/renderRow.js.map +1 -1
  359. package/dist/esm/components/Table/util/rowIndexPath.js +16 -14
  360. package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
  361. package/dist/esm/components/Table/util/sortTypes.js +31 -23
  362. package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
  363. package/dist/esm/components/Table/util.js +41 -29
  364. package/dist/esm/components/Table/util.js.map +1 -1
  365. package/dist/esm/components/Tabs/Tabs.js +27 -25
  366. package/dist/esm/components/Tabs/Tabs.js.map +1 -1
  367. package/dist/esm/components/Textarea/Textarea.js +9 -11
  368. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  369. package/dist/esm/components/Toast/Toast.js +21 -20
  370. package/dist/esm/components/Toast/Toast.js.map +1 -1
  371. package/dist/esm/components/Toast/Toaster.js +118 -88
  372. package/dist/esm/components/Toast/Toaster.js.map +1 -1
  373. package/dist/esm/components/Toast/util.js +2 -2
  374. package/dist/esm/components/Toast/util.js.map +1 -1
  375. package/dist/esm/components/Tooltip/Tooltip.js +9 -8
  376. package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
  377. package/dist/esm/components/Tour/Tour.js +50 -44
  378. package/dist/esm/components/Tour/Tour.js.map +1 -1
  379. package/dist/esm/components/Treeview/Treeview.js +36 -26
  380. package/dist/esm/components/Treeview/Treeview.js.map +1 -1
  381. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
  382. package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  383. package/dist/esm/index.css +661 -665
  384. package/dist/esm/index.js +2 -2
  385. package/dist/esm/primitives/Button.js +13 -9
  386. package/dist/esm/primitives/Button.js.map +1 -1
  387. package/dist/esm/utils/date.js.map +1 -1
  388. package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
  389. package/dist/esm/utils/hooks/useDraggable.js +18 -16
  390. package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
  391. package/dist/esm/utils/hooks/useDropTarget.js +10 -7
  392. package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
  393. package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
  394. package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
  395. package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
  396. package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
  397. package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
  398. package/dist/esm/utils/hooks/useTimer.js +17 -9
  399. package/dist/esm/utils/hooks/useTimer.js.map +1 -1
  400. package/dist/esm/utils/input.js +11 -7
  401. package/dist/esm/utils/input.js.map +1 -1
  402. package/dist/esm/utils/mergeRefs.js +2 -2
  403. package/dist/esm/utils/mergeRefs.js.map +1 -1
  404. package/dist/esm/utils/taillwind.js +2 -2
  405. package/dist/esm/utils/taillwind.js.map +1 -1
  406. package/dist/index.css +661 -665
  407. package/dist/taco.cjs.development.js +2746 -2236
  408. package/dist/taco.cjs.development.js.map +1 -1
  409. package/dist/taco.cjs.production.min.js +1 -1
  410. package/dist/taco.cjs.production.min.js.map +1 -1
  411. package/dist/utils/tailwind.d.ts +1 -1
  412. package/package.json +2 -2
  413. package/plugins/tailwindcss-aria-attributes.js +73 -73
  414. package/tailwind.config.js +297 -297
  415. package/types.json +420 -395
  416. package/dist/esm/components/Icon/components/Minus.js.map +0 -1
  417. package/dist/esm/components/Icon/components/PlusCircle.js.map +0 -1
  418. package/dist/esm/components/Icon/components/TickCircle.js.map +0 -1
@@ -1,19 +1,22 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, createElement, useEffect } from 'react';
2
3
  import cn from 'classnames';
3
4
  import { Icon as Icon$1 } from '../../Icon/Icon.js';
4
5
  import { useCurrentMenu } from '../Context.js';
5
6
  import { Item as Item$1 } from '@radix-ui/react-dropdown-menu';
6
7
 
7
- const Icon = ({
8
- name
9
- }) => createElement("span", {
10
- className: "absolute left-0 ml-1"
11
- }, createElement(Icon$1, {
12
- className: "-ml-px -mt-px !h-5 !w-5",
13
- name: name
14
- }));
8
+ var _excluded = ["dialog", "icon", "onClick", "shortcut"];
9
+ var Icon = function Icon(_ref) {
10
+ var name = _ref.name;
11
+ return createElement("span", {
12
+ className: "absolute left-0 ml-1"
13
+ }, createElement(Icon$1, {
14
+ className: "-ml-px -mt-px !h-5 !w-5",
15
+ name: name
16
+ }));
17
+ };
15
18
 
16
- const getAppearanceClasses = appearance => {
19
+ var getAppearanceClasses = function getAppearanceClasses(appearance) {
17
20
  switch (appearance) {
18
21
  case 'primary':
19
22
  return 'wcag-blue aria-disabled:text-blue-dark hover:wcag-blue-light focus:wcag-blue-light';
@@ -33,13 +36,12 @@ const getAppearanceClasses = appearance => {
33
36
  }
34
37
  };
35
38
 
36
- const useItemStyling = ({
37
- disabled,
38
- indented,
39
- className
40
- }) => {
41
- const menu = useCurrentMenu();
42
- useEffect(() => {
39
+ var useItemStyling = function useItemStyling(_ref2) {
40
+ var disabled = _ref2.disabled,
41
+ indented = _ref2.indented,
42
+ className = _ref2.className;
43
+ var menu = useCurrentMenu();
44
+ useEffect(function () {
43
45
  if (indented && !(menu !== null && menu !== void 0 && menu.indented)) {
44
46
  menu === null || menu === void 0 ? void 0 : menu.registerIndentation();
45
47
  }
@@ -51,9 +53,9 @@ const useItemStyling = ({
51
53
  'cursor-not-allowed': disabled
52
54
  }, className);
53
55
  };
54
- const Shortcut = props => {
55
- const menu = useCurrentMenu();
56
- let appearance;
56
+ var Shortcut = function Shortcut(props) {
57
+ var menu = useCurrentMenu();
58
+ var appearance;
57
59
 
58
60
  switch (menu === null || menu === void 0 ? void 0 : menu.appearance) {
59
61
  case 'primary':
@@ -78,37 +80,36 @@ const Shortcut = props => {
78
80
  break;
79
81
  }
80
82
 
81
- const className = cn('ml-auto pl-3', appearance);
83
+ var className = cn('ml-auto pl-3', appearance);
82
84
  return createElement("span", Object.assign({}, props, {
83
85
  className: className
84
86
  }));
85
87
  };
86
- const Item = /*#__PURE__*/forwardRef(function MenuItem(props, ref) {
88
+ var Item = /*#__PURE__*/forwardRef(function MenuItem(props, ref) {
87
89
  var _props$disabled;
88
90
 
89
- const {
90
- dialog,
91
- icon,
92
- onClick,
93
- shortcut,
94
- ...otherProps
95
- } = props;
96
- const className = useItemStyling({
91
+ var dialog = props.dialog,
92
+ icon = props.icon,
93
+ onClick = props.onClick,
94
+ shortcut = props.shortcut,
95
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
96
+
97
+ var className = useItemStyling({
97
98
  disabled: props.disabled,
98
99
  indented: !!icon,
99
100
  className: props.className
100
101
  });
101
- const disabled = (_props$disabled = props.disabled) !== null && _props$disabled !== void 0 ? _props$disabled : props['aria-disabled'];
102
- let handleClick; // radix has a bug that does not disable clicks when disabled is set on items
102
+ var disabled = (_props$disabled = props.disabled) !== null && _props$disabled !== void 0 ? _props$disabled : props['aria-disabled'];
103
+ var handleClick; // radix has a bug that does not disable clicks when disabled is set on items
103
104
 
104
105
  if (disabled) {
105
- handleClick = event => {
106
+ handleClick = function handleClick(event) {
106
107
  event.preventDefault();
107
108
  event.stopPropagation();
108
109
  };
109
110
  }
110
111
 
111
- const handleSelect = event => {
112
+ var handleSelect = function handleSelect(event) {
112
113
  if (onClick) {
113
114
  onClick(event);
114
115
  }
@@ -118,7 +119,7 @@ const Item = /*#__PURE__*/forwardRef(function MenuItem(props, ref) {
118
119
  }
119
120
  };
120
121
 
121
- let button = createElement(Item$1, Object.assign({}, otherProps, {
122
+ var button = createElement(Item$1, Object.assign({}, otherProps, {
122
123
  className: className,
123
124
  onClick: handleClick,
124
125
  onSelect: handleSelect,
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sources":["../../../../../src/components/Menu/components/Item.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\r\nimport cn from 'classnames';\r\nimport { IconName } from '../../Icon/Icon';\r\nimport { Icon as IconPrimitive } from '../../Icon/Icon';\r\nimport { useCurrentMenu } from '../Context';\r\nimport { Appearance } from '../../../types';\r\nimport { DialogProps } from '../../Dialog/Dialog';\r\n\r\nexport const Icon = ({ name }) => (\r\n <span className=\"absolute left-0 ml-1\">\r\n <IconPrimitive className=\"-ml-px -mt-px !h-5 !w-5\" name={name} />\r\n </span>\r\n);\r\n\r\nconst getAppearanceClasses = (appearance: Appearance | undefined) => {\r\n switch (appearance) {\r\n case 'primary':\r\n return 'wcag-blue aria-disabled:text-blue-dark hover:wcag-blue-light focus:wcag-blue-light';\r\n\r\n case 'danger':\r\n return 'wcag-red aria-disabled:text-red-dark hover:wcag-red-light focus:wcag-red-light';\r\n\r\n case 'ghost':\r\n return 'text-blue aria-disabled:text-grey hover:wcag-blue focus:wcag-blue';\r\n\r\n case 'discrete':\r\n return 'text-black aria-disabled:text-grey hover:wcag-blue-lightest focus:wcag-blue-lightest';\r\n\r\n case 'default':\r\n default:\r\n return 'wcag-grey-light aria-disabled:text-grey-darker hover:wcag-grey-dark focus:wcag-grey-dark';\r\n }\r\n};\r\n\r\nexport const useItemStyling = ({ disabled, indented, className }) => {\r\n const menu = useCurrentMenu();\r\n\r\n React.useEffect(() => {\r\n if (indented && !menu?.indented) {\r\n menu?.registerIndentation();\r\n }\r\n }, [indented]);\r\n\r\n return cn(\r\n 'flex items-center justify-start h-7 pr-1.5 relative rounded w-full focus:outline-none group',\r\n getAppearanceClasses(menu?.appearance),\r\n {\r\n 'pl-7': menu?.indented,\r\n 'pl-1.5': !menu?.indented,\r\n 'cursor-pointer': !disabled,\r\n 'cursor-not-allowed': disabled,\r\n },\r\n className\r\n );\r\n};\r\n\r\nexport const Shortcut = props => {\r\n const menu = useCurrentMenu();\r\n let appearance;\r\n\r\n switch (menu?.appearance) {\r\n case 'primary':\r\n appearance = 'text-blue-lightest group-focus:text-black';\r\n break;\r\n\r\n case 'danger':\r\n appearance = 'text-red-lightest group-focus:text-white';\r\n break;\r\n\r\n case 'ghost':\r\n appearance = 'text-blue-light group-focus:text-blue-lightest';\r\n break;\r\n\r\n case 'discrete':\r\n appearance = 'text-grey-darker group-focus:text-blue-light';\r\n break;\r\n\r\n case 'default':\r\n default:\r\n appearance = 'text-grey-darkest';\r\n break;\r\n }\r\n\r\n const className = cn('ml-auto pl-3', appearance);\r\n\r\n return <span {...props} className={className} />;\r\n};\r\n\r\nexport type MenuItemProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {\r\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\r\n disabled?: boolean;\r\n icon?: IconName;\r\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\r\n shortcut?: string;\r\n};\r\n\r\nexport const Item = React.forwardRef(function MenuItem(props: MenuItemProps, ref: React.Ref<HTMLDivElement>) {\r\n const { dialog, icon, onClick, shortcut, ...otherProps } = props;\r\n const className = useItemStyling({\r\n disabled: props.disabled,\r\n indented: !!icon,\r\n className: props.className,\r\n });\r\n\r\n const disabled = props.disabled ?? props['aria-disabled'];\r\n\r\n let handleClick;\r\n\r\n // radix has a bug that does not disable clicks when disabled is set on items\r\n if (disabled) {\r\n handleClick = event => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n };\r\n }\r\n\r\n const handleSelect = event => {\r\n if (onClick) {\r\n onClick(event);\r\n }\r\n\r\n if (props['aria-haspopup'] || typeof dialog === 'function') {\r\n event.preventDefault();\r\n }\r\n };\r\n\r\n let button = (\r\n <DropdownMenuPrimitive.Item {...otherProps} className={className} onClick={handleClick} onSelect={handleSelect} ref={ref}>\r\n {icon && <Icon name={icon} />}\r\n {props.children}\r\n {shortcut && <Shortcut>{shortcut}</Shortcut>}\r\n </DropdownMenuPrimitive.Item>\r\n );\r\n\r\n if (typeof dialog === 'function') {\r\n button = dialog({ trigger: button });\r\n }\r\n\r\n return button;\r\n});\r\n"],"names":["Icon","name","React","className","IconPrimitive","getAppearanceClasses","appearance","useItemStyling","disabled","indented","menu","useCurrentMenu","registerIndentation","cn","Shortcut","props","Item","MenuItem","ref","dialog","icon","onClick","shortcut","otherProps","handleClick","event","preventDefault","stopPropagation","handleSelect","button","DropdownMenuPrimitive","onSelect","children","trigger"],"mappings":";;;;;;MASaA,IAAI,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAChBC,aAAA,OAAA;AAAMC,EAAAA,SAAS,EAAC;CAAhB,EACID,aAAA,CAACE,MAAD;AAAeD,EAAA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K,CAACC,cAAN;AACH;AACJ,GARD;;AAUA,MAAIG,MAAM,GACN3B,aAAA,CAAC4B,MAAD,oBAAgCP;AAAYpB,IAAAA,SAAS,EAAEA;AAAWkB,IAAAA,OAAO,EAAEG;AAAaO,IAAAA,QAAQ,EAAEH;AAAcV,IAAAA,GAAG,EAAEA;IAArH,EACKE,IAAI,IAAIlB,aAAA,CAACF,IAAD;AAAMC,IAAAA,IAAI,EAAEmB;GAAZ,CADb,EAEKL,KAAK,CAACiB,QAFX,EAGKV,QAAQ,IAAIpB,aAAA,CAACY,QAAD,MAAA,EAAWQ,QAAX,CAHjB,CADJ;;AAQA,MAAI,OAAOH,MAAP,KAAkB,UAAtB,EAAkC;AAC9BU,IAAAA,MAAM,GAAGV,MAAM,CAAC;AAAEc,MAAAA,OAAO,EAAEJ;AAAX,KAAD,CAAf;AACH;;AAED,SAAOA,MAAP;AACH,CA3CmB;;;;"}
1
+ {"version":3,"file":"Item.js","sources":["../../../../../src/components/Menu/components/Item.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport cn from 'classnames';\nimport { IconName } from '../../Icon/Icon';\nimport { Icon as IconPrimitive } from '../../Icon/Icon';\nimport { useCurrentMenu } from '../Context';\nimport { Appearance } from '../../../types';\nimport { DialogProps } from '../../Dialog/Dialog';\n\nexport const Icon = ({ name }) => (\n <span className=\"absolute left-0 ml-1\">\n <IconPrimitive className=\"-ml-px -mt-px !h-5 !w-5\" name={name} />\n </span>\n);\n\nconst getAppearanceClasses = (appearance: Appearance | undefined) => {\n switch (appearance) {\n case 'primary':\n return 'wcag-blue aria-disabled:text-blue-dark hover:wcag-blue-light focus:wcag-blue-light';\n\n case 'danger':\n return 'wcag-red aria-disabled:text-red-dark hover:wcag-red-light focus:wcag-red-light';\n\n case 'ghost':\n return 'text-blue aria-disabled:text-grey hover:wcag-blue focus:wcag-blue';\n\n case 'discrete':\n return 'text-black aria-disabled:text-grey hover:wcag-blue-lightest focus:wcag-blue-lightest';\n\n case 'default':\n default:\n return 'wcag-grey-light aria-disabled:text-grey-darker hover:wcag-grey-dark focus:wcag-grey-dark';\n }\n};\n\nexport const useItemStyling = ({ disabled, indented, className }) => {\n const menu = useCurrentMenu();\n\n React.useEffect(() => {\n if (indented && !menu?.indented) {\n menu?.registerIndentation();\n }\n }, [indented]);\n\n return cn(\n 'flex items-center justify-start h-7 pr-1.5 relative rounded w-full focus:outline-none group',\n getAppearanceClasses(menu?.appearance),\n {\n 'pl-7': menu?.indented,\n 'pl-1.5': !menu?.indented,\n 'cursor-pointer': !disabled,\n 'cursor-not-allowed': disabled,\n },\n className\n );\n};\n\nexport const Shortcut = props => {\n const menu = useCurrentMenu();\n let appearance;\n\n switch (menu?.appearance) {\n case 'primary':\n appearance = 'text-blue-lightest group-focus:text-black';\n break;\n\n case 'danger':\n appearance = 'text-red-lightest group-focus:text-white';\n break;\n\n case 'ghost':\n appearance = 'text-blue-light group-focus:text-blue-lightest';\n break;\n\n case 'discrete':\n appearance = 'text-grey-darker group-focus:text-blue-light';\n break;\n\n case 'default':\n default:\n appearance = 'text-grey-darkest';\n break;\n }\n\n const className = cn('ml-auto pl-3', appearance);\n\n return <span {...props} className={className} />;\n};\n\nexport type MenuItemProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\n disabled?: boolean;\n icon?: IconName;\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n shortcut?: string;\n};\n\nexport const Item = React.forwardRef(function MenuItem(props: MenuItemProps, ref: React.Ref<HTMLDivElement>) {\n const { dialog, icon, onClick, shortcut, ...otherProps } = props;\n const className = useItemStyling({\n disabled: props.disabled,\n indented: !!icon,\n className: props.className,\n });\n\n const disabled = props.disabled ?? props['aria-disabled'];\n\n let handleClick;\n\n // radix has a bug that does not disable clicks when disabled is set on items\n if (disabled) {\n handleClick = event => {\n event.preventDefault();\n event.stopPropagation();\n };\n }\n\n const handleSelect = event => {\n if (onClick) {\n onClick(event);\n }\n\n if (props['aria-haspopup'] || typeof dialog === 'function') {\n event.preventDefault();\n }\n };\n\n let button = (\n <DropdownMenuPrimitive.Item {...otherProps} className={className} onClick={handleClick} onSelect={handleSelect} ref={ref}>\n {icon && <Icon name={icon} />}\n {props.children}\n {shortcut && <Shortcut>{shortcut}</Shortcut>}\n </DropdownMenuPrimitive.Item>\n );\n\n if (typeof dialog === 'function') {\n button = dialog({ trigger: button });\n }\n\n return button;\n});\n"],"names":["Icon","name","React","className","IconPrimitive","getAppearanceClasses","appearance","useItemStyling","disabled","indented","menu","useCurrentMenu","registerIndentation","cn","Shortcut","props","Item","MenuItem","ref","dialog","icon","onClick","shortcut","otherProps","handleClick","event","preventDefault","stopPropagation","handleSelect","button","DropdownMenuPrimitive","onSelect","children","trigger"],"mappings":";;;;;;;;IASaA,IAAI,GAAG,SAAPA,IAAO;AAAA,MAAGC,IAAH,QAAGA,IAAH;AAAA,SAChBC,aAAA,OAAA;AAAMC,IAAAA,SAAS,EAAC;GAAhB,EACID,aAAA,CAACE,MAAD;AAAeD,IAAAA,SAAS,EAAC;AAA0BF,IAAAA,IAAI,EAAEA;GAAzD,CADJ,CADgB;AAAA;;AAMpB,IAAMI,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AACzB,UAAQA,UAAR;AACI,SAAK,SAAL;AACI,aAAO,oFAAP;;AAEJ,SAAK,QAAL;AACI,aAAO,gFAAP;;AAEJ,SAAK,OAAL;AACI,aAAO,mEAAP;;AAEJ,SAAK,UAAL;AACI,aAAO,sFAAP;;AAEJ,SAAK,SAAL;AACA;AACI,aAAO,0FAAP;AAfR;AAiBH,CAlBD;;IAoBaC,cAAc,GAAG,SAAjBA,cAAiB;MAAGC,iBAAAA;MAAUC,iBAAAA;MAAUN,kBAAAA;AACjD,MAAMO,IAAI,GAAGC,cAAc,EAA3B;AAEAT,EAAAA,SAAA,CAAgB;AACZ,QAAIO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QAAD,MAAA,EAAWQ,QAAX,CAHjB,CADJ;;AAQA,MAAI,OAAOH,MAAP,KAAkB,UAAtB,EAAkC;AAC9BU,IAAAA,MAAM,GAAGV,MAAM,CAAC;AAAEc,MAAAA,OAAO,EAAEJ;AAAX,KAAD,CAAf;AACH;;AAED,SAAOA,MAAP;AACH,CA3CmB;;;;"}
@@ -1,23 +1,24 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { forwardRef, createElement } from 'react';
2
3
  import { useCurrentMenu } from '../Context.js';
3
4
  import { Item } from '@radix-ui/react-dropdown-menu';
4
5
  import { useItemStyling, Icon } from './Item.js';
5
6
 
6
- const Link = /*#__PURE__*/forwardRef(function MenuLink(props, ref) {
7
- const {
8
- href,
9
- icon,
10
- onClick,
11
- ...otherProps
12
- } = props;
13
- const menu = useCurrentMenu();
14
- const className = useItemStyling({
7
+ var _excluded = ["href", "icon", "onClick"];
8
+ var Link = /*#__PURE__*/forwardRef(function MenuLink(props, ref) {
9
+ var href = props.href,
10
+ icon = props.icon,
11
+ onClick = props.onClick,
12
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
13
+
14
+ var menu = useCurrentMenu();
15
+ var className = useItemStyling({
15
16
  disabled: props.disabled,
16
17
  indented: !!icon,
17
18
  className: props.className
18
19
  });
19
20
 
20
- const handleClick = event => {
21
+ var handleClick = function handleClick(event) {
21
22
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
22
23
  menu === null || menu === void 0 ? void 0 : menu.close();
23
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../../../src/components/Menu/components/Link.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\r\nimport { IconName } from '../../Icon/Icon';\r\nimport { Icon, useItemStyling } from './Item';\r\nimport { useCurrentMenu } from '../Context';\r\n\r\nexport type MenuLinkItemProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {\r\n disabled?: boolean;\r\n icon?: IconName;\r\n href: string;\r\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\r\n};\r\n\r\nexport const Link = React.forwardRef(function MenuLink(props: MenuLinkItemProps, ref: React.Ref<HTMLDivElement>) {\r\n const { href, icon, onClick, ...otherProps } = props;\r\n const menu = useCurrentMenu();\r\n\r\n const className = useItemStyling({\r\n disabled: props.disabled,\r\n indented: !!icon,\r\n className: props.className,\r\n });\r\n\r\n const handleClick: React.MouseEventHandler<HTMLDivElement> = event => {\r\n onClick?.(event);\r\n menu?.close();\r\n };\r\n\r\n return (\r\n <DropdownMenuPrimitive.Item {...otherProps} asChild className={className} ref={ref} onClick={handleClick}>\r\n <a href={href} target=\"_blank\">\r\n {icon && <Icon name={icon} />}\r\n {props.children}\r\n </a>\r\n </DropdownMenuPrimitive.Item>\r\n );\r\n});\r\n"],"names":["Link","React","MenuLink","props","ref","href","icon","onClick","otherProps","menu","useCurrentMenu","className","useItemStyling","disabled","indented","handleClick","event","close","DropdownMenuPrimitive","asChild","target","Icon","name","children"],"mappings":";;;;;MAaaA,IAAI,gBAAGC,UAAA,CAAiB,SAASC,QAAT,CAAkBC,KAAlB,EAA4CC,GAA5C;AACjC,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,OAAd;AAAuB,OAAGC;AAA1B,MAAyCL,KAA/C;AACA,QAAMM,IAAI,GAAGC,cAAc,EAA3B;AAEA,QAAMC,SAAS,GAAGC,cAAc,CAAC;AAC7BC,IAAAA,QAAQ,EAAEV,KAAK,CAACU,QADa;AAE7BC,IAAAA,QAAQ,EAAE,CAAC,CAACR,IAFiB;AAG7BK,IAAAA,SAAS,EAAER,KAAK,CAACQ;AAHY,GAAD,CAAhC;;AAMA,QAAMI,WAAW,GAA4CC,KAAK;AAC9DT,IAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAGS,KAAH,CAAP;AACAP,IAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEQ,KAAN;AACH,GAHD;;AAKA,SACIhB,aAAA,CAACiB,IAAD,oBAAgCV;AAAYW,IAAAA,OAAO;AAACR,IAAAA,SAAS,EAAEA;AAAWP,IAAAA,GAAG,EAAEA;AAAKG,IAAAA,OAAO,EAAEQ;IAA7F,EACId,aAAA,IAAA;AAAGI,IAAAA,IAAI,EAAEA;AAAMe,IAAAA,MAAM,EAAC;GAAtB,EACKd,IAAI,IAAIL,aAAA,CAACoB,IAAD;AAAMC,IAAAA,IAAI,EAAEhB;GAAZ,CADb,EAEKH,KAAK,CAACoB,QAFX,CADJ,CADJ;AAQH,CAvBmB;;;;"}
1
+ {"version":3,"file":"Link.js","sources":["../../../../../src/components/Menu/components/Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { IconName } from '../../Icon/Icon';\nimport { Icon, useItemStyling } from './Item';\nimport { useCurrentMenu } from '../Context';\n\nexport type MenuLinkItemProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {\n disabled?: boolean;\n icon?: IconName;\n href: string;\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n};\n\nexport const Link = React.forwardRef(function MenuLink(props: MenuLinkItemProps, ref: React.Ref<HTMLDivElement>) {\n const { href, icon, onClick, ...otherProps } = props;\n const menu = useCurrentMenu();\n\n const className = useItemStyling({\n disabled: props.disabled,\n indented: !!icon,\n className: props.className,\n });\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = event => {\n onClick?.(event);\n menu?.close();\n };\n\n return (\n <DropdownMenuPrimitive.Item {...otherProps} asChild className={className} ref={ref} onClick={handleClick}>\n <a href={href} target=\"_blank\">\n {icon && <Icon name={icon} />}\n {props.children}\n </a>\n </DropdownMenuPrimitive.Item>\n );\n});\n"],"names":["Link","React","MenuLink","props","ref","href","icon","onClick","otherProps","menu","useCurrentMenu","className","useItemStyling","disabled","indented","handleClick","event","close","DropdownMenuPrimitive","asChild","target","Icon","name","children"],"mappings":";;;;;;;IAaaA,IAAI,gBAAGC,UAAA,CAAiB,SAASC,QAAT,CAAkBC,KAAlB,EAA4CC,GAA5C;AACjC,MAAQC,IAAR,GAA+CF,KAA/C,CAAQE,IAAR;AAAA,MAAcC,IAAd,GAA+CH,KAA/C,CAAcG,IAAd;AAAA,MAAoBC,OAApB,GAA+CJ,KAA/C,CAAoBI,OAApB;AAAA,MAAgCC,UAAhC,iCAA+CL,KAA/C;;AACA,MAAMM,IAAI,GAAGC,cAAc,EAA3B;AAEA,MAAMC,SAAS,GAAGC,cAAc,CAAC;AAC7BC,IAAAA,QAAQ,EAAEV,KAAK,CAACU,QADa;AAE7BC,IAAAA,QAAQ,EAAE,CAAC,CAACR,IAFiB;AAG7BK,IAAAA,SAAS,EAAER,KAAK,CAACQ;AAHY,GAAD,CAAhC;;AAMA,MAAMI,WAAW,GAA4C,SAAvDA,WAAuD,CAAAC,KAAK;AAC9DT,IAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAGS,KAAH,CAAP;AACAP,IAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEQ,KAAN;AACH,GAHD;;AAKA,SACIhB,aAAA,CAACiB,IAAD,oBAAgCV;AAAYW,IAAAA,OAAO;AAACR,IAAAA,SAAS,EAAEA;AAAWP,IAAAA,GAAG,EAAEA;AAAKG,IAAAA,OAAO,EAAEQ;IAA7F,EACId,aAAA,IAAA;AAAGI,IAAAA,IAAI,EAAEA;AAAMe,IAAAA,MAAM,EAAC;GAAtB,EACKd,IAAI,IAAIL,aAAA,CAACoB,IAAD;AAAMC,IAAAA,IAAI,EAAEhB;GAAZ,CADb,EAEKH,KAAK,CAACoB,QAFX,CADJ,CADJ;AAQH,CAvBmB;;;;"}
@@ -1,18 +1,20 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { createElement, useContext, createContext } from 'react';
2
3
  import cn from 'classnames';
3
4
  import { RadioGroup as RadioGroup$1, RadioItem as RadioItem$1, ItemIndicator } from '@radix-ui/react-dropdown-menu';
4
5
  import { useItemStyling } from './Item.js';
5
6
  import { useRadioGroup, getRadioGroupItemValueAsString } from '../../RadioGroup/RadioGroup.js';
6
7
 
7
- const RadioItem = props => {
8
- const context = useContext(MenuRadioGroupContext);
9
- const {
10
- children,
11
- value,
12
- ...otherProps
13
- } = props;
14
- const disabled = context.disabled || props.disabled;
15
- const className = useItemStyling({
8
+ var _excluded = ["children", "value"];
9
+ var RadioItem = function RadioItem(props) {
10
+ var context = useContext(MenuRadioGroupContext);
11
+
12
+ var children = props.children,
13
+ value = props.value,
14
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
15
+
16
+ var disabled = context.disabled || props.disabled;
17
+ var className = useItemStyling({
16
18
  disabled: disabled,
17
19
  indented: true,
18
20
  className: props.className
@@ -27,15 +29,15 @@ const RadioItem = props => {
27
29
  className: "flex h-1.5 w-1.5 ml-1 rounded-full bg-current "
28
30
  })), children);
29
31
  };
30
- const MenuRadioGroupContext = /*#__PURE__*/createContext({
32
+ var MenuRadioGroupContext = /*#__PURE__*/createContext({
31
33
  disabled: false
32
34
  });
33
- const RadioGroup = props => {
34
- const {
35
- context,
36
- props: otherProps
37
- } = useRadioGroup(props);
38
- const className = cn('flex flex-col', props.className);
35
+ var RadioGroup = function RadioGroup(props) {
36
+ var _useRadioGroup = useRadioGroup(props),
37
+ context = _useRadioGroup.context,
38
+ otherProps = _useRadioGroup.props;
39
+
40
+ var className = cn('flex flex-col', props.className);
39
41
  return createElement(MenuRadioGroupContext.Provider, {
40
42
  value: context
41
43
  }, createElement(RadioGroup$1, Object.assign({}, otherProps, {
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../../../../src/components/Menu/components/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\r\nimport cn from 'classnames';\r\nimport { getRadioGroupItemValueAsString, RadioGroupItemProps, RadioGroupProps, useRadioGroup } from '../../RadioGroup/RadioGroup';\r\nimport { useItemStyling } from './Item';\r\n\r\nexport type MenuRadioGroupItemProps = RadioGroupItemProps<HTMLDivElement>;\r\n\r\nexport const RadioItem = (props: MenuRadioGroupItemProps) => {\r\n const context = React.useContext(MenuRadioGroupContext);\r\n const { children, value, ...otherProps } = props;\r\n const disabled = context.disabled || props.disabled;\r\n const className = useItemStyling({\r\n disabled: disabled,\r\n indented: true,\r\n className: props.className,\r\n });\r\n\r\n return (\r\n <DropdownMenuPrimitive.RadioItem\r\n {...otherProps}\r\n className={className}\r\n disabled={disabled}\r\n value={getRadioGroupItemValueAsString(value)}\r\n >\r\n <DropdownMenuPrimitive.ItemIndicator className=\"absolute left-0 ml-1.5\">\r\n <span className=\"flex h-1.5 w-1.5 ml-1 rounded-full bg-current \" />\r\n </DropdownMenuPrimitive.ItemIndicator>\r\n {children}\r\n </DropdownMenuPrimitive.RadioItem>\r\n );\r\n};\r\n\r\nconst MenuRadioGroupContext = React.createContext({ disabled: false });\r\n\r\nexport type MenuRadioGroupProps = RadioGroupProps;\r\n\r\nexport const RadioGroup = (props: MenuRadioGroupProps) => {\r\n const { context, props: otherProps } = useRadioGroup(props);\r\n const className = cn('flex flex-col', props.className);\r\n\r\n return (\r\n <MenuRadioGroupContext.Provider value={context}>\r\n <DropdownMenuPrimitive.RadioGroup {...otherProps} className={className} />\r\n </MenuRadioGroupContext.Provider>\r\n );\r\n};\r\nRadioGroup.Item = RadioItem;\r\n"],"names":["RadioItem","props","context","React","MenuRadioGroupContext","children","value","otherProps","disabled","className","useItemStyling","indented","DropdownMenuPrimitive","getRadioGroupItemValueAsString","RadioGroup","useRadioGroup","cn","Provider","Item"],"mappings":";;;;;;MAQaA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":"RadioGroup.js","sources":["../../../../../src/components/Menu/components/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport cn from 'classnames';\nimport { getRadioGroupItemValueAsString, RadioGroupItemProps, RadioGroupProps, useRadioGroup } from '../../RadioGroup/RadioGroup';\nimport { useItemStyling } from './Item';\n\nexport type MenuRadioGroupItemProps = RadioGroupItemProps<HTMLDivElement>;\n\nexport const RadioItem = (props: MenuRadioGroupItemProps) => {\n const context = React.useContext(MenuRadioGroupContext);\n const { children, value, ...otherProps } = props;\n const disabled = context.disabled || props.disabled;\n const className = useItemStyling({\n disabled: disabled,\n indented: true,\n className: props.className,\n });\n\n return (\n <DropdownMenuPrimitive.RadioItem\n {...otherProps}\n className={className}\n disabled={disabled}\n value={getRadioGroupItemValueAsString(value)}\n >\n <DropdownMenuPrimitive.ItemIndicator className=\"absolute left-0 ml-1.5\">\n <span className=\"flex h-1.5 w-1.5 ml-1 rounded-full bg-current \" />\n </DropdownMenuPrimitive.ItemIndicator>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n};\n\nconst MenuRadioGroupContext = React.createContext({ disabled: false });\n\nexport type MenuRadioGroupProps = RadioGroupProps;\n\nexport const RadioGroup = (props: MenuRadioGroupProps) => {\n const { context, props: otherProps } = useRadioGroup(props);\n const className = cn('flex flex-col', props.className);\n\n return (\n <MenuRadioGroupContext.Provider value={context}>\n <DropdownMenuPrimitive.RadioGroup {...otherProps} className={className} />\n </MenuRadioGroupContext.Provider>\n );\n};\nRadioGroup.Item = RadioItem;\n"],"names":["RadioItem","props","context","React","MenuRadioGroupContext","children","value","otherProps","disabled","className","useItemStyling","indented","DropdownMenuPrimitive","getRadioGroupItemValueAsString","RadioGroup","useRadioGroup","cn","Provider","Item"],"mappings":";;;;;;;;IAQaA,SAAS,GAAG,SAAZA,SAAY,CAACC,KAAD;AACrB,MAAMC,OAAO,GAAGC,UAAA,CAAiBC,qBAAjB,C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-3,7 +3,7 @@ import cn from 'classnames';
3
3
  import { useCurrentMenu } from '../Context.js';
4
4
  import { Separator as Separator$1 } from '@radix-ui/react-dropdown-menu';
5
5
 
6
- const getAppearanceClasses = appearance => {
6
+ var getAppearanceClasses = function getAppearanceClasses(appearance) {
7
7
  switch (appearance) {
8
8
  case 'primary':
9
9
  return 'bg-blue-lighe';
@@ -23,9 +23,9 @@ const getAppearanceClasses = appearance => {
23
23
  }
24
24
  };
25
25
 
26
- const Separator = () => {
27
- const menu = useCurrentMenu();
28
- const className = cn('h-px my-1', getAppearanceClasses(menu === null || menu === void 0 ? void 0 : menu.appearance));
26
+ var Separator = function Separator() {
27
+ var menu = useCurrentMenu();
28
+ var className = cn('h-px my-1', getAppearanceClasses(menu === null || menu === void 0 ? void 0 : menu.appearance));
29
29
  return createElement(Separator$1, {
30
30
  className: className
31
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.js","sources":["../../../../../src/components/Menu/components/Separator.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\r\nimport cn from 'classnames';\r\nimport { useCurrentMenu } from '../Context';\r\nimport { Appearance } from '../../../types';\r\n\r\nconst getAppearanceClasses = (appearance: Appearance | undefined) => {\r\n switch (appearance) {\r\n case 'primary':\r\n return 'bg-blue-lighe';\r\n\r\n case 'danger':\r\n return 'bg-red-light';\r\n\r\n case 'ghost':\r\n return 'bg-blue-light';\r\n\r\n case 'discrete':\r\n return 'bg-grey-dark';\r\n\r\n case 'default':\r\n default:\r\n return 'bg-grey-dark';\r\n }\r\n};\r\n\r\nexport const Separator = () => {\r\n const menu = useCurrentMenu();\r\n const className = cn('h-px my-1', getAppearanceClasses(menu?.appearance));\r\n\r\n return <DropdownMenuPrimitive.Separator className={className} />;\r\n};\r\n"],"names":["getAppearanceClasses","appearance","Separator","menu","useCurrentMenu","className","cn","React","DropdownMenuPrimitive"],"mappings":";;;;;AAMA,MAAMA,oBAAoB,GAAIC,UAAD;AACzB,UAAQA,UAAR;AACI,SAAK,SAAL;AACI,aAAO,eAAP;;AAEJ,SAAK,QAAL;AACI,aAAO,cAAP;;AAEJ,SAAK,OAAL;AACI,aAAO,eAAP;;AAEJ,SAAK,UAAL;AACI,aAAO,cAAP;;AAEJ,SAAK,SAAL;AACA;AACI,aAAO,cAAP;AAfR;AAiBH,CAlBD;;MAoBaC,SAAS,GAAG;AACrB,QAAMC,IAAI,GAAGC,cAAc,EAA3B;AACA,QAAMC,SAAS,GAAGC,EAAE,CAAC,YAAD,EAAeN,oBAAoB,CAACG,IAAD,aAACA,IAAD,uBAACA,IAAI,CAAEF,UAAP,CAAnC,CAApB;AAEA,SAAOM,aAAA,CAACC,WAAD;AAAiCH,IAAAA,SAAS,EAAEA;GAA5C,CAAP;AACH;;;;"}
1
+ {"version":3,"file":"Separator.js","sources":["../../../../../src/components/Menu/components/Separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport cn from 'classnames';\nimport { useCurrentMenu } from '../Context';\nimport { Appearance } from '../../../types';\n\nconst getAppearanceClasses = (appearance: Appearance | undefined) => {\n switch (appearance) {\n case 'primary':\n return 'bg-blue-lighe';\n\n case 'danger':\n return 'bg-red-light';\n\n case 'ghost':\n return 'bg-blue-light';\n\n case 'discrete':\n return 'bg-grey-dark';\n\n case 'default':\n default:\n return 'bg-grey-dark';\n }\n};\n\nexport const Separator = () => {\n const menu = useCurrentMenu();\n const className = cn('h-px my-1', getAppearanceClasses(menu?.appearance));\n\n return <DropdownMenuPrimitive.Separator className={className} />;\n};\n"],"names":["getAppearanceClasses","appearance","Separator","menu","useCurrentMenu","className","cn","React","DropdownMenuPrimitive"],"mappings":";;;;;AAMA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AACzB,UAAQA,UAAR;AACI,SAAK,SAAL;AACI,aAAO,eAAP;;AAEJ,SAAK,QAAL;AACI,aAAO,cAAP;;AAEJ,SAAK,OAAL;AACI,aAAO,eAAP;;AAEJ,SAAK,UAAL;AACI,aAAO,cAAP;;AAEJ,SAAK,SAAL;AACA;AACI,aAAO,cAAP;AAfR;AAiBH,CAlBD;;IAoBaC,SAAS,GAAG,SAAZA,SAAY;AACrB,MAAMC,IAAI,GAAGC,cAAc,EAA3B;AACA,MAAMC,SAAS,GAAGC,EAAE,CAAC,YAAD,EAAeN,oBAAoB,CAACG,IAAD,aAACA,IAAD,uBAACA,IAAI,CAAEF,UAAP,CAAnC,CAApB;AAEA,SAAOM,aAAA,CAACC,WAAD;AAAiCH,IAAAA,SAAS,EAAEA;GAA5C,CAAP;AACH;;;;"}
@@ -3,18 +3,18 @@ import { useProxiedRef } from '../../../utils/hooks/useProxiedRef.js';
3
3
  import { useCurrentMenu } from '../Context.js';
4
4
  import { Trigger as Trigger$1 } from '@radix-ui/react-dropdown-menu';
5
5
 
6
- const Trigger = /*#__PURE__*/forwardRef(function MenuTrigger(props, ref) {
6
+ var Trigger = /*#__PURE__*/forwardRef(function MenuTrigger(props, ref) {
7
7
  var _props$children3, _props$children3$prop;
8
8
 
9
- const menu = useCurrentMenu();
10
- const internalRef = useProxiedRef(ref);
11
- useEffect(() => {
9
+ var menu = useCurrentMenu();
10
+ var internalRef = useProxiedRef(ref);
11
+ useEffect(function () {
12
12
  if (internalRef.current) {
13
13
  menu === null || menu === void 0 ? void 0 : menu.setMinWidth(internalRef.current.getBoundingClientRect().width);
14
14
  }
15
15
  }, [internalRef]); // set the appearance based on the trigger button
16
16
 
17
- useEffect(() => {
17
+ useEffect(function () {
18
18
  var _props$children, _props$children$props;
19
19
 
20
20
  if ((_props$children = props.children) !== null && _props$children !== void 0 && (_props$children$props = _props$children.props) !== null && _props$children$props !== void 0 && _props$children$props.appearance) {
@@ -1 +1 @@
1
- {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/Menu/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\r\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\r\nimport { useCurrentMenu } from '../Context';\r\n\r\nexport type MenuTriggerProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'children'> & {\r\n children: React.ReactElement;\r\n};\r\n\r\nexport const Trigger = React.forwardRef(function MenuTrigger(props: MenuTriggerProps, ref: React.Ref<HTMLButtonElement>) {\r\n const menu = useCurrentMenu();\r\n const internalRef = useProxiedRef<HTMLButtonElement>(ref);\r\n\r\n React.useEffect(() => {\r\n if (internalRef.current) {\r\n menu?.setMinWidth(internalRef.current.getBoundingClientRect().width);\r\n }\r\n }, [internalRef]);\r\n\r\n // set the appearance based on the trigger button\r\n React.useEffect(() => {\r\n if (props.children?.props?.appearance) {\r\n menu?.setAppearance(props.children?.props?.appearance);\r\n }\r\n }, [props.children?.props?.appearance]);\r\n\r\n return <DropdownMenuPrimitive.Trigger {...props} asChild ref={internalRef} />;\r\n});\r\n"],"names":["Trigger","React","MenuTrigger","props","ref","menu","useCurrentMenu","internalRef","useProxiedRef","current","setMinWidth","getBoundingClientRect","width","children","appearance","setAppearance","DropdownMenuPrimitive","asChild"],"mappings":";;;;;MASaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;;;AACpC,QAAMC,IAAI,GAAGC,cAAc,EAA3B;AACA,QAAMC,WAAW,GAAGC,aAAa,CAAoBJ,GAApB,CAAjC;AAEAH,EAAAA,SAAA,CAAgB;AACZ,QAAIM,WAAW,CAACE,OAAhB,EAAyB;AACrBJ,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEK,WAAN,CAAkBH,WAAW,CAACE,OAAZ,CAAoBE,qBAApB,GAA4CC,KAA9D;AACH;AACJ,GAJD,EAIG,CAACL,WAAD,CAJH;;AAOAN,EAAAA,SAAA,CAAgB;;;AACZ,2BAAIE,KAAK,CAACU,QAAV,qEAAI,gBAAgBV,KAApB,kDAAI,sBAAuBW,UAA3B,EAAuC;AAAA;;AACnCT,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEU,aAAN,qBAAoBZ,KAAK,CAACU,QAA1B,8EAAoB,iBAAgBV,KAApC,0DAAoB,sBAAuBW,UAA3C;AACH;AACJ,GAJD,EAIG,qBAACX,KAAK,CAACU,QAAP,8EAAC,iBAAgBV,KAAjB,0DAAC,sBAAuBW,UAAxB,CAJH;AAMA,SAAOb,aAAA,CAACe,SAAD,oBAAmCb;AAAOc,IAAAA,OAAO;AAACb,IAAAA,GAAG,EAAEG;IAAvD,CAAP;AACH,CAlBsB;;;;"}
1
+ {"version":3,"file":"Trigger.js","sources":["../../../../../src/components/Menu/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { useProxiedRef } from '../../../utils/hooks/useProxiedRef';\nimport { useCurrentMenu } from '../Context';\n\nexport type MenuTriggerProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'children'> & {\n children: React.ReactElement;\n};\n\nexport const Trigger = React.forwardRef(function MenuTrigger(props: MenuTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const menu = useCurrentMenu();\n const internalRef = useProxiedRef<HTMLButtonElement>(ref);\n\n React.useEffect(() => {\n if (internalRef.current) {\n menu?.setMinWidth(internalRef.current.getBoundingClientRect().width);\n }\n }, [internalRef]);\n\n // set the appearance based on the trigger button\n React.useEffect(() => {\n if (props.children?.props?.appearance) {\n menu?.setAppearance(props.children?.props?.appearance);\n }\n }, [props.children?.props?.appearance]);\n\n return <DropdownMenuPrimitive.Trigger {...props} asChild ref={internalRef} />;\n});\n"],"names":["Trigger","React","MenuTrigger","props","ref","menu","useCurrentMenu","internalRef","useProxiedRef","current","setMinWidth","getBoundingClientRect","width","children","appearance","setAppearance","DropdownMenuPrimitive","asChild"],"mappings":";;;;;IASaA,OAAO,gBAAGC,UAAA,CAAiB,SAASC,WAAT,CAAqBC,KAArB,EAA8CC,GAA9C;;;AACpC,MAAMC,IAAI,GAAGC,cAAc,EAA3B;AACA,MAAMC,WAAW,GAAGC,aAAa,CAAoBJ,GAApB,CAAjC;AAEAH,EAAAA,SAAA,CAAgB;AACZ,QAAIM,WAAW,CAACE,OAAhB,EAAyB;AACrBJ,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEK,WAAN,CAAkBH,WAAW,CAACE,OAAZ,CAAoBE,qBAApB,GAA4CC,KAA9D;AACH;AACJ,GAJD,EAIG,CAACL,WAAD,CAJH;;AAOAN,EAAAA,SAAA,CAAgB;;;AACZ,2BAAIE,KAAK,CAACU,QAAV,qEAAI,gBAAgBV,KAApB,kDAAI,sBAAuBW,UAA3B,EAAuC;AAAA;;AACnCT,MAAAA,IAAI,SAAJ,IAAAA,IAAI,WAAJ,YAAAA,IAAI,CAAEU,aAAN,qBAAoBZ,KAAK,CAACU,QAA1B,8EAAoB,iBAAgBV,KAApC,0DAAoB,sBAAuBW,UAA3C;AACH;AACJ,GAJD,EAIG,qBAACX,KAAK,CAACU,QAAP,8EAAC,iBAAgBV,KAAjB,0DAAC,sBAAuBW,UAAxB,CAJH;AAMA,SAAOb,aAAA,CAACe,SAAD,oBAAmCb;AAAOc,IAAAA,OAAO;AAACb,IAAAA,GAAG,EAAEG;IAAvD,CAAP;AACH,CAlBsB;;;;"}
@@ -1,3 +1,4 @@
1
+ import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import React__default from 'react';
2
3
  import cn from 'classnames';
3
4
  import { Icon } from '../Icon/Icon.js';
@@ -5,20 +6,25 @@ import { useProxiedRef } from '../../utils/hooks/useProxiedRef.js';
5
6
  import { Treeview } from '../Treeview/Treeview.js';
6
7
  import { useDropTarget } from '../../utils/hooks/useDropTarget.js';
7
8
 
8
- const Item = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
9
- const {
10
- active,
11
- children,
12
- onDrop,
13
- postfix,
14
- prefix,
15
- role,
16
- ...otherProps
17
- } = props;
18
- const proxyRef = useProxiedRef(ref);
19
- const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);
20
- const isTreeitem = role === 'treeitem';
21
- const className = cn('yt-navigation__item cursor-pointer', {
9
+ var _excluded = ["active", "children", "onDrop", "postfix", "prefix", "role"],
10
+ _excluded2 = ["children"];
11
+ var Item = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
12
+ var active = props.active,
13
+ children = props.children,
14
+ onDrop = props.onDrop,
15
+ postfix = props.postfix,
16
+ prefix = props.prefix,
17
+ role = props.role,
18
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
19
+
20
+ var proxyRef = useProxiedRef(ref);
21
+
22
+ var _useDropTarget = useDropTarget(onDrop),
23
+ isDraggedOver = _useDropTarget[0],
24
+ dropTargetProps = _useDropTarget[1];
25
+
26
+ var isTreeitem = role === 'treeitem';
27
+ var className = cn('yt-navigation__item cursor-pointer', {
22
28
  'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,
23
29
  'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,
24
30
  'yt-navigation__item--active': active && !isDraggedOver,
@@ -26,7 +32,7 @@ const Item = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
26
32
  'yt-navigation__item--dropping bg-blue': isDraggedOver
27
33
  }, props.className);
28
34
 
29
- const handleClick = event => {
35
+ var handleClick = function handleClick(event) {
30
36
  if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {
31
37
  return;
32
38
  }
@@ -49,19 +55,19 @@ const Item = /*#__PURE__*/React__default.forwardRef(function Item(props, ref) {
49
55
  className: "yt-navigation__item__postfix ml-1"
50
56
  }, postfix));
51
57
  });
52
- const Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
58
+ var Panel = /*#__PURE__*/React__default.forwardRef(function Panel(props, ref) {
53
59
  return React__default.createElement("div", Object.assign({}, props, {
54
60
  className: cn('w-full bg-white p-3', props.className),
55
61
  ref: ref
56
62
  }));
57
63
  });
58
- const MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props, ref) {
59
- const className = cn('flex-shrink-0 space-y-1 outline-none', {
64
+ var MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(props, ref) {
65
+ var className = cn('flex-shrink-0 space-y-1 outline-none', {
60
66
  'bg-white pb-2': props.fixed
61
67
  }, props.className);
62
68
 
63
- const title = expanded => {
64
- const className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {
69
+ var title = function title(expanded) {
70
+ var className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {
65
71
  'mb-1': expanded,
66
72
  'cursor-pointer hover:text-blue': !props.fixed
67
73
  });
@@ -78,14 +84,16 @@ const MenuGroup = /*#__PURE__*/React__default.forwardRef(function MenuGroup(prop
78
84
  ref: ref
79
85
  }));
80
86
  });
81
- const Menu = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
82
- const scrollableAreas = React__default.useMemo(() => {
83
- const scrollableAreas = [];
84
- React__default.Children.toArray(props.children).filter(child => !!child).map(child => {
87
+ var Menu = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
88
+ var scrollableAreas = React__default.useMemo(function () {
89
+ var scrollableAreas = [];
90
+ React__default.Children.toArray(props.children).filter(function (child) {
91
+ return !!child;
92
+ }).map(function (child) {
85
93
  if (child.props.fixed) {
86
94
  scrollableAreas.push(child);
87
95
  } else {
88
- const x = scrollableAreas[scrollableAreas.length - 1];
96
+ var x = scrollableAreas[scrollableAreas.length - 1];
89
97
 
90
98
  if (Array.isArray(x)) {
91
99
  x.push(child);
@@ -99,18 +107,19 @@ const Menu = /*#__PURE__*/React__default.forwardRef(function Menu(props, ref) {
99
107
  return React__default.createElement(Treeview, Object.assign({}, props, {
100
108
  className: cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className),
101
109
  ref: ref
102
- }), scrollableAreas.map((area, i) => Array.isArray(area) ? React__default.createElement("div", {
103
- className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
104
- key: i
105
- }, area) : area));
110
+ }), scrollableAreas.map(function (area, i) {
111
+ return Array.isArray(area) ? React__default.createElement("div", {
112
+ className: "divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto",
113
+ key: i
114
+ }, area) : area;
115
+ }));
106
116
  });
107
117
  Menu.Group = MenuGroup;
108
- const Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
109
- const {
110
- children,
111
- ...otherProps
112
- } = props;
113
- const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
118
+ var Navigation = /*#__PURE__*/React__default.forwardRef(function Navigation(props, ref) {
119
+ var children = props.children,
120
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
121
+
122
+ var className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);
114
123
  return React__default.createElement("div", Object.assign({}, otherProps, {
115
124
  className: className,
116
125
  "data-taco": "navigation",
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.js","sources":["../../../../src/components/Navigation/Navigation.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport { TreeviewProps, Treeview, TreeviewGroupProps, TreeviewItemProps } from '../Treeview/Treeview';\r\nimport { Icon } from '../Icon/Icon';\r\nimport { useDropTarget } from '../../utils/hooks/useDropTarget';\r\nimport './Navigation.css';\r\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\r\n\r\n// Item\r\nexport type NavigationItemProps = Omit<TreeviewItemProps, 'prefix'> & {\r\n /** Change the style to indicate the link is selected */\r\n active?: boolean;\r\n /** Handler to be used when dropping a dragged element over the navigation link */\r\n onDrop?: React.DragEventHandler;\r\n /**\r\n * Small amount of information placed next to the text of the link.\r\n * This can be any valid react element, for e.g. a `span`.\r\n * Should be used to indicate a relevant information of the link,\r\n * for e.g. the number of unread notifications\r\n */\r\n postfix?: React.ReactNode;\r\n /**\r\n * Small amount of information placed before the text of the link.\r\n * This can be any valid react element, for e.g. a `span`.\r\n * Should be used to indicate a feedback for user,\r\n * for e.g. display some sort of visual informational state or a relevant icon.\r\n */\r\n prefix?: React.ReactNode;\r\n /** Target of the link */\r\n target?: string;\r\n};\r\n\r\nconst Item = React.forwardRef(function Item(props: NavigationItemProps, ref: React.Ref<HTMLAnchorElement>) {\r\n const { active, children, onDrop, postfix, prefix, role, ...otherProps } = props;\r\n const proxyRef = useProxiedRef<HTMLAnchorElement>(ref);\r\n const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);\r\n const isTreeitem = role === 'treeitem';\r\n const className = cn(\r\n 'yt-navigation__item cursor-pointer',\r\n {\r\n 'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,\r\n 'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,\r\n 'yt-navigation__item--active': active && !isDraggedOver,\r\n 'bg-grey-dark': isTreeitem && active && !isDraggedOver,\r\n 'yt-navigation__item--dropping bg-blue': isDraggedOver,\r\n },\r\n props.className\r\n );\r\n\r\n const handleClick = (event: React.MouseEvent<HTMLSpanElement>): void => {\r\n if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {\r\n return;\r\n }\r\n\r\n if (proxyRef.current) {\r\n proxyRef.current.click();\r\n }\r\n };\r\n\r\n return (\r\n <span {...dropTargetProps} className={className} onClick={handleClick} role={role}>\r\n {prefix && <span className=\"yt-navigation__item__prefix flex items-center\">{prefix}</span>}\r\n <a {...otherProps} className=\"block flex-grow truncate\" ref={proxyRef}>\r\n {children}\r\n </a>\r\n {postfix && <span className=\"yt-navigation__item__postfix ml-1\">{postfix}</span>}\r\n </span>\r\n );\r\n});\r\n\r\n// Panel\r\nexport type NavigationPanelProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nconst Panel = React.forwardRef(function Panel(props: NavigationPanelProps, ref: React.Ref<HTMLDivElement>) {\r\n return <div {...props} className={cn('w-full bg-white p-3', props.className)} ref={ref} />;\r\n});\r\n\r\n// Group\r\nexport type NavigationMenuGroupProps = TreeviewGroupProps;\r\n\r\nconst MenuGroup = React.forwardRef(function MenuGroup(props: NavigationMenuGroupProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn(\r\n 'flex-shrink-0 space-y-1 outline-none',\r\n {\r\n 'bg-white pb-2': props.fixed,\r\n },\r\n props.className\r\n );\r\n const title = (expanded: boolean): JSX.Element => {\r\n const className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {\r\n 'mb-1': expanded,\r\n 'cursor-pointer hover:text-blue': !props.fixed,\r\n });\r\n\r\n return (\r\n <span className={className}>\r\n {typeof props.title === 'function' ? props.title(expanded) : props.title}\r\n {!props.fixed && <Icon name={expanded ? 'chevron-up' : 'chevron-down'} />}\r\n </span>\r\n );\r\n };\r\n\r\n return <Treeview.Group {...props} className={className} title={title} ref={ref} />;\r\n});\r\n\r\n// Menu\r\nexport type NavigationMenuProps = React.PropsWithChildren<TreeviewProps>;\r\n\r\nexport type ForwardedNavigationMenuWithStatics = React.ForwardRefExoticComponent<\r\n NavigationMenuProps & React.RefAttributes<HTMLDivElement>\r\n> & {\r\n /** Expandable region reprezenting a group of related links */\r\n Group: React.ForwardRefExoticComponent<NavigationMenuGroupProps & React.RefAttributes<HTMLDivElement>>;\r\n};\r\n\r\nconst Menu = React.forwardRef(function Menu(props: NavigationMenuProps, ref: React.Ref<HTMLDivElement>) {\r\n const scrollableAreas = React.useMemo(() => {\r\n const scrollableAreas: any[] = [];\r\n\r\n React.Children.toArray(props.children)\r\n .filter(child => !!child)\r\n .map((child: React.ReactElement<NavigationMenuGroupProps>) => {\r\n if (child.props.fixed) {\r\n scrollableAreas.push(child);\r\n } else {\r\n const x = scrollableAreas[scrollableAreas.length - 1];\r\n if (Array.isArray(x)) {\r\n x.push(child);\r\n } else {\r\n scrollableAreas.push([child]);\r\n }\r\n }\r\n });\r\n\r\n return scrollableAreas;\r\n }, [props.children]);\r\n\r\n return (\r\n <Treeview\r\n {...props}\r\n className={cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className)}\r\n ref={ref}\r\n >\r\n {scrollableAreas.map((area, i) =>\r\n Array.isArray(area) ? (\r\n <div\r\n className=\"divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto\"\r\n key={i}\r\n >\r\n {area}\r\n </div>\r\n ) : (\r\n area\r\n )\r\n )}\r\n </Treeview>\r\n );\r\n}) as ForwardedNavigationMenuWithStatics;\r\n\r\nMenu.Group = MenuGroup;\r\n\r\n// Navigation\r\nexport type NavigationProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nexport type ForwardedNavigationWithStatics = React.ForwardRefExoticComponent<\r\n NavigationProps & React.RefAttributes<HTMLDivElement>\r\n> & {\r\n /** Navigation link */\r\n Item: React.ForwardRefExoticComponent<NavigationItemProps & React.RefAttributes<HTMLAnchorElement>>;\r\n /**\r\n * Container for the expandable groups that hold navigation links.\r\n * Should be used as a direct child of Navigation component, e.g. `Navigation.Menu`.\r\n * Should have the menu groups as a direct child, e.g. `Navigation.Menu.Group`\r\n */\r\n Menu: ForwardedNavigationMenuWithStatics;\r\n /**\r\n * Isolated container within the Navigation.\r\n * This can be used to create a region in the Navigation that is usually not scrollable, nor expandable,\r\n * containing useful information for user and quick actions\r\n */\r\n Panel: React.ForwardRefExoticComponent<NavigationPanelProps & React.RefAttributes<HTMLDivElement>>;\r\n};\r\n\r\nexport const Navigation = React.forwardRef(function Navigation(props: NavigationProps, ref: React.Ref<HTMLDivElement>) {\r\n const { children, ...otherProps } = props;\r\n const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);\r\n\r\n return (\r\n <div {...otherProps} className={className} data-taco=\"navigation\" ref={ref}>\r\n {children}\r\n </div>\r\n );\r\n}) as ForwardedNavigationWithStatics;\r\n\r\nNavigation.Menu = Menu;\r\nNavigation.Item = Item;\r\nNavigation.Panel = Panel;\r\n"],"names":["Item","React","forwardRef","props","ref","active","children","onDrop","postfix","prefix","role","otherProps","proxyRef","useProxiedRef","isDraggedOver","dropTargetProps","useDropTarget","isTreeitem","className","cn","handleClick","event","target","HTMLAnchorElement","HTMLButtonElement","current","click","onClick","Panel","MenuGroup","fixed","title","expanded","Icon","name","Treeview","Group","Menu","scrollableAreas","useMemo","Children","toArray","filter","child","map","push","x","length","Array","isArray","area","i","key","Navigation"],"mappings":";;;;;;;AAgCA,MAAMA,IAAI,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,IAAT,CAAcG,KAAd,EAA0CC,GAA1C;AAC1B,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,QAAV;AAAoBC,IAAAA,MAApB;AAA4BC,IAAAA,OAA5B;AAAqCC,IAAAA,MAArC;AAA6CC,IAAAA,IAA7C;AAAmD,OAAGC;AAAtD,MAAqER,KAA3E;AACA,QAAMS,QAAQ,GAAGC,aAAa,CAAoBT,GAApB,CAA9B;AACA,QAAM,CAACU,aAAD,EAAgBC,eAAhB,IAAmCC,aAAa,CAACT,MAAD,CAAtD;AACA,QAAMU,UAAU,GAAGP,IAAI,KAAK,UAA5B;AACA,QAAMQ,SAAS,GAAGC,EAAE,CAChB,oCADgB,EAEhB;AACI,mEAA+DF,UADnE;AAEI,gGAA4F,CAACA,UAFjG;AAGI,mCAA+BZ,MAAM,IAAI,CAACS,aAH9C;AAII,oBAAgBG,UAAU,IAAIZ,MAAd,IAAwB,CAACS,aAJ7C;AAKI,6CAAyCA;AAL7C,GAFgB,EAShBX,KAAK,CAACe,SATU,CAApB;;AAYA,QAAME,WAAW,GAAIC,KAAD;AAChB,QAAIA,KAAK,CAACC,MAAN,YAAwB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AAAA,eAAe,CAACO,IAAhB,CAAqB,CAACF,KAAD,CAArB;AACH;AACJ;AACJ,KAbL;AAeA,WAAOL,eAAP;AACH,GAnBuB,EAmBrB,CAACnC,KAAK,CAACG,QAAP,CAnBqB,CAAxB;AAqBA,SACIL,4BAAA,CAACkC,QAAD,oBACQhC;AACJe,IAAAA,SAAS,EAAEC,EAAE,CAAC,sEAAD,EAAyEhB,KAAK,CAACe,SAA/E;AACbd,IAAAA,GAAG,EAAEA;IAHT,EAKKkC,eAAe,CAACM,GAAhB,CAAoB,CAACM,IAAD,EAAOC,CAAP,KACjBH,KAAK,CAACC,OAAN,CAAcC,IAAd,IACIjD,4BAAA,MAAA;AACIiB,IAAAA,SAAS,EAAC;AACVkC,IAAAA,GAAG,EAAED;GAFT,EAIKD,IAJL,CADJ,GAQIA,IATP,CALL,CADJ;AAoBH,CA1CY,CAAb;AA4CAb,IAAI,CAACD,KAAL,GAAaP,SAAb;MAwBawB,UAAU,gBAAGpD,cAAK,CAACC,UAAN,CAAiB,SAASmD,UAAT,CAAoBlD,KAApB,EAA4CC,GAA5C;AACvC,QAAM;AAAEE,IAAAA,QAAF;AAAY,OAAGK;AAAf,MAA8BR,KAApC;AACA,QAAMe,SAAS,GAAGC,EAAE,CAAC,iEAAD,EAAoEhB,KAAK,CAACe,SAA1E,CAApB;AAEA,SACIjB,4BAAA,MAAA,oBAASU;AAAYO,IAAAA,SAAS,EAAEA;iBAAqB;AAAad,IAAAA,GAAG,EAAEA;IAAvE,EACKE,QADL,CADJ;AAKH,CATyB;AAW1B+C,UAAU,CAAChB,IAAX,GAAkBA,IAAlB;AACAgB,UAAU,CAACrD,IAAX,GAAkBA,IAAlB;AACAqD,UAAU,CAACzB,KAAX,GAAmBA,KAAnB;;;;"}
1
+ {"version":3,"file":"Navigation.js","sources":["../../../../src/components/Navigation/Navigation.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { TreeviewProps, Treeview, TreeviewGroupProps, TreeviewItemProps } from '../Treeview/Treeview';\nimport { Icon } from '../Icon/Icon';\nimport { useDropTarget } from '../../utils/hooks/useDropTarget';\nimport './Navigation.css';\nimport { useProxiedRef } from '../../utils/hooks/useProxiedRef';\n\n// Item\nexport type NavigationItemProps = Omit<TreeviewItemProps, 'prefix'> & {\n /** Change the style to indicate the link is selected */\n active?: boolean;\n /** Handler to be used when dropping a dragged element over the navigation link */\n onDrop?: React.DragEventHandler;\n /**\n * Small amount of information placed next to the text of the link.\n * This can be any valid react element, for e.g. a `span`.\n * Should be used to indicate a relevant information of the link,\n * for e.g. the number of unread notifications\n */\n postfix?: React.ReactNode;\n /**\n * Small amount of information placed before the text of the link.\n * This can be any valid react element, for e.g. a `span`.\n * Should be used to indicate a feedback for user,\n * for e.g. display some sort of visual informational state or a relevant icon.\n */\n prefix?: React.ReactNode;\n /** Target of the link */\n target?: string;\n};\n\nconst Item = React.forwardRef(function Item(props: NavigationItemProps, ref: React.Ref<HTMLAnchorElement>) {\n const { active, children, onDrop, postfix, prefix, role, ...otherProps } = props;\n const proxyRef = useProxiedRef<HTMLAnchorElement>(ref);\n const [isDraggedOver, dropTargetProps] = useDropTarget(onDrop);\n const isTreeitem = role === 'treeitem';\n const className = cn(\n 'yt-navigation__item cursor-pointer',\n {\n 'w-full mb-px py-1 px-3 flex items-center hover:bg-grey-dark': isTreeitem,\n 'bg-white w-full h-10 px-3 flex-shrink-0 flex items-center justify-between cursor-pointer': !isTreeitem,\n 'yt-navigation__item--active': active && !isDraggedOver,\n 'bg-grey-dark': isTreeitem && active && !isDraggedOver,\n 'yt-navigation__item--dropping bg-blue': isDraggedOver,\n },\n props.className\n );\n\n const handleClick = (event: React.MouseEvent<HTMLSpanElement>): void => {\n if (event.target instanceof HTMLAnchorElement || event.target instanceof HTMLButtonElement) {\n return;\n }\n\n if (proxyRef.current) {\n proxyRef.current.click();\n }\n };\n\n return (\n <span {...dropTargetProps} className={className} onClick={handleClick} role={role}>\n {prefix && <span className=\"yt-navigation__item__prefix flex items-center\">{prefix}</span>}\n <a {...otherProps} className=\"block flex-grow truncate\" ref={proxyRef}>\n {children}\n </a>\n {postfix && <span className=\"yt-navigation__item__postfix ml-1\">{postfix}</span>}\n </span>\n );\n});\n\n// Panel\nexport type NavigationPanelProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst Panel = React.forwardRef(function Panel(props: NavigationPanelProps, ref: React.Ref<HTMLDivElement>) {\n return <div {...props} className={cn('w-full bg-white p-3', props.className)} ref={ref} />;\n});\n\n// Group\nexport type NavigationMenuGroupProps = TreeviewGroupProps;\n\nconst MenuGroup = React.forwardRef(function MenuGroup(props: NavigationMenuGroupProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n 'flex-shrink-0 space-y-1 outline-none',\n {\n 'bg-white pb-2': props.fixed,\n },\n props.className\n );\n const title = (expanded: boolean): JSX.Element => {\n const className = cn('bg-white h-10 pl-3 pr-1 flex items-center justify-between w-full', {\n 'mb-1': expanded,\n 'cursor-pointer hover:text-blue': !props.fixed,\n });\n\n return (\n <span className={className}>\n {typeof props.title === 'function' ? props.title(expanded) : props.title}\n {!props.fixed && <Icon name={expanded ? 'chevron-up' : 'chevron-down'} />}\n </span>\n );\n };\n\n return <Treeview.Group {...props} className={className} title={title} ref={ref} />;\n});\n\n// Menu\nexport type NavigationMenuProps = React.PropsWithChildren<TreeviewProps>;\n\nexport type ForwardedNavigationMenuWithStatics = React.ForwardRefExoticComponent<\n NavigationMenuProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Expandable region reprezenting a group of related links */\n Group: React.ForwardRefExoticComponent<NavigationMenuGroupProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nconst Menu = React.forwardRef(function Menu(props: NavigationMenuProps, ref: React.Ref<HTMLDivElement>) {\n const scrollableAreas = React.useMemo(() => {\n const scrollableAreas: any[] = [];\n\n React.Children.toArray(props.children)\n .filter(child => !!child)\n .map((child: React.ReactElement<NavigationMenuGroupProps>) => {\n if (child.props.fixed) {\n scrollableAreas.push(child);\n } else {\n const x = scrollableAreas[scrollableAreas.length - 1];\n if (Array.isArray(x)) {\n x.push(child);\n } else {\n scrollableAreas.push([child]);\n }\n }\n });\n\n return scrollableAreas;\n }, [props.children]);\n\n return (\n <Treeview\n {...props}\n className={cn('divide-grey-light flex flex-grow flex-col divide-y-2 overflow-y-auto', props.className)}\n ref={ref}\n >\n {scrollableAreas.map((area, i) =>\n Array.isArray(area) ? (\n <div\n className=\"divide-grey-light flex h-0 flex-auto flex-shrink-0 flex-grow flex-col divide-y-2 overflow-y-auto\"\n key={i}\n >\n {area}\n </div>\n ) : (\n area\n )\n )}\n </Treeview>\n );\n}) as ForwardedNavigationMenuWithStatics;\n\nMenu.Group = MenuGroup;\n\n// Navigation\nexport type NavigationProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport type ForwardedNavigationWithStatics = React.ForwardRefExoticComponent<\n NavigationProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Navigation link */\n Item: React.ForwardRefExoticComponent<NavigationItemProps & React.RefAttributes<HTMLAnchorElement>>;\n /**\n * Container for the expandable groups that hold navigation links.\n * Should be used as a direct child of Navigation component, e.g. `Navigation.Menu`.\n * Should have the menu groups as a direct child, e.g. `Navigation.Menu.Group`\n */\n Menu: ForwardedNavigationMenuWithStatics;\n /**\n * Isolated container within the Navigation.\n * This can be used to create a region in the Navigation that is usually not scrollable, nor expandable,\n * containing useful information for user and quick actions\n */\n Panel: React.ForwardRefExoticComponent<NavigationPanelProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nexport const Navigation = React.forwardRef(function Navigation(props: NavigationProps, ref: React.Ref<HTMLDivElement>) {\n const { children, ...otherProps } = props;\n const className = cn('h-full flex flex-col bg-grey-light divide-y-2 divide-grey-light', props.className);\n\n return (\n <div {...otherProps} className={className} data-taco=\"navigation\" ref={ref}>\n {children}\n </div>\n );\n}) as ForwardedNavigationWithStatics;\n\nNavigation.Menu = Menu;\nNavigation.Item = Item;\nNavigation.Panel = Panel;\n"],"names":["Item","React","forwardRef","props","ref","active","children","onDrop","postfix","prefix","role","otherProps","proxyRef","useProxiedRef","useDropTarget","isDraggedOver","dropTargetProps","isTreeitem","className","cn","handleClick","event","target","HTMLAnchorElement","HTMLButtonElement","current","click","onClick","Panel","MenuGroup","fixed","title","expanded","Icon","name","Treeview","Group","Menu","scrollableAreas","useMemo","Children","toArray","filter","child","map","push","x","length","Array","isArray","area","i","key","Navigation"],"mappings":";;;;;;;;;;AAgCA,IAAMA,IAAI,gBAAGC,cAAK,CAACC,UAAN,CAAiB,SAASF,IAAT,CAAcG,KAAd,EAA0CC,GAA1C;AAC1B,MAAQC,MAAR,GAA2EF,KAA3E,CAAQE,MAAR;AAAA,MAAgBC,QAAhB,GAA2EH,KAA3E,CAAgBG,QAAhB;AAAA,MAA0BC,MAA1B,GAA2EJ,KAA3E,CAA0BI,MAA1B;AAAA,MAAkCC,OAAlC,GAA2EL,KAA3E,CAAkCK,OAAlC;AAAA,MAA2CC,MAA3C,GAA2EN,KAA3E,CAA2CM,MAA3C;AAAA,MAAmDC,IAAnD,GAA2EP,KAA3E,CAAmDO,IAAnD;AAAA,MAA4DC,UAA5D,iCAA2ER,KAA3E;;AACA,MAAMS,QAAQ,GAAGC,aAAa,CAAoBT,GAApB,CAA9B;;AACA,uBAAyCU,aAAa,CAACP,MAAD,CAAtD;AAAA,MAAOQ,aAAP;AAAA,MAAsBC,eAAtB;;AACA,MAAMC,UAAU,GAAGP,IAAI,KAAK,UAA5B;AACA,MAAMQ,SAAS,GAAGC,EAAE,CAChB,oCADgB,EAEhB;AACI,mEAA+DF,UADnE;AAEI,gGAA4F,CAACA,UAFjG;AAGI,mCAA+BZ,MAAM,IAAI,CAACU,aAH9C;AAII,oBAAgBE,UAAU,IAAIZ,MAAd,IAAwB,CAACU,aAJ7C;AAKI,6CAAyCA;AAL7C,GAFgB,EAShBZ,KAAK,CAACe,SATU,CAApB;;AAYA,MAAME,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD;AAChB,QAA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