@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,1428 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/scrolling-list/index.ts
|
|
21
|
-
var scrolling_list_exports = {};
|
|
22
|
-
__export(scrolling_list_exports, {
|
|
23
|
-
ScrollingList: () => ScrollingList2
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(scrolling_list_exports);
|
|
26
|
-
|
|
27
|
-
// src/scrolling-list/ScrollingList.tsx
|
|
28
|
-
var import_use_scroll_overflow = require("@spark-ui/hooks/use-scroll-overflow");
|
|
29
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
30
|
-
var import_react = require("react");
|
|
31
|
-
var import_react_snap_carousel = require("react-snap-carousel");
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
-
var ScrollingListContext = (0, import_react.createContext)(
|
|
34
|
-
null
|
|
35
|
-
);
|
|
36
|
-
var ScrollingList = ({
|
|
37
|
-
snapType = "none",
|
|
38
|
-
snapStop = "normal",
|
|
39
|
-
scrollBehavior = "smooth",
|
|
40
|
-
loop = false,
|
|
41
|
-
gap = 16,
|
|
42
|
-
withFade = false,
|
|
43
|
-
scrollPadding = 0,
|
|
44
|
-
children,
|
|
45
|
-
className,
|
|
46
|
-
...rest
|
|
47
|
-
}) => {
|
|
48
|
-
const scrollAreaRef = (0, import_react.useRef)(null);
|
|
49
|
-
const skipAnchorRef = (0, import_react.useRef)(null);
|
|
50
|
-
const snapCarouselAPI = (0, import_react_snap_carousel.useSnapCarousel)();
|
|
51
|
-
const { overflow, refresh: refreshOverflow } = (0, import_use_scroll_overflow.useScrollOverflow)(scrollAreaRef, {
|
|
52
|
-
precisionTreshold: 1
|
|
53
|
-
});
|
|
54
|
-
const { activePageIndex, pages, refresh } = snapCarouselAPI;
|
|
55
|
-
const visibleItems = pages[activePageIndex];
|
|
56
|
-
const visibleItemsRange = visibleItems ? [visibleItems[0] + 1, visibleItems[visibleItems.length - 1] + 1] : [0, 0];
|
|
57
|
-
const forceRefresh = (0, import_react.useCallback)(() => {
|
|
58
|
-
if (refresh && scrollAreaRef.current) {
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
refresh();
|
|
61
|
-
}, 0);
|
|
62
|
-
}
|
|
63
|
-
}, [refresh]);
|
|
64
|
-
(0, import_react.useEffect)(() => {
|
|
65
|
-
forceRefresh();
|
|
66
|
-
}, [children, forceRefresh]);
|
|
67
|
-
(0, import_react.useLayoutEffect)(() => {
|
|
68
|
-
if (scrollAreaRef.current) {
|
|
69
|
-
requestAnimationFrame(() => {
|
|
70
|
-
refreshOverflow();
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}, [children, refreshOverflow]);
|
|
74
|
-
const skipKeyboardNavigation = () => {
|
|
75
|
-
skipAnchorRef.current?.focus();
|
|
76
|
-
};
|
|
77
|
-
const ctxValue = {
|
|
78
|
-
...snapCarouselAPI,
|
|
79
|
-
snapType,
|
|
80
|
-
snapStop,
|
|
81
|
-
skipKeyboardNavigation,
|
|
82
|
-
scrollBehavior,
|
|
83
|
-
visibleItemsRange,
|
|
84
|
-
loop,
|
|
85
|
-
gap,
|
|
86
|
-
withFade,
|
|
87
|
-
scrollPadding,
|
|
88
|
-
scrollAreaRef,
|
|
89
|
-
overflow
|
|
90
|
-
};
|
|
91
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ScrollingListContext.Provider, { value: ctxValue, children: [
|
|
92
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
"data-spark-component": "scrolling-list",
|
|
96
|
-
className: (0, import_class_variance_authority.cx)(
|
|
97
|
-
"gap-lg group/scrolling-list relative flex flex-col default:w-full",
|
|
98
|
-
className
|
|
99
|
-
),
|
|
100
|
-
...rest,
|
|
101
|
-
children
|
|
102
|
-
}
|
|
103
|
-
),
|
|
104
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: skipAnchorRef, className: "size-0 overflow-hidden", tabIndex: -1 })
|
|
105
|
-
] });
|
|
106
|
-
};
|
|
107
|
-
ScrollingList.displayName = "ScrollingList";
|
|
108
|
-
|
|
109
|
-
// src/scrolling-list/ScrollingListControls.tsx
|
|
110
|
-
var import_class_variance_authority2 = require("class-variance-authority");
|
|
111
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
112
|
-
var ScrollingListControls = ({
|
|
113
|
-
children,
|
|
114
|
-
visibility = "always",
|
|
115
|
-
className,
|
|
116
|
-
...rest
|
|
117
|
-
}) => {
|
|
118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
119
|
-
"div",
|
|
120
|
-
{
|
|
121
|
-
"data-spark-component": "scrolling-list-controls",
|
|
122
|
-
className: (0, import_class_variance_authority2.cx)(
|
|
123
|
-
"default:px-md pointer-events-none absolute inset-0 flex flex-row items-center justify-between overflow-hidden",
|
|
124
|
-
className
|
|
125
|
-
),
|
|
126
|
-
style: {
|
|
127
|
-
"--scrolling-list-controls-opacity": visibility === "hover" ? "0" : "1"
|
|
128
|
-
},
|
|
129
|
-
"data-orientation": "horizontal",
|
|
130
|
-
...rest,
|
|
131
|
-
children
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
ScrollingListControls.displayName = "ScrollingList.Controls";
|
|
136
|
-
|
|
137
|
-
// src/scrolling-list/ScrollingListItem.tsx
|
|
138
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
139
|
-
var import_react4 = require("react");
|
|
140
|
-
|
|
141
|
-
// src/slot/Slot.tsx
|
|
142
|
-
var import_radix_ui = require("radix-ui");
|
|
143
|
-
var import_react2 = require("react");
|
|
144
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
145
|
-
var Slottable = import_radix_ui.Slot.Slottable;
|
|
146
|
-
var Slot = ({ ref, ...props }) => {
|
|
147
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
148
|
-
};
|
|
149
|
-
var wrapPolymorphicSlot = (asChild, children, callback) => {
|
|
150
|
-
if (!asChild) return callback(children);
|
|
151
|
-
return (0, import_react2.isValidElement)(children) ? (0, import_react2.cloneElement)(
|
|
152
|
-
children,
|
|
153
|
-
void 0,
|
|
154
|
-
callback(children.props.children)
|
|
155
|
-
) : null;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
// src/scrolling-list/useFocusWithinScroll.tsx
|
|
159
|
-
var import_react3 = require("react");
|
|
160
|
-
function useFocusWithinScroll(ref, scrollRef) {
|
|
161
|
-
const [isFocusWithin, setIsFocusWithin] = (0, import_react3.useState)(false);
|
|
162
|
-
(0, import_react3.useEffect)(() => {
|
|
163
|
-
const handleFocusIn = (event) => {
|
|
164
|
-
setIsFocusWithin(true);
|
|
165
|
-
const focusedElement = event.target;
|
|
166
|
-
const scrollContainer = scrollRef.current;
|
|
167
|
-
if (focusedElement && scrollContainer) {
|
|
168
|
-
const focusRect = focusedElement.getBoundingClientRect();
|
|
169
|
-
const scrollRect = scrollContainer.getBoundingClientRect();
|
|
170
|
-
const isFullyVisible = focusRect.left >= scrollRect.left && focusRect.right <= scrollRect.right && focusRect.top >= scrollRect.top && focusRect.bottom <= scrollRect.bottom;
|
|
171
|
-
if (!isFullyVisible) {
|
|
172
|
-
focusedElement.scrollIntoView({ behavior: "smooth", inline: "center", block: "nearest" });
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
const handleFocusOut = (event) => {
|
|
177
|
-
if (ref.current && !ref.current.contains(event.relatedTarget)) {
|
|
178
|
-
setIsFocusWithin(false);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const node = ref.current;
|
|
182
|
-
if (node) {
|
|
183
|
-
node.addEventListener("focusin", handleFocusIn);
|
|
184
|
-
node.addEventListener("focusout", handleFocusOut);
|
|
185
|
-
}
|
|
186
|
-
return () => {
|
|
187
|
-
if (node) {
|
|
188
|
-
node.removeEventListener("focusin", handleFocusIn);
|
|
189
|
-
node.removeEventListener("focusout", handleFocusOut);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
}, [ref, scrollRef]);
|
|
193
|
-
return isFocusWithin;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// src/scrolling-list/ScrollingListItem.tsx
|
|
197
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
198
|
-
var ScrollingListItem = ({
|
|
199
|
-
asChild = false,
|
|
200
|
-
children,
|
|
201
|
-
index = 0,
|
|
202
|
-
className = "",
|
|
203
|
-
...rest
|
|
204
|
-
}) => {
|
|
205
|
-
const ctx = (0, import_react4.useContext)(ScrollingListContext);
|
|
206
|
-
const itemRef = (0, import_react4.useRef)(null);
|
|
207
|
-
const isSnapPoint = ctx.snapPointIndexes.has(index);
|
|
208
|
-
useFocusWithinScroll(itemRef, ctx.scrollAreaRef);
|
|
209
|
-
const Component = asChild ? Slot : "div";
|
|
210
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
211
|
-
Component,
|
|
212
|
-
{
|
|
213
|
-
"data-spark-component": "scrolling-list-item",
|
|
214
|
-
role: "listitem",
|
|
215
|
-
ref: itemRef,
|
|
216
|
-
className: (0, import_class_variance_authority3.cx)(
|
|
217
|
-
"default:w-auto default:shrink-0",
|
|
218
|
-
{
|
|
219
|
-
"snap-start": isSnapPoint,
|
|
220
|
-
"snap-normal": isSnapPoint && ctx.snapStop === "normal",
|
|
221
|
-
"snap-always": isSnapPoint && ctx.snapStop === "always"
|
|
222
|
-
},
|
|
223
|
-
className
|
|
224
|
-
),
|
|
225
|
-
...rest,
|
|
226
|
-
children
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
};
|
|
230
|
-
ScrollingListItem.displayName = "ScrollingList.Item";
|
|
231
|
-
|
|
232
|
-
// src/scrolling-list/ScrollingListItems.tsx
|
|
233
|
-
var import_class_variance_authority4 = require("class-variance-authority");
|
|
234
|
-
var import_react5 = require("react");
|
|
235
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
236
|
-
function mergeRefs(...refs) {
|
|
237
|
-
return (value) => {
|
|
238
|
-
refs.forEach((ref) => {
|
|
239
|
-
if (typeof ref === "function") {
|
|
240
|
-
ref(value);
|
|
241
|
-
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
242
|
-
;
|
|
243
|
-
ref.current = value;
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
var ScrollingListItems = ({ children, ref, className = "", ...rest }) => {
|
|
249
|
-
const ctx = (0, import_react5.useContext)(ScrollingListContext);
|
|
250
|
-
const snapConfig = {
|
|
251
|
-
mandatory: "x mandatory",
|
|
252
|
-
proximity: "x proximity",
|
|
253
|
-
none: "none"
|
|
254
|
-
};
|
|
255
|
-
const handleLeftArrow = (event) => {
|
|
256
|
-
if (!ctx.loop && !ctx.hasPrevPage) return;
|
|
257
|
-
event.preventDefault();
|
|
258
|
-
ctx.goTo(ctx.hasPrevPage ? ctx.activePageIndex - 1 : ctx.pages.length - 1, {
|
|
259
|
-
behavior: ctx.scrollBehavior
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
const handleRightArrow = (event) => {
|
|
263
|
-
if (!ctx.loop && !ctx.hasNextPage) return;
|
|
264
|
-
event.preventDefault();
|
|
265
|
-
ctx.goTo(ctx.hasNextPage ? ctx.activePageIndex + 1 : 0, { behavior: ctx.scrollBehavior });
|
|
266
|
-
};
|
|
267
|
-
const handleKeyDown = (event) => {
|
|
268
|
-
if (event.key === "ArrowLeft") {
|
|
269
|
-
handleLeftArrow(event);
|
|
270
|
-
}
|
|
271
|
-
if (event.key === "ArrowRight") {
|
|
272
|
-
handleRightArrow(event);
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
const inlineStyles = {
|
|
276
|
-
scrollSnapType: snapConfig[ctx.snapType],
|
|
277
|
-
scrollPaddingInline: "var(--scrolling-list-px)",
|
|
278
|
-
"--scrolling-list-px": `${ctx.scrollPadding}px`,
|
|
279
|
-
"--scrolling-list-gap": `${ctx.gap}px`,
|
|
280
|
-
...ctx.withFade && {
|
|
281
|
-
maskImage: "linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
|
|
282
|
-
maskSize: `calc(100% + ${ctx.overflow.left ? "0px" : "44px"} + ${ctx.overflow.right ? "0px" : "44px"}) 100%`,
|
|
283
|
-
maskPosition: `${ctx.overflow.left ? "0px" : "-44px"} 0`
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
287
|
-
"div",
|
|
288
|
-
{
|
|
289
|
-
"data-spark-component": "scrolling-list-items",
|
|
290
|
-
id: "scrolling-list-items",
|
|
291
|
-
role: "list",
|
|
292
|
-
className: (0, import_class_variance_authority4.cx)(
|
|
293
|
-
"relative transition-all duration-300",
|
|
294
|
-
"u-no-scrollbar overflow-x-auto scroll-smooth",
|
|
295
|
-
"w-full gap-(--scrolling-list-gap) default:flex default:flex-row",
|
|
296
|
-
"focus-visible:u-outline",
|
|
297
|
-
className
|
|
298
|
-
),
|
|
299
|
-
ref: mergeRefs(ctx.scrollAreaRef, ctx.scrollRef, ref),
|
|
300
|
-
style: inlineStyles,
|
|
301
|
-
onKeyDown: handleKeyDown,
|
|
302
|
-
...rest,
|
|
303
|
-
children: import_react5.Children.map(
|
|
304
|
-
children,
|
|
305
|
-
(child, index) => (0, import_react5.isValidElement)(child) ? (0, import_react5.cloneElement)(child, { index }) : child
|
|
306
|
-
)
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
};
|
|
310
|
-
ScrollingListItems.displayName = "ScrollingList.Items";
|
|
311
|
-
|
|
312
|
-
// src/scrolling-list/ScrollingListNextButton.tsx
|
|
313
|
-
var import_ArrowVerticalRight = require("@spark-ui/icons/ArrowVerticalRight");
|
|
314
|
-
var import_class_variance_authority10 = require("class-variance-authority");
|
|
315
|
-
var import_react8 = require("react");
|
|
316
|
-
|
|
317
|
-
// src/icon/Icon.tsx
|
|
318
|
-
var import_react6 = require("react");
|
|
319
|
-
|
|
320
|
-
// src/visually-hidden/VisuallyHidden.tsx
|
|
321
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
322
|
-
var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
|
|
323
|
-
const Component = asChild ? Slot : "span";
|
|
324
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
325
|
-
Component,
|
|
326
|
-
{
|
|
327
|
-
...props,
|
|
328
|
-
ref,
|
|
329
|
-
style: {
|
|
330
|
-
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
331
|
-
position: "absolute",
|
|
332
|
-
border: 0,
|
|
333
|
-
width: 1,
|
|
334
|
-
height: 1,
|
|
335
|
-
padding: 0,
|
|
336
|
-
margin: -1,
|
|
337
|
-
overflow: "hidden",
|
|
338
|
-
clip: "rect(0, 0, 0, 0)",
|
|
339
|
-
whiteSpace: "nowrap",
|
|
340
|
-
wordWrap: "normal",
|
|
341
|
-
...props.style
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
|
-
};
|
|
346
|
-
VisuallyHidden.displayName = "VisuallyHidden";
|
|
347
|
-
|
|
348
|
-
// src/icon/Icon.styles.tsx
|
|
349
|
-
var import_internal_utils = require("@spark-ui/internal-utils");
|
|
350
|
-
var import_class_variance_authority5 = require("class-variance-authority");
|
|
351
|
-
var iconStyles = (0, import_class_variance_authority5.cva)(["fill-current shrink-0"], {
|
|
352
|
-
variants: {
|
|
353
|
-
/**
|
|
354
|
-
* Color scheme of the icon.
|
|
355
|
-
*/
|
|
356
|
-
intent: (0, import_internal_utils.makeVariants)({
|
|
357
|
-
current: ["text-current"],
|
|
358
|
-
main: ["text-main"],
|
|
359
|
-
support: ["text-support"],
|
|
360
|
-
accent: ["text-accent"],
|
|
361
|
-
basic: ["text-basic"],
|
|
362
|
-
success: ["text-success"],
|
|
363
|
-
alert: ["text-alert"],
|
|
364
|
-
error: ["text-error"],
|
|
365
|
-
info: ["text-info"],
|
|
366
|
-
neutral: ["text-neutral"]
|
|
367
|
-
}),
|
|
368
|
-
/**
|
|
369
|
-
* Sets the size of the icon.
|
|
370
|
-
*/
|
|
371
|
-
size: (0, import_internal_utils.makeVariants)({
|
|
372
|
-
current: ["u-current-font-size"],
|
|
373
|
-
sm: ["w-sz-16", "h-sz-16"],
|
|
374
|
-
md: ["w-sz-24", "h-sz-24"],
|
|
375
|
-
lg: ["w-sz-32", "h-sz-32"],
|
|
376
|
-
xl: ["w-sz-40", "h-sz-40"]
|
|
377
|
-
})
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
// src/icon/Icon.tsx
|
|
382
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
383
|
-
var Icon = ({
|
|
384
|
-
label,
|
|
385
|
-
className,
|
|
386
|
-
size = "current",
|
|
387
|
-
intent = "current",
|
|
388
|
-
children,
|
|
389
|
-
...others
|
|
390
|
-
}) => {
|
|
391
|
-
const child = import_react6.Children.only(children);
|
|
392
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
393
|
-
(0, import_react6.cloneElement)(child, {
|
|
394
|
-
className: iconStyles({ className, size, intent }),
|
|
395
|
-
"data-spark-component": "icon",
|
|
396
|
-
"aria-hidden": "true",
|
|
397
|
-
focusable: "false",
|
|
398
|
-
...others
|
|
399
|
-
}),
|
|
400
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VisuallyHidden, { children: label })
|
|
401
|
-
] });
|
|
402
|
-
};
|
|
403
|
-
Icon.displayName = "Icon";
|
|
404
|
-
|
|
405
|
-
// src/button/Button.tsx
|
|
406
|
-
var import_class_variance_authority8 = require("class-variance-authority");
|
|
407
|
-
var import_react7 = require("react");
|
|
408
|
-
|
|
409
|
-
// src/spinner/Spinner.styles.tsx
|
|
410
|
-
var import_internal_utils2 = require("@spark-ui/internal-utils");
|
|
411
|
-
var import_class_variance_authority6 = require("class-variance-authority");
|
|
412
|
-
var defaultVariants = {
|
|
413
|
-
intent: "current",
|
|
414
|
-
size: "current",
|
|
415
|
-
isBackgroundVisible: false
|
|
416
|
-
};
|
|
417
|
-
var spinnerStyles = (0, import_class_variance_authority6.cva)(
|
|
418
|
-
["inline-block", "border-solid", "rounded-full", "border-md", "animate-spin"],
|
|
419
|
-
{
|
|
420
|
-
variants: {
|
|
421
|
-
/**
|
|
422
|
-
* Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.
|
|
423
|
-
*/
|
|
424
|
-
size: {
|
|
425
|
-
current: ["u-current-font-size"],
|
|
426
|
-
sm: ["w-sz-20", "h-sz-20"],
|
|
427
|
-
md: ["w-sz-28", "h-sz-28"],
|
|
428
|
-
full: ["w-full", "h-full"]
|
|
429
|
-
},
|
|
430
|
-
/**
|
|
431
|
-
* Color scheme of the spinner.
|
|
432
|
-
*/
|
|
433
|
-
intent: (0, import_internal_utils2.makeVariants)({
|
|
434
|
-
current: ["border-current"],
|
|
435
|
-
main: ["border-main"],
|
|
436
|
-
support: ["border-support"],
|
|
437
|
-
accent: ["border-accent"],
|
|
438
|
-
basic: ["border-basic"],
|
|
439
|
-
success: ["border-success"],
|
|
440
|
-
alert: ["border-alert"],
|
|
441
|
-
error: ["border-error"],
|
|
442
|
-
info: ["border-info"],
|
|
443
|
-
neutral: ["border-neutral"]
|
|
444
|
-
}),
|
|
445
|
-
/**
|
|
446
|
-
* Size of the button.
|
|
447
|
-
*/
|
|
448
|
-
isBackgroundVisible: {
|
|
449
|
-
true: ["border-b-neutral-container", "border-l-neutral-container"],
|
|
450
|
-
false: ["border-b-transparent", "border-l-transparent"]
|
|
451
|
-
}
|
|
452
|
-
},
|
|
453
|
-
defaultVariants
|
|
454
|
-
}
|
|
455
|
-
);
|
|
456
|
-
|
|
457
|
-
// src/spinner/Spinner.tsx
|
|
458
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
459
|
-
var Spinner = ({
|
|
460
|
-
className,
|
|
461
|
-
size = "current",
|
|
462
|
-
intent = "current",
|
|
463
|
-
label,
|
|
464
|
-
isBackgroundVisible,
|
|
465
|
-
ref,
|
|
466
|
-
...others
|
|
467
|
-
}) => {
|
|
468
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
469
|
-
"span",
|
|
470
|
-
{
|
|
471
|
-
role: "status",
|
|
472
|
-
"data-spark-component": "spinner",
|
|
473
|
-
ref,
|
|
474
|
-
className: spinnerStyles({ className, size, intent, isBackgroundVisible }),
|
|
475
|
-
...others,
|
|
476
|
-
children: label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(VisuallyHidden, { children: label })
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
};
|
|
480
|
-
|
|
481
|
-
// src/button/Button.styles.tsx
|
|
482
|
-
var import_internal_utils8 = require("@spark-ui/internal-utils");
|
|
483
|
-
var import_class_variance_authority7 = require("class-variance-authority");
|
|
484
|
-
|
|
485
|
-
// src/button/variants/filled.ts
|
|
486
|
-
var import_internal_utils3 = require("@spark-ui/internal-utils");
|
|
487
|
-
var filledVariants = [
|
|
488
|
-
// Main
|
|
489
|
-
{
|
|
490
|
-
intent: "main",
|
|
491
|
-
design: "filled",
|
|
492
|
-
class: (0, import_internal_utils3.tw)([
|
|
493
|
-
"bg-main",
|
|
494
|
-
"text-on-main",
|
|
495
|
-
"hover:bg-main-hovered",
|
|
496
|
-
"enabled:active:bg-main-hovered",
|
|
497
|
-
"focus-visible:bg-main-hovered"
|
|
498
|
-
])
|
|
499
|
-
},
|
|
500
|
-
// Support
|
|
501
|
-
{
|
|
502
|
-
intent: "support",
|
|
503
|
-
design: "filled",
|
|
504
|
-
class: (0, import_internal_utils3.tw)([
|
|
505
|
-
"bg-support",
|
|
506
|
-
"text-on-support",
|
|
507
|
-
"hover:bg-support-hovered",
|
|
508
|
-
"enabled:active:bg-support-hovered",
|
|
509
|
-
"focus-visible:bg-support-hovered"
|
|
510
|
-
])
|
|
511
|
-
},
|
|
512
|
-
// Accent
|
|
513
|
-
{
|
|
514
|
-
intent: "accent",
|
|
515
|
-
design: "filled",
|
|
516
|
-
class: (0, import_internal_utils3.tw)([
|
|
517
|
-
"bg-accent",
|
|
518
|
-
"text-on-accent",
|
|
519
|
-
"hover:bg-accent-hovered",
|
|
520
|
-
"enabled:active:bg-accent-hovered",
|
|
521
|
-
"focus-visible:bg-accent-hovered"
|
|
522
|
-
])
|
|
523
|
-
},
|
|
524
|
-
// Basic
|
|
525
|
-
{
|
|
526
|
-
intent: "basic",
|
|
527
|
-
design: "filled",
|
|
528
|
-
class: (0, import_internal_utils3.tw)([
|
|
529
|
-
"bg-basic",
|
|
530
|
-
"text-on-basic",
|
|
531
|
-
"hover:bg-basic-hovered",
|
|
532
|
-
"enabled:active:bg-basic-hovered",
|
|
533
|
-
"focus-visible:bg-basic-hovered"
|
|
534
|
-
])
|
|
535
|
-
},
|
|
536
|
-
// Success
|
|
537
|
-
{
|
|
538
|
-
intent: "success",
|
|
539
|
-
design: "filled",
|
|
540
|
-
class: (0, import_internal_utils3.tw)([
|
|
541
|
-
"bg-success",
|
|
542
|
-
"text-on-success",
|
|
543
|
-
"hover:bg-success-hovered",
|
|
544
|
-
"enabled:active:bg-success-hovered",
|
|
545
|
-
"focus-visible:bg-success-hovered"
|
|
546
|
-
])
|
|
547
|
-
},
|
|
548
|
-
// Alert
|
|
549
|
-
{
|
|
550
|
-
intent: "alert",
|
|
551
|
-
design: "filled",
|
|
552
|
-
class: (0, import_internal_utils3.tw)([
|
|
553
|
-
"bg-alert",
|
|
554
|
-
"text-on-alert",
|
|
555
|
-
"hover:bg-alert-hovered",
|
|
556
|
-
"enabled:active:bg-alert-hovered",
|
|
557
|
-
"focus-visible:bg-alert-hovered"
|
|
558
|
-
])
|
|
559
|
-
},
|
|
560
|
-
// Danger
|
|
561
|
-
{
|
|
562
|
-
intent: "danger",
|
|
563
|
-
design: "filled",
|
|
564
|
-
class: (0, import_internal_utils3.tw)([
|
|
565
|
-
"text-on-error bg-error",
|
|
566
|
-
"hover:bg-error-hovered enabled:active:bg-error-hovered",
|
|
567
|
-
"focus-visible:bg-error-hovered"
|
|
568
|
-
])
|
|
569
|
-
},
|
|
570
|
-
// Info
|
|
571
|
-
{
|
|
572
|
-
intent: "info",
|
|
573
|
-
design: "filled",
|
|
574
|
-
class: (0, import_internal_utils3.tw)([
|
|
575
|
-
"text-on-error bg-info",
|
|
576
|
-
"hover:bg-info-hovered enabled:active:bg-info-hovered",
|
|
577
|
-
"focus-visible:bg-info-hovered"
|
|
578
|
-
])
|
|
579
|
-
},
|
|
580
|
-
// Neutral
|
|
581
|
-
{
|
|
582
|
-
intent: "neutral",
|
|
583
|
-
design: "filled",
|
|
584
|
-
class: (0, import_internal_utils3.tw)([
|
|
585
|
-
"bg-neutral",
|
|
586
|
-
"text-on-neutral",
|
|
587
|
-
"hover:bg-neutral-hovered",
|
|
588
|
-
"enabled:active:bg-neutral-hovered",
|
|
589
|
-
"focus-visible:bg-neutral-hovered"
|
|
590
|
-
])
|
|
591
|
-
},
|
|
592
|
-
// Surface
|
|
593
|
-
{
|
|
594
|
-
intent: "surface",
|
|
595
|
-
design: "filled",
|
|
596
|
-
class: (0, import_internal_utils3.tw)([
|
|
597
|
-
"bg-surface",
|
|
598
|
-
"text-on-surface",
|
|
599
|
-
"hover:bg-surface-hovered",
|
|
600
|
-
"enabled:active:bg-surface-hovered",
|
|
601
|
-
"focus-visible:bg-surface-hovered"
|
|
602
|
-
])
|
|
603
|
-
},
|
|
604
|
-
{
|
|
605
|
-
intent: "surfaceInverse",
|
|
606
|
-
design: "filled",
|
|
607
|
-
class: (0, import_internal_utils3.tw)([
|
|
608
|
-
"bg-surface-inverse",
|
|
609
|
-
"text-on-surface-inverse",
|
|
610
|
-
"hover:bg-surface-inverse-hovered",
|
|
611
|
-
"enabled:active:bg-surface-inverse-hovered",
|
|
612
|
-
"focus-visible:bg-surface-inverse-hovered"
|
|
613
|
-
])
|
|
614
|
-
}
|
|
615
|
-
];
|
|
616
|
-
|
|
617
|
-
// src/button/variants/ghost.ts
|
|
618
|
-
var import_internal_utils4 = require("@spark-ui/internal-utils");
|
|
619
|
-
var ghostVariants = [
|
|
620
|
-
{
|
|
621
|
-
intent: "main",
|
|
622
|
-
design: "ghost",
|
|
623
|
-
class: (0, import_internal_utils4.tw)([
|
|
624
|
-
"text-on-main-container",
|
|
625
|
-
"hover:bg-main/dim-5",
|
|
626
|
-
"enabled:active:bg-main/dim-5",
|
|
627
|
-
"focus-visible:bg-main/dim-5"
|
|
628
|
-
])
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
intent: "support",
|
|
632
|
-
design: "ghost",
|
|
633
|
-
class: (0, import_internal_utils4.tw)([
|
|
634
|
-
"text-on-support-container",
|
|
635
|
-
"hover:bg-support/dim-5",
|
|
636
|
-
"enabled:active:bg-support/dim-5",
|
|
637
|
-
"focus-visible:bg-support/dim-5"
|
|
638
|
-
])
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
intent: "accent",
|
|
642
|
-
design: "ghost",
|
|
643
|
-
class: (0, import_internal_utils4.tw)([
|
|
644
|
-
"text-on-accent-container",
|
|
645
|
-
"hover:bg-accent/dim-5",
|
|
646
|
-
"enabled:active:bg-accent/dim-5",
|
|
647
|
-
"focus-visible:bg-accent/dim-5"
|
|
648
|
-
])
|
|
649
|
-
},
|
|
650
|
-
{
|
|
651
|
-
intent: "basic",
|
|
652
|
-
design: "ghost",
|
|
653
|
-
class: (0, import_internal_utils4.tw)([
|
|
654
|
-
"text-on-basic-container",
|
|
655
|
-
"hover:bg-basic/dim-5",
|
|
656
|
-
"enabled:active:bg-basic/dim-5",
|
|
657
|
-
"focus-visible:bg-basic/dim-5"
|
|
658
|
-
])
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
intent: "success",
|
|
662
|
-
design: "ghost",
|
|
663
|
-
class: (0, import_internal_utils4.tw)([
|
|
664
|
-
"text-on-success-container",
|
|
665
|
-
"hover:bg-success/dim-5",
|
|
666
|
-
"enabled:active:bg-success/dim-5",
|
|
667
|
-
"focus-visible:bg-success/dim-5"
|
|
668
|
-
])
|
|
669
|
-
},
|
|
670
|
-
{
|
|
671
|
-
intent: "alert",
|
|
672
|
-
design: "ghost",
|
|
673
|
-
class: (0, import_internal_utils4.tw)([
|
|
674
|
-
"text-on-alert-container",
|
|
675
|
-
"hover:bg-alert/dim-5",
|
|
676
|
-
"enabled:active:bg-alert/dim-5",
|
|
677
|
-
"focus-visible:bg-alert/dim-5"
|
|
678
|
-
])
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
intent: "danger",
|
|
682
|
-
design: "ghost",
|
|
683
|
-
class: (0, import_internal_utils4.tw)([
|
|
684
|
-
"text-on-error-container",
|
|
685
|
-
"hover:bg-error/dim-5",
|
|
686
|
-
"enabled:active:bg-error/dim-5",
|
|
687
|
-
"focus-visible:bg-error/dim-5"
|
|
688
|
-
])
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
intent: "info",
|
|
692
|
-
design: "ghost",
|
|
693
|
-
class: (0, import_internal_utils4.tw)([
|
|
694
|
-
"text-on-info-container",
|
|
695
|
-
"hover:bg-info/dim-5",
|
|
696
|
-
"enabled:active:bg-info/dim-5",
|
|
697
|
-
"focus-visible:bg-info/dim-5"
|
|
698
|
-
])
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
intent: "neutral",
|
|
702
|
-
design: "ghost",
|
|
703
|
-
class: (0, import_internal_utils4.tw)([
|
|
704
|
-
"text-on-neutral-container",
|
|
705
|
-
"hover:bg-neutral/dim-5",
|
|
706
|
-
"enabled:active:bg-neutral/dim-5",
|
|
707
|
-
"focus-visible:bg-neutral/dim-5"
|
|
708
|
-
])
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
intent: "surface",
|
|
712
|
-
design: "ghost",
|
|
713
|
-
class: (0, import_internal_utils4.tw)([
|
|
714
|
-
"text-surface",
|
|
715
|
-
"hover:bg-surface/dim-5",
|
|
716
|
-
"enabled:active:bg-surface/dim-5",
|
|
717
|
-
"focus-visible:bg-surface/dim-5"
|
|
718
|
-
])
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
intent: "surfaceInverse",
|
|
722
|
-
design: "ghost",
|
|
723
|
-
class: (0, import_internal_utils4.tw)([
|
|
724
|
-
"text-surface-inverse",
|
|
725
|
-
"hover:bg-surface-inverse/dim-5",
|
|
726
|
-
"enabled:active:bg-surface-inverse/dim-5",
|
|
727
|
-
"focus-visible:bg-surface-inverse/dim-5"
|
|
728
|
-
])
|
|
729
|
-
}
|
|
730
|
-
];
|
|
731
|
-
|
|
732
|
-
// src/button/variants/outlined.ts
|
|
733
|
-
var import_internal_utils5 = require("@spark-ui/internal-utils");
|
|
734
|
-
var outlinedVariants = [
|
|
735
|
-
{
|
|
736
|
-
intent: "main",
|
|
737
|
-
design: "outlined",
|
|
738
|
-
class: (0, import_internal_utils5.tw)([
|
|
739
|
-
"hover:bg-main/dim-5",
|
|
740
|
-
"enabled:active:bg-main/dim-5",
|
|
741
|
-
"focus-visible:bg-main/dim-5",
|
|
742
|
-
"text-main"
|
|
743
|
-
])
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
intent: "support",
|
|
747
|
-
design: "outlined",
|
|
748
|
-
class: (0, import_internal_utils5.tw)([
|
|
749
|
-
"hover:bg-support/dim-5",
|
|
750
|
-
"enabled:active:bg-support/dim-5",
|
|
751
|
-
"focus-visible:bg-support/dim-5",
|
|
752
|
-
"text-support"
|
|
753
|
-
])
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
intent: "accent",
|
|
757
|
-
design: "outlined",
|
|
758
|
-
class: (0, import_internal_utils5.tw)([
|
|
759
|
-
"hover:bg-accent/dim-5",
|
|
760
|
-
"enabled:active:bg-accent/dim-5",
|
|
761
|
-
"focus-visible:bg-accent/dim-5",
|
|
762
|
-
"text-accent"
|
|
763
|
-
])
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
intent: "basic",
|
|
767
|
-
design: "outlined",
|
|
768
|
-
class: (0, import_internal_utils5.tw)([
|
|
769
|
-
"hover:bg-basic/dim-5",
|
|
770
|
-
"enabled:active:bg-basic/dim-5",
|
|
771
|
-
"focus-visible:bg-basic/dim-5",
|
|
772
|
-
"text-basic"
|
|
773
|
-
])
|
|
774
|
-
},
|
|
775
|
-
{
|
|
776
|
-
intent: "success",
|
|
777
|
-
design: "outlined",
|
|
778
|
-
class: (0, import_internal_utils5.tw)([
|
|
779
|
-
"hover:bg-success/dim-5",
|
|
780
|
-
"enabled:active:bg-success/dim-5",
|
|
781
|
-
"focus-visible:bg-success/dim-5",
|
|
782
|
-
"text-success"
|
|
783
|
-
])
|
|
784
|
-
},
|
|
785
|
-
{
|
|
786
|
-
intent: "alert",
|
|
787
|
-
design: "outlined",
|
|
788
|
-
class: (0, import_internal_utils5.tw)([
|
|
789
|
-
"hover:bg-alert/dim-5",
|
|
790
|
-
"enabled:active:bg-alert/dim-5",
|
|
791
|
-
"focus-visible:bg-alert/dim-5",
|
|
792
|
-
"text-alert"
|
|
793
|
-
])
|
|
794
|
-
},
|
|
795
|
-
{
|
|
796
|
-
intent: "danger",
|
|
797
|
-
design: "outlined",
|
|
798
|
-
class: (0, import_internal_utils5.tw)([
|
|
799
|
-
"hover:bg-error/dim-5",
|
|
800
|
-
"enabled:active:bg-error/dim-5",
|
|
801
|
-
"focus-visible:bg-error/dim-5",
|
|
802
|
-
"text-error"
|
|
803
|
-
])
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
intent: "info",
|
|
807
|
-
design: "outlined",
|
|
808
|
-
class: (0, import_internal_utils5.tw)([
|
|
809
|
-
"hover:bg-info/dim-5",
|
|
810
|
-
"enabled:active:bg-info/dim-5",
|
|
811
|
-
"focus-visible:bg-info/dim-5",
|
|
812
|
-
"text-info"
|
|
813
|
-
])
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
intent: "neutral",
|
|
817
|
-
design: "outlined",
|
|
818
|
-
class: (0, import_internal_utils5.tw)([
|
|
819
|
-
"hover:bg-neutral/dim-5",
|
|
820
|
-
"enabled:active:bg-neutral/dim-5",
|
|
821
|
-
"focus-visible:bg-neutral/dim-5",
|
|
822
|
-
"text-neutral"
|
|
823
|
-
])
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
intent: "surface",
|
|
827
|
-
design: "outlined",
|
|
828
|
-
class: (0, import_internal_utils5.tw)([
|
|
829
|
-
"hover:bg-surface/dim-5",
|
|
830
|
-
"enabled:active:bg-surface/dim-5",
|
|
831
|
-
"focus-visible:bg-surface/dim-5",
|
|
832
|
-
"text-surface"
|
|
833
|
-
])
|
|
834
|
-
},
|
|
835
|
-
{
|
|
836
|
-
intent: "surfaceInverse",
|
|
837
|
-
design: "outlined",
|
|
838
|
-
class: (0, import_internal_utils5.tw)([
|
|
839
|
-
"hover:bg-surface-inverse/dim-5",
|
|
840
|
-
"enabled:active:bg-surface-inverse/dim-5",
|
|
841
|
-
"focus-visible:bg-surface-inverse/dim-5",
|
|
842
|
-
"text-surface-inverse"
|
|
843
|
-
])
|
|
844
|
-
}
|
|
845
|
-
];
|
|
846
|
-
|
|
847
|
-
// src/button/variants/tinted.ts
|
|
848
|
-
var import_internal_utils6 = require("@spark-ui/internal-utils");
|
|
849
|
-
var tintedVariants = [
|
|
850
|
-
{
|
|
851
|
-
intent: "main",
|
|
852
|
-
design: "tinted",
|
|
853
|
-
class: (0, import_internal_utils6.tw)([
|
|
854
|
-
"bg-main-container",
|
|
855
|
-
"text-on-main-container",
|
|
856
|
-
"hover:bg-main-container-hovered",
|
|
857
|
-
"enabled:active:bg-main-container-hovered",
|
|
858
|
-
"focus-visible:bg-main-container-hovered"
|
|
859
|
-
])
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
intent: "support",
|
|
863
|
-
design: "tinted",
|
|
864
|
-
class: (0, import_internal_utils6.tw)([
|
|
865
|
-
"bg-support-container",
|
|
866
|
-
"text-on-support-container",
|
|
867
|
-
"hover:bg-support-container-hovered",
|
|
868
|
-
"enabled:active:bg-support-container-hovered",
|
|
869
|
-
"focus-visible:bg-support-container-hovered"
|
|
870
|
-
])
|
|
871
|
-
},
|
|
872
|
-
{
|
|
873
|
-
intent: "accent",
|
|
874
|
-
design: "tinted",
|
|
875
|
-
class: (0, import_internal_utils6.tw)([
|
|
876
|
-
"bg-accent-container",
|
|
877
|
-
"text-on-accent-container",
|
|
878
|
-
"hover:bg-accent-container-hovered",
|
|
879
|
-
"enabled:active:bg-accent-container-hovered",
|
|
880
|
-
"focus-visible:bg-accent-container-hovered"
|
|
881
|
-
])
|
|
882
|
-
},
|
|
883
|
-
{
|
|
884
|
-
intent: "basic",
|
|
885
|
-
design: "tinted",
|
|
886
|
-
class: (0, import_internal_utils6.tw)([
|
|
887
|
-
"bg-basic-container",
|
|
888
|
-
"text-on-basic-container",
|
|
889
|
-
"hover:bg-basic-container-hovered",
|
|
890
|
-
"enabled:active:bg-basic-container-hovered",
|
|
891
|
-
"focus-visible:bg-basic-container-hovered"
|
|
892
|
-
])
|
|
893
|
-
},
|
|
894
|
-
{
|
|
895
|
-
intent: "success",
|
|
896
|
-
design: "tinted",
|
|
897
|
-
class: (0, import_internal_utils6.tw)([
|
|
898
|
-
"bg-success-container",
|
|
899
|
-
"text-on-success-container",
|
|
900
|
-
"hover:bg-success-container-hovered",
|
|
901
|
-
"enabled:active:bg-success-container-hovered",
|
|
902
|
-
"focus-visible:bg-success-container-hovered"
|
|
903
|
-
])
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
intent: "alert",
|
|
907
|
-
design: "tinted",
|
|
908
|
-
class: (0, import_internal_utils6.tw)([
|
|
909
|
-
"bg-alert-container",
|
|
910
|
-
"text-on-alert-container",
|
|
911
|
-
"hover:bg-alert-container-hovered",
|
|
912
|
-
"enabled:active:bg-alert-container-hovered",
|
|
913
|
-
"focus-visible:bg-alert-container-hovered"
|
|
914
|
-
])
|
|
915
|
-
},
|
|
916
|
-
{
|
|
917
|
-
intent: "danger",
|
|
918
|
-
design: "tinted",
|
|
919
|
-
class: (0, import_internal_utils6.tw)([
|
|
920
|
-
"bg-error-container",
|
|
921
|
-
"text-on-error-container",
|
|
922
|
-
"hover:bg-error-container-hovered",
|
|
923
|
-
"enabled:active:bg-error-container-hovered",
|
|
924
|
-
"focus-visible:bg-error-container-hovered"
|
|
925
|
-
])
|
|
926
|
-
},
|
|
927
|
-
{
|
|
928
|
-
intent: "info",
|
|
929
|
-
design: "tinted",
|
|
930
|
-
class: (0, import_internal_utils6.tw)([
|
|
931
|
-
"bg-info-container",
|
|
932
|
-
"text-on-info-container",
|
|
933
|
-
"hover:bg-info-container-hovered",
|
|
934
|
-
"enabled:active:bg-info-container-hovered",
|
|
935
|
-
"focus-visible:bg-info-container-hovered"
|
|
936
|
-
])
|
|
937
|
-
},
|
|
938
|
-
{
|
|
939
|
-
intent: "neutral",
|
|
940
|
-
design: "tinted",
|
|
941
|
-
class: (0, import_internal_utils6.tw)([
|
|
942
|
-
"bg-neutral-container",
|
|
943
|
-
"text-on-neutral-container",
|
|
944
|
-
"hover:bg-neutral-container-hovered",
|
|
945
|
-
"enabled:active:bg-neutral-container-hovered",
|
|
946
|
-
"focus-visible:bg-neutral-container-hovered"
|
|
947
|
-
])
|
|
948
|
-
},
|
|
949
|
-
{
|
|
950
|
-
intent: "surface",
|
|
951
|
-
design: "tinted",
|
|
952
|
-
class: (0, import_internal_utils6.tw)([
|
|
953
|
-
"bg-surface",
|
|
954
|
-
"text-on-surface",
|
|
955
|
-
"hover:bg-surface-hovered",
|
|
956
|
-
"enabled:active:bg-surface-hovered",
|
|
957
|
-
"focus-visible:bg-surface-hovered"
|
|
958
|
-
])
|
|
959
|
-
},
|
|
960
|
-
{
|
|
961
|
-
intent: "surfaceInverse",
|
|
962
|
-
design: "tinted",
|
|
963
|
-
class: (0, import_internal_utils6.tw)([
|
|
964
|
-
"bg-surface-inverse",
|
|
965
|
-
"text-on-surface-inverse",
|
|
966
|
-
"hover:bg-surface-inverse-hovered",
|
|
967
|
-
"enabled:active:bg-surface-inverse-hovered",
|
|
968
|
-
"focus-visible:bg-surface-inverse-hovered"
|
|
969
|
-
])
|
|
970
|
-
}
|
|
971
|
-
];
|
|
972
|
-
|
|
973
|
-
// src/button/variants/contrast.ts
|
|
974
|
-
var import_internal_utils7 = require("@spark-ui/internal-utils");
|
|
975
|
-
var contrastVariants = [
|
|
976
|
-
{
|
|
977
|
-
intent: "main",
|
|
978
|
-
design: "contrast",
|
|
979
|
-
class: (0, import_internal_utils7.tw)([
|
|
980
|
-
"text-on-main-contaier bg-surface",
|
|
981
|
-
"hover:bg-main-container-hovered",
|
|
982
|
-
"enabled:active:bg-main-container-hovered",
|
|
983
|
-
"focus-visible:bg-main-container-hovered"
|
|
984
|
-
])
|
|
985
|
-
},
|
|
986
|
-
{
|
|
987
|
-
intent: "support",
|
|
988
|
-
design: "contrast",
|
|
989
|
-
class: (0, import_internal_utils7.tw)([
|
|
990
|
-
"text-on-support-container bg-surface",
|
|
991
|
-
"hover:bg-support-container-hovered",
|
|
992
|
-
"enabled:active:bg-support-container-hovered",
|
|
993
|
-
"focus-visible:bg-support-container-hovered"
|
|
994
|
-
])
|
|
995
|
-
},
|
|
996
|
-
{
|
|
997
|
-
intent: "accent",
|
|
998
|
-
design: "contrast",
|
|
999
|
-
class: (0, import_internal_utils7.tw)([
|
|
1000
|
-
"text-on-accent-container bg-surface",
|
|
1001
|
-
"hover:bg-accent-container-hovered",
|
|
1002
|
-
"enabled:active:bg-accent-container-hovered",
|
|
1003
|
-
"focus-visible:bg-accent-container-hovered"
|
|
1004
|
-
])
|
|
1005
|
-
},
|
|
1006
|
-
{
|
|
1007
|
-
intent: "basic",
|
|
1008
|
-
design: "contrast",
|
|
1009
|
-
class: (0, import_internal_utils7.tw)([
|
|
1010
|
-
"text-on-basic-container bg-surface",
|
|
1011
|
-
"hover:bg-basic-container-hovered",
|
|
1012
|
-
"enabled:active:bg-basic-container-hovered",
|
|
1013
|
-
"focus-visible:bg-basic-container-hovered"
|
|
1014
|
-
])
|
|
1015
|
-
},
|
|
1016
|
-
{
|
|
1017
|
-
intent: "success",
|
|
1018
|
-
design: "contrast",
|
|
1019
|
-
class: (0, import_internal_utils7.tw)([
|
|
1020
|
-
"text-on-success-container bg-surface",
|
|
1021
|
-
"hover:bg-success-container-hovered",
|
|
1022
|
-
"enabled:active:bg-success-container-hovered",
|
|
1023
|
-
"focus-visible:bg-success-container-hovered"
|
|
1024
|
-
])
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
intent: "alert",
|
|
1028
|
-
design: "contrast",
|
|
1029
|
-
class: (0, import_internal_utils7.tw)([
|
|
1030
|
-
"text-on-alert-container bg-surface",
|
|
1031
|
-
"hover:bg-alert-container-hovered",
|
|
1032
|
-
"enabled:active:bg-alert-container-hovered",
|
|
1033
|
-
"focus-visible:bg-alert-container-hovered"
|
|
1034
|
-
])
|
|
1035
|
-
},
|
|
1036
|
-
{
|
|
1037
|
-
intent: "danger",
|
|
1038
|
-
design: "contrast",
|
|
1039
|
-
class: (0, import_internal_utils7.tw)([
|
|
1040
|
-
"text-on-error-container bg-surface",
|
|
1041
|
-
"hover:bg-error-container-hovered",
|
|
1042
|
-
"enabled:active:bg-error-container-hovered",
|
|
1043
|
-
"focus-visible:bg-error-container-hovered"
|
|
1044
|
-
])
|
|
1045
|
-
},
|
|
1046
|
-
{
|
|
1047
|
-
intent: "info",
|
|
1048
|
-
design: "contrast",
|
|
1049
|
-
class: (0, import_internal_utils7.tw)([
|
|
1050
|
-
"text-on-info-container bg-surface",
|
|
1051
|
-
"hover:bg-info-container-hovered",
|
|
1052
|
-
"enabled:active:bg-info-container-hovered",
|
|
1053
|
-
"focus-visible:bg-info-container-hovered"
|
|
1054
|
-
])
|
|
1055
|
-
},
|
|
1056
|
-
{
|
|
1057
|
-
intent: "neutral",
|
|
1058
|
-
design: "contrast",
|
|
1059
|
-
class: (0, import_internal_utils7.tw)([
|
|
1060
|
-
"text-on-neutral-container bg-surface",
|
|
1061
|
-
"hover:bg-neutral-container-hovered",
|
|
1062
|
-
"enabled:active:bg-neutral-container-hovered",
|
|
1063
|
-
"focus-visible:bg-neutral-container-hovered"
|
|
1064
|
-
])
|
|
1065
|
-
},
|
|
1066
|
-
{
|
|
1067
|
-
intent: "surface",
|
|
1068
|
-
design: "contrast",
|
|
1069
|
-
class: (0, import_internal_utils7.tw)([
|
|
1070
|
-
"text-on-surface bg-surface",
|
|
1071
|
-
"hover:bg-surface-hovered",
|
|
1072
|
-
"enabled:active:bg-surface-hovered",
|
|
1073
|
-
"focus-visible:bg-surface-hovered"
|
|
1074
|
-
])
|
|
1075
|
-
},
|
|
1076
|
-
{
|
|
1077
|
-
intent: "surfaceInverse",
|
|
1078
|
-
design: "contrast",
|
|
1079
|
-
class: (0, import_internal_utils7.tw)([
|
|
1080
|
-
"text-on-surface-inverse bg-surface-inverse",
|
|
1081
|
-
"hover:bg-surface-inverse-hovered",
|
|
1082
|
-
"enabled:active:bg-surface-inverse-hovered",
|
|
1083
|
-
"focus-visible:bg-surface-inverse-hovered"
|
|
1084
|
-
])
|
|
1085
|
-
}
|
|
1086
|
-
];
|
|
1087
|
-
|
|
1088
|
-
// src/button/Button.styles.tsx
|
|
1089
|
-
var buttonStyles = (0, import_class_variance_authority7.cva)(
|
|
1090
|
-
[
|
|
1091
|
-
"u-shadow-border-transition",
|
|
1092
|
-
"box-border inline-flex items-center justify-center gap-md whitespace-nowrap",
|
|
1093
|
-
"default:px-lg",
|
|
1094
|
-
"text-body-1 font-bold",
|
|
1095
|
-
"focus-visible:u-outline"
|
|
1096
|
-
],
|
|
1097
|
-
{
|
|
1098
|
-
variants: {
|
|
1099
|
-
/**
|
|
1100
|
-
* Main style of the button.
|
|
1101
|
-
*
|
|
1102
|
-
* - `filled`: Button will be plain.
|
|
1103
|
-
*
|
|
1104
|
-
* - `outlined`: Button will be transparent with an outline.
|
|
1105
|
-
*
|
|
1106
|
-
* - `tinted`: Button will be filled but using a lighter color scheme.
|
|
1107
|
-
*
|
|
1108
|
-
* - `ghost`: Button will look like a link. No borders, plain text.
|
|
1109
|
-
*
|
|
1110
|
-
* - `contrast`: Button will be surface filled. No borders, plain text.
|
|
1111
|
-
*
|
|
1112
|
-
*/
|
|
1113
|
-
design: (0, import_internal_utils8.makeVariants)({
|
|
1114
|
-
filled: [],
|
|
1115
|
-
outlined: ["bg-transparent", "border-sm", "border-current"],
|
|
1116
|
-
tinted: [],
|
|
1117
|
-
ghost: ["default:-mx-md px-md hover:bg-main/dim-5"],
|
|
1118
|
-
contrast: []
|
|
1119
|
-
}),
|
|
1120
|
-
underline: {
|
|
1121
|
-
true: ["underline"]
|
|
1122
|
-
},
|
|
1123
|
-
/**
|
|
1124
|
-
* Color scheme of the button.
|
|
1125
|
-
*/
|
|
1126
|
-
intent: (0, import_internal_utils8.makeVariants)({
|
|
1127
|
-
main: [],
|
|
1128
|
-
support: [],
|
|
1129
|
-
accent: [],
|
|
1130
|
-
basic: [],
|
|
1131
|
-
success: [],
|
|
1132
|
-
alert: [],
|
|
1133
|
-
danger: [],
|
|
1134
|
-
info: [],
|
|
1135
|
-
neutral: [],
|
|
1136
|
-
surface: [],
|
|
1137
|
-
surfaceInverse: []
|
|
1138
|
-
}),
|
|
1139
|
-
/**
|
|
1140
|
-
* Size of the button.
|
|
1141
|
-
*/
|
|
1142
|
-
size: (0, import_internal_utils8.makeVariants)({
|
|
1143
|
-
sm: ["min-w-sz-32", "h-sz-32"],
|
|
1144
|
-
md: ["min-w-sz-44", "h-sz-44"],
|
|
1145
|
-
lg: ["min-w-sz-56", "h-sz-56"]
|
|
1146
|
-
}),
|
|
1147
|
-
/**
|
|
1148
|
-
* Shape of the button.
|
|
1149
|
-
*/
|
|
1150
|
-
shape: (0, import_internal_utils8.makeVariants)({
|
|
1151
|
-
rounded: ["rounded-lg"],
|
|
1152
|
-
square: ["rounded-0"],
|
|
1153
|
-
pill: ["rounded-full"]
|
|
1154
|
-
}),
|
|
1155
|
-
/**
|
|
1156
|
-
* Disable the button, preventing user interaction and adding opacity.
|
|
1157
|
-
*/
|
|
1158
|
-
disabled: {
|
|
1159
|
-
true: ["cursor-not-allowed", "opacity-dim-3"],
|
|
1160
|
-
false: ["cursor-pointer"]
|
|
1161
|
-
}
|
|
1162
|
-
},
|
|
1163
|
-
compoundVariants: [
|
|
1164
|
-
...filledVariants,
|
|
1165
|
-
...outlinedVariants,
|
|
1166
|
-
...tintedVariants,
|
|
1167
|
-
...ghostVariants,
|
|
1168
|
-
...contrastVariants
|
|
1169
|
-
],
|
|
1170
|
-
defaultVariants: {
|
|
1171
|
-
design: "filled",
|
|
1172
|
-
intent: "main",
|
|
1173
|
-
size: "md",
|
|
1174
|
-
shape: "rounded"
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
);
|
|
1178
|
-
|
|
1179
|
-
// src/button/Button.tsx
|
|
1180
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1181
|
-
var blockedEventHandlers = [
|
|
1182
|
-
"onClick",
|
|
1183
|
-
"onMouseDown",
|
|
1184
|
-
"onMouseUp",
|
|
1185
|
-
"onMouseEnter",
|
|
1186
|
-
"onMouseLeave",
|
|
1187
|
-
"onMouseOver",
|
|
1188
|
-
"onMouseOut",
|
|
1189
|
-
"onKeyDown",
|
|
1190
|
-
"onKeyPress",
|
|
1191
|
-
"onKeyUp",
|
|
1192
|
-
"onSubmit"
|
|
1193
|
-
];
|
|
1194
|
-
var Button = ({
|
|
1195
|
-
children,
|
|
1196
|
-
design = "filled",
|
|
1197
|
-
disabled = false,
|
|
1198
|
-
intent = "main",
|
|
1199
|
-
isLoading = false,
|
|
1200
|
-
loadingLabel,
|
|
1201
|
-
loadingText,
|
|
1202
|
-
shape = "rounded",
|
|
1203
|
-
size = "md",
|
|
1204
|
-
asChild,
|
|
1205
|
-
className,
|
|
1206
|
-
underline = false,
|
|
1207
|
-
ref,
|
|
1208
|
-
...others
|
|
1209
|
-
}) => {
|
|
1210
|
-
const Component = asChild ? Slot : "button";
|
|
1211
|
-
const shouldNotInteract = !!disabled || isLoading;
|
|
1212
|
-
const disabledEventHandlers = (0, import_react7.useMemo)(() => {
|
|
1213
|
-
const result = {};
|
|
1214
|
-
if (shouldNotInteract) {
|
|
1215
|
-
blockedEventHandlers.forEach((eventHandler) => result[eventHandler] = void 0);
|
|
1216
|
-
}
|
|
1217
|
-
return result;
|
|
1218
|
-
}, [shouldNotInteract]);
|
|
1219
|
-
const spinnerProps = {
|
|
1220
|
-
size: "current",
|
|
1221
|
-
className: loadingText ? "inline-block" : "absolute",
|
|
1222
|
-
...loadingLabel && { "aria-label": loadingLabel }
|
|
1223
|
-
};
|
|
1224
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1225
|
-
Component,
|
|
1226
|
-
{
|
|
1227
|
-
"data-spark-component": "button",
|
|
1228
|
-
...Component === "button" && { type: "button" },
|
|
1229
|
-
ref,
|
|
1230
|
-
className: buttonStyles({
|
|
1231
|
-
className,
|
|
1232
|
-
design,
|
|
1233
|
-
disabled: shouldNotInteract,
|
|
1234
|
-
intent,
|
|
1235
|
-
shape,
|
|
1236
|
-
size,
|
|
1237
|
-
underline
|
|
1238
|
-
}),
|
|
1239
|
-
disabled: !!disabled,
|
|
1240
|
-
"aria-busy": isLoading,
|
|
1241
|
-
"aria-live": isLoading ? "assertive" : "off",
|
|
1242
|
-
...others,
|
|
1243
|
-
...disabledEventHandlers,
|
|
1244
|
-
children: wrapPolymorphicSlot(
|
|
1245
|
-
asChild,
|
|
1246
|
-
children,
|
|
1247
|
-
(slotted) => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1248
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Spinner, { ...spinnerProps }),
|
|
1249
|
-
loadingText && loadingText,
|
|
1250
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1251
|
-
"div",
|
|
1252
|
-
{
|
|
1253
|
-
"aria-hidden": true,
|
|
1254
|
-
className: (0, import_class_variance_authority8.cx)("gap-md", loadingText ? "hidden" : "inline-flex opacity-0"),
|
|
1255
|
-
children: slotted
|
|
1256
|
-
}
|
|
1257
|
-
)
|
|
1258
|
-
] }) : slotted
|
|
1259
|
-
)
|
|
1260
|
-
}
|
|
1261
|
-
);
|
|
1262
|
-
};
|
|
1263
|
-
Button.displayName = "Button";
|
|
1264
|
-
|
|
1265
|
-
// src/icon-button/IconButton.styles.tsx
|
|
1266
|
-
var import_internal_utils9 = require("@spark-ui/internal-utils");
|
|
1267
|
-
var import_class_variance_authority9 = require("class-variance-authority");
|
|
1268
|
-
var iconButtonStyles = (0, import_class_variance_authority9.cva)(["pl-0 pr-0"], {
|
|
1269
|
-
variants: {
|
|
1270
|
-
/**
|
|
1271
|
-
* Sets the size of the icon.
|
|
1272
|
-
*/
|
|
1273
|
-
size: (0, import_internal_utils9.makeVariants)({
|
|
1274
|
-
sm: ["text-body-1"],
|
|
1275
|
-
md: ["text-body-1"],
|
|
1276
|
-
lg: ["text-display-3"]
|
|
1277
|
-
})
|
|
1278
|
-
}
|
|
1279
|
-
});
|
|
1280
|
-
|
|
1281
|
-
// src/icon-button/IconButton.tsx
|
|
1282
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1283
|
-
var IconButton = ({
|
|
1284
|
-
design = "filled",
|
|
1285
|
-
disabled = false,
|
|
1286
|
-
intent = "main",
|
|
1287
|
-
shape = "rounded",
|
|
1288
|
-
size = "md",
|
|
1289
|
-
className,
|
|
1290
|
-
ref,
|
|
1291
|
-
...others
|
|
1292
|
-
}) => {
|
|
1293
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1294
|
-
Button,
|
|
1295
|
-
{
|
|
1296
|
-
"data-spark-component": "icon-button",
|
|
1297
|
-
ref,
|
|
1298
|
-
className: iconButtonStyles({ size, className }),
|
|
1299
|
-
design,
|
|
1300
|
-
disabled,
|
|
1301
|
-
intent,
|
|
1302
|
-
shape,
|
|
1303
|
-
size,
|
|
1304
|
-
...others
|
|
1305
|
-
}
|
|
1306
|
-
);
|
|
1307
|
-
};
|
|
1308
|
-
IconButton.displayName = "IconButton";
|
|
1309
|
-
|
|
1310
|
-
// src/scrolling-list/ScrollingListNextButton.tsx
|
|
1311
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1312
|
-
var ScrollingListNextButton = ({ "aria-label": ariaLabel, ...rest }) => {
|
|
1313
|
-
const ctx = (0, import_react8.useContext)(ScrollingListContext);
|
|
1314
|
-
const handleNextPage = () => {
|
|
1315
|
-
if (ctx.hasNextPage) {
|
|
1316
|
-
ctx.next({ behavior: ctx.scrollBehavior });
|
|
1317
|
-
} else {
|
|
1318
|
-
ctx.goTo(0, { behavior: ctx.scrollBehavior });
|
|
1319
|
-
}
|
|
1320
|
-
};
|
|
1321
|
-
const listHasOverflow = ctx.overflow.left || ctx.overflow.right;
|
|
1322
|
-
const isDisabled = !listHasOverflow || !ctx.loop && !ctx.overflow.right;
|
|
1323
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1324
|
-
IconButton,
|
|
1325
|
-
{
|
|
1326
|
-
"data-spark-component": "scrolling-list-next-button",
|
|
1327
|
-
size: "sm",
|
|
1328
|
-
intent: "surface",
|
|
1329
|
-
design: "filled",
|
|
1330
|
-
className: (0, import_class_variance_authority10.cx)(
|
|
1331
|
-
"pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible",
|
|
1332
|
-
"group-hover/scrolling-list:opacity-none focus-visible:opacity-none"
|
|
1333
|
-
),
|
|
1334
|
-
onClick: handleNextPage,
|
|
1335
|
-
disabled: isDisabled,
|
|
1336
|
-
"aria-label": ariaLabel,
|
|
1337
|
-
"aria-controls": "scrolling-list-items",
|
|
1338
|
-
...rest,
|
|
1339
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ArrowVerticalRight.ArrowVerticalRight, {}) })
|
|
1340
|
-
}
|
|
1341
|
-
);
|
|
1342
|
-
};
|
|
1343
|
-
ScrollingListNextButton.displayName = "ScrollingList.NextButton";
|
|
1344
|
-
|
|
1345
|
-
// src/scrolling-list/ScrollingListPrevButton.tsx
|
|
1346
|
-
var import_ArrowVerticalLeft = require("@spark-ui/icons/ArrowVerticalLeft");
|
|
1347
|
-
var import_class_variance_authority11 = require("class-variance-authority");
|
|
1348
|
-
var import_react9 = require("react");
|
|
1349
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1350
|
-
var ScrollingListPrevButton = ({
|
|
1351
|
-
"aria-label": ariaLabel,
|
|
1352
|
-
...rest
|
|
1353
|
-
}) => {
|
|
1354
|
-
const ctx = (0, import_react9.useContext)(ScrollingListContext);
|
|
1355
|
-
const handlePrevPage = () => {
|
|
1356
|
-
const shouldSnapFirstPage = ctx.activePageIndex === 0 && (ctx.scrollAreaRef.current?.scrollLeft || 0) > 0;
|
|
1357
|
-
if (shouldSnapFirstPage) {
|
|
1358
|
-
ctx.goTo(0, { behavior: ctx.scrollBehavior });
|
|
1359
|
-
} else if (ctx.hasPrevPage) {
|
|
1360
|
-
ctx.prev({ behavior: ctx.scrollBehavior });
|
|
1361
|
-
} else {
|
|
1362
|
-
ctx.goTo(ctx.pages.length - 1, { behavior: ctx.scrollBehavior });
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
|
-
const listHasOverflow = ctx.overflow.left || ctx.overflow.right;
|
|
1366
|
-
const isDisabled = !listHasOverflow || !ctx.loop && !ctx.overflow.left;
|
|
1367
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1368
|
-
IconButton,
|
|
1369
|
-
{
|
|
1370
|
-
"data-spark-component": "scrolling-list-prev-button",
|
|
1371
|
-
size: "sm",
|
|
1372
|
-
intent: "surface",
|
|
1373
|
-
design: "filled",
|
|
1374
|
-
className: (0, import_class_variance_authority11.cx)(
|
|
1375
|
-
"pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible",
|
|
1376
|
-
"group-hover/scrolling-list:opacity-none focus-visible:opacity-none"
|
|
1377
|
-
),
|
|
1378
|
-
onClick: handlePrevPage,
|
|
1379
|
-
disabled: isDisabled,
|
|
1380
|
-
"aria-label": ariaLabel,
|
|
1381
|
-
"aria-controls": "scrolling-list-items",
|
|
1382
|
-
...rest,
|
|
1383
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_ArrowVerticalLeft.ArrowVerticalLeft, {}) })
|
|
1384
|
-
}
|
|
1385
|
-
);
|
|
1386
|
-
};
|
|
1387
|
-
ScrollingListPrevButton.displayName = "ScrollingList.PrevButton";
|
|
1388
|
-
|
|
1389
|
-
// src/scrolling-list/ScrollingListSkipButton.tsx
|
|
1390
|
-
var import_class_variance_authority12 = require("class-variance-authority");
|
|
1391
|
-
var import_react10 = require("react");
|
|
1392
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1393
|
-
var ScrollingListSkipButton = ({ children, ...rest }) => {
|
|
1394
|
-
const ctx = (0, import_react10.useContext)(ScrollingListContext);
|
|
1395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1396
|
-
Button,
|
|
1397
|
-
{
|
|
1398
|
-
type: "button",
|
|
1399
|
-
design: "tinted",
|
|
1400
|
-
intent: "surface",
|
|
1401
|
-
tabIndex: 0,
|
|
1402
|
-
className: (0, import_class_variance_authority12.cx)(
|
|
1403
|
-
"z-raised absolute top-1/2 left-0 -translate-y-1/2",
|
|
1404
|
-
"not-focus-visible:pointer-events-none not-focus-visible:size-0 not-focus-visible:opacity-0"
|
|
1405
|
-
),
|
|
1406
|
-
onClick: ctx.skipKeyboardNavigation,
|
|
1407
|
-
...rest,
|
|
1408
|
-
children
|
|
1409
|
-
}
|
|
1410
|
-
);
|
|
1411
|
-
};
|
|
1412
|
-
ScrollingListSkipButton.displayName = "ScrollingList.SkipButton";
|
|
1413
|
-
|
|
1414
|
-
// src/scrolling-list/index.ts
|
|
1415
|
-
var ScrollingList2 = Object.assign(ScrollingList, {
|
|
1416
|
-
Controls: ScrollingListControls,
|
|
1417
|
-
NextButton: ScrollingListNextButton,
|
|
1418
|
-
PrevButton: ScrollingListPrevButton,
|
|
1419
|
-
Item: ScrollingListItem,
|
|
1420
|
-
Items: ScrollingListItems,
|
|
1421
|
-
SkipButton: ScrollingListSkipButton
|
|
1422
|
-
});
|
|
1423
|
-
ScrollingList2.displayName = "ScrollingList";
|
|
1424
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
1425
|
-
0 && (module.exports = {
|
|
1426
|
-
ScrollingList
|
|
1427
|
-
});
|
|
1428
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),T=require("@spark-ui/hooks/use-scroll-overflow"),p=require("class-variance-authority"),l=require("react"),O=require("react-snap-carousel"),V=require("../Slot-DQ8z2zsy.js"),z=require("@spark-ui/icons/ArrowVerticalRight"),w=require("../Icon-CF0W0LKr.js"),S=require("../IconButton-D3g86WpZ.js"),D=require("@spark-ui/icons/ArrowVerticalLeft"),$=require("../Button-B6rA3-e5.js"),v=l.createContext(null),P=({snapType:s="none",snapStop:n="normal",scrollBehavior:e="smooth",loop:r=!1,gap:t=16,withFade:i=!1,scrollPadding:a=0,children:c,className:f,...d})=>{const o=l.useRef(null),g=l.useRef(null),h=O.useSnapCarousel(),{overflow:j,refresh:b}=T.useScrollOverflow(o,{precisionTreshold:1}),{activePageIndex:A,pages:q,refresh:m}=h,x=q[A],E=x?[x[0]+1,x[x.length-1]+1]:[0,0],y=l.useCallback(()=>{m&&o.current&&setTimeout(()=>{m()},0)},[m]);l.useEffect(()=>{y()},[c,y]),l.useLayoutEffect(()=>{o.current&&requestAnimationFrame(()=>{b()})},[c,b]);const F={...h,snapType:s,snapStop:n,skipKeyboardNavigation:()=>{g.current?.focus()},scrollBehavior:e,visibleItemsRange:E,loop:r,gap:t,withFade:i,scrollPadding:a,scrollAreaRef:o,overflow:j};return u.jsxs(v.Provider,{value:F,children:[u.jsx("div",{"data-spark-component":"scrolling-list",className:p.cx("gap-lg group/scrolling-list relative flex flex-col default:w-full",f),...d,children:c}),u.jsx("span",{ref:g,className:"size-0 overflow-hidden",tabIndex:-1})]})};P.displayName="ScrollingList";const L=({children:s,visibility:n="always",className:e,...r})=>u.jsx("div",{"data-spark-component":"scrolling-list-controls",className:p.cx("default:px-md pointer-events-none absolute inset-0 flex flex-row items-center justify-between overflow-hidden",e),style:{"--scrolling-list-controls-opacity":n==="hover"?"0":"1"},"data-orientation":"horizontal",...r,children:s});L.displayName="ScrollingList.Controls";function K(s,n){const[e,r]=l.useState(!1);return l.useEffect(()=>{const t=c=>{r(!0);const f=c.target,d=n.current;if(f&&d){const o=f.getBoundingClientRect(),g=d.getBoundingClientRect();o.left>=g.left&&o.right<=g.right&&o.top>=g.top&&o.bottom<=g.bottom||f.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},i=c=>{s.current&&!s.current.contains(c.relatedTarget)&&r(!1)},a=s.current;return a&&(a.addEventListener("focusin",t),a.addEventListener("focusout",i)),()=>{a&&(a.removeEventListener("focusin",t),a.removeEventListener("focusout",i))}},[s,n]),e}const I=({asChild:s=!1,children:n,index:e=0,className:r="",...t})=>{const i=l.useContext(v),a=l.useRef(null),c=i.snapPointIndexes.has(e);K(a,i.scrollAreaRef);const f=s?V.Slot:"div";return u.jsx(f,{"data-spark-component":"scrolling-list-item",role:"listitem",ref:a,className:p.cx("default:w-auto default:shrink-0",{"snap-start":c,"snap-normal":c&&i.snapStop==="normal","snap-always":c&&i.snapStop==="always"},r),...t,children:n})};I.displayName="ScrollingList.Item";function H(...s){return n=>{s.forEach(e=>{typeof e=="function"?e(n):e&&typeof e=="object"&&"current"in e&&(e.current=n)})}}const N=({children:s,ref:n,className:e="",...r})=>{const t=l.useContext(v),i={mandatory:"x mandatory",proximity:"x proximity",none:"none"},a=o=>{!t.loop&&!t.hasPrevPage||(o.preventDefault(),t.goTo(t.hasPrevPage?t.activePageIndex-1:t.pages.length-1,{behavior:t.scrollBehavior}))},c=o=>{!t.loop&&!t.hasNextPage||(o.preventDefault(),t.goTo(t.hasNextPage?t.activePageIndex+1:0,{behavior:t.scrollBehavior}))},f=o=>{o.key==="ArrowLeft"&&a(o),o.key==="ArrowRight"&&c(o)},d={scrollSnapType:i[t.snapType],scrollPaddingInline:"var(--scrolling-list-px)","--scrolling-list-px":`${t.scrollPadding}px`,"--scrolling-list-gap":`${t.gap}px`,...t.withFade&&{maskImage:"linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",maskSize:`calc(100% + ${t.overflow.left?"0px":"44px"} + ${t.overflow.right?"0px":"44px"}) 100%`,maskPosition:`${t.overflow.left?"0px":"-44px"} 0`}};return u.jsx("div",{"data-spark-component":"scrolling-list-items",id:"scrolling-list-items",role:"list",className:p.cx("relative transition-all duration-300","u-no-scrollbar overflow-x-auto scroll-smooth","w-full gap-(--scrolling-list-gap) default:flex default:flex-row","focus-visible:u-outline",e),ref:H(t.scrollAreaRef,t.scrollRef,n),style:d,onKeyDown:f,...r,children:l.Children.map(s,(o,g)=>l.isValidElement(o)?l.cloneElement(o,{index:g}):o)})};N.displayName="ScrollingList.Items";const k=({"aria-label":s,...n})=>{const e=l.useContext(v),r=()=>{e.hasNextPage?e.next({behavior:e.scrollBehavior}):e.goTo(0,{behavior:e.scrollBehavior})},i=!(e.overflow.left||e.overflow.right)||!e.loop&&!e.overflow.right;return u.jsx(S.IconButton,{"data-spark-component":"scrolling-list-next-button",size:"sm",intent:"surface",design:"filled",className:p.cx("pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible","group-hover/scrolling-list:opacity-none focus-visible:opacity-none"),onClick:r,disabled:i,"aria-label":s,"aria-controls":"scrolling-list-items",...n,children:u.jsx(w.Icon,{children:u.jsx(z.ArrowVerticalRight,{})})})};k.displayName="ScrollingList.NextButton";const B=({"aria-label":s,...n})=>{const e=l.useContext(v),r=()=>{e.activePageIndex===0&&(e.scrollAreaRef.current?.scrollLeft||0)>0?e.goTo(0,{behavior:e.scrollBehavior}):e.hasPrevPage?e.prev({behavior:e.scrollBehavior}):e.goTo(e.pages.length-1,{behavior:e.scrollBehavior})},i=!(e.overflow.left||e.overflow.right)||!e.loop&&!e.overflow.left;return u.jsx(S.IconButton,{"data-spark-component":"scrolling-list-prev-button",size:"sm",intent:"surface",design:"filled",className:p.cx("pointer-events-auto opacity-(--scrolling-list-controls-opacity) shadow-sm disabled:invisible","group-hover/scrolling-list:opacity-none focus-visible:opacity-none"),onClick:r,disabled:i,"aria-label":s,"aria-controls":"scrolling-list-items",...n,children:u.jsx(w.Icon,{children:u.jsx(D.ArrowVerticalLeft,{})})})};B.displayName="ScrollingList.PrevButton";const C=({children:s,...n})=>{const e=l.useContext(v);return u.jsx($.Button,{type:"button",design:"tinted",intent:"surface",tabIndex:0,className:p.cx("z-raised absolute top-1/2 left-0 -translate-y-1/2","not-focus-visible:pointer-events-none not-focus-visible:size-0 not-focus-visible:opacity-0"),onClick:e.skipKeyboardNavigation,...n,children:s})};C.displayName="ScrollingList.SkipButton";const R=Object.assign(P,{Controls:L,NextButton:k,PrevButton:B,Item:I,Items:N,SkipButton:C});R.displayName="ScrollingList";exports.ScrollingList=R;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|