@starwind-ui/core 1.15.4 → 1.16.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.d.ts +1 -0
- package/dist/index.js +67 -43
- package/dist/index.js.map +1 -1
- package/dist/src/components/accordion/Accordion.astro +1 -1
- package/dist/src/components/accordion/AccordionContent.astro +1 -1
- package/dist/src/components/accordion/AccordionItem.astro +1 -1
- package/dist/src/components/accordion/AccordionTrigger.astro +1 -1
- package/dist/src/components/alert/Alert.astro +1 -1
- package/dist/src/components/alert/AlertDescription.astro +1 -1
- package/dist/src/components/alert/AlertTitle.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialog.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogAction.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogCancel.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogContent.astro +3 -3
- package/dist/src/components/alert-dialog/AlertDialogDescription.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogFooter.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogHeader.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogTitle.astro +1 -1
- package/dist/src/components/alert-dialog/AlertDialogTrigger.astro +2 -2
- package/dist/src/components/aspect-ratio/AspectRatio.astro +1 -1
- package/dist/src/components/avatar/Avatar.astro +1 -1
- package/dist/src/components/avatar/AvatarFallback.astro +1 -1
- package/dist/src/components/avatar/AvatarImage.astro +2 -2
- package/dist/src/components/badge/Badge.astro +1 -1
- package/dist/src/components/breadcrumb/Breadcrumb.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbEllipsis.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbItem.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbLink.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbList.astro +2 -2
- package/dist/src/components/breadcrumb/BreadcrumbPage.astro +1 -1
- package/dist/src/components/breadcrumb/BreadcrumbSeparator.astro +1 -1
- package/dist/src/components/button/Button.astro +1 -1
- package/dist/src/components/button-group/ButtonGroup.astro +1 -1
- package/dist/src/components/button-group/ButtonGroupSeparator.astro +1 -1
- package/dist/src/components/button-group/ButtonGroupText.astro +1 -1
- package/dist/src/components/card/Card.astro +1 -1
- package/dist/src/components/card/CardAction.astro +1 -1
- package/dist/src/components/card/CardContent.astro +1 -1
- package/dist/src/components/card/CardDescription.astro +1 -1
- package/dist/src/components/card/CardFooter.astro +1 -1
- package/dist/src/components/card/CardHeader.astro +1 -1
- package/dist/src/components/card/CardTitle.astro +1 -1
- package/dist/src/components/carousel/Carousel.astro +1 -1
- package/dist/src/components/carousel/CarouselContent.astro +1 -1
- package/dist/src/components/carousel/CarouselItem.astro +1 -1
- package/dist/src/components/carousel/CarouselNext.astro +1 -1
- package/dist/src/components/carousel/CarouselPrevious.astro +1 -1
- package/dist/src/components/checkbox/Checkbox.astro +1 -1
- package/dist/src/components/collapsible/Collapsible.astro +1 -1
- package/dist/src/components/collapsible/CollapsibleContent.astro +1 -1
- package/dist/src/components/collapsible/CollapsibleTrigger.astro +1 -1
- package/dist/src/components/dialog/Dialog.astro +1 -1
- package/dist/src/components/dialog/DialogClose.astro +1 -1
- package/dist/src/components/dialog/DialogContent.astro +2 -2
- package/dist/src/components/dialog/DialogDescription.astro +1 -1
- package/dist/src/components/dialog/DialogFooter.astro +1 -1
- package/dist/src/components/dialog/DialogHeader.astro +1 -1
- package/dist/src/components/dialog/DialogTitle.astro +1 -1
- package/dist/src/components/dialog/DialogTrigger.astro +1 -1
- package/dist/src/components/dropdown/Dropdown.astro +261 -34
- package/dist/src/components/dropdown/DropdownContent.astro +41 -5
- package/dist/src/components/dropdown/DropdownItem.astro +2 -2
- package/dist/src/components/dropdown/DropdownLabel.astro +2 -2
- package/dist/src/components/dropdown/DropdownSeparator.astro +1 -1
- package/dist/src/components/dropdown/DropdownShortcut.astro +17 -0
- package/dist/src/components/dropdown/DropdownSub.astro +15 -0
- package/dist/src/components/dropdown/DropdownSubContent.astro +36 -0
- package/dist/src/components/dropdown/DropdownSubTrigger.astro +34 -0
- package/dist/src/components/dropdown/DropdownTrigger.astro +1 -1
- package/dist/src/components/dropdown/index.ts +12 -0
- package/dist/src/components/dropzone/DropzoneFilesList.astro +1 -1
- package/dist/src/components/image/Image.astro +1 -1
- package/dist/src/components/input/Input.astro +1 -1
- package/dist/src/components/input-group/InputGroup.astro +28 -0
- package/dist/src/components/input-group/InputGroupAddon.astro +79 -0
- package/dist/src/components/input-group/InputGroupButton.astro +34 -0
- package/dist/src/components/input-group/InputGroupInput.astro +16 -0
- package/dist/src/components/input-group/InputGroupText.astro +17 -0
- package/dist/src/components/input-group/InputGroupTextarea.astro +20 -0
- package/dist/src/components/input-group/index.ts +33 -0
- package/dist/src/components/input-otp/InputOtp.astro +1 -1
- package/dist/src/components/input-otp/InputOtpGroup.astro +1 -1
- package/dist/src/components/input-otp/InputOtpSeparator.astro +1 -1
- package/dist/src/components/input-otp/InputOtpSlot.astro +1 -1
- package/dist/src/components/item/Item.astro +1 -1
- package/dist/src/components/item/ItemActions.astro +1 -1
- package/dist/src/components/item/ItemContent.astro +1 -1
- package/dist/src/components/item/ItemDescription.astro +1 -1
- package/dist/src/components/item/ItemFooter.astro +1 -1
- package/dist/src/components/item/ItemGroup.astro +1 -1
- package/dist/src/components/item/ItemHeader.astro +1 -1
- package/dist/src/components/item/ItemMedia.astro +1 -1
- package/dist/src/components/item/ItemSeparator.astro +1 -1
- package/dist/src/components/item/ItemTitle.astro +1 -1
- package/dist/src/components/kbd/Kbd.astro +1 -1
- package/dist/src/components/kbd/KbdGroup.astro +1 -1
- package/dist/src/components/label/Label.astro +1 -1
- package/dist/src/components/native-select/NativeSelect.astro +64 -0
- package/dist/src/components/native-select/NativeSelectOptGroup.astro +15 -0
- package/dist/src/components/native-select/NativeSelectOption.astro +15 -0
- package/dist/src/components/native-select/index.ts +21 -0
- package/dist/src/components/pagination/Pagination.astro +1 -1
- package/dist/src/components/pagination/PaginationContent.astro +1 -1
- package/dist/src/components/pagination/PaginationEllipsis.astro +1 -1
- package/dist/src/components/pagination/PaginationItem.astro +1 -1
- package/dist/src/components/pagination/PaginationLink.astro +1 -1
- package/dist/src/components/pagination/PaginationNext.astro +1 -1
- package/dist/src/components/pagination/PaginationPrevious.astro +1 -1
- package/dist/src/components/popover/Popover.astro +717 -0
- package/dist/src/components/popover/PopoverContent.astro +102 -0
- package/dist/src/components/popover/PopoverDescription.astro +14 -0
- package/dist/src/components/popover/PopoverHeader.astro +14 -0
- package/dist/src/components/popover/PopoverTitle.astro +14 -0
- package/dist/src/components/popover/PopoverTrigger.astro +51 -0
- package/dist/src/components/popover/index.ts +34 -0
- package/dist/src/components/progress/Progress.astro +1 -1
- package/dist/src/components/prose/Prose.astro +1 -1
- package/dist/src/components/radio-group/RadioGroup.astro +1 -1
- package/dist/src/components/radio-group/RadioGroupItem.astro +1 -1
- package/dist/src/components/select/Select.astro +1 -1
- package/dist/src/components/select/SelectContent.astro +1 -1
- package/dist/src/components/select/SelectItem.astro +1 -1
- package/dist/src/components/select/SelectLabel.astro +1 -1
- package/dist/src/components/select/SelectSearch.astro +1 -1
- package/dist/src/components/select/SelectSeparator.astro +1 -1
- package/dist/src/components/select/SelectTrigger.astro +1 -1
- package/dist/src/components/select/SelectValue.astro +1 -1
- package/dist/src/components/separator/Separator.astro +1 -1
- package/dist/src/components/sheet/Sheet.astro +1 -1
- package/dist/src/components/sheet/SheetContent.astro +1 -1
- package/dist/src/components/sheet/SheetDescription.astro +1 -1
- package/dist/src/components/sheet/SheetFooter.astro +1 -1
- package/dist/src/components/sheet/SheetHeader.astro +1 -1
- package/dist/src/components/sheet/SheetTitle.astro +1 -1
- package/dist/src/components/sidebar/Sidebar.astro +19 -2
- package/dist/src/components/sidebar/SidebarContent.astro +1 -1
- package/dist/src/components/sidebar/SidebarFooter.astro +1 -1
- package/dist/src/components/sidebar/SidebarGroup.astro +1 -1
- package/dist/src/components/sidebar/SidebarGroupContent.astro +1 -1
- package/dist/src/components/sidebar/SidebarGroupLabel.astro +2 -2
- package/dist/src/components/sidebar/SidebarHeader.astro +1 -1
- package/dist/src/components/sidebar/SidebarInput.astro +1 -1
- package/dist/src/components/sidebar/SidebarInset.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenu.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuAction.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuBadge.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuButton.astro +2 -14
- package/dist/src/components/sidebar/SidebarMenuItem.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuSkeleton.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuSub.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuSubButton.astro +1 -1
- package/dist/src/components/sidebar/SidebarMenuSubItem.astro +1 -1
- package/dist/src/components/sidebar/SidebarProvider.astro +1 -1
- package/dist/src/components/sidebar/SidebarRail.astro +2 -2
- package/dist/src/components/sidebar/SidebarSeparator.astro +1 -1
- package/dist/src/components/sidebar/SidebarTrigger.astro +1 -1
- package/dist/src/components/skeleton/Skeleton.astro +1 -1
- package/dist/src/components/slider/Slider.astro +1 -1
- package/dist/src/components/spinner/Spinner.astro +1 -1
- package/dist/src/components/switch/Switch.astro +1 -1
- package/dist/src/components/table/Table.astro +1 -1
- package/dist/src/components/table/TableBody.astro +1 -1
- package/dist/src/components/table/TableCaption.astro +1 -1
- package/dist/src/components/table/TableCell.astro +1 -1
- package/dist/src/components/table/TableFoot.astro +1 -1
- package/dist/src/components/table/TableHead.astro +1 -1
- package/dist/src/components/table/TableHeader.astro +1 -1
- package/dist/src/components/table/TableRow.astro +1 -1
- package/dist/src/components/tabs/Tabs.astro +1 -1
- package/dist/src/components/tabs/TabsContent.astro +1 -1
- package/dist/src/components/tabs/TabsList.astro +1 -1
- package/dist/src/components/tabs/TabsTrigger.astro +1 -1
- package/dist/src/components/textarea/Textarea.astro +1 -1
- package/dist/src/components/theme-toggle/ThemeToggle.astro +1 -1
- package/dist/src/components/toast/ToastDescription.astro +1 -1
- package/dist/src/components/toast/ToastItem.astro +1 -1
- package/dist/src/components/toast/Toaster.astro +1 -1
- package/dist/src/components/toggle/Toggle.astro +1 -1
- package/dist/src/components/tooltip/Tooltip.astro +260 -122
- package/dist/src/components/tooltip/TooltipContent.astro +13 -23
- package/dist/src/components/video/Video.astro +2 -2
- package/dist/src/lib/utils/starwind/positioning.ts +318 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Side of the popover
|
|
8
|
+
* @default bottom
|
|
9
|
+
*/
|
|
10
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
11
|
+
/**
|
|
12
|
+
* Alignment of the popover
|
|
13
|
+
* @default center
|
|
14
|
+
*/
|
|
15
|
+
align?: "start" | "center" | "end";
|
|
16
|
+
/**
|
|
17
|
+
* Offset distance in pixels
|
|
18
|
+
* @default 4
|
|
19
|
+
*/
|
|
20
|
+
sideOffset?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Open and close animation duration in milliseconds
|
|
23
|
+
* @default 150
|
|
24
|
+
*/
|
|
25
|
+
animationDuration?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Accessible name for the dialog when a PopoverTitle is not present.
|
|
28
|
+
* If neither aria-label nor aria-labelledby is provided, a fallback label is applied.
|
|
29
|
+
*/
|
|
30
|
+
"aria-label"?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const popoverContent = tv({
|
|
34
|
+
base: [
|
|
35
|
+
"starwind-popover-content",
|
|
36
|
+
"bg-popover text-popover-foreground z-50 flex w-72 flex-col gap-2.5 overflow-x-hidden overflow-y-auto rounded-lg border p-2.5 shadow-md",
|
|
37
|
+
"data-[state=open]:animate-in fade-in zoom-in-95",
|
|
38
|
+
"data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out zoom-out-95",
|
|
39
|
+
"fixed isolate will-change-transform",
|
|
40
|
+
],
|
|
41
|
+
variants: {
|
|
42
|
+
side: {
|
|
43
|
+
bottom: "slide-in-from-top-2 slide-out-to-top-2",
|
|
44
|
+
top: "slide-in-from-bottom-2 slide-out-to-bottom-2",
|
|
45
|
+
right: "slide-in-from-left-2 slide-out-to-left-2",
|
|
46
|
+
left: "slide-in-from-right-2 slide-out-to-right-2",
|
|
47
|
+
},
|
|
48
|
+
align: {
|
|
49
|
+
start: "",
|
|
50
|
+
center: "",
|
|
51
|
+
end: "",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
compoundVariants: [
|
|
55
|
+
{
|
|
56
|
+
side: ["top", "bottom"],
|
|
57
|
+
align: "start",
|
|
58
|
+
class: "slide-in-from-left-1 slide-out-to-left-1",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
side: ["top", "bottom"],
|
|
62
|
+
align: "end",
|
|
63
|
+
class: "slide-in-from-right-1 slide-out-to-right-1",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
defaultVariants: {
|
|
67
|
+
side: "bottom",
|
|
68
|
+
align: "center",
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const {
|
|
73
|
+
class: className,
|
|
74
|
+
side = "bottom",
|
|
75
|
+
align = "center",
|
|
76
|
+
sideOffset = 4,
|
|
77
|
+
animationDuration = 150,
|
|
78
|
+
"aria-label": ariaLabel,
|
|
79
|
+
"aria-labelledby": ariaLabelledBy,
|
|
80
|
+
...rest
|
|
81
|
+
} = Astro.props;
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
<div
|
|
85
|
+
class={popoverContent({ side, align, class: className })}
|
|
86
|
+
data-side={side}
|
|
87
|
+
data-align={align}
|
|
88
|
+
data-side-offset={sideOffset}
|
|
89
|
+
data-state="closed"
|
|
90
|
+
role="dialog"
|
|
91
|
+
aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : "Popover dialog")}
|
|
92
|
+
aria-labelledby={ariaLabelledBy}
|
|
93
|
+
tabindex="-1"
|
|
94
|
+
style={{
|
|
95
|
+
display: "none",
|
|
96
|
+
animationDuration: `${animationDuration}ms`,
|
|
97
|
+
}}
|
|
98
|
+
{...rest}
|
|
99
|
+
data-slot="popover-content"
|
|
100
|
+
>
|
|
101
|
+
<slot />
|
|
102
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"p">;
|
|
6
|
+
|
|
7
|
+
export const popoverDescription = tv({ base: "text-muted-foreground" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<p class={popoverDescription({ class: className })} {...rest} data-slot="popover-description">
|
|
13
|
+
<slot />
|
|
14
|
+
</p>
|
|
@@ -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 popoverHeader = tv({ base: "flex flex-col gap-1" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class={popoverHeader({ class: className })} {...rest} data-slot="popover-header">
|
|
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<"h3">;
|
|
6
|
+
|
|
7
|
+
export const popoverTitle = tv({ base: "font-medium" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<h3 class={popoverTitle({ class: className })} {...rest} data-slot="popover-title">
|
|
13
|
+
<slot />
|
|
14
|
+
</h3>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
type Props = Omit<HTMLAttributes<"button">, "role" | "type"> & {
|
|
6
|
+
/**
|
|
7
|
+
* When true, the component will render its child element with a simple wrapper instead of a button component
|
|
8
|
+
*/
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const popoverTrigger = tv({
|
|
13
|
+
base: [
|
|
14
|
+
"starwind-popover-trigger",
|
|
15
|
+
"inline-flex items-center justify-center",
|
|
16
|
+
"focus-visible:ring-outline/50 transition-[color,box-shadow] outline-none focus-visible:ring-3",
|
|
17
|
+
"disabled:pointer-events-none",
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const { class: className, asChild = false, ...rest } = Astro.props;
|
|
22
|
+
|
|
23
|
+
let hasChildren = false;
|
|
24
|
+
if (Astro.slots.has("default")) {
|
|
25
|
+
hasChildren = true;
|
|
26
|
+
}
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
asChild && hasChildren ? (
|
|
31
|
+
<div
|
|
32
|
+
class:list={["starwind-popover-trigger", className]}
|
|
33
|
+
data-slot="popover-trigger"
|
|
34
|
+
data-as-child
|
|
35
|
+
>
|
|
36
|
+
<slot />
|
|
37
|
+
</div>
|
|
38
|
+
) : (
|
|
39
|
+
<button
|
|
40
|
+
class={popoverTrigger({ class: className })}
|
|
41
|
+
type="button"
|
|
42
|
+
aria-haspopup="dialog"
|
|
43
|
+
aria-expanded="false"
|
|
44
|
+
data-state="closed"
|
|
45
|
+
{...rest}
|
|
46
|
+
data-slot="popover-trigger"
|
|
47
|
+
>
|
|
48
|
+
<slot />
|
|
49
|
+
</button>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Popover, { popover } from "./Popover.astro";
|
|
2
|
+
import PopoverContent, { popoverContent } from "./PopoverContent.astro";
|
|
3
|
+
import PopoverDescription, { popoverDescription } from "./PopoverDescription.astro";
|
|
4
|
+
import PopoverHeader, { popoverHeader } from "./PopoverHeader.astro";
|
|
5
|
+
import PopoverTitle, { popoverTitle } from "./PopoverTitle.astro";
|
|
6
|
+
import PopoverTrigger, { popoverTrigger } from "./PopoverTrigger.astro";
|
|
7
|
+
|
|
8
|
+
const PopoverVariants = {
|
|
9
|
+
popover,
|
|
10
|
+
popoverContent,
|
|
11
|
+
popoverDescription,
|
|
12
|
+
popoverHeader,
|
|
13
|
+
popoverTitle,
|
|
14
|
+
popoverTrigger,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
Popover,
|
|
19
|
+
PopoverContent,
|
|
20
|
+
PopoverDescription,
|
|
21
|
+
PopoverHeader,
|
|
22
|
+
PopoverTitle,
|
|
23
|
+
PopoverTrigger,
|
|
24
|
+
PopoverVariants,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
Root: Popover,
|
|
29
|
+
Trigger: PopoverTrigger,
|
|
30
|
+
Content: PopoverContent,
|
|
31
|
+
Header: PopoverHeader,
|
|
32
|
+
Title: PopoverTitle,
|
|
33
|
+
Description: PopoverDescription,
|
|
34
|
+
};
|
|
@@ -80,8 +80,8 @@ const indicatorStyle = isIndeterminate
|
|
|
80
80
|
data-value={value}
|
|
81
81
|
data-max={max}
|
|
82
82
|
data-indeterminate={isIndeterminate}
|
|
83
|
-
data-slot="progress"
|
|
84
83
|
{...rest}
|
|
84
|
+
data-slot="progress"
|
|
85
85
|
>
|
|
86
86
|
<div class:list={[indicatorClasses]} style={indicatorStyle}></div>
|
|
87
87
|
</div>
|
|
@@ -11,7 +11,7 @@ type Props = HTMLAttributes<"div">;
|
|
|
11
11
|
const { class: className, ...rest } = Astro.props;
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
<div class:list={[prose({ class: className })]} data-slot="prose"
|
|
14
|
+
<div class:list={[prose({ class: className })]} {...rest} data-slot="prose"><slot /></div>
|
|
15
15
|
|
|
16
16
|
<style is:global>
|
|
17
17
|
/* ==========================================================================
|
|
@@ -53,8 +53,8 @@ const {
|
|
|
53
53
|
class:list={[radioGroup({ orientation, class: className })]}
|
|
54
54
|
data-value={value || defaultValue}
|
|
55
55
|
disabled={disabled}
|
|
56
|
-
data-slot="radio-group"
|
|
57
56
|
{...rest}
|
|
57
|
+
data-slot="radio-group"
|
|
58
58
|
>
|
|
59
59
|
{legend && <legend class="sr-only">{legend}</legend>}
|
|
60
60
|
<slot />
|
|
@@ -118,8 +118,8 @@ const {
|
|
|
118
118
|
value={value}
|
|
119
119
|
checked={checked}
|
|
120
120
|
disabled={disabled}
|
|
121
|
-
data-slot="radio-group-item"
|
|
122
121
|
{...rest}
|
|
122
|
+
data-slot="radio-group-item"
|
|
123
123
|
/>
|
|
124
124
|
<span class={radioControl({ variant, class: className })} data-slot="radio-group-item-control">
|
|
125
125
|
<slot name="icon">
|
|
@@ -77,7 +77,6 @@ const {
|
|
|
77
77
|
data-side={side}
|
|
78
78
|
data-align={align}
|
|
79
79
|
data-state="closed"
|
|
80
|
-
data-slot="select-content"
|
|
81
80
|
tabindex="-1"
|
|
82
81
|
style={{
|
|
83
82
|
// hide the content initially. Script will remove this
|
|
@@ -87,6 +86,7 @@ const {
|
|
|
87
86
|
marginBottom: side === "top" ? `${sideOffset}px` : undefined,
|
|
88
87
|
}}
|
|
89
88
|
{...rest}
|
|
89
|
+
data-slot="select-content"
|
|
90
90
|
>
|
|
91
91
|
<div class={selectContentInner()}>
|
|
92
92
|
<slot />
|
|
@@ -34,11 +34,11 @@ const { class: className, value, disabled, ...rest } = Astro.props;
|
|
|
34
34
|
class={selectItem({ class: className })}
|
|
35
35
|
data-value={value}
|
|
36
36
|
data-disabled={disabled}
|
|
37
|
-
data-slot="select-item"
|
|
38
37
|
aria-selected="false"
|
|
39
38
|
role="option"
|
|
40
39
|
tabindex="0"
|
|
41
40
|
{...rest}
|
|
41
|
+
data-slot="select-item"
|
|
42
42
|
>
|
|
43
43
|
<span>
|
|
44
44
|
<slot />
|
|
@@ -9,6 +9,6 @@ export const selectLabel = tv({ base: "text-muted-foreground py-1.5 pr-8 pl-2" }
|
|
|
9
9
|
const { class: className, ...rest } = Astro.props;
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<div class={selectLabel({ class: className })} data-slot="select-label"
|
|
12
|
+
<div class={selectLabel({ class: className })} {...rest} data-slot="select-label">
|
|
13
13
|
<slot />
|
|
14
14
|
</div>
|
|
@@ -36,11 +36,11 @@ const {
|
|
|
36
36
|
<input
|
|
37
37
|
type="text"
|
|
38
38
|
class={selectSearch({ class: className })}
|
|
39
|
-
data-slot="select-search"
|
|
40
39
|
placeholder={placeholder}
|
|
41
40
|
autocomplete="off"
|
|
42
41
|
aria-label={placeholder}
|
|
43
42
|
{...rest}
|
|
43
|
+
data-slot="select-search"
|
|
44
44
|
/>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
@@ -9,4 +9,4 @@ export const selectSeparator = tv({ base: "bg-muted -mx-1 my-1 h-px" });
|
|
|
9
9
|
const { class: className, ...rest } = Astro.props;
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<div class={selectSeparator({ class: className })} data-slot="select-separator"
|
|
12
|
+
<div class={selectSeparator({ class: className })} {...rest} data-slot="select-separator"></div>
|
|
@@ -14,6 +14,6 @@ export const selectValue = tv({ base: "pointer-events-none" });
|
|
|
14
14
|
const { placeholder = "select", class: className, ...rest } = Astro.props;
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
<span class={selectValue({ class: className })} data-slot="select-value"
|
|
17
|
+
<span class={selectValue({ class: className })} {...rest} data-slot="select-value">
|
|
18
18
|
{placeholder}
|
|
19
19
|
</span>
|
|
@@ -30,7 +30,7 @@ const { class: className, orientation = "horizontal", ...rest } = Astro.props;
|
|
|
30
30
|
role="separator"
|
|
31
31
|
aria-orientation={orientation}
|
|
32
32
|
class={separator({ orientation, class: className })}
|
|
33
|
-
data-slot="separator"
|
|
34
33
|
{...rest}
|
|
34
|
+
data-slot="separator"
|
|
35
35
|
>
|
|
36
36
|
</div>
|
|
@@ -8,6 +8,6 @@ type Props = ComponentProps<typeof Dialog>;
|
|
|
8
8
|
const { class: className, ...rest } = Astro.props;
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
<Dialog class:list={["starwind-sheet", className]} data-slot="sheet"
|
|
11
|
+
<Dialog class:list={["starwind-sheet", className]} {...rest} data-slot="sheet">
|
|
12
12
|
<slot />
|
|
13
13
|
</Dialog>
|
|
@@ -111,8 +111,8 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
|
111
111
|
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
112
112
|
className,
|
|
113
113
|
]}
|
|
114
|
-
data-slot="sidebar"
|
|
115
114
|
{...rest}
|
|
115
|
+
data-slot="sidebar"
|
|
116
116
|
>
|
|
117
117
|
<slot />
|
|
118
118
|
</div>
|
|
@@ -132,7 +132,7 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
|
132
132
|
<div data-slot="sidebar-gap" class={sidebarGap({ variant })} />
|
|
133
133
|
|
|
134
134
|
{/* Fixed sidebar container */}
|
|
135
|
-
<div
|
|
135
|
+
<div class={sidebarContainer({ side, variant })} {...rest} data-slot="sidebar-container">
|
|
136
136
|
<div data-slot="sidebar-inner" class={sidebarInner({ variant })}>
|
|
137
137
|
<slot />
|
|
138
138
|
</div>
|
|
@@ -182,6 +182,7 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
|
182
182
|
private init() {
|
|
183
183
|
this.updateState();
|
|
184
184
|
this.provider.addEventListener("sidebar:change", this.boundUpdateState);
|
|
185
|
+
this.provider.addEventListener("sidebar:mobile-change", this.boundUpdateState);
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
private updateState() {
|
|
@@ -193,6 +194,22 @@ const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
|
193
194
|
} else {
|
|
194
195
|
this.sidebar.setAttribute("data-collapsible", "");
|
|
195
196
|
}
|
|
197
|
+
|
|
198
|
+
this.syncSidebarMenuTooltips();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
private syncSidebarMenuTooltips() {
|
|
202
|
+
const hasEnabledSidebar = Array.from(
|
|
203
|
+
document.querySelectorAll<HTMLElement>(
|
|
204
|
+
'[data-slot="sidebar"][data-collapsible-mode="icon"][data-state="collapsed"]',
|
|
205
|
+
),
|
|
206
|
+
).some((sidebar) => getComputedStyle(sidebar).display !== "none");
|
|
207
|
+
|
|
208
|
+
if (hasEnabledSidebar) {
|
|
209
|
+
document.documentElement.setAttribute("data-starwind-sidebar-tooltips", "enabled");
|
|
210
|
+
} else {
|
|
211
|
+
document.documentElement.removeAttribute("data-starwind-sidebar-tooltips");
|
|
212
|
+
}
|
|
196
213
|
}
|
|
197
214
|
}
|
|
198
215
|
|
|
@@ -13,9 +13,9 @@ const { class: className, ...rest } = Astro.props;
|
|
|
13
13
|
|
|
14
14
|
<div
|
|
15
15
|
class={sidebarGroupContent({ class: className })}
|
|
16
|
-
data-slot="sidebar-group-content"
|
|
17
16
|
data-sidebar="group-content"
|
|
18
17
|
{...rest}
|
|
18
|
+
data-slot="sidebar-group-content"
|
|
19
19
|
>
|
|
20
20
|
<slot />
|
|
21
21
|
</div>
|
|
@@ -32,19 +32,19 @@ if (Astro.slots.has("default")) {
|
|
|
32
32
|
asChild && hasChildren ? (
|
|
33
33
|
<div
|
|
34
34
|
class={sidebarGroupLabel({ class: className })}
|
|
35
|
-
data-slot="sidebar-group-label"
|
|
36
35
|
data-sidebar="group-label"
|
|
37
36
|
data-as-child
|
|
38
37
|
{...rest}
|
|
38
|
+
data-slot="sidebar-group-label"
|
|
39
39
|
>
|
|
40
40
|
<slot />
|
|
41
41
|
</div>
|
|
42
42
|
) : (
|
|
43
43
|
<div
|
|
44
44
|
class={sidebarGroupLabel({ class: className })}
|
|
45
|
-
data-slot="sidebar-group-label"
|
|
46
45
|
data-sidebar="group-label"
|
|
47
46
|
{...rest}
|
|
47
|
+
data-slot="sidebar-group-label"
|
|
48
48
|
>
|
|
49
49
|
<slot />
|
|
50
50
|
</div>
|
|
@@ -16,6 +16,6 @@ export const sidebarInset = tv({
|
|
|
16
16
|
const { class: className, ...rest } = Astro.props;
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
<main class={sidebarInset({ class: className })} data-slot="sidebar-inset"
|
|
19
|
+
<main class={sidebarInset({ class: className })} {...rest} data-slot="sidebar-inset">
|
|
20
20
|
<slot />
|
|
21
21
|
</main>
|
|
@@ -79,7 +79,7 @@ const buttonDataAttrs = {
|
|
|
79
79
|
|
|
80
80
|
{
|
|
81
81
|
tooltip ? (
|
|
82
|
-
<Tooltip openDelay={0} closeDelay={0} class="w-full">
|
|
82
|
+
<Tooltip openDelay={0} closeDelay={0} class="starwind-sidebar-menu-button-tooltip w-full">
|
|
83
83
|
<TooltipTrigger>
|
|
84
84
|
{asChild ? (
|
|
85
85
|
<div class={buttonClasses} {...buttonDataAttrs} data-as-child>
|
|
@@ -111,19 +111,7 @@ const buttonDataAttrs = {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
<style is:global>
|
|
114
|
-
|
|
115
|
-
[data-slot="sidebar"][data-state="expanded"] .starwind-sidebar-tooltip-content,
|
|
116
|
-
[data-slot="sidebar"]:not([data-collapsible="icon"]) .starwind-sidebar-tooltip-content {
|
|
114
|
+
:root:not([data-starwind-sidebar-tooltips="enabled"]) .starwind-sidebar-tooltip-content {
|
|
117
115
|
display: none !important;
|
|
118
116
|
}
|
|
119
|
-
|
|
120
|
-
/* Hide tooltips in mobile sheet */
|
|
121
|
-
.starwind-sheet .starwind-sidebar-tooltip-content {
|
|
122
|
-
display: none !important;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/* Only show tooltip trigger wrapper styles when collapsed */
|
|
126
|
-
.starwind-sidebar-menu-button-tooltip-trigger {
|
|
127
|
-
display: contents;
|
|
128
|
-
}
|
|
129
117
|
</style>
|