@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,140 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { VALID_LOADING_VALUES } from './Image.utils';
|
|
3
|
+
export interface StaticImageData {
|
|
4
|
+
src: string;
|
|
5
|
+
height: number;
|
|
6
|
+
width: number;
|
|
7
|
+
blurDataURL?: string;
|
|
8
|
+
blurWidth?: number;
|
|
9
|
+
blurHeight?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface StaticRequire {
|
|
12
|
+
default: StaticImageData;
|
|
13
|
+
}
|
|
14
|
+
export type StaticImport = StaticRequire | StaticImageData;
|
|
15
|
+
export interface ImageLoaderProps {
|
|
16
|
+
src: string;
|
|
17
|
+
width: number;
|
|
18
|
+
quality?: number;
|
|
19
|
+
}
|
|
20
|
+
export type ImageConfig = ImageConfigComplete & {
|
|
21
|
+
allSizes: number[];
|
|
22
|
+
output?: "standalone" | "export";
|
|
23
|
+
};
|
|
24
|
+
export type ImageLoader = (props: ImageLoaderProps) => string;
|
|
25
|
+
export type ImageLoaderPropsWithConfig = ImageLoaderProps & {
|
|
26
|
+
config: Readonly<ImageConfig>;
|
|
27
|
+
};
|
|
28
|
+
export type ImageLoaderWithConfig = (p: ImageLoaderPropsWithConfig) => string;
|
|
29
|
+
export type PlaceholderValue = "blur" | "empty" | `data:image/${string}`;
|
|
30
|
+
/**
|
|
31
|
+
* 图片加载完成后触发,接收一个类似 React SyntheticEvent 的对象。
|
|
32
|
+
* SolidJS 中直接使用原生 Event 即可。
|
|
33
|
+
*/
|
|
34
|
+
export type OnLoad = (event: Event & {
|
|
35
|
+
currentTarget: HTMLImageElement;
|
|
36
|
+
target: Element;
|
|
37
|
+
}) => void;
|
|
38
|
+
/** @deprecated 使用 onLoad 替代 */
|
|
39
|
+
export type OnLoadingComplete = (img: HTMLImageElement) => void;
|
|
40
|
+
export interface ImageConfigComplete {
|
|
41
|
+
deviceSizes: number[];
|
|
42
|
+
imageSizes: number[];
|
|
43
|
+
loader: "default" | "imgix" | "cloudinary" | "akamai" | "custom";
|
|
44
|
+
path: string;
|
|
45
|
+
loaderFile: string;
|
|
46
|
+
domains: string[];
|
|
47
|
+
disableStaticImages: boolean;
|
|
48
|
+
minimumCacheTTL: number;
|
|
49
|
+
formats: ("image/avif" | "image/webp")[];
|
|
50
|
+
dangerouslyAllowSVG: boolean;
|
|
51
|
+
contentSecurityPolicy: string;
|
|
52
|
+
contentDispositionType: "inline" | "attachment";
|
|
53
|
+
remotePatterns: RemotePattern[];
|
|
54
|
+
localPatterns?: LocalPattern[];
|
|
55
|
+
unoptimized: boolean;
|
|
56
|
+
qualities?: number[];
|
|
57
|
+
/** 由运行时计算追加 */
|
|
58
|
+
allSizes?: number[];
|
|
59
|
+
}
|
|
60
|
+
export interface RemotePattern {
|
|
61
|
+
protocol?: "http" | "https";
|
|
62
|
+
hostname: string;
|
|
63
|
+
port?: string;
|
|
64
|
+
pathname?: string;
|
|
65
|
+
search?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface LocalPattern {
|
|
68
|
+
pathname?: string;
|
|
69
|
+
search?: string;
|
|
70
|
+
}
|
|
71
|
+
export type LoadingValue = (typeof VALID_LOADING_VALUES)[number];
|
|
72
|
+
/** 公开的 <Image> 组件 Props */
|
|
73
|
+
export interface ImageProps extends Omit<JSX.IntrinsicElements["img"], "src" | "srcSet" | "ref" | "alt" | "width" | "height" | "loading" | "style" | "onLoad"> {
|
|
74
|
+
style?: JSX.CSSProperties;
|
|
75
|
+
src: string | StaticImport;
|
|
76
|
+
alt: string;
|
|
77
|
+
width?: number | `${number}`;
|
|
78
|
+
height?: number | `${number}`;
|
|
79
|
+
fill?: boolean;
|
|
80
|
+
loader?: ImageLoader;
|
|
81
|
+
quality?: number | `${number}`;
|
|
82
|
+
preload?: boolean;
|
|
83
|
+
onLoad?: OnLoad;
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Use `preload` prop instead.
|
|
86
|
+
* See https://nextjs.org/docs/app/api-reference/components/image#preload
|
|
87
|
+
*/
|
|
88
|
+
priority?: boolean;
|
|
89
|
+
loading?: LoadingValue;
|
|
90
|
+
placeholder?: PlaceholderValue;
|
|
91
|
+
blurDataURL?: string;
|
|
92
|
+
unoptimized?: boolean;
|
|
93
|
+
overrideSrc?: string;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Use `onLoad` instead.
|
|
96
|
+
* @see https://nextjs.org/docs/app/api-reference/components/image#onload
|
|
97
|
+
*/
|
|
98
|
+
onLoadingComplete?: OnLoadingComplete;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
|
|
101
|
+
* @see https://nextjs.org/docs/api-reference/next/legacy/image
|
|
102
|
+
*/
|
|
103
|
+
layout?: string;
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated Use `style` prop instead.
|
|
106
|
+
*/
|
|
107
|
+
objectFit?: string;
|
|
108
|
+
/**
|
|
109
|
+
* @deprecated Use `style` prop instead.
|
|
110
|
+
*/
|
|
111
|
+
objectPosition?: string;
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated This prop does not do anything.
|
|
114
|
+
*/
|
|
115
|
+
lazyBoundary?: string;
|
|
116
|
+
/**
|
|
117
|
+
* @deprecated This prop does not do anything.
|
|
118
|
+
*/
|
|
119
|
+
lazyRoot?: string;
|
|
120
|
+
}
|
|
121
|
+
export type ImgProps = Omit<ImageProps, "src" | "loader"> & {
|
|
122
|
+
loading: LoadingValue;
|
|
123
|
+
width: number | undefined;
|
|
124
|
+
height: number | undefined;
|
|
125
|
+
style: NonNullable<JSX.IntrinsicElements["img"]["style"]>;
|
|
126
|
+
sizes: string | undefined;
|
|
127
|
+
srcSet: string | undefined;
|
|
128
|
+
src: string;
|
|
129
|
+
};
|
|
130
|
+
/** getImgProps 的返回结构 */
|
|
131
|
+
export interface ImgPropsResult {
|
|
132
|
+
props: ImgProps;
|
|
133
|
+
meta: {
|
|
134
|
+
unoptimized: boolean;
|
|
135
|
+
placeholder: PlaceholderValue;
|
|
136
|
+
fill: boolean;
|
|
137
|
+
preload: boolean;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export type PlaceholderStyle = Partial<Pick<JSX.CSSProperties, "background-size" | "background-position" | "background-repeat" | "background-image">>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ImageConfigComplete, ImageProps, ImgPropsResult, OnLoad, OnLoadingComplete, PlaceholderValue } from './Image.types';
|
|
2
|
+
/** 用于追踪每个 img 节点已处理的 src,避免重复触发 */
|
|
3
|
+
type ImgWithDataProp = HTMLImageElement & {
|
|
4
|
+
"data-loaded-src"?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* 在图片加载/hydrate 后调用。
|
|
8
|
+
* - 使用 img.decode() 确保像素已解码再触发回调
|
|
9
|
+
* - 清除 blur placeholder
|
|
10
|
+
* - 开发环境下输出 fill / sizes 相关警告
|
|
11
|
+
*/
|
|
12
|
+
export declare function handleLoading(img: ImgWithDataProp, placeholder: PlaceholderValue, onLoad: OnLoad | undefined, onLoadingComplete: OnLoadingComplete | undefined, setBlurComplete: (v: boolean) => void, unoptimized: boolean, sizesInput: string | undefined): void;
|
|
13
|
+
interface GetImgPropsOptions {
|
|
14
|
+
imgConf: ImageConfigComplete;
|
|
15
|
+
blurComplete: boolean;
|
|
16
|
+
showAltText: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const VALID_LOADING_VALUES: readonly ["lazy", "eager", undefined];
|
|
19
|
+
export declare function getImgProps(props: ImageProps, { imgConf, blurComplete, showAltText }: GetImgPropsOptions): ImgPropsResult;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { imageConfigDefault as e } from "./Image.config.js";
|
|
2
|
+
import { mergeProps as t, splitProps as n } from "solid-js";
|
|
3
|
+
//#region src/components/image/Image.utils.ts
|
|
4
|
+
function r(e, t, n, r, i, a, o) {
|
|
5
|
+
let s = e?.src;
|
|
6
|
+
!e || e["data-loaded-src"] === s || (e["data-loaded-src"] = s, ("decode" in e ? e.decode() : Promise.resolve()).catch(() => {}).then(() => {
|
|
7
|
+
if (!(!e.parentElement || !e.isConnected)) {
|
|
8
|
+
if (t !== "empty" && i(!0), n) {
|
|
9
|
+
let t = new Event("load");
|
|
10
|
+
Object.defineProperty(t, "target", {
|
|
11
|
+
writable: !1,
|
|
12
|
+
value: e
|
|
13
|
+
}), n(t);
|
|
14
|
+
}
|
|
15
|
+
r && r(e);
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
var i = [
|
|
20
|
+
"-moz-initial",
|
|
21
|
+
"fill",
|
|
22
|
+
"none",
|
|
23
|
+
"scale-down",
|
|
24
|
+
void 0
|
|
25
|
+
];
|
|
26
|
+
function a(r, { imgConf: a, blurComplete: l, showAltText: p }) {
|
|
27
|
+
let [m, h] = n(t({
|
|
28
|
+
fill: !1,
|
|
29
|
+
priority: !1,
|
|
30
|
+
preload: !1,
|
|
31
|
+
placeholder: "empty",
|
|
32
|
+
unoptimized: a.unoptimized,
|
|
33
|
+
decoding: "async"
|
|
34
|
+
}, r), [
|
|
35
|
+
"src",
|
|
36
|
+
"loader",
|
|
37
|
+
"quality",
|
|
38
|
+
"width",
|
|
39
|
+
"height",
|
|
40
|
+
"fill",
|
|
41
|
+
"sizes",
|
|
42
|
+
"priority",
|
|
43
|
+
"placeholder",
|
|
44
|
+
"blurDataURL",
|
|
45
|
+
"unoptimized",
|
|
46
|
+
"overrideSrc",
|
|
47
|
+
"onLoad",
|
|
48
|
+
"onLoadingComplete",
|
|
49
|
+
"layout",
|
|
50
|
+
"style",
|
|
51
|
+
"preload",
|
|
52
|
+
"loading",
|
|
53
|
+
"objectFit",
|
|
54
|
+
"objectPosition",
|
|
55
|
+
"lazyBoundary",
|
|
56
|
+
"lazyRoot",
|
|
57
|
+
"fetchpriority",
|
|
58
|
+
"class",
|
|
59
|
+
"decoding"
|
|
60
|
+
]), g, _ = a || e;
|
|
61
|
+
if ("allSizes" in _) g = _;
|
|
62
|
+
else {
|
|
63
|
+
let e = [..._.deviceSizes, ..._.imageSizes].sort((e, t) => e - t), t = _.deviceSizes.sort((e, t) => e - t), n = _.qualities?.sort((e, t) => e - t);
|
|
64
|
+
g = {
|
|
65
|
+
..._,
|
|
66
|
+
allSizes: e,
|
|
67
|
+
deviceSizes: t,
|
|
68
|
+
qualities: n
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (o === void 0) throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");
|
|
72
|
+
let v = m.style, y = m.sizes, b = m.fill, x = m.loader || o;
|
|
73
|
+
if (m.layout) {
|
|
74
|
+
m.layout === "fill" && (b = !0);
|
|
75
|
+
let e = {
|
|
76
|
+
intrinsic: {
|
|
77
|
+
maxWidth: "100%",
|
|
78
|
+
height: "auto"
|
|
79
|
+
},
|
|
80
|
+
responsive: {
|
|
81
|
+
width: "100%",
|
|
82
|
+
height: "auto"
|
|
83
|
+
}
|
|
84
|
+
}, t = {
|
|
85
|
+
responsive: "100vw",
|
|
86
|
+
fill: "100vw"
|
|
87
|
+
}, n = e[m.layout];
|
|
88
|
+
n && (v = {
|
|
89
|
+
...v,
|
|
90
|
+
...n
|
|
91
|
+
});
|
|
92
|
+
let r = t[m.layout];
|
|
93
|
+
r && !y && (y = r);
|
|
94
|
+
}
|
|
95
|
+
let S = "", C = m.blurDataURL, w = s(m.width), T = s(m.height), E, D;
|
|
96
|
+
if (u(m.src)) {
|
|
97
|
+
let e = c(m.src) ? m.src.default : m.src;
|
|
98
|
+
if (!e.src) throw Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(e)}`);
|
|
99
|
+
if (!e.height || !e.width) throw Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(e)}`);
|
|
100
|
+
if (E = e.blurWidth, D = e.blurHeight, C ||= e.blurDataURL, S = e.src, !b) {
|
|
101
|
+
if (!w && !T) w = e.width, T = e.height;
|
|
102
|
+
else if (w && !T) {
|
|
103
|
+
let t = w / e.width;
|
|
104
|
+
T = Math.round(e.height * t);
|
|
105
|
+
} else if (!w && T) {
|
|
106
|
+
let t = T / e.height;
|
|
107
|
+
w = Math.round(e.width * t);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
let O = typeof m.src == "string" ? m.src : S, k = m.unoptimized, A = !m.priority && !m.preload && (m.loading === "lazy" || m.loading === void 0);
|
|
112
|
+
(!O || O.startsWith("data:") || O.startsWith("blob:")) && (k = !0, A = !1), g.unoptimized && (k = !0), !g.dangerouslyAllowSVG && O.split("?", 1)[0].endsWith(".svg") && (k = !0);
|
|
113
|
+
let j = s(m.quality), M = Object.assign(b ? {
|
|
114
|
+
position: "absolute",
|
|
115
|
+
height: "100%",
|
|
116
|
+
width: "100%",
|
|
117
|
+
left: 0,
|
|
118
|
+
top: 0,
|
|
119
|
+
right: 0,
|
|
120
|
+
bottom: 0,
|
|
121
|
+
objectFit: m.objectFit,
|
|
122
|
+
objectPosition: m.objectPosition
|
|
123
|
+
} : {}, p ? {} : { color: "transparent" }, v), N = !l && m.placeholder !== "empty" ? m.placeholder === "blur" ? `url("data:image/svg+xml;charset=utf-8,${d({
|
|
124
|
+
widthInt: w,
|
|
125
|
+
heightInt: T,
|
|
126
|
+
blurWidth: E,
|
|
127
|
+
blurHeight: D,
|
|
128
|
+
blurDataURL: C || "",
|
|
129
|
+
objectFit: M.objectFit
|
|
130
|
+
})}")` : `url("${m.placeholder}")` : null, P = i.includes(M.objectFit) ? M.objectFit === "fill" ? "100% 100%" : "cover" : M.objectFit, F = N ? {
|
|
131
|
+
"background-size": P,
|
|
132
|
+
"background-position": M.objectPosition || "50% 50%",
|
|
133
|
+
"background-repeat": "no-repeat",
|
|
134
|
+
"background-image": N
|
|
135
|
+
} : {}, I = f({
|
|
136
|
+
config: g,
|
|
137
|
+
src: O,
|
|
138
|
+
unoptimized: k,
|
|
139
|
+
width: w,
|
|
140
|
+
quality: j,
|
|
141
|
+
sizes: y,
|
|
142
|
+
loader: x
|
|
143
|
+
}), L = A ? "lazy" : m.loading;
|
|
144
|
+
return {
|
|
145
|
+
props: {
|
|
146
|
+
...h,
|
|
147
|
+
loading: L,
|
|
148
|
+
fetchpriority: m.fetchpriority,
|
|
149
|
+
width: w,
|
|
150
|
+
height: T,
|
|
151
|
+
decoding: m.decoding,
|
|
152
|
+
class: m.class,
|
|
153
|
+
style: {
|
|
154
|
+
...M,
|
|
155
|
+
...F
|
|
156
|
+
},
|
|
157
|
+
sizes: I.sizes,
|
|
158
|
+
srcSet: I.srcSet,
|
|
159
|
+
src: m.overrideSrc || I.src
|
|
160
|
+
},
|
|
161
|
+
meta: {
|
|
162
|
+
unoptimized: k,
|
|
163
|
+
preload: m.preload || m.priority,
|
|
164
|
+
placeholder: m.placeholder,
|
|
165
|
+
fill: b
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function o({ src: e, width: t, quality: n }) {
|
|
170
|
+
if (e.startsWith("http://") || e.startsWith("https://")) return e;
|
|
171
|
+
let r = new URLSearchParams();
|
|
172
|
+
return r.set("url", e), r.set("w", String(t)), n && r.set("q", String(n)), `/_image?${r.toString()}`;
|
|
173
|
+
}
|
|
174
|
+
function s(e) {
|
|
175
|
+
return e === void 0 ? e : typeof e == "number" ? Number.isFinite(e) ? e : NaN : typeof e == "string" && /^[0-9]+$/.test(e) ? parseInt(e, 10) : NaN;
|
|
176
|
+
}
|
|
177
|
+
function c(e) {
|
|
178
|
+
return e.default !== void 0;
|
|
179
|
+
}
|
|
180
|
+
function l(e) {
|
|
181
|
+
return e.src !== void 0;
|
|
182
|
+
}
|
|
183
|
+
function u(e) {
|
|
184
|
+
return !!e && typeof e == "object" && (c(e) || l(e));
|
|
185
|
+
}
|
|
186
|
+
function d({ widthInt: e, heightInt: t, blurWidth: n, blurHeight: r, blurDataURL: i, objectFit: a }) {
|
|
187
|
+
let o = n ? n * 40 : e, s = r ? r * 40 : t, c = o && s ? `viewBox='0 0 ${o} ${s}'` : "";
|
|
188
|
+
return `%3Csvg xmlns='http://www.w3.org/2000/svg' ${c}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${c ? "none" : a === "contain" ? "xMidYMid" : a === "cover" ? "xMidYMid slice" : "none"}' style='filter: url(%23b);' href='${i}'/%3E%3C/svg%3E`;
|
|
189
|
+
}
|
|
190
|
+
function f({ config: e, src: t, unoptimized: n, width: r, quality: i, sizes: a, loader: o }) {
|
|
191
|
+
if (n) return {
|
|
192
|
+
src: t,
|
|
193
|
+
srcSet: void 0,
|
|
194
|
+
sizes: void 0
|
|
195
|
+
};
|
|
196
|
+
let { widths: s, kind: c } = p(e, r, a), l = s.length - 1;
|
|
197
|
+
return {
|
|
198
|
+
sizes: !a && c === "w" ? "100vw" : a,
|
|
199
|
+
srcSet: s.map((n, r) => `${o({
|
|
200
|
+
config: e,
|
|
201
|
+
src: t,
|
|
202
|
+
quality: i,
|
|
203
|
+
width: n
|
|
204
|
+
})} ${c === "w" ? n : r + 1}${c}`).join(", "),
|
|
205
|
+
src: o({
|
|
206
|
+
config: e,
|
|
207
|
+
src: t,
|
|
208
|
+
quality: i,
|
|
209
|
+
width: s[l]
|
|
210
|
+
})
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function p({ deviceSizes: e, allSizes: t }, n, r) {
|
|
214
|
+
if (r) {
|
|
215
|
+
let n = /(^|\s)(1?\d?\d)vw/g, i = [];
|
|
216
|
+
for (let e; e = n.exec(r);) i.push(Number.parseInt(e[2], 10));
|
|
217
|
+
if (i.length) {
|
|
218
|
+
let n = Math.min(...i) * .01;
|
|
219
|
+
return {
|
|
220
|
+
widths: t.filter((t) => t >= e[0] * n),
|
|
221
|
+
kind: "w"
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
widths: t,
|
|
226
|
+
kind: "w"
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return typeof n == "number" ? {
|
|
230
|
+
widths: [...new Set([n, n * 2].map((e) => t.find((t) => t >= e) || t[t.length - 1]))],
|
|
231
|
+
kind: "x"
|
|
232
|
+
} : {
|
|
233
|
+
widths: e,
|
|
234
|
+
kind: "w"
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
export { a as getImgProps, r as handleLoading };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from 'solid-js';
|
|
2
|
+
import { ImgProps, OnLoad, OnLoadingComplete, PlaceholderValue } from './Image.types';
|
|
3
|
+
export interface ImageElementProps extends ImgProps {
|
|
4
|
+
unoptimized: boolean;
|
|
5
|
+
placeholder: PlaceholderValue;
|
|
6
|
+
/** 上层通过 signal setter 传入,避免在此组件内管理状态 */
|
|
7
|
+
setBlurComplete: (v: boolean) => void;
|
|
8
|
+
setShowAltText: (v: boolean) => void;
|
|
9
|
+
sizesInput: string | undefined;
|
|
10
|
+
onLoad?: OnLoad;
|
|
11
|
+
onLoadingComplete?: OnLoadingComplete;
|
|
12
|
+
/** 透传给原生 img 的 ref */
|
|
13
|
+
ref?: (el: HTMLImageElement) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const ImageElement: Component<ImageElementProps>;
|
|
16
|
+
export default ImageElement;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { handleLoading as e } from "./Image.utils.js";
|
|
2
|
+
import { mergeProps as t, spread as n, template as r, use as i } from "solid-js/web";
|
|
3
|
+
import { mergeProps as a, splitProps as o } from "solid-js";
|
|
4
|
+
//#region src/components/image/ImageElement.tsx
|
|
5
|
+
var s = /* @__PURE__ */ r("<img>", !0, !1, !1), c = (r) => {
|
|
6
|
+
let [c, l] = o(a({ decoding: "async" }, r), [
|
|
7
|
+
"src",
|
|
8
|
+
"srcSet",
|
|
9
|
+
"sizes",
|
|
10
|
+
"height",
|
|
11
|
+
"width",
|
|
12
|
+
"decoding",
|
|
13
|
+
"class",
|
|
14
|
+
"classList",
|
|
15
|
+
"style",
|
|
16
|
+
"fetchpriority",
|
|
17
|
+
"placeholder",
|
|
18
|
+
"loading",
|
|
19
|
+
"unoptimized",
|
|
20
|
+
"fill",
|
|
21
|
+
"setBlurComplete",
|
|
22
|
+
"setShowAltText",
|
|
23
|
+
"sizesInput",
|
|
24
|
+
"onLoad",
|
|
25
|
+
"onError",
|
|
26
|
+
"onLoadingComplete",
|
|
27
|
+
"ref",
|
|
28
|
+
"alt"
|
|
29
|
+
]);
|
|
30
|
+
function u(t) {
|
|
31
|
+
t && (c.onError && (t.src = t.src), t.complete && e(t, c.placeholder, c.onLoad, c.onLoadingComplete, c.setBlurComplete, c.unoptimized, c.sizesInput), c.ref?.(t));
|
|
32
|
+
}
|
|
33
|
+
return (() => {
|
|
34
|
+
var r = s(), a = u;
|
|
35
|
+
return typeof a == "function" ? i(a, r) : u = r, n(r, t(l, {
|
|
36
|
+
get alt() {
|
|
37
|
+
return c.alt;
|
|
38
|
+
},
|
|
39
|
+
get loading() {
|
|
40
|
+
return c.loading;
|
|
41
|
+
},
|
|
42
|
+
get width() {
|
|
43
|
+
return c.width;
|
|
44
|
+
},
|
|
45
|
+
get height() {
|
|
46
|
+
return c.height;
|
|
47
|
+
},
|
|
48
|
+
get decoding() {
|
|
49
|
+
return c.decoding;
|
|
50
|
+
},
|
|
51
|
+
get "data-nimg"() {
|
|
52
|
+
return c.fill ? "fill" : "1";
|
|
53
|
+
},
|
|
54
|
+
get class() {
|
|
55
|
+
return c.class;
|
|
56
|
+
},
|
|
57
|
+
get style() {
|
|
58
|
+
return c.style;
|
|
59
|
+
},
|
|
60
|
+
get sizes() {
|
|
61
|
+
return c.sizes;
|
|
62
|
+
},
|
|
63
|
+
get srcset() {
|
|
64
|
+
return c.srcSet;
|
|
65
|
+
},
|
|
66
|
+
get src() {
|
|
67
|
+
return c.src;
|
|
68
|
+
},
|
|
69
|
+
onLoad: (t) => {
|
|
70
|
+
let n = t.currentTarget;
|
|
71
|
+
e(n, c.placeholder, c.onLoad, c.onLoadingComplete, c.setBlurComplete, c.unoptimized, c.sizesInput);
|
|
72
|
+
},
|
|
73
|
+
onError: (e) => {
|
|
74
|
+
c.setShowAltText(!0), c.placeholder !== "empty" && c.setBlurComplete(!0), c.onError && typeof c.onError == "function" && c.onError(e);
|
|
75
|
+
}
|
|
76
|
+
}), !1, !1), r;
|
|
77
|
+
})();
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { c as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component } from 'solid-js';
|
|
2
|
+
import { ImgProps } from './Image.types';
|
|
3
|
+
export interface ImagePreloadProps {
|
|
4
|
+
imgAttributes: Pick<ImgProps, "src" | "srcSet" | "sizes" | "crossOrigin" | "referrerPolicy" | "fetchpriority">;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 通过 SolidJS <Portal> 将 <link> 插入 document.head。
|
|
8
|
+
*
|
|
9
|
+
* 注意:
|
|
10
|
+
* - 故意省略 href(当 imagesrcset 存在时),以避免不支持 srcset 的浏览器
|
|
11
|
+
* 加载错误尺寸的图片。详见 HTML spec §attr-link-imagesrcset。
|
|
12
|
+
* - SolidJS SSR 环境可将此组件替换为 server-side head injection。
|
|
13
|
+
*/
|
|
14
|
+
declare const ImagePreload: Component<ImagePreloadProps>;
|
|
15
|
+
export default ImagePreload;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Portal as e, createComponent as t, effect as n, setAttribute as r, template as i } from "solid-js/web";
|
|
2
|
+
//#region src/components/image/ImagePreload.tsx
|
|
3
|
+
var a = /* @__PURE__ */ i("<link rel=preload as=image>"), o = (i) => {
|
|
4
|
+
let { imgAttributes: o } = i, s = `__img-preload-${o.src}-${o.srcSet ?? ""}-${o.sizes ?? ""}`;
|
|
5
|
+
return typeof document < "u" && document.head.querySelector(`link[data-img-key="${s}"]`) ? null : t(e, {
|
|
6
|
+
get mount() {
|
|
7
|
+
return document.head;
|
|
8
|
+
},
|
|
9
|
+
get children() {
|
|
10
|
+
var e = a();
|
|
11
|
+
return r(e, "data-img-key", s), n((t) => {
|
|
12
|
+
var n = o.srcSet ? void 0 : o.src, i = o.srcSet, a = o.sizes, s = o.crossOrigin, c = o.referrerPolicy, l = o.fetchpriority;
|
|
13
|
+
return n !== t.e && r(e, "href", t.e = n), i !== t.t && r(e, "imagesrcset", t.t = i), a !== t.a && r(e, "imagesizes", t.a = a), s !== t.o && r(e, "crossorigin", t.o = s), c !== t.i && r(e, "referrerpolicy", t.i = c), l !== t.n && r(e, "fetchpriority", t.n = l), t;
|
|
14
|
+
}, {
|
|
15
|
+
e: void 0,
|
|
16
|
+
t: void 0,
|
|
17
|
+
a: void 0,
|
|
18
|
+
o: void 0,
|
|
19
|
+
i: void 0,
|
|
20
|
+
n: void 0
|
|
21
|
+
}), e;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { o as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image } from './Image';
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { clsx as e } from "../../lib/utils/clsx.js";
|
|
2
|
+
import { delegateEvents as t, mergeProps as n, spread as r, template as i } from "solid-js/web";
|
|
3
|
+
import { createUniqueId as a, mergeProps as o, splitProps as s } from "solid-js";
|
|
4
|
+
//#region src/components/input/Input.tsx
|
|
5
|
+
var c = /* @__PURE__ */ i("<input data-slot=input>"), l = (t) => {
|
|
6
|
+
let [i, l] = s(o({
|
|
7
|
+
id: a(),
|
|
8
|
+
type: "text"
|
|
9
|
+
}, t), [
|
|
10
|
+
"type",
|
|
11
|
+
"onInput",
|
|
12
|
+
"onChange",
|
|
13
|
+
"class",
|
|
14
|
+
"classList"
|
|
15
|
+
]), u = (e) => {
|
|
16
|
+
let t = e.target.value;
|
|
17
|
+
i.type === "number" && (t = Number(e.target.value)), i.onInput?.(t);
|
|
18
|
+
}, d = (e) => {
|
|
19
|
+
let t = e.target.value;
|
|
20
|
+
i.type === "number" && (t = Number(e.target.value)), i.onChange?.(t);
|
|
21
|
+
};
|
|
22
|
+
return (() => {
|
|
23
|
+
var t = c();
|
|
24
|
+
return t.addEventListener("change", d), t.$$input = u, r(t, n({ get class() {
|
|
25
|
+
return e("h-8 w-full min-w-0 rounded-lg border border-neutral-200 dark:border-white/15 bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-neutral-950 dark:file:text-neutral-50 placeholder:text-neutral-500 dark:placeholder:text-neutral-400 focus-visible:border-neutral-400 dark:focus-visible:border-neutral-500 focus-visible:ring-3 focus-visible:ring-neutral-400/50 dark:focus-visible:ring-neutral-500/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:select-none disabled:bg-neutral-200/50 disabled:opacity-50 aria-invalid:border-red-600 aria-invalid:ring-3 aria-invalid:ring-red-600/20 md:text-sm dark:bg-white/4.5 dark:disabled:bg-white/12 dark:aria-invalid:border-red-400/50 dark:aria-invalid:ring-red-400/40", i.class);
|
|
26
|
+
} }, l), !1, !1), t;
|
|
27
|
+
})();
|
|
28
|
+
};
|
|
29
|
+
t(["input"]);
|
|
30
|
+
//#endregion
|
|
31
|
+
export { l as Input };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
|
|
3
|
+
type NativeInputProps = JSX.IntrinsicElements["input"];
|
|
4
|
+
export interface NumberInputSpecifics {
|
|
5
|
+
type: "number";
|
|
6
|
+
onChange?: (value: number) => void;
|
|
7
|
+
onInput?: (value: number) => void;
|
|
8
|
+
}
|
|
9
|
+
interface TextInputSpecifics {
|
|
10
|
+
type?: Exclude<InputType, "number">;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
onInput?: (value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export type InputProps = (NumberInputSpecifics & Omit<NativeInputProps, keyof NumberInputSpecifics>) | (TextInputSpecifics & Omit<NativeInputProps, keyof TextInputSpecifics>);
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input } from './Input';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { clsx as e } from "../../../lib/utils/clsx.js";
|
|
2
|
+
import { mergeProps as t, spread as n, template as r } from "solid-js/web";
|
|
3
|
+
import { splitProps as i } from "solid-js";
|
|
4
|
+
//#region src/components/input-group/InputGroup/InputGroup.tsx
|
|
5
|
+
var a = /* @__PURE__ */ r("<div data-slot=input-group role=group>"), o = (r) => {
|
|
6
|
+
let [o, s] = i(r, ["class", "classList"]);
|
|
7
|
+
return (() => {
|
|
8
|
+
var r = a();
|
|
9
|
+
return n(r, t({ get class() {
|
|
10
|
+
return e("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", "border-neutral-200 has-disabled:bg-neutral-200/50 has-[[data-slot=input-group-control]:focus-visible]:border-neutral-400 has-[[data-slot=input-group-control]:focus-visible]:ring-neutral-400/50 has-[[data-slot][aria-invalid=true]]:border-red-600 has-[[data-slot][aria-invalid=true]]:ring-red-600/20", "dark:border-white/15 dark:bg-white/4.5 dark:has-disabled:bg-white/12 dark:has-[[data-slot=input-group-control]:focus-visible]:border-neutral-500 dark:has-[[data-slot=input-group-control]:focus-visible]:ring-neutral-500/50 dark:has-[[data-slot][aria-invalid=true]]:border-red-400 dark:has-[[data-slot][aria-invalid=true]]:ring-red-400/40", o.class);
|
|
11
|
+
} }, s), !1, !1), r;
|
|
12
|
+
})();
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { o as InputGroup };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputGroup } from './InputGroup';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { clsx as e } from "../../../lib/utils/clsx.js";
|
|
2
|
+
import { inputGroupAddonVariants as t } from "./InputGroupAddon.styles.js";
|
|
3
|
+
import { delegateEvents as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
|
|
4
|
+
import { mergeProps as o, splitProps as s } from "solid-js";
|
|
5
|
+
//#region src/components/input-group/InputGroupAddon/InputGroupAddon.tsx
|
|
6
|
+
var c = /* @__PURE__ */ a("<div role=group data-slot=input-group-addon>"), l = (n) => {
|
|
7
|
+
let [a, l] = s(o({ align: "inline-start" }, n), [
|
|
8
|
+
"align",
|
|
9
|
+
"class",
|
|
10
|
+
"classList"
|
|
11
|
+
]);
|
|
12
|
+
return (() => {
|
|
13
|
+
var n = c();
|
|
14
|
+
return n.$$click = (e) => {
|
|
15
|
+
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
16
|
+
}, i(n, r({
|
|
17
|
+
get "data-align"() {
|
|
18
|
+
return a.align;
|
|
19
|
+
},
|
|
20
|
+
get class() {
|
|
21
|
+
return e(t({ align: a.align }), a.class);
|
|
22
|
+
}
|
|
23
|
+
}, l), !1, !1), n;
|
|
24
|
+
})();
|
|
25
|
+
};
|
|
26
|
+
n(["click"]);
|
|
27
|
+
//#endregion
|
|
28
|
+
export { l as InputGroupAddon };
|