@starwind-ui/core 1.7.3 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +41 -23
- package/dist/index.js.map +1 -1
- package/dist/src/components/accordion/Accordion.astro +8 -2
- package/dist/src/components/accordion/AccordionContent.astro +2 -1
- package/dist/src/components/accordion/AccordionItem.astro +8 -2
- package/dist/src/components/accordion/AccordionTrigger.astro +2 -1
- package/dist/src/components/accordion/index.ts +7 -5
- package/dist/src/components/alert/Alert.astro +5 -2
- package/dist/src/components/alert/AlertDescription.astro +4 -4
- package/dist/src/components/alert/AlertTitle.astro +3 -3
- package/dist/src/components/alert/index.ts +6 -4
- package/dist/src/components/alert-dialog/AlertDialog.astro +273 -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 +50 -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/avatar/Avatar.astro +2 -2
- package/dist/src/components/avatar/AvatarFallback.astro +2 -2
- package/dist/src/components/avatar/AvatarImage.astro +13 -2
- package/dist/src/components/avatar/index.ts +6 -4
- package/dist/src/components/badge/Badge.astro +2 -2
- package/dist/src/components/badge/index.ts +4 -2
- package/dist/src/components/breadcrumb/Breadcrumb.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +4 -1
- package/dist/src/components/breadcrumb/BreadcrumbItem.astro +2 -2
- package/dist/src/components/breadcrumb/BreadcrumbLink.astro +2 -2
- package/dist/src/components/breadcrumb/BreadcrumbList.astro +2 -2
- package/dist/src/components/breadcrumb/BreadcrumbPage.astro +2 -1
- package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +2 -1
- package/dist/src/components/breadcrumb/index.ts +16 -6
- package/dist/src/components/button/Button.astro +2 -2
- package/dist/src/components/button/index.ts +4 -2
- package/dist/src/components/card/Card.astro +2 -2
- package/dist/src/components/card/CardContent.astro +2 -2
- package/dist/src/components/card/CardDescription.astro +2 -2
- package/dist/src/components/card/CardFooter.astro +2 -2
- package/dist/src/components/card/CardHeader.astro +2 -2
- package/dist/src/components/card/CardTitle.astro +2 -2
- package/dist/src/components/card/index.ts +16 -7
- 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 +33 -0
- package/dist/src/components/carousel/CarouselPrevious.astro +33 -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 +10 -3
- package/dist/src/components/checkbox/index.ts +4 -2
- package/dist/src/components/dialog/Dialog.astro +24 -11
- package/dist/src/components/dialog/DialogClose.astro +7 -2
- package/dist/src/components/dialog/DialogContent.astro +6 -3
- package/dist/src/components/dialog/DialogDescription.astro +2 -2
- package/dist/src/components/dialog/DialogFooter.astro +2 -2
- package/dist/src/components/dialog/DialogHeader.astro +2 -2
- package/dist/src/components/dialog/DialogTitle.astro +2 -2
- package/dist/src/components/dialog/DialogTrigger.astro +7 -1
- package/dist/src/components/dialog/index.ts +20 -5
- package/dist/src/components/dropdown/Dropdown.astro +1 -0
- package/dist/src/components/dropdown/DropdownContent.astro +2 -1
- package/dist/src/components/dropdown/DropdownItem.astro +2 -1
- package/dist/src/components/dropdown/DropdownLabel.astro +2 -2
- package/dist/src/components/dropdown/DropdownSeparator.astro +2 -1
- package/dist/src/components/dropdown/DropdownTrigger.astro +7 -2
- package/dist/src/components/dropdown/index.ts +14 -5
- package/dist/src/components/dropzone/Dropzone.astro +3 -2
- package/dist/src/components/dropzone/DropzoneFilesList.astro +3 -2
- package/dist/src/components/dropzone/DropzoneLoadingIndicator.astro +1 -1
- package/dist/src/components/dropzone/DropzoneUploadIndicator.astro +1 -1
- package/dist/src/components/dropzone/index.ts +14 -3
- package/dist/src/components/input/Input.astro +2 -2
- package/dist/src/components/input/index.ts +4 -2
- package/dist/src/components/label/Label.astro +2 -2
- package/dist/src/components/label/index.ts +4 -2
- package/dist/src/components/pagination/Pagination.astro +8 -2
- package/dist/src/components/pagination/PaginationContent.astro +2 -2
- package/dist/src/components/pagination/PaginationEllipsis.astro +7 -2
- package/dist/src/components/pagination/PaginationItem.astro +2 -2
- package/dist/src/components/pagination/PaginationLink.astro +2 -1
- package/dist/src/components/pagination/PaginationNext.astro +2 -1
- package/dist/src/components/pagination/PaginationPrevious.astro +2 -1
- package/dist/src/components/pagination/index.ts +18 -7
- package/dist/src/components/progress/Progress.astro +5 -2
- package/dist/src/components/progress/index.ts +7 -2
- package/dist/src/components/radio-group/RadioGroup.astro +2 -1
- package/dist/src/components/radio-group/RadioGroupItem.astro +7 -6
- package/dist/src/components/radio-group/index.ts +16 -3
- package/dist/src/components/select/Select.astro +1 -0
- package/dist/src/components/select/SelectContent.astro +3 -2
- package/dist/src/components/select/SelectGroup.astro +1 -1
- package/dist/src/components/select/SelectItem.astro +3 -2
- package/dist/src/components/select/SelectLabel.astro +2 -2
- package/dist/src/components/select/SelectSeparator.astro +2 -2
- package/dist/src/components/select/SelectTrigger.astro +2 -1
- package/dist/src/components/select/SelectValue.astro +2 -2
- package/dist/src/components/select/index.ts +18 -6
- 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 +90 -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/skeleton/Skeleton.astro +2 -2
- package/dist/src/components/skeleton/index.ts +6 -2
- package/dist/src/components/switch/Switch.astro +6 -4
- package/dist/src/components/switch/index.ts +8 -2
- package/dist/src/components/table/Table.astro +3 -3
- package/dist/src/components/table/TableBody.astro +2 -2
- package/dist/src/components/table/TableCaption.astro +2 -2
- package/dist/src/components/table/TableCell.astro +2 -2
- package/dist/src/components/table/TableFoot.astro +2 -2
- package/dist/src/components/table/TableHead.astro +2 -2
- package/dist/src/components/table/TableHeader.astro +2 -2
- package/dist/src/components/table/TableRow.astro +2 -2
- package/dist/src/components/table/index.ts +30 -9
- package/dist/src/components/tabs/Tabs.astro +2 -1
- package/dist/src/components/tabs/TabsContent.astro +4 -1
- package/dist/src/components/tabs/TabsList.astro +8 -2
- package/dist/src/components/tabs/TabsTrigger.astro +2 -1
- package/dist/src/components/tabs/index.ts +12 -5
- package/dist/src/components/textarea/Textarea.astro +2 -2
- package/dist/src/components/textarea/index.ts +6 -2
- package/dist/src/components/tooltip/Tooltip.astro +2 -1
- package/dist/src/components/tooltip/TooltipContent.astro +2 -1
- package/dist/src/components/tooltip/TooltipTrigger.astro +1 -1
- package/dist/src/components/tooltip/index.ts +8 -3
- package/package.json +1 -1
|
@@ -24,7 +24,12 @@ if (Astro.slots.has("default")) {
|
|
|
24
24
|
|
|
25
25
|
{
|
|
26
26
|
asChild && hasChildren ? (
|
|
27
|
-
<div
|
|
27
|
+
<div
|
|
28
|
+
class:list={["starwind-dialog-trigger", className]}
|
|
29
|
+
data-slot="dialog-trigger"
|
|
30
|
+
data-as-child
|
|
31
|
+
data-dialog-for={dialogFor}
|
|
32
|
+
>
|
|
28
33
|
<slot />
|
|
29
34
|
</div>
|
|
30
35
|
) : (
|
|
@@ -32,6 +37,7 @@ if (Astro.slots.has("default")) {
|
|
|
32
37
|
type="button"
|
|
33
38
|
aria-haspopup="dialog"
|
|
34
39
|
class:list={["starwind-dialog-trigger", className]}
|
|
40
|
+
data-slot="dialog-trigger"
|
|
35
41
|
data-dialog-for={dialogFor}
|
|
36
42
|
{...rest}
|
|
37
43
|
>
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import Dialog from "./Dialog.astro";
|
|
2
2
|
import DialogClose from "./DialogClose.astro";
|
|
3
|
-
import DialogContent
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import DialogContent, {
|
|
4
|
+
dialogBackdrop,
|
|
5
|
+
dialogCloseButton,
|
|
6
|
+
dialogContent,
|
|
7
|
+
} from "./DialogContent.astro";
|
|
8
|
+
import DialogDescription, { dialogDescription } from "./DialogDescription.astro";
|
|
9
|
+
import DialogFooter, { dialogFooter } from "./DialogFooter.astro";
|
|
10
|
+
import DialogHeader, { dialogHeader } from "./DialogHeader.astro";
|
|
11
|
+
import DialogTitle, { dialogTitle } from "./DialogTitle.astro";
|
|
8
12
|
import DialogTrigger from "./DialogTrigger.astro";
|
|
9
13
|
|
|
14
|
+
const DialogVariants = {
|
|
15
|
+
dialogBackdrop,
|
|
16
|
+
dialogContent,
|
|
17
|
+
dialogCloseButton,
|
|
18
|
+
dialogDescription,
|
|
19
|
+
dialogFooter,
|
|
20
|
+
dialogHeader,
|
|
21
|
+
dialogTitle,
|
|
22
|
+
};
|
|
23
|
+
|
|
10
24
|
export {
|
|
11
25
|
Dialog,
|
|
12
26
|
DialogClose,
|
|
@@ -16,6 +30,7 @@ export {
|
|
|
16
30
|
DialogHeader,
|
|
17
31
|
DialogTitle,
|
|
18
32
|
DialogTrigger,
|
|
33
|
+
DialogVariants,
|
|
19
34
|
};
|
|
20
35
|
|
|
21
36
|
export default {
|
|
@@ -22,6 +22,7 @@ const { class: className, openOnHover = false, closeDelay = 200, ...rest } = Ast
|
|
|
22
22
|
class:list={["starwind-dropdown", "relative", className]}
|
|
23
23
|
data-open-on-hover={openOnHover ? "true" : undefined}
|
|
24
24
|
data-close-delay={closeDelay}
|
|
25
|
+
data-slot="dropdown"
|
|
25
26
|
{...rest}
|
|
26
27
|
>
|
|
27
28
|
<slot />
|
|
@@ -25,7 +25,7 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
25
25
|
animationDuration?: number;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const dropdownContent = tv({
|
|
28
|
+
export const dropdownContent = tv({
|
|
29
29
|
base: [
|
|
30
30
|
"starwind-dropdown-content",
|
|
31
31
|
"bg-popover text-popover-foreground z-50 min-w-[9rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
@@ -66,6 +66,7 @@ const {
|
|
|
66
66
|
data-side={side}
|
|
67
67
|
data-align={align}
|
|
68
68
|
data-state="closed"
|
|
69
|
+
data-slot="dropdown-content"
|
|
69
70
|
tabindex="-1"
|
|
70
71
|
aria-orientation="vertical"
|
|
71
72
|
style={{
|
|
@@ -13,7 +13,7 @@ type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }> & {
|
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const dropdownItem = tv({
|
|
16
|
+
export const dropdownItem = tv({
|
|
17
17
|
base: [
|
|
18
18
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 transition-colors outline-none select-none",
|
|
19
19
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
@@ -41,6 +41,7 @@ const { class: className, inset = false, disabled = false, as: Tag = "div", ...r
|
|
|
41
41
|
role="menuitem"
|
|
42
42
|
tabindex={disabled ? "-1" : "0"}
|
|
43
43
|
data-disabled={disabled ? "true" : undefined}
|
|
44
|
+
data-slot="dropdown-item"
|
|
44
45
|
{...rest}
|
|
45
46
|
>
|
|
46
47
|
<slot />
|
|
@@ -9,7 +9,7 @@ type Props = HTMLAttributes<"div"> & {
|
|
|
9
9
|
inset?: boolean;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const dropdownLabel = tv({
|
|
12
|
+
export const dropdownLabel = tv({
|
|
13
13
|
base: ["px-2 py-1.5 font-semibold"],
|
|
14
14
|
variants: {
|
|
15
15
|
inset: {
|
|
@@ -24,6 +24,6 @@ const dropdownLabel = tv({
|
|
|
24
24
|
const { class: className, inset = false, ...rest } = Astro.props;
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
<div class={dropdownLabel({ inset, class: className })} {...rest}>
|
|
27
|
+
<div class={dropdownLabel({ inset, class: className })} data-slot="dropdown-label" {...rest}>
|
|
28
28
|
<slot />
|
|
29
29
|
</div>
|
|
@@ -4,7 +4,7 @@ import { tv } from "tailwind-variants";
|
|
|
4
4
|
|
|
5
5
|
type Props = HTMLAttributes<"div">;
|
|
6
6
|
|
|
7
|
-
const dropdownSeparator = tv({
|
|
7
|
+
export const dropdownSeparator = tv({
|
|
8
8
|
base: "bg-muted -mx-1 my-1 h-px",
|
|
9
9
|
});
|
|
10
10
|
|
|
@@ -15,6 +15,7 @@ const { class: className, ...rest } = Astro.props;
|
|
|
15
15
|
class={dropdownSeparator({ class: className })}
|
|
16
16
|
role="separator"
|
|
17
17
|
aria-orientation="horizontal"
|
|
18
|
+
data-slot="dropdown-separator"
|
|
18
19
|
{...rest}
|
|
19
20
|
>
|
|
20
21
|
</div>
|
|
@@ -9,7 +9,7 @@ type Props = Omit<HTMLAttributes<"button">, "role" | "type"> & {
|
|
|
9
9
|
asChild?: boolean;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const dropdownTrigger = tv({
|
|
12
|
+
export const dropdownTrigger = tv({
|
|
13
13
|
base: [
|
|
14
14
|
"starwind-dropdown-trigger",
|
|
15
15
|
"inline-flex items-center justify-center",
|
|
@@ -28,7 +28,11 @@ if (Astro.slots.has("default")) {
|
|
|
28
28
|
|
|
29
29
|
{
|
|
30
30
|
asChild && hasChildren ? (
|
|
31
|
-
<div
|
|
31
|
+
<div
|
|
32
|
+
class={`starwind-dropdown-trigger ${className}`}
|
|
33
|
+
data-slot="dropdown-trigger"
|
|
34
|
+
data-as-child
|
|
35
|
+
>
|
|
32
36
|
<slot />
|
|
33
37
|
</div>
|
|
34
38
|
) : (
|
|
@@ -38,6 +42,7 @@ if (Astro.slots.has("default")) {
|
|
|
38
42
|
aria-haspopup="true"
|
|
39
43
|
aria-expanded="false"
|
|
40
44
|
data-state="closed"
|
|
45
|
+
data-slot="dropdown-trigger"
|
|
41
46
|
{...rest}
|
|
42
47
|
>
|
|
43
48
|
<slot />
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import Dropdown from "./Dropdown.astro";
|
|
2
|
-
import DropdownContent from "./DropdownContent.astro";
|
|
3
|
-
import DropdownItem from "./DropdownItem.astro";
|
|
4
|
-
import DropdownLabel from "./DropdownLabel.astro";
|
|
5
|
-
import DropdownSeparator from "./DropdownSeparator.astro";
|
|
6
|
-
import DropdownTrigger from "./DropdownTrigger.astro";
|
|
2
|
+
import DropdownContent, { dropdownContent } from "./DropdownContent.astro";
|
|
3
|
+
import DropdownItem, { dropdownItem } from "./DropdownItem.astro";
|
|
4
|
+
import DropdownLabel, { dropdownLabel } from "./DropdownLabel.astro";
|
|
5
|
+
import DropdownSeparator, { dropdownSeparator } from "./DropdownSeparator.astro";
|
|
6
|
+
import DropdownTrigger, { dropdownTrigger } from "./DropdownTrigger.astro";
|
|
7
|
+
|
|
8
|
+
const DropdownVariants = {
|
|
9
|
+
dropdownContent,
|
|
10
|
+
dropdownItem,
|
|
11
|
+
dropdownLabel,
|
|
12
|
+
dropdownSeparator,
|
|
13
|
+
dropdownTrigger,
|
|
14
|
+
};
|
|
7
15
|
|
|
8
16
|
export {
|
|
9
17
|
Dropdown,
|
|
@@ -12,6 +20,7 @@ export {
|
|
|
12
20
|
DropdownLabel,
|
|
13
21
|
DropdownSeparator,
|
|
14
22
|
DropdownTrigger,
|
|
23
|
+
DropdownVariants,
|
|
15
24
|
};
|
|
16
25
|
|
|
17
26
|
export default {
|
|
@@ -16,7 +16,7 @@ type Props = HTMLAttributes<"input"> & {
|
|
|
16
16
|
// extract id separately so it can be used in the label. The input will get the same id with "-input" suffix.
|
|
17
17
|
const { class: className, id, isUploading = false, ...rest } = Astro.props as Props;
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
export const dropzone = tv({
|
|
20
20
|
base: [
|
|
21
21
|
"starwind-dropzone",
|
|
22
22
|
"relative flex w-full flex-col items-center justify-center gap-1 rounded-lg px-6 py-12",
|
|
@@ -30,7 +30,8 @@ const root = tv({
|
|
|
30
30
|
<label
|
|
31
31
|
id={id}
|
|
32
32
|
tabindex="0"
|
|
33
|
-
class={
|
|
33
|
+
class={dropzone({ class: className })}
|
|
34
|
+
data-slot="dropzone"
|
|
34
35
|
data-drag-active="false"
|
|
35
36
|
data-has-files="false"
|
|
36
37
|
data-is-uploading={String(isUploading)}
|
|
@@ -6,7 +6,7 @@ type Props = HTMLAttributes<"div">;
|
|
|
6
6
|
|
|
7
7
|
const { class: className, ...rest } = Astro.props;
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
export const dropzoneFilesList = tv({
|
|
10
10
|
base: [
|
|
11
11
|
"starwind-files-list",
|
|
12
12
|
"mt-1 -mb-8 min-h-8",
|
|
@@ -17,9 +17,10 @@ const filesList = tv({
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
<div
|
|
20
|
-
class={
|
|
20
|
+
class={dropzoneFilesList({ class: className })}
|
|
21
21
|
aria-live="polite"
|
|
22
22
|
aria-label="Uploaded files"
|
|
23
|
+
data-slot="dropzone-files-list"
|
|
23
24
|
{...rest}
|
|
24
25
|
>
|
|
25
26
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import LoaderIcon from "@tabler/icons/outline/loader-2.svg";
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
<div class="starwind-loading-indicator hidden">
|
|
5
|
+
<div class="starwind-loading-indicator hidden" data-slot="dropzone-loading-indicator">
|
|
6
6
|
<slot>
|
|
7
7
|
<LoaderIcon class="mx-auto size-10 animate-spin" aria-hidden="true" />
|
|
8
8
|
<p class="mt-1 text-sm">Uploading file(s)...</p>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import CloudUploadIcon from "@tabler/icons/outline/cloud-upload.svg";
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
<div class="starwind-upload-indicator">
|
|
5
|
+
<div class="starwind-upload-indicator" data-slot="dropzone-upload-indicator">
|
|
6
6
|
<slot>
|
|
7
7
|
<CloudUploadIcon class="mx-auto size-10" aria-hidden="true" />
|
|
8
8
|
<p class="mt-1 text-sm">Click to upload or drag and drop</p>
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import Dropzone from "./Dropzone.astro";
|
|
2
|
-
import DropzoneFilesList from "./DropzoneFilesList.astro";
|
|
1
|
+
import Dropzone, { dropzone } from "./Dropzone.astro";
|
|
2
|
+
import DropzoneFilesList, { dropzoneFilesList } from "./DropzoneFilesList.astro";
|
|
3
3
|
import DropzoneLoadingIndicator from "./DropzoneLoadingIndicator.astro";
|
|
4
4
|
import DropzoneUploadIndicator from "./DropzoneUploadIndicator.astro";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const DropzoneVariants = {
|
|
7
|
+
dropzone,
|
|
8
|
+
dropzoneFilesList,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
Dropzone,
|
|
13
|
+
DropzoneFilesList,
|
|
14
|
+
DropzoneLoadingIndicator,
|
|
15
|
+
DropzoneUploadIndicator,
|
|
16
|
+
DropzoneVariants,
|
|
17
|
+
};
|
|
7
18
|
|
|
8
19
|
export default {
|
|
9
20
|
Root: Dropzone,
|
|
@@ -4,7 +4,7 @@ import { tv, type VariantProps } from "tailwind-variants";
|
|
|
4
4
|
|
|
5
5
|
type Props = HTMLAttributes<"input"> & VariantProps<typeof input>;
|
|
6
6
|
|
|
7
|
-
const input = tv({
|
|
7
|
+
export const input = tv({
|
|
8
8
|
base: [
|
|
9
9
|
"border-input bg-background text-foreground w-full rounded-md border",
|
|
10
10
|
"focus:outline-outline focus:ring-0 focus:outline-2 focus:outline-offset-2",
|
|
@@ -21,4 +21,4 @@ const input = tv({
|
|
|
21
21
|
const { size, class: className, ...rest } = Astro.props;
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
-
<input class={input({ size, class: className })} {...rest} />
|
|
24
|
+
<input class={input({ size, class: className })} data-slot="input" {...rest} />
|
|
@@ -4,7 +4,7 @@ import { tv, type VariantProps } from "tailwind-variants";
|
|
|
4
4
|
|
|
5
5
|
type Props = HTMLAttributes<"label"> & VariantProps<typeof label>;
|
|
6
6
|
|
|
7
|
-
const label = tv({
|
|
7
|
+
export const label = tv({
|
|
8
8
|
base: [
|
|
9
9
|
"text-foreground leading-none font-medium",
|
|
10
10
|
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70 has-[+:disabled]:cursor-not-allowed has-[+:disabled]:opacity-70",
|
|
@@ -17,6 +17,6 @@ const { size, class: className, ...rest } = Astro.props;
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
{/* eslint-disable-next-line astro/jsx-a11y/label-has-associated-control */}
|
|
20
|
-
<label class={label({ size, class: className })} {...rest}>
|
|
20
|
+
<label class={label({ size, class: className })} data-slot="label" {...rest}>
|
|
21
21
|
<slot />
|
|
22
22
|
</label>
|
|
@@ -4,11 +4,17 @@ import { tv } from "tailwind-variants";
|
|
|
4
4
|
|
|
5
5
|
type Props = HTMLAttributes<"nav">;
|
|
6
6
|
|
|
7
|
-
const pagination = tv({ base: "mx-auto flex w-full justify-center" });
|
|
7
|
+
export const pagination = tv({ base: "mx-auto flex w-full justify-center" });
|
|
8
8
|
|
|
9
9
|
const { class: className, ...rest } = Astro.props;
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<nav
|
|
12
|
+
<nav
|
|
13
|
+
role="navigation"
|
|
14
|
+
aria-label="pagination"
|
|
15
|
+
class={pagination({ class: className })}
|
|
16
|
+
data-slot="pagination"
|
|
17
|
+
{...rest}
|
|
18
|
+
>
|
|
13
19
|
<slot />
|
|
14
20
|
</nav>
|
|
@@ -6,11 +6,11 @@ type Props = HTMLAttributes<"ul"> & {
|
|
|
6
6
|
children: any;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const paginationContent = tv({ base: "flex flex-row items-center gap-1" });
|
|
9
|
+
export const paginationContent = tv({ base: "flex flex-row items-center gap-1" });
|
|
10
10
|
|
|
11
11
|
const { class: className, ...rest } = Astro.props;
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
<ul class={paginationContent({ class: className })} {...rest}>
|
|
14
|
+
<ul class={paginationContent({ class: className })} data-slot="pagination-content" {...rest}>
|
|
15
15
|
<slot />
|
|
16
16
|
</ul>
|
|
@@ -5,12 +5,17 @@ import { tv } from "tailwind-variants";
|
|
|
5
5
|
|
|
6
6
|
type Props = HTMLAttributes<"span">;
|
|
7
7
|
|
|
8
|
-
const paginationEllipsis = tv({ base: "flex h-9 w-9 items-center justify-center" });
|
|
8
|
+
export const paginationEllipsis = tv({ base: "flex h-9 w-9 items-center justify-center" });
|
|
9
9
|
|
|
10
10
|
const { class: className, ...rest } = Astro.props;
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
<span
|
|
13
|
+
<span
|
|
14
|
+
aria-hidden
|
|
15
|
+
class={paginationEllipsis({ class: className })}
|
|
16
|
+
data-slot="pagination-ellipsis"
|
|
17
|
+
{...rest}
|
|
18
|
+
>
|
|
14
19
|
<Dots class="size-4" />
|
|
15
20
|
<span class="sr-only">More pages</span>
|
|
16
21
|
</span>
|
|
@@ -6,11 +6,11 @@ type Props = HTMLAttributes<"li"> & {
|
|
|
6
6
|
children: any;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const paginationItem = tv({ base: "" });
|
|
9
|
+
export const paginationItem = tv({ base: "" });
|
|
10
10
|
|
|
11
11
|
const { class: className, ...rest } = Astro.props;
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
<li class={paginationItem({ class: className })} {...rest}>
|
|
14
|
+
<li class={paginationItem({ class: className })} data-slot="pagination-item" {...rest}>
|
|
15
15
|
<slot />
|
|
16
16
|
</li>
|
|
@@ -7,7 +7,7 @@ interface Props extends HTMLAttributes<"a"> {
|
|
|
7
7
|
size?: "sm" | "md" | "lg" | "icon";
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const paginationLink = tv({
|
|
10
|
+
export const paginationLink = tv({
|
|
11
11
|
base: [
|
|
12
12
|
"inline-flex items-center justify-center gap-1.5 rounded-md font-medium whitespace-nowrap",
|
|
13
13
|
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
@@ -37,6 +37,7 @@ const { class: className, isActive, size = "icon", ...rest } = Astro.props;
|
|
|
37
37
|
<a
|
|
38
38
|
aria-current={isActive ? "page" : undefined}
|
|
39
39
|
class={paginationLink({ isActive, size, class: className })}
|
|
40
|
+
data-slot="pagination-link"
|
|
40
41
|
{...rest}
|
|
41
42
|
>
|
|
42
43
|
<slot />
|
|
@@ -7,7 +7,7 @@ import PaginationLink from "./PaginationLink.astro";
|
|
|
7
7
|
|
|
8
8
|
type Props = HTMLAttributes<"a"> & { size?: "sm" | "md" | "lg" | "icon" };
|
|
9
9
|
|
|
10
|
-
const paginationNext = tv({ base: "group gap-1" });
|
|
10
|
+
export const paginationNext = tv({ base: "group gap-1" });
|
|
11
11
|
|
|
12
12
|
const { class: className, size = "md", ...rest } = Astro.props;
|
|
13
13
|
---
|
|
@@ -16,6 +16,7 @@ const { class: className, size = "md", ...rest } = Astro.props;
|
|
|
16
16
|
aria-label="Go to next page"
|
|
17
17
|
size={size}
|
|
18
18
|
class={paginationNext({ class: className })}
|
|
19
|
+
data-slot="pagination-next"
|
|
19
20
|
{...rest}
|
|
20
21
|
>
|
|
21
22
|
<slot />
|
|
@@ -7,7 +7,7 @@ import PaginationLink from "./PaginationLink.astro";
|
|
|
7
7
|
|
|
8
8
|
type Props = HTMLAttributes<"a"> & { size?: "sm" | "md" | "lg" | "icon" };
|
|
9
9
|
|
|
10
|
-
const paginationPrevious = tv({ base: "group gap-1" });
|
|
10
|
+
export const paginationPrevious = tv({ base: "group gap-1" });
|
|
11
11
|
|
|
12
12
|
const { class: className, size = "md", ...rest } = Astro.props;
|
|
13
13
|
---
|
|
@@ -16,6 +16,7 @@ const { class: className, size = "md", ...rest } = Astro.props;
|
|
|
16
16
|
aria-label="Go to previous page"
|
|
17
17
|
size={size}
|
|
18
18
|
class={paginationPrevious({ class: className })}
|
|
19
|
+
data-slot="pagination-previous"
|
|
19
20
|
{...rest}
|
|
20
21
|
>
|
|
21
22
|
<ChevronLeft class="size-4 transition-transform group-hover:-translate-x-1" />
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import Pagination from "./Pagination.astro";
|
|
2
|
-
import PaginationContent from "./PaginationContent.astro";
|
|
3
|
-
import PaginationEllipsis from "./PaginationEllipsis.astro";
|
|
4
|
-
import PaginationItem from "./PaginationItem.astro";
|
|
5
|
-
import PaginationLink from "./PaginationLink.astro";
|
|
6
|
-
import PaginationNext from "./PaginationNext.astro";
|
|
7
|
-
import PaginationPrevious from "./PaginationPrevious.astro";
|
|
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
|
+
};
|
|
8
18
|
|
|
9
19
|
export {
|
|
10
20
|
Pagination,
|
|
@@ -14,6 +24,7 @@ export {
|
|
|
14
24
|
PaginationLink,
|
|
15
25
|
PaginationNext,
|
|
16
26
|
PaginationPrevious,
|
|
27
|
+
PaginationVariants,
|
|
17
28
|
};
|
|
18
29
|
|
|
19
30
|
export default {
|
|
@@ -23,7 +23,7 @@ const isIndeterminate = value == null;
|
|
|
23
23
|
const valuePercent = isIndeterminate ? undefined : Math.round((value / max) * 100);
|
|
24
24
|
const valueText = isIndeterminate ? undefined : `${valuePercent}%`;
|
|
25
25
|
|
|
26
|
-
const progress = tv({
|
|
26
|
+
export const progress = tv({
|
|
27
27
|
base: ["starwind-progress-bar", "bg-accent h-2 w-full overflow-hidden rounded-full"],
|
|
28
28
|
variants: {
|
|
29
29
|
variant: {
|
|
@@ -32,7 +32,7 @@ const progress = tv({
|
|
|
32
32
|
},
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
export const progressIndicator = tv({
|
|
36
36
|
base: ["starwind-progress-indicator", "h-full w-full flex-1 transition-transform"],
|
|
37
37
|
variants: {
|
|
38
38
|
variant: {
|
|
@@ -53,6 +53,8 @@ const indicator = tv({
|
|
|
53
53
|
},
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
+
const indicator = progressIndicator;
|
|
57
|
+
|
|
56
58
|
const progressClasses = progress({
|
|
57
59
|
variant: isIndeterminate ? "indeterminate" : undefined,
|
|
58
60
|
class: className,
|
|
@@ -78,6 +80,7 @@ const indicatorStyle = isIndeterminate
|
|
|
78
80
|
data-value={value}
|
|
79
81
|
data-max={max}
|
|
80
82
|
data-indeterminate={isIndeterminate}
|
|
83
|
+
data-slot="progress"
|
|
81
84
|
{...rest}
|
|
82
85
|
>
|
|
83
86
|
<div class:list={[indicatorClasses]} style={indicatorStyle}></div>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import Progress from "./Progress.astro";
|
|
1
|
+
import Progress, { progress, progressIndicator } from "./Progress.astro";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const ProgressVariants = {
|
|
4
|
+
progress,
|
|
5
|
+
progressIndicator,
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { Progress, ProgressVariants };
|
|
4
9
|
|
|
5
10
|
export default Progress;
|
|
@@ -25,7 +25,7 @@ type Props = HTMLAttributes<"fieldset"> & {
|
|
|
25
25
|
orientation?: "horizontal" | "vertical";
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const radioGroup = tv({
|
|
28
|
+
export const radioGroup = tv({
|
|
29
29
|
base: "starwind-radio-group disabled:cursor-not-allowed disabled:opacity-70",
|
|
30
30
|
variants: {
|
|
31
31
|
orientation: {
|
|
@@ -53,6 +53,7 @@ const {
|
|
|
53
53
|
class:list={[radioGroup({ orientation, class: className })]}
|
|
54
54
|
data-value={value || defaultValue}
|
|
55
55
|
disabled={disabled}
|
|
56
|
+
data-slot="radio-group"
|
|
56
57
|
{...rest}
|
|
57
58
|
>
|
|
58
59
|
{legend && <legend class="sr-only">{legend}</legend>}
|
|
@@ -28,7 +28,7 @@ type Props = HTMLAttributes<"input"> &
|
|
|
28
28
|
checked?: boolean;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
const radioWrapper = tv({
|
|
31
|
+
export const radioWrapper = tv({
|
|
32
32
|
base: "relative isolate flex shrink-0",
|
|
33
33
|
variants: {
|
|
34
34
|
size: {
|
|
@@ -42,7 +42,7 @@ const radioWrapper = tv({
|
|
|
42
42
|
},
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const radioItem = tv({
|
|
45
|
+
export const radioItem = tv({
|
|
46
46
|
base: [
|
|
47
47
|
"starwind-radio-item peer z-10 h-full w-full",
|
|
48
48
|
"absolute inset-0 cursor-pointer opacity-0 outline-none focus:outline-none focus-visible:outline-none",
|
|
@@ -50,7 +50,7 @@ const radioItem = tv({
|
|
|
50
50
|
],
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
const radioControl = tv({
|
|
53
|
+
export const radioControl = tv({
|
|
54
54
|
base: [
|
|
55
55
|
"starwind-radio-control",
|
|
56
56
|
"border-input bg-background",
|
|
@@ -81,7 +81,7 @@ const radioControl = tv({
|
|
|
81
81
|
},
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
const radioIndicator = tv({
|
|
84
|
+
export const radioIndicator = tv({
|
|
85
85
|
base: ["starwind-radio-indicator", "opacity-0 transition-opacity"],
|
|
86
86
|
variants: {
|
|
87
87
|
size: {
|
|
@@ -108,7 +108,7 @@ const {
|
|
|
108
108
|
} = Astro.props;
|
|
109
109
|
---
|
|
110
110
|
|
|
111
|
-
<div class={radioWrapper({ size })}>
|
|
111
|
+
<div class={radioWrapper({ size })} data-slot="radio-group-item-wrapper">
|
|
112
112
|
<input
|
|
113
113
|
type="radio"
|
|
114
114
|
class={radioItem()}
|
|
@@ -117,9 +117,10 @@ const {
|
|
|
117
117
|
value={value}
|
|
118
118
|
checked={checked}
|
|
119
119
|
disabled={disabled}
|
|
120
|
+
data-slot="radio-group-item"
|
|
120
121
|
{...rest}
|
|
121
122
|
/>
|
|
122
|
-
<span class={radioControl({ variant, class: className })}>
|
|
123
|
+
<span class={radioControl({ variant, class: className })} data-slot="radio-group-item-control">
|
|
123
124
|
<CircleFilled class={radioIndicator({ size })} />
|
|
124
125
|
</span>
|
|
125
126
|
</div>
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import RadioGroup from "./RadioGroup.astro";
|
|
2
|
-
import RadioGroupItem
|
|
1
|
+
import RadioGroup, { radioGroup } from "./RadioGroup.astro";
|
|
2
|
+
import RadioGroupItem, {
|
|
3
|
+
radioControl,
|
|
4
|
+
radioIndicator,
|
|
5
|
+
radioItem,
|
|
6
|
+
radioWrapper,
|
|
7
|
+
} from "./RadioGroupItem.astro";
|
|
3
8
|
import type { RadioGroupChangeEvent } from "./RadioGroupTypes";
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
const RadioGroupVariants = {
|
|
11
|
+
radioGroup,
|
|
12
|
+
radioWrapper,
|
|
13
|
+
radioItem,
|
|
14
|
+
radioControl,
|
|
15
|
+
radioIndicator,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { RadioGroup, type RadioGroupChangeEvent, RadioGroupItem, RadioGroupVariants };
|
|
6
19
|
|
|
7
20
|
export default {
|
|
8
21
|
Root: RadioGroup,
|