@neut/ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -0
- package/dist/components/accordion/Accordion/Accordion.context.d.ts +17 -0
- package/dist/components/accordion/Accordion/Accordion.context.js +45 -0
- package/dist/components/accordion/Accordion/Accordion.d.ts +2 -0
- package/dist/components/accordion/Accordion/Accordion.js +65 -0
- package/dist/components/accordion/Accordion/Accordion.styles.d.ts +0 -0
- package/dist/components/accordion/Accordion/Accordion.types.d.ts +19 -0
- package/dist/components/accordion/Accordion/index.d.ts +1 -0
- package/dist/components/accordion/Accordion/useAccordion.d.ts +0 -0
- package/dist/components/accordion/AccordionContent/AccordionContent.d.ts +2 -0
- package/dist/components/accordion/AccordionContent/AccordionContent.js +53 -0
- package/dist/components/accordion/AccordionContent/AccordionContent.styles.d.ts +0 -0
- package/dist/components/accordion/AccordionContent/AccordionContent.types.d.ts +7 -0
- package/dist/components/accordion/AccordionContent/index.d.ts +1 -0
- package/dist/components/accordion/AccordionItem/AccordionItem.context.d.ts +13 -0
- package/dist/components/accordion/AccordionItem/AccordionItem.context.js +25 -0
- package/dist/components/accordion/AccordionItem/AccordionItem.d.ts +2 -0
- package/dist/components/accordion/AccordionItem/AccordionItem.js +46 -0
- package/dist/components/accordion/AccordionItem/AccordionItem.styles.d.ts +0 -0
- package/dist/components/accordion/AccordionItem/AccordionItem.types.d.ts +8 -0
- package/dist/components/accordion/AccordionItem/index.d.ts +1 -0
- package/dist/components/accordion/AccordionTrigger/AccordionTrigger.d.ts +2 -0
- package/dist/components/accordion/AccordionTrigger/AccordionTrigger.js +44 -0
- package/dist/components/accordion/AccordionTrigger/AccordionTrigger.styles.d.ts +0 -0
- package/dist/components/accordion/AccordionTrigger/AccordionTrigger.types.d.ts +6 -0
- package/dist/components/accordion/AccordionTrigger/index.d.ts +1 -0
- package/dist/components/accordion/index.d.ts +4 -0
- package/dist/components/aspect-ratio/AspectRatio.d.ts +2 -0
- package/dist/components/aspect-ratio/AspectRatio.js +25 -0
- package/dist/components/aspect-ratio/AspectRatio.styles.d.ts +1 -0
- package/dist/components/aspect-ratio/AspectRatio.styles.js +5 -0
- package/dist/components/aspect-ratio/AspectRatio.types.d.ts +6 -0
- package/dist/components/aspect-ratio/index.d.ts +1 -0
- package/dist/components/avatar/Avatar/Avatar.context.d.ts +8 -0
- package/dist/components/avatar/Avatar/Avatar.context.js +9 -0
- package/dist/components/avatar/Avatar/Avatar.d.ts +2 -0
- package/dist/components/avatar/Avatar/Avatar.js +34 -0
- package/dist/components/avatar/Avatar/Avatar.types.d.ts +4 -0
- package/dist/components/avatar/Avatar/index.d.ts +1 -0
- package/dist/components/avatar/AvatarBadge/AvatarBadge.d.ts +2 -0
- package/dist/components/avatar/AvatarBadge/AvatarBadge.js +15 -0
- package/dist/components/avatar/AvatarBadge/AvatarBadge.types.d.ts +2 -0
- package/dist/components/avatar/AvatarBadge/index.d.ts +1 -0
- package/dist/components/avatar/AvatarFallback/AvatarFallback.d.ts +2 -0
- package/dist/components/avatar/AvatarFallback/AvatarFallback.js +21 -0
- package/dist/components/avatar/AvatarFallback/AvatarFallback.types.d.ts +2 -0
- package/dist/components/avatar/AvatarFallback/index.d.ts +1 -0
- package/dist/components/avatar/AvatarGroup/AvatarGroup.d.ts +2 -0
- package/dist/components/avatar/AvatarGroup/AvatarGroup.js +15 -0
- package/dist/components/avatar/AvatarGroup/AvatarGroup.types.d.ts +2 -0
- package/dist/components/avatar/AvatarGroup/index.d.ts +1 -0
- package/dist/components/avatar/AvatarGroupCount/AvatarGroupCount.d.ts +2 -0
- package/dist/components/avatar/AvatarGroupCount/AvatarGroupCount.js +15 -0
- package/dist/components/avatar/AvatarGroupCount/AvatarGroupCount.types.d.ts +2 -0
- package/dist/components/avatar/AvatarGroupCount/index.d.ts +1 -0
- package/dist/components/avatar/AvatarImage/AvatarImage.d.ts +2 -0
- package/dist/components/avatar/AvatarImage/AvatarImage.js +32 -0
- package/dist/components/avatar/AvatarImage/AvatarImage.types.d.ts +2 -0
- package/dist/components/avatar/AvatarImage/index.d.ts +1 -0
- package/dist/components/avatar/index.d.ts +6 -0
- package/dist/components/badge/Badge.d.ts +2 -0
- package/dist/components/badge/Badge.js +20 -0
- package/dist/components/badge/Badge.styles.d.ts +3 -0
- package/dist/components/badge/Badge.styles.js +16 -0
- package/dist/components/badge/Badge.types.d.ts +6 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/button/Button.d.ts +2 -0
- package/dist/components/button/Button.js +84 -0
- package/dist/components/button/Button.styles.d.ts +7 -0
- package/dist/components/button/Button.styles.js +26 -0
- package/dist/components/button/Button.types.d.ts +23 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button-group/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/button-group/ButtonGroup/ButtonGroup.js +25 -0
- package/dist/components/button-group/ButtonGroup/ButtonGroup.styles.d.ts +3 -0
- package/dist/components/button-group/ButtonGroup/ButtonGroup.styles.js +11 -0
- package/dist/components/button-group/ButtonGroup/ButtonGroup.types.d.ts +6 -0
- package/dist/components/button-group/ButtonGroup/index.d.ts +1 -0
- package/dist/components/button-group/ButtonGroupSeparator/ButtonGroupSeparator.d.ts +2 -0
- package/dist/components/button-group/ButtonGroupSeparator/ButtonGroupSeparator.js +20 -0
- package/dist/components/button-group/ButtonGroupSeparator/ButtonGroupSeparator.styles.d.ts +1 -0
- package/dist/components/button-group/ButtonGroupSeparator/ButtonGroupSeparator.styles.js +5 -0
- package/dist/components/button-group/ButtonGroupSeparator/ButtonGroupSeparator.types.d.ts +2 -0
- package/dist/components/button-group/ButtonGroupSeparator/index.d.ts +1 -0
- package/dist/components/button-group/ButtonGroupText/ButtonGroupText.d.ts +2 -0
- package/dist/components/button-group/ButtonGroupText/ButtonGroupText.js +12 -0
- package/dist/components/button-group/ButtonGroupText/ButtonGroupText.styles.d.ts +1 -0
- package/dist/components/button-group/ButtonGroupText/ButtonGroupText.styles.js +5 -0
- package/dist/components/button-group/ButtonGroupText/ButtonGroupText.types.d.ts +2 -0
- package/dist/components/button-group/ButtonGroupText/index.d.ts +1 -0
- package/dist/components/button-group/index.d.ts +3 -0
- package/dist/components/card/Card/Card.d.ts +2 -0
- package/dist/components/card/Card/Card.js +25 -0
- package/dist/components/card/Card/Card.styles.d.ts +1 -0
- package/dist/components/card/Card/Card.styles.js +4 -0
- package/dist/components/card/Card/Card.types.d.ts +6 -0
- package/dist/components/card/Card/index.d.ts +1 -0
- package/dist/components/card/CardAction/CardAction.d.ts +2 -0
- package/dist/components/card/CardAction/CardAction.js +16 -0
- package/dist/components/card/CardAction/CardAction.styles.d.ts +1 -0
- package/dist/components/card/CardAction/CardAction.styles.js +4 -0
- package/dist/components/card/CardAction/CardAction.types.d.ts +2 -0
- package/dist/components/card/CardAction/index.d.ts +1 -0
- package/dist/components/card/CardContent/CardContent.d.ts +2 -0
- package/dist/components/card/CardContent/CardContent.js +16 -0
- package/dist/components/card/CardContent/CardContent.styles.d.ts +1 -0
- package/dist/components/card/CardContent/CardContent.styles.js +4 -0
- package/dist/components/card/CardContent/CardContent.types.d.ts +2 -0
- package/dist/components/card/CardContent/index.d.ts +1 -0
- package/dist/components/card/CardDescription/CardDescription.d.ts +2 -0
- package/dist/components/card/CardDescription/CardDescription.js +16 -0
- package/dist/components/card/CardDescription/CardDescription.styles.d.ts +1 -0
- package/dist/components/card/CardDescription/CardDescription.styles.js +4 -0
- package/dist/components/card/CardDescription/CardDescription.types.d.ts +2 -0
- package/dist/components/card/CardDescription/index.d.ts +1 -0
- package/dist/components/card/CardFooter/CardFooter.d.ts +2 -0
- package/dist/components/card/CardFooter/CardFooter.js +16 -0
- package/dist/components/card/CardFooter/CardFooter.styles.d.ts +1 -0
- package/dist/components/card/CardFooter/CardFooter.styles.js +4 -0
- package/dist/components/card/CardFooter/CardFooter.types.d.ts +2 -0
- package/dist/components/card/CardFooter/index.d.ts +1 -0
- package/dist/components/card/CardHeader/CardHeader.d.ts +2 -0
- package/dist/components/card/CardHeader/CardHeader.js +16 -0
- package/dist/components/card/CardHeader/CardHeader.styles.d.ts +1 -0
- package/dist/components/card/CardHeader/CardHeader.styles.js +4 -0
- package/dist/components/card/CardHeader/CardHeader.types.d.ts +2 -0
- package/dist/components/card/CardHeader/index.d.ts +1 -0
- package/dist/components/card/CardTitle/CardTitle.d.ts +2 -0
- package/dist/components/card/CardTitle/CardTitle.js +16 -0
- package/dist/components/card/CardTitle/CardTitle.styles.d.ts +1 -0
- package/dist/components/card/CardTitle/CardTitle.styles.js +4 -0
- package/dist/components/card/CardTitle/CardTitle.types.d.ts +2 -0
- package/dist/components/card/CardTitle/index.d.ts +1 -0
- package/dist/components/card/index.d.ts +7 -0
- package/dist/components/carousel/Carousel/Carousel.context.d.ts +25 -0
- package/dist/components/carousel/Carousel/Carousel.context.js +10 -0
- package/dist/components/carousel/Carousel/Carousel.d.ts +2 -0
- package/dist/components/carousel/Carousel/Carousel.js +32 -0
- package/dist/components/carousel/Carousel/Carousel.styles.d.ts +0 -0
- package/dist/components/carousel/Carousel/Carousel.types.d.ts +11 -0
- package/dist/components/carousel/Carousel/Carousel.utils.d.ts +0 -0
- package/dist/components/carousel/Carousel/index.d.ts +2 -0
- package/dist/components/carousel/Carousel/useAutoPlay.d.ts +4 -0
- package/dist/components/carousel/Carousel/useAutoPlay.js +14 -0
- package/dist/components/carousel/Carousel/useCarousel.d.ts +17 -0
- package/dist/components/carousel/Carousel/useCarousel.js +29 -0
- package/dist/components/carousel/Carousel/useKeyboardNavigation.d.ts +3 -0
- package/dist/components/carousel/Carousel/useKeyboardNavigation.js +13 -0
- package/dist/components/carousel/CarouselContent/CarouselContent.d.ts +2 -0
- package/dist/components/carousel/CarouselContent/CarouselContent.js +29 -0
- package/dist/components/carousel/CarouselContent/CarouselContent.styles.d.ts +0 -0
- package/dist/components/carousel/CarouselContent/CarouselContent.types.d.ts +2 -0
- package/dist/components/carousel/CarouselContent/index.d.ts +1 -0
- package/dist/components/carousel/CarouselContent/useItemSizeMeasure.d.ts +3 -0
- package/dist/components/carousel/CarouselContent/useItemSizeMeasure.js +17 -0
- package/dist/components/carousel/CarouselDots/CarouselDots.d.ts +2 -0
- package/dist/components/carousel/CarouselDots/CarouselDots.js +22 -0
- package/dist/components/carousel/CarouselDots/CarouselDots.types.d.ts +2 -0
- package/dist/components/carousel/CarouselDots/index.d.ts +1 -0
- package/dist/components/carousel/CarouselItem/CarouselItem.d.ts +2 -0
- package/dist/components/carousel/CarouselItem/CarouselItem.js +25 -0
- package/dist/components/carousel/CarouselItem/CarouselItem.types.d.ts +6 -0
- package/dist/components/carousel/CarouselItem/index.d.ts +1 -0
- package/dist/components/carousel/CarouselNext/CarouselNext.d.ts +2 -0
- package/dist/components/carousel/CarouselNext/CarouselNext.js +29 -0
- package/dist/components/carousel/CarouselNext/CarouselNext.types.d.ts +2 -0
- package/dist/components/carousel/CarouselNext/index.d.ts +1 -0
- package/dist/components/carousel/CarouselPrevious/CarouselPrevious.d.ts +2 -0
- package/dist/components/carousel/CarouselPrevious/CarouselPrevious.js +29 -0
- package/dist/components/carousel/CarouselPrevious/CarouselPrevious.types.d.ts +2 -0
- package/dist/components/carousel/CarouselPrevious/index.d.ts +1 -0
- package/dist/components/carousel/index.d.ts +6 -0
- package/dist/components/field/Field/Field.d.ts +2 -0
- package/dist/components/field/Field/Field.js +25 -0
- package/dist/components/field/Field/Field.styles.d.ts +3 -0
- package/dist/components/field/Field/Field.styles.js +12 -0
- package/dist/components/field/Field/Field.types.d.ts +4 -0
- package/dist/components/field/Field/index.d.ts +1 -0
- package/dist/components/field/FieldContent/FieldContent.d.ts +2 -0
- package/dist/components/field/FieldContent/FieldContent.js +15 -0
- package/dist/components/field/FieldContent/FieldContent.types.d.ts +2 -0
- package/dist/components/field/FieldContent/index.d.ts +1 -0
- package/dist/components/field/FieldDescription/FieldDescription.d.ts +2 -0
- package/dist/components/field/FieldDescription/FieldDescription.js +15 -0
- package/dist/components/field/FieldDescription/FieldDescription.types.d.ts +2 -0
- package/dist/components/field/FieldDescription/index.d.ts +1 -0
- package/dist/components/field/FieldError/FieldError.d.ts +2 -0
- package/dist/components/field/FieldError/FieldError.js +36 -0
- package/dist/components/field/FieldError/FieldError.types.d.ts +6 -0
- package/dist/components/field/FieldError/index.d.ts +1 -0
- package/dist/components/field/FieldError/useFieldError.d.ts +0 -0
- package/dist/components/field/FieldGroup/FieldGroup.d.ts +2 -0
- package/dist/components/field/FieldGroup/FieldGroup.js +15 -0
- package/dist/components/field/FieldGroup/FieldGroup.types.d.ts +2 -0
- package/dist/components/field/FieldGroup/index.d.ts +1 -0
- package/dist/components/field/FieldLabel/FieldLabel.d.ts +2 -0
- package/dist/components/field/FieldLabel/FieldLabel.js +16 -0
- package/dist/components/field/FieldLabel/FieldLabel.types.d.ts +3 -0
- package/dist/components/field/FieldLabel/index.d.ts +1 -0
- package/dist/components/field/FieldLegend/FieldLegend.d.ts +2 -0
- package/dist/components/field/FieldLegend/FieldLegend.js +24 -0
- package/dist/components/field/FieldLegend/FieldLegend.types.d.ts +4 -0
- package/dist/components/field/FieldLegend/index.d.ts +1 -0
- package/dist/components/field/FieldSeparator/FieldSeparator.d.ts +2 -0
- package/dist/components/field/FieldSeparator/FieldSeparator.js +33 -0
- package/dist/components/field/FieldSeparator/FieldSeparator.types.d.ts +2 -0
- package/dist/components/field/FieldSeparator/index.d.ts +1 -0
- package/dist/components/field/FieldSet/FieldSet.d.ts +2 -0
- package/dist/components/field/FieldSet/FieldSet.js +15 -0
- package/dist/components/field/FieldSet/FieldSet.types.d.ts +2 -0
- package/dist/components/field/FieldSet/index.d.ts +1 -0
- package/dist/components/field/FieldTitle/FieldTitle.d.ts +2 -0
- package/dist/components/field/FieldTitle/FieldTitle.js +15 -0
- package/dist/components/field/FieldTitle/FieldTitle.types.d.ts +2 -0
- package/dist/components/field/FieldTitle/index.d.ts +1 -0
- package/dist/components/field/index.d.ts +10 -0
- package/dist/components/image/Image.config.d.ts +16 -0
- package/dist/components/image/Image.config.js +53 -0
- package/dist/components/image/Image.d.ts +13 -0
- package/dist/components/image/Image.js +47 -0
- package/dist/components/image/Image.styles.d.ts +0 -0
- package/dist/components/image/Image.types.d.ts +140 -0
- package/dist/components/image/Image.utils.d.ts +20 -0
- package/dist/components/image/Image.utils.js +238 -0
- package/dist/components/image/ImageElement.d.ts +16 -0
- package/dist/components/image/ImageElement.js +80 -0
- package/dist/components/image/ImagePreload.d.ts +15 -0
- package/dist/components/image/ImagePreload.js +26 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/image/useImage.d.ts +0 -0
- package/dist/components/input/Input.d.ts +3 -0
- package/dist/components/input/Input.js +31 -0
- package/dist/components/input/Input.types.d.ts +15 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input-group/InputGroup/InputGroup.d.ts +2 -0
- package/dist/components/input-group/InputGroup/InputGroup.js +15 -0
- package/dist/components/input-group/InputGroup/InputGroup.styles.d.ts +0 -0
- package/dist/components/input-group/InputGroup/InputGroup.types.d.ts +2 -0
- package/dist/components/input-group/InputGroup/index.d.ts +1 -0
- package/dist/components/input-group/InputGroupAddon/InputGroupAddon.d.ts +2 -0
- package/dist/components/input-group/InputGroupAddon/InputGroupAddon.js +28 -0
- package/dist/components/input-group/InputGroupAddon/InputGroupAddon.styles.d.ts +3 -0
- package/dist/components/input-group/InputGroupAddon/InputGroupAddon.styles.js +13 -0
- package/dist/components/input-group/InputGroupAddon/InputGroupAddon.types.d.ts +4 -0
- package/dist/components/input-group/InputGroupAddon/index.d.ts +1 -0
- package/dist/components/input-group/InputGroupButton/InputGroupButton.d.ts +2 -0
- package/dist/components/input-group/InputGroupButton/InputGroupButton.js +34 -0
- package/dist/components/input-group/InputGroupButton/InputGroupButton.styles.d.ts +4 -0
- package/dist/components/input-group/InputGroupButton/InputGroupButton.styles.js +17 -0
- package/dist/components/input-group/InputGroupButton/InputGroupButton.types.d.ts +5 -0
- package/dist/components/input-group/InputGroupButton/index.d.ts +1 -0
- package/dist/components/input-group/InputGroupInput/InputGroupInput.d.ts +2 -0
- package/dist/components/input-group/InputGroupInput/InputGroupInput.js +16 -0
- package/dist/components/input-group/InputGroupInput/InputGroupInput.styles.d.ts +0 -0
- package/dist/components/input-group/InputGroupInput/InputGroupInput.types.d.ts +2 -0
- package/dist/components/input-group/InputGroupInput/index.d.ts +1 -0
- package/dist/components/input-group/InputGroupText/InputGroupText.d.ts +2 -0
- package/dist/components/input-group/InputGroupText/InputGroupText.js +15 -0
- package/dist/components/input-group/InputGroupText/InputGroupText.styles.d.ts +0 -0
- package/dist/components/input-group/InputGroupText/InputGroupText.types.d.ts +2 -0
- package/dist/components/input-group/InputGroupText/index.d.ts +1 -0
- package/dist/components/input-group/InputGroupTextarea/InputGroupTextarea.d.ts +2 -0
- package/dist/components/input-group/InputGroupTextarea/InputGroupTextarea.js +16 -0
- package/dist/components/input-group/InputGroupTextarea/InputGroupTextarea.types.d.ts +2 -0
- package/dist/components/input-group/InputGroupTextarea/index.d.ts +1 -0
- package/dist/components/input-group/index.d.ts +6 -0
- package/dist/components/item/Item/Item.d.ts +3 -0
- package/dist/components/item/Item/Item.js +32 -0
- package/dist/components/item/Item/Item.styles.d.ts +4 -0
- package/dist/components/item/Item/Item.styles.js +21 -0
- package/dist/components/item/Item/Item.types.d.ts +5 -0
- package/dist/components/item/Item/index.d.ts +1 -0
- package/dist/components/item/ItemActions/ItemActions.d.ts +2 -0
- package/dist/components/item/ItemActions/ItemActions.js +15 -0
- package/dist/components/item/ItemActions/ItemActions.types.d.ts +2 -0
- package/dist/components/item/ItemActions/index.d.ts +1 -0
- package/dist/components/item/ItemContent/ItemContent.d.ts +2 -0
- package/dist/components/item/ItemContent/ItemContent.js +15 -0
- package/dist/components/item/ItemContent/ItemContent.types.d.ts +2 -0
- package/dist/components/item/ItemContent/index.d.ts +1 -0
- package/dist/components/item/ItemDescription/ItemDescription.d.ts +2 -0
- package/dist/components/item/ItemDescription/ItemDescription.js +15 -0
- package/dist/components/item/ItemDescription/ItemDescription.types.d.ts +2 -0
- package/dist/components/item/ItemDescription/index.d.ts +1 -0
- package/dist/components/item/ItemFooter/ItemFooter.d.ts +2 -0
- package/dist/components/item/ItemFooter/ItemFooter.js +15 -0
- package/dist/components/item/ItemFooter/ItemFooter.types.d.ts +2 -0
- package/dist/components/item/ItemFooter/index.d.ts +1 -0
- package/dist/components/item/ItemGroup/ItemGroup.d.ts +2 -0
- package/dist/components/item/ItemGroup/ItemGroup.js +15 -0
- package/dist/components/item/ItemGroup/ItemGroup.types.d.ts +2 -0
- package/dist/components/item/ItemGroup/index.d.ts +1 -0
- package/dist/components/item/ItemHeader/ItemHeader.d.ts +2 -0
- package/dist/components/item/ItemHeader/ItemHeader.js +15 -0
- package/dist/components/item/ItemHeader/ItemHeader.types.d.ts +2 -0
- package/dist/components/item/ItemHeader/index.d.ts +1 -0
- package/dist/components/item/ItemMedia/ItemMedia.d.ts +2 -0
- package/dist/components/item/ItemMedia/ItemMedia.js +25 -0
- package/dist/components/item/ItemMedia/ItemMedia.styles.d.ts +3 -0
- package/dist/components/item/ItemMedia/ItemMedia.styles.js +12 -0
- package/dist/components/item/ItemMedia/ItemMedia.types.d.ts +4 -0
- package/dist/components/item/ItemMedia/index.d.ts +1 -0
- package/dist/components/item/ItemSeparator/ItemSeparator.d.ts +2 -0
- package/dist/components/item/ItemSeparator/ItemSeparator.js +17 -0
- package/dist/components/item/ItemSeparator/ItemSeparator.types.d.ts +2 -0
- package/dist/components/item/ItemSeparator/index.d.ts +1 -0
- package/dist/components/item/ItemTitle/ItemTitle.d.ts +2 -0
- package/dist/components/item/ItemTitle/ItemTitle.js +15 -0
- package/dist/components/item/ItemTitle/ItemTitle.types.d.ts +2 -0
- package/dist/components/item/ItemTitle/index.d.ts +1 -0
- package/dist/components/item/index.d.ts +10 -0
- package/dist/components/kbd/Kbd.d.ts +3 -0
- package/dist/components/kbd/Kbd.js +23 -0
- package/dist/components/kbd/Kbd.types.d.ts +3 -0
- package/dist/components/kbd/index.d.ts +1 -0
- package/dist/components/label/Label.d.ts +2 -0
- package/dist/components/label/Label.js +15 -0
- package/dist/components/label/Label.types.d.ts +2 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/pagination/Pagination/Pagination.d.ts +2 -0
- package/dist/components/pagination/Pagination/Pagination.js +15 -0
- package/dist/components/pagination/Pagination/Pagination.types.d.ts +2 -0
- package/dist/components/pagination/Pagination/index.d.ts +1 -0
- package/dist/components/pagination/PaginationContent/PaginationContent.d.ts +2 -0
- package/dist/components/pagination/PaginationContent/PaginationContent.js +15 -0
- package/dist/components/pagination/PaginationContent/PaginationContent.types.d.ts +2 -0
- package/dist/components/pagination/PaginationContent/index.d.ts +1 -0
- package/dist/components/pagination/PaginationEllipsis/PaginationEllipsis.d.ts +2 -0
- package/dist/components/pagination/PaginationEllipsis/PaginationEllipsis.js +16 -0
- package/dist/components/pagination/PaginationEllipsis/PaginationEllipsis.types.d.ts +2 -0
- package/dist/components/pagination/PaginationEllipsis/index.d.ts +1 -0
- package/dist/components/pagination/PaginationItem/PaginationItem.d.ts +2 -0
- package/dist/components/pagination/PaginationItem/PaginationItem.js +8 -0
- package/dist/components/pagination/PaginationItem/PaginationItem.types.d.ts +2 -0
- package/dist/components/pagination/PaginationItem/index.d.ts +1 -0
- package/dist/components/pagination/PaginationLink/PaginationLink.d.ts +2 -0
- package/dist/components/pagination/PaginationLink/PaginationLink.js +41 -0
- package/dist/components/pagination/PaginationLink/PaginationLink.types.d.ts +11 -0
- package/dist/components/pagination/PaginationLink/index.d.ts +1 -0
- package/dist/components/pagination/PaginationNext/PaginationNext.d.ts +2 -0
- package/dist/components/pagination/PaginationNext/PaginationNext.js +30 -0
- package/dist/components/pagination/PaginationNext/PaginationNext.types.d.ts +4 -0
- package/dist/components/pagination/PaginationNext/index.d.ts +1 -0
- package/dist/components/pagination/PaginationPrevious/PaginationPrevious.d.ts +2 -0
- package/dist/components/pagination/PaginationPrevious/PaginationPrevious.js +30 -0
- package/dist/components/pagination/PaginationPrevious/PaginationPrevious.types.d.ts +4 -0
- package/dist/components/pagination/PaginationPrevious/index.d.ts +1 -0
- package/dist/components/pagination/index.d.ts +7 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.context.d.ts +13 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.context.js +9 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.d.ts +2 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.js +65 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.types.d.ts +13 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.utils.d.ts +2 -0
- package/dist/components/scroll-area/ScrollArea/ScrollArea.utils.js +17 -0
- package/dist/components/scroll-area/ScrollArea/index.d.ts +2 -0
- package/dist/components/scroll-area/ScrollBar/ScrollBar.d.ts +2 -0
- package/dist/components/scroll-area/ScrollBar/ScrollBar.js +96 -0
- package/dist/components/scroll-area/ScrollBar/ScrollBar.types.d.ts +4 -0
- package/dist/components/scroll-area/ScrollBar/index.d.ts +1 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/separator/Separator.d.ts +2 -0
- package/dist/components/separator/Separator.js +31 -0
- package/dist/components/separator/Separator.styles.d.ts +1 -0
- package/dist/components/separator/Separator.styles.js +5 -0
- package/dist/components/separator/Separator.types.d.ts +8 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/sidebar/Sidebar/Sidebar.d.ts +2 -0
- package/dist/components/sidebar/Sidebar/Sidebar.js +60 -0
- package/dist/components/sidebar/Sidebar/Sidebar.types.d.ts +6 -0
- package/dist/components/sidebar/Sidebar/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarContent/SidebarContent.d.ts +2 -0
- package/dist/components/sidebar/SidebarContent/SidebarContent.js +15 -0
- package/dist/components/sidebar/SidebarContent/SidebarContent.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarContent/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarFooter/SidebarFooter.d.ts +2 -0
- package/dist/components/sidebar/SidebarFooter/SidebarFooter.js +15 -0
- package/dist/components/sidebar/SidebarFooter/SidebarFooter.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarFooter/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarGroup/SidebarGroup.d.ts +2 -0
- package/dist/components/sidebar/SidebarGroup/SidebarGroup.js +15 -0
- package/dist/components/sidebar/SidebarGroup/SidebarGroup.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarGroup/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarGroupAction/SidebarGroupAction.d.ts +3 -0
- package/dist/components/sidebar/SidebarGroupAction/SidebarGroupAction.js +23 -0
- package/dist/components/sidebar/SidebarGroupAction/SidebarGroupAction.types.d.ts +3 -0
- package/dist/components/sidebar/SidebarGroupAction/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarGroupContent/SidebarGroupContent.d.ts +2 -0
- package/dist/components/sidebar/SidebarGroupContent/SidebarGroupContent.js +15 -0
- package/dist/components/sidebar/SidebarGroupContent/SidebarGroupContent.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarGroupContent/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarGroupLabel/SidebarGroupLabel.d.ts +3 -0
- package/dist/components/sidebar/SidebarGroupLabel/SidebarGroupLabel.js +23 -0
- package/dist/components/sidebar/SidebarGroupLabel/SidebarGroupLabel.types.d.ts +3 -0
- package/dist/components/sidebar/SidebarGroupLabel/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarHeader/SidebarHeader.d.ts +2 -0
- package/dist/components/sidebar/SidebarHeader/SidebarHeader.js +15 -0
- package/dist/components/sidebar/SidebarHeader/SidebarHeader.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarHeader/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarInput/SidebarInput.d.ts +2 -0
- package/dist/components/sidebar/SidebarInput/SidebarInput.js +17 -0
- package/dist/components/sidebar/SidebarInput/SidebarInput.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarInput/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarInset/SidebarInset.d.ts +2 -0
- package/dist/components/sidebar/SidebarInset/SidebarInset.js +15 -0
- package/dist/components/sidebar/SidebarInset/SidebarInset.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarInset/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenu/SidebarMenu.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenu/SidebarMenu.js +15 -0
- package/dist/components/sidebar/SidebarMenu/SidebarMenu.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenu/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuBadge/SidebarMenuBadge.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuBadge/SidebarMenuBadge.js +15 -0
- package/dist/components/sidebar/SidebarMenuBadge/SidebarMenuBadge.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuBadge/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuButton/SidebarMenuButton.d.ts +3 -0
- package/dist/components/sidebar/SidebarMenuButton/SidebarMenuButton.js +66 -0
- package/dist/components/sidebar/SidebarMenuButton/SidebarMenuButton.styles.d.ts +4 -0
- package/dist/components/sidebar/SidebarMenuButton/SidebarMenuButton.styles.js +21 -0
- package/dist/components/sidebar/SidebarMenuButton/SidebarMenuButton.types.d.ts +9 -0
- package/dist/components/sidebar/SidebarMenuButton/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuItem/SidebarMenuItem.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuItem/SidebarMenuItem.js +15 -0
- package/dist/components/sidebar/SidebarMenuItem/SidebarMenuItem.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuItem/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuSkeleton/SidebarMenuSkeleton.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuSkeleton/SidebarMenuSkeleton.js +36 -0
- package/dist/components/sidebar/SidebarMenuSkeleton/SidebarMenuSkeleton.types.d.ts +4 -0
- package/dist/components/sidebar/SidebarMenuSkeleton/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuSub/SidebarMenuSub.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuSub/SidebarMenuSub.js +15 -0
- package/dist/components/sidebar/SidebarMenuSub/SidebarMenuSub.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuSub/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuSubButton/SidebarMenuSubButton.d.ts +3 -0
- package/dist/components/sidebar/SidebarMenuSubButton/SidebarMenuSubButton.js +35 -0
- package/dist/components/sidebar/SidebarMenuSubButton/SidebarMenuSubButton.types.d.ts +6 -0
- package/dist/components/sidebar/SidebarMenuSubButton/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarMenuSubItem/SidebarMenuSubItem.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuSubItem/SidebarMenuSubItem.js +15 -0
- package/dist/components/sidebar/SidebarMenuSubItem/SidebarMenuSubItem.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarMenuSubItem/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.consts.d.ts +6 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.consts.js +4 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.context.d.ts +13 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.context.js +10 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.d.ts +2 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.js +55 -0
- package/dist/components/sidebar/SidebarProvider/SidebarProvider.types.d.ts +8 -0
- package/dist/components/sidebar/SidebarProvider/index.d.ts +2 -0
- package/dist/components/sidebar/SidebarRail/SidebarRail.d.ts +2 -0
- package/dist/components/sidebar/SidebarRail/SidebarRail.js +17 -0
- package/dist/components/sidebar/SidebarRail/SidebarRail.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarRail/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarSeparator/SidebarSeparator.d.ts +2 -0
- package/dist/components/sidebar/SidebarSeparator/SidebarSeparator.js +17 -0
- package/dist/components/sidebar/SidebarSeparator/SidebarSeparator.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarSeparator/index.d.ts +1 -0
- package/dist/components/sidebar/SidebarTrigger/SidebarTrigger.d.ts +2 -0
- package/dist/components/sidebar/SidebarTrigger/SidebarTrigger.js +30 -0
- package/dist/components/sidebar/SidebarTrigger/SidebarTrigger.types.d.ts +2 -0
- package/dist/components/sidebar/SidebarTrigger/index.d.ts +1 -0
- package/dist/components/sidebar/index.d.ts +22 -0
- package/dist/components/skeleton/Skeleton.d.ts +2 -0
- package/dist/components/skeleton/Skeleton.js +15 -0
- package/dist/components/skeleton/Skeleton.types.d.ts +2 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/spinner/Spinner.d.ts +2 -0
- package/dist/components/spinner/Spinner.js +18 -0
- package/dist/components/spinner/Spinner.styles.d.ts +1 -0
- package/dist/components/spinner/Spinner.styles.js +5 -0
- package/dist/components/spinner/Spinner.types.d.ts +5 -0
- package/dist/components/spinner/index.d.ts +1 -0
- package/dist/components/switch/Switch.d.ts +2 -0
- package/dist/components/switch/Switch.js +62 -0
- package/dist/components/switch/Switch.styles.d.ts +5 -0
- package/dist/components/switch/Switch.styles.js +9 -0
- package/dist/components/switch/Switch.types.d.ts +7 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/textarea/Textarea.d.ts +2 -0
- package/dist/components/textarea/Textarea.js +15 -0
- package/dist/components/textarea/Textarea.types.d.ts +2 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/toast/components/Assets.d.ts +9 -0
- package/dist/components/toast/components/Assets.js +30 -0
- package/dist/components/toast/components/Toast.d.ts +3 -0
- package/dist/components/toast/components/Toast.js +150 -0
- package/dist/components/toast/components/ToastActions.d.ts +12 -0
- package/dist/components/toast/components/ToastActions.js +60 -0
- package/dist/components/toast/components/ToastContent.d.ts +9 -0
- package/dist/components/toast/components/ToastContent.js +34 -0
- package/dist/components/toast/components/ToastIcon.d.ts +9 -0
- package/dist/components/toast/components/ToastIcon.js +57 -0
- package/dist/components/toast/components/Toaster.d.ts +3 -0
- package/dist/components/toast/components/Toaster.js +161 -0
- package/dist/components/toast/constants.d.ts +16 -0
- package/dist/components/toast/constants.js +4 -0
- package/dist/components/toast/hooks/useSwipe.d.ts +23 -0
- package/dist/components/toast/hooks/useSwipe.js +57 -0
- package/dist/components/toast/hooks/useTheme.d.ts +2 -0
- package/dist/components/toast/hooks/useTheme.js +20 -0
- package/dist/components/toast/hooks/useToastHeight.d.ts +11 -0
- package/dist/components/toast/hooks/useToastHeight.js +33 -0
- package/dist/components/toast/hooks/useToastSubscription.d.ts +5 -0
- package/dist/components/toast/hooks/useToastSubscription.js +35 -0
- package/dist/components/toast/hooks/useToastTimer.d.ts +11 -0
- package/dist/components/toast/hooks/useToastTimer.js +20 -0
- package/dist/components/toast/hooks/useToasterKeyboard.d.ts +7 -0
- package/dist/components/toast/hooks/useToasterKeyboard.js +12 -0
- package/dist/components/toast/hooks.d.ts +13 -0
- package/dist/components/toast/hooks.js +34 -0
- package/dist/components/toast/index.d.ts +10 -0
- package/dist/components/toast/state.d.ts +52 -0
- package/dist/components/toast/state.js +168 -0
- package/dist/components/toast/types.d.ts +168 -0
- package/dist/components/toast/types.js +4 -0
- package/dist/components/toast/utils.d.ts +10 -0
- package/dist/components/toast/utils.js +37 -0
- package/dist/components/tooltip/Tooltip/Tooltip.context.d.ts +12 -0
- package/dist/components/tooltip/Tooltip/Tooltip.context.js +10 -0
- package/dist/components/tooltip/Tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip/Tooltip.js +25 -0
- package/dist/components/tooltip/Tooltip/Tooltip.types.d.ts +0 -0
- package/dist/components/tooltip/Tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/TooltipArrow/TooltipArrow.d.ts +1 -0
- package/dist/components/tooltip/TooltipArrow/TooltipArrow.js +19 -0
- package/dist/components/tooltip/TooltipArrow/index.d.ts +1 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.context.d.ts +6 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.context.js +10 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.d.ts +2 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.js +66 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.types.d.ts +9 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.utils.d.ts +6 -0
- package/dist/components/tooltip/TooltipContent/TooltipContent.utils.js +62 -0
- package/dist/components/tooltip/TooltipContent/index.d.ts +1 -0
- package/dist/components/tooltip/TooltipContent/useTooltipContent.d.ts +10 -0
- package/dist/components/tooltip/TooltipContent/useTooltipContent.js +51 -0
- package/dist/components/tooltip/TooltipTrigger/TooltipTrigger.d.ts +2 -0
- package/dist/components/tooltip/TooltipTrigger/TooltipTrigger.js +9 -0
- package/dist/components/tooltip/TooltipTrigger/TooltipTrigger.types.d.ts +0 -0
- package/dist/components/tooltip/TooltipTrigger/index.d.ts +1 -0
- package/dist/components/tooltip/TooltipTrigger/useTooltipTrigger.d.ts +2 -0
- package/dist/components/tooltip/TooltipTrigger/useTooltipTrigger.js +20 -0
- package/dist/components/tooltip/index.d.ts +4 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +104 -0
- package/dist/lib/utils/clsx.d.ts +1 -0
- package/dist/lib/utils/clsx.js +5 -0
- package/dist/lib/utils/get-style.d.ts +14 -0
- package/dist/lib/utils/index.d.ts +2 -0
- package/dist/lib/utils/warn-once.d.ts +2 -0
- package/dist/styles/animate.css +250 -0
- package/dist/styles/index.css +100 -0
- package/dist/styles/toast.css +745 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/props.types.d.ts +20 -0
- package/package.json +39 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createEffect as e, createSignal as t, onCleanup as n } from "solid-js";
|
|
2
|
+
//#region src/components/toast/hooks/useToastHeight.ts
|
|
3
|
+
function r(r) {
|
|
4
|
+
let [i, a] = t(0), o = r.toast();
|
|
5
|
+
return e(() => {
|
|
6
|
+
let e = r.toastRef();
|
|
7
|
+
if (!e) return;
|
|
8
|
+
let t = e.getBoundingClientRect().height;
|
|
9
|
+
a(t), r.setHeights((e) => [{
|
|
10
|
+
toastId: o.id,
|
|
11
|
+
height: t,
|
|
12
|
+
position: o.position
|
|
13
|
+
}, ...e]), n(() => r.setHeights((e) => e.filter((e) => e.toastId !== o.id)));
|
|
14
|
+
}), e(() => {
|
|
15
|
+
if (!r.mounted()) return;
|
|
16
|
+
let e = r.toastRef();
|
|
17
|
+
if (!e) return;
|
|
18
|
+
o.title, o.description, o.jsx, o.action, o.cancel;
|
|
19
|
+
let t = e.style.height;
|
|
20
|
+
e.style.height = "auto";
|
|
21
|
+
let n = e.getBoundingClientRect().height;
|
|
22
|
+
e.style.height = t, a(n), r.setHeights((e) => e.find((e) => e.toastId === o.id) ? e.map((e) => e.toastId === o.id ? {
|
|
23
|
+
...e,
|
|
24
|
+
height: n
|
|
25
|
+
} : e) : [{
|
|
26
|
+
toastId: o.id,
|
|
27
|
+
height: n,
|
|
28
|
+
position: o.position
|
|
29
|
+
}, ...e]);
|
|
30
|
+
}), { initialHeight: i };
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { r as useToastHeight };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ToastState as e } from "../state.js";
|
|
2
|
+
import { createSignal as t, onCleanup as n, onMount as r } from "solid-js";
|
|
3
|
+
//#region src/components/toast/hooks/useToastSubscription.ts
|
|
4
|
+
function i() {
|
|
5
|
+
let [i, a] = t([]);
|
|
6
|
+
return r(() => {
|
|
7
|
+
n(e.subscribe((e) => {
|
|
8
|
+
if (e.dismiss) {
|
|
9
|
+
a((t) => t.map((t) => t.id === e.id ? {
|
|
10
|
+
...t,
|
|
11
|
+
delete: !0
|
|
12
|
+
} : t));
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
a((t) => {
|
|
16
|
+
let n = t.findIndex((t) => t.id === e.id);
|
|
17
|
+
return n === -1 ? [e, ...t] : [
|
|
18
|
+
...t.slice(0, n),
|
|
19
|
+
{
|
|
20
|
+
...t[n],
|
|
21
|
+
...e
|
|
22
|
+
},
|
|
23
|
+
...t.slice(n + 1)
|
|
24
|
+
];
|
|
25
|
+
});
|
|
26
|
+
}));
|
|
27
|
+
}), {
|
|
28
|
+
toasts: i,
|
|
29
|
+
removeToast: (t) => {
|
|
30
|
+
t.delete || e.dismiss(t.id), a((e) => e.filter((e) => e.id !== t.id));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { i as useToastSubscription };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ToastT } from '../types';
|
|
2
|
+
interface UseToastTimerOptions {
|
|
3
|
+
toast: ToastT;
|
|
4
|
+
duration: number;
|
|
5
|
+
expanded: () => boolean;
|
|
6
|
+
interacting: () => boolean;
|
|
7
|
+
isDocumentHidden: () => boolean;
|
|
8
|
+
deleteToast: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useToastTimer(opts: UseToastTimerOptions): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createEffect as e, onCleanup as t } from "solid-js";
|
|
2
|
+
//#region src/components/toast/hooks/useToastTimer.ts
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r = n.toast.duration ?? n.duration, i = 0, a = 0, o, s = () => n.toast.promise && n.toast.type === "loading" || n.toast.duration === Infinity || n.toast.type === "loading", c = () => {
|
|
5
|
+
if (a < i) {
|
|
6
|
+
let e = Date.now() - i;
|
|
7
|
+
r = Math.max(0, r - e);
|
|
8
|
+
}
|
|
9
|
+
a = Date.now();
|
|
10
|
+
}, l = () => {
|
|
11
|
+
r !== Infinity && (clearTimeout(o), i = Date.now(), o = setTimeout(() => {
|
|
12
|
+
n.toast.onAutoClose?.(n.toast), n.deleteToast();
|
|
13
|
+
}, r));
|
|
14
|
+
};
|
|
15
|
+
e(() => {
|
|
16
|
+
s() || (n.expanded() || n.interacting() || n.isDocumentHidden() ? c() : l(), t(() => clearTimeout(o)));
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as useToastTimer };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { onCleanup as e, onMount as t } from "solid-js";
|
|
2
|
+
//#region src/components/toast/hooks/useToasterKeyboard.ts
|
|
3
|
+
function n(n) {
|
|
4
|
+
t(() => {
|
|
5
|
+
let t = (e) => {
|
|
6
|
+
n.hotkey.length > 0 && n.hotkey.every((t) => e[t] || e.code === t) && (n.setExpanded(!0), n.listRef()?.focus()), e.code === "Escape" && (document.activeElement === n.listRef() || n.listRef()?.contains(document.activeElement)) && n.setExpanded(!1);
|
|
7
|
+
};
|
|
8
|
+
document.addEventListener("keydown", t), e(() => document.removeEventListener("keydown", t));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useToasterKeyboard };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToastT } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a reactive boolean that tracks whether the browser tab is hidden.
|
|
4
|
+
* Used to pause auto-dismiss timers while the user has switched tabs.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useIsDocumentHidden(): import('solid-js').Accessor<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Subscribes to the global ToastState and returns the list of currently visible
|
|
9
|
+
* toasts as a SolidJS signal. Useful for building custom toast UIs.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSonner(): {
|
|
12
|
+
toasts: import('solid-js').Accessor<ToastT[]>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ToastState as e } from "./state.js";
|
|
2
|
+
import { createSignal as t, onCleanup as n, onMount as r } from "solid-js";
|
|
3
|
+
//#region src/components/toast/hooks.ts
|
|
4
|
+
function i() {
|
|
5
|
+
let [e, i] = t(document.hidden);
|
|
6
|
+
return r(() => {
|
|
7
|
+
let e = () => i(document.hidden);
|
|
8
|
+
document.addEventListener("visibilitychange", e), n(() => document.removeEventListener("visibilitychange", e));
|
|
9
|
+
}), e;
|
|
10
|
+
}
|
|
11
|
+
function a() {
|
|
12
|
+
let [i, a] = t([]);
|
|
13
|
+
return r(() => {
|
|
14
|
+
n(e.subscribe((e) => {
|
|
15
|
+
if (e.dismiss) {
|
|
16
|
+
a((t) => t.filter((t) => t.id !== e.id));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
a((t) => {
|
|
20
|
+
let n = t.findIndex((t) => t.id === e.id);
|
|
21
|
+
return n === -1 ? [e, ...t] : [
|
|
22
|
+
...t.slice(0, n),
|
|
23
|
+
{
|
|
24
|
+
...t[n],
|
|
25
|
+
...e
|
|
26
|
+
},
|
|
27
|
+
...t.slice(n + 1)
|
|
28
|
+
];
|
|
29
|
+
});
|
|
30
|
+
}));
|
|
31
|
+
}), { toasts: i };
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { i as useIsDocumentHidden, a as useSonner };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* index.ts
|
|
3
|
+
* Public API surface — only re-exports what consumers need.
|
|
4
|
+
* Internal modules (hooks, utils, constants) are intentionally not re-exported.
|
|
5
|
+
*/
|
|
6
|
+
export { toast } from './state';
|
|
7
|
+
export { Toaster } from './components/Toaster';
|
|
8
|
+
export { Toast } from './components/Toast';
|
|
9
|
+
export { useSonner } from './hooks';
|
|
10
|
+
export type { Action, ExternalToast, ToasterProps, ToastClassnames, ToastT, ToastToDismiss, } from './types';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { JSXElement } from 'solid-js';
|
|
2
|
+
import { ExternalToast, PromiseData, PromiseT, ToastT, ToastToDismiss, ToastTypes } from './types';
|
|
3
|
+
declare class Observer {
|
|
4
|
+
subscribers: Array<(toast: ToastT | ToastToDismiss) => void>;
|
|
5
|
+
toasts: Array<ToastT | ToastToDismiss>;
|
|
6
|
+
dismissedToasts: Set<string>;
|
|
7
|
+
subscribe: (subscriber: (toast: ToastT | ToastToDismiss) => void) => () => void;
|
|
8
|
+
publish: (data: ToastT) => void;
|
|
9
|
+
addToast: (data: ToastT) => void;
|
|
10
|
+
create: (data: ExternalToast & {
|
|
11
|
+
message?: JSXElement;
|
|
12
|
+
type?: ToastTypes;
|
|
13
|
+
promise?: PromiseT;
|
|
14
|
+
jsx?: (() => JSXElement) | JSXElement;
|
|
15
|
+
}) => string;
|
|
16
|
+
dismiss: (id?: string) => string | undefined;
|
|
17
|
+
message: (message: JSXElement, data?: ExternalToast) => string;
|
|
18
|
+
error: (message: JSXElement, data?: ExternalToast) => string;
|
|
19
|
+
success: (message: JSXElement, data?: ExternalToast) => string;
|
|
20
|
+
info: (message: JSXElement, data?: ExternalToast) => string;
|
|
21
|
+
warning: (message: JSXElement, data?: ExternalToast) => string;
|
|
22
|
+
loading: (message: JSXElement, data?: ExternalToast) => string;
|
|
23
|
+
promise: <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData>) => (string & {
|
|
24
|
+
unwrap: () => Promise<ToastData>;
|
|
25
|
+
}) | {
|
|
26
|
+
unwrap: () => Promise<ToastData>;
|
|
27
|
+
} | undefined;
|
|
28
|
+
custom: (jsx: (id: number | string) => any, data?: ExternalToast) => string;
|
|
29
|
+
getActiveToasts: () => (ToastT | ToastToDismiss)[];
|
|
30
|
+
}
|
|
31
|
+
export declare const ToastState: Observer;
|
|
32
|
+
export declare const getHistory: () => (ToastT | ToastToDismiss)[];
|
|
33
|
+
export declare const getToasts: () => (ToastT | ToastToDismiss)[];
|
|
34
|
+
export declare const toast: ((message: JSXElement, data?: ExternalToast) => string) & {
|
|
35
|
+
success: (message: JSXElement, data?: ExternalToast) => string;
|
|
36
|
+
info: (message: JSXElement, data?: ExternalToast) => string;
|
|
37
|
+
warning: (message: JSXElement, data?: ExternalToast) => string;
|
|
38
|
+
error: (message: JSXElement, data?: ExternalToast) => string;
|
|
39
|
+
custom: (jsx: (id: number | string) => any, data?: ExternalToast) => string;
|
|
40
|
+
message: (message: JSXElement, data?: ExternalToast) => string;
|
|
41
|
+
promise: <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData> | undefined) => (string & {
|
|
42
|
+
unwrap: () => Promise<ToastData>;
|
|
43
|
+
}) | {
|
|
44
|
+
unwrap: () => Promise<ToastData>;
|
|
45
|
+
} | undefined;
|
|
46
|
+
dismiss: (id?: string) => string | undefined;
|
|
47
|
+
loading: (message: JSXElement, data?: ExternalToast) => string;
|
|
48
|
+
} & {
|
|
49
|
+
getHistory: () => (ToastT | ToastToDismiss)[];
|
|
50
|
+
getToasts: () => (ToastT | ToastToDismiss)[];
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { createUniqueId as e } from "solid-js";
|
|
2
|
+
//#region src/components/toast/state.ts
|
|
3
|
+
var t = (e) => !("id" in e && "message" in e), n = new class {
|
|
4
|
+
subscribers = [];
|
|
5
|
+
toasts = [];
|
|
6
|
+
dismissedToasts = /* @__PURE__ */ new Set();
|
|
7
|
+
subscribe = (e) => (this.subscribers.push(e), () => {
|
|
8
|
+
let t = this.subscribers.indexOf(e);
|
|
9
|
+
this.subscribers.splice(t, 1);
|
|
10
|
+
});
|
|
11
|
+
publish = (e) => {
|
|
12
|
+
for (let t of this.subscribers) t(e);
|
|
13
|
+
};
|
|
14
|
+
addToast = (e) => {
|
|
15
|
+
this.publish(e), this.toasts = [...this.toasts, e];
|
|
16
|
+
};
|
|
17
|
+
create = (t) => {
|
|
18
|
+
let { message: n, ...r } = t, i = typeof t?.id == "number" || t.id?.length > 0 ? t.id : e(), a = this.toasts.find((e) => e.id === i), o = t.dismissible === void 0 ? !0 : t.dismissible;
|
|
19
|
+
return this.dismissedToasts.has(i) && this.dismissedToasts.delete(i), a ? this.toasts = this.toasts.map((e) => e.id === i ? (this.publish({
|
|
20
|
+
...e,
|
|
21
|
+
...t,
|
|
22
|
+
id: i,
|
|
23
|
+
title: n
|
|
24
|
+
}), {
|
|
25
|
+
...e,
|
|
26
|
+
...t,
|
|
27
|
+
id: i,
|
|
28
|
+
dismissible: o,
|
|
29
|
+
title: n
|
|
30
|
+
}) : e) : this.addToast({
|
|
31
|
+
title: n,
|
|
32
|
+
...r,
|
|
33
|
+
dismissible: o,
|
|
34
|
+
id: i
|
|
35
|
+
}), i;
|
|
36
|
+
};
|
|
37
|
+
dismiss = (e) => (e === void 0 ? requestAnimationFrame(() => {
|
|
38
|
+
for (let e of this.toasts) for (let t of this.subscribers) t({
|
|
39
|
+
id: e.id,
|
|
40
|
+
dismiss: !0
|
|
41
|
+
});
|
|
42
|
+
}) : (this.dismissedToasts.add(e), requestAnimationFrame(() => {
|
|
43
|
+
for (let t of this.subscribers) t({
|
|
44
|
+
id: e,
|
|
45
|
+
dismiss: !0
|
|
46
|
+
});
|
|
47
|
+
})), e);
|
|
48
|
+
message = (e, t) => this.create({
|
|
49
|
+
...t,
|
|
50
|
+
message: e
|
|
51
|
+
});
|
|
52
|
+
error = (e, t) => this.create({
|
|
53
|
+
...t,
|
|
54
|
+
message: e,
|
|
55
|
+
type: "error"
|
|
56
|
+
});
|
|
57
|
+
success = (e, t) => this.create({
|
|
58
|
+
...t,
|
|
59
|
+
type: "success",
|
|
60
|
+
message: e
|
|
61
|
+
});
|
|
62
|
+
info = (e, t) => this.create({
|
|
63
|
+
...t,
|
|
64
|
+
type: "info",
|
|
65
|
+
message: e
|
|
66
|
+
});
|
|
67
|
+
warning = (e, t) => this.create({
|
|
68
|
+
...t,
|
|
69
|
+
type: "warning",
|
|
70
|
+
message: e
|
|
71
|
+
});
|
|
72
|
+
loading = (e, t) => this.create({
|
|
73
|
+
...t,
|
|
74
|
+
type: "loading",
|
|
75
|
+
message: e
|
|
76
|
+
});
|
|
77
|
+
promise = (e, n) => {
|
|
78
|
+
if (!n) return;
|
|
79
|
+
let r;
|
|
80
|
+
n.loading !== void 0 && (r = this.create({
|
|
81
|
+
...n,
|
|
82
|
+
promise: e,
|
|
83
|
+
type: "loading",
|
|
84
|
+
message: n.loading,
|
|
85
|
+
description: typeof n.description == "function" ? void 0 : n.description
|
|
86
|
+
}));
|
|
87
|
+
let a = Promise.resolve(e instanceof Function ? e() : e), o = r !== void 0, s, c = a.then(async (e) => {
|
|
88
|
+
if (s = ["resolve", e], t(e)) o = !1, this.create({
|
|
89
|
+
id: r,
|
|
90
|
+
type: "default",
|
|
91
|
+
message: e
|
|
92
|
+
});
|
|
93
|
+
else if (i(e) && !e.ok) {
|
|
94
|
+
o = !1;
|
|
95
|
+
let i = `HTTP error! status: ${e.status}`, a = typeof n.error == "function" ? await n.error(i) : n.error, s = typeof n.description == "function" ? await n.description(i) : n.description, c = typeof a == "object" && !t(a) ? a : { message: a };
|
|
96
|
+
this.create({
|
|
97
|
+
id: r,
|
|
98
|
+
type: "error",
|
|
99
|
+
description: s,
|
|
100
|
+
...c
|
|
101
|
+
});
|
|
102
|
+
} else if (e instanceof Error) {
|
|
103
|
+
o = !1;
|
|
104
|
+
let i = typeof n.error == "function" ? await n.error(e) : n.error, a = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t(i) ? i : { message: i };
|
|
105
|
+
this.create({
|
|
106
|
+
id: r,
|
|
107
|
+
type: "error",
|
|
108
|
+
description: a,
|
|
109
|
+
...s
|
|
110
|
+
});
|
|
111
|
+
} else if (n.success !== void 0) {
|
|
112
|
+
o = !1;
|
|
113
|
+
let i = typeof n.success == "function" ? await n.success(e) : n.success, a = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t(i) ? i : { message: i };
|
|
114
|
+
this.create({
|
|
115
|
+
id: r,
|
|
116
|
+
type: "success",
|
|
117
|
+
description: a,
|
|
118
|
+
...s
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}).catch(async (e) => {
|
|
122
|
+
if (s = ["reject", e], n.error !== void 0) {
|
|
123
|
+
o = !1;
|
|
124
|
+
let i = typeof n.error == "function" ? await n.error(e) : n.error, a = typeof n.description == "function" ? await n.description(e) : n.description, s = typeof i == "object" && !t(i) ? i : { message: i };
|
|
125
|
+
this.create({
|
|
126
|
+
id: r,
|
|
127
|
+
type: "error",
|
|
128
|
+
description: a,
|
|
129
|
+
...s
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}).finally(() => {
|
|
133
|
+
o && (this.dismiss(r), r = void 0), n.finally?.();
|
|
134
|
+
}), l = () => new Promise((e, t) => c.then(() => s[0] === "reject" ? t(s[1]) : e(s[1])).catch(t));
|
|
135
|
+
return typeof r != "string" && typeof r != "number" ? { unwrap: l } : Object.assign(r, { unwrap: l });
|
|
136
|
+
};
|
|
137
|
+
custom = (t, n) => {
|
|
138
|
+
let r = n?.id || e();
|
|
139
|
+
return this.create({
|
|
140
|
+
jsx: t(r),
|
|
141
|
+
...n,
|
|
142
|
+
id: r
|
|
143
|
+
}), r;
|
|
144
|
+
};
|
|
145
|
+
getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id));
|
|
146
|
+
}(), r = (t, r) => {
|
|
147
|
+
let i = e();
|
|
148
|
+
return n.addToast({
|
|
149
|
+
title: t,
|
|
150
|
+
...r,
|
|
151
|
+
id: i
|
|
152
|
+
}), i;
|
|
153
|
+
}, i = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", a = Object.assign(r, {
|
|
154
|
+
success: n.success,
|
|
155
|
+
info: n.info,
|
|
156
|
+
warning: n.warning,
|
|
157
|
+
error: n.error,
|
|
158
|
+
custom: n.custom,
|
|
159
|
+
message: n.message,
|
|
160
|
+
promise: n.promise,
|
|
161
|
+
dismiss: n.dismiss,
|
|
162
|
+
loading: n.loading
|
|
163
|
+
}, {
|
|
164
|
+
getHistory: () => n.toasts,
|
|
165
|
+
getToasts: () => n.getActiveToasts()
|
|
166
|
+
});
|
|
167
|
+
//#endregion
|
|
168
|
+
export { n as ToastState, a as toast };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { JSX, JSXElement, Setter } from 'solid-js';
|
|
2
|
+
export type ToastTypes = "success" | "info" | "warning" | "error" | "loading" | "default";
|
|
3
|
+
export type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);
|
|
4
|
+
export interface PromiseIExtendedResult extends ExternalToast {
|
|
5
|
+
message: JSXElement;
|
|
6
|
+
}
|
|
7
|
+
export type PromiseTExtendedResult<Data = any> = PromiseIExtendedResult | ((data: Data) => PromiseIExtendedResult | Promise<PromiseIExtendedResult>);
|
|
8
|
+
export type PromiseTResult<Data = any> = string | JSXElement | ((data: Data) => JSXElement | string | Promise<JSXElement | string>);
|
|
9
|
+
export type PromiseExternalToast = Omit<ExternalToast, "description">;
|
|
10
|
+
export type PromiseData<ToastData = any> = PromiseExternalToast & {
|
|
11
|
+
loading?: string | JSXElement;
|
|
12
|
+
success?: PromiseTResult<ToastData> | PromiseTExtendedResult<ToastData>;
|
|
13
|
+
error?: PromiseTResult | PromiseTExtendedResult;
|
|
14
|
+
description?: PromiseTResult;
|
|
15
|
+
finally?: () => void | Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export interface ToastClassnames {
|
|
18
|
+
toast?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
loader?: string;
|
|
22
|
+
cancelButton?: string;
|
|
23
|
+
actionButton?: string;
|
|
24
|
+
success?: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
info?: string;
|
|
27
|
+
warning?: string;
|
|
28
|
+
loading?: string;
|
|
29
|
+
default?: string;
|
|
30
|
+
content?: string;
|
|
31
|
+
icon?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ToastIcons {
|
|
34
|
+
success?: JSXElement;
|
|
35
|
+
info?: JSXElement;
|
|
36
|
+
warning?: JSXElement;
|
|
37
|
+
error?: JSXElement;
|
|
38
|
+
loading?: JSXElement;
|
|
39
|
+
close?: JSXElement;
|
|
40
|
+
}
|
|
41
|
+
export interface Action {
|
|
42
|
+
label: JSXElement;
|
|
43
|
+
onClick: JSX.EventHandler<HTMLButtonElement, MouseEvent>;
|
|
44
|
+
actionButtonStyle?: JSX.CSSProperties;
|
|
45
|
+
}
|
|
46
|
+
export interface ToastT {
|
|
47
|
+
id: string;
|
|
48
|
+
toasterId?: string;
|
|
49
|
+
title?: (() => JSXElement) | JSXElement;
|
|
50
|
+
type?: ToastTypes;
|
|
51
|
+
icon?: JSXElement;
|
|
52
|
+
jsx?: JSXElement;
|
|
53
|
+
richColors?: boolean;
|
|
54
|
+
invert?: boolean;
|
|
55
|
+
closeButton?: boolean;
|
|
56
|
+
dismissible?: boolean;
|
|
57
|
+
description?: (() => JSXElement) | JSXElement;
|
|
58
|
+
duration?: number;
|
|
59
|
+
delete?: boolean;
|
|
60
|
+
action?: Action | JSXElement;
|
|
61
|
+
cancel?: Action | JSXElement;
|
|
62
|
+
onDismiss?: (toast: ToastT) => void;
|
|
63
|
+
onAutoClose?: (toast: ToastT) => void;
|
|
64
|
+
promise?: PromiseT;
|
|
65
|
+
cancelButtonStyle?: JSX.CSSProperties;
|
|
66
|
+
actionButtonStyle?: JSX.CSSProperties;
|
|
67
|
+
style?: JSX.CSSProperties;
|
|
68
|
+
unstyled?: boolean;
|
|
69
|
+
class?: string;
|
|
70
|
+
classes?: ToastClassnames;
|
|
71
|
+
descriptionClass?: string;
|
|
72
|
+
position?: Position;
|
|
73
|
+
testId?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const isAction: (action: Action | JSXElement) => action is Action;
|
|
76
|
+
export type Position = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center";
|
|
77
|
+
export interface HeightT {
|
|
78
|
+
height: number;
|
|
79
|
+
toastId: number | string;
|
|
80
|
+
position: Position;
|
|
81
|
+
}
|
|
82
|
+
interface ToastOptions {
|
|
83
|
+
class?: string;
|
|
84
|
+
closeButton?: boolean;
|
|
85
|
+
descriptionClass?: string;
|
|
86
|
+
style?: JSX.CSSProperties;
|
|
87
|
+
cancelButtonStyle?: JSX.CSSProperties;
|
|
88
|
+
actionButtonStyle?: JSX.CSSProperties;
|
|
89
|
+
duration?: number;
|
|
90
|
+
unstyled?: boolean;
|
|
91
|
+
classes?: ToastClassnames;
|
|
92
|
+
closeButtonAriaLabel?: string;
|
|
93
|
+
toasterId?: string;
|
|
94
|
+
}
|
|
95
|
+
type Offset = {
|
|
96
|
+
top?: string | number;
|
|
97
|
+
right?: string | number;
|
|
98
|
+
bottom?: string | number;
|
|
99
|
+
left?: string | number;
|
|
100
|
+
} | string | number;
|
|
101
|
+
export interface ToasterProps {
|
|
102
|
+
id?: string;
|
|
103
|
+
invert?: boolean;
|
|
104
|
+
theme?: "light" | "dark" | "system";
|
|
105
|
+
position?: Position;
|
|
106
|
+
hotkey?: string[];
|
|
107
|
+
richColors?: boolean;
|
|
108
|
+
expand?: boolean;
|
|
109
|
+
duration?: number;
|
|
110
|
+
gap?: number;
|
|
111
|
+
visibleToasts?: number;
|
|
112
|
+
closeButton?: boolean;
|
|
113
|
+
toastOptions?: ToastOptions;
|
|
114
|
+
class?: string;
|
|
115
|
+
style?: JSX.CSSProperties;
|
|
116
|
+
offset?: Offset;
|
|
117
|
+
mobileOffset?: Offset;
|
|
118
|
+
dir?: "rtl" | "ltr" | "auto";
|
|
119
|
+
swipeDirections?: SwipeDirection[];
|
|
120
|
+
icons?: ToastIcons;
|
|
121
|
+
customAriaLabel?: string;
|
|
122
|
+
containerAriaLabel?: string;
|
|
123
|
+
}
|
|
124
|
+
export type SwipeDirection = "top" | "right" | "bottom" | "left";
|
|
125
|
+
export interface ToastProps {
|
|
126
|
+
toast: ToastT;
|
|
127
|
+
toasts: ToastT[];
|
|
128
|
+
index: number;
|
|
129
|
+
swipeDirections?: SwipeDirection[];
|
|
130
|
+
expanded: boolean;
|
|
131
|
+
invert: boolean;
|
|
132
|
+
heights: HeightT[];
|
|
133
|
+
setHeights: Setter<HeightT[]>;
|
|
134
|
+
removeToast: (toast: ToastT) => void;
|
|
135
|
+
gap?: number;
|
|
136
|
+
position: Position;
|
|
137
|
+
visibleToasts: number;
|
|
138
|
+
expandByDefault: boolean;
|
|
139
|
+
closeButton: boolean;
|
|
140
|
+
interacting: boolean;
|
|
141
|
+
style?: JSX.CSSProperties;
|
|
142
|
+
cancelButtonStyle?: JSX.CSSProperties;
|
|
143
|
+
actionButtonStyle?: JSX.CSSProperties;
|
|
144
|
+
duration?: number;
|
|
145
|
+
class?: string;
|
|
146
|
+
unstyled?: boolean;
|
|
147
|
+
descriptionClass?: string;
|
|
148
|
+
loadingIcon?: JSXElement;
|
|
149
|
+
classes?: ToastClassnames;
|
|
150
|
+
icons?: ToastIcons;
|
|
151
|
+
closeButtonAriaLabel?: string;
|
|
152
|
+
defaultRichColors?: boolean;
|
|
153
|
+
}
|
|
154
|
+
export declare enum SwipeStateTypes {
|
|
155
|
+
SwipedOut = "SwipedOut",
|
|
156
|
+
SwipedBack = "SwipedBack",
|
|
157
|
+
NotSwiped = "NotSwiped"
|
|
158
|
+
}
|
|
159
|
+
export type Theme = "light" | "dark";
|
|
160
|
+
export interface ToastToDismiss {
|
|
161
|
+
id: string;
|
|
162
|
+
dismiss: boolean;
|
|
163
|
+
}
|
|
164
|
+
export type ExternalToast = Omit<ToastT, "id" | "type" | "title" | "jsx" | "delete" | "promise"> & {
|
|
165
|
+
id?: string;
|
|
166
|
+
toasterId?: string;
|
|
167
|
+
};
|
|
168
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SwipeDirection, ToasterProps } from './types';
|
|
2
|
+
/** Derives default swipe directions from a position string like "bottom-right" */
|
|
3
|
+
export declare function getDefaultSwipeDirections(position: string): SwipeDirection[];
|
|
4
|
+
/** Reads the document text direction (for RTL support) */
|
|
5
|
+
export declare function getDocumentDirection(): ToasterProps["dir"];
|
|
6
|
+
/**
|
|
7
|
+
* Converts offset prop (string | number | object) into CSS custom property map.
|
|
8
|
+
* Produces both desktop (`--offset-*`) and mobile (`--mobile-offset-*`) vars.
|
|
9
|
+
*/
|
|
10
|
+
export declare function assignOffset(defaultOffset: ToasterProps["offset"], mobileOffset: ToasterProps["mobileOffset"]): Record<string, string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MOBILE_VIEWPORT_OFFSET as e, VIEWPORT_OFFSET as t } from "./constants.js";
|
|
2
|
+
//#region src/components/toast/utils.ts
|
|
3
|
+
function n(e) {
|
|
4
|
+
let [t, n] = e.split("-"), r = [];
|
|
5
|
+
return t && r.push(t), n && r.push(n), r;
|
|
6
|
+
}
|
|
7
|
+
function r() {
|
|
8
|
+
if (typeof window > "u" || typeof document > "u") return "ltr";
|
|
9
|
+
let e = document.documentElement.getAttribute("dir");
|
|
10
|
+
return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
|
|
11
|
+
}
|
|
12
|
+
function i(n, r) {
|
|
13
|
+
let i = {};
|
|
14
|
+
return [n, r].forEach((n, r) => {
|
|
15
|
+
let a = r === 1, o = a ? "--mobile-offset" : "--offset", s = a ? e : t, c = (e) => {
|
|
16
|
+
[
|
|
17
|
+
"top",
|
|
18
|
+
"right",
|
|
19
|
+
"bottom",
|
|
20
|
+
"left"
|
|
21
|
+
].forEach((t) => {
|
|
22
|
+
i[`${o}-${t}`] = typeof e == "number" ? `${e}px` : e;
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
typeof n == "number" || typeof n == "string" ? c(n) : typeof n == "object" && n ? [
|
|
26
|
+
"top",
|
|
27
|
+
"right",
|
|
28
|
+
"bottom",
|
|
29
|
+
"left"
|
|
30
|
+
].forEach((e) => {
|
|
31
|
+
let t = n[e];
|
|
32
|
+
i[`${o}-${e}`] = t === void 0 ? s : typeof t == "number" ? `${t}px` : t;
|
|
33
|
+
}) : c(s);
|
|
34
|
+
}), i;
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { i as assignOffset, n as getDefaultSwipeDirections, r as getDocumentDirection };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type TooltipContextValue = {
|
|
2
|
+
open: () => boolean;
|
|
3
|
+
setOpen: (v: boolean) => void;
|
|
4
|
+
triggerRef: () => HTMLElement | undefined;
|
|
5
|
+
setTriggerRef: (el: HTMLElement) => void;
|
|
6
|
+
contentId: string;
|
|
7
|
+
openDelay: number;
|
|
8
|
+
closeDelay: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const TooltipContext: import('solid-js').Context<TooltipContextValue | undefined>;
|
|
11
|
+
export declare function useTooltipContext(): TooltipContextValue;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext as e, useContext as t } from "solid-js";
|
|
2
|
+
//#region src/components/tooltip/Tooltip/Tooltip.context.ts
|
|
3
|
+
var n = e();
|
|
4
|
+
function r() {
|
|
5
|
+
let e = t(n);
|
|
6
|
+
if (!e) throw Error("Tooltip components must be used within Tooltip.Root");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { n as TooltipContext, r as useTooltipContext };
|