@spark-ui/components 13.0.6 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button-C3xHNaGl.js +2 -0
- package/dist/Button-C3xHNaGl.js.map +1 -0
- package/dist/{chunk-2YM6GKWW.mjs → Button-D32Avk2j.mjs} +130 -173
- package/dist/Button-D32Avk2j.mjs.map +1 -0
- package/dist/DialogContent.styles-BrhKaHc_.js +2 -0
- package/dist/DialogContent.styles-BrhKaHc_.js.map +1 -0
- package/dist/{chunk-XZ47F6TP.mjs → DialogContent.styles-WGWJS9dj.mjs} +6 -8
- package/dist/DialogContent.styles-WGWJS9dj.mjs.map +1 -0
- package/dist/Icon-Bf0XrmiR.js +2 -0
- package/dist/Icon-Bf0XrmiR.js.map +1 -0
- package/dist/Icon-D1RueiPY.mjs +58 -0
- package/dist/Icon-D1RueiPY.mjs.map +1 -0
- package/dist/IconButton-BY3gYXtU.mjs +43 -0
- package/dist/IconButton-BY3gYXtU.mjs.map +1 -0
- package/dist/IconButton-Bf-EDzpI.js +2 -0
- package/dist/IconButton-Bf-EDzpI.js.map +1 -0
- package/dist/Slot-C98rL4yy.mjs +14 -0
- package/dist/Slot-C98rL4yy.mjs.map +1 -0
- package/dist/Slot-ghrohQLA.js +2 -0
- package/dist/Slot-ghrohQLA.js.map +1 -0
- package/dist/{chunk-GAK4SC2F.mjs → Spinner-CYL5kyzM.mjs} +29 -40
- package/dist/Spinner-CYL5kyzM.mjs.map +1 -0
- package/dist/Spinner-DK8VEsaR.js +2 -0
- package/dist/Spinner-DK8VEsaR.js.map +1 -0
- package/dist/{chunk-RKPP7ZOK.mjs → TextLink-3MEVs3No.mjs} +27 -36
- package/dist/TextLink-3MEVs3No.mjs.map +1 -0
- package/dist/TextLink-DD0VO37q.js +2 -0
- package/dist/TextLink-DD0VO37q.js.map +1 -0
- package/dist/VisuallyHidden-AoRh4WRK.js +2 -0
- package/dist/VisuallyHidden-AoRh4WRK.js.map +1 -0
- package/dist/VisuallyHidden-ByNP7ZUI.mjs +28 -0
- package/dist/VisuallyHidden-ByNP7ZUI.mjs.map +1 -0
- package/dist/accordion/Accordion.d.ts +27 -0
- package/dist/accordion/AccordionItem.d.ts +12 -0
- package/dist/accordion/AccordionItemContent.d.ts +12 -0
- package/dist/accordion/AccordionItemHeader.d.ts +9 -0
- package/dist/accordion/AccordionItemTrigger.d.ts +12 -0
- package/dist/accordion/index.d.ts +10 -68
- package/dist/accordion/index.js +2 -325
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +632 -154
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/accordion/useRenderSlot.d.ts +3 -0
- package/dist/alert-dialog/AlertDialog.d.ts +29 -0
- package/dist/alert-dialog/AlertDialogAction.d.ts +13 -0
- package/dist/alert-dialog/AlertDialogBody.d.ts +12 -0
- package/dist/alert-dialog/AlertDialogCancel.d.ts +13 -0
- package/dist/alert-dialog/AlertDialogContent.d.ts +9 -0
- package/dist/alert-dialog/AlertDialogContext.d.ts +12 -0
- package/dist/alert-dialog/AlertDialogDescription.d.ts +9 -0
- package/dist/alert-dialog/AlertDialogFooter.d.ts +10 -0
- package/dist/alert-dialog/AlertDialogHeader.d.ts +10 -0
- package/dist/alert-dialog/AlertDialogOverlay.d.ts +9 -0
- package/dist/alert-dialog/AlertDialogPortal.d.ts +7 -0
- package/dist/alert-dialog/AlertDialogTitle.d.ts +9 -0
- package/dist/alert-dialog/AlertDialogTrigger.d.ts +13 -0
- package/dist/alert-dialog/index.d.ts +26 -147
- package/dist/alert-dialog/index.js +35 -405
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +2513 -258
- package/dist/alert-dialog/index.mjs.map +1 -1
- package/dist/alert-dialog/useRenderSlot.d.ts +3 -0
- package/dist/avatar/Avatar.d.ts +3 -0
- package/dist/avatar/AvatarAction.d.ts +9 -0
- package/dist/avatar/AvatarImage.d.ts +7 -0
- package/dist/avatar/AvatarOnlineBadge.d.ts +9 -0
- package/dist/avatar/AvatarPlaceholder.d.ts +8 -0
- package/dist/avatar/AvatarUser.d.ts +7 -0
- package/dist/avatar/context.d.ts +5 -0
- package/dist/avatar/index.d.ts +8 -59
- package/dist/avatar/index.js +2 -1323
- package/dist/avatar/index.js.map +1 -1
- package/dist/avatar/index.mjs +149 -207
- package/dist/avatar/index.mjs.map +1 -1
- package/dist/avatar/types.d.ts +24 -0
- package/dist/badge/Badge.d.ts +9 -0
- package/dist/badge/BadgeItem.d.ts +31 -0
- package/dist/badge/BadgeItem.styles.d.ts +7 -0
- package/dist/badge/index.d.ts +1 -47
- package/dist/badge/index.js +2 -122
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/index.mjs +32 -44
- package/dist/badge/index.mjs.map +1 -1
- package/dist/breadcrumb/Breadcrumb.d.ts +10 -0
- package/dist/breadcrumb/Breadcrumb.styles.d.ts +0 -0
- package/dist/breadcrumb/BreadcrumbCurrentPage.d.ts +11 -0
- package/dist/breadcrumb/BreadcrumbItem.d.ts +9 -0
- package/dist/breadcrumb/BreadcrumbLink.d.ts +12 -0
- package/dist/breadcrumb/BreadcrumbSeparator.d.ts +10 -0
- package/dist/breadcrumb/index.d.ts +7 -59
- package/dist/breadcrumb/index.js +2 -327
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +106 -146
- package/dist/breadcrumb/index.mjs.map +1 -1
- package/dist/button/Button.d.ts +26 -0
- package/dist/button/Button.styles.d.ts +10 -0
- package/dist/button/index.d.ts +1 -41
- package/dist/button/index.js +2 -935
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +3 -8
- package/dist/button/index.mjs.map +1 -1
- package/dist/button/variants/contrast.d.ts +45 -0
- package/dist/button/variants/filled.d.ts +45 -0
- package/dist/button/variants/ghost.d.ts +45 -0
- package/dist/button/variants/index.d.ts +5 -0
- package/dist/button/variants/outlined.d.ts +45 -0
- package/dist/button/variants/tinted.d.ts +45 -0
- package/dist/card/Backdrop.d.ts +14 -0
- package/dist/card/Card.d.ts +16 -0
- package/dist/card/Card.styles.d.ts +7 -0
- package/dist/card/Content.d.ts +15 -0
- package/dist/card/Content.styles.d.ts +8 -0
- package/dist/card/context.d.ts +11 -0
- package/dist/card/index.d.ts +5 -58
- package/dist/card/index.js +2 -502
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +125 -178
- package/dist/card/index.mjs.map +1 -1
- package/dist/card/utils.d.ts +3 -0
- package/dist/carousel/Carousel.d.ts +12 -0
- package/dist/carousel/CarouselControls.d.ts +9 -0
- package/dist/carousel/CarouselNextButton.d.ts +5 -0
- package/dist/carousel/CarouselPageIndicator.d.ts +14 -0
- package/dist/carousel/CarouselPagePicker.d.ts +14 -0
- package/dist/carousel/CarouselPrevButton.d.ts +5 -0
- package/dist/carousel/CarouselSlide.d.ts +12 -0
- package/dist/carousel/CarouselSlides.d.ts +10 -0
- package/dist/carousel/CarouselViewport.d.ts +9 -0
- package/dist/carousel/index.d.ts +18 -263
- package/dist/carousel/index.js +2 -1882
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +428 -650
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/carousel/{index.d.mts → types.d.ts} +13 -112
- package/dist/carousel/useCarousel.d.ts +2 -0
- package/dist/carousel/useCarouselVisibility.d.ts +13 -0
- package/dist/carousel/useEvent.d.ts +7 -0
- package/dist/carousel/useIsMounted.d.ts +1 -0
- package/dist/carousel/useIsVisible.d.ts +6 -0
- package/dist/carousel/useResizeObserver.d.ts +2 -0
- package/dist/carousel/useScrollEnd.d.ts +3 -0
- package/dist/carousel/useSnapPoints.d.ts +10 -0
- package/dist/carousel/utils.d.ts +24 -0
- package/dist/checkbox/Checkbox.d.ts +10 -0
- package/dist/checkbox/CheckboxGroup.d.ts +18 -0
- package/dist/checkbox/CheckboxGroup.styles.d.ts +5 -0
- package/dist/checkbox/CheckboxGroupContext.d.ts +41 -0
- package/dist/checkbox/CheckboxIndicator.d.ts +9 -0
- package/dist/checkbox/CheckboxInput.d.ts +47 -0
- package/dist/checkbox/CheckboxInput.styles.d.ts +5 -0
- package/dist/checkbox/CheckboxLabel.d.ts +12 -0
- package/dist/checkbox/CheckboxLabel.styles.d.ts +5 -0
- package/dist/checkbox/index.d.ts +2 -120
- package/dist/checkbox/index.js +2 -511
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs +371 -226
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/chip/Chip.d.ts +34 -0
- package/dist/chip/Chip.styles.d.ts +8 -0
- package/dist/chip/ChipClearButton.d.ts +10 -0
- package/dist/chip/ChipClearButton.styles.d.ts +10 -0
- package/dist/chip/ChipContent.d.ts +8 -0
- package/dist/chip/ChipIcon.d.ts +8 -0
- package/dist/chip/ChipLeadingIcon.d.ts +9 -0
- package/dist/chip/ChipTrailingIcon.d.ts +9 -0
- package/dist/chip/index.d.ts +10 -92
- package/dist/chip/index.js +2 -908
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +390 -322
- package/dist/chip/index.mjs.map +1 -1
- package/dist/chip/useChipContext.d.ts +4 -0
- package/dist/chip/useChipElement.d.ts +41 -0
- package/dist/chip/variants/dashed.d.ts +49 -0
- package/dist/chip/variants/index.d.ts +3 -0
- package/dist/chip/variants/outlined.d.ts +49 -0
- package/dist/chip/variants/tinted.d.ts +49 -0
- package/dist/collapsible/Content.d.ts +12 -0
- package/dist/collapsible/Root.d.ts +12 -0
- package/dist/collapsible/Trigger.d.ts +11 -0
- package/dist/collapsible/index.d.ts +4 -40
- package/dist/collapsible/index.js +2 -109
- package/dist/collapsible/index.js.map +1 -1
- package/dist/collapsible/index.mjs +214 -58
- package/dist/collapsible/index.mjs.map +1 -1
- package/dist/collapsible/useRenderSlot.d.ts +3 -0
- package/dist/combobox/Combobox.d.ts +6 -0
- package/dist/combobox/ComboboxClearButton.d.ts +9 -0
- package/dist/combobox/ComboboxContext.d.ts +108 -0
- package/dist/combobox/ComboboxDisclosure.d.ts +13 -0
- package/dist/combobox/ComboboxEmpty.d.ts +11 -0
- package/dist/combobox/ComboboxGroup.d.ts +11 -0
- package/dist/combobox/ComboboxInput.d.ts +15 -0
- package/dist/combobox/ComboboxItem.d.ts +12 -0
- package/dist/combobox/ComboboxItemContext.d.ts +17 -0
- package/dist/combobox/ComboboxItemIndicator.d.ts +11 -0
- package/dist/combobox/ComboboxItemText.d.ts +10 -0
- package/dist/combobox/ComboboxItems.d.ts +11 -0
- package/dist/combobox/ComboboxItemsGroupContext.d.ts +8 -0
- package/dist/combobox/ComboboxLabel.d.ts +11 -0
- package/dist/combobox/ComboboxLeadingIcon.d.ts +7 -0
- package/dist/combobox/ComboboxPopover.d.ts +10 -0
- package/dist/combobox/ComboboxPortal.d.ts +2 -0
- package/dist/combobox/ComboboxSelectedItems.d.ts +4 -0
- package/dist/combobox/ComboboxTrigger.d.ts +11 -0
- package/dist/combobox/ComboboxTrigger.styles.d.ts +6 -0
- package/dist/combobox/index.d.ts +19 -271
- package/dist/combobox/index.js +2 -2588
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +623 -1017
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/combobox/tests/test-utils.d.ts +8 -0
- package/dist/combobox/types.d.ts +8 -0
- package/dist/combobox/useCombobox/multipleSelectionReducer.d.ts +13 -0
- package/dist/combobox/useCombobox/singleSelectionReducer.d.ts +8 -0
- package/dist/combobox/utils/index.d.ts +14 -0
- package/dist/combobox/utils/useWidthIncreaseCallback.d.ts +2 -0
- package/dist/composite-Br3kM5N9.mjs +40 -0
- package/dist/composite-Br3kM5N9.mjs.map +1 -0
- package/dist/composite-fJD9R7R0.js +2 -0
- package/dist/composite-fJD9R7R0.js.map +1 -0
- package/dist/detectBrowser-Bc7rk5fI.mjs +44 -0
- package/dist/detectBrowser-Bc7rk5fI.mjs.map +1 -0
- package/dist/detectBrowser-DTbs_30X.js +2 -0
- package/dist/detectBrowser-DTbs_30X.js.map +1 -0
- package/dist/dialog/Dialog.d.ts +32 -0
- package/dist/dialog/DialogBody.d.ts +12 -0
- package/dist/dialog/DialogClose.d.ts +9 -0
- package/dist/dialog/DialogCloseButton.d.ts +9 -0
- package/dist/dialog/DialogContent.d.ts +14 -0
- package/dist/dialog/DialogContent.styles.d.ts +6 -0
- package/dist/dialog/DialogContext.d.ts +11 -0
- package/dist/dialog/DialogDescription.d.ts +9 -0
- package/dist/dialog/DialogFooter.d.ts +10 -0
- package/dist/dialog/DialogHeader.d.ts +10 -0
- package/dist/dialog/DialogOverlay.d.ts +9 -0
- package/dist/dialog/DialogPortal.d.ts +7 -0
- package/dist/dialog/DialogTitle.d.ts +9 -0
- package/dist/dialog/DialogTrigger.d.ts +17 -0
- package/dist/dialog/index.d.ts +25 -154
- package/dist/dialog/index.js +2 -1389
- package/dist/dialog/index.js.map +1 -1
- package/dist/dialog/index.mjs +163 -258
- package/dist/dialog/index.mjs.map +1 -1
- package/dist/divider/Divider.d.ts +30 -0
- package/dist/divider/Divider.styles.d.ts +9 -0
- package/dist/divider/DividerContent.d.ts +13 -0
- package/dist/divider/index.d.ts +4 -59
- package/dist/divider/index.js +2 -224
- package/dist/divider/index.js.map +1 -1
- package/dist/divider/index.mjs +97 -100
- package/dist/divider/index.mjs.map +1 -1
- package/dist/divider/variants/intents.d.ts +17 -0
- package/dist/downshift.esm-Ncwetv0s.mjs +3038 -0
- package/dist/downshift.esm-Ncwetv0s.mjs.map +1 -0
- package/dist/downshift.esm-PfCOUbxq.js +37 -0
- package/dist/downshift.esm-PfCOUbxq.js.map +1 -0
- package/dist/drawer/Drawer.d.ts +39 -0
- package/dist/drawer/DrawerBody.d.ts +11 -0
- package/dist/drawer/DrawerBody.styles.d.ts +5 -0
- package/dist/drawer/DrawerClose.d.ts +9 -0
- package/dist/drawer/DrawerCloseButton.d.ts +7 -0
- package/dist/drawer/DrawerContent.d.ts +10 -0
- package/dist/drawer/DrawerContent.styles.d.ts +6 -0
- package/dist/drawer/DrawerContext.d.ts +9 -0
- package/dist/drawer/DrawerDescription.d.ts +9 -0
- package/dist/drawer/DrawerFooter.d.ts +8 -0
- package/dist/drawer/DrawerHeader.d.ts +10 -0
- package/dist/drawer/DrawerOverlay.d.ts +9 -0
- package/dist/drawer/DrawerPortal.d.ts +7 -0
- package/dist/drawer/DrawerTitle.d.ts +9 -0
- package/dist/drawer/DrawerTrigger.d.ts +13 -0
- package/dist/drawer/index.d.ts +24 -141
- package/dist/drawer/index.js +2 -1400
- package/dist/drawer/index.js.map +1 -1
- package/dist/drawer/index.mjs +141 -230
- package/dist/drawer/index.mjs.map +1 -1
- package/dist/dropdown/Dropdown.d.ts +6 -0
- package/dist/dropdown/DropdownContext.d.ts +81 -0
- package/dist/dropdown/DropdownDivider.d.ts +10 -0
- package/dist/dropdown/DropdownGroup.d.ts +11 -0
- package/dist/dropdown/DropdownItem.d.ts +12 -0
- package/dist/dropdown/DropdownItemContext.d.ts +17 -0
- package/dist/dropdown/DropdownItemIndicator.d.ts +11 -0
- package/dist/dropdown/DropdownItemText.d.ts +9 -0
- package/dist/dropdown/DropdownItems.d.ts +21 -0
- package/dist/dropdown/DropdownItemsGroupContext.d.ts +8 -0
- package/dist/dropdown/DropdownLabel.d.ts +11 -0
- package/dist/dropdown/DropdownLeadingIcon.d.ts +7 -0
- package/dist/dropdown/DropdownPopover.d.ts +6 -0
- package/dist/dropdown/DropdownPortal.d.ts +2 -0
- package/dist/dropdown/DropdownTrigger.d.ts +12 -0
- package/dist/dropdown/DropdownTrigger.styles.d.ts +5 -0
- package/dist/dropdown/DropdownValue.d.ts +11 -0
- package/dist/dropdown/index.d.ts +16 -220
- package/dist/dropdown/index.js +2 -2051
- package/dist/dropdown/index.js.map +1 -1
- package/dist/dropdown/index.mjs +352 -584
- package/dist/dropdown/index.mjs.map +1 -1
- package/dist/dropdown/types.d.ts +8 -0
- package/dist/dropdown/useDropdown.d.ts +41 -0
- package/dist/dropdown/utils.d.ts +13 -0
- package/dist/file-upload/FileUpload.d.ts +130 -0
- package/dist/file-upload/FileUploadAcceptedFile.d.ts +25 -0
- package/dist/file-upload/FileUploadContext.d.ts +17 -0
- package/dist/file-upload/FileUploadDropzone.d.ts +10 -0
- package/dist/file-upload/FileUploadItemDeleteTrigger.d.ts +11 -0
- package/dist/file-upload/FileUploadPreviewImage.d.ts +17 -0
- package/dist/file-upload/FileUploadRejectedFile.d.ts +24 -0
- package/dist/file-upload/FileUploadRejectedFileDeleteTrigger.d.ts +12 -0
- package/dist/file-upload/FileUploadTrigger.d.ts +12 -0
- package/dist/file-upload/constants.d.ts +29 -0
- package/dist/file-upload/index.d.ts +14 -262
- package/dist/file-upload/index.js +2 -2255
- package/dist/file-upload/index.js.map +1 -1
- package/dist/file-upload/index.mjs +506 -834
- package/dist/file-upload/index.mjs.map +1 -1
- package/dist/file-upload/test-utils.d.ts +9 -0
- package/dist/file-upload/useFileUploadState.d.ts +88 -0
- package/dist/file-upload/utils.d.ts +40 -0
- package/dist/floating-ui.utils.dom-CCN4I08l.js +2 -0
- package/dist/floating-ui.utils.dom-CCN4I08l.js.map +1 -0
- package/dist/floating-ui.utils.dom-uiDUZc_y.mjs +136 -0
- package/dist/floating-ui.utils.dom-uiDUZc_y.mjs.map +1 -0
- package/dist/form-field/FormField.d.ts +21 -0
- package/dist/form-field/FormFieldAlertMessage.d.ts +9 -0
- package/dist/form-field/FormFieldCharactersCount.d.ts +26 -0
- package/dist/form-field/FormFieldContext.d.ts +49 -0
- package/dist/form-field/FormFieldControl.d.ts +12 -0
- package/dist/form-field/FormFieldErrorMessage.d.ts +9 -0
- package/dist/form-field/FormFieldHelperMessage.d.ts +9 -0
- package/dist/form-field/FormFieldLabel.d.ts +13 -0
- package/dist/form-field/FormFieldMessage.d.ts +8 -0
- package/dist/form-field/FormFieldProvider.d.ts +9 -0
- package/dist/form-field/FormFieldRequiredIndicator.d.ts +9 -0
- package/dist/form-field/FormFieldStateMessage.d.ts +10 -0
- package/dist/form-field/FormFieldSuccessMessage.d.ts +9 -0
- package/dist/form-field/index.d.ts +21 -176
- package/dist/form-field/index.js +2 -553
- package/dist/form-field/index.js.map +1 -1
- package/dist/form-field/index.mjs +246 -349
- package/dist/form-field/index.mjs.map +1 -1
- package/dist/icon/Icon.d.ts +17 -0
- package/dist/icon/Icon.styles.d.ts +6 -0
- package/dist/icon/index.d.ts +1 -28
- package/dist/icon/index.js +2 -127
- package/dist/icon/index.js.map +1 -1
- package/dist/icon/index.mjs +3 -7
- package/dist/icon/index.mjs.map +1 -1
- package/dist/icon-button/IconButton.d.ts +10 -0
- package/dist/icon-button/IconButton.styles.d.ts +5 -0
- package/dist/icon-button/index.d.ts +1 -16
- package/dist/icon-button/index.js +2 -980
- package/dist/icon-button/index.js.map +1 -1
- package/dist/icon-button/index.mjs +3 -9
- package/dist/icon-button/index.mjs.map +1 -1
- package/dist/index-0KYGKeVg.js +2 -0
- package/dist/index-0KYGKeVg.js.map +1 -0
- package/dist/index-1WIgmEZh.js +2 -0
- package/dist/index-1WIgmEZh.js.map +1 -0
- package/dist/index-BRi38DTc.mjs +21 -0
- package/dist/index-BRi38DTc.mjs.map +1 -0
- package/dist/index-BZAtNKwE.mjs +71 -0
- package/dist/index-BZAtNKwE.mjs.map +1 -0
- package/dist/index-BZPx6jYI.mjs +9 -0
- package/dist/index-BZPx6jYI.mjs.map +1 -0
- package/dist/index-BlkdpEIe.mjs +55 -0
- package/dist/index-BlkdpEIe.mjs.map +1 -0
- package/dist/index-BmAFn37q.mjs +49 -0
- package/dist/index-BmAFn37q.mjs.map +1 -0
- package/dist/index-C-J_tHdS.js +6 -0
- package/dist/index-C-J_tHdS.js.map +1 -0
- package/dist/index-C1qb0595.mjs +28 -0
- package/dist/index-C1qb0595.mjs.map +1 -0
- package/dist/index-C34GgsKQ.mjs +54 -0
- package/dist/index-C34GgsKQ.mjs.map +1 -0
- package/dist/index-CCKe-Mpx.mjs +7 -0
- package/dist/index-CCKe-Mpx.mjs.map +1 -0
- package/dist/index-CDBBjNXc.js +2 -0
- package/dist/index-CDBBjNXc.js.map +1 -0
- package/dist/index-CYjGhVvU.mjs +243 -0
- package/dist/index-CYjGhVvU.mjs.map +1 -0
- package/dist/index-ChLwd62c.js +2 -0
- package/dist/index-ChLwd62c.js.map +1 -0
- package/dist/index-Cjj_rUPu.js +2 -0
- package/dist/index-Cjj_rUPu.js.map +1 -0
- package/dist/index-CyMbLkj0.js +2 -0
- package/dist/index-CyMbLkj0.js.map +1 -0
- package/dist/index-DFZozV_h.mjs +69 -0
- package/dist/index-DFZozV_h.mjs.map +1 -0
- package/dist/index-DKuHkHFX.js +2 -0
- package/dist/index-DKuHkHFX.js.map +1 -0
- package/dist/index-DLHLIYPI.mjs +16 -0
- package/dist/index-DLHLIYPI.mjs.map +1 -0
- package/dist/index-DO-atGp-.js +2 -0
- package/dist/index-DO-atGp-.js.map +1 -0
- package/dist/index-DWlg8lkk.mjs +179 -0
- package/dist/index-DWlg8lkk.mjs.map +1 -0
- package/dist/index-DYxWvftI.js +2 -0
- package/dist/index-DYxWvftI.js.map +1 -0
- package/dist/index-D_lWkK39.mjs +803 -0
- package/dist/index-D_lWkK39.mjs.map +1 -0
- package/dist/index-DdkVj7D0.js +18 -0
- package/dist/index-DdkVj7D0.js.map +1 -0
- package/dist/index-De-6atSi.js +2 -0
- package/dist/index-De-6atSi.js.map +1 -0
- package/dist/index-DhGWNzsz.mjs +83 -0
- package/dist/index-DhGWNzsz.mjs.map +1 -0
- package/dist/index-Dkj4QRX8.js +2 -0
- package/dist/index-Dkj4QRX8.js.map +1 -0
- package/dist/index-DlIFg0Eu.mjs +60 -0
- package/dist/index-DlIFg0Eu.mjs.map +1 -0
- package/dist/index-DnaHaH_0.js +2 -0
- package/dist/index-DnaHaH_0.js.map +1 -0
- package/dist/index-MHF2-CYX.js +2 -0
- package/dist/index-MHF2-CYX.js.map +1 -0
- package/dist/index-MQ0c3ZX_.js +2 -0
- package/dist/index-MQ0c3ZX_.js.map +1 -0
- package/dist/index-MSR-vgWR.mjs +37 -0
- package/dist/index-MSR-vgWR.mjs.map +1 -0
- package/dist/index-VL0YEmOW.mjs +125 -0
- package/dist/index-VL0YEmOW.mjs.map +1 -0
- package/dist/index-tXqxYME3.js +42 -0
- package/dist/index-tXqxYME3.js.map +1 -0
- package/dist/inertValue-Bif5Sqs6.mjs +522 -0
- package/dist/inertValue-Bif5Sqs6.mjs.map +1 -0
- package/dist/inertValue-ShwihJSN.js +5 -0
- package/dist/inertValue-ShwihJSN.js.map +1 -0
- package/dist/input/Input.d.ts +14 -0
- package/dist/input/Input.styles.d.ts +11 -0
- package/dist/input/InputAddon.d.ts +9 -0
- package/dist/input/InputAddon.styles.d.ts +9 -0
- package/dist/input/InputClearButton.d.ts +12 -0
- package/dist/input/InputGroup.d.ts +17 -0
- package/dist/input/InputGroup.styles.d.ts +6 -0
- package/dist/input/InputGroupContext.d.ts +14 -0
- package/dist/input/InputIcon.d.ts +6 -0
- package/dist/input/InputLeadingAddon.d.ts +11 -0
- package/dist/input/InputLeadingIcon.d.ts +7 -0
- package/dist/input/InputTrailingAddon.d.ts +11 -0
- package/dist/input/InputTrailingIcon.d.ts +7 -0
- package/dist/input/index.d.ts +15 -72
- package/dist/input/index.js +2 -724
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +453 -12
- package/dist/input/index.mjs.map +1 -1
- package/dist/input-otp/InputOTP.d.ts +85 -0
- package/dist/input-otp/InputOTP.styles.d.ts +10 -0
- package/dist/input-otp/InputOTPContext.d.ts +16 -0
- package/dist/input-otp/InputOTPGroup.d.ts +7 -0
- package/dist/input-otp/InputOTPSeparator.d.ts +7 -0
- package/dist/input-otp/InputOTPSlot.d.ts +12 -0
- package/dist/input-otp/index.d.ts +14 -0
- package/dist/input-otp/index.js +2 -0
- package/dist/input-otp/index.js.map +1 -0
- package/dist/input-otp/index.mjs +390 -0
- package/dist/input-otp/index.mjs.map +1 -0
- package/dist/input-otp/useInputOTP.d.ts +45 -0
- package/dist/kbd/Kbd.d.ts +5 -0
- package/dist/kbd/index.d.ts +1 -9
- package/dist/kbd/index.js +2 -47
- package/dist/kbd/index.js.map +1 -1
- package/dist/kbd/index.mjs +15 -18
- package/dist/kbd/index.mjs.map +1 -1
- package/dist/label/Label.d.ts +9 -0
- package/dist/label/LabelRequiredIndicator.d.ts +6 -0
- package/dist/label/index.d.ts +5 -9
- package/dist/label/index.js +2 -78
- package/dist/label/index.js.map +1 -1
- package/dist/label/index.mjs +3 -5
- package/dist/label/index.mjs.map +1 -1
- package/dist/link-box/LinkBox.d.ts +8 -0
- package/dist/link-box/LinkBoxLink.d.ts +8 -0
- package/dist/link-box/LinkBoxRaised.d.ts +9 -0
- package/dist/link-box/index.d.ts +6 -31
- package/dist/link-box/index.js +2 -92
- package/dist/link-box/index.js.map +1 -1
- package/dist/link-box/index.mjs +34 -56
- package/dist/link-box/index.mjs.map +1 -1
- package/dist/pagination/Pagination.d.ts +8 -0
- package/dist/pagination/PaginationContext.d.ts +43 -0
- package/dist/pagination/PaginationEllipsis.d.ts +9 -0
- package/dist/pagination/PaginationFirstPageTrigger.d.ts +16 -0
- package/dist/pagination/PaginationItem.d.ts +17 -0
- package/dist/pagination/PaginationLastPageTrigger.d.ts +16 -0
- package/dist/pagination/PaginationNextTrigger.d.ts +16 -0
- package/dist/pagination/PaginationPages.d.ts +16 -0
- package/dist/pagination/PaginationPrevTrigger.d.ts +16 -0
- package/dist/pagination/index.d.ts +10 -135
- package/dist/pagination/index.js +2 -1353
- package/dist/pagination/index.js.map +1 -1
- package/dist/pagination/index.mjs +893 -268
- package/dist/pagination/index.mjs.map +1 -1
- package/dist/pagination/utils.d.ts +1 -0
- package/dist/popover/Popover.d.ts +9 -0
- package/dist/popover/PopoverAnchor.d.ts +9 -0
- package/dist/popover/PopoverArrow.d.ts +9 -0
- package/dist/popover/PopoverCloseButton.d.ts +10 -0
- package/dist/popover/PopoverContent.d.ts +10 -0
- package/dist/popover/PopoverContent.styles.d.ts +9 -0
- package/dist/popover/PopoverContext.d.ts +15 -0
- package/dist/popover/PopoverHeader.d.ts +10 -0
- package/dist/popover/PopoverPortal.d.ts +7 -0
- package/dist/popover/PopoverTrigger.d.ts +9 -0
- package/dist/popover/index.d.ts +17 -6
- package/dist/popover/index.js +2 -1339
- package/dist/popover/index.js.map +1 -1
- package/dist/popover/index.mjs +1868 -11
- package/dist/popover/index.mjs.map +1 -1
- package/dist/portal/{index.d.mts → Portal.d.ts} +2 -5
- package/dist/portal/index.d.ts +1 -13
- package/dist/portal/index.js +2 -37
- package/dist/portal/index.js.map +1 -1
- package/dist/portal/index.mjs +5 -8
- package/dist/portal/index.mjs.map +1 -1
- package/dist/progress/Progress.d.ts +16 -0
- package/dist/progress/ProgressBar.d.ts +6 -0
- package/dist/progress/ProgressBar.styles.d.ts +5 -0
- package/dist/progress/ProgressContext.d.ts +13 -0
- package/dist/progress/ProgressIndicator.d.ts +6 -0
- package/dist/progress/ProgressIndicator.styles.d.ts +7 -0
- package/dist/progress/ProgressLabel.d.ts +6 -0
- package/dist/progress/index.d.ts +9 -48
- package/dist/progress/index.js +6 -239
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +241 -5
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progress-tracker/ProgressTracker.d.ts +27 -0
- package/dist/progress-tracker/ProgressTracker.styles.d.ts +1 -0
- package/dist/progress-tracker/ProgressTrackerContext.d.ts +15 -0
- package/dist/progress-tracker/ProgressTrackerStep.d.ts +12 -0
- package/dist/progress-tracker/ProgressTrackerStep.styles.d.ts +10 -0
- package/dist/progress-tracker/ProgressTrackerStepIndicator.d.ts +15 -0
- package/dist/progress-tracker/ProgressTrackerStepIndicator.styles.d.ts +7 -0
- package/dist/progress-tracker/ProgressTrackerStepLabel.d.ts +9 -0
- package/dist/progress-tracker/index.d.ts +10 -80
- package/dist/progress-tracker/index.js +2 -571
- package/dist/progress-tracker/index.js.map +1 -1
- package/dist/progress-tracker/index.mjs +115 -183
- package/dist/progress-tracker/index.mjs.map +1 -1
- package/dist/radio-group/Radio.d.ts +9 -0
- package/dist/radio-group/RadioGroup.d.ts +54 -0
- package/dist/radio-group/RadioGroup.styles.d.ts +5 -0
- package/dist/radio-group/RadioGroupContext.d.ts +5 -0
- package/dist/radio-group/RadioGroupProvider.d.ts +7 -0
- package/dist/radio-group/RadioIndicator.d.ts +18 -0
- package/dist/radio-group/RadioIndicator.styles.d.ts +5 -0
- package/dist/radio-group/RadioInput.d.ts +25 -0
- package/dist/radio-group/RadioInput.styles.d.ts +5 -0
- package/dist/radio-group/RadioLabel.d.ts +20 -0
- package/dist/radio-group/RadioLabel.styles.d.ts +5 -0
- package/dist/radio-group/index.d.ts +5 -98
- package/dist/radio-group/index.js +2 -318
- package/dist/radio-group/index.js.map +1 -1
- package/dist/radio-group/index.mjs +332 -174
- package/dist/radio-group/index.mjs.map +1 -1
- package/dist/rating/Rating.d.ts +52 -0
- package/dist/rating/RatingStar.d.ts +10 -0
- package/dist/rating/RatingStar.styles.d.ts +14 -0
- package/dist/rating/index.d.ts +1 -78
- package/dist/rating/index.js +2 -363
- package/dist/rating/index.js.map +1 -1
- package/dist/rating/index.mjs +125 -170
- package/dist/rating/index.mjs.map +1 -1
- package/dist/rating/types.d.ts +1 -0
- package/dist/rating/utils.d.ts +8 -0
- package/dist/scrolling-list/ScrollingList.d.ts +57 -0
- package/dist/scrolling-list/ScrollingListControls.d.ts +18 -0
- package/dist/scrolling-list/ScrollingListItem.d.ts +17 -0
- package/dist/scrolling-list/ScrollingListItems.d.ts +11 -0
- package/dist/scrolling-list/ScrollingListNextButton.d.ts +5 -0
- package/dist/scrolling-list/ScrollingListPrevButton.d.ts +5 -0
- package/dist/scrolling-list/ScrollingListSkipButton.d.ts +9 -0
- package/dist/scrolling-list/index.d.ts +14 -117
- package/dist/scrolling-list/index.js +2 -1428
- package/dist/scrolling-list/index.js.map +1 -1
- package/dist/scrolling-list/index.mjs +358 -325
- package/dist/scrolling-list/index.mjs.map +1 -1
- package/dist/scrolling-list/useFocusWithinScroll.d.ts +3 -0
- package/dist/segmented-gauge/{index.d.mts → SegmentedGauge.d.ts} +4 -43
- package/dist/segmented-gauge/SegmentedGaugeContext.d.ts +14 -0
- package/dist/segmented-gauge/SegmentedGaugeLabel.d.ts +9 -0
- package/dist/segmented-gauge/SegmentedGaugeSegment.d.ts +12 -0
- package/dist/segmented-gauge/SegmentedGaugeTrack.d.ts +8 -0
- package/dist/segmented-gauge/index.d.ts +9 -101
- package/dist/segmented-gauge/index.js +2 -274
- package/dist/segmented-gauge/index.js.map +1 -1
- package/dist/segmented-gauge/index.mjs +132 -178
- package/dist/segmented-gauge/index.mjs.map +1 -1
- package/dist/select/Select.d.ts +6 -0
- package/dist/select/SelectContext.d.ts +59 -0
- package/dist/select/SelectGroup.d.ts +11 -0
- package/dist/select/SelectItem.d.ts +11 -0
- package/dist/select/SelectItems.d.ts +10 -0
- package/dist/select/SelectItemsGroupContext.d.ts +9 -0
- package/dist/select/SelectLabel.d.ts +8 -0
- package/dist/select/SelectLeadingIcon.d.ts +7 -0
- package/dist/select/SelectPlaceholder.d.ts +10 -0
- package/dist/select/SelectTrigger.d.ts +16 -0
- package/dist/select/SelectTrigger.styles.d.ts +5 -0
- package/dist/select/SelectValue.d.ts +15 -0
- package/dist/select/index.d.ts +12 -158
- package/dist/select/index.js +2 -581
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +207 -339
- package/dist/select/index.mjs.map +1 -1
- package/dist/select/types.d.ts +6 -0
- package/dist/select/utils.d.ts +4 -0
- package/dist/skeleton/Skeleton.d.ts +17 -0
- package/dist/skeleton/Skeleton.styles.d.ts +5 -0
- package/dist/skeleton/SkeletonItem.d.ts +31 -0
- package/dist/skeleton/SkeletonItem.styles.d.ts +8 -0
- package/dist/skeleton/index.d.ts +8 -67
- package/dist/skeleton/index.js +2 -206
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +64 -96
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/slider/Slider.d.ts +55 -0
- package/dist/slider/Slider.styles.d.ts +1 -0
- package/dist/slider/SliderContext.d.ts +4 -0
- package/dist/slider/SliderThumb.d.ts +14 -0
- package/dist/slider/SliderThumb.styles.d.ts +5 -0
- package/dist/slider/SliderTrack.d.ts +14 -0
- package/dist/slider/SliderTrack.styles.d.ts +9 -0
- package/dist/slider/index.d.ts +8 -97
- package/dist/slider/index.js +2 -220
- package/dist/slider/index.js.map +1 -1
- package/dist/slider/index.mjs +490 -107
- package/dist/slider/index.mjs.map +1 -1
- package/dist/slot/Slot.d.ts +12 -0
- package/dist/slot/index.d.ts +1 -16
- package/dist/slot/index.js +2 -51
- package/dist/slot/index.js.map +1 -1
- package/dist/slot/index.mjs +5 -9
- package/dist/slot/index.mjs.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +29 -0
- package/dist/snackbar/SnackbarItem.d.ts +49 -0
- package/dist/snackbar/SnackbarItem.styles.d.ts +10 -0
- package/dist/snackbar/SnackbarItemAction.d.ts +10 -0
- package/dist/snackbar/SnackbarItemClose.d.ts +9 -0
- package/dist/snackbar/SnackbarItemContext.d.ts +8 -0
- package/dist/snackbar/SnackbarItemIcon.d.ts +7 -0
- package/dist/snackbar/SnackbarRegion.d.ts +30 -0
- package/dist/snackbar/SnackbarRegion.styles.d.ts +5 -0
- package/dist/snackbar/index.d.ts +13 -158
- package/dist/snackbar/index.js +2 -1756
- package/dist/snackbar/index.js.map +1 -1
- package/dist/snackbar/index.mjs +1153 -429
- package/dist/snackbar/index.mjs.map +1 -1
- package/dist/snackbar/snackbarVariants.d.ts +82 -0
- package/dist/snackbar/useSnackbarGlobalStore.d.ts +18 -0
- package/dist/snackbar/useSwipe.d.ts +15 -0
- package/dist/spinner/Spinner.d.ts +9 -0
- package/dist/spinner/Spinner.styles.d.ts +7 -0
- package/dist/spinner/index.d.ts +1 -21
- package/dist/spinner/index.js +2 -139
- package/dist/spinner/index.js.map +1 -1
- package/dist/spinner/index.mjs +3 -7
- package/dist/spinner/index.mjs.map +1 -1
- package/dist/stepper/Stepper.d.ts +9 -0
- package/dist/stepper/StepperButton.d.ts +14 -0
- package/dist/stepper/StepperInput.d.ts +7 -0
- package/dist/stepper/index.d.ts +9 -81
- package/dist/stepper/index.js +8 -1847
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +2325 -197
- package/dist/stepper/index.mjs.map +1 -1
- package/dist/stepper/types.d.ts +46 -0
- package/dist/stepper/useStepper.d.ts +2 -0
- package/dist/switch/Switch.d.ts +6 -0
- package/dist/switch/{index.d.mts → SwitchInput.d.ts} +4 -17
- package/dist/switch/SwitchInput.styles.d.ts +16 -0
- package/dist/switch/SwitchLabel.d.ts +17 -0
- package/dist/switch/SwitchLabel.styles.d.ts +5 -0
- package/dist/switch/index.d.ts +1 -64
- package/dist/switch/index.js +2 -327
- package/dist/switch/index.js.map +1 -1
- package/dist/switch/index.mjs +213 -130
- package/dist/switch/index.mjs.map +1 -1
- package/dist/tabs/Tabs.d.ts +24 -0
- package/dist/tabs/TabsContent.d.ts +22 -0
- package/dist/tabs/TabsContent.styles.d.ts +3 -0
- package/dist/tabs/TabsContext.d.ts +7 -0
- package/dist/tabs/TabsList.d.ts +20 -0
- package/dist/tabs/TabsList.styles.d.ts +3 -0
- package/dist/tabs/TabsPopover.d.ts +29 -0
- package/dist/tabs/TabsPopoverAbstraction.d.ts +27 -0
- package/dist/tabs/TabsRoot.styles.d.ts +1 -0
- package/dist/tabs/TabsTrigger.d.ts +41 -0
- package/dist/tabs/TabsTrigger.styles.d.ts +8 -0
- package/dist/tabs/index.d.ts +13 -137
- package/dist/tabs/index.js +2 -1830
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +374 -350
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tabs/useResizeObserver.d.ts +8 -0
- package/dist/tag/Tag.d.ts +17 -0
- package/dist/tag/Tag.styles.d.ts +8 -0
- package/dist/tag/index.d.ts +1 -29
- package/dist/tag/index.js +2 -283
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/index.mjs +66 -90
- package/dist/tag/index.mjs.map +1 -1
- package/dist/tag/variants/filled.d.ts +41 -0
- package/dist/tag/variants/index.d.ts +3 -0
- package/dist/tag/variants/outlined.d.ts +37 -0
- package/dist/tag/variants/tinted.d.ts +37 -0
- package/dist/text-link/TextLink.d.ts +16 -0
- package/dist/text-link/index.d.ts +1 -20
- package/dist/text-link/index.js +2 -100
- package/dist/text-link/index.js.map +1 -1
- package/dist/text-link/index.mjs +3 -6
- package/dist/text-link/index.mjs.map +1 -1
- package/dist/textarea/Textarea.d.ts +14 -0
- package/dist/textarea/TextareaClearButton.d.ts +10 -0
- package/dist/textarea/TextareaGroup.d.ts +6 -0
- package/dist/textarea/TextareaLeadingIcon.d.ts +7 -0
- package/dist/textarea/TextareaTrailingIcon.d.ts +7 -0
- package/dist/textarea/index.d.ts +10 -53
- package/dist/textarea/index.js +2 -797
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +50 -83
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/Toast.d.ts +4 -0
- package/dist/toast/Toast.styles.d.ts +10 -0
- package/dist/toast/index.d.ts +10 -53
- package/dist/toast/index.js +2 -1454
- package/dist/toast/index.js.map +1 -1
- package/dist/toast/index.mjs +1016 -208
- package/dist/toast/index.mjs.map +1 -1
- package/dist/toast/types.d.ts +41 -0
- package/dist/toast/useRenderSlot.d.ts +3 -0
- package/dist/toast/useToastManager.d.ts +2 -0
- package/dist/useCollapsiblePanel-D1dCo0lf.js +4 -0
- package/dist/useCollapsiblePanel-D1dCo0lf.js.map +1 -0
- package/dist/useCollapsiblePanel-kbMNl4Z4.mjs +287 -0
- package/dist/useCollapsiblePanel-kbMNl4Z4.mjs.map +1 -0
- package/dist/useFocusWithin-CFNEka2I.js +2 -0
- package/dist/useFocusWithin-CFNEka2I.js.map +1 -0
- package/dist/useFocusWithin-CoL4390f.mjs +796 -0
- package/dist/useFocusWithin-CoL4390f.mjs.map +1 -0
- package/dist/useOpenChangeComplete-Dk-u_f2y.js +2 -0
- package/dist/useOpenChangeComplete-Dk-u_f2y.js.map +1 -0
- package/dist/useOpenChangeComplete-RUbg6RBw.mjs +582 -0
- package/dist/useOpenChangeComplete-RUbg6RBw.mjs.map +1 -0
- package/dist/useTransitionStatus-CktVVKxz.mjs +46 -0
- package/dist/useTransitionStatus-CktVVKxz.mjs.map +1 -0
- package/dist/useTransitionStatus-CqbEyvIj.js +2 -0
- package/dist/useTransitionStatus-CqbEyvIj.js.map +1 -0
- package/dist/visually-hidden/VisuallyHidden.d.ts +12 -0
- package/dist/visually-hidden/index.d.ts +1 -16
- package/dist/visually-hidden/index.js +2 -67
- package/dist/visually-hidden/index.js.map +1 -1
- package/dist/visually-hidden/index.mjs +3 -6
- package/dist/visually-hidden/index.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/Input-N8AWWSmt.d.mts +0 -41
- package/dist/Input-N8AWWSmt.d.ts +0 -41
- package/dist/InputTrailingIcon-BBp7sE6D.d.mts +0 -20
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +0 -20
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.mts +0 -19
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +0 -19
- package/dist/accordion/index.d.mts +0 -73
- package/dist/alert-dialog/index.d.mts +0 -159
- package/dist/avatar/index.d.mts +0 -66
- package/dist/badge/index.d.mts +0 -47
- package/dist/breadcrumb/index.d.mts +0 -64
- package/dist/button/index.d.mts +0 -41
- package/dist/card/index.d.mts +0 -61
- package/dist/checkbox/index.d.mts +0 -120
- package/dist/chip/index.d.mts +0 -97
- package/dist/chunk-2YM6GKWW.mjs.map +0 -1
- package/dist/chunk-6QCEPQ3U.mjs +0 -26
- package/dist/chunk-6QCEPQ3U.mjs.map +0 -1
- package/dist/chunk-7EWSMIZU.mjs +0 -214
- package/dist/chunk-7EWSMIZU.mjs.map +0 -1
- package/dist/chunk-DCXWGQVZ.mjs +0 -53
- package/dist/chunk-DCXWGQVZ.mjs.map +0 -1
- package/dist/chunk-GAK4SC2F.mjs.map +0 -1
- package/dist/chunk-GPJMLIHC.mjs +0 -308
- package/dist/chunk-GPJMLIHC.mjs.map +0 -1
- package/dist/chunk-HLXYG643.mjs +0 -52
- package/dist/chunk-HLXYG643.mjs.map +0 -1
- package/dist/chunk-KEGAAGJW.mjs +0 -36
- package/dist/chunk-KEGAAGJW.mjs.map +0 -1
- package/dist/chunk-RKPP7ZOK.mjs.map +0 -1
- package/dist/chunk-UMUMFMFB.mjs +0 -68
- package/dist/chunk-UMUMFMFB.mjs.map +0 -1
- package/dist/chunk-VBX7BTNU.mjs +0 -614
- package/dist/chunk-VBX7BTNU.mjs.map +0 -1
- package/dist/chunk-XZ47F6TP.mjs.map +0 -1
- package/dist/collapsible/index.d.mts +0 -43
- package/dist/combobox/index.d.mts +0 -287
- package/dist/dialog/index.d.mts +0 -166
- package/dist/divider/index.d.mts +0 -61
- package/dist/docgen.json +0 -47767
- package/dist/drawer/index.d.mts +0 -152
- package/dist/dropdown/index.d.mts +0 -233
- package/dist/file-upload/index.d.mts +0 -270
- package/dist/form-field/index.d.mts +0 -186
- package/dist/icon/index.d.mts +0 -28
- package/dist/icon-button/index.d.mts +0 -16
- package/dist/index-Cno_GFuW.d.mts +0 -93
- package/dist/index-Cno_GFuW.d.ts +0 -93
- package/dist/input/index.d.mts +0 -78
- package/dist/kbd/index.d.mts +0 -9
- package/dist/label/index.d.mts +0 -11
- package/dist/link-box/index.d.mts +0 -34
- package/dist/pagination/index.d.mts +0 -143
- package/dist/popover/index.d.mts +0 -6
- package/dist/progress/index.d.mts +0 -52
- package/dist/progress-tracker/index.d.mts +0 -80
- package/dist/radio-group/index.d.mts +0 -100
- package/dist/rating/index.d.mts +0 -78
- package/dist/scrolling-list/index.d.mts +0 -118
- package/dist/select/index.d.mts +0 -167
- package/dist/skeleton/index.d.mts +0 -67
- package/dist/slider/index.d.mts +0 -97
- package/dist/slot/index.d.mts +0 -16
- package/dist/snackbar/index.d.mts +0 -158
- package/dist/spinner/index.d.mts +0 -21
- package/dist/stepper/index.d.mts +0 -81
- package/dist/tabs/index.d.mts +0 -137
- package/dist/tag/index.d.mts +0 -29
- package/dist/text-link/index.d.mts +0 -20
- package/dist/textarea/index.d.mts +0 -57
- package/dist/toast/index.d.mts +0 -63
- package/dist/visually-hidden/index.d.mts +0 -16
|
@@ -1,327 +1,2582 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
} from "../
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { jsxs as At, jsx as K } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import Ft, { createContext as Fn, useContext as _n, useRef as _t } from "react";
|
|
4
|
+
import { a as Z, N as Lt, A as Ln, c as V, q as Ve, e as Vt, g as pt, r as be, s as Vn, v as Bt, d as se, o as Bn, t as De, E as ke, w as Wn, n as jn, f as Me, p as zn, l as Wt, u as jt, m as zt, x as Kn, T as gt, j as Re, i as Kt, k as Ht, y as Hn } from "../useOpenChangeComplete-RUbg6RBw.mjs";
|
|
5
|
+
import { f as $e, p as $t, o as Ut, i as ve, e as Gt, c as pe, k as qe, j as $n, d as Xe, s as Un } from "../floating-ui.utils.dom-uiDUZc_y.mjs";
|
|
6
|
+
import { c as Gn, d as Yn } from "../detectBrowser-Bc7rk5fI.mjs";
|
|
7
|
+
import { T as nt, o as Ue, b as oe, d as mt, e as qn, f as Ne, h as ot, t as Yt, j as st, k as rt, a as xe, c as $, v as Xn, F as ht, l as Et, n as Jn, p as Qn, g as re, q as qt, C as Xt, r as Zn, s as eo, w as to, x as ne, y as no, A as Jt, S as Qt, z as oo, i as ro } from "../inertValue-Bif5Sqs6.mjs";
|
|
8
|
+
import { u as so, a as it } from "../useTransitionStatus-CktVVKxz.mjs";
|
|
9
|
+
import { r as Zt, s as io } from "../index-VL0YEmOW.mjs";
|
|
10
|
+
import { i as ao, d as lo, s as co, e as yt, f as en, g as uo, C as fo } from "../composite-Br3kM5N9.mjs";
|
|
11
|
+
import { a as po } from "../Slot-C98rL4yy.mjs";
|
|
12
|
+
import { useMergeRefs as tn } from "@spark-ui/hooks/use-merge-refs";
|
|
13
|
+
import { useScrollOverflow as go } from "@spark-ui/hooks/use-scroll-overflow";
|
|
14
|
+
import { a as Te } from "../index-BmAFn37q.mjs";
|
|
15
|
+
import { d as mo } from "../DialogContent.styles-WGWJS9dj.mjs";
|
|
16
|
+
function Se(e, t, n = !0) {
|
|
17
|
+
return e.filter((r) => r.parentId === t && (!n || r.context?.open)).flatMap((r) => [r, ...Se(e, r.id, n)]);
|
|
18
|
+
}
|
|
19
|
+
function bt(e, t) {
|
|
20
|
+
let n = [], o = e.find((r) => r.id === t)?.parentId;
|
|
21
|
+
for (; o; ) {
|
|
22
|
+
const r = e.find((s) => s.id === o);
|
|
23
|
+
o = r?.parentId, r && (n = n.concat(r));
|
|
24
|
+
}
|
|
25
|
+
return n;
|
|
26
|
+
}
|
|
27
|
+
let vt = {}, St = {}, Ct = "";
|
|
28
|
+
function ho(e) {
|
|
29
|
+
if (typeof document > "u")
|
|
30
|
+
return !1;
|
|
31
|
+
const t = Ue(e);
|
|
32
|
+
return $e(t).innerWidth - t.documentElement.clientWidth > 0;
|
|
33
|
+
}
|
|
34
|
+
function Eo(e) {
|
|
35
|
+
const t = Ue(e), n = t.documentElement, o = t.body, r = $t(n) ? n : o, s = r.style.overflow;
|
|
36
|
+
return r.style.overflow = "hidden", () => {
|
|
37
|
+
r.style.overflow = s;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function yo(e) {
|
|
41
|
+
const t = Ue(e), n = t.documentElement, o = t.body, r = $e(n);
|
|
42
|
+
let s = 0, a = 0;
|
|
43
|
+
const l = Ln.create(), i = typeof CSS < "u" && CSS.supports?.("scrollbar-gutter", "stable");
|
|
44
|
+
if (Yn && (r.visualViewport?.scale ?? 1) !== 1)
|
|
45
|
+
return () => {
|
|
46
|
+
};
|
|
47
|
+
function c() {
|
|
48
|
+
const p = r.getComputedStyle(n), m = r.getComputedStyle(o), C = (p.scrollbarGutter || "").includes("both-edges") ? "stable both-edges" : "stable";
|
|
49
|
+
s = n.scrollTop, a = n.scrollLeft, vt = {
|
|
50
|
+
scrollbarGutter: n.style.scrollbarGutter,
|
|
51
|
+
overflowY: n.style.overflowY,
|
|
52
|
+
overflowX: n.style.overflowX
|
|
53
|
+
}, Ct = n.style.scrollBehavior, St = {
|
|
54
|
+
position: o.style.position,
|
|
55
|
+
height: o.style.height,
|
|
56
|
+
width: o.style.width,
|
|
57
|
+
boxSizing: o.style.boxSizing,
|
|
58
|
+
overflowY: o.style.overflowY,
|
|
59
|
+
overflowX: o.style.overflowX,
|
|
60
|
+
scrollBehavior: o.style.scrollBehavior
|
|
61
|
+
};
|
|
62
|
+
const T = n.scrollHeight > n.clientHeight, y = n.scrollWidth > n.clientWidth, E = p.overflowY === "scroll" || m.overflowY === "scroll", x = p.overflowX === "scroll" || m.overflowX === "scroll", k = Math.max(0, r.innerWidth - n.clientWidth), w = Math.max(0, r.innerHeight - n.clientHeight), D = parseFloat(m.marginTop) + parseFloat(m.marginBottom), I = parseFloat(m.marginLeft) + parseFloat(m.marginRight), B = $t(n) ? n : o;
|
|
63
|
+
if (i) {
|
|
64
|
+
n.style.scrollbarGutter = C, B.style.overflowY = "hidden", B.style.overflowX = "hidden";
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
Object.assign(n.style, {
|
|
68
|
+
scrollbarGutter: C,
|
|
69
|
+
overflowY: "hidden",
|
|
70
|
+
overflowX: "hidden"
|
|
71
|
+
}), (T || E) && (n.style.overflowY = "scroll"), (y || x) && (n.style.overflowX = "scroll"), Object.assign(o.style, {
|
|
72
|
+
position: "relative",
|
|
73
|
+
height: D || w ? `calc(100dvh - ${D + w}px)` : "100dvh",
|
|
74
|
+
width: I || k ? `calc(100vw - ${I + k}px)` : "100vw",
|
|
75
|
+
boxSizing: "border-box",
|
|
76
|
+
overflow: "hidden",
|
|
77
|
+
scrollBehavior: "unset"
|
|
78
|
+
}), o.scrollTop = s, o.scrollLeft = a, n.setAttribute("data-base-ui-scroll-locked", ""), n.style.scrollBehavior = "unset";
|
|
79
|
+
}
|
|
80
|
+
function f() {
|
|
81
|
+
Object.assign(n.style, vt), Object.assign(o.style, St), i || (n.scrollTop = s, n.scrollLeft = a, n.removeAttribute("data-base-ui-scroll-locked"), n.style.scrollBehavior = Ct);
|
|
82
|
+
}
|
|
83
|
+
function h() {
|
|
84
|
+
f(), l.request(c);
|
|
85
|
+
}
|
|
86
|
+
return c(), r.addEventListener("resize", h), () => {
|
|
87
|
+
l.cancel(), f(), typeof r.removeEventListener == "function" && r.removeEventListener("resize", h);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
class bo {
|
|
91
|
+
lockCount = 0;
|
|
92
|
+
restore = null;
|
|
93
|
+
timeoutLock = nt.create();
|
|
94
|
+
timeoutUnlock = nt.create();
|
|
95
|
+
acquire(t) {
|
|
96
|
+
return this.lockCount += 1, this.lockCount === 1 && this.restore === null && this.timeoutLock.start(0, () => this.lock(t)), this.release;
|
|
97
|
+
}
|
|
98
|
+
release = () => {
|
|
99
|
+
this.lockCount -= 1, this.lockCount === 0 && this.restore && this.timeoutUnlock.start(0, this.unlock);
|
|
100
|
+
};
|
|
101
|
+
unlock = () => {
|
|
102
|
+
this.lockCount === 0 && this.restore && (this.restore?.(), this.restore = null);
|
|
103
|
+
};
|
|
104
|
+
lock(t) {
|
|
105
|
+
if (this.lockCount === 0 || this.restore !== null)
|
|
106
|
+
return;
|
|
107
|
+
const o = Ue(t).documentElement, r = $e(o).getComputedStyle(o).overflowY;
|
|
108
|
+
if (r === "hidden" || r === "clip") {
|
|
109
|
+
this.restore = Lt;
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const s = Gn || !ho(t);
|
|
113
|
+
this.restore = s ? Eo(t) : yo(t);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const vo = new bo();
|
|
117
|
+
function So(e = !0, t = null) {
|
|
118
|
+
Z(() => {
|
|
119
|
+
if (e)
|
|
120
|
+
return vo.acquire(t);
|
|
121
|
+
}, [e, t]);
|
|
122
|
+
}
|
|
123
|
+
function Co() {
|
|
124
|
+
const e = /* @__PURE__ */ new Map();
|
|
125
|
+
return {
|
|
126
|
+
emit(t, n) {
|
|
127
|
+
e.get(t)?.forEach((o) => o(n));
|
|
128
|
+
},
|
|
129
|
+
on(t, n) {
|
|
130
|
+
e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n);
|
|
131
|
+
},
|
|
132
|
+
off(t, n) {
|
|
133
|
+
e.get(t)?.delete(n);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const nn = /* @__PURE__ */ u.createContext(null);
|
|
138
|
+
process.env.NODE_ENV !== "production" && (nn.displayName = "FloatingNodeContext");
|
|
139
|
+
const on = /* @__PURE__ */ u.createContext(null);
|
|
140
|
+
process.env.NODE_ENV !== "production" && (on.displayName = "FloatingTreeContext");
|
|
141
|
+
const rn = () => u.useContext(nn)?.id || null, sn = (e) => {
|
|
142
|
+
const t = u.useContext(on);
|
|
143
|
+
return e ?? t;
|
|
144
|
+
};
|
|
145
|
+
let Rt = 0;
|
|
146
|
+
function Je(e, t = {}) {
|
|
147
|
+
const {
|
|
148
|
+
preventScroll: n = !1,
|
|
149
|
+
cancelPrevious: o = !0,
|
|
150
|
+
sync: r = !1
|
|
151
|
+
} = t;
|
|
152
|
+
o && cancelAnimationFrame(Rt);
|
|
153
|
+
const s = () => e?.focus({
|
|
154
|
+
preventScroll: n
|
|
155
|
+
});
|
|
156
|
+
r ? s() : Rt = requestAnimationFrame(s);
|
|
157
|
+
}
|
|
158
|
+
const Ce = {
|
|
159
|
+
inert: /* @__PURE__ */ new WeakMap(),
|
|
160
|
+
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
161
|
+
none: /* @__PURE__ */ new WeakMap()
|
|
162
|
+
};
|
|
163
|
+
function Tt(e) {
|
|
164
|
+
return e === "inert" ? Ce.inert : e === "aria-hidden" ? Ce["aria-hidden"] : Ce.none;
|
|
165
|
+
}
|
|
166
|
+
let Be = /* @__PURE__ */ new WeakSet(), We = {}, Qe = 0;
|
|
167
|
+
const an = (e) => e && (e.host || an(e.parentNode)), Ro = (e, t) => t.map((n) => {
|
|
168
|
+
if (e.contains(n))
|
|
169
|
+
return n;
|
|
170
|
+
const o = an(n);
|
|
171
|
+
return e.contains(o) ? o : null;
|
|
172
|
+
}).filter((n) => n != null);
|
|
173
|
+
function To(e, t, n, o) {
|
|
174
|
+
const r = "data-base-ui-inert", s = o ? "inert" : n ? "aria-hidden" : null, a = Ro(t, e), l = /* @__PURE__ */ new Set(), i = new Set(a), c = [];
|
|
175
|
+
We[r] || (We[r] = /* @__PURE__ */ new WeakMap());
|
|
176
|
+
const f = We[r];
|
|
177
|
+
a.forEach(h), p(t), l.clear();
|
|
178
|
+
function h(m) {
|
|
179
|
+
!m || l.has(m) || (l.add(m), m.parentNode && h(m.parentNode));
|
|
180
|
+
}
|
|
181
|
+
function p(m) {
|
|
182
|
+
!m || i.has(m) || [].forEach.call(m.children, (g) => {
|
|
183
|
+
if (Ut(g) !== "script")
|
|
184
|
+
if (l.has(g))
|
|
185
|
+
p(g);
|
|
186
|
+
else {
|
|
187
|
+
const b = s ? g.getAttribute(s) : null, C = b !== null && b !== "false", T = Tt(s), y = (T.get(g) || 0) + 1, E = (f.get(g) || 0) + 1;
|
|
188
|
+
T.set(g, y), f.set(g, E), c.push(g), y === 1 && C && Be.add(g), E === 1 && g.setAttribute(r, ""), !C && s && g.setAttribute(s, s === "inert" ? "" : "true");
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return Qe += 1, () => {
|
|
193
|
+
c.forEach((m) => {
|
|
194
|
+
const g = Tt(s), C = (g.get(m) || 0) - 1, T = (f.get(m) || 0) - 1;
|
|
195
|
+
g.set(m, C), f.set(m, T), C || (!Be.has(m) && s && m.removeAttribute(s), Be.delete(m)), T || m.removeAttribute(r);
|
|
196
|
+
}), Qe -= 1, Qe || (Ce.inert = /* @__PURE__ */ new WeakMap(), Ce["aria-hidden"] = /* @__PURE__ */ new WeakMap(), Ce.none = /* @__PURE__ */ new WeakMap(), Be = /* @__PURE__ */ new WeakSet(), We = {});
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function Oo(e, t = !1, n = !1) {
|
|
200
|
+
const o = oe(e[0]).body;
|
|
201
|
+
return To(e.concat(Array.from(o.querySelectorAll("[aria-live]"))), o, t, n);
|
|
202
|
+
}
|
|
203
|
+
function wo(e, t) {
|
|
204
|
+
const n = $e(e.target);
|
|
205
|
+
return e instanceof n.KeyboardEvent ? "keyboard" : e instanceof n.FocusEvent ? t || "keyboard" : "pointerType" in e ? e.pointerType || "keyboard" : "touches" in e ? "touch" : e instanceof n.MouseEvent ? t || (e.detail === 0 ? "keyboard" : "mouse") : "";
|
|
206
|
+
}
|
|
207
|
+
const Ot = 20;
|
|
208
|
+
let ue = [];
|
|
209
|
+
function at() {
|
|
210
|
+
ue = ue.filter((e) => e.isConnected);
|
|
211
|
+
}
|
|
212
|
+
function xo(e) {
|
|
213
|
+
at(), e && Ut(e) !== "body" && (ue.push(e), ue.length > Ot && (ue = ue.slice(-Ot)));
|
|
214
|
+
}
|
|
215
|
+
function Ze() {
|
|
216
|
+
return at(), ue[ue.length - 1];
|
|
217
|
+
}
|
|
218
|
+
function Do(e) {
|
|
219
|
+
if (!e)
|
|
220
|
+
return null;
|
|
221
|
+
const t = st();
|
|
222
|
+
return qt(e, t) ? e : Yt(e, t)[0] || e;
|
|
223
|
+
}
|
|
224
|
+
function ko(e) {
|
|
225
|
+
return !e || !e.isConnected ? !1 : typeof e.checkVisibility == "function" ? e.checkVisibility() : Gt(e).display !== "none";
|
|
226
|
+
}
|
|
227
|
+
function wt(e, t) {
|
|
228
|
+
if (!t.current.includes("floating") && !e.getAttribute("role")?.includes("dialog"))
|
|
229
|
+
return;
|
|
230
|
+
const n = st(), r = Zn(e, n).filter((a) => {
|
|
231
|
+
const l = a.getAttribute("data-tabindex") || "";
|
|
232
|
+
return qt(a, n) || a.hasAttribute("data-tabindex") && !l.startsWith("-");
|
|
233
|
+
}), s = e.getAttribute("tabindex");
|
|
234
|
+
t.current.includes("floating") || r.length === 0 ? s !== "0" && e.setAttribute("tabindex", "0") : (s !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
235
|
+
}
|
|
236
|
+
function Io(e) {
|
|
237
|
+
const {
|
|
238
|
+
context: t,
|
|
239
|
+
children: n,
|
|
240
|
+
disabled: o = !1,
|
|
241
|
+
order: r = ["content"],
|
|
242
|
+
initialFocus: s = !0,
|
|
243
|
+
returnFocus: a = !0,
|
|
244
|
+
restoreFocus: l = !1,
|
|
245
|
+
modal: i = !0,
|
|
246
|
+
closeOnFocusOut: c = !0,
|
|
247
|
+
openInteractionType: f = "",
|
|
248
|
+
getInsideElements: h = () => [],
|
|
249
|
+
nextFocusableElement: p,
|
|
250
|
+
previousFocusableElement: m,
|
|
251
|
+
beforeContentFocusGuardRef: g,
|
|
252
|
+
externalTree: b
|
|
253
|
+
} = e, C = "rootStore" in t ? t.rootStore : t, T = C.useState("open"), y = C.useState("domReferenceElement"), E = C.useState("floatingElement"), {
|
|
254
|
+
events: x,
|
|
255
|
+
dataRef: k
|
|
256
|
+
} = C.context, w = V(() => k.current.floatingContext?.nodeId), D = V(h), I = s === !1, B = mt(y) && I, W = Ve(r), H = Ve(s), q = Ve(a), Oe = Ve(f), G = sn(b), F = qn(), ae = u.useRef(null), Ge = u.useRef(null), U = u.useRef(!1), ie = u.useRef(!1), me = u.useRef(!1), Pe = u.useRef(-1), he = u.useRef(""), te = u.useRef(""), Ae = Ne(), Ee = Ne(), Fe = Vt(), fe = F != null, N = ot(E), J = V((S = N) => S ? Yt(S, st()) : []), ce = V((S) => {
|
|
257
|
+
const O = J(S);
|
|
258
|
+
return W.current.map(() => O).filter(Boolean).flat();
|
|
259
|
+
});
|
|
260
|
+
u.useEffect(() => {
|
|
261
|
+
if (o || !i)
|
|
262
|
+
return;
|
|
263
|
+
function S(j) {
|
|
264
|
+
j.key === "Tab" && $(N, xe(oe(N))) && J().length === 0 && !B && co(j);
|
|
265
|
+
}
|
|
266
|
+
const O = oe(N);
|
|
267
|
+
return O.addEventListener("keydown", S), () => {
|
|
268
|
+
O.removeEventListener("keydown", S);
|
|
269
|
+
};
|
|
270
|
+
}, [o, y, N, i, W, B, J, ce]), u.useEffect(() => {
|
|
271
|
+
if (o || !E)
|
|
272
|
+
return;
|
|
273
|
+
function S(O) {
|
|
274
|
+
const j = re(O), z = J().indexOf(j);
|
|
275
|
+
z !== -1 && (Pe.current = z);
|
|
276
|
+
}
|
|
277
|
+
return E.addEventListener("focusin", S), () => {
|
|
278
|
+
E.removeEventListener("focusin", S);
|
|
279
|
+
};
|
|
280
|
+
}, [o, E, J]), u.useEffect(() => {
|
|
281
|
+
if (o || !T)
|
|
282
|
+
return;
|
|
283
|
+
const S = oe(N);
|
|
284
|
+
function O() {
|
|
285
|
+
me.current = !1;
|
|
286
|
+
}
|
|
287
|
+
function j(z) {
|
|
288
|
+
const v = re(z), M = $(E, v) || $(y, v) || $(F?.portalNode, v);
|
|
289
|
+
me.current = !M, te.current = z.pointerType || "keyboard";
|
|
290
|
+
}
|
|
291
|
+
function L() {
|
|
292
|
+
te.current = "keyboard";
|
|
293
|
+
}
|
|
294
|
+
return S.addEventListener("pointerdown", j, !0), S.addEventListener("pointerup", O, !0), S.addEventListener("pointercancel", O, !0), S.addEventListener("keydown", L, !0), () => {
|
|
295
|
+
S.removeEventListener("pointerdown", j, !0), S.removeEventListener("pointerup", O, !0), S.removeEventListener("pointercancel", O, !0), S.removeEventListener("keydown", L, !0);
|
|
296
|
+
};
|
|
297
|
+
}, [o, E, y, N, T, F]), u.useEffect(() => {
|
|
298
|
+
if (o || !c)
|
|
299
|
+
return;
|
|
300
|
+
function S() {
|
|
301
|
+
ie.current = !0, Ee.start(0, () => {
|
|
302
|
+
ie.current = !1;
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function O(v) {
|
|
306
|
+
const M = v.relatedTarget, le = v.currentTarget, X = re(v);
|
|
307
|
+
queueMicrotask(() => {
|
|
308
|
+
const ye = w(), _e = C.context.triggerElements, Ye = !($(y, M) || $(E, M) || $(M, E) || $(F?.portalNode, M) || M != null && _e.hasElement(M) || _e.hasMatchingElement((Q) => $(Q, M)) || M?.hasAttribute(rt("focus-guard")) || G && (Se(G.nodesRef.current, ye).find((Q) => $(Q.context?.elements.floating, M) || $(Q.context?.elements.domReference, M)) || bt(G.nodesRef.current, ye).find((Q) => [Q.context?.elements.floating, ot(Q.context?.elements.floating)].includes(M) || Q.context?.elements.domReference === M)));
|
|
309
|
+
if (le === y && N && wt(N, W), l && le !== y && !ko(X) && xe(oe(N)) === oe(N).body) {
|
|
310
|
+
if (ve(N) && (N.focus(), l === "popup")) {
|
|
311
|
+
Fe.request(() => {
|
|
312
|
+
N.focus();
|
|
313
|
+
});
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const Q = Pe.current, we = J(), Le = we[Q] || we[we.length - 1] || N;
|
|
317
|
+
ve(Le) && Le.focus();
|
|
318
|
+
}
|
|
319
|
+
if (k.current.insideReactTree) {
|
|
320
|
+
k.current.insideReactTree = !1;
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
(B || !i) && M && Ye && !ie.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
324
|
+
// For an "untrapped" typeable combobox (input role=combobox with
|
|
325
|
+
// initialFocus=false), re-opening the popup and tabbing out should still close it even
|
|
326
|
+
// when the previously focused element (e.g. the next tabbable outside the popup) is
|
|
327
|
+
// focused again. Otherwise, the popup remains open on the second Tab sequence:
|
|
328
|
+
// click input -> Tab (closes) -> click input -> Tab.
|
|
329
|
+
// Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.
|
|
330
|
+
(B || M !== Ze()) && (U.current = !0, C.setOpen(!1, se(Bn, v)));
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
function j() {
|
|
334
|
+
me.current || (k.current.insideReactTree = !0, Ae.start(0, () => {
|
|
335
|
+
k.current.insideReactTree = !1;
|
|
336
|
+
}));
|
|
337
|
+
}
|
|
338
|
+
const L = ve(y) ? y : null, z = [];
|
|
339
|
+
if (!(!E && !L))
|
|
340
|
+
return L && (L.addEventListener("focusout", O), L.addEventListener("pointerdown", S), z.push(() => {
|
|
341
|
+
L.removeEventListener("focusout", O), L.removeEventListener("pointerdown", S);
|
|
342
|
+
})), E && (E.addEventListener("focusout", O), F && (E.addEventListener("focusout", j, !0), z.push(() => {
|
|
343
|
+
E.removeEventListener("focusout", j, !0);
|
|
344
|
+
})), z.push(() => {
|
|
345
|
+
E.removeEventListener("focusout", O);
|
|
346
|
+
})), () => {
|
|
347
|
+
z.forEach((v) => {
|
|
348
|
+
v();
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
}, [o, y, E, N, i, G, F, C, c, l, J, B, w, W, k, Ae, Ee, Fe]);
|
|
352
|
+
const d = u.useRef(null), P = u.useRef(null), R = pt(d, g, F?.beforeInsideRef), Y = pt(P, F?.afterInsideRef);
|
|
353
|
+
u.useEffect(() => {
|
|
354
|
+
if (o || !E || !T)
|
|
355
|
+
return;
|
|
356
|
+
const S = Array.from(F?.portalNode?.querySelectorAll(`[${rt("portal")}]`) || []), j = (G ? bt(G.nodesRef.current, w()) : []).find((v) => mt(v.context?.elements.domReference || null))?.context?.elements.domReference, L = [E, j, ...S, ...D(), ae.current, Ge.current, d.current, P.current, F?.beforeOutsideRef.current, F?.afterOutsideRef.current, be(m), be(p), B ? y : null].filter((v) => v != null), z = Oo(L, i || B);
|
|
357
|
+
return () => {
|
|
358
|
+
z();
|
|
359
|
+
};
|
|
360
|
+
}, [T, o, y, E, i, W, F, B, G, w, D, p, m]), Z(() => {
|
|
361
|
+
if (!T || o || !ve(N))
|
|
362
|
+
return;
|
|
363
|
+
const S = oe(N), O = xe(S);
|
|
364
|
+
queueMicrotask(() => {
|
|
365
|
+
const j = ce(N), L = H.current, z = typeof L == "function" ? L(Oe.current || "") : L;
|
|
366
|
+
if (z === void 0 || z === !1)
|
|
367
|
+
return;
|
|
368
|
+
let v;
|
|
369
|
+
z === !0 || z === null ? v = j[0] || N : v = be(z), v = v || j[0] || N, !$(N, O) && Je(v, {
|
|
370
|
+
preventScroll: v === N
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
}, [o, T, N, I, ce, H, Oe]), Z(() => {
|
|
374
|
+
if (o || !N)
|
|
375
|
+
return;
|
|
376
|
+
const S = oe(N), O = xe(S);
|
|
377
|
+
xo(O);
|
|
378
|
+
function j(v) {
|
|
379
|
+
if (v.open || (he.current = wo(v.nativeEvent, te.current)), v.reason === Vn && v.nativeEvent.type === "mouseleave" && (U.current = !0), v.reason === Bt)
|
|
380
|
+
if (v.nested)
|
|
381
|
+
U.current = !1;
|
|
382
|
+
else if (ao(v.nativeEvent) || lo(v.nativeEvent))
|
|
383
|
+
U.current = !1;
|
|
384
|
+
else {
|
|
385
|
+
let M = !1;
|
|
386
|
+
document.createElement("div").focus({
|
|
387
|
+
get preventScroll() {
|
|
388
|
+
return M = !0, !1;
|
|
389
|
+
}
|
|
390
|
+
}), M ? U.current = !1 : U.current = !0;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
x.on("openchange", j);
|
|
394
|
+
const L = S.createElement("span");
|
|
395
|
+
L.setAttribute("tabindex", "-1"), L.setAttribute("aria-hidden", "true"), Object.assign(L.style, Xn), fe && y && y.insertAdjacentElement("afterend", L);
|
|
396
|
+
function z() {
|
|
397
|
+
const v = q.current;
|
|
398
|
+
let M = typeof v == "function" ? v(he.current) : v;
|
|
399
|
+
if (M === void 0 || M === !1)
|
|
400
|
+
return null;
|
|
401
|
+
if (M === null && (M = !0), typeof M == "boolean") {
|
|
402
|
+
const X = y || Ze();
|
|
403
|
+
return X && X.isConnected ? X : L;
|
|
404
|
+
}
|
|
405
|
+
const le = y || Ze() || L;
|
|
406
|
+
return be(M) || le;
|
|
407
|
+
}
|
|
408
|
+
return () => {
|
|
409
|
+
x.off("openchange", j);
|
|
410
|
+
const v = xe(S), M = $(E, v) || G && Se(G.nodesRef.current, w(), !1).some((X) => $(X.context?.elements.floating, v)), le = z();
|
|
411
|
+
queueMicrotask(() => {
|
|
412
|
+
const X = Do(le), ye = typeof q.current != "boolean";
|
|
413
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
414
|
+
q.current && !U.current && ve(X) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
415
|
+
// since it likely entered a different element which should be
|
|
416
|
+
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
417
|
+
(!(!ye && X !== v && v !== S.body) || M) && X.focus({
|
|
418
|
+
preventScroll: !0
|
|
419
|
+
}), L.remove();
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
}, [o, E, N, q, k, x, G, fe, y, w]), u.useEffect(() => {
|
|
423
|
+
queueMicrotask(() => {
|
|
424
|
+
U.current = !1;
|
|
425
|
+
});
|
|
426
|
+
}, [o]), u.useEffect(() => {
|
|
427
|
+
if (o || !T)
|
|
428
|
+
return;
|
|
429
|
+
function S(j) {
|
|
430
|
+
re(j)?.closest(`[${Xt}]`) && (ie.current = !0);
|
|
431
|
+
}
|
|
432
|
+
const O = oe(N);
|
|
433
|
+
return O.addEventListener("pointerdown", S, !0), () => {
|
|
434
|
+
O.removeEventListener("pointerdown", S, !0);
|
|
435
|
+
};
|
|
436
|
+
}, [o, T, N]), Z(() => {
|
|
437
|
+
if (!o && F)
|
|
438
|
+
return F.setFocusManagerState({
|
|
439
|
+
modal: i,
|
|
440
|
+
closeOnFocusOut: c,
|
|
441
|
+
open: T,
|
|
442
|
+
onOpenChange: C.setOpen,
|
|
443
|
+
domReference: y
|
|
444
|
+
}), () => {
|
|
445
|
+
F.setFocusManagerState(null);
|
|
446
|
+
};
|
|
447
|
+
}, [o, F, i, T, C, c, y]), Z(() => {
|
|
448
|
+
if (!(o || !N))
|
|
449
|
+
return wt(N, W), () => {
|
|
450
|
+
queueMicrotask(at);
|
|
451
|
+
};
|
|
452
|
+
}, [o, N, W]);
|
|
453
|
+
const A = !o && (i ? !B : !0) && (fe || i);
|
|
454
|
+
return /* @__PURE__ */ At(u.Fragment, {
|
|
455
|
+
children: [A && /* @__PURE__ */ K(ht, {
|
|
456
|
+
"data-type": "inside",
|
|
457
|
+
ref: R,
|
|
458
|
+
onFocus: (S) => {
|
|
459
|
+
if (i) {
|
|
460
|
+
const O = ce();
|
|
461
|
+
Je(O[O.length - 1]);
|
|
462
|
+
} else F?.portalNode && (U.current = !1, Et(S, F.portalNode) ? Jn(y)?.focus() : be(m ?? F.beforeOutsideRef)?.focus());
|
|
463
|
+
}
|
|
464
|
+
}), n, A && /* @__PURE__ */ K(ht, {
|
|
465
|
+
"data-type": "inside",
|
|
466
|
+
ref: Y,
|
|
467
|
+
onFocus: (S) => {
|
|
468
|
+
i ? Je(ce()[0]) : F?.portalNode && (c && (U.current = !0), Et(S, F.portalNode) ? Qn(y)?.focus() : be(p ?? F.afterOutsideRef)?.focus());
|
|
469
|
+
}
|
|
470
|
+
})]
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
function No(e, t = {}) {
|
|
474
|
+
const n = "rootStore" in e ? e.rootStore : e, o = n.context.dataRef, {
|
|
475
|
+
enabled: r = !0,
|
|
476
|
+
event: s = "click",
|
|
477
|
+
toggle: a = !0,
|
|
478
|
+
ignoreMouse: l = !1,
|
|
479
|
+
stickIfOpen: i = !0,
|
|
480
|
+
touchOpenDelay: c = 0
|
|
481
|
+
} = t, f = u.useRef(void 0), h = Vt(), p = Ne(), m = u.useMemo(() => ({
|
|
482
|
+
onPointerDown(g) {
|
|
483
|
+
f.current = g.pointerType;
|
|
484
|
+
},
|
|
485
|
+
onMouseDown(g) {
|
|
486
|
+
const b = f.current, C = g.nativeEvent, T = n.select("open");
|
|
487
|
+
if (g.button !== 0 || s === "click" || yt(b) && l)
|
|
488
|
+
return;
|
|
489
|
+
const y = o.current.openEvent, E = y?.type, x = n.select("domReferenceElement") !== g.currentTarget, k = T && x || !(T && a && (!(y && i) || E === "click" || E === "mousedown"));
|
|
490
|
+
if (eo(C.target)) {
|
|
491
|
+
const D = se(De, C, C.target);
|
|
492
|
+
k && b === "touch" && c > 0 ? p.start(c, () => {
|
|
493
|
+
n.setOpen(!0, D);
|
|
494
|
+
}) : n.setOpen(k, D);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
const w = g.currentTarget;
|
|
498
|
+
h.request(() => {
|
|
499
|
+
const D = se(De, C, w);
|
|
500
|
+
k && b === "touch" && c > 0 ? p.start(c, () => {
|
|
501
|
+
n.setOpen(!0, D);
|
|
502
|
+
}) : n.setOpen(k, D);
|
|
503
|
+
});
|
|
504
|
+
},
|
|
505
|
+
onClick(g) {
|
|
506
|
+
if (s === "mousedown-only")
|
|
507
|
+
return;
|
|
508
|
+
const b = f.current;
|
|
509
|
+
if (s === "mousedown" && b) {
|
|
510
|
+
f.current = void 0;
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (yt(b) && l)
|
|
514
|
+
return;
|
|
515
|
+
const C = n.select("open"), T = o.current.openEvent, y = n.select("domReferenceElement") !== g.currentTarget, E = C && y || !(C && a && (!(T && i) || en(T))), x = se(De, g.nativeEvent, g.currentTarget);
|
|
516
|
+
E && b === "touch" && c > 0 ? p.start(c, () => {
|
|
517
|
+
n.setOpen(!0, x);
|
|
518
|
+
}) : n.setOpen(E, x);
|
|
519
|
+
},
|
|
520
|
+
onKeyDown() {
|
|
521
|
+
f.current = void 0;
|
|
522
|
+
}
|
|
523
|
+
}), [o, s, l, n, i, a, h, p, c]);
|
|
524
|
+
return u.useMemo(() => r ? {
|
|
525
|
+
reference: m
|
|
526
|
+
} : ke, [r, m]);
|
|
527
|
+
}
|
|
528
|
+
const Mo = {
|
|
529
|
+
intentional: "onClick",
|
|
530
|
+
sloppy: "onPointerDown"
|
|
531
|
+
};
|
|
532
|
+
function Po(e) {
|
|
533
|
+
return {
|
|
534
|
+
escapeKey: typeof e == "boolean" ? e : e?.escapeKey ?? !1,
|
|
535
|
+
outsidePress: typeof e == "boolean" ? e : e?.outsidePress ?? !0
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
function Ao(e, t = {}) {
|
|
539
|
+
const n = "rootStore" in e ? e.rootStore : e, o = n.useState("open"), r = n.useState("floatingElement"), s = n.useState("referenceElement"), a = n.useState("domReferenceElement"), {
|
|
540
|
+
onOpenChange: l,
|
|
541
|
+
dataRef: i
|
|
542
|
+
} = n.context, {
|
|
543
|
+
enabled: c = !0,
|
|
544
|
+
escapeKey: f = !0,
|
|
545
|
+
outsidePress: h = !0,
|
|
546
|
+
outsidePressEvent: p = "sloppy",
|
|
547
|
+
referencePress: m = !1,
|
|
548
|
+
referencePressEvent: g = "sloppy",
|
|
549
|
+
ancestorScroll: b = !1,
|
|
550
|
+
bubbles: C,
|
|
551
|
+
externalTree: T
|
|
552
|
+
} = t, y = sn(T), E = V(typeof h == "function" ? h : () => !1), x = typeof h == "function" ? E : h, k = u.useRef(!1), {
|
|
553
|
+
escapeKey: w,
|
|
554
|
+
outsidePress: D
|
|
555
|
+
} = Po(C), I = u.useRef(null), B = Ne(), W = Ne(), H = V(() => {
|
|
556
|
+
W.clear(), i.current.insideReactTree = !1;
|
|
557
|
+
}), q = u.useRef(!1), Oe = u.useRef(""), G = V((d) => {
|
|
558
|
+
Oe.current = d.pointerType;
|
|
559
|
+
}), F = V(() => {
|
|
560
|
+
const d = Oe.current, P = d === "pen" || !d ? "mouse" : d, R = typeof p == "function" ? p() : p;
|
|
561
|
+
return typeof R == "string" ? R : R[P];
|
|
562
|
+
}), ae = V((d) => {
|
|
563
|
+
if (!o || !c || !f || d.key !== "Escape" || q.current)
|
|
564
|
+
return;
|
|
565
|
+
const P = i.current.floatingContext?.nodeId, R = y ? Se(y.nodesRef.current, P) : [];
|
|
566
|
+
if (!w && R.length > 0) {
|
|
567
|
+
let S = !0;
|
|
568
|
+
if (R.forEach((O) => {
|
|
569
|
+
O.context?.open && !O.context.dataRef.current.__escapeKeyBubbles && (S = !1);
|
|
570
|
+
}), !S)
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
const Y = uo(d) ? d.nativeEvent : d, A = se(Wn, Y);
|
|
574
|
+
n.setOpen(!1, A), !w && !A.isPropagationAllowed && d.stopPropagation();
|
|
575
|
+
}), Ge = V((d) => {
|
|
576
|
+
const P = F();
|
|
577
|
+
return P === "intentional" && d.type !== "click" || P === "sloppy" && d.type === "click";
|
|
578
|
+
}), U = V(() => {
|
|
579
|
+
i.current.insideReactTree = !0, W.start(0, H);
|
|
580
|
+
}), ie = V((d, P = !1) => {
|
|
581
|
+
if (Ge(d)) {
|
|
582
|
+
H();
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (i.current.insideReactTree) {
|
|
586
|
+
H();
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (F() === "intentional" && P || typeof x == "function" && !x(d))
|
|
590
|
+
return;
|
|
591
|
+
const R = re(d), Y = `[${rt("inert")}]`, A = oe(n.select("floatingElement")).querySelectorAll(Y), S = n.context.triggerElements;
|
|
592
|
+
if (R && (S.hasElement(R) || S.hasMatchingElement((v) => $(v, R))))
|
|
593
|
+
return;
|
|
594
|
+
let O = pe(R) ? R : null;
|
|
595
|
+
for (; O && !qe(O); ) {
|
|
596
|
+
const v = $n(O);
|
|
597
|
+
if (qe(v) || !pe(v))
|
|
598
|
+
break;
|
|
599
|
+
O = v;
|
|
600
|
+
}
|
|
601
|
+
if (A.length && pe(R) && !to(R) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
602
|
+
!$(R, n.select("floatingElement")) && // If the target root element contains none of the markers, then the
|
|
603
|
+
// element was injected after the floating element rendered.
|
|
604
|
+
Array.from(A).every((v) => !$(O, v)))
|
|
605
|
+
return;
|
|
606
|
+
if (ve(R) && !("touches" in d)) {
|
|
607
|
+
const v = qe(R), M = Gt(R), le = /auto|scroll/, X = v || le.test(M.overflowX), ye = v || le.test(M.overflowY), _e = X && R.clientWidth > 0 && R.scrollWidth > R.clientWidth, Ye = ye && R.clientHeight > 0 && R.scrollHeight > R.clientHeight, Q = M.direction === "rtl", we = Ye && (Q ? d.offsetX <= R.offsetWidth - R.clientWidth : d.offsetX > R.clientWidth), Le = _e && d.offsetY > R.clientHeight;
|
|
608
|
+
if (we || Le)
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
const j = i.current.floatingContext?.nodeId, L = y && Se(y.nodesRef.current, j).some((v) => ne(d, v.context?.elements.floating));
|
|
612
|
+
if (ne(d, n.select("floatingElement")) || ne(d, n.select("domReferenceElement")) || L)
|
|
613
|
+
return;
|
|
614
|
+
const z = y ? Se(y.nodesRef.current, j) : [];
|
|
615
|
+
if (z.length > 0) {
|
|
616
|
+
let v = !0;
|
|
617
|
+
if (z.forEach((M) => {
|
|
618
|
+
M.context?.open && !M.context.dataRef.current.__outsidePressBubbles && (v = !1);
|
|
619
|
+
}), !v)
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
n.setOpen(!1, se(Bt, d)), H();
|
|
623
|
+
}), me = V((d) => {
|
|
624
|
+
F() !== "sloppy" || d.pointerType === "touch" || !n.select("open") || !c || ne(d, n.select("floatingElement")) || ne(d, n.select("domReferenceElement")) || ie(d);
|
|
625
|
+
}), Pe = V((d) => {
|
|
626
|
+
if (F() !== "sloppy" || !n.select("open") || !c || ne(d, n.select("floatingElement")) || ne(d, n.select("domReferenceElement")))
|
|
627
|
+
return;
|
|
628
|
+
const P = d.touches[0];
|
|
629
|
+
P && (I.current = {
|
|
630
|
+
startTime: Date.now(),
|
|
631
|
+
startX: P.clientX,
|
|
632
|
+
startY: P.clientY,
|
|
633
|
+
dismissOnTouchEnd: !1,
|
|
634
|
+
dismissOnMouseDown: !0
|
|
635
|
+
}, B.start(1e3, () => {
|
|
636
|
+
I.current && (I.current.dismissOnTouchEnd = !1, I.current.dismissOnMouseDown = !1);
|
|
637
|
+
}));
|
|
638
|
+
}), he = V((d) => {
|
|
639
|
+
const P = re(d);
|
|
640
|
+
function R() {
|
|
641
|
+
Pe(d), P?.removeEventListener(d.type, R);
|
|
642
|
+
}
|
|
643
|
+
P?.addEventListener(d.type, R);
|
|
644
|
+
}), te = V((d) => {
|
|
645
|
+
const P = k.current;
|
|
646
|
+
if (k.current = !1, B.clear(), d.type === "mousedown" && I.current && !I.current.dismissOnMouseDown)
|
|
647
|
+
return;
|
|
648
|
+
const R = re(d);
|
|
649
|
+
function Y() {
|
|
650
|
+
d.type === "pointerdown" ? me(d) : ie(d, P), R?.removeEventListener(d.type, Y);
|
|
651
|
+
}
|
|
652
|
+
R?.addEventListener(d.type, Y);
|
|
653
|
+
}), Ae = V((d) => {
|
|
654
|
+
if (F() !== "sloppy" || !I.current || ne(d, n.select("floatingElement")) || ne(d, n.select("domReferenceElement")))
|
|
655
|
+
return;
|
|
656
|
+
const P = d.touches[0];
|
|
657
|
+
if (!P)
|
|
658
|
+
return;
|
|
659
|
+
const R = Math.abs(P.clientX - I.current.startX), Y = Math.abs(P.clientY - I.current.startY), A = Math.sqrt(R * R + Y * Y);
|
|
660
|
+
A > 5 && (I.current.dismissOnTouchEnd = !0), A > 10 && (ie(d), B.clear(), I.current = null);
|
|
661
|
+
}), Ee = V((d) => {
|
|
662
|
+
const P = re(d);
|
|
663
|
+
function R() {
|
|
664
|
+
Ae(d), P?.removeEventListener(d.type, R);
|
|
665
|
+
}
|
|
666
|
+
P?.addEventListener(d.type, R);
|
|
667
|
+
}), Fe = V((d) => {
|
|
668
|
+
F() !== "sloppy" || !I.current || ne(d, n.select("floatingElement")) || ne(d, n.select("domReferenceElement")) || (I.current.dismissOnTouchEnd && ie(d), B.clear(), I.current = null);
|
|
669
|
+
}), fe = V((d) => {
|
|
670
|
+
const P = re(d);
|
|
671
|
+
function R() {
|
|
672
|
+
Fe(d), P?.removeEventListener(d.type, R);
|
|
673
|
+
}
|
|
674
|
+
P?.addEventListener(d.type, R);
|
|
675
|
+
});
|
|
676
|
+
u.useEffect(() => {
|
|
677
|
+
if (!o || !c)
|
|
678
|
+
return;
|
|
679
|
+
i.current.__escapeKeyBubbles = w, i.current.__outsidePressBubbles = D;
|
|
680
|
+
const d = new nt();
|
|
681
|
+
function P(O) {
|
|
682
|
+
n.setOpen(!1, se(jn, O));
|
|
683
|
+
}
|
|
684
|
+
function R() {
|
|
685
|
+
d.clear(), q.current = !0;
|
|
686
|
+
}
|
|
687
|
+
function Y() {
|
|
688
|
+
d.start(
|
|
689
|
+
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
|
|
690
|
+
// Only apply to WebKit for the test to remain 0ms.
|
|
691
|
+
Un() ? 5 : 0,
|
|
692
|
+
() => {
|
|
693
|
+
q.current = !1;
|
|
694
|
+
}
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
const A = oe(r);
|
|
698
|
+
A.addEventListener("pointerdown", G, !0), f && (A.addEventListener("keydown", ae), A.addEventListener("compositionstart", R), A.addEventListener("compositionend", Y)), x && (A.addEventListener("click", te, !0), A.addEventListener("pointerdown", te, !0), A.addEventListener("touchstart", he, !0), A.addEventListener("touchmove", Ee, !0), A.addEventListener("touchend", fe, !0), A.addEventListener("mousedown", te, !0));
|
|
699
|
+
let S = [];
|
|
700
|
+
return b && (pe(a) && (S = Xe(a)), pe(r) && (S = S.concat(Xe(r))), !pe(s) && s && s.contextElement && (S = S.concat(Xe(s.contextElement)))), S = S.filter((O) => O !== A.defaultView?.visualViewport), S.forEach((O) => {
|
|
701
|
+
O.addEventListener("scroll", P, {
|
|
702
|
+
passive: !0
|
|
703
|
+
});
|
|
704
|
+
}), () => {
|
|
705
|
+
A.removeEventListener("pointerdown", G, !0), f && (A.removeEventListener("keydown", ae), A.removeEventListener("compositionstart", R), A.removeEventListener("compositionend", Y)), x && (A.removeEventListener("click", te, !0), A.removeEventListener("pointerdown", te, !0), A.removeEventListener("touchstart", he, !0), A.removeEventListener("touchmove", Ee, !0), A.removeEventListener("touchend", fe, !0), A.removeEventListener("mousedown", te, !0)), S.forEach((O) => {
|
|
706
|
+
O.removeEventListener("scroll", P);
|
|
707
|
+
}), d.clear();
|
|
708
|
+
};
|
|
709
|
+
}, [i, r, s, a, f, x, o, l, b, c, w, D, ae, ie, te, me, he, Ee, fe, G, n]), u.useEffect(H, [x, H]);
|
|
710
|
+
const N = u.useMemo(() => ({
|
|
711
|
+
onKeyDown: ae,
|
|
712
|
+
...m && {
|
|
713
|
+
[Mo[g]]: (d) => {
|
|
714
|
+
n.setOpen(!1, se(De, d.nativeEvent));
|
|
27
715
|
},
|
|
28
|
-
|
|
716
|
+
...g !== "intentional" && {
|
|
717
|
+
onClick(d) {
|
|
718
|
+
n.setOpen(!1, se(De, d.nativeEvent));
|
|
719
|
+
}
|
|
720
|
+
}
|
|
29
721
|
}
|
|
30
|
-
)
|
|
722
|
+
}), [ae, n, m, g]), J = V((d) => {
|
|
723
|
+
const P = re(d.nativeEvent);
|
|
724
|
+
!$(n.select("floatingElement"), P) || d.button !== 0 || (k.current = !0);
|
|
725
|
+
}), ce = u.useMemo(() => ({
|
|
726
|
+
onKeyDown: ae,
|
|
727
|
+
// `onMouseDown` may be blocked if `event.preventDefault()` is called in
|
|
728
|
+
// `onPointerDown`, such as with <NumberField.ScrubArea>.
|
|
729
|
+
// See https://github.com/mui/base-ui/pull/3379
|
|
730
|
+
onPointerDown: J,
|
|
731
|
+
onMouseDown: J,
|
|
732
|
+
onMouseUp: J,
|
|
733
|
+
onClickCapture: U,
|
|
734
|
+
onMouseDownCapture: U,
|
|
735
|
+
onPointerDownCapture: U,
|
|
736
|
+
onMouseUpCapture: U,
|
|
737
|
+
onTouchEndCapture: U,
|
|
738
|
+
onTouchMoveCapture: U
|
|
739
|
+
}), [ae, J, U]);
|
|
740
|
+
return u.useMemo(() => c ? {
|
|
741
|
+
reference: N,
|
|
742
|
+
floating: ce,
|
|
743
|
+
trigger: N
|
|
744
|
+
} : {}, [c, N, ce]);
|
|
745
|
+
}
|
|
746
|
+
var Fo = (e, t, n) => {
|
|
747
|
+
if (t.length === 1 && t[0] === n) {
|
|
748
|
+
let o = !1;
|
|
749
|
+
try {
|
|
750
|
+
const r = {};
|
|
751
|
+
e(r) === r && (o = !0);
|
|
752
|
+
} catch {
|
|
753
|
+
}
|
|
754
|
+
if (o) {
|
|
755
|
+
let r;
|
|
756
|
+
try {
|
|
757
|
+
throw new Error();
|
|
758
|
+
} catch (s) {
|
|
759
|
+
({ stack: r } = s);
|
|
760
|
+
}
|
|
761
|
+
console.warn(
|
|
762
|
+
`The result function returned its own inputs without modification. e.g
|
|
763
|
+
\`createSelector([state => state.todos], todos => todos)\`
|
|
764
|
+
This could lead to inefficient memoization and unnecessary re-renders.
|
|
765
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,
|
|
766
|
+
{ stack: r }
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}, _o = (e, t, n) => {
|
|
771
|
+
const { memoize: o, memoizeOptions: r } = t, { inputSelectorResults: s, inputSelectorResultsCopy: a } = e, l = o(() => ({}), ...r);
|
|
772
|
+
if (!(l.apply(null, s) === l.apply(null, a))) {
|
|
773
|
+
let c;
|
|
774
|
+
try {
|
|
775
|
+
throw new Error();
|
|
776
|
+
} catch (f) {
|
|
777
|
+
({ stack: c } = f);
|
|
778
|
+
}
|
|
779
|
+
console.warn(
|
|
780
|
+
`An input selector returned a different result when passed same arguments.
|
|
781
|
+
This means your output selector will likely run more frequently than intended.
|
|
782
|
+
Avoid returning a new reference inside your input selector, e.g.
|
|
783
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,
|
|
784
|
+
{
|
|
785
|
+
arguments: n,
|
|
786
|
+
firstInputs: s,
|
|
787
|
+
secondInputs: a,
|
|
788
|
+
stack: c
|
|
789
|
+
}
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
}, Lo = {
|
|
793
|
+
inputStabilityCheck: "once",
|
|
794
|
+
identityFunctionCheck: "once"
|
|
795
|
+
}, He = /* @__PURE__ */ Symbol("NOT_FOUND");
|
|
796
|
+
function Vo(e, t = `expected a function, instead received ${typeof e}`) {
|
|
797
|
+
if (typeof e != "function")
|
|
798
|
+
throw new TypeError(t);
|
|
799
|
+
}
|
|
800
|
+
function Bo(e, t = `expected an object, instead received ${typeof e}`) {
|
|
801
|
+
if (typeof e != "object")
|
|
802
|
+
throw new TypeError(t);
|
|
803
|
+
}
|
|
804
|
+
function Wo(e, t = "expected all items to be functions, instead received the following types: ") {
|
|
805
|
+
if (!e.every((n) => typeof n == "function")) {
|
|
806
|
+
const n = e.map(
|
|
807
|
+
(o) => typeof o == "function" ? `function ${o.name || "unnamed"}()` : typeof o
|
|
808
|
+
).join(", ");
|
|
809
|
+
throw new TypeError(`${t}[${n}]`);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
var xt = (e) => Array.isArray(e) ? e : [e];
|
|
813
|
+
function jo(e) {
|
|
814
|
+
const t = Array.isArray(e[0]) ? e[0] : e;
|
|
815
|
+
return Wo(
|
|
816
|
+
t,
|
|
817
|
+
"createSelector expects all input-selectors to be functions, but received the following types: "
|
|
818
|
+
), t;
|
|
819
|
+
}
|
|
820
|
+
function Dt(e, t) {
|
|
821
|
+
const n = [], { length: o } = e;
|
|
822
|
+
for (let r = 0; r < o; r++)
|
|
823
|
+
n.push(e[r].apply(null, t));
|
|
824
|
+
return n;
|
|
825
|
+
}
|
|
826
|
+
var zo = (e, t) => {
|
|
827
|
+
const { identityFunctionCheck: n, inputStabilityCheck: o } = {
|
|
828
|
+
...Lo,
|
|
829
|
+
...t
|
|
830
|
+
};
|
|
831
|
+
return {
|
|
832
|
+
identityFunctionCheck: {
|
|
833
|
+
shouldRun: n === "always" || n === "once" && e,
|
|
834
|
+
run: Fo
|
|
835
|
+
},
|
|
836
|
+
inputStabilityCheck: {
|
|
837
|
+
shouldRun: o === "always" || o === "once" && e,
|
|
838
|
+
run: _o
|
|
839
|
+
}
|
|
840
|
+
};
|
|
31
841
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
842
|
+
function Ko(e) {
|
|
843
|
+
let t;
|
|
844
|
+
return {
|
|
845
|
+
get(n) {
|
|
846
|
+
return t && e(t.key, n) ? t.value : He;
|
|
847
|
+
},
|
|
848
|
+
put(n, o) {
|
|
849
|
+
t = { key: n, value: o };
|
|
850
|
+
},
|
|
851
|
+
getEntries() {
|
|
852
|
+
return t ? [t] : [];
|
|
853
|
+
},
|
|
854
|
+
clear() {
|
|
855
|
+
t = void 0;
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
function Ho(e, t) {
|
|
860
|
+
let n = [];
|
|
861
|
+
function o(l) {
|
|
862
|
+
const i = n.findIndex((c) => t(l, c.key));
|
|
863
|
+
if (i > -1) {
|
|
864
|
+
const c = n[i];
|
|
865
|
+
return i > 0 && (n.splice(i, 1), n.unshift(c)), c.value;
|
|
866
|
+
}
|
|
867
|
+
return He;
|
|
36
868
|
}
|
|
37
|
-
|
|
869
|
+
function r(l, i) {
|
|
870
|
+
o(l) === He && (n.unshift({ key: l, value: i }), n.length > e && n.pop());
|
|
871
|
+
}
|
|
872
|
+
function s() {
|
|
873
|
+
return n;
|
|
874
|
+
}
|
|
875
|
+
function a() {
|
|
876
|
+
n = [];
|
|
877
|
+
}
|
|
878
|
+
return { get: o, put: r, getEntries: s, clear: a };
|
|
879
|
+
}
|
|
880
|
+
var $o = (e, t) => e === t;
|
|
881
|
+
function Uo(e) {
|
|
882
|
+
return function(n, o) {
|
|
883
|
+
if (n === null || o === null || n.length !== o.length)
|
|
884
|
+
return !1;
|
|
885
|
+
const { length: r } = n;
|
|
886
|
+
for (let s = 0; s < r; s++)
|
|
887
|
+
if (!e(n[s], o[s]))
|
|
888
|
+
return !1;
|
|
889
|
+
return !0;
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
function Go(e, t) {
|
|
893
|
+
const n = typeof t == "object" ? t : { equalityCheck: t }, {
|
|
894
|
+
equalityCheck: o = $o,
|
|
895
|
+
maxSize: r = 1,
|
|
896
|
+
resultEqualityCheck: s
|
|
897
|
+
} = n, a = Uo(o);
|
|
898
|
+
let l = 0;
|
|
899
|
+
const i = r <= 1 ? Ko(a) : Ho(r, a);
|
|
900
|
+
function c() {
|
|
901
|
+
let f = i.get(arguments);
|
|
902
|
+
if (f === He) {
|
|
903
|
+
if (f = e.apply(null, arguments), l++, s) {
|
|
904
|
+
const p = i.getEntries().find(
|
|
905
|
+
(m) => s(m.value, f)
|
|
906
|
+
);
|
|
907
|
+
p && (f = p.value, l !== 0 && l--);
|
|
908
|
+
}
|
|
909
|
+
i.put(arguments, f);
|
|
910
|
+
}
|
|
911
|
+
return f;
|
|
912
|
+
}
|
|
913
|
+
return c.clearCache = () => {
|
|
914
|
+
i.clear(), c.resetResultsCount();
|
|
915
|
+
}, c.resultsCount = () => l, c.resetResultsCount = () => {
|
|
916
|
+
l = 0;
|
|
917
|
+
}, c;
|
|
918
|
+
}
|
|
919
|
+
var Yo = class {
|
|
920
|
+
constructor(e) {
|
|
921
|
+
this.value = e;
|
|
922
|
+
}
|
|
923
|
+
deref() {
|
|
924
|
+
return this.value;
|
|
925
|
+
}
|
|
926
|
+
}, qo = typeof WeakRef < "u" ? WeakRef : Yo, Xo = 0, kt = 1;
|
|
927
|
+
function je() {
|
|
928
|
+
return {
|
|
929
|
+
s: Xo,
|
|
930
|
+
v: void 0,
|
|
931
|
+
o: null,
|
|
932
|
+
p: null
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
function ln(e, t = {}) {
|
|
936
|
+
let n = je();
|
|
937
|
+
const { resultEqualityCheck: o } = t;
|
|
938
|
+
let r, s = 0;
|
|
939
|
+
function a() {
|
|
940
|
+
let l = n;
|
|
941
|
+
const { length: i } = arguments;
|
|
942
|
+
for (let h = 0, p = i; h < p; h++) {
|
|
943
|
+
const m = arguments[h];
|
|
944
|
+
if (typeof m == "function" || typeof m == "object" && m !== null) {
|
|
945
|
+
let g = l.o;
|
|
946
|
+
g === null && (l.o = g = /* @__PURE__ */ new WeakMap());
|
|
947
|
+
const b = g.get(m);
|
|
948
|
+
b === void 0 ? (l = je(), g.set(m, l)) : l = b;
|
|
949
|
+
} else {
|
|
950
|
+
let g = l.p;
|
|
951
|
+
g === null && (l.p = g = /* @__PURE__ */ new Map());
|
|
952
|
+
const b = g.get(m);
|
|
953
|
+
b === void 0 ? (l = je(), g.set(m, l)) : l = b;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
const c = l;
|
|
957
|
+
let f;
|
|
958
|
+
if (l.s === kt)
|
|
959
|
+
f = l.v;
|
|
960
|
+
else if (f = e.apply(null, arguments), s++, o) {
|
|
961
|
+
const h = r?.deref?.() ?? r;
|
|
962
|
+
h != null && o(h, f) && (f = h, s !== 0 && s--), r = typeof f == "object" && f !== null || typeof f == "function" ? new qo(f) : f;
|
|
963
|
+
}
|
|
964
|
+
return c.s = kt, c.v = f, f;
|
|
965
|
+
}
|
|
966
|
+
return a.clearCache = () => {
|
|
967
|
+
n = je(), a.resetResultsCount();
|
|
968
|
+
}, a.resultsCount = () => s, a.resetResultsCount = () => {
|
|
969
|
+
s = 0;
|
|
970
|
+
}, a;
|
|
971
|
+
}
|
|
972
|
+
function cn(e, ...t) {
|
|
973
|
+
const n = typeof e == "function" ? {
|
|
974
|
+
memoize: e,
|
|
975
|
+
memoizeOptions: t
|
|
976
|
+
} : e, o = (...r) => {
|
|
977
|
+
let s = 0, a = 0, l, i = {}, c = r.pop();
|
|
978
|
+
typeof c == "object" && (i = c, c = r.pop()), Vo(
|
|
979
|
+
c,
|
|
980
|
+
`createSelector expects an output function after the inputs, but received: [${typeof c}]`
|
|
981
|
+
);
|
|
982
|
+
const f = {
|
|
983
|
+
...n,
|
|
984
|
+
...i
|
|
985
|
+
}, {
|
|
986
|
+
memoize: h,
|
|
987
|
+
memoizeOptions: p = [],
|
|
988
|
+
argsMemoize: m = ln,
|
|
989
|
+
argsMemoizeOptions: g = [],
|
|
990
|
+
devModeChecks: b = {}
|
|
991
|
+
} = f, C = xt(p), T = xt(g), y = jo(r), E = h(function() {
|
|
992
|
+
return s++, c.apply(
|
|
993
|
+
null,
|
|
994
|
+
arguments
|
|
995
|
+
);
|
|
996
|
+
}, ...C);
|
|
997
|
+
let x = !0;
|
|
998
|
+
const k = m(function() {
|
|
999
|
+
a++;
|
|
1000
|
+
const D = Dt(
|
|
1001
|
+
y,
|
|
1002
|
+
arguments
|
|
1003
|
+
);
|
|
1004
|
+
if (l = E.apply(null, D), process.env.NODE_ENV !== "production") {
|
|
1005
|
+
const { identityFunctionCheck: I, inputStabilityCheck: B } = zo(x, b);
|
|
1006
|
+
if (I.shouldRun && I.run(
|
|
1007
|
+
c,
|
|
1008
|
+
D,
|
|
1009
|
+
l
|
|
1010
|
+
), B.shouldRun) {
|
|
1011
|
+
const W = Dt(
|
|
1012
|
+
y,
|
|
1013
|
+
arguments
|
|
1014
|
+
);
|
|
1015
|
+
B.run(
|
|
1016
|
+
{ inputSelectorResults: D, inputSelectorResultsCopy: W },
|
|
1017
|
+
{ memoize: h, memoizeOptions: C },
|
|
1018
|
+
arguments
|
|
1019
|
+
);
|
|
1020
|
+
}
|
|
1021
|
+
x && (x = !1);
|
|
1022
|
+
}
|
|
1023
|
+
return l;
|
|
1024
|
+
}, ...T);
|
|
1025
|
+
return Object.assign(k, {
|
|
1026
|
+
resultFunc: c,
|
|
1027
|
+
memoizedResultFunc: E,
|
|
1028
|
+
dependencies: y,
|
|
1029
|
+
dependencyRecomputations: () => a,
|
|
1030
|
+
resetDependencyRecomputations: () => {
|
|
1031
|
+
a = 0;
|
|
1032
|
+
},
|
|
1033
|
+
lastResult: () => l,
|
|
1034
|
+
recomputations: () => s,
|
|
1035
|
+
resetRecomputations: () => {
|
|
1036
|
+
s = 0;
|
|
1037
|
+
},
|
|
1038
|
+
memoize: h,
|
|
1039
|
+
argsMemoize: m
|
|
1040
|
+
});
|
|
1041
|
+
};
|
|
1042
|
+
return Object.assign(o, {
|
|
1043
|
+
withTypes: () => o
|
|
1044
|
+
}), o;
|
|
1045
|
+
}
|
|
1046
|
+
var Jo = /* @__PURE__ */ cn(ln), Qo = Object.assign(
|
|
1047
|
+
(e, t = Jo) => {
|
|
1048
|
+
Bo(
|
|
1049
|
+
e,
|
|
1050
|
+
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`
|
|
1051
|
+
);
|
|
1052
|
+
const n = Object.keys(e), o = n.map(
|
|
1053
|
+
(s) => e[s]
|
|
1054
|
+
);
|
|
1055
|
+
return t(
|
|
1056
|
+
o,
|
|
1057
|
+
(...s) => s.reduce((a, l, i) => (a[n[i]] = l, a), {})
|
|
1058
|
+
);
|
|
1059
|
+
},
|
|
1060
|
+
{ withTypes: () => Qo }
|
|
1061
|
+
);
|
|
1062
|
+
cn({
|
|
1063
|
+
memoize: Go,
|
|
1064
|
+
memoizeOptions: {
|
|
1065
|
+
maxSize: 1,
|
|
1066
|
+
equalityCheck: Object.is
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
const _ = (e, t, n, o, r, s, ...a) => {
|
|
1070
|
+
if (a.length > 0)
|
|
1071
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of selectors" : Me(1));
|
|
1072
|
+
let l;
|
|
1073
|
+
if (e)
|
|
1074
|
+
l = e;
|
|
1075
|
+
else
|
|
1076
|
+
throw new Error("Missing arguments");
|
|
1077
|
+
return l;
|
|
38
1078
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1079
|
+
var ze = { exports: {} }, et = {};
|
|
1080
|
+
/**
|
|
1081
|
+
* @license React
|
|
1082
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
1083
|
+
*
|
|
1084
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1085
|
+
*
|
|
1086
|
+
* This source code is licensed under the MIT license found in the
|
|
1087
|
+
* LICENSE file in the root directory of this source tree.
|
|
1088
|
+
*/
|
|
1089
|
+
var It;
|
|
1090
|
+
function Zo() {
|
|
1091
|
+
if (It) return et;
|
|
1092
|
+
It = 1;
|
|
1093
|
+
var e = Ft, t = Zt();
|
|
1094
|
+
function n(c, f) {
|
|
1095
|
+
return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
|
|
1096
|
+
}
|
|
1097
|
+
var o = typeof Object.is == "function" ? Object.is : n, r = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, l = e.useMemo, i = e.useDebugValue;
|
|
1098
|
+
return et.useSyncExternalStoreWithSelector = function(c, f, h, p, m) {
|
|
1099
|
+
var g = s(null);
|
|
1100
|
+
if (g.current === null) {
|
|
1101
|
+
var b = { hasValue: !1, value: null };
|
|
1102
|
+
g.current = b;
|
|
1103
|
+
} else b = g.current;
|
|
1104
|
+
g = l(
|
|
1105
|
+
function() {
|
|
1106
|
+
function T(w) {
|
|
1107
|
+
if (!y) {
|
|
1108
|
+
if (y = !0, E = w, w = p(w), m !== void 0 && b.hasValue) {
|
|
1109
|
+
var D = b.value;
|
|
1110
|
+
if (m(D, w))
|
|
1111
|
+
return x = D;
|
|
1112
|
+
}
|
|
1113
|
+
return x = w;
|
|
1114
|
+
}
|
|
1115
|
+
if (D = x, o(E, w)) return D;
|
|
1116
|
+
var I = p(w);
|
|
1117
|
+
return m !== void 0 && m(D, I) ? (E = w, D) : (E = w, x = I);
|
|
1118
|
+
}
|
|
1119
|
+
var y = !1, E, x, k = h === void 0 ? null : h;
|
|
1120
|
+
return [
|
|
1121
|
+
function() {
|
|
1122
|
+
return T(f());
|
|
1123
|
+
},
|
|
1124
|
+
k === null ? void 0 : function() {
|
|
1125
|
+
return T(k());
|
|
1126
|
+
}
|
|
1127
|
+
];
|
|
1128
|
+
},
|
|
1129
|
+
[f, h, p, m]
|
|
1130
|
+
);
|
|
1131
|
+
var C = r(c, g[0], g[1]);
|
|
1132
|
+
return a(
|
|
1133
|
+
function() {
|
|
1134
|
+
b.hasValue = !0, b.value = C;
|
|
1135
|
+
},
|
|
1136
|
+
[C]
|
|
1137
|
+
), i(C), C;
|
|
1138
|
+
}, et;
|
|
1139
|
+
}
|
|
1140
|
+
var tt = {};
|
|
1141
|
+
/**
|
|
1142
|
+
* @license React
|
|
1143
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
1144
|
+
*
|
|
1145
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1146
|
+
*
|
|
1147
|
+
* This source code is licensed under the MIT license found in the
|
|
1148
|
+
* LICENSE file in the root directory of this source tree.
|
|
1149
|
+
*/
|
|
1150
|
+
var Nt;
|
|
1151
|
+
function er() {
|
|
1152
|
+
return Nt || (Nt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1153
|
+
function e(c, f) {
|
|
1154
|
+
return c === f && (c !== 0 || 1 / c === 1 / f) || c !== c && f !== f;
|
|
1155
|
+
}
|
|
1156
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1157
|
+
var t = Ft, n = Zt(), o = typeof Object.is == "function" ? Object.is : e, r = n.useSyncExternalStore, s = t.useRef, a = t.useEffect, l = t.useMemo, i = t.useDebugValue;
|
|
1158
|
+
tt.useSyncExternalStoreWithSelector = function(c, f, h, p, m) {
|
|
1159
|
+
var g = s(null);
|
|
1160
|
+
if (g.current === null) {
|
|
1161
|
+
var b = { hasValue: !1, value: null };
|
|
1162
|
+
g.current = b;
|
|
1163
|
+
} else b = g.current;
|
|
1164
|
+
g = l(
|
|
1165
|
+
function() {
|
|
1166
|
+
function T(w) {
|
|
1167
|
+
if (!y) {
|
|
1168
|
+
if (y = !0, E = w, w = p(w), m !== void 0 && b.hasValue) {
|
|
1169
|
+
var D = b.value;
|
|
1170
|
+
if (m(D, w))
|
|
1171
|
+
return x = D;
|
|
1172
|
+
}
|
|
1173
|
+
return x = w;
|
|
1174
|
+
}
|
|
1175
|
+
if (D = x, o(E, w))
|
|
1176
|
+
return D;
|
|
1177
|
+
var I = p(w);
|
|
1178
|
+
return m !== void 0 && m(D, I) ? (E = w, D) : (E = w, x = I);
|
|
1179
|
+
}
|
|
1180
|
+
var y = !1, E, x, k = h === void 0 ? null : h;
|
|
1181
|
+
return [
|
|
1182
|
+
function() {
|
|
1183
|
+
return T(f());
|
|
1184
|
+
},
|
|
1185
|
+
k === null ? void 0 : function() {
|
|
1186
|
+
return T(k());
|
|
1187
|
+
}
|
|
1188
|
+
];
|
|
1189
|
+
},
|
|
1190
|
+
[f, h, p, m]
|
|
1191
|
+
);
|
|
1192
|
+
var C = r(c, g[0], g[1]);
|
|
1193
|
+
return a(
|
|
1194
|
+
function() {
|
|
1195
|
+
b.hasValue = !0, b.value = C;
|
|
1196
|
+
},
|
|
1197
|
+
[C]
|
|
1198
|
+
), i(C), C;
|
|
1199
|
+
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1200
|
+
})()), tt;
|
|
1201
|
+
}
|
|
1202
|
+
var Mt;
|
|
1203
|
+
function tr() {
|
|
1204
|
+
return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? ze.exports = Zo() : ze.exports = er()), ze.exports;
|
|
1205
|
+
}
|
|
1206
|
+
var nr = tr();
|
|
1207
|
+
const or = zn(19), rr = or ? ir : ar;
|
|
1208
|
+
function sr(e, t, n, o, r) {
|
|
1209
|
+
return rr(e, t, n, o, r);
|
|
1210
|
+
}
|
|
1211
|
+
function ir(e, t, n, o, r) {
|
|
1212
|
+
const s = u.useCallback(() => t(e.getSnapshot(), n, o, r), [e, t, n, o, r]);
|
|
1213
|
+
return io.useSyncExternalStore(e.subscribe, s, s);
|
|
1214
|
+
}
|
|
1215
|
+
function ar(e, t, n, o, r) {
|
|
1216
|
+
return nr.useSyncExternalStoreWithSelector(e.subscribe, e.getSnapshot, e.getSnapshot, (s) => t(s, n, o, r));
|
|
1217
|
+
}
|
|
1218
|
+
class Ie {
|
|
1219
|
+
/**
|
|
1220
|
+
* The current state of the store.
|
|
1221
|
+
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
|
|
1222
|
+
* To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
|
|
1223
|
+
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
|
|
1224
|
+
*
|
|
1225
|
+
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
|
|
1226
|
+
*/
|
|
1227
|
+
// Internal state to handle recursive `setState()` calls
|
|
1228
|
+
constructor(t) {
|
|
1229
|
+
this.state = t, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Registers a listener that will be called whenever the store's state changes.
|
|
1233
|
+
*
|
|
1234
|
+
* @param fn The listener function to be called on state changes.
|
|
1235
|
+
* @returns A function to unsubscribe the listener.
|
|
1236
|
+
*/
|
|
1237
|
+
subscribe = (t) => (this.listeners.add(t), () => {
|
|
1238
|
+
this.listeners.delete(t);
|
|
1239
|
+
});
|
|
1240
|
+
/**
|
|
1241
|
+
* Returns the current state of the store.
|
|
1242
|
+
*/
|
|
1243
|
+
getSnapshot = () => this.state;
|
|
1244
|
+
/**
|
|
1245
|
+
* Updates the entire store's state and notifies all registered listeners.
|
|
1246
|
+
*
|
|
1247
|
+
* @param newState The new state to set for the store.
|
|
1248
|
+
*/
|
|
1249
|
+
setState(t) {
|
|
1250
|
+
if (this.state === t)
|
|
1251
|
+
return;
|
|
1252
|
+
this.state = t, this.updateTick += 1;
|
|
1253
|
+
const n = this.updateTick;
|
|
1254
|
+
for (const o of this.listeners) {
|
|
1255
|
+
if (n !== this.updateTick)
|
|
1256
|
+
return;
|
|
1257
|
+
o(t);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Merges the provided changes into the current state and notifies listeners if there are changes.
|
|
1262
|
+
*
|
|
1263
|
+
* @param changes An object containing the changes to apply to the current state.
|
|
1264
|
+
*/
|
|
1265
|
+
update(t) {
|
|
1266
|
+
for (const n in t)
|
|
1267
|
+
if (!Object.is(this.state[n], t[n])) {
|
|
1268
|
+
Ie.prototype.setState.call(this, {
|
|
1269
|
+
...this.state,
|
|
1270
|
+
...t
|
|
1271
|
+
});
|
|
1272
|
+
return;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
/**
|
|
1276
|
+
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
|
|
1277
|
+
*
|
|
1278
|
+
* @param key The key in the store's state to update.
|
|
1279
|
+
* @param value The new value to set for the specified key.
|
|
1280
|
+
*/
|
|
1281
|
+
set(t, n) {
|
|
1282
|
+
Object.is(this.state[t], n) || Ie.prototype.setState.call(this, {
|
|
1283
|
+
...this.state,
|
|
1284
|
+
[t]: n
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Gives the state a new reference and updates all registered listeners.
|
|
1289
|
+
*/
|
|
1290
|
+
notifyAll() {
|
|
1291
|
+
const t = {
|
|
1292
|
+
...this.state
|
|
1293
|
+
};
|
|
1294
|
+
Ie.prototype.setState.call(this, t);
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
class un extends Ie {
|
|
1298
|
+
/**
|
|
1299
|
+
* Creates a new ReactStore instance.
|
|
1300
|
+
*
|
|
1301
|
+
* @param state Initial state of the store.
|
|
1302
|
+
* @param context Non-reactive context values.
|
|
1303
|
+
* @param selectors Optional selectors for use with `useState`.
|
|
1304
|
+
*/
|
|
1305
|
+
constructor(t, n = {}, o) {
|
|
1306
|
+
super(t), this.context = n, this.selectors = o;
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Non-reactive values such as refs, callbacks, etc.
|
|
1310
|
+
*/
|
|
1311
|
+
/**
|
|
1312
|
+
* Keeps track of which properties are controlled.
|
|
1313
|
+
*/
|
|
1314
|
+
controlledValues = /* @__PURE__ */ new Map();
|
|
1315
|
+
/**
|
|
1316
|
+
* Synchronizes a single external value into the store.
|
|
1317
|
+
*
|
|
1318
|
+
* Note that the while the value in `state` is updated immediately, the value returned
|
|
1319
|
+
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
1320
|
+
*/
|
|
1321
|
+
useSyncedValue(t, n) {
|
|
1322
|
+
u.useDebugValue(t), Z(() => {
|
|
1323
|
+
this.state[t] !== n && this.set(t, n);
|
|
1324
|
+
}, [t, n]);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Synchronizes a single external value into the store and
|
|
1328
|
+
* cleans it up (sets to `undefined`) on unmount.
|
|
1329
|
+
*
|
|
1330
|
+
* Note that the while the value in `state` is updated immediately, the value returned
|
|
1331
|
+
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
1332
|
+
*/
|
|
1333
|
+
useSyncedValueWithCleanup(t, n) {
|
|
1334
|
+
Z(() => (this.state[t] !== n && this.set(t, n), () => {
|
|
1335
|
+
this.set(t, void 0);
|
|
1336
|
+
}), [t, n]);
|
|
1337
|
+
}
|
|
1338
|
+
/**
|
|
1339
|
+
* Synchronizes multiple external values into the store.
|
|
1340
|
+
*
|
|
1341
|
+
* Note that the while the values in `state` are updated immediately, the values returned
|
|
1342
|
+
* by `useState` are updated before the next render (similarly to React's `useState`).
|
|
1343
|
+
*/
|
|
1344
|
+
useSyncedValues(t) {
|
|
1345
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1346
|
+
u.useDebugValue(t, (s) => Object.keys(s));
|
|
1347
|
+
const o = u.useRef(Object.keys(t)).current, r = Object.keys(t);
|
|
1348
|
+
(o.length !== r.length || o.some((s, a) => s !== r[a])) && console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
|
|
1349
|
+
}
|
|
1350
|
+
const n = Object.values(t);
|
|
1351
|
+
Z(() => {
|
|
1352
|
+
this.update(t);
|
|
1353
|
+
}, n);
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key.
|
|
1357
|
+
* - If `controlled` is non-undefined, the key is marked as controlled and the store's
|
|
1358
|
+
* state at `key` is updated to match `controlled`. Local writes to that key are ignored.
|
|
1359
|
+
* - If `controlled` is undefined, the key is marked as uncontrolled. The store's state
|
|
1360
|
+
* is initialized to `defaultValue` on first render and can be updated with local writes.
|
|
1361
|
+
*/
|
|
1362
|
+
useControlledProp(t, n, o) {
|
|
1363
|
+
u.useDebugValue(t);
|
|
1364
|
+
const r = n !== void 0;
|
|
1365
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1366
|
+
const s = this.controlledValues.get(t);
|
|
1367
|
+
s !== void 0 && s !== r && console.error(`A component is changing the ${r ? "" : "un"}controlled state of ${t.toString()} to be ${r ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
|
|
1368
|
+
}
|
|
1369
|
+
this.controlledValues.has(t) || (this.controlledValues.set(t, r), !r && !Object.is(this.state[t], o) && super.setState({
|
|
1370
|
+
...this.state,
|
|
1371
|
+
[t]: o
|
|
1372
|
+
})), Z(() => {
|
|
1373
|
+
r && !Object.is(this.state[t], n) && super.setState({
|
|
1374
|
+
...this.state,
|
|
1375
|
+
[t]: n
|
|
1376
|
+
});
|
|
1377
|
+
}, [t, n, o, r]);
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
|
|
1381
|
+
* If the key is controlled (registered via {@link useControlledProp} with a non-undefined value),
|
|
1382
|
+
* the update is ignored and no listeners are notified.
|
|
1383
|
+
*
|
|
1384
|
+
* @param key The state key to update.
|
|
1385
|
+
* @param value The new value to set for the specified key.
|
|
1386
|
+
*/
|
|
1387
|
+
set(t, n) {
|
|
1388
|
+
this.controlledValues.get(t) !== !0 && super.set(t, n);
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Merges the provided changes into the current state and notifies listeners if there are changes.
|
|
1392
|
+
* Controlled keys are filtered out and not updated.
|
|
1393
|
+
*
|
|
1394
|
+
* @param values An object containing the changes to apply to the current state.
|
|
1395
|
+
*/
|
|
1396
|
+
update(t) {
|
|
1397
|
+
const n = {
|
|
1398
|
+
...t
|
|
1399
|
+
};
|
|
1400
|
+
for (const o in n)
|
|
1401
|
+
if (Object.hasOwn(n, o) && this.controlledValues.get(o) === !0) {
|
|
1402
|
+
delete n[o];
|
|
1403
|
+
continue;
|
|
1404
|
+
}
|
|
1405
|
+
super.update(n);
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Updates the entire store's state and notifies all registered listeners.
|
|
1409
|
+
* Controlled keys are left unchanged; only uncontrolled keys from `newState` are applied.
|
|
1410
|
+
*
|
|
1411
|
+
* @param newState The new state to set for the store.
|
|
1412
|
+
*/
|
|
1413
|
+
setState(t) {
|
|
1414
|
+
const n = {
|
|
1415
|
+
...t
|
|
1416
|
+
};
|
|
1417
|
+
for (const o in n)
|
|
1418
|
+
if (Object.hasOwn(n, o) && this.controlledValues.get(o) === !0) {
|
|
1419
|
+
delete n[o];
|
|
1420
|
+
continue;
|
|
1421
|
+
}
|
|
1422
|
+
super.setState({
|
|
1423
|
+
...this.state,
|
|
1424
|
+
...n
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
/** Gets the current value from the store using a selector with the provided key.
|
|
1428
|
+
*
|
|
1429
|
+
* @param key Key of the selector to use.
|
|
1430
|
+
*/
|
|
1431
|
+
select = (t, n, o, r) => {
|
|
1432
|
+
const s = this.selectors[t];
|
|
1433
|
+
return s(this.state, n, o, r);
|
|
1434
|
+
};
|
|
1435
|
+
/**
|
|
1436
|
+
* Returns a value from the store's state using a selector function.
|
|
1437
|
+
* Used to subscribe to specific parts of the state.
|
|
1438
|
+
* This methods causes a rerender whenever the selected state changes.
|
|
1439
|
+
*
|
|
1440
|
+
* @param key Key of the selector to use.
|
|
1441
|
+
*/
|
|
1442
|
+
useState = (t, n, o, r) => {
|
|
1443
|
+
u.useDebugValue(t);
|
|
1444
|
+
const s = this.selectors[t];
|
|
1445
|
+
return sr(this, s, n, o, r);
|
|
1446
|
+
};
|
|
1447
|
+
/**
|
|
1448
|
+
* Wraps a function with `useStableCallback` to ensure it has a stable reference
|
|
1449
|
+
* and assigns it to the context.
|
|
1450
|
+
*
|
|
1451
|
+
* @param key Key of the event callback. Must be a function in the context.
|
|
1452
|
+
* @param fn Function to assign.
|
|
1453
|
+
*/
|
|
1454
|
+
useContextCallback(t, n) {
|
|
1455
|
+
u.useDebugValue(t);
|
|
1456
|
+
const o = V(n ?? Lt);
|
|
1457
|
+
this.context[t] = o;
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* Returns a stable setter function for a specific key in the store's state.
|
|
1461
|
+
* It's commonly used to pass as a ref callback to React elements.
|
|
1462
|
+
*
|
|
1463
|
+
* @param key Key of the state to set.
|
|
1464
|
+
*/
|
|
1465
|
+
useStateSetter(t) {
|
|
1466
|
+
const n = u.useRef(void 0);
|
|
1467
|
+
return n.current === void 0 && (n.current = (o) => {
|
|
1468
|
+
this.set(t, o);
|
|
1469
|
+
}), n.current;
|
|
1470
|
+
}
|
|
1471
|
+
/**
|
|
1472
|
+
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
|
|
1473
|
+
*
|
|
1474
|
+
* @param key Key of the selector to observe.
|
|
1475
|
+
* @param listener Listener function called when the selector result changes.
|
|
1476
|
+
*/
|
|
1477
|
+
observe(t, n) {
|
|
1478
|
+
let o;
|
|
1479
|
+
typeof t == "function" ? o = t : o = this.selectors[t];
|
|
1480
|
+
let r = o(this.state);
|
|
1481
|
+
return n(r, r, this), this.subscribe((s) => {
|
|
1482
|
+
const a = o(s);
|
|
1483
|
+
if (!Object.is(r, a)) {
|
|
1484
|
+
const l = r;
|
|
1485
|
+
r = a, n(a, l, this);
|
|
1486
|
+
}
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
const lr = {
|
|
1491
|
+
open: _((e) => e.open),
|
|
1492
|
+
domReferenceElement: _((e) => e.domReferenceElement),
|
|
1493
|
+
referenceElement: _((e) => e.positionReference ?? e.referenceElement),
|
|
1494
|
+
floatingElement: _((e) => e.floatingElement),
|
|
1495
|
+
floatingId: _((e) => e.floatingId)
|
|
1496
|
+
};
|
|
1497
|
+
class dn extends un {
|
|
1498
|
+
constructor(t) {
|
|
1499
|
+
const {
|
|
1500
|
+
nested: n,
|
|
1501
|
+
noEmit: o,
|
|
1502
|
+
onOpenChange: r,
|
|
1503
|
+
triggerElements: s,
|
|
1504
|
+
...a
|
|
1505
|
+
} = t;
|
|
1506
|
+
super({
|
|
1507
|
+
...a,
|
|
1508
|
+
positionReference: a.referenceElement,
|
|
1509
|
+
domReferenceElement: a.referenceElement
|
|
1510
|
+
}, {
|
|
1511
|
+
onOpenChange: r,
|
|
1512
|
+
dataRef: {
|
|
1513
|
+
current: {}
|
|
1514
|
+
},
|
|
1515
|
+
events: Co(),
|
|
1516
|
+
nested: n,
|
|
1517
|
+
noEmit: o,
|
|
1518
|
+
triggerElements: s
|
|
1519
|
+
}, lr);
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
|
|
1523
|
+
*
|
|
1524
|
+
* @param newOpen The new open state.
|
|
1525
|
+
* @param eventDetails Details about the event that triggered the open state change.
|
|
1526
|
+
*/
|
|
1527
|
+
setOpen = (t, n) => {
|
|
1528
|
+
if ((!t || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing
|
|
1529
|
+
// click events to upgrade a hover-open.
|
|
1530
|
+
en(n.event)) && (this.context.dataRef.current.openEvent = t ? n.event : void 0), !this.context.noEmit) {
|
|
1531
|
+
const o = {
|
|
1532
|
+
open: t,
|
|
1533
|
+
reason: n.reason,
|
|
1534
|
+
nativeEvent: n.event,
|
|
1535
|
+
nested: this.context.nested,
|
|
1536
|
+
triggerElement: n.trigger
|
|
1537
|
+
};
|
|
1538
|
+
this.context.events.emit("openchange", o);
|
|
1539
|
+
}
|
|
1540
|
+
this.context.onOpenChange?.(t, n);
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
function cr(e, t) {
|
|
1544
|
+
const n = u.useRef(null);
|
|
1545
|
+
return u.useCallback((o) => {
|
|
1546
|
+
e !== void 0 && (n.current !== null && (t.context.triggerElements.delete(n.current), n.current = null), o !== null && (n.current = e, t.context.triggerElements.add(e, o)));
|
|
1547
|
+
}, [t, e]);
|
|
1548
|
+
}
|
|
1549
|
+
function ur(e, t, n, o) {
|
|
1550
|
+
const r = n.useState("isMountedByTrigger", e), s = cr(e, n), a = V((l) => {
|
|
1551
|
+
s(l), l !== null && n.select("open") && n.select("activeTriggerId") == null && n.update({
|
|
1552
|
+
activeTriggerId: e,
|
|
1553
|
+
activeTriggerElement: l,
|
|
1554
|
+
...o
|
|
1555
|
+
});
|
|
1556
|
+
});
|
|
1557
|
+
return Z(() => {
|
|
1558
|
+
r && n.update({
|
|
1559
|
+
activeTriggerElement: t.current,
|
|
1560
|
+
...o
|
|
1561
|
+
});
|
|
1562
|
+
}, [r, n, t, ...Object.values(o)]), {
|
|
1563
|
+
registerTrigger: a,
|
|
1564
|
+
isMountedByThisTrigger: r
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
function dr(e) {
|
|
1568
|
+
const t = e.useState("open");
|
|
1569
|
+
Z(() => {
|
|
1570
|
+
if (t && !e.select("activeTriggerId") && e.context.triggerElements.size === 1) {
|
|
1571
|
+
const n = e.context.triggerElements.entries().next();
|
|
1572
|
+
if (!n.done) {
|
|
1573
|
+
const [o, r] = n.value;
|
|
1574
|
+
e.update({
|
|
1575
|
+
activeTriggerId: o,
|
|
1576
|
+
activeTriggerElement: r
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}, [t, e]);
|
|
1581
|
+
}
|
|
1582
|
+
function fr(e, t, n) {
|
|
1583
|
+
const {
|
|
1584
|
+
mounted: o,
|
|
1585
|
+
setMounted: r,
|
|
1586
|
+
transitionStatus: s
|
|
1587
|
+
} = so(e);
|
|
1588
|
+
t.useSyncedValues({
|
|
1589
|
+
mounted: o,
|
|
1590
|
+
transitionStatus: s
|
|
1591
|
+
});
|
|
1592
|
+
const a = V(() => {
|
|
1593
|
+
r(!1), t.update({
|
|
1594
|
+
activeTriggerId: null,
|
|
1595
|
+
activeTriggerElement: null,
|
|
1596
|
+
mounted: !1
|
|
1597
|
+
}), n?.(), t.context.onOpenChangeComplete?.(!1);
|
|
1598
|
+
}), l = t.useState("preventUnmountingOnClose");
|
|
1599
|
+
return Wt({
|
|
1600
|
+
enabled: !l,
|
|
1601
|
+
open: e,
|
|
1602
|
+
ref: t.context.popupRef,
|
|
1603
|
+
onComplete() {
|
|
1604
|
+
e || a();
|
|
1605
|
+
}
|
|
1606
|
+
}), {
|
|
1607
|
+
forceUnmount: a,
|
|
1608
|
+
transitionStatus: s
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
class fn {
|
|
1612
|
+
constructor() {
|
|
1613
|
+
this.elements = /* @__PURE__ */ new Set(), this.idMap = /* @__PURE__ */ new Map();
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Adds a trigger element with the given ID.
|
|
1617
|
+
*
|
|
1618
|
+
* Note: The provided element is assumed to not be registered under multiple IDs.
|
|
1619
|
+
*/
|
|
1620
|
+
add(t, n) {
|
|
1621
|
+
const o = this.idMap.get(t);
|
|
1622
|
+
if (o !== n && (o !== void 0 && this.elements.delete(o), this.elements.add(n), this.idMap.set(t, n), process.env.NODE_ENV !== "production" && this.elements.size !== this.idMap.size))
|
|
1623
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap." : Me(87));
|
|
1624
|
+
}
|
|
1625
|
+
/**
|
|
1626
|
+
* Removes the trigger element with the given ID.
|
|
1627
|
+
*/
|
|
1628
|
+
delete(t) {
|
|
1629
|
+
const n = this.idMap.get(t);
|
|
1630
|
+
n && (this.elements.delete(n), this.idMap.delete(t));
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Whether the given element is registered as a trigger.
|
|
1634
|
+
*/
|
|
1635
|
+
hasElement(t) {
|
|
1636
|
+
return this.elements.has(t);
|
|
1637
|
+
}
|
|
1638
|
+
/**
|
|
1639
|
+
* Whether there is a registered trigger element matching the given predicate.
|
|
1640
|
+
*/
|
|
1641
|
+
hasMatchingElement(t) {
|
|
1642
|
+
for (const n of this.elements)
|
|
1643
|
+
if (t(n))
|
|
1644
|
+
return !0;
|
|
1645
|
+
return !1;
|
|
1646
|
+
}
|
|
1647
|
+
getById(t) {
|
|
1648
|
+
return this.idMap.get(t);
|
|
1649
|
+
}
|
|
1650
|
+
entries() {
|
|
1651
|
+
return this.idMap.entries();
|
|
1652
|
+
}
|
|
1653
|
+
get size() {
|
|
1654
|
+
return this.idMap.size;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
function pr() {
|
|
1658
|
+
return new dn({
|
|
1659
|
+
open: !1,
|
|
1660
|
+
floatingElement: null,
|
|
1661
|
+
referenceElement: null,
|
|
1662
|
+
triggerElements: new fn(),
|
|
1663
|
+
floatingId: "",
|
|
1664
|
+
nested: !1,
|
|
1665
|
+
noEmit: !1,
|
|
1666
|
+
onOpenChange: void 0
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
function gr() {
|
|
1670
|
+
return {
|
|
1671
|
+
open: !1,
|
|
1672
|
+
mounted: !1,
|
|
1673
|
+
transitionStatus: "idle",
|
|
1674
|
+
floatingRootContext: pr(),
|
|
1675
|
+
preventUnmountingOnClose: !1,
|
|
1676
|
+
payload: void 0,
|
|
1677
|
+
activeTriggerId: null,
|
|
1678
|
+
activeTriggerElement: null,
|
|
1679
|
+
popupElement: null,
|
|
1680
|
+
positionerElement: null,
|
|
1681
|
+
activeTriggerProps: ke,
|
|
1682
|
+
inactiveTriggerProps: ke,
|
|
1683
|
+
popupProps: ke
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
const mr = {
|
|
1687
|
+
open: _((e) => e.open),
|
|
1688
|
+
mounted: _((e) => e.mounted),
|
|
1689
|
+
transitionStatus: _((e) => e.transitionStatus),
|
|
1690
|
+
floatingRootContext: _((e) => e.floatingRootContext),
|
|
1691
|
+
preventUnmountingOnClose: _((e) => e.preventUnmountingOnClose),
|
|
1692
|
+
payload: _((e) => e.payload),
|
|
1693
|
+
activeTriggerId: _((e) => e.activeTriggerId),
|
|
1694
|
+
activeTriggerElement: _((e) => e.mounted ? e.activeTriggerElement : null),
|
|
1695
|
+
/**
|
|
1696
|
+
* Whether the trigger with the given ID was used to open the popup.
|
|
1697
|
+
*/
|
|
1698
|
+
isTriggerActive: _((e, t) => t !== void 0 && e.activeTriggerId === t),
|
|
1699
|
+
/**
|
|
1700
|
+
* Whether the popup is open and was activated by a trigger with the given ID.
|
|
1701
|
+
*/
|
|
1702
|
+
isOpenedByTrigger: _((e, t) => t !== void 0 && e.activeTriggerId === t && e.open),
|
|
1703
|
+
/**
|
|
1704
|
+
* Whether the popup is mounted and was activated by a trigger with the given ID.
|
|
1705
|
+
*/
|
|
1706
|
+
isMountedByTrigger: _((e, t) => t !== void 0 && e.activeTriggerId === t && e.mounted),
|
|
1707
|
+
triggerProps: _((e, t) => t ? e.activeTriggerProps : e.inactiveTriggerProps),
|
|
1708
|
+
popupProps: _((e) => e.popupProps),
|
|
1709
|
+
popupElement: _((e) => e.popupElement),
|
|
1710
|
+
positionerElement: _((e) => e.positionerElement)
|
|
1711
|
+
};
|
|
1712
|
+
function hr(e) {
|
|
1713
|
+
const {
|
|
1714
|
+
popupStore: t,
|
|
1715
|
+
noEmit: n = !1,
|
|
1716
|
+
treatPopupAsFloatingElement: o = !1,
|
|
1717
|
+
onOpenChange: r
|
|
1718
|
+
} = e, s = jt(), a = rn() != null, l = t.useState("open"), i = t.useState("activeTriggerElement"), c = t.useState(o ? "popupElement" : "positionerElement"), f = t.context.triggerElements, h = zt(() => new dn({
|
|
1719
|
+
open: l,
|
|
1720
|
+
referenceElement: i,
|
|
1721
|
+
floatingElement: c,
|
|
1722
|
+
triggerElements: f,
|
|
1723
|
+
onOpenChange: r,
|
|
1724
|
+
floatingId: s,
|
|
1725
|
+
nested: a,
|
|
1726
|
+
noEmit: n
|
|
1727
|
+
})).current;
|
|
1728
|
+
return Z(() => {
|
|
1729
|
+
const p = {
|
|
1730
|
+
open: l,
|
|
1731
|
+
floatingId: s,
|
|
1732
|
+
referenceElement: i,
|
|
1733
|
+
floatingElement: c
|
|
1734
|
+
};
|
|
1735
|
+
pe(i) && (p.domReferenceElement = i), h.update(p);
|
|
1736
|
+
}, [l, s, i, c, h]), h.context.onOpenChange = r, h.context.nested = a, h.context.noEmit = n, h;
|
|
1737
|
+
}
|
|
1738
|
+
function pn(e = []) {
|
|
1739
|
+
const t = e.map((c) => c?.reference), n = e.map((c) => c?.floating), o = e.map((c) => c?.item), r = e.map((c) => c?.trigger), s = u.useCallback(
|
|
1740
|
+
(c) => Ke(c, e, "reference"),
|
|
1741
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1742
|
+
t
|
|
1743
|
+
), a = u.useCallback(
|
|
1744
|
+
(c) => Ke(c, e, "floating"),
|
|
1745
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1746
|
+
n
|
|
1747
|
+
), l = u.useCallback(
|
|
1748
|
+
(c) => Ke(c, e, "item"),
|
|
1749
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1750
|
+
o
|
|
1751
|
+
), i = u.useCallback(
|
|
1752
|
+
(c) => Ke(c, e, "trigger"),
|
|
1753
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1754
|
+
r
|
|
1755
|
+
);
|
|
1756
|
+
return u.useMemo(() => ({
|
|
1757
|
+
getReferenceProps: s,
|
|
1758
|
+
getFloatingProps: a,
|
|
1759
|
+
getItemProps: l,
|
|
1760
|
+
getTriggerProps: i
|
|
1761
|
+
}), [s, a, l, i]);
|
|
1762
|
+
}
|
|
1763
|
+
function Ke(e, t, n) {
|
|
1764
|
+
const o = /* @__PURE__ */ new Map(), r = n === "item", s = {};
|
|
1765
|
+
n === "floating" && (s.tabIndex = -1, s[no] = "");
|
|
1766
|
+
for (const a in e)
|
|
1767
|
+
r && e && (a === Jt || a === Qt) || (s[a] = e[a]);
|
|
1768
|
+
for (let a = 0; a < t.length; a += 1) {
|
|
1769
|
+
let l;
|
|
1770
|
+
const i = t[a]?.[n];
|
|
1771
|
+
typeof i == "function" ? l = e ? i(e) : null : l = i, l && Pt(s, l, r, o);
|
|
1772
|
+
}
|
|
1773
|
+
return Pt(s, e, r, o), s;
|
|
1774
|
+
}
|
|
1775
|
+
function Pt(e, t, n, o) {
|
|
1776
|
+
for (const r in t) {
|
|
1777
|
+
const s = t[r];
|
|
1778
|
+
n && (r === Jt || r === Qt) || (r.startsWith("on") ? (o.has(r) || o.set(r, []), typeof s == "function" && (o.get(r)?.push(s), e[r] = (...a) => o.get(r)?.map((l) => l(...a)).find((l) => l !== void 0))) : e[r] = s);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
const Er = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
1782
|
+
function yr(e, t = {}) {
|
|
1783
|
+
const n = "rootStore" in e ? e.rootStore : e, o = n.useState("open"), r = n.useState("floatingId"), s = n.useState("domReferenceElement"), a = n.useState("floatingElement"), {
|
|
1784
|
+
enabled: l = !0,
|
|
1785
|
+
role: i = "dialog"
|
|
1786
|
+
} = t, c = jt(), f = s?.id || c, h = u.useMemo(() => ot(a)?.id || r, [a, r]), p = Er.get(i) ?? i, g = rn() != null, b = u.useMemo(() => p === "tooltip" || i === "label" ? ke : {
|
|
1787
|
+
"aria-haspopup": p === "alertdialog" ? "dialog" : p,
|
|
1788
|
+
"aria-expanded": "false",
|
|
1789
|
+
...p === "listbox" && {
|
|
1790
|
+
role: "combobox"
|
|
1791
|
+
},
|
|
1792
|
+
...p === "menu" && g && {
|
|
1793
|
+
role: "menuitem"
|
|
1794
|
+
},
|
|
1795
|
+
...i === "select" && {
|
|
1796
|
+
"aria-autocomplete": "none"
|
|
1797
|
+
},
|
|
1798
|
+
...i === "combobox" && {
|
|
1799
|
+
"aria-autocomplete": "list"
|
|
1800
|
+
}
|
|
1801
|
+
}, [p, g, i]), C = u.useMemo(() => p === "tooltip" || i === "label" ? {
|
|
1802
|
+
[`aria-${i === "label" ? "labelledby" : "describedby"}`]: o ? h : void 0
|
|
1803
|
+
} : {
|
|
1804
|
+
...b,
|
|
1805
|
+
"aria-expanded": o ? "true" : "false",
|
|
1806
|
+
"aria-controls": o ? h : void 0,
|
|
1807
|
+
...p === "menu" && {
|
|
1808
|
+
id: f
|
|
1809
|
+
}
|
|
1810
|
+
}, [p, h, o, f, i, b]), T = u.useMemo(() => {
|
|
1811
|
+
const E = {
|
|
1812
|
+
id: h,
|
|
1813
|
+
...p && {
|
|
1814
|
+
role: p
|
|
1815
|
+
}
|
|
1816
|
+
};
|
|
1817
|
+
return p === "tooltip" || i === "label" ? E : {
|
|
1818
|
+
...E,
|
|
1819
|
+
...p === "menu" && {
|
|
1820
|
+
"aria-labelledby": f
|
|
1821
|
+
}
|
|
1822
|
+
};
|
|
1823
|
+
}, [p, h, f, i]), y = u.useCallback(({
|
|
1824
|
+
active: E,
|
|
1825
|
+
selected: x
|
|
1826
|
+
}) => {
|
|
1827
|
+
const k = {
|
|
1828
|
+
role: "option",
|
|
1829
|
+
...E && {
|
|
1830
|
+
id: `${h}-fui-option`
|
|
1831
|
+
}
|
|
1832
|
+
};
|
|
1833
|
+
switch (i) {
|
|
1834
|
+
case "select":
|
|
1835
|
+
case "combobox":
|
|
1836
|
+
return {
|
|
1837
|
+
...k,
|
|
1838
|
+
"aria-selected": x
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
return {};
|
|
1842
|
+
}, [h, i]);
|
|
1843
|
+
return u.useMemo(() => l ? {
|
|
1844
|
+
reference: C,
|
|
1845
|
+
floating: T,
|
|
1846
|
+
item: y,
|
|
1847
|
+
trigger: b
|
|
1848
|
+
} : {}, [l, C, T, b, y]);
|
|
1849
|
+
}
|
|
1850
|
+
function br(e) {
|
|
1851
|
+
const t = u.useRef(""), n = u.useCallback((r) => {
|
|
1852
|
+
r.defaultPrevented || (t.current = r.pointerType, e(r, r.pointerType));
|
|
1853
|
+
}, [e]);
|
|
1854
|
+
return {
|
|
1855
|
+
onClick: u.useCallback((r) => {
|
|
1856
|
+
if (r.detail === 0) {
|
|
1857
|
+
e(r, "keyboard");
|
|
1858
|
+
return;
|
|
1859
|
+
}
|
|
1860
|
+
"pointerType" in r && e(r, r.pointerType), e(r, t.current), t.current = "";
|
|
1861
|
+
}, [e]),
|
|
1862
|
+
onPointerDown: n
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
function vr(e) {
|
|
1866
|
+
const [t, n] = u.useState(null), o = V((l, i) => {
|
|
1867
|
+
e || n(i);
|
|
1868
|
+
}), r = u.useCallback(() => {
|
|
1869
|
+
n(null);
|
|
1870
|
+
}, []), {
|
|
1871
|
+
onClick: s,
|
|
1872
|
+
onPointerDown: a
|
|
1873
|
+
} = br(o);
|
|
1874
|
+
return u.useMemo(() => ({
|
|
1875
|
+
openMethod: t,
|
|
1876
|
+
reset: r,
|
|
1877
|
+
triggerProps: {
|
|
1878
|
+
onClick: s,
|
|
1879
|
+
onPointerDown: a
|
|
1880
|
+
}
|
|
1881
|
+
}), [t, r, s, a]);
|
|
1882
|
+
}
|
|
1883
|
+
function Sr(e) {
|
|
1884
|
+
const {
|
|
1885
|
+
store: t,
|
|
1886
|
+
parentContext: n,
|
|
1887
|
+
actionsRef: o
|
|
1888
|
+
} = e, r = t.useState("open"), s = t.useState("disablePointerDismissal"), a = t.useState("modal"), l = t.useState("popupElement"), {
|
|
1889
|
+
openMethod: i,
|
|
1890
|
+
triggerProps: c,
|
|
1891
|
+
reset: f
|
|
1892
|
+
} = vr(r);
|
|
1893
|
+
dr(t);
|
|
1894
|
+
const {
|
|
1895
|
+
forceUnmount: h
|
|
1896
|
+
} = fr(r, t, () => {
|
|
1897
|
+
f();
|
|
1898
|
+
}), p = V((W) => {
|
|
1899
|
+
const H = se(W);
|
|
1900
|
+
return H.preventUnmountOnClose = () => {
|
|
1901
|
+
t.set("preventUnmountingOnClose", !0);
|
|
1902
|
+
}, H;
|
|
1903
|
+
}), m = u.useCallback(() => {
|
|
1904
|
+
t.setOpen(!1, p(Kn));
|
|
1905
|
+
}, [t, p]);
|
|
1906
|
+
u.useImperativeHandle(o, () => ({
|
|
1907
|
+
unmount: h,
|
|
1908
|
+
close: m
|
|
1909
|
+
}), [h, m]);
|
|
1910
|
+
const g = hr({
|
|
1911
|
+
popupStore: t,
|
|
1912
|
+
onOpenChange: t.setOpen,
|
|
1913
|
+
treatPopupAsFloatingElement: !0,
|
|
1914
|
+
noEmit: !0
|
|
1915
|
+
}), [b, C] = u.useState(0), T = b === 0, y = yr(g), E = Ao(g, {
|
|
1916
|
+
outsidePressEvent() {
|
|
1917
|
+
return t.context.internalBackdropRef.current || t.context.backdropRef.current ? "intentional" : {
|
|
1918
|
+
mouse: a === "trap-focus" ? "sloppy" : "intentional",
|
|
1919
|
+
touch: "sloppy"
|
|
1920
|
+
};
|
|
1921
|
+
},
|
|
1922
|
+
outsidePress(W) {
|
|
1923
|
+
if ("button" in W && W.button !== 0 || "touches" in W && W.touches.length !== 1)
|
|
1924
|
+
return !1;
|
|
1925
|
+
const H = re(W);
|
|
1926
|
+
if (T && !s) {
|
|
1927
|
+
const q = H;
|
|
1928
|
+
return a && (t.context.internalBackdropRef.current || t.context.backdropRef.current) ? t.context.internalBackdropRef.current === q || t.context.backdropRef.current === q || $(q, l) && !q?.hasAttribute("data-base-ui-portal") : !0;
|
|
1929
|
+
}
|
|
1930
|
+
return !1;
|
|
1931
|
+
},
|
|
1932
|
+
escapeKey: T
|
|
1933
|
+
});
|
|
1934
|
+
So(r && a === !0, l);
|
|
1935
|
+
const {
|
|
1936
|
+
getReferenceProps: x,
|
|
1937
|
+
getFloatingProps: k,
|
|
1938
|
+
getTriggerProps: w
|
|
1939
|
+
} = pn([y, E]);
|
|
1940
|
+
t.useContextCallback("onNestedDialogOpen", (W) => {
|
|
1941
|
+
C(W + 1);
|
|
1942
|
+
}), t.useContextCallback("onNestedDialogClose", () => {
|
|
1943
|
+
C(0);
|
|
1944
|
+
}), u.useEffect(() => (n?.onNestedDialogOpen && r && n.onNestedDialogOpen(b), n?.onNestedDialogClose && !r && n.onNestedDialogClose(), () => {
|
|
1945
|
+
n?.onNestedDialogClose && r && n.onNestedDialogClose();
|
|
1946
|
+
}), [r, n, b]);
|
|
1947
|
+
const D = u.useMemo(() => x(c), [x, c]), I = u.useMemo(() => w(c), [w, c]), B = u.useMemo(() => k(), [k]);
|
|
1948
|
+
t.useSyncedValues({
|
|
1949
|
+
openMethod: i,
|
|
1950
|
+
activeTriggerProps: D,
|
|
1951
|
+
inactiveTriggerProps: I,
|
|
1952
|
+
popupProps: B,
|
|
1953
|
+
floatingRootContext: g,
|
|
1954
|
+
nestedOpenDialogCount: b
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
const lt = /* @__PURE__ */ u.createContext(void 0);
|
|
1958
|
+
process.env.NODE_ENV !== "production" && (lt.displayName = "DialogRootContext");
|
|
1959
|
+
function de(e) {
|
|
1960
|
+
const t = u.useContext(lt);
|
|
1961
|
+
if (e === !1 && t === void 0)
|
|
1962
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>." : Me(27));
|
|
1963
|
+
return t;
|
|
1964
|
+
}
|
|
1965
|
+
const Cr = {
|
|
1966
|
+
...mr,
|
|
1967
|
+
modal: _((e) => e.modal),
|
|
1968
|
+
nested: _((e) => e.nested),
|
|
1969
|
+
nestedOpenDialogCount: _((e) => e.nestedOpenDialogCount),
|
|
1970
|
+
disablePointerDismissal: _((e) => e.disablePointerDismissal),
|
|
1971
|
+
openMethod: _((e) => e.openMethod),
|
|
1972
|
+
descriptionElementId: _((e) => e.descriptionElementId),
|
|
1973
|
+
titleElementId: _((e) => e.titleElementId),
|
|
1974
|
+
viewportElement: _((e) => e.viewportElement),
|
|
1975
|
+
role: _((e) => e.role)
|
|
1976
|
+
};
|
|
1977
|
+
class Rr extends un {
|
|
1978
|
+
constructor(t) {
|
|
1979
|
+
super(Tr(t), {
|
|
1980
|
+
popupRef: /* @__PURE__ */ u.createRef(),
|
|
1981
|
+
backdropRef: /* @__PURE__ */ u.createRef(),
|
|
1982
|
+
internalBackdropRef: /* @__PURE__ */ u.createRef(),
|
|
1983
|
+
triggerElements: new fn(),
|
|
1984
|
+
onOpenChange: void 0,
|
|
1985
|
+
onOpenChangeComplete: void 0
|
|
1986
|
+
}, Cr);
|
|
1987
|
+
}
|
|
1988
|
+
setOpen = (t, n) => {
|
|
1989
|
+
if (n.preventUnmountOnClose = () => {
|
|
1990
|
+
this.set("preventUnmountingOnClose", !0);
|
|
1991
|
+
}, !t && n.trigger == null && this.state.activeTriggerId != null && (n.trigger = this.state.activeTriggerElement ?? void 0), this.context.onOpenChange?.(t, n), n.isCanceled)
|
|
1992
|
+
return;
|
|
1993
|
+
const o = {
|
|
1994
|
+
open: t,
|
|
1995
|
+
nativeEvent: n.event,
|
|
1996
|
+
reason: n.reason,
|
|
1997
|
+
nested: this.state.nested
|
|
1998
|
+
};
|
|
1999
|
+
this.state.floatingRootContext.context.events?.emit("openchange", o);
|
|
2000
|
+
const r = {
|
|
2001
|
+
open: t
|
|
2002
|
+
}, s = n.trigger?.id ?? null;
|
|
2003
|
+
(s || t) && (r.activeTriggerId = s, r.activeTriggerElement = n.trigger ?? null), this.update(r);
|
|
2004
|
+
};
|
|
2005
|
+
}
|
|
2006
|
+
function Tr(e = {}) {
|
|
2007
|
+
return {
|
|
2008
|
+
...gr(),
|
|
2009
|
+
modal: !0,
|
|
2010
|
+
disablePointerDismissal: !1,
|
|
2011
|
+
popupElement: null,
|
|
2012
|
+
viewportElement: null,
|
|
2013
|
+
descriptionElementId: void 0,
|
|
2014
|
+
titleElementId: void 0,
|
|
2015
|
+
openMethod: null,
|
|
2016
|
+
nested: !1,
|
|
2017
|
+
nestedOpenDialogCount: 0,
|
|
2018
|
+
role: "dialog",
|
|
2019
|
+
...e
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
function Or(e) {
|
|
2023
|
+
const {
|
|
2024
|
+
children: t,
|
|
2025
|
+
open: n,
|
|
2026
|
+
defaultOpen: o = !1,
|
|
2027
|
+
onOpenChange: r,
|
|
2028
|
+
onOpenChangeComplete: s,
|
|
2029
|
+
actionsRef: a,
|
|
2030
|
+
handle: l,
|
|
2031
|
+
triggerId: i,
|
|
2032
|
+
defaultTriggerId: c = null
|
|
2033
|
+
} = e, f = de(), h = !!f, p = zt(() => l?.store ?? new Rr({
|
|
2034
|
+
open: n ?? o,
|
|
2035
|
+
activeTriggerId: i !== void 0 ? i : c,
|
|
2036
|
+
modal: !0,
|
|
2037
|
+
disablePointerDismissal: !0,
|
|
2038
|
+
nested: h,
|
|
2039
|
+
role: "alertdialog"
|
|
2040
|
+
})).current;
|
|
2041
|
+
p.useControlledProp("open", n, o), p.useControlledProp("activeTriggerId", i, c), p.useSyncedValue("nested", h), p.useContextCallback("onOpenChange", r), p.useContextCallback("onOpenChangeComplete", s);
|
|
2042
|
+
const m = p.useState("payload");
|
|
2043
|
+
Sr({
|
|
2044
|
+
store: p,
|
|
2045
|
+
actionsRef: a,
|
|
2046
|
+
parentContext: f?.store.context
|
|
2047
|
+
});
|
|
2048
|
+
const g = u.useMemo(() => ({
|
|
2049
|
+
store: p
|
|
2050
|
+
}), [p]);
|
|
2051
|
+
return /* @__PURE__ */ K(lt.Provider, {
|
|
2052
|
+
value: g,
|
|
2053
|
+
children: typeof t == "function" ? t({
|
|
2054
|
+
payload: m
|
|
2055
|
+
}) : t
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
let ge = (function(e) {
|
|
2059
|
+
return e.open = "data-open", e.closed = "data-closed", e[e.startingStyle = gt.startingStyle] = "startingStyle", e[e.endingStyle = gt.endingStyle] = "endingStyle", e.anchorHidden = "data-anchor-hidden", e;
|
|
2060
|
+
})({}), wr = /* @__PURE__ */ (function(e) {
|
|
2061
|
+
return e.popupOpen = "data-popup-open", e.pressed = "data-pressed", e;
|
|
2062
|
+
})({});
|
|
2063
|
+
const xr = {
|
|
2064
|
+
[wr.popupOpen]: ""
|
|
2065
|
+
}, Dr = {
|
|
2066
|
+
[ge.open]: ""
|
|
2067
|
+
}, kr = {
|
|
2068
|
+
[ge.closed]: ""
|
|
2069
|
+
}, Ir = {
|
|
2070
|
+
[ge.anchorHidden]: ""
|
|
2071
|
+
}, Nr = {
|
|
2072
|
+
open(e) {
|
|
2073
|
+
return e ? xr : null;
|
|
2074
|
+
}
|
|
2075
|
+
}, gn = {
|
|
2076
|
+
open(e) {
|
|
2077
|
+
return e ? Dr : kr;
|
|
2078
|
+
},
|
|
2079
|
+
anchorHidden(e) {
|
|
2080
|
+
return e ? Ir : null;
|
|
2081
|
+
}
|
|
2082
|
+
}, Mr = {
|
|
2083
|
+
...gn,
|
|
2084
|
+
...Kt
|
|
2085
|
+
}, mn = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2086
|
+
const {
|
|
2087
|
+
render: o,
|
|
2088
|
+
className: r,
|
|
2089
|
+
forceRender: s = !1,
|
|
2090
|
+
...a
|
|
2091
|
+
} = t, {
|
|
2092
|
+
store: l
|
|
2093
|
+
} = de(), i = l.useState("open"), c = l.useState("nested"), f = l.useState("mounted"), h = l.useState("transitionStatus"), p = u.useMemo(() => ({
|
|
2094
|
+
open: i,
|
|
2095
|
+
transitionStatus: h
|
|
2096
|
+
}), [i, h]);
|
|
2097
|
+
return Re("div", t, {
|
|
2098
|
+
state: p,
|
|
2099
|
+
ref: [l.context.backdropRef, n],
|
|
2100
|
+
stateAttributesMapping: Mr,
|
|
2101
|
+
props: [{
|
|
2102
|
+
role: "presentation",
|
|
2103
|
+
hidden: !f,
|
|
2104
|
+
style: {
|
|
2105
|
+
userSelect: "none",
|
|
2106
|
+
WebkitUserSelect: "none"
|
|
2107
|
+
}
|
|
2108
|
+
}, a],
|
|
2109
|
+
enabled: s || !c
|
|
2110
|
+
});
|
|
2111
|
+
});
|
|
2112
|
+
process.env.NODE_ENV !== "production" && (mn.displayName = "DialogBackdrop");
|
|
2113
|
+
const ct = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2114
|
+
const {
|
|
2115
|
+
render: o,
|
|
2116
|
+
className: r,
|
|
2117
|
+
disabled: s = !1,
|
|
2118
|
+
nativeButton: a = !0,
|
|
2119
|
+
...l
|
|
2120
|
+
} = t, {
|
|
2121
|
+
store: i
|
|
2122
|
+
} = de(), c = i.useState("open");
|
|
2123
|
+
function f(g) {
|
|
2124
|
+
c && i.setOpen(!1, se(Hn, g.nativeEvent));
|
|
2125
|
+
}
|
|
2126
|
+
const {
|
|
2127
|
+
getButtonProps: h,
|
|
2128
|
+
buttonRef: p
|
|
2129
|
+
} = Ht({
|
|
2130
|
+
disabled: s,
|
|
2131
|
+
native: a
|
|
2132
|
+
}), m = u.useMemo(() => ({
|
|
2133
|
+
disabled: s
|
|
2134
|
+
}), [s]);
|
|
2135
|
+
return Re("button", t, {
|
|
2136
|
+
state: m,
|
|
2137
|
+
ref: [n, p],
|
|
2138
|
+
props: [{
|
|
2139
|
+
onClick: f
|
|
2140
|
+
}, l, h]
|
|
2141
|
+
});
|
|
2142
|
+
});
|
|
2143
|
+
process.env.NODE_ENV !== "production" && (ct.displayName = "DialogClose");
|
|
2144
|
+
const hn = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2145
|
+
const {
|
|
2146
|
+
render: o,
|
|
2147
|
+
className: r,
|
|
2148
|
+
id: s,
|
|
2149
|
+
...a
|
|
2150
|
+
} = t, {
|
|
2151
|
+
store: l
|
|
2152
|
+
} = de(), i = it(s);
|
|
2153
|
+
return l.useSyncedValueWithCleanup("descriptionElementId", i), Re("p", t, {
|
|
2154
|
+
ref: n,
|
|
2155
|
+
props: [{
|
|
2156
|
+
id: i
|
|
2157
|
+
}, a]
|
|
2158
|
+
});
|
|
2159
|
+
});
|
|
2160
|
+
process.env.NODE_ENV !== "production" && (hn.displayName = "DialogDescription");
|
|
2161
|
+
let Pr = /* @__PURE__ */ (function(e) {
|
|
2162
|
+
return e.nestedDialogs = "--nested-dialogs", e;
|
|
2163
|
+
})({}), Ar = (function(e) {
|
|
2164
|
+
return e[e.open = ge.open] = "open", e[e.closed = ge.closed] = "closed", e[e.startingStyle = ge.startingStyle] = "startingStyle", e[e.endingStyle = ge.endingStyle] = "endingStyle", e.nested = "data-nested", e.nestedDialogOpen = "data-nested-dialog-open", e;
|
|
2165
|
+
})({});
|
|
2166
|
+
const ut = /* @__PURE__ */ u.createContext(void 0);
|
|
2167
|
+
process.env.NODE_ENV !== "production" && (ut.displayName = "DialogPortalContext");
|
|
2168
|
+
function Fr() {
|
|
2169
|
+
const e = u.useContext(ut);
|
|
2170
|
+
if (e === void 0)
|
|
2171
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Portal> is missing." : Me(26));
|
|
2172
|
+
return e;
|
|
2173
|
+
}
|
|
2174
|
+
const _r = {
|
|
2175
|
+
...gn,
|
|
2176
|
+
...Kt,
|
|
2177
|
+
nestedDialogOpen(e) {
|
|
2178
|
+
return e ? {
|
|
2179
|
+
[Ar.nestedDialogOpen]: ""
|
|
2180
|
+
} : null;
|
|
2181
|
+
}
|
|
2182
|
+
}, En = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2183
|
+
const {
|
|
2184
|
+
className: o,
|
|
2185
|
+
finalFocus: r,
|
|
2186
|
+
initialFocus: s,
|
|
2187
|
+
render: a,
|
|
2188
|
+
...l
|
|
2189
|
+
} = t, {
|
|
2190
|
+
store: i
|
|
2191
|
+
} = de(), c = i.useState("descriptionElementId"), f = i.useState("disablePointerDismissal"), h = i.useState("floatingRootContext"), p = i.useState("popupProps"), m = i.useState("modal"), g = i.useState("mounted"), b = i.useState("nested"), C = i.useState("nestedOpenDialogCount"), T = i.useState("open"), y = i.useState("openMethod"), E = i.useState("titleElementId"), x = i.useState("transitionStatus"), k = i.useState("role");
|
|
2192
|
+
Fr(), Wt({
|
|
2193
|
+
open: T,
|
|
2194
|
+
ref: i.context.popupRef,
|
|
2195
|
+
onComplete() {
|
|
2196
|
+
T && i.context.onOpenChangeComplete?.(!0);
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
function w(H) {
|
|
2200
|
+
return H === "touch" ? i.context.popupRef.current : !0;
|
|
2201
|
+
}
|
|
2202
|
+
const D = s === void 0 ? w : s, I = C > 0, B = u.useMemo(() => ({
|
|
2203
|
+
open: T,
|
|
2204
|
+
nested: b,
|
|
2205
|
+
transitionStatus: x,
|
|
2206
|
+
nestedDialogOpen: I
|
|
2207
|
+
}), [T, b, x, I]), W = Re("div", t, {
|
|
2208
|
+
state: B,
|
|
2209
|
+
props: [p, {
|
|
2210
|
+
"aria-labelledby": E ?? void 0,
|
|
2211
|
+
"aria-describedby": c ?? void 0,
|
|
2212
|
+
role: k,
|
|
2213
|
+
tabIndex: -1,
|
|
2214
|
+
hidden: !g,
|
|
2215
|
+
onKeyDown(H) {
|
|
2216
|
+
fo.has(H.key) && H.stopPropagation();
|
|
2217
|
+
},
|
|
2218
|
+
style: {
|
|
2219
|
+
[Pr.nestedDialogs]: C
|
|
2220
|
+
}
|
|
2221
|
+
}, l],
|
|
2222
|
+
ref: [n, i.context.popupRef, i.useStateSetter("popupElement")],
|
|
2223
|
+
stateAttributesMapping: _r
|
|
2224
|
+
});
|
|
2225
|
+
return /* @__PURE__ */ K(Io, {
|
|
2226
|
+
context: h,
|
|
2227
|
+
openInteractionType: y,
|
|
2228
|
+
disabled: !g,
|
|
2229
|
+
closeOnFocusOut: !f,
|
|
2230
|
+
initialFocus: D,
|
|
2231
|
+
returnFocus: r,
|
|
2232
|
+
modal: m !== !1,
|
|
2233
|
+
restoreFocus: "popup",
|
|
2234
|
+
children: W
|
|
2235
|
+
});
|
|
2236
|
+
});
|
|
2237
|
+
process.env.NODE_ENV !== "production" && (En.displayName = "DialogPopup");
|
|
2238
|
+
const yn = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2239
|
+
const {
|
|
2240
|
+
cutout: o,
|
|
2241
|
+
...r
|
|
2242
|
+
} = t;
|
|
2243
|
+
let s;
|
|
2244
|
+
if (o) {
|
|
2245
|
+
const a = o?.getBoundingClientRect();
|
|
2246
|
+
s = `polygon(
|
|
2247
|
+
0% 0%,
|
|
2248
|
+
100% 0%,
|
|
2249
|
+
100% 100%,
|
|
2250
|
+
0% 100%,
|
|
2251
|
+
0% 0%,
|
|
2252
|
+
${a.left}px ${a.top}px,
|
|
2253
|
+
${a.left}px ${a.bottom}px,
|
|
2254
|
+
${a.right}px ${a.bottom}px,
|
|
2255
|
+
${a.right}px ${a.top}px,
|
|
2256
|
+
${a.left}px ${a.top}px
|
|
2257
|
+
)`;
|
|
2258
|
+
}
|
|
2259
|
+
return /* @__PURE__ */ K("div", {
|
|
2260
|
+
ref: n,
|
|
2261
|
+
role: "presentation",
|
|
2262
|
+
"data-base-ui-inert": "",
|
|
2263
|
+
...r,
|
|
2264
|
+
style: {
|
|
2265
|
+
position: "fixed",
|
|
2266
|
+
inset: 0,
|
|
2267
|
+
userSelect: "none",
|
|
2268
|
+
WebkitUserSelect: "none",
|
|
2269
|
+
clipPath: s
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
});
|
|
2273
|
+
process.env.NODE_ENV !== "production" && (yn.displayName = "InternalBackdrop");
|
|
2274
|
+
const bn = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2275
|
+
const {
|
|
2276
|
+
keepMounted: o = !1,
|
|
2277
|
+
...r
|
|
2278
|
+
} = t, {
|
|
2279
|
+
store: s
|
|
2280
|
+
} = de(), a = s.useState("mounted"), l = s.useState("modal");
|
|
2281
|
+
return a || o ? /* @__PURE__ */ K(ut.Provider, {
|
|
2282
|
+
value: o,
|
|
2283
|
+
children: /* @__PURE__ */ At(oo, {
|
|
2284
|
+
ref: n,
|
|
2285
|
+
...r,
|
|
2286
|
+
children: [a && l === !0 && /* @__PURE__ */ K(yn, {
|
|
2287
|
+
ref: s.context.internalBackdropRef,
|
|
2288
|
+
inert: ro(!open)
|
|
2289
|
+
}), t.children]
|
|
2290
|
+
})
|
|
2291
|
+
}) : null;
|
|
2292
|
+
});
|
|
2293
|
+
process.env.NODE_ENV !== "production" && (bn.displayName = "DialogPortal");
|
|
2294
|
+
const vn = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2295
|
+
const {
|
|
2296
|
+
render: o,
|
|
2297
|
+
className: r,
|
|
2298
|
+
id: s,
|
|
2299
|
+
...a
|
|
2300
|
+
} = t, {
|
|
2301
|
+
store: l
|
|
2302
|
+
} = de(), i = it(s);
|
|
2303
|
+
return l.useSyncedValueWithCleanup("titleElementId", i), Re("h2", t, {
|
|
2304
|
+
ref: n,
|
|
2305
|
+
props: [{
|
|
2306
|
+
id: i
|
|
2307
|
+
}, a]
|
|
2308
|
+
});
|
|
2309
|
+
});
|
|
2310
|
+
process.env.NODE_ENV !== "production" && (vn.displayName = "DialogTitle");
|
|
2311
|
+
const Sn = /* @__PURE__ */ u.forwardRef(function(t, n) {
|
|
2312
|
+
const {
|
|
2313
|
+
render: o,
|
|
2314
|
+
className: r,
|
|
2315
|
+
disabled: s = !1,
|
|
2316
|
+
nativeButton: a = !0,
|
|
2317
|
+
id: l,
|
|
2318
|
+
payload: i,
|
|
2319
|
+
handle: c,
|
|
2320
|
+
...f
|
|
2321
|
+
} = t, h = de(!0), p = c?.store ?? h?.store;
|
|
2322
|
+
if (!p)
|
|
2323
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle." : Me(79));
|
|
2324
|
+
const m = it(l), g = p.useState("floatingRootContext"), b = p.useState("isOpenedByTrigger", m), C = u.useRef(null), {
|
|
2325
|
+
registerTrigger: T,
|
|
2326
|
+
isMountedByThisTrigger: y
|
|
2327
|
+
} = ur(m, C, p, {
|
|
2328
|
+
payload: i
|
|
2329
|
+
}), {
|
|
2330
|
+
getButtonProps: E,
|
|
2331
|
+
buttonRef: x
|
|
2332
|
+
} = Ht({
|
|
2333
|
+
disabled: s,
|
|
2334
|
+
native: a
|
|
2335
|
+
}), k = No(g, {
|
|
2336
|
+
enabled: g != null
|
|
2337
|
+
}), w = pn([k]), D = u.useMemo(() => ({
|
|
2338
|
+
disabled: s,
|
|
2339
|
+
open: b
|
|
2340
|
+
}), [s, b]), I = p.useState("triggerProps", y);
|
|
2341
|
+
return Re("button", t, {
|
|
2342
|
+
state: D,
|
|
2343
|
+
ref: [x, n, T, C],
|
|
2344
|
+
props: [w.getReferenceProps(), I, {
|
|
2345
|
+
[Xt]: "",
|
|
2346
|
+
id: m
|
|
2347
|
+
}, f, E],
|
|
2348
|
+
stateAttributesMapping: Nr
|
|
2349
|
+
});
|
|
2350
|
+
});
|
|
2351
|
+
process.env.NODE_ENV !== "production" && (Sn.displayName = "DialogTrigger");
|
|
2352
|
+
const Cn = Fn(null), Lr = ({
|
|
2353
|
+
children: e,
|
|
2354
|
+
withFade: t = !1,
|
|
2355
|
+
cancelRef: n
|
|
2356
|
+
}) => /* @__PURE__ */ K(
|
|
2357
|
+
Cn.Provider,
|
|
2358
|
+
{
|
|
2359
|
+
value: {
|
|
2360
|
+
cancelRef: n,
|
|
2361
|
+
withFade: t
|
|
2362
|
+
},
|
|
2363
|
+
children: e
|
|
2364
|
+
}
|
|
2365
|
+
), dt = () => {
|
|
2366
|
+
const e = _n(Cn);
|
|
2367
|
+
if (!e)
|
|
2368
|
+
throw Error("useAlertDialog must be used within an AlertDialog provider");
|
|
2369
|
+
return e;
|
|
2370
|
+
}, Rn = ({ onOpenChange: e, withFade: t = !1, ...n }) => {
|
|
2371
|
+
const o = _t(null);
|
|
2372
|
+
return /* @__PURE__ */ K(Lr, { withFade: t, cancelRef: o, children: /* @__PURE__ */ K(
|
|
2373
|
+
Or,
|
|
49
2374
|
{
|
|
50
2375
|
"data-spark-component": "alert-dialog",
|
|
51
|
-
onOpenChange:
|
|
52
|
-
|
|
2376
|
+
onOpenChange: e ? (s, a) => {
|
|
2377
|
+
e(s);
|
|
2378
|
+
} : void 0,
|
|
2379
|
+
...n
|
|
53
2380
|
}
|
|
54
2381
|
) });
|
|
55
2382
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return asChild ? ({ ...props }) => /* @__PURE__ */ jsx3(Component, { ...props }) : void 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// src/alert-dialog/AlertDialogAction.tsx
|
|
69
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
70
|
-
var AlertDialogAction = ({ asChild = false, ...props }) => {
|
|
71
|
-
const renderSlot = useRenderSlot(asChild, "button");
|
|
72
|
-
return /* @__PURE__ */ jsx4(
|
|
73
|
-
BaseAlertDialog2.Close,
|
|
2383
|
+
Rn.displayName = "AlertDialog";
|
|
2384
|
+
function ft(e, t) {
|
|
2385
|
+
const n = e ? po : t;
|
|
2386
|
+
return e ? ({ ...o }) => /* @__PURE__ */ K(n, { ...o }) : void 0;
|
|
2387
|
+
}
|
|
2388
|
+
const Tn = ({ asChild: e = !1, ...t }) => {
|
|
2389
|
+
const n = ft(e, "button");
|
|
2390
|
+
return /* @__PURE__ */ K(
|
|
2391
|
+
ct,
|
|
74
2392
|
{
|
|
75
2393
|
"data-spark-component": "alert-dialog-action",
|
|
76
|
-
render:
|
|
77
|
-
...
|
|
2394
|
+
render: n,
|
|
2395
|
+
...t
|
|
78
2396
|
}
|
|
79
2397
|
);
|
|
80
2398
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
89
|
-
var AlertDialogBody = ({
|
|
90
|
-
children,
|
|
91
|
-
className,
|
|
92
|
-
inset = false,
|
|
93
|
-
ref: forwardedRef,
|
|
94
|
-
...rest
|
|
2399
|
+
Tn.displayName = "AlertDialog.Action";
|
|
2400
|
+
const On = ({
|
|
2401
|
+
children: e,
|
|
2402
|
+
className: t,
|
|
2403
|
+
inset: n = !1,
|
|
2404
|
+
ref: o,
|
|
2405
|
+
...r
|
|
95
2406
|
}) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const { withFade } = useAlertDialog();
|
|
99
|
-
const { overflow } = useScrollOverflow(scrollAreaRef);
|
|
100
|
-
return /* @__PURE__ */ jsx5(
|
|
2407
|
+
const s = _t(null), a = tn(o, s), { withFade: l } = dt(), { overflow: i } = go(s);
|
|
2408
|
+
return /* @__PURE__ */ K(
|
|
101
2409
|
"div",
|
|
102
2410
|
{
|
|
103
2411
|
"data-spark-component": "alert-dialog-body",
|
|
104
|
-
ref,
|
|
105
|
-
className:
|
|
2412
|
+
ref: a,
|
|
2413
|
+
className: Te(
|
|
106
2414
|
"focus-visible:u-outline relative grow overflow-y-auto outline-hidden",
|
|
107
2415
|
"transition-all duration-300",
|
|
108
2416
|
{
|
|
109
|
-
|
|
2417
|
+
"px-xl py-lg": !n
|
|
110
2418
|
},
|
|
111
|
-
|
|
2419
|
+
t
|
|
112
2420
|
),
|
|
113
2421
|
style: {
|
|
114
|
-
...
|
|
2422
|
+
...l && {
|
|
115
2423
|
maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
|
|
116
|
-
maskSize: `100% calc(100% + ${
|
|
117
|
-
maskPosition: `0 ${
|
|
2424
|
+
maskSize: `100% calc(100% + ${i.top ? "0px" : "44px"} + ${i.bottom ? "0px" : "44px"})`,
|
|
2425
|
+
maskPosition: `0 ${i.top ? "0px" : "-44px"}`
|
|
118
2426
|
}
|
|
119
2427
|
},
|
|
120
|
-
...
|
|
121
|
-
children
|
|
2428
|
+
...r,
|
|
2429
|
+
children: e
|
|
122
2430
|
}
|
|
123
2431
|
);
|
|
124
2432
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
131
|
-
var AlertDialogCancel = ({
|
|
132
|
-
asChild = false,
|
|
133
|
-
ref: forwardedRef,
|
|
134
|
-
...props
|
|
2433
|
+
On.displayName = "AlertDialog.Body";
|
|
2434
|
+
const wn = ({
|
|
2435
|
+
asChild: e = !1,
|
|
2436
|
+
ref: t,
|
|
2437
|
+
...n
|
|
135
2438
|
}) => {
|
|
136
|
-
const { cancelRef } =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return /* @__PURE__ */ jsx6(
|
|
140
|
-
BaseAlertDialog3.Close,
|
|
2439
|
+
const { cancelRef: o } = dt(), r = tn(t, o), s = ft(e, "button");
|
|
2440
|
+
return /* @__PURE__ */ K(
|
|
2441
|
+
ct,
|
|
141
2442
|
{
|
|
142
|
-
ref,
|
|
2443
|
+
ref: r,
|
|
143
2444
|
"data-spark-component": "alert-dialog-cancel",
|
|
144
|
-
render:
|
|
145
|
-
...
|
|
2445
|
+
render: s,
|
|
2446
|
+
...n
|
|
146
2447
|
}
|
|
147
2448
|
);
|
|
148
2449
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var AlertDialogContent = ({
|
|
156
|
-
className,
|
|
157
|
-
ref,
|
|
158
|
-
initialFocus,
|
|
159
|
-
...others
|
|
2450
|
+
wn.displayName = "AlertDialog.Cancel";
|
|
2451
|
+
const xn = ({
|
|
2452
|
+
className: e,
|
|
2453
|
+
ref: t,
|
|
2454
|
+
initialFocus: n,
|
|
2455
|
+
...o
|
|
160
2456
|
}) => {
|
|
161
|
-
const { cancelRef } =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
BaseAlertDialog4.Popup,
|
|
2457
|
+
const { cancelRef: r } = dt();
|
|
2458
|
+
return /* @__PURE__ */ K(
|
|
2459
|
+
En,
|
|
165
2460
|
{
|
|
166
|
-
ref,
|
|
2461
|
+
ref: t,
|
|
167
2462
|
"data-spark-component": "alert-dialog-content",
|
|
168
2463
|
role: "alertdialog",
|
|
169
|
-
className: (
|
|
170
|
-
|
|
2464
|
+
className: (a) => Te(
|
|
2465
|
+
mo({ size: "md", isNarrow: !0 }),
|
|
171
2466
|
"min-w-sz-288",
|
|
172
2467
|
// Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
|
|
173
2468
|
// Transition with opacity and scale for smooth open/close animations
|
|
174
2469
|
"transition-all duration-150",
|
|
175
2470
|
"data-starting-style:scale-90 data-starting-style:opacity-0",
|
|
176
2471
|
"data-ending-style:scale-90 data-ending-style:opacity-0",
|
|
177
|
-
typeof
|
|
2472
|
+
typeof e == "function" ? e(a) : e
|
|
178
2473
|
),
|
|
179
|
-
initialFocus:
|
|
180
|
-
...
|
|
2474
|
+
initialFocus: n !== void 0 ? n : () => r.current,
|
|
2475
|
+
...o
|
|
181
2476
|
}
|
|
182
2477
|
);
|
|
183
2478
|
};
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// src/alert-dialog/AlertDialogFooter.tsx
|
|
195
|
-
import { cx as cx3 } from "class-variance-authority";
|
|
196
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
197
|
-
var AlertDialogFooter = ({
|
|
198
|
-
children,
|
|
199
|
-
className,
|
|
200
|
-
ref,
|
|
201
|
-
...rest
|
|
202
|
-
}) => /* @__PURE__ */ jsx9(
|
|
2479
|
+
xn.displayName = "AlertDialog.Content";
|
|
2480
|
+
const Dn = (e) => /* @__PURE__ */ K(hn, { "data-spark-component": "alert-dialog-description", ...e });
|
|
2481
|
+
Dn.displayName = "AlertDialog.Description";
|
|
2482
|
+
const kn = ({
|
|
2483
|
+
children: e,
|
|
2484
|
+
className: t,
|
|
2485
|
+
ref: n,
|
|
2486
|
+
...o
|
|
2487
|
+
}) => /* @__PURE__ */ K(
|
|
203
2488
|
"footer",
|
|
204
2489
|
{
|
|
205
2490
|
"data-spark-component": "alert-dialog-footer",
|
|
206
|
-
ref,
|
|
207
|
-
className:
|
|
208
|
-
...
|
|
209
|
-
children
|
|
2491
|
+
ref: n,
|
|
2492
|
+
className: Te(t, ["px-xl", "py-lg"]),
|
|
2493
|
+
...o,
|
|
2494
|
+
children: e
|
|
210
2495
|
}
|
|
211
2496
|
);
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
className,
|
|
220
|
-
ref,
|
|
221
|
-
...rest
|
|
222
|
-
}) => /* @__PURE__ */ jsx10(
|
|
2497
|
+
kn.displayName = "AlertDialog.Footer";
|
|
2498
|
+
const In = ({
|
|
2499
|
+
children: e,
|
|
2500
|
+
className: t,
|
|
2501
|
+
ref: n,
|
|
2502
|
+
...o
|
|
2503
|
+
}) => /* @__PURE__ */ K(
|
|
223
2504
|
"header",
|
|
224
2505
|
{
|
|
225
2506
|
"data-spark-component": "alert-dialog-header",
|
|
226
|
-
ref,
|
|
227
|
-
className:
|
|
228
|
-
...
|
|
229
|
-
children
|
|
2507
|
+
ref: n,
|
|
2508
|
+
className: Te(t, ["px-xl", "py-lg"]),
|
|
2509
|
+
...o,
|
|
2510
|
+
children: e
|
|
230
2511
|
}
|
|
231
2512
|
);
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
"data-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
// src/alert-dialog/AlertDialogTitle.tsx
|
|
266
|
-
import { AlertDialog as BaseAlertDialog8 } from "@base-ui/react/alert-dialog";
|
|
267
|
-
import { cx as cx6 } from "class-variance-authority";
|
|
268
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
269
|
-
var AlertDialogTitle = ({ className, ...props }) => {
|
|
270
|
-
return /* @__PURE__ */ jsx13(
|
|
271
|
-
BaseAlertDialog8.Title,
|
|
272
|
-
{
|
|
273
|
-
"data-spark-component": "alert-dialog-title",
|
|
274
|
-
className: cx6("text-headline-1 text-on-surface", className),
|
|
275
|
-
...props
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
};
|
|
279
|
-
AlertDialogTitle.displayName = "AlertDialog.Title";
|
|
280
|
-
|
|
281
|
-
// src/alert-dialog/AlertDialogTrigger.tsx
|
|
282
|
-
import { AlertDialog as BaseAlertDialog9 } from "@base-ui/react/alert-dialog";
|
|
283
|
-
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
284
|
-
var AlertDialogTrigger = ({ asChild = false, ...props }) => {
|
|
285
|
-
const renderSlot = useRenderSlot(asChild, "button");
|
|
286
|
-
return /* @__PURE__ */ jsx14(
|
|
287
|
-
BaseAlertDialog9.Trigger,
|
|
2513
|
+
In.displayName = "AlertDialog.Header";
|
|
2514
|
+
const Nn = ({ className: e, ...t }) => /* @__PURE__ */ K(
|
|
2515
|
+
mn,
|
|
2516
|
+
{
|
|
2517
|
+
"data-spark-component": "alert-dialog-overlay",
|
|
2518
|
+
className: (n) => Te(
|
|
2519
|
+
"z-overlay fixed top-0 left-0 h-screen w-screen",
|
|
2520
|
+
"bg-overlay/dim-1",
|
|
2521
|
+
// Base UI automatically adds data-[starting-style] and data-[ending-style] attributes
|
|
2522
|
+
"data-[starting-style]:animate-fade-in",
|
|
2523
|
+
"data-[ending-style]:animate-fade-out",
|
|
2524
|
+
typeof e == "function" ? e(n) : e
|
|
2525
|
+
),
|
|
2526
|
+
...t
|
|
2527
|
+
}
|
|
2528
|
+
);
|
|
2529
|
+
Nn.displayName = "AlertDialog.Overlay";
|
|
2530
|
+
const Mn = (e) => /* @__PURE__ */ K(bn, { "data-spark-component": "alert-dialog-portal", ...e });
|
|
2531
|
+
Mn.displayName = "AlertDialog.Portal";
|
|
2532
|
+
const Pn = ({ className: e, ...t }) => /* @__PURE__ */ K(
|
|
2533
|
+
vn,
|
|
2534
|
+
{
|
|
2535
|
+
"data-spark-component": "alert-dialog-title",
|
|
2536
|
+
className: Te("text-headline-1 text-on-surface", e),
|
|
2537
|
+
...t
|
|
2538
|
+
}
|
|
2539
|
+
);
|
|
2540
|
+
Pn.displayName = "AlertDialog.Title";
|
|
2541
|
+
const An = ({ asChild: e = !1, ...t }) => {
|
|
2542
|
+
const n = ft(e, "button");
|
|
2543
|
+
return /* @__PURE__ */ K(
|
|
2544
|
+
Sn,
|
|
288
2545
|
{
|
|
289
2546
|
"data-spark-component": "alert-dialog-trigger",
|
|
290
|
-
render:
|
|
291
|
-
...
|
|
2547
|
+
render: n,
|
|
2548
|
+
...t
|
|
292
2549
|
}
|
|
293
2550
|
);
|
|
294
2551
|
};
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
Title: AlertDialogTitle,
|
|
309
|
-
Trigger: AlertDialogTrigger
|
|
2552
|
+
An.displayName = "AlertDialog.Trigger";
|
|
2553
|
+
const ee = Object.assign(Rn, {
|
|
2554
|
+
Action: Tn,
|
|
2555
|
+
Body: On,
|
|
2556
|
+
Cancel: wn,
|
|
2557
|
+
Content: xn,
|
|
2558
|
+
Description: Dn,
|
|
2559
|
+
Footer: kn,
|
|
2560
|
+
Header: In,
|
|
2561
|
+
Overlay: Nn,
|
|
2562
|
+
Portal: Mn,
|
|
2563
|
+
Title: Pn,
|
|
2564
|
+
Trigger: An
|
|
310
2565
|
});
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
2566
|
+
ee.displayName = "AlertDialog";
|
|
2567
|
+
ee.Action.displayName = "AlertDialog.Action";
|
|
2568
|
+
ee.Body.displayName = "AlertDialog.Body";
|
|
2569
|
+
ee.Cancel.displayName = "AlertDialog.Cancel";
|
|
2570
|
+
ee.Content.displayName = "AlertDialog.Content";
|
|
2571
|
+
ee.Description.displayName = "AlertDialog.Description";
|
|
2572
|
+
ee.Footer.displayName = "AlertDialog.Footer";
|
|
2573
|
+
ee.Header.displayName = "AlertDialog.Header";
|
|
2574
|
+
ee.Overlay.displayName = "AlertDialog.Overlay";
|
|
2575
|
+
ee.Portal.displayName = "AlertDialog.Portal";
|
|
2576
|
+
ee.Title.displayName = "AlertDialog.Title";
|
|
2577
|
+
ee.Trigger.displayName = "AlertDialog.Trigger";
|
|
323
2578
|
export {
|
|
324
|
-
|
|
325
|
-
useAlertDialog
|
|
2579
|
+
ee as AlertDialog,
|
|
2580
|
+
dt as useAlertDialog
|
|
326
2581
|
};
|
|
327
|
-
//# sourceMappingURL=index.mjs.map
|
|
2582
|
+
//# sourceMappingURL=index.mjs.map
|