@economic/taco 11.0.0 → 11.0.1-react-v19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (774) hide show
  1. package/dist/charts/components/Area/AreaChart.cjs.map +1 -1
  2. package/dist/charts/components/Area/AreaChart.d.ts +1 -1
  3. package/dist/charts/components/Area/AreaChart.js.map +1 -1
  4. package/dist/charts/components/Bar/BarChart.cjs.map +1 -1
  5. package/dist/charts/components/Bar/BarChart.d.ts +1 -1
  6. package/dist/charts/components/Bar/BarChart.js.map +1 -1
  7. package/dist/charts/components/Composed/BarLineChart.cjs.map +1 -1
  8. package/dist/charts/components/Composed/BarLineChart.d.ts +2 -2
  9. package/dist/charts/components/Composed/BarLineChart.js.map +1 -1
  10. package/dist/charts/components/Donut/DonutChart.cjs.map +1 -1
  11. package/dist/charts/components/Donut/DonutChart.d.ts +1 -1
  12. package/dist/charts/components/Donut/DonutChart.js.map +1 -1
  13. package/dist/charts/components/Line/LineChart.cjs.map +1 -1
  14. package/dist/charts/components/Line/LineChart.d.ts +1 -1
  15. package/dist/charts/components/Line/LineChart.js.map +1 -1
  16. package/dist/charts/components/Pie/PieChart.cjs.map +1 -1
  17. package/dist/charts/components/Pie/PieChart.d.ts +1 -1
  18. package/dist/charts/components/Pie/PieChart.js.map +1 -1
  19. package/dist/charts/components/Tooltip.cjs.map +1 -1
  20. package/dist/charts/components/Tooltip.d.ts +1 -1
  21. package/dist/charts/components/Tooltip.js.map +1 -1
  22. package/dist/charts/components/types.d.ts +2 -2
  23. package/dist/components/AlertDialog/AlertDialog.cjs.map +1 -1
  24. package/dist/components/AlertDialog/AlertDialog.d.ts +1 -1
  25. package/dist/components/AlertDialog/AlertDialog.js.map +1 -1
  26. package/dist/components/Banner/util.cjs.map +1 -1
  27. package/dist/components/Banner/util.d.ts +2 -1
  28. package/dist/components/Banner/util.js.map +1 -1
  29. package/dist/components/Card/Card.cjs.map +1 -1
  30. package/dist/components/Card/Card.d.ts +1 -1
  31. package/dist/components/Card/Card.js.map +1 -1
  32. package/dist/components/Combobox/Combobox.cjs.map +1 -1
  33. package/dist/components/Combobox/Combobox.d.ts +1 -1
  34. package/dist/components/Combobox/Combobox.js.map +1 -1
  35. package/dist/components/Combobox/useCombobox.cjs.map +1 -1
  36. package/dist/components/Combobox/useCombobox.d.ts +1 -1
  37. package/dist/components/Combobox/useCombobox.js.map +1 -1
  38. package/dist/components/Dialog/Dialog.cjs.map +1 -1
  39. package/dist/components/Dialog/Dialog.d.ts +1 -1
  40. package/dist/components/Dialog/Dialog.js.map +1 -1
  41. package/dist/components/Dialog/components/Content.cjs.map +1 -1
  42. package/dist/components/Dialog/components/Content.d.ts +2 -2
  43. package/dist/components/Dialog/components/Content.js.map +1 -1
  44. package/dist/components/Drawer/Drawer.cjs.map +1 -1
  45. package/dist/components/Drawer/Drawer.d.ts +1 -1
  46. package/dist/components/Drawer/Drawer.js.map +1 -1
  47. package/dist/components/Drawer/useDrawerStack.cjs +1 -1
  48. package/dist/components/Drawer/useDrawerStack.cjs.map +1 -1
  49. package/dist/components/Drawer/useDrawerStack.js +1 -1
  50. package/dist/components/Drawer/useDrawerStack.js.map +1 -1
  51. package/dist/components/Hanger/Hanger.cjs.map +1 -1
  52. package/dist/components/Hanger/Hanger.d.ts +1 -1
  53. package/dist/components/Hanger/Hanger.js.map +1 -1
  54. package/dist/components/Header/components/Agreement/Display.cjs.map +1 -1
  55. package/dist/components/Header/components/Agreement/Display.d.ts +1 -1
  56. package/dist/components/Header/components/Agreement/Display.js.map +1 -1
  57. package/dist/components/Header/components/Agreement/Item.cjs.map +1 -1
  58. package/dist/components/Header/components/Agreement/Item.d.ts +1 -1
  59. package/dist/components/Header/components/Agreement/Item.js.map +1 -1
  60. package/dist/components/Header/components/Link.cjs.map +1 -1
  61. package/dist/components/Header/components/Link.d.ts +1 -1
  62. package/dist/components/Header/components/Link.js.map +1 -1
  63. package/dist/components/Icon/components/AccountPreview.cjs.map +1 -1
  64. package/dist/components/Icon/components/AccountPreview.js.map +1 -1
  65. package/dist/components/Icon/components/Accounting.cjs.map +1 -1
  66. package/dist/components/Icon/components/Accounting.js.map +1 -1
  67. package/dist/components/Icon/components/AccountingYear.cjs.map +1 -1
  68. package/dist/components/Icon/components/AccountingYear.js.map +1 -1
  69. package/dist/components/Icon/components/AccountingYearCancel.cjs.map +1 -1
  70. package/dist/components/Icon/components/AccountingYearCancel.js.map +1 -1
  71. package/dist/components/Icon/components/AiChatSolid.cjs.map +1 -1
  72. package/dist/components/Icon/components/AiChatSolid.js.map +1 -1
  73. package/dist/components/Icon/components/AiStars.cjs.map +1 -1
  74. package/dist/components/Icon/components/AiStars.js.map +1 -1
  75. package/dist/components/Icon/components/ArrowBottom.cjs.map +1 -1
  76. package/dist/components/Icon/components/ArrowBottom.js.map +1 -1
  77. package/dist/components/Icon/components/ArrowDown.cjs.map +1 -1
  78. package/dist/components/Icon/components/ArrowDown.js.map +1 -1
  79. package/dist/components/Icon/components/ArrowEnd.cjs.map +1 -1
  80. package/dist/components/Icon/components/ArrowEnd.js.map +1 -1
  81. package/dist/components/Icon/components/ArrowLeft.cjs.map +1 -1
  82. package/dist/components/Icon/components/ArrowLeft.js.map +1 -1
  83. package/dist/components/Icon/components/ArrowRight.cjs.map +1 -1
  84. package/dist/components/Icon/components/ArrowRight.js.map +1 -1
  85. package/dist/components/Icon/components/ArrowStart.cjs.map +1 -1
  86. package/dist/components/Icon/components/ArrowStart.js.map +1 -1
  87. package/dist/components/Icon/components/ArrowTop.cjs.map +1 -1
  88. package/dist/components/Icon/components/ArrowTop.js.map +1 -1
  89. package/dist/components/Icon/components/ArrowUp.cjs.map +1 -1
  90. package/dist/components/Icon/components/ArrowUp.js.map +1 -1
  91. package/dist/components/Icon/components/Attach.cjs.map +1 -1
  92. package/dist/components/Icon/components/Attach.js.map +1 -1
  93. package/dist/components/Icon/components/AttachAuto.cjs.map +1 -1
  94. package/dist/components/Icon/components/AttachAuto.js.map +1 -1
  95. package/dist/components/Icon/components/AttachCancel.cjs.map +1 -1
  96. package/dist/components/Icon/components/AttachCancel.js.map +1 -1
  97. package/dist/components/Icon/components/AttachWarning.cjs.map +1 -1
  98. package/dist/components/Icon/components/AttachWarning.js.map +1 -1
  99. package/dist/components/Icon/components/Autopay.cjs.map +1 -1
  100. package/dist/components/Icon/components/Autopay.js.map +1 -1
  101. package/dist/components/Icon/components/AutopayPaused.cjs.map +1 -1
  102. package/dist/components/Icon/components/AutopayPaused.js.map +1 -1
  103. package/dist/components/Icon/components/Autotext.cjs.map +1 -1
  104. package/dist/components/Icon/components/Autotext.js.map +1 -1
  105. package/dist/components/Icon/components/AutotextInsert.cjs.map +1 -1
  106. package/dist/components/Icon/components/AutotextInsert.js.map +1 -1
  107. package/dist/components/Icon/components/Basic.cjs.map +1 -1
  108. package/dist/components/Icon/components/Basic.js.map +1 -1
  109. package/dist/components/Icon/components/BasicTabs.cjs.map +1 -1
  110. package/dist/components/Icon/components/BasicTabs.js.map +1 -1
  111. package/dist/components/Icon/components/BellSolid.cjs.map +1 -1
  112. package/dist/components/Icon/components/BellSolid.js.map +1 -1
  113. package/dist/components/Icon/components/Book.cjs.map +1 -1
  114. package/dist/components/Icon/components/Book.js.map +1 -1
  115. package/dist/components/Icon/components/Booking.cjs.map +1 -1
  116. package/dist/components/Icon/components/Booking.js.map +1 -1
  117. package/dist/components/Icon/components/Budget.cjs.map +1 -1
  118. package/dist/components/Icon/components/Budget.js.map +1 -1
  119. package/dist/components/Icon/components/Calendar.cjs.map +1 -1
  120. package/dist/components/Icon/components/Calendar.js.map +1 -1
  121. package/dist/components/Icon/components/CashAccount.cjs.map +1 -1
  122. package/dist/components/Icon/components/CashAccount.js.map +1 -1
  123. package/dist/components/Icon/components/CashReports.cjs.map +1 -1
  124. package/dist/components/Icon/components/CashReports.js.map +1 -1
  125. package/dist/components/Icon/components/ChartArea.cjs.map +1 -1
  126. package/dist/components/Icon/components/ChartArea.js.map +1 -1
  127. package/dist/components/Icon/components/ChartBar.cjs.map +1 -1
  128. package/dist/components/Icon/components/ChartBar.js.map +1 -1
  129. package/dist/components/Icon/components/ChartLine.cjs.map +1 -1
  130. package/dist/components/Icon/components/ChartLine.js.map +1 -1
  131. package/dist/components/Icon/components/ChartPie.cjs.map +1 -1
  132. package/dist/components/Icon/components/ChartPie.js.map +1 -1
  133. package/dist/components/Icon/components/ChartTable.cjs.map +1 -1
  134. package/dist/components/Icon/components/ChartTable.js.map +1 -1
  135. package/dist/components/Icon/components/Chat.cjs.map +1 -1
  136. package/dist/components/Icon/components/Chat.js.map +1 -1
  137. package/dist/components/Icon/components/ChatSolid.cjs.map +1 -1
  138. package/dist/components/Icon/components/ChatSolid.js.map +1 -1
  139. package/dist/components/Icon/components/ChevronDown.cjs.map +1 -1
  140. package/dist/components/Icon/components/ChevronDown.js.map +1 -1
  141. package/dist/components/Icon/components/ChevronDownDouble.cjs.map +1 -1
  142. package/dist/components/Icon/components/ChevronDownDouble.js.map +1 -1
  143. package/dist/components/Icon/components/ChevronDownSolid.cjs.map +1 -1
  144. package/dist/components/Icon/components/ChevronDownSolid.js.map +1 -1
  145. package/dist/components/Icon/components/ChevronLeft.cjs.map +1 -1
  146. package/dist/components/Icon/components/ChevronLeft.js.map +1 -1
  147. package/dist/components/Icon/components/ChevronLeftDouble.cjs.map +1 -1
  148. package/dist/components/Icon/components/ChevronLeftDouble.js.map +1 -1
  149. package/dist/components/Icon/components/ChevronLeftSolid.cjs.map +1 -1
  150. package/dist/components/Icon/components/ChevronLeftSolid.js.map +1 -1
  151. package/dist/components/Icon/components/ChevronRight.cjs.map +1 -1
  152. package/dist/components/Icon/components/ChevronRight.js.map +1 -1
  153. package/dist/components/Icon/components/ChevronRightDouble.cjs.map +1 -1
  154. package/dist/components/Icon/components/ChevronRightDouble.js.map +1 -1
  155. package/dist/components/Icon/components/ChevronRightSolid.cjs.map +1 -1
  156. package/dist/components/Icon/components/ChevronRightSolid.js.map +1 -1
  157. package/dist/components/Icon/components/ChevronUp.cjs.map +1 -1
  158. package/dist/components/Icon/components/ChevronUp.js.map +1 -1
  159. package/dist/components/Icon/components/ChevronUpDouble.cjs.map +1 -1
  160. package/dist/components/Icon/components/ChevronUpDouble.js.map +1 -1
  161. package/dist/components/Icon/components/ChevronUpSolid.cjs.map +1 -1
  162. package/dist/components/Icon/components/ChevronUpSolid.js.map +1 -1
  163. package/dist/components/Icon/components/CircleInformation.cjs.map +1 -1
  164. package/dist/components/Icon/components/CircleInformation.js.map +1 -1
  165. package/dist/components/Icon/components/CircleMinus.cjs.map +1 -1
  166. package/dist/components/Icon/components/CircleMinus.js.map +1 -1
  167. package/dist/components/Icon/components/CirclePlus.cjs.map +1 -1
  168. package/dist/components/Icon/components/CirclePlus.js.map +1 -1
  169. package/dist/components/Icon/components/CircleQuestionmark.cjs.map +1 -1
  170. package/dist/components/Icon/components/CircleQuestionmark.js.map +1 -1
  171. package/dist/components/Icon/components/CircleTick.cjs.map +1 -1
  172. package/dist/components/Icon/components/CircleTick.js.map +1 -1
  173. package/dist/components/Icon/components/CircleWarning.cjs.map +1 -1
  174. package/dist/components/Icon/components/CircleWarning.js.map +1 -1
  175. package/dist/components/Icon/components/Clamp.cjs.map +1 -1
  176. package/dist/components/Icon/components/Clamp.js.map +1 -1
  177. package/dist/components/Icon/components/ClampOpen.cjs.map +1 -1
  178. package/dist/components/Icon/components/ClampOpen.js.map +1 -1
  179. package/dist/components/Icon/components/ClickToPay.cjs.map +1 -1
  180. package/dist/components/Icon/components/ClickToPay.js.map +1 -1
  181. package/dist/components/Icon/components/Close.cjs.map +1 -1
  182. package/dist/components/Icon/components/Close.js.map +1 -1
  183. package/dist/components/Icon/components/ColumnFreeze.cjs.map +1 -1
  184. package/dist/components/Icon/components/ColumnFreeze.js.map +1 -1
  185. package/dist/components/Icon/components/ColumnUnfreeze.cjs.map +1 -1
  186. package/dist/components/Icon/components/ColumnUnfreeze.js.map +1 -1
  187. package/dist/components/Icon/components/Columns.cjs.map +1 -1
  188. package/dist/components/Icon/components/Columns.js.map +1 -1
  189. package/dist/components/Icon/components/ConnectionEnable.cjs.map +1 -1
  190. package/dist/components/Icon/components/ConnectionEnable.js.map +1 -1
  191. package/dist/components/Icon/components/ConnectionRevoke.cjs.map +1 -1
  192. package/dist/components/Icon/components/ConnectionRevoke.js.map +1 -1
  193. package/dist/components/Icon/components/Contacts.cjs.map +1 -1
  194. package/dist/components/Icon/components/Contacts.js.map +1 -1
  195. package/dist/components/Icon/components/Copy.cjs.map +1 -1
  196. package/dist/components/Icon/components/Copy.js.map +1 -1
  197. package/dist/components/Icon/components/Courses.cjs.map +1 -1
  198. package/dist/components/Icon/components/Courses.js.map +1 -1
  199. package/dist/components/Icon/components/Credit.cjs.map +1 -1
  200. package/dist/components/Icon/components/Credit.js.map +1 -1
  201. package/dist/components/Icon/components/Delete.cjs.map +1 -1
  202. package/dist/components/Icon/components/Delete.js.map +1 -1
  203. package/dist/components/Icon/components/DeletePermanently.cjs.map +1 -1
  204. package/dist/components/Icon/components/DeletePermanently.js.map +1 -1
  205. package/dist/components/Icon/components/Depecriate.cjs.map +1 -1
  206. package/dist/components/Icon/components/Depecriate.js.map +1 -1
  207. package/dist/components/Icon/components/Developer.cjs.map +1 -1
  208. package/dist/components/Icon/components/Developer.js.map +1 -1
  209. package/dist/components/Icon/components/DistributionTemplate.cjs.map +1 -1
  210. package/dist/components/Icon/components/DistributionTemplate.js.map +1 -1
  211. package/dist/components/Icon/components/Document.cjs.map +1 -1
  212. package/dist/components/Icon/components/Document.js.map +1 -1
  213. package/dist/components/Icon/components/DocumentApprove.cjs.map +1 -1
  214. package/dist/components/Icon/components/DocumentApprove.js.map +1 -1
  215. package/dist/components/Icon/components/DocumentCreateEntry.cjs.map +1 -1
  216. package/dist/components/Icon/components/DocumentCreateEntry.js.map +1 -1
  217. package/dist/components/Icon/components/DocumentCut.cjs.map +1 -1
  218. package/dist/components/Icon/components/DocumentCut.js.map +1 -1
  219. package/dist/components/Icon/components/DocumentError.cjs.map +1 -1
  220. package/dist/components/Icon/components/DocumentError.js.map +1 -1
  221. package/dist/components/Icon/components/DocumentIsolatePage.cjs.map +1 -1
  222. package/dist/components/Icon/components/DocumentIsolatePage.js.map +1 -1
  223. package/dist/components/Icon/components/DocumentMerge.cjs.map +1 -1
  224. package/dist/components/Icon/components/DocumentMerge.js.map +1 -1
  225. package/dist/components/Icon/components/DocumentMove.cjs.map +1 -1
  226. package/dist/components/Icon/components/DocumentMove.js.map +1 -1
  227. package/dist/components/Icon/components/DocumentPreview.cjs.map +1 -1
  228. package/dist/components/Icon/components/DocumentPreview.js.map +1 -1
  229. package/dist/components/Icon/components/DocumentReceived.cjs.map +1 -1
  230. package/dist/components/Icon/components/DocumentReceived.js.map +1 -1
  231. package/dist/components/Icon/components/DocumentRejectedRequest.cjs.map +1 -1
  232. package/dist/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
  233. package/dist/components/Icon/components/DocumentSigned.cjs.map +1 -1
  234. package/dist/components/Icon/components/DocumentSigned.js.map +1 -1
  235. package/dist/components/Icon/components/DocumentSignedSolid.cjs.map +1 -1
  236. package/dist/components/Icon/components/DocumentSignedSolid.js.map +1 -1
  237. package/dist/components/Icon/components/DocumentSplit.cjs.map +1 -1
  238. package/dist/components/Icon/components/DocumentSplit.js.map +1 -1
  239. package/dist/components/Icon/components/DocumentTime.cjs.map +1 -1
  240. package/dist/components/Icon/components/DocumentTime.js.map +1 -1
  241. package/dist/components/Icon/components/Download.cjs.map +1 -1
  242. package/dist/components/Icon/components/Download.js.map +1 -1
  243. package/dist/components/Icon/components/Drag.cjs.map +1 -1
  244. package/dist/components/Icon/components/Drag.js.map +1 -1
  245. package/dist/components/Icon/components/ECopedia.cjs.map +1 -1
  246. package/dist/components/Icon/components/ECopedia.js.map +1 -1
  247. package/dist/components/Icon/components/Edit.cjs.map +1 -1
  248. package/dist/components/Icon/components/Edit.js.map +1 -1
  249. package/dist/components/Icon/components/EditSimple.cjs.map +1 -1
  250. package/dist/components/Icon/components/EditSimple.js.map +1 -1
  251. package/dist/components/Icon/components/EllipsisHorizontal.cjs.map +1 -1
  252. package/dist/components/Icon/components/EllipsisHorizontal.js.map +1 -1
  253. package/dist/components/Icon/components/EllipsisVertical.cjs.map +1 -1
  254. package/dist/components/Icon/components/EllipsisVertical.js.map +1 -1
  255. package/dist/components/Icon/components/EntriesOnAccount.cjs.map +1 -1
  256. package/dist/components/Icon/components/EntriesOnAccount.js.map +1 -1
  257. package/dist/components/Icon/components/EntriesOpen.cjs.map +1 -1
  258. package/dist/components/Icon/components/EntriesOpen.js.map +1 -1
  259. package/dist/components/Icon/components/EntriesWarning.cjs.map +1 -1
  260. package/dist/components/Icon/components/EntriesWarning.js.map +1 -1
  261. package/dist/components/Icon/components/EntryTypeCustomerInvoice.cjs.map +1 -1
  262. package/dist/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
  263. package/dist/components/Icon/components/EntryTypeCustomerPayment.cjs.map +1 -1
  264. package/dist/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
  265. package/dist/components/Icon/components/EntryTypeJournalEntry.cjs.map +1 -1
  266. package/dist/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
  267. package/dist/components/Icon/components/EntryTypeManualCustomerInvoice.cjs.map +1 -1
  268. package/dist/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
  269. package/dist/components/Icon/components/EntryTypeSupplierInvoice.cjs.map +1 -1
  270. package/dist/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
  271. package/dist/components/Icon/components/EntryTypeSupplierPayment.cjs.map +1 -1
  272. package/dist/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
  273. package/dist/components/Icon/components/Envelope.cjs.map +1 -1
  274. package/dist/components/Icon/components/Envelope.js.map +1 -1
  275. package/dist/components/Icon/components/EnvelopeApproved.cjs.map +1 -1
  276. package/dist/components/Icon/components/EnvelopeApproved.js.map +1 -1
  277. package/dist/components/Icon/components/EnvelopeSolid.cjs.map +1 -1
  278. package/dist/components/Icon/components/EnvelopeSolid.js.map +1 -1
  279. package/dist/components/Icon/components/ExpandView.cjs.map +1 -1
  280. package/dist/components/Icon/components/ExpandView.js.map +1 -1
  281. package/dist/components/Icon/components/Expenses.cjs.map +1 -1
  282. package/dist/components/Icon/components/Expenses.js.map +1 -1
  283. package/dist/components/Icon/components/Experiment.cjs.map +1 -1
  284. package/dist/components/Icon/components/Experiment.js.map +1 -1
  285. package/dist/components/Icon/components/Export.cjs.map +1 -1
  286. package/dist/components/Icon/components/Export.js.map +1 -1
  287. package/dist/components/Icon/components/ExportToExcel.cjs.map +1 -1
  288. package/dist/components/Icon/components/ExportToExcel.js.map +1 -1
  289. package/dist/components/Icon/components/ExportToPdf.cjs.map +1 -1
  290. package/dist/components/Icon/components/ExportToPdf.js.map +1 -1
  291. package/dist/components/Icon/components/EyeOff.cjs.map +1 -1
  292. package/dist/components/Icon/components/EyeOff.js.map +1 -1
  293. package/dist/components/Icon/components/EyeOn.cjs.map +1 -1
  294. package/dist/components/Icon/components/EyeOn.js.map +1 -1
  295. package/dist/components/Icon/components/Filter.cjs.map +1 -1
  296. package/dist/components/Icon/components/Filter.js.map +1 -1
  297. package/dist/components/Icon/components/FilterSolid.cjs.map +1 -1
  298. package/dist/components/Icon/components/FilterSolid.js.map +1 -1
  299. package/dist/components/Icon/components/FontSize.cjs.map +1 -1
  300. package/dist/components/Icon/components/FontSize.js.map +1 -1
  301. package/dist/components/Icon/components/GraphSolid.cjs.map +1 -1
  302. package/dist/components/Icon/components/GraphSolid.js.map +1 -1
  303. package/dist/components/Icon/components/Hash.cjs.map +1 -1
  304. package/dist/components/Icon/components/Hash.js.map +1 -1
  305. package/dist/components/Icon/components/HeightExtraTall.cjs.map +1 -1
  306. package/dist/components/Icon/components/HeightExtraTall.js.map +1 -1
  307. package/dist/components/Icon/components/HeightMedium.cjs.map +1 -1
  308. package/dist/components/Icon/components/HeightMedium.js.map +1 -1
  309. package/dist/components/Icon/components/HeightShort.cjs.map +1 -1
  310. package/dist/components/Icon/components/HeightShort.js.map +1 -1
  311. package/dist/components/Icon/components/HeightTall.cjs.map +1 -1
  312. package/dist/components/Icon/components/HeightTall.js.map +1 -1
  313. package/dist/components/Icon/components/House.cjs.map +1 -1
  314. package/dist/components/Icon/components/House.js.map +1 -1
  315. package/dist/components/Icon/components/HouseSolid.cjs.map +1 -1
  316. package/dist/components/Icon/components/HouseSolid.js.map +1 -1
  317. package/dist/components/Icon/components/Id.cjs.map +1 -1
  318. package/dist/components/Icon/components/Id.js.map +1 -1
  319. package/dist/components/Icon/components/Images.cjs.map +1 -1
  320. package/dist/components/Icon/components/Images.js.map +1 -1
  321. package/dist/components/Icon/components/Import.cjs.map +1 -1
  322. package/dist/components/Icon/components/Import.js.map +1 -1
  323. package/dist/components/Icon/components/Inbox.cjs.map +1 -1
  324. package/dist/components/Icon/components/Inbox.js.map +1 -1
  325. package/dist/components/Icon/components/InboxEinvoicing.cjs.map +1 -1
  326. package/dist/components/Icon/components/InboxEinvoicing.js.map +1 -1
  327. package/dist/components/Icon/components/InboxScanning.cjs.map +1 -1
  328. package/dist/components/Icon/components/InboxScanning.js.map +1 -1
  329. package/dist/components/Icon/components/InboxSmart.cjs.map +1 -1
  330. package/dist/components/Icon/components/InboxSmart.js.map +1 -1
  331. package/dist/components/Icon/components/Info.cjs.map +1 -1
  332. package/dist/components/Icon/components/Info.js.map +1 -1
  333. package/dist/components/Icon/components/Inventory.cjs.map +1 -1
  334. package/dist/components/Icon/components/Inventory.js.map +1 -1
  335. package/dist/components/Icon/components/InventoryMatrix.cjs.map +1 -1
  336. package/dist/components/Icon/components/InventoryMatrix.js.map +1 -1
  337. package/dist/components/Icon/components/JournalPro.cjs.map +1 -1
  338. package/dist/components/Icon/components/JournalPro.js.map +1 -1
  339. package/dist/components/Icon/components/Layout.cjs.map +1 -1
  340. package/dist/components/Icon/components/Layout.js.map +1 -1
  341. package/dist/components/Icon/components/LayoutBoth.cjs.map +1 -1
  342. package/dist/components/Icon/components/LayoutBoth.js.map +1 -1
  343. package/dist/components/Icon/components/LayoutFirst.cjs.map +1 -1
  344. package/dist/components/Icon/components/LayoutFirst.js.map +1 -1
  345. package/dist/components/Icon/components/LayoutLast.cjs.map +1 -1
  346. package/dist/components/Icon/components/LayoutLast.js.map +1 -1
  347. package/dist/components/Icon/components/LayoutNone.cjs.map +1 -1
  348. package/dist/components/Icon/components/LayoutNone.js.map +1 -1
  349. package/dist/components/Icon/components/LedgerCard.cjs.map +1 -1
  350. package/dist/components/Icon/components/LedgerCard.js.map +1 -1
  351. package/dist/components/Icon/components/LedgerCardCustomerReminder.cjs.map +1 -1
  352. package/dist/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
  353. package/dist/components/Icon/components/LedgerCardManualCustomerInvoice.cjs.map +1 -1
  354. package/dist/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
  355. package/dist/components/Icon/components/LedgerCardObsoleteStock.cjs.map +1 -1
  356. package/dist/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
  357. package/dist/components/Icon/components/LedgerCardOpeningEntry.cjs.map +1 -1
  358. package/dist/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
  359. package/dist/components/Icon/components/LedgerCardReservedEntry.cjs.map +1 -1
  360. package/dist/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
  361. package/dist/components/Icon/components/LedgerCardShrinkagePilferage.cjs.map +1 -1
  362. package/dist/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
  363. package/dist/components/Icon/components/LedgerCardStockAdjustment.cjs.map +1 -1
  364. package/dist/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
  365. package/dist/components/Icon/components/LedgerCardTransferredOpeningEntry.cjs.map +1 -1
  366. package/dist/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
  367. package/dist/components/Icon/components/Lightbulb.cjs.map +1 -1
  368. package/dist/components/Icon/components/Lightbulb.js.map +1 -1
  369. package/dist/components/Icon/components/Line.cjs.map +1 -1
  370. package/dist/components/Icon/components/Line.js.map +1 -1
  371. package/dist/components/Icon/components/LinkExternal.cjs.map +1 -1
  372. package/dist/components/Icon/components/LinkExternal.js.map +1 -1
  373. package/dist/components/Icon/components/List.cjs.map +1 -1
  374. package/dist/components/Icon/components/List.js.map +1 -1
  375. package/dist/components/Icon/components/ListBulleted.cjs.map +1 -1
  376. package/dist/components/Icon/components/ListBulleted.js.map +1 -1
  377. package/dist/components/Icon/components/ListSearch.cjs.map +1 -1
  378. package/dist/components/Icon/components/ListSearch.js.map +1 -1
  379. package/dist/components/Icon/components/Location.cjs.map +1 -1
  380. package/dist/components/Icon/components/Location.js.map +1 -1
  381. package/dist/components/Icon/components/Lock.cjs.map +1 -1
  382. package/dist/components/Icon/components/Lock.js.map +1 -1
  383. package/dist/components/Icon/components/LockOpen.cjs.map +1 -1
  384. package/dist/components/Icon/components/LockOpen.js.map +1 -1
  385. package/dist/components/Icon/components/Log.cjs.map +1 -1
  386. package/dist/components/Icon/components/Log.js.map +1 -1
  387. package/dist/components/Icon/components/LogOut.cjs.map +1 -1
  388. package/dist/components/Icon/components/LogOut.js.map +1 -1
  389. package/dist/components/Icon/components/Market.cjs.map +1 -1
  390. package/dist/components/Icon/components/Market.js.map +1 -1
  391. package/dist/components/Icon/components/MastercardOs.cjs.map +1 -1
  392. package/dist/components/Icon/components/MastercardOs.js.map +1 -1
  393. package/dist/components/Icon/components/MatchAmount.cjs.map +1 -1
  394. package/dist/components/Icon/components/MatchAmount.js.map +1 -1
  395. package/dist/components/Icon/components/MatchEntries.cjs.map +1 -1
  396. package/dist/components/Icon/components/MatchEntries.js.map +1 -1
  397. package/dist/components/Icon/components/Menu.cjs.map +1 -1
  398. package/dist/components/Icon/components/Menu.js.map +1 -1
  399. package/dist/components/Icon/components/Mileage.cjs.map +1 -1
  400. package/dist/components/Icon/components/Mileage.js.map +1 -1
  401. package/dist/components/Icon/components/ModalResize.cjs.map +1 -1
  402. package/dist/components/Icon/components/ModalResize.js.map +1 -1
  403. package/dist/components/Icon/components/ModalShrink.cjs.map +1 -1
  404. package/dist/components/Icon/components/ModalShrink.js.map +1 -1
  405. package/dist/components/Icon/components/More.cjs.map +1 -1
  406. package/dist/components/Icon/components/More.js.map +1 -1
  407. package/dist/components/Icon/components/MoreSolid.cjs.map +1 -1
  408. package/dist/components/Icon/components/MoreSolid.js.map +1 -1
  409. package/dist/components/Icon/components/Move.cjs.map +1 -1
  410. package/dist/components/Icon/components/Move.js.map +1 -1
  411. package/dist/components/Icon/components/NavigationList.cjs.map +1 -1
  412. package/dist/components/Icon/components/NavigationList.js.map +1 -1
  413. package/dist/components/Icon/components/Note.cjs.map +1 -1
  414. package/dist/components/Icon/components/Note.js.map +1 -1
  415. package/dist/components/Icon/components/NoteFollowUp.cjs.map +1 -1
  416. package/dist/components/Icon/components/NoteFollowUp.js.map +1 -1
  417. package/dist/components/Icon/components/NoteRead.cjs.map +1 -1
  418. package/dist/components/Icon/components/NoteRead.js.map +1 -1
  419. package/dist/components/Icon/components/NovemberFirst.cjs.map +1 -1
  420. package/dist/components/Icon/components/NovemberFirst.js.map +1 -1
  421. package/dist/components/Icon/components/Numbers.cjs.map +1 -1
  422. package/dist/components/Icon/components/Numbers.js.map +1 -1
  423. package/dist/components/Icon/components/PartialPaymentScheduled.cjs.map +1 -1
  424. package/dist/components/Icon/components/PartialPaymentScheduled.js.map +1 -1
  425. package/dist/components/Icon/components/PartnerApi.cjs.map +1 -1
  426. package/dist/components/Icon/components/PartnerApi.js.map +1 -1
  427. package/dist/components/Icon/components/PaymentPaid.cjs.map +1 -1
  428. package/dist/components/Icon/components/PaymentPaid.js.map +1 -1
  429. package/dist/components/Icon/components/PaymentUnpaid.cjs.map +1 -1
  430. package/dist/components/Icon/components/PaymentUnpaid.js.map +1 -1
  431. package/dist/components/Icon/components/Period.cjs.map +1 -1
  432. package/dist/components/Icon/components/Period.js.map +1 -1
  433. package/dist/components/Icon/components/Person.cjs.map +1 -1
  434. package/dist/components/Icon/components/Person.js.map +1 -1
  435. package/dist/components/Icon/components/PersonChange.cjs.map +1 -1
  436. package/dist/components/Icon/components/PersonChange.js.map +1 -1
  437. package/dist/components/Icon/components/PersonMinus.cjs.map +1 -1
  438. package/dist/components/Icon/components/PersonMinus.js.map +1 -1
  439. package/dist/components/Icon/components/PersonPlus.cjs.map +1 -1
  440. package/dist/components/Icon/components/PersonPlus.js.map +1 -1
  441. package/dist/components/Icon/components/PersonSolid.cjs.map +1 -1
  442. package/dist/components/Icon/components/PersonSolid.js.map +1 -1
  443. package/dist/components/Icon/components/PersonTick.cjs.map +1 -1
  444. package/dist/components/Icon/components/PersonTick.js.map +1 -1
  445. package/dist/components/Icon/components/Phone.cjs.map +1 -1
  446. package/dist/components/Icon/components/Phone.js.map +1 -1
  447. package/dist/components/Icon/components/PhoneSolid.cjs.map +1 -1
  448. package/dist/components/Icon/components/PhoneSolid.js.map +1 -1
  449. package/dist/components/Icon/components/Play.cjs.map +1 -1
  450. package/dist/components/Icon/components/Play.js.map +1 -1
  451. package/dist/components/Icon/components/PlusMinus.cjs.map +1 -1
  452. package/dist/components/Icon/components/PlusMinus.js.map +1 -1
  453. package/dist/components/Icon/components/Print.cjs.map +1 -1
  454. package/dist/components/Icon/components/Print.js.map +1 -1
  455. package/dist/components/Icon/components/ProcessPayment.cjs.map +1 -1
  456. package/dist/components/Icon/components/ProcessPayment.js.map +1 -1
  457. package/dist/components/Icon/components/ProductLedgerCard.cjs.map +1 -1
  458. package/dist/components/Icon/components/ProductLedgerCard.js.map +1 -1
  459. package/dist/components/Icon/components/Profile.cjs.map +1 -1
  460. package/dist/components/Icon/components/Profile.js.map +1 -1
  461. package/dist/components/Icon/components/ProjectCards.cjs.map +1 -1
  462. package/dist/components/Icon/components/ProjectCards.js.map +1 -1
  463. package/dist/components/Icon/components/Projects.cjs.map +1 -1
  464. package/dist/components/Icon/components/Projects.js.map +1 -1
  465. package/dist/components/Icon/components/QuestionMark.cjs.map +1 -1
  466. package/dist/components/Icon/components/QuestionMark.js.map +1 -1
  467. package/dist/components/Icon/components/QuestionMarkBold.cjs.map +1 -1
  468. package/dist/components/Icon/components/QuestionMarkBold.js.map +1 -1
  469. package/dist/components/Icon/components/Quicklinks.cjs.map +1 -1
  470. package/dist/components/Icon/components/Quicklinks.js.map +1 -1
  471. package/dist/components/Icon/components/RatingBankruptcy.cjs.map +1 -1
  472. package/dist/components/Icon/components/RatingBankruptcy.js.map +1 -1
  473. package/dist/components/Icon/components/RatingPaymentProblems.cjs.map +1 -1
  474. package/dist/components/Icon/components/RatingPaymentProblems.js.map +1 -1
  475. package/dist/components/Icon/components/Reconciled.cjs.map +1 -1
  476. package/dist/components/Icon/components/Reconciled.js.map +1 -1
  477. package/dist/components/Icon/components/Refresh.cjs.map +1 -1
  478. package/dist/components/Icon/components/Refresh.js.map +1 -1
  479. package/dist/components/Icon/components/Remove.cjs.map +1 -1
  480. package/dist/components/Icon/components/Remove.js.map +1 -1
  481. package/dist/components/Icon/components/Report.cjs.map +1 -1
  482. package/dist/components/Icon/components/Report.js.map +1 -1
  483. package/dist/components/Icon/components/ReportSolid.cjs.map +1 -1
  484. package/dist/components/Icon/components/ReportSolid.js.map +1 -1
  485. package/dist/components/Icon/components/Restore.cjs.map +1 -1
  486. package/dist/components/Icon/components/Restore.js.map +1 -1
  487. package/dist/components/Icon/components/RotateLeft.cjs.map +1 -1
  488. package/dist/components/Icon/components/RotateLeft.js.map +1 -1
  489. package/dist/components/Icon/components/RotateRight.cjs.map +1 -1
  490. package/dist/components/Icon/components/RotateRight.js.map +1 -1
  491. package/dist/components/Icon/components/Sales.cjs.map +1 -1
  492. package/dist/components/Icon/components/Sales.js.map +1 -1
  493. package/dist/components/Icon/components/Search.cjs.map +1 -1
  494. package/dist/components/Icon/components/Search.js.map +1 -1
  495. package/dist/components/Icon/components/SearchBold.cjs.map +1 -1
  496. package/dist/components/Icon/components/SearchBold.js.map +1 -1
  497. package/dist/components/Icon/components/Secure.cjs.map +1 -1
  498. package/dist/components/Icon/components/Secure.js.map +1 -1
  499. package/dist/components/Icon/components/SecureTick.cjs.map +1 -1
  500. package/dist/components/Icon/components/SecureTick.js.map +1 -1
  501. package/dist/components/Icon/components/Settings.cjs.map +1 -1
  502. package/dist/components/Icon/components/Settings.js.map +1 -1
  503. package/dist/components/Icon/components/SettingsSolid.cjs.map +1 -1
  504. package/dist/components/Icon/components/SettingsSolid.js.map +1 -1
  505. package/dist/components/Icon/components/Shortcuts.cjs.map +1 -1
  506. package/dist/components/Icon/components/Shortcuts.js.map +1 -1
  507. package/dist/components/Icon/components/ShowAll.cjs.map +1 -1
  508. package/dist/components/Icon/components/ShowAll.js.map +1 -1
  509. package/dist/components/Icon/components/ShowLess.cjs.map +1 -1
  510. package/dist/components/Icon/components/ShowLess.js.map +1 -1
  511. package/dist/components/Icon/components/ShowMore.cjs.map +1 -1
  512. package/dist/components/Icon/components/ShowMore.js.map +1 -1
  513. package/dist/components/Icon/components/ShowTemplate.cjs.map +1 -1
  514. package/dist/components/Icon/components/ShowTemplate.js.map +1 -1
  515. package/dist/components/Icon/components/Sliders.cjs.map +1 -1
  516. package/dist/components/Icon/components/Sliders.js.map +1 -1
  517. package/dist/components/Icon/components/Smartpay.cjs.map +1 -1
  518. package/dist/components/Icon/components/Smartpay.js.map +1 -1
  519. package/dist/components/Icon/components/SortBy.cjs.map +1 -1
  520. package/dist/components/Icon/components/SortBy.js.map +1 -1
  521. package/dist/components/Icon/components/Star.cjs.map +1 -1
  522. package/dist/components/Icon/components/Star.js.map +1 -1
  523. package/dist/components/Icon/components/StarSolid.cjs.map +1 -1
  524. package/dist/components/Icon/components/StarSolid.js.map +1 -1
  525. package/dist/components/Icon/components/Subscriptions.cjs.map +1 -1
  526. package/dist/components/Icon/components/Subscriptions.js.map +1 -1
  527. package/dist/components/Icon/components/SystemEntries.cjs.map +1 -1
  528. package/dist/components/Icon/components/SystemEntries.js.map +1 -1
  529. package/dist/components/Icon/components/Tag.cjs.map +1 -1
  530. package/dist/components/Icon/components/Tag.js.map +1 -1
  531. package/dist/components/Icon/components/TemplateOverride.cjs.map +1 -1
  532. package/dist/components/Icon/components/TemplateOverride.js.map +1 -1
  533. package/dist/components/Icon/components/Templates.cjs.map +1 -1
  534. package/dist/components/Icon/components/Templates.js.map +1 -1
  535. package/dist/components/Icon/components/ThumbBoth.cjs.map +1 -1
  536. package/dist/components/Icon/components/ThumbBoth.js.map +1 -1
  537. package/dist/components/Icon/components/ThumbDown.cjs.map +1 -1
  538. package/dist/components/Icon/components/ThumbDown.js.map +1 -1
  539. package/dist/components/Icon/components/ThumbDownSolid.cjs.map +1 -1
  540. package/dist/components/Icon/components/ThumbDownSolid.js.map +1 -1
  541. package/dist/components/Icon/components/ThumbUp.cjs.map +1 -1
  542. package/dist/components/Icon/components/ThumbUp.js.map +1 -1
  543. package/dist/components/Icon/components/ThumbUpSolid.cjs.map +1 -1
  544. package/dist/components/Icon/components/ThumbUpSolid.js.map +1 -1
  545. package/dist/components/Icon/components/Tick.cjs.map +1 -1
  546. package/dist/components/Icon/components/Tick.js.map +1 -1
  547. package/dist/components/Icon/components/TickBold.cjs.map +1 -1
  548. package/dist/components/Icon/components/TickBold.js.map +1 -1
  549. package/dist/components/Icon/components/Time.cjs.map +1 -1
  550. package/dist/components/Icon/components/Time.js.map +1 -1
  551. package/dist/components/Icon/components/Transfer.cjs.map +1 -1
  552. package/dist/components/Icon/components/Transfer.js.map +1 -1
  553. package/dist/components/Icon/components/TransferCancel.cjs.map +1 -1
  554. package/dist/components/Icon/components/TransferCancel.js.map +1 -1
  555. package/dist/components/Icon/components/TransferLocked.cjs.map +1 -1
  556. package/dist/components/Icon/components/TransferLocked.js.map +1 -1
  557. package/dist/components/Icon/components/Undo.cjs.map +1 -1
  558. package/dist/components/Icon/components/Undo.js.map +1 -1
  559. package/dist/components/Icon/components/Undock.cjs.map +1 -1
  560. package/dist/components/Icon/components/Undock.js.map +1 -1
  561. package/dist/components/Icon/components/Unreconciled.cjs.map +1 -1
  562. package/dist/components/Icon/components/Unreconciled.js.map +1 -1
  563. package/dist/components/Icon/components/Wallet.cjs.map +1 -1
  564. package/dist/components/Icon/components/Wallet.js.map +1 -1
  565. package/dist/components/Icon/components/Warning.cjs.map +1 -1
  566. package/dist/components/Icon/components/Warning.js.map +1 -1
  567. package/dist/components/Icon/components/Webshop.cjs.map +1 -1
  568. package/dist/components/Icon/components/Webshop.js.map +1 -1
  569. package/dist/components/Icon/components/Website.cjs.map +1 -1
  570. package/dist/components/Icon/components/Website.js.map +1 -1
  571. package/dist/components/Icon/components/Workflow.cjs.map +1 -1
  572. package/dist/components/Icon/components/Workflow.js.map +1 -1
  573. package/dist/components/Icon/components/WorkflowTemplateBasic.cjs.map +1 -1
  574. package/dist/components/Icon/components/WorkflowTemplateBasic.js.map +1 -1
  575. package/dist/components/Icon/components/Zoom.cjs.map +1 -1
  576. package/dist/components/Icon/components/Zoom.js.map +1 -1
  577. package/dist/components/Input/Input.cjs.map +1 -1
  578. package/dist/components/Input/Input.d.ts +14 -8
  579. package/dist/components/Input/Input.js.map +1 -1
  580. package/dist/components/LegacyComponents/Button/Button.cjs.map +1 -1
  581. package/dist/components/LegacyComponents/Button/Button.d.ts +13 -13
  582. package/dist/components/LegacyComponents/Button/Button.js.map +1 -1
  583. package/dist/components/LegacyComponents/Button/util.cjs.map +1 -1
  584. package/dist/components/LegacyComponents/Button/util.d.ts +2 -2
  585. package/dist/components/LegacyComponents/Button/util.js.map +1 -1
  586. package/dist/components/LegacyComponents/IconButton/IconButton.cjs.map +1 -1
  587. package/dist/components/LegacyComponents/IconButton/IconButton.d.ts +15 -15
  588. package/dist/components/LegacyComponents/IconButton/IconButton.js.map +1 -1
  589. package/dist/components/List/List.cjs.map +1 -1
  590. package/dist/components/List/List.d.ts +3 -3
  591. package/dist/components/List/List.js.map +1 -1
  592. package/dist/components/List/components/Collapsible.cjs.map +1 -1
  593. package/dist/components/List/components/Collapsible.d.ts +2 -2
  594. package/dist/components/List/components/Collapsible.js.map +1 -1
  595. package/dist/components/List/components/Group.cjs.map +1 -1
  596. package/dist/components/List/components/Group.d.ts +2 -2
  597. package/dist/components/List/components/Group.js.map +1 -1
  598. package/dist/components/List/components/Item.cjs.map +1 -1
  599. package/dist/components/List/components/Item.d.ts +7 -7
  600. package/dist/components/List/components/Item.js.map +1 -1
  601. package/dist/components/List/components/Toggle.cjs.map +1 -1
  602. package/dist/components/List/components/Toggle.js.map +1 -1
  603. package/dist/components/Listbox/ScrollableList.cjs.map +1 -1
  604. package/dist/components/Listbox/ScrollableList.d.ts +4 -2
  605. package/dist/components/Listbox/ScrollableList.js.map +1 -1
  606. package/dist/components/Listbox/util.cjs.map +1 -1
  607. package/dist/components/Listbox/util.d.ts +9 -5
  608. package/dist/components/Listbox/util.js.map +1 -1
  609. package/dist/components/Menu/Context.cjs.map +1 -1
  610. package/dist/components/Menu/Context.d.ts +2 -2
  611. package/dist/components/Menu/Context.js.map +1 -1
  612. package/dist/components/Menu/Menu.cjs.map +1 -1
  613. package/dist/components/Menu/Menu.d.ts +1 -1
  614. package/dist/components/Menu/Menu.js.map +1 -1
  615. package/dist/components/Menu/components/Content.cjs.map +1 -1
  616. package/dist/components/Menu/components/Content.js.map +1 -1
  617. package/dist/components/Menu/components/Item.cjs.map +1 -1
  618. package/dist/components/Menu/components/Item.d.ts +2 -2
  619. package/dist/components/Menu/components/Item.js.map +1 -1
  620. package/dist/components/Menu/components/RadioGroup.cjs.map +1 -1
  621. package/dist/components/Menu/components/RadioGroup.js.map +1 -1
  622. package/dist/components/Navigation2/components/Group.cjs.map +1 -1
  623. package/dist/components/Navigation2/components/Group.d.ts +2 -2
  624. package/dist/components/Navigation2/components/Group.js.map +1 -1
  625. package/dist/components/Navigation2/components/Link.cjs.map +1 -1
  626. package/dist/components/Navigation2/components/Link.d.ts +2 -2
  627. package/dist/components/Navigation2/components/Link.js.map +1 -1
  628. package/dist/components/OverflowGroup/OverflowGroup.cjs.map +1 -1
  629. package/dist/components/OverflowGroup/OverflowGroup.js.map +1 -1
  630. package/dist/components/Pagination/PageNumbers.cjs.map +1 -1
  631. package/dist/components/Pagination/PageNumbers.d.ts +2 -1
  632. package/dist/components/Pagination/PageNumbers.js.map +1 -1
  633. package/dist/components/Popover/Popover.cjs.map +1 -1
  634. package/dist/components/Popover/Popover.d.ts +2 -2
  635. package/dist/components/Popover/Popover.js.map +1 -1
  636. package/dist/components/Progress/Progress.cjs.map +1 -1
  637. package/dist/components/Progress/Progress.d.ts +1 -1
  638. package/dist/components/Progress/Progress.js.map +1 -1
  639. package/dist/components/Provider/Provider.cjs.map +1 -1
  640. package/dist/components/Provider/Provider.d.ts +1 -1
  641. package/dist/components/Provider/Provider.js.map +1 -1
  642. package/dist/components/RadioGroup/RadioGroup.cjs.map +1 -1
  643. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  644. package/dist/components/Report/Report.cjs.map +1 -1
  645. package/dist/components/Report/Report.d.ts +1 -1
  646. package/dist/components/Report/Report.js.map +1 -1
  647. package/dist/components/SearchInput2/SearchInput2.cjs.map +1 -1
  648. package/dist/components/SearchInput2/SearchInput2.d.ts +1 -1
  649. package/dist/components/SearchInput2/SearchInput2.js.map +1 -1
  650. package/dist/components/Select/useSelect.cjs.map +1 -1
  651. package/dist/components/Select/useSelect.d.ts +2 -2
  652. package/dist/components/Select/useSelect.js.map +1 -1
  653. package/dist/components/Select2/Select2.cjs +1 -3
  654. package/dist/components/Select2/Select2.cjs.map +1 -1
  655. package/dist/components/Select2/Select2.d.ts +5 -5
  656. package/dist/components/Select2/Select2.js +1 -3
  657. package/dist/components/Select2/Select2.js.map +1 -1
  658. package/dist/components/Select2/components/Context.cjs.map +1 -1
  659. package/dist/components/Select2/components/Context.d.ts +3 -3
  660. package/dist/components/Select2/components/Context.js.map +1 -1
  661. package/dist/components/Select2/components/Option.cjs.map +1 -1
  662. package/dist/components/Select2/components/Option.d.ts +7 -7
  663. package/dist/components/Select2/components/Option.js.map +1 -1
  664. package/dist/components/Select2/components/Search.d.ts +7 -4
  665. package/dist/components/Select2/components/Trigger.cjs +6 -5
  666. package/dist/components/Select2/components/Trigger.cjs.map +1 -1
  667. package/dist/components/Select2/components/Trigger.js +6 -5
  668. package/dist/components/Select2/components/Trigger.js.map +1 -1
  669. package/dist/components/Select2/types.d.ts +1 -1
  670. package/dist/components/Table3/Table3.cjs.map +1 -1
  671. package/dist/components/Table3/Table3.d.ts +1 -1
  672. package/dist/components/Table3/Table3.js.map +1 -1
  673. package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.cjs.map +1 -1
  674. package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.d.ts +1 -1
  675. package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
  676. package/dist/components/Table3/components/Columns/Cell/EditingControlCell.cjs.map +1 -1
  677. package/dist/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
  678. package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.cjs.map +1 -1
  679. package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.d.ts +2 -1
  680. package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -1
  681. package/dist/components/Table3/components/Editing/Alert.cjs +9 -3
  682. package/dist/components/Table3/components/Editing/Alert.cjs.map +1 -1
  683. package/dist/components/Table3/components/Editing/Alert.js +9 -3
  684. package/dist/components/Table3/components/Editing/Alert.js.map +1 -1
  685. package/dist/components/Table3/components/Row/Editing/TemporaryRow.cjs.map +1 -1
  686. package/dist/components/Table3/components/Row/Editing/TemporaryRow.d.ts +1 -1
  687. package/dist/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
  688. package/dist/components/Table3/features/useEditingState.cjs +14 -6
  689. package/dist/components/Table3/features/useEditingState.cjs.map +1 -1
  690. package/dist/components/Table3/features/useEditingState.d.ts +24 -6
  691. package/dist/components/Table3/features/useEditingState.js +14 -6
  692. package/dist/components/Table3/features/useEditingState.js.map +1 -1
  693. package/dist/components/Table3/features/useTableEditing.d.ts +28 -7
  694. package/dist/components/Tabs/components/TabList.cjs.map +1 -1
  695. package/dist/components/Tabs/components/TabList.js.map +1 -1
  696. package/dist/components/Tabs/components/Trigger.cjs.map +1 -1
  697. package/dist/components/Tabs/components/Trigger.d.ts +2 -2
  698. package/dist/components/Tabs/components/Trigger.js.map +1 -1
  699. package/dist/components/Toast/Toast.cjs.map +1 -1
  700. package/dist/components/Toast/Toast.d.ts +1 -1
  701. package/dist/components/Toast/Toast.js.map +1 -1
  702. package/dist/components/Toast/Toaster.cjs.map +1 -1
  703. package/dist/components/Toast/Toaster.d.ts +1 -1
  704. package/dist/components/Toast/Toaster.js.map +1 -1
  705. package/dist/components/Toast/util.cjs.map +1 -1
  706. package/dist/components/Toast/util.d.ts +2 -1
  707. package/dist/components/Toast/util.js.map +1 -1
  708. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  709. package/dist/components/Tooltip/Tooltip.d.ts +2 -2
  710. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  711. package/dist/components/Truncate/Truncate.cjs.map +1 -1
  712. package/dist/components/Truncate/Truncate.d.ts +5 -2
  713. package/dist/components/Truncate/Truncate.js.map +1 -1
  714. package/dist/hooks/useBoundingClientRectListener.cjs.map +1 -1
  715. package/dist/hooks/useBoundingClientRectListener.d.ts +1 -1
  716. package/dist/hooks/useBoundingClientRectListener.js.map +1 -1
  717. package/dist/hooks/useIntersectionObserver.cjs.map +1 -1
  718. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  719. package/dist/hooks/useIntersectionObserver.js.map +1 -1
  720. package/dist/hooks/useMergedRef.cjs.map +1 -1
  721. package/dist/hooks/useMergedRef.js.map +1 -1
  722. package/dist/hooks/useResizeObserver.cjs.map +1 -1
  723. package/dist/hooks/useResizeObserver.d.ts +1 -1
  724. package/dist/hooks/useResizeObserver.js.map +1 -1
  725. package/dist/primitives/Button.cjs.map +1 -1
  726. package/dist/primitives/Button.d.ts +2 -2
  727. package/dist/primitives/Button.js.map +1 -1
  728. package/dist/primitives/Listbox2/components/Option.d.ts +1 -1
  729. package/dist/primitives/Sortable/components/Item.cjs.map +1 -1
  730. package/dist/primitives/Sortable/components/Item.js.map +1 -1
  731. package/dist/primitives/Table/Core/Table.cjs.map +1 -1
  732. package/dist/primitives/Table/Core/Table.d.ts +2 -2
  733. package/dist/primitives/Table/Core/Table.js.map +1 -1
  734. package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.cjs.map +1 -1
  735. package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
  736. package/dist/primitives/Table/Core/components/Columns/Cell/util.cjs.map +1 -1
  737. package/dist/primitives/Table/Core/components/Columns/Cell/util.d.ts +1 -1
  738. package/dist/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
  739. package/dist/primitives/Table/Core/components/Columns/Internal/Actions.cjs.map +1 -1
  740. package/dist/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
  741. package/dist/primitives/Table/Core/components/Footer/Footer.cjs.map +1 -1
  742. package/dist/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
  743. package/dist/primitives/Table/Core/components/Header/Header.cjs.map +1 -1
  744. package/dist/primitives/Table/Core/components/Header/Header.d.ts +1 -1
  745. package/dist/primitives/Table/Core/components/Header/Header.js.map +1 -1
  746. package/dist/primitives/Table/Core/components/Header/components/Menu.cjs.map +1 -1
  747. package/dist/primitives/Table/Core/components/Header/components/Menu.d.ts +1 -1
  748. package/dist/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
  749. package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.cjs.map +1 -1
  750. package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.d.ts +1 -1
  751. package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
  752. package/dist/primitives/Table/Core/components/Toolbar/Toolbar.cjs.map +1 -1
  753. package/dist/primitives/Table/Core/components/Toolbar/Toolbar.d.ts +1 -1
  754. package/dist/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
  755. package/dist/primitives/Table/Core/features/useTableRenderer.cjs.map +1 -1
  756. package/dist/primitives/Table/Core/features/useTableRenderer.d.ts +1 -1
  757. package/dist/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
  758. package/dist/primitives/Table/Core/types.d.ts +3 -3
  759. package/dist/primitives/Table/Core/useTable.cjs.map +1 -1
  760. package/dist/primitives/Table/Core/useTable.d.ts +4 -4
  761. package/dist/primitives/Table/Core/useTable.js.map +1 -1
  762. package/dist/primitives/Table/types.cjs.map +1 -1
  763. package/dist/primitives/Table/types.d.ts +15 -15
  764. package/dist/primitives/Table/types.js.map +1 -1
  765. package/dist/primitives/Table/useTableManager/features/useTableRowSelection.d.ts +1 -1
  766. package/dist/primitives/Table/useTableManager/types.d.ts +2 -2
  767. package/dist/primitives/Table/useTableManager/util/setup.cjs +2 -2
  768. package/dist/primitives/Table/useTableManager/util/setup.cjs.map +1 -1
  769. package/dist/primitives/Table/useTableManager/util/setup.js +2 -2
  770. package/dist/primitives/Table/useTableManager/util/setup.js.map +1 -1
  771. package/dist/types.cjs.map +1 -1
  772. package/dist/types.d.ts +1 -1
  773. package/dist/types.js.map +1 -1
  774. package/package.json +8 -15
@@ -1 +1 @@
1
- {"version":3,"file":"util.cjs","sources":["../../../src/components/Banner/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { State } from '../../types';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\n\nexport const getBannerIcon = (type: State): JSX.Element | null => {\n return (\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n <div className=\"mt-[5px] self-start\">\n {(() => {\n switch (type) {\n case 'success':\n return <BadgeIcon icon=\"tick\" color=\"green\" />;\n case 'error':\n return <BadgeIcon icon=\"close\" color=\"red\" />;\n case 'experiment':\n return <BadgeIcon icon=\"experiment\" color=\"purple\" />;\n case 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n"],"names":["BadgeIcon"],"mappings":";;;;AAKO,MAAM,gBAAgB,CAAC,SAAoC;AAC9D;AAAA;AAAA,IAEI,sBAAA,cAAC,OAAA,EAAI,WAAU,sBAAA,IACT,MAAM;AACJ,cAAQ,MAAA;AAAA,QACJ,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,QAAO,OAAM,SAAQ;AAAA,QAChD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,SAAQ,OAAM,OAAM;AAAA,QAC/C,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,cAAa,OAAM,UAAS;AAAA,QACvD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,WAAU,OAAM,UAAS;AAAA,QACpD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,QAAO,OAAM,QAAO;AAAA,QAC/C;AACI,iBAAO;AAAA,MAAA;AAAA,IAEnB,IACJ;AAAA;AAER;;"}
1
+ {"version":3,"file":"util.cjs","sources":["../../../src/components/Banner/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { State } from '../../types';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\n\nexport const getBannerIcon = (type: State): React.JSX.Element | null => {\n return (\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n <div className=\"mt-[5px] self-start\">\n {(() => {\n switch (type) {\n case 'success':\n return <BadgeIcon icon=\"tick\" color=\"green\" />;\n case 'error':\n return <BadgeIcon icon=\"close\" color=\"red\" />;\n case 'experiment':\n return <BadgeIcon icon=\"experiment\" color=\"purple\" />;\n case 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n"],"names":["BadgeIcon"],"mappings":";;;;AAKO,MAAM,gBAAgB,CAAC,SAA0C;AACpE;AAAA;AAAA,IAEI,sBAAA,cAAC,OAAA,EAAI,WAAU,sBAAA,IACT,MAAM;AACJ,cAAQ,MAAA;AAAA,QACJ,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,QAAO,OAAM,SAAQ;AAAA,QAChD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,SAAQ,OAAM,OAAM;AAAA,QAC/C,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,cAAa,OAAM,UAAS;AAAA,QACvD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,WAAU,OAAM,UAAS;AAAA,QACpD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,QAAO,OAAM,QAAO;AAAA,QAC/C;AACI,iBAAO;AAAA,MAAA;AAAA,IAEnB,IACJ;AAAA;AAER;;"}
@@ -1,2 +1,3 @@
1
+ import { default as React } from 'react';
1
2
  import { State } from '../../types';
2
- export declare const getBannerIcon: (type: State) => JSX.Element | null;
3
+ export declare const getBannerIcon: (type: State) => React.JSX.Element | null;
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../src/components/Banner/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { State } from '../../types';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\n\nexport const getBannerIcon = (type: State): JSX.Element | null => {\n return (\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n <div className=\"mt-[5px] self-start\">\n {(() => {\n switch (type) {\n case 'success':\n return <BadgeIcon icon=\"tick\" color=\"green\" />;\n case 'error':\n return <BadgeIcon icon=\"close\" color=\"red\" />;\n case 'experiment':\n return <BadgeIcon icon=\"experiment\" color=\"purple\" />;\n case 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n"],"names":["React"],"mappings":";;AAKO,MAAM,gBAAgB,CAAC,SAAoC;AAC9D;AAAA;AAAA,IAEIA,+BAAA,cAAC,OAAA,EAAI,WAAU,sBAAA,IACT,MAAM;AACJ,cAAQ,MAAA;AAAA,QACJ,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,QAAO,OAAM,SAAQ;AAAA,QAChD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,SAAQ,OAAM,OAAM;AAAA,QAC/C,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,cAAa,OAAM,UAAS;AAAA,QACvD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,WAAU,OAAM,UAAS;AAAA,QACpD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,QAAO,OAAM,QAAO;AAAA,QAC/C;AACI,iBAAO;AAAA,MAAA;AAAA,IAEnB,IACJ;AAAA;AAER;"}
1
+ {"version":3,"file":"util.js","sources":["../../../src/components/Banner/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { State } from '../../types';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\n\nexport const getBannerIcon = (type: State): React.JSX.Element | null => {\n return (\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n <div className=\"mt-[5px] self-start\">\n {(() => {\n switch (type) {\n case 'success':\n return <BadgeIcon icon=\"tick\" color=\"green\" />;\n case 'error':\n return <BadgeIcon icon=\"close\" color=\"red\" />;\n case 'experiment':\n return <BadgeIcon icon=\"experiment\" color=\"purple\" />;\n case 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n"],"names":["React"],"mappings":";;AAKO,MAAM,gBAAgB,CAAC,SAA0C;AACpE;AAAA;AAAA,IAEIA,+BAAA,cAAC,OAAA,EAAI,WAAU,sBAAA,IACT,MAAM;AACJ,cAAQ,MAAA;AAAA,QACJ,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,QAAO,OAAM,SAAQ;AAAA,QAChD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,SAAQ,OAAM,OAAM;AAAA,QAC/C,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,cAAa,OAAM,UAAS;AAAA,QACvD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,WAAU,OAAM,UAAS;AAAA,QACpD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,QAAO,OAAM,QAAO;AAAA,QAC/C;AACI,iBAAO;AAAA,MAAA;AAAA,IAEnB,IACJ;AAAA;AAER;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.cjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\n\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { MenuProps } from '../Menu/Menu';\nimport { useLocalization } from '../Provider/Localization';\nimport { Truncate } from '../Truncate/Truncate';\n\nimport './style.css';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'px-4 pb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} data-taco=\"card-content\" ref={ref} />;\n});\n\nexport type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** Title of the Card */\n title?: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport type CardTexts = {\n /** Text and aria-label for menu button in Card */\n menu: string;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children, className, ...otherProps } = props;\n const localization = useLocalization();\n const cardClassName = cn('flex flex-col rounded-lg border border-solid border-gray-200 bg-white pt-4', className);\n // if title is not passed menu should be shifted to the end of the container\n const headerContainerAlignment = title ? 'justify-between' : 'justify-end';\n\n return (\n <div {...otherProps} className={cardClassName} data-taco=\"card\" ref={ref}>\n {(title || menu) && (\n <div className={cn('flex px-4 pb-2', headerContainerAlignment)}>\n {title && (\n <Truncate tooltip={title}>\n <h4 className=\"mb-0 flex-grow truncate text-left\">{title}</h4>\n </Truncate>\n )}\n {menu && (\n <LegacyIconButton\n aria-label={localization.texts.card.menu}\n icon=\"ellipsis-horizontal\"\n appearance=\"discrete\"\n menu={menu}\n className=\"-mt-[4px]\"\n />\n )}\n </div>\n )}\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["React","Card","useLocalization","Truncate","LegacyIconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,UAAUA,iBAAM,WAA6C,SAAS,YAAY,eAAe,KAAK;AACxG,QAAM,EAAE,WAAW,GAAG,MAAA,IAAU;AAChC,QAAM,YAAY;AAAA,IACd;AAAA,IACA;AAAA,MACI,aAAa,CAAC;AAAA,IAAA;AAAA,IAElB,MAAM;AAAA,EAAA;AAEV,wDAAQ,OAAA,EAAK,GAAG,OAAO,WAAsB,aAAU,gBAAe,KAAU;AACpF,CAAC;AAcM,MAAM,OAAOA,iBAAM,WAAsC,SAASC,MAAK,OAAO,KAAK;AACtF,QAAM,EAAE,OAAO,MAAM,UAAU,WAAW,GAAG,eAAe;AAC5D,QAAM,eAAeC,aAAAA,gBAAA;AACrB,QAAM,gBAAgB,GAAG,8EAA8E,SAAS;AAEhH,QAAM,2BAA2B,QAAQ,oBAAoB;AAE7D,SACIF,iCAAA,cAAC,OAAA,EAAK,GAAG,YAAY,WAAW,eAAe,aAAU,QAAO,QAC1D,SAAS,SACPA,iCAAA,cAAC,SAAI,WAAW,GAAG,kBAAkB,wBAAwB,EAAA,GACxD,SACGA,iCAAA,cAACG,SAAAA,UAAA,EAAS,SAAS,SACfH,iCAAA,cAAC,MAAA,EAAG,WAAU,oCAAA,GAAqC,KAAM,CAC7D,GAEH,QACGA,iCAAA;AAAA,IAACI,WAAAA;AAAAA,IAAA;AAAA,MACG,cAAY,aAAa,MAAM,KAAK;AAAA,MACpC,MAAK;AAAA,MACL,YAAW;AAAA,MACX;AAAA,MACA,WAAU;AAAA,IAAA;AAAA,EAAA,CAGtB,GAEH,QACL;AAER,CAAC;AAGD,KAAK,UAAU;;"}
1
+ {"version":3,"file":"Card.cjs","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\n\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { MenuProps } from '../Menu/Menu';\nimport { useLocalization } from '../Provider/Localization';\nimport { Truncate } from '../Truncate/Truncate';\n\nimport './style.css';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'px-4 pb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} data-taco=\"card-content\" ref={ref} />;\n});\n\nexport type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** Title of the Card */\n title?: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => React.JSX.Element;\n};\n\nexport type CardTexts = {\n /** Text and aria-label for menu button in Card */\n menu: string;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children, className, ...otherProps } = props;\n const localization = useLocalization();\n const cardClassName = cn('flex flex-col rounded-lg border border-solid border-gray-200 bg-white pt-4', className);\n // if title is not passed menu should be shifted to the end of the container\n const headerContainerAlignment = title ? 'justify-between' : 'justify-end';\n\n return (\n <div {...otherProps} className={cardClassName} data-taco=\"card\" ref={ref}>\n {(title || menu) && (\n <div className={cn('flex px-4 pb-2', headerContainerAlignment)}>\n {title && (\n <Truncate tooltip={title}>\n <h4 className=\"mb-0 flex-grow truncate text-left\">{title}</h4>\n </Truncate>\n )}\n {menu && (\n <LegacyIconButton\n aria-label={localization.texts.card.menu}\n icon=\"ellipsis-horizontal\"\n appearance=\"discrete\"\n menu={menu}\n className=\"-mt-[4px]\"\n />\n )}\n </div>\n )}\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["React","Card","useLocalization","Truncate","LegacyIconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,UAAUA,iBAAM,WAA6C,SAAS,YAAY,eAAe,KAAK;AACxG,QAAM,EAAE,WAAW,GAAG,MAAA,IAAU;AAChC,QAAM,YAAY;AAAA,IACd;AAAA,IACA;AAAA,MACI,aAAa,CAAC;AAAA,IAAA;AAAA,IAElB,MAAM;AAAA,EAAA;AAEV,wDAAQ,OAAA,EAAK,GAAG,OAAO,WAAsB,aAAU,gBAAe,KAAU;AACpF,CAAC;AAcM,MAAM,OAAOA,iBAAM,WAAsC,SAASC,MAAK,OAAO,KAAK;AACtF,QAAM,EAAE,OAAO,MAAM,UAAU,WAAW,GAAG,eAAe;AAC5D,QAAM,eAAeC,aAAAA,gBAAA;AACrB,QAAM,gBAAgB,GAAG,8EAA8E,SAAS;AAEhH,QAAM,2BAA2B,QAAQ,oBAAoB;AAE7D,SACIF,iCAAA,cAAC,OAAA,EAAK,GAAG,YAAY,WAAW,eAAe,aAAU,QAAO,QAC1D,SAAS,SACPA,iCAAA,cAAC,SAAI,WAAW,GAAG,kBAAkB,wBAAwB,EAAA,GACxD,SACGA,iCAAA,cAACG,SAAAA,UAAA,EAAS,SAAS,SACfH,iCAAA,cAAC,MAAA,EAAG,WAAU,oCAAA,GAAqC,KAAM,CAC7D,GAEH,QACGA,iCAAA;AAAA,IAACI,WAAAA;AAAAA,IAAA;AAAA,MACG,cAAY,aAAa,MAAM,KAAK;AAAA,MACpC,MAAK;AAAA,MACL,YAAW;AAAA,MACX;AAAA,MACA,WAAU;AAAA,IAAA;AAAA,EAAA,CAGtB,GAEH,QACL;AAER,CAAC;AAGD,KAAK,UAAU;;"}
@@ -7,7 +7,7 @@ export type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {
7
7
  /** Title of the Card */
8
8
  title?: string | React.ReactElement;
9
9
  /** Menu component associated with the Card */
10
- menu?: (props: Partial<MenuProps>) => JSX.Element;
10
+ menu?: (props: Partial<MenuProps>) => React.JSX.Element;
11
11
  };
12
12
  export type CardTexts = {
13
13
  /** Text and aria-label for menu button in Card */
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\n\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { MenuProps } from '../Menu/Menu';\nimport { useLocalization } from '../Provider/Localization';\nimport { Truncate } from '../Truncate/Truncate';\n\nimport './style.css';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'px-4 pb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} data-taco=\"card-content\" ref={ref} />;\n});\n\nexport type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** Title of the Card */\n title?: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport type CardTexts = {\n /** Text and aria-label for menu button in Card */\n menu: string;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children, className, ...otherProps } = props;\n const localization = useLocalization();\n const cardClassName = cn('flex flex-col rounded-lg border border-solid border-gray-200 bg-white pt-4', className);\n // if title is not passed menu should be shifted to the end of the container\n const headerContainerAlignment = title ? 'justify-between' : 'justify-end';\n\n return (\n <div {...otherProps} className={cardClassName} data-taco=\"card\" ref={ref}>\n {(title || menu) && (\n <div className={cn('flex px-4 pb-2', headerContainerAlignment)}>\n {title && (\n <Truncate tooltip={title}>\n <h4 className=\"mb-0 flex-grow truncate text-left\">{title}</h4>\n </Truncate>\n )}\n {menu && (\n <LegacyIconButton\n aria-label={localization.texts.card.menu}\n icon=\"ellipsis-horizontal\"\n appearance=\"discrete\"\n menu={menu}\n className=\"-mt-[4px]\"\n />\n )}\n </div>\n )}\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Card"],"mappings":";;;;;;AAcA,MAAM,UAAU,MAAM,WAA6C,SAAS,YAAY,eAAe,KAAK;AACxG,QAAM,EAAE,WAAW,GAAG,MAAA,IAAU;AAChC,QAAM,YAAY;AAAA,IACd;AAAA,IACA;AAAA,MACI,aAAa,CAAC;AAAA,IAAA;AAAA,IAElB,MAAM;AAAA,EAAA;AAEV,6CAAQ,OAAA,EAAK,GAAG,OAAO,WAAsB,aAAU,gBAAe,KAAU;AACpF,CAAC;AAcM,MAAM,OAAO,MAAM,WAAsC,SAASA,MAAK,OAAO,KAAK;AACtF,QAAM,EAAE,OAAO,MAAM,UAAU,WAAW,GAAG,eAAe;AAC5D,QAAM,eAAe,gBAAA;AACrB,QAAM,gBAAgB,GAAG,8EAA8E,SAAS;AAEhH,QAAM,2BAA2B,QAAQ,oBAAoB;AAE7D,SACI,sBAAA,cAAC,OAAA,EAAK,GAAG,YAAY,WAAW,eAAe,aAAU,QAAO,QAC1D,SAAS,SACP,sBAAA,cAAC,SAAI,WAAW,GAAG,kBAAkB,wBAAwB,EAAA,GACxD,SACG,sBAAA,cAAC,UAAA,EAAS,SAAS,SACf,sBAAA,cAAC,MAAA,EAAG,WAAU,oCAAA,GAAqC,KAAM,CAC7D,GAEH,QACG,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,cAAY,aAAa,MAAM,KAAK;AAAA,MACpC,MAAK;AAAA,MACL,YAAW;AAAA,MACX;AAAA,MACA,WAAU;AAAA,IAAA;AAAA,EAAA,CAGtB,GAEH,QACL;AAER,CAAC;AAGD,KAAK,UAAU;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import cn from 'clsx';\nimport * as React from 'react';\n\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { MenuProps } from '../Menu/Menu';\nimport { useLocalization } from '../Provider/Localization';\nimport { Truncate } from '../Truncate/Truncate';\n\nimport './style.css';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'px-4 pb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} data-taco=\"card-content\" ref={ref} />;\n});\n\nexport type CardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** Title of the Card */\n title?: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => React.JSX.Element;\n};\n\nexport type CardTexts = {\n /** Text and aria-label for menu button in Card */\n menu: string;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children, className, ...otherProps } = props;\n const localization = useLocalization();\n const cardClassName = cn('flex flex-col rounded-lg border border-solid border-gray-200 bg-white pt-4', className);\n // if title is not passed menu should be shifted to the end of the container\n const headerContainerAlignment = title ? 'justify-between' : 'justify-end';\n\n return (\n <div {...otherProps} className={cardClassName} data-taco=\"card\" ref={ref}>\n {(title || menu) && (\n <div className={cn('flex px-4 pb-2', headerContainerAlignment)}>\n {title && (\n <Truncate tooltip={title}>\n <h4 className=\"mb-0 flex-grow truncate text-left\">{title}</h4>\n </Truncate>\n )}\n {menu && (\n <LegacyIconButton\n aria-label={localization.texts.card.menu}\n icon=\"ellipsis-horizontal\"\n appearance=\"discrete\"\n menu={menu}\n className=\"-mt-[4px]\"\n />\n )}\n </div>\n )}\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Card"],"mappings":";;;;;;AAcA,MAAM,UAAU,MAAM,WAA6C,SAAS,YAAY,eAAe,KAAK;AACxG,QAAM,EAAE,WAAW,GAAG,MAAA,IAAU;AAChC,QAAM,YAAY;AAAA,IACd;AAAA,IACA;AAAA,MACI,aAAa,CAAC;AAAA,IAAA;AAAA,IAElB,MAAM;AAAA,EAAA;AAEV,6CAAQ,OAAA,EAAK,GAAG,OAAO,WAAsB,aAAU,gBAAe,KAAU;AACpF,CAAC;AAcM,MAAM,OAAO,MAAM,WAAsC,SAASA,MAAK,OAAO,KAAK;AACtF,QAAM,EAAE,OAAO,MAAM,UAAU,WAAW,GAAG,eAAe;AAC5D,QAAM,eAAe,gBAAA;AACrB,QAAM,gBAAgB,GAAG,8EAA8E,SAAS;AAEhH,QAAM,2BAA2B,QAAQ,oBAAoB;AAE7D,SACI,sBAAA,cAAC,OAAA,EAAK,GAAG,YAAY,WAAW,eAAe,aAAU,QAAO,QAC1D,SAAS,SACP,sBAAA,cAAC,SAAI,WAAW,GAAG,kBAAkB,wBAAwB,EAAA,GACxD,SACG,sBAAA,cAAC,UAAA,EAAS,SAAS,SACf,sBAAA,cAAC,MAAA,EAAG,WAAU,oCAAA,GAAqC,KAAM,CAC7D,GAEH,QACG,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,cAAY,aAAa,MAAM,KAAK;AAAA,MACpC,MAAK;AAAA,MACL,YAAW;AAAA,MACX;AAAA,MACA,WAAU;AAAA,IAAA;AAAA,EAAA,CAGtB,GAEH,QACL;AAER,CAAC;AAGD,KAAK,UAAU;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.cjs","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport type { DialogProps } from '../Dialog/Dialog';\nimport type { InputProps } from '../Input/Input';\nimport { Input } from '../Input/Input';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { ScrollableList } from '../Listbox/ScrollableList';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { useCombobox } from './useCombobox';\n\nimport './Combobox.css';\n\nexport type ComboboxTexts = {\n /** Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n /** Custom renderer for displaying the selected value in the input field. If not provided, defaults to displaying the option's value. */\n valueRenderer?: (option: ComboboxItem | undefined) => string;\n};\n\ntype InlineComboboxProps = {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n} & ComboboxBaseProps;\n\ntype DialogComboboxProps = {\n dialog: (props: Partial<DialogProps>) => JSX.Element;\n inline?: never;\n} & ComboboxBaseProps;\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, forwardedRef: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, forwardedRef);\n\n const internalRef = React.useRef(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'relative inline-flex w-full',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <div {...combobox} className={className} data-taco=\"combobox\" style={style} ref={internalRef}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.readOnly ? undefined : props.inline ? (\n <LegacyIconButton\n // In case of inline combobox, this icon button acts only as visual chevron representation,\n // so should be taken out of screen reader scope.\n aria-hidden\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <LegacyIconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Positioner\n align=\"start\"\n anchor={internalRef}\n collisionAvoidance={{ side: 'flip', fallbackAxisSide: 'none' }}\n side=\"bottom\"\n sideOffset={4}>\n <PopoverPrimitive.Popup initialFocus={false}>\n <ScrollableList\n {...list}\n className={cn('max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)] !border-blue-500')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\n"],"names":["React","Combobox","popover","useCombobox","useLocalization","useBoundingClientRectListener","Input","LegacyIconButton","PopoverPrimitive","ScrollableList"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEO,MAAM,WAAWA,iBAAM,WAAW,SAASC,UAAS,OAAsB,cAA2C;AACxH,QAAM,EAAE,WAAW,mBAAmB,QAAQ,OAAO,GAAG,eAAe;AACvE,QAAM,EAAE,UAAU,QAAQ,OAAA,SAAOC,WAAS,SAASC,YAAAA,YAAY,YAAY,YAAY;AAEvF,QAAM,cAAcH,iBAAM,OAAO,IAAI;AACrC,QAAM,EAAE,MAAA,IAAUI,6BAAA;AAClB,QAAM,mBAAmBC,8BAAAA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L,YAAY;AAAA,IAAA;AAAA,IACZR,iCAAA,cAACQ,QAAAA,QAAiB,OAAjB,EAAuB,cAAc,MAAA,GAClCR,iCAAA;AAAA,MAACS,eAAAA;AAAAA,MAAA;AAAA,QACI,GAAG;AAAA,QACJ,WAAW,GAAG,2EAA2E;AAAA,QACzF,OAAO,EAAE,UAAU,kBAAkB,MAAA;AAAA,QACrC,UAAUP,UAAQ,OAAO,IAAI;AAAA,MAAA;AAAA,IAAA,CAErC;AAAA,EAAA,CAER,CACJ,CACJ;AAER,CAAC;;"}
1
+ {"version":3,"file":"Combobox.cjs","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport type { DialogProps } from '../Dialog/Dialog';\nimport type { InputProps } from '../Input/Input';\nimport { Input } from '../Input/Input';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { ScrollableList } from '../Listbox/ScrollableList';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { useCombobox } from './useCombobox';\n\nimport './Combobox.css';\n\nexport type ComboboxTexts = {\n /** Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n /** Custom renderer for displaying the selected value in the input field. If not provided, defaults to displaying the option's value. */\n valueRenderer?: (option: ComboboxItem | undefined) => string;\n};\n\ntype InlineComboboxProps = {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n} & ComboboxBaseProps;\n\ntype DialogComboboxProps = {\n dialog: (props: Partial<DialogProps>) => React.JSX.Element;\n inline?: never;\n} & ComboboxBaseProps;\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, forwardedRef: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, forwardedRef);\n\n const internalRef = React.useRef(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'relative inline-flex w-full',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <div {...combobox} className={className} data-taco=\"combobox\" style={style} ref={internalRef}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.readOnly ? undefined : props.inline ? (\n <LegacyIconButton\n // In case of inline combobox, this icon button acts only as visual chevron representation,\n // so should be taken out of screen reader scope.\n aria-hidden\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <LegacyIconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Positioner\n align=\"start\"\n anchor={internalRef}\n collisionAvoidance={{ side: 'flip', fallbackAxisSide: 'none' }}\n side=\"bottom\"\n sideOffset={4}>\n <PopoverPrimitive.Popup initialFocus={false}>\n <ScrollableList\n {...list}\n className={cn('max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)] !border-blue-500')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\n"],"names":["React","Combobox","popover","useCombobox","useLocalization","useBoundingClientRectListener","Input","LegacyIconButton","PopoverPrimitive","ScrollableList"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEO,MAAM,WAAWA,iBAAM,WAAW,SAASC,UAAS,OAAsB,cAA2C;AACxH,QAAM,EAAE,WAAW,mBAAmB,QAAQ,OAAO,GAAG,eAAe;AACvE,QAAM,EAAE,UAAU,QAAQ,OAAA,SAAOC,WAAS,SAASC,YAAAA,YAAY,YAAY,YAAY;AAEvF,QAAM,cAAcH,iBAAM,OAAO,IAAI;AACrC,QAAM,EAAE,MAAA,IAAUI,6BAAA;AAClB,QAAM,mBAAmBC,8BAAAA,8BAA8B,WAAW;AAClE,QAAM,YAAY;AAAA,IACd;AAAA,IACA;AAAA,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OAAjB,EAAuB,cAAc,MAAA,GAClCR,iCAAA;AAAA,MAACS,eAAAA;AAAAA,MAAA;AAAA,QACI,GAAG;AAAA,QACJ,WAAW,GAAG,2EAA2E;AAAA,QACzF,OAAO,EAAE,UAAU,kBAAkB,MAAA;AAAA,QACrC,UAAUP,UAAQ,OAAO,IAAI;AAAA,MAAA;AAAA,IAAA,CAErC;AAAA,EAAA,CAER,CACJ,CACJ;AAER,CAAC;;"}
@@ -45,7 +45,7 @@ type InlineComboboxProps = {
45
45
  inline: boolean;
46
46
  } & ComboboxBaseProps;
47
47
  type DialogComboboxProps = {
48
- dialog: (props: Partial<DialogProps>) => JSX.Element;
48
+ dialog: (props: Partial<DialogProps>) => React.JSX.Element;
49
49
  inline?: never;
50
50
  } & ComboboxBaseProps;
51
51
  export type ComboboxProps = InlineComboboxProps | DialogComboboxProps;
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport type { DialogProps } from '../Dialog/Dialog';\nimport type { InputProps } from '../Input/Input';\nimport { Input } from '../Input/Input';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { ScrollableList } from '../Listbox/ScrollableList';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { useCombobox } from './useCombobox';\n\nimport './Combobox.css';\n\nexport type ComboboxTexts = {\n /** Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n /** Custom renderer for displaying the selected value in the input field. If not provided, defaults to displaying the option's value. */\n valueRenderer?: (option: ComboboxItem | undefined) => string;\n};\n\ntype InlineComboboxProps = {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n} & ComboboxBaseProps;\n\ntype DialogComboboxProps = {\n dialog: (props: Partial<DialogProps>) => JSX.Element;\n inline?: never;\n} & ComboboxBaseProps;\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, forwardedRef: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, forwardedRef);\n\n const internalRef = React.useRef(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'relative inline-flex w-full',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <div {...combobox} className={className} data-taco=\"combobox\" style={style} ref={internalRef}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.readOnly ? undefined : props.inline ? (\n <LegacyIconButton\n // In case of inline combobox, this icon button acts only as visual chevron representation,\n // so should be taken out of screen reader scope.\n aria-hidden\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <LegacyIconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Positioner\n align=\"start\"\n anchor={internalRef}\n collisionAvoidance={{ side: 'flip', fallbackAxisSide: 'none' }}\n side=\"bottom\"\n sideOffset={4}>\n <PopoverPrimitive.Popup initialFocus={false}>\n <ScrollableList\n {...list}\n className={cn('max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)] !border-blue-500')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\n"],"names":["Combobox","PopoverPrimitive"],"mappings":";;;;;;;;;;AAsEO,MAAM,WAAW,MAAM,WAAW,SAASA,UAAS,OAAsB,cAA2C;AACxH,QAAM,EAAE,WAAW,mBAAmB,QAAQ,OAAO,GAAG,eAAe;AACvE,QAAM,EAAE,UAAU,QAAQ,OAAO,SAAS,SAAS,YAAY,YAAY,YAAY;AAEvF,QAAM,cAAc,MAAM,OAAO,IAAI;AACrC,QAAM,EAAE,MAAA,IAAU,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BAAA,cAACA,QAAiB,OAAjB,EAAuB,cAAc,MAAA,GAClC,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACI,GAAG;AAAA,QACJ,WAAW,GAAG,2EAA2E;AAAA,QACzF,OAAO,EAAE,UAAU,kBAAkB,MAAA;AAAA,QACrC,UAAU,QAAQ,OAAO,IAAI;AAAA,MAAA;AAAA,IAAA,CAErC;AAAA,EAAA,CAER,CACJ,CACJ;AAER,CAAC;"}
1
+ {"version":3,"file":"Combobox.js","sources":["../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive } from '@base-ui/react/popover';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport type { DialogProps } from '../Dialog/Dialog';\nimport type { InputProps } from '../Input/Input';\nimport { Input } from '../Input/Input';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport type { ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { ScrollableList } from '../Listbox/ScrollableList';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { useCombobox } from './useCombobox';\n\nimport './Combobox.css';\n\nexport type ComboboxTexts = {\n /** Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n /** Custom renderer for displaying the selected value in the input field. If not provided, defaults to displaying the option's value. */\n valueRenderer?: (option: ComboboxItem | undefined) => string;\n};\n\ntype InlineComboboxProps = {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n} & ComboboxBaseProps;\n\ntype DialogComboboxProps = {\n dialog: (props: Partial<DialogProps>) => React.JSX.Element;\n inline?: never;\n} & ComboboxBaseProps;\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, forwardedRef: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, forwardedRef);\n\n const internalRef = React.useRef(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'relative inline-flex w-full',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <div {...combobox} className={className} data-taco=\"combobox\" style={style} ref={internalRef}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.readOnly ? undefined : props.inline ? (\n <LegacyIconButton\n // In case of inline combobox, this icon button acts only as visual chevron representation,\n // so should be taken out of screen reader scope.\n aria-hidden\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <LegacyIconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Positioner\n align=\"start\"\n anchor={internalRef}\n collisionAvoidance={{ side: 'flip', fallbackAxisSide: 'none' }}\n side=\"bottom\"\n sideOffset={4}>\n <PopoverPrimitive.Popup initialFocus={false}>\n <ScrollableList\n {...list}\n className={cn('max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)] !border-blue-500')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Popup>\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </div>\n );\n});\n"],"names":["Combobox","PopoverPrimitive"],"mappings":";;;;;;;;;;AAsEO,MAAM,WAAW,MAAM,WAAW,SAASA,UAAS,OAAsB,cAA2C;AACxH,QAAM,EAAE,WAAW,mBAAmB,QAAQ,OAAO,GAAG,eAAe;AACvE,QAAM,EAAE,UAAU,QAAQ,OAAO,SAAS,SAAS,YAAY,YAAY,YAAY;AAEvF,QAAM,cAAc,MAAM,OAAO,IAAI;AACrC,QAAM,EAAE,MAAA,IAAU,gBAAA;AAClB,QAAM,mBAAmB,8BAA8B,WAAW;AAClE,QAAM,YAAY;AAAA,IACd;AAAA,IACA;AAAA,MACI,uBAAuB,MAAM;AAAA,IAAA;AAAA,IAEjC;AAAA,EAAA;AAGJ,SACI,sBAAA,cAAC,SAAK,GAAG,UAAU,WAAsB,aAAU,YAAW,OAAc,KAAK,YAAA,GAC7E,sBAAA;AAAA,IAAC;AAA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,CAER,CACJ,CACJ;AAER,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCombobox.cjs","sources":["../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import debounce from 'lodash/debounce';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\n\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { isElementInsideTable3OrReport } from '../../utils/dom';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport type { InputProps } from '../Input/Input';\nimport type { ScrollableListItem, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { getId } from '../Listbox/ScrollableList';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\n\nimport type { ComboboxProps } from './Combobox';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst defaultConvertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (props: Omit<ComboboxProps, 'dialog'>, ref: React.Ref<HTMLInputElement>): useCombobox => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: _nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n valueRenderer,\n ...otherProps\n } = props;\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => nanoid(), []);\n const flattenedData = useFlattenedData(unfilteredData);\n\n const convertToInputValue = React.useCallback(\n (val: ScrollableListItemValue | undefined): string => {\n const option = findByValue(flattenedData, val);\n if (typeof valueRenderer === 'function' && option) {\n return valueRenderer(option);\n }\n return defaultConvertToInputValue(val);\n },\n [valueRenderer, flattenedData]\n );\n\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue === undefined ? undefined : getIndexFromValue(data, inputValue)\n );\n\n const setInputValueByIndex = (index: number | undefined, event?: string): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n const eventType = event ?? 'focusout';\n setInputValueByRef(inputRef.current, option.value, eventType);\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined, event?: string) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n if (option?.value === value) {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n } else {\n // if the selected option is not already selected, trigger blur event\n setInputValueByIndex(index, event);\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined) {\n const renderedValue = convertToInputValue(value);\n // Compare with rendered value to handle valueRenderer case\n // (e.g., value is \"1000\" but renderedValue is \"1000 - Account Name\")\n if (renderedValue !== inputValue) {\n setInputValue(renderedValue);\n }\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === convertToInputValue(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n const findOption = React.useCallback(\n (inputVal: string): ScrollableListItem | undefined => {\n // First try to find by raw value\n const itemByValue = findByValue(flattenedData, inputVal);\n if (itemByValue) {\n return itemByValue;\n }\n\n // If valueRenderer is provided, also try to match against rendered values\n if (valueRenderer) {\n return flattenedData.find(option => valueRenderer(option) === inputVal);\n }\n\n return undefined;\n },\n [flattenedData, valueRenderer]\n );\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n const item = findOption(event.target.value);\n\n // If the found item's value equals the current value, just update the display to rendered format\n // This handles the case where user types the raw value but valueRenderer shows something different\n // (e.g., user types \"1000\" but display should be \"1000 - Account Name\")\n if (item && item.value === value) {\n setInputValue(convertToInputValue(value));\n if (props.onBlur) {\n props.onBlur(event);\n }\n return;\n }\n\n // event.target.value is always a string so it is important to cast value to a string (convertToInputValue) before checking the equality\n if (onChange && event.target.value !== convertToInputValue(value)) {\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n // Explicitly stop propagation for arrow keys when Combobox is in open state and inside Table3\n // This ensures Table3 won't react to these keys when using the Combobox\n if (\n isElementInsideTable3OrReport(event.currentTarget) &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n open\n ) {\n event.stopPropagation();\n }\n\n if (!event.ctrlKey && !event.metaKey) {\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n if (open) {\n // as focus is on input, need to prevent propagation to not close dialog.\n event.stopPropagation();\n }\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab': {\n // default focusout will trigger onBlur and we don't want to trigger it twice\n setCurrentValue(currentIndex, 'change');\n setOpen(false);\n return;\n }\n\n case 'Enter': {\n event.preventDefault();\n\n if (isElementInsideTable3OrReport(event.currentTarget)) {\n if (inline && !open) {\n setOpen(true);\n } else if (buttonRef.current && !open) {\n buttonRef.current.click();\n }\n }\n\n if (open) {\n // we need to focusout to trigger onBlur as we are not actually blurring the input\n setCurrentValue(currentIndex, 'focusout');\n setOpen(false);\n }\n\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {\n buttonRef.current.click();\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (\n inline &&\n !open &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n !isElementInsideTable3OrReport(event.currentTarget)\n ) {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex === undefined ? initialIndex : currentIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...otherProps,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDownCapture: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["useMergedRef","React","nanoid","useFlattenedData","findByValue","filterData","getIndexFromValue","setInputValueByRef","sanitizeItem","getOptionParents","isElementInsideTable3OrReport","createCustomKe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AAM,QAAQ,OAAO,KAAK,YAAY,EAAE,KAAK,CAAC,IAAI;AAAA,IACzG,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,IACA,QAAQ,CAAC,YAAY,CAAC,WAAW,kBAAkB;AAAA,IACnD,UAAU,CAAC,YAAY,CAAC,WAAW,oBAAoB;AAAA,IACvD,SAAS,CAAC,YAAY,CAAC,WAAW,mBAAmB;AAAA,IACrD,kBAAkB,CAAC,YAAY,CAAC,WAAW,qBAAqB;AAAA,IAChE;AAAA,IACA,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO,cAAc;AAAA,EAAA;AAGzB,QAAM,OAAmC;AAAA,IACrC,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,IACA,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,EAAA;AAGX,QAAM,SAAS;AAAA,IACX,KAAK;AAAA,EAAA;AAGT,SAAO;AAAA,IACH;AAAA,IAAA,OACAD;AAAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,MACL;AAAA,MACA,cAAc;AAAA;AAAA,IAAA;AAAA,EAElB;AAER;;"}
1
+ {"version":3,"file":"useCombobox.cjs","sources":["../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import debounce from 'lodash/debounce';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\n\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { isElementInsideTable3OrReport } from '../../utils/dom';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport type { InputProps } from '../Input/Input';\nimport type { ScrollableListItem, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { getId } from '../Listbox/ScrollableList';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\n\nimport type { ComboboxProps } from './Combobox';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst defaultConvertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = Omit<React.HTMLAttributes<HTMLDivElement>, 'popover'> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (props: Omit<ComboboxProps, 'dialog'>, ref: React.Ref<HTMLInputElement>): useCombobox => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: _nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n valueRenderer,\n ...otherProps\n } = props;\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => nanoid(), []);\n const flattenedData = useFlattenedData(unfilteredData);\n\n const convertToInputValue = React.useCallback(\n (val: ScrollableListItemValue | undefined): string => {\n const option = findByValue(flattenedData, val);\n if (typeof valueRenderer === 'function' && option) {\n return valueRenderer(option);\n }\n return defaultConvertToInputValue(val);\n },\n [valueRenderer, flattenedData]\n );\n\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue === undefined ? undefined : getIndexFromValue(data, inputValue)\n );\n\n const setInputValueByIndex = (index: number | undefined, event?: string): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n const eventType = event ?? 'focusout';\n setInputValueByRef(inputRef.current, option.value, eventType);\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined, event?: string) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n if (option?.value === value) {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n } else {\n // if the selected option is not already selected, trigger blur event\n setInputValueByIndex(index, event);\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined) {\n const renderedValue = convertToInputValue(value);\n // Compare with rendered value to handle valueRenderer case\n // (e.g., value is \"1000\" but renderedValue is \"1000 - Account Name\")\n if (renderedValue !== inputValue) {\n setInputValue(renderedValue);\n }\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === convertToInputValue(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n const findOption = React.useCallback(\n (inputVal: string): ScrollableListItem | undefined => {\n // First try to find by raw value\n const itemByValue = findByValue(flattenedData, inputVal);\n if (itemByValue) {\n return itemByValue;\n }\n\n // If valueRenderer is provided, also try to match against rendered values\n if (valueRenderer) {\n return flattenedData.find(option => valueRenderer(option) === inputVal);\n }\n\n return undefined;\n },\n [flattenedData, valueRenderer]\n );\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n const item = findOption(event.target.value);\n\n // If the found item's value equals the current value, just update the display to rendered format\n // This handles the case where user types the raw value but valueRenderer shows something different\n // (e.g., user types \"1000\" but display should be \"1000 - Account Name\")\n if (item && item.value === value) {\n setInputValue(convertToInputValue(value));\n if (props.onBlur) {\n props.onBlur(event);\n }\n return;\n }\n\n // event.target.value is always a string so it is important to cast value to a string (convertToInputValue) before checking the equality\n if (onChange && event.target.value !== convertToInputValue(value)) {\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n // Explicitly stop propagation for arrow keys when Combobox is in open state and inside Table3\n // This ensures Table3 won't react to these keys when using the Combobox\n if (\n isElementInsideTable3OrReport(event.currentTarget) &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n open\n ) {\n event.stopPropagation();\n }\n\n if (!event.ctrlKey && !event.metaKey) {\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n if (open) {\n // as focus is on input, need to prevent propagation to not close dialog.\n event.stopPropagation();\n }\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab': {\n // default focusout will trigger onBlur and we don't want to trigger it twice\n setCurrentValue(currentIndex, 'change');\n setOpen(false);\n return;\n }\n\n case 'Enter': {\n event.preventDefault();\n\n if (isElementInsideTable3OrReport(event.currentTarget)) {\n if (inline && !open) {\n setOpen(true);\n } else if (buttonRef.current && !open) {\n buttonRef.current.click();\n }\n }\n\n if (open) {\n // we need to focusout to trigger onBlur as we are not actually blurring the input\n setCurrentValue(currentIndex, 'focusout');\n setOpen(false);\n }\n\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {\n buttonRef.current.click();\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (\n inline &&\n !open &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n !isElementInsideTable3OrReport(event.currentTarget)\n ) {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex === undefined ? initialIndex : currentIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...otherProps,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDownCapture: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["useMergedRef","React","nanoid","useFlattenedData","findByValue","filterData","getIndexFromValue","setInputValueByRef","sanitizeItem","getOptionParents","isElementInsideTable3OrReport","createCustomKeyboardEvent","input","getId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,YAAY,SAAS,CAAA,MAAK,EAAA,GAAK,GAAG;AAExC,MAAM,6BAA6B,CAAC,UAA+C,OAAO,SAAS,EAAE;AAU9F,MAAM,cAAc,CAAC,OAAsC,QAAkD;AAChH,QAAM;AAAA,IACF,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,MAAM,iBAAiB,CAAA;AAAA,IACvB;AAAA,IACA;AAAA,IACA,IAAI;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACH;AACJ,QAAM,WAAWA,aAAAA,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;AAAA,IACV,SAAS;AAAA,IACT,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,EAAA;AAGX,QAAM,SAAS;AAAA,IACX,KAAK;AAAA,EAAA;AAGT,SAAO;AAAA,IACH;AAAA,IAAA,OACAD;AAAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,MACL;AAAA,MACA,cAAc;AAAA;AAAA,IAAA;AAAA,EAElB;AAER;;"}
@@ -2,7 +2,7 @@ import { InputProps } from '../Input/Input';
2
2
  import { ScrollableListPropsWithRef } from '../Listbox/ScrollableList';
3
3
  import { ComboboxProps } from './Combobox';
4
4
  import * as React from 'react';
5
- type useCombobox = React.HTMLAttributes<HTMLDivElement> & {
5
+ type useCombobox = Omit<React.HTMLAttributes<HTMLDivElement>, 'popover'> & {
6
6
  combobox: React.HTMLAttributes<HTMLSpanElement>;
7
7
  input: Omit<InputProps, 'defaultValue'> & {
8
8
  ref: React.RefObject<HTMLInputElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"useCombobox.js","sources":["../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import debounce from 'lodash/debounce';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\n\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { isElementInsideTable3OrReport } from '../../utils/dom';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport type { InputProps } from '../Input/Input';\nimport type { ScrollableListItem, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { getId } from '../Listbox/ScrollableList';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\n\nimport type { ComboboxProps } from './Combobox';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst defaultConvertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (props: Omit<ComboboxProps, 'dialog'>, ref: React.Ref<HTMLInputElement>): useCombobox => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: _nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n valueRenderer,\n ...otherProps\n } = props;\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => nanoid(), []);\n const flattenedData = useFlattenedData(unfilteredData);\n\n const convertToInputValue = React.useCallback(\n (val: ScrollableListItemValue | undefined): string => {\n const option = findByValue(flattenedData, val);\n if (typeof valueRenderer === 'function' && option) {\n return valueRenderer(option);\n }\n return defaultConvertToInputValue(val);\n },\n [valueRenderer, flattenedData]\n );\n\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue === undefined ? undefined : getIndexFromValue(data, inputValue)\n );\n\n const setInputValueByIndex = (index: number | undefined, event?: string): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n const eventType = event ?? 'focusout';\n setInputValueByRef(inputRef.current, option.value, eventType);\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined, event?: string) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n if (option?.value === value) {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n } else {\n // if the selected option is not already selected, trigger blur event\n setInputValueByIndex(index, event);\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined) {\n const renderedValue = convertToInputValue(value);\n // Compare with rendered value to handle valueRenderer case\n // (e.g., value is \"1000\" but renderedValue is \"1000 - Account Name\")\n if (renderedValue !== inputValue) {\n setInputValue(renderedValue);\n }\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === convertToInputValue(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n const findOption = React.useCallback(\n (inputVal: string): ScrollableListItem | undefined => {\n // First try to find by raw value\n const itemByValue = findByValue(flattenedData, inputVal);\n if (itemByValue) {\n return itemByValue;\n }\n\n // If valueRenderer is provided, also try to match against rendered values\n if (valueRenderer) {\n return flattenedData.find(option => valueRenderer(option) === inputVal);\n }\n\n return undefined;\n },\n [flattenedData, valueRenderer]\n );\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n const item = findOption(event.target.value);\n\n // If the found item's value equals the current value, just update the display to rendered format\n // This handles the case where user types the raw value but valueRenderer shows something different\n // (e.g., user types \"1000\" but display should be \"1000 - Account Name\")\n if (item && item.value === value) {\n setInputValue(convertToInputValue(value));\n if (props.onBlur) {\n props.onBlur(event);\n }\n return;\n }\n\n // event.target.value is always a string so it is important to cast value to a string (convertToInputValue) before checking the equality\n if (onChange && event.target.value !== convertToInputValue(value)) {\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n // Explicitly stop propagation for arrow keys when Combobox is in open state and inside Table3\n // This ensures Table3 won't react to these keys when using the Combobox\n if (\n isElementInsideTable3OrReport(event.currentTarget) &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n open\n ) {\n event.stopPropagation();\n }\n\n if (!event.ctrlKey && !event.metaKey) {\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n if (open) {\n // as focus is on input, need to prevent propagation to not close dialog.\n event.stopPropagation();\n }\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab': {\n // default focusout will trigger onBlur and we don't want to trigger it twice\n setCurrentValue(currentIndex, 'change');\n setOpen(false);\n return;\n }\n\n case 'Enter': {\n event.preventDefault();\n\n if (isElementInsideTable3OrReport(event.currentTarget)) {\n if (inline && !open) {\n setOpen(true);\n } else if (buttonRef.current && !open) {\n buttonRef.current.click();\n }\n }\n\n if (open) {\n // we need to focusout to trigger onBlur as we are not actually blurring the input\n setCurrentValue(currentIndex, 'focusout');\n setOpen(false);\n }\n\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {\n buttonRef.current.click();\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (\n inline &&\n !open &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n !isElementInsideTable3OrReport(event.currentTarget)\n ) {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex === undefined ? initialIndex : currentIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...otherProps,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDownCapture: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,YAAY,SAAS,CAAA,MAAK,EAAA,GAAK,GAAG;AAExC,MAAM,6BAA6B,CAAC,UAA+C,OAAO,SAAS,EAAE;AAU9F,MAAM,cAAc,CAAC,OAAsC,QAAkD;AAChH,QAAM;AAAA,IACF,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,MAAM,iBAAiB,CAAA;AAAA,IACvB;AAAA,IACA;AAAA,IACA,IAAI;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACH;AACJ,QAAM,WAAW,aAA+B,GAAG;AACnD,QAAM,YAAY,MAAM,OAA0B,IAAI;AACtD,QAAM,UAAU,MAAM,OAAyB,IAAI;AACnD,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,QAAM,SAAS,MAAM,QAAQ,MAAM,OAAA,GAAU,CAAA,CAAE;AAC/C,QAAM,gBAAgB,iBAAiB,cAAc;AAErD,QAAM,sBAAsB,MAAM;AAAA,IAC9B,CAAC,QAAqD;AAClD,YAAM,SA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;AAAA,EACjB;AAEA,QAAM,WAAW;AAAA,IACb,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,MAAM;AAAA,EAAA;AAGV,QAAM,QAAQ;AAAA,IACV,GAAG;AAAA,IACH,iBAAiB;AAAA;AAAA;AAAA,IAGjB,qBAAqB;AAAA;AAAA,IAErB,yBACI,iBAAiB,UAAa,KAAK,YAAY,IAAI,MAAM,QAAQ,OAAO,KAAK,YAAY,EAAE,KAAK,CAAC,IAAI;AAAA,IACzG,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB;AAAA,IACA,QAAQ,CAAC,YAAY,CAAC,WAAW,kBAAkB;AAAA,IACnD,UAAU,CAAC,YAAY,CAAC,WAAW,oBAAoB;AAAA,IACvD,SAAS,CAAC,YAAY,CAAC,WAAW,mBAAmB;AAAA,IACrD,kBAAkB,CAAC,YAAY,CAAC,WAAW,qBAAqB;AAAA,IAChE;AAAA,IACA,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO,cAAc;AAAA,EAAA;AAGzB,QAAM,OAAmC;AAAA,IACrC,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,IACA,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,KAAK;AAAA,IACL,eAAe;AAAA,IACf,UAAU;AAAA,IACV,OAAO;AAAA,EAAA;AAGX,QAAM,SAAS;AAAA,IACX,KAAK;AAAA,EAAA;AAGT,SAAO;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,MACL;AAAA,MACA,cAAc;AAAA;AAAA,IAAA;AAAA,EAElB;AAER;"}
1
+ {"version":3,"file":"useCombobox.js","sources":["../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import debounce from 'lodash/debounce';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\n\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { isElementInsideTable3OrReport } from '../../utils/dom';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport type { InputProps } from '../Input/Input';\nimport type { ScrollableListItem, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\nimport { getId } from '../Listbox/ScrollableList';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\n\nimport type { ComboboxProps } from './Combobox';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst defaultConvertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = Omit<React.HTMLAttributes<HTMLDivElement>, 'popover'> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<InputProps, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (props: Omit<ComboboxProps, 'dialog'>, ref: React.Ref<HTMLInputElement>): useCombobox => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: _nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n valueRenderer,\n ...otherProps\n } = props;\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => nanoid(), []);\n const flattenedData = useFlattenedData(unfilteredData);\n\n const convertToInputValue = React.useCallback(\n (val: ScrollableListItemValue | undefined): string => {\n const option = findByValue(flattenedData, val);\n if (typeof valueRenderer === 'function' && option) {\n return valueRenderer(option);\n }\n return defaultConvertToInputValue(val);\n },\n [valueRenderer, flattenedData]\n );\n\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue === undefined ? undefined : getIndexFromValue(data, inputValue)\n );\n\n const setInputValueByIndex = (index: number | undefined, event?: string): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n const eventType = event ?? 'focusout';\n setInputValueByRef(inputRef.current, option.value, eventType);\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined, event?: string) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n if (option?.value === value) {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n } else {\n // if the selected option is not already selected, trigger blur event\n setInputValueByIndex(index, event);\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined) {\n const renderedValue = convertToInputValue(value);\n // Compare with rendered value to handle valueRenderer case\n // (e.g., value is \"1000\" but renderedValue is \"1000 - Account Name\")\n if (renderedValue !== inputValue) {\n setInputValue(renderedValue);\n }\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === convertToInputValue(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n const findOption = React.useCallback(\n (inputVal: string): ScrollableListItem | undefined => {\n // First try to find by raw value\n const itemByValue = findByValue(flattenedData, inputVal);\n if (itemByValue) {\n return itemByValue;\n }\n\n // If valueRenderer is provided, also try to match against rendered values\n if (valueRenderer) {\n return flattenedData.find(option => valueRenderer(option) === inputVal);\n }\n\n return undefined;\n },\n [flattenedData, valueRenderer]\n );\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n if (listRef.current && event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n const item = findOption(event.target.value);\n\n // If the found item's value equals the current value, just update the display to rendered format\n // This handles the case where user types the raw value but valueRenderer shows something different\n // (e.g., user types \"1000\" but display should be \"1000 - Account Name\")\n if (item && item.value === value) {\n setInputValue(convertToInputValue(value));\n if (props.onBlur) {\n props.onBlur(event);\n }\n return;\n }\n\n // event.target.value is always a string so it is important to cast value to a string (convertToInputValue) before checking the equality\n if (onChange && event.target.value !== convertToInputValue(value)) {\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n // Explicitly stop propagation for arrow keys when Combobox is in open state and inside Table3\n // This ensures Table3 won't react to these keys when using the Combobox\n if (\n isElementInsideTable3OrReport(event.currentTarget) &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n open\n ) {\n event.stopPropagation();\n }\n\n if (!event.ctrlKey && !event.metaKey) {\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n if (open) {\n // as focus is on input, need to prevent propagation to not close dialog.\n event.stopPropagation();\n }\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab': {\n // default focusout will trigger onBlur and we don't want to trigger it twice\n setCurrentValue(currentIndex, 'change');\n setOpen(false);\n return;\n }\n\n case 'Enter': {\n event.preventDefault();\n\n if (isElementInsideTable3OrReport(event.currentTarget)) {\n if (inline && !open) {\n setOpen(true);\n } else if (buttonRef.current && !open) {\n buttonRef.current.click();\n }\n }\n\n if (open) {\n // we need to focusout to trigger onBlur as we are not actually blurring the input\n setCurrentValue(currentIndex, 'focusout');\n setOpen(false);\n }\n\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {\n buttonRef.current.click();\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (\n inline &&\n !open &&\n (event.key === 'ArrowUp' || event.key === 'ArrowDown') &&\n !isElementInsideTable3OrReport(event.currentTarget)\n ) {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex === undefined ? initialIndex : currentIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...otherProps,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDownCapture: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":[],"mappings":";;;;;;;;AAsBA,MAAM,YAAY,SAAS,CAAA,MAAK,EAAA,GAAK,GAAG;AAExC,MAAM,6BAA6B,CAAC,UAA+C,OAAO,SAAS,EAAE;AAU9F,MAAM,cAAc,CAAC,OAAsC,QAAkD;AAChH,QAAM;AAAA,IACF,cAAc;AAAA,IACd,mBAAmB;AAAA,IACnB,MAAM,iBAAiB,CAAA;AAAA,IACvB;AAAA,IACA;AAAA,IACA,IAAI;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;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;AAAA,IACV,OAAO;AAAA,EAAA;AAGX,QAAM,SAAS;AAAA,IACX,KAAK;AAAA,EAAA;AAGT,SAAO;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,MACL;AAAA,MACA,cAAc;AAAA;AAAA,IAAA;AAAA,EAElB;AAER;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.cjs","sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport * as React from 'react';\n\nimport type {\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { Content, Title, Footer, Close } from './components/Content';\nimport type { DialogDrawerProps, DialogDrawerRenderProps } from './components/DialogDrawer';\nimport { DialogDrawer } from './components/DialogDrawer';\nimport type { DialogExtraProps } from './components/Extra';\nimport { Extra } from './components/Extra';\nimport type { DialogTriggerProps } from './components/Trigger';\nimport { Trigger } from './components/Trigger';\nimport { DialogContext } from './Context';\nimport type { DialogSize } from './types';\n\nimport './Dialog.css';\n\nexport type {\n DialogCloseProps,\n DialogContentDrawerRenderProps,\n DialogContentProps,\n DialogContentRenderProps,\n DialogDrawerProps,\n DialogDrawerRenderProps,\n DialogFooterProps,\n DialogSize,\n DialogTitleProps,\n};\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** When `true`, pressing escape will close the dialog */\n closeOnEscape?: boolean;\n /** Set whether the dialog is open by default or not */\n defaultOpen?: boolean;\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Called when the dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Shows the close icon button of the dialog */\n showCloseButton?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\n\nconst useSeparatedChildren = (initialChildren: React.ReactNode) => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.toArray(initialChildren).forEach((child: any) => {\n if (child.type?.displayName === DialogDrawer.displayName) {\n drawer = child;\n } else if (child.type?.displayName === Extra.displayName) {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const Dialog = React.forwardRef(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\n const {\n children: initialChildren,\n closeOnEscape = true,\n defaultOpen,\n draggable = false,\n onChange,\n onClose,\n open,\n showCloseButton = true,\n size = 'sm',\n trigger,\n ...otherProps\n } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n const popupRef = React.useRef<HTMLElement | null>(null);\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n popupRef,\n props: otherProps,\n showCloseButton,\n size,\n ref,\n }),\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\n );\n\n const handleOpenChange = (open: boolean, eventDetails: DialogPrimitive.Root.ChangeEventDetails) => {\n if (eventDetails.reason === 'escape-key') {\n const triggeredFromRadixPortal = (eventDetails.event.target as HTMLElement)?.closest(\n 'div[data-radix-popper-content-wrapper]'\n );\n\n if (triggeredFromRadixPortal) {\n // TODO: This could be removed when all radix overlays are replaced with base UI components, but currently it propagates through and closes the dialog.\n\n // cancel closing the dialog\n eventDetails.cancel();\n\n // propagate to allow the radix overlay to close\n eventDetails.allowPropagation();\n return;\n } else if (closeOnEscape === false) {\n eventDetails.cancel();\n return;\n }\n // call onClose, and fall through to also call onChange.\n props.onClose?.();\n }\n\n onChange?.(open);\n };\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root\n defaultOpen={defaultOpen}\n disablePointerDismissal\n modal\n open={open}\n onOpenChange={handleOpenChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = DialogDrawer;\nDialog.Close = Close;\n"],"names":["React","DialogDrawer","Extra","Dialog","open","DialogContext","DialogPrimitive","Trigger","Content","Title","Footer","Close"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,uBAAuB,CAAC,oBAAqC;AAC/D,SAAOA,iBAAM,QAAQ,MAAM;AACvB,UAAM,WAAkB,CAAA;AACxB,QAAI;AACJ,QAAI;AAEJA,qBAAM,SAAS,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AwB;AAAA,QACzE;AAAA,MAAA;AAGJ,UAAI,0BAA0B;AAI1B,qBAAa,OAAA;AAGb,qBAAa,iBAAA;AACb;AAAA,MACJ,WAAW,kBAAkB,OAAO;AAChC,qBAAa,OAAA;AACb;AAAA,MACJ;AAEA,YAAM,UAAA;AAAA,IACV;AAEA,eAAWA,KAAI;AAAA,EACnB;AAEA,SACIJ,iCAAA,cAACK,sBAAc,UAAd,EAAuB,OAAO,WAC3BL,iCAAA;AAAA,IAACM,OAAAA,OAAgB;AAAA,IAAhB;AAAA,MACG;AAAA,MACA,yBAAuB;AAAA,MACvB,OAAK;AAAA,MACL;AAAA,MACA,cAAc;AAAA,IAAA;AAAA,IACb,WAAWN,iCAAA,cAACO,QAAAA,SAAA,MAAS,OAAQ;AAAA,IAC7B;AAAA,EAAA,CAET;AAER,CAAC;AAED,OAAO,UAAUA,QAAAA;AACjB,OAAO,UAAUC,QAAAA;AACjB,OAAO,QAAQC,QAAAA;AACf,OAAO,SAASC,QAAAA;AAChB,OAAO,QAAQR,MAAAA;AACf,OAAO,SAASD,aAAAA;AAChB,OAAO,QAAQU,QAAAA;;"}
1
+ {"version":3,"file":"Dialog.cjs","sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport * as React from 'react';\n\nimport type {\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { Content, Title, Footer, Close } from './components/Content';\nimport type { DialogDrawerProps, DialogDrawerRenderProps } from './components/DialogDrawer';\nimport { DialogDrawer } from './components/DialogDrawer';\nimport type { DialogExtraProps } from './components/Extra';\nimport { Extra } from './components/Extra';\nimport type { DialogTriggerProps } from './components/Trigger';\nimport { Trigger } from './components/Trigger';\nimport { DialogContext } from './Context';\nimport type { DialogSize } from './types';\n\nimport './Dialog.css';\n\nexport type {\n DialogCloseProps,\n DialogContentDrawerRenderProps,\n DialogContentProps,\n DialogContentRenderProps,\n DialogDrawerProps,\n DialogDrawerRenderProps,\n DialogFooterProps,\n DialogSize,\n DialogTitleProps,\n};\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** When `true`, pressing escape will close the dialog */\n closeOnEscape?: boolean;\n /** Set whether the dialog is open by default or not */\n defaultOpen?: boolean;\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Called when the dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Shows the close icon button of the dialog */\n showCloseButton?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\n trigger?: React.JSX.Element;\n};\n\nconst useSeparatedChildren = (initialChildren: React.ReactNode) => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.toArray(initialChildren).forEach((child: any) => {\n if (child.type?.displayName === DialogDrawer.displayName) {\n drawer = child;\n } else if (child.type?.displayName === Extra.displayName) {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const Dialog = React.forwardRef(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\n const {\n children: initialChildren,\n closeOnEscape = true,\n defaultOpen,\n draggable = false,\n onChange,\n onClose,\n open,\n showCloseButton = true,\n size = 'sm',\n trigger,\n ...otherProps\n } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n const popupRef = React.useRef<HTMLElement | null>(null);\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n popupRef,\n props: otherProps,\n showCloseButton,\n size,\n ref,\n }),\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\n );\n\n const handleOpenChange = (open: boolean, eventDetails: DialogPrimitive.Root.ChangeEventDetails) => {\n if (eventDetails.reason === 'escape-key') {\n const triggeredFromRadixPortal = (eventDetails.event.target as HTMLElement)?.closest(\n 'div[data-radix-popper-content-wrapper]'\n );\n\n if (triggeredFromRadixPortal) {\n // TODO: This could be removed when all radix overlays are replaced with base UI components, but currently it propagates through and closes the dialog.\n\n // cancel closing the dialog\n eventDetails.cancel();\n\n // propagate to allow the radix overlay to close\n eventDetails.allowPropagation();\n return;\n } else if (closeOnEscape === false) {\n eventDetails.cancel();\n return;\n }\n // call onClose, and fall through to also call onChange.\n props.onClose?.();\n }\n\n onChange?.(open);\n };\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root\n defaultOpen={defaultOpen}\n disablePointerDismissal\n modal\n open={open}\n onOpenChange={handleOpenChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = DialogDrawer;\nDialog.Close = Close;\n"],"names":["React","DialogDrawer","Extra","Dialog","open","DialogContext","DialogPrimitive","Trigger","Content","Title","Footer","Close"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,MAAM,uBAAuB,CAAC,oBAAqC;AAC/D,SAAOA,iBAAM,QAAQ,MAAM;AACvB,UAAM,WAAkB,CAAA;AACxB,QAAI;AACJ,QAAI;AAEJA,qBAAM,SAAS,QAAQ,eAAe,EAAE,QAAQ,CAAC,UAAe;AAC5D,UAAI,MAAM,MAAM,gBAAgBC,aAAAA,aAAa,aAAa;AACtD,iBAAS;AAAA,MACb,WAAW,MAAM,MAAM,gBAAgBC,MAAAA,MAAM,aAAa;AACtD,gBAAQ;AAAA,MACZ,OAAO;AACH,iBAAS,KAAK,KAAK;AAAA,MACvB;AAAA,IACJ,CAAC;AAED,WAAO,CAAC,UAAU,QAAQ,KAAK;AAAA,EACnC,GAAG,CAAC,eAAe,CAAC;AACxB;AAYO,MAAM,SAASF,iBAAM,WAAW,SAASG,QAAO,OAAoB,KAA6B;AACpG,QAAM;AAAA,IACF,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EAAA,IACH;AACJ,QAAM,CAAC,UAAU,QAAQ,KAAK,IAAI,qBAAqB,eAAe;AACtE,QAAM,CAAC,YAAY,aAAa,IAAIH,iBAAM,SAAS,KAAK;AACxD,QAAM,WAAWA,iBAAM,OAA2B,IAAI;AAEtD,QAAM,UAAUA,i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is the recommended way to set a size for dialog component. */
33
33
  size?: DialogSize;
34
34
  /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */
35
- trigger?: JSX.Element;
35
+ trigger?: React.JSX.Element;
36
36
  };
37
37
  export type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {
38
38
  Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport * as React from 'react';\n\nimport type {\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { Content, Title, Footer, Close } from './components/Content';\nimport type { DialogDrawerProps, DialogDrawerRenderProps } from './components/DialogDrawer';\nimport { DialogDrawer } from './components/DialogDrawer';\nimport type { DialogExtraProps } from './components/Extra';\nimport { Extra } from './components/Extra';\nimport type { DialogTriggerProps } from './components/Trigger';\nimport { Trigger } from './components/Trigger';\nimport { DialogContext } from './Context';\nimport type { DialogSize } from './types';\n\nimport './Dialog.css';\n\nexport type {\n DialogCloseProps,\n DialogContentDrawerRenderProps,\n DialogContentProps,\n DialogContentRenderProps,\n DialogDrawerProps,\n DialogDrawerRenderProps,\n DialogFooterProps,\n DialogSize,\n DialogTitleProps,\n};\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** When `true`, pressing escape will close the dialog */\n closeOnEscape?: boolean;\n /** Set whether the dialog is open by default or not */\n defaultOpen?: boolean;\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Called when the dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Shows the close icon button of the dialog */\n showCloseButton?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\n\nconst useSeparatedChildren = (initialChildren: React.ReactNode) => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.toArray(initialChildren).forEach((child: any) => {\n if (child.type?.displayName === DialogDrawer.displayName) {\n drawer = child;\n } else if (child.type?.displayName === Extra.displayName) {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const Dialog = React.forwardRef(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\n const {\n children: initialChildren,\n closeOnEscape = true,\n defaultOpen,\n draggable = false,\n onChange,\n onClose,\n open,\n showCloseButton = true,\n size = 'sm',\n trigger,\n ...otherProps\n } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n const popupRef = React.useRef<HTMLElement | null>(null);\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n popupRef,\n props: otherProps,\n showCloseButton,\n size,\n ref,\n }),\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\n );\n\n const handleOpenChange = (open: boolean, eventDetails: DialogPrimitive.Root.ChangeEventDetails) => {\n if (eventDetails.reason === 'escape-key') {\n const triggeredFromRadixPortal = (eventDetails.event.target as HTMLElement)?.closest(\n 'div[data-radix-popper-content-wrapper]'\n );\n\n if (triggeredFromRadixPortal) {\n // TODO: This could be removed when all radix overlays are replaced with base UI components, but currently it propagates through and closes the dialog.\n\n // cancel closing the dialog\n eventDetails.cancel();\n\n // propagate to allow the radix overlay to close\n eventDetails.allowPropagation();\n return;\n } else if (closeOnEscape === false) {\n eventDetails.cancel();\n return;\n }\n // call onClose, and fall through to also call onChange.\n props.onClose?.();\n }\n\n onChange?.(open);\n };\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root\n defaultOpen={defaultOpen}\n disablePointerDismissal\n modal\n open={open}\n onOpenChange={handleOpenChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = DialogDrawer;\nDialog.Close = Close;\n"],"names":["Dialog","open","DialogPrimitive"],"mappings":";;;;;;;;AAkEA,MAAM,uBAAuB,CAAC,oBAAqC;AAC/D,SAAO,MAAM,QAAQ,MAAM;AACvB,UAAM,WAAkB,CAAA;AACxB,QAAI;AACJ,QAAI;AAEJ,UAAM,SAAS,QAAQ,eAAe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AAI,0BAA0B;AAI1B,qBAAa,OAAA;AAGb,qBAAa,iBAAA;AACb;AAAA,MACJ,WAAW,kBAAkB,OAAO;AAChC,qBAAa,OAAA;AACb;AAAA,MACJ;AAEA,YAAM,UAAA;AAAA,IACV;AAEA,eAAWA,KAAI;AAAA,EACnB;AAEA,SACI,sBAAA,cAAC,cAAc,UAAd,EAAuB,OAAO,WAC3B,sBAAA;AAAA,IAACC,SAAgB;AAAA,IAAhB;AAAA,MACG;AAAA,MACA,yBAAuB;AAAA,MACvB,OAAK;AAAA,MACL;AAAA,MACA,cAAc;AAAA,IAAA;AAAA,IACb,WAAW,sBAAA,cAAC,SAAA,MAAS,OAAQ;AAAA,IAC7B;AAAA,EAAA,CAET;AAER,CAAC;AAED,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,SAAS;AAChB,OAAO,QAAQ;AACf,OAAO,SAAS;AAChB,OAAO,QAAQ;"}
1
+ {"version":3,"file":"Dialog.js","sources":["../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport * as React from 'react';\n\nimport type {\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { Content, Title, Footer, Close } from './components/Content';\nimport type { DialogDrawerProps, DialogDrawerRenderProps } from './components/DialogDrawer';\nimport { DialogDrawer } from './components/DialogDrawer';\nimport type { DialogExtraProps } from './components/Extra';\nimport { Extra } from './components/Extra';\nimport type { DialogTriggerProps } from './components/Trigger';\nimport { Trigger } from './components/Trigger';\nimport { DialogContext } from './Context';\nimport type { DialogSize } from './types';\n\nimport './Dialog.css';\n\nexport type {\n DialogCloseProps,\n DialogContentDrawerRenderProps,\n DialogContentProps,\n DialogContentRenderProps,\n DialogDrawerProps,\n DialogDrawerRenderProps,\n DialogFooterProps,\n DialogSize,\n DialogTitleProps,\n};\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** When `true`, pressing escape will close the dialog */\n closeOnEscape?: boolean;\n /** Set whether the dialog is open by default or not */\n defaultOpen?: boolean;\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Called when the dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Shows the close icon button of the dialog */\n showCloseButton?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\n trigger?: React.JSX.Element;\n};\n\nconst useSeparatedChildren = (initialChildren: React.ReactNode) => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.toArray(initialChildren).forEach((child: any) => {\n if (child.type?.displayName === DialogDrawer.displayName) {\n drawer = child;\n } else if (child.type?.displayName === Extra.displayName) {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const Dialog = React.forwardRef(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\n const {\n children: initialChildren,\n closeOnEscape = true,\n defaultOpen,\n draggable = false,\n onChange,\n onClose,\n open,\n showCloseButton = true,\n size = 'sm',\n trigger,\n ...otherProps\n } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n const popupRef = React.useRef<HTMLElement | null>(null);\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n popupRef,\n props: otherProps,\n showCloseButton,\n size,\n ref,\n }),\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\n );\n\n const handleOpenChange = (open: boolean, eventDetails: DialogPrimitive.Root.ChangeEventDetails) => {\n if (eventDetails.reason === 'escape-key') {\n const triggeredFromRadixPortal = (eventDetails.event.target as HTMLElement)?.closest(\n 'div[data-radix-popper-content-wrapper]'\n );\n\n if (triggeredFromRadixPortal) {\n // TODO: This could be removed when all radix overlays are replaced with base UI components, but currently it propagates through and closes the dialog.\n\n // cancel closing the dialog\n eventDetails.cancel();\n\n // propagate to allow the radix overlay to close\n eventDetails.allowPropagation();\n return;\n } else if (closeOnEscape === false) {\n eventDetails.cancel();\n return;\n }\n // call onClose, and fall through to also call onChange.\n props.onClose?.();\n }\n\n onChange?.(open);\n };\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root\n defaultOpen={defaultOpen}\n disablePointerDismissal\n modal\n open={open}\n onOpenChange={handleOpenChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = DialogDrawer;\nDialog.Close = Close;\n"],"names":["Dialog","open","DialogPrimitive"],"mappings":";;;;;;;;AAkEA,MAAM,uBAAuB,CAAC,oBAAqC;AAC/D,SAAO,MAAM,QAAQ,MAAM;AACvB,UAAM,WAAkB,CAAA;AACxB,QAAI;AACJ,QAAI;AAEJ,UAAM,SAAS,QAAQ,eAAe,EAAE,QAAQ,CAAC,UAAe;AAC5D,UAAI,MAAM,MAAM,gBAAgB,aAAa,aAAa;AACtD,iBAAS;AAAA,MACb,WAAW,MAAM,MAAM,gBAAgB,MAAM,aAAa;AACtD,gBAAQ;AAAA,MACZ,OAAO;AACH,iBAAS,KAAK,KAAK;AAAA,MACvB;AAAA,IACJ,CAAC;AAED,WAAO,CAAC,UAAU,QAAQ,KAAK;AAAA,EACnC,GAAG,CAAC,eAAe,CAAC;AACxB;AAYO,MAAM,SAAS,MAAM,WAAW,SAASA,QAAO,OAAoB,KAA6B;AACpG,QAAM;AAAA,IACF,UAAU;AAAA,IACV,gBAAgB;AAAA,IAChB;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB,OAAO;AAAA,IACP;AAAA,IACA,GAAG;AAAA,EAAA,IACH;AACJ,QAAM,CAAC,UAAU,QAAQ,KAAK,IAAI,qBAAqB,eAAe;AACtE,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,KAAK;AACxD,QAAM,WAAW,MAAM,OAA2B,IAAI;AAEtD,QAAM,UAAU,MAAM;AAAA,IAClB,OAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,QACJ,MAAM;AAAA,QACN,QAAQ,MAAM,cAAc,CAAA,iBAAgB,CAAC,YAAY;AAAA,MAAA;AAAA,MAE7D,UAAU;AAAA,QACN;AAAA,QACA;AAAA,MAAA;AAAA,MAEJ;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEJ,CAAC,eAAe,YAAY,WAAW,QAAQ,OAAO,MAAM,YAAY,eAAe;AAAA,EAAA;AAG3F,QAAM,mBAAmB,CAACC,OAAe,iBAA0D;AAC/F,QAAI,aAAa,WAAW,cAAc;AACtC,YAAM,2BAA4B,aAAa,MAAM,QAAwB;AAAA,QACzE;AAAA,MAAA;AAGJ,UAAI,0BAA0B;AAI1B,qBAAa,OAAA;AAGb,qBAAa,iBAAA;AACb;AAAA,MACJ,WAAW,kBAAkB,OAAO;AAChC,qBAAa,OAAA;AACb;AAAA,MACJ;AAEA,YAAM,UAAA;AAAA,IACV;AAEA,eAAWA,KAAI;AAAA,EACnB;AAEA,SACI,sBAAA,cAAC,cAAc,UAAd,EAAuB,OAAO,WAC3B,sBAAA;AAAA,IAACC,SAAgB;AAAA,IAAhB;AAAA,MACG;AAAA,MACA,yBAAuB;AAAA,MACvB,OAAK;AAAA,MACL;AAAA,MACA,cAAc;AAAA,IAAA;AAAA,IACb,WAAW,sBAAA,cAAC,SAAA,MAAS,OAAQ;AAAA,IAC7B;AAAA,EAAA,CAET;AAER,CAAC;AAED,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,QAAQ;AACf,OAAO,SAAS;AAChB,OAAO,QAAQ;AACf,OAAO,SAAS;AAChB,OAAO,QAAQ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Content.cjs","sources":["../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { mergeRefs } from '../../../utils/mergeRefs';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { LegacyIconButton } from '../../LegacyComponents/IconButton/IconButton';\nimport { useLocalization } from '../../Provider/Localization';\nimport type { DialogContext } from '../Context';\nimport { useCurrentDialog } from '../Context';\nimport { DIALOG_POSITION_CLASSNAMES, DIALOG_SIZE_CLASSNAME } 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 children: JSX.Element;\n};\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n const { children, ...restProps } = props;\n\n return <DialogPrimitive.Close {...restProps} onClick={dialog.onClose} ref={ref} render={children} />;\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: React.ReactNode | ((props: DialogContentRenderProps) => React.ReactNode);\n initialFocus?: DialogPrimitive.Popup.Props['initialFocus'];\n finalFocus?: DialogPrimitive.Popup.Props['finalFocus'];\n};\nexport const Content = React.forwardRef(function DialogContent(\n props: DialogContentProps,\n forwardedRef: React.Ref<HTMLDivElement>\n) {\n const dialog = useCurrentDialog();\n // Popup ref lives on the Dialog root so descendants can read it via `useDialogScope`;\n // we attach it to the popup node here and merge in any forwarded ref.\n const popupRef = dialog.popupRef as React.MutableRefObject<HTMLDivElement | null>;\n const setPopupRef = React.useMemo(() => mergeRefs<HTMLDivElement>([popupRef, forwardedRef]), [popupRef, forwardedRef]);\n const { position, dragging, handleProps: dragHandleProps } = useDraggable(popupRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative animate-[fade-in_150ms] rounded bg-white print:!static',\n DIALOG_POSITION_CLASSNAMES,\n DIALOG_SIZE_CLASSNAME[dialog.size],\n 'print:m-0 print:h-max print:w-full print:overflow-visible'\n );\n\n const containerClassName = cn(\n 'relative z-10 rounded bg-white p-6 shadow print:p-0',\n // The `!fixed` property is crucial to ensure that when a draggable dialog is moved, the printed document still displays its content across the full page.\n 'print:!inset-0 print:!m-0 print:h-max print:!transform-none print:overflow-visible',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\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 return (\n <DialogPrimitive.Portal>\n <Backdrop>\n <DialogPrimitive.Popup\n {...props}\n className={className}\n ref={setPopupRef}\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 top-1.5 h-3 w-24 cursor-move rounded bg-gray-100 text-center absolute-center-x print:hidden\"\n />\n )}\n {dialog.showCloseButton ? (\n <DialogPrimitive.Close\n onClick={dialog.onClose}\n render={\n <LegacyIconButton\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.Popup>\n </Backdrop>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["React","DialogPrimitive","dialog","useCurrentDialog","RenderPropWrapper","mergeRefs","useDraggable","useLocalization","DIALOG_POSITION_CLASSNAMES","DIALOG_SIZE_CLASSNAME","Backdrop","LegacyIconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,QAAQA,iBAAM,WAAW,SAAS,YAAY,OAAyB,KAAoC;AACpH,QAAM,YAAY,GAAG,eAAe,MAAM,SAAS;AACnD,wDAAQC,cAAgB,OAAhB,EAAuB,GAAG,OAAO,WAAsB,KAAU;AAC7E,CAAC;AAGM,MAAM,SAASD,iBAAM,WAAW,SAAS,aAAa,OAA0B,KAAgC;AACnH,QAAM,YAAY,GAAG,yBAAyB,MAAM,SAAS;AAC7D,wDACK,OAAA,EAAK,GAAG,OAAO,WAAsB,IAAA,GACjC,MAAM,QACX;AAER,CAAC;AAMM,MAAM,QAAQA,iBAAM,WAAW,SAAS,YAAY,OAAyB,KAAmC;AACnH,QAAME,WAASC,QAAAA,iBAAA;AACf,QAAM,EAAE,UAAU,GAAG,UAAA,IAAc;AAEnC,SAAOH,iCAAA,cAACC,cAAgB,OAAhB,EAAuB,GAAG,WAAW,SAASC,SAAO,SAAS,KAAU,QAAQ,SAAA,CAAU;AACtG,CAAC;AAED,MAAM,oBAAoBF,iBAAM,WAAW,SAASI,mBAAkB,EAAE,UAAU,SAAS,YAAA,GAAoB,KAAK;AAChH,QAAM,QAAQ,MAAM;AAChB,YAAQ,IAAI,YAAY,OAAO,CAAC;AAAA,EACpC;AAEA,SAAO,SAAS,EAAE,OAAO,KAAK,GAAG,aAAa;AAClD,CAAC;AASM,MAAM,UAAUJ,iBAAM,WAAW,SAAS,cAC7C,OACA,cACF;AACE,QAAME,WAAS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K;AAAA,QACL,WAAS;AAAA,QACT,gBAAc;AAAA,QACd,cAAY,MAAM,OAAO;AAAA,QACzB,WAAU;AAAA,MAAA;AAAA,IAAA,GAGjBE,SAAO,kBACJF,iCAAA;AAAA,MAACC,OAAAA,OAAgB;AAAA,MAAhB;AAAA,QACG,SAASC,SAAO;AAAA,QAChB,QACIF,iCAAA;AAAA,UAACW,WAAAA;AAAAA,UAAA;AAAA,YACG,YAAW;AAAA,YACX,cAAY,MAAM,OAAO;AAAA,YACzB,WAAU;AAAA,YACV,MAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MACT;AAAA,IAAA,IAER,IACR;AAAA,IACCT,SAAO,SAAS;AAAA,IAChBA,SAAO,SAAS;AAAA,EAAA,CAEzB,CACJ;AAER,CAAC;;;;;"}
1
+ {"version":3,"file":"Content.cjs","sources":["../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { mergeRefs } from '../../../utils/mergeRefs';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { LegacyIconButton } from '../../LegacyComponents/IconButton/IconButton';\nimport { useLocalization } from '../../Provider/Localization';\nimport type { DialogContext } from '../Context';\nimport { useCurrentDialog } from '../Context';\nimport { DIALOG_POSITION_CLASSNAMES, DIALOG_SIZE_CLASSNAME } 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 children: React.JSX.Element;\n};\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n const { children, ...restProps } = props;\n\n return <DialogPrimitive.Close {...restProps} onClick={dialog.onClose} ref={ref} render={children} />;\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: React.ReactNode | ((props: DialogContentRenderProps) => React.ReactNode);\n initialFocus?: DialogPrimitive.Popup.Props['initialFocus'];\n finalFocus?: DialogPrimitive.Popup.Props['finalFocus'];\n};\nexport const Content = React.forwardRef(function DialogContent(\n props: DialogContentProps,\n forwardedRef: React.Ref<HTMLDivElement>\n) {\n const dialog = useCurrentDialog();\n // Popup ref lives on the Dialog root so descendants can read it via `useDialogScope`;\n // we attach it to the popup node here and merge in any forwarded ref.\n const popupRef = dialog.popupRef as React.MutableRefObject<HTMLDivElement | null>;\n const setPopupRef = React.useMemo(() => mergeRefs<HTMLDivElement>([popupRef, forwardedRef]), [popupRef, forwardedRef]);\n const { position, dragging, handleProps: dragHandleProps } = useDraggable(popupRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative animate-[fade-in_150ms] rounded bg-white print:!static',\n DIALOG_POSITION_CLASSNAMES,\n DIALOG_SIZE_CLASSNAME[dialog.size],\n 'print:m-0 print:h-max print:w-full print:overflow-visible'\n );\n\n const containerClassName = cn(\n 'relative z-10 rounded bg-white p-6 shadow print:p-0',\n // The `!fixed` property is crucial to ensure that when a draggable dialog is moved, the printed document still displays its content across the full page.\n 'print:!inset-0 print:!m-0 print:h-max print:!transform-none print:overflow-visible',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\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 return (\n <DialogPrimitive.Portal>\n <Backdrop>\n <DialogPrimitive.Popup\n {...props}\n className={className}\n ref={setPopupRef}\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 top-1.5 h-3 w-24 cursor-move rounded bg-gray-100 text-center absolute-center-x print:hidden\"\n />\n )}\n {dialog.showCloseButton ? (\n <DialogPrimitive.Close\n onClick={dialog.onClose}\n render={\n <LegacyIconButton\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.Popup>\n </Backdrop>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["React","DialogPrimitive","dialog","useCurrentDialog","RenderPropWrapper","mergeRefs","useDraggable","useLocalization","DIALOG_POSITION_CLASSNAMES","DIALOG_SIZE_CLASSNAME","Backdrop","LegacyIconButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,QAAQA,iBAAM,WAAW,SAAS,YAAY,OAAyB,KAAoC;AACpH,QAAM,YAAY,GAA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;AAAA,IAChBA,SAAO,SAAS;AAAA,EAAA,CAEzB,CACJ;AAER,CAAC;;;;;"}
@@ -11,10 +11,10 @@ export declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & R
11
11
  export type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
12
12
  export declare const Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;
13
13
  export type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement> & {
14
- children: JSX.Element;
14
+ children: React.JSX.Element;
15
15
  };
16
16
  export declare const Close: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
17
- children: JSX.Element;
17
+ children: React.JSX.Element;
18
18
  } & React.RefAttributes<HTMLButtonElement>>;
19
19
  export type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
20
20
  /** An accessible label to be announced when the dialog is opened */