@spark-ui/components 13.1.4 → 13.2.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-B6rA3-e5.js +2 -0
- package/dist/Button-B6rA3-e5.js.map +1 -0
- package/dist/{chunk-2YM6GKWW.mjs → Button-C3C0aixy.mjs} +130 -173
- package/dist/Button-C3C0aixy.mjs.map +1 -0
- package/dist/DialogContent.styles-B5pR8ECK.js +2 -0
- package/dist/DialogContent.styles-B5pR8ECK.js.map +1 -0
- package/dist/{chunk-XZ47F6TP.mjs → DialogContent.styles-_lRDsl8c.mjs} +6 -8
- package/dist/DialogContent.styles-_lRDsl8c.mjs.map +1 -0
- package/dist/Icon-CF0W0LKr.js +2 -0
- package/dist/Icon-CF0W0LKr.js.map +1 -0
- package/dist/Icon-Ck-dhfLd.mjs +58 -0
- package/dist/Icon-Ck-dhfLd.mjs.map +1 -0
- package/dist/IconButton-C62-axzv.mjs +43 -0
- package/dist/IconButton-C62-axzv.mjs.map +1 -0
- package/dist/IconButton-D3g86WpZ.js +2 -0
- package/dist/IconButton-D3g86WpZ.js.map +1 -0
- package/dist/Slot-D2Bbf8Gw.mjs +14 -0
- package/dist/Slot-D2Bbf8Gw.mjs.map +1 -0
- package/dist/Slot-DQ8z2zsy.js +2 -0
- package/dist/Slot-DQ8z2zsy.js.map +1 -0
- package/dist/Spinner-_Kffli3B.js +2 -0
- package/dist/Spinner-_Kffli3B.js.map +1 -0
- package/dist/{chunk-GAK4SC2F.mjs → Spinner-jF3-zoh_.mjs} +29 -40
- package/dist/Spinner-jF3-zoh_.mjs.map +1 -0
- package/dist/{chunk-RKPP7ZOK.mjs → TextLink-BuzFRWO6.mjs} +27 -36
- package/dist/TextLink-BuzFRWO6.mjs.map +1 -0
- package/dist/TextLink-C3xDLsbC.js +2 -0
- package/dist/TextLink-C3xDLsbC.js.map +1 -0
- package/dist/VisuallyHidden-CB6Nx76j.js +2 -0
- package/dist/VisuallyHidden-CB6Nx76j.js.map +1 -0
- package/dist/VisuallyHidden-KH1biLx-.mjs +28 -0
- package/dist/VisuallyHidden-KH1biLx-.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.mts +10 -68
- 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 +114 -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.mts +26 -147
- package/dist/alert-dialog/index.d.ts +26 -147
- package/dist/alert-dialog/index.js +2 -405
- package/dist/alert-dialog/index.js.map +1 -1
- package/dist/alert-dialog/index.mjs +172 -260
- 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.mts +8 -59
- 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.mts +1 -47
- 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.mts +7 -59
- 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.mts +1 -41
- 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.mts +5 -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.mts +5 -58
- 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.mts +18 -263
- 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/types.d.ts +165 -0
- 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.mts +2 -120
- 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 +135 -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.mts +10 -92
- 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 +218 -324
- 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.mts +3 -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.mts +4 -40
- 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 +39 -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.mts +19 -271
- 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.mts +14 -0
- package/dist/combobox/utils/index.d.ts +14 -0
- package/dist/combobox/utils/useWidthIncreaseCallback.d.ts +2 -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.mts +25 -154
- 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.mts +4 -59
- 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 +79 -100
- package/dist/divider/index.mjs.map +1 -1
- package/dist/divider/variants/intents.d.ts +17 -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.mts +24 -141
- 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.mts +16 -220
- 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.mts +14 -262
- 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/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.mts +21 -176
- 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.mts +1 -28
- 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.mts +1 -16
- 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/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.mts +15 -72
- 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.mts +10 -128
- package/dist/input-otp/index.d.ts +10 -128
- package/dist/input-otp/index.js +2 -668
- package/dist/input-otp/index.js.map +1 -1
- package/dist/input-otp/index.mjs +295 -462
- package/dist/input-otp/index.mjs.map +1 -1
- package/dist/input-otp/useInputOTP.d.ts +45 -0
- package/dist/kbd/Kbd.d.ts +5 -0
- package/dist/kbd/index.d.mts +1 -9
- 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.mts +5 -9
- 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 +38 -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.mts +6 -31
- 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.mts +10 -135
- 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 +176 -269
- 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.mts +17 -6
- 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 +239 -11
- package/dist/popover/index.mjs.map +1 -1
- package/dist/portal/Portal.d.ts +10 -0
- package/dist/portal/index.d.mts +1 -13
- 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.mts +9 -48
- package/dist/progress/index.d.ts +9 -48
- package/dist/progress/index.js +2 -240
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +166 -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.mts +10 -80
- 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.mts +5 -98
- 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 +105 -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.mts +1 -78
- 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.mts +14 -117
- 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 +193 -325
- package/dist/scrolling-list/index.mjs.map +1 -1
- package/dist/scrolling-list/useFocusWithinScroll.d.ts +3 -0
- package/dist/segmented-gauge/SegmentedGauge.d.ts +66 -0
- 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.mts +9 -101
- 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.mts +12 -158
- 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.mts +8 -67
- 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 +60 -0
- package/dist/slider/Slider.styles.d.ts +1 -0
- package/dist/slider/SliderContext.d.ts +7 -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.mts +8 -97
- 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 +94 -111
- package/dist/slider/index.mjs.map +1 -1
- package/dist/slot/Slot.d.ts +12 -0
- package/dist/slot/index.d.mts +1 -16
- 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.mts +13 -158
- 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 +237 -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.mts +1 -21
- 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.mts +9 -81
- package/dist/stepper/index.d.ts +9 -81
- package/dist/stepper/index.js +2 -1847
- package/dist/stepper/index.js.map +1 -1
- package/dist/stepper/index.mjs +143 -195
- 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/SwitchInput.d.ts +51 -0
- 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.mts +1 -64
- 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 +90 -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.mts +13 -137
- 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 +224 -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.mts +1 -29
- 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.mts +3 -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.mts +1 -20
- 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.mts +10 -53
- 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.mts +10 -53
- 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 +126 -180
- 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/visually-hidden/VisuallyHidden.d.ts +12 -0
- package/dist/visually-hidden/index.d.mts +1 -16
- 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 +6 -6
- 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/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/index-Cno_GFuW.d.mts +0 -93
- package/dist/index-Cno_GFuW.d.ts +0 -93
|
@@ -1,317 +1,224 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
} from "
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
} from "../
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { createContext, useContext, useId } from "react";
|
|
18
|
-
|
|
19
|
-
// src/pagination/utils.ts
|
|
20
|
-
function sliceArrayWithIndex(arr, index, length) {
|
|
21
|
-
const relativeElements = (length - 1) / 2;
|
|
22
|
-
let start = Math.max(0, index - relativeElements);
|
|
23
|
-
let end = Math.min(arr.length, index + relativeElements + 1);
|
|
24
|
-
if (end - start < length) {
|
|
25
|
-
start = Math.max(0, Math.min(start, arr.length - length));
|
|
26
|
-
end = Math.min(arr.length, start + length);
|
|
27
|
-
}
|
|
28
|
-
return arr.slice(start, end);
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as v from "@zag-js/pagination";
|
|
3
|
+
import { useMachine as w, normalizeProps as D, mergeProps as u } from "@zag-js/react";
|
|
4
|
+
import { createContext as F, useId as A, useContext as E } from "react";
|
|
5
|
+
import { cx as R } from "class-variance-authority";
|
|
6
|
+
import { ArrowDoubleLeft as j } from "@spark-ui/icons/ArrowDoubleLeft";
|
|
7
|
+
import { I as h } from "../Icon-Ck-dhfLd.mjs";
|
|
8
|
+
import { I as P } from "../IconButton-C62-axzv.mjs";
|
|
9
|
+
import { B as L } from "../Button-C3C0aixy.mjs";
|
|
10
|
+
import { ArrowDoubleRight as z } from "@spark-ui/icons/ArrowDoubleRight";
|
|
11
|
+
import { ArrowVerticalRight as B } from "@spark-ui/icons/ArrowVerticalRight";
|
|
12
|
+
import { ArrowVerticalLeft as $ } from "@spark-ui/icons/ArrowVerticalLeft";
|
|
13
|
+
function V(i, e, n) {
|
|
14
|
+
const a = (n - 1) / 2;
|
|
15
|
+
let r = Math.max(0, e - a), s = Math.min(i.length, e + a + 1);
|
|
16
|
+
return s - r < n && (r = Math.max(0, Math.min(r, i.length - n)), s = Math.min(i.length, r + n)), i.slice(r, s);
|
|
29
17
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
page,
|
|
40
|
-
onPageChange,
|
|
41
|
-
noEllipsis,
|
|
42
|
-
type = "link"
|
|
18
|
+
const C = F(null), W = ({
|
|
19
|
+
children: i,
|
|
20
|
+
count: e,
|
|
21
|
+
visiblePageItems: n = 7,
|
|
22
|
+
pageSize: a,
|
|
23
|
+
page: r,
|
|
24
|
+
onPageChange: s,
|
|
25
|
+
noEllipsis: l,
|
|
26
|
+
type: g = "link"
|
|
43
27
|
}) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const api = pagination.connect(service, normalizeProps);
|
|
56
|
-
const pages = noEllipsis ? sliceArrayWithIndex(api.pages, api.page - 1, visiblePageItems) : api.pages;
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
PaginationContext.Provider,
|
|
28
|
+
const p = l ? 1 / 0 : Math.max(0, Math.floor((n - 5) / 2)), d = A(), c = w(v.machine, {
|
|
29
|
+
id: d,
|
|
30
|
+
count: e,
|
|
31
|
+
siblingCount: p,
|
|
32
|
+
pageSize: a,
|
|
33
|
+
page: r,
|
|
34
|
+
onPageChange: s,
|
|
35
|
+
type: g
|
|
36
|
+
}), o = v.connect(c, D), M = l ? V(o.pages, o.page - 1, n) : o.pages;
|
|
37
|
+
return /* @__PURE__ */ t(
|
|
38
|
+
C.Provider,
|
|
59
39
|
{
|
|
60
40
|
value: {
|
|
61
|
-
type,
|
|
41
|
+
type: g,
|
|
62
42
|
pagination: {
|
|
63
|
-
...
|
|
64
|
-
pages,
|
|
43
|
+
...o,
|
|
44
|
+
pages: M,
|
|
65
45
|
// Extending ZagJS anatomy
|
|
66
|
-
getFirstPageTriggerProps: () => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"data-part": "last-page-trigger",
|
|
79
|
-
onClick: api.goToLastPage
|
|
80
|
-
};
|
|
81
|
-
}
|
|
46
|
+
getFirstPageTriggerProps: () => ({
|
|
47
|
+
...o.getPrevTriggerProps(),
|
|
48
|
+
id: `${o.getRootProps().id}:first`,
|
|
49
|
+
"data-part": "first-page-trigger",
|
|
50
|
+
onClick: o.goToFirstPage
|
|
51
|
+
}),
|
|
52
|
+
getLastPageTriggerProps: () => ({
|
|
53
|
+
...o.getNextTriggerProps(),
|
|
54
|
+
id: `${o.getRootProps().id}:last`,
|
|
55
|
+
"data-part": "last-page-trigger",
|
|
56
|
+
onClick: o.goToLastPage
|
|
57
|
+
})
|
|
82
58
|
}
|
|
83
59
|
},
|
|
84
|
-
children
|
|
60
|
+
children: i
|
|
85
61
|
}
|
|
86
62
|
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (!context) {
|
|
63
|
+
}, m = () => {
|
|
64
|
+
const i = E(C);
|
|
65
|
+
if (!i)
|
|
91
66
|
throw Error("usePagination must be used within a Pagination provider");
|
|
67
|
+
return i;
|
|
68
|
+
}, I = ({
|
|
69
|
+
children: i,
|
|
70
|
+
visiblePageItems: e = 5,
|
|
71
|
+
type: n = "link",
|
|
72
|
+
noEllipsis: a = !1,
|
|
73
|
+
className: r,
|
|
74
|
+
...s
|
|
75
|
+
}) => /* @__PURE__ */ t(
|
|
76
|
+
W,
|
|
77
|
+
{
|
|
78
|
+
visiblePageItems: e,
|
|
79
|
+
noEllipsis: a,
|
|
80
|
+
type: n,
|
|
81
|
+
...s,
|
|
82
|
+
children: /* @__PURE__ */ t(O, { className: r, children: i })
|
|
92
83
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// src/pagination/Pagination.tsx
|
|
97
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
98
|
-
var Pagination = ({
|
|
99
|
-
children,
|
|
100
|
-
visiblePageItems = 5,
|
|
101
|
-
type = "link",
|
|
102
|
-
noEllipsis = false,
|
|
103
|
-
className,
|
|
104
|
-
...rest
|
|
105
|
-
}) => {
|
|
106
|
-
return /* @__PURE__ */ jsx2(
|
|
107
|
-
PaginationProvider,
|
|
108
|
-
{
|
|
109
|
-
visiblePageItems,
|
|
110
|
-
noEllipsis,
|
|
111
|
-
type,
|
|
112
|
-
...rest,
|
|
113
|
-
children: /* @__PURE__ */ jsx2(PaginationWrapper, { className, children })
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
var PaginationWrapper = ({
|
|
118
|
-
children,
|
|
119
|
-
className
|
|
84
|
+
), O = ({
|
|
85
|
+
children: i,
|
|
86
|
+
className: e
|
|
120
87
|
}) => {
|
|
121
|
-
const { pagination:
|
|
122
|
-
|
|
123
|
-
return /* @__PURE__ */ jsx2("nav", { "data-spark-component": "pagination", ...props, className, children: /* @__PURE__ */ jsx2("ul", { className: "gap-md flex flex-wrap", children }) });
|
|
88
|
+
const { pagination: n } = m(), a = n.getRootProps();
|
|
89
|
+
return /* @__PURE__ */ t("nav", { "data-spark-component": "pagination", ...a, className: e, children: /* @__PURE__ */ t("ul", { className: "gap-md flex flex-wrap", children: i }) });
|
|
124
90
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const { pagination: pagination2 } = usePagination();
|
|
133
|
-
const apiProps = pagination2.getEllipsisProps({ index });
|
|
134
|
-
const localProps = {
|
|
135
|
-
className: cx("flex size-sz-44 items-center justify-center", className),
|
|
136
|
-
...rest
|
|
137
|
-
};
|
|
138
|
-
const mergedProps = mergeProps(apiProps, localProps);
|
|
139
|
-
return /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3("span", { "data-spark-component": "pagination-ellipsis", ref, ...mergedProps, children: children || "\u2026" }) });
|
|
91
|
+
I.displayName = "Pagination";
|
|
92
|
+
const k = ({ children: i, index: e, className: n, ref: a, ...r }) => {
|
|
93
|
+
const { pagination: s } = m(), l = s.getEllipsisProps({ index: e }), g = {
|
|
94
|
+
className: R("flex size-sz-44 items-center justify-center", n),
|
|
95
|
+
...r
|
|
96
|
+
}, p = u(l, g);
|
|
97
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t("span", { "data-spark-component": "pagination-ellipsis", ref: a, ...p, children: i || "…" }) });
|
|
140
98
|
};
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
children,
|
|
149
|
-
className,
|
|
150
|
-
href,
|
|
151
|
-
ref,
|
|
152
|
-
...props
|
|
99
|
+
k.displayName = "Pagination.Ellipsis";
|
|
100
|
+
const y = ({
|
|
101
|
+
children: i,
|
|
102
|
+
className: e,
|
|
103
|
+
href: n,
|
|
104
|
+
ref: a,
|
|
105
|
+
...r
|
|
153
106
|
}) => {
|
|
154
|
-
const { pagination:
|
|
155
|
-
const apiProps = pagination2.getFirstPageTriggerProps();
|
|
156
|
-
const shouldDisableLink = type === "link" && apiProps["data-disabled"] === "";
|
|
157
|
-
const localProps = {
|
|
107
|
+
const { pagination: s, type: l } = m(), g = s.getFirstPageTriggerProps(), p = l === "link" && g["data-disabled"] === "", d = {
|
|
158
108
|
"data-spark-component": "pagination-first-page-trigger",
|
|
159
109
|
intent: "support",
|
|
160
110
|
design: "contrast",
|
|
161
|
-
...
|
|
162
|
-
className,
|
|
163
|
-
...
|
|
164
|
-
disabled:
|
|
111
|
+
...r,
|
|
112
|
+
className: e,
|
|
113
|
+
...p && {
|
|
114
|
+
disabled: !0,
|
|
165
115
|
role: "link",
|
|
166
|
-
"aria-disabled":
|
|
116
|
+
"aria-disabled": !0
|
|
167
117
|
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
);
|
|
173
|
-
const content = children || /* @__PURE__ */ jsx4(Icon, { children: /* @__PURE__ */ jsx4(ArrowDoubleLeft, {}) });
|
|
174
|
-
return /* @__PURE__ */ jsx4("li", { children: href ? /* @__PURE__ */ jsx4(IconButton, { ref, ...mergedProps, asChild: true, children: /* @__PURE__ */ jsx4("a", { href: shouldDisableLink ? void 0 : href, children: content }) }) : /* @__PURE__ */ jsx4(IconButton, { ref, ...mergedProps, children: content }) });
|
|
118
|
+
}, c = u(
|
|
119
|
+
g,
|
|
120
|
+
d
|
|
121
|
+
), o = i || /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(j, {}) });
|
|
122
|
+
return /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(P, { ref: a, ...c, asChild: !0, children: /* @__PURE__ */ t("a", { href: p ? void 0 : n, children: o }) }) : /* @__PURE__ */ t(P, { ref: a, ...c, children: o }) });
|
|
175
123
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
import { mergeProps as mergeProps3 } from "@zag-js/react";
|
|
180
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
181
|
-
var Item = ({ children, value, className, href, ref, ...props }) => {
|
|
182
|
-
const { pagination: pagination2 } = usePagination();
|
|
183
|
-
const apiProps = pagination2.getItemProps({ type: "page", value });
|
|
184
|
-
const localProps = {
|
|
124
|
+
y.displayName = "Pagination.FirstPageTrigger";
|
|
125
|
+
const N = ({ children: i, value: e, className: n, href: a, ref: r, ...s }) => {
|
|
126
|
+
const { pagination: l } = m(), g = l.getItemProps({ type: "page", value: e }), p = {
|
|
185
127
|
"data-spark-component": "pagination-item",
|
|
186
128
|
intent: "support",
|
|
187
|
-
design:
|
|
188
|
-
className,
|
|
189
|
-
...
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
return /* @__PURE__ */ jsx5("li", { children: href ? /* @__PURE__ */ jsx5(Button, { ref, ...mergedProps, asChild: true, children: /* @__PURE__ */ jsx5("a", { href, children: children || value }) }) : /* @__PURE__ */ jsx5(Button, { ref, ...mergedProps, children: children || value }) });
|
|
129
|
+
design: g["aria-current"] === "page" ? "filled" : "contrast",
|
|
130
|
+
className: n,
|
|
131
|
+
...s
|
|
132
|
+
}, d = u(g, p);
|
|
133
|
+
return /* @__PURE__ */ t("li", { children: a ? /* @__PURE__ */ t(L, { ref: r, ...d, asChild: !0, children: /* @__PURE__ */ t("a", { href: a, children: i || e }) }) : /* @__PURE__ */ t(L, { ref: r, ...d, children: i || e }) });
|
|
193
134
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
children,
|
|
202
|
-
className,
|
|
203
|
-
href,
|
|
204
|
-
ref,
|
|
205
|
-
...props
|
|
135
|
+
N.displayName = "Pagination.Item";
|
|
136
|
+
const f = ({
|
|
137
|
+
children: i,
|
|
138
|
+
className: e,
|
|
139
|
+
href: n,
|
|
140
|
+
ref: a,
|
|
141
|
+
...r
|
|
206
142
|
}) => {
|
|
207
|
-
const { pagination:
|
|
208
|
-
const apiProps = pagination2.getLastPageTriggerProps();
|
|
209
|
-
const shouldDisableLink = type === "link" && apiProps["data-disabled"] === "";
|
|
210
|
-
const localProps = {
|
|
143
|
+
const { pagination: s, type: l } = m(), g = s.getLastPageTriggerProps(), p = l === "link" && g["data-disabled"] === "", d = {
|
|
211
144
|
"data-spark-component": "pagination-last-page-trigger",
|
|
212
145
|
intent: "support",
|
|
213
146
|
design: "contrast",
|
|
214
|
-
...
|
|
215
|
-
className,
|
|
216
|
-
...
|
|
217
|
-
disabled:
|
|
147
|
+
...r,
|
|
148
|
+
className: e,
|
|
149
|
+
...p && {
|
|
150
|
+
disabled: !0,
|
|
218
151
|
role: "link",
|
|
219
|
-
"aria-disabled":
|
|
152
|
+
"aria-disabled": !0
|
|
220
153
|
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
);
|
|
226
|
-
const content = children || /* @__PURE__ */ jsx6(Icon, { children: /* @__PURE__ */ jsx6(ArrowDoubleRight, {}) });
|
|
227
|
-
return /* @__PURE__ */ jsx6("li", { children: href ? /* @__PURE__ */ jsx6(IconButton, { ref, ...mergedProps, asChild: true, children: /* @__PURE__ */ jsx6("a", { href: shouldDisableLink ? void 0 : href, children: content }) }) : /* @__PURE__ */ jsx6(IconButton, { ref, ...mergedProps, children: content }) });
|
|
154
|
+
}, c = u(
|
|
155
|
+
g,
|
|
156
|
+
d
|
|
157
|
+
), o = i || /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(z, {}) });
|
|
158
|
+
return /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(P, { ref: a, ...c, asChild: !0, children: /* @__PURE__ */ t("a", { href: p ? void 0 : n, children: o }) }) : /* @__PURE__ */ t(P, { ref: a, ...c, children: o }) });
|
|
228
159
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
import { ArrowVerticalRight } from "@spark-ui/icons/ArrowVerticalRight";
|
|
233
|
-
import { mergeProps as mergeProps5 } from "@zag-js/react";
|
|
234
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
235
|
-
var NextTrigger = ({ children, className, href, ref, ...props }) => {
|
|
236
|
-
const { pagination: pagination2, type } = usePagination();
|
|
237
|
-
const apiProps = pagination2.getNextTriggerProps();
|
|
238
|
-
const shouldDisableLink = type === "link" && apiProps["data-disabled"] === "";
|
|
239
|
-
const localProps = {
|
|
160
|
+
f.displayName = "Pagination.LastPageTrigger";
|
|
161
|
+
const T = ({ children: i, className: e, href: n, ref: a, ...r }) => {
|
|
162
|
+
const { pagination: s, type: l } = m(), g = s.getNextTriggerProps(), p = l === "link" && g["data-disabled"] === "", d = {
|
|
240
163
|
"data-spark-component": "pagination-next-trigger",
|
|
241
164
|
intent: "support",
|
|
242
165
|
design: "contrast",
|
|
243
|
-
...
|
|
244
|
-
className,
|
|
245
|
-
...
|
|
246
|
-
disabled:
|
|
166
|
+
...r,
|
|
167
|
+
className: e,
|
|
168
|
+
...p && {
|
|
169
|
+
disabled: !0,
|
|
247
170
|
role: "link",
|
|
248
|
-
"aria-disabled":
|
|
171
|
+
"aria-disabled": !0
|
|
249
172
|
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
);
|
|
255
|
-
const content = children || /* @__PURE__ */ jsx7(Icon, { children: /* @__PURE__ */ jsx7(ArrowVerticalRight, {}) });
|
|
256
|
-
return /* @__PURE__ */ jsx7("li", { children: href ? /* @__PURE__ */ jsx7(IconButton, { ref, ...mergedProps, asChild: true, children: /* @__PURE__ */ jsx7("a", { href: shouldDisableLink ? void 0 : href, children: content }) }) : /* @__PURE__ */ jsx7(IconButton, { ref, ...mergedProps, children: content }) });
|
|
173
|
+
}, c = u(
|
|
174
|
+
g,
|
|
175
|
+
d
|
|
176
|
+
), o = i || /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t(B, {}) });
|
|
177
|
+
return /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(P, { ref: a, ...c, asChild: !0, children: /* @__PURE__ */ t("a", { href: p ? void 0 : n, children: o }) }) : /* @__PURE__ */ t(P, { ref: a, ...c, children: o }) });
|
|
257
178
|
};
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
const { pagination: pagination2 } = usePagination();
|
|
263
|
-
return children(pagination2);
|
|
179
|
+
T.displayName = "Pagination.NextTrigger";
|
|
180
|
+
const b = ({ children: i }) => {
|
|
181
|
+
const { pagination: e } = m();
|
|
182
|
+
return i(e);
|
|
264
183
|
};
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
import { ArrowVerticalLeft } from "@spark-ui/icons/ArrowVerticalLeft";
|
|
269
|
-
import { mergeProps as mergeProps6 } from "@zag-js/react";
|
|
270
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
271
|
-
var PrevTrigger = ({ children, className, href, ref, ...props }) => {
|
|
272
|
-
const { pagination: pagination2, type } = usePagination();
|
|
273
|
-
const apiProps = pagination2.getPrevTriggerProps();
|
|
274
|
-
const shouldDisableLink = type === "link" && apiProps["data-disabled"] === "";
|
|
275
|
-
const localProps = {
|
|
184
|
+
b.displayName = "Pagination.Pages";
|
|
185
|
+
const x = ({ children: i, className: e, href: n, ref: a, ...r }) => {
|
|
186
|
+
const { pagination: s, type: l } = m(), g = s.getPrevTriggerProps(), p = l === "link" && g["data-disabled"] === "", d = {
|
|
276
187
|
"data-spark-component": "pagination-prev-trigger",
|
|
277
188
|
intent: "support",
|
|
278
189
|
design: "contrast",
|
|
279
|
-
...
|
|
280
|
-
className,
|
|
281
|
-
...
|
|
282
|
-
disabled:
|
|
190
|
+
...r,
|
|
191
|
+
className: e,
|
|
192
|
+
...p && {
|
|
193
|
+
disabled: !0,
|
|
283
194
|
role: "link",
|
|
284
|
-
"aria-disabled":
|
|
195
|
+
"aria-disabled": !0
|
|
285
196
|
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
);
|
|
291
|
-
const content = children || /* @__PURE__ */ jsx8(Icon, { children: /* @__PURE__ */ jsx8(ArrowVerticalLeft, {}) });
|
|
292
|
-
return /* @__PURE__ */ jsx8("li", { children: href ? /* @__PURE__ */ jsx8(IconButton, { ref, ...mergedProps, asChild: true, children: /* @__PURE__ */ jsx8("a", { href: shouldDisableLink ? void 0 : href, children: content }) }) : /* @__PURE__ */ jsx8(IconButton, { ref, ...mergedProps, children: content }) });
|
|
197
|
+
}, c = u(
|
|
198
|
+
g,
|
|
199
|
+
d
|
|
200
|
+
), o = i || /* @__PURE__ */ t(h, { children: /* @__PURE__ */ t($, {}) });
|
|
201
|
+
return /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(P, { ref: a, ...c, asChild: !0, children: /* @__PURE__ */ t("a", { href: p ? void 0 : n, children: o }) }) : /* @__PURE__ */ t(P, { ref: a, ...c, children: o }) });
|
|
293
202
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
FirstPageTrigger,
|
|
304
|
-
LastPageTrigger
|
|
203
|
+
x.displayName = "Pagination.PrevTrigger";
|
|
204
|
+
const q = Object.assign(I, {
|
|
205
|
+
PrevTrigger: x,
|
|
206
|
+
NextTrigger: T,
|
|
207
|
+
Pages: b,
|
|
208
|
+
Item: N,
|
|
209
|
+
Ellipsis: k,
|
|
210
|
+
FirstPageTrigger: y,
|
|
211
|
+
LastPageTrigger: f
|
|
305
212
|
});
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
213
|
+
q.displayName = "Pagination";
|
|
214
|
+
x.displayName = "Pagination.PrevTrigger";
|
|
215
|
+
T.displayName = "Pagination.NextTrigger";
|
|
216
|
+
b.displayName = "Pagination.Pages";
|
|
217
|
+
N.displayName = "Pagination.Item";
|
|
218
|
+
k.displayName = "Pagination.Ellipsis";
|
|
219
|
+
y.displayName = "Pagination.FirstPageTrigger";
|
|
220
|
+
f.displayName = "Pagination.LastPageTrigger";
|
|
314
221
|
export {
|
|
315
|
-
|
|
222
|
+
q as Pagination
|
|
316
223
|
};
|
|
317
|
-
//# sourceMappingURL=index.mjs.map
|
|
224
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pagination/PaginationContext.tsx","../../src/pagination/utils.ts","../../src/pagination/Pagination.tsx","../../src/pagination/PaginationEllipsis.tsx","../../src/pagination/PaginationFirstPageTrigger.tsx","../../src/pagination/PaginationItem.tsx","../../src/pagination/PaginationLastPageTrigger.tsx","../../src/pagination/PaginationNextTrigger.tsx","../../src/pagination/PaginationPages.tsx","../../src/pagination/PaginationPrevTrigger.tsx","../../src/pagination/index.ts"],"sourcesContent":["import * as pagination from '@zag-js/pagination'\nimport { normalizeProps, type PropTypes, useMachine } from '@zag-js/react'\nimport { createContext, type ReactNode, useContext, useId } from 'react'\n\nimport { sliceArrayWithIndex } from './utils'\n\nexport interface PaginationContextState<T extends PropTypes = PropTypes> {\n type: pagination.Props['type']\n pagination: pagination.Api<T> & {\n getFirstPageTriggerProps: () => ReturnType<pagination.Api<T>['getPrevTriggerProps']> & {\n 'data-part': string\n onClick: () => void\n }\n getLastPageTriggerProps: () => ReturnType<pagination.Api<T>['getNextTriggerProps']> & {\n 'data-part': string\n onClick: () => void\n }\n }\n}\n\nconst PaginationContext = createContext<PaginationContextState | null>(null)\n\nexport interface PaginationProviderProps {\n children: ReactNode\n /**\n * Total number of data items available across all pages.\n */\n count: number\n /**\n * Maximum amount of items displayed on a single page.\n */\n pageSize: number\n /**\n * Number of visible pages (or ellipsis) between previous and next page triggers.\n */\n visiblePageItems?: number\n /**\n * The current page (active page)\n */\n page?: pagination.Props['page']\n /**\n * If your pagination contains buttons instead of links, set `type` to `button`, extra attributes will be applied on page items for a11y.\n */\n type?: pagination.Props['type']\n onPageChange?: pagination.Props['onPageChange']\n noEllipsis?: boolean\n}\n\nexport const PaginationProvider = ({\n children,\n count,\n visiblePageItems = 7,\n pageSize,\n page,\n onPageChange,\n noEllipsis,\n type = 'link',\n}: PaginationProviderProps) => {\n /**\n * Here `Infinity` is used because we apply a custom slice ourselves to manage the \"no ellipsis\" version.\n * It means Zag won't filter out any page item, allowing us to apply our own slicing logic.\n */\n const siblingCount = noEllipsis ? Infinity : Math.max(0, Math.floor((visiblePageItems - 5) / 2))\n\n const id = useId()\n\n const service = useMachine(pagination.machine, {\n id,\n count,\n siblingCount,\n pageSize,\n page,\n onPageChange,\n type,\n })\n\n const api = pagination.connect(service, normalizeProps)\n const pages = noEllipsis\n ? sliceArrayWithIndex(api.pages, api.page - 1, visiblePageItems)\n : api.pages\n\n return (\n <PaginationContext.Provider\n value={{\n type,\n pagination: {\n ...api,\n pages,\n // Extending ZagJS anatomy\n getFirstPageTriggerProps: () => {\n return {\n ...api.getPrevTriggerProps(),\n id: `${api.getRootProps().id}:first`,\n 'data-part': 'first-page-trigger',\n onClick: api.goToFirstPage,\n }\n },\n getLastPageTriggerProps: () => {\n return {\n ...api.getNextTriggerProps(),\n id: `${api.getRootProps().id}:last`,\n 'data-part': 'last-page-trigger',\n onClick: api.goToLastPage,\n }\n },\n },\n }}\n >\n {children}\n </PaginationContext.Provider>\n )\n}\n\nexport const usePagination = () => {\n const context = useContext(PaginationContext)\n\n if (!context) {\n throw Error('usePagination must be used within a Pagination provider')\n }\n\n return context\n}\n","export function sliceArrayWithIndex(arr: any[], index: number, length: number) {\n const relativeElements = (length - 1) / 2\n\n let start = Math.max(0, index - relativeElements)\n let end = Math.min(arr.length, index + relativeElements + 1)\n\n if (end - start < length) {\n start = Math.max(0, Math.min(start, arr.length - length))\n end = Math.min(arr.length, start + length)\n }\n\n return arr.slice(start, end)\n}\n","import { ReactNode } from 'react'\n\nimport {\n PaginationProvider,\n type PaginationProviderProps,\n usePagination,\n} from './PaginationContext'\n\nexport type PaginationProps = PaginationProviderProps & { className?: string }\n\nexport const Pagination = ({\n children,\n visiblePageItems = 5,\n type = 'link',\n noEllipsis = false,\n className,\n ...rest\n}: PaginationProps) => {\n return (\n <PaginationProvider\n visiblePageItems={visiblePageItems}\n noEllipsis={noEllipsis}\n type={type}\n {...rest}\n >\n <PaginationWrapper className={className}>{children}</PaginationWrapper>\n </PaginationProvider>\n )\n}\n\nconst PaginationWrapper = ({\n children,\n className,\n}: {\n children: ReactNode\n className?: string\n}) => {\n const { pagination } = usePagination()\n\n const props = pagination.getRootProps()\n\n return (\n <nav data-spark-component=\"pagination\" {...props} className={className}>\n <ul className=\"gap-md flex flex-wrap\">{children}</ul>\n </nav>\n )\n}\n\nPagination.displayName = 'Pagination'\n","import { mergeProps } from '@zag-js/react'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { usePagination } from './PaginationContext'\n\ninterface EllipsisProps extends ComponentPropsWithRef<'span'> {\n index: number\n}\n\nexport const Ellipsis = ({ children, index, className, ref, ...rest }: EllipsisProps) => {\n const { pagination } = usePagination()\n const apiProps = pagination.getEllipsisProps({ index })\n const localProps = {\n className: cx('flex size-sz-44 items-center justify-center', className),\n ...rest,\n }\n\n const mergedProps = mergeProps(apiProps, localProps)\n\n return (\n <li>\n <span data-spark-component=\"pagination-ellipsis\" ref={ref} {...mergedProps}>\n {children || '\\u2026'}\n </span>\n </li>\n )\n}\n\nEllipsis.displayName = 'Pagination.Ellipsis'\n","import { ArrowDoubleLeft } from '@spark-ui/icons/ArrowDoubleLeft'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type FirstPageTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const FirstPageTrigger = ({\n children,\n className,\n href,\n ref,\n ...props\n}: FirstPageTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getFirstPageTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-first-page-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowDoubleLeft />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nFirstPageTrigger.displayName = 'Pagination.FirstPageTrigger'\n","import { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Button } from '../button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type ItemProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n value: number\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Item = ({ children, value, className, href, ref, ...props }: ItemProps) => {\n const { pagination } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getItemProps({ type: 'page', value })\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-item',\n intent: 'support',\n design: apiProps['aria-current'] === 'page' ? 'filled' : 'contrast',\n className,\n ...props,\n }\n\n const mergedProps = mergeProps(apiProps, localProps)\n\n return (\n <li>\n {href ? (\n <Button ref={ref} {...mergedProps} asChild>\n <a href={href}>{children || value}</a>\n </Button>\n ) : (\n <Button ref={ref} {...mergedProps}>\n {children || value}\n </Button>\n )}\n </li>\n )\n}\n\nItem.displayName = 'Pagination.Item'\n","import { ArrowDoubleRight } from '@spark-ui/icons/ArrowDoubleRight'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type LastPageTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const LastPageTrigger = ({\n children,\n className,\n href,\n ref,\n ...props\n}: LastPageTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getLastPageTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-last-page-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowDoubleRight />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nLastPageTrigger.displayName = 'Pagination.LastPageTrigger'\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type NextTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const NextTrigger = ({ children, className, href, ref, ...props }: NextTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getNextTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-next-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nNextTrigger.displayName = 'Pagination.NextTrigger'\n","import * as pagination from '@zag-js/pagination'\nimport { ReactNode } from 'react'\n\nimport { usePagination } from './PaginationContext'\n\n// Extract the 'page' type element from the pagination API's 'pages' array.\ntype PageItem = Extract<pagination.Api['pages'][number], { type: 'page' }>\n\n// Define a type that conditionally tweaks the pagination API\n// based on the generic T parameter.\ntype TweakedPaginationApi<T extends 'noEllipsis' | ''> = Omit<pagination.Api, 'pages'> & {\n pages: T extends 'noEllipsis' ? PageItem[] : pagination.Api['pages']\n}\n\ninterface PagesProps<T extends 'noEllipsis' | ''> {\n children: (pagination: TweakedPaginationApi<T>) => ReactNode\n}\n\nexport const Pages = <T extends 'noEllipsis' | '' = ''>({ children }: PagesProps<T>) => {\n const { pagination } = usePagination()\n\n return children(pagination as TweakedPaginationApi<T>)\n}\n\nPages.displayName = 'Pagination.Pages'\n","import { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type PrevTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const PrevTrigger = ({ children, className, href, ref, ...props }: PrevTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getPrevTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-prev-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nPrevTrigger.displayName = 'Pagination.PrevTrigger'\n","import type { FC } from 'react'\n\nimport { Pagination as Root, type PaginationProps } from './Pagination'\nimport { Ellipsis } from './PaginationEllipsis'\nimport { FirstPageTrigger } from './PaginationFirstPageTrigger'\nimport { Item } from './PaginationItem'\nimport { LastPageTrigger } from './PaginationLastPageTrigger'\nimport { NextTrigger } from './PaginationNextTrigger'\nimport { Pages } from './PaginationPages'\nimport { PrevTrigger } from './PaginationPrevTrigger'\n\nexport const Pagination: FC<PaginationProps> & {\n PrevTrigger: typeof PrevTrigger\n NextTrigger: typeof NextTrigger\n Pages: typeof Pages\n Item: typeof Item\n Ellipsis: typeof Ellipsis\n FirstPageTrigger: typeof FirstPageTrigger\n LastPageTrigger: typeof LastPageTrigger\n} = Object.assign(Root, {\n PrevTrigger,\n NextTrigger,\n Pages,\n Item,\n Ellipsis,\n FirstPageTrigger,\n LastPageTrigger,\n})\n\nPagination.displayName = 'Pagination'\n\nPrevTrigger.displayName = 'Pagination.PrevTrigger'\nNextTrigger.displayName = 'Pagination.NextTrigger'\nPages.displayName = 'Pagination.Pages'\nItem.displayName = 'Pagination.Item'\nEllipsis.displayName = 'Pagination.Ellipsis'\nFirstPageTrigger.displayName = 'Pagination.FirstPageTrigger'\nLastPageTrigger.displayName = 'Pagination.LastPageTrigger'\n"],"mappings":";;;;;;;;;;;;;;AAAA,YAAY,gBAAgB;AAC5B,SAAS,gBAAgC,kBAAkB;AAC3D,SAAS,eAA+B,YAAY,aAAa;;;ACF1D,SAAS,oBAAoB,KAAY,OAAe,QAAgB;AAC7E,QAAM,oBAAoB,SAAS,KAAK;AAExC,MAAI,QAAQ,KAAK,IAAI,GAAG,QAAQ,gBAAgB;AAChD,MAAI,MAAM,KAAK,IAAI,IAAI,QAAQ,QAAQ,mBAAmB,CAAC;AAE3D,MAAI,MAAM,QAAQ,QAAQ;AACxB,YAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,OAAO,IAAI,SAAS,MAAM,CAAC;AACxD,UAAM,KAAK,IAAI,IAAI,QAAQ,QAAQ,MAAM;AAAA,EAC3C;AAEA,SAAO,IAAI,MAAM,OAAO,GAAG;AAC7B;;;ADsEI;AA9DJ,IAAM,oBAAoB,cAA6C,IAAI;AA4BpE,IAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AACT,MAA+B;AAK7B,QAAM,eAAe,aAAa,WAAW,KAAK,IAAI,GAAG,KAAK,OAAO,mBAAmB,KAAK,CAAC,CAAC;AAE/F,QAAM,KAAK,MAAM;AAEjB,QAAM,UAAU,WAAsB,oBAAS;AAAA,IAC7C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAC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cAAc;;;AC9DnB,IAAMG,cAQT,OAAO,OAAO,YAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,YAAW,cAAc;AAEzB,YAAY,cAAc;AAC1B,YAAY,cAAc;AAC1B,MAAM,cAAc;AACpB,KAAK,cAAc;AACnB,SAAS,cAAc;AACvB,iBAAiB,cAAc;AAC/B,gBAAgB,cAAc;","names":["jsx","pagination","jsx","pagination","mergeProps","jsx","pagination","mergeProps","mergeProps","jsx","pagination","mergeProps","mergeProps","jsx","pagination","mergeProps","mergeProps","jsx","pagination","mergeProps","pagination","mergeProps","jsx","pagination","mergeProps","Pagination"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/pagination/utils.ts","../../src/pagination/PaginationContext.tsx","../../src/pagination/Pagination.tsx","../../src/pagination/PaginationEllipsis.tsx","../../src/pagination/PaginationFirstPageTrigger.tsx","../../src/pagination/PaginationItem.tsx","../../src/pagination/PaginationLastPageTrigger.tsx","../../src/pagination/PaginationNextTrigger.tsx","../../src/pagination/PaginationPages.tsx","../../src/pagination/PaginationPrevTrigger.tsx","../../src/pagination/index.ts"],"sourcesContent":["export function sliceArrayWithIndex(arr: any[], index: number, length: number) {\n const relativeElements = (length - 1) / 2\n\n let start = Math.max(0, index - relativeElements)\n let end = Math.min(arr.length, index + relativeElements + 1)\n\n if (end - start < length) {\n start = Math.max(0, Math.min(start, arr.length - length))\n end = Math.min(arr.length, start + length)\n }\n\n return arr.slice(start, end)\n}\n","import * as pagination from '@zag-js/pagination'\nimport { normalizeProps, type PropTypes, useMachine } from '@zag-js/react'\nimport { createContext, type ReactNode, useContext, useId } from 'react'\n\nimport { sliceArrayWithIndex } from './utils'\n\nexport interface PaginationContextState<T extends PropTypes = PropTypes> {\n type: pagination.Props['type']\n pagination: pagination.Api<T> & {\n getFirstPageTriggerProps: () => ReturnType<pagination.Api<T>['getPrevTriggerProps']> & {\n 'data-part': string\n onClick: () => void\n }\n getLastPageTriggerProps: () => ReturnType<pagination.Api<T>['getNextTriggerProps']> & {\n 'data-part': string\n onClick: () => void\n }\n }\n}\n\nconst PaginationContext = createContext<PaginationContextState | null>(null)\n\nexport interface PaginationProviderProps {\n children: ReactNode\n /**\n * Total number of data items available across all pages.\n */\n count: number\n /**\n * Maximum amount of items displayed on a single page.\n */\n pageSize: number\n /**\n * Number of visible pages (or ellipsis) between previous and next page triggers.\n */\n visiblePageItems?: number\n /**\n * The current page (active page)\n */\n page?: pagination.Props['page']\n /**\n * If your pagination contains buttons instead of links, set `type` to `button`, extra attributes will be applied on page items for a11y.\n */\n type?: pagination.Props['type']\n onPageChange?: pagination.Props['onPageChange']\n noEllipsis?: boolean\n}\n\nexport const PaginationProvider = ({\n children,\n count,\n visiblePageItems = 7,\n pageSize,\n page,\n onPageChange,\n noEllipsis,\n type = 'link',\n}: PaginationProviderProps) => {\n /**\n * Here `Infinity` is used because we apply a custom slice ourselves to manage the \"no ellipsis\" version.\n * It means Zag won't filter out any page item, allowing us to apply our own slicing logic.\n */\n const siblingCount = noEllipsis ? Infinity : Math.max(0, Math.floor((visiblePageItems - 5) / 2))\n\n const id = useId()\n\n const service = useMachine(pagination.machine, {\n id,\n count,\n siblingCount,\n pageSize,\n page,\n onPageChange,\n type,\n })\n\n const api = pagination.connect(service, normalizeProps)\n const pages = noEllipsis\n ? sliceArrayWithIndex(api.pages, api.page - 1, visiblePageItems)\n : api.pages\n\n return (\n <PaginationContext.Provider\n value={{\n type,\n pagination: {\n ...api,\n pages,\n // Extending ZagJS anatomy\n getFirstPageTriggerProps: () => {\n return {\n ...api.getPrevTriggerProps(),\n id: `${api.getRootProps().id}:first`,\n 'data-part': 'first-page-trigger',\n onClick: api.goToFirstPage,\n }\n },\n getLastPageTriggerProps: () => {\n return {\n ...api.getNextTriggerProps(),\n id: `${api.getRootProps().id}:last`,\n 'data-part': 'last-page-trigger',\n onClick: api.goToLastPage,\n }\n },\n },\n }}\n >\n {children}\n </PaginationContext.Provider>\n )\n}\n\nexport const usePagination = () => {\n const context = useContext(PaginationContext)\n\n if (!context) {\n throw Error('usePagination must be used within a Pagination provider')\n }\n\n return context\n}\n","import { ReactNode } from 'react'\n\nimport {\n PaginationProvider,\n type PaginationProviderProps,\n usePagination,\n} from './PaginationContext'\n\nexport type PaginationProps = PaginationProviderProps & { className?: string }\n\nexport const Pagination = ({\n children,\n visiblePageItems = 5,\n type = 'link',\n noEllipsis = false,\n className,\n ...rest\n}: PaginationProps) => {\n return (\n <PaginationProvider\n visiblePageItems={visiblePageItems}\n noEllipsis={noEllipsis}\n type={type}\n {...rest}\n >\n <PaginationWrapper className={className}>{children}</PaginationWrapper>\n </PaginationProvider>\n )\n}\n\nconst PaginationWrapper = ({\n children,\n className,\n}: {\n children: ReactNode\n className?: string\n}) => {\n const { pagination } = usePagination()\n\n const props = pagination.getRootProps()\n\n return (\n <nav data-spark-component=\"pagination\" {...props} className={className}>\n <ul className=\"gap-md flex flex-wrap\">{children}</ul>\n </nav>\n )\n}\n\nPagination.displayName = 'Pagination'\n","import { mergeProps } from '@zag-js/react'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { usePagination } from './PaginationContext'\n\ninterface EllipsisProps extends ComponentPropsWithRef<'span'> {\n index: number\n}\n\nexport const Ellipsis = ({ children, index, className, ref, ...rest }: EllipsisProps) => {\n const { pagination } = usePagination()\n const apiProps = pagination.getEllipsisProps({ index })\n const localProps = {\n className: cx('flex size-sz-44 items-center justify-center', className),\n ...rest,\n }\n\n const mergedProps = mergeProps(apiProps, localProps)\n\n return (\n <li>\n <span data-spark-component=\"pagination-ellipsis\" ref={ref} {...mergedProps}>\n {children || '\\u2026'}\n </span>\n </li>\n )\n}\n\nEllipsis.displayName = 'Pagination.Ellipsis'\n","import { ArrowDoubleLeft } from '@spark-ui/icons/ArrowDoubleLeft'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type FirstPageTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const FirstPageTrigger = ({\n children,\n className,\n href,\n ref,\n ...props\n}: FirstPageTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getFirstPageTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-first-page-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowDoubleLeft />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nFirstPageTrigger.displayName = 'Pagination.FirstPageTrigger'\n","import { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Button } from '../button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type ItemProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n value: number\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Item = ({ children, value, className, href, ref, ...props }: ItemProps) => {\n const { pagination } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getItemProps({ type: 'page', value })\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-item',\n intent: 'support',\n design: apiProps['aria-current'] === 'page' ? 'filled' : 'contrast',\n className,\n ...props,\n }\n\n const mergedProps = mergeProps(apiProps, localProps)\n\n return (\n <li>\n {href ? (\n <Button ref={ref} {...mergedProps} asChild>\n <a href={href}>{children || value}</a>\n </Button>\n ) : (\n <Button ref={ref} {...mergedProps}>\n {children || value}\n </Button>\n )}\n </li>\n )\n}\n\nItem.displayName = 'Pagination.Item'\n","import { ArrowDoubleRight } from '@spark-ui/icons/ArrowDoubleRight'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type LastPageTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const LastPageTrigger = ({\n children,\n className,\n href,\n ref,\n ...props\n}: LastPageTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getLastPageTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-last-page-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowDoubleRight />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nLastPageTrigger.displayName = 'Pagination.LastPageTrigger'\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type NextTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const NextTrigger = ({ children, className, href, ref, ...props }: NextTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getNextTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-next-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nNextTrigger.displayName = 'Pagination.NextTrigger'\n","import * as pagination from '@zag-js/pagination'\nimport { ReactNode } from 'react'\n\nimport { usePagination } from './PaginationContext'\n\n// Extract the 'page' type element from the pagination API's 'pages' array.\ntype PageItem = Extract<pagination.Api['pages'][number], { type: 'page' }>\n\n// Define a type that conditionally tweaks the pagination API\n// based on the generic T parameter.\ntype TweakedPaginationApi<T extends 'noEllipsis' | ''> = Omit<pagination.Api, 'pages'> & {\n pages: T extends 'noEllipsis' ? PageItem[] : pagination.Api['pages']\n}\n\ninterface PagesProps<T extends 'noEllipsis' | ''> {\n children: (pagination: TweakedPaginationApi<T>) => ReactNode\n}\n\nexport const Pages = <T extends 'noEllipsis' | '' = ''>({ children }: PagesProps<T>) => {\n const { pagination } = usePagination()\n\n return children(pagination as TweakedPaginationApi<T>)\n}\n\nPages.displayName = 'Pagination.Pages'\n","import { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\nimport { mergeProps } from '@zag-js/react'\nimport { ComponentPropsWithoutRef, Ref } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton } from '../icon-button'\nimport { usePagination } from './PaginationContext'\n\ninterface AnchorProps extends ComponentPropsWithoutRef<'a'> {\n href: string\n}\n\ninterface ButtonProps extends ComponentPropsWithoutRef<'button'> {\n href?: undefined\n}\nexport type PrevTriggerProps = Omit<AnchorProps | ButtonProps, 'aria-label'> & {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const PrevTrigger = ({ children, className, href, ref, ...props }: PrevTriggerProps) => {\n const { pagination, type } = usePagination()\n\n // ZagJS props\n const apiProps = pagination.getPrevTriggerProps()\n\n const shouldDisableLink =\n type === 'link' &&\n (apiProps as typeof apiProps & { 'data-disabled'?: string })['data-disabled'] === ''\n\n // Locally managed props\n const localProps = {\n 'data-spark-component': 'pagination-prev-trigger',\n intent: 'support',\n design: 'contrast',\n ...props,\n className,\n ...(shouldDisableLink && {\n disabled: true,\n role: 'link',\n 'aria-disabled': true,\n }),\n }\n\n // We know 'aria-label' is included in props\n type WithAriaLabel = Omit<typeof apiProps, 'aria-label'> & { 'aria-label': string }\n\n const mergedProps = mergeProps(\n apiProps,\n localProps as unknown as typeof apiProps\n ) as WithAriaLabel\n\n const content = children || (\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n )\n\n return (\n <li>\n {href ? (\n <IconButton ref={ref} {...mergedProps} asChild>\n <a href={shouldDisableLink ? undefined : href}>{content}</a>\n </IconButton>\n ) : (\n <IconButton ref={ref} {...mergedProps}>\n {content}\n </IconButton>\n )}\n </li>\n )\n}\n\nPrevTrigger.displayName = 'Pagination.PrevTrigger'\n","import type { FC } from 'react'\n\nimport { Pagination as Root, type PaginationProps } from './Pagination'\nimport { Ellipsis } from './PaginationEllipsis'\nimport { FirstPageTrigger } from './PaginationFirstPageTrigger'\nimport { Item } from './PaginationItem'\nimport { LastPageTrigger } from './PaginationLastPageTrigger'\nimport { NextTrigger } from './PaginationNextTrigger'\nimport { Pages } from './PaginationPages'\nimport { PrevTrigger } from './PaginationPrevTrigger'\n\nexport const Pagination: FC<PaginationProps> & {\n PrevTrigger: typeof PrevTrigger\n NextTrigger: typeof NextTrigger\n Pages: typeof Pages\n Item: typeof Item\n Ellipsis: typeof Ellipsis\n FirstPageTrigger: typeof FirstPageTrigger\n LastPageTrigger: typeof LastPageTrigger\n} = Object.assign(Root, {\n PrevTrigger,\n NextTrigger,\n Pages,\n Item,\n Ellipsis,\n FirstPageTrigger,\n LastPageTrigger,\n})\n\nPagination.displayName = 'Pagination'\n\nPrevTrigger.displayName = 'Pagination.PrevTrigger'\nNextTrigger.displayName = 'Pagination.NextTrigger'\nPages.displayName = 'Pagination.Pages'\nItem.displayName = 'Pagination.Item'\nEllipsis.displayName = 'Pagination.Ellipsis'\nFirstPageTrigger.displayName = 'Pagination.FirstPageTrigger'\nLastPageTrigger.displayName = 'Pagination.LastPageTrigger'\n"],"names":["sliceArrayWithIndex","arr","index","length","relativeElements","start","end","PaginationContext","createContext","PaginationProvider","children","count","visiblePageItems","pageSize","page","onPageChange","noEllipsis","type","siblingCount","id","useId","service","useMachine","pagination","api","normalizeProps","pages","jsx","usePagination","context","useContext","Pagination","className","rest","PaginationWrapper","props","Ellipsis","ref","apiProps","localProps","cx","mergedProps","mergeProps","FirstPageTrigger","href","shouldDisableLink","content","Icon","ArrowDoubleLeft","IconButton","Item","value","Button","LastPageTrigger","ArrowDoubleRight","NextTrigger","ArrowVerticalRight","Pages","PrevTrigger","ArrowVerticalLeft","Root"],"mappings":";;;;;;;;;;;;AAAO,SAASA,EAAoBC,GAAYC,GAAeC,GAAgB;AAC7E,QAAMC,KAAoBD,IAAS,KAAK;AAExC,MAAIE,IAAQ,KAAK,IAAI,GAAGH,IAAQE,CAAgB,GAC5CE,IAAM,KAAK,IAAIL,EAAI,QAAQC,IAAQE,IAAmB,CAAC;AAE3D,SAAIE,IAAMD,IAAQF,MAChBE,IAAQ,KAAK,IAAI,GAAG,KAAK,IAAIA,GAAOJ,EAAI,SAASE,CAAM,CAAC,GACxDG,IAAM,KAAK,IAAIL,EAAI,QAAQI,IAAQF,CAAM,IAGpCF,EAAI,MAAMI,GAAOC,CAAG;AAC7B;ACQA,MAAMC,IAAoBC,EAA6C,IAAI,GA4B9DC,IAAqB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAC,IAAO;AACT,MAA+B;AAK7B,QAAMC,IAAeF,IAAa,QAAW,KAAK,I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