@rimelight/ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/i18n-data.json +186 -0
- package/package.json +49 -0
- package/src/components/FormattedDate.astro +22 -0
- package/src/components/HeaderLink.astro +24 -0
- package/src/components/HttpObservatory.astro +103 -0
- package/src/components/LighthouseScores.astro +204 -0
- package/src/components/MissingTranslationBanner.astro +39 -0
- package/src/components/TableOfContents.astro +106 -0
- package/src/components/ThemeToggle.astro +71 -0
- package/src/components/accordion/Accordion.astro +257 -0
- package/src/components/accordion/AccordionContent.astro +34 -0
- package/src/components/accordion/AccordionItem.astro +29 -0
- package/src/components/accordion/AccordionTrigger.astro +33 -0
- package/src/components/alert/Alert.astro +34 -0
- package/src/components/alert/AlertDescription.astro +15 -0
- package/src/components/alert/AlertTitle.astro +17 -0
- package/src/components/alert-dialog/AlertDialog.astro +275 -0
- package/src/components/alert-dialog/AlertDialogAction.astro +46 -0
- package/src/components/alert-dialog/AlertDialogCancel.astro +46 -0
- package/src/components/alert-dialog/AlertDialogContent.astro +52 -0
- package/src/components/alert-dialog/AlertDialogDescription.astro +18 -0
- package/src/components/alert-dialog/AlertDialogFooter.astro +16 -0
- package/src/components/alert-dialog/AlertDialogHeader.astro +14 -0
- package/src/components/alert-dialog/AlertDialogTitle.astro +20 -0
- package/src/components/alert-dialog/AlertDialogTrigger.astro +47 -0
- package/src/components/aspect-ratio/AspectRatio.astro +32 -0
- package/src/components/avatar/Avatar.astro +29 -0
- package/src/components/avatar/AvatarFallback.astro +18 -0
- package/src/components/avatar/AvatarImage.astro +66 -0
- package/src/components/badge/Badge.astro +57 -0
- package/src/components/breadcrumb/Breadcrumb.astro +12 -0
- package/src/components/breadcrumb/BreadcrumbEllipsis.astro +29 -0
- package/src/components/breadcrumb/BreadcrumbItem.astro +15 -0
- package/src/components/breadcrumb/BreadcrumbLink.astro +24 -0
- package/src/components/breadcrumb/BreadcrumbList.astro +17 -0
- package/src/components/breadcrumb/BreadcrumbPage.astro +22 -0
- package/src/components/breadcrumb/BreadcrumbSeparator.astro +24 -0
- package/src/components/button/Button.astro +58 -0
- package/src/components/button-group/ButtonGroup.astro +64 -0
- package/src/components/button-group/ButtonGroupSeparator.astro +20 -0
- package/src/components/button-group/ButtonGroupText.astro +19 -0
- package/src/components/card/Card.astro +36 -0
- package/src/components/card/CardAction.astro +16 -0
- package/src/components/card/CardContent.astro +16 -0
- package/src/components/card/CardDescription.astro +16 -0
- package/src/components/card/CardFooter.astro +16 -0
- package/src/components/card/CardHeader.astro +19 -0
- package/src/components/card/CardTitle.astro +16 -0
- package/src/components/carousel/Carousel.astro +55 -0
- package/src/components/carousel/CarouselContent.astro +26 -0
- package/src/components/carousel/CarouselItem.astro +26 -0
- package/src/components/carousel/CarouselNext.astro +39 -0
- package/src/components/carousel/CarouselPrevious.astro +41 -0
- package/src/components/carousel/carousel-script.ts +188 -0
- package/src/components/carousel/index.ts +1 -0
- package/src/components/checkbox/Checkbox.astro +133 -0
- package/src/components/collapsible/Collapsible.astro +161 -0
- package/src/components/collapsible/CollapsibleContent.astro +22 -0
- package/src/components/collapsible/CollapsibleTrigger.astro +44 -0
- package/src/components/dialog/Dialog.astro +389 -0
- package/src/components/dialog/DialogClose.astro +35 -0
- package/src/components/dialog/DialogContent.astro +78 -0
- package/src/components/dialog/DialogDescription.astro +14 -0
- package/src/components/dialog/DialogFooter.astro +14 -0
- package/src/components/dialog/DialogHeader.astro +14 -0
- package/src/components/dialog/DialogTitle.astro +18 -0
- package/src/components/dialog/DialogTrigger.astro +47 -0
- package/src/components/dropdown/Dropdown.astro +604 -0
- package/src/components/dropdown/DropdownContent.astro +118 -0
- package/src/components/dropdown/DropdownItem.astro +48 -0
- package/src/components/dropdown/DropdownLabel.astro +29 -0
- package/src/components/dropdown/DropdownSeparator.astro +21 -0
- package/src/components/dropdown/DropdownShortcut.astro +17 -0
- package/src/components/dropdown/DropdownSub.astro +15 -0
- package/src/components/dropdown/DropdownSubContent.astro +39 -0
- package/src/components/dropdown/DropdownSubTrigger.astro +34 -0
- package/src/components/dropdown/DropdownTrigger.astro +52 -0
- package/src/components/dropzone/Dropzone.astro +236 -0
- package/src/components/dropzone/DropzoneFilesList.astro +26 -0
- package/src/components/dropzone/DropzoneLoadingIndicator.astro +10 -0
- package/src/components/dropzone/DropzoneUploadIndicator.astro +10 -0
- package/src/components/embeds/YoutubeEmbed.astro +94 -0
- package/src/components/hero/Hero.astro +166 -0
- package/src/components/icons/Flag.astro +62 -0
- package/src/components/image/ExtendedImage.astro +46 -0
- package/src/components/image/Image.astro +25 -0
- package/src/components/input/Input.astro +27 -0
- package/src/components/input-group/InputGroup.astro +28 -0
- package/src/components/input-group/InputGroupAddon.astro +76 -0
- package/src/components/input-group/InputGroupButton.astro +36 -0
- package/src/components/input-group/InputGroupInput.astro +18 -0
- package/src/components/input-group/InputGroupText.astro +17 -0
- package/src/components/input-group/InputGroupTextarea.astro +22 -0
- package/src/components/input-otp/InputOtp.astro +352 -0
- package/src/components/input-otp/InputOtpGroup.astro +16 -0
- package/src/components/input-otp/InputOtpSeparator.astro +25 -0
- package/src/components/input-otp/InputOtpSlot.astro +50 -0
- package/src/components/input-otp/InputOtpTypes.ts +6 -0
- package/src/components/item/Item.astro +52 -0
- package/src/components/item/ItemActions.astro +16 -0
- package/src/components/item/ItemContent.astro +16 -0
- package/src/components/item/ItemDescription.astro +19 -0
- package/src/components/item/ItemFooter.astro +16 -0
- package/src/components/item/ItemGroup.astro +16 -0
- package/src/components/item/ItemHeader.astro +16 -0
- package/src/components/item/ItemMedia.astro +40 -0
- package/src/components/item/ItemSeparator.astro +23 -0
- package/src/components/item/ItemTitle.astro +16 -0
- package/src/components/kbd/Kbd.astro +21 -0
- package/src/components/kbd/KbdGroup.astro +16 -0
- package/src/components/label/Label.astro +24 -0
- package/src/components/marquee/Marquee.astro +73 -0
- package/src/components/native-select/NativeSelect.astro +68 -0
- package/src/components/native-select/NativeSelectOptGroup.astro +15 -0
- package/src/components/native-select/NativeSelectOption.astro +15 -0
- package/src/components/pagination/Pagination.astro +20 -0
- package/src/components/pagination/PaginationContent.astro +16 -0
- package/src/components/pagination/PaginationEllipsis.astro +37 -0
- package/src/components/pagination/PaginationItem.astro +16 -0
- package/src/components/pagination/PaginationLink.astro +27 -0
- package/src/components/pagination/PaginationNext.astro +33 -0
- package/src/components/pagination/PaginationPrevious.astro +33 -0
- package/src/components/popover/Popover.astro +717 -0
- package/src/components/popover/PopoverContent.astro +102 -0
- package/src/components/popover/PopoverDescription.astro +14 -0
- package/src/components/popover/PopoverHeader.astro +14 -0
- package/src/components/popover/PopoverTitle.astro +14 -0
- package/src/components/popover/PopoverTrigger.astro +51 -0
- package/src/components/progress/Progress.astro +154 -0
- package/src/components/prose/Prose.astro +619 -0
- package/src/components/radio-group/RadioGroup.astro +162 -0
- package/src/components/radio-group/RadioGroupItem.astro +133 -0
- package/src/components/radio-group/RadioGroupTypes.ts +6 -0
- package/src/components/section/Section.astro +167 -0
- package/src/components/select/Select.astro +752 -0
- package/src/components/select/SelectContent.astro +94 -0
- package/src/components/select/SelectGroup.astro +9 -0
- package/src/components/select/SelectItem.astro +51 -0
- package/src/components/select/SelectLabel.astro +14 -0
- package/src/components/select/SelectSearch.astro +49 -0
- package/src/components/select/SelectSeparator.astro +12 -0
- package/src/components/select/SelectTrigger.astro +56 -0
- package/src/components/select/SelectTypes.ts +13 -0
- package/src/components/select/SelectValue.astro +19 -0
- package/src/components/separator/Separator.astro +36 -0
- package/src/components/sheet/Sheet.astro +15 -0
- package/src/components/sheet/SheetClose.astro +15 -0
- package/src/components/sheet/SheetContent.astro +89 -0
- package/src/components/sheet/SheetDescription.astro +16 -0
- package/src/components/sheet/SheetFooter.astro +16 -0
- package/src/components/sheet/SheetHeader.astro +16 -0
- package/src/components/sheet/SheetTitle.astro +16 -0
- package/src/components/sheet/SheetTrigger.astro +15 -0
- package/src/components/sidebar/Sidebar.astro +231 -0
- package/src/components/sidebar/SidebarContent.astro +25 -0
- package/src/components/sidebar/SidebarFooter.astro +22 -0
- package/src/components/sidebar/SidebarGroup.astro +22 -0
- package/src/components/sidebar/SidebarGroupContent.astro +22 -0
- package/src/components/sidebar/SidebarGroupLabel.astro +53 -0
- package/src/components/sidebar/SidebarHeader.astro +22 -0
- package/src/components/sidebar/SidebarInput.astro +24 -0
- package/src/components/sidebar/SidebarInset.astro +22 -0
- package/src/components/sidebar/SidebarMenu.astro +22 -0
- package/src/components/sidebar/SidebarMenuAction.astro +63 -0
- package/src/components/sidebar/SidebarMenuBadge.astro +31 -0
- package/src/components/sidebar/SidebarMenuButton.astro +124 -0
- package/src/components/sidebar/SidebarMenuItem.astro +22 -0
- package/src/components/sidebar/SidebarMenuSkeleton.astro +43 -0
- package/src/components/sidebar/SidebarMenuSub.astro +25 -0
- package/src/components/sidebar/SidebarMenuSubButton.astro +52 -0
- package/src/components/sidebar/SidebarMenuSubItem.astro +17 -0
- package/src/components/sidebar/SidebarProvider.astro +215 -0
- package/src/components/sidebar/SidebarRail.astro +72 -0
- package/src/components/sidebar/SidebarSeparator.astro +25 -0
- package/src/components/sidebar/SidebarTrigger.astro +69 -0
- package/src/components/skeleton/Skeleton.astro +14 -0
- package/src/components/slider/Slider.astro +425 -0
- package/src/components/spinner/Spinner.astro +23 -0
- package/src/components/switch/Switch.astro +192 -0
- package/src/components/switch/SwitchTypes.ts +6 -0
- package/src/components/table/Table.astro +20 -0
- package/src/components/table/TableBody.astro +18 -0
- package/src/components/table/TableCaption.astro +18 -0
- package/src/components/table/TableCell.astro +18 -0
- package/src/components/table/TableFoot.astro +18 -0
- package/src/components/table/TableHead.astro +18 -0
- package/src/components/table/TableHeader.astro +18 -0
- package/src/components/table/TableRow.astro +17 -0
- package/src/components/tabs/Tabs.astro +270 -0
- package/src/components/tabs/TabsContent.astro +28 -0
- package/src/components/tabs/TabsList.astro +23 -0
- package/src/components/tabs/TabsTrigger.astro +34 -0
- package/src/components/textarea/Textarea.astro +31 -0
- package/src/components/toast/ToastDescription.astro +22 -0
- package/src/components/toast/ToastItem.astro +56 -0
- package/src/components/toast/ToastTemplate.astro +27 -0
- package/src/components/toast/ToastTitle.astro +59 -0
- package/src/components/toast/Toaster.astro +981 -0
- package/src/components/toast/index.ts +1 -0
- package/src/components/toast/toast-manager.ts +234 -0
- package/src/components/toggle/Toggle.astro +174 -0
- package/src/components/toggle/ToggleTypes.ts +14 -0
- package/src/components/tooltip/Tooltip.astro +422 -0
- package/src/components/tooltip/TooltipContent.astro +83 -0
- package/src/components/tooltip/TooltipTrigger.astro +13 -0
- package/src/components/video/Video.astro +121 -0
- package/src/config/cookies.ts +5 -0
- package/src/config/index.ts +3 -0
- package/src/config/links.ts +4 -0
- package/src/config/site.config.ts +45 -0
- package/src/domain/cms/index.ts +1 -0
- package/src/domain/cms/types.ts +20 -0
- package/src/domain/i18n/constants.ts +21 -0
- package/src/domain/i18n/cookie-storage.ts +13 -0
- package/src/domain/i18n/country-to-locale-map.ts +67 -0
- package/src/domain/i18n/fallbacks.generated.ts +230 -0
- package/src/domain/i18n/fetcher.ts +268 -0
- package/src/domain/i18n/flags.ts +16 -0
- package/src/domain/i18n/format.ts +90 -0
- package/src/domain/i18n/index.ts +10 -0
- package/src/domain/i18n/middleware/i18n.ts +160 -0
- package/src/domain/i18n/resolve-locale.ts +55 -0
- package/src/domain/i18n/runtime-constants.ts +14 -0
- package/src/domain/i18n/schema.ts +29 -0
- package/src/domain/index.ts +4 -0
- package/src/domain/seo/constants.ts +20 -0
- package/src/domain/seo/index.ts +3 -0
- package/src/domain/seo/services/index.ts +3 -0
- package/src/domain/seo/services/llms.ts +53 -0
- package/src/domain/seo/services/robots.ts +12 -0
- package/src/domain/seo/services/sitemap.ts +56 -0
- package/src/domain/seo/utils.ts +37 -0
- package/src/domain/theme/constants.ts +6 -0
- package/src/domain/theme/index.ts +2 -0
- package/src/domain/theme/schema.ts +10 -0
- package/src/env.d.ts +49 -0
- package/src/i18n.generated.d.ts +202 -0
- package/src/lib/component-preview.ts +73 -0
- package/src/lib/index.ts +6 -0
- package/src/lib/remark/remark-modified-time.ts +13 -0
- package/src/lib/showcase-preview-elements.ts +408 -0
- package/src/lib/showcase-renderer.ts +218 -0
- package/src/lib/showcase-utils.ts +189 -0
- package/src/lib/turnstile.ts +35 -0
- package/src/lib/utils/starwind/positioning.ts +318 -0
- package/src/locales/de/blog.json +9 -0
- package/src/locales/de/common.json +19 -0
- package/src/locales/de/errors.json +6 -0
- package/src/locales/de/home.json +20 -0
- package/src/locales/de/messages.json +8 -0
- package/src/locales/de/nav.json +13 -0
- package/src/locales/de/projects.json +9 -0
- package/src/locales/de/services.json +43 -0
- package/src/locales/en/blog.json +9 -0
- package/src/locales/en/chat.json +29 -0
- package/src/locales/en/common.json +19 -0
- package/src/locales/en/cookie_notice.json +11 -0
- package/src/locales/en/editor.json +24 -0
- package/src/locales/en/errors.json +6 -0
- package/src/locales/en/home.json +20 -0
- package/src/locales/en/messages.json +8 -0
- package/src/locales/en/nav.json +13 -0
- package/src/locales/en/projects.json +9 -0
- package/src/locales/en/services.json +43 -0
- package/src/locales/es/blog.json +9 -0
- package/src/locales/es/common.json +19 -0
- package/src/locales/es/errors.json +6 -0
- package/src/locales/es/home.json +20 -0
- package/src/locales/es/messages.json +8 -0
- package/src/locales/es/nav.json +13 -0
- package/src/locales/es/projects.json +9 -0
- package/src/locales/es/services.json +43 -0
- package/src/locales/ja/blog.json +9 -0
- package/src/locales/ja/common.json +19 -0
- package/src/locales/ja/errors.json +6 -0
- package/src/locales/ja/home.json +20 -0
- package/src/locales/ja/messages.json +8 -0
- package/src/locales/ja/nav.json +13 -0
- package/src/locales/ja/projects.json +9 -0
- package/src/locales/ja/services.json +43 -0
- package/src/locales/pt/blog.json +9 -0
- package/src/locales/pt/chat.json +29 -0
- package/src/locales/pt/common.json +19 -0
- package/src/locales/pt/cookie_notice.json +11 -0
- package/src/locales/pt/editor.json +24 -0
- package/src/locales/pt/errors.json +6 -0
- package/src/locales/pt/home.json +20 -0
- package/src/locales/pt/messages.json +8 -0
- package/src/locales/pt/nav.json +13 -0
- package/src/locales/pt/projects.json +9 -0
- package/src/locales/pt/services.json +43 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/server/cookies.ts +98 -0
- package/src/utils/server/index.ts +1 -0
- package/src/utils/shared/deep-merge.ts +36 -0
- package/src/utils/shared/embed.ts +105 -0
- package/src/utils/shared/index.ts +3 -0
- package/src/utils/shared/parse-boolean.ts +14 -0
- package/worker-configuration.d.ts +14791 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Side of the tooltip
|
|
8
|
+
* @default bottom
|
|
9
|
+
*/
|
|
10
|
+
side?: "top" | "bottom";
|
|
11
|
+
/**
|
|
12
|
+
* Alignment of the dropdown
|
|
13
|
+
* @default start
|
|
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
|
+
* Size of the select content
|
|
28
|
+
* @default md
|
|
29
|
+
*/
|
|
30
|
+
size?: "sm" | "md" | "lg";
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const selectContent = cv({
|
|
34
|
+
base: [
|
|
35
|
+
"starwind-select-content",
|
|
36
|
+
"bg-popover text-popover-foreground absolute z-50 min-w-6xl rounded-md b shadow-md",
|
|
37
|
+
"data-[state=open]:animate-in fade-in zoom-in-95 overflow-hidden will-change-transform",
|
|
38
|
+
"data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out zoom-out-95",
|
|
39
|
+
],
|
|
40
|
+
variants: {
|
|
41
|
+
side: {
|
|
42
|
+
bottom: "slide-in-from-top-2 slide-out-to-top-2 top-full",
|
|
43
|
+
top: "slide-in-from-bottom-2 slide-out-to-bottom-2 bottom-full",
|
|
44
|
+
},
|
|
45
|
+
align: {
|
|
46
|
+
start: "slide-in-from-left-1 slide-out-to-left-1 left-0",
|
|
47
|
+
center: "left-1/2 -translate-x-1/2",
|
|
48
|
+
end: "slide-in-from-right-1 slide-out-to-right-1 right-0",
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
sm: "text-sm [&_[data-slot=select-label]]:text-xs",
|
|
52
|
+
md: "text-base [&_[data-slot=select-label]]:text-sm",
|
|
53
|
+
lg: "text-lg [&_[data-slot=select-label]]:text-base",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: { side: "bottom", align: "start", size: "md" },
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const selectContentInner = cv({
|
|
60
|
+
base: "max-h-3xl w-full min-w-(--select-trigger-width) overflow-y-auto p-5xs",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const {
|
|
64
|
+
class: className,
|
|
65
|
+
side = "bottom",
|
|
66
|
+
align = "start",
|
|
67
|
+
size = "md",
|
|
68
|
+
sideOffset = 4,
|
|
69
|
+
animationDuration = 150,
|
|
70
|
+
...rest
|
|
71
|
+
} = Astro.props;
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
<div
|
|
75
|
+
class:list={[selectContent({ side, align, size }), className]}
|
|
76
|
+
role="listbox"
|
|
77
|
+
data-side={side}
|
|
78
|
+
data-align={align}
|
|
79
|
+
data-state="closed"
|
|
80
|
+
tabindex="-1"
|
|
81
|
+
style={{
|
|
82
|
+
// hide the content initially. Script will remove this
|
|
83
|
+
display: "none",
|
|
84
|
+
animationDuration: `${animationDuration}ms`,
|
|
85
|
+
marginTop: side === "bottom" ? `${sideOffset}px` : undefined,
|
|
86
|
+
marginBottom: side === "top" ? `${sideOffset}px` : undefined,
|
|
87
|
+
}}
|
|
88
|
+
{...rest}
|
|
89
|
+
data-slot="select-content"
|
|
90
|
+
>
|
|
91
|
+
<div class={selectContentInner()}>
|
|
92
|
+
<slot />
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
import IconCheck from "~icons/lucide/check";
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"div"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The value associated with this select item
|
|
9
|
+
*/
|
|
10
|
+
value: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this select item is disabled and cannot be selected
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const selectItem = cv({
|
|
18
|
+
base: [
|
|
19
|
+
"relative flex w-full cursor-default items-center rounded-sm py-5xs pr-2xl pl-3xs outline-none select-none",
|
|
20
|
+
"data-[active]:bg-accent data-[active]:text-accent-foreground",
|
|
21
|
+
"data-[disabled]:pointer-events-none data-[disabled]:op-50",
|
|
22
|
+
"not-aria-selected:[&_svg]:hidden aria-selected:[&_svg]:flex",
|
|
23
|
+
],
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const selectItemIcon = cv({
|
|
27
|
+
base: "absolute right-3xs flex size-4 items-center justify-center",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const { class: className, value, disabled, ...rest } = Astro.props;
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<div
|
|
34
|
+
class:list={[selectItem(), className]}
|
|
35
|
+
data-value={value}
|
|
36
|
+
data-disabled={disabled}
|
|
37
|
+
aria-selected="false"
|
|
38
|
+
role="option"
|
|
39
|
+
tabindex="0"
|
|
40
|
+
{...rest}
|
|
41
|
+
data-slot="select-item"
|
|
42
|
+
>
|
|
43
|
+
<span>
|
|
44
|
+
<slot />
|
|
45
|
+
</span>
|
|
46
|
+
<span class={selectItemIcon()}>
|
|
47
|
+
<slot name="icon">
|
|
48
|
+
<IconCheck class="size-4" />
|
|
49
|
+
</slot>
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const selectLabel = cv({ base: "text-muted-foreground py-5xs pr-2xl pl-3xs" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class:list={[selectLabel(), className]} {...rest} data-slot="select-label">
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
import IconSearch from "~icons/lucide/search";
|
|
5
|
+
|
|
6
|
+
type Props = Omit<HTMLAttributes<"input">, "type" | "autocomplete"> & {
|
|
7
|
+
/**
|
|
8
|
+
* The text to display when no results are found
|
|
9
|
+
* @default "No results found."
|
|
10
|
+
*/
|
|
11
|
+
emptyText?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const selectSearch = cv({
|
|
15
|
+
base: [
|
|
16
|
+
"placeholder:text-muted-foreground flex w-full border-0 bg-transparent px-0 py-2xl",
|
|
17
|
+
"ring-0 outline-none disabled:cursor-not-allowed disabled:op-50",
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
class: className,
|
|
23
|
+
placeholder = "Search...",
|
|
24
|
+
emptyText = "No results found.",
|
|
25
|
+
...rest
|
|
26
|
+
} = Astro.props;
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
data-slot="select-search-wrapper"
|
|
31
|
+
class="-mx-5xs -mt-5xs mb-5xs flex items-center gap-3xs border-b px-3xs"
|
|
32
|
+
>
|
|
33
|
+
<slot name="icon">
|
|
34
|
+
<IconSearch class="text-muted-foreground size-4.5 shrink-0" />
|
|
35
|
+
</slot>
|
|
36
|
+
<input
|
|
37
|
+
type="text"
|
|
38
|
+
class:list={[selectSearch(), className]}
|
|
39
|
+
placeholder={placeholder}
|
|
40
|
+
autocomplete="off"
|
|
41
|
+
aria-label={placeholder}
|
|
42
|
+
{...rest}
|
|
43
|
+
data-slot="select-search"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="text-muted-foreground hidden py-6 text-center text-sm" data-slot="select-empty">
|
|
48
|
+
<slot name="empty">{emptyText}</slot>
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const selectSeparator = cv({ base: "bg-muted -mx-5xs my-5xs h-6xs" });
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div class:list={[selectSeparator(), className]} {...rest} data-slot="select-separator"></div>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
import IconChevronDown from "~icons/lucide/chevron-down";
|
|
5
|
+
|
|
6
|
+
type VariantProps<T extends (...args: any) => any> = NonNullable<Parameters<T>[0]>;
|
|
7
|
+
|
|
8
|
+
type Props = Omit<HTMLAttributes<"button">, "role" | "type"> &
|
|
9
|
+
VariantProps<typeof selectTrigger> & {
|
|
10
|
+
/**
|
|
11
|
+
* The content to be rendered inside the select trigger
|
|
12
|
+
*/
|
|
13
|
+
children: any;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const selectTrigger = cv({
|
|
17
|
+
base: [
|
|
18
|
+
"starwind-select-trigger",
|
|
19
|
+
"border-input dark:bg-input/30 text-foreground ring-offset-background flex items-center justify-between gap-2 rounded-md b bg-transparent shadow-xs",
|
|
20
|
+
"focus-visible:border-outline focus-visible:ring-outline/50 transition-[color,box-shadow] outline-none focus-visible:ring-3",
|
|
21
|
+
"disabled:cursor-not-allowed disabled:op-50 [&>span]:line-clamp-1",
|
|
22
|
+
"aria-invalid:border-error aria-invalid:focus:ring-error/40 aria-invalid:focus:ring-3",
|
|
23
|
+
],
|
|
24
|
+
variants: {
|
|
25
|
+
size: {
|
|
26
|
+
sm: "h-2xl px-3xs text-sm",
|
|
27
|
+
md: "h-3xl px-xs text-base",
|
|
28
|
+
lg: "h-3xl px-2xl text-lg",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
size: "md",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const { class: className, size, ...rest } = Astro.props;
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
<button
|
|
40
|
+
class:list={[selectTrigger({ size }), className]}
|
|
41
|
+
type="button"
|
|
42
|
+
role="combobox"
|
|
43
|
+
aria-label="Select field"
|
|
44
|
+
aria-controls=""
|
|
45
|
+
aria-expanded="false"
|
|
46
|
+
aria-haspopup="listbox"
|
|
47
|
+
aria-autocomplete="none"
|
|
48
|
+
data-state="closed"
|
|
49
|
+
{...rest}
|
|
50
|
+
data-slot="select-trigger"
|
|
51
|
+
>
|
|
52
|
+
<slot />
|
|
53
|
+
<slot name="icon">
|
|
54
|
+
<IconChevronDown class="size-4 op-50" />
|
|
55
|
+
</slot>
|
|
56
|
+
</button>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SelectChangeEvent extends CustomEvent {
|
|
2
|
+
detail: {
|
|
3
|
+
value: string
|
|
4
|
+
selectId: string
|
|
5
|
+
label: string
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SelectEvent extends CustomEvent {
|
|
10
|
+
detail:
|
|
11
|
+
| { value: string; selectId: string; selectName?: string }
|
|
12
|
+
| { value: string; selectId?: string; selectName: string }
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"span"> & {
|
|
6
|
+
/**
|
|
7
|
+
* The text to display when no value is selected
|
|
8
|
+
*/
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const selectValue = cv({ base: "pointer-events-none" });
|
|
13
|
+
|
|
14
|
+
const { placeholder = "select", class: className, ...rest } = Astro.props;
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<span class:list={[selectValue(), className]} {...rest} data-slot="select-value">
|
|
18
|
+
{placeholder}
|
|
19
|
+
</span>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = Omit<HTMLAttributes<"div">, "role" | "aria-orientation"> & {
|
|
6
|
+
/**
|
|
7
|
+
* The orientation of the separator.
|
|
8
|
+
* @default "horizontal"
|
|
9
|
+
*/
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const separator = cv({
|
|
14
|
+
base: "bg-border shrink-0",
|
|
15
|
+
variants: {
|
|
16
|
+
orientation: {
|
|
17
|
+
horizontal: "h-6xs w-full",
|
|
18
|
+
vertical: "h-full w-6xs",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
orientation: "horizontal",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const { class: className, orientation = "horizontal", ...rest } = Astro.props;
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
role="separator"
|
|
31
|
+
aria-orientation={orientation}
|
|
32
|
+
class:list={[separator({ orientation }), className]}
|
|
33
|
+
{...rest}
|
|
34
|
+
data-slot="separator"
|
|
35
|
+
>
|
|
36
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line typescript/consistent-type-imports
|
|
5
|
+
import Dialog from "../dialog/Dialog.astro";
|
|
6
|
+
|
|
7
|
+
type Props = ComponentProps<typeof Dialog>;
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<Dialog class:list={["starwind-sheet", className]} {...rest} data-slot="sheet">
|
|
13
|
+
<slot />
|
|
14
|
+
</Dialog>
|
|
15
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line typescript/consistent-type-imports
|
|
5
|
+
import DialogClose from "../dialog/DialogClose.astro";
|
|
6
|
+
|
|
7
|
+
type Props = ComponentProps<typeof DialogClose>;
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<DialogClose class:list={["starwind-sheet-close", className]} {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogClose>
|
|
15
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
import IconX from "~icons/lucide/x";
|
|
5
|
+
|
|
6
|
+
type Props = HTMLAttributes<"dialog"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Side of the page the sheet opens from
|
|
9
|
+
*/
|
|
10
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const { side = "right", class: className, ...rest } = Astro.props;
|
|
14
|
+
|
|
15
|
+
export const dialogBackdrop = cv({
|
|
16
|
+
base: [
|
|
17
|
+
"starwind-dialog-backdrop fixed inset-0 top-0 left-0 z-50 hidden h-screen w-screen bg-black/80",
|
|
18
|
+
"data-[state=open]:animate-in fade-in",
|
|
19
|
+
"data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards fade-out",
|
|
20
|
+
"data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
21
|
+
],
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const sheetContent = cv({
|
|
25
|
+
base: [
|
|
26
|
+
"starwind-dialog-content",
|
|
27
|
+
"bg-background fixed z-50 flex-col gap-lg shadow-lg transition ease-in-out open:flex",
|
|
28
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fill-mode-forwards",
|
|
29
|
+
"data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
30
|
+
],
|
|
31
|
+
variants: {
|
|
32
|
+
side: {
|
|
33
|
+
right: [
|
|
34
|
+
"slide-out-to-right slide-in-from-right",
|
|
35
|
+
"inset-y-0 right-0 left-auto h-full max-h-[100dvh] w-3/4 border-l sm:max-w-sm",
|
|
36
|
+
],
|
|
37
|
+
left: [
|
|
38
|
+
"slide-out-to-left slide-in-from-left",
|
|
39
|
+
"inset-y-0 right-auto left-0 h-full max-h-[100dvh] w-3/4 border-r sm:max-w-sm",
|
|
40
|
+
],
|
|
41
|
+
top: [
|
|
42
|
+
"slide-out-to-top slide-in-from-top",
|
|
43
|
+
"inset-x-0 top-0 bottom-auto h-auto w-full max-w-screen border-b",
|
|
44
|
+
],
|
|
45
|
+
bottom: [
|
|
46
|
+
"slide-out-to-bottom slide-in-from-bottom",
|
|
47
|
+
"inset-x-0 top-auto bottom-0 h-auto w-full max-w-screen border-t",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
side: "right",
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const sheetCloseButton = cv({
|
|
57
|
+
base: [
|
|
58
|
+
"starwind-dialog-close",
|
|
59
|
+
"absolute top-2xl right-2xl rounded-xs [&>svg]:op-70 hover:[&>svg]:op-100",
|
|
60
|
+
"focus-visible:ring-outline/50 transition-[color,box-shadow] outline-none focus-visible:ring-3",
|
|
61
|
+
],
|
|
62
|
+
});
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
<!-- dialog overlay -->
|
|
66
|
+
<slot name="backdrop">
|
|
67
|
+
<div class={dialogBackdrop()} data-state="closed" data-slot="dialog-backdrop"></div>
|
|
68
|
+
</slot>
|
|
69
|
+
|
|
70
|
+
<dialog
|
|
71
|
+
class:list={[sheetContent({ side }), className]}
|
|
72
|
+
data-state="closed"
|
|
73
|
+
data-close-duration="300"
|
|
74
|
+
{...rest}
|
|
75
|
+
data-slot="sheet-content"
|
|
76
|
+
>
|
|
77
|
+
<slot />
|
|
78
|
+
<button
|
|
79
|
+
type="button"
|
|
80
|
+
class={sheetCloseButton()}
|
|
81
|
+
data-slot="sheet-close"
|
|
82
|
+
aria-label="Close dialog"
|
|
83
|
+
>
|
|
84
|
+
<slot name="icon">
|
|
85
|
+
<IconX class="size-5 transition-opacity" />
|
|
86
|
+
</slot>
|
|
87
|
+
<span class="sr-only">Close</span>
|
|
88
|
+
</button>
|
|
89
|
+
</dialog>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"p">;
|
|
6
|
+
|
|
7
|
+
const { class: className, ...rest } = Astro.props;
|
|
8
|
+
|
|
9
|
+
export const sheetDescription = cv({
|
|
10
|
+
base: ["text-muted-foreground text-sm"],
|
|
11
|
+
});
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<p class:list={[sheetDescription(), className]} {...rest} data-slot="sheet-description">
|
|
15
|
+
<slot />
|
|
16
|
+
</p>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
const { class: className, ...rest } = Astro.props;
|
|
8
|
+
|
|
9
|
+
export const sheetFooter = cv({
|
|
10
|
+
base: ["mt-auto flex flex-col gap-3xs p-2xl"],
|
|
11
|
+
});
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class:list={[sheetFooter(), className]} {...rest} data-slot="sheet-footer">
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
const { class: className, ...rest } = Astro.props;
|
|
8
|
+
|
|
9
|
+
export const sheetHeader = cv({
|
|
10
|
+
base: ["flex flex-col gap-5xs p-2xl"],
|
|
11
|
+
});
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<div class:list={[sheetHeader(), className]} {...rest} data-slot="sheet-header">
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"h2">;
|
|
6
|
+
|
|
7
|
+
const { class: className, ...rest } = Astro.props;
|
|
8
|
+
|
|
9
|
+
export const sheetTitle = cv({
|
|
10
|
+
base: ["starwind-sheet-title", "text-foreground font-heading font-semibold"],
|
|
11
|
+
});
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<h2 class:list={[sheetTitle(), className]} {...rest} data-slot="sheet-title">
|
|
15
|
+
<slot />
|
|
16
|
+
</h2>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line typescript/consistent-type-imports
|
|
5
|
+
import DialogTrigger from "../dialog/DialogTrigger.astro";
|
|
6
|
+
|
|
7
|
+
type Props = ComponentProps<typeof DialogTrigger>;
|
|
8
|
+
|
|
9
|
+
const { class: className, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<DialogTrigger class:list={["starwind-sheet-trigger", className]} {...rest}>
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogTrigger>
|
|
15
|
+
|