@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.
- package/dist/charts/components/Area/AreaChart.cjs.map +1 -1
- package/dist/charts/components/Area/AreaChart.d.ts +1 -1
- package/dist/charts/components/Area/AreaChart.js.map +1 -1
- package/dist/charts/components/Bar/BarChart.cjs.map +1 -1
- package/dist/charts/components/Bar/BarChart.d.ts +1 -1
- package/dist/charts/components/Bar/BarChart.js.map +1 -1
- package/dist/charts/components/Composed/BarLineChart.cjs.map +1 -1
- package/dist/charts/components/Composed/BarLineChart.d.ts +2 -2
- package/dist/charts/components/Composed/BarLineChart.js.map +1 -1
- package/dist/charts/components/Donut/DonutChart.cjs.map +1 -1
- package/dist/charts/components/Donut/DonutChart.d.ts +1 -1
- package/dist/charts/components/Donut/DonutChart.js.map +1 -1
- package/dist/charts/components/Line/LineChart.cjs.map +1 -1
- package/dist/charts/components/Line/LineChart.d.ts +1 -1
- package/dist/charts/components/Line/LineChart.js.map +1 -1
- package/dist/charts/components/Pie/PieChart.cjs.map +1 -1
- package/dist/charts/components/Pie/PieChart.d.ts +1 -1
- package/dist/charts/components/Pie/PieChart.js.map +1 -1
- package/dist/charts/components/Tooltip.cjs.map +1 -1
- package/dist/charts/components/Tooltip.d.ts +1 -1
- package/dist/charts/components/Tooltip.js.map +1 -1
- package/dist/charts/components/types.d.ts +2 -2
- package/dist/components/AlertDialog/AlertDialog.cjs.map +1 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/components/Banner/util.cjs.map +1 -1
- package/dist/components/Banner/util.d.ts +2 -1
- package/dist/components/Banner/util.js.map +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Combobox/Combobox.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +1 -1
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Combobox/useCombobox.cjs.map +1 -1
- package/dist/components/Combobox/useCombobox.d.ts +1 -1
- package/dist/components/Combobox/useCombobox.js.map +1 -1
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +1 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/components/Content.cjs.map +1 -1
- package/dist/components/Dialog/components/Content.d.ts +2 -2
- package/dist/components/Dialog/components/Content.js.map +1 -1
- package/dist/components/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/useDrawerStack.cjs +1 -1
- package/dist/components/Drawer/useDrawerStack.cjs.map +1 -1
- package/dist/components/Drawer/useDrawerStack.js +1 -1
- package/dist/components/Drawer/useDrawerStack.js.map +1 -1
- package/dist/components/Hanger/Hanger.cjs.map +1 -1
- package/dist/components/Hanger/Hanger.d.ts +1 -1
- package/dist/components/Hanger/Hanger.js.map +1 -1
- package/dist/components/Header/components/Agreement/Display.cjs.map +1 -1
- package/dist/components/Header/components/Agreement/Display.d.ts +1 -1
- package/dist/components/Header/components/Agreement/Display.js.map +1 -1
- package/dist/components/Header/components/Agreement/Item.cjs.map +1 -1
- package/dist/components/Header/components/Agreement/Item.d.ts +1 -1
- package/dist/components/Header/components/Agreement/Item.js.map +1 -1
- package/dist/components/Header/components/Link.cjs.map +1 -1
- package/dist/components/Header/components/Link.d.ts +1 -1
- package/dist/components/Header/components/Link.js.map +1 -1
- package/dist/components/Icon/components/AccountPreview.cjs.map +1 -1
- package/dist/components/Icon/components/AccountPreview.js.map +1 -1
- package/dist/components/Icon/components/Accounting.cjs.map +1 -1
- package/dist/components/Icon/components/Accounting.js.map +1 -1
- package/dist/components/Icon/components/AccountingYear.cjs.map +1 -1
- package/dist/components/Icon/components/AccountingYear.js.map +1 -1
- package/dist/components/Icon/components/AccountingYearCancel.cjs.map +1 -1
- package/dist/components/Icon/components/AccountingYearCancel.js.map +1 -1
- package/dist/components/Icon/components/AiChatSolid.cjs.map +1 -1
- package/dist/components/Icon/components/AiChatSolid.js.map +1 -1
- package/dist/components/Icon/components/AiStars.cjs.map +1 -1
- package/dist/components/Icon/components/AiStars.js.map +1 -1
- package/dist/components/Icon/components/ArrowBottom.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowBottom.js.map +1 -1
- package/dist/components/Icon/components/ArrowDown.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowDown.js.map +1 -1
- package/dist/components/Icon/components/ArrowEnd.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowEnd.js.map +1 -1
- package/dist/components/Icon/components/ArrowLeft.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowLeft.js.map +1 -1
- package/dist/components/Icon/components/ArrowRight.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowRight.js.map +1 -1
- package/dist/components/Icon/components/ArrowStart.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowStart.js.map +1 -1
- package/dist/components/Icon/components/ArrowTop.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowTop.js.map +1 -1
- package/dist/components/Icon/components/ArrowUp.cjs.map +1 -1
- package/dist/components/Icon/components/ArrowUp.js.map +1 -1
- package/dist/components/Icon/components/Attach.cjs.map +1 -1
- package/dist/components/Icon/components/Attach.js.map +1 -1
- package/dist/components/Icon/components/AttachAuto.cjs.map +1 -1
- package/dist/components/Icon/components/AttachAuto.js.map +1 -1
- package/dist/components/Icon/components/AttachCancel.cjs.map +1 -1
- package/dist/components/Icon/components/AttachCancel.js.map +1 -1
- package/dist/components/Icon/components/AttachWarning.cjs.map +1 -1
- package/dist/components/Icon/components/AttachWarning.js.map +1 -1
- package/dist/components/Icon/components/Autopay.cjs.map +1 -1
- package/dist/components/Icon/components/Autopay.js.map +1 -1
- package/dist/components/Icon/components/AutopayPaused.cjs.map +1 -1
- package/dist/components/Icon/components/AutopayPaused.js.map +1 -1
- package/dist/components/Icon/components/Autotext.cjs.map +1 -1
- package/dist/components/Icon/components/Autotext.js.map +1 -1
- package/dist/components/Icon/components/AutotextInsert.cjs.map +1 -1
- package/dist/components/Icon/components/AutotextInsert.js.map +1 -1
- package/dist/components/Icon/components/Basic.cjs.map +1 -1
- package/dist/components/Icon/components/Basic.js.map +1 -1
- package/dist/components/Icon/components/BasicTabs.cjs.map +1 -1
- package/dist/components/Icon/components/BasicTabs.js.map +1 -1
- package/dist/components/Icon/components/BellSolid.cjs.map +1 -1
- package/dist/components/Icon/components/BellSolid.js.map +1 -1
- package/dist/components/Icon/components/Book.cjs.map +1 -1
- package/dist/components/Icon/components/Book.js.map +1 -1
- package/dist/components/Icon/components/Booking.cjs.map +1 -1
- package/dist/components/Icon/components/Booking.js.map +1 -1
- package/dist/components/Icon/components/Budget.cjs.map +1 -1
- package/dist/components/Icon/components/Budget.js.map +1 -1
- package/dist/components/Icon/components/Calendar.cjs.map +1 -1
- package/dist/components/Icon/components/Calendar.js.map +1 -1
- package/dist/components/Icon/components/CashAccount.cjs.map +1 -1
- package/dist/components/Icon/components/CashAccount.js.map +1 -1
- package/dist/components/Icon/components/CashReports.cjs.map +1 -1
- package/dist/components/Icon/components/CashReports.js.map +1 -1
- package/dist/components/Icon/components/ChartArea.cjs.map +1 -1
- package/dist/components/Icon/components/ChartArea.js.map +1 -1
- package/dist/components/Icon/components/ChartBar.cjs.map +1 -1
- package/dist/components/Icon/components/ChartBar.js.map +1 -1
- package/dist/components/Icon/components/ChartLine.cjs.map +1 -1
- package/dist/components/Icon/components/ChartLine.js.map +1 -1
- package/dist/components/Icon/components/ChartPie.cjs.map +1 -1
- package/dist/components/Icon/components/ChartPie.js.map +1 -1
- package/dist/components/Icon/components/ChartTable.cjs.map +1 -1
- package/dist/components/Icon/components/ChartTable.js.map +1 -1
- package/dist/components/Icon/components/Chat.cjs.map +1 -1
- package/dist/components/Icon/components/Chat.js.map +1 -1
- package/dist/components/Icon/components/ChatSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ChatSolid.js.map +1 -1
- package/dist/components/Icon/components/ChevronDown.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronDown.js.map +1 -1
- package/dist/components/Icon/components/ChevronDownDouble.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronDownDouble.js.map +1 -1
- package/dist/components/Icon/components/ChevronDownSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronDownSolid.js.map +1 -1
- package/dist/components/Icon/components/ChevronLeft.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronLeft.js.map +1 -1
- package/dist/components/Icon/components/ChevronLeftDouble.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronLeftDouble.js.map +1 -1
- package/dist/components/Icon/components/ChevronLeftSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronLeftSolid.js.map +1 -1
- package/dist/components/Icon/components/ChevronRight.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronRight.js.map +1 -1
- package/dist/components/Icon/components/ChevronRightDouble.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronRightDouble.js.map +1 -1
- package/dist/components/Icon/components/ChevronRightSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronRightSolid.js.map +1 -1
- package/dist/components/Icon/components/ChevronUp.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronUp.js.map +1 -1
- package/dist/components/Icon/components/ChevronUpDouble.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronUpDouble.js.map +1 -1
- package/dist/components/Icon/components/ChevronUpSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ChevronUpSolid.js.map +1 -1
- package/dist/components/Icon/components/CircleInformation.cjs.map +1 -1
- package/dist/components/Icon/components/CircleInformation.js.map +1 -1
- package/dist/components/Icon/components/CircleMinus.cjs.map +1 -1
- package/dist/components/Icon/components/CircleMinus.js.map +1 -1
- package/dist/components/Icon/components/CirclePlus.cjs.map +1 -1
- package/dist/components/Icon/components/CirclePlus.js.map +1 -1
- package/dist/components/Icon/components/CircleQuestionmark.cjs.map +1 -1
- package/dist/components/Icon/components/CircleQuestionmark.js.map +1 -1
- package/dist/components/Icon/components/CircleTick.cjs.map +1 -1
- package/dist/components/Icon/components/CircleTick.js.map +1 -1
- package/dist/components/Icon/components/CircleWarning.cjs.map +1 -1
- package/dist/components/Icon/components/CircleWarning.js.map +1 -1
- package/dist/components/Icon/components/Clamp.cjs.map +1 -1
- package/dist/components/Icon/components/Clamp.js.map +1 -1
- package/dist/components/Icon/components/ClampOpen.cjs.map +1 -1
- package/dist/components/Icon/components/ClampOpen.js.map +1 -1
- package/dist/components/Icon/components/ClickToPay.cjs.map +1 -1
- package/dist/components/Icon/components/ClickToPay.js.map +1 -1
- package/dist/components/Icon/components/Close.cjs.map +1 -1
- package/dist/components/Icon/components/Close.js.map +1 -1
- package/dist/components/Icon/components/ColumnFreeze.cjs.map +1 -1
- package/dist/components/Icon/components/ColumnFreeze.js.map +1 -1
- package/dist/components/Icon/components/ColumnUnfreeze.cjs.map +1 -1
- package/dist/components/Icon/components/ColumnUnfreeze.js.map +1 -1
- package/dist/components/Icon/components/Columns.cjs.map +1 -1
- package/dist/components/Icon/components/Columns.js.map +1 -1
- package/dist/components/Icon/components/ConnectionEnable.cjs.map +1 -1
- package/dist/components/Icon/components/ConnectionEnable.js.map +1 -1
- package/dist/components/Icon/components/ConnectionRevoke.cjs.map +1 -1
- package/dist/components/Icon/components/ConnectionRevoke.js.map +1 -1
- package/dist/components/Icon/components/Contacts.cjs.map +1 -1
- package/dist/components/Icon/components/Contacts.js.map +1 -1
- package/dist/components/Icon/components/Copy.cjs.map +1 -1
- package/dist/components/Icon/components/Copy.js.map +1 -1
- package/dist/components/Icon/components/Courses.cjs.map +1 -1
- package/dist/components/Icon/components/Courses.js.map +1 -1
- package/dist/components/Icon/components/Credit.cjs.map +1 -1
- package/dist/components/Icon/components/Credit.js.map +1 -1
- package/dist/components/Icon/components/Delete.cjs.map +1 -1
- package/dist/components/Icon/components/Delete.js.map +1 -1
- package/dist/components/Icon/components/DeletePermanently.cjs.map +1 -1
- package/dist/components/Icon/components/DeletePermanently.js.map +1 -1
- package/dist/components/Icon/components/Depecriate.cjs.map +1 -1
- package/dist/components/Icon/components/Depecriate.js.map +1 -1
- package/dist/components/Icon/components/Developer.cjs.map +1 -1
- package/dist/components/Icon/components/Developer.js.map +1 -1
- package/dist/components/Icon/components/DistributionTemplate.cjs.map +1 -1
- package/dist/components/Icon/components/DistributionTemplate.js.map +1 -1
- package/dist/components/Icon/components/Document.cjs.map +1 -1
- package/dist/components/Icon/components/Document.js.map +1 -1
- package/dist/components/Icon/components/DocumentApprove.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentApprove.js.map +1 -1
- package/dist/components/Icon/components/DocumentCreateEntry.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentCreateEntry.js.map +1 -1
- package/dist/components/Icon/components/DocumentCut.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentCut.js.map +1 -1
- package/dist/components/Icon/components/DocumentError.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentError.js.map +1 -1
- package/dist/components/Icon/components/DocumentIsolatePage.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentIsolatePage.js.map +1 -1
- package/dist/components/Icon/components/DocumentMerge.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentMerge.js.map +1 -1
- package/dist/components/Icon/components/DocumentMove.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentMove.js.map +1 -1
- package/dist/components/Icon/components/DocumentPreview.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentPreview.js.map +1 -1
- package/dist/components/Icon/components/DocumentReceived.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentReceived.js.map +1 -1
- package/dist/components/Icon/components/DocumentRejectedRequest.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
- package/dist/components/Icon/components/DocumentSigned.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentSigned.js.map +1 -1
- package/dist/components/Icon/components/DocumentSignedSolid.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentSignedSolid.js.map +1 -1
- package/dist/components/Icon/components/DocumentSplit.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentSplit.js.map +1 -1
- package/dist/components/Icon/components/DocumentTime.cjs.map +1 -1
- package/dist/components/Icon/components/DocumentTime.js.map +1 -1
- package/dist/components/Icon/components/Download.cjs.map +1 -1
- package/dist/components/Icon/components/Download.js.map +1 -1
- package/dist/components/Icon/components/Drag.cjs.map +1 -1
- package/dist/components/Icon/components/Drag.js.map +1 -1
- package/dist/components/Icon/components/ECopedia.cjs.map +1 -1
- package/dist/components/Icon/components/ECopedia.js.map +1 -1
- package/dist/components/Icon/components/Edit.cjs.map +1 -1
- package/dist/components/Icon/components/Edit.js.map +1 -1
- package/dist/components/Icon/components/EditSimple.cjs.map +1 -1
- package/dist/components/Icon/components/EditSimple.js.map +1 -1
- package/dist/components/Icon/components/EllipsisHorizontal.cjs.map +1 -1
- package/dist/components/Icon/components/EllipsisHorizontal.js.map +1 -1
- package/dist/components/Icon/components/EllipsisVertical.cjs.map +1 -1
- package/dist/components/Icon/components/EllipsisVertical.js.map +1 -1
- package/dist/components/Icon/components/EntriesOnAccount.cjs.map +1 -1
- package/dist/components/Icon/components/EntriesOnAccount.js.map +1 -1
- package/dist/components/Icon/components/EntriesOpen.cjs.map +1 -1
- package/dist/components/Icon/components/EntriesOpen.js.map +1 -1
- package/dist/components/Icon/components/EntriesWarning.cjs.map +1 -1
- package/dist/components/Icon/components/EntriesWarning.js.map +1 -1
- package/dist/components/Icon/components/EntryTypeCustomerInvoice.cjs.map +1 -1
- package/dist/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
- package/dist/components/Icon/components/EntryTypeCustomerPayment.cjs.map +1 -1
- package/dist/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
- package/dist/components/Icon/components/EntryTypeJournalEntry.cjs.map +1 -1
- package/dist/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
- package/dist/components/Icon/components/EntryTypeManualCustomerInvoice.cjs.map +1 -1
- package/dist/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
- package/dist/components/Icon/components/EntryTypeSupplierInvoice.cjs.map +1 -1
- package/dist/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
- package/dist/components/Icon/components/EntryTypeSupplierPayment.cjs.map +1 -1
- package/dist/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
- package/dist/components/Icon/components/Envelope.cjs.map +1 -1
- package/dist/components/Icon/components/Envelope.js.map +1 -1
- package/dist/components/Icon/components/EnvelopeApproved.cjs.map +1 -1
- package/dist/components/Icon/components/EnvelopeApproved.js.map +1 -1
- package/dist/components/Icon/components/EnvelopeSolid.cjs.map +1 -1
- package/dist/components/Icon/components/EnvelopeSolid.js.map +1 -1
- package/dist/components/Icon/components/ExpandView.cjs.map +1 -1
- package/dist/components/Icon/components/ExpandView.js.map +1 -1
- package/dist/components/Icon/components/Expenses.cjs.map +1 -1
- package/dist/components/Icon/components/Expenses.js.map +1 -1
- package/dist/components/Icon/components/Experiment.cjs.map +1 -1
- package/dist/components/Icon/components/Experiment.js.map +1 -1
- package/dist/components/Icon/components/Export.cjs.map +1 -1
- package/dist/components/Icon/components/Export.js.map +1 -1
- package/dist/components/Icon/components/ExportToExcel.cjs.map +1 -1
- package/dist/components/Icon/components/ExportToExcel.js.map +1 -1
- package/dist/components/Icon/components/ExportToPdf.cjs.map +1 -1
- package/dist/components/Icon/components/ExportToPdf.js.map +1 -1
- package/dist/components/Icon/components/EyeOff.cjs.map +1 -1
- package/dist/components/Icon/components/EyeOff.js.map +1 -1
- package/dist/components/Icon/components/EyeOn.cjs.map +1 -1
- package/dist/components/Icon/components/EyeOn.js.map +1 -1
- package/dist/components/Icon/components/Filter.cjs.map +1 -1
- package/dist/components/Icon/components/Filter.js.map +1 -1
- package/dist/components/Icon/components/FilterSolid.cjs.map +1 -1
- package/dist/components/Icon/components/FilterSolid.js.map +1 -1
- package/dist/components/Icon/components/FontSize.cjs.map +1 -1
- package/dist/components/Icon/components/FontSize.js.map +1 -1
- package/dist/components/Icon/components/GraphSolid.cjs.map +1 -1
- package/dist/components/Icon/components/GraphSolid.js.map +1 -1
- package/dist/components/Icon/components/Hash.cjs.map +1 -1
- package/dist/components/Icon/components/Hash.js.map +1 -1
- package/dist/components/Icon/components/HeightExtraTall.cjs.map +1 -1
- package/dist/components/Icon/components/HeightExtraTall.js.map +1 -1
- package/dist/components/Icon/components/HeightMedium.cjs.map +1 -1
- package/dist/components/Icon/components/HeightMedium.js.map +1 -1
- package/dist/components/Icon/components/HeightShort.cjs.map +1 -1
- package/dist/components/Icon/components/HeightShort.js.map +1 -1
- package/dist/components/Icon/components/HeightTall.cjs.map +1 -1
- package/dist/components/Icon/components/HeightTall.js.map +1 -1
- package/dist/components/Icon/components/House.cjs.map +1 -1
- package/dist/components/Icon/components/House.js.map +1 -1
- package/dist/components/Icon/components/HouseSolid.cjs.map +1 -1
- package/dist/components/Icon/components/HouseSolid.js.map +1 -1
- package/dist/components/Icon/components/Id.cjs.map +1 -1
- package/dist/components/Icon/components/Id.js.map +1 -1
- package/dist/components/Icon/components/Images.cjs.map +1 -1
- package/dist/components/Icon/components/Images.js.map +1 -1
- package/dist/components/Icon/components/Import.cjs.map +1 -1
- package/dist/components/Icon/components/Import.js.map +1 -1
- package/dist/components/Icon/components/Inbox.cjs.map +1 -1
- package/dist/components/Icon/components/Inbox.js.map +1 -1
- package/dist/components/Icon/components/InboxEinvoicing.cjs.map +1 -1
- package/dist/components/Icon/components/InboxEinvoicing.js.map +1 -1
- package/dist/components/Icon/components/InboxScanning.cjs.map +1 -1
- package/dist/components/Icon/components/InboxScanning.js.map +1 -1
- package/dist/components/Icon/components/InboxSmart.cjs.map +1 -1
- package/dist/components/Icon/components/InboxSmart.js.map +1 -1
- package/dist/components/Icon/components/Info.cjs.map +1 -1
- package/dist/components/Icon/components/Info.js.map +1 -1
- package/dist/components/Icon/components/Inventory.cjs.map +1 -1
- package/dist/components/Icon/components/Inventory.js.map +1 -1
- package/dist/components/Icon/components/InventoryMatrix.cjs.map +1 -1
- package/dist/components/Icon/components/InventoryMatrix.js.map +1 -1
- package/dist/components/Icon/components/JournalPro.cjs.map +1 -1
- package/dist/components/Icon/components/JournalPro.js.map +1 -1
- package/dist/components/Icon/components/Layout.cjs.map +1 -1
- package/dist/components/Icon/components/Layout.js.map +1 -1
- package/dist/components/Icon/components/LayoutBoth.cjs.map +1 -1
- package/dist/components/Icon/components/LayoutBoth.js.map +1 -1
- package/dist/components/Icon/components/LayoutFirst.cjs.map +1 -1
- package/dist/components/Icon/components/LayoutFirst.js.map +1 -1
- package/dist/components/Icon/components/LayoutLast.cjs.map +1 -1
- package/dist/components/Icon/components/LayoutLast.js.map +1 -1
- package/dist/components/Icon/components/LayoutNone.cjs.map +1 -1
- package/dist/components/Icon/components/LayoutNone.js.map +1 -1
- package/dist/components/Icon/components/LedgerCard.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCard.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardCustomerReminder.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardManualCustomerInvoice.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardObsoleteStock.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardOpeningEntry.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardReservedEntry.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardShrinkagePilferage.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardStockAdjustment.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
- package/dist/components/Icon/components/LedgerCardTransferredOpeningEntry.cjs.map +1 -1
- package/dist/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
- package/dist/components/Icon/components/Lightbulb.cjs.map +1 -1
- package/dist/components/Icon/components/Lightbulb.js.map +1 -1
- package/dist/components/Icon/components/Line.cjs.map +1 -1
- package/dist/components/Icon/components/Line.js.map +1 -1
- package/dist/components/Icon/components/LinkExternal.cjs.map +1 -1
- package/dist/components/Icon/components/LinkExternal.js.map +1 -1
- package/dist/components/Icon/components/List.cjs.map +1 -1
- package/dist/components/Icon/components/List.js.map +1 -1
- package/dist/components/Icon/components/ListBulleted.cjs.map +1 -1
- package/dist/components/Icon/components/ListBulleted.js.map +1 -1
- package/dist/components/Icon/components/ListSearch.cjs.map +1 -1
- package/dist/components/Icon/components/ListSearch.js.map +1 -1
- package/dist/components/Icon/components/Location.cjs.map +1 -1
- package/dist/components/Icon/components/Location.js.map +1 -1
- package/dist/components/Icon/components/Lock.cjs.map +1 -1
- package/dist/components/Icon/components/Lock.js.map +1 -1
- package/dist/components/Icon/components/LockOpen.cjs.map +1 -1
- package/dist/components/Icon/components/LockOpen.js.map +1 -1
- package/dist/components/Icon/components/Log.cjs.map +1 -1
- package/dist/components/Icon/components/Log.js.map +1 -1
- package/dist/components/Icon/components/LogOut.cjs.map +1 -1
- package/dist/components/Icon/components/LogOut.js.map +1 -1
- package/dist/components/Icon/components/Market.cjs.map +1 -1
- package/dist/components/Icon/components/Market.js.map +1 -1
- package/dist/components/Icon/components/MastercardOs.cjs.map +1 -1
- package/dist/components/Icon/components/MastercardOs.js.map +1 -1
- package/dist/components/Icon/components/MatchAmount.cjs.map +1 -1
- package/dist/components/Icon/components/MatchAmount.js.map +1 -1
- package/dist/components/Icon/components/MatchEntries.cjs.map +1 -1
- package/dist/components/Icon/components/MatchEntries.js.map +1 -1
- package/dist/components/Icon/components/Menu.cjs.map +1 -1
- package/dist/components/Icon/components/Menu.js.map +1 -1
- package/dist/components/Icon/components/Mileage.cjs.map +1 -1
- package/dist/components/Icon/components/Mileage.js.map +1 -1
- package/dist/components/Icon/components/ModalResize.cjs.map +1 -1
- package/dist/components/Icon/components/ModalResize.js.map +1 -1
- package/dist/components/Icon/components/ModalShrink.cjs.map +1 -1
- package/dist/components/Icon/components/ModalShrink.js.map +1 -1
- package/dist/components/Icon/components/More.cjs.map +1 -1
- package/dist/components/Icon/components/More.js.map +1 -1
- package/dist/components/Icon/components/MoreSolid.cjs.map +1 -1
- package/dist/components/Icon/components/MoreSolid.js.map +1 -1
- package/dist/components/Icon/components/Move.cjs.map +1 -1
- package/dist/components/Icon/components/Move.js.map +1 -1
- package/dist/components/Icon/components/NavigationList.cjs.map +1 -1
- package/dist/components/Icon/components/NavigationList.js.map +1 -1
- package/dist/components/Icon/components/Note.cjs.map +1 -1
- package/dist/components/Icon/components/Note.js.map +1 -1
- package/dist/components/Icon/components/NoteFollowUp.cjs.map +1 -1
- package/dist/components/Icon/components/NoteFollowUp.js.map +1 -1
- package/dist/components/Icon/components/NoteRead.cjs.map +1 -1
- package/dist/components/Icon/components/NoteRead.js.map +1 -1
- package/dist/components/Icon/components/NovemberFirst.cjs.map +1 -1
- package/dist/components/Icon/components/NovemberFirst.js.map +1 -1
- package/dist/components/Icon/components/Numbers.cjs.map +1 -1
- package/dist/components/Icon/components/Numbers.js.map +1 -1
- package/dist/components/Icon/components/PartialPaymentScheduled.cjs.map +1 -1
- package/dist/components/Icon/components/PartialPaymentScheduled.js.map +1 -1
- package/dist/components/Icon/components/PartnerApi.cjs.map +1 -1
- package/dist/components/Icon/components/PartnerApi.js.map +1 -1
- package/dist/components/Icon/components/PaymentPaid.cjs.map +1 -1
- package/dist/components/Icon/components/PaymentPaid.js.map +1 -1
- package/dist/components/Icon/components/PaymentUnpaid.cjs.map +1 -1
- package/dist/components/Icon/components/PaymentUnpaid.js.map +1 -1
- package/dist/components/Icon/components/Period.cjs.map +1 -1
- package/dist/components/Icon/components/Period.js.map +1 -1
- package/dist/components/Icon/components/Person.cjs.map +1 -1
- package/dist/components/Icon/components/Person.js.map +1 -1
- package/dist/components/Icon/components/PersonChange.cjs.map +1 -1
- package/dist/components/Icon/components/PersonChange.js.map +1 -1
- package/dist/components/Icon/components/PersonMinus.cjs.map +1 -1
- package/dist/components/Icon/components/PersonMinus.js.map +1 -1
- package/dist/components/Icon/components/PersonPlus.cjs.map +1 -1
- package/dist/components/Icon/components/PersonPlus.js.map +1 -1
- package/dist/components/Icon/components/PersonSolid.cjs.map +1 -1
- package/dist/components/Icon/components/PersonSolid.js.map +1 -1
- package/dist/components/Icon/components/PersonTick.cjs.map +1 -1
- package/dist/components/Icon/components/PersonTick.js.map +1 -1
- package/dist/components/Icon/components/Phone.cjs.map +1 -1
- package/dist/components/Icon/components/Phone.js.map +1 -1
- package/dist/components/Icon/components/PhoneSolid.cjs.map +1 -1
- package/dist/components/Icon/components/PhoneSolid.js.map +1 -1
- package/dist/components/Icon/components/Play.cjs.map +1 -1
- package/dist/components/Icon/components/Play.js.map +1 -1
- package/dist/components/Icon/components/PlusMinus.cjs.map +1 -1
- package/dist/components/Icon/components/PlusMinus.js.map +1 -1
- package/dist/components/Icon/components/Print.cjs.map +1 -1
- package/dist/components/Icon/components/Print.js.map +1 -1
- package/dist/components/Icon/components/ProcessPayment.cjs.map +1 -1
- package/dist/components/Icon/components/ProcessPayment.js.map +1 -1
- package/dist/components/Icon/components/ProductLedgerCard.cjs.map +1 -1
- package/dist/components/Icon/components/ProductLedgerCard.js.map +1 -1
- package/dist/components/Icon/components/Profile.cjs.map +1 -1
- package/dist/components/Icon/components/Profile.js.map +1 -1
- package/dist/components/Icon/components/ProjectCards.cjs.map +1 -1
- package/dist/components/Icon/components/ProjectCards.js.map +1 -1
- package/dist/components/Icon/components/Projects.cjs.map +1 -1
- package/dist/components/Icon/components/Projects.js.map +1 -1
- package/dist/components/Icon/components/QuestionMark.cjs.map +1 -1
- package/dist/components/Icon/components/QuestionMark.js.map +1 -1
- package/dist/components/Icon/components/QuestionMarkBold.cjs.map +1 -1
- package/dist/components/Icon/components/QuestionMarkBold.js.map +1 -1
- package/dist/components/Icon/components/Quicklinks.cjs.map +1 -1
- package/dist/components/Icon/components/Quicklinks.js.map +1 -1
- package/dist/components/Icon/components/RatingBankruptcy.cjs.map +1 -1
- package/dist/components/Icon/components/RatingBankruptcy.js.map +1 -1
- package/dist/components/Icon/components/RatingPaymentProblems.cjs.map +1 -1
- package/dist/components/Icon/components/RatingPaymentProblems.js.map +1 -1
- package/dist/components/Icon/components/Reconciled.cjs.map +1 -1
- package/dist/components/Icon/components/Reconciled.js.map +1 -1
- package/dist/components/Icon/components/Refresh.cjs.map +1 -1
- package/dist/components/Icon/components/Refresh.js.map +1 -1
- package/dist/components/Icon/components/Remove.cjs.map +1 -1
- package/dist/components/Icon/components/Remove.js.map +1 -1
- package/dist/components/Icon/components/Report.cjs.map +1 -1
- package/dist/components/Icon/components/Report.js.map +1 -1
- package/dist/components/Icon/components/ReportSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ReportSolid.js.map +1 -1
- package/dist/components/Icon/components/Restore.cjs.map +1 -1
- package/dist/components/Icon/components/Restore.js.map +1 -1
- package/dist/components/Icon/components/RotateLeft.cjs.map +1 -1
- package/dist/components/Icon/components/RotateLeft.js.map +1 -1
- package/dist/components/Icon/components/RotateRight.cjs.map +1 -1
- package/dist/components/Icon/components/RotateRight.js.map +1 -1
- package/dist/components/Icon/components/Sales.cjs.map +1 -1
- package/dist/components/Icon/components/Sales.js.map +1 -1
- package/dist/components/Icon/components/Search.cjs.map +1 -1
- package/dist/components/Icon/components/Search.js.map +1 -1
- package/dist/components/Icon/components/SearchBold.cjs.map +1 -1
- package/dist/components/Icon/components/SearchBold.js.map +1 -1
- package/dist/components/Icon/components/Secure.cjs.map +1 -1
- package/dist/components/Icon/components/Secure.js.map +1 -1
- package/dist/components/Icon/components/SecureTick.cjs.map +1 -1
- package/dist/components/Icon/components/SecureTick.js.map +1 -1
- package/dist/components/Icon/components/Settings.cjs.map +1 -1
- package/dist/components/Icon/components/Settings.js.map +1 -1
- package/dist/components/Icon/components/SettingsSolid.cjs.map +1 -1
- package/dist/components/Icon/components/SettingsSolid.js.map +1 -1
- package/dist/components/Icon/components/Shortcuts.cjs.map +1 -1
- package/dist/components/Icon/components/Shortcuts.js.map +1 -1
- package/dist/components/Icon/components/ShowAll.cjs.map +1 -1
- package/dist/components/Icon/components/ShowAll.js.map +1 -1
- package/dist/components/Icon/components/ShowLess.cjs.map +1 -1
- package/dist/components/Icon/components/ShowLess.js.map +1 -1
- package/dist/components/Icon/components/ShowMore.cjs.map +1 -1
- package/dist/components/Icon/components/ShowMore.js.map +1 -1
- package/dist/components/Icon/components/ShowTemplate.cjs.map +1 -1
- package/dist/components/Icon/components/ShowTemplate.js.map +1 -1
- package/dist/components/Icon/components/Sliders.cjs.map +1 -1
- package/dist/components/Icon/components/Sliders.js.map +1 -1
- package/dist/components/Icon/components/Smartpay.cjs.map +1 -1
- package/dist/components/Icon/components/Smartpay.js.map +1 -1
- package/dist/components/Icon/components/SortBy.cjs.map +1 -1
- package/dist/components/Icon/components/SortBy.js.map +1 -1
- package/dist/components/Icon/components/Star.cjs.map +1 -1
- package/dist/components/Icon/components/Star.js.map +1 -1
- package/dist/components/Icon/components/StarSolid.cjs.map +1 -1
- package/dist/components/Icon/components/StarSolid.js.map +1 -1
- package/dist/components/Icon/components/Subscriptions.cjs.map +1 -1
- package/dist/components/Icon/components/Subscriptions.js.map +1 -1
- package/dist/components/Icon/components/SystemEntries.cjs.map +1 -1
- package/dist/components/Icon/components/SystemEntries.js.map +1 -1
- package/dist/components/Icon/components/Tag.cjs.map +1 -1
- package/dist/components/Icon/components/Tag.js.map +1 -1
- package/dist/components/Icon/components/TemplateOverride.cjs.map +1 -1
- package/dist/components/Icon/components/TemplateOverride.js.map +1 -1
- package/dist/components/Icon/components/Templates.cjs.map +1 -1
- package/dist/components/Icon/components/Templates.js.map +1 -1
- package/dist/components/Icon/components/ThumbBoth.cjs.map +1 -1
- package/dist/components/Icon/components/ThumbBoth.js.map +1 -1
- package/dist/components/Icon/components/ThumbDown.cjs.map +1 -1
- package/dist/components/Icon/components/ThumbDown.js.map +1 -1
- package/dist/components/Icon/components/ThumbDownSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ThumbDownSolid.js.map +1 -1
- package/dist/components/Icon/components/ThumbUp.cjs.map +1 -1
- package/dist/components/Icon/components/ThumbUp.js.map +1 -1
- package/dist/components/Icon/components/ThumbUpSolid.cjs.map +1 -1
- package/dist/components/Icon/components/ThumbUpSolid.js.map +1 -1
- package/dist/components/Icon/components/Tick.cjs.map +1 -1
- package/dist/components/Icon/components/Tick.js.map +1 -1
- package/dist/components/Icon/components/TickBold.cjs.map +1 -1
- package/dist/components/Icon/components/TickBold.js.map +1 -1
- package/dist/components/Icon/components/Time.cjs.map +1 -1
- package/dist/components/Icon/components/Time.js.map +1 -1
- package/dist/components/Icon/components/Transfer.cjs.map +1 -1
- package/dist/components/Icon/components/Transfer.js.map +1 -1
- package/dist/components/Icon/components/TransferCancel.cjs.map +1 -1
- package/dist/components/Icon/components/TransferCancel.js.map +1 -1
- package/dist/components/Icon/components/TransferLocked.cjs.map +1 -1
- package/dist/components/Icon/components/TransferLocked.js.map +1 -1
- package/dist/components/Icon/components/Undo.cjs.map +1 -1
- package/dist/components/Icon/components/Undo.js.map +1 -1
- package/dist/components/Icon/components/Undock.cjs.map +1 -1
- package/dist/components/Icon/components/Undock.js.map +1 -1
- package/dist/components/Icon/components/Unreconciled.cjs.map +1 -1
- package/dist/components/Icon/components/Unreconciled.js.map +1 -1
- package/dist/components/Icon/components/Wallet.cjs.map +1 -1
- package/dist/components/Icon/components/Wallet.js.map +1 -1
- package/dist/components/Icon/components/Warning.cjs.map +1 -1
- package/dist/components/Icon/components/Warning.js.map +1 -1
- package/dist/components/Icon/components/Webshop.cjs.map +1 -1
- package/dist/components/Icon/components/Webshop.js.map +1 -1
- package/dist/components/Icon/components/Website.cjs.map +1 -1
- package/dist/components/Icon/components/Website.js.map +1 -1
- package/dist/components/Icon/components/Workflow.cjs.map +1 -1
- package/dist/components/Icon/components/Workflow.js.map +1 -1
- package/dist/components/Icon/components/WorkflowTemplateBasic.cjs.map +1 -1
- package/dist/components/Icon/components/WorkflowTemplateBasic.js.map +1 -1
- package/dist/components/Icon/components/Zoom.cjs.map +1 -1
- package/dist/components/Icon/components/Zoom.js.map +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.ts +14 -8
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/LegacyComponents/Button/Button.cjs.map +1 -1
- package/dist/components/LegacyComponents/Button/Button.d.ts +13 -13
- package/dist/components/LegacyComponents/Button/Button.js.map +1 -1
- package/dist/components/LegacyComponents/Button/util.cjs.map +1 -1
- package/dist/components/LegacyComponents/Button/util.d.ts +2 -2
- package/dist/components/LegacyComponents/Button/util.js.map +1 -1
- package/dist/components/LegacyComponents/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/LegacyComponents/IconButton/IconButton.d.ts +15 -15
- package/dist/components/LegacyComponents/IconButton/IconButton.js.map +1 -1
- package/dist/components/List/List.cjs.map +1 -1
- package/dist/components/List/List.d.ts +3 -3
- package/dist/components/List/List.js.map +1 -1
- package/dist/components/List/components/Collapsible.cjs.map +1 -1
- package/dist/components/List/components/Collapsible.d.ts +2 -2
- package/dist/components/List/components/Collapsible.js.map +1 -1
- package/dist/components/List/components/Group.cjs.map +1 -1
- package/dist/components/List/components/Group.d.ts +2 -2
- package/dist/components/List/components/Group.js.map +1 -1
- package/dist/components/List/components/Item.cjs.map +1 -1
- package/dist/components/List/components/Item.d.ts +7 -7
- package/dist/components/List/components/Item.js.map +1 -1
- package/dist/components/List/components/Toggle.cjs.map +1 -1
- package/dist/components/List/components/Toggle.js.map +1 -1
- package/dist/components/Listbox/ScrollableList.cjs.map +1 -1
- package/dist/components/Listbox/ScrollableList.d.ts +4 -2
- package/dist/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/components/Listbox/util.cjs.map +1 -1
- package/dist/components/Listbox/util.d.ts +9 -5
- package/dist/components/Listbox/util.js.map +1 -1
- package/dist/components/Menu/Context.cjs.map +1 -1
- package/dist/components/Menu/Context.d.ts +2 -2
- package/dist/components/Menu/Context.js.map +1 -1
- package/dist/components/Menu/Menu.cjs.map +1 -1
- package/dist/components/Menu/Menu.d.ts +1 -1
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/components/Content.cjs.map +1 -1
- package/dist/components/Menu/components/Content.js.map +1 -1
- package/dist/components/Menu/components/Item.cjs.map +1 -1
- package/dist/components/Menu/components/Item.d.ts +2 -2
- package/dist/components/Menu/components/Item.js.map +1 -1
- package/dist/components/Menu/components/RadioGroup.cjs.map +1 -1
- package/dist/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/components/Navigation2/components/Group.cjs.map +1 -1
- package/dist/components/Navigation2/components/Group.d.ts +2 -2
- package/dist/components/Navigation2/components/Group.js.map +1 -1
- package/dist/components/Navigation2/components/Link.cjs.map +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +2 -2
- package/dist/components/Navigation2/components/Link.js.map +1 -1
- package/dist/components/OverflowGroup/OverflowGroup.cjs.map +1 -1
- package/dist/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/components/Pagination/PageNumbers.cjs.map +1 -1
- package/dist/components/Pagination/PageNumbers.d.ts +2 -1
- package/dist/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/components/Popover/Popover.cjs.map +1 -1
- package/dist/components/Popover/Popover.d.ts +2 -2
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Progress/Progress.cjs.map +1 -1
- package/dist/components/Progress/Progress.d.ts +1 -1
- package/dist/components/Progress/Progress.js.map +1 -1
- package/dist/components/Provider/Provider.cjs.map +1 -1
- package/dist/components/Provider/Provider.d.ts +1 -1
- package/dist/components/Provider/Provider.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.cjs.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Report/Report.cjs.map +1 -1
- package/dist/components/Report/Report.d.ts +1 -1
- package/dist/components/Report/Report.js.map +1 -1
- package/dist/components/SearchInput2/SearchInput2.cjs.map +1 -1
- package/dist/components/SearchInput2/SearchInput2.d.ts +1 -1
- package/dist/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/components/Select/useSelect.cjs.map +1 -1
- package/dist/components/Select/useSelect.d.ts +2 -2
- package/dist/components/Select/useSelect.js.map +1 -1
- package/dist/components/Select2/Select2.cjs +1 -3
- package/dist/components/Select2/Select2.cjs.map +1 -1
- package/dist/components/Select2/Select2.d.ts +5 -5
- package/dist/components/Select2/Select2.js +1 -3
- package/dist/components/Select2/Select2.js.map +1 -1
- package/dist/components/Select2/components/Context.cjs.map +1 -1
- package/dist/components/Select2/components/Context.d.ts +3 -3
- package/dist/components/Select2/components/Context.js.map +1 -1
- package/dist/components/Select2/components/Option.cjs.map +1 -1
- package/dist/components/Select2/components/Option.d.ts +7 -7
- package/dist/components/Select2/components/Option.js.map +1 -1
- package/dist/components/Select2/components/Search.d.ts +7 -4
- package/dist/components/Select2/components/Trigger.cjs +6 -5
- package/dist/components/Select2/components/Trigger.cjs.map +1 -1
- package/dist/components/Select2/components/Trigger.js +6 -5
- package/dist/components/Select2/components/Trigger.js.map +1 -1
- package/dist/components/Select2/types.d.ts +1 -1
- package/dist/components/Table3/Table3.cjs.map +1 -1
- package/dist/components/Table3/Table3.d.ts +1 -1
- package/dist/components/Table3/Table3.js.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.cjs.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.d.ts +1 -1
- package/dist/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.cjs.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.cjs.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.d.ts +2 -1
- package/dist/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -1
- package/dist/components/Table3/components/Editing/Alert.cjs +9 -3
- package/dist/components/Table3/components/Editing/Alert.cjs.map +1 -1
- package/dist/components/Table3/components/Editing/Alert.js +9 -3
- package/dist/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/components/Table3/components/Row/Editing/TemporaryRow.cjs.map +1 -1
- package/dist/components/Table3/components/Row/Editing/TemporaryRow.d.ts +1 -1
- package/dist/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
- package/dist/components/Table3/features/useEditingState.cjs +14 -6
- package/dist/components/Table3/features/useEditingState.cjs.map +1 -1
- package/dist/components/Table3/features/useEditingState.d.ts +24 -6
- package/dist/components/Table3/features/useEditingState.js +14 -6
- package/dist/components/Table3/features/useEditingState.js.map +1 -1
- package/dist/components/Table3/features/useTableEditing.d.ts +28 -7
- package/dist/components/Tabs/components/TabList.cjs.map +1 -1
- package/dist/components/Tabs/components/TabList.js.map +1 -1
- package/dist/components/Tabs/components/Trigger.cjs.map +1 -1
- package/dist/components/Tabs/components/Trigger.d.ts +2 -2
- package/dist/components/Tabs/components/Trigger.js.map +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toaster.cjs.map +1 -1
- package/dist/components/Toast/Toaster.d.ts +1 -1
- package/dist/components/Toast/Toaster.js.map +1 -1
- package/dist/components/Toast/util.cjs.map +1 -1
- package/dist/components/Toast/util.d.ts +2 -1
- package/dist/components/Toast/util.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Truncate/Truncate.cjs.map +1 -1
- package/dist/components/Truncate/Truncate.d.ts +5 -2
- package/dist/components/Truncate/Truncate.js.map +1 -1
- package/dist/hooks/useBoundingClientRectListener.cjs.map +1 -1
- package/dist/hooks/useBoundingClientRectListener.d.ts +1 -1
- package/dist/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/hooks/useIntersectionObserver.cjs.map +1 -1
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js.map +1 -1
- package/dist/hooks/useMergedRef.cjs.map +1 -1
- package/dist/hooks/useMergedRef.js.map +1 -1
- package/dist/hooks/useResizeObserver.cjs.map +1 -1
- package/dist/hooks/useResizeObserver.d.ts +1 -1
- package/dist/hooks/useResizeObserver.js.map +1 -1
- package/dist/primitives/Button.cjs.map +1 -1
- package/dist/primitives/Button.d.ts +2 -2
- package/dist/primitives/Button.js.map +1 -1
- package/dist/primitives/Listbox2/components/Option.d.ts +1 -1
- package/dist/primitives/Sortable/components/Item.cjs.map +1 -1
- package/dist/primitives/Sortable/components/Item.js.map +1 -1
- package/dist/primitives/Table/Core/Table.cjs.map +1 -1
- package/dist/primitives/Table/Core/Table.d.ts +2 -2
- package/dist/primitives/Table/Core/Table.js.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/util.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/util.d.ts +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Internal/Actions.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
- package/dist/primitives/Table/Core/components/Footer/Footer.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/primitives/Table/Core/components/Header/Header.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Header/Header.d.ts +1 -1
- package/dist/primitives/Table/Core/components/Header/Header.js.map +1 -1
- package/dist/primitives/Table/Core/components/Header/components/Menu.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Header/components/Menu.d.ts +1 -1
- package/dist/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
- package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.d.ts +1 -1
- package/dist/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/Toolbar.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableRenderer.cjs.map +1 -1
- package/dist/primitives/Table/Core/features/useTableRenderer.d.ts +1 -1
- package/dist/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/primitives/Table/Core/types.d.ts +3 -3
- package/dist/primitives/Table/Core/useTable.cjs.map +1 -1
- package/dist/primitives/Table/Core/useTable.d.ts +4 -4
- package/dist/primitives/Table/Core/useTable.js.map +1 -1
- package/dist/primitives/Table/types.cjs.map +1 -1
- package/dist/primitives/Table/types.d.ts +15 -15
- package/dist/primitives/Table/types.js.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowSelection.d.ts +1 -1
- package/dist/primitives/Table/useTableManager/types.d.ts +2 -2
- package/dist/primitives/Table/useTableManager/util/setup.cjs +2 -2
- package/dist/primitives/Table/useTableManager/util/setup.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/util/setup.js +2 -2
- package/dist/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +8 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trigger.js","sources":["../../../../src/components/Tabs/components/Trigger.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\n\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { getButtonClasses } from '../../LegacyComponents/Button/util';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport { TabContext } from '../Context';\n\nimport { createPanelId, createTriggerId } from './utils';\n\nexport type TabTriggerProps = React.HTMLAttributes<HTMLButtonElement> & {\n /**\n * A unique value that associates the trigger with a content.\n */\n id: string;\n /**\n * When true, prevents the user from interacting with the tab.\n */\n disabled?: boolean;\n /** A tooltip to show when hovering over the trigger */\n tooltip?: string | JSX.Element;\n};\n\nexport const TabTrigger = React.forwardRef(function Tab(props: TabTriggerProps, forwardedRef: React.Ref<HTMLButtonElement>) {\n const { children, id, disabled, tooltip, ...otherProps } = props;\n const context = React.useContext(TabContext);\n const ref = useMergedRef<HTMLButtonElement>(forwardedRef);\n\n const triggerClassName = cn(\n props.className,\n 'group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',\n // horizontal\n '[[aria-orientation=\"horizontal\"]_&]:pb-1',\n // vertical\n '[[aria-orientation=\"vertical\"]_&]:pr-1'\n );\n const buttonClassName = cn(\n getButtonClasses(),\n 'pointer-events-none rounded px-3 group-focus-visible:yt-focus-inset group-enabled:group-hover:bg-gray-100 group-enabled:group-hover:text-black'\n );\n const activeClassName = cn(\n 'pointer-events-none absolute z-[1] hidden bg-blue-500 group-aria-selected:flex',\n // horizontal\n '[[aria-orientation=\"horizontal\"]_&]:bottom-0 [[aria-orientation=\"horizontal\"]_&]:left-0 [[aria-orientation=\"horizontal\"]_&]:right-0 [[aria-orientation=\"horizontal\"]_&]:h-0.5 [[aria-orientation=\"horizontal\"]_&]:rounded-t-sm',\n // vertical\n '[[aria-orientation=\"vertical\"]_&]:bottom-0 [[aria-orientation=\"vertical\"]_&]:right-0 [[aria-orientation=\"vertical\"]_&]:top-0 [[aria-orientation=\"vertical\"]_&]:w-0.5 [[aria-orientation=\"vertical\"]_&]:rounded-l-sm'\n );\n\n const triggerId = createTriggerId(context.baseId, id);\n const panelId = createPanelId(context.baseId, id);\n\n const trigger = (\n <button\n {...otherProps}\n aria-selected={id === context?.activeTabId}\n aria-controls={panelId}\n id={triggerId}\n role=\"tab\"\n type=\"button\"\n className={triggerClassName}\n disabled={disabled}\n onFocus={() => context.onChange(id)}\n ref={ref}\n tabIndex={context?.activeTabId !== undefined ? (id === context?.activeTabId ? 0 : -1) : 0}>\n <span className={buttonClassName}>{children}</span>\n <span className={activeClassName} />\n </button>\n );\n\n if (tooltip) {\n return <Tooltip title={tooltip}>{trigger}</Tooltip>;\n }\n\n return trigger;\n});\n"],"names":["React"],"mappings":";;;;;;;AAuBO,MAAM,aAAaA,eAAM,WAAW,SAAS,IAAI,OAAwB,cAA4C;AACxH,QAAM,EAAE,UAAU,IAAI,UAAU,SAAS,GAAG,eAAe;AAC3D,QAAM,UAAUA,eAAM,WAAW,UAAU;AAC3C,QAAM,MAAM,aAAgC,YAAY;AAExD,QAAM,mBAAmB;AAAA,IACrB,MAAM;AAAA,IACN;AAAA;AAAA,IAEA;AAAA;AAAA,IAEA;AAAA,EAAA;AAEJ,QAAM,kBAAkB;AAAA,IACpB,iBAAA;AAAA,IACA;AAAA,EAAA;AAEJ,QAAM,kBAAkB;AAAA,IACpB;AAAA;AAAA,IAEA;AAAA;AAAA,IAEA;AAAA,EAAA;AAGJ,QAAM,YAAY,gBAAgB,QAAQ,QAAQ,EAAE;AACpD,QAAM,UAAU,cAAc,QAAQ,QAAQ,EAAE;AAEhD,QAAM,UACFA,+BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,iBAAe,OAAO,SAAS;AAAA,MAC/B,iBAAe;AAAA,MACf,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,MAAK;AAAA,MACL,WAAW;AAAA,MACX;AAAA,MACA,SAAS,MAAM,QAAQ,SAAS,EAAE;AAAA,MAClC;AAAA,MACA,UAAU,SAAS,gBAAgB,SAAa,OAAO,SAAS,cAAc,IAAI,KAAM;AAAA,IAAA;AAAA,IACxFA,+BAAA,cAAC,QAAA,EAAK,WAAW,gBAAA,GAAkB,QAAS;AAAA,IAC5CA,+BAAA,cAAC,QAAA,EAAK,WAAW,gBAAA,CAAiB;AAAA,EAAA;AAI1C,MAAI,SAAS;AACT,WAAOA,+BAAA,cAAC,SAAA,EAAQ,OAAO,QAAA,GAAU,OAAQ;AAAA,EAC7C;AAEA,SAAO;AACX,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../src/components/Tabs/components/Trigger.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\n\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { getButtonClasses } from '../../LegacyComponents/Button/util';\nimport { Tooltip } from '../../Tooltip/Tooltip';\nimport { TabContext } from '../Context';\n\nimport { createPanelId, createTriggerId } from './utils';\n\nexport type TabTriggerProps = React.HTMLAttributes<HTMLButtonElement> & {\n /**\n * A unique value that associates the trigger with a content.\n */\n id: string;\n /**\n * When true, prevents the user from interacting with the tab.\n */\n disabled?: boolean;\n /** A tooltip to show when hovering over the trigger */\n tooltip?: string | React.JSX.Element;\n};\n\nexport const TabTrigger = React.forwardRef(function Tab(props: TabTriggerProps, forwardedRef: React.Ref<HTMLButtonElement>) {\n const { children, id, disabled, tooltip, ...otherProps } = props;\n const context = React.useContext(TabContext);\n const ref = useMergedRef<HTMLButtonElement>(forwardedRef);\n\n const triggerClassName = cn(\n props.className,\n 'group relative p-0.5 outline-none disabled:cursor-not-allowed disabled:text-black/50',\n // horizontal\n '[[aria-orientation=\"horizontal\"]_&]:pb-1',\n // vertical\n '[[aria-orientation=\"vertical\"]_&]:pr-1'\n );\n const buttonClassName = cn(\n getButtonClasses(),\n 'pointer-events-none rounded px-3 group-focus-visible:yt-focus-inset group-enabled:group-hover:bg-gray-100 group-enabled:group-hover:text-black'\n );\n const activeClassName = cn(\n 'pointer-events-none absolute z-[1] hidden bg-blue-500 group-aria-selected:flex',\n // horizontal\n '[[aria-orientation=\"horizontal\"]_&]:bottom-0 [[aria-orientation=\"horizontal\"]_&]:left-0 [[aria-orientation=\"horizontal\"]_&]:right-0 [[aria-orientation=\"horizontal\"]_&]:h-0.5 [[aria-orientation=\"horizontal\"]_&]:rounded-t-sm',\n // vertical\n '[[aria-orientation=\"vertical\"]_&]:bottom-0 [[aria-orientation=\"vertical\"]_&]:right-0 [[aria-orientation=\"vertical\"]_&]:top-0 [[aria-orientation=\"vertical\"]_&]:w-0.5 [[aria-orientation=\"vertical\"]_&]:rounded-l-sm'\n );\n\n const triggerId = createTriggerId(context.baseId, id);\n const panelId = createPanelId(context.baseId, id);\n\n const trigger = (\n <button\n {...otherProps}\n aria-selected={id === context?.activeTabId}\n aria-controls={panelId}\n id={triggerId}\n role=\"tab\"\n type=\"button\"\n className={triggerClassName}\n disabled={disabled}\n onFocus={() => context.onChange(id)}\n ref={ref}\n tabIndex={context?.activeTabId !== undefined ? (id === context?.activeTabId ? 0 : -1) : 0}>\n <span className={buttonClassName}>{children}</span>\n <span className={activeClassName} />\n </button>\n );\n\n if (tooltip) {\n return <Tooltip title={tooltip}>{trigger}</Tooltip>;\n }\n\n return trigger;\n});\n"],"names":["React"],"mappings":";;;;;;;AAuBO,MAAM,aAAaA,eAAM,WAAW,SAAS,IAAI,OAAwB,cAA4C;AACxH,QAAM,EAAE,UAAU,IAAI,UAAU,SAAS,GAAG,eAAe;AAC3D,QAAM,UAAUA,eAAM,WAAW,UAAU;AAC3C,QAAM,MAAM,aAAgC,YAAY;AAExD,QAAM,mBAAmB;AAAA,IACrB,MAAM;AAAA,IACN;AAAA;AAAA,IAEA;AAAA;AAAA,IAEA;AAAA,EAAA;AAEJ,QAAM,kBAAkB;AAAA,IACpB,iBAAA;AAAA,IACA;AAAA,EAAA;AAEJ,QAAM,kBAAkB;AAAA,IACpB;AAAA;AAAA,IAEA;AAAA;AAAA,IAEA;AAAA,EAAA;AAGJ,QAAM,YAAY,gBAAgB,QAAQ,QAAQ,EAAE;AACpD,QAAM,UAAU,cAAc,QAAQ,QAAQ,EAAE;AAEhD,QAAM,UACFA,+BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,iBAAe,OAAO,SAAS;AAAA,MAC/B,iBAAe;AAAA,MACf,IAAI;AAAA,MACJ,MAAK;AAAA,MACL,MAAK;AAAA,MACL,WAAW;AAAA,MACX;AAAA,MACA,SAAS,MAAM,QAAQ,SAAS,EAAE;AAAA,MAClC;AAAA,MACA,UAAU,SAAS,gBAAgB,SAAa,OAAO,SAAS,cAAc,IAAI,KAAM;AAAA,IAAA;AAAA,IACxFA,+BAAA,cAAC,QAAA,EAAK,WAAW,gBAAA,GAAkB,QAAS;AAAA,IAC5CA,+BAAA,cAAC,QAAA,EAAK,WAAW,gBAAA,CAAiB;AAAA,EAAA;AAI1C,MAAI,SAAS;AACT,WAAOA,+BAAA,cAAC,SAAA,EAAQ,OAAO,QAAA,GAAU,OAAQ;AAAA,EAC7C;AAEA,SAAO;AACX,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import cn from 'clsx';\nimport { motion, useAnimation } from 'motion/react';\nimport React from 'react';\n\nimport type { State } from '../../types';\nimport { useTimer } from '../../utils/hooks/useTimer';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { getBadgeIcon, getToastEmptyContentWarning } from './util';\n\nexport type ToastsTexts = {\n /** Aria-label for the close icon button of toast */\n dismiss: string;\n};\n\nexport type ToastType = Exclude<State, 'default'> | 'loading';\nexport type ToastOptions = {\n /** Provide time in milliseconds after which the toast should autoclose */\n autoClose?: number;\n /**\n * State will change the icon displayed in toast and other characteristics,\n * for e.g. `loading` state will display a progress animation.\n * Default value is `default`\n */\n type?: ToastType;\n};\nexport type ToastContent = Omit<React.ReactNode, 'null' | 'undefined'>;\nexport type ToastProps = {\n /** Provide a unique id for toast */\n id: string;\n /**\n * Content can be any valid react node, for e.g. a `div`, or a simple text.\n */\n content: ToastContent;\n /** Additional options to define your toast */\n options: ToastOptions;\n /**\n * Handler called when toast closes.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n onClose: () => void;\n lastUpdated?: number;\n lastDuplicateId?: string;\n};\n\nexport const Toast = ({ content, lastUpdated, onClose: handleClose, options, ...props }: ToastProps): JSX.Element => {\n const { texts } = useLocalization();\n const { autoClose, type = 'default' } = options;\n const className = cn('relative mt-3 flex w-full items-center rounded bg-white px-2 py-1 yt-shadow print:hidden', {\n 'border border-gray-500': type === 'default' || type === 'loading' || !type,\n 'border border-green-500': type === 'success',\n 'border border-blue-500': type === 'information',\n 'border border-yellow-500': type === 'warning',\n 'border border-red-500': type === 'error',\n });\n const timer = useTimer(autoClose, handleClose);\n const controls = useAnimation();\n\n if (!content) {\n // oxlint-disable-next-line no-console\n console.warn(getToastEmptyContentWarning(content));\n }\n\n React.useEffect(() => {\n if (autoClose) {\n timer.start();\n }\n }, [autoClose]);\n\n const triggerUpdateAnimation = async () => {\n await controls.start({ scale: 1.05 });\n await controls.start({ scale: 1 });\n };\n\n React.useEffect(() => {\n if (lastUpdated) {\n triggerUpdateAnimation();\n\n if (timer.running) {\n timer.start();\n }\n }\n }, [lastUpdated]);\n\n return (\n <motion.div\n {...props}\n animate={controls}\n className={className}\n data-taco=\"toast\"\n onMouseEnter={timer.pause}\n onMouseLeave={timer.resume}>\n {getBadgeIcon(type)}\n <div className=\"flex-grow\">{content as React.ReactNode}</div>\n <LegacyIconButton\n appearance=\"discrete\"\n className=\"-mr-2 cursor-pointer self-start !px-0 text-gray-700\"\n icon=\"close\"\n aria-label={texts.toasts.dismiss}\n onClick={handleClose}\n />\n </motion.div>\n );\n};\n"],"names":["useLocalization","useTimer","useAnimation","getToastEmptyContentWarning","motion","getBadgeIcon","LegacyIconButton"],"mappings":";;;;;;;;;AA8CO,MAAM,QAAQ,CAAC,EAAE,SAAS,aAAa,SAAS,aAAa,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"Toast.cjs","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import cn from 'clsx';\nimport { motion, useAnimation } from 'motion/react';\nimport React from 'react';\n\nimport type { State } from '../../types';\nimport { useTimer } from '../../utils/hooks/useTimer';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { getBadgeIcon, getToastEmptyContentWarning } from './util';\n\nexport type ToastsTexts = {\n /** Aria-label for the close icon button of toast */\n dismiss: string;\n};\n\nexport type ToastType = Exclude<State, 'default'> | 'loading';\nexport type ToastOptions = {\n /** Provide time in milliseconds after which the toast should autoclose */\n autoClose?: number;\n /**\n * State will change the icon displayed in toast and other characteristics,\n * for e.g. `loading` state will display a progress animation.\n * Default value is `default`\n */\n type?: ToastType;\n};\nexport type ToastContent = Omit<React.ReactNode, 'null' | 'undefined'>;\nexport type ToastProps = {\n /** Provide a unique id for toast */\n id: string;\n /**\n * Content can be any valid react node, for e.g. a `div`, or a simple text.\n */\n content: ToastContent;\n /** Additional options to define your toast */\n options: ToastOptions;\n /**\n * Handler called when toast closes.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n onClose: () => void;\n lastUpdated?: number;\n lastDuplicateId?: string;\n};\n\nexport const Toast = ({ content, lastUpdated, onClose: handleClose, options, ...props }: ToastProps): React.JSX.Element => {\n const { texts } = useLocalization();\n const { autoClose, type = 'default' } = options;\n const className = cn('relative mt-3 flex w-full items-center rounded bg-white px-2 py-1 yt-shadow print:hidden', {\n 'border border-gray-500': type === 'default' || type === 'loading' || !type,\n 'border border-green-500': type === 'success',\n 'border border-blue-500': type === 'information',\n 'border border-yellow-500': type === 'warning',\n 'border border-red-500': type === 'error',\n });\n const timer = useTimer(autoClose, handleClose);\n const controls = useAnimation();\n\n if (!content) {\n // oxlint-disable-next-line no-console\n console.warn(getToastEmptyContentWarning(content));\n }\n\n React.useEffect(() => {\n if (autoClose) {\n timer.start();\n }\n }, [autoClose]);\n\n const triggerUpdateAnimation = async () => {\n await controls.start({ scale: 1.05 });\n await controls.start({ scale: 1 });\n };\n\n React.useEffect(() => {\n if (lastUpdated) {\n triggerUpdateAnimation();\n\n if (timer.running) {\n timer.start();\n }\n }\n }, [lastUpdated]);\n\n return (\n <motion.div\n {...props}\n animate={controls}\n className={className}\n data-taco=\"toast\"\n onMouseEnter={timer.pause}\n onMouseLeave={timer.resume}>\n {getBadgeIcon(type)}\n <div className=\"flex-grow\">{content as React.ReactNode}</div>\n <LegacyIconButton\n appearance=\"discrete\"\n className=\"-mr-2 cursor-pointer self-start !px-0 text-gray-700\"\n icon=\"close\"\n aria-label={texts.toasts.dismiss}\n onClick={handleClose}\n />\n </motion.div>\n );\n};\n"],"names":["useLocalization","useTimer","useAnimation","getToastEmptyContentWarning","motion","getBadgeIcon","LegacyIconButton"],"mappings":";;;;;;;;;AA8CO,MAAM,QAAQ,CAAC,EAAE,SAAS,aAAa,SAAS,aAAa,SAAS,GAAG,YAA2C;AACvH,QAAM,EAAE,MAAA,IAAUA,6BAAA;AAClB,QAAM,EAAE,WAAW,OAAO,UAAA,IAAc;AACxC,QAAM,YAAY,GAAG,4FAA4F;AAAA,IAC7G,0BAA0B,SAAS,aAAa,SAAS,aAAa,CAAC;AAAA,IACvE,2BAA2B,SAAS;AAAA,IACpC,0BAA0B,SAAS;AAAA,IACnC,4BAA4B,SAAS;AAAA,IACrC,yBAAyB,SAAS;AAAA,EAAA,CACrC;AACD,QAAM,QAAQC,SAAAA,SAAS,WAAW,WAAW;AAC7C,QAAM,WAAWC,MAAAA,aAAA;AAEjB,MAAI,CAAC,SAAS;AAEV,YAAQ,KAAKC,iCAA4B,OAAO,CAAC;AAAA,EACrD;AAEA,QAAM,UAAU,MAAM;AAClB,QAAI,WAAW;AACX,YAAM,MAAA;AAAA,IACV;AAAA,EACJ,GAAG,CAAC,SAAS,CAAC;AAEd,QAAM,yBAAyB,YAAY;AACvC,UAAM,SAAS,MAAM,EAAE,OAAO,MAAM;AACpC,UAAM,SAAS,MAAM,EAAE,OAAO,GAAG;AAAA,EACrC;AAEA,QAAM,UAAU,MAAM;AAClB,QAAI,aAAa;AACb,6BAAA;AAEA,UAAI,MAAM,SAAS;AACf,cAAM,MAAA;AAAA,MACV;AAAA,IACJ;AAAA,EACJ,GAAG,CAAC,WAAW,CAAC;AAEhB,SACI,sBAAA;AAAA,IAACC,MAAAA,OAAO;AAAA,IAAP;AAAA,MACI,GAAG;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA,aAAU;AAAA,MACV,cAAc,MAAM;AAAA,MACpB,cAAc,MAAM;AAAA,IAAA;AAAA,IACnBC,KAAAA,aAAa,IAAI;AAAA,IAClB,sBAAA,cAAC,OAAA,EAAI,WAAU,YAAA,GAAa,OAA2B;AAAA,IACvD,sBAAA;AAAA,MAACC,WAAAA;AAAAA,MAAA;AAAA,QACG,YAAW;AAAA,QACX,WAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAY,MAAM,OAAO;AAAA,QACzB,SAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EACb;AAGZ;;"}
|
|
@@ -33,4 +33,4 @@ export type ToastProps = {
|
|
|
33
33
|
lastUpdated?: number;
|
|
34
34
|
lastDuplicateId?: string;
|
|
35
35
|
};
|
|
36
|
-
export declare const Toast: ({ content, lastUpdated, onClose: handleClose, options, ...props }: ToastProps) => JSX.Element;
|
|
36
|
+
export declare const Toast: ({ content, lastUpdated, onClose: handleClose, options, ...props }: ToastProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import cn from 'clsx';\nimport { motion, useAnimation } from 'motion/react';\nimport React from 'react';\n\nimport type { State } from '../../types';\nimport { useTimer } from '../../utils/hooks/useTimer';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { getBadgeIcon, getToastEmptyContentWarning } from './util';\n\nexport type ToastsTexts = {\n /** Aria-label for the close icon button of toast */\n dismiss: string;\n};\n\nexport type ToastType = Exclude<State, 'default'> | 'loading';\nexport type ToastOptions = {\n /** Provide time in milliseconds after which the toast should autoclose */\n autoClose?: number;\n /**\n * State will change the icon displayed in toast and other characteristics,\n * for e.g. `loading` state will display a progress animation.\n * Default value is `default`\n */\n type?: ToastType;\n};\nexport type ToastContent = Omit<React.ReactNode, 'null' | 'undefined'>;\nexport type ToastProps = {\n /** Provide a unique id for toast */\n id: string;\n /**\n * Content can be any valid react node, for e.g. a `div`, or a simple text.\n */\n content: ToastContent;\n /** Additional options to define your toast */\n options: ToastOptions;\n /**\n * Handler called when toast closes.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n onClose: () => void;\n lastUpdated?: number;\n lastDuplicateId?: string;\n};\n\nexport const Toast = ({ content, lastUpdated, onClose: handleClose, options, ...props }: ToastProps): JSX.Element => {\n const { texts } = useLocalization();\n const { autoClose, type = 'default' } = options;\n const className = cn('relative mt-3 flex w-full items-center rounded bg-white px-2 py-1 yt-shadow print:hidden', {\n 'border border-gray-500': type === 'default' || type === 'loading' || !type,\n 'border border-green-500': type === 'success',\n 'border border-blue-500': type === 'information',\n 'border border-yellow-500': type === 'warning',\n 'border border-red-500': type === 'error',\n });\n const timer = useTimer(autoClose, handleClose);\n const controls = useAnimation();\n\n if (!content) {\n // oxlint-disable-next-line no-console\n console.warn(getToastEmptyContentWarning(content));\n }\n\n React.useEffect(() => {\n if (autoClose) {\n timer.start();\n }\n }, [autoClose]);\n\n const triggerUpdateAnimation = async () => {\n await controls.start({ scale: 1.05 });\n await controls.start({ scale: 1 });\n };\n\n React.useEffect(() => {\n if (lastUpdated) {\n triggerUpdateAnimation();\n\n if (timer.running) {\n timer.start();\n }\n }\n }, [lastUpdated]);\n\n return (\n <motion.div\n {...props}\n animate={controls}\n className={className}\n data-taco=\"toast\"\n onMouseEnter={timer.pause}\n onMouseLeave={timer.resume}>\n {getBadgeIcon(type)}\n <div className=\"flex-grow\">{content as React.ReactNode}</div>\n <LegacyIconButton\n appearance=\"discrete\"\n className=\"-mr-2 cursor-pointer self-start !px-0 text-gray-700\"\n icon=\"close\"\n aria-label={texts.toasts.dismiss}\n onClick={handleClose}\n />\n </motion.div>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;AA8CO,MAAM,QAAQ,CAAC,EAAE,SAAS,aAAa,SAAS,aAAa,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"Toast.js","sources":["../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import cn from 'clsx';\nimport { motion, useAnimation } from 'motion/react';\nimport React from 'react';\n\nimport type { State } from '../../types';\nimport { useTimer } from '../../utils/hooks/useTimer';\nimport { LegacyIconButton } from '../LegacyComponents/IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nimport { getBadgeIcon, getToastEmptyContentWarning } from './util';\n\nexport type ToastsTexts = {\n /** Aria-label for the close icon button of toast */\n dismiss: string;\n};\n\nexport type ToastType = Exclude<State, 'default'> | 'loading';\nexport type ToastOptions = {\n /** Provide time in milliseconds after which the toast should autoclose */\n autoClose?: number;\n /**\n * State will change the icon displayed in toast and other characteristics,\n * for e.g. `loading` state will display a progress animation.\n * Default value is `default`\n */\n type?: ToastType;\n};\nexport type ToastContent = Omit<React.ReactNode, 'null' | 'undefined'>;\nexport type ToastProps = {\n /** Provide a unique id for toast */\n id: string;\n /**\n * Content can be any valid react node, for e.g. a `div`, or a simple text.\n */\n content: ToastContent;\n /** Additional options to define your toast */\n options: ToastOptions;\n /**\n * Handler called when toast closes.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n onClose: () => void;\n lastUpdated?: number;\n lastDuplicateId?: string;\n};\n\nexport const Toast = ({ content, lastUpdated, onClose: handleClose, options, ...props }: ToastProps): React.JSX.Element => {\n const { texts } = useLocalization();\n const { autoClose, type = 'default' } = options;\n const className = cn('relative mt-3 flex w-full items-center rounded bg-white px-2 py-1 yt-shadow print:hidden', {\n 'border border-gray-500': type === 'default' || type === 'loading' || !type,\n 'border border-green-500': type === 'success',\n 'border border-blue-500': type === 'information',\n 'border border-yellow-500': type === 'warning',\n 'border border-red-500': type === 'error',\n });\n const timer = useTimer(autoClose, handleClose);\n const controls = useAnimation();\n\n if (!content) {\n // oxlint-disable-next-line no-console\n console.warn(getToastEmptyContentWarning(content));\n }\n\n React.useEffect(() => {\n if (autoClose) {\n timer.start();\n }\n }, [autoClose]);\n\n const triggerUpdateAnimation = async () => {\n await controls.start({ scale: 1.05 });\n await controls.start({ scale: 1 });\n };\n\n React.useEffect(() => {\n if (lastUpdated) {\n triggerUpdateAnimation();\n\n if (timer.running) {\n timer.start();\n }\n }\n }, [lastUpdated]);\n\n return (\n <motion.div\n {...props}\n animate={controls}\n className={className}\n data-taco=\"toast\"\n onMouseEnter={timer.pause}\n onMouseLeave={timer.resume}>\n {getBadgeIcon(type)}\n <div className=\"flex-grow\">{content as React.ReactNode}</div>\n <LegacyIconButton\n appearance=\"discrete\"\n className=\"-mr-2 cursor-pointer self-start !px-0 text-gray-700\"\n icon=\"close\"\n aria-label={texts.toasts.dismiss}\n onClick={handleClose}\n />\n </motion.div>\n );\n};\n"],"names":["React"],"mappings":";;;;;;;AA8CO,MAAM,QAAQ,CAAC,EAAE,SAAS,aAAa,SAAS,aAAa,SAAS,GAAG,YAA2C;AACvH,QAAM,EAAE,MAAA,IAAU,gBAAA;AAClB,QAAM,EAAE,WAAW,OAAO,UAAA,IAAc;AACxC,QAAM,YAAY,GAAG,4FAA4F;AAAA,IAC7G,0BAA0B,SAAS,aAAa,SAAS,aAAa,CAAC;AAAA,IACvE,2BAA2B,SAAS;AAAA,IACpC,0BAA0B,SAAS;AAAA,IACnC,4BAA4B,SAAS;AAAA,IACrC,yBAAyB,SAAS;AAAA,EAAA,CACrC;AACD,QAAM,QAAQ,SAAS,WAAW,WAAW;AAC7C,QAAM,WAAW,aAAA;AAEjB,MAAI,CAAC,SAAS;AAEV,YAAQ,KAAK,4BAA4B,OAAO,CAAC;AAAA,EACrD;AAEAA,iBAAM,UAAU,MAAM;AAClB,QAAI,WAAW;AACX,YAAM,MAAA;AAAA,IACV;AAAA,EACJ,GAAG,CAAC,SAAS,CAAC;AAEd,QAAM,yBAAyB,YAAY;AACvC,UAAM,SAAS,MAAM,EAAE,OAAO,MAAM;AACpC,UAAM,SAAS,MAAM,EAAE,OAAO,GAAG;AAAA,EACrC;AAEAA,iBAAM,UAAU,MAAM;AAClB,QAAI,aAAa;AACb,6BAAA;AAEA,UAAI,MAAM,SAAS;AACf,cAAM,MAAA;AAAA,MACV;AAAA,IACJ;AAAA,EACJ,GAAG,CAAC,WAAW,CAAC;AAEhB,SACIA,+BAAA;AAAA,IAAC,OAAO;AAAA,IAAP;AAAA,MACI,GAAG;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MACA,aAAU;AAAA,MACV,cAAc,MAAM;AAAA,MACpB,cAAc,MAAM;AAAA,IAAA;AAAA,IACnB,aAAa,IAAI;AAAA,IAClBA,+BAAA,cAAC,OAAA,EAAI,WAAU,YAAA,GAAa,OAA2B;AAAA,IACvDA,+BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,YAAW;AAAA,QACX,WAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAY,MAAM,OAAO;AAAA,QACzB,SAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EACb;AAGZ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.cjs","sources":["../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ToastOptions, ToastProps, ToastContent } from './Toast';\nimport { Toast } from './Toast';\n\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: ToastContent | ((close: () => void) => ToastContent), options?: ToastOptions) => T;\n\nexport type Toaster<T> = {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n} & ToastCreator<T>;\n\nexport type ToastReference = {\n /** Show a success toast */\n success: ToastCreator<void>;\n /** Show an error toast */\n error: ToastCreator<void>;\n /** Show a warning toast */\n warning: ToastCreator<void>;\n /** Show an information toast */\n information: ToastCreator<void>;\n /** Show a loading toast */\n loading: ToastCreator<void>;\n /**\n * Close an existing toast.\n * The toast function returns a reference to the active toast,\n * allowing you to programmatically close it when needed\n */\n close: () => void;\n};\n\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\n\nexport type ToastProviderProps = {\n children: React.ReactNode;\n};\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: ToastContent,\n options: ToastOptions,\n close: () => void\n): InternalToast[] => {\n const nextToasts = [...currentToasts];\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\n\n if (existingToastIndex > -1 && nextToasts[existingToastIndex]) {\n nextToasts[existingToastIndex].lastDuplicateId = id;\n nextToasts[existingToastIndex].lastUpdated = Date.now();\n } else {\n nextToasts.push({\n id,\n content: typeof content === 'function' ? content(close) : content,\n options,\n });\n }\n\n return nextToasts;\n};\n\ntype PortalProps = React.ComponentPropsWithRef<'div'> & {\n container?: Element | DocumentFragment | null;\n};\n\nconst Portal = (props: PortalProps) => {\n const { children, container: containerProp, ...portalProps } = props;\n\n const [mounted, setMounted] = React.useState(false);\n React.useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n\n return container\n ? ReactDOM.createPortal(\n <div {...portalProps} data-taco=\"portal\">\n {children}\n </div>,\n container\n )\n : null;\n};\n\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): JSX.Element => {\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\n\n const handleClose = (id: string): void => {\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\n };\n\n // memoize (useCallback) this function,\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\n const toaster = React.useCallback((content: ToastContent, options: ToastOptions): ToastReference => {\n const id = nanoid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: ToastContent, options: ToastOptions): void => {\n setToasts(currentToasts => {\n const nextToasts = currentToasts.filter(toast => {\n if (toast.lastDuplicateId) {\n return toast.lastDuplicateId !== id;\n }\n\n return toast.id !== id;\n });\n return insertToastWithoutDuplicates(nextToasts, nanoid(), content, options, close);\n });\n };\n\n const success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'loading' });\n };\n\n return {\n success,\n error,\n warning,\n information,\n loading,\n close,\n };\n }, []) as Toaster<ToastReference>;\n\n // no need to rebind these every render, do them once in an effect\n React.useEffect(() => {\n toaster.success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <Portal>\n <div\n id=\"yt-toast__container\"\n className=\"absolute !left-auto bottom-0 right-0 z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end pointer-events-all\"\n role=\"log\">\n <AnimatePresence initial={false}>\n {toasts.map((toast: InternalToast) => (\n <motion.div\n key={toast.id}\n transition={{\n type: 'spring',\n damping: 20,\n stiffness: 300,\n }}\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}>\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["React","nanoid","content","options","AnimatePresence","motion","Toast"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Toaster.cjs","sources":["../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ToastOptions, ToastProps, ToastContent } from './Toast';\nimport { Toast } from './Toast';\n\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: ToastContent | ((close: () => void) => ToastContent), options?: ToastOptions) => T;\n\nexport type Toaster<T> = {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n} & ToastCreator<T>;\n\nexport type ToastReference = {\n /** Show a success toast */\n success: ToastCreator<void>;\n /** Show an error toast */\n error: ToastCreator<void>;\n /** Show a warning toast */\n warning: ToastCreator<void>;\n /** Show an information toast */\n information: ToastCreator<void>;\n /** Show a loading toast */\n loading: ToastCreator<void>;\n /**\n * Close an existing toast.\n * The toast function returns a reference to the active toast,\n * allowing you to programmatically close it when needed\n */\n close: () => void;\n};\n\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\n\nexport type ToastProviderProps = {\n children: React.ReactNode;\n};\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: ToastContent,\n options: ToastOptions,\n close: () => void\n): InternalToast[] => {\n const nextToasts = [...currentToasts];\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\n\n if (existingToastIndex > -1 && nextToasts[existingToastIndex]) {\n nextToasts[existingToastIndex].lastDuplicateId = id;\n nextToasts[existingToastIndex].lastUpdated = Date.now();\n } else {\n nextToasts.push({\n id,\n content: typeof content === 'function' ? content(close) : content,\n options,\n });\n }\n\n return nextToasts;\n};\n\ntype PortalProps = React.ComponentPropsWithRef<'div'> & {\n container?: Element | DocumentFragment | null;\n};\n\nconst Portal = (props: PortalProps) => {\n const { children, container: containerProp, ...portalProps } = props;\n\n const [mounted, setMounted] = React.useState(false);\n React.useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n\n return container\n ? ReactDOM.createPortal(\n <div {...portalProps} data-taco=\"portal\">\n {children}\n </div>,\n container\n )\n : null;\n};\n\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): React.JSX.Element => {\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\n\n const handleClose = (id: string): void => {\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\n };\n\n // memoize (useCallback) this function,\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\n const toaster = React.useCallback((content: ToastContent, options: ToastOptions): ToastReference => {\n const id = nanoid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: ToastContent, options: ToastOptions): void => {\n setToasts(currentToasts => {\n const nextToasts = currentToasts.filter(toast => {\n if (toast.lastDuplicateId) {\n return toast.lastDuplicateId !== id;\n }\n\n return toast.id !== id;\n });\n return insertToastWithoutDuplicates(nextToasts, nanoid(), content, options, close);\n });\n };\n\n const success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'loading' });\n };\n\n return {\n success,\n error,\n warning,\n information,\n loading,\n close,\n };\n }, []) as Toaster<ToastReference>;\n\n // no need to rebind these every render, do them once in an effect\n React.useEffect(() => {\n toaster.success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <Portal>\n <div\n id=\"yt-toast__container\"\n className=\"absolute !left-auto bottom-0 right-0 z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end pointer-events-all\"\n role=\"log\">\n <AnimatePresence initial={false}>\n {toasts.map((toast: InternalToast) => (\n <motion.div\n key={toast.id}\n transition={{\n type: 'spring',\n damping: 20,\n stiffness: 300,\n }}\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}>\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["React","nanoid","content","options","AnimatePresence","motion","Toast"],"mappings":"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"}
|
|
@@ -29,6 +29,6 @@ export type ToastReference = {
|
|
|
29
29
|
export type ToastProviderProps = {
|
|
30
30
|
children: React.ReactNode;
|
|
31
31
|
};
|
|
32
|
-
export declare const ToastProvider: ({ children, ...props }: ToastProviderProps) => JSX.Element;
|
|
32
|
+
export declare const ToastProvider: ({ children, ...props }: ToastProviderProps) => React.JSX.Element;
|
|
33
33
|
export declare const useToast: () => Toaster<ToastReference>;
|
|
34
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","sources":["../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ToastOptions, ToastProps, ToastContent } from './Toast';\nimport { Toast } from './Toast';\n\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: ToastContent | ((close: () => void) => ToastContent), options?: ToastOptions) => T;\n\nexport type Toaster<T> = {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n} & ToastCreator<T>;\n\nexport type ToastReference = {\n /** Show a success toast */\n success: ToastCreator<void>;\n /** Show an error toast */\n error: ToastCreator<void>;\n /** Show a warning toast */\n warning: ToastCreator<void>;\n /** Show an information toast */\n information: ToastCreator<void>;\n /** Show a loading toast */\n loading: ToastCreator<void>;\n /**\n * Close an existing toast.\n * The toast function returns a reference to the active toast,\n * allowing you to programmatically close it when needed\n */\n close: () => void;\n};\n\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\n\nexport type ToastProviderProps = {\n children: React.ReactNode;\n};\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: ToastContent,\n options: ToastOptions,\n close: () => void\n): InternalToast[] => {\n const nextToasts = [...currentToasts];\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\n\n if (existingToastIndex > -1 && nextToasts[existingToastIndex]) {\n nextToasts[existingToastIndex].lastDuplicateId = id;\n nextToasts[existingToastIndex].lastUpdated = Date.now();\n } else {\n nextToasts.push({\n id,\n content: typeof content === 'function' ? content(close) : content,\n options,\n });\n }\n\n return nextToasts;\n};\n\ntype PortalProps = React.ComponentPropsWithRef<'div'> & {\n container?: Element | DocumentFragment | null;\n};\n\nconst Portal = (props: PortalProps) => {\n const { children, container: containerProp, ...portalProps } = props;\n\n const [mounted, setMounted] = React.useState(false);\n React.useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n\n return container\n ? ReactDOM.createPortal(\n <div {...portalProps} data-taco=\"portal\">\n {children}\n </div>,\n container\n )\n : null;\n};\n\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): JSX.Element => {\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\n\n const handleClose = (id: string): void => {\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\n };\n\n // memoize (useCallback) this function,\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\n const toaster = React.useCallback((content: ToastContent, options: ToastOptions): ToastReference => {\n const id = nanoid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: ToastContent, options: ToastOptions): void => {\n setToasts(currentToasts => {\n const nextToasts = currentToasts.filter(toast => {\n if (toast.lastDuplicateId) {\n return toast.lastDuplicateId !== id;\n }\n\n return toast.id !== id;\n });\n return insertToastWithoutDuplicates(nextToasts, nanoid(), content, options, close);\n });\n };\n\n const success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'loading' });\n };\n\n return {\n success,\n error,\n warning,\n information,\n loading,\n close,\n };\n }, []) as Toaster<ToastReference>;\n\n // no need to rebind these every render, do them once in an effect\n React.useEffect(() => {\n toaster.success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <Portal>\n <div\n id=\"yt-toast__container\"\n className=\"absolute !left-auto bottom-0 right-0 z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end pointer-events-all\"\n role=\"log\">\n <AnimatePresence initial={false}>\n {toasts.map((toast: InternalToast) => (\n <motion.div\n key={toast.id}\n transition={{\n type: 'spring',\n damping: 20,\n stiffness: 300,\n }}\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}>\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["content","options"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Toaster.js","sources":["../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import { AnimatePresence, motion } from 'motion/react';\nimport { nanoid } from 'nanoid';\nimport * as React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ToastOptions, ToastProps, ToastContent } from './Toast';\nimport { Toast } from './Toast';\n\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: ToastContent | ((close: () => void) => ToastContent), options?: ToastOptions) => T;\n\nexport type Toaster<T> = {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n} & ToastCreator<T>;\n\nexport type ToastReference = {\n /** Show a success toast */\n success: ToastCreator<void>;\n /** Show an error toast */\n error: ToastCreator<void>;\n /** Show a warning toast */\n warning: ToastCreator<void>;\n /** Show an information toast */\n information: ToastCreator<void>;\n /** Show a loading toast */\n loading: ToastCreator<void>;\n /**\n * Close an existing toast.\n * The toast function returns a reference to the active toast,\n * allowing you to programmatically close it when needed\n */\n close: () => void;\n};\n\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\n\nexport type ToastProviderProps = {\n children: React.ReactNode;\n};\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: ToastContent,\n options: ToastOptions,\n close: () => void\n): InternalToast[] => {\n const nextToasts = [...currentToasts];\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\n\n if (existingToastIndex > -1 && nextToasts[existingToastIndex]) {\n nextToasts[existingToastIndex].lastDuplicateId = id;\n nextToasts[existingToastIndex].lastUpdated = Date.now();\n } else {\n nextToasts.push({\n id,\n content: typeof content === 'function' ? content(close) : content,\n options,\n });\n }\n\n return nextToasts;\n};\n\ntype PortalProps = React.ComponentPropsWithRef<'div'> & {\n container?: Element | DocumentFragment | null;\n};\n\nconst Portal = (props: PortalProps) => {\n const { children, container: containerProp, ...portalProps } = props;\n\n const [mounted, setMounted] = React.useState(false);\n React.useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || (mounted && globalThis?.document?.body);\n\n return container\n ? ReactDOM.createPortal(\n <div {...portalProps} data-taco=\"portal\">\n {children}\n </div>,\n container\n )\n : null;\n};\n\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): React.JSX.Element => {\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\n\n const handleClose = (id: string): void => {\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\n };\n\n // memoize (useCallback) this function,\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\n const toaster = React.useCallback((content: ToastContent, options: ToastOptions): ToastReference => {\n const id = nanoid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: ToastContent, options: ToastOptions): void => {\n setToasts(currentToasts => {\n const nextToasts = currentToasts.filter(toast => {\n if (toast.lastDuplicateId) {\n return toast.lastDuplicateId !== id;\n }\n\n return toast.id !== id;\n });\n return insertToastWithoutDuplicates(nextToasts, nanoid(), content, options, close);\n });\n };\n\n const success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'loading' });\n };\n\n return {\n success,\n error,\n warning,\n information,\n loading,\n close,\n };\n }, []) as Toaster<ToastReference>;\n\n // no need to rebind these every render, do them once in an effect\n React.useEffect(() => {\n toaster.success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <Portal>\n <div\n id=\"yt-toast__container\"\n className=\"absolute !left-auto bottom-0 right-0 z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end pointer-events-all\"\n role=\"log\">\n <AnimatePresence initial={false}>\n {toasts.map((toast: InternalToast) => (\n <motion.div\n key={toast.id}\n transition={{\n type: 'spring',\n damping: 20,\n stiffness: 300,\n }}\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}>\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["content","options"],"mappings":";;;;;;AAUA,MAAM,6BAA6B;AA+BnC,MAAM,eAAe,MAAM,cAAuC,EAA6B;AAQ/F,MAAM,+BAA+B,CACjC,eACA,IACA,SACA,SACA,UACkB;AAClB,QAAM,aAAa,CAAC,GAAG,aAAa;AACpC,QAAM,qBAAqB,cAAc,UAAU,CAAA,UAAS,KAAK,UAAU,MAAM,OAAO,MAAM,KAAK,UAAU,OAAO,CAAC;AAErH,MAAI,qBAAqB,MAAM,WAAW,kBAAkB,GAAG;AAC3D,eAAW,kBAAkB,EAAE,kBAAkB;AACjD,eAAW,kBAAkB,EAAE,cAAc,KAAK,IAAA;AAAA,EACtD,OAAO;AACH,eAAW,KAAK;AAAA,MACZ;AAAA,MACA,SAAS,OAAO,YAAY,aAAa,QAAQ,KAAK,IAAI;AAAA,MAC1D;AAAA,IAAA,CACH;AAAA,EACL;AAEA,SAAO;AACX;AAMA,MAAM,SAAS,CAAC,UAAuB;AACnC,QAAM,EAAE,UAAU,WAAW,eAAe,GAAG,gBAAgB;AAE/D,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAClD,QAAM,gBAAgB,MAAM,WAAW,IAAI,GAAG,CAAA,CAAE;AAChD,QAAM,YAAY,iBAAkB,WAAW,YAAY,UAAU;AAErE,SAAO,YACD,SAAS;AAAA,wCACJ,OAAA,EAAK,GAAG,aAAa,aAAU,YAC3B,QACL;AAAA,IACA;AAAA,EAAA,IAEJ;AACV;AAEO,MAAM,gBAAgB,CAAC,EAAE,UAAU,GAAG,YAAmD;AAC5F,QAAM,CAAC,QAAQ,SAAS,IAAI,MAAM,SAA0B,CAAA,CAAE;AAE9D,QAAM,cAAc,CAAC,OAAqB;AACtC,cAAU,mBAAiB,cAAc,OAAO,WAAS,MAAM,OAAO,EAAE,CAAC;AAAA,EAC7E;AAIA,QAAM,UAAU,MAAM,YAAY,CAAC,SAAuB,YAA0C;AAChG,UAAM,KAAK,OAAA;AACX,UAAM,QAAQ,MAAY,YAAY,EAAE;AAExC,cAAU,mBAAiB,6BAA6B,eAAe,IAAI,SAAS,SAAS,KAAK,CAAC;AAEnG,UAAM,SAAS,CAACA,UAAuBC,aAAgC;AACnE,gBAAU,CAAA,kBAAiB;AACvB,cAAM,aAAa,cAAc,OAAO,CAAA,UAAS;AAC7C,cAAI,MAAM,iBAAiB;AACvB,mBAAO,MAAM,oBAAoB;AAAA,UACrC;AAEA,iBAAO,MAAM,OAAO;AAAA,QACxB,CAAC;AACD,eAAO,6BAA6B,YAAY,OAAA,GAAUD,UAASC,UAAS,KAAK;AAAA,MACrF,CAAC;AAAA,IACL;AAEA,UAAM,UAAU,CAACD,UAAuBC,aAA+C;AACnF,aAAOD,UAAS,EAAE,WAAW,4BAA4B,GAAGC,UAAS,MAAM,WAAW;AAAA,IAC1F;AACA,UAAM,QAAQ,CAACD,UAAuBC,aAA+C;AACjF,aAAOD,UAAS,EAAE,GAAGC,UAAS,MAAM,SAAS;AAAA,IACjD;AACA,UAAM,UAAU,CAACD,UAAuBC,aAA+C;AACnF,aAAOD,UAAS,EAAE,GAAGC,UAAS,MAAM,WAAW;AAAA,IACnD;AACA,UAAM,cAAc,CAACD,UAAuBC,aAA+C;AACvF,aAAOD,UAAS,EAAE,GAAGC,UAAS,MAAM,eAAe;AAAA,IACvD;AACA,UAAM,UAAU,CAACD,UAAuBC,aAA+C;AACnF,aAAOD,UAAS,EAAE,GAAGC,UAAS,MAAM,WAAW;AAAA,IACnD;AAEA,WAAO;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAER,GAAG,CAAA,CAAE;AAGL,QAAM,UAAU,MAAM;AAClB,YAAQ,UAAU,CAAC,SAAuB,YACtC,QAAQ,SAAS,EAAE,WAAW,4BAA4B,GAAG,SAAS,MAAM,WAAW;AAC3F,YAAQ,QAAQ,CAAC,SAAuB,YACpC,QAAQ,SAAS,EAAE,GAAG,SAAS,MAAM,QAAA,CAAS;AAClD,YAAQ,UAAU,CAAC,SAAuB,YACtC,QAAQ,SAAS,EAAE,GAAG,SAAS,MAAM,UAAA,CAAW;AACpD,YAAQ,cAAc,CAAC,SAAuB,YAC1C,QAAQ,SAAS,EAAE,GAAG,SAAS,MAAM,cAAA,CAAe;AACxD,YAAQ,UAAU,CAAC,SAAuB,YACtC,QAAQ,SAAS,EAAE,GAAG,SAAS,MAAM,UAAA,CAAW;AAAA,EACxD,GAAG,CAAA,CAAE;AAEL,SACI,sBAAA,cAAC,aAAa,UAAb,EAAuB,GAAG,OAAO,OAAO,QAAA,GACpC,UACD,sBAAA,cAAC,QAAA,MACG,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,IAAG;AAAA,MACH,WAAU;AAAA,MACV,MAAK;AAAA,IAAA;AAAA,wCACJ,iBAAA,EAAgB,SAAS,SACrB,OAAO,IAAI,CAAC,UACT,sBAAA;AAAA,MAAC,OAAO;AAAA,MAAP;AAAA,QACG,KAAK,MAAM;AAAA,QACX,YAAY;AAAA,UACR,MAAM;AAAA,UACN,SAAS;AAAA,UACT,WAAW;AAAA,QAAA;AAAA,QAEf,SAAS,EAAE,SAAS,GAAG,GAAG,IAAI,OAAO,IAAA;AAAA,QACrC,SAAS,EAAE,SAAS,GAAG,GAAG,GAAG,OAAO,EAAA;AAAA,QACpC,MAAM,EAAE,SAAS,GAAG,OAAO,KAAK,YAAY,EAAE,UAAU,IAAA,EAAI;AAAA,MAAE;AAAA,MAC9D,sBAAA,cAAC,SAAO,GAAG,OAAO,SAAS,MAAM,YAAY,MAAM,EAAE,EAAA,CAAG;AAAA,IAAA,CAE/D,CACL;AAAA,EAAA,CAER,CACJ;AAER;AAEO,MAAM,WAAW,MAA+B,MAAM,WAAW,YAAY;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.cjs","sources":["../../../src/components/Toast/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\nimport { Spinner } from '../Spinner/Spinner';\n\nimport type { ToastContent, ToastType } from './Toast';\n\nexport const getBadgeIcon = (type: ToastType | 'default'): 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=\"mr-2 mt-[5px] flex-shrink-0 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 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n case 'loading':\n return <Spinner delay={0} className=\"h-5 w-5\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n\nexport const getToastEmptyContentWarning = (content?: ToastContent) =>\n `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${\n content === '' ? 'empty string' : content\n }.`;\n"],"names":["BadgeIcon","Spinner"],"mappings":";;;;;AAOO,MAAM,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"util.cjs","sources":["../../../src/components/Toast/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\nimport { Spinner } from '../Spinner/Spinner';\n\nimport type { ToastContent, ToastType } from './Toast';\n\nexport const getBadgeIcon = (type: ToastType | 'default'): 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=\"mr-2 mt-[5px] flex-shrink-0 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 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n case 'loading':\n return <Spinner delay={0} className=\"h-5 w-5\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n\nexport const getToastEmptyContentWarning = (content?: ToastContent) =>\n `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${\n content === '' ? 'empty string' : content\n }.`;\n"],"names":["BadgeIcon","Spinner"],"mappings":";;;;;AAOO,MAAM,eAAe,CAAC,SAA0D;AACnF;AAAA;AAAA,IAEI,sBAAA,cAAC,OAAA,EAAI,WAAU,yCAAA,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,WAAU,OAAM,UAAS;AAAA,QACpD,KAAK;AACD,iBAAO,sBAAA,cAACA,qBAAA,EAAU,MAAK,QAAO,OAAM,QAAO;AAAA,QAC/C,KAAK;AACD,iBAAO,sBAAA,cAACC,iBAAA,EAAQ,OAAO,GAAG,WAAU,WAAU;AAAA,QAClD;AACI,iBAAO;AAAA,MAAA;AAAA,IAEnB,IACJ;AAAA;AAER;AAEO,MAAM,8BAA8B,CAAC,YACxC,sHACI,YAAY,KAAK,iBAAiB,OACtC;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { ToastContent, ToastType } from './Toast';
|
|
2
|
-
export declare const getBadgeIcon: (type: ToastType | "default") => JSX.Element | null;
|
|
3
|
+
export declare const getBadgeIcon: (type: ToastType | "default") => React.JSX.Element | null;
|
|
3
4
|
export declare const getToastEmptyContentWarning: (content?: ToastContent) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../src/components/Toast/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\nimport { Spinner } from '../Spinner/Spinner';\n\nimport type { ToastContent, ToastType } from './Toast';\n\nexport const getBadgeIcon = (type: ToastType | 'default'): 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=\"mr-2 mt-[5px] flex-shrink-0 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 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n case 'loading':\n return <Spinner delay={0} className=\"h-5 w-5\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n\nexport const getToastEmptyContentWarning = (content?: ToastContent) =>\n `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${\n content === '' ? 'empty string' : content\n }.`;\n"],"names":["React"],"mappings":";;;AAOO,MAAM,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../src/components/Toast/util.tsx"],"sourcesContent":["import React from 'react';\n\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\nimport { Spinner } from '../Spinner/Spinner';\n\nimport type { ToastContent, ToastType } from './Toast';\n\nexport const getBadgeIcon = (type: ToastType | 'default'): 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=\"mr-2 mt-[5px] flex-shrink-0 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 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n case 'loading':\n return <Spinner delay={0} className=\"h-5 w-5\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n\nexport const getToastEmptyContentWarning = (content?: ToastContent) =>\n `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${\n content === '' ? 'empty string' : content\n }.`;\n"],"names":["React"],"mappings":";;;AAOO,MAAM,eAAe,CAAC,SAA0D;AACnF;AAAA;AAAA,IAEIA,+BAAA,cAAC,OAAA,EAAI,WAAU,yCAAA,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,WAAU,OAAM,UAAS;AAAA,QACpD,KAAK;AACD,iBAAOA,+BAAA,cAAC,WAAA,EAAU,MAAK,QAAO,OAAM,QAAO;AAAA,QAC/C,KAAK;AACD,iBAAOA,+BAAA,cAAC,SAAA,EAAQ,OAAO,GAAG,WAAU,WAAU;AAAA,QAClD;AACI,iBAAO;AAAA,MAAA;AAAA,IAEnB,IACJ;AAAA;AAER;AAEO,MAAM,8BAA8B,CAAC,YACxC,sHACI,YAAY,KAAK,iBAAiB,OACtC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'children'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement<{ id?: string }>;\n\n /** Use this value to hide tooltip conditionally */\n hide?: boolean;\n /** Text displayed in the tooltip */\n title: string | JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, hide = false, ...otherProps } = props;\n const className = cn('break-words', otherProps.className);\n\n if (hide) {\n return children;\n }\n\n return (\n <TooltipPrimitive.Root>\n {/* the trigger id must match the rendered element's id attribute - base-ui registers the trigger\n under its own id, but an id on `children` overrides it on the DOM node, and base-ui@1.6 then\n treats the open tooltip's trigger as unmounted and immediately closes it */}\n <TooltipPrimitive.Trigger delay={250} id={children.props.id} ref={ref as any} render={children} />\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Positioner side={placement} sideOffset={8}>\n <TooltipPrimitive.Popup\n {...otherProps}\n className={cn(\n 'max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded bg-gray-900 px-2 py-1 text-xs text-white xs:max-w-[theme(spacing.56)] print:hidden',\n className\n )}\n data-taco=\"tooltip\">\n <TooltipPrimitive.Arrow className=\"data-[side=bottom]:top-[-5px] data-[side=left]:right-[-10px] data-[side=right]:left-[-10px] data-[side=top]:bottom-[-5px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-gray-900\"\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className=\"fill-gray-900\"\n />\n <path\n className=\"fill-gray-900\"\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n />\n </svg>\n </TooltipPrimitive.Arrow>\n {title}\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["React","Tooltip","TooltipPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,UAAUA,iBAAM,WAAW,SAASC,SAAQ,OAAqB,KAA6B;AACvG,QAAM,EAAE,OAAO,UAAU,WAAW,OAAO,OAAO,GAAG,eAAe;AACpE,QAAM,YAAY,GAAG,eAAe,WAAW,SAAS;AAExD,MAAI,MAAM;AACN,WAAO;AAAA,EACX;AAEA,SACID,iCAAA,cAACE,QAAAA,QAAiB,MAAjB,MAIGF,iCAAA,cAACE,QAAAA,QAAiB,SAAjB,EAAyB,OAAO,KAAK,IAAI,SAAS,MAAM,IAAI,KAAiB,QAAQ,SAAA,CAAU,GAChGF,iCAAA,cAACE,QAAAA,QAAiB,QAAjB,MACGF,iCAAA,cAACE,QAAAA,QAAiB,YAAjB,EAA4B,MAAM,WAAW,YAAY,EAAA,GACtDF,iCAAA;AAAA,IAACE,QAAAA,QAAiB;AAAA,IAAjB;AAAA,MACI,GAAG;AAAA,MACJ,WAAW;AAAA,QACP;AAAA,QACA;AAAA,MAAA;AAAA,MAEJ,aAAU;AAAA,IAAA;AAAA,IACVF,iCAAA,cAACE,QAAAA,QAAiB,OAAjB,EAAuB,WAAU,+MAAA,GAC9BF,iCAAA,cAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,YAAA,GAChCA,iCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEdA,iCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEdA,iCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,GAAE;AAAA,MAAA;AAAA,IAAA,CAEV,CACJ;AAAA,IACC;AAAA,EAAA,CAET,CACJ,CACJ;AAER,CAAC;;"}
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'children'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement<{ id?: string }>;\n\n /** Use this value to hide tooltip conditionally */\n hide?: boolean;\n /** Text displayed in the tooltip */\n title: string | React.JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, hide = false, ...otherProps } = props;\n const className = cn('break-words', otherProps.className);\n\n if (hide) {\n return children;\n }\n\n return (\n <TooltipPrimitive.Root>\n {/* the trigger id must match the rendered element's id attribute - base-ui registers the trigger\n under its own id, but an id on `children` overrides it on the DOM node, and base-ui@1.6 then\n treats the open tooltip's trigger as unmounted and immediately closes it */}\n <TooltipPrimitive.Trigger delay={250} id={children.props.id} ref={ref as any} render={children} />\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Positioner side={placement} sideOffset={8}>\n <TooltipPrimitive.Popup\n {...otherProps}\n className={cn(\n 'max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded bg-gray-900 px-2 py-1 text-xs text-white xs:max-w-[theme(spacing.56)] print:hidden',\n className\n )}\n data-taco=\"tooltip\">\n <TooltipPrimitive.Arrow className=\"data-[side=bottom]:top-[-5px] data-[side=left]:right-[-10px] data-[side=right]:left-[-10px] data-[side=top]:bottom-[-5px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-gray-900\"\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className=\"fill-gray-900\"\n />\n <path\n className=\"fill-gray-900\"\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n />\n </svg>\n </TooltipPrimitive.Arrow>\n {title}\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["React","Tooltip","TooltipPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAM,UAAUA,iBAAM,WAAW,SAASC,SAAQ,OAAqB,KAA6B;AACvG,QAAM,EAAE,OAAO,UAAU,WAAW,OAAO,OAAO,GAAG,eAAe;AACpE,QAAM,YAAY,GAAG,eAAe,WAAW,SAAS;AAExD,MAAI,MAAM;AACN,WAAO;AAAA,EACX;AAEA,SACID,iCAAA,cAACE,QAAAA,QAAiB,MAAjB,MAIGF,iCAAA,cAACE,QAAAA,QAAiB,SAAjB,EAAyB,OAAO,KAAK,IAAI,SAAS,MAAM,IAAI,KAAiB,QAAQ,SAAA,CAAU,GAChGF,iCAAA,cAACE,QAAAA,QAAiB,QAAjB,MACGF,iCAAA,cAACE,QAAAA,QAAiB,YAAjB,EAA4B,MAAM,WAAW,YAAY,EAAA,GACtDF,iCAAA;AAAA,IAACE,QAAAA,QAAiB;AAAA,IAAjB;AAAA,MACI,GAAG;AAAA,MACJ,WAAW;AAAA,QACP;AAAA,QACA;AAAA,MAAA;AAAA,MAEJ,aAAU;AAAA,IAAA;AAAA,IACVF,iCAAA,cAACE,QAAAA,QAAiB,OAAjB,EAAuB,WAAU,+MAAA,GAC9BF,iCAAA,cAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,YAAA,GAChCA,iCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEdA,iCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEdA,iCAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,GAAE;AAAA,MAAA;AAAA,IAAA,CAEV,CACJ;AAAA,IACC;AAAA,EAAA,CAET,CACJ,CACJ;AAER,CAAC;;"}
|
|
@@ -7,7 +7,7 @@ export type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' |
|
|
|
7
7
|
/** Use this value to hide tooltip conditionally */
|
|
8
8
|
hide?: boolean;
|
|
9
9
|
/** Text displayed in the tooltip */
|
|
10
|
-
title: string | JSX.Element;
|
|
10
|
+
title: string | React.JSX.Element;
|
|
11
11
|
/**
|
|
12
12
|
* Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs
|
|
13
13
|
* @defaultValue bottom
|
|
@@ -22,7 +22,7 @@ export declare const Tooltip: React.ForwardRefExoticComponent<Omit<React.HTMLAtt
|
|
|
22
22
|
/** Use this value to hide tooltip conditionally */
|
|
23
23
|
hide?: boolean;
|
|
24
24
|
/** Text displayed in the tooltip */
|
|
25
|
-
title: string | JSX.Element;
|
|
25
|
+
title: string | React.JSX.Element;
|
|
26
26
|
/**
|
|
27
27
|
* Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs
|
|
28
28
|
* @defaultValue bottom
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'children'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement<{ id?: string }>;\n\n /** Use this value to hide tooltip conditionally */\n hide?: boolean;\n /** Text displayed in the tooltip */\n title: string | JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, hide = false, ...otherProps } = props;\n const className = cn('break-words', otherProps.className);\n\n if (hide) {\n return children;\n }\n\n return (\n <TooltipPrimitive.Root>\n {/* the trigger id must match the rendered element's id attribute - base-ui registers the trigger\n under its own id, but an id on `children` overrides it on the DOM node, and base-ui@1.6 then\n treats the open tooltip's trigger as unmounted and immediately closes it */}\n <TooltipPrimitive.Trigger delay={250} id={children.props.id} ref={ref as any} render={children} />\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Positioner side={placement} sideOffset={8}>\n <TooltipPrimitive.Popup\n {...otherProps}\n className={cn(\n 'max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded bg-gray-900 px-2 py-1 text-xs text-white xs:max-w-[theme(spacing.56)] print:hidden',\n className\n )}\n data-taco=\"tooltip\">\n <TooltipPrimitive.Arrow className=\"data-[side=bottom]:top-[-5px] data-[side=left]:right-[-10px] data-[side=right]:left-[-10px] data-[side=top]:bottom-[-5px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-gray-900\"\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className=\"fill-gray-900\"\n />\n <path\n className=\"fill-gray-900\"\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n />\n </svg>\n </TooltipPrimitive.Arrow>\n {title}\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["Tooltip","TooltipPrimitive"],"mappings":";;;AAmBO,MAAM,UAAU,MAAM,WAAW,SAASA,SAAQ,OAAqB,KAA6B;AACvG,QAAM,EAAE,OAAO,UAAU,WAAW,OAAO,OAAO,GAAG,eAAe;AACpE,QAAM,YAAY,GAAG,eAAe,WAAW,SAAS;AAExD,MAAI,MAAM;AACN,WAAO;AAAA,EACX;AAEA,SACI,sBAAA,cAACC,UAAiB,MAAjB,MAIG,sBAAA,cAACA,UAAiB,SAAjB,EAAyB,OAAO,KAAK,IAAI,SAAS,MAAM,IAAI,KAAiB,QAAQ,SAAA,CAAU,GAChG,sBAAA,cAACA,UAAiB,QAAjB,MACG,sBAAA,cAACA,UAAiB,YAAjB,EAA4B,MAAM,WAAW,YAAY,EAAA,GACtD,sBAAA;AAAA,IAACA,UAAiB;AAAA,IAAjB;AAAA,MACI,GAAG;AAAA,MACJ,WAAW;AAAA,QACP;AAAA,QACA;AAAA,MAAA;AAAA,MAEJ,aAAU;AAAA,IAAA;AAAA,IACV,sBAAA,cAACA,UAAiB,OAAjB,EAAuB,WAAU,+MAAA,GAC9B,sBAAA,cAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,YAAA,GAChC,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEd,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEd,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,GAAE;AAAA,MAAA;AAAA,IAAA,CAEV,CACJ;AAAA,IACC;AAAA,EAAA,CAET,CACJ,CACJ;AAER,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\nimport cn from 'clsx';\nimport * as React from 'react';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'children'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement<{ id?: string }>;\n\n /** Use this value to hide tooltip conditionally */\n hide?: boolean;\n /** Text displayed in the tooltip */\n title: string | React.JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, hide = false, ...otherProps } = props;\n const className = cn('break-words', otherProps.className);\n\n if (hide) {\n return children;\n }\n\n return (\n <TooltipPrimitive.Root>\n {/* the trigger id must match the rendered element's id attribute - base-ui registers the trigger\n under its own id, but an id on `children` overrides it on the DOM node, and base-ui@1.6 then\n treats the open tooltip's trigger as unmounted and immediately closes it */}\n <TooltipPrimitive.Trigger delay={250} id={children.props.id} ref={ref as any} render={children} />\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Positioner side={placement} sideOffset={8}>\n <TooltipPrimitive.Popup\n {...otherProps}\n className={cn(\n 'max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded bg-gray-900 px-2 py-1 text-xs text-white xs:max-w-[theme(spacing.56)] print:hidden',\n className\n )}\n data-taco=\"tooltip\">\n <TooltipPrimitive.Arrow className=\"data-[side=bottom]:top-[-5px] data-[side=left]:right-[-10px] data-[side=right]:left-[-10px] data-[side=top]:bottom-[-5px] data-[side=left]:rotate-90 data-[side=right]:-rotate-90 data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-gray-900\"\n />\n <path\n d=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n className=\"fill-gray-900\"\n />\n <path\n className=\"fill-gray-900\"\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n />\n </svg>\n </TooltipPrimitive.Arrow>\n {title}\n </TooltipPrimitive.Popup>\n </TooltipPrimitive.Positioner>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["Tooltip","TooltipPrimitive"],"mappings":";;;AAmBO,MAAM,UAAU,MAAM,WAAW,SAASA,SAAQ,OAAqB,KAA6B;AACvG,QAAM,EAAE,OAAO,UAAU,WAAW,OAAO,OAAO,GAAG,eAAe;AACpE,QAAM,YAAY,GAAG,eAAe,WAAW,SAAS;AAExD,MAAI,MAAM;AACN,WAAO;AAAA,EACX;AAEA,SACI,sBAAA,cAACC,UAAiB,MAAjB,MAIG,sBAAA,cAACA,UAAiB,SAAjB,EAAyB,OAAO,KAAK,IAAI,SAAS,MAAM,IAAI,KAAiB,QAAQ,SAAA,CAAU,GAChG,sBAAA,cAACA,UAAiB,QAAjB,MACG,sBAAA,cAACA,UAAiB,YAAjB,EAA4B,MAAM,WAAW,YAAY,EAAA,GACtD,sBAAA;AAAA,IAACA,UAAiB;AAAA,IAAjB;AAAA,MACI,GAAG;AAAA,MACJ,WAAW;AAAA,QACP;AAAA,QACA;AAAA,MAAA;AAAA,MAEJ,aAAU;AAAA,IAAA;AAAA,IACV,sBAAA,cAACA,UAAiB,OAAjB,EAAuB,WAAU,+MAAA,GAC9B,sBAAA,cAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,YAAA,GAChC,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEd,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,GAAE;AAAA,QACF,WAAU;AAAA,MAAA;AAAA,IAAA,GAEd,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,GAAE;AAAA,MAAA;AAAA,IAAA,CAEV,CACJ;AAAA,IACC;AAAA,EAAA,CAET,CACJ,CACJ;AAER,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncate.cjs","sources":["../../../src/components/Truncate/Truncate.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\n\nimport { useTruncated } from '../../utils/hooks/useTruncated';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type TruncateProps = {\n children: React.ReactElement
|
|
1
|
+
{"version":3,"file":"Truncate.cjs","sources":["../../../src/components/Truncate/Truncate.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\n\nimport { useTruncated } from '../../utils/hooks/useTruncated';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type TruncateProps = {\n children: React.ReactElement<{ className?: string; id?: string } & React.RefAttributes<HTMLElement>>;\n tooltip: string | React.JSX.Element;\n};\n\nexport const Truncate = ({ children, tooltip }: TruncateProps) => {\n const ref = React.useRef<HTMLElement>(null);\n const [mounted, setMounted] = React.useState(false);\n const { isTruncated } = useTruncated(ref.current, [mounted]);\n\n React.useEffect(() => {\n setMounted(true);\n\n return () => setMounted(false);\n }, []);\n\n const clonedChildrenWithRef = React.cloneElement(React.Children.only(children), {\n ref,\n className: cn(children.props.className, 'truncate', { 'hover:cursor-pointer': isTruncated }),\n });\n\n if (isTruncated) {\n return <Tooltip title={tooltip}>{clonedChildrenWithRef}</Tooltip>;\n }\n\n return clonedChildrenWithRef;\n};\n"],"names":["useTruncated","Tooltip"],"mappings":";;;;;;AAWO,MAAM,WAAW,CAAC,EAAE,UAAU,cAA6B;AAC9D,QAAM,MAAM,MAAM,OAAoB,IAAI;AAC1C,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAClD,QAAM,EAAE,gBAAgBA,aAAAA,aAAa,IAAI,SAAS,CAAC,OAAO,CAAC;AAE3D,QAAM,UAAU,MAAM;AAClB,eAAW,IAAI;AAEf,WAAO,MAAM,WAAW,KAAK;AAAA,EACjC,GAAG,CAAA,CAAE;AAEL,QAAM,wBAAwB,MAAM,aAAa,MAAM,SAAS,KAAK,QAAQ,GAAG;AAAA,IAC5E;AAAA,IACA,WAAW,GAAG,SAAS,MAAM,WAAW,YAAY,EAAE,wBAAwB,YAAA,CAAa;AAAA,EAAA,CAC9F;AAED,MAAI,aAAa;AACb,WAAO,sBAAA,cAACC,QAAAA,SAAA,EAAQ,OAAO,QAAA,GAAU,qBAAsB;AAAA,EAC3D;AAEA,SAAO;AACX;;"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export type TruncateProps = {
|
|
3
|
-
children: React.ReactElement
|
|
4
|
-
|
|
3
|
+
children: React.ReactElement<{
|
|
4
|
+
className?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
tooltip: string | React.JSX.Element;
|
|
5
8
|
};
|
|
6
9
|
export declare const Truncate: ({ children, tooltip }: TruncateProps) => React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncate.js","sources":["../../../src/components/Truncate/Truncate.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\n\nimport { useTruncated } from '../../utils/hooks/useTruncated';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type TruncateProps = {\n children: React.ReactElement
|
|
1
|
+
{"version":3,"file":"Truncate.js","sources":["../../../src/components/Truncate/Truncate.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\n\nimport { useTruncated } from '../../utils/hooks/useTruncated';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport type TruncateProps = {\n children: React.ReactElement<{ className?: string; id?: string } & React.RefAttributes<HTMLElement>>;\n tooltip: string | React.JSX.Element;\n};\n\nexport const Truncate = ({ children, tooltip }: TruncateProps) => {\n const ref = React.useRef<HTMLElement>(null);\n const [mounted, setMounted] = React.useState(false);\n const { isTruncated } = useTruncated(ref.current, [mounted]);\n\n React.useEffect(() => {\n setMounted(true);\n\n return () => setMounted(false);\n }, []);\n\n const clonedChildrenWithRef = React.cloneElement(React.Children.only(children), {\n ref,\n className: cn(children.props.className, 'truncate', { 'hover:cursor-pointer': isTruncated }),\n });\n\n if (isTruncated) {\n return <Tooltip title={tooltip}>{clonedChildrenWithRef}</Tooltip>;\n }\n\n return clonedChildrenWithRef;\n};\n"],"names":["React"],"mappings":";;;;AAWO,MAAM,WAAW,CAAC,EAAE,UAAU,cAA6B;AAC9D,QAAM,MAAMA,eAAM,OAAoB,IAAI;AAC1C,QAAM,CAAC,SAAS,UAAU,IAAIA,eAAM,SAAS,KAAK;AAClD,QAAM,EAAE,gBAAgB,aAAa,IAAI,SAAS,CAAC,OAAO,CAAC;AAE3DA,iBAAM,UAAU,MAAM;AAClB,eAAW,IAAI;AAEf,WAAO,MAAM,WAAW,KAAK;AAAA,EACjC,GAAG,CAAA,CAAE;AAEL,QAAM,wBAAwBA,eAAM,aAAaA,eAAM,SAAS,KAAK,QAAQ,GAAG;AAAA,IAC5E;AAAA,IACA,WAAW,GAAG,SAAS,MAAM,WAAW,YAAY,EAAE,wBAAwB,YAAA,CAAa;AAAA,EAAA,CAC9F;AAED,MAAI,aAAa;AACb,WAAOA,+BAAA,cAAC,SAAA,EAAQ,OAAO,QAAA,GAAU,qBAAsB;AAAA,EAC3D;AAEA,SAAO;AACX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBoundingClientRectListener.cjs","sources":["../../src/hooks/useBoundingClientRectListener.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { debounce } from '../utils/debounce';\n\nconst getVisibility = (element: HTMLElement | null): boolean =>\n Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));\n\nexport const useBoundingClientRectListener = (\n ref: React.RefObject<HTMLElement>,\n dependencies?: Array<any>\n): DOMRectReadOnly | undefined => {\n const [dimensions, setDimensions] = React.useState<DOMRectReadOnly | undefined>(undefined);\n const isRefElementVisible = getVisibility(ref.current);\n const [visibility, setVisibility] = React.useState(isRefElementVisible);\n\n const resize = () => {\n if (visibility) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n };\n\n React.useEffect(() => {\n const timeout = setTimeout(resize, 0);\n const debouncedResize = debounce(resize, 250);\n\n window.addEventListener('resize', debouncedResize);\n\n return () => {\n clearTimeout(timeout);\n window.removeEventListener('resize', debouncedResize);\n };\n }, [ref.current, visibility]);\n\n React.useEffect(() => {\n const newRefElementVisibility = getVisibility(ref.current);\n\n if (visibility !== newRefElementVisibility) {\n // When visibility of an element changes, then the new visibility of the element can only be checked after the\n // component has rendered. That's why the visibility check is inside the useEffect. This useEffect will cause\n // the consumer to rerender and that will cause the above hook to recalculate the dimensions\n setVisibility(newRefElementVisibility);\n }\n });\n\n React.useEffect(() => {\n if (dependencies) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n }, dependencies);\n\n return dimensions;\n};\n"],"names":["React","debounce"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,gBAAgB,CAAC,YACnB,QAAQ,YAAY,QAAQ,eAAe,QAAQ,gBAAgB,QAAQ,eAAA,EAAiB,OAAO;AAEhG,MAAM,gCAAgC,CACzC,KACA,iBAC8B;AAC9B,QAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,SAAsC,MAAS;AACzF,QAAM,sBAAsB,cAAc,IAAI,OAAO;AACrD,QAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,SAAS,mBAAmB;AAEtE,QAAM,SAAS,MAAM;AACjB,QAAI,YAAY;AACZ,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ;AAEAA,mBAAM,UAAU,MAAM;AAClB,UAAM,UAAU,WAAW,QAAQ,CAAC;AACpC,UAAM,kBAAkBC,SAAAA,SAAS,QAAQ,GAAG;AAE5C,WAAO,iBAAiB,UAAU,eAAe;AAEjD,WAAO,MAAM;AACT,mBAAa,OAAO;AACpB,aAAO,oBAAoB,UAAU,eAAe;AAAA,IACxD;AAAA,EACJ,GAAG,CAAC,IAAI,SAAS,UAAU,CAAC;AAE5BD,mBAAM,UAAU,MAAM;AAClB,UAAM,0BAA0B,cAAc,IAAI,OAAO;AAEzD,QAAI,eAAe,yBAAyB;AAIxC,oBAAc,uBAAuB;AAAA,IACzC;AAAA,EACJ,CAAC;AAEDA,mBAAM,UAAU,MAAM;AAClB,QAAI,cAAc;AACd,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ,GAAG,YAAY;AAEf,SAAO;AACX;;"}
|
|
1
|
+
{"version":3,"file":"useBoundingClientRectListener.cjs","sources":["../../src/hooks/useBoundingClientRectListener.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { debounce } from '../utils/debounce';\n\nconst getVisibility = (element: HTMLElement | null): boolean =>\n Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));\n\nexport const useBoundingClientRectListener = (\n ref: React.RefObject<HTMLElement | null>,\n dependencies?: Array<any>\n): DOMRectReadOnly | undefined => {\n const [dimensions, setDimensions] = React.useState<DOMRectReadOnly | undefined>(undefined);\n const isRefElementVisible = getVisibility(ref.current);\n const [visibility, setVisibility] = React.useState(isRefElementVisible);\n\n const resize = () => {\n if (visibility) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n };\n\n React.useEffect(() => {\n const timeout = setTimeout(resize, 0);\n const debouncedResize = debounce(resize, 250);\n\n window.addEventListener('resize', debouncedResize);\n\n return () => {\n clearTimeout(timeout);\n window.removeEventListener('resize', debouncedResize);\n };\n }, [ref.current, visibility]);\n\n React.useEffect(() => {\n const newRefElementVisibility = getVisibility(ref.current);\n\n if (visibility !== newRefElementVisibility) {\n // When visibility of an element changes, then the new visibility of the element can only be checked after the\n // component has rendered. That's why the visibility check is inside the useEffect. This useEffect will cause\n // the consumer to rerender and that will cause the above hook to recalculate the dimensions\n setVisibility(newRefElementVisibility);\n }\n });\n\n React.useEffect(() => {\n if (dependencies) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n }, dependencies);\n\n return dimensions;\n};\n"],"names":["React","debounce"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,gBAAgB,CAAC,YACnB,QAAQ,YAAY,QAAQ,eAAe,QAAQ,gBAAgB,QAAQ,eAAA,EAAiB,OAAO;AAEhG,MAAM,gCAAgC,CACzC,KACA,iBAC8B;AAC9B,QAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,SAAsC,MAAS;AACzF,QAAM,sBAAsB,cAAc,IAAI,OAAO;AACrD,QAAM,CAAC,YAAY,aAAa,IAAIA,iBAAM,SAAS,mBAAmB;AAEtE,QAAM,SAAS,MAAM;AACjB,QAAI,YAAY;AACZ,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ;AAEAA,mBAAM,UAAU,MAAM;AAClB,UAAM,UAAU,WAAW,QAAQ,CAAC;AACpC,UAAM,kBAAkBC,SAAAA,SAAS,QAAQ,GAAG;AAE5C,WAAO,iBAAiB,UAAU,eAAe;AAEjD,WAAO,MAAM;AACT,mBAAa,OAAO;AACpB,aAAO,oBAAoB,UAAU,eAAe;AAAA,IACxD;AAAA,EACJ,GAAG,CAAC,IAAI,SAAS,UAAU,CAAC;AAE5BD,mBAAM,UAAU,MAAM;AAClB,UAAM,0BAA0B,cAAc,IAAI,OAAO;AAEzD,QAAI,eAAe,yBAAyB;AAIxC,oBAAc,uBAAuB;AAAA,IACzC;AAAA,EACJ,CAAC;AAEDA,mBAAM,UAAU,MAAM;AAClB,QAAI,cAAc;AACd,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ,GAAG,YAAY;AAEf,SAAO;AACX;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const useBoundingClientRectListener: (ref: React.RefObject<HTMLElement>, dependencies?: Array<any>) => DOMRectReadOnly | undefined;
|
|
2
|
+
export declare const useBoundingClientRectListener: (ref: React.RefObject<HTMLElement | null>, dependencies?: Array<any>) => DOMRectReadOnly | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBoundingClientRectListener.js","sources":["../../src/hooks/useBoundingClientRectListener.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { debounce } from '../utils/debounce';\n\nconst getVisibility = (element: HTMLElement | null): boolean =>\n Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));\n\nexport const useBoundingClientRectListener = (\n ref: React.RefObject<HTMLElement>,\n dependencies?: Array<any>\n): DOMRectReadOnly | undefined => {\n const [dimensions, setDimensions] = React.useState<DOMRectReadOnly | undefined>(undefined);\n const isRefElementVisible = getVisibility(ref.current);\n const [visibility, setVisibility] = React.useState(isRefElementVisible);\n\n const resize = () => {\n if (visibility) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n };\n\n React.useEffect(() => {\n const timeout = setTimeout(resize, 0);\n const debouncedResize = debounce(resize, 250);\n\n window.addEventListener('resize', debouncedResize);\n\n return () => {\n clearTimeout(timeout);\n window.removeEventListener('resize', debouncedResize);\n };\n }, [ref.current, visibility]);\n\n React.useEffect(() => {\n const newRefElementVisibility = getVisibility(ref.current);\n\n if (visibility !== newRefElementVisibility) {\n // When visibility of an element changes, then the new visibility of the element can only be checked after the\n // component has rendered. That's why the visibility check is inside the useEffect. This useEffect will cause\n // the consumer to rerender and that will cause the above hook to recalculate the dimensions\n setVisibility(newRefElementVisibility);\n }\n });\n\n React.useEffect(() => {\n if (dependencies) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n }, dependencies);\n\n return dimensions;\n};\n"],"names":[],"mappings":";;AAIA,MAAM,gBAAgB,CAAC,YACnB,QAAQ,YAAY,QAAQ,eAAe,QAAQ,gBAAgB,QAAQ,eAAA,EAAiB,OAAO;AAEhG,MAAM,gCAAgC,CACzC,KACA,iBAC8B;AAC9B,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAsC,MAAS;AACzF,QAAM,sBAAsB,cAAc,IAAI,OAAO;AACrD,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,mBAAmB;AAEtE,QAAM,SAAS,MAAM;AACjB,QAAI,YAAY;AACZ,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ;AAEA,QAAM,UAAU,MAAM;AAClB,UAAM,UAAU,WAAW,QAAQ,CAAC;AACpC,UAAM,kBAAkB,SAAS,QAAQ,GAAG;AAE5C,WAAO,iBAAiB,UAAU,eAAe;AAEjD,WAAO,MAAM;AACT,mBAAa,OAAO;AACpB,aAAO,oBAAoB,UAAU,eAAe;AAAA,IACxD;AAAA,EACJ,GAAG,CAAC,IAAI,SAAS,UAAU,CAAC;AAE5B,QAAM,UAAU,MAAM;AAClB,UAAM,0BAA0B,cAAc,IAAI,OAAO;AAEzD,QAAI,eAAe,yBAAyB;AAIxC,oBAAc,uBAAuB;AAAA,IACzC;AAAA,EACJ,CAAC;AAED,QAAM,UAAU,MAAM;AAClB,QAAI,cAAc;AACd,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ,GAAG,YAAY;AAEf,SAAO;AACX;"}
|
|
1
|
+
{"version":3,"file":"useBoundingClientRectListener.js","sources":["../../src/hooks/useBoundingClientRectListener.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { debounce } from '../utils/debounce';\n\nconst getVisibility = (element: HTMLElement | null): boolean =>\n Boolean(element && (element.offsetWidth || element.offsetHeight || element.getClientRects().length));\n\nexport const useBoundingClientRectListener = (\n ref: React.RefObject<HTMLElement | null>,\n dependencies?: Array<any>\n): DOMRectReadOnly | undefined => {\n const [dimensions, setDimensions] = React.useState<DOMRectReadOnly | undefined>(undefined);\n const isRefElementVisible = getVisibility(ref.current);\n const [visibility, setVisibility] = React.useState(isRefElementVisible);\n\n const resize = () => {\n if (visibility) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n };\n\n React.useEffect(() => {\n const timeout = setTimeout(resize, 0);\n const debouncedResize = debounce(resize, 250);\n\n window.addEventListener('resize', debouncedResize);\n\n return () => {\n clearTimeout(timeout);\n window.removeEventListener('resize', debouncedResize);\n };\n }, [ref.current, visibility]);\n\n React.useEffect(() => {\n const newRefElementVisibility = getVisibility(ref.current);\n\n if (visibility !== newRefElementVisibility) {\n // When visibility of an element changes, then the new visibility of the element can only be checked after the\n // component has rendered. That's why the visibility check is inside the useEffect. This useEffect will cause\n // the consumer to rerender and that will cause the above hook to recalculate the dimensions\n setVisibility(newRefElementVisibility);\n }\n });\n\n React.useEffect(() => {\n if (dependencies) {\n setDimensions(ref.current?.getBoundingClientRect());\n }\n }, dependencies);\n\n return dimensions;\n};\n"],"names":[],"mappings":";;AAIA,MAAM,gBAAgB,CAAC,YACnB,QAAQ,YAAY,QAAQ,eAAe,QAAQ,gBAAgB,QAAQ,eAAA,EAAiB,OAAO;AAEhG,MAAM,gCAAgC,CACzC,KACA,iBAC8B;AAC9B,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAsC,MAAS;AACzF,QAAM,sBAAsB,cAAc,IAAI,OAAO;AACrD,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,mBAAmB;AAEtE,QAAM,SAAS,MAAM;AACjB,QAAI,YAAY;AACZ,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ;AAEA,QAAM,UAAU,MAAM;AAClB,UAAM,UAAU,WAAW,QAAQ,CAAC;AACpC,UAAM,kBAAkB,SAAS,QAAQ,GAAG;AAE5C,WAAO,iBAAiB,UAAU,eAAe;AAEjD,WAAO,MAAM;AACT,mBAAa,OAAO;AACpB,aAAO,oBAAoB,UAAU,eAAe;AAAA,IACxD;AAAA,EACJ,GAAG,CAAC,IAAI,SAAS,UAAU,CAAC;AAE5B,QAAM,UAAU,MAAM;AAClB,UAAM,0BAA0B,cAAc,IAAI,OAAO;AAEzD,QAAI,eAAe,yBAAyB;AAIxC,oBAAc,uBAAuB;AAAA,IACzC;AAAA,EACJ,CAAC;AAED,QAAM,UAAU,MAAM;AAClB,QAAI,cAAc;AACd,oBAAc,IAAI,SAAS,uBAAuB;AAAA,IACtD;AAAA,EACJ,GAAG,YAAY;AAEf,SAAO;AACX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntersectionObserver.cjs","sources":["../../src/hooks/useIntersectionObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useIntersectionObserver = (ref: React.RefObject<HTMLElement>, offset?: number) => {\n const [intersectedIndexes, setIntersectedIndexes] = React.useState({});\n\n const handleIntersection = (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n if (observer.root) {\n const children = Array.from((observer.root as Element).children);\n const map: Record<number, boolean> = {};\n\n entries.forEach(entry => {\n // entries only contains the items being intersected not all children of the ref\n // so use root and the the entry being intersected to find its real index\n // on first mount this is different - all children are present\n map[children.indexOf(entry.target)] = entry.isIntersecting;\n });\n\n setIntersectedIndexes(prev => ({ ...prev, ...map }));\n }\n };\n\n const intersectedChildIndex = React.useMemo(() => {\n const index = Object.values(intersectedIndexes).indexOf(false);\n return index > -1 ? index : undefined;\n }, [intersectedIndexes]);\n\n const hasRootMargin = intersectedChildIndex !== undefined && offset;\n\n React.useEffect(() => {\n const observer = new IntersectionObserver(handleIntersection, {\n root: ref.current,\n // offset the button, but only after the first item has been intersected\n rootMargin: hasRootMargin ? `0px -${offset}px 0px 0px` : undefined,\n threshold: 1,\n });\n\n if (observer.root) {\n Array.from(observer.root.children).forEach(item => {\n if (!item.hasAttribute('data-observer-ignore')) {\n observer.observe(item);\n }\n });\n }\n\n return () => {\n observer.disconnect();\n };\n }, [hasRootMargin]);\n\n return intersectedChildIndex;\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"useIntersectionObserver.cjs","sources":["../../src/hooks/useIntersectionObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useIntersectionObserver = (ref: React.RefObject<HTMLElement | null>, offset?: number) => {\n const [intersectedIndexes, setIntersectedIndexes] = React.useState({});\n\n const handleIntersection = (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n if (observer.root) {\n const children = Array.from((observer.root as Element).children);\n const map: Record<number, boolean> = {};\n\n entries.forEach(entry => {\n // entries only contains the items being intersected not all children of the ref\n // so use root and the the entry being intersected to find its real index\n // on first mount this is different - all children are present\n map[children.indexOf(entry.target)] = entry.isIntersecting;\n });\n\n setIntersectedIndexes(prev => ({ ...prev, ...map }));\n }\n };\n\n const intersectedChildIndex = React.useMemo(() => {\n const index = Object.values(intersectedIndexes).indexOf(false);\n return index > -1 ? index : undefined;\n }, [intersectedIndexes]);\n\n const hasRootMargin = intersectedChildIndex !== undefined && offset;\n\n React.useEffect(() => {\n const observer = new IntersectionObserver(handleIntersection, {\n root: ref.current,\n // offset the button, but only after the first item has been intersected\n rootMargin: hasRootMargin ? `0px -${offset}px 0px 0px` : undefined,\n threshold: 1,\n });\n\n if (observer.root) {\n Array.from(observer.root.children).forEach(item => {\n if (!item.hasAttribute('data-observer-ignore')) {\n observer.observe(item);\n }\n });\n }\n\n return () => {\n observer.disconnect();\n };\n }, [hasRootMargin]);\n\n return intersectedChildIndex;\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,0BAA0B,CAAC,KAA0C,WAAoB;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,MAAM,SAAS,CAAA,CAAE;AAErE,QAAM,qBAAqB,CAAC,SAAsC,aAAmC;AACjG,QAAI,SAAS,MAAM;AACf,YAAM,WAAW,MAAM,KAAM,SAAS,KAAiB,QAAQ;AAC/D,YAAM,MAA+B,CAAA;AAErC,cAAQ,QAAQ,CAAA,UAAS;AAIrB,YAAI,SAAS,QAAQ,MAAM,MAAM,CAAC,IAAI,MAAM;AAAA,MAChD,CAAC;AAED,4BAAsB,WAAS,EAAE,GAAG,MAAM,GAAG,MAAM;AAAA,IACvD;AAAA,EACJ;AAEA,QAAM,wBAAwB,MAAM,QAAQ,MAAM;AAC9C,UAAM,QAAQ,OAAO,OAAO,kBAAkB,EAAE,QAAQ,KAAK;AAC7D,WAAO,QAAQ,KAAK,QAAQ;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AAEvB,QAAM,gBAAgB,0BAA0B,UAAa;AAE7D,QAAM,UAAU,MAAM;AAClB,UAAM,WAAW,IAAI,qBAAqB,oBAAoB;AAAA,MAC1D,MAAM,IAAI;AAAA;AAAA,MAEV,YAAY,gBAAgB,QAAQ,MAAM,eAAe;AAAA,MACzD,WAAW;AAAA,IAAA,CACd;AAED,QAAI,SAAS,MAAM;AACf,YAAM,KAAK,SAAS,KAAK,QAAQ,EAAE,QAAQ,CAAA,SAAQ;AAC/C,YAAI,CAAC,KAAK,aAAa,sBAAsB,GAAG;AAC5C,mBAAS,QAAQ,IAAI;AAAA,QACzB;AAAA,MACJ,CAAC;AAAA,IACL;AAEA,WAAO,MAAM;AACT,eAAS,WAAA;AAAA,IACb;AAAA,EACJ,GAAG,CAAC,aAAa,CAAC;AAElB,SAAO;AACX;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export declare const useIntersectionObserver: (ref: React.RefObject<HTMLElement>, offset?: number) => number | undefined;
|
|
2
|
+
export declare const useIntersectionObserver: (ref: React.RefObject<HTMLElement | null>, offset?: number) => number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntersectionObserver.js","sources":["../../src/hooks/useIntersectionObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useIntersectionObserver = (ref: React.RefObject<HTMLElement>, offset?: number) => {\n const [intersectedIndexes, setIntersectedIndexes] = React.useState({});\n\n const handleIntersection = (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n if (observer.root) {\n const children = Array.from((observer.root as Element).children);\n const map: Record<number, boolean> = {};\n\n entries.forEach(entry => {\n // entries only contains the items being intersected not all children of the ref\n // so use root and the the entry being intersected to find its real index\n // on first mount this is different - all children are present\n map[children.indexOf(entry.target)] = entry.isIntersecting;\n });\n\n setIntersectedIndexes(prev => ({ ...prev, ...map }));\n }\n };\n\n const intersectedChildIndex = React.useMemo(() => {\n const index = Object.values(intersectedIndexes).indexOf(false);\n return index > -1 ? index : undefined;\n }, [intersectedIndexes]);\n\n const hasRootMargin = intersectedChildIndex !== undefined && offset;\n\n React.useEffect(() => {\n const observer = new IntersectionObserver(handleIntersection, {\n root: ref.current,\n // offset the button, but only after the first item has been intersected\n rootMargin: hasRootMargin ? `0px -${offset}px 0px 0px` : undefined,\n threshold: 1,\n });\n\n if (observer.root) {\n Array.from(observer.root.children).forEach(item => {\n if (!item.hasAttribute('data-observer-ignore')) {\n observer.observe(item);\n }\n });\n }\n\n return () => {\n observer.disconnect();\n };\n }, [hasRootMargin]);\n\n return intersectedChildIndex;\n};\n"],"names":["React"],"mappings":";AAEO,MAAM,0BAA0B,CAAC,
|
|
1
|
+
{"version":3,"file":"useIntersectionObserver.js","sources":["../../src/hooks/useIntersectionObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useIntersectionObserver = (ref: React.RefObject<HTMLElement | null>, offset?: number) => {\n const [intersectedIndexes, setIntersectedIndexes] = React.useState({});\n\n const handleIntersection = (entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {\n if (observer.root) {\n const children = Array.from((observer.root as Element).children);\n const map: Record<number, boolean> = {};\n\n entries.forEach(entry => {\n // entries only contains the items being intersected not all children of the ref\n // so use root and the the entry being intersected to find its real index\n // on first mount this is different - all children are present\n map[children.indexOf(entry.target)] = entry.isIntersecting;\n });\n\n setIntersectedIndexes(prev => ({ ...prev, ...map }));\n }\n };\n\n const intersectedChildIndex = React.useMemo(() => {\n const index = Object.values(intersectedIndexes).indexOf(false);\n return index > -1 ? index : undefined;\n }, [intersectedIndexes]);\n\n const hasRootMargin = intersectedChildIndex !== undefined && offset;\n\n React.useEffect(() => {\n const observer = new IntersectionObserver(handleIntersection, {\n root: ref.current,\n // offset the button, but only after the first item has been intersected\n rootMargin: hasRootMargin ? `0px -${offset}px 0px 0px` : undefined,\n threshold: 1,\n });\n\n if (observer.root) {\n Array.from(observer.root.children).forEach(item => {\n if (!item.hasAttribute('data-observer-ignore')) {\n observer.observe(item);\n }\n });\n }\n\n return () => {\n observer.disconnect();\n };\n }, [hasRootMargin]);\n\n return intersectedChildIndex;\n};\n"],"names":["React"],"mappings":";AAEO,MAAM,0BAA0B,CAAC,KAA0C,WAAoB;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,IAAIA,eAAM,SAAS,CAAA,CAAE;AAErE,QAAM,qBAAqB,CAAC,SAAsC,aAAmC;AACjG,QAAI,SAAS,MAAM;AACf,YAAM,WAAW,MAAM,KAAM,SAAS,KAAiB,QAAQ;AAC/D,YAAM,MAA+B,CAAA;AAErC,cAAQ,QAAQ,CAAA,UAAS;AAIrB,YAAI,SAAS,QAAQ,MAAM,MAAM,CAAC,IAAI,MAAM;AAAA,MAChD,CAAC;AAED,4BAAsB,WAAS,EAAE,GAAG,MAAM,GAAG,MAAM;AAAA,IACvD;AAAA,EACJ;AAEA,QAAM,wBAAwBA,eAAM,QAAQ,MAAM;AAC9C,UAAM,QAAQ,OAAO,OAAO,kBAAkB,EAAE,QAAQ,KAAK;AAC7D,WAAO,QAAQ,KAAK,QAAQ;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AAEvB,QAAM,gBAAgB,0BAA0B,UAAa;AAE7DA,iBAAM,UAAU,MAAM;AAClB,UAAM,WAAW,IAAI,qBAAqB,oBAAoB;AAAA,MAC1D,MAAM,IAAI;AAAA;AAAA,MAEV,YAAY,gBAAgB,QAAQ,MAAM,eAAe;AAAA,MACzD,WAAW;AAAA,IAAA,CACd;AAED,QAAI,SAAS,MAAM;AACf,YAAM,KAAK,SAAS,KAAK,QAAQ,EAAE,QAAQ,CAAA,SAAQ;AAC/C,YAAI,CAAC,KAAK,aAAa,sBAAsB,GAAG;AAC5C,mBAAS,QAAQ,IAAI;AAAA,QACzB;AAAA,MACJ,CAAC;AAAA,IACL;AAEA,WAAO,MAAM;AACT,eAAS,WAAA;AAAA,IACb;AAAA,EACJ,GAAG,CAAC,aAAa,CAAC;AAElB,SAAO;AACX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMergedRef.cjs","sources":["../../src/hooks/useMergedRef.ts"],"sourcesContent":["import React from 'react';\n\n// merges an external ref (optional) with an internal ref (required)\nexport const useMergedRef = <T extends HTMLElement>(ref: React.Ref<HTMLElement>): React.RefObject<T> => {\n const internalRef = React.useRef<T>(null);\n\n React.useEffect(() => {\n if (ref) {\n if (typeof ref === 'function') {\n ref(internalRef.current);\n } else {\n (ref as React.MutableRefObject<HTMLElement | null>).current = internalRef.current;\n }\n }\n }, [ref]);\n\n return internalRef
|
|
1
|
+
{"version":3,"file":"useMergedRef.cjs","sources":["../../src/hooks/useMergedRef.ts"],"sourcesContent":["import React from 'react';\n\n// merges an external ref (optional) with an internal ref (required)\nexport const useMergedRef = <T extends HTMLElement>(ref: React.Ref<HTMLElement>): React.RefObject<T> => {\n const internalRef = React.useRef<T>(null);\n\n React.useEffect(() => {\n if (ref) {\n if (typeof ref === 'function') {\n ref(internalRef.current);\n } else {\n (ref as React.MutableRefObject<HTMLElement | null>).current = internalRef.current;\n }\n }\n }, [ref]);\n\n // React 19 types useRef<T>(null) as RefObject<T | null>, but this hook hands back a ref that is\n // always attached to an element, so keep the narrower contract rather than leak null to callers.\n return internalRef as React.RefObject<T>;\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,eAAe,CAAwB,QAAoD;AACpG,QAAM,cAAc,MAAM,OAAU,IAAI;AAExC,QAAM,UAAU,MAAM;AAClB,QAAI,KAAK;AACL,UAAI,OAAO,QAAQ,YAAY;AAC3B,YAAI,YAAY,OAAO;AAAA,MAC3B,OAAO;AACF,YAAmD,UAAU,YAAY;AAAA,MAC9E;AAAA,IACJ;AAAA,EACJ,GAAG,CAAC,GAAG,CAAC;AAIR,SAAO;AACX;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMergedRef.js","sources":["../../src/hooks/useMergedRef.ts"],"sourcesContent":["import React from 'react';\n\n// merges an external ref (optional) with an internal ref (required)\nexport const useMergedRef = <T extends HTMLElement>(ref: React.Ref<HTMLElement>): React.RefObject<T> => {\n const internalRef = React.useRef<T>(null);\n\n React.useEffect(() => {\n if (ref) {\n if (typeof ref === 'function') {\n ref(internalRef.current);\n } else {\n (ref as React.MutableRefObject<HTMLElement | null>).current = internalRef.current;\n }\n }\n }, [ref]);\n\n return internalRef
|
|
1
|
+
{"version":3,"file":"useMergedRef.js","sources":["../../src/hooks/useMergedRef.ts"],"sourcesContent":["import React from 'react';\n\n// merges an external ref (optional) with an internal ref (required)\nexport const useMergedRef = <T extends HTMLElement>(ref: React.Ref<HTMLElement>): React.RefObject<T> => {\n const internalRef = React.useRef<T>(null);\n\n React.useEffect(() => {\n if (ref) {\n if (typeof ref === 'function') {\n ref(internalRef.current);\n } else {\n (ref as React.MutableRefObject<HTMLElement | null>).current = internalRef.current;\n }\n }\n }, [ref]);\n\n // React 19 types useRef<T>(null) as RefObject<T | null>, but this hook hands back a ref that is\n // always attached to an element, so keep the narrower contract rather than leak null to callers.\n return internalRef as React.RefObject<T>;\n};\n"],"names":["React"],"mappings":";AAGO,MAAM,eAAe,CAAwB,QAAoD;AACpG,QAAM,cAAcA,eAAM,OAAU,IAAI;AAExCA,iBAAM,UAAU,MAAM;AAClB,QAAI,KAAK;AACL,UAAI,OAAO,QAAQ,YAAY;AAC3B,YAAI,YAAY,OAAO;AAAA,MAC3B,OAAO;AACF,YAAmD,UAAU,YAAY;AAAA,MAC9E;AAAA,IACJ;AAAA,EACJ,GAAG,CAAC,GAAG,CAAC;AAIR,SAAO;AACX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.cjs","sources":["../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useResizeObserver = (ref: React.RefObject<HTMLElement>, enabled = true) => {\n const [size, setSize] = React.useState<{ height: number; width: number }>();\n\n React.useEffect(() => {\n if (!ref.current || !enabled) {\n return () => undefined;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n\n setSize({ height: entry?.contentRect.height ?? 0, width: entry?.contentRect.width ?? 0 });\n });\n\n observer.observe(ref.current);\n\n return () => observer.disconnect();\n }, [enabled]);\n\n return size;\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"useResizeObserver.cjs","sources":["../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useResizeObserver = (ref: React.RefObject<HTMLElement | null>, enabled = true) => {\n const [size, setSize] = React.useState<{ height: number; width: number }>();\n\n React.useEffect(() => {\n if (!ref.current || !enabled) {\n return () => undefined;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n\n setSize({ height: entry?.contentRect.height ?? 0, width: entry?.contentRect.width ?? 0 });\n });\n\n observer.observe(ref.current);\n\n return () => observer.disconnect();\n }, [enabled]);\n\n return size;\n};\n"],"names":[],"mappings":";;;AAEO,MAAM,oBAAoB,CAAC,KAA0C,UAAU,SAAS;AAC3F,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAA;AAE9B,QAAM,UAAU,MAAM;AAClB,QAAI,CAAC,IAAI,WAAW,CAAC,SAAS;AAC1B,aAAO,MAAM;AAAA,IACjB;AAEA,UAAM,WAAW,IAAI,eAAe,CAAA,YAAW;AAC3C,YAAM,QAAQ,QAAQ,CAAC;AAEvB,cAAQ,EAAE,QAAQ,OAAO,YAAY,UAAU,GAAG,OAAO,OAAO,YAAY,SAAS,EAAA,CAAG;AAAA,IAC5F,CAAC;AAED,aAAS,QAAQ,IAAI,OAAO;AAE5B,WAAO,MAAM,SAAS,WAAA;AAAA,EAC1B,GAAG,CAAC,OAAO,CAAC;AAEZ,SAAO;AACX;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export declare const useResizeObserver: (ref: React.RefObject<HTMLElement>, enabled?: boolean) => {
|
|
2
|
+
export declare const useResizeObserver: (ref: React.RefObject<HTMLElement | null>, enabled?: boolean) => {
|
|
3
3
|
height: number;
|
|
4
4
|
width: number;
|
|
5
5
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResizeObserver.js","sources":["../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useResizeObserver = (ref: React.RefObject<HTMLElement>, enabled = true) => {\n const [size, setSize] = React.useState<{ height: number; width: number }>();\n\n React.useEffect(() => {\n if (!ref.current || !enabled) {\n return () => undefined;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n\n setSize({ height: entry?.contentRect.height ?? 0, width: entry?.contentRect.width ?? 0 });\n });\n\n observer.observe(ref.current);\n\n return () => observer.disconnect();\n }, [enabled]);\n\n return size;\n};\n"],"names":["React"],"mappings":";AAEO,MAAM,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sources":["../../src/hooks/useResizeObserver.ts"],"sourcesContent":["import React from 'react';\n\nexport const useResizeObserver = (ref: React.RefObject<HTMLElement | null>, enabled = true) => {\n const [size, setSize] = React.useState<{ height: number; width: number }>();\n\n React.useEffect(() => {\n if (!ref.current || !enabled) {\n return () => undefined;\n }\n\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n\n setSize({ height: entry?.contentRect.height ?? 0, width: entry?.contentRect.width ?? 0 });\n });\n\n observer.observe(ref.current);\n\n return () => observer.disconnect();\n }, [enabled]);\n\n return size;\n};\n"],"names":["React"],"mappings":";AAEO,MAAM,oBAAoB,CAAC,KAA0C,UAAU,SAAS;AAC3F,QAAM,CAAC,MAAM,OAAO,IAAIA,eAAM,SAAA;AAE9BA,iBAAM,UAAU,MAAM;AAClB,QAAI,CAAC,IAAI,WAAW,CAAC,SAAS;AAC1B,aAAO,MAAM;AAAA,IACjB;AAEA,UAAM,WAAW,IAAI,eAAe,CAAA,YAAW;AAC3C,YAAM,QAAQ,QAAQ,CAAC;AAEvB,cAAQ,EAAE,QAAQ,OAAO,YAAY,UAAU,GAAG,OAAO,OAAO,YAAY,SAAS,EAAA,CAAG;AAAA,IAC5F,CAAC;AAED,aAAS,QAAQ,IAAI,OAAO;AAE5B,WAAO,MAAM,SAAS,WAAA;AAAA,EAC1B,GAAG,CAAC,OAAO,CAAC;AAEZ,SAAO;AACX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","sources":["../../src/primitives/Button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useGlobalKeyDown } from '../hooks/useGlobalKeyDown';\nimport { useMergedRef } from '../hooks/useMergedRef';\nimport type { KeyDownHandlerOptions } from '../utils/keyboard';\n\ntype ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> & {\n /** Content should be a text */\n children: React.ReactNode;\n /** Provides url for buttons being used as a link */\n href?: string;\n shortcut?: string | KeyDownHandlerOptions;\n /** Provides target for buttons being used as a link */\n target?: '_self' | '_blank' | '_parent' | '_top';\n};\n\nconst Button = React.forwardRef(function Button(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { disabled, shortcut, target, type = 'button', ...otherProps } = props;\n const internalRef = useMergedRef<HTMLButtonElement | HTMLAnchorElement>(ref);\n\n useGlobalKeyDown(shortcut, event => {\n event?.preventDefault();\n const dialog = document.querySelector('[role=\"dialog\"]');\n\n // Don't trigger the click on the button if it is outside of the dialog\n if (dialog && !dialog?.contains(internalRef.current)) {\n return;\n }\n\n internalRef.current?.click();\n });\n\n const Tag = props.href ? 'a' : 'button';\n\n return (\n <Tag\n {...otherProps}\n href={disabled ? undefined : props.href}\n aria-disabled={disabled ? 'true' : undefined}\n disabled={disabled}\n target={Tag === 'a' ? target : undefined}\n type={Tag === 'a' ? undefined : type}\n ref={internalRef as any}>\n {React.Children.count(props.children) > 1\n ? React.Children.map(props.children, child => (typeof child === 'string' ? <span>{child}</span> : child))\n : props.children}\n </Tag>\n );\n});\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["React","Button","useMergedRef","useGlobalKeyDown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Button.cjs","sources":["../../src/primitives/Button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useGlobalKeyDown } from '../hooks/useGlobalKeyDown';\nimport { useMergedRef } from '../hooks/useMergedRef';\nimport type { KeyDownHandlerOptions } from '../utils/keyboard';\n\n// React 19 added the native `popover` attribute to HTML props. Consumers of this primitive use\n// `popover` as a render prop for an associated Popover, so the native one is dropped to keep that.\ntype ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, 'popover'> & {\n /** Content should be a text */\n children: React.ReactNode;\n /** Provides url for buttons being used as a link */\n href?: string;\n shortcut?: string | KeyDownHandlerOptions;\n /** Provides target for buttons being used as a link */\n target?: '_self' | '_blank' | '_parent' | '_top';\n};\n\nconst Button = React.forwardRef(function Button(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { disabled, shortcut, target, type = 'button', ...otherProps } = props;\n const internalRef = useMergedRef<HTMLButtonElement | HTMLAnchorElement>(ref);\n\n useGlobalKeyDown(shortcut, event => {\n event?.preventDefault();\n const dialog = document.querySelector('[role=\"dialog\"]');\n\n // Don't trigger the click on the button if it is outside of the dialog\n if (dialog && !dialog?.contains(internalRef.current)) {\n return;\n }\n\n internalRef.current?.click();\n });\n\n const Tag = props.href ? 'a' : 'button';\n\n return (\n <Tag\n {...otherProps}\n href={disabled ? undefined : props.href}\n aria-disabled={disabled ? 'true' : undefined}\n disabled={disabled}\n target={Tag === 'a' ? target : undefined}\n type={Tag === 'a' ? undefined : type}\n ref={internalRef as any}>\n {React.Children.count(props.children) > 1\n ? React.Children.map(props.children, child => (typeof child === 'string' ? <span>{child}</span> : child))\n : props.children}\n </Tag>\n );\n});\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["React","Button","useMergedRef","useGlobalKeyDown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,SAASA,iBAAM,WAAW,SAASC,QAAO,OAAoB,KAAuD;AACvH,QAAM,EAAE,UAAU,UAAU,QAAQ,OAAO,UAAU,GAAG,eAAe;AACvE,QAAM,cAAcC,aAAAA,aAAoD,GAAG;AAE3EC,oCAAiB,UAAU,CAAA,UAAS;AAChC,WAAO,eAAA;AACP,UAAM,SAAS,SAAS,cAAc,iBAAiB;AAGvD,QAAI,UAAU,CAAC,QAAQ,SAAS,YAAY,OAAO,GAAG;AAClD;AAAA,IACJ;AAEA,gBAAY,SAAS,MAAA;AAAA,EACzB,CAAC;AAED,QAAM,MAAM,MAAM,OAAO,MAAM;AAE/B,SACIH,iCAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,MAAM,WAAW,SAAY,MAAM;AAAA,MACnC,iBAAe,WAAW,SAAS;AAAA,MACnC;AAAA,MACA,QAAQ,QAAQ,MAAM,SAAS;AAAA,MAC/B,MAAM,QAAQ,MAAM,SAAY;AAAA,MAChC,KAAK;AAAA,IAAA;AAAA,IACJA,iBAAM,SAAS,MAAM,MAAM,QAAQ,IAAI,IAClCA,iBAAM,SAAS,IAAI,MAAM,UAAU,CAAA,UAAU,OAAO,UAAU,WAAWA,iCAAA,cAAC,cAAM,KAAM,IAAU,KAAM,IACtG,MAAM;AAAA,EAAA;AAGxB,CAAC;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeyDownHandlerOptions } from '../utils/keyboard';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> & {
|
|
3
|
+
type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, 'popover'> & {
|
|
4
4
|
/** Content should be a text */
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Provides url for buttons being used as a link */
|
|
@@ -9,7 +9,7 @@ type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElem
|
|
|
9
9
|
/** Provides target for buttons being used as a link */
|
|
10
10
|
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
11
11
|
};
|
|
12
|
-
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> & {
|
|
12
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, "popover"> & {
|
|
13
13
|
/** Content should be a text */
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
/** Provides url for buttons being used as a link */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/primitives/Button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useGlobalKeyDown } from '../hooks/useGlobalKeyDown';\nimport { useMergedRef } from '../hooks/useMergedRef';\nimport type { KeyDownHandlerOptions } from '../utils/keyboard';\n\ntype ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> & {\n /** Content should be a text */\n children: React.ReactNode;\n /** Provides url for buttons being used as a link */\n href?: string;\n shortcut?: string | KeyDownHandlerOptions;\n /** Provides target for buttons being used as a link */\n target?: '_self' | '_blank' | '_parent' | '_top';\n};\n\nconst Button = React.forwardRef(function Button(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { disabled, shortcut, target, type = 'button', ...otherProps } = props;\n const internalRef = useMergedRef<HTMLButtonElement | HTMLAnchorElement>(ref);\n\n useGlobalKeyDown(shortcut, event => {\n event?.preventDefault();\n const dialog = document.querySelector('[role=\"dialog\"]');\n\n // Don't trigger the click on the button if it is outside of the dialog\n if (dialog && !dialog?.contains(internalRef.current)) {\n return;\n }\n\n internalRef.current?.click();\n });\n\n const Tag = props.href ? 'a' : 'button';\n\n return (\n <Tag\n {...otherProps}\n href={disabled ? undefined : props.href}\n aria-disabled={disabled ? 'true' : undefined}\n disabled={disabled}\n target={Tag === 'a' ? target : undefined}\n type={Tag === 'a' ? undefined : type}\n ref={internalRef as any}>\n {React.Children.count(props.children) > 1\n ? React.Children.map(props.children, child => (typeof child === 'string' ? <span>{child}</span> : child))\n : props.children}\n </Tag>\n );\n});\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["Button"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/primitives/Button.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useGlobalKeyDown } from '../hooks/useGlobalKeyDown';\nimport { useMergedRef } from '../hooks/useMergedRef';\nimport type { KeyDownHandlerOptions } from '../utils/keyboard';\n\n// React 19 added the native `popover` attribute to HTML props. Consumers of this primitive use\n// `popover` as a render prop for an associated Popover, so the native one is dropped to keep that.\ntype ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, 'popover'> & {\n /** Content should be a text */\n children: React.ReactNode;\n /** Provides url for buttons being used as a link */\n href?: string;\n shortcut?: string | KeyDownHandlerOptions;\n /** Provides target for buttons being used as a link */\n target?: '_self' | '_blank' | '_parent' | '_top';\n};\n\nconst Button = React.forwardRef(function Button(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { disabled, shortcut, target, type = 'button', ...otherProps } = props;\n const internalRef = useMergedRef<HTMLButtonElement | HTMLAnchorElement>(ref);\n\n useGlobalKeyDown(shortcut, event => {\n event?.preventDefault();\n const dialog = document.querySelector('[role=\"dialog\"]');\n\n // Don't trigger the click on the button if it is outside of the dialog\n if (dialog && !dialog?.contains(internalRef.current)) {\n return;\n }\n\n internalRef.current?.click();\n });\n\n const Tag = props.href ? 'a' : 'button';\n\n return (\n <Tag\n {...otherProps}\n href={disabled ? undefined : props.href}\n aria-disabled={disabled ? 'true' : undefined}\n disabled={disabled}\n target={Tag === 'a' ? target : undefined}\n type={Tag === 'a' ? undefined : type}\n ref={internalRef as any}>\n {React.Children.count(props.children) > 1\n ? React.Children.map(props.children, child => (typeof child === 'string' ? <span>{child}</span> : child))\n : props.children}\n </Tag>\n );\n});\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["Button"],"mappings":";;;AAkBA,MAAM,SAAS,MAAM,WAAW,SAASA,QAAO,OAAoB,KAAuD;AACvH,QAAM,EAAE,UAAU,UAAU,QAAQ,OAAO,UAAU,GAAG,eAAe;AACvE,QAAM,cAAc,aAAoD,GAAG;AAE3E,mBAAiB,UAAU,CAAA,UAAS;AAChC,WAAO,eAAA;AACP,UAAM,SAAS,SAAS,cAAc,iBAAiB;AAGvD,QAAI,UAAU,CAAC,QAAQ,SAAS,YAAY,OAAO,GAAG;AAClD;AAAA,IACJ;AAEA,gBAAY,SAAS,MAAA;AAAA,EACzB,CAAC;AAED,QAAM,MAAM,MAAM,OAAO,MAAM;AAE/B,SACI,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,MAAM,WAAW,SAAY,MAAM;AAAA,MACnC,iBAAe,WAAW,SAAS;AAAA,MACnC;AAAA,MACA,QAAQ,QAAQ,MAAM,SAAS;AAAA,MAC/B,MAAM,QAAQ,MAAM,SAAY;AAAA,MAChC,KAAK;AAAA,IAAA;AAAA,IACJ,MAAM,SAAS,MAAM,MAAM,QAAQ,IAAI,IAClC,MAAM,SAAS,IAAI,MAAM,UAAU,CAAA,UAAU,OAAO,UAAU,WAAW,sBAAA,cAAC,cAAM,KAAM,IAAU,KAAM,IACtG,MAAM;AAAA,EAAA;AAGxB,CAAC;"}
|
|
@@ -7,4 +7,4 @@ export type Listbox2OptionProps<T extends Listbox2OptionValue = Listbox2OptionVa
|
|
|
7
7
|
export declare const Option: <T extends Listbox2OptionValue>(props: React.HTMLAttributes<HTMLDivElement> & {
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
value: T;
|
|
10
|
-
} & React.RefAttributes<HTMLDivElement>) => JSX.Element;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>) => React.JSX.Element;
|