@starwind-ui/core 1.15.0 → 1.15.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/package.json +1 -1
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -108
- package/dist/index.js.map +0 -1
- package/dist/src/components/accordion/Accordion.astro +0 -254
- package/dist/src/components/accordion/AccordionContent.astro +0 -33
- package/dist/src/components/accordion/AccordionItem.astro +0 -27
- package/dist/src/components/accordion/AccordionTrigger.astro +0 -32
- package/dist/src/components/accordion/index.ts +0 -15
- package/dist/src/components/alert/Alert.astro +0 -31
- package/dist/src/components/alert/AlertDescription.astro +0 -14
- package/dist/src/components/alert/AlertTitle.astro +0 -16
- package/dist/src/components/alert/index.ts +0 -13
- package/dist/src/components/alert-dialog/AlertDialog.astro +0 -275
- package/dist/src/components/alert-dialog/AlertDialogAction.astro +0 -44
- package/dist/src/components/alert-dialog/AlertDialogCancel.astro +0 -45
- package/dist/src/components/alert-dialog/AlertDialogContent.astro +0 -52
- package/dist/src/components/alert-dialog/AlertDialogDescription.astro +0 -18
- package/dist/src/components/alert-dialog/AlertDialogFooter.astro +0 -16
- package/dist/src/components/alert-dialog/AlertDialogHeader.astro +0 -14
- package/dist/src/components/alert-dialog/AlertDialogTitle.astro +0 -20
- package/dist/src/components/alert-dialog/AlertDialogTrigger.astro +0 -47
- package/dist/src/components/alert-dialog/index.ts +0 -46
- package/dist/src/components/aspect-ratio/AspectRatio.astro +0 -32
- package/dist/src/components/aspect-ratio/index.ts +0 -7
- package/dist/src/components/avatar/Avatar.astro +0 -29
- package/dist/src/components/avatar/AvatarFallback.astro +0 -18
- package/dist/src/components/avatar/AvatarImage.astro +0 -49
- package/dist/src/components/avatar/index.ts +0 -13
- package/dist/src/components/badge/Badge.astro +0 -55
- package/dist/src/components/badge/index.ts +0 -7
- package/dist/src/components/breadcrumb/Breadcrumb.astro +0 -11
- package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +0 -28
- package/dist/src/components/breadcrumb/BreadcrumbItem.astro +0 -14
- package/dist/src/components/breadcrumb/BreadcrumbLink.astro +0 -22
- package/dist/src/components/breadcrumb/BreadcrumbList.astro +0 -16
- package/dist/src/components/breadcrumb/BreadcrumbPage.astro +0 -21
- package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +0 -23
- package/dist/src/components/breadcrumb/index.ts +0 -37
- package/dist/src/components/button/Button.astro +0 -55
- package/dist/src/components/button/index.ts +0 -7
- package/dist/src/components/button-group/ButtonGroup.astro +0 -62
- package/dist/src/components/button-group/ButtonGroupSeparator.astro +0 -27
- package/dist/src/components/button-group/ButtonGroupText.astro +0 -19
- package/dist/src/components/button-group/index.ts +0 -17
- package/dist/src/components/card/Card.astro +0 -14
- package/dist/src/components/card/CardContent.astro +0 -14
- package/dist/src/components/card/CardDescription.astro +0 -14
- package/dist/src/components/card/CardFooter.astro +0 -14
- package/dist/src/components/card/CardHeader.astro +0 -14
- package/dist/src/components/card/CardTitle.astro +0 -14
- package/dist/src/components/card/index.ts +0 -26
- package/dist/src/components/carousel/Carousel.astro +0 -55
- package/dist/src/components/carousel/CarouselContent.astro +0 -26
- package/dist/src/components/carousel/CarouselItem.astro +0 -26
- package/dist/src/components/carousel/CarouselNext.astro +0 -37
- package/dist/src/components/carousel/CarouselPrevious.astro +0 -37
- package/dist/src/components/carousel/carousel-script.ts +0 -191
- package/dist/src/components/carousel/index.ts +0 -32
- package/dist/src/components/checkbox/Checkbox.astro +0 -128
- package/dist/src/components/checkbox/index.ts +0 -7
- package/dist/src/components/collapsible/Collapsible.astro +0 -161
- package/dist/src/components/collapsible/CollapsibleContent.astro +0 -22
- package/dist/src/components/collapsible/CollapsibleTrigger.astro +0 -44
- package/dist/src/components/collapsible/index.ts +0 -13
- package/dist/src/components/dialog/Dialog.astro +0 -389
- package/dist/src/components/dialog/DialogClose.astro +0 -35
- package/dist/src/components/dialog/DialogContent.astro +0 -78
- package/dist/src/components/dialog/DialogDescription.astro +0 -14
- package/dist/src/components/dialog/DialogFooter.astro +0 -14
- package/dist/src/components/dialog/DialogHeader.astro +0 -14
- package/dist/src/components/dialog/DialogTitle.astro +0 -22
- package/dist/src/components/dialog/DialogTrigger.astro +0 -47
- package/dist/src/components/dialog/index.ts +0 -45
- package/dist/src/components/dropdown/Dropdown.astro +0 -377
- package/dist/src/components/dropdown/DropdownContent.astro +0 -81
- package/dist/src/components/dropdown/DropdownItem.astro +0 -48
- package/dist/src/components/dropdown/DropdownLabel.astro +0 -29
- package/dist/src/components/dropdown/DropdownSeparator.astro +0 -21
- package/dist/src/components/dropdown/DropdownTrigger.astro +0 -52
- package/dist/src/components/dropdown/index.ts +0 -33
- package/dist/src/components/dropzone/Dropzone.astro +0 -236
- package/dist/src/components/dropzone/DropzoneFilesList.astro +0 -26
- package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +0 -10
- package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +0 -10
- package/dist/src/components/dropzone/index.ts +0 -24
- package/dist/src/components/image/Image.astro +0 -24
- package/dist/src/components/image/index.ts +0 -9
- package/dist/src/components/input/Input.astro +0 -25
- package/dist/src/components/input/index.ts +0 -7
- package/dist/src/components/input-otp/InputOtp.astro +0 -319
- package/dist/src/components/input-otp/InputOtpGroup.astro +0 -16
- package/dist/src/components/input-otp/InputOtpSeparator.astro +0 -25
- package/dist/src/components/input-otp/InputOtpSlot.astro +0 -48
- package/dist/src/components/input-otp/InputOtpTypes.ts +0 -6
- package/dist/src/components/input-otp/index.ts +0 -33
- package/dist/src/components/item/Item.astro +0 -52
- package/dist/src/components/item/ItemActions.astro +0 -16
- package/dist/src/components/item/ItemContent.astro +0 -16
- package/dist/src/components/item/ItemDescription.astro +0 -19
- package/dist/src/components/item/ItemFooter.astro +0 -16
- package/dist/src/components/item/ItemGroup.astro +0 -16
- package/dist/src/components/item/ItemHeader.astro +0 -16
- package/dist/src/components/item/ItemMedia.astro +0 -40
- package/dist/src/components/item/ItemSeparator.astro +0 -21
- package/dist/src/components/item/ItemTitle.astro +0 -16
- package/dist/src/components/item/index.ts +0 -50
- package/dist/src/components/kbd/Kbd.astro +0 -21
- package/dist/src/components/kbd/KbdGroup.astro +0 -16
- package/dist/src/components/kbd/index.ts +0 -11
- package/dist/src/components/label/Label.astro +0 -22
- package/dist/src/components/label/index.ts +0 -7
- package/dist/src/components/pagination/Pagination.astro +0 -20
- package/dist/src/components/pagination/PaginationContent.astro +0 -16
- package/dist/src/components/pagination/PaginationEllipsis.astro +0 -35
- package/dist/src/components/pagination/PaginationItem.astro +0 -16
- package/dist/src/components/pagination/PaginationLink.astro +0 -24
- package/dist/src/components/pagination/PaginationNext.astro +0 -30
- package/dist/src/components/pagination/PaginationPrevious.astro +0 -30
- package/dist/src/components/pagination/index.ts +0 -38
- package/dist/src/components/progress/Progress.astro +0 -155
- package/dist/src/components/progress/index.ts +0 -10
- package/dist/src/components/prose/Prose.astro +0 -617
- package/dist/src/components/prose/index.ts +0 -9
- package/dist/src/components/radio-group/RadioGroup.astro +0 -162
- package/dist/src/components/radio-group/RadioGroupItem.astro +0 -129
- package/dist/src/components/radio-group/RadioGroupTypes.ts +0 -6
- package/dist/src/components/radio-group/index.ts +0 -23
- package/dist/src/components/select/Select.astro +0 -751
- package/dist/src/components/select/SelectContent.astro +0 -94
- package/dist/src/components/select/SelectGroup.astro +0 -9
- package/dist/src/components/select/SelectItem.astro +0 -51
- package/dist/src/components/select/SelectLabel.astro +0 -14
- package/dist/src/components/select/SelectSearch.astro +0 -49
- package/dist/src/components/select/SelectSeparator.astro +0 -12
- package/dist/src/components/select/SelectTrigger.astro +0 -54
- package/dist/src/components/select/SelectTypes.ts +0 -13
- package/dist/src/components/select/SelectValue.astro +0 -19
- package/dist/src/components/select/index.ts +0 -49
- package/dist/src/components/separator/Separator.astro +0 -36
- package/dist/src/components/separator/index.ts +0 -7
- package/dist/src/components/sheet/Sheet.astro +0 -13
- package/dist/src/components/sheet/SheetClose.astro +0 -13
- package/dist/src/components/sheet/SheetContent.astro +0 -92
- package/dist/src/components/sheet/SheetDescription.astro +0 -16
- package/dist/src/components/sheet/SheetFooter.astro +0 -16
- package/dist/src/components/sheet/SheetHeader.astro +0 -16
- package/dist/src/components/sheet/SheetTitle.astro +0 -16
- package/dist/src/components/sheet/SheetTrigger.astro +0 -13
- package/dist/src/components/sheet/index.ts +0 -41
- package/dist/src/components/sidebar/Sidebar.astro +0 -213
- package/dist/src/components/sidebar/SidebarContent.astro +0 -24
- package/dist/src/components/sidebar/SidebarFooter.astro +0 -21
- package/dist/src/components/sidebar/SidebarGroup.astro +0 -21
- package/dist/src/components/sidebar/SidebarGroupContent.astro +0 -21
- package/dist/src/components/sidebar/SidebarGroupLabel.astro +0 -52
- package/dist/src/components/sidebar/SidebarHeader.astro +0 -21
- package/dist/src/components/sidebar/SidebarInput.astro +0 -22
- package/dist/src/components/sidebar/SidebarInset.astro +0 -21
- package/dist/src/components/sidebar/SidebarMenu.astro +0 -21
- package/dist/src/components/sidebar/SidebarMenuAction.astro +0 -59
- package/dist/src/components/sidebar/SidebarMenuBadge.astro +0 -30
- package/dist/src/components/sidebar/SidebarMenuButton.astro +0 -129
- package/dist/src/components/sidebar/SidebarMenuItem.astro +0 -21
- package/dist/src/components/sidebar/SidebarMenuSkeleton.astro +0 -40
- package/dist/src/components/sidebar/SidebarMenuSub.astro +0 -24
- package/dist/src/components/sidebar/SidebarMenuSubButton.astro +0 -49
- package/dist/src/components/sidebar/SidebarMenuSubItem.astro +0 -16
- package/dist/src/components/sidebar/SidebarProvider.astro +0 -213
- package/dist/src/components/sidebar/SidebarRail.astro +0 -71
- package/dist/src/components/sidebar/SidebarSeparator.astro +0 -22
- package/dist/src/components/sidebar/SidebarTrigger.astro +0 -66
- package/dist/src/components/sidebar/index.ts +0 -103
- package/dist/src/components/skeleton/Skeleton.astro +0 -14
- package/dist/src/components/skeleton/index.ts +0 -9
- package/dist/src/components/slider/Slider.astro +0 -411
- package/dist/src/components/slider/index.ts +0 -9
- package/dist/src/components/spinner/Spinner.astro +0 -21
- package/dist/src/components/spinner/index.ts +0 -7
- package/dist/src/components/switch/Switch.astro +0 -192
- package/dist/src/components/switch/SwitchTypes.ts +0 -6
- package/dist/src/components/switch/index.ts +0 -12
- package/dist/src/components/table/Table.astro +0 -18
- package/dist/src/components/table/TableBody.astro +0 -16
- package/dist/src/components/table/TableCaption.astro +0 -16
- package/dist/src/components/table/TableCell.astro +0 -16
- package/dist/src/components/table/TableFoot.astro +0 -16
- package/dist/src/components/table/TableHead.astro +0 -16
- package/dist/src/components/table/TableHeader.astro +0 -16
- package/dist/src/components/table/TableRow.astro +0 -16
- package/dist/src/components/table/index.ts +0 -42
- package/dist/src/components/tabs/Tabs.astro +0 -271
- package/dist/src/components/tabs/TabsContent.astro +0 -28
- package/dist/src/components/tabs/TabsList.astro +0 -22
- package/dist/src/components/tabs/TabsTrigger.astro +0 -34
- package/dist/src/components/tabs/index.ts +0 -20
- package/dist/src/components/textarea/Textarea.astro +0 -29
- package/dist/src/components/textarea/index.ts +0 -9
- package/dist/src/components/theme-toggle/ThemeToggle.astro +0 -208
- package/dist/src/components/theme-toggle/index.ts +0 -7
- package/dist/src/components/toast/ToastDescription.astro +0 -21
- package/dist/src/components/toast/ToastItem.astro +0 -54
- package/dist/src/components/toast/ToastTemplate.astro +0 -25
- package/dist/src/components/toast/ToastTitle.astro +0 -57
- package/dist/src/components/toast/Toaster.astro +0 -982
- package/dist/src/components/toast/index.ts +0 -29
- package/dist/src/components/toast/toast-manager.ts +0 -216
- package/dist/src/components/toggle/Toggle.astro +0 -174
- package/dist/src/components/toggle/ToggleTypes.ts +0 -14
- package/dist/src/components/toggle/index.ts +0 -8
- package/dist/src/components/tooltip/Tooltip.astro +0 -282
- package/dist/src/components/tooltip/TooltipContent.astro +0 -89
- package/dist/src/components/tooltip/TooltipTrigger.astro +0 -10
- package/dist/src/components/tooltip/index.ts +0 -16
- package/dist/src/components/video/Video.astro +0 -120
- package/dist/src/components/video/index.ts +0 -9
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import Item, { item } from "./Item.astro";
|
|
2
|
-
import ItemActions, { itemActions } from "./ItemActions.astro";
|
|
3
|
-
import ItemContent, { itemContent } from "./ItemContent.astro";
|
|
4
|
-
import ItemDescription, { itemDescription } from "./ItemDescription.astro";
|
|
5
|
-
import ItemFooter, { itemFooter } from "./ItemFooter.astro";
|
|
6
|
-
import ItemGroup, { itemGroup } from "./ItemGroup.astro";
|
|
7
|
-
import ItemHeader, { itemHeader } from "./ItemHeader.astro";
|
|
8
|
-
import ItemMedia, { itemMedia } from "./ItemMedia.astro";
|
|
9
|
-
import ItemSeparator, { itemSeparator } from "./ItemSeparator.astro";
|
|
10
|
-
import ItemTitle, { itemTitle } from "./ItemTitle.astro";
|
|
11
|
-
|
|
12
|
-
const ItemVariants = {
|
|
13
|
-
item,
|
|
14
|
-
itemActions,
|
|
15
|
-
itemContent,
|
|
16
|
-
itemDescription,
|
|
17
|
-
itemFooter,
|
|
18
|
-
itemGroup,
|
|
19
|
-
itemHeader,
|
|
20
|
-
itemMedia,
|
|
21
|
-
itemSeparator,
|
|
22
|
-
itemTitle,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
Item,
|
|
27
|
-
ItemActions,
|
|
28
|
-
ItemContent,
|
|
29
|
-
ItemDescription,
|
|
30
|
-
ItemFooter,
|
|
31
|
-
ItemGroup,
|
|
32
|
-
ItemHeader,
|
|
33
|
-
ItemMedia,
|
|
34
|
-
ItemSeparator,
|
|
35
|
-
ItemTitle,
|
|
36
|
-
ItemVariants,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
Root: Item,
|
|
41
|
-
Actions: ItemActions,
|
|
42
|
-
Content: ItemContent,
|
|
43
|
-
Description: ItemDescription,
|
|
44
|
-
Footer: ItemFooter,
|
|
45
|
-
Group: ItemGroup,
|
|
46
|
-
Header: ItemHeader,
|
|
47
|
-
Media: ItemMedia,
|
|
48
|
-
Separator: ItemSeparator,
|
|
49
|
-
Title: ItemTitle,
|
|
50
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"kbd">;
|
|
6
|
-
|
|
7
|
-
export const kbd = tv({
|
|
8
|
-
base: [
|
|
9
|
-
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none",
|
|
10
|
-
"bg-muted text-muted-foreground",
|
|
11
|
-
"[&_svg:not([class*='size-'])]:size-3",
|
|
12
|
-
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
13
|
-
],
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const { class: className, ...rest } = Astro.props;
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
<kbd class={kbd({ class: className })} data-slot="kbd" {...rest}>
|
|
20
|
-
<slot />
|
|
21
|
-
</kbd>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"kbd">;
|
|
6
|
-
|
|
7
|
-
export const kbdGroup = tv({
|
|
8
|
-
base: "inline-flex items-center gap-1",
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const { class: className, ...rest } = Astro.props;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<kbd class={kbdGroup({ class: className })} data-slot="kbd-group" {...rest}>
|
|
15
|
-
<slot />
|
|
16
|
-
</kbd>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv, type VariantProps } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"label"> & VariantProps<typeof label>;
|
|
6
|
-
|
|
7
|
-
export const label = tv({
|
|
8
|
-
base: [
|
|
9
|
-
"text-foreground leading-none font-medium",
|
|
10
|
-
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70 has-[+:disabled]:cursor-not-allowed has-[+:disabled]:opacity-70",
|
|
11
|
-
],
|
|
12
|
-
variants: { size: { sm: "text-sm", md: "text-base", lg: "text-lg" } },
|
|
13
|
-
defaultVariants: { size: "md" },
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const { size, class: className, ...rest } = Astro.props;
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
{/* eslint-disable-next-line astro/jsx-a11y/label-has-associated-control */}
|
|
20
|
-
<label class={label({ size, class: className })} data-slot="label" {...rest}>
|
|
21
|
-
<slot />
|
|
22
|
-
</label>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"nav">;
|
|
6
|
-
|
|
7
|
-
export const pagination = tv({ base: "mx-auto flex w-full justify-center" });
|
|
8
|
-
|
|
9
|
-
const { class: className, ...rest } = Astro.props;
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
<nav
|
|
13
|
-
role="navigation"
|
|
14
|
-
aria-label="pagination"
|
|
15
|
-
class={pagination({ class: className })}
|
|
16
|
-
data-slot="pagination"
|
|
17
|
-
{...rest}
|
|
18
|
-
>
|
|
19
|
-
<slot />
|
|
20
|
-
</nav>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"ul"> & {
|
|
6
|
-
children: any;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const paginationContent = tv({ base: "flex flex-row items-center gap-1" });
|
|
10
|
-
|
|
11
|
-
const { class: className, ...rest } = Astro.props;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<ul class={paginationContent({ class: className })} data-slot="pagination-content" {...rest}>
|
|
15
|
-
<slot />
|
|
16
|
-
</ul>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import Dots from "@tabler/icons/outline/dots.svg";
|
|
3
|
-
import type { HTMLAttributes } from "astro/types";
|
|
4
|
-
import { tv, type VariantProps } from "tailwind-variants";
|
|
5
|
-
|
|
6
|
-
type Props = HTMLAttributes<"span"> & VariantProps<typeof paginationEllipsis>;
|
|
7
|
-
|
|
8
|
-
export const paginationEllipsis = tv({
|
|
9
|
-
base: "flex items-center justify-center",
|
|
10
|
-
variants: {
|
|
11
|
-
size: {
|
|
12
|
-
"icon-sm": "size-9",
|
|
13
|
-
icon: "size-11",
|
|
14
|
-
"icon-lg": "size-12",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
defaultVariants: { size: "icon" },
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const { class: className, size, ...rest } = Astro.props;
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
<span
|
|
24
|
-
aria-hidden
|
|
25
|
-
class={paginationEllipsis({ size, class: className })}
|
|
26
|
-
data-slot="pagination-ellipsis"
|
|
27
|
-
{...rest}
|
|
28
|
-
>
|
|
29
|
-
<slot name="icon">
|
|
30
|
-
<Dots class="size-4" />
|
|
31
|
-
</slot>
|
|
32
|
-
<slot>
|
|
33
|
-
<span class="sr-only">More pages</span>
|
|
34
|
-
</slot>
|
|
35
|
-
</span>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"li"> & {
|
|
6
|
-
children: any;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const paginationItem = tv({ base: "" });
|
|
10
|
-
|
|
11
|
-
const { class: className, ...rest } = Astro.props;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<li class={paginationItem({ class: className })} data-slot="pagination-item" {...rest}>
|
|
15
|
-
<slot />
|
|
16
|
-
</li>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import type { VariantProps } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
import { ButtonVariants } from "@/components/starwind/button";
|
|
6
|
-
|
|
7
|
-
type Props = HTMLAttributes<"a"> &
|
|
8
|
-
Omit<VariantProps<typeof ButtonVariants.button>, "variant"> & {
|
|
9
|
-
isActive?: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const paginationLink = ButtonVariants.button;
|
|
13
|
-
|
|
14
|
-
const { class: className, isActive, size = "icon", ...rest } = Astro.props;
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
<a
|
|
18
|
-
aria-current={isActive ? "page" : undefined}
|
|
19
|
-
class={ButtonVariants.button({ variant: isActive ? "outline" : "ghost", size, class: className })}
|
|
20
|
-
data-slot="pagination-link"
|
|
21
|
-
{...rest}
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
</a>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import ChevronRight from "@tabler/icons/outline/chevron-right.svg";
|
|
3
|
-
import type { HTMLAttributes } from "astro/types";
|
|
4
|
-
import { tv, type VariantProps } from "tailwind-variants";
|
|
5
|
-
|
|
6
|
-
import { ButtonVariants } from "@/components/starwind/button";
|
|
7
|
-
|
|
8
|
-
import PaginationLink from "./PaginationLink.astro";
|
|
9
|
-
|
|
10
|
-
type Props = HTMLAttributes<"a"> & {
|
|
11
|
-
size?: VariantProps<typeof ButtonVariants.button>["size"];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const paginationNext = tv({ base: "group gap-1" });
|
|
15
|
-
|
|
16
|
-
const { class: className, size = "md", ...rest } = Astro.props;
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
<PaginationLink
|
|
20
|
-
aria-label="Go to next page"
|
|
21
|
-
size={size}
|
|
22
|
-
class={paginationNext({ class: className })}
|
|
23
|
-
data-slot="pagination-next"
|
|
24
|
-
{...rest}
|
|
25
|
-
>
|
|
26
|
-
<slot />
|
|
27
|
-
<slot name="icon">
|
|
28
|
-
<ChevronRight class="size-4 transition-transform group-hover:translate-x-1" />
|
|
29
|
-
</slot>
|
|
30
|
-
</PaginationLink>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import ChevronLeft from "@tabler/icons/outline/chevron-left.svg";
|
|
3
|
-
import type { HTMLAttributes } from "astro/types";
|
|
4
|
-
import { tv, type VariantProps } from "tailwind-variants";
|
|
5
|
-
|
|
6
|
-
import { ButtonVariants } from "@/components/starwind/button";
|
|
7
|
-
|
|
8
|
-
import PaginationLink from "./PaginationLink.astro";
|
|
9
|
-
|
|
10
|
-
type Props = HTMLAttributes<"a"> & {
|
|
11
|
-
size?: VariantProps<typeof ButtonVariants.button>["size"];
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const paginationPrevious = tv({ base: "group gap-1" });
|
|
15
|
-
|
|
16
|
-
const { class: className, size = "md", ...rest } = Astro.props;
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
<PaginationLink
|
|
20
|
-
aria-label="Go to previous page"
|
|
21
|
-
size={size}
|
|
22
|
-
class={paginationPrevious({ class: className })}
|
|
23
|
-
data-slot="pagination-previous"
|
|
24
|
-
{...rest}
|
|
25
|
-
>
|
|
26
|
-
<slot name="icon">
|
|
27
|
-
<ChevronLeft class="size-4 transition-transform group-hover:-translate-x-1" />
|
|
28
|
-
</slot>
|
|
29
|
-
<slot />
|
|
30
|
-
</PaginationLink>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import Pagination, { pagination } from "./Pagination.astro";
|
|
2
|
-
import PaginationContent, { paginationContent } from "./PaginationContent.astro";
|
|
3
|
-
import PaginationEllipsis, { paginationEllipsis } from "./PaginationEllipsis.astro";
|
|
4
|
-
import PaginationItem, { paginationItem } from "./PaginationItem.astro";
|
|
5
|
-
import PaginationLink, { paginationLink } from "./PaginationLink.astro";
|
|
6
|
-
import PaginationNext, { paginationNext } from "./PaginationNext.astro";
|
|
7
|
-
import PaginationPrevious, { paginationPrevious } from "./PaginationPrevious.astro";
|
|
8
|
-
|
|
9
|
-
const PaginationVariants = {
|
|
10
|
-
pagination,
|
|
11
|
-
paginationContent,
|
|
12
|
-
paginationEllipsis,
|
|
13
|
-
paginationItem,
|
|
14
|
-
paginationLink,
|
|
15
|
-
paginationNext,
|
|
16
|
-
paginationPrevious,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
Pagination,
|
|
21
|
-
PaginationContent,
|
|
22
|
-
PaginationEllipsis,
|
|
23
|
-
PaginationItem,
|
|
24
|
-
PaginationLink,
|
|
25
|
-
PaginationNext,
|
|
26
|
-
PaginationPrevious,
|
|
27
|
-
PaginationVariants,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default {
|
|
31
|
-
Root: Pagination,
|
|
32
|
-
Content: PaginationContent,
|
|
33
|
-
Ellipsis: PaginationEllipsis,
|
|
34
|
-
Item: PaginationItem,
|
|
35
|
-
Link: PaginationLink,
|
|
36
|
-
Next: PaginationNext,
|
|
37
|
-
Previous: PaginationPrevious,
|
|
38
|
-
};
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { HTMLAttributes } from "astro/types";
|
|
3
|
-
import { tv } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
type Props = HTMLAttributes<"div"> & {
|
|
6
|
-
/**
|
|
7
|
-
* Current value of the progress bar (omit for indeterminate state)
|
|
8
|
-
*/
|
|
9
|
-
value?: number;
|
|
10
|
-
/**
|
|
11
|
-
* Maximum value for the progress bar (default: 100)
|
|
12
|
-
*/
|
|
13
|
-
max?: number;
|
|
14
|
-
/**
|
|
15
|
-
* Color variant for the progress indicator (default: default)
|
|
16
|
-
*/
|
|
17
|
-
variant?: "default" | "primary" | "secondary" | "info" | "success" | "warning" | "error";
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const { class: className, value, max = 100, variant = "default", ...rest } = Astro.props;
|
|
21
|
-
|
|
22
|
-
const isIndeterminate = value == null;
|
|
23
|
-
const valuePercent = isIndeterminate ? undefined : Math.round((value / max) * 100);
|
|
24
|
-
const valueText = isIndeterminate ? undefined : `${valuePercent}%`;
|
|
25
|
-
|
|
26
|
-
export const progress = tv({
|
|
27
|
-
base: ["starwind-progress-bar", "bg-muted h-2 w-full overflow-hidden rounded-full"],
|
|
28
|
-
variants: {
|
|
29
|
-
variant: {
|
|
30
|
-
indeterminate: "relative",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const progressIndicator = tv({
|
|
36
|
-
base: ["starwind-progress-indicator", "h-full w-full flex-1 transition-transform"],
|
|
37
|
-
variants: {
|
|
38
|
-
variant: {
|
|
39
|
-
indeterminate: "absolute inset-y-0 start-0 w-3/4",
|
|
40
|
-
},
|
|
41
|
-
color: {
|
|
42
|
-
primary: "bg-primary",
|
|
43
|
-
secondary: "bg-secondary",
|
|
44
|
-
default: "bg-foreground",
|
|
45
|
-
info: "bg-info",
|
|
46
|
-
success: "bg-success",
|
|
47
|
-
warning: "bg-warning",
|
|
48
|
-
error: "bg-error",
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
defaultVariants: {
|
|
52
|
-
color: "primary",
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const indicator = progressIndicator;
|
|
57
|
-
|
|
58
|
-
const progressClasses = progress({
|
|
59
|
-
variant: isIndeterminate ? "indeterminate" : undefined,
|
|
60
|
-
class: className,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const indicatorClasses = indicator({
|
|
64
|
-
variant: isIndeterminate ? "indeterminate" : undefined,
|
|
65
|
-
color: variant,
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
const indicatorStyle = isIndeterminate
|
|
69
|
-
? ""
|
|
70
|
-
: `transform: translateX(-${100 - (valuePercent ?? 0)}%);`;
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
<div
|
|
74
|
-
role="progressbar"
|
|
75
|
-
aria-valuemin={0}
|
|
76
|
-
aria-valuemax={max}
|
|
77
|
-
aria-valuenow={isIndeterminate ? undefined : value}
|
|
78
|
-
aria-valuetext={valueText}
|
|
79
|
-
class:list={[progressClasses]}
|
|
80
|
-
data-value={value}
|
|
81
|
-
data-max={max}
|
|
82
|
-
data-indeterminate={isIndeterminate}
|
|
83
|
-
data-slot="progress"
|
|
84
|
-
{...rest}
|
|
85
|
-
>
|
|
86
|
-
<div class:list={[indicatorClasses]} style={indicatorStyle}></div>
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<script>
|
|
90
|
-
class ProgressHandler {
|
|
91
|
-
private progressElement: HTMLElement;
|
|
92
|
-
private observer!: MutationObserver;
|
|
93
|
-
|
|
94
|
-
constructor(progressElement: HTMLElement) {
|
|
95
|
-
this.progressElement = progressElement;
|
|
96
|
-
this.setupMutationObserver();
|
|
97
|
-
this.updateProgress(); // Initial update
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
private setupMutationObserver(): void {
|
|
101
|
-
// Create a MutationObserver to watch for data-value attribute changes
|
|
102
|
-
this.observer = new MutationObserver((mutations) => {
|
|
103
|
-
mutations.forEach((mutation) => {
|
|
104
|
-
if (mutation.attributeName === "data-value" || mutation.attributeName === "data-max") {
|
|
105
|
-
this.updateProgress();
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// Start observing
|
|
111
|
-
this.observer.observe(this.progressElement, { attributes: true });
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private updateProgress(): void {
|
|
115
|
-
const value = Number(this.progressElement.getAttribute("data-value"));
|
|
116
|
-
const max = Number(this.progressElement.getAttribute("data-max") || 100);
|
|
117
|
-
const isIndeterminate = this.progressElement.hasAttribute("data-indeterminate")
|
|
118
|
-
? this.progressElement.getAttribute("data-indeterminate") === "true"
|
|
119
|
-
: value == null;
|
|
120
|
-
|
|
121
|
-
// Update ARIA attributes
|
|
122
|
-
if (!isIndeterminate) {
|
|
123
|
-
const valuePercent = Math.round((value / max) * 100);
|
|
124
|
-
this.progressElement.setAttribute("aria-valuenow", String(value));
|
|
125
|
-
this.progressElement.setAttribute("aria-valuetext", `${valuePercent}%`);
|
|
126
|
-
|
|
127
|
-
// Update indicator position
|
|
128
|
-
const indicator = this.progressElement.querySelector("div");
|
|
129
|
-
if (indicator) {
|
|
130
|
-
indicator.style.transform = `translateX(-${100 - valuePercent}%)`;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Clean up method to disconnect observer
|
|
136
|
-
public destroy(): void {
|
|
137
|
-
this.observer.disconnect();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Store instances in a WeakMap to avoid memory leaks
|
|
142
|
-
const progressInstances = new WeakMap<HTMLElement, ProgressHandler>();
|
|
143
|
-
|
|
144
|
-
const setupProgressBars = () => {
|
|
145
|
-
document.querySelectorAll<HTMLElement>(".starwind-progress-bar").forEach((progressElement) => {
|
|
146
|
-
if (!progressInstances.has(progressElement)) {
|
|
147
|
-
progressInstances.set(progressElement, new ProgressHandler(progressElement));
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
setupProgressBars();
|
|
153
|
-
document.addEventListener("astro:after-swap", setupProgressBars);
|
|
154
|
-
document.addEventListener("starwind:init", setupProgressBars);
|
|
155
|
-
</script>
|