@economic/taco 1.15.0 → 1.15.1
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 +82 -82
- package/dist/components/AlertDialog/components/Content.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Calendar/Calendar.stories.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.stories.d.ts +1 -1
- package/dist/components/Dialog/components/Content.d.ts +1 -1
- package/dist/components/Dialog/components/Drawer.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -2
- package/dist/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/components/Listbox/Listbox.d.ts +2 -2
- package/dist/components/Listbox/Listbox.stories.d.ts +1 -1
- package/dist/components/Listbox/ScrollableList.d.ts +1 -1
- package/dist/components/Menu/components/Checkbox.d.ts +1 -1
- package/dist/components/Menu/components/Content.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Menu/components/Trigger.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/SearchInput/SearchInput.stories.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.stories.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +1 -1
- package/dist/components/Select2/components/Trigger.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/index.css +190 -190
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Drawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/AccountPreview.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Accounting.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/AccountingYear.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/AccountingYearCancel.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowBottom.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowDown.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowEnd.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowLeft.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowRight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowStart.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowTop.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ArrowUp.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Attach.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/AttachAuto.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/AttachCancel.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Autotext.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/AutotextInsert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Basic.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/BasicTabs.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/BellSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Book.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Booking.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Budget.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CashAccount.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CashReports.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Chat.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChatSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronDown.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronDownDouble.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronDownSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronLeft.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronLeftDouble.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronLeftSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronRight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronRightDouble.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronRightSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronUp.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronUpDouble.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ChevronUpSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CircleClose.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CircleMinus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CirclePlus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/CircleTick.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Clamp.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ClampOpen.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Close.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ConnectionEnable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ConnectionRevoke.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Contacts.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Copy.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Courses.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Credit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Delete.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DeletePermanently.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Depecriate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Developer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DistributionTemplate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Document.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentApprove.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentCreateEntry.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentCut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentError.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentIsolatePage.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentMerge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentMove.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentPreview.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentReceived.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentSplit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/DocumentTime.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Download.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ECopedia.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ESignature.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EllipsisHorizontal.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EllipsisVertical.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntriesOnAccount.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntriesOpen.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntriesWarning.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Envelope.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/EnvelopeApproved.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ExpandView.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Expenses.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Export.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ExportToExcel.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ExportToPdf.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/FilterSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/GraphSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Hash.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Home.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Images.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Import.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Inbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/InboxEinvoicing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/InboxScanning.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/InboxSmart.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Info.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Inventory.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/InventoryMatrix.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/JournalPro.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Layout.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LayoutBoth.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LayoutFirst.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LayoutLast.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LayoutNone.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Lightbulb.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Line.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/List.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ListBulleted.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ListSearch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LockOpen.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Log.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/LogOut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Market.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/MatchAmount.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/MatchEntries.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Mileage.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ModalResize.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ModalShrink.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/More.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/MoreSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Move.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/NavigationList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Note.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/NoteFollowUp.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/NoteRead.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Numbers.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/PartnerApi.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Period.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/PersonChange.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/PersonMinus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/PersonPlus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/PersonTick.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Play.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/PlusMinus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Print.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ProcessPayment.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ProductLedgerCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Profile.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ProjectCards.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Projects.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Quicklinks.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/RatingBankruptcy.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/RatingPaymentProblems.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Reconciled.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Refresh.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Report.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ReportSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Restore.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/RotateLeft.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/RotateRight.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Sales.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/SearchBold.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Secure.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/SecureTick.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/SettingsSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Shortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ShowAll.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ShowLess.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ShowMore.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ShowTemplate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Sliders.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Smartpay.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/SortBy.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Spinner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Star.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/StarSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Subscriptions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/SystemEntries.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/TemplateOverride.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Templates.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ThumbBoth.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ThumbDown.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ThumbDownSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ThumbUp.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/ThumbUpSolid.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Tick.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Time.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Transfer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/TransferCancel.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/TransferLocked.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Undo.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Undock.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Unreconciled.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Warning.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Webshop.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Website.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Workflow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Zoom.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Provider.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useId.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/usePrevious.js.map +1 -1
- package/dist/esm/packages/taco/src/index.js +1 -1
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/aria.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/colors.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/debounce.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/device.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/input.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/mergeRefs.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/taillwind.js.map +1 -1
- package/dist/index.css +190 -190
- package/dist/taco.cjs.development.js +47 -47
- 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/package.json +2 -2
- package/plugins/tailwindcss-aria-attributes.js +73 -73
- package/tailwind.config.js +284 -284
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/AlertDialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport cn from 'classnames';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames, getDialogStylingClassnames } from '../../Dialog/util';\n\nexport type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function AlertDialogTitle(\n props: AlertDialogTitleProps,\n ref: React.Ref<HTMLHeadingElement>\n) {\n const className = cn('text-center', props.className);\n return <AlertDialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: React.ReactNode;\n};\nexport const Content = React.forwardRef(function AlertDialogContent(\n props: AlertDialogContentProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const className = cn('p-6', getDialogPositionClassnames(), getDialogStylingClassnames(), getDialogSizeClassnames('dialog'));\n\n return (\n <AlertDialogPrimitive.Portal>\n <AlertDialogPrimitive.Overlay asChild>\n <Backdrop>\n <AlertDialogPrimitive.Content\n {...props}\n ref={ref}\n className={className}\n onEscapeKeyDown={event => event.preventDefault()}>\n {props.children}\n </AlertDialogPrimitive.Content>\n </Backdrop>\n </AlertDialogPrimitive.Overlay>\n </AlertDialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","AlertDialogTitle","props","ref","className","cn","AlertDialogPrimitive","Content","AlertDialogContent","getDialogPositionClassnames","getDialogStylingClassnames","getDialogSizeClassnames","asChild","Backdrop","onEscapeKeyDown","event","preventDefault","children"],"mappings":";;;;;;MAOaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,gBAAgB,CAC3DC,KAA4B,EAC5BC,GAAkC;EAElC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAA0B,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AACpF,CAAC;MAOYI,OAAO,gBAAGP,UAAgB,CAAC,SAASQ,kBAAkB,CAC/DN,KAA8B,EAC9BC,GAA8B;EAE9B,MAAMC,SAAS,GAAGC,EAAE,CAAC,KAAK,EAAEI,2BAA2B,EAAE,EAAEC,0BAA0B,EAAE,EAAEC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;EAE3H,oBACIX,cAACM,MAA2B,qBACxBN,cAACM,OAA4B;IAACM,OAAO;kBACjCZ,cAACa,QAAQ,qBACLb,cAACM,SAA4B,oBACrBJ,KAAK;IACTC,GAAG,EAAEA,GAAG;IACRC,SAAS,EAAEA,SAAS;IACpBU,eAAe,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc;MAC7Cd,KAAK,CAACe,QAAQ,CACY,CACxB,CACgB,CACL;AAEtC,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/AlertDialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\r\nimport cn from 'classnames';\r\nimport { Backdrop } from '../../Backdrop/Backdrop';\r\nimport { getDialogPositionClassnames, getDialogSizeClassnames, getDialogStylingClassnames } from '../../Dialog/util';\r\n\r\nexport type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\r\nexport const Title = React.forwardRef(function AlertDialogTitle(\r\n props: AlertDialogTitleProps,\r\n ref: React.Ref<HTMLHeadingElement>\r\n) {\r\n const className = cn('text-center', props.className);\r\n return <AlertDialogPrimitive.Title {...props} className={className} ref={ref} />;\r\n});\r\n\r\nexport type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\r\n /** An accessible label to be announced when the dialog is opened */\r\n 'aria-label': string;\r\n children: React.ReactNode;\r\n};\r\nexport const Content = React.forwardRef(function AlertDialogContent(\r\n props: AlertDialogContentProps,\r\n ref: React.Ref<HTMLDivElement>\r\n) {\r\n const className = cn('p-6', getDialogPositionClassnames(), getDialogStylingClassnames(), getDialogSizeClassnames('dialog'));\r\n\r\n return (\r\n <AlertDialogPrimitive.Portal>\r\n <AlertDialogPrimitive.Overlay asChild>\r\n <Backdrop>\r\n <AlertDialogPrimitive.Content\r\n {...props}\r\n ref={ref}\r\n className={className}\r\n onEscapeKeyDown={event => event.preventDefault()}>\r\n {props.children}\r\n </AlertDialogPrimitive.Content>\r\n </Backdrop>\r\n </AlertDialogPrimitive.Overlay>\r\n </AlertDialogPrimitive.Portal>\r\n );\r\n});\r\n"],"names":["Title","React","AlertDialogTitle","props","ref","className","cn","AlertDialogPrimitive","Content","AlertDialogContent","getDialogPositionClassnames","getDialogStylingClassnames","getDialogSizeClassnames","asChild","Backdrop","onEscapeKeyDown","event","preventDefault","children"],"mappings":";;;;;;MAOaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,gBAAgB,CAC3DC,KAA4B,EAC5BC,GAAkC;EAElC,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAA0B,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AACpF,CAAC;MAOYI,OAAO,gBAAGP,UAAgB,CAAC,SAASQ,kBAAkB,CAC/DN,KAA8B,EAC9BC,GAA8B;EAE9B,MAAMC,SAAS,GAAGC,EAAE,CAAC,KAAK,EAAEI,2BAA2B,EAAE,EAAEC,0BAA0B,EAAE,EAAEC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;EAE3H,oBACIX,cAACM,MAA2B,qBACxBN,cAACM,OAA4B;IAACM,OAAO;kBACjCZ,cAACa,QAAQ,qBACLb,cAACM,SAA4B,oBACrBJ,KAAK;IACTC,GAAG,EAAEA,GAAG;IACRC,SAAS,EAAEA,SAAS;IACpBU,eAAe,EAAEC,KAAK,IAAIA,KAAK,CAACC,cAAc;MAC7Cd,KAAK,CAACe,QAAQ,CACY,CACxB,CACgB,CACL;AAEtC,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Footer.js","sources":["../../../../../../../../src/components/AlertDialog/components/Footer.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nexport type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function AlertDialogFooter(props: AlertDialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = 'flex justify-end gap-2';\n\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\n </div>\n );\n});\n\nexport type AlertDialogCancelProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Cancel = React.forwardRef(function AlertDialogCancel(\n props: AlertDialogCancelProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n return <AlertDialogPrimitive.Cancel {...props} ref={ref} asChild />;\n});\n\nexport type AlertDialogActionProps = React.HTMLAttributes<HTMLButtonElement>;\nexport const Action = React.forwardRef(function AlertDialogAction(\n props: AlertDialogActionProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n return <AlertDialogPrimitive.Action {...props} className={props.className} ref={ref} asChild />;\n});\n"],"names":["Footer","React","AlertDialogFooter","props","ref","className","children","Cancel","AlertDialogCancel","AlertDialogPrimitive","asChild","Action","AlertDialogAction"],"mappings":";;;MAIaA,MAAM,gBAAGC,UAAgB,CAAC,SAASC,iBAAiB,CAACC,KAA6B,EAAEC,GAA8B;EAC3H,MAAMC,SAAS,GAAG,wBAAwB;EAE1C,oBACIJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;MACtCD,KAAK,CAACG,QAAQ,CACb;AAEd,CAAC;MAGYC,MAAM,gBAAGN,UAAgB,CAAC,SAASO,iBAAiB,CAC7DL,KAA6B,EAC7BC,GAAiC;EAEjC,oBAAOH,cAACQ,QAA2B,oBAAKN,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEM,OAAO;KAAG;AACvE,CAAC;MAGYC,MAAM,gBAAGV,UAAgB,CAAC,SAASW,iBAAiB,CAC7DT,KAA6B,EAC7BC,GAAiC;EAEjC,oBAAOH,cAACQ,QAA2B,oBAAKN,KAAK;IAAEE,SAAS,EAAEF,KAAK,CAACE,SAAS;IAAED,GAAG,EAAEA,GAAG;IAAEM,OAAO;KAAG;AACnG,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Footer.js","sources":["../../../../../../../../src/components/AlertDialog/components/Footer.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\r\n\r\nexport type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\r\nexport const Footer = React.forwardRef(function AlertDialogFooter(props: AlertDialogFooterProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = 'flex justify-end gap-2';\r\n\r\n return (\r\n <div {...props} className={className} ref={ref}>\r\n {props.children}\r\n </div>\r\n );\r\n});\r\n\r\nexport type AlertDialogCancelProps = React.HTMLAttributes<HTMLButtonElement>;\r\nexport const Cancel = React.forwardRef(function AlertDialogCancel(\r\n props: AlertDialogCancelProps,\r\n ref: React.Ref<HTMLButtonElement>\r\n) {\r\n return <AlertDialogPrimitive.Cancel {...props} ref={ref} asChild />;\r\n});\r\n\r\nexport type AlertDialogActionProps = React.HTMLAttributes<HTMLButtonElement>;\r\nexport const Action = React.forwardRef(function AlertDialogAction(\r\n props: AlertDialogActionProps,\r\n ref: React.Ref<HTMLButtonElement>\r\n) {\r\n return <AlertDialogPrimitive.Action {...props} className={props.className} ref={ref} asChild />;\r\n});\r\n"],"names":["Footer","React","AlertDialogFooter","props","ref","className","children","Cancel","AlertDialogCancel","AlertDialogPrimitive","asChild","Action","AlertDialogAction"],"mappings":";;;MAIaA,MAAM,gBAAGC,UAAgB,CAAC,SAASC,iBAAiB,CAACC,KAA6B,EAAEC,GAA8B;EAC3H,MAAMC,SAAS,GAAG,wBAAwB;EAE1C,oBACIJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;MACtCD,KAAK,CAACG,QAAQ,CACb;AAEd,CAAC;MAGYC,MAAM,gBAAGN,UAAgB,CAAC,SAASO,iBAAiB,CAC7DL,KAA6B,EAC7BC,GAAiC;EAEjC,oBAAOH,cAACQ,QAA2B,oBAAKN,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEM,OAAO;KAAG;AACvE,CAAC;MAGYC,MAAM,gBAAGV,UAAgB,CAAC,SAASW,iBAAiB,CAC7DT,KAA6B,EAC7BC,GAAiC;EAEjC,oBAAOH,cAACQ,QAA2B,oBAAKN,KAAK;IAAEE,SAAS,EAAEF,KAAK,CAACE,SAAS;IAAED,GAAG,EAAEA,GAAG;IAAEM,OAAO;KAAG;AACnG,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/AlertDialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\nimport { useCurrentAlertDialog } from '../Context';\nimport { mergeRefs } from '../../../utils/mergeRefs';\n\nexport type AlertDialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function AlertDialogTrigger(\n props: AlertDialogTriggerProps,\n externalRef: React.Ref<HTMLButtonElement>\n) {\n const { ref: parentRef, props: parentProps } = useCurrentAlertDialog();\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n return <AlertDialogPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild />;\n});\n"],"names":["Trigger","React","AlertDialogTrigger","props","externalRef","ref","parentRef","parentProps","useCurrentAlertDialog","refCallback","mergeRefs","AlertDialogPrimitive","asChild"],"mappings":";;;;;MAOaA,OAAO,gBAAGC,UAAgB,CAAC,SAASC,kBAAkB,CAC/DC,KAA8B,EAC9BC,WAAyC;EAEzC,MAAM;IAAEC,GAAG,EAAEC,SAAS;IAAEH,KAAK,EAAEI;GAAa,GAAGC,qBAAqB,EAAE;EACtE,MAAMC,WAAW,GAAGC,SAAS,CAAC,CAACJ,SAAS,EAAEF,WAAW,CAAC,CAAC;EAEvD,oBAAOH,cAACU,SAA4B,oBAAKJ,WAAW,EAAMJ,KAAK;IAAEE,GAAG,EAAEI,WAAW;IAAEG,OAAO;KAAG;AACjG,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/AlertDialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\r\nimport { useCurrentAlertDialog } from '../Context';\r\nimport { mergeRefs } from '../../../utils/mergeRefs';\r\n\r\nexport type AlertDialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\r\n\r\nexport const Trigger = React.forwardRef(function AlertDialogTrigger(\r\n props: AlertDialogTriggerProps,\r\n externalRef: React.Ref<HTMLButtonElement>\r\n) {\r\n const { ref: parentRef, props: parentProps } = useCurrentAlertDialog();\r\n const refCallback = mergeRefs([parentRef, externalRef]);\r\n\r\n return <AlertDialogPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild />;\r\n});\r\n"],"names":["Trigger","React","AlertDialogTrigger","props","externalRef","ref","parentRef","parentProps","useCurrentAlertDialog","refCallback","mergeRefs","AlertDialogPrimitive","asChild"],"mappings":";;;;;MAOaA,OAAO,gBAAGC,UAAgB,CAAC,SAASC,kBAAkB,CAC/DC,KAA8B,EAC9BC,WAAyC;EAEzC,MAAM;IAAEC,GAAG,EAAEC,SAAS;IAAEH,KAAK,EAAEI;GAAa,GAAGC,qBAAqB,EAAE;EACtE,MAAMC,WAAW,GAAGC,SAAS,CAAC,CAACJ,SAAS,EAAEF,WAAW,CAAC,CAAC;EAEvD,oBAAOH,cAACU,SAA4B,oBAAKJ,WAAW,EAAMJ,KAAK;IAAEE,GAAG,EAAEI,WAAW;IAAEG,OAAO;KAAG;AACjG,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Backdrop.js","sources":["../../../../../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nexport type BackdropProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport const Backdrop = React.forwardRef<HTMLDivElement, BackdropProps>(function Backdrop(props, ref) {\n const className = cn(\n 'fixed inset-0 cursor-default overflow-y-auto bg-purple-darker/[0.3] aria-hidden:invisible',\n props.className\n );\n\n return <div {...props} className={className} data-taco=\"backdrop\" ref={ref} />;\n});\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;MAKaA,QAAQ,gBAAGC,UAAgB,CAAgC,SAASD,QAAQ,CAACE,KAAK,EAAEC,GAAG;EAChG,MAAMC,SAAS,GAAGC,EAAE,CAChB,2FAA2F,EAC3FH,KAAK,CAACE,SAAS,CAClB;EAED,oBAAOH,uCAASC,KAAK;IAAEE,SAAS,EAAEA,SAAS;iBAAY,UAAU;IAACD,GAAG,EAAEA;KAAO;AAClF,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Backdrop.js","sources":["../../../../../../../src/components/Backdrop/Backdrop.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\n\r\nexport type BackdropProps = React.HTMLAttributes<HTMLDivElement>;\r\n\r\nexport const Backdrop = React.forwardRef<HTMLDivElement, BackdropProps>(function Backdrop(props, ref) {\r\n const className = cn(\r\n 'fixed inset-0 cursor-default overflow-y-auto bg-purple-darker/[0.3] aria-hidden:invisible',\r\n props.className\r\n );\r\n\r\n return <div {...props} className={className} data-taco=\"backdrop\" ref={ref} />;\r\n});\r\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;MAKaA,QAAQ,gBAAGC,UAAgB,CAAgC,SAASD,QAAQ,CAACE,KAAK,EAAEC,GAAG;EAChG,MAAMC,SAAS,GAAGC,EAAE,CAChB,2FAA2F,EAC3FH,KAAK,CAACE,SAAS,CAClB;EAED,oBAAOH,uCAASC,KAAK;IAAEE,SAAS,EAAEA,SAAS;iBAAY,UAAU;IAACD,GAAG,EAAEA;KAAO;AAClF,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Button/Button.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { getAppearanceClasses, getButtonClasses, createButtonWithTooltip, createButtonWithOverlays } from './util';\nimport { HangerProps } from '../Hanger/Hanger';\nimport { MenuProps } from '../Menu/Menu';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { PopoverProps } from '../Popover/Popover';\nimport './Button.css';\nimport { Icon } from '../Icon/Icon';\n\nexport type ButtonProps = ButtonPrimitive.ButtonProps & {\n /** Appearance will change the style of the button */\n appearance?: Appearance;\n /**\n * Dialog component associated with the button, clicking the button will open the dialog.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated dialog when clicked.\n */\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\n /** If fluid, button expands to the width of it's container */\n fluid?: boolean;\n /** Hanger component associated with the button. */\n hanger?: (props: Partial<HangerProps>) => JSX.Element;\n /** Menu component associated with the button. */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n /**\n * Popover component associated with the button, clicking the button will open the popover.\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\n * the button should be only to open the associated popover when clicked.\n */\n popover?: (props: Partial<PopoverProps>) => JSX.Element;\n /** A tooltip to show when hovering over the button */\n tooltip?: string;\n};\n\nconst Base = React.forwardRef(function ButtonBase(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\n const { fluid, ...otherProps } = props;\n const className = cn(\n getButtonClasses(),\n getAppearanceClasses(otherProps.appearance),\n 'rounded px-3',\n {\n 'cursor-not-allowed opacity-50': props.disabled,\n 'focus:yt-focus active:focus:yt-focus': !props.disabled,\n 'w-full': fluid,\n },\n props.className\n );\n\n return createButtonWithTooltip({ ...otherProps, 'data-taco': 'button' }, className, ref);\n});\n\nexport const Button = React.forwardRef(function Button(\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\n const { dialog, hanger, menu, popover, ...buttonProps } = props;\n\n let children = buttonProps.children;\n\n // add a chevron icon to menu buttons\n if (typeof menu === 'function') {\n children = Array.isArray(children)\n ? [...children, <Icon key=\"chevron-down\" name=\"chevron-down\" />]\n : [children, <Icon key=\"chevron-down\" name=\"chevron-down\" />];\n }\n\n const button = <Base {...buttonProps} children={children} ref={ref} />;\n\n return createButtonWithOverlays({ dialog, hanger, menu, popover }, button);\n});\n"],"names":["Base","React","ButtonBase","props","ref","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","appearance","disabled","createButtonWithTooltip","Button","dialog","hanger","menu","popover","buttonProps","children","Array","isArray","Icon","key","name","button","createButtonWithOverlays"],"mappings":";;;;;AAqCA,MAAMA,IAAI,gBAAGC,UAAgB,CAAC,SAASC,UAAU,CAACC,KAAkB,EAAEC,GAAqD;EACvH,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GA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":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport { Appearance } from '../../types';\r\nimport * as ButtonPrimitive from '../../primitives/Button';\r\nimport { getAppearanceClasses, getButtonClasses, createButtonWithTooltip, createButtonWithOverlays } from './util';\r\nimport { HangerProps } from '../Hanger/Hanger';\r\nimport { MenuProps } from '../Menu/Menu';\r\nimport { DialogProps } from '../Dialog/Dialog';\r\nimport { PopoverProps } from '../Popover/Popover';\r\nimport './Button.css';\r\nimport { Icon } from '../Icon/Icon';\r\n\r\nexport type ButtonProps = ButtonPrimitive.ButtonProps & {\r\n /** Appearance will change the style of the button */\r\n appearance?: Appearance;\r\n /**\r\n * Dialog component associated with the button, clicking the button will open the dialog.\r\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\r\n * the button should be only to open the associated dialog when clicked.\r\n */\r\n dialog?: (props: Partial<DialogProps>) => JSX.Element;\r\n /** If fluid, button expands to the width of it's container */\r\n fluid?: boolean;\r\n /** Hanger component associated with the button. */\r\n hanger?: (props: Partial<HangerProps>) => JSX.Element;\r\n /** Menu component associated with the button. */\r\n menu?: (props: Partial<MenuProps>) => JSX.Element;\r\n /**\r\n * Popover component associated with the button, clicking the button will open the popover.\r\n * *Note* that `onClick` event on button won't be handled, as in this case, the purpose of\r\n * the button should be only to open the associated popover when clicked.\r\n */\r\n popover?: (props: Partial<PopoverProps>) => JSX.Element;\r\n /** A tooltip to show when hovering over the button */\r\n tooltip?: string;\r\n};\r\n\r\nconst Base = React.forwardRef(function ButtonBase(props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) {\r\n const { fluid, ...otherProps } = props;\r\n const className = cn(\r\n getButtonClasses(),\r\n getAppearanceClasses(otherProps.appearance),\r\n 'rounded px-3',\r\n {\r\n 'cursor-not-allowed opacity-50': props.disabled,\r\n 'focus:yt-focus active:focus:yt-focus': !props.disabled,\r\n 'w-full': fluid,\r\n },\r\n props.className\r\n );\r\n\r\n return createButtonWithTooltip({ ...otherProps, 'data-taco': 'button' }, className, ref);\r\n});\r\n\r\nexport const Button = React.forwardRef(function Button(\r\n props: ButtonProps,\r\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\r\n) {\r\n const { dialog, hanger, menu, popover, ...buttonProps } = props;\r\n\r\n let children = buttonProps.children;\r\n\r\n // add a chevron icon to menu buttons\r\n if (typeof menu === 'function') {\r\n children = Array.isArray(children)\r\n ? [...children, <Icon key=\"chevron-down\" name=\"chevron-down\" />]\r\n : [children, <Icon key=\"chevron-down\" name=\"chevron-down\" />];\r\n }\r\n\r\n const button = <Base {...buttonProps} children={children} ref={ref} />;\r\n\r\n return createButtonWithOverlays({ dialog, hanger, menu, popover }, button);\r\n});\r\n"],"names":["Base","React","ButtonBase","props","ref","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","appearance","disabled","createButtonWithTooltip","Button","dialog","hanger","menu","popover","buttonProps","children","Array","isArray","Icon","key","name","button","createButtonWithOverlays"],"mappings":";;;;;AAqCA,MAAMA,IAAI,gBAAGC,UAAgB,CAAC,SAASC,UAAU,CAACC,KAAkB,EAAEC,GAAqD;EACvH,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGH,KAAK;EACtC,MAAMI,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EAAE,EAClBC,oBAAoB,CAACJ,UAAU,CAACK,UAAU,CAAC,EAC3C,cAAc,EACd;IACI,+BAA+B,EAAER,KAAK,CAACS,QAAQ;IAC/C,sCAAsC,EAAE,CAACT,KAAK,CAACS,QAAQ;IACvD,QAAQ,EAAEP;GACb,EACDF,KAAK,CAACI,SAAS,CAClB;EAED,OAAOM,uBAAuB,CAAC;IAAE,GAAGP,UAAU;IAAE,WAAW,EAAE;GAAU,EAAEC,SAAS,EAAEH,GAAG,CAAC;AAC5F,CAAC,CAAC;MAEWU,MAAM,gBAAGb,UAAgB,CAAC,SAASa,MAAM,CAClDX,KAAkB,EAClBC,GAAqD;EAErD,MAAM;IAAEW,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAE,GAAGC;GAAa,GAAGhB,KAAK;EAE/D,IAAIiB,QAAQ,GAAGD,WAAW,CAACC,QAAQ;;EAGnC,IAAI,OAAOH,IAAI,KAAK,UAAU,EAAE;IAC5BG,QAAQ,GAAGC,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,GAC5B,CAAC,GAAGA,QAAQ,eAAEnB,cAACsB,IAAI;MAACC,GAAG,EAAC,cAAc;MAACC,IAAI,EAAC;MAAiB,CAAC,GAC9D,CAACL,QAAQ,eAAEnB,cAACsB,IAAI;MAACC,GAAG,EAAC,cAAc;MAACC,IAAI,EAAC;MAAiB,CAAC;;EAGrE,MAAMC,MAAM,gBAAGzB,cAACD,IAAI,oBAAKmB,WAAW;IAAEC,QAAQ,EAAEA,QAAQ;IAAEhB,GAAG,EAAEA;KAAO;EAEtE,OAAOuB,wBAAwB,CAAC;IAAEZ,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;GAAS,EAAEQ,MAAM,CAAC;AAC9E,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Button/util.tsx"],"sourcesContent":["import React from 'react';\nimport { Appearance } from '../../types';\nimport * as ButtonPrimitive from '../../primitives/Button';\nimport { Tooltip } from '../Tooltip/Tooltip';\n\nexport const getButtonClasses = () => {\n return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] gap-1 h-max leading-5 inline-flex items-center justify-center';\n};\n\nexport const getAppearanceClasses = (value: Appearance | undefined, icon = false): string => {\n switch (value) {\n case 'primary':\n return `yt-blue-solid focus:bg-blue focus:text-white focus:yt-focus active:bg-blue-dark active:text-white hover:bg-blue-light hover:text-white hover:focus:bg-blue-light hover:focus:border-blue-light hover:focus:text-white disabled:hover:yt-blue-solid disabled:hover:hover:border-blue`;\n\n case 'danger':\n return `yt-red-solid focus:bg-red focus:text-white focus:yt-focus-red active:bg-red-dark active:text-white hover:bg-red-light hover:text-white hover:focus:bg-red-light hover:focus:text-white disabled:hover:yt-red-solid`;\n\n case 'ghost':\n return `bg-white shadow-[inset_0_0_0_1px_theme(colors.blue.DEFAULT)] text-blue focus:bg-transparent focus:text-blue active:bg-blue-lightest focus:!shadow-[inset_0_0_0_1px_theme(colors.blue.DEFAULT),0_0_0_2px_rgba(0,99,255,0.25)] active:text-blue-dark hover:bg-blue-lightest hover:shadow-[inset_0_0_0_1px_theme(colors.blue.light)] hover:text-blue-light hover:focus:bg-blue-lightest hover:focus:!shadow-[inset_0_0_0_1px_theme(colors.blue.light),0_0_0_2px_rgba(0,99,255,0.25)] hover:focus:text-blue-light`;\n\n case 'discrete': {\n if (icon) {\n return `bg-transparent text-black border-transparent focus:text-black focus:yt-focus active:text-black hover:text-grey-darkest hover:focus:text-grey-darkest disabled:hover:text-black `;\n }\n\n return `yt-transparent focus:text-blue focus:yt-focus active:text-blue-dark hover:text-blue-light hover:focus:text-blue-light disabled:hover:yt-transparent`;\n }\n\n default:\n return `yt-grey-solid focus:bg-grey focus:yt-focus active:bg-grey-dark active:text-black hover:bg-grey-light hover:text-grey-darkest hover:focus:bg-grey-light hover:focus:text-grey-darkest disabled:hover:yt-grey-solid`;\n }\n};\n\nexport const createButtonWithTooltip = (\n props: any,\n className: string,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n): JSX.Element => {\n const { tooltip, ...buttonProps } = props;\n const button = <ButtonPrimitive.Button {...buttonProps} className={className} ref={ref} />;\n\n if (tooltip) {\n return <Tooltip title={tooltip}>{button}</Tooltip>;\n }\n\n return button;\n};\n\nexport const createButtonWithOverlays = (props: any, buttonBase: JSX.Element) => {\n const { dialog, hanger, menu, popover } = props;\n let button = buttonBase;\n\n if (typeof dialog === 'function') {\n button = dialog({ trigger: button });\n } else if (typeof menu === 'function') {\n button = menu({ trigger: button });\n } else if (typeof popover === 'function') {\n button = popover({ trigger: button });\n }\n\n if (typeof hanger === 'function') {\n button = hanger({ anchor: button });\n }\n\n return button;\n};\n"],"names":["getButtonClasses","getAppearanceClasses","value","icon","createButtonWithTooltip","props","className","ref","tooltip","buttonProps","button","React","ButtonPrimitive","Tooltip","title","createButtonWithOverlays","buttonBase","dialog","hanger","menu","popover","trigger","anchor"],"mappings":";;;;MAKaA,gBAAgB,GAAG;EAC5B,OAAO,iHAAiH;AAC5H;MAEaC,oBAAoB,GAAG,CAACC,KAA6B,EAAEC,IAAI,GAAG,KAAK;EAC5E,QAAQD,KAAK;IACT,KAAK,SAAS;MACV,4RAA4R;IAEhS,KAAK,QAAQ;MACT,2NAA2N;IAE/N,KAAK,OAAO;MACR,sfAAsf;IAE1f,KAAK,UAAU;MAAE;QACb,IAAIC,IAAI,EAAE;UACN,wLAAwL;;QAG5L,4JAA4J;;IAGhK;MACI,0NAA0N;;AAEtO;MAEaC,uBAAuB,GAAG,CACnCC,KAAU,EACVC,SAAiB,EACjBC,GAAqD;EAErD,MAAM;IAAEC,OAAO;IAAE,GAAGC;GAAa,GAAGJ,KAAK;EACzC,MAAMK,MAAM,gBAAGC,6BAACC,MAAsB,oBAAKH,WAAW;IAAEH,SAAS,EAAEA,SAAS;IAAEC,GAAG,EAAEA;KAAO;EAE1F,IAAIC,OAAO,EAAE;IACT,oBAAOG,6BAACE,OAAO;MAACC,KAAK,EAAEN;OAAUE,MAAM,CAAW;;EAGtD,OAAOA,MAAM;AACjB;MAEaK,wBAAwB,GAAG,CAACV,KAAU,EAAEW,UAAuB;EACxE,MAAM;IAAEC,MAAM;IAAEC,MAAM;IAAEC,IAAI;IAAEC;GAAS,GAAGf,KAAK;EAC/C,IAAIK,MAAM,GAAGM,UAAU;EAEvB,IAAI,OAAOC,MAAM,KAAK,UAAU,EAAE;IAC9BP,MAAM,GAAGO,MAAM,CAAC;MAAEI,OAAO,EAAEX;KAAQ,CAAC;GACvC,MAAM,IAAI,OAAOS,IAAI,KAAK,UAAU,EAAE;IACnCT,MAAM,GAAGS,IAAI,CAAC;MAAEE,OAAO,EAAEX;KAAQ,CAAC;GACrC,MAAM,IAAI,OAAOU,OAAO,KAAK,UAAU,EAAE;IACtCV,MAAM,GAAGU,OAAO,CAAC;MAAEC,OAAO,EAAEX;KAAQ,CAAC;;EAGzC,IAAI,OAAOQ,MAAM,KAAK,UAAU,EAAE;IAC9BR,MAAM,GAAGQ,MAAM,CAAC;MAAEI,MAAM,EAAEZ;KAAQ,CAAC;;EAGvC,OAAOA,MAAM;AACjB;;;;"}
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Button/util.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Appearance } from '../../types';\r\nimport * as ButtonPrimitive from '../../primitives/Button';\r\nimport { Tooltip } from '../Tooltip/Tooltip';\r\n\r\nexport const getButtonClasses = () => {\r\n return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] gap-1 h-max leading-5 inline-flex items-center justify-center';\r\n};\r\n\r\nexport const getAppearanceClasses = (value: Appearance | undefined, icon = false): string => {\r\n switch (value) {\r\n case 'primary':\r\n return `yt-blue-solid focus:bg-blue focus:text-white focus:yt-focus active:bg-blue-dark active:text-white hover:bg-blue-light hover:text-white hover:focus:bg-blue-light hover:focus:border-blue-light hover:focus:text-white disabled:hover:yt-blue-solid disabled:hover:hover:border-blue`;\r\n\r\n case 'danger':\r\n return `yt-red-solid focus:bg-red focus:text-white focus:yt-focus-red active:bg-red-dark active:text-white hover:bg-red-light hover:text-white hover:focus:bg-red-light hover:focus:text-white disabled:hover:yt-red-solid`;\r\n\r\n case 'ghost':\r\n return `bg-white shadow-[inset_0_0_0_1px_theme(colors.blue.DEFAULT)] text-blue focus:bg-transparent focus:text-blue active:bg-blue-lightest focus:!shadow-[inset_0_0_0_1px_theme(colors.blue.DEFAULT),0_0_0_2px_rgba(0,99,255,0.25)] active:text-blue-dark hover:bg-blue-lightest hover:shadow-[inset_0_0_0_1px_theme(colors.blue.light)] hover:text-blue-light hover:focus:bg-blue-lightest hover:focus:!shadow-[inset_0_0_0_1px_theme(colors.blue.light),0_0_0_2px_rgba(0,99,255,0.25)] hover:focus:text-blue-light`;\r\n\r\n case 'discrete': {\r\n if (icon) {\r\n return `bg-transparent text-black border-transparent focus:text-black focus:yt-focus active:text-black hover:text-grey-darkest hover:focus:text-grey-darkest disabled:hover:text-black `;\r\n }\r\n\r\n return `yt-transparent focus:text-blue focus:yt-focus active:text-blue-dark hover:text-blue-light hover:focus:text-blue-light disabled:hover:yt-transparent`;\r\n }\r\n\r\n default:\r\n return `yt-grey-solid focus:bg-grey focus:yt-focus active:bg-grey-dark active:text-black hover:bg-grey-light hover:text-grey-darkest hover:focus:bg-grey-light hover:focus:text-grey-darkest disabled:hover:yt-grey-solid`;\r\n }\r\n};\r\n\r\nexport const createButtonWithTooltip = (\r\n props: any,\r\n className: string,\r\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\r\n): JSX.Element => {\r\n const { tooltip, ...buttonProps } = props;\r\n const button = <ButtonPrimitive.Button {...buttonProps} className={className} ref={ref} />;\r\n\r\n if (tooltip) {\r\n return <Tooltip title={tooltip}>{button}</Tooltip>;\r\n }\r\n\r\n return button;\r\n};\r\n\r\nexport const createButtonWithOverlays = (props: any, buttonBase: JSX.Element) => {\r\n const { dialog, hanger, menu, popover } = props;\r\n let button = buttonBase;\r\n\r\n if (typeof dialog === 'function') {\r\n button = dialog({ trigger: button });\r\n } else if (typeof menu === 'function') {\r\n button = menu({ trigger: button });\r\n } else if (typeof popover === 'function') {\r\n button = popover({ trigger: button });\r\n }\r\n\r\n if (typeof hanger === 'function') {\r\n button = hanger({ anchor: button });\r\n }\r\n\r\n return button;\r\n};\r\n"],"names":["getButtonClasses","getAppearanceClasses","value","icon","createButtonWithTooltip","props","className","ref","tooltip","buttonProps","button","React","ButtonPrimitive","Tooltip","title","createButtonWithOverlays","buttonBase","dialog","hanger","menu","popover","trigger","anchor"],"mappings":";;;;MAKaA,gBAAgB,GAAG;EAC5B,OAAO,iHAAiH;AAC5H;MAEaC,oBAAoB,GAAG,CA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;EAGvC,OAAOA,MAAM;AACjB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Calendar.js","sources":["../../../../../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport ReactDayPicker, { NavbarElementProps, Modifier } from 'react-day-picker';\nimport { useLocalization } from '../Provider/Provider';\nimport './Calendar.css';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type CalendarTextsActions = {\n /** Aria-label for previous month action button */\n previousMonth: string;\n /** Aria-label for next month action button */\n nextMonth: string;\n /** Aria-label for previous year action button */\n previousYear: string;\n /** Aria-label for next year action button */\n nextYear: string;\n /** Text displayed within today action button */\n today: string;\n};\n\nexport type CalendarTexts = {\n /** Text and aria-label for action buttons in Calendar */\n actions: CalendarTextsActions;\n /** Text abbreviation for months in Calendar's header, starting with January */\n months: string[];\n /** Text abbreviation for days in Calendar's header, starting with Sunday */\n weekdaysShort: string[];\n};\n\n/** @internal */\ntype CustomNavbarElementProps = NavbarElementProps & {\n showYearControls?: boolean;\n onMonthChange: (month: Date) => void;\n value?: Date;\n};\n\nconst thisYear = new Date().getFullYear();\nconst years: number[] = [];\n\nfor (let i = thisYear - 10; i <= thisYear + 10; i += 1) {\n years.push(i);\n}\n\nconst Navbar = React.memo(\n ({ onMonthChange, onNextClick, onPreviousClick, value = new Date() }: CustomNavbarElementProps): JSX.Element => {\n const {\n texts: {\n calendar: { actions, months },\n },\n } = useLocalization();\n\n const handleChange = function handleChange(event) {\n const { year, month } = event.target.form;\n onMonthChange(new Date(year.value, month.value));\n };\n\n return (\n <div className=\"mb-2 flex items-center justify-between\">\n <form className=\"inline-flex space-x-1\">\n <select className=\"h-8 px-2\" name=\"month\" onChange={handleChange} value={value.getMonth()}>\n {months.map((month, i) => (\n <option key={month} value={i}>\n {month}\n </option>\n ))}\n </select>\n <select className=\"h-8 px-2\" name=\"year\" onChange={handleChange} value={value.getFullYear()}>\n {years.map(year => (\n <option key={year} value={year}>\n {String(year)}\n </option>\n ))}\n </select>\n </form>\n <div>\n <IconButton\n appearance=\"discrete\"\n icon=\"chevron-left\"\n aria-label={actions.previousMonth}\n onClick={() => onPreviousClick()}\n rounded\n />\n <IconButton\n appearance=\"discrete\"\n icon=\"chevron-right\"\n aria-label={actions.nextMonth}\n onClick={() => onNextClick()}\n rounded\n />\n </div>\n </div>\n );\n }\n);\n\nexport type CalendarProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'value'> & {\n /** Handler called when a day is clicked in calendar */\n onChange: (date: Date, event?: React.MouseEvent<HTMLDivElement>) => void;\n value?: Date;\n disabledDays?: Modifier[];\n};\n\nexport const Calendar = React.forwardRef(function Calendar(props: CalendarProps, ref: React.Ref<ReactDayPicker>) {\n const { onChange: handleChange, value, disabledDays, ...otherProps } = props;\n const { locale, texts } = useLocalization();\n const [visibleMonth, setVisibleMonth] = React.useState(value ?? new Date());\n\n React.useEffect(() => {\n if (visibleMonth !== value) {\n setVisibleMonth(value ?? new Date());\n }\n }, [value]);\n\n const handleDayClick = (date, modifiers, event) => {\n if (modifiers.outside || modifiers.disabled) {\n return;\n }\n\n handleChange(date, event);\n };\n\n const handleCalendarClickToday = (): void => {\n const today = new Date();\n\n // set to midday to avoid UTC offset causing dates to be mismatched server side\n today.setHours(12);\n today.setMinutes(0);\n today.setSeconds(0);\n\n handleChange(today);\n };\n\n const className = cn('flex bg-white text-xs p-4', otherProps.className);\n\n return (\n <div data-taco=\"calendar\">\n <ReactDayPicker\n {...otherProps}\n className={className}\n month={visibleMonth}\n selectedDays={value}\n locale={locale.substring(0, 2)}\n firstDayOfWeek={1}\n months={texts.calendar.months}\n weekdaysShort={texts.calendar.weekdaysShort}\n navbarElement={navProps => <Navbar {...navProps} onMonthChange={setVisibleMonth} value={visibleMonth} />}\n onDayClick={handleDayClick}\n onMonthChange={setVisibleMonth}\n onTodayButtonClick={handleCalendarClickToday}\n captionElement={() => null}\n todayButton={texts.calendar.actions.today}\n numberOfMonths={1}\n ref={ref}\n disabledDays={disabledDays}\n />\n </div>\n );\n});\n"],"names":["thisYear","Date","getFullYear","years","i","push","Navbar","React","onMonthChange","onNextClick","onPreviousClick","value","texts","calendar","actions","months","useLocalization","handleChange","event","year","month","target","form","className","name","onChange","getMonth","map","key","String","IconButton","appearance","icon","previousMonth","onClick","rounded","nextMonth","Calendar","props","ref","disabledDays","otherProps","locale","visibleMonth","setVisibleMonth","handleDayClick","date","modifiers","outside","disabled","handleCalendarClickToday","today","setHours","setMinutes","setSeconds","cn","ReactDayPicker","selectedDays","substring","firstDayOfWeek","weekdaysShort","navbarElement","navProps","onDayClick","onTodayButtonClick","captionElement","todayButton","numberOfMonths"],"mappings":";;;;;;AAoCA,MAAMA,QAAQ,gBAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,EAAE;AACzC,MAAMC,KAAK,GAAa,EAAE;AAE1B,KAAK,IAAIC,CAAC,GAAGJ,QAAQ,GAAG,EAAE,EAAEI,CAAC,IAAIJ,QAAQ,GAAG,EAAE,EAAEI,CAAC,IAAI,CAAC,EAAE;EACpDD,KAAK,CAACE,IAAI,CAACD,CAAC,CAAC;;AAGjB,MAAME,MAAM,gBAAGC,IAAU,CACrB,CAAC;EAAEC,aAAa;EAAEC,WAAW;EAAEC,eAAe;EAAEC,KAAK,GAAG,IAAIV,IAAI;CAA8B;EAC1F,MAAM;IACFW,KAAK,EAAE;MACHC,QAAQ,EAAE;QAAEC,OAAO;QAAEC;;;GAE5B,GAAGC,eAAe,EAAE;EAErB,MAAMC,YAAY,GAAG,SAASA,YAAY,CAACC,KAAK;IAC5C,MAAM;MAAEC,IAAI;MAAEC;KAAO,GAAGF,KAAK,CAACG,MAAM,CAACC,IAAI;IACzCd,aAAa,CAAC,IAAIP,IAAI,CAACkB,IAAI,CAACR,KAAK,EAAES,KAAK,CAACT,KAAK,CAAC,CAAC;GACnD;EAED,oBACIJ;IAAKgB,SAAS,EAAC;kBACXhB;IAAMgB,SAAS,EAAC;kBACZhB;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,aAAa,EAAEoC,eAAe;IAC9BoB,kBAAkB,EAAEd,wBAAwB;IAC5Ce,cAAc,EAAE,MAAM,IAAI;IAC1BC,WAAW,EAAEtD,KAAK,CAACC,QAAQ,CAACC,OAAO,CAACqC,KAAK;IACzCgB,cAAc,EAAE,CAAC;IACjB5B,GAAG,EAAEA,GAAG;IACRC,YAAY,EAAEA;KAChB,CACA;AAEd,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Calendar.js","sources":["../../../../../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport ReactDayPicker, { NavbarElementProps, Modifier } from 'react-day-picker';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport './Calendar.css';\r\nimport { IconButton } from '../IconButton/IconButton';\r\n\r\nexport type CalendarTextsActions = {\r\n /** Aria-label for previous month action button */\r\n previousMonth: string;\r\n /** Aria-label for next month action button */\r\n nextMonth: string;\r\n /** Aria-label for previous year action button */\r\n previousYear: string;\r\n /** Aria-label for next year action button */\r\n nextYear: string;\r\n /** Text displayed within today action button */\r\n today: string;\r\n};\r\n\r\nexport type CalendarTexts = {\r\n /** Text and aria-label for action buttons in Calendar */\r\n actions: CalendarTextsActions;\r\n /** Text abbreviation for months in Calendar's header, starting with January */\r\n months: string[];\r\n /** Text abbreviation for days in Calendar's header, starting with Sunday */\r\n weekdaysShort: string[];\r\n};\r\n\r\n/** @internal */\r\ntype CustomNavbarElementProps = NavbarElementProps & {\r\n showYearControls?: boolean;\r\n onMonthChange: (month: Date) => void;\r\n value?: Date;\r\n};\r\n\r\nconst thisYear = new Date().getFullYear();\r\nconst years: number[] = [];\r\n\r\nfor (let i = thisYear - 10; i <= thisYear + 10; i += 1) {\r\n years.push(i);\r\n}\r\n\r\nconst Navbar = React.memo(\r\n ({ onMonthChange, onNextClick, onPreviousClick, value = new Date() }: CustomNavbarElementProps): JSX.Element => {\r\n const {\r\n texts: {\r\n calendar: { actions, months },\r\n },\r\n } = useLocalization();\r\n\r\n const handleChange = function handleChange(event) {\r\n const { year, month } = event.target.form;\r\n onMonthChange(new Date(year.value, month.value));\r\n };\r\n\r\n return (\r\n <div className=\"mb-2 flex items-center justify-between\">\r\n <form className=\"inline-flex space-x-1\">\r\n <select className=\"h-8 px-2\" name=\"month\" onChange={handleChange} value={value.getMonth()}>\r\n {months.map((month, i) => (\r\n <option key={month} value={i}>\r\n {month}\r\n </option>\r\n ))}\r\n </select>\r\n <select className=\"h-8 px-2\" name=\"year\" onChange={handleChange} value={value.getFullYear()}>\r\n {years.map(year => (\r\n <option key={year} value={year}>\r\n {String(year)}\r\n </option>\r\n ))}\r\n </select>\r\n </form>\r\n <div>\r\n <IconButton\r\n appearance=\"discrete\"\r\n icon=\"chevron-left\"\r\n aria-label={actions.previousMonth}\r\n onClick={() => onPreviousClick()}\r\n rounded\r\n />\r\n <IconButton\r\n appearance=\"discrete\"\r\n icon=\"chevron-right\"\r\n aria-label={actions.nextMonth}\r\n onClick={() => onNextClick()}\r\n rounded\r\n />\r\n </div>\r\n </div>\r\n );\r\n }\r\n);\r\n\r\nexport type CalendarProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'value'> & {\r\n /** Handler called when a day is clicked in calendar */\r\n onChange: (date: Date, event?: React.MouseEvent<HTMLDivElement>) => void;\r\n value?: Date;\r\n disabledDays?: Modifier[];\r\n};\r\n\r\nexport const Calendar = React.forwardRef(function Calendar(props: CalendarProps, ref: React.Ref<ReactDayPicker>) {\r\n const { onChange: handleChange, value, disabledDays, ...otherProps } = props;\r\n const { locale, texts } = useLocalization();\r\n const [visibleMonth, setVisibleMonth] = React.useState(value ?? new Date());\r\n\r\n React.useEffect(() => {\r\n if (visibleMonth !== value) {\r\n setVisibleMonth(value ?? new Date());\r\n }\r\n }, [value]);\r\n\r\n const handleDayClick = (date, modifiers, event) => {\r\n if (modifiers.outside || modifiers.disabled) {\r\n return;\r\n }\r\n\r\n handleChange(date, event);\r\n };\r\n\r\n const handleCalendarClickToday = (): void => {\r\n const today = new Date();\r\n\r\n // set to midday to avoid UTC offset causing dates to be mismatched server side\r\n today.setHours(12);\r\n today.setMinutes(0);\r\n today.setSeconds(0);\r\n\r\n handleChange(today);\r\n };\r\n\r\n const className = cn('flex bg-white text-xs p-4', otherProps.className);\r\n\r\n return (\r\n <div data-taco=\"calendar\">\r\n <ReactDayPicker\r\n {...otherProps}\r\n className={className}\r\n month={visibleMonth}\r\n selectedDays={value}\r\n locale={locale.substring(0, 2)}\r\n firstDayOfWeek={1}\r\n months={texts.calendar.months}\r\n weekdaysShort={texts.calendar.weekdaysShort}\r\n navbarElement={navProps => <Navbar {...navProps} onMonthChange={setVisibleMonth} value={visibleMonth} />}\r\n onDayClick={handleDayClick}\r\n onMonthChange={setVisibleMonth}\r\n onTodayButtonClick={handleCalendarClickToday}\r\n captionElement={() => null}\r\n todayButton={texts.calendar.actions.today}\r\n numberOfMonths={1}\r\n ref={ref}\r\n disabledDays={disabledDays}\r\n />\r\n </div>\r\n );\r\n});\r\n"],"names":["thisYear","Date","getFullYear","years","i","push","Navbar","React","onMonthChange","onNextClick","onPreviousClick","value","texts","calendar","actions","months","useLocalization","handleChange","event","year","month","target","form","className","name","onChange","getMonth","map","key","String","IconButton","appearance","icon","previousMonth","onClick","rounded","nextMonth","Calendar","props","ref","disabledDays","otherProps","locale","visibleMonth","setVisibleMonth","handleDayClick","date","modifiers","outside","disabled","handleCalendarClickToday","today","setHours","setMinutes","setSeconds","cn","ReactDayPicker","selectedDays","substring","firstDayOfWeek","weekdaysShort","navbarElement","navProps","onDayClick","onTodayButtonClick","captionElement","todayButton","numberOfMonths"],"mappings":";;;;;;AAoCA,MAAMA,QAAQ,gBAAG,IAAIC,IAAI,EAAE,CAACC,WAAW,EAAE;AACzC,MAAMC,KAAK,GAAa,EAAE;AAE1B,KAAK,IAAIC,CAAC,GAAGJ,QAAQ,GAAG,EAAE,EAAEI,CAAC,IAAIJ,QAAQ,GAAG,EAAE,EAAEI,CAAC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,MAAM5B,SAAS,GAAGgC,EAAE,CAAC,2BAA2B,EAAEd,UAAU,CAAClB,SAAS,CAAC;EAEvE,oBACIhB;iBAAe;kBACXA,cAACiD,cAAc,oBACPf,UAAU;IACdlB,SAAS,EAAEA,SAAS;IACpBH,KAAK,EAAEuB,YAAY;IACnBc,YAAY,EAAE9C,KAAK;IACnB+B,MAAM,EAAEA,MAAM,CAACgB,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9BC,cAAc,EAAE,CAAC;IACjB5C,MAAM,EAAEH,KAAK,CAACC,QAAQ,CAACE,MAAM;IAC7B6C,aAAa,EAAEhD,KAAK,CAACC,QAAQ,CAAC+C,aAAa;IAC3CC,aAAa,EAAEC,QAAQ,iBAAIvD,cAACD,MAAM,oBAAKwD,QAAQ;MAAEtD,aAAa,EAAEoC,eAAe;MAAEjC,KAAK,EAAEgC;OAAgB;IACxGoB,UAAU,EAAElB,cAAc;IAC1BrC,aAAa,EAAEoC,eAAe;IAC9BoB,kBAAkB,EAAEd,wBAAwB;IAC5Ce,cAAc,EAAE,MAAM,IAAI;IAC1BC,WAAW,EAAEtD,KAAK,CAACC,QAAQ,CAACC,OAAO,CAACqC,KAAK;IACzCgB,cAAc,EAAE,CAAC;IACjB5B,GAAG,EAAEA,GAAG;IACRC,YAAY,EAAEA;KAChB,CACA;AAEd,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\n\nimport { MenuProps, IconButton } from '../..';\n\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\n noPadding?: boolean;\n};\n\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\n const { noPadding, ...props } = externalProps;\n const className = cn(\n 'flex-grow overflow-auto',\n {\n 'mx-4 mb-4': !noPadding,\n },\n props.className\n );\n return <div {...props} className={className} ref={ref} />;\n});\n\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Title of the Card */\n title: string | React.ReactElement;\n /** Menu component associated with the Card */\n menu?: (props: Partial<MenuProps>) => JSX.Element;\n};\n\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\n const { title, menu, children } = props;\n const className = cn(\n 'bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]',\n props.className\n );\n\n return (\n <div className={className} data-taco=\"card\" ref={ref}>\n <div className=\"mx-4 mt-4 mb-2 flex\">\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\n </div>\n {children}\n </div>\n );\n}) as React.ForwardRefExoticComponent<CardProps> & {\n Content: React.ForwardRefExoticComponent<CardContentProps>;\n};\nCard.Content = Content;\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAW,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAI,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGAAwG,EACxGF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,iBAAIT;IAAIM,SAAS,EAAC;KAA4BG,KAAK,CAAM,EAC9DC,IAAI,gBAAGV,cAACY,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACJ,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\n\r\nimport { MenuProps, IconButton } from '../..';\r\n\r\nexport type CardContentProps = React.HTMLAttributes<HTMLDivElement> & {\r\n noPadding?: boolean;\r\n};\r\n\r\nconst Content = React.forwardRef<HTMLDivElement, CardContentProps>(function CardContent(externalProps, ref) {\r\n const { noPadding, ...props } = externalProps;\r\n const className = cn(\r\n 'flex-grow overflow-auto',\r\n {\r\n 'mx-4 mb-4': !noPadding,\r\n },\r\n props.className\r\n );\r\n return <div {...props} className={className} ref={ref} />;\r\n});\r\n\r\nexport type CardProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /** Title of the Card */\r\n title: string | React.ReactElement;\r\n /** Menu component associated with the Card */\r\n menu?: (props: Partial<MenuProps>) => JSX.Element;\r\n};\r\n\r\nexport const Card = React.forwardRef<HTMLDivElement, CardProps>(function Card(props, ref) {\r\n const { title, menu, children } = props;\r\n const className = cn(\r\n 'bg-white flex flex-col rounded-xl shadow-[0px_0px_1px_rgba(0,0,0,0.1),0px_6px_18px_rgba(47,51,68,0.2)]',\r\n props.className\r\n );\r\n\r\n return (\r\n <div className={className} data-taco=\"card\" ref={ref}>\r\n <div className=\"mx-4 mt-4 mb-2 flex\">\r\n {title && <h4 className=\"mb-0 flex-grow text-left\">{title}</h4>}\r\n {menu ? <IconButton icon=\"ellipsis-horizontal\" appearance=\"discrete\" menu={menu} className=\"-mt-[4px]\" /> : null}\r\n </div>\r\n {children}\r\n </div>\r\n );\r\n}) as React.ForwardRefExoticComponent<CardProps> & {\r\n Content: React.ForwardRefExoticComponent<CardContentProps>;\r\n};\r\nCard.Content = Content;\r\n"],"names":["Content","React","CardContent","externalProps","ref","noPadding","props","className","cn","Card","title","menu","children","IconButton","icon","appearance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAMA,OAAO,gBAAGC,UAAgB,CAAmC,SAASC,WAAW,CAACC,aAAa,EAAEC,GAAG;EACtG,MAAM;IAAEC,SAAS;IAAE,GAAGC;GAAO,GAAGH,aAAa;EAC7C,MAAMI,SAAS,GAAGC,EAAE,CAChB,yBAAyB,EACzB;IACI,WAAW,EAAE,CAACH;GACjB,EACDC,KAAK,CAACC,SAAS,CAClB;EACD,oBAAON,uCAASK,KAAK;IAAEC,SAAS,EAAEA,SAAS;IAAEH,GAAG,EAAEA;KAAO;AAC7D,CAAC,CAAC;MASWK,IAAI,gBAAGR,UAAgB,CAA4B,SAASQ,IAAI,CAACH,KAAK,EAAEF,GAAG;EACpF,MAAM;IAAEM,KAAK;IAAEC,IAAI;IAAEC;GAAU,GAAGN,KAAK;EACvC,MAAMC,SAAS,GAAGC,EAAE,CAChB,wGAAwG,EACxGF,KAAK,CAACC,SAAS,CAClB;EAED,oBACIN;IAAKM,SAAS,EAAEA,SAAS;iBAAY,MAAM;IAACH,GAAG,EAAEA;kBAC7CH;IAAKM,SAAS,EAAC;KACVG,KAAK,iBAAIT;IAAIM,SAAS,EAAC;KAA4BG,KAAK,CAAM,EAC9DC,IAAI,gBAAGV,cAACY,UAAU;IAACC,IAAI,EAAC,qBAAqB;IAACC,UAAU,EAAC,UAAU;IAACJ,IAAI,EAAEA,IAAI;IAAEJ,SAAS,EAAC;IAAc,GAAG,IAAI,CAC9G,EACLK,QAAQ,CACP;AAEd,CAAC;AAGDH,IAAI,CAACT,OAAO,GAAGA,OAAO;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Combobox.js","sources":["../../../../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { Input, InputProps } from '../Input/Input';\nimport { useCombobox } from './useCombobox';\nimport { ScrollableList, ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\nimport { IconButton } from '../IconButton/IconButton';\nimport './Combobox.css';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { useLocalization } from '../Provider/Provider';\n\nexport type ComboboxTexts = {\n /* Tooltip shown for the dialog button */\n tooltip: string;\n};\n\nexport type ComboboxItem = ScrollableListItem;\nexport type ComboboxValue = ScrollableListItemValue;\n\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\n /** Array of options in combobox */\n data?: ComboboxItem[];\n /**\n * Initial value of the input in combobox.\n * This is used when combobox is mounted, if no value is provided.\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\n */\n defaultValue?: ComboboxValue;\n /** Set what value should have an empty option in combobox */\n emptyValue?: ComboboxValue;\n /** Draws attention to the combobox by changing its style and making it visually prominent */\n highlighted?: boolean;\n /** Displays loading state in listbox */\n loading?: boolean;\n /**\n * Handler called when user chooses an option from the provided suggestions.\n * Suggestions will be calculated based on the input value.\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\n */\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\n /** Handler called when the user enters a query **/\n onSearch?: (query: string) => void | Promise<void>;\n /** Value of the input in combobox */\n value?: ComboboxValue;\n};\n\ninterface InlineComboboxProps extends ComboboxBaseProps {\n dialog?: never;\n /**\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\n * *Note* that default combobox will display matching data only when user starts typing in input.\n */\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\n}\n\ninterface DialogComboboxProps extends ComboboxBaseProps {\n dialog: (props: Partial<DialogProps>) => JSX.Element;\n inline?: never;\n}\n\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\n\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, dialog, style, ...otherProps } = props;\n const { combobox, button, input, popover, list } = useCombobox(otherProps, ref);\n const internalRef = React.useRef<HTMLDivElement>(null);\n const { texts } = useLocalization();\n const selectDimensions = useBoundingClientRectListener(internalRef);\n const className = cn(\n 'inline-flex relative',\n {\n 'yt-combobox--inline': props.inline,\n },\n externalClassName\n );\n\n return (\n <span className={className} data-taco=\"combobox\" style={style}>\n <PopoverPrimitive.Root {...popover}>\n <PopoverPrimitive.Anchor asChild ref={internalRef}>\n <div {...combobox} className=\"inline w-full\" ref={ref}>\n <Input\n {...input}\n autoComplete=\"off\"\n button={\n props.inline ? (\n <IconButton\n appearance=\"discrete\"\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\n onClick={() => {\n popover.onOpenChange(true);\n input.ref.current?.focus();\n }}\n tabIndex={-1}\n />\n ) : dialog ? (\n <IconButton\n aria-label={texts.combobox.tooltip}\n icon=\"list-search\"\n disabled={props.readOnly || props.disabled}\n dialog={dialog}\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\n event.preventDefault();\n input.ref.current?.focus();\n }}\n ref={button.ref}\n tabIndex={-1}\n tooltip={texts.combobox.tooltip}\n />\n ) : undefined\n }\n />\n </div>\n </PopoverPrimitive.Anchor>\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n align=\"start\"\n onOpenAutoFocus={event => {\n event.preventDefault();\n }}\n sideOffset={4}>\n <ScrollableList\n {...list}\n className={cn('!border-blue max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)]')}\n style={{ minWidth: selectDimensions?.width }}\n tabIndex={popover.open ? 0 : -1}\n />\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n </span>\n );\n});\n"],"names":["Combobox","React","props","ref","className","externalClassName","dialog","style","otherProps","combobox","button","input","popover","list","useCombobox","internalRef","texts","useLocalization","selectDimensions","useBoundingClientRectListener","cn","inline","PopoverPrimitive","asChild","Input","autoComplete","IconButton","appearance","icon","open","onClick","onOpenChange","current","focus","tabIndex","tooltip","disabled","readOnly","onFocus","event","preventDefault","undefined","align","onOpenAutoFocus","sideOffset","ScrollableList","minWidth","width"],"mappings":";;;;;;;;;;MA+DaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQ,CAACE,KAAoB,EAAEC,GAAgC;EAC7G,MAAM;IAAEC,SAAS,EAAEC,iBAAiB;IAAEC,MAAM;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGN,KAAK;EAC5E,MAAM;IAAEO,QAAQ;IAAEC,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC;GAAM,GAAGC,WAAW,CAACN,UAAU,EAAEL,GAAG,CAAC;EAC/E,MAAMY,WAAW,GAAGd,MAAY,CAAiB,IAAI,CAAC;EACtD,MAAM;IAAEe;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMC,gBAAgB,GAAGC,6BAA6B,CAACJ,WAAW,CAAC;EACnE,MAAMX,SAAS,GAAGgB,EAAE,CAChB,sBAAsB,EACtB;IACI,qBAAqB,EAAElB,KAAK,CAACmB;GAChC,EACDhB,iBAAiB,CACpB;EAED,oBACIJ;IAAMG,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MAClBA,KAAK,CAACC,cAAc,EAAE;KACzB;IACDI,UAAU,EAAE;kBACZ3C,cAAC4C,cAAc,oBACPhC,IAAI;IACRT,SAAS,EAAEgB,EAAE,CAAC,uEAAuE,CAAC;IACtFb,KAAK,EAAE;MAAEuC,QAAQ,EAAE5B,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAE6B;KAAO;IAC5Cb,QAAQ,EAAEtB,OAAO,CAACiB,IAAI,GAAG,CAAC,GAAG,CAAC;KAChC,CACqB,CACL,CACN,CACrB;AAEf,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Combobox.js","sources":["../../../../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\r\nimport { Input, InputProps } from '../Input/Input';\r\nimport { useCombobox } from './useCombobox';\r\nimport { ScrollableList, ScrollableListItem, ScrollableListItemValue } from '../Listbox/ScrollableList';\r\nimport { useBoundingClientRectListener } from '../../hooks/useBoundingClientRectListener';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport './Combobox.css';\r\nimport { DialogProps } from '../Dialog/Dialog';\r\nimport { useLocalization } from '../Provider/Provider';\r\n\r\nexport type ComboboxTexts = {\r\n /* Tooltip shown for the dialog button */\r\n tooltip: string;\r\n};\r\n\r\nexport type ComboboxItem = ScrollableListItem;\r\nexport type ComboboxValue = ScrollableListItemValue;\r\n\r\ntype ComboboxBaseProps = Omit<InputProps, 'defaultValue' | 'button' | 'onChange' | 'value'> & {\r\n /** Array of options in combobox */\r\n data?: ComboboxItem[];\r\n /**\r\n * Initial value of the input in combobox.\r\n * This is used when combobox is mounted, if no value is provided.\r\n * *Note* that combobox is a controlled component, setting this will also trigger the `onChange` event\r\n */\r\n defaultValue?: ComboboxValue;\r\n /** Set what value should have an empty option in combobox */\r\n emptyValue?: ComboboxValue;\r\n /** Draws attention to the combobox by changing its style and making it visually prominent */\r\n highlighted?: boolean;\r\n /** Displays loading state in listbox */\r\n loading?: boolean;\r\n /**\r\n * Handler called when user chooses an option from the provided suggestions.\r\n * Suggestions will be calculated based on the input value.\r\n * There are two ways to choose an option: either click on it, or navigate using keyboard and press `enter`\r\n */\r\n onChange?: React.ChangeEventHandler<HTMLInputElement>;\r\n /** Handler called when the user enters a query **/\r\n onSearch?: (query: string) => void | Promise<void>;\r\n /** Value of the input in combobox */\r\n value?: ComboboxValue;\r\n};\r\n\r\ninterface InlineComboboxProps extends ComboboxBaseProps {\r\n dialog?: never;\r\n /**\r\n * Combobox will display its data when input is clicked/focused, even if the input is empty.\r\n * *Note* that default combobox will display matching data only when user starts typing in input.\r\n */\r\n inline: boolean; // Example 3 on https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html\r\n}\r\n\r\ninterface DialogComboboxProps extends ComboboxBaseProps {\r\n dialog: (props: Partial<DialogProps>) => JSX.Element;\r\n inline?: never;\r\n}\r\n\r\nexport type ComboboxProps = InlineComboboxProps | DialogComboboxProps;\r\n\r\nexport const Combobox = React.forwardRef(function Combobox(props: ComboboxProps, ref: React.Ref<HTMLInputElement>) {\r\n const { className: externalClassName, dialog, style, ...otherProps } = props;\r\n const { combobox, button, input, popover, list } = useCombobox(otherProps, ref);\r\n const internalRef = React.useRef<HTMLDivElement>(null);\r\n const { texts } = useLocalization();\r\n const selectDimensions = useBoundingClientRectListener(internalRef);\r\n const className = cn(\r\n 'inline-flex relative',\r\n {\r\n 'yt-combobox--inline': props.inline,\r\n },\r\n externalClassName\r\n );\r\n\r\n return (\r\n <span className={className} data-taco=\"combobox\" style={style}>\r\n <PopoverPrimitive.Root {...popover}>\r\n <PopoverPrimitive.Anchor asChild ref={internalRef}>\r\n <div {...combobox} className=\"inline w-full\" ref={ref}>\r\n <Input\r\n {...input}\r\n autoComplete=\"off\"\r\n button={\r\n props.inline ? (\r\n <IconButton\r\n appearance=\"discrete\"\r\n className=\"!border-l-0 focus:!border-none focus:!shadow-none active:!border-none\"\r\n icon={popover.open ? 'chevron-up' : 'chevron-down'}\r\n onClick={() => {\r\n popover.onOpenChange(true);\r\n input.ref.current?.focus();\r\n }}\r\n tabIndex={-1}\r\n />\r\n ) : dialog ? (\r\n <IconButton\r\n aria-label={texts.combobox.tooltip}\r\n icon=\"list-search\"\r\n disabled={props.readOnly || props.disabled}\r\n dialog={dialog}\r\n onFocus={(event: React.FocusEvent<HTMLButtonElement>) => {\r\n // Prevents the default focus behaviour of showing the tooltip, on parent tooltip element\r\n event.preventDefault();\r\n input.ref.current?.focus();\r\n }}\r\n ref={button.ref}\r\n tabIndex={-1}\r\n tooltip={texts.combobox.tooltip}\r\n />\r\n ) : undefined\r\n }\r\n />\r\n </div>\r\n </PopoverPrimitive.Anchor>\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n align=\"start\"\r\n onOpenAutoFocus={event => {\r\n event.preventDefault();\r\n }}\r\n sideOffset={4}>\r\n <ScrollableList\r\n {...list}\r\n className={cn('!border-blue max-h-[calc(12rem+2px)] w-auto max-w-[theme(spacing.96)]')}\r\n style={{ minWidth: selectDimensions?.width }}\r\n tabIndex={popover.open ? 0 : -1}\r\n />\r\n </PopoverPrimitive.Content>\r\n </PopoverPrimitive.Portal>\r\n </PopoverPrimitive.Root>\r\n </span>\r\n );\r\n});\r\n"],"names":["Combobox","React","props","ref","className","externalClassName","dialog","style","otherProps","combobox","button","input","popover","list","useCombobox","internalRef","texts","useLocalization","selectDimensions","useBoundingClientRectListener","cn","inline","PopoverPrimitive","asChild","Input","autoComplete","IconButton","appearance","icon","open","onClick","onOpenChange","current","focus","tabIndex","tooltip","disabled","readOnly","onFocus","event","preventDefault","undefined","align","onOpenAutoFocus","sideOffset","ScrollableList","minWidth","width"],"mappings":";;;;;;;;;;MA+DaA,QAAQ,gBAAGC,UAAgB,CAAC,SAASD,QAAQ,CAACE,KAAoB,EAAEC,GAAgC;EAC7G,MAAM;IAAEC,SAAS,EAAEC,iBAAiB;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AAK,CAACmC,QAAQ,IAAInC,KAAK,CAACkC,QAAQ;MAC1C9B,MAAM,EAAEA,MAAM;MACdgC,OAAO,EAAGC,KAA0C;;;QAEhDA,KAAK,CAACC,cAAc,EAAE;QACtB,uBAAA7B,KAAK,CAACR,GAAG,CAAC6B,OAAO,wDAAjB,oBAAmBC,KAAK,EAAE;OAC7B;MACD9B,GAAG,EAAEO,MAAM,CAACP,GAAG;MACf+B,QAAQ,EAAE,CAAC,CAAC;MACZC,OAAO,EAAEnB,KAAK,CAACP,QAAQ,CAAC0B;MAC1B,GACFM;KAEV,CACA,CACgB,eAC1BxC,cAACqB,MAAuB,qBACpBrB,cAACqB,OAAwB;IACrBoB,KAAK,EAAC,OAAO;IACbC,eAAe,EAAEJ,KAAK;MAClBA,KAAK,CAACC,cAAc,EAAE;KACzB;IACDI,UAAU,EAAE;kBACZ3C,cAAC4C,cAAc,oBACPhC,IAAI;IACRT,SAAS,EAAEgB,EAAE,CAAC,uEAAuE,CAAC;IACtFb,KAAK,EAAE;MAAEuC,QAAQ,EAAE5B,gBAAgB,aAAhBA,gBAAgB,uBAAhBA,gBAAgB,CAAE6B;KAAO;IAC5Cb,QAAQ,EAAEtB,OAAO,CAACiB,IAAI,GAAG,CAAC,GAAG,CAAC;KAChC,CACqB,CACL,CACN,CACrB;AAEf,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCombobox.js","sources":["../../../../../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport debounce from 'lodash/debounce';\nimport { ComboboxProps } from './Combobox';\nimport {\n setInputValueByRef,\n getIndexFromValue,\n findByValue,\n useFlattenedData,\n sanitizeItem,\n getOptionParents,\n filterData,\n} from '../Listbox/util';\nimport { createCustomKeyboardEvent } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { getId, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\n\nconst debouncer = debounce(f => f(), 200);\n\nconst convertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\n\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\n combobox: React.HTMLAttributes<HTMLSpanElement>;\n input: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\n list: ScrollableListPropsWithRef;\n button: { ref: any };\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\n};\n\nexport const useCombobox = (\n {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n data: unfilteredData = [],\n defaultValue,\n disabled,\n id: nativeId,\n inline,\n loading: __,\n onChange,\n onClick,\n onKeyDown,\n onSearch,\n readOnly,\n value,\n ...props\n }: Omit<ComboboxProps, 'dialog'>,\n ref: React.Ref<HTMLInputElement>\n): useCombobox => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const listRef = React.useRef<HTMLUListElement>(null);\n const [open, setOpen] = React.useState(false);\n const listId = React.useMemo(() => uuid(), []);\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\n const flattenedData = useFlattenedData(unfilteredData);\n const data = React.useMemo(\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\n [shouldFilterData, inputValue, flattenedData]\n );\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\n inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined\n );\n\n const setInputValueByIndex = (index: number | undefined): void => {\n if (index !== undefined) {\n const option = data[index];\n\n if (option && !option.disabled) {\n setInputValueByRef(inputRef.current, option.value, 'focusout');\n }\n }\n };\n\n const setCurrentValue = (index: number | undefined) => {\n if (index === undefined) {\n return;\n }\n\n const option = data[index];\n\n // if the selected option is not already selected, trigger blur event\n if (option.value !== value) {\n setInputValueByIndex(index);\n } else {\n // if the selected option is already selected, refill input with its value\n setInputValue(convertToInputValue(value));\n }\n };\n\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\n React.useEffect(() => {\n if (defaultValue && !value) {\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\n }\n }, [data]);\n\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\n React.useEffect(() => {\n if (value !== undefined && value !== inputValue) {\n setInputValue(convertToInputValue(value));\n }\n }, [value]);\n\n React.useEffect(() => {\n if (onSearch) {\n debouncer(() => {\n onSearch(inputValue);\n });\n }\n }, [inputValue]);\n\n // show listbox based on input value\n React.useEffect(() => {\n // don't show the popover if the internal (input) value already is the current value\n // this prevents the popover showing after selecting a value or pressing escape\n const isCurrentValue = value !== undefined && value !== null && inputValue === String(value);\n\n if (inputValue && data.length && !isCurrentValue) {\n setCurrentIndex(0);\n\n if (!open) {\n setOpen(true);\n }\n } else {\n setOpen(false);\n }\n }, [inputValue, data]);\n\n React.useEffect(() => {\n if (open) {\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\n } else {\n setCurrentIndex(undefined);\n }\n }, [open]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n if (event.relatedTarget === listRef.current) {\n event.preventDefault();\n return;\n }\n\n if (onChange && event.target.value !== value) {\n const item = findByValue(flattenedData, event.target.value);\n (event as any).detail = sanitizeItem(item);\n\n const parents = getOptionParents(flattenedData, item?.path);\n\n if (parents !== null && parents.length > 0) {\n (event as any).detail.parents = parents;\n }\n\n onChange(event);\n }\n\n if (props.onBlur) {\n props.onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInputValue(event.target.value);\n };\n\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\n if (inline || (!open && inputValue && data.length)) {\n setOpen(true);\n }\n\n if (onClick) {\n event.persist();\n onClick(event);\n }\n };\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\n event.persist();\n\n switch (event.key) {\n case 'Backspace': {\n return;\n }\n\n case 'Escape': {\n event.preventDefault();\n setInputValue(convertToInputValue(value));\n setOpen(false);\n return;\n }\n\n case 'Tab':\n case 'Enter': {\n if (event.key !== 'Tab') {\n event.preventDefault();\n }\n\n setCurrentValue(currentIndex);\n setOpen(false);\n return;\n }\n\n case 'ArrowDown':\n if (open) {\n event.preventDefault();\n } else {\n if (!inline && buttonRef.current) {\n buttonRef.current.click();\n }\n }\n break;\n\n case 'ArrowUp':\n case 'Home':\n case 'End': {\n if (open) {\n event.preventDefault();\n }\n break;\n }\n\n default:\n }\n\n // we aren't focused on the list, so manually forward the keydown event to it\n if (listRef.current) {\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\n }\n\n if (inline && !open) {\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n event.preventDefault();\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\n setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);\n setOpen(true);\n }\n }\n\n if (!event.isDefaultPrevented() && onKeyDown) {\n event.persist();\n onKeyDown(event);\n }\n };\n\n const handleListboxChange = (index: number): void => {\n setCurrentIndex(index);\n };\n\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\n event.preventDefault();\n setCurrentValue(index);\n setOpen(false);\n };\n\n const combobox = {\n 'aria-expanded': open,\n 'aria-owns': listId,\n 'aria-haspopup': 'listbox' as const,\n role: 'combobox',\n };\n\n const input = {\n ...props,\n 'aria-controls': listId,\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\n // are related to the string that is present in the textbox\n 'aria-autocomplete': 'list' as const,\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\n 'aria-activedescendant':\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\n onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,\n readOnly,\n ref: inputRef,\n type: 'text',\n value: inputValue ?? '',\n };\n\n const list: ScrollableListPropsWithRef = {\n 'aria-labelledby': ariaLabelledBy,\n data,\n disabled,\n id: listId,\n onChange: handleListboxChange,\n onClick: handleListboxClick,\n ref: listRef,\n scrollOnFocus: false,\n tabIndex: -1,\n value: currentIndex,\n };\n\n const button = {\n ref: buttonRef,\n };\n\n return {\n combobox,\n input,\n list,\n button,\n popover: {\n open,\n onOpenChange: setOpen,\n //visible: !data.length ? false : open,\n },\n };\n};\n"],"names":["debouncer","debounce","f","convertToInputValue","value","String","useCombobox","ariaLabel","ariaLabelledBy","data","unfilteredData","defaultValue","disabled","id","nativeId","inline","loading","__","onChange","onClick","onKeyDown","onSearch","readOnly","props","ref","inputRef","useMergedRef","buttonRef","React","listRef","open","setOpen","listId","uuid","inputValue","setInputValue","shouldFilterData","flattenedData","useFlattenedData","filterData","currentIndex","setCurrentIndex","undefined","getIndexFromValue","setInputValueByIndex","index","option","setInputValueByRef","current","setCurrentValue","isCurrentValue","length","handleInputBlur","event","persist","relatedTarget","preventDefault","target","item","findByValue","detail","sanitizeItem","parents","getOptionParents","path","onBlur","handleInputChange","handleInputClick","handleInputKeyDown","key","click","dispatchEvent","createCustomKeyboardEvent","initialIndex","isDefaultPrevented","handleListboxChange","handleListboxClick","combobox","role","input","getId","type","list","scrollOnFocus","tabIndex","button","popover","onOpenChange"],"mappings":";;;;;;;;AAiBA,MAAMA,SAAS,gBAAGC,QAAQ,CAACC,CAAC,IAAIA,CAAC,EAAE,EAAE,GAAG,CAAC;AAEzC,MAAMC,mBAAmB,GAAIC,KAA0C,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA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CAAC,CAACpC,KAAK,CAAC,CAAC,GAAGsC,SAAS;IAClH,iBAAiB,EAAElC,cAAc;IACjCI,QAAQ;IACRqD,MAAM,EAAE,CAACrD,QAAQ,IAAI,CAACU,QAAQ,GAAG8B,eAAe,GAAGV,SAAS;IAC5DxB,QAAQ,EAAE,CAACN,QAAQ,IAAI,CAACU,QAAQ,GAAG4C,iBAAiB,GAAGxB,SAAS;IAChEvB,OAAO,EAAE,CAACP,QAAQ,IAAI,CAACU,QAAQ,GAAG6C,gBAAgB,GAAGzB,SAAS;IAC9DtB,SAAS,EAAE,CAACR,QAAQ,IAAI,CAACU,QAAQ,GAAG8C,kBAAkB,GAAG1B,SAAS;IAClEpB,QAAQ;IACRE,GAAG,EAAEC,QAAQ;IACbwD,IAAI,EAAE,MAAM;IACZ7E,KAAK,EAAE8B,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI;GACxB;EAED,MAAMgD,IAAI,GAA+B;IACrC,iBAAiB,EAAE1E,cAAc;IACjCC,IAAI;IACJG,QAAQ;IACRC,EAAE,EAAEmB,MAAM;IACVd,QAAQ,EAAEyD,mBAAmB;IAC7BxD,OAAO,EAAEyD,kBAAkB;IAC3BpD,GAAG,EAAEK,OAAO;IACZsD,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,CAAC,CAAC;IACZhF,KAAK,EAAEoC;GACV;EAED,MAAM6C,MAAM,GAAG;IACX7D,GAAG,EAAEG;GACR;EAED,OAAO;IACHkD,QAAQ;IACRE,KAAK;IACLG,IAAI;IACJG,MAAM;IACNC,OAAO,EAAE;MACLxD,IAAI;MACJyD,YAAY,EAAExD;;GAGrB;AACL;;;;"}
|
1
|
+
{"version":3,"file":"useCombobox.js","sources":["../../../../../../../src/components/Combobox/useCombobox.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { v4 as uuid } from 'uuid';\r\nimport debounce from 'lodash/debounce';\r\nimport { ComboboxProps } from './Combobox';\r\nimport {\r\n setInputValueByRef,\r\n getIndexFromValue,\r\n findByValue,\r\n useFlattenedData,\r\n sanitizeItem,\r\n getOptionParents,\r\n filterData,\r\n} from '../Listbox/util';\r\nimport { createCustomKeyboardEvent } from '../../utils/input';\r\nimport { useMergedRef } from '../../hooks/useMergedRef';\r\nimport { getId, ScrollableListItemValue, ScrollableListPropsWithRef } from '../Listbox/ScrollableList';\r\n\r\nconst debouncer = debounce(f => f(), 200);\r\n\r\nconst convertToInputValue = (value: ScrollableListItemValue | undefined) => String(value ?? '');\r\n\r\ntype useCombobox = React.HTMLAttributes<HTMLDivElement> & {\r\n combobox: React.HTMLAttributes<HTMLSpanElement>;\r\n input: Omit<React.InputHTMLAttributes<HTMLInputElement>, 'defaultValue'> & { ref: React.RefObject<HTMLInputElement> };\r\n list: ScrollableListPropsWithRef;\r\n button: { ref: any };\r\n popover: { open: boolean; onOpenChange: (open: boolean) => void };\r\n};\r\n\r\nexport const useCombobox = (\r\n {\r\n 'aria-label': ariaLabel,\r\n 'aria-labelledby': ariaLabelledBy,\r\n data: unfilteredData = [],\r\n defaultValue,\r\n disabled,\r\n id: nativeId,\r\n inline,\r\n loading: __,\r\n onChange,\r\n onClick,\r\n onKeyDown,\r\n onSearch,\r\n readOnly,\r\n value,\r\n ...props\r\n }: Omit<ComboboxProps, 'dialog'>,\r\n ref: React.Ref<HTMLInputElement>\r\n): useCombobox => {\r\n const inputRef = useMergedRef<HTMLInputElement>(ref);\r\n const buttonRef = React.useRef<HTMLButtonElement>(null);\r\n const listRef = React.useRef<HTMLUListElement>(null);\r\n const [open, setOpen] = React.useState(false);\r\n const listId = React.useMemo(() => uuid(), []);\r\n const [inputValue, setInputValue] = React.useState<string>(convertToInputValue(value));\r\n const shouldFilterData = !onSearch && (!inline || (inline && inputValue !== convertToInputValue(value)));\r\n const flattenedData = useFlattenedData(unfilteredData);\r\n const data = React.useMemo(\r\n () => (shouldFilterData ? filterData(flattenedData, inputValue) : flattenedData),\r\n [shouldFilterData, inputValue, flattenedData]\r\n );\r\n // listbox/select change value _with_ the index, but combobox changes on select of an index (click/enter), so we need state\r\n const [currentIndex, setCurrentIndex] = React.useState<number | undefined>(\r\n inputValue !== undefined ? getIndexFromValue(data, inputValue) : undefined\r\n );\r\n\r\n const setInputValueByIndex = (index: number | undefined): void => {\r\n if (index !== undefined) {\r\n const option = data[index];\r\n\r\n if (option && !option.disabled) {\r\n setInputValueByRef(inputRef.current, option.value, 'focusout');\r\n }\r\n }\r\n };\r\n\r\n const setCurrentValue = (index: number | undefined) => {\r\n if (index === undefined) {\r\n return;\r\n }\r\n\r\n const option = data[index];\r\n\r\n // if the selected option is not already selected, trigger blur event\r\n if (option.value !== value) {\r\n setInputValueByIndex(index);\r\n } else {\r\n // if the selected option is already selected, refill input with its value\r\n setInputValue(convertToInputValue(value));\r\n }\r\n };\r\n\r\n // ensure the external value is synced with the internal value when mounting, e.g. incase a default value was set\r\n React.useEffect(() => {\r\n if (defaultValue && !value) {\r\n setInputValueByIndex(getIndexFromValue(data, defaultValue));\r\n }\r\n }, [data]);\r\n\r\n // update input value if it changed 'externally', e.g. clicking/entering an item in the listbox, from a modal etc\r\n React.useEffect(() => {\r\n if (value !== undefined && value !== inputValue) {\r\n setInputValue(convertToInputValue(value));\r\n }\r\n }, [value]);\r\n\r\n React.useEffect(() => {\r\n if (onSearch) {\r\n debouncer(() => {\r\n onSearch(inputValue);\r\n });\r\n }\r\n }, [inputValue]);\r\n\r\n // show listbox based on input value\r\n React.useEffect(() => {\r\n // don't show the popover if the internal (input) value already is the current value\r\n // this prevents the popover showing after selecting a value or pressing escape\r\n const isCurrentValue = value !== undefined && value !== null && inputValue === String(value);\r\n\r\n if (inputValue && data.length && !isCurrentValue) {\r\n setCurrentIndex(0);\r\n\r\n if (!open) {\r\n setOpen(true);\r\n }\r\n } else {\r\n setOpen(false);\r\n }\r\n }, [inputValue, data]);\r\n\r\n React.useEffect(() => {\r\n if (open) {\r\n setCurrentIndex(getIndexFromValue(data, inputValue) || 0);\r\n } else {\r\n setCurrentIndex(undefined);\r\n }\r\n }, [open]);\r\n\r\n // event handlers\r\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n if (event.relatedTarget === listRef.current) {\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n if (onChange && event.target.value !== value) {\r\n const item = findByValue(flattenedData, event.target.value);\r\n (event as any).detail = sanitizeItem(item);\r\n\r\n const parents = getOptionParents(flattenedData, item?.path);\r\n\r\n if (parents !== null && parents.length > 0) {\r\n (event as any).detail.parents = parents;\r\n }\r\n\r\n onChange(event);\r\n }\r\n\r\n if (props.onBlur) {\r\n props.onBlur(event);\r\n }\r\n };\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\r\n setInputValue(event.target.value);\r\n };\r\n\r\n const handleInputClick = (event: React.MouseEvent<HTMLInputElement>): void => {\r\n if (inline || (!open && inputValue && data.length)) {\r\n setOpen(true);\r\n }\r\n\r\n if (onClick) {\r\n event.persist();\r\n onClick(event);\r\n }\r\n };\r\n\r\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n switch (event.key) {\r\n case 'Backspace': {\r\n return;\r\n }\r\n\r\n case 'Escape': {\r\n event.preventDefault();\r\n setInputValue(convertToInputValue(value));\r\n setOpen(false);\r\n return;\r\n }\r\n\r\n case 'Tab':\r\n case 'Enter': {\r\n if (event.key !== 'Tab') {\r\n event.preventDefault();\r\n }\r\n\r\n setCurrentValue(currentIndex);\r\n setOpen(false);\r\n return;\r\n }\r\n\r\n case 'ArrowDown':\r\n if (open) {\r\n event.preventDefault();\r\n } else {\r\n if (!inline && buttonRef.current) {\r\n buttonRef.current.click();\r\n }\r\n }\r\n break;\r\n\r\n case 'ArrowUp':\r\n case 'Home':\r\n case 'End': {\r\n if (open) {\r\n event.preventDefault();\r\n }\r\n break;\r\n }\r\n\r\n default:\r\n }\r\n\r\n // we aren't focused on the list, so manually forward the keydown event to it\r\n if (listRef.current) {\r\n listRef.current.dispatchEvent(createCustomKeyboardEvent(event));\r\n }\r\n\r\n if (inline && !open) {\r\n if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\r\n event.preventDefault();\r\n const initialIndex = event.key === 'ArrowUp' ? data.length - 1 : 0;\r\n setCurrentIndex(currentIndex !== undefined ? currentIndex : initialIndex);\r\n setOpen(true);\r\n }\r\n }\r\n\r\n if (!event.isDefaultPrevented() && onKeyDown) {\r\n event.persist();\r\n onKeyDown(event);\r\n }\r\n };\r\n\r\n const handleListboxChange = (index: number): void => {\r\n setCurrentIndex(index);\r\n };\r\n\r\n const handleListboxClick = (event: React.MouseEvent<HTMLLIElement>, index: number): void => {\r\n event.preventDefault();\r\n setCurrentValue(index);\r\n setOpen(false);\r\n };\r\n\r\n const combobox = {\r\n 'aria-expanded': open,\r\n 'aria-owns': listId,\r\n 'aria-haspopup': 'listbox' as const,\r\n role: 'combobox',\r\n };\r\n\r\n const input = {\r\n ...props,\r\n 'aria-controls': listId,\r\n // Indicates that the autocomplete behavior of the text input is to suggest a list of possible values in a popup and that the suggestions\r\n // are related to the string that is present in the textbox\r\n 'aria-autocomplete': 'list' as const,\r\n // Enables assistive technologies to know which element the application regards as focused while DOM focus remains on the input element\r\n 'aria-activedescendant':\r\n currentIndex !== undefined && data[currentIndex] ? getId(listId, String(data[currentIndex].value)) : undefined,\r\n 'aria-labelledby': ariaLabelledBy,\r\n disabled,\r\n onBlur: !disabled && !readOnly ? handleInputBlur : undefined,\r\n onChange: !disabled && !readOnly ? handleInputChange : undefined,\r\n onClick: !disabled && !readOnly ? handleInputClick : undefined,\r\n onKeyDown: !disabled && !readOnly ? handleInputKeyDown : undefined,\r\n readOnly,\r\n ref: inputRef,\r\n type: 'text',\r\n value: inputValue ?? '',\r\n };\r\n\r\n const list: ScrollableListPropsWithRef = {\r\n 'aria-labelledby': ariaLabelledBy,\r\n data,\r\n disabled,\r\n id: listId,\r\n onChange: handleListboxChange,\r\n onClick: handleListboxClick,\r\n ref: listRef,\r\n scrollOnFocus: false,\r\n tabIndex: -1,\r\n value: currentIndex,\r\n };\r\n\r\n const button = {\r\n ref: buttonRef,\r\n };\r\n\r\n return {\r\n combobox,\r\n input,\r\n list,\r\n button,\r\n popover: {\r\n open,\r\n onOpenChange: setOpen,\r\n //visible: !data.length ? false : open,\r\n },\r\n };\r\n};\r\n"],"names":["debouncer","debounce","f","convertToInputValue","value","String","useCombobox","ariaLabel","ariaLabelledBy","data","unfilteredData","defaultValue","disabled","id","nativeId","inline","loading","__","onChange","onClick","onKeyDown","onSearch","readOnly","props","ref","inputRef","useMergedRef","buttonRef","React","listRef","open","setOpen","listId","uuid","inputValue","setInputValue","shouldFilterData","flattenedData","useFlattenedData","filterData","currentIndex","setCurrentIndex","undefined","getIndexFromValue","setInputValueByIndex","index","option","setInputValueByRef","current","setCurrentValue","isCurrentValue","length","handleInputBlur","event","persist","relatedTarget","preventDefault","target","item","findByValue","detail","sanitizeItem","parents","getOptionParents","path","onBlur","handleInputChange","handleInputClick","handleInputKeyDown","key","click","dispatchEvent","createCustomKeyboardEvent","initialIndex","isDefaultPrevented","handleListboxChange","handleListboxClick","combobox","role","input","getId","type","list","scrollOnFocus","tabIndex","button","popover","onOpenChange"],"mappings":";;;;;;;;AAiBA,MAAMA,SAAS,gBAAGC,QAAQ,CAACC,CAAC,IAAIA,CAAC,EAAE,EAAE,GAAG,CAAC;AAEzC,MAAMC,mBAAmB,GAAIC,KAA0C,IAAKC,MAAM,CAACD,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAE,CAAC;MAUlFE,WAAW,GAAG,CACvB;EACI,YAAY,EAAEC,SAAS;EACvB,iBAAiB,EAAEC,cAAc;EACjCC,IAAI,EAAEC,cAAc,GAAG,EAAE;EACzBC,YAAY;EACZC,QAAQ;EACRC,EAAE,EAAEC,QAAQ;EACZC,MAAM;EACNC,OAAO,EAAEC,EAAE;EACXC,QAAQ;EACRC,OAAO;EACPC,SAAS;EACTC,QAAQ;EACRC,QAAQ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CAACU,QAAQ,GAAG6C,gBAAgB,GAAGzB,SAAS;IAC9DtB,SAAS,EAAE,CAACR,QAAQ,IAAI,CAACU,QAAQ,GAAG8C,kBAAkB,GAAG1B,SAAS;IAClEpB,QAAQ;IACRE,GAAG,EAAEC,QAAQ;IACbwD,IAAI,EAAE,MAAM;IACZ7E,KAAK,EAAE8B,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI;GACxB;EAED,MAAMgD,IAAI,GAA+B;IACrC,iBAAiB,EAAE1E,cAAc;IACjCC,IAAI;IACJG,QAAQ;IACRC,EAAE,EAAEmB,MAAM;IACVd,QAAQ,EAAEyD,mBAAmB;IAC7BxD,OAAO,EAAEyD,kBAAkB;IAC3BpD,GAAG,EAAEK,OAAO;IACZsD,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,CAAC,CAAC;IACZhF,KAAK,EAAEoC;GACV;EAED,MAAM6C,MAAM,GAAG;IACX7D,GAAG,EAAEG;GACR;EAED,OAAO;IACHkD,QAAQ;IACRE,KAAK;IACLG,IAAI;IACJG,MAAM;IACNC,OAAO,EAAE;MACLxD,IAAI;MACJyD,YAAY,EAAExD;;GAGrB;AACL;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Datepicker.js","sources":["../../../../../../../src/components/Datepicker/Datepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { Calendar, CalendarProps } from '../Calendar/Calendar';\nimport { Input, InputProps } from '../Input/Input';\nimport { useLocalization } from '../Provider/Provider';\nimport { useDatepicker } from './useDatepicker';\nimport { IconButton } from '../IconButton/IconButton';\nimport { Popover } from '../Popover/Popover';\n\nexport type DatepickerTexts = {\n /** Aria-label for calendar */\n calendar: string;\n /** Clear button text */\n clear: string;\n /**\n * Aria-label for calendar icon button in the input.\n * Calendar will open when user clicks this icon button.\n */\n expand: string;\n /** Shortcut heading text */\n shortcuts: string;\n};\n\nexport type DatepickerProps = Omit<InputProps, 'value'> & {\n /** [Calendar](component:calendar) component associated with the DatePicker */\n calendar?: CalendarProps;\n /** List of shortcuts */\n shortcuts?: any;\n /** Title for the shortcuts panel */\n shortcutsText?: string;\n /** Handler to be called when the clear button is clicked */\n onReset?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /**\n * Date value of the calendar.\n * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component\n */\n value?: Date;\n};\n\nexport const Datepicker = React.forwardRef(function Datepicker(props: DatepickerProps, ref: React.Ref<HTMLInputElement>) {\n const { className: externalClassName, onReset: handleReset, style, shortcuts, shortcutsText, ...otherProps } = props;\n const { calendar, input } = useDatepicker(otherProps, ref);\n const { texts } = useLocalization();\n const className = cn('inline-flex w-full text-black font-normal', externalClassName);\n\n return (\n <span className={className} data-taco=\"datepicker\" style={style}>\n <Input\n {...input}\n button={\n <Popover>\n <Popover.Trigger>\n <IconButton\n aria-label={texts.datepicker.expand}\n disabled={input.disabled || input.readOnly}\n icon=\"calendar\"\n />\n </Popover.Trigger>\n <Popover.Content>\n {({ close }) => (\n <div className=\"-m-3 flex\">\n <Calendar\n {...calendar}\n onChange={(date: Date, event?: React.MouseEvent<HTMLDivElement>) => {\n calendar.onChange(date, event);\n close();\n }}\n tabIndex={-1}\n />\n {shortcuts && (\n <div className=\"border-grey-dark flex flex-col border-l\">\n <span className=\"m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold\">\n {shortcutsText ?? texts.datepicker.shortcuts}\n </span>\n <ul>\n {shortcuts.map((shortcut, i) => (\n <li key={i}>\n <button\n className=\"hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs\"\n onClick={event => {\n event.persist();\n shortcut.onClick(event);\n close();\n }}>\n {shortcut.text}\n </button>\n </li>\n ))}\n </ul>\n {handleReset && (\n <button\n className=\"text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs\"\n onClick={event => {\n event.persist();\n handleReset(event);\n close();\n }}>\n {texts.datepicker.clear}\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </Popover.Content>\n </Popover>\n }\n />\n </span>\n );\n});\n"],"names":["Datepicker","React","props","ref","className","externalClassName","onReset","handleReset","style","shortcuts","shortcutsText","otherProps","calendar","input","useDatepicker","texts","useLocalization","cn","Input","button","Popover","Trigger","IconButton","datepicker","expand","disabled","readOnly","icon","Content","close","Calendar","onChange","date","event","tabIndex","map","shortcut","i","key","onClick","persist","text","clear"],"mappings":";;;;;;;;;MAuCaA,UAAU,gBAAGC,UAAgB,CAAC,SAASD,UAAU,CAACE,KAAsB,EAAEC,GAAgC;EACnH,MAAM;IAAEC,SAAS,EAAEC,iBAAiB;IAAEC,OAAO,EAAEC,WAAW;IAAEC,KAAK;IAAEC,SAAS;IAAEC,aAAa;IAAE,GAAGC;GAAY,GAAGT,KAAK;EACpH,MAAM;IAAEU,QAAQ;IAAEC;GAAO,GAAGC,aAAa,CAACH,UAAU,EAAER,GAAG,CAAC;EAC1D,MAAM;IAAEY;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMZ,SAAS,GAAGa,EAAE,CAAC,2CAA2C,EAAEZ,iBAAiB,CAAC;EAEpF,oBACIJ;IAAMG,SAAS,EAAEA,SAAS;iBAAY,YAAY;IAACI,KAAK,EAAEA;kBACtDP,cAACiB,KAAK,oBACEL,KAAK;IACTM,MAAM,eACFlB,cAACmB,OAAO,qBACJnB,cAACmB,OAAO,CAACC,OAAO,qBACZpB,cAACqB,UAAU;oBACKP,KAAK,CAACQ,UAAU,CAACC,MAAM;MACnCC,QAAQ,EAAEZ,KAAK,CAACY,QAAQ,IAAIZ,KAAK,CAACa,QAAQ;MAC1CC,IAAI,EAAC;MACP,CACY,eAClB1B,cAACmB,OAAO,CAACQ,OAAO,QACX,CAAC;MAAEC;KAAO,kBACP5B;MAAKG,SAAS,EAAC;oBACXH,cAAC6B,QAAQ,oBACDlB,QAAQ;MACZmB,QAAQ,EAAE,CAACC,IAAU,EAAEC,KAAwC;QAC3DrB,QAAQ,CAACmB,QAAQ,CAACC,IAAI,EAAEC,KAAK,CAAC;QAC9BJ,KAAK,EAAE;OACV;MACDK,QAAQ,EAAE,CAAC;OACb,EACDzB,SAAS,iBACNR;MAAKG,SAAS,EAAC;oBACXH;MAAMG,SAAS,EAAC;OACXM,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAIK,KAAK,CAACQ,UAAU,CAACd,SAAS,CACzC,eACPR,0BACKQ,SAAS,CAAC0B,GAAG,CAAC,CAACC,QAAQ,EAAEC,CAAC,kBACvBpC;MAAIqC,GAAG,EAAED;oBACLpC;MACIG,SAAS,EAAC,+DAA+D;MACzEmC,OAAO,EAAEN,KAAK;QACVA,KAAK,CAACO,OAAO,EAAE;QACfJ,QAAQ,CAACG,OAAO,CAACN,KAAK,CAAC;QACvBJ,KAAK,EAAE;;OAEVO,QAAQ,CAACK,IAAI,CACT,CAEhB,CAAC,CACD,EACJlC,WAAW,iBACRN;MACIG,SAAS,EAAC,oHAAoH;MAC9HmC,OAAO,EAAEN,KAAK;QACVA,KAAK,CAACO,OAAO,EAAE;QACfjC,WAAW,CAAC0B,KAAK,CAAC;QAClBJ,KAAK,EAAE;;OAEVd,KAAK,CAACQ,UAAU,CAACmB,KAAK,CAE9B,CAER,CAER,CACa;KAG5B,CACC;AAEf,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Datepicker.js","sources":["../../../../../../../src/components/Datepicker/Datepicker.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport { Calendar, CalendarProps } from '../Calendar/Calendar';\r\nimport { Input, InputProps } from '../Input/Input';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { useDatepicker } from './useDatepicker';\r\nimport { IconButton } from '../IconButton/IconButton';\r\nimport { Popover } from '../Popover/Popover';\r\n\r\nexport type DatepickerTexts = {\r\n /** Aria-label for calendar */\r\n calendar: string;\r\n /** Clear button text */\r\n clear: string;\r\n /**\r\n * Aria-label for calendar icon button in the input.\r\n * Calendar will open when user clicks this icon button.\r\n */\r\n expand: string;\r\n /** Shortcut heading text */\r\n shortcuts: string;\r\n};\r\n\r\nexport type DatepickerProps = Omit<InputProps, 'value'> & {\r\n /** [Calendar](component:calendar) component associated with the DatePicker */\r\n calendar?: CalendarProps;\r\n /** List of shortcuts */\r\n shortcuts?: any;\r\n /** Title for the shortcuts panel */\r\n shortcutsText?: string;\r\n /** Handler to be called when the clear button is clicked */\r\n onReset?: (event: React.MouseEvent<HTMLButtonElement>) => void;\r\n /**\r\n * Date value of the calendar.\r\n * This will be displayed in DatePicker's input in the format given to the [Provider](component:provider) component\r\n */\r\n value?: Date;\r\n};\r\n\r\nexport const Datepicker = React.forwardRef(function Datepicker(props: DatepickerProps, ref: React.Ref<HTMLInputElement>) {\r\n const { className: externalClassName, onReset: handleReset, style, shortcuts, shortcutsText, ...otherProps } = props;\r\n const { calendar, input } = useDatepicker(otherProps, ref);\r\n const { texts } = useLocalization();\r\n const className = cn('inline-flex w-full text-black font-normal', externalClassName);\r\n\r\n return (\r\n <span className={className} data-taco=\"datepicker\" style={style}>\r\n <Input\r\n {...input}\r\n button={\r\n <Popover>\r\n <Popover.Trigger>\r\n <IconButton\r\n aria-label={texts.datepicker.expand}\r\n disabled={input.disabled || input.readOnly}\r\n icon=\"calendar\"\r\n />\r\n </Popover.Trigger>\r\n <Popover.Content>\r\n {({ close }) => (\r\n <div className=\"-m-3 flex\">\r\n <Calendar\r\n {...calendar}\r\n onChange={(date: Date, event?: React.MouseEvent<HTMLDivElement>) => {\r\n calendar.onChange(date, event);\r\n close();\r\n }}\r\n tabIndex={-1}\r\n />\r\n {shortcuts && (\r\n <div className=\"border-grey-dark flex flex-col border-l\">\r\n <span className=\"m-4 mb-3 flex h-8 w-32 items-center text-xs font-semibold\">\r\n {shortcutsText ?? texts.datepicker.shortcuts}\r\n </span>\r\n <ul>\r\n {shortcuts.map((shortcut, i) => (\r\n <li key={i}>\r\n <button\r\n className=\"hover:bg-grey-light flex w-full items-start px-4 py-1 text-xs\"\r\n onClick={event => {\r\n event.persist();\r\n shortcut.onClick(event);\r\n close();\r\n }}>\r\n {shortcut.text}\r\n </button>\r\n </li>\r\n ))}\r\n </ul>\r\n {handleReset && (\r\n <button\r\n className=\"text-blue hover:text-blue-light my-4 mx-auto mt-auto inline-flex cursor-pointer border-none bg-transparent text-xs\"\r\n onClick={event => {\r\n event.persist();\r\n handleReset(event);\r\n close();\r\n }}>\r\n {texts.datepicker.clear}\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n )}\r\n </Popover.Content>\r\n </Popover>\r\n }\r\n />\r\n </span>\r\n );\r\n});\r\n"],"names":["Datepicker","React","props","ref","className","externalClassName","onReset","handleReset","style","shortcuts","shortcutsText","otherProps","calendar","input","useDatepicker","texts","useLocalization","cn","Input","button","Popover","Trigger","IconButton","datepicker","expand","disabled","readOnly","icon","Content","close","Calendar","onChange","date","event","tabIndex","map","shortcut","i","key","onClick","persist","text","clear"],"mappings":";;;;;;;;;MAuCaA,UAAU,gBAAGC,UAAgB,CAAC,SAASD,UAAU,CAACE,KAAsB,EAAEC,GAAgC;EACnH,MAAM;IAAEC,SAAS,EAAEC,iBAAiB;IAAEC,OAAO,EAAEC,WAAW;IAAEC,KAAK;IAAEC,SAAS;IAAEC,aAAa;IAAE,GAAGC;GAAY,GAAGT,KAAK;EACpH,MAAM;IAAEU,QAAQ;IAAEC;GAAO,GAAGC,aAAa,CAACH,UAAU,EAAER,GAAG,CAAC;EAC1D,MAAM;IAAEY;GAAO,GAAGC,eAAe,EAAE;EACnC,MAAMZ,SAAS,GAAGa,EAAE,CAAC,2CAA2C,EAAEZ,iBAAiB,CAAC;EAEpF,oBACIJ;IAAMG,SAAS,EAAEA,SAAS;iBAAY,YAAY;IAACI,KAAK,EAAEA;kBACtDP,cAACiB,KAAK,oBACEL,KAAK;IACTM,MAAM,eACFlB,cAACmB,OAAO,qBACJnB,cAACmB,OAAO,CAACC,OAAO,qBACZpB,cAACqB,UAAU;oBACKP,KAAK,CAACQ,UAAU,CAACC,MAAM;MACnCC,QAAQ,EAAEZ,KAAK,CAACY,QAAQ,IAAIZ,KAAK,CAACa,QAAQ;MAC1CC,IAAI,EAAC;MACP,CACY,eAClB1B,cAACmB,OAAO,CAACQ,OAAO,QACX,CAAC;MAAEC;KAAO,kBACP5B;MAAKG,SAAS,EAAC;oBACXH,cAAC6B,QAAQ,oBACDlB,QAAQ;MACZmB,QAAQ,EAAE,CAACC,IAAU,EAAEC,KAAwC;QAC3DrB,QAAQ,CAACmB,QAAQ,CAACC,IAAI,EAAEC,KAAK,CAAC;QAC9BJ,KAAK,EAAE;OACV;MACDK,QAAQ,EAAE,CAAC;OACb,EACDzB,SAAS,iBACNR;MAAKG,SAAS,EAAC;oBACXH;MAAMG,SAAS,EAAC;OACXM,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAIK,KAAK,CAACQ,UAAU,CAACd,SAAS,CACzC,eACPR,0BACKQ,SAAS,CAAC0B,GAAG,CAAC,CAACC,QAAQ,EAAEC,CAAC,kBACvBpC;MAAIqC,GAAG,EAAED;oBACLpC;MACIG,SAAS,EAAC,+DAA+D;MACzEmC,OAAO,EAAEN,KAAK;QACVA,KAAK,CAACO,OAAO,EAAE;QACfJ,QAAQ,CAACG,OAAO,CAACN,KAAK,CAAC;QACvBJ,KAAK,EAAE;;OAEVO,QAAQ,CAACK,IAAI,CACT,CAEhB,CAAC,CACD,EACJlC,WAAW,iBACRN;MACIG,SAAS,EAAC,oHAAoH;MAC9HmC,OAAO,EAAEN,KAAK;QACVA,KAAK,CAACO,OAAO,EAAE;QACfjC,WAAW,CAAC0B,KAAK,CAAC;QAClBJ,KAAK,EAAE;;OAEVd,KAAK,CAACQ,UAAU,CAACmB,KAAK,CAE9B,CAER,CAER,CACa;KAG5B,CACC;AAEf,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useDatepicker.js","sources":["../../../../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { parseFromCustomString, format } from '../../utils/date';\nimport { useLocalization } from '../Provider/Provider';\nimport { setInputValueByRef } from '../../utils/input';\nimport { useMergedRef } from '../../hooks/useMergedRef';\nimport { DatepickerProps } from './Datepicker';\nimport { CalendarProps } from '../Calendar/Calendar';\n\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement> };\n\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\n calendar: CalendarProps;\n input: InputProps;\n};\n\nexport const useDatepicker = (\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\n ref: React.Ref<HTMLInputElement>\n): useDatepicker => {\n const inputRef = useMergedRef<HTMLInputElement>(ref);\n const { formatting } = useLocalization();\n const [internalValue, setInternalValue] = React.useState(value ? format(value, formatting.date) : '');\n\n // update internal value if it changed 'externally'\n React.useEffect(() => {\n if (value) {\n const formattedValue = format(value, formatting.date);\n\n if (formattedValue !== internalValue) {\n setInternalValue(formattedValue);\n }\n } else {\n setInternalValue('');\n }\n }, [value]);\n\n // event handlers\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n event.persist();\n\n const valueAsDate = parseFromCustomString(event.target.value);\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\n\n event.target.value = formattedValue;\n\n if (onChange) {\n (event as any).detail = valueAsDate;\n onChange(event);\n } else {\n // update the internal value to use the formatted date\n setInternalValue(formattedValue);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n };\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n setInternalValue(event.target.value);\n };\n\n const handleChange = date => {\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\n }\n };\n\n const inputProps: InputProps = {\n ...props,\n autoComplete: 'off',\n onBlur: handleInputBlur,\n onChange: handleInputChange,\n onKeyDown: handleKeyDown,\n ref: inputRef,\n type: 'text',\n value: internalValue,\n };\n\n const calendarProps: CalendarProps = {\n ...calendar,\n onChange: handleChange,\n value,\n };\n\n return {\n input: inputProps,\n calendar: calendarProps,\n };\n};\n"],"names":["useDatepicker","defaultValue","_","calendar","onBlur","onChange","value","props","ref","inputRef","useMergedRef","formatting","useLocalization","internalValue","setInternalValue","React","format","date","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","detail","handleInputChange","handleChange","setInputValueByRef","current","handleKeyDown","key","dispatchEvent","Event","bubbles","inputProps","autoComplete","onKeyDown","type","calendarProps","input"],"mappings":";;;;;;MAeaA,aAAa,GAAG,CACzB;EAAEC,YAAY,EAAEC,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;CAAwB,EACjFC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAM;IAAEG;GAAY,GAAGC,eAAe,EAAE;EACxC,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,QAAc,CAACT,KAAK,GAAGU,MAAM,CAACV,KAAK,EAAEK,UAAU,CAACM,IAAI,CAAC,GAAG,EAAE,CAAC;;EAGrGF,SAAe,CAAC;IACZ,IAAIT,KAAK,EAAE;MACP,MAAMY,cAAc,GAAGF,MAAM,CAACV,KAAK,EAAEK,UAAU,CAACM,IAAI,CAAC;MAErD,IAAIC,cAAc,KAAKL,aAAa,EAAE;QAClCC,gBAAgB,CAACI,cAAc,CAAC;;KAEvC,MAAM;MACHJ,gBAAgB,CAAC,EAAE,CAAC;;GAE3B,EAAE,CAACR,KAAK,CAAC,CAAC;;EAGX,MAAMa,eAAe,GAAIC,KAAyC;IAC9DA,KAAK,CAACC,OAAO,EAAE;IAEf,MAAMC,WAAW,GAAGC,qBAAqB,CAACH,KAAK,CAACI,MAAM,CAAClB,KAAK,CAAC;IAC7D,MAAM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epicker.js","sources":["../../../../../../../src/components/Datepicker/useDatepicker.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { parseFromCustomString, format } from '../../utils/date';\r\nimport { useLocalization } from '../Provider/Provider';\r\nimport { setInputValueByRef } from '../../utils/input';\r\nimport { useMergedRef } from '../../hooks/useMergedRef';\r\nimport { DatepickerProps } from './Datepicker';\r\nimport { CalendarProps } from '../Calendar/Calendar';\r\n\r\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & { ref: React.RefObject<HTMLInputElement> };\r\n\r\ntype useDatepicker = React.HTMLAttributes<HTMLDivElement> & {\r\n calendar: CalendarProps;\r\n input: InputProps;\r\n};\r\n\r\nexport const useDatepicker = (\r\n { defaultValue: _, calendar, onBlur, onChange, value, ...props }: DatepickerProps,\r\n ref: React.Ref<HTMLInputElement>\r\n): useDatepicker => {\r\n const inputRef = useMergedRef<HTMLInputElement>(ref);\r\n const { formatting } = useLocalization();\r\n const [internalValue, setInternalValue] = React.useState(value ? format(value, formatting.date) : '');\r\n\r\n // update internal value if it changed 'externally'\r\n React.useEffect(() => {\r\n if (value) {\r\n const formattedValue = format(value, formatting.date);\r\n\r\n if (formattedValue !== internalValue) {\r\n setInternalValue(formattedValue);\r\n }\r\n } else {\r\n setInternalValue('');\r\n }\r\n }, [value]);\r\n\r\n // event handlers\r\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\r\n event.persist();\r\n\r\n const valueAsDate = parseFromCustomString(event.target.value);\r\n const formattedValue = valueAsDate ? format(valueAsDate) || '' : '';\r\n\r\n event.target.value = formattedValue;\r\n\r\n if (onChange) {\r\n (event as any).detail = valueAsDate;\r\n onChange(event);\r\n } else {\r\n // update the internal value to use the formatted date\r\n setInternalValue(formattedValue);\r\n }\r\n\r\n if (onBlur) {\r\n onBlur(event);\r\n }\r\n };\r\n\r\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\r\n setInternalValue(event.target.value);\r\n };\r\n\r\n const handleChange = date => {\r\n setInputValueByRef(inputRef.current, format(date, formatting.date), 'focusout');\r\n };\r\n\r\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === 'Enter') {\r\n event.target.dispatchEvent(new Event('focusout', { bubbles: true }));\r\n }\r\n };\r\n\r\n const inputProps: InputProps = {\r\n ...props,\r\n autoComplete: 'off',\r\n onBlur: handleInputBlur,\r\n onChange: handleInputChange,\r\n onKeyDown: handleKeyDown,\r\n ref: inputRef,\r\n type: 'text',\r\n value: internalValue,\r\n };\r\n\r\n const calendarProps: CalendarProps = {\r\n ...calendar,\r\n onChange: handleChange,\r\n value,\r\n };\r\n\r\n return {\r\n input: inputProps,\r\n calendar: calendarProps,\r\n };\r\n};\r\n"],"names":["useDatepicker","defaultValue","_","calendar","onBlur","onChange","value","props","ref","inputRef","useMergedRef","formatting","useLocalization","internalValue","setInternalValue","React","format","date","formattedValue","handleInputBlur","event","persist","valueAsDate","parseFromCustomString","target","detail","handleInputChange","handleChange","setInputValueByRef","current","handleKeyDown","key","dispatchEvent","Event","bubbles","inputProps","autoComplete","onKeyDown","type","calendarProps","input"],"mappings":";;;;;;MAeaA,aAAa,GAAG,CACzB;EAAEC,YAAY,EAAEC,CAAC;EAAEC,QAAQ;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;CAAwB,EACjFC,GAAgC;EAEhC,MAAMC,QAAQ,GAAGC,YAAY,CAAmBF,GAAG,CAAC;EACpD,MAAM;IAAEG;GAAY,GAAGC,eAAe,EAAE;EACxC,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,QAAc,CAACT,KAAK,GAAGU,MAAM,CAACV,KAAK,EAAEK,UAAU,CAACM,IAAI,CAAC,GAAG,EAAE,CAAC;;EAGrGF,SAAe,CAAC;IACZ,IAAIT,KAAK,EAAE;MACP,MAAMY,cAAc,GAAGF,MAAM,CAACV,KAAK,EAAEK,UAAU,CAACM,IAAI,CAAC;MAErD,IAAIC,cA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;IAC3BW,SAAS,EAAEP,aAAa;IACxBtB,GAAG,EAAEC,QAAQ;IACb6B,IAAI,EAAE,MAAM;IACZhC,KAAK,EAAEO;GACV;EAED,MAAM0B,aAAa,GAAkB;IACjC,GAAGpC,QAAQ;IACXE,QAAQ,EAAEsB,YAAY;IACtBrB;GACH;EAED,OAAO;IACHkC,KAAK,EAAEL,UAAU;IACjBhC,QAAQ,EAAEoC;GACb;AACL;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport './Dialog.css';\nimport { DialogTriggerProps, Trigger } from './components/Trigger';\nimport {\n Content,\n Title,\n Footer,\n Close,\n DialogContentProps,\n DialogContentRenderProps,\n DialogContentDrawerRenderProps,\n DialogTitleProps,\n DialogFooterProps,\n DialogCloseProps,\n} from './components/Content';\nimport { DialogDrawerProps, DialogDrawerRenderProps, Drawer } from './components/Drawer';\nimport { DialogExtraProps, Extra } from './components/Extra';\nimport { DialogContext } from './Context';\nimport { DialogSize } from './types';\n\nexport type {\n DialogCloseProps,\n DialogContentDrawerRenderProps,\n DialogContentProps,\n DialogContentRenderProps,\n DialogDrawerProps,\n DialogDrawerRenderProps,\n DialogFooterProps,\n DialogSize,\n DialogTitleProps,\n};\n\nexport type DialogTexts = {\n /**\n * Aria-label for close icon button in dialog.\n * To read more about how to provide the text, see [Provider](component:provider) component\n */\n close: string;\n drag: string;\n};\n\nexport type DialogProps = {\n children: React.ReactNode | React.ReactNode[];\n /** When `true`, pressing escape will close the dialog */\n closeOnEscape?: boolean;\n /** Set whether the dialog is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Allows dragging the dialog around the screen (window constrained) */\n draggable?: boolean;\n /** Handler called when dialog closes by user interaction */\n onClose?: () => void;\n /** Called when the dialog opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean) => void;\n /** Control the open state of the dialog from outside the component */\n open?: boolean;\n /** Shows the close icon button of the dialog */\n showCloseButton?: boolean;\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\n size?: DialogSize;\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n};\n\nconst useSeparatedChildren = initialChildren => {\n return React.useMemo(() => {\n const children: any[] = [];\n let drawer;\n let extra;\n\n React.Children.toArray(initialChildren).forEach((child: any) => {\n if (child.type?.displayName === Drawer.displayName) {\n drawer = child;\n } else if (child.type?.displayName === Extra.displayName) {\n extra = child;\n } else {\n children.push(child);\n }\n });\n\n return [children, drawer, extra];\n }, [initialChildren]);\n};\n\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\n};\n\nexport const Dialog = React.forwardRef(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\n const {\n children: initialChildren,\n closeOnEscape = true,\n defaultOpen,\n draggable = false,\n onChange,\n onClose,\n open,\n showCloseButton = true,\n size = 'sm',\n trigger,\n ...otherProps\n } = props;\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n draggable,\n drawer: {\n open: drawerOpen,\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\n },\n elements: {\n drawer,\n extra,\n },\n onClose,\n props: otherProps,\n showCloseButton,\n size,\n ref,\n }),\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\n );\n\n return (\n <DialogContext.Provider value={context}>\n <DialogPrimitive.Root defaultOpen={defaultOpen} open={open} onOpenChange={onChange}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DialogContext.Provider>\n );\n}) as ForwardedDialogWithStatics;\n\nDialog.Trigger = Trigger;\nDialog.Content = Content;\nDialog.Title = Title;\nDialog.Footer = Footer;\nDialog.Extra = Extra;\nDialog.Drawer = Drawer;\nDialog.Close = Close;\n"],"names":["useSeparatedChildren","initialChildren","React","children","drawer","extra","toArray","forEach","child","type","displayName","Drawer","Extra","push","Dialog","props","ref","closeOnEscape","defaultOpen","draggable","onChange","onClose","open","showCloseButton","size","trigger","otherProps","drawerOpen","setDrawerOpen","context","toggle","isDrawerOpen","elements","DialogContext","Provider","value","DialogPrimitive","onOpenChange","Trigger","Content","Title","Footer","Close"],"mappings":";;;;;;;;AAgEA,MAAMA,oBAAoB,GAAGC,eAAe;EACxC,OAAOC,OAAa,CAAC;IACjB,MAAMC,QAAQ,GAAU,EAAE;IAC1B,IAAIC,MAAM;IACV,IAAIC,KAAK;IAETH,QAAc,CAACI,OAAO,CAACL,eAAe,CAAC,CAACM,OAAO,CAAEC,KAAU;;MACvD,IAAI,gBAAAA,KAAK,CAACC,IAAI,gDAAV,YAAYC,WAAW,MAAKC,MAAM,CAACD,WAAW,EAAE;QAChDN,MAAM,GAAGI,KAAK;OACjB,MAAM,IAAI,iBAAAA,KAAK,CAACC,IAAI,iDAAV,aAAYC,WAAW,MAAKE,KAAK,CAACF,WAAW,EAAE;QACtDL,KAAK,GAAGG,KAAK;OAChB,MAAM;QACHL,QAAQ,CAACU,IAAI,CAACL,KAAK,CAAC;;KAE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AAO,CAAW,EACvCtB,QAAQ,CACU,CACF;AAEjC,CAAC;AAEDW,MAAM,CAACwB,OAAO,GAAGA,OAAO;AACxBxB,MAAM,CAACyB,OAAO,GAAGA,OAAO;AACxBzB,MAAM,CAAC0B,KAAK,GAAGA,KAAK;AACpB1B,MAAM,CAAC2B,MAAM,GAAGA,MAAM;AACtB3B,MAAM,CAACF,KAAK,GAAGA,KAAK;AACpBE,MAAM,CAACH,MAAM,GAAGA,MAAM;AACtBG,MAAM,CAAC4B,KAAK,GAAGA,KAAK;;;;"}
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\r\nimport './Dialog.css';\r\nimport { DialogTriggerProps, Trigger } from './components/Trigger';\r\nimport {\r\n Content,\r\n Title,\r\n Footer,\r\n Close,\r\n DialogContentProps,\r\n DialogContentRenderProps,\r\n DialogContentDrawerRenderProps,\r\n DialogTitleProps,\r\n DialogFooterProps,\r\n DialogCloseProps,\r\n} from './components/Content';\r\nimport { DialogDrawerProps, DialogDrawerRenderProps, Drawer } from './components/Drawer';\r\nimport { DialogExtraProps, Extra } from './components/Extra';\r\nimport { DialogContext } from './Context';\r\nimport { DialogSize } from './types';\r\n\r\nexport type {\r\n DialogCloseProps,\r\n DialogContentDrawerRenderProps,\r\n DialogContentProps,\r\n DialogContentRenderProps,\r\n DialogDrawerProps,\r\n DialogDrawerRenderProps,\r\n DialogFooterProps,\r\n DialogSize,\r\n DialogTitleProps,\r\n};\r\n\r\nexport type DialogTexts = {\r\n /**\r\n * Aria-label for close icon button in dialog.\r\n * To read more about how to provide the text, see [Provider](component:provider) component\r\n */\r\n close: string;\r\n drag: string;\r\n};\r\n\r\nexport type DialogProps = {\r\n children: React.ReactNode | React.ReactNode[];\r\n /** When `true`, pressing escape will close the dialog */\r\n closeOnEscape?: boolean;\r\n /** Set whether the dialog is open by default or not, use when not providing a trigger */\r\n defaultOpen?: boolean;\r\n /** Allows dragging the dialog around the screen (window constrained) */\r\n draggable?: boolean;\r\n /** Handler called when dialog closes by user interaction */\r\n onClose?: () => void;\r\n /** Called when the dialog opens or closes, must be used in conjunction with open */\r\n onChange?: (open: boolean) => void;\r\n /** Control the open state of the dialog from outside the component */\r\n open?: boolean;\r\n /** Shows the close icon button of the dialog */\r\n showCloseButton?: boolean;\r\n /** Size of the dialog. This is the recommended way to set a size for dialog component. */\r\n size?: DialogSize;\r\n /** A trigger to be used for the dialog, should not be set if `children` already contains a trigger */\r\n trigger?: JSX.Element;\r\n};\r\n\r\nconst useSeparatedChildren = initialChildren => {\r\n return React.useMemo(() => {\r\n const children: any[] = [];\r\n let drawer;\r\n let extra;\r\n\r\n React.Children.toArray(initialChildren).forEach((child: any) => {\r\n if (child.type?.displayName === Drawer.displayName) {\r\n drawer = child;\r\n } else if (child.type?.displayName === Extra.displayName) {\r\n extra = child;\r\n } else {\r\n children.push(child);\r\n }\r\n });\r\n\r\n return [children, drawer, extra];\r\n }, [initialChildren]);\r\n};\r\n\r\nexport type ForwardedDialogWithStatics = React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<HTMLElement>> & {\r\n Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;\r\n Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;\r\n Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;\r\n Footer: React.ForwardRefExoticComponent<DialogFooterProps & React.RefAttributes<HTMLDivElement>>;\r\n Extra: React.ForwardRefExoticComponent<DialogExtraProps & React.RefAttributes<HTMLDivElement>>;\r\n Drawer: React.ForwardRefExoticComponent<DialogDrawerProps & React.RefAttributes<HTMLDivElement>>;\r\n Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;\r\n};\r\n\r\nexport const Dialog = React.forwardRef(function Dialog(props: DialogProps, ref: React.Ref<HTMLElement>) {\r\n const {\r\n children: initialChildren,\r\n closeOnEscape = true,\r\n defaultOpen,\r\n draggable = false,\r\n onChange,\r\n onClose,\r\n open,\r\n showCloseButton = true,\r\n size = 'sm',\r\n trigger,\r\n ...otherProps\r\n } = props;\r\n const [children, drawer, extra] = useSeparatedChildren(initialChildren);\r\n const [drawerOpen, setDrawerOpen] = React.useState(false);\r\n\r\n const context = React.useMemo(\r\n () => ({\r\n closeOnEscape,\r\n draggable,\r\n drawer: {\r\n open: drawerOpen,\r\n toggle: () => setDrawerOpen(isDrawerOpen => !isDrawerOpen),\r\n },\r\n elements: {\r\n drawer,\r\n extra,\r\n },\r\n onClose,\r\n props: otherProps,\r\n showCloseButton,\r\n size,\r\n ref,\r\n }),\r\n [closeOnEscape, drawerOpen, draggable, drawer, extra, open, otherProps, showCloseButton]\r\n );\r\n\r\n return (\r\n <DialogContext.Provider value={context}>\r\n <DialogPrimitive.Root defaultOpen={defaultOpen} open={open} onOpenChange={onChange}>\r\n {trigger && <Trigger>{trigger}</Trigger>}\r\n {children}\r\n </DialogPrimitive.Root>\r\n </DialogContext.Provider>\r\n );\r\n}) as ForwardedDialogWithStatics;\r\n\r\nDialog.Trigger = Trigger;\r\nDialog.Content = Content;\r\nDialog.Title = Title;\r\nDialog.Footer = Footer;\r\nDialog.Extra = Extra;\r\nDialog.Drawer = Drawer;\r\nDialog.Close = Close;\r\n"],"names":["useSeparatedChildren","initialChildren","React","children","drawer","extra","toArray","forEach","child","type","displayName","Drawer","Extra","push","Dialog","props","ref","closeOnEscape","defaultOpen","draggable","onChange","onClose","open","showCloseButton","size","trigger","otherProps","drawerOpen","setDrawerOpen","context","toggle","isDrawerOpen","elements","DialogContext","Provider","value","DialogPrimitive","onOpenChange","Trigger","Content","Title","Footer","Close"],"mappings":";;;;;;;;AAgEA,MAAMA,oBAAoB,GAAGC,eAAe;EACxC,OAAOC,OAAa,CAAC;IACjB,MAAMC,QAAQ,GAAU,EAAE;IA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gB,OAAO;IACPN,KAAK,EAAEW,UAAU;IACjBH,eAAe;IACfC,IAAI;IACJR;GACH,CAAC,EACF,CAACC,aAAa,EAAEU,UAAU,EAAER,SAAS,EAAEf,MAAM,EAAEC,KAAK,EAAEiB,IAAI,EAAEI,UAAU,EAAEH,eAAe,CAAC,CAC3F;EAED,oBACIrB,cAAC+B,aAAa,CAACC,QAAQ;IAACC,KAAK,EAAEN;kBAC3B3B,cAACkC,IAAoB;IAAClB,WAAW,EAAEA,WAAW;IAAEI,IAAI,EAAEA,IAAI;IAAEe,YAAY,EAAEjB;KACrEK,OAAO,iBAAIvB,cAACoC,OAAO,QAAEb,OAAO,CAAW,EACvCtB,QAAQ,CACU,CACF;AAEjC,CAAC;AAEDW,MAAM,CAACwB,OAAO,GAAGA,OAAO;AACxBxB,MAAM,CAACyB,OAAO,GAAGA,OAAO;AACxBzB,MAAM,CAAC0B,KAAK,GAAGA,KAAK;AACpB1B,MAAM,CAAC2B,MAAM,GAAGA,MAAM;AACtB3B,MAAM,CAACF,KAAK,GAAGA,KAAK;AACpBE,MAAM,CAACH,MAAM,GAAGA,MAAM;AACtBG,MAAM,CAAC4B,KAAK,GAAGA,KAAK;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Provider';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames } from '../util';\n\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: DialogContentDrawerRenderProps;\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('text-center', props.className);\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('mt-8 flex justify-end', props.className);\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\n </div>\n );\n});\n\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n const { position, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative bg-white animate-[fade-in_150ms]',\n getDialogPositionClassnames(),\n getDialogSizeClassnames(dialog.size)\n );\n\n const containerClassName = cn(\n 'bg-white p-6 rounded relative z-10',\n 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (!dialog.closeOnEscape) {\n event.preventDefault();\n } else if (dialog.onClose) {\n dialog.onClose();\n }\n };\n\n // the chosen behaviour in taco is that outside clicks do not close the dialog\n const handleInteractOutside = event => event.preventDefault();\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <DialogPrimitive.Close asChild>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </DialogPrimitive.Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay asChild>\n <Backdrop>\n <DialogPrimitive.Content\n {...props}\n className={className}\n onEscapeKeyDown={handleEscapeKeyDown}\n onInteractOutside={handleInteractOutside}\n ref={internalRef}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}>\n <div className={containerClassName} data-taco=\"dialog\">\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n aria-label={texts.dialog.drag}\n className=\"yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center\"\n />\n )}\n {dialog.showCloseButton ? (\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.dialog.close}\n className=\"absolute top-0 right-0 mt-2 mr-2\"\n icon=\"close\"\n />\n </DialogPrimitive.Close>\n ) : null}\n </div>\n {dialog.elements.drawer}\n {dialog.elements.extra}\n </DialogPrimitive.Content>\n </Backdrop>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","DialogTitle","props","ref","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useMergedRef","position","handleProps","dragHandleProps","useDraggable","texts","useLocalization","getDialogPositionClassnames","getDialogSizeClassnames","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","style","left","draggable","x","undefined","top","y","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;MAmBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAW,CAACC,KAAuB,EAAEC,GAAkC;EAClH,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAAqB,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC/E,CAAC;MAGYI,MAAM,gBAAGP,UAAgB,CAAC,SAASQ,YAAY,CAACN,KAAwB,EAAEC,GAA8B;EACjH,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAuB,EAAEH,KAAK,CAACE,SAAS,CAAC;EAC9D,oBACIJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;MACtCD,KAAK,CAACO,QAAQ,CACb;AAEd,CAAC;MAIYC,KAAK,gBAAGV,UAAgB,CAAC,SAASW,WAAW,CAACT,KAAuB,EAAEC,GAAiC;EACjH,MAAMS,MAAM,GAAGC,gBAAgB,EAAE;EAEjC,oBAAOb,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG;KAAab,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEa,OAAO;KAAG;AAC1F,CAAC;AAED,MAAMC,iBAAiB,gBAAGjB,UAAgB,CAAC,SAASiB,iBAAiB,CAAC;EAAER,QAAQ;EAAEK,OAAO;EAAEI;CAAkB,EAAEf,GAAG;EAC9G,MAAMgB,KAAK,GAAG;IACVL,OAAO,CAAC,IAAIM,WAAW,CAAC,OAAO,CAAC,CAAC;GACpC;EAED,OAAOX,QAAQ,CAAC;IAAEU,KAAK;I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G3B,oBACIT,cAACM,MAAsB,qBACnBN,cAACM,OAAuB;IAACU,OAAO;kBAC5BhB,cAAC4C,QAAQ,qBACL5C,cAACM,SAAuB,oBAChBJ,KAAK;IACTE,SAAS,EAAEA,SAAS;IACpByC,eAAe,EAAER,mBAAmB;IACpCS,iBAAiB,EAAEL,qBAAqB;IACxCtC,GAAG,EAAEoB,WAAW;IAChBwB,KAAK,EAAE;MACH,GAAG7C,KAAK,CAAC6C,KAAK;MACdC,IAAI,EAAEpC,MAAM,CAACqC,SAAS,MAAMxB,QAAQ,CAACyB,KAAK,GAAGC,SAAS;MACtDC,GAAG,EAAExC,MAAM,CAACqC,SAAS,MAAMxB,QAAQ,CAAC4B,KAAK,GAAGF;;mBAEhDnD;IAAKI,SAAS,EAAE8B,kBAAkB;iBAAY;KACzCQ,MAAM,EACN9B,MAAM,CAACqC,SAAS,iBACbjD,uCACQ2B,eAAe;kBACPE,KAAK,CAACjB,MAAM,CAAC0C,IAAI;IAC7BlD,SAAS,EAAC;KAEjB,EACAQ,MAAM,CAAC2C,eAAe,gBACnBvD,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG,OAAO;IAAEC,OAAO;kBACnDhB,cAACwD,UAAU;IACPC,UAAU,EAAC,UAAU;kBACT5B,KAAK,CAACjB,MAAM,CAACO,KAAK;IAC9Bf,SAAS,EAAC,kCAAkC;IAC5CsD,IAAI,EAAC;IACP,CACkB,GACxB,IAAI,CACN,EACL9C,MAAM,CAACuB,QAAQ,CAACQ,MAAM,EACtB/B,MAAM,CAACuB,QAAQ,CAACC,KAAK,CACA,CACnB,CACW,CACL;AAEjC,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\r\nimport { useMergedRef } from '../../../hooks/useMergedRef';\r\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\r\nimport { DialogContext, useCurrentDialog } from '../Context';\r\nimport { useLocalization } from '../../Provider/Provider';\r\nimport { IconButton } from '../../IconButton/IconButton';\r\nimport { Backdrop } from '../../Backdrop/Backdrop';\r\nimport { getDialogPositionClassnames, getDialogSizeClassnames } from '../util';\r\n\r\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\r\n\r\nexport type DialogContentRenderProps = {\r\n close: () => void;\r\n drawer?: DialogContentDrawerRenderProps;\r\n};\r\n\r\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\r\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\r\n const className = cn('text-center', props.className);\r\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\r\n});\r\n\r\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\r\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\r\n const className = cn('mt-8 flex justify-end', props.className);\r\n return (\r\n <div {...props} className={className} ref={ref}>\r\n {props.children}\r\n </div>\r\n );\r\n});\r\n\r\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\r\n\r\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\r\n const dialog = useCurrentDialog();\r\n\r\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\r\n});\r\n\r\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\r\n const close = () => {\r\n onClick(new CustomEvent('close'));\r\n };\r\n\r\n return children({ close, ref, ...renderProps });\r\n});\r\n\r\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\r\n /** An accessible label to be announced when the dialog is opened */\r\n 'aria-label': string;\r\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\r\n};\r\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\r\n const dialog = useCurrentDialog();\r\n const internalRef = useMergedRef<HTMLDivElement>(ref);\r\n const { position, handleProps: dragHandleProps } = useDraggable(internalRef);\r\n const { texts } = useLocalization();\r\n\r\n const className = cn(\r\n 'relative bg-white animate-[fade-in_150ms]',\r\n getDialogPositionClassnames(),\r\n getDialogSizeClassnames(dialog.size)\r\n );\r\n\r\n const containerClassName = cn(\r\n 'bg-white p-6 rounded relative z-10',\r\n 'shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]',\r\n {\r\n 'rounded-b-none': !!dialog.elements.extra,\r\n },\r\n props.className\r\n );\r\n\r\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\r\n if (!dialog.closeOnEscape) {\r\n event.preventDefault();\r\n } else if (dialog.onClose) {\r\n dialog.onClose();\r\n }\r\n };\r\n\r\n // the chosen behaviour in taco is that outside clicks do not close the dialog\r\n const handleInteractOutside = event => event.preventDefault();\r\n\r\n let output;\r\n\r\n if (typeof props.children === 'function') {\r\n output = (\r\n <DialogPrimitive.Close asChild>\r\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\r\n </DialogPrimitive.Close>\r\n );\r\n } else {\r\n output = props.children;\r\n }\r\n\r\n return (\r\n <DialogPrimitive.Portal>\r\n <DialogPrimitive.Overlay asChild>\r\n <Backdrop>\r\n <DialogPrimitive.Content\r\n {...props}\r\n className={className}\r\n onEscapeKeyDown={handleEscapeKeyDown}\r\n onInteractOutside={handleInteractOutside}\r\n ref={internalRef}\r\n style={{\r\n ...props.style,\r\n left: dialog.draggable ? `${position.x}px` : undefined,\r\n top: dialog.draggable ? `${position.y}px` : undefined,\r\n }}>\r\n <div className={containerClassName} data-taco=\"dialog\">\r\n {output}\r\n {dialog.draggable && (\r\n <div\r\n {...dragHandleProps}\r\n aria-label={texts.dialog.drag}\r\n className=\"yt-dialog__drag absolute-center-x bg-grey-light top-1.5 h-3 w-24 cursor-move rounded text-center\"\r\n />\r\n )}\r\n {dialog.showCloseButton ? (\r\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\r\n <IconButton\r\n appearance=\"discrete\"\r\n aria-label={texts.dialog.close}\r\n className=\"absolute top-0 right-0 mt-2 mr-2\"\r\n icon=\"close\"\r\n />\r\n </DialogPrimitive.Close>\r\n ) : null}\r\n </div>\r\n {dialog.elements.drawer}\r\n {dialog.elements.extra}\r\n </DialogPrimitive.Content>\r\n </Backdrop>\r\n </DialogPrimitive.Overlay>\r\n </DialogPrimitive.Portal>\r\n );\r\n});\r\n"],"names":["Title","React","DialogTitle","props","ref","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useMergedRef","position","handleProps","dragHandleProps","useDraggable","texts","useLocalization","getDialogPositionClassnames","getDialogSizeClassnames","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","style","left","draggable","x","undefined","top","y","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;MAmBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAW,CAACC,KAAuB,EAAEC,GAAkC;EAClH,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAAqB,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC/E,CAAC;MAGYI,MAAM,gBAAGP,UAAgB,CAAC,SAASQ,YAAY,CAACN,KAAwB,EAAEC,GAA8B;EACjH,MAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAuB,EAAEH,KAAK,CAACE,SAAS,CAAC;EAC9D,oBACI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B,EACAQ,MAAM,CAAC2C,eAAe,gBACnBvD,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG,OAAO;IAAEC,OAAO;kBACnDhB,cAACwD,UAAU;IACPC,UAAU,EAAC,UAAU;kBACT5B,KAAK,CAACjB,MAAM,CAACO,KAAK;IAC9Bf,SAAS,EAAC,kCAAkC;IAC5CsD,IAAI,EAAC;IACP,CACkB,GACxB,IAAI,CACN,EACL9C,MAAM,CAACuB,QAAQ,CAACQ,MAAM,EACtB/B,MAAM,CAACuB,QAAQ,CAACC,KAAK,CACA,CACnB,CACW,CACL;AAEjC,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../../../../../../../src/components/Dialog/components/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { motion } from 'framer-motion';\nimport cn from 'classnames';\nimport { DialogContext, useCurrentDialog } from '../Context';\n\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n> & {\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\n};\n\nconst Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const className = cn(\n 'absolute top-0 -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\n props.className\n );\n\n return (\n <motion.div\n {...props}\n className={className}\n data-taco=\"dialog-drawer\"\n aria-hidden={!dialog.drawer?.open}\n variants={{\n visible: {\n left: '100%',\n display: 'block',\n transition: { ease: 'easeOut', duration: 0.2 },\n },\n hidden: {\n left: '0%',\n transition: { ease: 'easeOut', duration: 0.2 },\n transitionEnd: {\n display: 'none',\n },\n },\n }}\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\n ref={ref}>\n {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\n </motion.div>\n );\n});\nDrawer.displayName = 'DialogDrawer';\n\nexport { Drawer };\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","className","cn","motion","div","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate","children","displayName"],"mappings":";;;;;MAcMA,MAAM,gBAAGC,UAAgB,CAAC,SAASC,YAAY,CAACC,KAAwB,EAAEC,GAA8B;;EAC1G,MAAMC,MAAM,GAAGC,gBAAgB,EAAE;EACjC,MAAMC,SAAS,GAAGC,EAAE,CAChB,iGAAiG,EACjGL,KAAK,CAACI,SAAS,CAClB;EAED,oBACIN,cAACQ,MAAM,CAACC,GAAG,oBACHP,KAAK;IACTI,SAAS,EAAEA,SAAS;iBACV,eAAe;mBACZ,oBAACF,MAAM,CAACM,MAAM,2CAAb,eAAeC,IAAI;IACjCC,QAAQ,EAAE;MACNC,OAAO,EAAE;QACLC,IAAI,EAAE,MAAM;QACZC,OAAO,EAAE,OAAO;QAChBC,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAS;UAAEC,QAAQ,EAAE;;OAC5C;MACDC,MAAM,EAAE;QACJL,IAAI,EAAE,IAAI;QACVE,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAS;UAAEC,QAAQ,EAAE;SAAK;QAC9CE,aAAa,EAAE;UACXL,OAAO,EAAE;;;KAGpB;IACDM,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAM,4CAAb,gBAAeC,IAAI,GAAG,SAAS,GAAG,QAAQ;IACnDR,GAAG,EAAEA;MACJ,OAAOD,KAAK,CAACoB,QAAQ,KAAK,UAAU,GAAGpB,KAAK,CAACoB,QAAQ,CAAClB,MAAM,CAACM,MAAM,CAAC,GAAGR,KAAK,CAACoB,QAAQ,CAC7E;AAErB,CAAC;AACDvB,MAAM,CAACwB,WAAW,GAAG,cAAc;;;;"}
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../../../../../../src/components/Dialog/components/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport { motion } from 'framer-motion';\r\nimport cn from 'classnames';\r\nimport { DialogContext, useCurrentDialog } from '../Context';\r\n\r\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\r\n\r\nexport type DialogDrawerProps = Omit<\r\n React.HTMLAttributes<HTMLDivElement>,\r\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\r\n> & {\r\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\r\n};\r\n\r\nconst Drawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\r\n const dialog = useCurrentDialog();\r\n const className = cn(\r\n 'absolute top-0 -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\r\n props.className\r\n );\r\n\r\n return (\r\n <motion.div\r\n {...props}\r\n className={className}\r\n data-taco=\"dialog-drawer\"\r\n aria-hidden={!dialog.drawer?.open}\r\n variants={{\r\n visible: {\r\n left: '100%',\r\n display: 'block',\r\n transition: { ease: 'easeOut', duration: 0.2 },\r\n },\r\n hidden: {\r\n left: '0%',\r\n transition: { ease: 'easeOut', duration: 0.2 },\r\n transitionEnd: {\r\n display: 'none',\r\n },\r\n },\r\n }}\r\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\r\n ref={ref}>\r\n {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\r\n </motion.div>\r\n );\r\n});\r\nDrawer.displayName = 'DialogDrawer';\r\n\r\nexport { Drawer };\r\n"],"names":["Drawer","React","DialogDrawer","props","ref","dialog","useCurrentDialog","className","cn","motion","div","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate","children","displayName"],"mappings":";;;;;MAcMA,MAAM,gBAAGC,UAAgB,CAAC,SAASC,YAAY,CAACC,KAAwB,EAAEC,GAA8B;;EAC1G,MAAMC,MAAM,GAAGC,gBAAgB,EAAE;EACjC,MAAMC,SAAS,GAAGC,EAAE,CAChB,iGAAiG,EACjGL,KAAK,CAACI,SAAS,CAClB;EAED,oBACIN,cAACQ,MAAM,CAACC,GAAG,oBACHP,KAAK;IACTI,SAAS,EAAEA,SAAS;iBACV,eAAe;mBACZ,oBAACF,MAAM,CAACM,MAAM,2CAAb,eAAeC,IAAI;IACjCC,QAAQ,EAAE;MACNC,OAAO,EAAE;QACLC,IAAI,EAAE,MAAM;QACZC,OAAO,EAAE,OAAO;QAChBC,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAS;UAAEC,QAAQ,EAAE;;OAC5C;MACDC,MAAM,EAAE;QACJL,IAAI,EAAE,IAAI;QACVE,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAS;UAAEC,QAAQ,EAAE;SAAK;QAC9CE,aAAa,EAAE;UACXL,OAAO,EAAE;;;KAGpB;IACDM,OAAO,EAAE,mBAAAjB,MAAM,CAACM,MAAM,4CAAb,gBAAeC,IAAI,GAAG,SAAS,GAAG,QAAQ;IACnDR,GAAG,EAAEA;MACJ,OAAOD,KAAK,CAACoB,QAAQ,KAAK,UAAU,GAAGpB,KAAK,CAACoB,QAAQ,CAAClB,MAAM,CAACM,MAAM,CAAC,GAAGR,KAAK,CAACoB,QAAQ,CAC7E;AAErB,CAAC;AACDvB,MAAM,CAACwB,WAAW,GAAG,cAAc;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useCurrentDialog } from '../Context';\nimport { mergeRefs } from '../../../utils/mergeRefs';\n\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function DialogTrigger(\n props: DialogTriggerProps,\n externalRef: React.Ref<HTMLButtonElement>\n) {\n const { ref: parentRef, props: parentProps } = useCurrentDialog();\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n return <DialogPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild />;\n});\n"],"names":["Trigger","React","DialogTrigger","props","externalRef","ref","parentRef","parentProps","useCurrentDialog","refCallback","mergeRefs","DialogPrimitive","asChild"],"mappings":";;;;;MAOaA,OAAO,gBAAGC,UAAgB,CAAC,SAASC,aAAa,CAC1DC,KAAyB,EACzBC,WAAyC;EAEzC,MAAM;IAAEC,GAAG,EAAEC,SAAS;IAAEH,KAAK,EAAEI;GAAa,GAAGC,gBAAgB,EAAE;EACjE,MAAMC,WAAW,GAAGC,SAAS,CAAC,CAACJ,SAAS,EAAEF,WAAW,CAAC,CAAC;EAEvD,oBAAOH,cAACU,SAAuB,oBAAKJ,WAAW,EAAMJ,KAAK;IAAEE,GAAG,EAAEI,WAAW;IAAEG,OAAO;KAAG;AAC5F,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\r\nimport { useCurrentDialog } from '../Context';\r\nimport { mergeRefs } from '../../../utils/mergeRefs';\r\n\r\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\r\n\r\nexport const Trigger = React.forwardRef(function DialogTrigger(\r\n props: DialogTriggerProps,\r\n externalRef: React.Ref<HTMLButtonElement>\r\n) {\r\n const { ref: parentRef, props: parentProps } = useCurrentDialog();\r\n const refCallback = mergeRefs([parentRef, externalRef]);\r\n\r\n return <DialogPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild />;\r\n});\r\n"],"names":["Trigger","React","DialogTrigger","props","externalRef","ref","parentRef","parentProps","useCurrentDialog","refCallback","mergeRefs","DialogPrimitive","asChild"],"mappings":";;;;;MAOaA,OAAO,gBAAGC,UAAgB,CAAC,SAASC,aAAa,CAC1DC,KAAyB,EACzBC,WAAyC;EAEzC,MAAM;IAAEC,GAAG,EAAEC,SAAS;IAAEH,KAAK,EAAEI;GAAa,GAAGC,gBAAgB,EAAE;EACjE,MAAMC,WAAW,GAAGC,SAAS,CAAC,CAACJ,SAAS,EAAEF,WAAW,CAAC,CAAC;EAEvD,oBAAOH,cAACU,SAAuB,oBAAKJ,WAAW,EAAMJ,KAAK;IAAEE,GAAG,EAAEI,WAAW;IAAEG,OAAO;KAAG;AAC5F,CAAC;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Dialog/util.ts"],"sourcesContent":["import { DialogSize } from './types';\n\nexport const getDialogSizeClassnames = (size: DialogSize) => {\n switch (size) {\n case 'dialog':\n return 'w-128';\n case 'xs':\n return 'w-xs';\n case 'sm':\n return 'w-sm';\n case 'md':\n return 'w-md';\n case 'lg':\n return 'w-lg';\n }\n};\n\nexport const getDialogPositionClassnames = () => 'mt-16 mx-auto';\n\nexport const getDialogStylingClassnames = () =>\n 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';\n"],"names":["getDialogSizeClassnames","size","getDialogPositionClassnames","getDialogStylingClassnames"],"mappings":"MAEaA,uBAAuB,GAAIC,IAAgB;EACpD,QAAQA,IAAI;IACR,KAAK,QAAQ;MACT,OAAO,OAAO;IAClB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;;AAEzB;MAEaC,2BAA2B,GAAG,MAAM;MAEpCC,0BAA0B,GAAG,MACtC;;;;"}
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Dialog/util.ts"],"sourcesContent":["import { DialogSize } from './types';\r\n\r\nexport const getDialogSizeClassnames = (size: DialogSize) => {\r\n switch (size) {\r\n case 'dialog':\r\n return 'w-128';\r\n case 'xs':\r\n return 'w-xs';\r\n case 'sm':\r\n return 'w-sm';\r\n case 'md':\r\n return 'w-md';\r\n case 'lg':\r\n return 'w-lg';\r\n }\r\n};\r\n\r\nexport const getDialogPositionClassnames = () => 'mt-16 mx-auto';\r\n\r\nexport const getDialogStylingClassnames = () =>\r\n 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';\r\n"],"names":["getDialogSizeClassnames","size","getDialogPositionClassnames","getDialogStylingClassnames"],"mappings":"MAEaA,uBAAuB,GAAIC,IAAgB;EACpD,QAAQA,IAAI;IACR,KAAK,QAAQ;MACT,OAAO,OAAO;IAClB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;;AAEzB;MAEaC,2BAA2B,GAAG,MAAM;MAEpCC,0BAA0B,GAAG,MACtC;;;;"}
|