@economic/taco 1.0.7 → 1.0.8
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/README.md +84 -84
- package/dist/components/Card/Card.d.ts +14 -0
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Banner/util.js +1 -1
- package/dist/esm/components/Banner/util.js.map +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Button/util.js +23 -18
- package/dist/esm/components/Button/util.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Card/Card.js +75 -0
- package/dist/esm/components/Card/Card.js.map +1 -0
- package/dist/esm/components/Checkbox/Checkbox.js +18 -15
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js +25 -23
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Combobox/useCombobox.js +87 -67
- package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/components/Datepicker/Datepicker.js +52 -48
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Datepicker/useDatepicker.js +34 -27
- package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Context.js +4 -4
- package/dist/esm/components/Dialog/Context.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +58 -39
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/components/Content.js +44 -39
- package/dist/esm/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/components/Dialog/components/Drawer.js +3 -3
- package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
- package/dist/esm/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js +2 -2
- package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/components/Field/Field.js +12 -10
- package/dist/esm/components/Field/Field.js.map +1 -1
- package/dist/esm/components/Form/Form.js +8 -6
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js +8 -6
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js +35 -27
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/HoverCard/HoverCard.js +9 -8
- package/dist/esm/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js +8 -7
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
- package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
- package/dist/esm/components/Icon/components/Attach.js.map +1 -1
- package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
- package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
- package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
- package/dist/esm/components/Icon/components/Basic.js.map +1 -1
- package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
- package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Book.js.map +1 -1
- package/dist/esm/components/Icon/components/Booking.js.map +1 -1
- package/dist/esm/components/Icon/components/Budget.js.map +1 -1
- package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
- package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
- package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
- package/dist/esm/components/Icon/components/Chat.js.map +1 -1
- package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/CircleClose.js.map +1 -1
- package/dist/esm/components/Icon/components/CircleMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/CirclePlus.js.map +1 -1
- package/dist/esm/components/Icon/components/CircleTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
- package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/Close.js.map +1 -1
- package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
- package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
- package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
- package/dist/esm/components/Icon/components/Copy.js.map +1 -1
- package/dist/esm/components/Icon/components/Courses.js.map +1 -1
- package/dist/esm/components/Icon/components/Credit.js.map +1 -1
- package/dist/esm/components/Icon/components/Delete.js.map +1 -1
- package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
- package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
- package/dist/esm/components/Icon/components/Developer.js.map +1 -1
- package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
- package/dist/esm/components/Icon/components/Document.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
- package/dist/esm/components/Icon/components/Download.js.map +1 -1
- package/dist/esm/components/Icon/components/Drag.js.map +1 -1
- package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
- package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
- package/dist/esm/components/Icon/components/Edit.js.map +1 -1
- package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
- package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
- package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
- package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
- package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
- package/dist/esm/components/Icon/components/Export.js.map +1 -1
- package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
- package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
- package/dist/esm/components/Icon/components/Filter.js.map +1 -1
- package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Hash.js.map +1 -1
- package/dist/esm/components/Icon/components/Home.js.map +1 -1
- package/dist/esm/components/Icon/components/Images.js.map +1 -1
- package/dist/esm/components/Icon/components/Import.js.map +1 -1
- package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
- package/dist/esm/components/Icon/components/Info.js.map +1 -1
- package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
- package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
- package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
- package/dist/esm/components/Icon/components/Layout.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
- package/dist/esm/components/Icon/components/Line.js.map +1 -1
- package/dist/esm/components/Icon/components/List.js.map +1 -1
- package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
- package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
- package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/Log.js.map +1 -1
- package/dist/esm/components/Icon/components/Market.js.map +1 -1
- package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
- package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
- package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
- package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
- package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
- package/dist/esm/components/Icon/components/More.js.map +1 -1
- package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Move.js.map +1 -1
- package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
- package/dist/esm/components/Icon/components/Note.js.map +1 -1
- package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
- package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
- package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
- package/dist/esm/components/Icon/components/Period.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Play.js.map +1 -1
- package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/Print.js.map +1 -1
- package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
- package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
- package/dist/esm/components/Icon/components/Projects.js.map +1 -1
- package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
- package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
- package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
- package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
- package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
- package/dist/esm/components/Icon/components/Report.js.map +1 -1
- package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Restore.js.map +1 -1
- package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
- package/dist/esm/components/Icon/components/Sales.js.map +1 -1
- package/dist/esm/components/Icon/components/Search.js.map +1 -1
- package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
- package/dist/esm/components/Icon/components/Secure.js.map +1 -1
- package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Settings.js.map +1 -1
- package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
- package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
- package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
- package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
- package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
- package/dist/esm/components/Icon/components/Star.js.map +1 -1
- package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
- package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
- package/dist/esm/components/Icon/components/Tag.js.map +1 -1
- package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
- package/dist/esm/components/Icon/components/Templates.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Tick.js.map +1 -1
- package/dist/esm/components/Icon/components/Time.js.map +1 -1
- package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
- package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
- package/dist/esm/components/Icon/components/Undock.js.map +1 -1
- package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
- package/dist/esm/components/Icon/components/Warning.js.map +1 -1
- package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
- package/dist/esm/components/Icon/components/Website.js.map +1 -1
- package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
- package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
- package/dist/esm/components/Icon/components/index.js +4 -4
- package/dist/esm/components/Icon/components/index.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js +11 -9
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js +25 -25
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/util.js +2 -2
- package/dist/esm/components/Input/util.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js +25 -24
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Listbox/ScrollableList.js +83 -64
- package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/components/Listbox/useListbox.js +60 -51
- package/dist/esm/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useMultiListbox.js +91 -64
- package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useTypeahead.js +9 -10
- package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/components/Listbox/util.js +85 -48
- package/dist/esm/components/Listbox/util.js.map +1 -1
- package/dist/esm/components/Menu/Context.js +2 -2
- package/dist/esm/components/Menu/Context.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js +43 -20
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/components/Checkbox.js +9 -8
- package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/components/Menu/components/Content.js +13 -10
- package/dist/esm/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/components/Menu/components/Header.js +4 -4
- package/dist/esm/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/components/Menu/components/Item.js +35 -34
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/components/Menu/components/Link.js +11 -10
- package/dist/esm/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/components/Menu/components/RadioGroup.js +18 -16
- package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Menu/components/Separator.js +4 -4
- package/dist/esm/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/components/Menu/components/Trigger.js +5 -5
- package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/components/Navigation/Navigation.js +44 -35
- package/dist/esm/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/PageNumbers.js +28 -23
- package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +56 -39
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePagination.js +21 -7
- package/dist/esm/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
- package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +34 -29
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Popover/Primitives.js +8 -7
- package/dist/esm/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js +15 -11
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js +18 -13
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +57 -45
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js +12 -10
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.js +31 -30
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/useSelect.js +81 -63
- package/dist/esm/components/Select/useSelect.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +19 -12
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +10 -9
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Table/components/BaseTable.js +30 -23
- package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/components/Table/components/PaginatedTable.js +7 -3
- package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/components/Table/components/Table.js +25 -18
- package/dist/esm/components/Table/components/Table.js.map +1 -1
- package/dist/esm/components/Table/components/WindowedTable.js +104 -88
- package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js +146 -122
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +61 -57
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +36 -39
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +89 -79
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowCreation.js +64 -29
- package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTable.js +141 -119
- package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +15 -12
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/components/Table/util/renderColumn.js +10 -10
- package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/components/Table/util/renderRow.js +46 -37
- package/dist/esm/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/components/Table/util/rowIndexPath.js +16 -14
- package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/components/Table/util/sortTypes.js +31 -23
- package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/components/Table/util.js +41 -29
- package/dist/esm/components/Table/util.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +27 -25
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +9 -11
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/Toast/Toast.js +21 -20
- package/dist/esm/components/Toast/Toast.js.map +1 -1
- package/dist/esm/components/Toast/Toaster.js +118 -88
- package/dist/esm/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/components/Toast/util.js +2 -2
- package/dist/esm/components/Toast/util.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +8 -7
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +50 -44
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js +36 -26
- package/dist/esm/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/index.css +661 -661
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/primitives/Button.js +13 -9
- package/dist/esm/primitives/Button.js.map +1 -1
- package/dist/esm/utils/date.js.map +1 -1
- package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/utils/hooks/useDraggable.js +18 -16
- package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/utils/hooks/useDropTarget.js +10 -7
- package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
- package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
- package/dist/esm/utils/hooks/useTimer.js +17 -9
- package/dist/esm/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/utils/input.js +11 -7
- package/dist/esm/utils/input.js.map +1 -1
- package/dist/esm/utils/mergeRefs.js +2 -2
- package/dist/esm/utils/mergeRefs.js.map +1 -1
- package/dist/esm/utils/taillwind.js +2 -2
- package/dist/esm/utils/taillwind.js.map +1 -1
- package/dist/index.css +661 -661
- package/dist/index.d.ts +1 -0
- package/dist/taco.cjs.development.js +2636 -2136
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/dist/utils/tailwind.d.ts +1 -1
- package/package.json +2 -2
- package/plugins/tailwindcss-aria-attributes.js +73 -73
- package/tailwind.config.js +297 -297
- package/types.json +531 -459
@@ -1,17 +1,21 @@
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
1
2
|
import { forwardRef, createElement } from 'react';
|
2
3
|
import cn from 'classnames';
|
3
4
|
import { Root, List, Trigger, Content } from '@radix-ui/react-tabs';
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
id
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
var _excluded = ["id", "defaultId", "children", "onChange", "orientation"],
|
7
|
+
_excluded2 = ["id", "disabled"],
|
8
|
+
_excluded3 = ["id"];
|
9
|
+
var Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
|
10
|
+
var id = props.id,
|
11
|
+
defaultId = props.defaultId,
|
12
|
+
children = props.children,
|
13
|
+
onChange = props.onChange,
|
14
|
+
_props$orientation = props.orientation,
|
15
|
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
16
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
17
|
+
|
18
|
+
var className = cn('yt-tabs', "yt-tabs--" + orientation, {
|
15
19
|
'flex w-full': orientation === 'vertical'
|
16
20
|
}, props.className);
|
17
21
|
return createElement(Root, Object.assign({}, otherProps, {
|
@@ -25,20 +29,19 @@ const Tabs = /*#__PURE__*/forwardRef(function Tabs(props, ref) {
|
|
25
29
|
value: id
|
26
30
|
}), children);
|
27
31
|
});
|
28
|
-
|
29
|
-
|
32
|
+
var TabList = /*#__PURE__*/forwardRef(function Tab(props, ref) {
|
33
|
+
var className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);
|
30
34
|
return createElement(List, Object.assign({}, props, {
|
31
35
|
className: className,
|
32
36
|
ref: ref
|
33
37
|
}));
|
34
38
|
});
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
const className = cn('yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4', disabled ? 'cursor-not-allowed !text-grey' : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue', props.className);
|
39
|
+
var TabTrigger = /*#__PURE__*/forwardRef(function Tab(props, ref) {
|
40
|
+
var id = props.id,
|
41
|
+
disabled = props.disabled,
|
42
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded2);
|
43
|
+
|
44
|
+
var className = cn('yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4', disabled ? 'cursor-not-allowed !text-grey' : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue', props.className);
|
42
45
|
return createElement(Trigger, Object.assign({}, otherProps, {
|
43
46
|
className: className,
|
44
47
|
disabled: disabled,
|
@@ -49,12 +52,11 @@ const TabTrigger = /*#__PURE__*/forwardRef(function Tab(props, ref) {
|
|
49
52
|
value: id
|
50
53
|
}));
|
51
54
|
});
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
const className = cn('yt-tab__panel outline-none', props.className);
|
55
|
+
var TabContent = /*#__PURE__*/forwardRef(function Tab(props, ref) {
|
56
|
+
var id = props.id,
|
57
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded3);
|
58
|
+
|
59
|
+
var className = cn('yt-tab__panel outline-none', props.className);
|
58
60
|
return createElement(Content, Object.assign({}, otherProps, {
|
59
61
|
className: className,
|
60
62
|
ref: ref,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tabs.js","sources":["../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import * as React from 'react';\
|
1
|
+
{"version":3,"file":"Tabs.js","sources":["../../../../src/components/Tabs/Tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\n\nimport { Orientation } from '../../types';\nimport './Tabs.css';\n\nexport type TabsProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * The controlled value of the tab to activate. Should be used in conjunction with `onChange`.\n */\n id?: string;\n /**\n * Set which tab is selected on mount.\n * This has to be one of the existing ids provided for tabs\n */\n defaultId?: string;\n /**\n * Content should be one or an array of `Tabs.Trigger` components inside `Tabs.List` and then\n * followed by one or an array of `Tabs.Content`.\n * *Note* that there can also be tabs that are rendered conditionally.\n */\n children: React.ReactNode;\n /**\n * Define orientation of tabs.\n * @defaultValue horizontal\n */\n orientation?: Orientation;\n /**\n * Callback that is called when tab is changed.\n */\n onChange?: (id: string) => void;\n};\n\nexport type TabListProps = React.HTMLAttributes<HTMLDivElement>;\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};\n\nexport type TabContentProps = React.HTMLAttributes<HTMLDivElement> & {\n /**\n * A unique value that associates the content with a trigger.\n */\n id: string;\n};\n\nexport type ForwardedTabsWithStatics = React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> & {\n /** Tab list component containing all tab triggers, rendered in a `Tabs` group component */\n List: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;\n /** Tab trigger component rendered in a `Tabs.List` component */\n Trigger: React.ForwardRefExoticComponent<TabTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n /** Tab content component rendered in a `Tabs` group component */\n Content: React.ForwardRefExoticComponent<TabContentProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nexport const Tabs = React.forwardRef(function Tabs(props: TabsProps, ref: React.Ref<HTMLDivElement>) {\n const { id, defaultId, children, onChange, orientation = 'horizontal', ...otherProps } = props;\n const className = cn(\n 'yt-tabs',\n `yt-tabs--${orientation}`,\n {\n 'flex w-full': orientation === 'vertical',\n },\n props.className\n );\n\n return (\n <TabsPrimitive.Root\n {...otherProps}\n className={className}\n data-taco=\"tabs\"\n defaultValue={defaultId}\n dir=\"ltr\"\n onValueChange={onChange}\n orientation={orientation}\n ref={ref}\n value={id}\n >\n {children}\n </TabsPrimitive.Root>\n );\n}) as ForwardedTabsWithStatics;\n\nconst TabList = React.forwardRef(function Tab(props: TabListProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('yt-tab__list border-b border-grey-light flex flex-row m-0 mb-4', props.className);\n\n return <TabsPrimitive.List {...props} className={className} ref={ref} />;\n});\n\nconst TabTrigger = React.forwardRef(function Tab(props: TabTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const { id, disabled, ...otherProps } = props;\n const className = cn(\n 'yt-tab bg-transparent border-b-2 border-transparent text-grey-darkest m-0 py-2 px-4',\n disabled\n ? 'cursor-not-allowed !text-grey'\n : 'cursor-pointer rounded-t hover:border-grey-light hover:text-black active:yt-focus active:border-blue focus:yt-focus focus:border-blue',\n props.className\n );\n\n return (\n <TabsPrimitive.Trigger\n {...otherProps}\n className={className}\n disabled={disabled}\n ref={ref}\n style={{\n transition: 'border 0.2s ease-in',\n }}\n value={id}\n />\n );\n});\n\nconst TabContent = React.forwardRef(function Tab(props: TabContentProps, ref: React.Ref<HTMLDivElement>) {\n const { id, ...otherProps } = props;\n const className = cn('yt-tab__panel outline-none', props.className);\n\n return <TabsPrimitive.Content {...otherProps} className={className} ref={ref} value={id} />;\n});\n\nTabs.List = TabList;\nTabs.Trigger = TabTrigger;\nTabs.Content = TabContent;\n"],"names":["Tabs","React","props","ref","id","defaultId","children","onChange","orientation","otherProps","className","cn","TabsPrimitive","defaultValue","dir","onValueChange","value","TabList","Tab","TabTrigger","disabled","style","transition","TabContent","List","Trigger","Content"],"mappings":";;;;;;;;IA+DaA,IAAI,gBAAGC,UAAA,CAAiB,SAASD,IAAT,CAAcE,KAAd,EAAgCC,GAAhC;AACjC,MAAQC,EAAR,GAAyFF,KAAzF,CAAQE,EAAR;AAAA,MAAYC,SAAZ,GAAyFH,KAAzF,CAAYG,SAAZ;AAAA,MAAuBC,QAAvB,GAAyFJ,KAAzF,CAAuBI,QAAvB;AAAA,MAAiCC,QAAjC,GAAyFL,KAAzF,CAAiCK,QAAjC;AAAA,2BAAyFL,KAAzF,CAA2CM,WAA3C;AAAA,MAA2CA,WAA3C,mCAAyD,YAAzD;AAAA,MAA0EC,UAA1E,iCAAyFP,KAAzF;;AACA,MAAMQ,SAAS,GAAGC,EAAE,CAChB,SADgB,gBAEJH,WAFI,EAGhB;AACI,mBAAeA,WAAW,KAAK;AADnC,GAHgB,EAMhBN,KAAK,CAACQ,SANU,CAApB;AASA,SACIT,aAAA,CAACW,IAAD,oBACQH;AACJC,IAAAA,SAAS,EAAEA;iBACD;AACVG,IAAAA,YAAY,EAAER;AACdS,IAAAA,GAAG,EAAC;AACJC,IAAAA,aAAa,EAAER;AACfC,IAAAA,WAAW,EAAEA;AACbL,IAAAA,GAAG,EAAEA;AACLa,IAAAA,KAAK,EAAEZ;IATX,EAWKE,QAXL,CADJ;AAeH,CA1BmB;AA4BpB,IAAMW,OAAO,gBAAGhB,UAAA,CAAiB,SAASiB,GAAT,CAAahB,KAAb,EAAkCC,GAAlC;AAC7B,MAAMO,SAAS,GAAGC,EAAE,CAAC,gEAAD,EAAmET,KAAK,CAACQ,SAAzE,CAApB;AAEA,SAAOT,aAAA,CAACW,IAAD,oBAAwBV;AAAOQ,IAAAA,SAAS,EAAEA;AAAWP,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PropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
1
2
|
import { forwardRef, createElement } from 'react';
|
2
3
|
import cn from 'classnames';
|
3
4
|
import { getInputClasses } from '../Input/util.js';
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
...otherProps
|
12
|
-
} = props;
|
13
|
-
const classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className); // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll
|
6
|
+
var _excluded = ["defaultValue", "highlighted", "invalid", "onKeyDown"];
|
7
|
+
var Textarea = /*#__PURE__*/forwardRef(function Textarea(props, ref) {
|
8
|
+
var onKeyDown = props.onKeyDown,
|
9
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
10
|
+
|
11
|
+
var classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className); // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll
|
14
12
|
// if it has scroll height then the browser reverts to native scrolling behaviour only
|
15
13
|
// so we manually override it to ensure _our_ desired behaviour remains intact
|
16
14
|
|
17
|
-
|
15
|
+
var handleKeyDown = function handleKeyDown(event) {
|
18
16
|
if (event.key === 'Home' || event.key === 'End') {
|
19
17
|
event.preventDefault();
|
20
|
-
|
18
|
+
var position = event.key === 'End' ? event.currentTarget.value.length : 0;
|
21
19
|
event.currentTarget.setSelectionRange(position, position);
|
22
20
|
event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;
|
23
21
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { getInputClasses } from '../Input/util';\n\nexport type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n /** Draws attention to the textarea by changing its style and making it visually prominent */\n highlighted?: boolean;\n /* Whether the input is in an invalid state */\n invalid?: boolean;\n /** Value of the textarea */\n value?: string;\n};\n\nexport const Textarea = React.forwardRef(function Textarea(props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>) {\n const { defaultValue: _, highlighted, invalid, onKeyDown, ...otherProps } = props;\n const classNames = cn(getInputClasses(props), 'py-1 min-h-[75px] disabled:resize-none', props.className);\n\n // home and end keys only navigate to the start/end of textarea value if the textarea container does not scroll\n // if it has scroll height then the browser reverts to native scrolling behaviour only\n // so we manually override it to ensure _our_ desired behaviour remains intact\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault();\n const position = event.key === 'End' ? event.currentTarget.value.length : 0;\n event.currentTarget.setSelectionRange(position, position);\n event.currentTarget.scrollTop = event.key === 'End' ? event.currentTarget.scrollHeight : 0;\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n return <textarea {...otherProps} className={classNames} data-taco=\"textarea\" onKeyDown={handleKeyDown} ref={ref} />;\n});\n"],"names":["Textarea","React","props","ref","onKeyDown","otherProps","classNames","cn","getInputClasses","className","handleKeyDown","event","key","preventDefault","position","currentTarget","value","length","setSelectionRange","scrollTop","scrollHeight"],"mappings":";;;;;;IAaaA,QAAQ,gBAAGC,UAAA,CAAiB,SAASD,QAAT,CAAkBE,KAAlB,EAAwCC,GAAxC;AACrC,MAA+CC,SAA/C,GAA4EF,KAA5E,CAA+CE,SAA/C;AAAA,MAA6DC,UAA7D,iCAA4EH,KAA5E;;AACA,MAAMI,UAAU,GAAGC,EAAE,CAACC,eAAe,CAACN,KAAD,CAAhB,EAAyB,wCAAzB,EAAmEA,KAAK,CAACO,SAAzE,CAArB;AAGA;AACA;;AACA,MAAMC,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;AAClB,QAAIA,KAAK,CAACC,GAAN,KAAc,MAAd,IAAwBD,KAAK,CAACC,GAAN,KAAc,KAA1C,EAAiD;AAC7CD,MAAAA,KAAK,CAACE,cAAN;AACA,UAAMC,QAAQ,GAAGH,KAAK,CAACC,GAAN,KAAc,KAAd,GAAsBD,KAAK,CAACI,aAAN,CAAoBC,KAApB,CAA0BC,MAAhD,GAAyD,CAA1E;AACAN,MAAAA,KAAK,CAACI,aAAN,CAAoBG,iBAApB,CAAsCJ,QAAtC,EAAgDA,QAAhD;AACAH,MAAAA,KAAK,CAACI,aAAN,CAAoBI,SAApB,GAAgCR,KAAK,CAACC,GAAN,KAAc,KAAd,GAAsBD,KAAK,CAACI,aAAN,CAAoBK,YAA1C,GAAyD,CAAzF;AACH;;AAED,QAAIhB,SAAJ,EAAe;AACXA,MAAAA,SAAS,CAACO,KAAD,CAAT;AACH;AACJ,GAXD;;AAaA,SAAOV,aAAA,WAAA,oBAAcI;AAAYI,IAAAA,SAAS,EAAEH;iBAAsB;AAAWF,IAAAA,SAAS,EAAEM;AAAeP,IAAAA,GAAG,EAAEA;IAArG,CAAP;AACH,CArBuB;;;;"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
1
2
|
import React__default from 'react';
|
2
3
|
import cn from 'classnames';
|
3
4
|
import { IconButton } from '../IconButton/IconButton.js';
|
@@ -6,36 +7,36 @@ import useTimer from '../../utils/hooks/useTimer.js';
|
|
6
7
|
import { getBadgeIcon } from './util.js';
|
7
8
|
import { useLocalization } from '../Provider/Provider.js';
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
var _excluded = ["content", "lastUpdated", "onClose", "options"];
|
11
|
+
var Toast = function Toast(_ref) {
|
12
|
+
var content = _ref.content,
|
13
|
+
lastUpdated = _ref.lastUpdated,
|
14
|
+
handleClose = _ref.onClose,
|
15
|
+
options = _ref.options,
|
16
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
17
|
+
|
18
|
+
var _useLocalization = useLocalization(),
|
19
|
+
texts = _useLocalization.texts;
|
20
|
+
|
21
|
+
var autoClose = options.autoClose,
|
22
|
+
_options$type = options.type,
|
23
|
+
type = _options$type === void 0 ? 'default' : _options$type;
|
24
|
+
var className = cn('bg-white relative flex items-center py-1 px-2 mt-3 w-full rounded yt-shadow', {
|
24
25
|
'border border-grey': type === 'default' || type === 'loading' || !type,
|
25
26
|
'border border-grey-darker': type === 'success',
|
26
27
|
'border border-blue': type === 'information',
|
27
28
|
'border border-yellow-dark': type === 'warning',
|
28
29
|
'border border-red': type === 'error'
|
29
30
|
});
|
30
|
-
|
31
|
-
|
32
|
-
React__default.useEffect(()
|
31
|
+
var timer = useTimer(autoClose, handleClose);
|
32
|
+
var controls = useAnimation();
|
33
|
+
React__default.useEffect(function () {
|
33
34
|
if (autoClose) {
|
34
35
|
timer.start();
|
35
36
|
}
|
36
37
|
}, [autoClose]);
|
37
38
|
|
38
|
-
|
39
|
+
var triggerUpdateAnimation = function triggerUpdateAnimation() {
|
39
40
|
try {
|
40
41
|
return Promise.resolve(controls.start({
|
41
42
|
scale: 1.05
|
@@ -49,7 +50,7 @@ const Toast = ({
|
|
49
50
|
}
|
50
51
|
};
|
51
52
|
|
52
|
-
React__default.useEffect(()
|
53
|
+
React__default.useEffect(function () {
|
53
54
|
if (lastUpdated) {
|
54
55
|
triggerUpdateAnimation();
|
55
56
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Toast.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import React from 'react';\
|
1
|
+
{"version":3,"file":"Toast.js","sources":["../../../../src/components/Toast/Toast.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport { motion, useAnimation } from 'framer-motion';\nimport useTimer from '../../utils/hooks/useTimer';\nimport { getBadgeIcon } from './util';\nimport { State } from '../../types';\nimport { useLocalization } from '../Provider/Provider';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type ToastsTexts = {\n /** Aria-label for the close icon button of toast */\n dismiss: string;\n};\n\nexport type ToastType = Omit<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 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 * Note that content can also be `null`, resulting in a slimmer version of your toast with a vertically centered title\n */\n content: React.ReactNode;\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('bg-white relative flex items-center py-1 px-2 mt-3 w-full rounded yt-shadow', {\n 'border border-grey': type === 'default' || type === 'loading' || !type,\n 'border border-grey-darker': type === 'success',\n 'border border-blue': type === 'information',\n 'border border-yellow-dark': type === 'warning',\n 'border border-red': type === 'error',\n });\n const timer = useTimer(autoClose, handleClose);\n const controls = useAnimation();\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 >\n {getBadgeIcon(type)}\n {content && <div className=\"flex-grow\">{content}</div>}\n <IconButton\n appearance=\"discrete\"\n className=\"text-grey-darkest cursor-pointer -mr-2 !px-0\"\n icon=\"close\"\n aria-label={texts.toasts.dismiss}\n onClick={handleClose}\n />\n </motion.div>\n );\n};\n"],"names":["Toast","content","lastUpdated","handleClose","onClose","options","props","useLocalization","texts","autoClose","type","className","cn","timer","useTimer","controls","useAnimation","React","useEffect","start","triggerUpdateAnimation","scale","running","motion","div","animate","onMouseEnter","pause","onMouseLeave","resume","getBadgeIcon","IconButton","appearance","icon","toasts","dismiss","onClick"],"mappings":";;;;;;;;;;IA4CaA,KAAK,GAAG,SAARA,KAAQ;MAAGC,eAAAA;MAASC,mBAAAA;MAAsBC,mBAATC;MAAsBC,eAAAA;MAAYC;;AAC5E,yBAAkBC,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AACA,MAAQC,SAAR,GAAwCJ,OAAxC,CAAQI,SAAR;AAAA,sBAAwCJ,OAAxC,CAAmBK,IAAnB;AAAA,MAAmBA,IAAnB,8BAA0B,SAA1B;AACA,MAAMC,SAAS,GAAGC,EAAE,CAAC,6EAAD,EAAgF;AAChG,0BAAsBF,IAAI,KAAK,SAAT,IAAsBA,IAAI,KAAK,SAA/B,IAA4C,CAACA,IAD6B;AAEhG,iCAA6BA,IAAI,KAAK,SAF0D;AAGhG,0BAAsBA,IAAI,KAAK,aAHiE;AAIhG,iCAA6BA,IAAI,KAAK,SAJ0D;AAKhG,yBAAqBA,IAAI,KAAK;AALkE,GAAhF,CAApB;AAOA,MAAMG,KAAK,GAAGC,QAAQ,CAACL,SAAD,EAAYN,WAAZ,CAAtB;AACA,MAAMY,QAAQ,GAAGC,YAAY,EAA7B;AAEAC,EAAAA,cAAK,CAACC,SAAN,CAAgB;AACZ,QAAIT,SAAJ,EAAe;AACXI,MAAAA,KAAK,CAACM,KAAN;AACH;AACJ,GAJD,EAIG,CAACV,SAAD,CAJH;;AAMA,MAAMW,sBAAsB,YAAtBA,sBAAsB;AAAA;6BAClBL,QAAQ,CAACI,KAAT,CAAe;AAAEE,QAAAA,KAAK,EAAE;AAAT,OAAf;+BACAN,QAAQ,CAACI,KAAT,CAAe;AAAEE,UAAAA,KAAK,EAAE;AAAT,SAAf;;AACT,KAH2B;AAAA;AAAA;AAAA,GAA5B;;AAKAJ,EAAAA,cAAK,CAACC,SAAN,CAAgB;AACZ,QAAIhB,WAAJ,EAAiB;AACbkB,MAAAA,sBAAsB;;AAEtB,UAAIP,KAAK,CAACS,OAAV,EAAmB;AACfT,QAAAA,KAAK,CAACM,KAAN;AACH;AACJ;AACJ,GARD,EAQG,CAACjB,WAAD,CARH;AAUA,SACIe,4BAAA,CAACM,MAAM,CAACC,GAAR,oBACQlB;AACJmB,IAAAA,OAAO,EAAEV;AACTJ,IAAAA,SAAS,EAAEA;iBACD;AACVe,IAAAA,YAAY,EAAEb,KAAK,CAACc;AACpBC,IAAAA,YAAY,EAAEf,KAAK,CAACgB;IANxB,EAQKC,YAAY,CAACpB,IAAD,CARjB,EASKT,OAAO,IAAIgB,4BAAA,MAAA;AAAKN,IAAAA,SAAS,EAAC;GAAf,EAA4BV,OAA5B,CAThB,EAUIgB,4BAAA,CAACc,UAAD;AACIC,IAAAA,UAAU,EAAC;AACXrB,IAAAA,SAAS,EAAC;AACVsB,IAAAA,IAAI,EAAC;kBACOzB,KAAK,CAAC0B,MAAN,CAAaC;AACzBC,IAAAA,OAAO,EAAEjC;GALb,CAVJ,CADJ;AAoBH;;;;"}
|
@@ -1,51 +1,65 @@
|
|
1
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
1
2
|
import { useState, useCallback, useEffect, createElement, useContext, createContext } from 'react';
|
2
3
|
import { v4 } from 'uuid';
|
3
4
|
import { AnimatePresence, motion } from 'framer-motion';
|
4
5
|
import { Toast } from './Toast.js';
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
var _excluded = ["children"];
|
8
|
+
var DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
9
|
+
var ToastContext = /*#__PURE__*/createContext({});
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
var insertToastWithoutDuplicates = function insertToastWithoutDuplicates(currentToasts, id, content, options, close) {
|
12
|
+
var nextToasts = [].concat(currentToasts);
|
13
|
+
var existingToastIndex = currentToasts.findIndex(function (toast) {
|
14
|
+
return JSON.stringify(toast.content) === JSON.stringify(content);
|
15
|
+
});
|
12
16
|
|
13
17
|
if (existingToastIndex > -1) {
|
14
18
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
15
19
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
16
20
|
} else {
|
17
21
|
nextToasts.push({
|
18
|
-
id,
|
22
|
+
id: id,
|
19
23
|
content: typeof content === 'function' ? content(close) : content,
|
20
|
-
options
|
24
|
+
options: options
|
21
25
|
});
|
22
26
|
}
|
23
27
|
|
24
28
|
return nextToasts;
|
25
29
|
};
|
26
30
|
|
27
|
-
|
28
|
-
children,
|
29
|
-
|
30
|
-
}) => {
|
31
|
-
const [toasts, setToasts] = useState([]);
|
31
|
+
var ToastProvider = function ToastProvider(_ref) {
|
32
|
+
var children = _ref.children,
|
33
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
+
var _React$useState = useState([]),
|
36
|
+
toasts = _React$useState[0],
|
37
|
+
setToasts = _React$useState[1];
|
38
|
+
|
39
|
+
var handleClose = function handleClose(id) {
|
40
|
+
setToasts(function (currentToasts) {
|
41
|
+
return currentToasts.filter(function (toast) {
|
42
|
+
return toast.id !== id;
|
43
|
+
});
|
44
|
+
});
|
35
45
|
}; // memoize (useCallback) this function,
|
36
46
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
37
47
|
|
38
48
|
|
39
|
-
|
40
|
-
|
49
|
+
var toaster = useCallback(function (content, options) {
|
50
|
+
var id = v4();
|
41
51
|
|
42
|
-
|
52
|
+
var close = function close() {
|
53
|
+
return handleClose(id);
|
54
|
+
};
|
43
55
|
|
44
|
-
setToasts(
|
56
|
+
setToasts(function (currentToasts) {
|
57
|
+
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
58
|
+
});
|
45
59
|
|
46
|
-
|
47
|
-
setToasts(currentToasts
|
48
|
-
|
60
|
+
var update = function update(content, options) {
|
61
|
+
setToasts(function (currentToasts) {
|
62
|
+
var nextToasts = currentToasts.filter(function (toast) {
|
49
63
|
if (toast.lastDuplicateId) {
|
50
64
|
return toast.lastDuplicateId !== id;
|
51
65
|
}
|
@@ -56,70 +70,80 @@ const ToastProvider = ({
|
|
56
70
|
});
|
57
71
|
};
|
58
72
|
|
59
|
-
|
60
|
-
update(content, {
|
61
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
62
|
-
|
73
|
+
var success = function success(content, options) {
|
74
|
+
update(content, _extends({
|
75
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
76
|
+
}, options, {
|
63
77
|
type: 'success'
|
64
|
-
});
|
78
|
+
}));
|
65
79
|
};
|
66
80
|
|
67
|
-
|
68
|
-
update(content, {
|
81
|
+
var error = function error(content, options) {
|
82
|
+
update(content, _extends({}, options, {
|
69
83
|
type: 'error'
|
70
|
-
});
|
84
|
+
}));
|
71
85
|
};
|
72
86
|
|
73
|
-
|
74
|
-
update(content, {
|
87
|
+
var warning = function warning(content, options) {
|
88
|
+
update(content, _extends({}, options, {
|
75
89
|
type: 'warning'
|
76
|
-
});
|
90
|
+
}));
|
77
91
|
};
|
78
92
|
|
79
|
-
|
80
|
-
update(content, {
|
93
|
+
var information = function information(content, options) {
|
94
|
+
update(content, _extends({}, options, {
|
81
95
|
type: 'information'
|
82
|
-
});
|
96
|
+
}));
|
83
97
|
};
|
84
98
|
|
85
|
-
|
86
|
-
update(content, {
|
99
|
+
var loading = function loading(content, options) {
|
100
|
+
update(content, _extends({}, options, {
|
87
101
|
type: 'loading'
|
88
|
-
});
|
102
|
+
}));
|
89
103
|
};
|
90
104
|
|
91
105
|
return {
|
92
|
-
success,
|
93
|
-
error,
|
94
|
-
warning,
|
95
|
-
information,
|
96
|
-
loading,
|
97
|
-
close
|
106
|
+
success: success,
|
107
|
+
error: error,
|
108
|
+
warning: warning,
|
109
|
+
information: information,
|
110
|
+
loading: loading,
|
111
|
+
close: close
|
98
112
|
};
|
99
113
|
}, []); // no need to rebind these every render, do them once in an effect
|
100
114
|
|
101
|
-
useEffect(()
|
102
|
-
toaster.success = (content, options)
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
115
|
+
useEffect(function () {
|
116
|
+
toaster.success = function (content, options) {
|
117
|
+
return toaster(content, _extends({
|
118
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
119
|
+
}, options, {
|
120
|
+
type: 'success'
|
121
|
+
}));
|
122
|
+
};
|
107
123
|
|
108
|
-
toaster.error = (content, options)
|
109
|
-
|
110
|
-
|
124
|
+
toaster.error = function (content, options) {
|
125
|
+
return toaster(content, _extends({}, options, {
|
126
|
+
type: 'error'
|
127
|
+
}));
|
128
|
+
};
|
111
129
|
|
112
|
-
toaster.warning = (content, options)
|
113
|
-
|
114
|
-
|
130
|
+
toaster.warning = function (content, options) {
|
131
|
+
return toaster(content, _extends({}, options, {
|
132
|
+
type: 'warning'
|
133
|
+
}));
|
134
|
+
};
|
115
135
|
|
116
|
-
toaster.information = (content, options)
|
117
|
-
|
118
|
-
|
136
|
+
toaster.information = function (content, options) {
|
137
|
+
return toaster(content, _extends({}, options, {
|
138
|
+
type: 'information'
|
139
|
+
}));
|
140
|
+
};
|
119
141
|
|
120
|
-
toaster.loading = (content, options)
|
121
|
-
|
122
|
-
|
142
|
+
toaster.loading = function (content, options) {
|
143
|
+
return toaster(content, _extends({}, options, {
|
144
|
+
type: 'loading'
|
145
|
+
}));
|
146
|
+
};
|
123
147
|
}, []);
|
124
148
|
return createElement(ToastContext.Provider, Object.assign({}, props, {
|
125
149
|
value: toaster
|
@@ -129,35 +153,41 @@ const ToastProvider = ({
|
|
129
153
|
role: "log"
|
130
154
|
}, createElement(AnimatePresence, {
|
131
155
|
initial: false
|
132
|
-
}, toasts.map(
|
133
|
-
|
134
|
-
|
135
|
-
type: 'spring',
|
136
|
-
damping: 20,
|
137
|
-
stiffness: 300
|
138
|
-
},
|
139
|
-
initial: {
|
140
|
-
opacity: 0,
|
141
|
-
y: 10,
|
142
|
-
scale: 0.5
|
143
|
-
},
|
144
|
-
animate: {
|
145
|
-
opacity: 1,
|
146
|
-
y: 0,
|
147
|
-
scale: 1
|
148
|
-
},
|
149
|
-
exit: {
|
150
|
-
opacity: 0,
|
151
|
-
scale: 0.5,
|
156
|
+
}, toasts.map(function (toast) {
|
157
|
+
return createElement(motion.div, {
|
158
|
+
key: toast.id,
|
152
159
|
transition: {
|
153
|
-
|
160
|
+
type: 'spring',
|
161
|
+
damping: 20,
|
162
|
+
stiffness: 300
|
163
|
+
},
|
164
|
+
initial: {
|
165
|
+
opacity: 0,
|
166
|
+
y: 10,
|
167
|
+
scale: 0.5
|
168
|
+
},
|
169
|
+
animate: {
|
170
|
+
opacity: 1,
|
171
|
+
y: 0,
|
172
|
+
scale: 1
|
173
|
+
},
|
174
|
+
exit: {
|
175
|
+
opacity: 0,
|
176
|
+
scale: 0.5,
|
177
|
+
transition: {
|
178
|
+
duration: 0.2
|
179
|
+
}
|
180
|
+
}
|
181
|
+
}, createElement(Toast, Object.assign({}, toast, {
|
182
|
+
onClose: function onClose() {
|
183
|
+
return handleClose(toast.id);
|
154
184
|
}
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
|
185
|
+
})));
|
186
|
+
}))));
|
187
|
+
};
|
188
|
+
var useToast = function useToast() {
|
189
|
+
return useContext(ToastContext);
|
159
190
|
};
|
160
|
-
const useToast = () => useContext(ToastContext);
|
161
191
|
|
162
192
|
export { ToastProvider, useToast };
|
163
193
|
//# sourceMappingURL=Toaster.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Toaster.js","sources":["../../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { v4 as uuid } from 'uuid';\r\nimport { AnimatePresence, motion } from 'framer-motion';\r\nimport { ToastOptions, Toast, ToastProps } from './Toast';\r\nimport './Toast.css';\r\n\r\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\r\n\r\ntype ToastCreator<T> = (content: React.ReactNode | ((close: () => void) => React.ReactNode), options?: ToastOptions) => T;\r\n\r\nexport interface Toaster<T> extends ToastCreator<T> {\r\n success: ToastCreator<T>;\r\n error: ToastCreator<T>;\r\n warning: ToastCreator<T>;\r\n information: ToastCreator<T>;\r\n loading: ToastCreator<T>;\r\n}\r\n\r\nexport interface ToastReference {\r\n /** Show a success toast */\r\n success: ToastCreator<void>;\r\n /** Show an error toast */\r\n error: ToastCreator<void>;\r\n /** Show a warning toast */\r\n warning: ToastCreator<void>;\r\n /** Show an information toast */\r\n information: ToastCreator<void>;\r\n /** Show a loading toast */\r\n loading: ToastCreator<void>;\r\n /**\r\n * Close an existing toast.\r\n * The toast function returns a reference to the active toast,\r\n * allowing you to programmatically close it when needed\r\n */\r\n close: () => void;\r\n}\r\n\r\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\r\n\r\nexport interface ToastProviderProps {\r\n children: React.ReactNode;\r\n}\r\n\r\ntype InternalToast = Omit<ToastProps, 'onClose'>;\r\n\r\nconst insertToastWithoutDuplicates = (\r\n currentToasts: InternalToast[],\r\n id: string,\r\n content: React.ReactNode,\r\n options: ToastOptions,\r\n close: () => void\r\n): InternalToast[] => {\r\n const nextToasts = [...currentToasts];\r\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\r\n\r\n if (existingToastIndex > -1) {\r\n nextToasts[existingToastIndex].lastDuplicateId = id;\r\n nextToasts[existingToastIndex].lastUpdated = Date.now();\r\n } else {\r\n nextToasts.push({\r\n id,\r\n content: typeof content === 'function' ? content(close) : content,\r\n options,\r\n });\r\n }\r\n\r\n return nextToasts;\r\n};\r\n\r\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): JSX.Element => {\r\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\r\n\r\n const handleClose = (id: string): void => {\r\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\r\n };\r\n\r\n // memoize (useCallback) this function,\r\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\r\n const toaster = React.useCallback((content: React.ReactNode, options: ToastOptions): ToastReference => {\r\n const id = uuid();\r\n const close = (): void => handleClose(id);\r\n\r\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\r\n\r\n const update = (content: React.ReactNode, options: ToastOptions): void => {\r\n setToasts(currentToasts => {\r\n const nextToasts = currentToasts.filter(toast => {\r\n if (toast.lastDuplicateId) {\r\n return toast.lastDuplicateId !== id;\r\n }\r\n\r\n return toast.id !== id;\r\n });\r\n return insertToastWithoutDuplicates(nextToasts, uuid(), content, options, close);\r\n });\r\n };\r\n\r\n const success = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\r\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\r\n };\r\n const error = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\r\n update(content, { ...options, type: 'error' });\r\n };\r\n const warning = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\r\n update(content, { ...options, type: 'warning' });\r\n };\r\n const information = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\r\n update(content, { ...options, type: 'information' });\r\n };\r\n const loading = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\r\n update(content, { ...options, type: 'loading' });\r\n };\r\n\r\n return {\r\n success,\r\n error,\r\n warning,\r\n information,\r\n loading,\r\n close,\r\n };\r\n }, []) as Toaster<ToastReference>;\r\n\r\n // no need to rebind these every render, do them once in an effect\r\n React.useEffect(() => {\r\n toaster.success = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\r\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\r\n toaster.error = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\r\n toaster(content, { ...options, type: 'error' });\r\n toaster.warning = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\r\n toaster(content, { ...options, type: 'warning' });\r\n toaster.information = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\r\n toaster(content, { ...options, type: 'information' });\r\n toaster.loading = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\r\n toaster(content, { ...options, type: 'loading' });\r\n }, []);\r\n\r\n return (\r\n <ToastContext.Provider {...props} value={toaster}>\r\n {children}\r\n <div\r\n id=\"yt-toast__container\"\r\n className=\"pointer-events-all absolute bottom-0 right-0 !left-auto z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end\"\r\n role=\"log\"\r\n >\r\n <AnimatePresence initial={false}>\r\n {toasts.map((toast: ToastProps) => (\r\n <motion.div\r\n key={toast.id}\r\n transition={{\r\n type: 'spring',\r\n damping: 20,\r\n stiffness: 300,\r\n }}\r\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\r\n animate={{ opacity: 1, y: 0, scale: 1 }}\r\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}\r\n >\r\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\r\n </motion.div>\r\n ))}\r\n </AnimatePresence>\r\n </div>\r\n </ToastContext.Provider>\r\n );\r\n};\r\n\r\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\r\n"],"names":["DEFAULT_AUTO_CLOSE_TIMEOUT","ToastContext","React","insertToastWithoutDuplicates","currentToasts","id","content","options","close","nextToasts","existingToastIndex","findIndex","toast","JSON","stringify","lastDuplicateId","lastUpdated","Date","now","push","ToastProvider","children","props","toasts","setToasts","handleClose","filter","toaster","uuid","update","success","autoClose","type","error","warning","information","loading","Provider","value","className","role","AnimatePresence","initial","map","motion","div","key","transition","damping","stiffness","opacity","y","scale","animate","exit","duration","Toast","onClose","useToast"],"mappings":";;;;;AAMA,MAAMA,0BAA0B,GAAG,IAAnC;AA+BA,MAAMC,YAAY,gBAAGC,aAAA,CAA6C,EAA7C,CAArB;;AAQA,MAAMC,4BAA4B,GAAG,CACjCC,aADiC,EAEjCC,EAFiC,EAGjCC,OAHiC,EAIjCC,OAJiC,EAKjCC,KALiC;AAOjC,QAAMC,UAAU,GAAG,CAAC,GAAGL,aAAJ,CAAnB;AACA,QAAMM,kBAAkB,GAAGN,aAAa,CAACO,SAAd,CAAwBC,KAAK,IAAIC,IAAI,CAACC,SAAL,CAAeF,KAAK,CAACN,OAArB,MAAkCO,IAAI,CAACC,SAAL,CAAeR,OAAf,CAAnE,CAA3B;;AAEA,MAAII,kBAAkB,GAAG,CAAC,CAA1B,EAA6B;AACzBD,IAAAA,UAAU,CAACC,kBAAD,CAAV,CAA+BK,eAA/B,GAAiDV,EAAjD;AACAI,IAAAA,UAAU,CAACC,kBAAD,CAAV,CAA+BM,WAA/B,GAA6CC,IAAI,CAACC,GAAL,EAA7C;AACH,GAHD,MAGO;AACHT,IAAAA,UAAU,CAACU,IAAX,CAAgB;AACZd,MAAAA,EADY;AAEZC,MAAAA,OAAO,EAAE,OAAOA,OAAP,KAAmB,UAAnB,GAAgCA,OAAO,CAACE,KAAD,CAAvC,GAAiDF,OAF9C;AAGZC,MAAAA;AAHY,KAAhB;AAKH;;AAED,SAAOE,UAAP;AACH,CAtBD;;MAwBaW,aAAa,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAD;AACzB,QAAM,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X;AAAcC,MAAAA,CAAC,EAAE,CAAjB;AAAoBC,MAAAA,KAAK,EAAE;AAA3B;AACTE,IAAAA,IAAI,EAAE;AAAEJ,MAAAA,OAAO,EAAE,CAAX;AAAcE,MAAAA,KAAK,EAAE,GAArB;AAA0BL,MAAAA,UAAU,EAAE;AAAEQ,QAAAA,QAAQ,EAAE;AAAZ;AAAtC;GATV,EAWIrD,aAAA,CAACsD,KAAD,oBAAW5C;AAAO6C,IAAAA,OAAO,EAAE,MAAMhC,WAAW,CAACb,KAAK,CAACP,EAAP;IAA5C,CAXJ,CADH,CADL,CALJ,CAFJ,CADJ;AA4BH;MAEYqD,QAAQ,GAAG,MAA+BxD,UAAA,CAAiBD,YAAjB;;;;"}
|
1
|
+
{"version":3,"file":"Toaster.js","sources":["../../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { ToastOptions, Toast, ToastProps } from './Toast';\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: React.ReactNode | ((close: () => void) => React.ReactNode), options?: ToastOptions) => T;\n\nexport interface Toaster<T> extends ToastCreator<T> {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n}\n\nexport interface 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 interface ToastProviderProps {\n children: React.ReactNode;\n}\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: React.ReactNode,\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) {\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\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: React.ReactNode, options: ToastOptions): ToastReference => {\n const id = uuid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: React.ReactNode, 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, uuid(), content, options, close);\n });\n };\n\n const success = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: React.ReactNode, 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: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: React.ReactNode, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <div\n id=\"yt-toast__container\"\n className=\"pointer-events-all absolute bottom-0 right-0 !left-auto z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end\"\n role=\"log\"\n >\n <AnimatePresence initial={false}>\n {toasts.map((toast: ToastProps) => (\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 >\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["DEFAULT_AUTO_CLOSE_TIMEOUT","ToastContext","React","insertToastWithoutDuplicates","currentToasts","id","content","options","close","nextToasts","existingToastIndex","findIndex","toast","JSON","stringify","lastDuplicateId","lastUpdated","Date","now","push","ToastProvider","children","props","toasts","setToasts","handleClose","filter","toaster","uuid","update","success","autoClose","type","error","warning","information","loading","Provider","value","className","role","AnimatePresence","initial","map","motion","div","key","transition","damping","stiffness","opacity","y","scale","animate","exit","duration","Toast","onClose","useToast"],"mappings":";;;;;;;AAMA,IAAMA,0BAA0B,GAAG,IAAnC;AA+BA,IAAMC,YAAY,gBAAGC,aAAA,CAA6C,EAA7C,CAArB;;AAQA,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA+B,CACjCC,aADiC,EAEjCC,EAFiC,EAGjCC,OAHiC,EAIjCC,OAJiC,EAKjCC,KALiC;AAOjC,MAAMC,UAAU,aAAOL,aAAP,CAAhB;AACA,MAAMM,kBAAkB,GAAGN,aAAa,CAACO,SAAd,CAAwB,UAAAC,KAAK;AAAA,WAAIC,IAAI,CAACC,SAAL,CAAeF,KAAK,CAACN,OAArB,MAAkCO,IAAI,CAACC,SAAL,CAAeR,OAAf,CAAtC;AAAA,GAA7B,CAA3B;;AAEA,MAAII,kBAAkB,GAAG,CAAC,CAA1B,EAA6B;AACzBD,IAAAA,UAAU,CAACC,kBAAD,CAAV,CAA+BK,eAA/B,GAAiDV,EAAjD;AACAI,IAAAA,UAAU,CAACC,kBAAD,CAAV,CAA+BM,WAA/B,GAA6CC,IAAI,CAACC,GAAL,EAA7C;AACH,GAHD,MAGO;AACHT,IAAAA,UAAU,CAACU,IAAX,CAAgB;AACZd,MAAAA,EAAE,EAAFA,EADY;AAEZC,MAAAA,OAAO,EAAE,OAAOA,OAAP,KAAmB,UAAnB,GAAgCA,OAAO,CAACE,KAAD,CAAvC,GAAiDF,OAF9C;AAGZC,MAAAA,OAAO,EAAPA;AAHY,KAAhB;AAKH;;AAED,SAAOE,UAAP;AACH,CAtBD;;IAwBaW,aAAa,GAAG,SAAhBA,aAAgB;MAAGC,gBAAAA;MAAaC;;AACzC,wBAA4BpB,QAAA,CAAg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FD;AAGRC,QAAAA,SAAS,EAAE;AAHH;AAKZP,MAAAA,OAAO,EAAE;AAAEQ,QAAAA,OAAO,EAAE,CAAX;AAAcC,QAAAA,CAAC,EAAE,EAAjB;AAAqBC,QAAAA,KAAK,EAAE;AAA5B;AACTC,MAAAA,OAAO,EAAE;AAAEH,QAAAA,OAAO,EAAE,CAAX;AAAcC,QAAAA,CAAC,EAAE,CAAjB;AAAoBC,QAAAA,KAAK,EAAE;AAA3B;AACTE,MAAAA,IAAI,EAAE;AAAEJ,QAAAA,OAAO,EAAE,CAAX;AAAcE,QAAAA,KAAK,EAAE,GAArB;AAA0BL,QAAAA,UAAU,EAAE;AAAEQ,UAAAA,QAAQ,EAAE;AAAZ;AAAtC;KATV,EAWIrD,aAAA,CAACsD,KAAD,oBAAW5C;AAAO6C,MAAAA,OAAO,EAAE;AAAA,eAAMhC,WAAW,CAACb,KAAK,CAACP,EAAP,CAAjB;AAAA;MAA3B,CAXJ,CADQ;AAAA,GAAX,CADL,CALJ,CAFJ,CADJ;AA4BH;IAEYqD,QAAQ,GAAG,SAAXA,QAAW;AAAA,SAA+BxD,UAAA,CAAiBD,YAAjB,CAA/B;AAAA;;;;"}
|
@@ -3,8 +3,8 @@ import cn from 'classnames';
|
|
3
3
|
import { Icon } from '../Icon/Icon.js';
|
4
4
|
import { Spinner } from '../Spinner/Spinner.js';
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
var getBadgeIcon = function getBadgeIcon(type) {
|
7
|
+
var css = 'rounded-full flex-shrink-0 mr-2';
|
8
8
|
|
9
9
|
switch (type) {
|
10
10
|
case 'success':
|