@starwind-ui/core 1.15.1 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +28 -0
- package/dist/index.js +108 -0
- package/dist/index.js.map +1 -0
- package/dist/src/components/accordion/Accordion.astro +254 -0
- package/dist/src/components/accordion/AccordionContent.astro +33 -0
- package/dist/src/components/accordion/AccordionItem.astro +27 -0
- package/dist/src/components/accordion/AccordionTrigger.astro +32 -0
- package/dist/src/components/accordion/index.ts +15 -0
- package/dist/src/components/alert/Alert.astro +31 -0
- package/dist/src/components/alert/AlertDescription.astro +14 -0
- package/dist/src/components/alert/AlertTitle.astro +16 -0
- package/dist/src/components/alert/index.ts +13 -0
- package/dist/src/components/alert-dialog/AlertDialog.astro +275 -0
- package/dist/src/components/alert-dialog/AlertDialogAction.astro +44 -0
- package/dist/src/components/alert-dialog/AlertDialogCancel.astro +45 -0
- package/dist/src/components/alert-dialog/AlertDialogContent.astro +52 -0
- package/dist/src/components/alert-dialog/AlertDialogDescription.astro +18 -0
- package/dist/src/components/alert-dialog/AlertDialogFooter.astro +16 -0
- package/dist/src/components/alert-dialog/AlertDialogHeader.astro +14 -0
- package/dist/src/components/alert-dialog/AlertDialogTitle.astro +20 -0
- package/dist/src/components/alert-dialog/AlertDialogTrigger.astro +47 -0
- package/dist/src/components/alert-dialog/index.ts +46 -0
- package/dist/src/components/aspect-ratio/AspectRatio.astro +32 -0
- package/dist/src/components/aspect-ratio/index.ts +7 -0
- package/dist/src/components/avatar/Avatar.astro +29 -0
- package/dist/src/components/avatar/AvatarFallback.astro +18 -0
- package/dist/src/components/avatar/AvatarImage.astro +49 -0
- package/dist/src/components/avatar/index.ts +13 -0
- package/dist/src/components/badge/Badge.astro +55 -0
- package/dist/src/components/badge/index.ts +7 -0
- package/dist/src/components/breadcrumb/Breadcrumb.astro +11 -0
- package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +28 -0
- package/dist/src/components/breadcrumb/BreadcrumbItem.astro +14 -0
- package/dist/src/components/breadcrumb/BreadcrumbLink.astro +22 -0
- package/dist/src/components/breadcrumb/BreadcrumbList.astro +16 -0
- package/dist/src/components/breadcrumb/BreadcrumbPage.astro +21 -0
- package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +23 -0
- package/dist/src/components/breadcrumb/index.ts +37 -0
- package/dist/src/components/button/Button.astro +55 -0
- package/dist/src/components/button/index.ts +7 -0
- package/dist/src/components/button-group/ButtonGroup.astro +62 -0
- package/dist/src/components/button-group/ButtonGroupSeparator.astro +27 -0
- package/dist/src/components/button-group/ButtonGroupText.astro +19 -0
- package/dist/src/components/button-group/index.ts +17 -0
- package/dist/src/components/card/Card.astro +14 -0
- package/dist/src/components/card/CardContent.astro +14 -0
- package/dist/src/components/card/CardDescription.astro +14 -0
- package/dist/src/components/card/CardFooter.astro +14 -0
- package/dist/src/components/card/CardHeader.astro +14 -0
- package/dist/src/components/card/CardTitle.astro +14 -0
- package/dist/src/components/card/index.ts +26 -0
- package/dist/src/components/carousel/Carousel.astro +55 -0
- package/dist/src/components/carousel/CarouselContent.astro +26 -0
- package/dist/src/components/carousel/CarouselItem.astro +26 -0
- package/dist/src/components/carousel/CarouselNext.astro +37 -0
- package/dist/src/components/carousel/CarouselPrevious.astro +37 -0
- package/dist/src/components/carousel/carousel-script.ts +191 -0
- package/dist/src/components/carousel/index.ts +32 -0
- package/dist/src/components/checkbox/Checkbox.astro +128 -0
- package/dist/src/components/checkbox/index.ts +7 -0
- package/dist/src/components/collapsible/Collapsible.astro +161 -0
- package/dist/src/components/collapsible/CollapsibleContent.astro +22 -0
- package/dist/src/components/collapsible/CollapsibleTrigger.astro +44 -0
- package/dist/src/components/collapsible/index.ts +13 -0
- package/dist/src/components/dialog/Dialog.astro +389 -0
- package/dist/src/components/dialog/DialogClose.astro +35 -0
- package/dist/src/components/dialog/DialogContent.astro +78 -0
- package/dist/src/components/dialog/DialogDescription.astro +14 -0
- package/dist/src/components/dialog/DialogFooter.astro +14 -0
- package/dist/src/components/dialog/DialogHeader.astro +14 -0
- package/dist/src/components/dialog/DialogTitle.astro +22 -0
- package/dist/src/components/dialog/DialogTrigger.astro +47 -0
- package/dist/src/components/dialog/index.ts +45 -0
- package/dist/src/components/dropdown/Dropdown.astro +377 -0
- package/dist/src/components/dropdown/DropdownContent.astro +81 -0
- package/dist/src/components/dropdown/DropdownItem.astro +48 -0
- package/dist/src/components/dropdown/DropdownLabel.astro +29 -0
- package/dist/src/components/dropdown/DropdownSeparator.astro +21 -0
- package/dist/src/components/dropdown/DropdownTrigger.astro +52 -0
- package/dist/src/components/dropdown/index.ts +33 -0
- package/dist/src/components/dropzone/Dropzone.astro +236 -0
- package/dist/src/components/dropzone/DropzoneFilesList.astro +26 -0
- package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +10 -0
- package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +10 -0
- package/dist/src/components/dropzone/index.ts +24 -0
- package/dist/src/components/image/Image.astro +24 -0
- package/dist/src/components/image/index.ts +9 -0
- package/dist/src/components/input/Input.astro +25 -0
- package/dist/src/components/input/index.ts +7 -0
- package/dist/src/components/input-otp/InputOtp.astro +352 -0
- package/dist/src/components/input-otp/InputOtpGroup.astro +16 -0
- package/dist/src/components/input-otp/InputOtpSeparator.astro +25 -0
- package/dist/src/components/input-otp/InputOtpSlot.astro +48 -0
- package/dist/src/components/input-otp/InputOtpTypes.ts +6 -0
- package/dist/src/components/input-otp/index.ts +33 -0
- package/dist/src/components/item/Item.astro +52 -0
- package/dist/src/components/item/ItemActions.astro +16 -0
- package/dist/src/components/item/ItemContent.astro +16 -0
- package/dist/src/components/item/ItemDescription.astro +19 -0
- package/dist/src/components/item/ItemFooter.astro +16 -0
- package/dist/src/components/item/ItemGroup.astro +16 -0
- package/dist/src/components/item/ItemHeader.astro +16 -0
- package/dist/src/components/item/ItemMedia.astro +40 -0
- package/dist/src/components/item/ItemSeparator.astro +21 -0
- package/dist/src/components/item/ItemTitle.astro +16 -0
- package/dist/src/components/item/index.ts +50 -0
- package/dist/src/components/kbd/Kbd.astro +21 -0
- package/dist/src/components/kbd/KbdGroup.astro +16 -0
- package/dist/src/components/kbd/index.ts +11 -0
- package/dist/src/components/label/Label.astro +22 -0
- package/dist/src/components/label/index.ts +7 -0
- package/dist/src/components/pagination/Pagination.astro +20 -0
- package/dist/src/components/pagination/PaginationContent.astro +16 -0
- package/dist/src/components/pagination/PaginationEllipsis.astro +35 -0
- package/dist/src/components/pagination/PaginationItem.astro +16 -0
- package/dist/src/components/pagination/PaginationLink.astro +24 -0
- package/dist/src/components/pagination/PaginationNext.astro +30 -0
- package/dist/src/components/pagination/PaginationPrevious.astro +30 -0
- package/dist/src/components/pagination/index.ts +38 -0
- package/dist/src/components/progress/Progress.astro +155 -0
- package/dist/src/components/progress/index.ts +10 -0
- package/dist/src/components/prose/Prose.astro +617 -0
- package/dist/src/components/prose/index.ts +9 -0
- package/dist/src/components/radio-group/RadioGroup.astro +162 -0
- package/dist/src/components/radio-group/RadioGroupItem.astro +129 -0
- package/dist/src/components/radio-group/RadioGroupTypes.ts +6 -0
- package/dist/src/components/radio-group/index.ts +23 -0
- package/dist/src/components/select/Select.astro +752 -0
- package/dist/src/components/select/SelectContent.astro +94 -0
- package/dist/src/components/select/SelectGroup.astro +9 -0
- package/dist/src/components/select/SelectItem.astro +51 -0
- package/dist/src/components/select/SelectLabel.astro +14 -0
- package/dist/src/components/select/SelectSearch.astro +49 -0
- package/dist/src/components/select/SelectSeparator.astro +12 -0
- package/dist/src/components/select/SelectTrigger.astro +54 -0
- package/dist/src/components/select/SelectTypes.ts +13 -0
- package/dist/src/components/select/SelectValue.astro +19 -0
- package/dist/src/components/select/index.ts +49 -0
- package/dist/src/components/separator/Separator.astro +36 -0
- package/dist/src/components/separator/index.ts +7 -0
- package/dist/src/components/sheet/Sheet.astro +13 -0
- package/dist/src/components/sheet/SheetClose.astro +13 -0
- package/dist/src/components/sheet/SheetContent.astro +92 -0
- package/dist/src/components/sheet/SheetDescription.astro +16 -0
- package/dist/src/components/sheet/SheetFooter.astro +16 -0
- package/dist/src/components/sheet/SheetHeader.astro +16 -0
- package/dist/src/components/sheet/SheetTitle.astro +16 -0
- package/dist/src/components/sheet/SheetTrigger.astro +13 -0
- package/dist/src/components/sheet/index.ts +41 -0
- package/dist/src/components/sidebar/Sidebar.astro +213 -0
- package/dist/src/components/sidebar/SidebarContent.astro +24 -0
- package/dist/src/components/sidebar/SidebarFooter.astro +21 -0
- package/dist/src/components/sidebar/SidebarGroup.astro +21 -0
- package/dist/src/components/sidebar/SidebarGroupContent.astro +21 -0
- package/dist/src/components/sidebar/SidebarGroupLabel.astro +52 -0
- package/dist/src/components/sidebar/SidebarHeader.astro +21 -0
- package/dist/src/components/sidebar/SidebarInput.astro +22 -0
- package/dist/src/components/sidebar/SidebarInset.astro +21 -0
- package/dist/src/components/sidebar/SidebarMenu.astro +21 -0
- package/dist/src/components/sidebar/SidebarMenuAction.astro +59 -0
- package/dist/src/components/sidebar/SidebarMenuBadge.astro +30 -0
- package/dist/src/components/sidebar/SidebarMenuButton.astro +129 -0
- package/dist/src/components/sidebar/SidebarMenuItem.astro +21 -0
- package/dist/src/components/sidebar/SidebarMenuSkeleton.astro +40 -0
- package/dist/src/components/sidebar/SidebarMenuSub.astro +24 -0
- package/dist/src/components/sidebar/SidebarMenuSubButton.astro +49 -0
- package/dist/src/components/sidebar/SidebarMenuSubItem.astro +16 -0
- package/dist/src/components/sidebar/SidebarProvider.astro +213 -0
- package/dist/src/components/sidebar/SidebarRail.astro +71 -0
- package/dist/src/components/sidebar/SidebarSeparator.astro +22 -0
- package/dist/src/components/sidebar/SidebarTrigger.astro +66 -0
- package/dist/src/components/sidebar/index.ts +103 -0
- package/dist/src/components/skeleton/Skeleton.astro +14 -0
- package/dist/src/components/skeleton/index.ts +9 -0
- package/dist/src/components/slider/Slider.astro +411 -0
- package/dist/src/components/slider/index.ts +9 -0
- package/dist/src/components/spinner/Spinner.astro +21 -0
- package/dist/src/components/spinner/index.ts +7 -0
- package/dist/src/components/switch/Switch.astro +192 -0
- package/dist/src/components/switch/SwitchTypes.ts +6 -0
- package/dist/src/components/switch/index.ts +12 -0
- package/dist/src/components/table/Table.astro +18 -0
- package/dist/src/components/table/TableBody.astro +16 -0
- package/dist/src/components/table/TableCaption.astro +16 -0
- package/dist/src/components/table/TableCell.astro +16 -0
- package/dist/src/components/table/TableFoot.astro +16 -0
- package/dist/src/components/table/TableHead.astro +16 -0
- package/dist/src/components/table/TableHeader.astro +16 -0
- package/dist/src/components/table/TableRow.astro +16 -0
- package/dist/src/components/table/index.ts +42 -0
- package/dist/src/components/tabs/Tabs.astro +271 -0
- package/dist/src/components/tabs/TabsContent.astro +28 -0
- package/dist/src/components/tabs/TabsList.astro +22 -0
- package/dist/src/components/tabs/TabsTrigger.astro +34 -0
- package/dist/src/components/tabs/index.ts +20 -0
- package/dist/src/components/textarea/Textarea.astro +29 -0
- package/dist/src/components/textarea/index.ts +9 -0
- package/dist/src/components/theme-toggle/ThemeToggle.astro +208 -0
- package/dist/src/components/theme-toggle/index.ts +7 -0
- package/dist/src/components/toast/ToastDescription.astro +21 -0
- package/dist/src/components/toast/ToastItem.astro +54 -0
- package/dist/src/components/toast/ToastTemplate.astro +25 -0
- package/dist/src/components/toast/ToastTitle.astro +57 -0
- package/dist/src/components/toast/Toaster.astro +982 -0
- package/dist/src/components/toast/index.ts +29 -0
- package/dist/src/components/toast/toast-manager.ts +216 -0
- package/dist/src/components/toggle/Toggle.astro +174 -0
- package/dist/src/components/toggle/ToggleTypes.ts +14 -0
- package/dist/src/components/toggle/index.ts +8 -0
- package/dist/src/components/tooltip/Tooltip.astro +282 -0
- package/dist/src/components/tooltip/TooltipContent.astro +89 -0
- package/dist/src/components/tooltip/TooltipTrigger.astro +10 -0
- package/dist/src/components/tooltip/index.ts +16 -0
- package/dist/src/components/video/Video.astro +120 -0
- package/dist/src/components/video/index.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { Image } from "astro:assets";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
|
|
6
|
+
export const avatarImage = tv({ base: "relative z-1 h-full w-full object-cover" });
|
|
7
|
+
|
|
8
|
+
type BaseProps = { alt: string; class?: string };
|
|
9
|
+
|
|
10
|
+
type WithSrc = BaseProps & { src: string; image?: never };
|
|
11
|
+
|
|
12
|
+
type WithImage = BaseProps & { src?: never; image: ImageMetadata };
|
|
13
|
+
|
|
14
|
+
type Props = HTMLAttributes<"img"> & (WithSrc | WithImage);
|
|
15
|
+
|
|
16
|
+
const { src, image, alt, class: className, width, height, ...rest } = Astro.props;
|
|
17
|
+
|
|
18
|
+
if (!src && !image) {
|
|
19
|
+
throw new Error("Either 'src' or 'image' is required for an avatar image.");
|
|
20
|
+
}
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
{
|
|
24
|
+
src && (
|
|
25
|
+
// eslint-disable-next-line astro/jsx-a11y/no-noninteractive-element-interactions
|
|
26
|
+
<img
|
|
27
|
+
src={src}
|
|
28
|
+
alt={alt}
|
|
29
|
+
class={avatarImage({ class: className })}
|
|
30
|
+
width={64}
|
|
31
|
+
height={64}
|
|
32
|
+
onerror="this.style.display='none'"
|
|
33
|
+
data-slot="avatar-image"
|
|
34
|
+
{...rest}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
image && (
|
|
40
|
+
<Image
|
|
41
|
+
src={image}
|
|
42
|
+
alt={alt}
|
|
43
|
+
class={avatarImage({ class: className })}
|
|
44
|
+
width={64}
|
|
45
|
+
data-slot="avatar-image"
|
|
46
|
+
{...rest}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Avatar, { avatar } from "./Avatar.astro";
|
|
2
|
+
import AvatarFallback, { avatarFallback } from "./AvatarFallback.astro";
|
|
3
|
+
import AvatarImage, { avatarImage } from "./AvatarImage.astro";
|
|
4
|
+
|
|
5
|
+
const AvatarVariants = { avatar, avatarFallback, avatarImage };
|
|
6
|
+
|
|
7
|
+
export { Avatar, AvatarFallback, AvatarImage, AvatarVariants };
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
Root: Avatar,
|
|
11
|
+
Image: AvatarImage,
|
|
12
|
+
Fallback: AvatarFallback,
|
|
13
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv, type VariantProps } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
interface Props
|
|
6
|
+
extends HTMLAttributes<"div">, Omit<HTMLAttributes<"a">, "type">, VariantProps<typeof badge> {}
|
|
7
|
+
|
|
8
|
+
export const badge = tv({
|
|
9
|
+
base: [
|
|
10
|
+
"starwind-badge inline-flex items-center gap-1.5 rounded-full font-medium whitespace-nowrap",
|
|
11
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
12
|
+
"transition-all outline-none focus-visible:ring-3",
|
|
13
|
+
"aria-invalid:border-error aria-invalid:focus-visible:ring-error/40",
|
|
14
|
+
],
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "bg-foreground text-background focus-visible:ring-outline/50",
|
|
18
|
+
primary: "bg-primary text-primary-foreground focus-visible:ring-primary/50",
|
|
19
|
+
secondary: "bg-secondary text-secondary-foreground focus-visible:ring-secondary/50",
|
|
20
|
+
outline: "border-border focus-visible:border-outline focus-visible:ring-outline/50 border",
|
|
21
|
+
ghost: "bg-foreground/10 text-foreground focus-visible:ring-outline/50",
|
|
22
|
+
info: "bg-info text-info-foreground focus-visible:ring-info/50",
|
|
23
|
+
success: "bg-success text-success-foreground focus-visible:ring-success/50",
|
|
24
|
+
warning: "bg-warning text-warning-foreground focus-visible:ring-warning/50",
|
|
25
|
+
error: "bg-error text-error-foreground focus-visible:ring-error/50",
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
sm: "px-2.5 py-0.5 text-xs [&_svg:not([class*='size-'])]:size-3",
|
|
29
|
+
md: "px-3 py-0.5 text-sm [&_svg:not([class*='size-'])]:size-4",
|
|
30
|
+
lg: "px-4 py-1 text-base [&_svg:not([class*='size-'])]:size-4.5",
|
|
31
|
+
},
|
|
32
|
+
isLink: { true: "cursor-pointer", false: "" },
|
|
33
|
+
},
|
|
34
|
+
compoundVariants: [
|
|
35
|
+
{ isLink: true, variant: "default", className: "hover:bg-foreground/80" },
|
|
36
|
+
{ isLink: true, variant: "primary", className: "hover:bg-primary/80" },
|
|
37
|
+
{ isLink: true, variant: "secondary", className: "hover:bg-secondary/80" },
|
|
38
|
+
{ isLink: true, variant: "outline", className: "hover:border-border/80" },
|
|
39
|
+
{ isLink: true, variant: "ghost", className: "hover:bg-foreground/7" },
|
|
40
|
+
{ isLink: true, variant: "info", className: "hover:bg-info/80" },
|
|
41
|
+
{ isLink: true, variant: "success", className: "hover:bg-success/80" },
|
|
42
|
+
{ isLink: true, variant: "warning", className: "hover:bg-warning/80" },
|
|
43
|
+
{ isLink: true, variant: "error", className: "hover:bg-error/80" },
|
|
44
|
+
],
|
|
45
|
+
defaultVariants: { variant: "default", size: "md", isLink: false },
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const { variant, size, class: className, ...rest } = Astro.props;
|
|
49
|
+
const isLink = Astro.props.href ? true : false;
|
|
50
|
+
const Tag = Astro.props.href ? "a" : "div";
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<Tag class={badge({ variant, size, isLink, class: className })} data-slot="badge" {...rest}>
|
|
54
|
+
<slot />
|
|
55
|
+
</Tag>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
|
|
4
|
+
type Props = HTMLAttributes<"nav">;
|
|
5
|
+
|
|
6
|
+
const { class: className, ...rest } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<nav aria-label="breadcrumb" class={className} data-slot="breadcrumb" {...rest}>
|
|
10
|
+
<slot />
|
|
11
|
+
</nav>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Dots from "@tabler/icons/outline/dots.svg";
|
|
3
|
+
import type { HTMLAttributes } from "astro/types";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"span">;
|
|
7
|
+
|
|
8
|
+
export const breadcrumbEllipsis = tv({
|
|
9
|
+
base: "flex size-6 items-center justify-center [&>svg]:size-4",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const { class: className, ...rest } = Astro.props;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<span
|
|
16
|
+
role="presentation"
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
class={breadcrumbEllipsis({ class: className })}
|
|
19
|
+
data-slot="breadcrumb-ellipsis"
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
22
|
+
<slot name="icon">
|
|
23
|
+
<Dots />
|
|
24
|
+
</slot>
|
|
25
|
+
<slot>
|
|
26
|
+
<span class="sr-only">More</span>
|
|
27
|
+
</slot>
|
|
28
|
+
</span>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"li">;
|
|
6
|
+
|
|
7
|
+
export const breadcrumbItem = tv({ base: "inline-flex items-center gap-1.5" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<li class={breadcrumbItem({ class: className })} data-slot="breadcrumb-item" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</li>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"a"> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const breadcrumbLink = tv({ base: "hover:text-foreground transition-colors" });
|
|
10
|
+
|
|
11
|
+
const { class: className, asChild = false, ...rest } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
asChild ? (
|
|
16
|
+
<slot />
|
|
17
|
+
) : (
|
|
18
|
+
<a class={breadcrumbLink({ class: className })} data-slot="breadcrumb-link" {...rest}>
|
|
19
|
+
<slot />
|
|
20
|
+
</a>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"ol">;
|
|
6
|
+
|
|
7
|
+
export const breadcrumbList = tv({
|
|
8
|
+
base: "text-muted-foreground flex flex-wrap items-center gap-1.5 break-words sm:gap-2",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const { class: className, ...rest } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<ol class={breadcrumbList({ class: className })} data-slot="breadcrumb-list" {...rest}>
|
|
15
|
+
<slot />
|
|
16
|
+
</ol>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"span">;
|
|
6
|
+
|
|
7
|
+
export const breadcrumbPage = tv({ base: "text-foreground font-normal" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<span
|
|
13
|
+
role="link"
|
|
14
|
+
aria-disabled="true"
|
|
15
|
+
aria-current="page"
|
|
16
|
+
class={breadcrumbPage({ class: className })}
|
|
17
|
+
data-slot="breadcrumb-page"
|
|
18
|
+
{...rest}
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</span>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import ChevronRight from "@tabler/icons/outline/chevron-right.svg";
|
|
3
|
+
import type { HTMLAttributes } from "astro/types";
|
|
4
|
+
import { tv } from "tailwind-variants";
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"li">;
|
|
7
|
+
|
|
8
|
+
export const breadcrumbSeparator = tv({ base: "[&>svg]:size-4" });
|
|
9
|
+
|
|
10
|
+
const { class: className, ...rest } = Astro.props;
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<li
|
|
14
|
+
role="presentation"
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
class={breadcrumbSeparator({ class: className })}
|
|
17
|
+
data-slot="breadcrumb-separator"
|
|
18
|
+
{...rest}
|
|
19
|
+
>
|
|
20
|
+
<slot>
|
|
21
|
+
<ChevronRight />
|
|
22
|
+
</slot>
|
|
23
|
+
</li>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Breadcrumb from "./Breadcrumb.astro";
|
|
2
|
+
import BreadcrumbEllipsis, { breadcrumbEllipsis } from "./BreadcrumbEllipsis.astro";
|
|
3
|
+
import BreadcrumbItem, { breadcrumbItem } from "./BreadcrumbItem.astro";
|
|
4
|
+
import BreadcrumbLink, { breadcrumbLink } from "./BreadcrumbLink.astro";
|
|
5
|
+
import BreadcrumbList, { breadcrumbList } from "./BreadcrumbList.astro";
|
|
6
|
+
import BreadcrumbPage, { breadcrumbPage } from "./BreadcrumbPage.astro";
|
|
7
|
+
import BreadcrumbSeparator, { breadcrumbSeparator } from "./BreadcrumbSeparator.astro";
|
|
8
|
+
|
|
9
|
+
const BreadcrumbVariants = {
|
|
10
|
+
breadcrumbEllipsis,
|
|
11
|
+
breadcrumbItem,
|
|
12
|
+
breadcrumbLink,
|
|
13
|
+
breadcrumbList,
|
|
14
|
+
breadcrumbPage,
|
|
15
|
+
breadcrumbSeparator,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
Breadcrumb,
|
|
20
|
+
BreadcrumbEllipsis,
|
|
21
|
+
BreadcrumbItem,
|
|
22
|
+
BreadcrumbLink,
|
|
23
|
+
BreadcrumbList,
|
|
24
|
+
BreadcrumbPage,
|
|
25
|
+
BreadcrumbSeparator,
|
|
26
|
+
BreadcrumbVariants,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
Root: Breadcrumb,
|
|
31
|
+
List: BreadcrumbList,
|
|
32
|
+
Ellipsis: BreadcrumbEllipsis,
|
|
33
|
+
Item: BreadcrumbItem,
|
|
34
|
+
Link: BreadcrumbLink,
|
|
35
|
+
Separator: BreadcrumbSeparator,
|
|
36
|
+
Page: BreadcrumbPage,
|
|
37
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv, type VariantProps } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
interface Props
|
|
6
|
+
extends
|
|
7
|
+
HTMLAttributes<"button">,
|
|
8
|
+
Omit<HTMLAttributes<"a">, "type">,
|
|
9
|
+
VariantProps<typeof button> {}
|
|
10
|
+
|
|
11
|
+
const { variant, size, class: className, ...rest } = Astro.props;
|
|
12
|
+
|
|
13
|
+
export const button = tv({
|
|
14
|
+
base: [
|
|
15
|
+
"inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap",
|
|
16
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
17
|
+
"transition-all outline-none focus-visible:ring-3",
|
|
18
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
19
|
+
"aria-invalid:border-error aria-invalid:focus-visible:ring-error/40",
|
|
20
|
+
],
|
|
21
|
+
variants: {
|
|
22
|
+
variant: {
|
|
23
|
+
default: "bg-foreground text-background hover:bg-foreground/90 focus-visible:ring-outline/50",
|
|
24
|
+
primary:
|
|
25
|
+
"bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50",
|
|
26
|
+
secondary:
|
|
27
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/90 focus-visible:ring-secondary/50",
|
|
28
|
+
outline:
|
|
29
|
+
"dark:border-input focus-visible:ring-outline/50 bg-background dark:bg-input/30 focus-visible:border-outline hover:bg-muted dark:hover:bg-input/50 hover:text-foreground border shadow-xs",
|
|
30
|
+
ghost: "hover:bg-muted hover:text-foreground focus-visible:ring-outline/50",
|
|
31
|
+
info: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50",
|
|
32
|
+
success:
|
|
33
|
+
"bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/50",
|
|
34
|
+
warning:
|
|
35
|
+
"bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning/50",
|
|
36
|
+
error: "bg-error text-error-foreground hover:bg-error/90 focus-visible:ring-error/50",
|
|
37
|
+
},
|
|
38
|
+
size: {
|
|
39
|
+
sm: "h-9 px-4 text-sm has-[>svg]:px-3 [&_svg:not([class*='size-'])]:size-3.5",
|
|
40
|
+
md: "h-11 px-5 text-base has-[>svg]:px-4 [&_svg:not([class*='size-'])]:size-4.5",
|
|
41
|
+
lg: "h-12 px-8 text-lg has-[>svg]:px-6 [&_svg:not([class*='size-'])]:size-5",
|
|
42
|
+
"icon-sm": "size-9 [&_svg:not([class*='size-'])]:size-3.5",
|
|
43
|
+
icon: "size-11 [&_svg:not([class*='size-'])]:size-4.5",
|
|
44
|
+
"icon-lg": "size-12 [&_svg:not([class*='size-'])]:size-5",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: { variant: "default", size: "md" },
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const Tag = Astro.props.href ? "a" : "button";
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
<Tag class={button({ variant, size, class: className })} data-slot="button" {...rest}>
|
|
54
|
+
<slot />
|
|
55
|
+
</Tag>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div"> & {
|
|
6
|
+
/**
|
|
7
|
+
* The orientation of the button group.
|
|
8
|
+
* @default "horizontal"
|
|
9
|
+
*/
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const buttonGroup = tv({
|
|
14
|
+
base: [
|
|
15
|
+
"flex w-fit items-stretch",
|
|
16
|
+
"[&>*]:focus-visible:relative [&>*]:focus-visible:z-10",
|
|
17
|
+
"has-[>[data-slot=button-group]]:gap-2 [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
18
|
+
],
|
|
19
|
+
variants: {
|
|
20
|
+
orientation: {
|
|
21
|
+
horizontal: [
|
|
22
|
+
"[&>*:not(:first-child)]:rounded-l-none",
|
|
23
|
+
"[&>*:not(:first-child)]:border-l-0",
|
|
24
|
+
"[&>*:not(:last-child):not(:has(+_script:last-child))]:rounded-r-none",
|
|
25
|
+
"[&>*:not(:first-child)_>_[data-as-child]_>_*]:rounded-l-none",
|
|
26
|
+
"[&>*:not(:first-child)_>_[data-as-child]_>_*]:border-l-0",
|
|
27
|
+
"[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-as-child]_>_*]:rounded-r-none",
|
|
28
|
+
"[&>*:not(:first-child)_>_[data-slot=select-trigger]]:rounded-l-none",
|
|
29
|
+
"[&>*:not(:first-child)_>_[data-slot=select-trigger]]:border-l-0",
|
|
30
|
+
"[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-slot=select-trigger]]:rounded-r-none",
|
|
31
|
+
],
|
|
32
|
+
vertical: [
|
|
33
|
+
"flex-col",
|
|
34
|
+
"[&>*:not(:first-child)]:rounded-t-none",
|
|
35
|
+
"[&>*:not(:first-child)]:border-t-0",
|
|
36
|
+
"[&>*:not(:last-child):not(:has(+_script:last-child))]:rounded-b-none",
|
|
37
|
+
"[&>*:not(:first-child)_>_[data-as-child]_>_*]:rounded-t-none",
|
|
38
|
+
"[&>*:not(:first-child)_>_[data-as-child]_>_*]:border-t-0",
|
|
39
|
+
"[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-as-child]_>_*]:rounded-b-none",
|
|
40
|
+
"[&>*:not(:first-child)_>_[data-slot=select-trigger]]:rounded-t-none",
|
|
41
|
+
"[&>*:not(:first-child)_>_[data-slot=select-trigger]]:border-t-0",
|
|
42
|
+
"[&>*:not(:last-child):not(:has(+_script:last-child))_>_[data-slot=select-trigger]]:rounded-b-none",
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
defaultVariants: {
|
|
47
|
+
orientation: "horizontal",
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const { class: className, orientation = "horizontal", ...rest } = Astro.props;
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
<div
|
|
55
|
+
role="group"
|
|
56
|
+
data-slot="button-group"
|
|
57
|
+
data-orientation={orientation}
|
|
58
|
+
class={buttonGroup({ orientation, class: className })}
|
|
59
|
+
{...rest}
|
|
60
|
+
>
|
|
61
|
+
<slot />
|
|
62
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
import { Separator } from "@/components/starwind/separator";
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<"div"> & {
|
|
8
|
+
/**
|
|
9
|
+
* The orientation of the separator.
|
|
10
|
+
* @default "vertical"
|
|
11
|
+
*/
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const buttonGroupSeparator = tv({
|
|
16
|
+
base: ["bg-input relative m-0! self-stretch data-[orientation=vertical]:h-auto"],
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const { class: className, orientation = "vertical", ...rest } = Astro.props;
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<Separator
|
|
23
|
+
data-slot="button-group-separator"
|
|
24
|
+
orientation={orientation}
|
|
25
|
+
class={buttonGroupSeparator({ class: className })}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const buttonGroupText = tv({
|
|
8
|
+
base: [
|
|
9
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs",
|
|
10
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
11
|
+
],
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const { class: className, ...rest } = Astro.props;
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<div class:list={[buttonGroupText(), className]} data-slot="button-group-text" {...rest}>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ButtonGroup, { buttonGroup } from "./ButtonGroup.astro";
|
|
2
|
+
import ButtonGroupSeparator, { buttonGroupSeparator } from "./ButtonGroupSeparator.astro";
|
|
3
|
+
import ButtonGroupText, { buttonGroupText } from "./ButtonGroupText.astro";
|
|
4
|
+
|
|
5
|
+
const ButtonGroupVariants = {
|
|
6
|
+
buttonGroup,
|
|
7
|
+
buttonGroupSeparator,
|
|
8
|
+
buttonGroupText,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, ButtonGroupVariants };
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
Root: ButtonGroup,
|
|
15
|
+
Separator: ButtonGroupSeparator,
|
|
16
|
+
Text: ButtonGroupText,
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const card = tv({ base: "bg-card text-card-foreground rounded-2xl border shadow-sm" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={card({ class: className })} data-slot="card" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const cardContent = tv({ base: "p-8 pt-0" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={cardContent({ class: className })} data-slot="card-content" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const cardDescription = tv({ base: "text-muted-foreground text-base" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={cardDescription({ class: className })} data-slot="card-description" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const cardFooter = tv({ base: "flex items-center p-8 pt-0" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={cardFooter({ class: className })} data-slot="card-footer" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const cardHeader = tv({ base: "flex flex-col space-y-2 p-8" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={cardHeader({ class: className })} data-slot="card-header" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const cardTitle = tv({ base: "text-xl leading-none font-semibold tracking-tight" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={cardTitle({ class: className })} data-slot="card-title" {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Card, { card } from "./Card.astro";
|
|
2
|
+
import CardContent, { cardContent } from "./CardContent.astro";
|
|
3
|
+
import CardDescription, { cardDescription } from "./CardDescription.astro";
|
|
4
|
+
import CardFooter, { cardFooter } from "./CardFooter.astro";
|
|
5
|
+
import CardHeader, { cardHeader } from "./CardHeader.astro";
|
|
6
|
+
import CardTitle, { cardTitle } from "./CardTitle.astro";
|
|
7
|
+
|
|
8
|
+
const CardVariants = {
|
|
9
|
+
card,
|
|
10
|
+
cardContent,
|
|
11
|
+
cardDescription,
|
|
12
|
+
cardFooter,
|
|
13
|
+
cardHeader,
|
|
14
|
+
cardTitle,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardVariants };
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
Root: Card,
|
|
21
|
+
Header: CardHeader,
|
|
22
|
+
Footer: CardFooter,
|
|
23
|
+
Title: CardTitle,
|
|
24
|
+
Description: CardDescription,
|
|
25
|
+
Content: CardContent,
|
|
26
|
+
};
|