@economic/taco 1.0.3 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -84
- package/dist/esm/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js.map +1 -1
- package/dist/esm/components/Banner/Banner.js.map +1 -1
- package/dist/esm/components/Banner/util.js +1 -1
- package/dist/esm/components/Banner/util.js.map +1 -1
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Button/util.js +18 -23
- package/dist/esm/components/Button/util.js.map +1 -1
- package/dist/esm/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/components/Combobox/useCombobox.js +67 -87
- package/dist/esm/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/components/Datepicker/useDatepicker.js +27 -34
- package/dist/esm/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/components/Dialog/Context.js +4 -4
- package/dist/esm/components/Dialog/Context.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/components/Content.js +39 -44
- package/dist/esm/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/components/Dialog/components/Drawer.js +3 -3
- package/dist/esm/components/Dialog/components/Drawer.js.map +1 -1
- package/dist/esm/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/components/Dialog/components/Trigger.js +2 -2
- package/dist/esm/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/components/Field/Field.js.map +1 -1
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/Group/Group.js.map +1 -1
- package/dist/esm/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountPreview.js.map +1 -1
- package/dist/esm/components/Icon/components/Accounting.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountingYear.js.map +1 -1
- package/dist/esm/components/Icon/components/AccountingYearCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowBottom.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowEnd.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowRight.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowStart.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowTop.js.map +1 -1
- package/dist/esm/components/Icon/components/ArrowUp.js.map +1 -1
- package/dist/esm/components/Icon/components/Attach.js.map +1 -1
- package/dist/esm/components/Icon/components/AttachAuto.js.map +1 -1
- package/dist/esm/components/Icon/components/AttachCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/Autotext.js.map +1 -1
- package/dist/esm/components/Icon/components/AutotextInsert.js.map +1 -1
- package/dist/esm/components/Icon/components/Basic.js.map +1 -1
- package/dist/esm/components/Icon/components/BasicTabs.js.map +1 -1
- package/dist/esm/components/Icon/components/BellSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Book.js.map +1 -1
- package/dist/esm/components/Icon/components/Booking.js.map +1 -1
- package/dist/esm/components/Icon/components/Budget.js.map +1 -1
- package/dist/esm/components/Icon/components/Calendar.js.map +1 -1
- package/dist/esm/components/Icon/components/CashAccount.js.map +1 -1
- package/dist/esm/components/Icon/components/CashReports.js.map +1 -1
- package/dist/esm/components/Icon/components/Chat.js.map +1 -1
- package/dist/esm/components/Icon/components/ChatSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDownDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronDownSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronLeftDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronRight.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronRightDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUp.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUpDouble.js.map +1 -1
- package/dist/esm/components/Icon/components/ChevronUpSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/CircleClose.js.map +1 -1
- package/dist/esm/components/Icon/components/CircleMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/CirclePlus.js.map +1 -1
- package/dist/esm/components/Icon/components/CircleTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Clamp.js.map +1 -1
- package/dist/esm/components/Icon/components/ClampOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/Close.js.map +1 -1
- package/dist/esm/components/Icon/components/ConnectionEnable.js.map +1 -1
- package/dist/esm/components/Icon/components/ConnectionRevoke.js.map +1 -1
- package/dist/esm/components/Icon/components/Contacts.js.map +1 -1
- package/dist/esm/components/Icon/components/Copy.js.map +1 -1
- package/dist/esm/components/Icon/components/Courses.js.map +1 -1
- package/dist/esm/components/Icon/components/Credit.js.map +1 -1
- package/dist/esm/components/Icon/components/Delete.js.map +1 -1
- package/dist/esm/components/Icon/components/DeletePermanently.js.map +1 -1
- package/dist/esm/components/Icon/components/Depecriate.js.map +1 -1
- package/dist/esm/components/Icon/components/Developer.js.map +1 -1
- package/dist/esm/components/Icon/components/DistributionTemplate.js.map +1 -1
- package/dist/esm/components/Icon/components/Document.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentApprove.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentCreateEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentCut.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentError.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentIsolatePage.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentMerge.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentMove.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentPreview.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentReceived.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentRejectedRequest.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentSplit.js.map +1 -1
- package/dist/esm/components/Icon/components/DocumentTime.js.map +1 -1
- package/dist/esm/components/Icon/components/Download.js.map +1 -1
- package/dist/esm/components/Icon/components/Drag.js.map +1 -1
- package/dist/esm/components/Icon/components/ECopedia.js.map +1 -1
- package/dist/esm/components/Icon/components/ESignature.js.map +1 -1
- package/dist/esm/components/Icon/components/Edit.js.map +1 -1
- package/dist/esm/components/Icon/components/EllipsisHorizontal.js.map +1 -1
- package/dist/esm/components/Icon/components/EllipsisVertical.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesOnAccount.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/EntriesWarning.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeCustomerPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeJournalEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeManualCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeSupplierInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/EntryTypeSupplierPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/Envelope.js.map +1 -1
- package/dist/esm/components/Icon/components/EnvelopeApproved.js.map +1 -1
- package/dist/esm/components/Icon/components/ExpandView.js.map +1 -1
- package/dist/esm/components/Icon/components/Expenses.js.map +1 -1
- package/dist/esm/components/Icon/components/Export.js.map +1 -1
- package/dist/esm/components/Icon/components/ExportToExcel.js.map +1 -1
- package/dist/esm/components/Icon/components/ExportToPdf.js.map +1 -1
- package/dist/esm/components/Icon/components/Filter.js.map +1 -1
- package/dist/esm/components/Icon/components/FilterSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/GraphSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Hash.js.map +1 -1
- package/dist/esm/components/Icon/components/Home.js.map +1 -1
- package/dist/esm/components/Icon/components/Images.js.map +1 -1
- package/dist/esm/components/Icon/components/Import.js.map +1 -1
- package/dist/esm/components/Icon/components/Inbox.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxEinvoicing.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxScanning.js.map +1 -1
- package/dist/esm/components/Icon/components/InboxSmart.js.map +1 -1
- package/dist/esm/components/Icon/components/Info.js.map +1 -1
- package/dist/esm/components/Icon/components/Inventory.js.map +1 -1
- package/dist/esm/components/Icon/components/InventoryMatrix.js.map +1 -1
- package/dist/esm/components/Icon/components/JournalPro.js.map +1 -1
- package/dist/esm/components/Icon/components/Layout.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutBoth.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutFirst.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutLast.js.map +1 -1
- package/dist/esm/components/Icon/components/LayoutNone.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCard.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardCustomerReminder.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardManualCustomerInvoice.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardObsoleteStock.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardOpeningEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardReservedEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardShrinkagePilferage.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardStockAdjustment.js.map +1 -1
- package/dist/esm/components/Icon/components/LedgerCardTransferredOpeningEntry.js.map +1 -1
- package/dist/esm/components/Icon/components/Lightbulb.js.map +1 -1
- package/dist/esm/components/Icon/components/Line.js.map +1 -1
- package/dist/esm/components/Icon/components/List.js.map +1 -1
- package/dist/esm/components/Icon/components/ListBulleted.js.map +1 -1
- package/dist/esm/components/Icon/components/ListSearch.js.map +1 -1
- package/dist/esm/components/Icon/components/LockOpen.js.map +1 -1
- package/dist/esm/components/Icon/components/Log.js.map +1 -1
- package/dist/esm/components/Icon/components/Market.js.map +1 -1
- package/dist/esm/components/Icon/components/MatchAmount.js.map +1 -1
- package/dist/esm/components/Icon/components/MatchEntries.js.map +1 -1
- package/dist/esm/components/Icon/components/Mileage.js.map +1 -1
- package/dist/esm/components/Icon/components/ModalResize.js.map +1 -1
- package/dist/esm/components/Icon/components/ModalShrink.js.map +1 -1
- package/dist/esm/components/Icon/components/More.js.map +1 -1
- package/dist/esm/components/Icon/components/MoreSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Move.js.map +1 -1
- package/dist/esm/components/Icon/components/NavigationList.js.map +1 -1
- package/dist/esm/components/Icon/components/Note.js.map +1 -1
- package/dist/esm/components/Icon/components/NoteFollowUp.js.map +1 -1
- package/dist/esm/components/Icon/components/NoteRead.js.map +1 -1
- package/dist/esm/components/Icon/components/PartnerApi.js.map +1 -1
- package/dist/esm/components/Icon/components/Period.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonChange.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonPlus.js.map +1 -1
- package/dist/esm/components/Icon/components/PersonTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Play.js.map +1 -1
- package/dist/esm/components/Icon/components/PlusMinus.js.map +1 -1
- package/dist/esm/components/Icon/components/Print.js.map +1 -1
- package/dist/esm/components/Icon/components/ProcessPayment.js.map +1 -1
- package/dist/esm/components/Icon/components/ProductLedgerCard.js.map +1 -1
- package/dist/esm/components/Icon/components/ProjectCards.js.map +1 -1
- package/dist/esm/components/Icon/components/Projects.js.map +1 -1
- package/dist/esm/components/Icon/components/Quicklinks.js.map +1 -1
- package/dist/esm/components/Icon/components/RatingBankruptcy.js.map +1 -1
- package/dist/esm/components/Icon/components/RatingPaymentProblems.js.map +1 -1
- package/dist/esm/components/Icon/components/Reconciled.js.map +1 -1
- package/dist/esm/components/Icon/components/Refresh.js.map +1 -1
- package/dist/esm/components/Icon/components/Report.js.map +1 -1
- package/dist/esm/components/Icon/components/ReportSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Restore.js.map +1 -1
- package/dist/esm/components/Icon/components/RotateLeft.js.map +1 -1
- package/dist/esm/components/Icon/components/RotateRight.js.map +1 -1
- package/dist/esm/components/Icon/components/Sales.js.map +1 -1
- package/dist/esm/components/Icon/components/Search.js.map +1 -1
- package/dist/esm/components/Icon/components/SearchBold.js.map +1 -1
- package/dist/esm/components/Icon/components/Secure.js.map +1 -1
- package/dist/esm/components/Icon/components/SecureTick.js.map +1 -1
- package/dist/esm/components/Icon/components/Settings.js.map +1 -1
- package/dist/esm/components/Icon/components/SettingsSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Shortcuts.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowAll.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowLess.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowMore.js.map +1 -1
- package/dist/esm/components/Icon/components/ShowTemplate.js.map +1 -1
- package/dist/esm/components/Icon/components/Sliders.js.map +1 -1
- package/dist/esm/components/Icon/components/Smartpay.js.map +1 -1
- package/dist/esm/components/Icon/components/SortBy.js.map +1 -1
- package/dist/esm/components/Icon/components/Spinner.js.map +1 -1
- package/dist/esm/components/Icon/components/Star.js.map +1 -1
- package/dist/esm/components/Icon/components/StarSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Subscriptions.js.map +1 -1
- package/dist/esm/components/Icon/components/SystemEntries.js.map +1 -1
- package/dist/esm/components/Icon/components/Tag.js.map +1 -1
- package/dist/esm/components/Icon/components/TemplateOverride.js.map +1 -1
- package/dist/esm/components/Icon/components/Templates.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbBoth.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbDown.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbDownSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbUp.js.map +1 -1
- package/dist/esm/components/Icon/components/ThumbUpSolid.js.map +1 -1
- package/dist/esm/components/Icon/components/Tick.js.map +1 -1
- package/dist/esm/components/Icon/components/Time.js.map +1 -1
- package/dist/esm/components/Icon/components/Transfer.js.map +1 -1
- package/dist/esm/components/Icon/components/TransferCancel.js.map +1 -1
- package/dist/esm/components/Icon/components/TransferLocked.js.map +1 -1
- package/dist/esm/components/Icon/components/Undock.js.map +1 -1
- package/dist/esm/components/Icon/components/Unreconciled.js.map +1 -1
- package/dist/esm/components/Icon/components/Warning.js.map +1 -1
- package/dist/esm/components/Icon/components/Webshop.js.map +1 -1
- package/dist/esm/components/Icon/components/Website.js.map +1 -1
- package/dist/esm/components/Icon/components/Workflow.js.map +1 -1
- package/dist/esm/components/Icon/components/Zoom.js.map +1 -1
- package/dist/esm/components/Icon/components/index.js +4 -4
- package/dist/esm/components/Icon/components/index.js.map +1 -1
- package/dist/esm/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/components/Input/Input.js.map +1 -1
- package/dist/esm/components/Input/util.js +2 -2
- package/dist/esm/components/Input/util.js.map +1 -1
- package/dist/esm/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/components/Listbox/ScrollableList.js +64 -83
- package/dist/esm/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/components/Listbox/useListbox.js +51 -60
- package/dist/esm/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useMultiListbox.js +64 -91
- package/dist/esm/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/components/Listbox/useTypeahead.js +10 -9
- package/dist/esm/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/components/Listbox/util.js +48 -85
- package/dist/esm/components/Listbox/util.js.map +1 -1
- package/dist/esm/components/Menu/Context.js +2 -2
- package/dist/esm/components/Menu/Context.js.map +1 -1
- package/dist/esm/components/Menu/Menu.js.map +1 -1
- package/dist/esm/components/Menu/components/Checkbox.js +8 -9
- package/dist/esm/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/components/Menu/components/Content.js +10 -13
- package/dist/esm/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/components/Menu/components/Header.js +4 -4
- package/dist/esm/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/components/Menu/components/Item.js +34 -35
- package/dist/esm/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/components/Menu/components/Link.js +10 -11
- package/dist/esm/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/components/Menu/components/RadioGroup.js +16 -18
- package/dist/esm/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Menu/components/Separator.js +4 -4
- package/dist/esm/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/components/Menu/components/Trigger.js +5 -5
- package/dist/esm/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/components/Navigation/Navigation.js +35 -44
- package/dist/esm/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/components/Pagination/PageNumbers.js +23 -28
- package/dist/esm/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +39 -56
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePagination.js +7 -21
- package/dist/esm/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/components/Pagination/usePaginationShortcuts.js +9 -9
- package/dist/esm/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +29 -34
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/Popover/Primitives.js +7 -8
- package/dist/esm/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/components/Progress/Progress.js +11 -15
- package/dist/esm/components/Progress/Progress.js.map +1 -1
- package/dist/esm/components/Provider/Provider.js +13 -18
- package/dist/esm/components/Provider/Provider.js.map +1 -1
- package/dist/esm/components/RadioGroup/RadioGroup.js +45 -57
- package/dist/esm/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/components/Select/Select.js +30 -31
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Select/useSelect.js +63 -81
- package/dist/esm/components/Select/useSelect.js.map +1 -1
- package/dist/esm/components/Spinner/Spinner.js +12 -19
- package/dist/esm/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +9 -10
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Table/components/BaseTable.js +23 -30
- package/dist/esm/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/components/Table/components/PaginatedTable.js +3 -7
- package/dist/esm/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/components/Table/components/Table.js +18 -25
- package/dist/esm/components/Table/components/Table.js.map +1 -1
- package/dist/esm/components/Table/components/WindowedTable.js +88 -104
- package/dist/esm/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js +122 -147
- package/dist/esm/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js +57 -61
- package/dist/esm/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js +39 -36
- package/dist/esm/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js +79 -89
- package/dist/esm/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/components/Table/hooks/useRowCreation.js +29 -64
- package/dist/esm/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTable.js +119 -141
- package/dist/esm/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js +12 -15
- package/dist/esm/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/components/Table/util/renderColumn.js +10 -10
- package/dist/esm/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/components/Table/util/renderRow.js +37 -46
- package/dist/esm/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/components/Table/util/rowIndexPath.js +14 -16
- package/dist/esm/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/components/Table/util/sortTypes.js +23 -31
- package/dist/esm/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/components/Table/util.js +29 -41
- package/dist/esm/components/Table/util.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.js +25 -27
- package/dist/esm/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/components/Textarea/Textarea.js +11 -9
- package/dist/esm/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/components/Toast/Toast.js +20 -21
- package/dist/esm/components/Toast/Toast.js.map +1 -1
- package/dist/esm/components/Toast/Toaster.js +88 -118
- package/dist/esm/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/components/Toast/util.js +2 -2
- package/dist/esm/components/Toast/util.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +7 -8
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Tour/Tour.js +44 -50
- package/dist/esm/components/Tour/Tour.js.map +1 -1
- package/dist/esm/components/Treeview/Treeview.js +26 -36
- package/dist/esm/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/index.css +661 -661
- package/dist/esm/index.js +1 -1
- package/dist/esm/primitives/Button.js +9 -13
- package/dist/esm/primitives/Button.js.map +1 -1
- package/dist/esm/utils/date.js.map +1 -1
- package/dist/esm/utils/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/utils/hooks/useDraggable.js +16 -18
- package/dist/esm/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/utils/hooks/useDropTarget.js +7 -10
- package/dist/esm/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/utils/hooks/useProxiedRef.js +3 -3
- package/dist/esm/utils/hooks/useProxiedRef.js.map +1 -1
- package/dist/esm/utils/hooks/useTimer.js +9 -17
- package/dist/esm/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/utils/input.js +7 -11
- package/dist/esm/utils/input.js.map +1 -1
- package/dist/esm/utils/mergeRefs.js +2 -2
- package/dist/esm/utils/mergeRefs.js.map +1 -1
- package/dist/esm/utils/taillwind.js +2 -2
- package/dist/esm/utils/taillwind.js.map +1 -1
- package/dist/index.css +661 -661
- package/dist/taco.cjs.development.js +1895 -2318
- 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 +297 -297
package/README.md
CHANGED
@@ -1,84 +1,84 @@
|
|
1
|
-
[](https://travis-ci.com/e-conomic/taco)
|
2
|
-
|
3
|
-
# @economic/taco
|
4
|
-
|
5
|
-
> UI React component library
|
6
|
-
|
7
|
-
## Usage
|
8
|
-
|
9
|
-
```bash
|
10
|
-
npm install @economic/taco
|
11
|
-
```
|
12
|
-
|
13
|
-
```javascript
|
14
|
-
import { Button } from '@economic/taco';
|
15
|
-
|
16
|
-
const MyComponent = () => <Button>Tada!</Button>;
|
17
|
-
```
|
18
|
-
|
19
|
-
## Development
|
20
|
-
|
21
|
-
### Guidelines for new components
|
22
|
-
|
23
|
-
Start by creating a folder under `src/` with the name of the component, e.g. `<MyAwesomeComponent />`:
|
24
|
-
|
25
|
-
```
|
26
|
-
src/
|
27
|
-
├── ...
|
28
|
-
├── components
|
29
|
-
│ ├── MyAwesomeComponent
|
30
|
-
│ │ ├── MyAwesomeComponent.css
|
31
|
-
│ │ ├── MyAwesomeComponent.mdx
|
32
|
-
│ │ ├── MyAwesomeComponent.test.tsx
|
33
|
-
│ │ ├── MyAwesomeComponent.tsx
|
34
|
-
├── index.tsx
|
35
|
-
└── ...
|
36
|
-
```
|
37
|
-
|
38
|
-
Conceptually, the component's style, implementation, tests & documentation are co-located in its own folder.
|
39
|
-
|
40
|
-
`MyAwesomeComponent/MyAwesomeComponent.css` Holds the component's style, directly imported in the implementation
|
41
|
-
`MyAwesomeComponent/MyAwesomeComponent.mdx` Holds the component's documentation
|
42
|
-
`MyAwesomeComponent/MyAwesomeComponent.test.tsx` Holds the component's tests - if applicable
|
43
|
-
`MyAwesomeComponent/MyAwesomeComponent.tsx` Holds the component's implementation
|
44
|
-
|
45
|
-
> If the component has a special (_snowflake_) case/variation, it's best advised to implement as separate component within the same folder (e.g. `<Button />` and `<IconButton />`)
|
46
|
-
|
47
|
-
# Consumption
|
48
|
-
|
49
|
-
#### Components
|
50
|
-
|
51
|
-
Import individual components from tailwind as you need them.
|
52
|
-
|
53
|
-
#### Styling
|
54
|
-
|
55
|
-
Taco uses tailwind, but does not process its css before exporting. It exports css _with_ tailwind commands present - you must process the stylesheet with tailwind yourself.
|
56
|
-
|
57
|
-
Browser targeting, purging and minification should be performed _by the consumer_.
|
58
|
-
|
59
|
-
Your postcss config probably looks something like this:
|
60
|
-
|
61
|
-
```js
|
62
|
-
module.exports = {
|
63
|
-
plugins: ['tailwindcss', 'autoprefixer'],
|
64
|
-
};
|
65
|
-
```
|
66
|
-
|
67
|
-
Your `tailwind.config.js` should look something like this:
|
68
|
-
|
69
|
-
```js
|
70
|
-
const tailwindConfig = require('@economic/taco/tailwind.config.js');
|
71
|
-
|
72
|
-
module.exports = {
|
73
|
-
presets: [require('@economic/taco/tailwind.config.js'))],
|
74
|
-
content: {
|
75
|
-
files: ['../src/**/*.{mdx,tsx}', './node_modules/@economic/taco/dist/taco.esm.js'],
|
76
|
-
},
|
77
|
-
};
|
78
|
-
```
|
79
|
-
|
80
|
-
You should then import the taco stylesheet in your application:
|
81
|
-
|
82
|
-
```css
|
83
|
-
import '@economic/taco/dist/index.css';
|
84
|
-
```
|
1
|
+
[](https://travis-ci.com/e-conomic/taco)
|
2
|
+
|
3
|
+
# @economic/taco
|
4
|
+
|
5
|
+
> UI React component library
|
6
|
+
|
7
|
+
## Usage
|
8
|
+
|
9
|
+
```bash
|
10
|
+
npm install @economic/taco
|
11
|
+
```
|
12
|
+
|
13
|
+
```javascript
|
14
|
+
import { Button } from '@economic/taco';
|
15
|
+
|
16
|
+
const MyComponent = () => <Button>Tada!</Button>;
|
17
|
+
```
|
18
|
+
|
19
|
+
## Development
|
20
|
+
|
21
|
+
### Guidelines for new components
|
22
|
+
|
23
|
+
Start by creating a folder under `src/` with the name of the component, e.g. `<MyAwesomeComponent />`:
|
24
|
+
|
25
|
+
```
|
26
|
+
src/
|
27
|
+
├── ...
|
28
|
+
├── components
|
29
|
+
│ ├── MyAwesomeComponent
|
30
|
+
│ │ ├── MyAwesomeComponent.css
|
31
|
+
│ │ ├── MyAwesomeComponent.mdx
|
32
|
+
│ │ ├── MyAwesomeComponent.test.tsx
|
33
|
+
│ │ ├── MyAwesomeComponent.tsx
|
34
|
+
├── index.tsx
|
35
|
+
└── ...
|
36
|
+
```
|
37
|
+
|
38
|
+
Conceptually, the component's style, implementation, tests & documentation are co-located in its own folder.
|
39
|
+
|
40
|
+
`MyAwesomeComponent/MyAwesomeComponent.css` Holds the component's style, directly imported in the implementation
|
41
|
+
`MyAwesomeComponent/MyAwesomeComponent.mdx` Holds the component's documentation
|
42
|
+
`MyAwesomeComponent/MyAwesomeComponent.test.tsx` Holds the component's tests - if applicable
|
43
|
+
`MyAwesomeComponent/MyAwesomeComponent.tsx` Holds the component's implementation
|
44
|
+
|
45
|
+
> If the component has a special (_snowflake_) case/variation, it's best advised to implement as separate component within the same folder (e.g. `<Button />` and `<IconButton />`)
|
46
|
+
|
47
|
+
# Consumption
|
48
|
+
|
49
|
+
#### Components
|
50
|
+
|
51
|
+
Import individual components from tailwind as you need them.
|
52
|
+
|
53
|
+
#### Styling
|
54
|
+
|
55
|
+
Taco uses tailwind, but does not process its css before exporting. It exports css _with_ tailwind commands present - you must process the stylesheet with tailwind yourself.
|
56
|
+
|
57
|
+
Browser targeting, purging and minification should be performed _by the consumer_.
|
58
|
+
|
59
|
+
Your postcss config probably looks something like this:
|
60
|
+
|
61
|
+
```js
|
62
|
+
module.exports = {
|
63
|
+
plugins: ['tailwindcss', 'autoprefixer'],
|
64
|
+
};
|
65
|
+
```
|
66
|
+
|
67
|
+
Your `tailwind.config.js` should look something like this:
|
68
|
+
|
69
|
+
```js
|
70
|
+
const tailwindConfig = require('@economic/taco/tailwind.config.js');
|
71
|
+
|
72
|
+
module.exports = {
|
73
|
+
presets: [require('@economic/taco/tailwind.config.js'))],
|
74
|
+
content: {
|
75
|
+
files: ['../src/**/*.{mdx,tsx}', './node_modules/@economic/taco/dist/taco.esm.js'],
|
76
|
+
},
|
77
|
+
};
|
78
|
+
```
|
79
|
+
|
80
|
+
You should then import the taco stylesheet in your application:
|
81
|
+
|
82
|
+
```css
|
83
|
+
import '@economic/taco/dist/index.css';
|
84
|
+
```
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { Icon } from '../Icon/Icon';\n\ntype AccordionContext = {\n as: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n};\nconst AccordionContext = React.createContext<AccordionContext>({\n as: 'h2',\n});\n\nexport type AccordionTriggerProps = React.HTMLAttributes<HTMLElement>;\n\nconst StyledTrigger = React.forwardRef(function AccordionStyledTrigger(\n props: AccordionPrimitive.AccordionTriggerProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const isExpanded = !!props['aria-expanded'];\n\n const className = cn(\n 'w-full inline-flex justify-between items-center align-middle',\n 'focus:rounded-sm focus:border-blue focus:yt-focus',\n props.className\n );\n\n return (\n <button {...props} ref={ref} className={className}>\n {props.children}\n <Icon name={isExpanded ? 'chevron-up' : 'chevron-down'} />\n </button>\n );\n});\n\nconst Trigger = React.forwardRef(function AccordionTrigger(props: AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) {\n const { children } = props;\n const { as: Heading } = React.useContext(AccordionContext);\n\n return (\n <AccordionPrimitive.Header asChild>\n <Heading className=\"my-3\">\n <AccordionPrimitive.Trigger ref={ref} asChild>\n <StyledTrigger>{children}</StyledTrigger>\n </AccordionPrimitive.Trigger>\n </Heading>\n </AccordionPrimitive.Header>\n );\n});\n\nexport type AccordionContentProps = React.HTMLAttributes<HTMLElement>;\nconst Content = React.forwardRef(function AccordionContent(props: AccordionContentProps, ref: React.Ref<HTMLDivElement>) {\n return <AccordionPrimitive.Content {...props} ref={ref} />;\n});\n\nexport type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & {\n id: string;\n disabled?: boolean;\n};\nconst Item = (props: AccordionItemProps) => {\n const { id, ...otherProps } = props;\n return <AccordionPrimitive.Item {...otherProps} value={id} />;\n};\n\ntype AccordionBaseProps = {\n children: React.ReactNode[];\n\n /** Change what heading element accordion regions will render */\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n /** Additional classes for Accordion root element */\n className?: string;\n};\n\nexport interface AccordionUncontrolledProps extends AccordionBaseProps {\n /** Default expanded accordion(s) */\n defaultId: string | string[];\n\n id?: never;\n onChange?: never;\n}\n\nexport interface AccordionMultipleControlledProps extends AccordionBaseProps {\n /** Expanded accordions */\n id: string[];\n\n /** onChange function to receive ids of expanded accordions */\n onChange: (id: string[]) => void;\n\n defaultId?: never;\n}\nexport interface AccordionSingleControlledProps extends AccordionBaseProps {\n /** Expanded accordion */\n id: string;\n\n /** onChange function to receive id of expanded accordion */\n onChange: (id: string) => void;\n\n defaultId?: never;\n}\n\nexport type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;\n\nexport const Accordion = (props: AccordionProps) => {\n const { id, defaultId, onChange, as = 'h2', ...otherProps } = props;\n const context = React.useMemo(() => ({ as }), [as]);\n\n let valueProps;\n\n if (defaultId) {\n valueProps = {\n defaultValue: defaultId || undefined,\n };\n } else {\n valueProps = {\n onValueChange: onChange,\n value: id || undefined,\n };\n }\n\n const type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';\n const className = cn('divide-y divide-grey', props.className);\n\n return (\n <AccordionContext.Provider value={context}>\n <AccordionPrimitive.Root {...otherProps} {...valueProps} data-taco=\"accordion\" className={className} type={type} />\n </AccordionContext.Provider>\n );\n};\n\nAccordion.Item = Item;\nAccordion.Trigger = Trigger;\nAccordion.Content = Content;\n"],"names":["AccordionContext","React","createContext","as","StyledTrigger","forwardRef","AccordionStyledTrigger","props","ref","isExpanded","className","cn","children","Icon","name","Trigger","AccordionTrigger","useContext","Heading","AccordionPrimitive","asChild","Content","AccordionContent","Item","id","otherProps","value","Accordion","defaultId","onChange","context","useMemo","valueProps","defaultValue","undefined","onValueChange","type","Array","isArray","Provider"],"mappings":";;;;;;;;AAQA,IAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAN,CAAsC;AAC3DC,EAAAA,EAAE,EAAE;AADuD,CAAtC,CAAzB;AAMA,IAAMC,aAAa,gBAAGH,cAAK,CAACI,UAAN,CAAiB,SAASC,sBAAT,CACnCC,KADmC,EAEnCC,GAFmC;AAInC,MAAMC,UAAU,GAAG,CAAC,CAAC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AAAYtB,IAAAA,SAAS,EAAEA;AAAW0B,IAAAA,IAAI,EAAEA;IAA3G,CADJ,CADJ;AAKH;AAEDT,SAAS,CAACJ,IAAV,GAAiBA,IAAjB;AACAI,SAAS,CAACZ,OAAV,GAAoBA,OAApB;AACAY,SAAS,CAACN,OAAV,GAAoBA,OAApB;;;;"}
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import React from 'react';\r\nimport cn from 'classnames';\r\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\r\nimport { Icon } from '../Icon/Icon';\r\n\r\ntype AccordionContext = {\r\n as: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\r\n};\r\nconst AccordionContext = React.createContext<AccordionContext>({\r\n as: 'h2',\r\n});\r\n\r\nexport type AccordionTriggerProps = React.HTMLAttributes<HTMLElement>;\r\n\r\nconst StyledTrigger = React.forwardRef(function AccordionStyledTrigger(\r\n props: AccordionPrimitive.AccordionTriggerProps,\r\n ref: React.Ref<HTMLButtonElement>\r\n) {\r\n const isExpanded = !!props['aria-expanded'];\r\n\r\n const className = cn(\r\n 'w-full inline-flex justify-between items-center align-middle',\r\n 'focus:rounded-sm focus:border-blue focus:yt-focus',\r\n props.className\r\n );\r\n\r\n return (\r\n <button {...props} ref={ref} className={className}>\r\n {props.children}\r\n <Icon name={isExpanded ? 'chevron-up' : 'chevron-down'} />\r\n </button>\r\n );\r\n});\r\n\r\nconst Trigger = React.forwardRef(function AccordionTrigger(props: AccordionTriggerProps, ref: React.Ref<HTMLButtonElement>) {\r\n const { children } = props;\r\n const { as: Heading } = React.useContext(AccordionContext);\r\n\r\n return (\r\n <AccordionPrimitive.Header asChild>\r\n <Heading className=\"my-3\">\r\n <AccordionPrimitive.Trigger ref={ref} asChild>\r\n <StyledTrigger>{children}</StyledTrigger>\r\n </AccordionPrimitive.Trigger>\r\n </Heading>\r\n </AccordionPrimitive.Header>\r\n );\r\n});\r\n\r\nexport type AccordionContentProps = React.HTMLAttributes<HTMLElement>;\r\nconst Content = React.forwardRef(function AccordionContent(props: AccordionContentProps, ref: React.Ref<HTMLDivElement>) {\r\n return <AccordionPrimitive.Content {...props} ref={ref} />;\r\n});\r\n\r\nexport type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & {\r\n id: string;\r\n disabled?: boolean;\r\n};\r\nconst Item = (props: AccordionItemProps) => {\r\n const { id, ...otherProps } = props;\r\n return <AccordionPrimitive.Item {...otherProps} value={id} />;\r\n};\r\n\r\ntype AccordionBaseProps = {\r\n children: React.ReactNode[];\r\n\r\n /** Change what heading element accordion regions will render */\r\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\r\n\r\n /** Additional classes for Accordion root element */\r\n className?: string;\r\n};\r\n\r\nexport interface AccordionUncontrolledProps extends AccordionBaseProps {\r\n /** Default expanded accordion(s) */\r\n defaultId: string | string[];\r\n\r\n id?: never;\r\n onChange?: never;\r\n}\r\n\r\nexport interface AccordionMultipleControlledProps extends AccordionBaseProps {\r\n /** Expanded accordions */\r\n id: string[];\r\n\r\n /** onChange function to receive ids of expanded accordions */\r\n onChange: (id: string[]) => void;\r\n\r\n defaultId?: never;\r\n}\r\nexport interface AccordionSingleControlledProps extends AccordionBaseProps {\r\n /** Expanded accordion */\r\n id: string;\r\n\r\n /** onChange function to receive id of expanded accordion */\r\n onChange: (id: string) => void;\r\n\r\n defaultId?: never;\r\n}\r\n\r\nexport type AccordionProps = AccordionUncontrolledProps | AccordionMultipleControlledProps | AccordionSingleControlledProps;\r\n\r\nexport const Accordion = (props: AccordionProps) => {\r\n const { id, defaultId, onChange, as = 'h2', ...otherProps } = props;\r\n const context = React.useMemo(() => ({ as }), [as]);\r\n\r\n let valueProps;\r\n\r\n if (defaultId) {\r\n valueProps = {\r\n defaultValue: defaultId || undefined,\r\n };\r\n } else {\r\n valueProps = {\r\n onValueChange: onChange,\r\n value: id || undefined,\r\n };\r\n }\r\n\r\n const type = Array.isArray(valueProps.defaultValue) || Array.isArray(valueProps.value) ? 'multiple' : 'single';\r\n const className = cn('divide-y divide-grey', props.className);\r\n\r\n return (\r\n <AccordionContext.Provider value={context}>\r\n <AccordionPrimitive.Root {...otherProps} {...valueProps} data-taco=\"accordion\" className={className} type={type} />\r\n </AccordionContext.Provider>\r\n );\r\n};\r\n\r\nAccordion.Item = Item;\r\nAccordion.Trigger = Trigger;\r\nAccordion.Content = Content;\r\n"],"names":["AccordionContext","React","createContext","as","StyledTrigger","forwardRef","AccordionStyledTrigger","props","ref","isExpanded","className","cn","children","Icon","name","Trigger","AccordionTrigger","useContext","Heading","AccordionPrimitive","asChild","Content","AccordionContent","Item","id","otherProps","value","Accordion","defaultId","onChange","context","useMemo","valueProps","defaultValue","undefined","onValueChange","type","Array","isArray","Provider"],"mappings":";;;;;;;;AAQA,IAAMA,gBAAgB,gBAAGC,cAAK,CAACC,aAAN,CAAsC;AAC3DC,EAAAA,EAAE,EAAE;AADuD,CAAtC,CAAzB;AAMA,IAAMC,aAAa,gBAAGH,cAAK,CAACI,UAAN,CAAiB,SAASC,sBAAT,CACnCC,KADmC,EAEnCC,GAFmC;AAInC,MAAMC,UAAU,GAAG,CAAC,CAACF,KAAK,CAAC,eAAD,CAA1B;AAEA,MAAMG,SAAS,GAAGC,EAAE,CAChB,8DADgB,EAEhB,mDAFgB,EAGhBJ,KAAK,CAACG,SAHU,CAApB;AAMA,SACIT,4BAAA,SAAA,oBAAYM;AAAOC,IAAAA,GAAG,EAAEA;AAAKE,IAAAA,SAAS,EAAEA;IAAxC,EACKH,KAAK,CAACK,QADX,EAEIX,4BAAA,CAACY,IAAD;AAAMC,IAAAA,IAAI,EAAEL,UAAU,GAAG,YAAH,GAAkB;GAAxC,CAFJ,CADJ;AAMH,CAlBqB,CAAtB;AAoBA,IAAMM,OAAO,gBAAGd,cAAK,CAACI,UAAN,CAAiB,SAASW,gBAAT,CAA0BT,KAA1B,EAAwDC,GAAxD;AAC7B,MAAQI,QAAR,GAAqBL,KAArB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AA,WAAO;AAAE5B,MAAAA,EAAE,EAAFA;AAAF,KAAP;AAAA,GAAd,EAA8B,CAACA,EAAD,CAA9B,CAAhB;AAEA,MAAI6B,UAAJ;;AAEA,MAAIJ,SAAJ,EAAe;AACXI,IAAAA,UAAU,GAAG;AACTC,MAAAA,YAAY,EAAEL,SAAS,IAAIM;AADlB,KAAb;AAGH,GAJD,MAIO;AACHF,IAAAA,UAAU,GAAG;AACTG,MAAAA,aAAa,EAAEN,QADN;AAETH,MAAAA,KAAK,EAAEF,EAAE,IAAIU;AAFJ,KAAb;AAIH;;AAED,MAAME,IAAI,GAAGC,KAAK,CAACC,OAAN,CAAcN,UAAU,CAACC,YAAzB,KAA0CI,KAAK,CAACC,OAAN,CAAcN,UAAU,CAACN,KAAzB,CAA1C,GAA4E,UAA5E,GAAyF,QAAtG;AACA,MAAMhB,SAAS,GAAGC,EAAE,CAAC,sBAAD,EAAyBJ,KAAK,CAACG,SAA/B,CAApB;AAEA,SACIT,4BAAA,CAACD,gBAAgB,CAACuC,QAAlB;AAA2Bb,IAAAA,KAAK,EAAEI;GAAlC,EACI7B,4BAAA,CAACkB,IAAD,oBAA6BM,YAAgBO;iBAAsB;AAAYtB,IAAAA,SAAS,EAAEA;AAAW0B,IAAAA,IAAI,EAAEA;IAA3G,CADJ,CADJ;AAKH;AAEDT,SAAS,CAACJ,IAAV,GAAiBA,IAAjB;AACAI,SAAS,CAACZ,OAAV,GAAoBA,OAApB;AACAY,SAAS,CAACN,OAAV,GAAoBA,OAApB;;;;"}
|
@@ -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-[rgba(50,46,62,0.8)] aria-hidden:hidden z-[996]',\n props.className\n );\n\n return <div {...props} className={className} ref={ref} />;\n});\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;IAKaA,QAAQ,gBAAGC,UAAA,CAAgD,SAASD,QAAT,CAAkBE,KAAlB,EAAyBC,GAAzB;AACpE,MAAMC,SAAS,GAAGC,EAAE,CAChB,iGADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;AAKA,SAAOH,aAAA,MAAA,oBAASC;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA3C,CAAP;AACH,CAPuB;;;;"}
|
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-[rgba(50,46,62,0.8)] aria-hidden:hidden z-[996]',\r\n props.className\r\n );\r\n\r\n return <div {...props} className={className} ref={ref} />;\r\n});\r\n"],"names":["Backdrop","React","props","ref","className","cn"],"mappings":";;;IAKaA,QAAQ,gBAAGC,UAAA,CAAgD,SAASD,QAAT,CAAkBE,KAAlB,EAAyBC,GAAzB;AACpE,MAAMC,SAAS,GAAGC,EAAE,CAChB,iGADgB,EAEhBH,KAAK,CAACE,SAFU,CAApB;AAKA,SAAOH,aAAA,MAAA,oBAASC;AAAOE,IAAAA,SAAS,EAAEA;AAAWD,IAAAA,GAAG,EAAEA;IAA3C,CAAP;AACH,CAPuB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\nimport { State } from '../../types';\nimport { getStateClasses, getOutlineClasses } from '../../utils/taillwind';\nimport './Badge.css';\n\nexport type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {\n /** Content should be a numerical value or tag/status like text **/\n children: React.ReactNode;\n /** Show compact version **/\n compact?: boolean;\n /** Show outlined version **/\n outline?: boolean;\n /** State will change the style of the badge **/\n state?: State;\n};\n\nexport const Badge = React.forwardRef(function Badge(props: BadgeProps, ref: React.Ref<HTMLSpanElement>) {\n const { children, compact = false, outline = false, state, ...otherProps } = props;\n const className = cn(\n 'rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5',\n {\n [getOutlineClasses(state)]: outline,\n [`border-transparent ${getStateClasses(state)}`]: !outline,\n 'h-2 w-2 min-w-0': compact,\n 'h-5 py-0 px-1.5': !compact, // custom padding keeps single digits in a perfect circle\n },\n props.className\n );\n\n return (\n <span\n {...otherProps}\n aria-atomic=\"true\"\n aria-live=\"polite\"\n className={className}\n data-taco=\"badge\"\n ref={ref}\n role=\"status\"\n title={props['aria-label']}\n >\n {compact ? <VisuallyHidden>{children}</VisuallyHidden> : children}\n </span>\n );\n});\n"],"names":["Badge","React","props","ref","children","compact","outline","state","otherProps","className","cn","getOutlineClasses","getStateClasses","role","title","VisuallyHidden"],"mappings":";;;;;;;IAkBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;;;AAClC,MAAQC,QAAR,GAA6EF,KAA7E,CAAQE,QAAR;AAAA,uBAA6EF,KAA7E,CAAkBG,OAAlB;AAAA,MAAkBA,OAAlB,+BAA4B,KAA5B;AAAA,uBAA6EH,KAA7E,CAAmCI,OAAnC;AAAA,MAAmCA,OAAnC,+BAA6C,KAA7C;AAAA,MAAoDC,KAApD,GAA6EL,KAA7E,CAAoDK,KAApD;AAAA,MAA8DC,UAA9D,iCAA6EN,KAA7E;;AACA,MAAMO,SAAS,GAAGC,EAAE,CAChB,+HADgB,iBAGXC,iBAAiB,CAACJ,KAAD,CAHN,IAGgBD,OAHhB,8BAIWM,eAAe,CAACL,KAAD,CAJ1B,IAIsC,CAACD,OAJvC,MAKZ,iBALY,IAKOD,OALP,MAMZ,iBANY,IAMO,CAACA,OANR,QAQhBH,KAAK,CAACO,SARU,CAApB;AAWA,SACIR,aAAA,OAAA,oBACQO;mBACQ;iBACF;AACVC,IAAAA,SAAS,EAAEA;iBACD;AACVN,IAAAA,GAAG,EAAEA;AACLU,IAAAA,IAAI,EAAC;AACLC,IAAAA,KAAK,EAAEZ,KAAK,CAAC,YAAD;IARhB,EAUKG,OAAO,GAAGJ,aAAA,CAACc,cAAD,MAAA,EAAiBX,QAAjB,CAAH,GAAiDA,QAV7D,CADJ;AAcH,CA3BoB;;;;"}
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden';\r\nimport { State } from '../../types';\r\nimport { getStateClasses, getOutlineClasses } from '../../utils/taillwind';\r\nimport './Badge.css';\r\n\r\nexport type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {\r\n /** Content should be a numerical value or tag/status like text **/\r\n children: React.ReactNode;\r\n /** Show compact version **/\r\n compact?: boolean;\r\n /** Show outlined version **/\r\n outline?: boolean;\r\n /** State will change the style of the badge **/\r\n state?: State;\r\n};\r\n\r\nexport const Badge = React.forwardRef(function Badge(props: BadgeProps, ref: React.Ref<HTMLSpanElement>) {\r\n const { children, compact = false, outline = false, state, ...otherProps } = props;\r\n const className = cn(\r\n 'rounded-full border font-bold text-xs uppercase overflow-hidden whitespace-nowrap inline-flex items-center justify-center h-5',\r\n {\r\n [getOutlineClasses(state)]: outline,\r\n [`border-transparent ${getStateClasses(state)}`]: !outline,\r\n 'h-2 w-2 min-w-0': compact,\r\n 'h-5 py-0 px-1.5': !compact, // custom padding keeps single digits in a perfect circle\r\n },\r\n props.className\r\n );\r\n\r\n return (\r\n <span\r\n {...otherProps}\r\n aria-atomic=\"true\"\r\n aria-live=\"polite\"\r\n className={className}\r\n data-taco=\"badge\"\r\n ref={ref}\r\n role=\"status\"\r\n title={props['aria-label']}\r\n >\r\n {compact ? <VisuallyHidden>{children}</VisuallyHidden> : children}\r\n </span>\r\n );\r\n});\r\n"],"names":["Badge","React","props","ref","children","compact","outline","state","otherProps","className","cn","getOutlineClasses","getStateClasses","role","title","VisuallyHidden"],"mappings":";;;;;;;IAkBaA,KAAK,gBAAGC,UAAA,CAAiB,SAASD,KAAT,CAAeE,KAAf,EAAkCC,GAAlC;;;AAClC,MAAQC,QAAR,GAA6EF,KAA7E,CAAQE,QAAR;AAAA,uBAA6EF,KAA7E,CAAkBG,OAAlB;AAAA,MAAkBA,OAAlB,+BAA4B,KAA5B;AAAA,uBAA6EH,KAA7E,CAAmCI,OAAnC;AAAA,MAAmCA,OAAnC,+BAA6C,KAA7C;AAAA,MAAoDC,KAApD,GAA6EL,KAA7E,CAAoDK,KAApD;AAAA,MAA8DC,UAA9D,iCAA6EN,KAA7E;;AACA,MAAMO,SAAS,GAAGC,EAAE,CAChB,+HADgB,iBAGXC,iBAAiB,CAACJ,KAAD,CAHN,IAGgBD,OAHhB,8BAIWM,eAAe,CAACL,KAAD,CAJ1B,IAIsC,CAACD,OAJvC,MAKZ,iBALY,IAKOD,OALP,MAMZ,iBANY,IAMO,CAACA,OANR,QAQhBH,KAAK,CAACO,SARU,CAApB;AAWA,SACIR,aAAA,OAAA,oBACQO;mBACQ;iBACF;AACVC,IAAAA,SAAS,EAAEA;iBACD;AACVN,IAAAA,GAAG,EAAEA;AACLU,IAAAA,IAAI,EAAC;AACLC,IAAAA,KAAK,EAAEZ,KAAK,CAAC,YAAD;IARhB,EAUKG,OAAO,GAAGJ,aAAA,CAACc,cAAD,MAAA,EAAiBX,QAAjB,CAAH,GAAiDA,QAV7D,CADJ;AAcH,CA3BoB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Banner.js","sources":["../../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { State } from '../../types';\nimport { getBannerIcon } from './util';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport type BannerProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Content can be any react element, for e.g. a `div` */\n children: React.ReactNode;\n /** State will change the icon displayed in banner */\n state: State;\n onClose?: () => void;\n};\n\nexport const Banner = React.forwardRef(function Banner(props: BannerProps, ref: React.Ref<HTMLDivElement>) {\n const { children, state, onClose } = props;\n const className = cn('bg-white relative flex items-center gap-2 py-2 px-4 leading-6 shadow-md z-10', props.className);\n\n return (\n <div className={className} data-taco=\"banner\" ref={ref}>\n {getBannerIcon(state)}\n {children}\n {onClose ? (\n <IconButton className=\"ml-auto -mr-2 self-start\" icon=\"close\" appearance=\"discrete\" onClick={onClose} />\n ) : null}\n </div>\n );\n});\n"],"names":["Banner","React","props","ref","children","state","onClose","className","cn","getBannerIcon","IconButton","icon","appearance","onClick"],"mappings":";;;;;IAcaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,MAAQC,QAAR,GAAqCF,KAArC,CAAQE,QAAR;AAAA,MAAkBC,KAAlB,GAAqCH,KAArC,CAAkBG,KAAlB;AAAA,MAAyBC,OAAzB,GAAqCJ,KAArC,CAAyBI,OAAzB;AACA,MAAMC,SAAS,GAAGC,EAAE,CAAC,8EAAD,EAAiFN,KAAK,CAACK,SAAvF,CAApB;AAEA,SACIN,aAAA,MAAA;AAAKM,IAAAA,SAAS,EAAEA;iBAAqB;AAASJ,IAAAA,GAAG,EAAEA;GAAnD,EACKM,aAAa,CAACJ,KAAD,CADlB,EAEKD,QAFL,EAGKE,OAAO,GACJL,aAAA,CAACS,UAAD;AAAYH,IAAAA,SAAS,EAAC;AAA2BI,IAAAA,IAAI,EAAC;AAAQC,IAAAA,UAAU,EAAC;AAAWC,IAAAA,OAAO,EAAEP;GAA7F,CADI,GAEJ,IALR,CADJ;AASH,CAbqB;;;;"}
|
1
|
+
{"version":3,"file":"Banner.js","sources":["../../../../src/components/Banner/Banner.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport { State } from '../../types';\r\nimport { getBannerIcon } from './util';\r\nimport { IconButton } from '../IconButton/IconButton';\r\n\r\nexport type BannerProps = React.HTMLAttributes<HTMLDivElement> & {\r\n /** Content can be any react element, for e.g. a `div` */\r\n children: React.ReactNode;\r\n /** State will change the icon displayed in banner */\r\n state: State;\r\n onClose?: () => void;\r\n};\r\n\r\nexport const Banner = React.forwardRef(function Banner(props: BannerProps, ref: React.Ref<HTMLDivElement>) {\r\n const { children, state, onClose } = props;\r\n const className = cn('bg-white relative flex items-center gap-2 py-2 px-4 leading-6 shadow-md z-10', props.className);\r\n\r\n return (\r\n <div className={className} data-taco=\"banner\" ref={ref}>\r\n {getBannerIcon(state)}\r\n {children}\r\n {onClose ? (\r\n <IconButton className=\"ml-auto -mr-2 self-start\" icon=\"close\" appearance=\"discrete\" onClick={onClose} />\r\n ) : null}\r\n </div>\r\n );\r\n});\r\n"],"names":["Banner","React","props","ref","children","state","onClose","className","cn","getBannerIcon","IconButton","icon","appearance","onClick"],"mappings":";;;;;IAcaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CAAgBE,KAAhB,EAAoCC,GAApC;AACnC,MAAQC,QAAR,GAAqCF,KAArC,CAAQE,QAAR;AAAA,MAAkBC,KAAlB,GAAqCH,KAArC,CAAkBG,KAAlB;AAAA,MAAyBC,OAAzB,GAAqCJ,KAArC,CAAyBI,OAAzB;AACA,MAAMC,SAAS,GAAGC,EAAE,CAAC,8EAAD,EAAiFN,KAAK,CAACK,SAAvF,CAApB;AAEA,SACIN,aAAA,MAAA;AAAKM,IAAAA,SAAS,EAAEA;iBAAqB;AAASJ,IAAAA,GAAG,EAAEA;GAAnD,EACKM,aAAa,CAACJ,KAAD,CADlB,EAEKD,QAFL,EAGKE,OAAO,GACJL,aAAA,CAACS,UAAD;AAAYH,IAAAA,SAAS,EAAC;AAA2BI,IAAAA,IAAI,EAAC;AAAQC,IAAAA,UAAU,EAAC;AAAWC,IAAAA,OAAO,EAAEP;GAA7F,CADI,GAEJ,IALR,CADJ;AASH,CAbqB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../src/components/Banner/util.tsx"],"sourcesContent":["import React from 'react';\nimport { Icon } from '../Icon/Icon';\nimport { State } from '../../types';\n\nexport const getBannerIcon = (type: State): JSX.Element | null => {\n switch (type) {\n case 'success':\n return <Icon name=\"tick\" className=\"yt-green-solid mt-1 self-start rounded-full\" />;\n\n case 'error':\n return <Icon name=\"warning\" className=\"yt-red-solid mt-1 self-start rounded-full\" />;\n\n case 'warning':\n return <Icon name=\"warning\" className=\"yt-yellow-solid mt-1 self-start rounded-full\" />;\n\n case 'information':\n return <Icon name=\"info\" className=\"yt-blue-solid mt-1 self-start rounded-full\" />;\n\n default:\n return null;\n }\n};\n"],"names":["getBannerIcon","type","React","Icon","name","className"],"mappings":";;;
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../src/components/Banner/util.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Icon } from '../Icon/Icon';\r\nimport { State } from '../../types';\r\n\r\nexport const getBannerIcon = (type: State): JSX.Element | null => {\r\n switch (type) {\r\n case 'success':\r\n return <Icon name=\"tick\" className=\"yt-green-solid mt-1 self-start rounded-full\" />;\r\n\r\n case 'error':\r\n return <Icon name=\"warning\" className=\"yt-red-solid mt-1 self-start rounded-full\" />;\r\n\r\n case 'warning':\r\n return <Icon name=\"warning\" className=\"yt-yellow-solid mt-1 self-start rounded-full\" />;\r\n\r\n case 'information':\r\n return <Icon name=\"info\" className=\"yt-blue-solid mt-1 self-start rounded-full\" />;\r\n\r\n default:\r\n return null;\r\n }\r\n};\r\n"],"names":["getBannerIcon","type","React","Icon","name","className"],"mappings":";;;MAIaA,aAAa,GAAIC,IAAD;AACzB,UAAQA,IAAR;AACI,SAAK,SAAL;AACI,aAAOC,4BAAA,CAACC,IAAD;AAAMC,QAAAA,IAAI,EAAC;AAAOC,QAAAA,SAAS,EAAC;OAA5B,CAAP;;AAEJ,SAAK,OAAL;AACI,aAAOH,4BAAA,CAACC,IAAD;AAAMC,QAAAA,IAAI,EAAC;AAAUC,QAAAA,SAAS,EAAC;OAA/B,CAAP;;AAEJ,SAAK,SAAL;AACI,aAAOH,4BAAA,CAACC,IAAD;AAAMC,QAAAA,IAAI,EAAC;AAAUC,QAAAA,SAAS,EAAC;OAA/B,CAAP;;AAEJ,SAAK,aAAL;AACI,aAAOH,4BAAA,CAACC,IAAD;AAAMC,QAAAA,IAAI,EAAC;AAAOC,QAAAA,SAAS,EAAC;OAA5B,CAAP;;AAEJ;AACI,aAAO,IAAP;AAdR;AAgBH;;;;"}
|
@@ -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, createButton } 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\nexport const Button = React.forwardRef(function Button(\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) {\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 let children = otherProps.children;\n\n // add a chevron icon to menu buttons\n if (typeof otherProps.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 return createButton({ ...otherProps, children, 'data-taco': 'button' }, className, ref);\n});\n"],"names":["Button","React","props","ref","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","appearance","disabled","children","menu","Array","isArray","Icon","key","name","createButton"],"mappings":";;;;;;;IAqCaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CACnCE,KADmC,EAEnCC,GAFmC;AAInC,MAAQC,KAAR,GAAiCF,KAAjC,CAAQE,KAAR;AAAA,MAAkBC,UAAlB,iCAAiCH,KAAjC;;AACA,MAAMI,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EADA,EAEhBC,oBAAoB,CAACJ,UAAU,CAACK,UAAZ,CAFJ,EAGhB,cAHgB,EAIhB;AACI,qCAAiCR,KAAK,CAACS,QAD3C;AAEI,4CAAwC,CAACT,KAAK,CAACS,QAFnD;AAGI,cAAUP;AAHd,GAJgB,EAShBF,KAAK,CAACI,SATU,CAApB;AAYA,MAAIM,QAAQ,GAAGP,UAAU,CAACO,QAA1B;;AAGA,MAAI,OAAOP,UAAU,CAACQ,IAAlB,KAA2B,UAA/B,EAA2C;AACvCD,IAAAA,QAAQ,GAAGE,KAAK,CAACC,OAAN,CAAcH,QAAd,cACDA,QADC,GACSX,aAAA,CAACe,IAAD;AAAMC,MAAAA,GAAG,EAAC;AAAeC,MAAAA,IAAI,EAAC;KAA9B,CADT,KAEL,CAACN,QAAD,EAAWX,aAAA,CAACe,IAAD;AAAMC,MAAAA,GAAG,EAAC;AAAeC,MAAAA,IAAI,EAAC;KAA9B,CAAX,CAFN;AAGH;;AAED,SAAOC,YAAY,cAAMd,UAAN;AAAkBO,IAAAA,QAAQ,EAARA,QAAlB;AAA4B,iBAAa;AAAzC,MAAqDN,SAArD,EAAgEH,GAAhE,CAAnB;AACH,CA3BqB;;;;"}
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/Button/Button.tsx"],"sourcesContent":["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, createButton } 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\nexport const Button = React.forwardRef(function Button(\r\n props: ButtonProps,\r\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\r\n) {\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 let children = otherProps.children;\r\n\r\n // add a chevron icon to menu buttons\r\n if (typeof otherProps.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 return createButton({ ...otherProps, children, 'data-taco': 'button' }, className, ref);\r\n});\r\n"],"names":["Button","React","props","ref","fluid","otherProps","className","cn","getButtonClasses","getAppearanceClasses","appearance","disabled","children","menu","Array","isArray","Icon","key","name","createButton"],"mappings":";;;;;;;IAqCaA,MAAM,gBAAGC,UAAA,CAAiB,SAASD,MAAT,CACnCE,KADmC,EAEnCC,GAFmC;AAInC,MAAQC,KAAR,GAAiCF,KAAjC,CAAQE,KAAR;AAAA,MAAkBC,UAAlB,iCAAiCH,KAAjC;;AACA,MAAMI,SAAS,GAAGC,EAAE,CAChBC,gBAAgB,EADA,EAEhBC,oBAAoB,CAACJ,UAAU,CAACK,UAAZ,CAFJ,EAGhB,cAHgB,EAIhB;AACI,qCAAiCR,KAAK,CAACS,QAD3C;AAEI,4CAAwC,CAACT,KAAK,CAACS,QAFnD;AAGI,cAAUP;AAHd,GAJgB,EAShBF,KAAK,CAACI,SATU,CAApB;AAYA,MAAIM,QAAQ,GAAGP,UAAU,CAACO,QAA1B;;AAGA,MAAI,OAAOP,UAAU,CAACQ,IAAlB,KAA2B,UAA/B,EAA2C;AACvCD,IAAAA,QAAQ,GAAGE,KAAK,CAACC,OAAN,CAAcH,QAAd,cACDA,QADC,GACSX,aAAA,CAACe,IAAD;AAAMC,MAAAA,GAAG,EAAC;AAAeC,MAAAA,IAAI,EAAC;KAA9B,CADT,KAEL,CAACN,QAAD,EAAWX,aAAA,CAACe,IAAD;AAAMC,MAAAA,GAAG,EAAC;AAAeC,MAAAA,IAAI,EAAC;KAA9B,CAAX,CAFN;AAGH;;AAED,SAAOC,YAAY,cAAMd,UAAN;AAAkBO,IAAAA,QAAQ,EAARA,QAAlB;AAA4B,iBAAa;AAAzC,MAAqDN,SAArD,EAAgEH,GAAhE,CAAnB;AACH,CA3BqB;;;;"}
|
@@ -1,49 +1,44 @@
|
|
1
|
-
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
2
1
|
import React__default from 'react';
|
3
2
|
import { Button } from '../../primitives/Button.js';
|
4
3
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
5
4
|
|
6
|
-
|
7
|
-
var getButtonClasses = function getButtonClasses() {
|
5
|
+
const getButtonClasses = () => {
|
8
6
|
return 'min-h-[theme(spacing.8)] min-w-[theme(spacing.8)] gap-1 h-max leading-5 inline-flex items-center justify-center border';
|
9
7
|
};
|
10
|
-
|
11
|
-
if (icon === void 0) {
|
12
|
-
icon = false;
|
13
|
-
}
|
14
|
-
|
8
|
+
const getAppearanceClasses = (value, icon = false) => {
|
15
9
|
switch (value) {
|
16
10
|
case 'primary':
|
17
|
-
return
|
11
|
+
return `yt-blue-solid border-blue focus:bg-blue focus:text-white focus:yt-focus active:bg-blue-dark active:text-white hover:bg-blue-light hover:border-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`;
|
18
12
|
|
19
13
|
case 'danger':
|
20
|
-
return
|
14
|
+
return `yt-red-solid border-red 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`;
|
21
15
|
|
22
16
|
case 'ghost':
|
23
|
-
return
|
17
|
+
return `yt-blue-inverted focus:bg-transparent focus:text-blue focus:yt-focus active:bg-blue-lightest active:border-blue active:text-blue-dark hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light disabled:hover:yt-blue-inverted`;
|
24
18
|
|
25
19
|
case 'discrete':
|
26
20
|
{
|
27
21
|
if (icon) {
|
28
|
-
return
|
22
|
+
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 `;
|
29
23
|
}
|
30
24
|
|
31
|
-
return
|
25
|
+
return `yt-transparent border-transparent focus:text-blue focus:yt-focus active:text-blue-dark hover:text-blue-light hover:focus:text-blue-light disabled:hover:yt-transparent`;
|
32
26
|
}
|
33
27
|
|
34
28
|
default:
|
35
|
-
return
|
29
|
+
return `yt-grey-solid border-grey 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`;
|
36
30
|
}
|
37
31
|
};
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
32
|
+
const createButton = (props, className, ref) => {
|
33
|
+
const {
|
34
|
+
dialog,
|
35
|
+
hanger,
|
36
|
+
menu,
|
37
|
+
popover,
|
38
|
+
tooltip,
|
39
|
+
...otherProps
|
40
|
+
} = props;
|
41
|
+
let button = React__default.createElement(Button, Object.assign({}, otherProps, {
|
47
42
|
className: className,
|
48
43
|
ref: ref
|
49
44
|
}));
|
@@ -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 border';\n};\n\nexport const getAppearanceClasses = (value: Appearance | undefined, icon = false): string => {\n switch (value) {\n case 'primary':\n return `yt-blue-solid border-blue focus:bg-blue focus:text-white focus:yt-focus active:bg-blue-dark active:text-white hover:bg-blue-light hover:border-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 border-red 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 `yt-blue-inverted focus:bg-transparent focus:text-blue focus:yt-focus active:bg-blue-lightest active:border-blue active:text-blue-dark hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light disabled:hover:yt-blue-inverted`;\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 border-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 border-grey 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 createButton = (\n props: any,\n className: string,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n): JSX.Element => {\n const { dialog, hanger, menu, popover, tooltip, ...otherProps } = props;\n\n let button = <ButtonPrimitive.Button {...otherProps} className={className} ref={ref} />;\n\n if (typeof dialog === 'function') {\n button = dialog({ trigger: button });\n } else if (typeof menu === 'function') {\n button = menu({ trigger: button, appearance: otherProps.appearance });\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 if (tooltip) {\n button = <Tooltip title={tooltip}>{button}</Tooltip>;\n }\n\n return button;\n};\n"],"names":["getButtonClasses","getAppearanceClasses","value","icon","createButton","props","className","ref","dialog","hanger","menu","popover","tooltip","otherProps","button","React","ButtonPrimitive","trigger","appearance","anchor","Tooltip","title"],"mappings":"
|
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 border';\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 border-blue focus:bg-blue focus:text-white focus:yt-focus active:bg-blue-dark active:text-white hover:bg-blue-light hover:border-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 border-red 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 `yt-blue-inverted focus:bg-transparent focus:text-blue focus:yt-focus active:bg-blue-lightest active:border-blue active:text-blue-dark hover:bg-blue-lightest hover:border-blue-light hover:text-blue-light hover:focus:bg-blue-lightest hover:focus:border-blue-light hover:focus:text-blue-light disabled:hover:yt-blue-inverted`;\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 border-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 border-grey 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 createButton = (\r\n props: any,\r\n className: string,\r\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\r\n): JSX.Element => {\r\n const { dialog, hanger, menu, popover, tooltip, ...otherProps } = props;\r\n\r\n let button = <ButtonPrimitive.Button {...otherProps} className={className} ref={ref} />;\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, appearance: otherProps.appearance });\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 if (tooltip) {\r\n button = <Tooltip title={tooltip}>{button}</Tooltip>;\r\n }\r\n\r\n return button;\r\n};\r\n"],"names":["getButtonClasses","getAppearanceClasses","value","icon","createButton","props","className","ref","dialog","hanger","menu","popover","tooltip","otherProps","button","React","ButtonPr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AkB,UAAtB,EAAkC;AAC9BK,IAAAA,MAAM,GAAGL,MAAM,CAAC;AAAEU,MAAAA,MAAM,EAAEL;AAAV,KAAD,CAAf;AACH;;AAED,MAAIF,OAAJ,EAAa;AACTE,IAAAA,MAAM,GAAGC,4BAAA,CAACK,OAAD;AAASC,MAAAA,KAAK,EAAET;KAAhB,EAA0BE,MAA1B,CAAT;AACH;;AAED,SAAOA,MAAP;AACH;;;;"}
|
@@ -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, DayModifiers } 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\nconst renderDay = (day: Date, modifiers: DayModifiers): React.ReactNode =>\n modifiers.disabled ? <span className=\"dot\" /> : day.getDate();\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};\n\nexport const Calendar = React.forwardRef(function Calendar(props: CalendarProps, ref: React.Ref<ReactDayPicker>) {\n const { onChange: handleChange, value, ...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 showOutsideDays\n renderDay={renderDay}\n numberOfMonths={1}\n ref={ref}\n />\n </div>\n );\n});\n"],"names":["renderDay","day","modifiers","disabled","React","className","getDate","thisYear","Date","getFullYear","years","i","push","Navbar","onMonthChange","onNextClick","onPreviousClick","value","useLocalization","texts","calendar","actions","months","handleChange","event","target","form","year","month","name","onChange","getMonth","map","key","String","IconButton","appearance","icon","previousMonth","onClick","rounded","nextMonth","Calendar","props","ref","otherProps","locale","visibleMonth","setVisibleMonth","handleDayClick","date","outside","handleCalendarClickToday","today","setHours","setMinutes","setSeconds","cn","ReactDayPicker","selectedDays","substring","firstDayOfWeek","weekdaysShort","navbarElement","navProps","onDayClick","onTodayButtonClick","captionElement","todayButton","showOutsideDays","numberOfMonths"],"mappings":";;;;;;;;;AA6BA,IAAMA,SAAS,GAAG,SAAZA,SAAY,CAACC,GAAD,EAAYC,SAAZ;AAAA,SACdA,SAAS,CAACC,QAAV,GAAqBC,aAAA,OAAA;AAAMC,IAAAA,SAAS,EAAC;GAAhB,CAArB,GAAgDJ,GAAG,CAACK,OAAJ,EADlC;AAAA,CAAlB;;AAUA,IAAMC,QAAQ,gBAAG,IAAIC,IAAJ,GAAWC,WAAX,EAAjB;AACA,IAAMC,KAAK,GAAa,EAAxB;;AAEA,KAAK,IAAIC,CAAC,GAAGJ,QAAQ,GAAG,EAAxB,EAA4BI,CAAC,IAAIJ,QAAQ,GAAG,EAA5C,EAAgDI,CAAC,IAAI,CAArD,EAAwD;AACpDD,EAAAA,KAAK,CAACE,IAAN,CAA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kBAAkB,EAAEd;AACpBe,IAAAA,cAAc,EAAE;AAAA,aAAM,IAAN;AAAA;AAChBC,IAAAA,WAAW,EAAEjD,KAAK,CAACC,QAAN,CAAeC,OAAf,CAAuBgC;AACpCgB,IAAAA,eAAe;AACfrE,IAAAA,SAAS,EAAEA;AACXsE,IAAAA,cAAc,EAAE;AAChB1B,IAAAA,GAAG,EAAEA;IAlBT,CADJ,CADJ;AAwBH,CAxDuB;;;;"}
|
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, DayModifiers } 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\nconst renderDay = (day: Date, modifiers: DayModifiers): React.ReactNode =>\r\n modifiers.disabled ? <span className=\"dot\" /> : day.getDate();\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};\r\n\r\nexport const Calendar = React.forwardRef(function Calendar(props: CalendarProps, ref: React.Ref<ReactDayPicker>) {\r\n const { onChange: handleChange, value, ...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 showOutsideDays\r\n renderDay={renderDay}\r\n numberOfMonths={1}\r\n ref={ref}\r\n />\r\n </div>\r\n );\r\n});\r\n"],"names":["renderDay","day","modifiers","disabled","React","className","getDate","thisYear","Date","getFullYear","years","i","push","Navbar","onMonthChange","onNextClick","onPreviousClick","value","useLocalization","texts","calendar","actions","months","handleChange","event","target","form","year","month","name","onChange","getMonth","map","key","String","IconButton","appearance","icon","previousMonth","onClick","rounded","nextMonth","Calendar","props","ref","otherProps","locale","visibleMonth","setVisibleMonth","handleDayClick","date","outside","handleCalendarClickToday","today","setHours","setMinutes","setSeconds","cn","ReactDayPicker","selectedDays","substring","firstDayOfWeek","weekdaysShort","navbarElement","navProps","onDayClick","onTodayButtonClick","captionElement","todayButton","showOutsideDays","numberOfMonths"],"mappings":";;;;;;;;;AA6BA,IAAMA,SAAS,GAAG,SAAZA,SAAY,CAACC,GAAD,EAAYC,SAAZ;AAAA,SACdA,SAAS,CAACC,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;AACRC,IAAAA,cAAc,EAAE;AAChBvC,IAAAA,MAAM,EAAEH,KAAK,CAACC,QAAN,CAAeE;AACvBwC,IAAAA,aAAa,EAAE3C,KAAK,CAACC,QAAN,CAAe0C;AAC9BC,IAAAA,aAAa,EAAE,uBAAAC,QAAQ;AAAA,aAAI5D,aAAA,CAACS,MAAD,oBAAYmD;AAAUlD,QAAAA,aAAa,EAAEkC;AAAiB/B,QAAAA,KAAK,EAAE8B;QAA7D,CAAJ;AAAA;AACvBkB,IAAAA,UAAU,EAAEhB;AACZnC,IAAAA,aAAa,EAAEkC;AACfkB,IAAAA,kBAAkB,EAAEd;AACpBe,IAAAA,cAAc,EAAE;AAAA,aAAM,IAAN;AAAA;AAChBC,IAAAA,WAAW,EAAEjD,KAAK,CAACC,QAAN,CAAeC,OAAf,CAAuBgC;AACpCgB,IAAAA,eAAe;AACfrE,IAAAA,SAAS,EAAEA;AACXsE,IAAAA,cAAc,EAAE;AAChB1B,IAAAA,GAAG,EAAEA;IAlBT,CADJ,CADJ;AAwBH,CAxDuB;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Icon } from '../Icon/Icon';\n\ntype CheckedState = boolean | 'indeterminate';\n\ntype CheckboxBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\n /* Increases visual prominenance of the checkbox */\n highlighted?: boolean;\n /**\n * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all\n * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.\n */\n indeterminate?: boolean;\n /* Whether the checkbox is in an invalid state */\n invalid?: boolean;\n /** Label for the checkbox */\n label?: React.ReactNode;\n /* Whether user input is required */\n required?: boolean;\n};\n\ninterface UncontrolledCheckboxProps extends CheckboxBaseProps {\n checked?: never;\n onChange?: never;\n /* The default checked state (uncontrolled) */\n defaultChecked?: boolean;\n}\n\ninterface ControlledCheckboxProps extends CheckboxBaseProps {\n defaultChecked?: never;\n /* The current checked state (controlled) */\n checked: boolean;\n /* Handler called when the checked state changes */\n onChange: (checked: boolean) => void;\n}\n\nexport type CheckboxProps = UncontrolledCheckboxProps | ControlledCheckboxProps;\n\nexport const Checkbox = React.forwardRef(function Checkbox(props: CheckboxProps, ref: React.Ref<HTMLButtonElement>) {\n const { checked, highlighted, indeterminate, invalid, label, onChange, ...otherProps } = props;\n\n const className = cn(\n 'bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem] focus:yt-focus', //hover:shadow-[0_0_0_1px_rgba(235,235,235,1)]\n props.className,\n {\n 'border-grey-dark text-blue hover:text-blue-light focus:border-blue focus:hover:border-blue-light':\n !props.disabled && !invalid,\n 'border-grey text-blue-light cursor-not-allowed': props.disabled,\n 'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,\n 'border-red text-red hover:text-red-light hover:border-red-light focus:border-red focus:hover:border-red-light':\n invalid && !props.disabled,\n }\n );\n\n let handleChange: ((checked: CheckedState) => void) | undefined;\n\n if (onChange) {\n handleChange = (checked: CheckedState) => onChange(checked === 'indeterminate' ? false : checked);\n }\n\n const element = (\n <CheckboxPrimitive.Root\n {...otherProps}\n data-taco=\"checkbox\"\n checked={indeterminate ? 'indeterminate' : checked}\n className={className}\n onCheckedChange={handleChange}\n ref={ref}\n >\n <CheckboxPrimitive.Indicator className=\"flex h-full w-full\">\n <Icon name={indeterminate ? 'line' : 'tick'} className=\"!h-full !w-full\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n\n if (label) {\n const labelClassName = cn(\n 'flex items-center cursor-pointer gap-2',\n {\n 'cursor-not-allowed text-grey-dark': props.disabled,\n },\n props.className\n );\n\n return (\n <label className={labelClassName}>\n {element}\n {label}\n </label>\n );\n }\n\n return element;\n});\n"],"names":["Checkbox","React","props","ref","checked","highlighted","indeterminate","invalid","label","onChange","otherProps","className","cn","disabled","handleChange","element","CheckboxPrimitive","onCheckedChange","Icon","name","labelClassName"],"mappings":";;;;;;;IAwCaA,QAAQ,gBAAGC,UAAA,CAAiB,SAASD,QAAT,CAAkBE,KAAlB,EAAwCC,GAAxC;AACrC,MAAQC,OAAR,GAAyFF,KAAzF,CAAQE,OAAR;AAAA,MAAiBC,WAAjB,GAAyFH,KAAzF,CAAiBG,WAAjB;AAAA,MAA8BC,aAA9B,GAAyFJ,KAAzF,CAA8BI,aAA9B;AAAA,MAA6CC,OAA7C,GAAyFL,KAAzF,CAA6CK,OAA7C;AAAA,MAAsDC,KAAtD,GAAyFN,KAAzF,CAAsDM,KAAtD;AAAA,MAA6DC,QAA7D,GAAyFP,KAAzF,CAA6DO,QAA7D;AAAA,MAA0EC,UAA1E,iCAAyFR,KAAzF;;AAEA,MAAMS,SAAS,GAAGC,EAAE,CAChB,6FADgB;AAEhBV,EAAAA,KAAK,CAACS,SAFU,EAGhB;AACI,wGACI,CAACT,KAAK,CAACW,QAAP,IAAmB,CAACN,OAF5B;AAGI,sDAAkDL,KAAK,CAACW,QAH5D;AAII,oEAAgER,WAJpE;AAKI,qHACIE,OAAO,IAAI,CAACL,KAAK,CAACW;AAN1B,GAHgB,CAApB;AAaA,MAAIC,YAAJ;;AAEA,MAAIL,QAAJ,EAAc;AACVK,IAAAA,YAAY,GAAG,sBAACV,OAAD;AAAA,aAA2BK,QAAQ,CAACL,OAAO,KAAK,eAAZ,GAA8B,KAA9B,GAAsCA,OAAvC,CAAnC;AAAA,KAAf;AACH;;AAED,MAAMW,OAAO,GACTd,aAAA,CAACe,IAAD,oBACQN;iBACM;AACVN,IAAAA,OAAO,EAAEE,aAAa,GAAG,eAAH,GAAqBF;AAC3CO,IAAAA,SAAS,EAAEA;AACXM,IAAAA,eAAe,EAAEH;AACjBX,IAAAA,GAAG,EAAEA;IANT,EAQIF,aAAA,CAACe,SAAD;AAA6BL,IAAAA,SAAS,EAAC;GAAvC,EACIV,aAAA,CAACiB,IAAD;AAAMC,IAAAA,IAAI,EAAEb,aAAa,GAAG,MAAH,GAAY;AAAQK,IAAAA,SAAS,EAAC;GAAvD,CADJ,CARJ,CADJ;;AAeA,MAAIH,KAAJ,EAAW;AACP,QAAMY,cAAc,GAAGR,EAAE,CACrB,wCADqB,EAErB;AACI,2CAAqCV,KAAK,CAACW;AAD/C,KAFqB,EAKrBX,KAAK,CAACS,SALe,CAAzB;AAQA,WACIV,aAAA,QAAA;AAAOU,MAAAA,SAAS,EAAES;KAAlB,EACKL,OADL,EAEKP,KAFL,CADJ;AAMH;;AAED,SAAOO,OAAP;AACH,CAvDuB;;;;"}
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import * as React from 'react';\r\nimport cn from 'classnames';\r\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\r\nimport { Icon } from '../Icon/Icon';\r\n\r\ntype CheckedState = boolean | 'indeterminate';\r\n\r\ntype CheckboxBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onChange'> & {\r\n /* Increases visual prominenance of the checkbox */\r\n highlighted?: boolean;\r\n /**\r\n * Indeterminate state should only be used with sub-checkboxes. The indeterminate state is shown if not all\r\n * sub-checkboxes are selected. This only affects the style, changing the icon in the checkbox.\r\n */\r\n indeterminate?: boolean;\r\n /* Whether the checkbox is in an invalid state */\r\n invalid?: boolean;\r\n /** Label for the checkbox */\r\n label?: React.ReactNode;\r\n /* Whether user input is required */\r\n required?: boolean;\r\n};\r\n\r\ninterface UncontrolledCheckboxProps extends CheckboxBaseProps {\r\n checked?: never;\r\n onChange?: never;\r\n /* The default checked state (uncontrolled) */\r\n defaultChecked?: boolean;\r\n}\r\n\r\ninterface ControlledCheckboxProps extends CheckboxBaseProps {\r\n defaultChecked?: never;\r\n /* The current checked state (controlled) */\r\n checked: boolean;\r\n /* Handler called when the checked state changes */\r\n onChange: (checked: boolean) => void;\r\n}\r\n\r\nexport type CheckboxProps = UncontrolledCheckboxProps | ControlledCheckboxProps;\r\n\r\nexport const Checkbox = React.forwardRef(function Checkbox(props: CheckboxProps, ref: React.Ref<HTMLButtonElement>) {\r\n const { checked, highlighted, indeterminate, invalid, label, onChange, ...otherProps } = props;\r\n\r\n const className = cn(\r\n 'bg-white h-5 w-5 border rounded text-sm flex-shrink-0 self-start mt-[0.1rem] focus:yt-focus', //hover:shadow-[0_0_0_1px_rgba(235,235,235,1)]\r\n props.className,\r\n {\r\n 'border-grey-dark text-blue hover:text-blue-light focus:border-blue focus:hover:border-blue-light':\r\n !props.disabled && !invalid,\r\n 'border-grey text-blue-light cursor-not-allowed': props.disabled,\r\n 'bg-[rgba(255,255,0,0.2)] disabled:bg-[rgba(255,255,0,0.075)]': highlighted,\r\n 'border-red text-red hover:text-red-light hover:border-red-light focus:border-red focus:hover:border-red-light':\r\n invalid && !props.disabled,\r\n }\r\n );\r\n\r\n let handleChange: ((checked: CheckedState) => void) | undefined;\r\n\r\n if (onChange) {\r\n handleChange = (checked: CheckedState) => onChange(checked === 'indeterminate' ? false : checked);\r\n }\r\n\r\n const element = (\r\n <CheckboxPrimitive.Root\r\n {...otherProps}\r\n data-taco=\"checkbox\"\r\n checked={indeterminate ? 'indeterminate' : checked}\r\n className={className}\r\n onCheckedChange={handleChange}\r\n ref={ref}\r\n >\r\n <CheckboxPrimitive.Indicator className=\"flex h-full w-full\">\r\n <Icon name={indeterminate ? 'line' : 'tick'} className=\"!h-full !w-full\" />\r\n </CheckboxPrimitive.Indicator>\r\n </CheckboxPrimitive.Root>\r\n );\r\n\r\n if (label) {\r\n const labelClassName = cn(\r\n 'flex items-center cursor-pointer gap-2',\r\n {\r\n 'cursor-not-allowed text-grey-dark': props.disabled,\r\n },\r\n props.className\r\n );\r\n\r\n return (\r\n <label className={labelClassName}>\r\n {element}\r\n {label}\r\n </label>\r\n );\r\n }\r\n\r\n return element;\r\n});\r\n"],"names":["Checkbox","React","props","ref","checked","highlighted","indeterminate","invalid","label","onChange","otherProps","className","cn","disabled","handleChange","element","CheckboxPrimitive","onCheckedChange","Icon","name","labelClassName"],"mappings":";;;;;;;IAwCaA,QAAQ,gBAAGC,UAAA,CAAiB,SAASD,QAAT,CAAkBE,KAAlB,EAAwCC,GAAxC;AACrC,MAAQC,OAAR,GAAyFF,KAAzF,CAAQE,OAAR;AAAA,MAAiBC,WAAjB,GAAyFH,KAAzF,CAAiBG,WAAjB;AAAA,MAA8BC,aAA9B,GAAyFJ,KAAzF,CAA8BI,aAA9B;AAAA,MAA6CC,OAA7C,GAAyFL,KAAzF,CAA6CK,OAA7C;AAAA,MAAsDC,KAAtD,GAAyFN,KAAzF,CAAsDM,KAAtD;AAAA,MAA6DC,QAA7D,GAAyFP,KAAzF,CAA6DO,QAA7D;AAAA,MAA0EC,UAA1E,iCAAyFR,KAAzF;;AAEA,MAAMS,SAAS,GAAGC,EAAE,CAChB,6FADgB;AAEhBV,EAAAA,KAAK,CAACS,SAFU,EAGhB;AACI,wGACI,CAACT,KAAK,CAACW,QAAP,IAAmB,CAACN,OAF5B;AAGI,sDAAkDL,KAAK,CAACW,QAH5D;AAII,oEAAgER,WAJpE;AAKI,qHACIE,OAAO,IAAI,CAACL,KAAK,CAACW;AAN1B,GAHgB,CAApB;AAaA,MAAIC,YAAJ;;AAEA,MAAIL,QAAJ,EAAc;AACVK,IAAAA,YAAY,GAAG,sBAACV,OAAD;AAAA,aAA2BK,QAAQ,CAACL,OAAO,KAAK,eAAZ,GAA8B,KAA9B,GAAsCA,OAAvC,CAAnC;AAAA,KAAf;AACH;;AAED,MAAMW,OAAO,GACTd,aAAA,CAACe,IAAD,oBACQN;iBACM;AACVN,IAAAA,OAAO,EAAEE,aAAa,GAAG,eAAH,GAAqBF;AAC3CO,IAAAA,SAAS,EAAEA;AACXM,IAAAA,eAAe,EAAEH;AACjBX,IAAAA,GAAG,EAAEA;IANT,EAQIF,aAAA,CAACe,SAAD;AAA6BL,IAAAA,SAAS,EAAC;GAAvC,EACIV,aAAA,CAACiB,IAAD;AAAMC,IAAAA,IAAI,EAAEb,aAAa,GAAG,MAAH,GAAY;AAAQK,IAAAA,SAAS,EAAC;GAAvD,CADJ,CARJ,CADJ;;AAeA,MAAIH,KAAJ,EAAW;AACP,QAAMY,cAAc,GAAGR,EAAE,CACrB,wCADqB,EAErB;AACI,2CAAqCV,KAAK,CAACW;AAD/C,KAFqB,EAKrBX,KAAK,CAACS,SALe,CAAzB;AAQA,WACIV,aAAA,QAAA;AAAOU,MAAAA,SAAS,EAAES;KAAlB,EACKL,OADL,EAEKP,KAFL,CADJ;AAMH;;AAED,SAAOO,OAAP;AACH,CAvDuB;;;;"}
|
@@ -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 '../../utils/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 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.Content\n align=\"start\"\n onOpenAutoFocus={event => {\n event.preventDefault();\n }}\n sideOffset={4}\n >\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.Root>\n </span>\n );\n});\n"],"names":["Combobox","React","props","ref","externalClassName","className","dialog","style","otherProps","useCombobox","combobox","button","input","popover","list","internalRef","useLocalization","texts","selectDimensions","useBoundingClientRectListener","cn","inline","PopoverPrimitive","asChild","Input","autoComplete","IconButton","appearance","icon","open","onClick","onOpenChange","current","focus","tabIndex","disabled","readOnly","onFocus","event","preventDefault","tooltip","undefined","align","onOpenAutoFocus","sideOffset","ScrollableList","minWidth","width"],"mappings":";;;;;;;;;;;;IA+DaA,QAAQ,gBAAGC,UAAA,CAAiB,SAASD,QAAT,CAAkBE,KAAlB,EAAwCC,GAAxC;AACrC,MAAmBC,iBAAnB,GAAuEF,KAAvE,CAAQG,SAAR;AAAA,MAAsCC,MAAtC,GAAuEJ,KAAvE,CAAsCI,MAAtC;AAAA,MAA8CC,KAA9C,GAAuEL,KAAvE,CAA8CK,KAA9C;AAAA,MAAwDC,UAAxD,iCAAuEN,KAAvE;;AACA,qBAAmDO,WAAW,CAACD,UAAD,EAAaL,GAAb,CAA9D;AAAA,MAAQO,QAAR,gBAAQA,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AACIE,MAAAA,IAAI,EAAC;AACLO,MAAAA,QAAQ,EAAEjC,KAAK,CAACkC,QAAN,IAAkBlC,KAAK,CAACiC;AAClC7B,MAAAA,MAAM,EAAEA;AACR+B,MAAAA,OAAO,EAAE,iBAACC,KAAD;;;AACL;AACAA,QAAAA,KAAK,CAACC,cAAN;AACA,+BAAA3B,KAAK,CAACT,GAAN,CAAU6B,OAAV,4EAAmBC,KAAnB;AACH;AACD9B,MAAAA,GAAG,EAAEQ,MAAM,CAACR;AACZ+B,MAAAA,QAAQ,EAAE,CAAC;AACXM,MAAAA,OAAO,EAAEvB,KAAK,CAACP,QAAN,CAAe8B;KAX5B,CADM,GAcNC;IA7BZ,CADJ,CADJ,CADJ,EAqCIxC,aAAA,CAACqB,OAAD;AACIoB,IAAAA,KAAK,EAAC;AACNC,IAAAA,eAAe,EAAE,yBAAAL,KAAK;AAClBA,MAAAA,KAAK,CAACC,cAAN;AACH;AACDK,IAAAA,UAAU,EAAE;GALhB,EAOI3C,aAAA,CAAC4C,cAAD,oBACQ/B;AACJT,IAAAA,SAAS,EAAEe,EAAE,CAAC,uEAAD;AACbb,IAAAA,KAAK,EAAE;AAAEuC,MAAAA,QAAQ,EAAE5B,gBAAF,aAAEA,gBAAF,uBAAEA,gBAAgB,CAAE6B;AAA9B;AACPb,IAAAA,QAAQ,EAAErB,OAAO,CAACgB,IAAR,GAAe,CAAf,GAAmB,CAAC;IAJlC,CAPJ,CArCJ,CADJ,CADJ;AAwDH,CAtEuB;;;;"}
|
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 '../../utils/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 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.Content\r\n align=\"start\"\r\n onOpenAutoFocus={event => {\r\n event.preventDefault();\r\n }}\r\n sideOffset={4}\r\n >\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.Root>\r\n </span>\r\n );\r\n});\r\n"],"names":["Combobox","React","props","ref","externalClassName","className","dialog","style","otherProps","useCombobox","combobox","button","input","popover","list","internalRef","useLocalization","texts","selectDimensions","useBoundingClientRectListener","cn","inline","PopoverPrimitive","asChild","Input","autoComplete","IconButton","appearance","icon","open","onClick","onOpenChange","current","focus","tabIndex","disabled","readOnly","onFocus","event","preventDefault","tooltip","undefined","align","onOpenAutoFocus","sideOffset","ScrollableList","minWidth","width"],"mappings":";;;;;;;;;;;;IA+DaA,QAAQ,gBAAGC,UAAA,CAAiB,SAASD,QAAT,CAAkBE,KAAlB,EAAwCC,GAAxC;AACrC,MAAmBC,iBAAnB,GAAuEF,KAAvE,CAAQG,SAAR;AAAA,MAAsCC,MAAtC,GAAuEJ,KAAvE,CAAsCI,MAAtC;AAAA,MAA8CC,KAA9C,GAAuEL,KAAvE,CAA8CK,KAA9C;AAAA,MAAwDC,UAAxD,iCAAuEN,KAAvE;;AACA,qBAAmDO,WAAW,CAACD,UAAD,EAAaL,GAAb,CAA9D;AAAA,MAAQO,QAAR,gBAAQA,QAAR;AAAA,MAAkBC,MAAlB,gBAAkBA,MAAlB;AAAA,MAA0BC,KAA1B,gBAA0BA,KAA1B;AAAA,MAAiCC,OAAjC,gBAAiCA,OAAjC;AAAA,MAA0CC,IAA1C,gBAA0CA,IAA1C;;AACA,MAAMC,WAAW,GAAGd,MAAA,CAA6B,IAA7B,CAApB;;AACA,yBAAkBe,eAAe,EAAjC;AAAA,MAAQC,KAAR,oBAAQA,KAAR;;AACA,MAAMC,gBAAgB,GAAGC,6BAA6B,CAACJ,WAAD,CAAtD;AACA,MAAMV,SAAS,GAAGe,EAAE,CAChB,sBADgB,EAEhB;AACI,2BAAuBlB,KAAK,CAACmB;AADjC,GAFgB,EAKhBjB,iBALgB,CAApB;AAQA,SACIH,aAAA,OAAA;AAAM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