@economic/taco 2.41.4 → 2.42.1-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (470) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +2 -2
  2. package/dist/components/Alert/Alert.d.ts +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.d.ts +2 -0
  4. package/dist/components/AlertDialog/components/Content.d.ts +1 -1
  5. package/dist/components/Calendar/Calendar.d.ts +1 -1
  6. package/dist/components/Datepicker/Datepicker.d.ts +1 -1
  7. package/dist/components/Dialog/components/Content.d.ts +1 -1
  8. package/dist/components/Dialog/components/DialogDrawer.d.ts +1 -1
  9. package/dist/components/Drawer/components/Content.d.ts +2 -2
  10. package/dist/components/Header/components/Agreement/Badge.d.ts +1 -1
  11. package/dist/components/Header/components/Agreement/Display.d.ts +2 -2
  12. package/dist/components/Header/components/Agreement/Item.d.ts +2 -2
  13. package/dist/components/Header/components/AgreementSelector.d.ts +2 -2
  14. package/dist/components/Header/components/Button.d.ts +1 -1
  15. package/dist/components/HoverCard/HoverCard.d.ts +1 -1
  16. package/dist/components/Icon/components/AccountPreview.d.ts +1 -1
  17. package/dist/components/Icon/components/Accounting.d.ts +1 -1
  18. package/dist/components/Icon/components/AccountingYear.d.ts +1 -1
  19. package/dist/components/Icon/components/AccountingYearCancel.d.ts +1 -1
  20. package/dist/components/Icon/components/AiChatSolid.d.ts +1 -1
  21. package/dist/components/Icon/components/AiStars.d.ts +1 -1
  22. package/dist/components/Icon/components/ArrowBottom.d.ts +1 -1
  23. package/dist/components/Icon/components/ArrowDown.d.ts +1 -1
  24. package/dist/components/Icon/components/ArrowEnd.d.ts +1 -1
  25. package/dist/components/Icon/components/ArrowLeft.d.ts +1 -1
  26. package/dist/components/Icon/components/ArrowRight.d.ts +1 -1
  27. package/dist/components/Icon/components/ArrowStart.d.ts +1 -1
  28. package/dist/components/Icon/components/ArrowTop.d.ts +1 -1
  29. package/dist/components/Icon/components/ArrowUp.d.ts +1 -1
  30. package/dist/components/Icon/components/Attach.d.ts +1 -1
  31. package/dist/components/Icon/components/AttachAuto.d.ts +1 -1
  32. package/dist/components/Icon/components/AttachCancel.d.ts +1 -1
  33. package/dist/components/Icon/components/AttachWarning.d.ts +1 -1
  34. package/dist/components/Icon/components/Autotext.d.ts +1 -1
  35. package/dist/components/Icon/components/AutotextInsert.d.ts +1 -1
  36. package/dist/components/Icon/components/Basic.d.ts +1 -1
  37. package/dist/components/Icon/components/BasicTabs.d.ts +1 -1
  38. package/dist/components/Icon/components/BellSolid.d.ts +1 -1
  39. package/dist/components/Icon/components/Book.d.ts +1 -1
  40. package/dist/components/Icon/components/Booking.d.ts +1 -1
  41. package/dist/components/Icon/components/Budget.d.ts +1 -1
  42. package/dist/components/Icon/components/Calendar.d.ts +1 -1
  43. package/dist/components/Icon/components/CashAccount.d.ts +1 -1
  44. package/dist/components/Icon/components/CashReports.d.ts +1 -1
  45. package/dist/components/Icon/components/ChartArea.d.ts +1 -1
  46. package/dist/components/Icon/components/ChartBar.d.ts +1 -1
  47. package/dist/components/Icon/components/ChartLine.d.ts +1 -1
  48. package/dist/components/Icon/components/ChartPie.d.ts +1 -1
  49. package/dist/components/Icon/components/ChartTable.d.ts +1 -1
  50. package/dist/components/Icon/components/Chat.d.ts +1 -1
  51. package/dist/components/Icon/components/ChatSolid.d.ts +1 -1
  52. package/dist/components/Icon/components/ChevronDown.d.ts +1 -1
  53. package/dist/components/Icon/components/ChevronDownDouble.d.ts +1 -1
  54. package/dist/components/Icon/components/ChevronDownSolid.d.ts +1 -1
  55. package/dist/components/Icon/components/ChevronLeft.d.ts +1 -1
  56. package/dist/components/Icon/components/ChevronLeftDouble.d.ts +1 -1
  57. package/dist/components/Icon/components/ChevronLeftSolid.d.ts +1 -1
  58. package/dist/components/Icon/components/ChevronRight.d.ts +1 -1
  59. package/dist/components/Icon/components/ChevronRightDouble.d.ts +1 -1
  60. package/dist/components/Icon/components/ChevronRightSolid.d.ts +1 -1
  61. package/dist/components/Icon/components/ChevronUp.d.ts +1 -1
  62. package/dist/components/Icon/components/ChevronUpDouble.d.ts +1 -1
  63. package/dist/components/Icon/components/ChevronUpSolid.d.ts +1 -1
  64. package/dist/components/Icon/components/CircleClose.d.ts +1 -1
  65. package/dist/components/Icon/components/CircleInformation.d.ts +1 -1
  66. package/dist/components/Icon/components/CircleMinus.d.ts +1 -1
  67. package/dist/components/Icon/components/CirclePlus.d.ts +1 -1
  68. package/dist/components/Icon/components/CircleQuestionmark.d.ts +1 -1
  69. package/dist/components/Icon/components/CircleTick.d.ts +1 -1
  70. package/dist/components/Icon/components/CircleWarning.d.ts +1 -1
  71. package/dist/components/Icon/components/Clamp.d.ts +1 -1
  72. package/dist/components/Icon/components/ClampOpen.d.ts +1 -1
  73. package/dist/components/Icon/components/Close.d.ts +1 -1
  74. package/dist/components/Icon/components/ColumnFreeze.d.ts +1 -1
  75. package/dist/components/Icon/components/ColumnUnfreeze.d.ts +1 -1
  76. package/dist/components/Icon/components/Columns.d.ts +1 -1
  77. package/dist/components/Icon/components/ConnectionEnable.d.ts +1 -1
  78. package/dist/components/Icon/components/ConnectionRevoke.d.ts +1 -1
  79. package/dist/components/Icon/components/Contacts.d.ts +1 -1
  80. package/dist/components/Icon/components/Copy.d.ts +1 -1
  81. package/dist/components/Icon/components/Courses.d.ts +1 -1
  82. package/dist/components/Icon/components/Credit.d.ts +1 -1
  83. package/dist/components/Icon/components/Delete.d.ts +1 -1
  84. package/dist/components/Icon/components/DeletePermanently.d.ts +1 -1
  85. package/dist/components/Icon/components/Depecriate.d.ts +1 -1
  86. package/dist/components/Icon/components/Developer.d.ts +1 -1
  87. package/dist/components/Icon/components/DistributionTemplate.d.ts +1 -1
  88. package/dist/components/Icon/components/Document.d.ts +1 -1
  89. package/dist/components/Icon/components/DocumentApprove.d.ts +1 -1
  90. package/dist/components/Icon/components/DocumentCreateEntry.d.ts +1 -1
  91. package/dist/components/Icon/components/DocumentCut.d.ts +1 -1
  92. package/dist/components/Icon/components/DocumentError.d.ts +1 -1
  93. package/dist/components/Icon/components/DocumentIsolatePage.d.ts +1 -1
  94. package/dist/components/Icon/components/DocumentMerge.d.ts +1 -1
  95. package/dist/components/Icon/components/DocumentMove.d.ts +1 -1
  96. package/dist/components/Icon/components/DocumentPreview.d.ts +1 -1
  97. package/dist/components/Icon/components/DocumentReceived.d.ts +1 -1
  98. package/dist/components/Icon/components/DocumentRejectedRequest.d.ts +1 -1
  99. package/dist/components/Icon/components/DocumentSigned.d.ts +1 -1
  100. package/dist/components/Icon/components/DocumentSignedSolid.d.ts +1 -1
  101. package/dist/components/Icon/components/DocumentSplit.d.ts +1 -1
  102. package/dist/components/Icon/components/DocumentTime.d.ts +1 -1
  103. package/dist/components/Icon/components/Download.d.ts +1 -1
  104. package/dist/components/Icon/components/Drag.d.ts +1 -1
  105. package/dist/components/Icon/components/ECopedia.d.ts +1 -1
  106. package/dist/components/Icon/components/Edit.d.ts +1 -1
  107. package/dist/components/Icon/components/EditSimple.d.ts +1 -1
  108. package/dist/components/Icon/components/EllipsisHorizontal.d.ts +1 -1
  109. package/dist/components/Icon/components/EllipsisVertical.d.ts +1 -1
  110. package/dist/components/Icon/components/EntriesOnAccount.d.ts +1 -1
  111. package/dist/components/Icon/components/EntriesOpen.d.ts +1 -1
  112. package/dist/components/Icon/components/EntriesWarning.d.ts +1 -1
  113. package/dist/components/Icon/components/EntryTypeCustomerInvoice.d.ts +1 -1
  114. package/dist/components/Icon/components/EntryTypeCustomerPayment.d.ts +1 -1
  115. package/dist/components/Icon/components/EntryTypeJournalEntry.d.ts +1 -1
  116. package/dist/components/Icon/components/EntryTypeManualCustomerInvoice.d.ts +1 -1
  117. package/dist/components/Icon/components/EntryTypeSupplierInvoice.d.ts +1 -1
  118. package/dist/components/Icon/components/EntryTypeSupplierPayment.d.ts +1 -1
  119. package/dist/components/Icon/components/Envelope.d.ts +1 -1
  120. package/dist/components/Icon/components/EnvelopeApproved.d.ts +1 -1
  121. package/dist/components/Icon/components/EnvelopeSolid.d.ts +1 -1
  122. package/dist/components/Icon/components/ExpandView.d.ts +1 -1
  123. package/dist/components/Icon/components/Expenses.d.ts +1 -1
  124. package/dist/components/Icon/components/Export.d.ts +1 -1
  125. package/dist/components/Icon/components/ExportToExcel.d.ts +1 -1
  126. package/dist/components/Icon/components/ExportToPdf.d.ts +1 -1
  127. package/dist/components/Icon/components/EyeOff.d.ts +1 -1
  128. package/dist/components/Icon/components/EyeOn.d.ts +1 -1
  129. package/dist/components/Icon/components/Filter.d.ts +1 -1
  130. package/dist/components/Icon/components/FilterSolid.d.ts +1 -1
  131. package/dist/components/Icon/components/FontSize.d.ts +1 -1
  132. package/dist/components/Icon/components/GraphSolid.d.ts +1 -1
  133. package/dist/components/Icon/components/Hash.d.ts +1 -1
  134. package/dist/components/Icon/components/HeightExtraTall.d.ts +1 -1
  135. package/dist/components/Icon/components/HeightMedium.d.ts +1 -1
  136. package/dist/components/Icon/components/HeightShort.d.ts +1 -1
  137. package/dist/components/Icon/components/HeightTall.d.ts +1 -1
  138. package/dist/components/Icon/components/House.d.ts +1 -1
  139. package/dist/components/Icon/components/HouseSolid.d.ts +1 -1
  140. package/dist/components/Icon/components/Id.d.ts +1 -1
  141. package/dist/components/Icon/components/Images.d.ts +1 -1
  142. package/dist/components/Icon/components/Import.d.ts +1 -1
  143. package/dist/components/Icon/components/Inbox.d.ts +1 -1
  144. package/dist/components/Icon/components/InboxEinvoicing.d.ts +1 -1
  145. package/dist/components/Icon/components/InboxScanning.d.ts +1 -1
  146. package/dist/components/Icon/components/InboxSmart.d.ts +1 -1
  147. package/dist/components/Icon/components/Info.d.ts +1 -1
  148. package/dist/components/Icon/components/Inventory.d.ts +1 -1
  149. package/dist/components/Icon/components/InventoryMatrix.d.ts +1 -1
  150. package/dist/components/Icon/components/JournalPro.d.ts +1 -1
  151. package/dist/components/Icon/components/Layout.d.ts +1 -1
  152. package/dist/components/Icon/components/LayoutBoth.d.ts +1 -1
  153. package/dist/components/Icon/components/LayoutFirst.d.ts +1 -1
  154. package/dist/components/Icon/components/LayoutLast.d.ts +1 -1
  155. package/dist/components/Icon/components/LayoutNone.d.ts +1 -1
  156. package/dist/components/Icon/components/LedgerCard.d.ts +1 -1
  157. package/dist/components/Icon/components/LedgerCardCustomerReminder.d.ts +1 -1
  158. package/dist/components/Icon/components/LedgerCardManualCustomerInvoice.d.ts +1 -1
  159. package/dist/components/Icon/components/LedgerCardObsoleteStock.d.ts +1 -1
  160. package/dist/components/Icon/components/LedgerCardOpeningEntry.d.ts +1 -1
  161. package/dist/components/Icon/components/LedgerCardReservedEntry.d.ts +1 -1
  162. package/dist/components/Icon/components/LedgerCardShrinkagePilferage.d.ts +1 -1
  163. package/dist/components/Icon/components/LedgerCardStockAdjustment.d.ts +1 -1
  164. package/dist/components/Icon/components/LedgerCardTransferredOpeningEntry.d.ts +1 -1
  165. package/dist/components/Icon/components/Lightbulb.d.ts +1 -1
  166. package/dist/components/Icon/components/Line.d.ts +1 -1
  167. package/dist/components/Icon/components/LinkExternal.d.ts +1 -1
  168. package/dist/components/Icon/components/List.d.ts +1 -1
  169. package/dist/components/Icon/components/ListBulleted.d.ts +1 -1
  170. package/dist/components/Icon/components/ListSearch.d.ts +1 -1
  171. package/dist/components/Icon/components/Location.d.ts +1 -1
  172. package/dist/components/Icon/components/Lock.d.ts +1 -1
  173. package/dist/components/Icon/components/LockOpen.d.ts +1 -1
  174. package/dist/components/Icon/components/Log.d.ts +1 -1
  175. package/dist/components/Icon/components/LogOut.d.ts +1 -1
  176. package/dist/components/Icon/components/Market.d.ts +1 -1
  177. package/dist/components/Icon/components/MastercardOs.d.ts +1 -1
  178. package/dist/components/Icon/components/MatchAmount.d.ts +1 -1
  179. package/dist/components/Icon/components/MatchEntries.d.ts +1 -1
  180. package/dist/components/Icon/components/Menu.d.ts +1 -1
  181. package/dist/components/Icon/components/Mileage.d.ts +1 -1
  182. package/dist/components/Icon/components/ModalResize.d.ts +1 -1
  183. package/dist/components/Icon/components/ModalShrink.d.ts +1 -1
  184. package/dist/components/Icon/components/More.d.ts +1 -1
  185. package/dist/components/Icon/components/MoreSolid.d.ts +1 -1
  186. package/dist/components/Icon/components/Move.d.ts +1 -1
  187. package/dist/components/Icon/components/NavigationList.d.ts +1 -1
  188. package/dist/components/Icon/components/Note.d.ts +1 -1
  189. package/dist/components/Icon/components/NoteFollowUp.d.ts +1 -1
  190. package/dist/components/Icon/components/NoteRead.d.ts +1 -1
  191. package/dist/components/Icon/components/NovemberFirst.d.ts +1 -1
  192. package/dist/components/Icon/components/Numbers.d.ts +1 -1
  193. package/dist/components/Icon/components/PartnerApi.d.ts +1 -1
  194. package/dist/components/Icon/components/PaymentPaid.d.ts +1 -1
  195. package/dist/components/Icon/components/PaymentUnpaid.d.ts +1 -1
  196. package/dist/components/Icon/components/Period.d.ts +1 -1
  197. package/dist/components/Icon/components/PersonChange.d.ts +1 -1
  198. package/dist/components/Icon/components/PersonMinus.d.ts +1 -1
  199. package/dist/components/Icon/components/PersonPlus.d.ts +1 -1
  200. package/dist/components/Icon/components/PersonTick.d.ts +1 -1
  201. package/dist/components/Icon/components/Phone.d.ts +1 -1
  202. package/dist/components/Icon/components/PhoneSolid.d.ts +1 -1
  203. package/dist/components/Icon/components/Play.d.ts +1 -1
  204. package/dist/components/Icon/components/PlusMinus.d.ts +1 -1
  205. package/dist/components/Icon/components/Print.d.ts +1 -1
  206. package/dist/components/Icon/components/ProcessPayment.d.ts +1 -1
  207. package/dist/components/Icon/components/ProductLedgerCard.d.ts +1 -1
  208. package/dist/components/Icon/components/Profile.d.ts +1 -1
  209. package/dist/components/Icon/components/ProjectCards.d.ts +1 -1
  210. package/dist/components/Icon/components/Projects.d.ts +1 -1
  211. package/dist/components/Icon/components/QuestionMark.d.ts +1 -1
  212. package/dist/components/Icon/components/QuestionMarkBold.d.ts +1 -1
  213. package/dist/components/Icon/components/Quicklinks.d.ts +1 -1
  214. package/dist/components/Icon/components/RatingBankruptcy.d.ts +1 -1
  215. package/dist/components/Icon/components/RatingPaymentProblems.d.ts +1 -1
  216. package/dist/components/Icon/components/Reconciled.d.ts +1 -1
  217. package/dist/components/Icon/components/Refresh.d.ts +1 -1
  218. package/dist/components/Icon/components/Report.d.ts +1 -1
  219. package/dist/components/Icon/components/ReportSolid.d.ts +1 -1
  220. package/dist/components/Icon/components/Restore.d.ts +1 -1
  221. package/dist/components/Icon/components/RotateLeft.d.ts +1 -1
  222. package/dist/components/Icon/components/RotateRight.d.ts +1 -1
  223. package/dist/components/Icon/components/Sales.d.ts +1 -1
  224. package/dist/components/Icon/components/Search.d.ts +1 -1
  225. package/dist/components/Icon/components/SearchBold.d.ts +1 -1
  226. package/dist/components/Icon/components/Secure.d.ts +1 -1
  227. package/dist/components/Icon/components/SecureTick.d.ts +1 -1
  228. package/dist/components/Icon/components/Settings.d.ts +1 -1
  229. package/dist/components/Icon/components/SettingsSolid.d.ts +1 -1
  230. package/dist/components/Icon/components/Shortcuts.d.ts +1 -1
  231. package/dist/components/Icon/components/ShowAll.d.ts +1 -1
  232. package/dist/components/Icon/components/ShowLess.d.ts +1 -1
  233. package/dist/components/Icon/components/ShowMore.d.ts +1 -1
  234. package/dist/components/Icon/components/ShowTemplate.d.ts +1 -1
  235. package/dist/components/Icon/components/Sliders.d.ts +1 -1
  236. package/dist/components/Icon/components/Smartpay.d.ts +1 -1
  237. package/dist/components/Icon/components/SortBy.d.ts +1 -1
  238. package/dist/components/Icon/components/Star.d.ts +1 -1
  239. package/dist/components/Icon/components/StarSolid.d.ts +1 -1
  240. package/dist/components/Icon/components/Subscriptions.d.ts +1 -1
  241. package/dist/components/Icon/components/SystemEntries.d.ts +1 -1
  242. package/dist/components/Icon/components/Tag.d.ts +1 -1
  243. package/dist/components/Icon/components/TemplateOverride.d.ts +1 -1
  244. package/dist/components/Icon/components/Templates.d.ts +1 -1
  245. package/dist/components/Icon/components/ThumbBoth.d.ts +1 -1
  246. package/dist/components/Icon/components/ThumbDown.d.ts +1 -1
  247. package/dist/components/Icon/components/ThumbDownSolid.d.ts +1 -1
  248. package/dist/components/Icon/components/ThumbUp.d.ts +1 -1
  249. package/dist/components/Icon/components/ThumbUpSolid.d.ts +1 -1
  250. package/dist/components/Icon/components/Tick.d.ts +1 -1
  251. package/dist/components/Icon/components/TickBold.d.ts +1 -1
  252. package/dist/components/Icon/components/Time.d.ts +1 -1
  253. package/dist/components/Icon/components/Transfer.d.ts +1 -1
  254. package/dist/components/Icon/components/TransferCancel.d.ts +1 -1
  255. package/dist/components/Icon/components/TransferLocked.d.ts +1 -1
  256. package/dist/components/Icon/components/Undo.d.ts +1 -1
  257. package/dist/components/Icon/components/Undock.d.ts +1 -1
  258. package/dist/components/Icon/components/Unreconciled.d.ts +1 -1
  259. package/dist/components/Icon/components/Warning.d.ts +1 -1
  260. package/dist/components/Icon/components/Webshop.d.ts +1 -1
  261. package/dist/components/Icon/components/Website.d.ts +1 -1
  262. package/dist/components/Icon/components/Workflow.d.ts +1 -1
  263. package/dist/components/Icon/components/WorkflowTemplateBasic.d.ts +1 -1
  264. package/dist/components/Icon/components/Zoom.d.ts +1 -1
  265. package/dist/components/IconButton/IconButton.d.ts +2 -2
  266. package/dist/components/Input/Input.d.ts +2 -2
  267. package/dist/components/Input/util.d.ts +11 -1
  268. package/dist/components/Layout/components/Sidebar.d.ts +14 -2
  269. package/dist/components/Layout/components/Top.d.ts +2 -2
  270. package/dist/components/List/List.d.ts +7 -7
  271. package/dist/components/List/components/Button.d.ts +1 -1
  272. package/dist/components/List/components/Collapsible.d.ts +1 -1
  273. package/dist/components/List/components/Group.d.ts +1 -1
  274. package/dist/components/List/components/Item.d.ts +1 -1
  275. package/dist/components/List/components/Link.d.ts +1 -1
  276. package/dist/components/List/components/Toggle.d.ts +2 -2
  277. package/dist/components/Listbox/Listbox.d.ts +2 -2
  278. package/dist/components/Listbox/ScrollableList.d.ts +1 -1
  279. package/dist/components/Listbox/util.d.ts +2 -2
  280. package/dist/components/Menu/components/Checkbox.d.ts +1 -1
  281. package/dist/components/Menu/components/Content.d.ts +2 -2
  282. package/dist/components/Menu/components/Item.d.ts +8 -8
  283. package/dist/components/Menu/components/Link.d.ts +1 -1
  284. package/dist/components/Menu/components/RadioGroup.d.ts +1 -1
  285. package/dist/components/Menu/components/SubMenu.d.ts +1 -1
  286. package/dist/components/Menu/components/Trigger.d.ts +1 -1
  287. package/dist/components/Navigation2/components/Group.d.ts +1 -1
  288. package/dist/components/Popover/Popover.d.ts +2 -2
  289. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  290. package/dist/components/ScrollArea/ScrollArea.d.ts +2 -2
  291. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  292. package/dist/components/Select/Select.d.ts +1 -1
  293. package/dist/components/Select2/components/All.d.ts +2 -2
  294. package/dist/components/Select2/components/Collection.d.ts +1 -1
  295. package/dist/components/Select2/components/Create.d.ts +1 -1
  296. package/dist/components/Select2/components/Edit.d.ts +2 -2
  297. package/dist/components/Select2/components/Group.d.ts +1 -1
  298. package/dist/components/Select2/components/Option.d.ts +1 -1
  299. package/dist/components/Select2/components/Search.d.ts +3 -3
  300. package/dist/components/Select2/components/Trigger.d.ts +1 -1
  301. package/dist/components/Select2/hooks/useChildren.d.ts +2 -2
  302. package/dist/components/Shortcut/Shortcut.d.ts +1 -1
  303. package/dist/components/Table3/components/Columns/Cell/Cell.d.ts +2 -2
  304. package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.d.ts +1 -1
  305. package/dist/components/Table3/components/Columns/Cell/EditingControlCell.d.ts +2 -2
  306. package/dist/components/Table3/components/Columns/Internal/EditingActionsMenu.d.ts +2 -2
  307. package/dist/components/Table3/components/Editing/Alert.d.ts +1 -1
  308. package/dist/components/Table3/components/Row/Editing/CreateRowButton.d.ts +2 -2
  309. package/dist/components/Table3/components/Row/Editing/SaveStatus.d.ts +2 -2
  310. package/dist/components/Table3/components/Row/Row.d.ts +2 -2
  311. package/dist/components/Table3/components/Toolbar/Editing/Editing.d.ts +1 -1
  312. package/dist/components/Table3/features/useTableEditing.d.ts +2 -2
  313. package/dist/components/Table3/util/editing.d.ts +3 -2
  314. package/dist/components/Tag/Tag.d.ts +2 -2
  315. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  316. package/dist/components/Tour/Tour.d.ts +3 -3
  317. package/dist/components/Truncate/Truncate.d.ts +1 -1
  318. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +14 -6
  319. package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
  320. package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
  321. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +31 -3
  322. package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
  323. package/dist/esm/packages/taco/src/components/Card/Card.js +7 -5
  324. package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
  325. package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
  326. package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
  327. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +3 -3
  328. package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
  329. package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
  330. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +5 -3
  331. package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
  332. package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
  333. package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
  334. package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
  335. package/dist/esm/packages/taco/src/components/Listbox/util.js +7 -1
  336. package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
  337. package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
  338. package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
  339. package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
  340. package/dist/esm/packages/taco/src/components/Popover/Primitives.js +2 -1
  341. package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
  342. package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
  343. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +4 -4
  344. package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
  345. package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
  346. package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
  347. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  348. package/dist/esm/packages/taco/src/components/Select2/components/Create.js +11 -10
  349. package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
  350. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +0 -2
  351. package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
  352. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  353. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  354. package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
  355. package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
  356. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
  357. package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
  358. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
  359. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
  360. package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
  361. package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
  362. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateRowButton.js.map +1 -1
  363. package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
  364. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +4 -1
  365. package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
  366. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +7 -4
  367. package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
  368. package/dist/esm/packages/taco/src/components/Table3/util/editing.js +9 -7
  369. package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
  370. package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
  371. package/dist/esm/packages/taco/src/components/Tour/Tour.js +3 -3
  372. package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
  373. package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
  374. package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js.map +1 -1
  375. package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +1 -1
  376. package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
  377. package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js.map +1 -1
  378. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js +4 -4
  379. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
  380. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js +3 -1
  381. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
  382. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
  383. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +1 -1
  384. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
  385. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -1
  386. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +2 -2
  387. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
  388. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
  389. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -1
  390. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -1
  391. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
  392. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +1 -1
  393. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
  394. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +3 -1
  395. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
  396. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +5 -7
  397. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
  398. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
  399. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
  400. package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -1
  401. package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
  402. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +1 -1
  403. package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
  404. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -1
  405. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +3 -1
  406. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
  407. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
  408. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -1
  409. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +4 -2
  410. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
  411. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +4 -17
  412. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
  413. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js +62 -0
  414. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js.map +1 -0
  415. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js +1 -15
  416. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -1
  417. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +37 -7
  418. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
  419. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
  420. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +22 -8
  421. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
  422. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js +4 -6
  423. package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -1
  424. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  425. package/dist/primitives/BubbleSelect.d.ts +1 -1
  426. package/dist/primitives/Sortable/components/Container.d.ts +2 -2
  427. package/dist/primitives/Sortable/components/Item.d.ts +2 -1
  428. package/dist/primitives/Sortable/components/List.d.ts +1 -1
  429. package/dist/primitives/Table/Core/Table.d.ts +2 -2
  430. package/dist/primitives/Table/Core/components/Body/Body.d.ts +1 -1
  431. package/dist/primitives/Table/Core/components/Body/EmptyStateBody.d.ts +1 -1
  432. package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.d.ts +2 -2
  433. package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.d.ts +2 -2
  434. package/dist/primitives/Table/Core/components/Columns/Cell/Cell.d.ts +1 -1
  435. package/dist/primitives/Table/Core/components/Columns/Internal/Actions.d.ts +2 -2
  436. package/dist/primitives/Table/Core/components/Footer/Footer.d.ts +3 -3
  437. package/dist/primitives/Table/Core/components/Footer/Summary.d.ts +2 -2
  438. package/dist/primitives/Table/Core/components/Header/Header.d.ts +1 -1
  439. package/dist/primitives/Table/Core/components/Header/components/Goto.d.ts +2 -2
  440. package/dist/primitives/Table/Core/components/Header/components/Menu.d.ts +1 -1
  441. package/dist/primitives/Table/Core/components/Header/components/Resizer.d.ts +2 -2
  442. package/dist/primitives/Table/Core/components/Header/components/SortIndicator.d.ts +3 -3
  443. package/dist/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.d.ts +2 -2
  444. package/dist/primitives/Table/Core/components/Row/Row.d.ts +1 -1
  445. package/dist/primitives/Table/Core/components/Toolbar/Toolbar.d.ts +1 -1
  446. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/Filters.d.ts +2 -2
  447. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.d.ts +2 -2
  448. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +2 -2
  449. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +1 -1
  450. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.d.ts +2 -2
  451. package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.d.ts +2 -2
  452. package/dist/primitives/Table/Core/components/Toolbar/components/Print/Print.d.ts +1 -1
  453. package/dist/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.d.ts +2 -2
  454. package/dist/primitives/Table/Core/components/Toolbar/components/Search/Search.d.ts +1 -1
  455. package/dist/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.d.ts +2 -2
  456. package/dist/primitives/Table/Core/components/Toolbar/components/Settings/Settings.d.ts +2 -2
  457. package/dist/primitives/Table/types.d.ts +1 -1
  458. package/dist/primitives/Table/useTableManager/util/columns.d.ts +2 -2
  459. package/dist/primitives/Table/useTableManager/util/dataTypes.d.ts +12 -0
  460. package/dist/primitives/Table/useTableManager/util/filtering.d.ts +0 -2
  461. package/dist/primitives/Table/useTableManager/util/search.d.ts +6 -2
  462. package/dist/primitives/Table/useTableManager/util/settings.d.ts +1 -1
  463. package/dist/primitives/Table/useTableManager/util/setup.d.ts +3 -2
  464. package/dist/primitives/Table/useTableManager/util/sorting.d.ts +2 -1
  465. package/dist/taco.cjs.development.js +380 -259
  466. package/dist/taco.cjs.development.js.map +1 -1
  467. package/dist/taco.cjs.production.min.js +1 -1
  468. package/dist/taco.cjs.production.min.js.map +1 -1
  469. package/dist/utils/dom.d.ts +1 -1
  470. package/package.json +10 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Localization';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames } from '../util';\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 onOpenAutoFocus?: DialogPrimitive.DialogContentProps['onOpenAutoFocus'];\n onCloseAutoFocus?: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n const { position, dragging, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative bg-white animate-[fade-in_150ms] rounded',\n getDialogPositionClassnames(),\n getDialogSizeClassnames(dialog.size),\n 'print:w-full print:h-full print:m-0 print:overflow-visible'\n );\n\n const containerClassName = cn(\n 'bg-white p-6 rounded relative z-10 shadow print:p-0 print:overflow-visible print:h-full',\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 <Close>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </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 ref={internalRef}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}>\n <div className={containerClassName} data-taco=\"dialog\">\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n role=\"button\"\n draggable\n aria-grabbed={dragging}\n aria-label={texts.dialog.drag}\n className=\"yt-dialog__drag absolute-center-x bg-grey-100 top-1.5 h-3 w-24 cursor-move rounded text-center print:hidden\"\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 right-0 top-0 mr-2 mt-2 print:hidden\"\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","useMergedRef","position","dragging","handleProps","dragHandleProps","useDraggable","texts","useLocalization","getDialogPositionClassnames","getDialogSizeClassnames","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","style","left","draggable","x","undefined","top","y","role","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;MAmBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAWA,CAACC,KAAuB,EAAEC,GAAkC;EAClH,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAAqB,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC/E,CAAC;MAGYI,MAAM,gBAAGP,UAAgB,CAAC,SAASQ,YAAYA,CAACN,KAAwB,EAAEC,GAA8B;EACjH,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAuB,EAAEH,KAAK,CAACE,SAAS,CAAC;EAC9D,oBACIJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;MACtCD,KAAK,CAACO,QAAQ,CACb;AAEd,CAAC;MAIYC,KAAK,gBAAGV,UAAgB,CAAC,SAASW,WAAWA,CAACT,KAAuB,EAAEC,GAAiC;EACjH,MAAMS,MAAM,GAAGC,gBAAgB,EAAE;EAEjC,oBAAOb,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG;KAAab,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEa,OAAO;KAAG;AAC1F,CAAC;AAED,MAAMC,iBAAiB,gBAAGjB,UAAgB,CAAC,SAASiB,iBAAiBA,CAAC;EAAER,QAAQ;EAAEK,OAAO;EAAEI;CAAkB,EAAEf,GAAG;EAC9G,MAAMgB,KAAK,GAAGA;IACVL,OAAO,CAAC,IAAIM,WAAW,C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CAEtG;GACJ,MAAM;IACHkC,MAAM,GAAGzC,KAAK,CAACO,QAAQ;;EAG3B,oBACIT,cAACM,MAAsB,qBACnBN,cAACM,OAAuB;IAACU,OAAO;kBAC5BhB,cAAC6C,QAAQ,qBACL7C,cAACM,SAAuB,oBAChBJ,KAAK;IACTE,SAAS,EAAEA,SAAS;IACpB0C,eAAe,EAAER,mBAAmB;IACpCS,iBAAiB,EAAEL,qBAAqB;IACxCvC,GAAG,EAAEoB,WAAW;IAChByB,KAAK,EAAE;MACH,GAAG9C,KAAK,CAAC8C,KAAK;MACdC,IAAI,EAAErC,MAAM,CAACsC,SAAS,GAAG,GAAGzB,QAAQ,CAAC0B,CAAC,IAAI,GAAGC,SAAS;MACtDC,GAAG,EAAEzC,MAAM,CAACsC,SAAS,GAAG,GAAGzB,QAAQ,CAAC6B,CAAC,IAAI,GAAGF;;mBAEhDpD;IAAKI,SAAS,EAAE+B,kBAAkB;iBAAY;KACzCQ,MAAM,EACN/B,MAAM,CAACsC,SAAS,kBACblD,uCACQ4B,eAAe;IACnB2B,IAAI,EAAC,QAAQ;IACbL,SAAS;oBACKxB,QAAQ;kBACVI,KAAK,CAAClB,MAAM,CAAC4C,IAAI;IAC7BpD,SAAS,EAAC;KACZ,CACL,EACAQ,MAAM,CAAC6C,eAAe,iBACnBzD,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG,OAAO;IAAEC,OAAO;kBACnDhB,cAAC0D,UAAU;IACPC,UAAU,EAAC,UAAU;kBACT7B,KAAK,CAAClB,MAAM,CAACO,KAAK;IAC9Bf,SAAS,EAAC,+CAA+C;IACzDwD,IAAI,EAAC;IACP,CACkB,IACxB,IAAI,CACN,EACLhD,MAAM,CAACwB,QAAQ,CAACQ,MAAM,EACtBhC,MAAM,CAACwB,QAAQ,CAACC,KAAK,CACA,CACnB,CACW,CACL;AAEjC,CAAC;;;;"}
1
+ {"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Localization';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames } from '../util';\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 onOpenAutoFocus?: DialogPrimitive.DialogContentProps['onOpenAutoFocus'];\n onCloseAutoFocus?: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n const { position, dragging, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative bg-white animate-[fade-in_150ms] rounded',\n getDialogPositionClassnames(),\n getDialogSizeClassnames(dialog.size),\n 'print:w-full print:h-full print:m-0 print:overflow-visible'\n );\n\n const containerClassName = cn(\n 'bg-white p-6 rounded relative z-10 shadow print:p-0 print:overflow-visible print:h-full',\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: any) => event.preventDefault();\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <Close>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </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 ref={internalRef}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}>\n <div className={containerClassName} data-taco=\"dialog\">\n <>\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n role=\"button\"\n draggable\n aria-grabbed={dragging}\n aria-label={texts.dialog.drag}\n className=\"yt-dialog__drag absolute-center-x bg-grey-100 top-1.5 h-3 w-24 cursor-move rounded text-center print:hidden\"\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 right-0 top-0 mr-2 mt-2 print:hidden\"\n icon=\"close\"\n />\n </DialogPrimitive.Close>\n ) : null}\n </>\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","useMergedRef","position","dragging","handleProps","dragHandleProps","useDraggable","texts","useLocalization","getDialogPositionClassnames","getDialogSizeClassnames","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","style","left","draggable","x","undefined","top","y","role","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;MAmBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAWA,CAACC,KAAuB,EAAEC,GAAkC;EAClH,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAAqB,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC/E,CAAC;MAGYI,MAAM,gBAAGP,UAAgB,CAAC,SAASQ,YAAYA,CAACN,KAAwB,EAAEC,GAA8B;EACjH,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAuB,EAAEH,KAAK,CAACE,SAAS,CAAC;EAC9D,oBACIJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED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CAAC4C,IAAI;IAC7BpD,SAAS,EAAC;KACZ,CACL,EACAQ,MAAM,CAAC6C,eAAe,iBACnBzD,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG,OAAO;IAAEC,OAAO;kBACnDhB,cAAC0D,UAAU;IACPC,UAAU,EAAC,UAAU;kBACT7B,KAAK,CAAClB,MAAM,CAACO,KAAK;IAC9Bf,SAAS,EAAC,+CAA+C;IACzDwD,IAAI,EAAC;IACP,CACkB,IACxB,IAAI,CACT,CACD,EACLhD,MAAM,CAACwB,QAAQ,CAACQ,MAAM,EACtBhC,MAAM,CAACwB,QAAQ,CAACC,KAAK,CACA,CACnB,CACW,CACL;AAEjC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../../../../../../../src/components/Header/components/Agreement/Avatar.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\n\nexport type AgreementAvatarProps = React.ImgHTMLAttributes<HTMLImageElement> & { fallbackSrc: string };\n\nexport const AgreementAvatar = React.forwardRef<HTMLImageElement, AgreementAvatarProps>(function AgreementAvatar(props, ref) {\n const { src, fallbackSrc, ...otherProps } = props;\n const [loaded, setLoaded] = React.useState(false);\n const handleLoad = () => setLoaded(true);\n const handleError = event => {\n event.target.src = fallbackSrc;\n };\n\n const className = cn(\n 'h-9 w-9 rounded-full shrink-0 group-focus:yt-focus-dark xl:group-focus:shadow-none',\n {\n visible: loaded,\n },\n props.className\n );\n\n return <img {...otherProps} className={className} src={src} onLoad={handleLoad} onError={handleError} ref={ref} />;\n});\n"],"names":["AgreementAvatar","React","forwardRef","props","ref","src","fallbackSrc","otherProps","loaded","setLoaded","useState","handleLoad","handleError","event","target","className","cn","visible","onLoad","onError"],"mappings":";;;MAKaA,eAAe,gBAAGC,cAAK,CAACC,UAAU,CAAyC,SAASF,eAAeA,CAACG,KAAK,EAAEC,GAAG;EACvH,MAAM;IAAEC,GAAG;IAAEC,WAAW;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EACjD,MAAM,CAACK,MAAM,EAAEC,SAAS,CAAC,GAAGR,cAAK,CAACS,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAMC,UAAU,GAAGA,MAAMF,SAAS,CAAC,IAAI,CAAC;EACxC,MAAMG,WAAW,GAAGC,KAAK;IACrBA,KAAK,CAACC,MAAM,CAACT,GAAG,GAAGC,WAAW;GACjC;EAED,MAAMS,SAAS,GAAGC,EAAE,CAChB,oFAAoF,EACpF;IACIC,OAAO,EAAET;GACZ,EACDL,KAAK,CAACY,SAAS,CAClB;EAED,oBAAOd,sDAASM,UAAU;IAAEQ,SAAS,EAAEA,SAAS;IAAEV,GAAG,EAAEA,GAAG;IAAEa,MAAM,EAAEP,UAAU;IAAEQ,OAAO,EAAEP,WAAW;IAAER,GAAG,EAAEA;KAAO;AACtH,CAAC;;;;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../../../../../../../src/components/Header/components/Agreement/Avatar.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\n\nexport type AgreementAvatarProps = React.ImgHTMLAttributes<HTMLImageElement> & { fallbackSrc: string };\n\nexport const AgreementAvatar = React.forwardRef<HTMLImageElement, AgreementAvatarProps>(function AgreementAvatar(props, ref) {\n const { src, fallbackSrc, ...otherProps } = props;\n const [loaded, setLoaded] = React.useState(false);\n const handleLoad = () => setLoaded(true);\n const handleError = (event: any) => {\n event.target.src = fallbackSrc;\n };\n\n const className = cn(\n 'h-9 w-9 rounded-full shrink-0 group-focus:yt-focus-dark xl:group-focus:shadow-none',\n {\n visible: loaded,\n },\n props.className\n );\n\n return <img {...otherProps} className={className} src={src} onLoad={handleLoad} onError={handleError} ref={ref} />;\n});\n"],"names":["AgreementAvatar","React","forwardRef","props","ref","src","fallbackSrc","otherProps","loaded","setLoaded","useState","handleLoad","handleError","event","target","className","cn","visible","onLoad","onError"],"mappings":";;;MAKaA,eAAe,gBAAGC,cAAK,CAACC,UAAU,CAAyC,SAASF,eAAeA,CAACG,KAAK,EAAEC,GAAG;EACvH,MAAM;IAAEC,GAAG;IAAEC,WAAW;IAAE,GAAGC;GAAY,GAAGJ,KAAK;EACjD,MAAM,CAACK,MAAM,EAAEC,SAAS,CAAC,GAAGR,cAAK,CAACS,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAMC,UAAU,GAAGA,MAAMF,SAAS,CAAC,IAAI,CAAC;EACxC,MAAMG,WAAW,GAAIC,KAAU;IAC3BA,KAAK,CAACC,MAAM,CAACT,GAAG,GAAGC,WAAW;GACjC;EAED,MAAMS,SAAS,GAAGC,EAAE,CAChB,oFAAoF,EACpF;IACIC,OAAO,EAAET;GACZ,EACDL,KAAK,CAACY,SAAS,CAClB;EAED,oBAAOd,sDAASM,UAAU;IAAEQ,SAAS,EAAEA,SAAS;IAAEV,GAAG,EAAEA,GAAG;IAAEa,MAAM,EAAEP,UAAU;IAAEQ,OAAO,EAAEP,WAAW;IAAER,GAAG,EAAEA;KAAO;AACtH,CAAC;;;;"}
@@ -11,13 +11,15 @@ import '../../../primitives/Collection/Collection.js';
11
11
  import { AgreementItem } from './Agreement/Item.js';
12
12
  import { AgreementDisplay as AgreementDisplay$1 } from './Agreement/Display.js';
13
13
 
14
- const Container = props => {
14
+ const Container = ({
15
+ children
16
+ }) => {
15
17
  return /*#__PURE__*/React__default.createElement("div", {
16
18
  className: "-ml-2 flex flex-shrink-0 flex-grow-0 items-center gap-2 pr-2 xl:ml-auto xl:w-64",
17
19
  "data-taco": "header-agreements"
18
20
  }, /*#__PURE__*/React__default.createElement("span", {
19
21
  className: "hidden h-8 w-px flex-shrink-0 flex-grow-0 bg-white/[0.3] xl:flex"
20
- }), props.children);
22
+ }), children);
21
23
  };
22
24
  function AgreementSelector(props) {
23
25
  const {
@@ -89,7 +91,7 @@ function AgreementSelector(props) {
89
91
  }
90
92
  return button;
91
93
  })), handleAddAgreement ? (/*#__PURE__*/React__default.createElement(Button, {
92
- className: "focus-visible:!yt-focus-dark my-1 mx-2 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]",
94
+ className: "focus-visible:!yt-focus-dark mx-2 my-1 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]",
93
95
  onClick: handleAddAgreement
94
96
  }, texts.header.addAgreement)) : null, /*#__PURE__*/React__default.createElement("hr", {
95
97
  className: "my-0 h-px w-full bg-white/[0.08]"
@@ -1 +1 @@
1
- {"version":3,"file":"AgreementSelector.js","sources":["../../../../../../../../src/components/Header/components/AgreementSelector.tsx"],"sourcesContent":["import React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport * as CollectionPrimitive from '../../../primitives/Collection/Collection';\nimport { AgreementItem } from './Agreement/Item';\nimport { createCustomKeyboardEvent } from '../../../utils/input';\nimport { Icon } from '../../Icon/Icon';\nimport { SearchInput } from '../../SearchInput/SearchInput';\nimport { Button } from '../../Button/Button';\nimport { useLocalization } from '../../Provider/Localization';\nimport { Agreement } from './Agreement/types';\nimport { AgreementDisplay as Display } from './Agreement/Display';\n\nconst Container = props => {\n return (\n <div\n className=\"-ml-2 flex flex-shrink-0 flex-grow-0 items-center gap-2 pr-2 xl:ml-auto xl:w-64\"\n data-taco=\"header-agreements\">\n <span className=\"hidden h-8 w-px flex-shrink-0 flex-grow-0 bg-white/[0.3] xl:flex\" />\n {props.children}\n </div>\n );\n};\n\nexport type AgreementSelectorProps = {\n agreements: Agreement[];\n currentAgreement: Agreement;\n fallbackImageSrc: string;\n filterAgreement: (agreement: Agreement, filter: (agreement: Agreement) => boolean) => void;\n filterClientAgreement: (agreement: Agreement, searchValue: string, filter: (agreement: Agreement) => boolean) => void;\n onAddAgreement?: () => void;\n onChangeAgreement: (agreement: Agreement) => void;\n onLogout: () => void;\n open?: boolean;\n setOpen?: (open: boolean) => void;\n};\n\nexport function AgreementSelector(props: AgreementSelectorProps) {\n const {\n agreements,\n currentAgreement,\n fallbackImageSrc,\n filterAgreement = () => true,\n filterClientAgreement = () => true,\n onAddAgreement: handleAddAgreement,\n onChangeAgreement,\n onLogout: handleLogout,\n open: prop,\n setOpen: onChange,\n } = props;\n const { texts } = useLocalization();\n const collectionRef = React.useRef<CollectionPrimitive.CollectionRef | null>(null);\n const [open, setOpen] = useControllableState<boolean>({\n onChange,\n prop,\n });\n const [search, setSearch] = React.useState('');\n\n React.useEffect(() => {\n setSearch('');\n }, [open]);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter') {\n event.preventDefault();\n collectionRef.current?.dispatchEvent(createCustomKeyboardEvent(event as React.KeyboardEvent<HTMLInputElement>));\n }\n };\n\n const handleChangeAgreement = (agreement: Agreement) => {\n onChangeAgreement(agreement);\n setOpen(false);\n };\n\n return (\n <Container>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger className=\"xl:focus-visible:yt-focus-dark [&:focus-visible_img]:yt-focus-dark w-full rounded outline-none xl:[&:focus-visible_img]:shadow-none\">\n <Display currentAgreement={currentAgreement} fallbackImageSrc={fallbackImageSrc}>\n {agreements ? (\n <Icon\n className=\"ml-auto hidden flex-shrink-0 flex-grow-0 text-white xl:flex\"\n name={open ? 'chevron-up' : 'chevron-down'}\n />\n ) : null}\n </Display>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content className=\"z-[996] mt-2 flex h-[calc(100vh_-_theme(spacing.16))] w-64 flex-col gap-1 bg-blue-900\">\n <SearchInput\n autoFocus\n className=\"focus-visible:!yt-focus-dark mx-2 !border-transparent !bg-white/[0.08] !text-white hover:!bg-white/[0.16] hover:!shadow-none focus:!bg-white/[0.16] active:!bg-white/[0.16] [&+div>button]:!text-white\"\n onChange={event => setSearch(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={texts.header.search}\n />\n <CollectionPrimitive.Root\n querySelector=\"button\"\n className=\"-my-1 flex w-full flex-grow flex-col gap-1 overflow-auto px-2 py-1 outline-none\"\n ref={collectionRef}\n tabIndex={-1}>\n {agreements\n ?.filter(agreement => filterAgreement(agreement, filterBySearchValue(search)))\n .map(agreement => {\n const button = createAgreementButton(\n agreement,\n fallbackImageSrc,\n handleChangeAgreement,\n isCurrentAgreement(agreement, currentAgreement)\n );\n\n if (agreement.clients) {\n return (\n <span\n className=\"flex flex-col gap-px [&>*:first-child>span]:!rounded-t [&>*:last-child>span]:!rounded-b [&>*>span]:!rounded-none\"\n key={`${agreement.number}_${agreement.userId}_clients`}>\n {filterBySearchValue(search)(agreement) ? button : null}\n {agreement.clients\n .filter(agreement =>\n filterClientAgreement(agreement, search, filterBySearchValue(search))\n )\n .map(clientAgreement =>\n createAgreementButton(\n clientAgreement,\n fallbackImageSrc,\n handleChangeAgreement,\n isCurrentAgreement(clientAgreement, currentAgreement)\n )\n )}\n </span>\n );\n }\n\n return button;\n })}\n </CollectionPrimitive.Root>\n {handleAddAgreement ? (\n <Button\n className=\"focus-visible:!yt-focus-dark my-1 mx-2 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]\"\n onClick={handleAddAgreement}>\n {texts.header.addAgreement}\n </Button>\n ) : null}\n <hr className=\"my-0 h-px w-full bg-white/[0.08]\" />\n <a\n className=\"focus-visible:yt-focus-dark mx-2 mb-2 flex h-8 shrink-0 items-center justify-center rounded text-white hover:cursor-pointer hover:text-white hover:underline focus-visible:outline-none\"\n onClick={handleLogout}\n tabIndex={0}>\n {texts.header.logout}\n </a>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Root>\n </Container>\n );\n}\n\nconst filterBySearchValue = (search: string) => (agreement: Agreement) => {\n if (!search || !search.length) {\n return true;\n }\n\n const matchesAgreementNumber = String(agreement.number).indexOf(search) > -1;\n const matchesCompanyName = agreement.name.toLowerCase().indexOf(search.toLowerCase()) > -1;\n\n return matchesAgreementNumber || matchesCompanyName;\n};\n\nconst isCurrentAgreement = (agreement: Agreement, currentAgreement: Agreement) => {\n return agreement.number === currentAgreement.number && agreement.userId === currentAgreement.userId;\n};\n\nconst createAgreementButton = (\n agreement: Agreement,\n fallbackImageSrc: string,\n onChangeAgreement: (agreement: Agreement) => void,\n isCurrentAgreement = false\n) => {\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'Enter') {\n onChangeAgreement(agreement);\n }\n };\n\n return (\n <button\n aria-current={isCurrentAgreement ? 'true' : undefined}\n className=\"focus:yt-focus-dark w-full rounded outline-none\"\n data-taco=\"header-agreements-agreement\"\n key={`${agreement.number}_${agreement.userId}`}\n onClick={() => onChangeAgreement(agreement)}\n onKeyDown={handleKeyDown}\n tabIndex={0}>\n <AgreementItem\n {...agreement}\n className=\"h-14 bg-white/[0.08] xl:hover:bg-white/[0.16] [[aria-current='true']>&]:bg-white/[0.16]\"\n fallbackImageSrc={fallbackImageSrc}\n />\n </button>\n );\n};\n\nexport type AgreementDisplayProps = React.HTMLAttributes<HTMLDivElement> & {\n currentAgreement: Agreement;\n fallbackImageSrc: string;\n};\n\nexport function AgreementDisplay(props: AgreementDisplayProps) {\n const { currentAgreement, fallbackImageSrc } = props;\n\n return (\n <Container>\n <Display currentAgreement={currentAgreement} fallbackImageSrc={fallbackImageSrc} />\n </Container>\n );\n}\n"],"names":["Container","props","React","className","children","AgreementSelector","agreements","currentAgreement","fallbackImageSrc","filterAgreement","filterClientAgreement","onAddAgreement","handleAddAgreement","onChangeAgreement","onLogout","handleLogout","open","prop","setOpen","onChange","texts","useLocalization","collectionRef","useRef","useControllableState","search","setSearch","useState","useEffect","handleKeyDown","event","key","_collectionRef$curren","preventDefault","current","dispatchEvent","createCustomKeyboardEvent","handleChangeAgreement","agreement","PopoverPrimitive","onOpenChange","Display","Icon","name","SearchInput","autoFocus","target","value","onKeyDown","placeholder","header","CollectionPrimitive","querySelector","ref","tabIndex","filter","filterBySearchValue","map","button","createAgreementButton","isCurrentAgreement","clients","number","userId","clientAgreement","Button","onClick","addAgreement","logout","length","matchesAgreementNumber","String","indexOf","matchesCompanyName","toLowerCase","undefined","AgreementItem","AgreementDisplay"],"mappings":";;;;;;;;;;;;;AAaA,MAAMA,SAAS,GAAGC,KAAK;EACnB,oBACIC;IACIC,SAAS,EAAC,iFAAiF;iBACjF;kBACVD;IAAMC,SAAS,EAAC;IAAqE,EACpFF,KAAK,CAACG,QAAQ,CACb;AAEd,CAAC;SAeeC,iBAAiBA,CAACJ,KAA6B;EAC3D,MAAM;IACFK,UAAU;IACVC,gBAAgB;IAChBC,gBAAgB;IAChBC,eAAe,GAAGA,MAAM,IAAI;IAC5BC,qBAAqB,GAAGA,MAAM,IAAI;IAClCC,cAAc,EAAEC,kBAAkB;IAClCC,iBAAiB;IACjBC,QAAQ,EAAEC,YAAY;IACtBC,IAAI,EAAEC,IAAI;IACVC,OAAO,EAAEC;GACZ,GAAGlB,KAAK;EACT,MAAM;IAAEmB;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,aAAa,GAAGpB,cAAK,CAACqB,MAAM,CAA2C,IAAI,CAAC;EAClF,MAAM,CAACP,IAAI,EAAEE,OAAO,CAAC,GAAGM,oBAAoB,CAAU;IAClDL,QAAQ;IACRF;GACH,CAAC;EACF,MAAM,CAACQ,MAAM,EAAEC,SAAS,CAAC,GAAGxB,cAAK,CAACyB,QAAQ,CAAC,EAAE,CAAC;EAE9CzB,cAAK,CAAC0B,SAAS,CAAC;IACZF,SAAS,CAAC,EAAE,CAAC;GAChB,EAAE,CAACV,IAAI,CAAC,CAAC;EAEV,MAAMa,aAAa,GAAIC,KAA0B;IAC7C,IAAIA,KAAK,CAACC,GAAG,KAAK,WAAW,IAAID,KAAK,CAACC,GAAG,KAAK,SAAS,IAAID,KAAK,CAACC,GAAG,KAAK,OAAO,EAAE;MAAA,IAAAC,qBAAA;MAC/EF,KAAK,CAACG,cAAc,EAAE;MACtB,CAAAD,qBAAA,GAAAV,aAAa,CAACY,OAAO,cAAAF,qBAAA,uBAArBA,qBAAA,CAAuBG,a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elector.js","sources":["../../../../../../../../src/components/Header/components/AgreementSelector.tsx"],"sourcesContent":["import React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport * as CollectionPrimitive from '../../../primitives/Collection/Collection';\nimport { AgreementItem } from './Agreement/Item';\nimport { createCustomKeyboardEvent } from '../../../utils/input';\nimport { Icon } from '../../Icon/Icon';\nimport { SearchInput } from '../../SearchInput/SearchInput';\nimport { Button } from '../../Button/Button';\nimport { useLocalization } from '../../Provider/Localization';\nimport { Agreement } from './Agreement/types';\nimport { AgreementDisplay as Display } from './Agreement/Display';\n\nconst Container = ({ children }: { children: React.ReactNode }) => {\n return (\n <div\n className=\"-ml-2 flex flex-shrink-0 flex-grow-0 items-center gap-2 pr-2 xl:ml-auto xl:w-64\"\n data-taco=\"header-agreements\">\n <span className=\"hidden h-8 w-px flex-shrink-0 flex-grow-0 bg-white/[0.3] xl:flex\" />\n {children}\n </div>\n );\n};\n\nexport type AgreementSelectorProps = {\n agreements: Agreement[];\n currentAgreement: Agreement;\n fallbackImageSrc: string;\n filterAgreement: (agreement: Agreement, filter: (agreement: Agreement) => boolean) => void;\n filterClientAgreement: (agreement: Agreement, searchValue: string, filter: (agreement: Agreement) => boolean) => void;\n onAddAgreement?: () => void;\n onChangeAgreement: (agreement: Agreement) => void;\n onLogout: () => void;\n open?: boolean;\n setOpen?: (open: boolean) => void;\n};\n\nexport function AgreementSelector(props: AgreementSelectorProps) {\n const {\n agreements,\n currentAgreement,\n fallbackImageSrc,\n filterAgreement = () => true,\n filterClientAgreement = () => true,\n onAddAgreement: handleAddAgreement,\n onChangeAgreement,\n onLogout: handleLogout,\n open: prop,\n setOpen: onChange,\n } = props;\n const { texts } = useLocalization();\n const collectionRef = React.useRef<CollectionPrimitive.CollectionRef | null>(null);\n const [open, setOpen] = useControllableState<boolean>({\n onChange,\n prop,\n });\n const [search, setSearch] = React.useState('');\n\n React.useEffect(() => {\n setSearch('');\n }, [open]);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter') {\n event.preventDefault();\n collectionRef.current?.dispatchEvent(createCustomKeyboardEvent(event as React.KeyboardEvent<HTMLInputElement>));\n }\n };\n\n const handleChangeAgreement = (agreement: Agreement) => {\n onChangeAgreement(agreement);\n setOpen(false);\n };\n\n return (\n <Container>\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger className=\"xl:focus-visible:yt-focus-dark [&:focus-visible_img]:yt-focus-dark w-full rounded outline-none xl:[&:focus-visible_img]:shadow-none\">\n <Display currentAgreement={currentAgreement} fallbackImageSrc={fallbackImageSrc}>\n {agreements ? (\n <Icon\n className=\"ml-auto hidden flex-shrink-0 flex-grow-0 text-white xl:flex\"\n name={open ? 'chevron-up' : 'chevron-down'}\n />\n ) : null}\n </Display>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Content className=\"z-[996] mt-2 flex h-[calc(100vh_-_theme(spacing.16))] w-64 flex-col gap-1 bg-blue-900\">\n <SearchInput\n autoFocus\n className=\"focus-visible:!yt-focus-dark mx-2 !border-transparent !bg-white/[0.08] !text-white hover:!bg-white/[0.16] hover:!shadow-none focus:!bg-white/[0.16] active:!bg-white/[0.16] [&+div>button]:!text-white\"\n onChange={event => setSearch(event.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={texts.header.search}\n />\n <CollectionPrimitive.Root\n querySelector=\"button\"\n className=\"-my-1 flex w-full flex-grow flex-col gap-1 overflow-auto px-2 py-1 outline-none\"\n ref={collectionRef}\n tabIndex={-1}>\n {agreements\n ?.filter(agreement => filterAgreement(agreement, filterBySearchValue(search)))\n .map(agreement => {\n const button = createAgreementButton(\n agreement,\n fallbackImageSrc,\n handleChangeAgreement,\n isCurrentAgreement(agreement, currentAgreement)\n );\n\n if (agreement.clients) {\n return (\n <span\n className=\"flex flex-col gap-px [&>*:first-child>span]:!rounded-t [&>*:last-child>span]:!rounded-b [&>*>span]:!rounded-none\"\n key={`${agreement.number}_${agreement.userId}_clients`}>\n {filterBySearchValue(search)(agreement) ? button : null}\n {agreement.clients\n .filter(agreement =>\n filterClientAgreement(agreement, search, filterBySearchValue(search))\n )\n .map(clientAgreement =>\n createAgreementButton(\n clientAgreement,\n fallbackImageSrc,\n handleChangeAgreement,\n isCurrentAgreement(clientAgreement, currentAgreement)\n )\n )}\n </span>\n );\n }\n\n return button;\n })}\n </CollectionPrimitive.Root>\n {handleAddAgreement ? (\n <Button\n className=\"focus-visible:!yt-focus-dark mx-2 my-1 !h-9 shrink-0 !bg-white/[0.08] !text-white hover:!bg-white/[0.16]\"\n onClick={handleAddAgreement}>\n {texts.header.addAgreement}\n </Button>\n ) : null}\n <hr className=\"my-0 h-px w-full bg-white/[0.08]\" />\n <a\n className=\"focus-visible:yt-focus-dark mx-2 mb-2 flex h-8 shrink-0 items-center justify-center rounded text-white hover:cursor-pointer hover:text-white hover:underline focus-visible:outline-none\"\n onClick={handleLogout}\n tabIndex={0}>\n {texts.header.logout}\n </a>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Root>\n </Container>\n );\n}\n\nconst filterBySearchValue = (search: string) => (agreement: Agreement) => {\n if (!search || !search.length) {\n return true;\n }\n\n const matchesAgreementNumber = String(agreement.number).indexOf(search) > -1;\n const matchesCompanyName = agreement.name.toLowerCase().indexOf(search.toLowerCase()) > -1;\n\n return matchesAgreementNumber || matchesCompanyName;\n};\n\nconst isCurrentAgreement = (agreement: Agreement, currentAgreement: Agreement) => {\n return agreement.number === currentAgreement.number && agreement.userId === currentAgreement.userId;\n};\n\nconst createAgreementButton = (\n agreement: Agreement,\n fallbackImageSrc: string,\n onChangeAgreement: (agreement: Agreement) => void,\n isCurrentAgreement = false\n) => {\n const handleKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === 'Enter') {\n onChangeAgreement(agreement);\n }\n };\n\n return (\n <button\n aria-current={isCurrentAgreement ? 'true' : undefined}\n className=\"focus:yt-focus-dark w-full rounded outline-none\"\n data-taco=\"header-agreements-agreement\"\n key={`${agreement.number}_${agreement.userId}`}\n onClick={() => onChangeAgreement(agreement)}\n onKeyDown={handleKeyDown}\n tabIndex={0}>\n <AgreementItem\n {...agreement}\n className=\"h-14 bg-white/[0.08] xl:hover:bg-white/[0.16] [[aria-current='true']>&]:bg-white/[0.16]\"\n fallbackImageSrc={fallbackImageSrc}\n />\n </button>\n );\n};\n\nexport type AgreementDisplayProps = React.HTMLAttributes<HTMLDivElement> & {\n currentAgreement: Agreement;\n fallbackImageSrc: string;\n};\n\nexport function AgreementDisplay(props: AgreementDisplayProps) {\n const { currentAgreement, fallbackImageSrc } = props;\n\n return (\n <Container>\n <Display currentAgreement={currentAgreement} fallbackImageSrc={fallbackImageSrc} />\n </Container>\n );\n}\n"],"names":["Container","children","React","className","AgreementSelector","props","agreements","currentAgreement","fallbackImageSrc","filterAgreement","filterClientAgreement","onAddAgreement","handleAddAgreement","onChangeAgreement","onLogout","handleLogout","open","prop","setOpen","onChange","texts","useLocalization","collectionRef","useRef","useControllableState","search","setSearch","useState","useEffect","handleKeyDown","event","key","_collectionRef$curren","preventDefault","current","dispatchEvent","createCustomKeyboardEvent","handleChangeAgreement","agreement","PopoverPrimitive","onOpenChange","Display","Icon","name","SearchInput","autoFocus","target","value","onKeyDown","placeholder","header","CollectionPrimitive","querySelector","ref","tabIndex","filter","filterBySearchValue","map","button","createAgreementButton","isCurrentAgreement","clients","number","userId","clientAgreement","Button","onClick","addAgreement","logout","length","matchesAgreementNumber","String","indexOf","matchesCompanyName","toLowerCase","undefined","AgreementItem","AgreementDisplay"],"mappings":";;;;;;;;;;;;;AAaA,MAAMA,SAAS,GAAGA,CAAC;EAAEC;CAAyC;EAC1D,oBACIC;IACIC,SAAS,EAAC,iFAAiF;iBACjF;kBACVD;IAAMC,SAAS,EAAC;IAAqE,EACpFF,QAAQ,CACP;AAEd,CAAC;SAeeG,iBAAiB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B,CAACuD,MAAM,IAAIxB,SAAS,CAACyB,MAAM,KAAKxD,gBAAgB,CAACwD,MAAM;AACvG,CAAC;AAED,MAAMJ,qBAAqB,GAAGA,CAC1BrB,SAAoB,EACpB9B,gBAAwB,EACxBK,iBAAiD,EACjD+C,kBAAkB,GAAG,KAAK;EAE1B,MAAM/B,aAAa,GAAIC,KAA6C;IAChE,IAAIA,KAAK,CAACC,GAAG,KAAK,OAAO,EAAE;MACvBlB,iBAAiB,CAACyB,SAAS,CAAC;;GAEnC;EAED,oBACIpC;oBACkB0D,kBAAkB,GAAG,MAAM,GAAGe,SAAS;IACrDxE,SAAS,EAAC,iDAAiD;iBACjD,6BAA6B;IACvC4B,GAAG,EAAE,GAAGO,SAAS,CAACwB,MAAM,IAAIxB,SAAS,CAACyB,MAAM,EAAE;IAC9CG,OAAO,EAAEA,MAAMrD,iBAAiB,CAACyB,SAAS,CAAC;IAC3CU,SAAS,EAAEnB,aAAa;IACxByB,QAAQ,EAAE;kBACVpD,6BAAC0E,aAAa,oBACNtC,SAAS;IACbnC,SAAS,EAAC,yFAAyF;IACnGK,gBAAgB,EAAEA;KACpB,CACG;AAEjB,CAAC;SAOeqE,gBAAgBA,CAACxE,KAA4B;EACzD,MAAM;IAAEE,gBAAgB;IAAEC;GAAkB,GAAGH,KAAK;EAEpD,oBACIH,6BAACF,SAAS,qBACNE,6BAACuC,kBAAO;IAAClC,gBAAgB,EAAEA,gBAAgB;IAAEC,gBAAgB,EAAEA;IAAoB,CAC3E;AAEpB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../../../../../src/components/Input/util.ts"],"sourcesContent":["import cn from 'clsx';\n\nexport const getInputClasses = props => {\n const disabled = props.disabled || !!props['aria-disabled'];\n const readOnly = props.readOnly || !!props['aria-readonly'];\n const invalid = props.invalid || !!props['aria-invalid'];\n\n return cn(\n 'peer text-black text-sm border font-normal not-italic no-underline rounded flex items-center leading-6 px-2 relative w-full text-ellipsis transition-colors transition-opacity ease-in min-h-[theme(spacing.8)] focus-visible:yt-focus',\n // hide the arrow controls on input[type=number]\n '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n {\n 'bg-white': !props.highlighted && !readOnly,\n // default\n 'border-grey-300 enabled:hover:border-grey-500 disabled:border-grey-200': !invalid,\n // disabled\n 'text-opacity-25 cursor-not-allowed placeholder:text-grey-700': disabled,\n // highlighted\n 'bg-yellow-100/50': props.highlighted && disabled,\n 'bg-yellow-100': props.highlighted && !disabled,\n // invalid\n 'border-red-500 enabled:hover:border-red-700 disabled:border-red-500/50': invalid,\n // readOnly\n 'cursor-not-allowed text-black bg-grey-200': readOnly,\n }\n );\n};\n\nexport const getButtonStateClasses = (invalid: boolean | undefined, disabled = false): string => {\n if (invalid) {\n return cn('border border-red-500 group-peer-hover:enabled:border-red-700 transition-colors ease-in', {\n 'border-red-500/30': disabled,\n });\n }\n\n return 'border border-grey-300 group-peer-hover:enabled:border-grey-500 transition-colors transition-opacity ease-in';\n};\n"],"names":["getInputClasses","props","disabled","readOnly","invalid","cn","highlighted","getButtonStateClasses"],"mappings":";;MAEaA,eAAe,GAAGC,KAAK;EAChC,MAAMC,QAAQ,GAAGD,KAAK,CAACC,QAAQ,IAAI,CAAC,CAACD,KAAK,CAAC,eAAe,CAAC;EAC3D,MAAME,QAAQ,GAAGF,KAAK,CAACE,QAAQ,IAAI,CAAC,CAACF,KAAK,CAAC,eAAe,CAAC;EAC3D,MAAMG,OAAO,GAAGH,KAAK,CAACG,OAAO,IAAI,CAAC,CAACH,KAAK,CAAC,cAAc,CAAC;EAExD,OAAOI,EAAE,CACL,wOAAwO;;EAExO,sHAAsH,EACtH;IACI,UAAU,EAAE,CAACJ,KAAK,CAACK,WAAW,IAAI,CAACH,QAAQ;;IAE3C,wEAAwE,EAAE,CAACC,OAAO;;IAElF,8DAA8D,EAAEF,QAAQ;;IAExE,kBAAkB,EAAED,KAAK,CAACK,WAAW,IAAIJ,QAAQ;IACjD,eAAe,EAAED,KAAK,CAACK,WAAW,IAAI,CAACJ,QAAQ;;IAE/C,wEAAwE,EAAEE,OAAO;;IAEjF,2CAA2C,EAAED;GAChD,CACJ;AACL;MAEaI,qBAAqB,GAAGA,CAACH,OAA4B,EAAEF,QAAQ,GAAG,KAAK;EAChF,IAAIE,OAAO,EAAE;IACT,OAAOC,EAAE,CAAC,yFAAyF,EAAE;MACjG,mBAAmB,EAAEH;KACxB,CAAC;;EAGN,OAAO,8GAA8G;AACzH;;;;"}
1
+ {"version":3,"file":"util.js","sources":["../../../../../../../src/components/Input/util.ts"],"sourcesContent":["import cn from 'clsx';\n\ntype InputClassesProps = {\n disabled: boolean;\n readOnly: boolean;\n invalid: boolean;\n highlighted: boolean;\n ['aria-disabled']: any;\n ['aria-readonly']: any;\n ['aria-invalid']: any;\n};\n\nexport const getInputClasses = (props: Partial<InputClassesProps>) => {\n const disabled = props.disabled || !!props['aria-disabled'];\n const readOnly = props.readOnly || !!props['aria-readonly'];\n const invalid = props.invalid || !!props['aria-invalid'];\n\n return cn(\n 'peer text-black text-sm border font-normal not-italic no-underline rounded flex items-center leading-6 px-2 relative w-full text-ellipsis transition-colors transition-opacity ease-in min-h-[theme(spacing.8)] focus-visible:yt-focus',\n // hide the arrow controls on input[type=number]\n '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none',\n {\n 'bg-white': !props.highlighted && !readOnly,\n // default\n 'border-grey-300 enabled:hover:border-grey-500 disabled:border-grey-200': !invalid,\n // disabled\n 'text-opacity-25 cursor-not-allowed placeholder:text-grey-700': disabled,\n // highlighted\n 'bg-yellow-100/50': props.highlighted && disabled,\n 'bg-yellow-100': props.highlighted && !disabled,\n // invalid\n 'border-red-500 enabled:hover:border-red-700 disabled:border-red-500/50': invalid,\n // readOnly\n 'cursor-not-allowed text-black bg-grey-200': readOnly,\n }\n );\n};\n\nexport const getButtonStateClasses = (invalid: boolean | undefined, disabled = false): string => {\n if (invalid) {\n return cn('border border-red-500 group-peer-hover:enabled:border-red-700 transition-colors ease-in', {\n 'border-red-500/30': disabled,\n });\n }\n\n return 'border border-grey-300 group-peer-hover:enabled:border-grey-500 transition-colors transition-opacity ease-in';\n};\n"],"names":["getInputClasses","props","disabled","readOnly","invalid","cn","highlighted","getButtonStateClasses"],"mappings":";;MAYaA,eAAe,GAAIC,KAAiC;EAC7D,MAAMC,QAAQ,GAAGD,KAAK,CAACC,QAAQ,IAAI,CAAC,CAACD,KAAK,CAAC,eAAe,CAAC;EAC3D,MAAME,QAAQ,GAAGF,KAAK,CAACE,QAAQ,IAAI,CAAC,CAACF,KAAK,CAAC,eAAe,CAAC;EAC3D,MAAMG,OAAO,GAAGH,KAAK,CAACG,OAAO,IAAI,CAAC,CAACH,KAAK,CAAC,cAAc,CAAC;EAExD,OAAOI,EAAE,CACL,wOAAwO;;EAExO,sHAAsH,EACtH;IACI,UAAU,EAAE,CAACJ,KAAK,CAACK,WAAW,IAAI,CAACH,QAAQ;;IAE3C,wEAAwE,EAAE,CAACC,OAAO;;IAElF,8DAA8D,EAAEF,QAAQ;;IAExE,kBAAkB,EAAED,KAAK,CAACK,WAAW,IAAIJ,QAAQ;IACjD,eAAe,EAAED,KAAK,CAACK,WAAW,IAAI,CAACJ,QAAQ;;IAE/C,wEAAwE,EAAEE,OAAO;;IAEjF,2CAA2C,EAAED;GAChD,CACJ;AACL;MAEaI,qBAAqB,GAAGA,CAACH,OAA4B,EAAEF,QAAQ,GAAG,KAAK;EAChF,IAAIE,OAAO,EAAE;IACT,OAAOC,EAAE,CAAC,yFAAyF,EAAE;MACjG,mBAAmB,EAAEH;KACxB,CAAC;;EAGN,OAAO,8GAA8G;AACzH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.js","sources":["../../../../../../../../src/components/Layout/components/Sidebar.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { LayoutContext } from './Context';\nimport { useIsLargeScreen } from '../../../hooks/useIsLargeScreen';\nimport { Backdrop, BackdropProps } from '../../Backdrop/Backdrop';\n\nconst SidebarBackdrop = motion<BackdropProps>(Backdrop);\n\nexport type LayoutSidebarProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, LayoutSidebarProps>(function LayoutSidebar(props, ref) {\n const { children, ...attributes } = props;\n const { sidebarOpen, setSidebarOpen } = React.useContext(LayoutContext);\n const isLargeScreen = useIsLargeScreen();\n const isSmallScreen = !isLargeScreen;\n\n // if it's a large screen we override the open state and make it always visible\n const isVisible = isLargeScreen || sidebarOpen;\n\n // ensures the menu is always closed by default when resizing to a smaller window size\n React.useEffect(() => {\n setSidebarOpen(isLargeScreen);\n }, [isLargeScreen]);\n\n React.useEffect(() => {\n const handleEscapeKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n setSidebarOpen(false);\n }\n };\n\n if (isSmallScreen && sidebarOpen) {\n window.addEventListener('keydown', handleEscapeKey);\n }\n\n return () => {\n window.removeEventListener('keydown', handleEscapeKey);\n };\n }, [isSmallScreen, sidebarOpen]);\n\n const showBackdrop = isSmallScreen && sidebarOpen === true;\n\n const [ready, setReady] = React.useState(isSmallScreen);\n\n const className = cn(\n 'bg-grey-50 h-full w-64 flex-shrink-0 flex-grow-0 print:hidden',\n {\n 'absolute z-10 aria-hidden:-translate-x-64 ': isSmallScreen,\n // prevent animation when crossing the boundary from large to small screen,\n // this prevents awkward animation in the edge case (resizing the browser, instead of starting at a given size)\n invisible: isSmallScreen && !ready,\n 'transition-[transform] duration-300 visible': isSmallScreen && ready,\n 'border-r-2 border-black/[.08] ': !showBackdrop,\n },\n props.className\n );\n\n React.useEffect(() => {\n // ensure state is updated in the next cpu tick so that the animation definitely doesn't run\n setTimeout(() => {\n setReady(isSmallScreen);\n }, 1);\n }, [isSmallScreen]);\n\n const toggleSidebar = () => setSidebarOpen(open => !open);\n const content = typeof children === 'function' ? children({ isLargeScreen, open: sidebarOpen, toggleSidebar }) : children;\n\n if (!content) {\n return null;\n }\n\n return (\n <>\n <nav {...attributes} data-responsive={isSmallScreen} aria-hidden={!isVisible} className={className} ref={ref}>\n {content}\n </nav>\n <AnimatePresence>\n {showBackdrop && (\n <SidebarBackdrop\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"z-[1]\"\n onClick={() => setSidebarOpen(false)}\n />\n )}\n </AnimatePresence>\n </>\n );\n});\n"],"names":["SidebarBackdrop","motion","Backdrop","Sidebar","React","forwardRef","LayoutSidebar","props","ref","children","attributes","sidebarOpen","setSidebarOpen","useContext","LayoutContext","isLargeScreen","useIsLargeScreen","isSmallScreen","isVisible","useEffect","handleEscapeKey","event","key","preventDefault","stopPropagation","window","addEventListener","removeEventListener","showBackdrop","ready","setReady","useState","className","cn","invisible","setTimeout","toggleSidebar","open","content","AnimatePresence","initial","opacity","animate","exit","onClick"],"mappings":";;;;;;;AAOA,MAAMA,eAAe,gBAAGC,MAAM,CAAgBC,QAAQ,CAAC;MAI1CC,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAAqC,SAASC,aAAaA,CAACC,KAAK,EAAEC,GAAG;EACzG,MAAM;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGH,KAAK;EACzC,MAAM;IAAEI,WAAW;IAAEC;GAAgB,GAAGR,cAAK,CAACS,UAAU,CAACC,aAAa,CAAC;EACvE,MAAMC,aAAa,GAAGC,gBAAgB,EAAE;EACxC,MAAMC,aAAa,GAAG,CAACF,aAAa;;EAGpC,MAAMG,SAAS,GAAGH,aAAa,IAAIJ,WAAW;;EAG9CP,cAAK,CAACe,SAAS,CAAC;IACZP,cAAc,CAACG,aAAa,CAAC;GAChC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnBX,cAAK,CAACe,SAAS,CAAC;IACZ,MAAMC,eAAe,GAAIC,KAAoB;MACzC,IAAIA,K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O,aAAa;mBAAe,CAACC,SAAS;IAAEc,SAAS,EAAEA,SAAS;IAAExB,GAAG,EAAEA;MACpG8B,OAAO,CACN,eACNlC,6BAACmC,eAAe,QACXX,YAAY,kBACTxB,6BAACJ,eAAe;IACZwC,OAAO,EAAE;MAAEC,OAAO,EAAE;KAAG;IACvBC,OAAO,EAAE;MAAED,OAAO,EAAE;KAAG;IACvBE,IAAI,EAAE;MAAEF,OAAO,EAAE;KAAG;IACpBT,SAAS,EAAC,OAAO;IACjBY,OAAO,EAAEA,MAAMhC,cAAc,CAAC,KAAK;IACrC,CACL,CACa,CACnB;AAEX,CAAC;;;;"}
1
+ {"version":3,"file":"Sidebar.js","sources":["../../../../../../../../src/components/Layout/components/Sidebar.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { LayoutContext } from './Context';\nimport { useIsLargeScreen } from '../../../hooks/useIsLargeScreen';\nimport { Backdrop, BackdropProps } from '../../Backdrop/Backdrop';\n\nconst SidebarBackdrop = motion<BackdropProps>(Backdrop);\n\nexport type LayoutSidebarProps = React.HTMLAttributes<HTMLDivElement> & {\n children:\n | React.ReactNode\n | (({\n isLargeScreen,\n open,\n toggleSidebar,\n }: {\n isLargeScreen: boolean;\n open: boolean;\n toggleSidebar: () => void;\n }) => React.ReactNode);\n};\n\nexport const Sidebar = React.forwardRef<HTMLDivElement, LayoutSidebarProps>(function LayoutSidebar(props, ref) {\n const { children, ...attributes } = props;\n const { sidebarOpen, setSidebarOpen } = React.useContext(LayoutContext);\n const isLargeScreen = useIsLargeScreen();\n const isSmallScreen = !isLargeScreen;\n\n // if it's a large screen we override the open state and make it always visible\n const isVisible = isLargeScreen || sidebarOpen;\n\n // ensures the menu is always closed by default when resizing to a smaller window size\n React.useEffect(() => {\n setSidebarOpen(isLargeScreen);\n }, [isLargeScreen]);\n\n React.useEffect(() => {\n const handleEscapeKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n setSidebarOpen(false);\n }\n };\n\n if (isSmallScreen && sidebarOpen) {\n window.addEventListener('keydown', handleEscapeKey);\n }\n\n return () => {\n window.removeEventListener('keydown', handleEscapeKey);\n };\n }, [isSmallScreen, sidebarOpen]);\n\n const showBackdrop = isSmallScreen && sidebarOpen === true;\n\n const [ready, setReady] = React.useState(isSmallScreen);\n\n const className = cn(\n 'bg-grey-50 h-full w-64 flex-shrink-0 flex-grow-0 print:hidden',\n {\n 'absolute z-10 aria-hidden:-translate-x-64 ': isSmallScreen,\n // prevent animation when crossing the boundary from large to small screen,\n // this prevents awkward animation in the edge case (resizing the browser, instead of starting at a given size)\n invisible: isSmallScreen && !ready,\n 'transition-[transform] duration-300 visible': isSmallScreen && ready,\n 'border-r-2 border-black/[.08] ': !showBackdrop,\n },\n props.className\n );\n\n React.useEffect(() => {\n // ensure state is updated in the next cpu tick so that the animation definitely doesn't run\n setTimeout(() => {\n setReady(isSmallScreen);\n }, 1);\n }, [isSmallScreen]);\n\n const toggleSidebar = () => setSidebarOpen(open => !open);\n const content = typeof children === 'function' ? children({ isLargeScreen, open: sidebarOpen, toggleSidebar }) : children;\n\n if (!content) {\n return null;\n }\n\n return (\n <>\n <nav {...attributes} data-responsive={isSmallScreen} aria-hidden={!isVisible} className={className} ref={ref}>\n {content}\n </nav>\n <AnimatePresence>\n {showBackdrop && (\n <SidebarBackdrop\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n className=\"z-[1]\"\n onClick={() => setSidebarOpen(false)}\n />\n )}\n </AnimatePresence>\n </>\n );\n});\n"],"names":["SidebarBackdrop","motion","Backdrop","Sidebar","React","forwardRef","LayoutSidebar","props","ref","children","attributes","sidebarOpen","setSidebarOpen","useContext","LayoutContext","isLargeScreen","useIsLargeScreen","isSmallScreen","isVisible","useEffect","handleEscapeKey","event","key","preventDefault","stopPropagation","window","addEventListener","removeEventListener","showBackdrop","ready","setReady","useState","className","cn","invisible","setTimeout","toggleSidebar","open","content","AnimatePresence","initial","opacity","animate","exit","onClick"],"mappings":";;;;;;;AAOA,MAAMA,eAAe,gBAAGC,MAAM,CAAgBC,QAAQ,CAAC;MAgB1CC,OAAO,gBAAGC,cAAK,CAACC,UAAU,CAAqC,SAASC,aAAaA,CAACC,KAAK,EAAEC,GAAG;EACzG,MAAM;IAAEC,QAAQ;IAAE,GAAGC;GAAY,GAAGH,KAAK;EACzC,MAAM;IAAEI,WAAW;IAAEC;GAAgB,GAAGR,cAAK,CAACS,UAAU,CAACC,aAAa,CAAC;EACvE,MAAMC,aAAa,GAAGC,gBAAgB,EAAE;EACxC,MAAMC,aAAa,GAAG,CAACF,aAAa;;EAGpC,MAAMG,SAAS,GAAGH,aAAa,IAAIJ,WAAW;;EAG9CP,cAAK,CAACe,SAAS,CAAC;IACZP,cAAc,CAACG,aAAa,CAAC;GAChC,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnBX,cAAK,CAACe,SAAS,CAAC;IACZ,MAAMC,eAAe,GAAIC,KAAoB;MACzC,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,EAAE;QACxBD,KAAK,CAACE,cAAc,EAAE;QACtBF,KAAK,CAACG,eAAe,EAAE;QACvBZ,cAAc,CAAC,KAAK,CAAC;;KAE5B;IAED,IAAIK,aAAa,IAAIN,WAAW,EAAE;MAC9Bc,MAAM,CAACC,gBAAgB,CAAC,SAAS,EAAEN,eAAe,CAAC;;IAGvD,OAAO;MACHK,MAAM,CAACE,mBAAmB,CAAC,SAAS,EAAEP,eAAe,CAAC;KACzD;GACJ,EAAE,CAACH,aAAa,EAAEN,WAAW,CAAC,CAAC;EAEhC,MAAMiB,YAAY,GAAGX,aAAa,IAAIN,WAAW,KAAK,IAAI;EAE1D,MAAM,CAACkB,KAAK,EAAEC,QAAQ,CAAC,GAAG1B,cAAK,CAAC2B,QAAQ,CAACd,aAAa,CAAC;EAEvD,MAAMe,SAAS,GAAGC,EAAE,CAChB,+DAA+D,EAC/D;IACI,4CAA4C,EAAEhB,aAAa;;;IAG3DiB,SAAS,EAAEjB,aAAa,IAAI,CAACY,KAAK;IAClC,6CAA6C,EAAEZ,aAAa,IAAIY,KAAK;IACrE,gCAAgC,EAAE,CAACD;GACtC,EACDrB,KAAK,CAACyB,SAAS,CAClB;EAED5B,cAAK,CAACe,SAAS,CAAC;;IAEZgB,UAAU,CAAC;MACPL,QAAQ,CAACb,aAAa,CAAC;KAC1B,EAAE,CAAC,CAAC;GACR,EAAE,CAACA,aAAa,CAAC,CAAC;EAEnB,MAAMmB,aAAa,GAAGA,MAAMxB,cAAc,CAACyB,IAAI,IAAI,CAACA,IAAI,CAAC;EACzD,MAAMC,OAAO,GAAG,OAAO7B,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAAC;IAAEM,aAAa;IAAEsB,IAAI,EAAE1B,WAAW;IAAEyB;GAAe,CAAC,GAAG3B,QAAQ;EAEzH,IAAI,CAAC6B,OAAO,EAAE;IACV,OAAO,IAAI;;EAGf,oBACIlC,yEACIA,sDAASM,UAAU;uBAAmBO,aAAa;mBAAe,CAACC,SAAS;IAAEc,SAAS,EAAEA,SAAS;IAAExB,GAAG,EAAEA;MACpG8B,OAAO,CACN,eACNlC,6BAACmC,eAAe,QACXX,YAAY,kBACTxB,6BAACJ,eAAe;IACZwC,OAAO,EAAE;MAAEC,OAAO,EAAE;KAAG;IACvBC,OAAO,EAAE;MAAED,OAAO,EAAE;KAAG;IACvBE,IAAI,EAAE;MAAEF,OAAO,EAAE;KAAG;IACpBT,SAAS,EAAC,OAAO;IACjBY,OAAO,EAAEA,MAAMhC,cAAc,CAAC,KAAK;IACrC,CACL,CACa,CACnB;AAEX,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Top.js","sources":["../../../../../../../../src/components/Layout/components/Top.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutContext } from './Context';\n\nexport type LayoutTopProps = {\n children: React.ReactNode | React.ReactNode[] | (({ toggleSidebar }) => React.ReactNode | React.ReactNode[]);\n};\n\nexport const Top = (props: LayoutTopProps) => {\n const { setSidebarOpen } = React.useContext(LayoutContext);\n const toggleSidebar = () => setSidebarOpen(open => !open);\n\n return typeof props.children === 'function' ? props.children({ toggleSidebar }) : props.children;\n};\n"],"names":["Top","props","setSidebarOpen","React","useContext","LayoutContext","toggleSidebar","open","children"],"mappings":";;;MAOaA,GAAG,GAAIC,KAAqB;EACrC,MAAM;IAAEC;GAAgB,GAAGC,cAAK,CAACC,UAAU,CAACC,aAAa,CAAC;EAC1D,MAAMC,aAAa,GAAGA,MAAMJ,cAAc,CAACK,IAAI,IAAI,CAACA,IAAI,CAAC;EAEzD,OAAO,OAAON,KAAK,CAACO,QAAQ,KAAK,UAAU,GAAGP,KAAK,CAACO,QAAQ,CAAC;IAAEF;GAAe,CAAC,GAAGL,KAAK,CAACO,QAAQ;AACpG;;;;"}
1
+ {"version":3,"file":"Top.js","sources":["../../../../../../../../src/components/Layout/components/Top.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutContext } from './Context';\n\nexport type LayoutTopProps = {\n children:\n | React.ReactNode\n | React.ReactNode[]\n | (({ toggleSidebar }: { toggleSidebar: () => void }) => React.ReactNode | React.ReactNode[]);\n};\n\nexport const Top = (props: LayoutTopProps) => {\n const { setSidebarOpen } = React.useContext(LayoutContext);\n const toggleSidebar = () => setSidebarOpen(open => !open);\n\n return typeof props.children === 'function' ? props.children({ toggleSidebar }) : props.children;\n};\n"],"names":["Top","props","setSidebarOpen","React","useContext","LayoutContext","toggleSidebar","open","children"],"mappings":";;;MAUaA,GAAG,GAAIC,KAAqB;EACrC,MAAM;IAAEC;GAAgB,GAAGC,cAAK,CAACC,UAAU,CAACC,aAAa,CAAC;EAC1D,MAAMC,aAAa,GAAGA,MAAMJ,cAAc,CAACK,IAAI,IAAI,CAACA,IAAI,CAAC;EAEzD,OAAO,OAAON,KAAK,CAACO,QAAQ,KAAK,UAAU,GAAGP,KAAK,CAACO,QAAQ,CAAC;IAAEF;GAAe,CAAC,GAAGL,KAAK,CAACO,QAAQ;AACpG;;;;"}
@@ -27,7 +27,13 @@ const searchForString = (child, value, strategy = 'includes') => {
27
27
  }
28
28
  return searchForString((_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.children, value, strategy);
29
29
  } else {
30
- return child.toString().toLowerCase()[strategy](String(value).toLowerCase());
30
+ const childLowerCase = child.toString().toLowerCase();
31
+ const valueLowerCase = String(value).toLowerCase();
32
+ if (strategy === 'startsWith') {
33
+ return childLowerCase.startsWith(valueLowerCase);
34
+ } else {
35
+ return childLowerCase.includes(valueLowerCase);
36
+ }
31
37
  }
32
38
  } catch {
33
39
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../../../../../src/components/Listbox/util.ts"],"sourcesContent":["import React from 'react';\nimport { ScrollableListItem, ScrollableListItemValue, getId } from './ScrollableList';\nimport { setInputValueByRef as setInputValueByRefBase } from '../../utils/input';\n\nconst getValue = (value: ScrollableListItemValue | undefined): string => String(value ?? '');\n\nexport const setInputValueByRef = (input: HTMLInputElement | null, value: ScrollableListItemValue, event = 'change'): void => {\n setInputValueByRefBase(input, getValue(value), event);\n};\n\nexport const getIndexFromValue = (data: ScrollableListItem[], value: ScrollableListItemValue | undefined): number | undefined => {\n const index = data.findIndex(option => getValue(option.value) === getValue(value));\n return index > -1 ? index : undefined;\n};\n\nexport const getSelectedIndexesFromValue = (data: ScrollableListItem[], value: ScrollableListItemValue | undefined): number[] => {\n if (typeof value !== 'string') return [];\n\n return value\n .split(',')\n .map(v => data.findIndex(o => String(o.value) === v))\n .filter(v => v !== -1);\n};\n\nexport const findByValue = (data: ScrollableListItem[], value: ScrollableListItemValue): ScrollableListItem | undefined => {\n return data.find(option => getValue(option.value) === getValue(value));\n};\n\nexport const searchForString = (child: JSX.Element | string, value: string, strategy = 'includes'): boolean => {\n try {\n if (typeof child !== 'string' && child.props?.children) {\n if (Array.isArray(child.props?.children)) {\n return !!child.props.children.find((subChild: JSX.Element | string) =>\n searchForString(subChild, value, strategy)\n );\n }\n\n return searchForString(child.props?.children, value, strategy);\n } else {\n return child.toString().toLowerCase()[strategy](String(value).toLowerCase());\n }\n } catch {\n return false;\n }\n};\n\nconst getIndexInRangeByValue = (\n data: ScrollableListItem[],\n query: string,\n firstIndex: number,\n lastIndex: number = data.length\n): number => {\n const index = data.slice(firstIndex, lastIndex).findIndex(option => {\n if (option.disabled) {\n return false;\n }\n\n return searchForString(option.text, query, 'startsWith');\n });\n\n return index > -1 ? index + firstIndex : -1;\n};\n\nexport const findNextIndexByValue = (data: ScrollableListItem[], query: string, activeIndex: number | undefined): number => {\n const firstIndex = activeIndex === undefined ? 0 : activeIndex + 1;\n let index = getIndexInRangeByValue(data, query, firstIndex);\n\n if (index === -1) {\n index = getIndexInRangeByValue(data, query, 0, activeIndex);\n }\n\n return index;\n};\n\nexport const getActiveDescendant = (data: ScrollableListItem[], currentIndex: number | undefined, id: string): any => {\n return currentIndex !== undefined && data[currentIndex] ? getId(id, data[currentIndex].value) : undefined;\n};\n\nexport const useFlattenedData = (data: ScrollableListItem[]): ScrollableListItem[] => {\n return React.useMemo(() => {\n const items: ScrollableListItem[] = [];\n\n const flatten = (item: ScrollableListItem, path: number, parentPath?: string, parentDisabled?: boolean) => {\n const currentPath = parentPath ? `${parentPath}.${path}` : `${path}`;\n const isItemDisabled = parentDisabled || item.disabled;\n\n items.push({\n ...item,\n disabled: isItemDisabled,\n path: currentPath,\n hasChildren: !!item.children,\n });\n\n if (item.children) {\n item.children.forEach((childItem: ScrollableListItem, childPath: number) =>\n flatten(childItem, childPath, currentPath, isItemDisabled)\n );\n }\n };\n\n data.forEach((item, index) => {\n flatten(item, index);\n });\n\n return items;\n }, [data]);\n};\n\nexport const sanitizeItem = (item: ScrollableListItem | undefined) => {\n if (item) {\n const { hasChildren: _1, path: _2, ...rest } = item;\n return rest;\n }\n\n return undefined;\n};\n\nexport const getOptionParents = (data: ScrollableListItem[], path?: string) => {\n const indexes = path?.split('.') ?? [];\n\n if (indexes.length > 1) {\n // we don't want to map the current item\n indexes.pop();\n // we need to rebuild the path as we map\n let lastPath: string;\n\n return indexes.map(i => {\n lastPath = lastPath ? [lastPath, i].join('.') : i;\n return sanitizeItem(data.find((i: ScrollableListItem) => i.path === lastPath));\n });\n }\n\n return null;\n};\n\nexport const filterData = (data: ScrollableListItem[], value: ScrollableListItemValue = ''): ScrollableListItem[] => {\n if (value === '' || value === null) {\n return data;\n }\n\n const filteredOptionValues = new Set();\n const shouldFilterOption = (option: ScrollableListItem): boolean => {\n if (option.disabled) {\n return false;\n }\n\n return searchForString(option.text, String(value));\n };\n\n data.forEach(option => {\n if (shouldFilterOption(option)) {\n const parents = getOptionParents(data, option.path);\n\n filteredOptionValues.add(option.value);\n\n if (parents !== null) {\n parents.forEach(option => filteredOptionValues.add(option?.value));\n }\n }\n });\n\n return data.filter(({ value }) => filteredOptionValues.has(value));\n};\n"],"names":["getValue","value","String","setInputValueByRef","input","event","setInputValueByRefBase","getIndexFromValue","data","index","findIndex","option","undefined","getSelectedIndexesFromValue","split","map","v","o","filter","findByValue","find","searchForString","child","strategy","_child$props","props","children","_child$props2","_child$props3","Array","isArray","subChild","toString","toLowerCase","getIndexInRangeByValue","query","firstIndex","lastIndex","length","slice","disabled","text","findNextIndexByValue","activeIndex","getActiveDescendant","currentIndex","id","getId","useFlattenedData","React","useMemo","items","flatten","item","path","parentPath","parentDisabled","currentPath","isItemDisabled","push","hasChildren","forEach","childItem","childPath","sanitizeItem","_1","_2","rest","getOptionParents","indexes","_path$split","pop","lastPath","i","join","filterData","filteredOptionValues","Set","shouldFilterOption","parents","add","has"],"mappings":";;;;AAIA,MAAMA,QAAQ,GAAIC,KAA0C,IAAaC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAE/EE,kBAAkB,GAAGA,CAACC,KAA8B,EAAEH,KAA8B,EAAEI,KAAK,GAAG,QAAQ;EAC/GC,oBAAs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;EAEDO,IAAI,CAACqD,OAAO,CAAClD,MAAM;IACf,IAAImE,kBAAkB,CAACnE,MAAM,CAAC,EAAE;MAC5B,MAAMoE,OAAO,GAAGX,gBAAgB,CAAC5D,IAAI,EAAEG,MAAM,CAAC2C,IAAI,CAAC;MAEnDsB,oBAAoB,CAACI,GAAG,CAACrE,MAAM,CAACV,KAAK,CAAC;MAEtC,IAAI8E,OAAO,KAAK,IAAI,EAAE;QAClBA,OAAO,CAAClB,OAAO,CAAClD,MAAM,IAAIiE,oBAAoB,CAACI,GAAG,CAACrE,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEV,KAAK,CAAC,CAAC;;;GAG7E,CAAC;EAEF,OAAOO,IAAI,CAACU,MAAM,CAAC,CAAC;IAAEjB;GAAO,KAAK2E,oBAAoB,CAACK,GAAG,CAAChF,KAAK,CAAC,CAAC;AACtE;;;;"}
1
+ {"version":3,"file":"util.js","sources":["../../../../../../../src/components/Listbox/util.ts"],"sourcesContent":["import React from 'react';\nimport { ScrollableListItem, ScrollableListItemValue, getId } from './ScrollableList';\nimport { setInputValueByRef as setInputValueByRefBase } from '../../utils/input';\n\nconst getValue = (value: ScrollableListItemValue | undefined): string => String(value ?? '');\n\nexport const setInputValueByRef = (input: HTMLInputElement | null, value: ScrollableListItemValue, event = 'change'): void => {\n setInputValueByRefBase(input, getValue(value), event);\n};\n\nexport const getIndexFromValue = (data: ScrollableListItem[], value: ScrollableListItemValue | undefined): number | undefined => {\n const index = data.findIndex(option => getValue(option.value) === getValue(value));\n return index > -1 ? index : undefined;\n};\n\nexport const getSelectedIndexesFromValue = (data: ScrollableListItem[], value: ScrollableListItemValue | undefined): number[] => {\n if (typeof value !== 'string') return [];\n\n return value\n .split(',')\n .map(v => data.findIndex(o => String(o.value) === v))\n .filter(v => v !== -1);\n};\n\nexport const findByValue = (data: ScrollableListItem[], value: ScrollableListItemValue): ScrollableListItem | undefined => {\n return data.find(option => getValue(option.value) === getValue(value));\n};\n\nexport const searchForString = (child: JSX.Element | string, value: string, strategy = 'includes'): boolean => {\n try {\n if (typeof child !== 'string' && child.props?.children) {\n if (Array.isArray(child.props?.children)) {\n return !!child.props.children.find((subChild: JSX.Element | string) =>\n searchForString(subChild, value, strategy)\n );\n }\n\n return searchForString(child.props?.children, value, strategy);\n } else {\n const childLowerCase = child.toString().toLowerCase();\n const valueLowerCase = String(value).toLowerCase();\n\n if (strategy === 'startsWith') {\n return childLowerCase.startsWith(valueLowerCase);\n } else {\n return childLowerCase.includes(valueLowerCase);\n }\n }\n } catch {\n return false;\n }\n};\n\nconst getIndexInRangeByValue = (\n data: ScrollableListItem[],\n query: string,\n firstIndex: number,\n lastIndex: number = data.length\n): number => {\n const index = data.slice(firstIndex, lastIndex).findIndex(option => {\n if (option.disabled) {\n return false;\n }\n\n return searchForString(option.text, query, 'startsWith');\n });\n\n return index > -1 ? index + firstIndex : -1;\n};\n\nexport const findNextIndexByValue = (data: ScrollableListItem[], query: string, activeIndex: number | undefined): number => {\n const firstIndex = activeIndex === undefined ? 0 : activeIndex + 1;\n let index = getIndexInRangeByValue(data, query, firstIndex);\n\n if (index === -1) {\n index = getIndexInRangeByValue(data, query, 0, activeIndex);\n }\n\n return index;\n};\n\nexport const getActiveDescendant = (data: ScrollableListItem[], currentIndex: number | undefined, id: string): any => {\n return currentIndex !== undefined && data[currentIndex] ? getId(id, data[currentIndex].value) : undefined;\n};\n\nexport const useFlattenedData = (data: ScrollableListItem[]): ScrollableListItem[] => {\n return React.useMemo(() => {\n const items: ScrollableListItem[] = [];\n\n const flatten = (item: ScrollableListItem, path: number, parentPath?: string, parentDisabled?: boolean) => {\n const currentPath = parentPath ? `${parentPath}.${path}` : `${path}`;\n const isItemDisabled = parentDisabled || item.disabled;\n\n items.push({\n ...item,\n disabled: isItemDisabled,\n path: currentPath,\n hasChildren: !!item.children,\n });\n\n if (item.children) {\n item.children.forEach((childItem: ScrollableListItem, childPath: number) =>\n flatten(childItem, childPath, currentPath, isItemDisabled)\n );\n }\n };\n\n data.forEach((item, index) => {\n flatten(item, index);\n });\n\n return items;\n }, [data]);\n};\n\nexport const sanitizeItem = (item: ScrollableListItem | undefined) => {\n if (item) {\n const { hasChildren: _1, path: _2, ...rest } = item;\n return rest;\n }\n\n return undefined;\n};\n\nexport const getOptionParents = (data: ScrollableListItem[], path?: string) => {\n const indexes = path?.split('.') ?? [];\n\n if (indexes.length > 1) {\n // we don't want to map the current item\n indexes.pop();\n // we need to rebuild the path as we map\n let lastPath: string;\n\n return indexes.map(i => {\n lastPath = lastPath ? [lastPath, i].join('.') : i;\n return sanitizeItem(data.find((i: ScrollableListItem) => i.path === lastPath));\n });\n }\n\n return null;\n};\n\nexport const filterData = (data: ScrollableListItem[], value: ScrollableListItemValue = ''): ScrollableListItem[] => {\n if (value === '' || value === null) {\n return data;\n }\n\n const filteredOptionValues = new Set();\n const shouldFilterOption = (option: ScrollableListItem): boolean => {\n if (option.disabled) {\n return false;\n }\n\n return searchForString(option.text, String(value));\n };\n\n data.forEach(option => {\n if (shouldFilterOption(option)) {\n const parents = getOptionParents(data, option.path);\n\n filteredOptionValues.add(option.value);\n\n if (parents !== null) {\n parents.forEach(option => filteredOptionValues.add(option?.value));\n }\n }\n });\n\n return data.filter(({ value }) => filteredOptionValues.has(value));\n};\n"],"names":["getValue","value","String","setInputValueByRef","input","event","setInputValueByRefBase","getIndexFromValue","data","index","findIndex","option","undefined","getSelectedIndexesFromValue","split","map","v","o","filter","findByValue","find","searchForString","child","strategy","_child$props","props","children","_child$props2","_child$props3","Array","isArray","subChild","childLowerCase","toString","toLowerCase","valueLowerCase","startsWith","includes","getIndexInRangeByValue","query","firstIndex","lastIndex","length","slice","disabled","text","findNextIndexByValue","activeIndex","getActiveDescendant","currentIndex","id","getId","useFlattenedData","React","useMemo","items","flatten","item","path","parentPath","parentDisabled","currentPath","isItemDisabled","push","hasChildren","forEach","childItem","childPath","sanitizeItem","_1","_2","rest","getOptionParents","indexes","_path$split","pop","lastPath","i","join","filterData","filteredOptionVal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AO,IAAI;AACf;MAEaG,UAAU,GAAGA,CAACvE,IAA0B,EAAEP,QAAiC,EAAE;EACtF,IAAIA,KAAK,KAAK,EAAE,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChC,OAAOO,IAAI;;EAGf,MAAMwE,oBAAoB,GAAG,IAAIC,GAAG,EAAE;EACtC,MAAMC,kBAAkB,GAAIvE,MAA0B;IAClD,IAAIA,MAAM,CAACiC,QAAQ,EAAE;MACjB,OAAO,KAAK;;IAGhB,OAAOvB,eAAe,CAACV,MAAM,CAACkC,IAAI,EAAE3C,MAAM,CAACD,KAAK,CAAC,CAAC;GACrD;EAEDO,IAAI,CAACyD,OAAO,CAACtD,MAAM;IACf,IAAIuE,kBAAkB,CAACvE,MAAM,CAAC,EAAE;MAC5B,MAAMwE,OAAO,GAAGX,gBAAgB,CAAChE,IAAI,EAAEG,MAAM,CAAC+C,IAAI,CAAC;MAEnDsB,oBAAoB,CAACI,GAAG,CAACzE,MAAM,CAACV,KAAK,CAAC;MAEtC,IAAIkF,OAAO,KAAK,IAAI,EAAE;QAClBA,OAAO,CAAClB,OAAO,CAACtD,MAAM,IAAIqE,oBAAoB,CAACI,GAAG,CAACzE,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEV,KAAK,CAAC,CAAC;;;GAG7E,CAAC;EAEF,OAAOO,IAAI,CAACU,MAAM,CAAC,CAAC;IAAEjB;GAAO,KAAK+E,oBAAoB,CAACK,GAAG,CAACpF,KAAK,CAAC,CAAC;AACtE;;;;"}
@@ -1 +1 @@
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 'clsx';\nimport { IconName } from '../../Icon/Icon';\nimport { Icon as IconPrimitive } from '../../Icon/Icon';\nimport { useCurrentMenu } from '../Context';\nimport { DialogProps } from '../../Dialog/Dialog';\nimport { Shortcut } from '../../Shortcut/Shortcut';\nimport { PopoverProps } from '../../Popover/Popover';\nimport { KeyDownHandlerOptions } from '../../../utils/keyboard';\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\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-8 pr-1.5 relative rounded w-full focus:outline-none group',\n {\n 'pl-7': menu?.indented,\n 'pl-1.5': !menu?.indented,\n 'cursor-pointer text-black hover:wcag-grey-200 data-[highlighted]:wcag-grey-200': !disabled,\n 'cursor-not-allowed hover:bg-white text-grey-300': disabled,\n },\n className\n );\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 popover?: (props: Partial<PopoverProps>) => JSX.Element;\n shortcut?: string | KeyDownHandlerOptions;\n subMenu?: any;\n};\n\nexport const Item = React.forwardRef(function MenuItem(props: MenuItemProps, ref: React.Ref<HTMLDivElement>) {\n const { dialog, icon, onClick, popover, shortcut, subMenu, ...otherProps } = props;\n const menu = useCurrentMenu();\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 if (subMenu) {\n return (\n <DropdownMenuPrimitive.Sub>\n <DropdownMenuPrimitive.SubTrigger {...otherProps} className={className} onClick={handleClick} ref={ref}>\n {icon ? <Icon name={icon} /> : null}\n {props.children}\n <IconPrimitive className=\"-mr-1.5 ml-auto !h-5 !w-5\" name=\"chevron-right\" />\n </DropdownMenuPrimitive.SubTrigger>\n {subMenu()}\n </DropdownMenuPrimitive.Sub>\n );\n }\n\n const handleSelect = event => {\n if (onClick) {\n onClick(event);\n }\n\n if (props['aria-haspopup'] || typeof dialog === 'function' || typeof popover === '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} /> : null}\n {props.children}\n {shortcut ? (\n <span className=\"ml-auto pl-5\">\n <Shortcut keys={shortcut} className=\"text-grey-700\" />\n </span>\n ) : null}\n </DropdownMenuPrimitive.Item>\n );\n\n if (typeof dialog === 'function') {\n button = dialog({ trigger: button, onClose: menu?.close });\n } else if (typeof popover === 'function') {\n button = popover({ trigger: button });\n }\n\n return button;\n});\n"],"names":["Icon","name","React","className","IconPrimitive","useItemStyling","disabled","indented","menu","useCurrentMenu","registerIndentation","cn","Item","MenuItem","props","ref","dialog","icon","onClick","popover","shortcut","subMenu","otherProps","_props$disabled","handleClick","event","preventDefault","stopPropagation","DropdownMenuPrimitive","children","handleSelect","button","onSelect","Shortcut","keys","trigger","onClose","close"],"mappings":";;;;;;;MAWaA,IAAI,GAAGA,CAAC;EAAEC;CAAM,mBACzBC;EAAMC,SAAS,EAAC;gBACZD,cAACE,MAAa;EAACD,SAAS,EAAC,yBAAyB;EAACF,IAAI,EAAEA;EAAQ,CAC9D;MAGEI,cAAc,GAAGA,CAAC;EAAEC,QAAQ;EAAEC,QAAQ;EAAEJ;CAAW;EAC5D,MAAMK,IAAI,GAAGC,cAAc,EAAE;EAE7BP,SAAe,CAAC;IACZ,IAAIK,QAAQ,IAAI,EAACC,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAED,QAAQ,GAAE;MAC7BC,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEE,mBAAmB,EAAE;;GAElC,EAAE,CAACH,QAAQ,CAAC,CAA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S,EAAC,2BAA2B;MAACF,IAAI,EAAC;MAAkB,CAC7C,EAClCoB,OAAO,EAAE,CACc;;EAIpC,MAAMS,YAAY,GAAGL,KAAK;IACtB,IAAIP,OAAO,EAAE;MACTA,OAAO,CAACO,KAAK,CAAC;;IAGlB,IAAIX,KAAK,CAAC,eAAe,CAAC,IAAI,OAAOE,MAAM,KAAK,UAAU,IAAI,OAAOG,OAAO,KAAK,UAAU,EAAE;MACzFM,KAAK,CAACC,cAAc,EAAE;;GAE7B;EAED,IAAIK,MAAM,gBACN7B,cAAC0B,MAA0B,oBAAKN,UAAU;IAAEnB,SAAS,EAAEA,SAAS;IAAEe,OAAO,EAAEM,WAAW;IAAEQ,QAAQ,EAAEF,YAAY;IAAEf,GAAG,EAAEA;MAChHE,IAAI,gBAAGf,cAACF,IAAI;IAACC,IAAI,EAAEgB;IAAQ,GAAG,IAAI,EAClCH,KAAK,CAACe,QAAQ,EACdT,QAAQ,iBACLlB;IAAMC,SAAS,EAAC;kBACZD,cAAC+B,QAAQ;IAACC,IAAI,EAAEd,QAAQ;IAAEjB,SAAS,EAAC;IAAkB,CACnD,IACP,IAAI,CAEf;EAED,IAAI,OAAOa,MAAM,KAAK,UAAU,EAAE;IAC9Be,MAAM,GAAGf,MAAM,CAAC;MAAEmB,OAAO,EAAEJ,MAAM;MAAEK,OAAO,EAAE5B,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAE6B;KAAO,CAAC;GAC7D,MAAM,IAAI,OAAOlB,OAAO,KAAK,UAAU,EAAE;IACtCY,MAAM,GAAGZ,OAAO,CAAC;MAAEgB,OAAO,EAAEJ;KAAQ,CAAC;;EAGzC,OAAOA,MAAM;AACjB,CAAC;;;;"}
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 'clsx';\nimport { IconName } from '../../Icon/Icon';\nimport { Icon as IconPrimitive } from '../../Icon/Icon';\nimport { useCurrentMenu } from '../Context';\nimport { DialogProps } from '../../Dialog/Dialog';\nimport { Shortcut } from '../../Shortcut/Shortcut';\nimport { PopoverProps } from '../../Popover/Popover';\nimport { KeyDownHandlerOptions } from '../../../utils/keyboard';\n\nexport const Icon = ({ name }: { name: IconName }) => (\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\nexport const useItemStyling = ({\n disabled,\n indented,\n className,\n}: {\n disabled?: boolean;\n indented: boolean;\n className?: string;\n}) => {\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-8 pr-1.5 relative rounded w-full focus:outline-none group',\n {\n 'pl-7': menu?.indented,\n 'pl-1.5': !menu?.indented,\n 'cursor-pointer text-black hover:wcag-grey-200 data-[highlighted]:wcag-grey-200': !disabled,\n 'cursor-not-allowed hover:bg-white text-grey-300': disabled,\n },\n className\n );\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 popover?: (props: Partial<PopoverProps>) => JSX.Element;\n shortcut?: string | KeyDownHandlerOptions;\n subMenu?: any;\n};\n\nexport const Item = React.forwardRef(function MenuItem(props: MenuItemProps, ref: React.Ref<HTMLDivElement>) {\n const { dialog, icon, onClick, popover, shortcut, subMenu, ...otherProps } = props;\n const menu = useCurrentMenu();\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: React.MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n }\n\n if (subMenu) {\n return (\n <DropdownMenuPrimitive.Sub>\n <DropdownMenuPrimitive.SubTrigger {...otherProps} className={className} onClick={handleClick} ref={ref}>\n {icon ? <Icon name={icon} /> : null}\n {props.children}\n <IconPrimitive className=\"-mr-1.5 ml-auto !h-5 !w-5\" name=\"chevron-right\" />\n </DropdownMenuPrimitive.SubTrigger>\n {subMenu()}\n </DropdownMenuPrimitive.Sub>\n );\n }\n\n const handleSelect = (event: any) => {\n if (onClick) {\n onClick(event);\n }\n\n if (props['aria-haspopup'] || typeof dialog === 'function' || typeof popover === '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} /> : null}\n {props.children}\n {shortcut ? (\n <span className=\"ml-auto pl-5\">\n <Shortcut keys={shortcut} className=\"text-grey-700\" />\n </span>\n ) : null}\n </DropdownMenuPrimitive.Item>\n );\n\n if (typeof dialog === 'function') {\n button = dialog({ trigger: button, onClose: menu?.close });\n } else if (typeof popover === 'function') {\n button = popover({ trigger: button });\n }\n\n return button;\n});\n"],"names":["Icon","name","React","className","IconPrimitive","useItemStyling","disabled","indented","menu","useCurrentMenu","registerIndentation","cn","Item","MenuItem","props","ref","dialog","icon","onClick","popover","shortcut","subMenu","otherProps","_props$disabled","handleClick","event","preventDefault","stopPropagation","DropdownMenuPrimitive","children","handleSelect","button","onSelect","Shortcut","keys","trigger","onClose","close"],"mappings":";;;;;;;MAWaA,IAAI,GAAGA,CAAC;EAAEC;CAA0B,mBAC7CC;EAAMC,SAAS,EAAC;gBACZD,cAACE,MAAa;EAACD,SAAS,EAAC,yBAAyB;EAACF,IAAI,EAAEA;EAAQ,CAC9D;MAGEI,cAAc,GAAGA,CAAC;EAC3BC,QAAQ;EACRC,QAAQ;EACRJ;CAKH;EACG,MAAMK,IAAI,GAAGC,cAAc,EAAE;EAE7BP,SAAe,CAAC;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AAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OverflowGroup.js","sources":["../../../../../../../src/components/OverflowGroup/OverflowGroup.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { ButtonProps } from '../Button/Button';\nimport { Menu } from '../Menu/Menu';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nconst sanitizeButtonPropsForMenuItem = (button: any, index) => {\n const href: string | undefined = button.props.to || button.props.href;\n const Tag = href ? Menu.Link : Menu.Item;\n\n // Removing className prop so that custom styling cannot be applied on Menu.Link\n const {\n as,\n className: _,\n appearance: _1,\n drawer: _2,\n fluid: _3,\n hanger: _4,\n menu: _5,\n popover: _6,\n tooltip: _7,\n ...attributes\n } = button.props;\n\n const props = {\n ...attributes,\n key: index,\n target: href ? (href.startsWith('http') ? '_blank' : '_self') : undefined,\n };\n\n if (as) {\n return React.cloneElement(button, { as: Tag, ...props });\n }\n\n return <Tag {...props} />;\n};\n\ntype OverflowGroupProps = React.HTMLAttributes<HTMLElement> & {\n moreButton?: (moreButtonText: string) => React.ReactElement<ButtonProps>;\n wrapChild?: true | undefined;\n};\n\nconst DEFAULT_OFFSET = 32 + 8;\n\nexport const OverflowGroup = React.forwardRef(function OverflowGroup(props: OverflowGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { moreButton, wrapChild, ...attributes } = props;\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n // determine width of more button, to add intersection observer margin\n const [buttonWidth, setButtonWidth] = React.useState(DEFAULT_OFFSET);\n const buttonRefCallback = React.useCallback((el: HTMLElement) => setButtonWidth(el?.getBoundingClientRect()?.width), []);\n const { texts } = useLocalization();\n\n const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);\n const children = React.Children.toArray(props.children) as React.ReactElement<ButtonProps>[];\n const hiddenChildren = intersectedChildIndex !== undefined ? children.slice(intersectedChildIndex) : [];\n const hiddenChildrenCount = hiddenChildren.length;\n const moreButtonText = hiddenChildrenCount ? `${hiddenChildrenCount} ${texts.header.more}` : '';\n\n const MoreButton = moreButton?.(moreButtonText) ?? <IconButton icon=\"more\" />;\n\n const className = cn('flex overflow-hidden', props.className);\n\n return (\n <div {...attributes} className={className} data-taco=\"overflow-group\" ref={internalRef}>\n {children.map((child, index) =>\n React.cloneElement(child, {\n className: cn(child.props.className, {\n visible: intersectedChildIndex === undefined || index < intersectedChildIndex,\n 'invisible order-[100] pointer-events-none':\n intersectedChildIndex !== undefined && index >= intersectedChildIndex,\n }),\n })\n )}\n {hiddenChildren.length\n ? React.cloneElement(MoreButton, {\n className: cn('sticky right-0 order-[99]', MoreButton.props.className),\n 'data-observer-ignore': true,\n menu: menuProps => (\n <Menu {...menuProps}>\n <Menu.Content>\n {hiddenChildren.map((child, index) =>\n wrapChild ? (\n <Menu.Item key={index}>{child}</Menu.Item>\n ) : (\n sanitizeButtonPropsForMenuItem(child, index)\n )\n )}\n </Menu.Content>\n </Menu>\n ),\n ref: buttonRefCallback,\n })\n : null}\n </div>\n );\n});\n"],"names":["sanitizeButtonPropsForMenuItem","button","index","href","props","to","Tag","Menu","Link","Item","as","className","_","appearance","_1","drawer","_2","fluid","_3","hanger","_4","menu","_5","popover","_6","tooltip","_7","attributes","key","target","startsWith","undefined","React","cloneElement","DEFAULT_OFFSET","OverflowGroup","forwardRef","ref","moreButton","wrapChild","internalRef","useMergedRef","buttonWidth","setButtonWidth","useState","buttonRefCallback","useCallback","el","_el$getBoundingClient","getBoundingClientRect","width","texts","useLocalization","intersectedChildIndex","useIntersectionObserver","children","Children","toArray","hiddenChildren","slice","hiddenChildrenCount","length","moreButtonText","header","more","MoreButton","_moreButton","IconButton","icon","cn","map","child","visible","menuProps","Content"],"mappings":";;;;;;;;AASA,MAAMA,8BAA8B,GAAGA,CAACC,MAAW,EAAEC,KAAK;EACtD,MAAMC,IAAI,GAAuBF,M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,KAAK,GAAGmD,qBAAqB;MAC7E,2CAA2C,EACvCA,qBAAqB,KAAKtB,SAAS,IAAI7B,KAAK,IAAImD;KACvD;GACJ,CAAC,CACL,EACAK,cAAc,CAACG,MAAM,gBAChB7B,cAAK,CAACC,YAAY,CAACgC,UAAU,EAAE;IAC3BtD,SAAS,EAAE0D,EAAE,CAAC,2BAA2B,EAAEJ,UAAU,CAAC7D,KAAK,CAACO,SAAS,CAAC;IACtE,sBAAsB,EAAE,IAAI;IAC5BU,IAAI,EAAEoD,SAAS,kBACXzC,6BAACzB,IAAI,oBAAKkE,SAAS,gBACfzC,6BAACzB,IAAI,CAACmE,OAAO,QACRhB,cAAc,CAACY,GAAG,CAAC,CAACC,KAAK,EAAErE,KAAK,KAC7BqC,SAAS,iBACLP,6BAACzB,IAAI,CAACE,IAAI;MAACmB,GAAG,EAAE1B;OAAQqE,KAAK,CAAa,IAE1CvE,8BAA8B,CAACuE,KAAK,EAAErE,KAAK,CAC9C,CACJ,CACU,CACZ,CACV;IACDmC,GAAG,EAAEQ;GACR,CAAC,GACF,IAAI,CACR;AAEd,CAAC;;;;"}
1
+ {"version":3,"file":"OverflowGroup.js","sources":["../../../../../../../src/components/OverflowGroup/OverflowGroup.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { ButtonProps } from '../Button/Button';\nimport { Menu, MenuProps } from '../Menu/Menu';\nimport { useIntersectionObserver } from '../../hooks/useIntersectionObserver';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nconst sanitizeButtonPropsForMenuItem = (button: any, index: number) => {\n const href: string | undefined = button.props.to || button.props.href;\n const Tag = href ? Menu.Link : Menu.Item;\n\n // Removing className prop so that custom styling cannot be applied on Menu.Link\n const {\n as,\n className: _,\n appearance: _1,\n drawer: _2,\n fluid: _3,\n hanger: _4,\n menu: _5,\n popover: _6,\n tooltip: _7,\n ...attributes\n } = button.props;\n\n const props = {\n ...attributes,\n key: index,\n target: href ? (href.startsWith('http') ? '_blank' : '_self') : undefined,\n };\n\n if (as) {\n return React.cloneElement(button, { as: Tag, ...props });\n }\n\n return <Tag {...props} />;\n};\n\ntype OverflowGroupProps = React.HTMLAttributes<HTMLElement> & {\n moreButton?: (moreButtonText: string) => React.ReactElement<ButtonProps>;\n wrapChild?: true | undefined;\n};\n\nconst DEFAULT_OFFSET = 32 + 8;\n\nexport const OverflowGroup = React.forwardRef(function OverflowGroup(props: OverflowGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { moreButton, wrapChild, ...attributes } = props;\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n // determine width of more button, to add intersection observer margin\n const [buttonWidth, setButtonWidth] = React.useState(DEFAULT_OFFSET);\n const buttonRefCallback = React.useCallback((el: HTMLElement) => setButtonWidth(el?.getBoundingClientRect()?.width), []);\n const { texts } = useLocalization();\n\n const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);\n const children = React.Children.toArray(props.children) as React.ReactElement<ButtonProps>[];\n const hiddenChildren = intersectedChildIndex !== undefined ? children.slice(intersectedChildIndex) : [];\n const hiddenChildrenCount = hiddenChildren.length;\n const moreButtonText = hiddenChildrenCount ? `${hiddenChildrenCount} ${texts.header.more}` : '';\n\n const MoreButton = moreButton?.(moreButtonText) ?? <IconButton icon=\"more\" />;\n\n const className = cn('flex overflow-hidden', props.className);\n\n return (\n <div {...attributes} className={className} data-taco=\"overflow-group\" ref={internalRef}>\n {children.map((child, index) =>\n React.cloneElement(child, {\n className: cn(child.props.className, {\n visible: intersectedChildIndex === undefined || index < intersectedChildIndex,\n 'invisible order-[100] pointer-events-none':\n intersectedChildIndex !== undefined && index >= intersectedChildIndex,\n }),\n })\n )}\n {hiddenChildren.length\n ? React.cloneElement(MoreButton, {\n className: cn('sticky right-0 order-[99]', MoreButton.props.className),\n 'data-observer-ignore': true,\n menu: (menuProps: MenuProps) => (\n <Menu {...menuProps}>\n <Menu.Content>\n {hiddenChildren.map((child, index) =>\n wrapChild ? (\n <Menu.Item key={index}>{child}</Menu.Item>\n ) : (\n sanitizeButtonPropsForMenuItem(child, index)\n )\n )}\n </Menu.Content>\n </Menu>\n ),\n ref: buttonRefCallback,\n })\n : null}\n </div>\n );\n});\n"],"names":["sanitizeButtonPropsForMenuItem","button","index","href","props","to","Tag","Menu","Link","Item","as","className","_","appearance","_1","drawer","_2","fluid","_3","hanger","_4","menu","_5","popover","_6","tooltip","_7","attributes","key","target","startsWith","undefined","React","cloneElement","DEFAULT_OFFSET","OverflowGroup","forwardRef","ref","moreButton","wrapChild","internalRef","useMergedRef","buttonWidth","setButtonWidth","useState","buttonRefCallback","useCallback","el","_el$getBoundingClient","getBoundingClientRect","width","texts","useLocalization","intersectedChildIndex","useIntersectionObserver","children","Children","toArray","hiddenChildren","slice","hiddenChildrenCount","length","moreButtonText","header","more","MoreButton","_moreButton","IconButton","icon","cn","map","child","visible","menuProps","Content"],"mappings":";;;;;;;;AASA,MAAMA,8BAA8B,GAAGA,CAACC,MAAW,EAAEC,KAAa;EAC9D,MAAMC,IAAI,GAAuBF,MAAM,CAACG,KAAK,CAACC,EAAE,IAAIJ,MAAM,CAACG,KAAK,CAACD,IAAI;EACrE,MAAMG,GAAG,GAAGH,IAAI,GAAGI,IAAI,CAACC,IAAI,GAAGD,IAAI,CAACE,IAAI;;EAGxC,MAAM;IACFC,EAAE;IACFC,SAAS,EAAEC,CAAC;IACZC,UAAU,EAAEC,EAAE;IACdC,MAAM,EAAEC,EAAE;IACVC,KAAK,EAAEC,EAAE;IACTC,MAAM,EAAEC,EAAE;IACVC,IAAI,EAAEC,EAAE;IACRC,OAAO,EAAEC,EAAE;IACXC,OAAO,EAAEC,EAAE;IACX,GAAGC;GACN,GAAG1B,MAAM,CAACG,KAAK;EAEhB,MAAMA,KAAK,GAAG;IACV,GAAGuB,UAAU;IACbC,GAAG,EAAE1B,KAAK;IACV2B,MAAM,EAAE1B,IAAI,GAAIA,IAAI,CAAC2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qE,KAAK,CAAa,IAE1CvE,8BAA8B,CAACuE,KAAK,EAAErE,KAAK,CAC9C,CACJ,CACU,CACZ,CACV;IACDmC,GAAG,EAAEQ;GACR,CAAC,GACF,IAAI,CACR;AAEd,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Primitives';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport { getPopoverStyleClassnames } from './util';\n\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n props: {},\n ref: null,\n});\n\nexport type PopoverAnchorProps = React.HTMLAttributes<HTMLElement>;\nconst Anchor = React.forwardRef(function PopoverAnchor(props: PopoverAnchorProps, ref: React.Ref<HTMLDivElement>) {\n return <PopoverPrimitive.Anchor {...props} asChild ref={ref} />;\n});\n\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLElement>;\nconst Trigger = React.forwardRef(function PopoverTrigger(props: PopoverTriggerProps, externalRef: React.Ref<HTMLElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(PopoverContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild>\n {children}\n </PopoverPrimitive.Trigger>\n );\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('hide'));\n };\n\n return children({ close, ref });\n});\n\nexport type PopoverContentRenderProps = { close: () => void };\nexport type PopoverContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side'> & {\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, ...popoverContentProps } = props;\n const className = cn(getPopoverStyleClassnames(), props.className);\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <PopoverPrimitive.Close asChild>\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\n </PopoverPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n {...popoverContentProps}\n className={className}\n data-taco=\"popover\"\n side={side}\n sideOffset={1}\n ref={ref}>\n {output}\n <UnstyledArrow className=\"text-white\" />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Close = React.forwardRef(\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\n )\n);\n\nexport type PopoverProps = React.PropsWithChildren<{\n anchor?: JSX.Element;\n modal?: boolean;\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n /** Set whether the popover is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Control the open state of the popover from outside the component */\n open?: boolean;\n /** Called when the popover opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n}>;\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<PopoverAnchorProps>;\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\n Portal: React.FunctionComponent<PopoverPrimitive.PortalProps>;\n};\n\nexport const Popover = React.forwardRef<HTMLElement, PopoverProps>(function Popover(props, ref) {\n const { anchor, children, defaultOpen, modal = false, open, onChange, trigger, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <PopoverContext.Provider value={context}>\n <PopoverPrimitive.Root defaultOpen={defaultOpen} modal={modal} open={open} onOpenChange={onChange}>\n {anchor ? <Anchor>{anchor}</Anchor> : null}\n {trigger && !anchor ? <Trigger>{trigger}</Trigger> : null}\n {children}\n </PopoverPrimitive.Root>\n </PopoverContext.Provider>\n );\n}) as ForwardedPopoverWithStatics;\nPopover.Anchor = Anchor;\nPopover.Trigger = Trigger;\nPopover.Content = Content;\nPopover.Close = Close;\nPopover.Portal = PopoverPrimitive.Portal;\n"],"names":["PopoverContext","React","props","ref","Anchor","PopoverAnchor","PopoverPrimitive","asChild","Trigger","PopoverTrigger","externalRef","parentRef","parentProps","refCallback","mergeRefs","children","_props$children","type","console","warn","name","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","placement","side","popoverContentProps","className","cn","getPopoverStyleClassnames","output","sideOffset","UnstyledArrow","Close","Popover","anchor","defaultOpen","modal","open","onChange","trigger","otherProps","context","Provider","value","onOpenChange","Portal"],"mappings":";;;;;;;AAUA,MAAMA,cAAc,gBAAGC,aAAmB,CAAsB;EAC5DC,KAAK,EAAE,EAAE;EACTC,GAAG,EAAE;CACR,CAAC;AAGF,MAAMC,MAAM,gBAAGH,UAAgB,CAAC,SAASI,aAAaA,CAACH,KAAyB,EAAEC,GAA8B;EAC5G,oBAAOF,cAACK,QAAuB,oBAAKJ,KAAK;IAAEK,OAAO;IAACJ,GAAG,EAAEA;KAAO;AACnE,CAAC,CAAC;AAGF,MAAMK,OAAO,gBAAGP,UAAgB,CAAC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AK,EAAEA,KAAK;IAAEC,IAAI,EAAEA,IAAI;IAAEO,YAAY,EAAEN;KACpFJ,MAAM,gBAAGrC,cAACG,MAAM,QAAEkC,MAAM,CAAU,GAAG,IAAI,EACzCK,OAAO,IAAI,CAACL,MAAM,gBAAGrC,cAACO,OAAO,QAAEmC,OAAO,CAAW,GAAG,IAAI,EACxD5B,QAAQ,CACW,CACF;AAElC,CAAC;AACDsB,OAAO,CAACjC,MAAM,GAAGA,MAAM;AACvBiC,OAAO,CAAC7B,OAAO,GAAGA,OAAO;AACzB6B,OAAO,CAACZ,OAAO,GAAGA,OAAO;AACzBY,OAAO,CAACD,KAAK,GAAGA,KAAK;AACrBC,OAAO,CAACY,MAAM,GAAG3C,MAAuB;;;;"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../../../../../src/components/Popover/Popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Placement } from '../..';\nimport { UnstyledArrow } from './Primitives';\nimport { mergeRefs } from '../../utils/mergeRefs';\nimport { getPopoverStyleClassnames } from './util';\n\ntype PopoverContextValue = { props: any; ref: React.Ref<HTMLElement> };\n\nconst PopoverContext = React.createContext<PopoverContextValue>({\n props: {},\n ref: null,\n});\n\nexport type PopoverAnchorProps = React.HTMLAttributes<HTMLElement>;\nconst Anchor = React.forwardRef(function PopoverAnchor(props: PopoverAnchorProps, ref: React.Ref<HTMLDivElement>) {\n return <PopoverPrimitive.Anchor {...props} asChild ref={ref} />;\n});\n\nexport type PopoverTriggerProps = React.HTMLAttributes<HTMLElement>;\nconst Trigger = React.forwardRef(function PopoverTrigger(props: PopoverTriggerProps, externalRef: React.Ref<HTMLElement>) {\n const { ref: parentRef, props: parentProps } = React.useContext(PopoverContext);\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n let children = props.children;\n\n if (React.isValidElement(props.children) && typeof props.children?.type === 'function') {\n console.warn(\n `Popover.Trigger requires its child to forwardRef so that it can attach to the dom element. Did you mean to wrap '${props.children.type.name}' in React.forwardRef()? Taco has wrapped '${props.children.type.name}' in a 'span' to maintain functionality, but this may cause unintended behaviour`\n );\n children = <span>{props.children}</span>;\n }\n\n return (\n <PopoverPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild>\n {children}\n </PopoverPrimitive.Trigger>\n );\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('hide'));\n };\n\n return children({ close, ref });\n});\n\nexport type PopoverContentRenderProps = { close: () => void };\nexport type PopoverContentProps = Omit<PopoverPrimitive.PopoverContentProps, 'side' | 'children'> & {\n children: React.ReactNode | ((props: PopoverContentRenderProps) => React.ReactNode);\n /** Set the position of the Popover relative to its trigger. Default value is `bottom` */\n placement?: Placement;\n};\nconst Content = React.forwardRef(function PopoverContent(props: PopoverContentProps, ref: React.Ref<HTMLDivElement>) {\n const { placement: side, ...popoverContentProps } = props;\n const className = cn(getPopoverStyleClassnames(), props.className);\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <PopoverPrimitive.Close asChild>\n <RenderPropWrapper>{props.children}</RenderPropWrapper>\n </PopoverPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n {...popoverContentProps}\n className={className}\n data-taco=\"popover\"\n side={side}\n sideOffset={1}\n ref={ref}>\n {output}\n <UnstyledArrow className=\"text-white\" />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\nexport type PopoverCloseProps = React.HTMLAttributes<HTMLButtonElement>;\nconst Close = React.forwardRef(\n (props: PopoverCloseProps, ref: React.Ref<HTMLButtonElement>): JSX.Element => (\n <PopoverPrimitive.Close {...props} ref={ref} asChild />\n )\n);\n\nexport type PopoverProps = React.PropsWithChildren<{\n anchor?: JSX.Element;\n modal?: boolean;\n /** A trigger to be used for the popover, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n /** Set whether the popover is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Control the open state of the popover from outside the component */\n open?: boolean;\n /** Called when the popover opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n}>;\nexport type ForwardedPopoverWithStatics = React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLElement>> & {\n Anchor: React.ForwardRefExoticComponent<PopoverAnchorProps>;\n Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps>;\n Content: React.ForwardRefExoticComponent<PopoverContentProps>;\n Close: React.ForwardRefExoticComponent<PopoverCloseProps>;\n Portal: React.FunctionComponent<PopoverPrimitive.PopoverPortalProps>;\n};\n\nexport const Popover = React.forwardRef<HTMLElement, PopoverProps>(function Popover(props, ref) {\n const { anchor, children, defaultOpen, modal = false, open, onChange, trigger, ...otherProps } = props;\n const context = React.useMemo(() => ({ props: otherProps, ref }), [otherProps]);\n\n return (\n <PopoverContext.Provider value={context}>\n <PopoverPrimitive.Root defaultOpen={defaultOpen} modal={modal} open={open} onOpenChange={onChange}>\n {anchor ? <Anchor>{anchor}</Anchor> : null}\n {trigger && !anchor ? <Trigger>{trigger}</Trigger> : null}\n {children}\n </PopoverPrimitive.Root>\n </PopoverContext.Provider>\n );\n}) as ForwardedPopoverWithStatics;\nPopover.Anchor = Anchor;\nPopover.Trigger = Trigger;\nPopover.Content = Content;\nPopover.Close = Close;\nPopover.Portal = PopoverPrimitive.Portal;\n"],"names":["PopoverContext","React","props","ref","Anchor","PopoverAnchor","PopoverPrimitive","asChild","Trigger","PopoverTrigger","externalRef","parentRef","parentProps","refCallback","mergeRefs","children","_props$children","type","console","warn","name","RenderPropWrapper","onClick","close","CustomEvent","Content","PopoverContent","placement","side","popoverContentProps","className","cn","getPopoverStyleClassnames","output","sideOffset","UnstyledArrow","Close","Popover","anchor","defaultOpen","modal","open","onChange","trigger","otherProps","context","Provider","value","onOpenChange","Portal"],"mappings":";;;;;;;AAUA,MAAMA,cA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C,QAAQ;IAAEC,OAAO;IAAE,GAAGC;GAAY,GAAG1C,KAAK;EACtG,MAAM2C,OAAO,GAAG5C,OAAa,CAAC,OAAO;IAAEC,KAAK,EAAE0C,UAAU;IAAEzC;GAAK,CAAC,EAAE,CAACyC,UAAU,CAAC,CAAC;EAE/E,oBACI3C,cAACD,cAAc,CAAC8C,QAAQ;IAACC,KAAK,EAAEF;kBAC5B5C,cAACK,IAAqB;IAACiC,WAAW,EAAEA,WAAW;IAAEC,KAAK,EAAEA,KAAK;IAAEC,IAAI,EAAEA,IAAI;IAAEO,YAAY,EAAEN;KACpFJ,MAAM,gBAAGrC,cAACG,MAAM,QAAEkC,MAAM,CAAU,GAAG,IAAI,EACzCK,OAAO,IAAI,CAACL,MAAM,gBAAGrC,cAACO,OAAO,QAAEmC,OAAO,CAAW,GAAG,IAAI,EACxD5B,QAAQ,CACW,CACF;AAElC,CAAC;AACDsB,OAAO,CAACjC,MAAM,GAAGA,MAAM;AACvBiC,OAAO,CAAC7B,OAAO,GAAGA,OAAO;AACzB6B,OAAO,CAACZ,OAAO,GAAGA,OAAO;AACzBY,OAAO,CAACD,KAAK,GAAGA,KAAK;AACrBC,OAAO,CAACY,MAAM,GAAG3C,MAAuB;;;;"}
@@ -15,7 +15,8 @@ const UnstyledArrow = /*#__PURE__*/forwardRef(function PopoverArrow(props, ref)
15
15
  transform: 'rotateZ(180deg)'
16
16
  }
17
17
  }), /*#__PURE__*/createElement("path", {
18
- className: "text-grey-300 fill-current group-focus:text-blue-300",
18
+ // rgba(89, 85, 98, 0.35) is the primary color of the yt-shadow, giving the arrow a shadow-like appearance
19
+ className: "text-[rgba(89, 85, 98, 0.35)] fill-current",
19
20
  d: "M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z"
20
21
  }), /*#__PURE__*/createElement("path", {
21
22
  className: "fill-current",
@@ -1 +1 @@
1
- {"version":3,"file":"Primitives.js","sources":["../../../../../../../src/components/Popover/Primitives.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nexport const UnstyledArrow = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>(function PopoverArrow(props, ref) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none -mt-px\" asChild offset={2} width={30} height={11}>\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\" style={{ transform: 'rotateZ(180deg)' }}>\n <path\n className=\"text-grey-300 fill-current group-focus:text-blue-300\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n"],"names":["UnstyledArrow","React","PopoverArrow","props","ref","PopoverPrimitive","className","asChild","offset","width","height","viewBox","style","transform","d"],"mappings":";;;MAGaA,aAAa,gBAAGC,UAAgB,CAAiD,SAASC,YAAYA,CAACC,KAAK,EAAEC,GAAG;EAC1H,oBACIH,cAACI,KAAsB;IAACC,SAAS,EAAC,4BAA4B;IAACC,OAAO;IAACC,MAAM,EAAE,CAAC;IAAEC,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE;kBACjGT,uCAASE,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEO,OAAO,EAAC,YAAY;IAACC,KAAK,EAAE;MAAEC,SAAS,EAAE;;mBAC/DZ;IACIK,SAAS,EAAC,sDAAsD;IAChEQ,CAAC,EAAC;IAAoI,eAC1Ib;IACIK,SAAS,EAAC,cAAc;IACxBQ,CAAC,EAAC;IAA6G,CACjH,CACe;AAEjC,CAAC;;;;"}
1
+ {"version":3,"file":"Primitives.js","sources":["../../../../../../../src/components/Popover/Primitives.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nexport const UnstyledArrow = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGElement>>(function PopoverArrow(props, ref) {\n return (\n <PopoverPrimitive.Arrow className=\"pointer-events-none -mt-px\" asChild offset={2} width={30} height={11}>\n <svg {...props} ref={ref} viewBox=\"0 19 30 11\" style={{ transform: 'rotateZ(180deg)' }}>\n <path\n // rgba(89, 85, 98, 0.35) is the primary color of the yt-shadow, giving the arrow a shadow-like appearance\n className=\"text-[rgba(89, 85, 98, 0.35)] fill-current\"\n d=\"M23.7,27.1L17,19.9C16.5,19.3,15.8,19,15,19s-1.6,0.3-2.1,0.9l-6.6,7.2C5.3,28.1,3.4,29,2,29h26 C26.7,29,24.6,28.1,23.7,27.1z\"></path>\n <path\n className=\"fill-current\"\n d=\"M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z\"></path>\n </svg>\n </PopoverPrimitive.Arrow>\n );\n});\n"],"names":["UnstyledArrow","React","PopoverArrow","props","ref","PopoverPrimitive","className","asChild","offset","width","height","viewBox","style","transform","d"],"mappings":";;;MAGaA,aAAa,gBAAGC,UAAgB,CAAiD,SAASC,YAAYA,CAACC,KAAK,EAAEC,GAAG;EAC1H,oBACIH,cAACI,KAAsB;IAACC,SAAS,EAAC,4BAA4B;IAACC,OAAO;IAACC,MAAM,EAAE,CAAC;IAAEC,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE;kBACjGT,uCAASE,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEO,OAAO,EAAC,YAAY;IAACC,KAAK,EAAE;MAAEC,SAAS,EAAE;;mBAC/DZ;;IAEIK,SAAS,EAAC,4CAA4C;IACtDQ,CAAC,EAAC;IAAoI,eAC1Ib;IACIK,SAAS,EAAC,cAAc;IACxBQ,CAAC,EAAC;IAA6G,CACjH,CACe;AAEjC,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Orientation } from '../../types';\nimport { getRadioClassnames } from './util';\n\nexport type RadioGroupItemValue = string | number | boolean | null;\n\nexport const getRadioGroupItemValueAsString = (value: RadioGroupItemValue): string => String(value ?? '');\n\nexport const findByValue = (values: RadioGroupItemValue[], valueAsString: string): RadioGroupItemValue =>\n values.find(value => getRadioGroupItemValueAsString(value) === valueAsString) as RadioGroupItemValue;\n\nconst RadioGroupContext = React.createContext({ disabled: false, invalid: false });\n\nexport type RadioGroupItemProps<T = HTMLButtonElement> = Omit<\n React.ButtonHTMLAttributes<T>,\n 'children' | 'onSelect' | 'value'\n> & {\n /** Label for the radio group item */\n children: React.ReactNode;\n /* Whether the radio group item is disabled */\n disabled?: boolean;\n /** Value of the radio button */\n value: RadioGroupItemValue;\n};\n\nconst RadioGroupItem = React.forwardRef(function RadioGroupItem(props: RadioGroupItemProps, ref: React.Ref<HTMLButtonElement>) {\n const context = React.useContext(RadioGroupContext);\n const { children, value, ...otherProps } = props;\n\n const isDisabled = context.disabled || props.disabled;\n\n const className = cn('self-start', getRadioClassnames(isDisabled, context.invalid));\n const labelClassName = cn(\n 'flex items-center gap-2',\n {\n 'cursor-pointer': !isDisabled,\n 'cursor-not-allowed text-grey-300': isDisabled,\n },\n props.className\n );\n\n return (\n <label className={labelClassName}>\n <RadioGroupPrimitive.Item\n {...otherProps}\n className={className}\n disabled={isDisabled}\n ref={ref}\n value={getRadioGroupItemValueAsString(value)}>\n <RadioGroupPrimitive.Indicator className=\"h-2 w-2 rounded-full bg-white\" />\n </RadioGroupPrimitive.Item>\n {children}\n </label>\n );\n});\n\ntype ReactGroupBaseChild = React.ReactElement<RadioGroupItemProps> | boolean | null;\n\ntype RadioGroupBaseProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue' | 'onChange' | 'value'> & {\n children: ReactGroupBaseChild[];\n /* Whether the radio group is disabled */\n disabled?: boolean;\n /* Whether the radio group is in an invalid state */\n invalid?: boolean;\n /** The name of the radio group, used when submitting an HTML form */\n name?: string;\n /**\n * Orientation of the radio group\n * @defaultValue vertical\n */\n orientation?: Orientation;\n /* Whether the radio group requires user input */\n required?: boolean;\n};\n\ninterface UncontrolledRadioGroupProps extends RadioGroupBaseProps {\n /* The default value (uncontrolled) */\n defaultValue?: RadioGroupItemValue;\n onChange?: never;\n value?: never;\n}\n\ninterface ControlledRadioGroupProps extends RadioGroupBaseProps {\n defaultValue?: never;\n /** Handler called when the value changes */\n onChange: (value: RadioGroupItemValue) => void;\n /** The current value (controlled) */\n value?: RadioGroupItemValue;\n}\n\nexport type RadioGroupProps = UncontrolledRadioGroupProps | ControlledRadioGroupProps;\n\nexport type ForwardedRadioGroupWithStatics = React.ForwardRefExoticComponent<\n RadioGroupProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Item component rendered in a `RadioGroup` component */\n Item: React.ForwardRefExoticComponent<RadioGroupItemProps>;\n};\n\nexport const useRadioGroup = (props: RadioGroupProps) => {\n const { children, defaultValue, disabled, invalid, onChange, orientation = 'vertical', value, ...otherProps } = props;\n\n const values = React.useMemo<RadioGroupItemValue[]>(() => {\n const radioGroupItemValues: RadioGroupItemValue[] = [];\n\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n radioGroupItemValues.push(child.props.value);\n }\n });\n\n return radioGroupItemValues;\n }, [children]);\n\n const context = React.useMemo(() => ({ disabled: disabled ?? false, invalid: invalid ?? false }), [disabled, invalid]);\n\n let valueProps;\n\n if (onChange !== undefined) {\n const handleChange = (value: string): void => onChange(findByValue(values, value));\n\n valueProps = {\n onValueChange: handleChange,\n value: value !== undefined ? getRadioGroupItemValueAsString(value) : undefined,\n };\n } else {\n valueProps = {\n defaultValue: defaultValue !== undefined ? getRadioGroupItemValueAsString(defaultValue) : undefined,\n };\n }\n\n return {\n context,\n props: {\n ...otherProps,\n ...valueProps,\n children,\n disabled,\n orientation,\n },\n };\n};\n\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { context, props: otherProps } = useRadioGroup(props);\n const className = cn(\n 'flex items-start gap-y-2',\n {\n 'flex-wrap gap-x-4 ': otherProps.orientation === 'horizontal',\n 'flex-col': otherProps.orientation === 'vertical',\n },\n otherProps.className\n );\n\n return (\n <RadioGroupContext.Provider value={context}>\n <RadioGroupPrimitive.Root {...otherProps} className={className} data-taco=\"radio-group\" ref={ref} />\n </RadioGroupContext.Provider>\n );\n}) as ForwardedRadioGroupWithStatics;\nRadioGroup.Item = RadioGroupItem;\n"],"names":["getRadioGroupItemValueAsString","value","String","findByValue","values","valueAsString","find","RadioGroupContext","React","disabled","invalid","RadioGroupItem","props","ref","context","children","otherProps","isDisabled","className","cn","getRadioClassnames","labelClassName","RadioGroupPrimitive","useRadioGroup","defaultValue","onChange","orientation","radioGroupItemValues","forEach","child","push","valueProps","undefined","handleChange","onValueChange","RadioGroup","Provider","Item"],"mappings":";;;;;MAQaA,8BAA8B,GAAIC,KAA0B,IAAaC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;MAE3FE,WAAW,GAAGA,CAACC,MAA6B,EAAEC,aAAqB,KAC5ED,MAAM,CAACE,IAAI,CAACL,KAAK,IAAID,8BAA8B,CAACC,KAAK,CAAC,KAAKI,aAAa;AAEhF,MAAME,iBAAiB,gBAAGC,aAAmB,CAAC;EAAEC,QAAQ,EAAE,KAAK;EAAEC,OAAO,EAAE;CAAO,CAAC;AAclF,MAAMC,cAAc,gBAAGH,UAAgB,CAAC,SAASG,cAAcA,CAACC,KAA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/BN,cAACc,IAAwB,oBAAKN,UAAU;IAAEE,SAAS,EAAEA,SAAS;iBAAY,aAAa;IAACL,GAAG,EAAEA;KAAO,CAC3E;AAErC,CAAC;AACDsB,UAAU,CAACE,IAAI,GAAG1B,cAAc;;;;"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../../../../../../src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Orientation } from '../../types';\nimport { getRadioClassnames } from './util';\n\nexport type RadioGroupItemValue = string | number | boolean | null;\n\nexport const getRadioGroupItemValueAsString = (value: RadioGroupItemValue): string => String(value ?? '');\n\nexport const findByValue = (values: RadioGroupItemValue[], valueAsString: string): RadioGroupItemValue =>\n values.find(value => getRadioGroupItemValueAsString(value) === valueAsString) as RadioGroupItemValue;\n\nconst RadioGroupContext = React.createContext({ disabled: false, invalid: false });\n\nexport type RadioGroupItemProps<T = HTMLButtonElement> = Omit<\n React.ButtonHTMLAttributes<T>,\n 'children' | 'onSelect' | 'value'\n> & {\n /** Label for the radio group item */\n children: React.ReactNode;\n /* Whether the radio group item is disabled */\n disabled?: boolean;\n /** Value of the radio button */\n value: RadioGroupItemValue;\n};\n\nconst RadioGroupItem = React.forwardRef(function RadioGroupItem(props: RadioGroupItemProps, ref: React.Ref<HTMLButtonElement>) {\n const context = React.useContext(RadioGroupContext);\n const { children, value, ...otherProps } = props;\n\n const isDisabled = context.disabled || props.disabled;\n\n const className = cn('self-start', getRadioClassnames(isDisabled, context.invalid));\n const labelClassName = cn(\n 'flex items-center gap-2',\n {\n 'cursor-pointer': !isDisabled,\n 'cursor-not-allowed text-grey-300': isDisabled,\n },\n props.className\n );\n\n return (\n <label className={labelClassName}>\n <RadioGroupPrimitive.Item\n {...otherProps}\n className={className}\n disabled={isDisabled}\n ref={ref}\n value={getRadioGroupItemValueAsString(value)}>\n <RadioGroupPrimitive.Indicator className=\"h-2 w-2 rounded-full bg-white\" />\n </RadioGroupPrimitive.Item>\n {children}\n </label>\n );\n});\n\ntype ReactGroupBaseChild = React.ReactElement<RadioGroupItemProps> | boolean | null;\n\ntype RadioGroupBaseProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children' | 'defaultValue' | 'onChange' | 'value' | 'dir'\n> & {\n children: ReactGroupBaseChild[];\n /* Whether the radio group is disabled */\n disabled?: boolean;\n /* Whether the radio group is in an invalid state */\n invalid?: boolean;\n /** The name of the radio group, used when submitting an HTML form */\n name?: string;\n /**\n * Orientation of the radio group\n * @defaultValue vertical\n */\n orientation?: Orientation;\n /* Whether the radio group requires user input */\n required?: boolean;\n};\n\ninterface UncontrolledRadioGroupProps extends RadioGroupBaseProps {\n /* The default value (uncontrolled) */\n defaultValue?: RadioGroupItemValue;\n onChange?: never;\n value?: never;\n}\n\ninterface ControlledRadioGroupProps extends RadioGroupBaseProps {\n defaultValue?: never;\n /** Handler called when the value changes */\n onChange: (value: RadioGroupItemValue) => void;\n /** The current value (controlled) */\n value?: RadioGroupItemValue;\n}\n\nexport type RadioGroupProps = UncontrolledRadioGroupProps | ControlledRadioGroupProps;\n\nexport type ForwardedRadioGroupWithStatics = React.ForwardRefExoticComponent<\n RadioGroupProps & React.RefAttributes<HTMLDivElement>\n> & {\n /** Item component rendered in a `RadioGroup` component */\n Item: React.ForwardRefExoticComponent<RadioGroupItemProps>;\n};\n\nexport const useRadioGroup = (props: RadioGroupProps) => {\n const { children, defaultValue, disabled, invalid, onChange, orientation = 'vertical', value, ...otherProps } = props;\n\n const values = React.useMemo<RadioGroupItemValue[]>(() => {\n const radioGroupItemValues: RadioGroupItemValue[] = [];\n\n React.Children.forEach(children, child => {\n if (React.isValidElement(child)) {\n radioGroupItemValues.push(child.props.value);\n }\n });\n\n return radioGroupItemValues;\n }, [children]);\n\n const context = React.useMemo(() => ({ disabled: disabled ?? false, invalid: invalid ?? false }), [disabled, invalid]);\n\n let valueProps;\n\n if (onChange !== undefined) {\n const handleChange = (value: string): void => onChange(findByValue(values, value));\n\n valueProps = {\n onValueChange: handleChange,\n value: value !== undefined ? getRadioGroupItemValueAsString(value) : undefined,\n };\n } else {\n valueProps = {\n defaultValue: defaultValue !== undefined ? getRadioGroupItemValueAsString(defaultValue) : undefined,\n };\n }\n\n return {\n context,\n props: {\n ...otherProps,\n ...valueProps,\n children,\n disabled,\n orientation,\n },\n };\n};\n\nexport const RadioGroup = React.forwardRef(function RadioGroup(props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) {\n const { context, props: otherProps } = useRadioGroup(props);\n const className = cn(\n 'flex items-start gap-y-2',\n {\n 'flex-wrap gap-x-4 ': otherProps.orientation === 'horizontal',\n 'flex-col': otherProps.orientation === 'vertical',\n },\n otherProps.className\n );\n\n return (\n <RadioGroupContext.Provider value={context}>\n <RadioGroupPrimitive.Root {...otherProps} className={className} data-taco=\"radio-group\" ref={ref} />\n </RadioGroupContext.Provider>\n );\n}) as ForwardedRadioGroupWithStatics;\nRadioGroup.Item = RadioGroupItem;\n"],"names":["getRadioGroupItemValueAsString","value","String","findByValue","values","valueAsString","find","RadioGroupContext","React","disabled","invalid","RadioGroupItem","props","ref","context","children","otherProps","isDisabled","className","cn","getRadioClassnames","labelClassName","RadioGroupPrimitive","useRadioGroup","defaultValue","onChange","orientation","radioGroupItemValues","forEach","child","push","valueProps","undefined","handleChange","onValueChange","RadioGroup","Provider","Item"],"mappings":";;;;;MAQaA,8BAA8B,GAAIC,KAA0B,IAAaC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE;MAE3FE,WAAW,GAAGA,CAACC,MAA6B,EAAEC,aAAqB,KAC5ED,MAAM,CAACE,IAAI,CAACL,KAAK,IAAID,8BAA8B,CAACC,KAAK,CAAC,KAAKI,aAAa;AAEhF,MAAME,iBAAiB,gBAAGC,aAAmB,CAAC;EAAEC,QAAQ,EAAE,KAAK;EAAEC,OAAO,EAAE;CAAO,CAAC;AAclF,MAAMC,cAAc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AiB,CAAC6B,QAAQ;IAACnC,KAAK,EAAEa;kBAC/BN,cAACc,IAAwB,oBAAKN,UAAU;IAAEE,SAAS,EAAEA,SAAS;iBAAY,aAAa;IAACL,GAAG,EAAEA;KAAO,CAC3E;AAErC,CAAC;AACDsB,UAAU,CAACE,IAAI,GAAG1B,cAAc;;;;"}
@@ -11,12 +11,12 @@ const Bar = props => {
11
11
  className: className
12
12
  }));
13
13
  };
14
- const Thumb = props => /*#__PURE__*/React__default.createElement(Thumb$1, Object.assign({}, props, {
14
+ const Thumb = () => /*#__PURE__*/React__default.createElement(Thumb$1, {
15
15
  className: "flex-[1] rounded bg-black opacity-50"
16
- }));
17
- const Corner = props => /*#__PURE__*/React__default.createElement(Corner$1, Object.assign({}, props, {
16
+ });
17
+ const Corner = () => /*#__PURE__*/React__default.createElement(Corner$1, {
18
18
  className: "bg-grey-500"
19
- }));
19
+ });
20
20
  const ScrollArea = props => {
21
21
  const {
22
22
  children,
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollArea.js","sources":["../../../../../../../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nconst Bar = props => {\n const className = cn(`flex select-none touch-none transition-colors hover:bg-grey`, {\n 'w-[7px] hover:w-[14px] mr-[2px] hover:px-[2px] hover:mr-0': props.orientation === 'vertical',\n 'flex-col h-[7px] hover:h-[14px] mb-[2px] hover:py-[2px] hover:mb-0': props.orientation === 'horizontal',\n });\n return <ScrollAreaPrimitive.Scrollbar {...props} className={className} />;\n};\n\nconst Thumb = props => <ScrollAreaPrimitive.Thumb {...props} className=\"flex-[1] rounded bg-black opacity-50\" />;\n\nconst Corner = props => <ScrollAreaPrimitive.Corner {...props} className=\"bg-grey-500\" />;\n\nexport type ScrollbarProps = Omit<ScrollAreaPrimitive.ScrollAreaProps, 'scrollHideDelay'>;\n\nexport const ScrollArea = (props: ScrollbarProps) => {\n const { children, ...otherProps } = props;\n\n return (\n <ScrollAreaPrimitive.Root {...otherProps} className={cn('overflow-hidden', props.className)} data-taco=\"scrollarea\">\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full\">{children}</ScrollAreaPrimitive.Viewport>\n <Bar orientation=\"vertical\">\n <Thumb />\n </Bar>\n <Bar orientation=\"horizontal\">\n <Thumb />\n </Bar>\n <Corner />\n </ScrollAreaPrimitive.Root>\n );\n};\n"],"names":["Bar","props","className","cn","orientation","React","ScrollAreaPrimitive","Thumb","Corner","ScrollArea","children","otherProps"],"mappings":";;;;AAIA,MAAMA,GAAG,GAAGC,KAAK;EACb,MAAMC,SAAS,GAAGC,EAAE,CAAC,6DAA6D,EAAE;IAChF,2DAA2D,EAAEF,KAAK,CAACG,WAAW,KAAK,UAAU;IAC7F,oEAAoE,EAAEH,KAAK,CAACG,WAAW,KAAK;GAC/F,CAAC;EACF,oBAAOC,6BAACC,SAA6B,oBAAKL,KAAK;IAAEC,SAAS,EAAEA;KAAa;AAC7E,CAAC;AAED,MAAMK,KAAK,GAAGN,KAAK,iBAAII,6BAACC,OAAyB,oBAAKL,KAAK;EAAEC,SAAS,EAAC;GAAyC;AAEhH,MAAMM,MAAM,GAAGP,KAAK,iBAAII,6BAACC,QAA0B,oBAAKL,KAAK;EAAEC,SAAS,EAAC;GAAgB;MAI5EO,UAAU,GAAIR,KAAqB;EAC5C,MAAM;IAAES,QAAQ;IAAE,GAAGC;GAAY,GAAGV,KAAK;EAEzC,oBACII,6BAACC,IAAwB,oBAAKK,UAAU;IAAET,SAAS,EAAEC,EAAE,CAAC,iBAAiB,EAAEF,KAAK,CAACC,SAAS,CAAC;iBAAY;mBACnGG,6BAACC,QAA4B;IAACJ,SAAS,EAAC;KAAiBQ,QAAQ,CAAgC,eACjGL,6BAACL,GAAG;IAACI,WAAW,EAAC;kBACbC,6BAACE,KAAK,OAAG,CACP,eACNF,6BAACL,GAAG;IAACI,WAAW,EAAC;kBACbC,6BAACE,KAAK,OAAG,CACP,eACNF,6BAACG,MAAM,OAAG,CACa;AAEnC;;;;"}
1
+ {"version":3,"file":"ScrollArea.js","sources":["../../../../../../../src/components/ScrollArea/ScrollArea.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'clsx';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nconst Bar = (props: { children: React.ReactNode; orientation: 'vertical' | 'horizontal' }) => {\n const className = cn(`flex select-none touch-none transition-colors hover:bg-grey`, {\n 'w-[7px] hover:w-[14px] mr-[2px] hover:px-[2px] hover:mr-0': props.orientation === 'vertical',\n 'flex-col h-[7px] hover:h-[14px] mb-[2px] hover:py-[2px] hover:mb-0': props.orientation === 'horizontal',\n });\n return <ScrollAreaPrimitive.Scrollbar {...props} className={className} />;\n};\n\nconst Thumb = () => <ScrollAreaPrimitive.Thumb className=\"flex-[1] rounded bg-black opacity-50\" />;\n\nconst Corner = () => <ScrollAreaPrimitive.Corner className=\"bg-grey-500\" />;\n\nexport type ScrollbarProps = Omit<ScrollAreaPrimitive.ScrollAreaProps, 'scrollHideDelay'>;\n\nexport const ScrollArea = (props: ScrollbarProps) => {\n const { children, ...otherProps } = props;\n\n return (\n <ScrollAreaPrimitive.Root {...otherProps} className={cn('overflow-hidden', props.className)} data-taco=\"scrollarea\">\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full\">{children}</ScrollAreaPrimitive.Viewport>\n <Bar orientation=\"vertical\">\n <Thumb />\n </Bar>\n <Bar orientation=\"horizontal\">\n <Thumb />\n </Bar>\n <Corner />\n </ScrollAreaPrimitive.Root>\n );\n};\n"],"names":["Bar","props","className","cn","orientation","React","ScrollAreaPrimitive","Thumb","Corner","ScrollArea","children","otherProps"],"mappings":";;;;AAIA,MAAMA,GAAG,GAAIC,KAA4E;EACrF,MAAMC,SAAS,GAAGC,EAAE,CAAC,6DAA6D,EAAE;IAChF,2DAA2D,EAAEF,KAAK,CAACG,WAAW,KAAK,UAAU;IAC7F,oEAAoE,EAAEH,KAAK,CAACG,WAAW,KAAK;GAC/F,CAAC;EACF,oBAAOC,6BAACC,SAA6B,oBAAKL,KAAK;IAAEC,SAAS,EAAEA;KAAa;AAC7E,CAAC;AAED,MAAMK,KAAK,GAAGA,mBAAMF,6BAACC,OAAyB;EAACJ,SAAS,EAAC;EAAyC;AAElG,MAAMM,MAAM,GAAGA,mBAAMH,6BAACC,QAA0B;EAACJ,SAAS,EAAC;EAAgB;MAI9DO,UAAU,GAAIR,KAAqB;EAC5C,MAAM;IAAES,QAAQ;IAAE,GAAGC;GAAY,GAAGV,KAAK;EAEzC,oBACII,6BAACC,IAAwB,oBAAKK,UAAU;IAAET,SAAS,EAAEC,EAAE,CAAC,iBAAiB,EAAEF,KAAK,CAACC,SAAS,CAAC;iBAAY;mBACnGG,6BAACC,QAA4B;IAACJ,SAAS,EAAC;KAAiBQ,QAAQ,CAAgC,eACjGL,6BAACL,GAAG;IAACI,WAAW,EAAC;kBACbC,6BAACE,KAAK,OAAG,CACP,eACNF,6BAACL,GAAG;IAACI,WAAW,EAAC;kBACbC,6BAACE,KAAK,OAAG,CACP,eACNF,6BAACG,MAAM,OAAG,CACa;AAEnC;;;;"}