@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 { getYoutubeEmbedUrl, getYoutubeThumbnail } from "../../utils";
|
|
3
|
+
import { Image } from "astro:assets";
|
|
4
|
+
import IconCirclePlay from "~icons/lucide/circle-play";
|
|
5
|
+
|
|
6
|
+
export interface YoutubeEmbedProps {
|
|
7
|
+
src: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
type Props = YoutubeEmbedProps;
|
|
12
|
+
|
|
13
|
+
const { src, title = "YouTube video player", class: className } = Astro.props;
|
|
14
|
+
|
|
15
|
+
const embedUrl = getYoutubeEmbedUrl(src);
|
|
16
|
+
const thumbnail = await getYoutubeThumbnail(src);
|
|
17
|
+
const isPlayable = Boolean(embedUrl);
|
|
18
|
+
const ariaLabel = isPlayable ? "Play YouTube video" : "YouTube video unavailable";
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
<div class:list={["group relative aspect-video h-full w-full cursor-pointer overflow-hidden", className]} data-youtube-video>
|
|
22
|
+
<button
|
|
23
|
+
type="button"
|
|
24
|
+
class="absolute inset-0 aspect-video h-full w-full overflow-hidden"
|
|
25
|
+
data-youtube-trigger
|
|
26
|
+
aria-label={ariaLabel}
|
|
27
|
+
data-embed-url={isPlayable ? embedUrl : undefined}
|
|
28
|
+
disabled={!isPlayable}
|
|
29
|
+
data-video-title={title}
|
|
30
|
+
>
|
|
31
|
+
<Image
|
|
32
|
+
layout="full-width"
|
|
33
|
+
src={thumbnail}
|
|
34
|
+
width={1280}
|
|
35
|
+
height={720}
|
|
36
|
+
class="h-full w-full object-cover"
|
|
37
|
+
alt={title}
|
|
38
|
+
/>
|
|
39
|
+
</button>
|
|
40
|
+
|
|
41
|
+
<div
|
|
42
|
+
class="pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-20"
|
|
43
|
+
style="width: 80px; height: 80px;"
|
|
44
|
+
>
|
|
45
|
+
<IconCirclePlay
|
|
46
|
+
class="w-full h-full op-80 group-hover:op-100 text-white transition-all"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
const setupYoutubeEmbeds = () => {
|
|
53
|
+
document.querySelectorAll("[data-youtube-video]").forEach((root) => {
|
|
54
|
+
// Avoid duplicated listeners
|
|
55
|
+
if (root.getAttribute("data-hydrated") === "true") return;
|
|
56
|
+
|
|
57
|
+
const trigger = root.querySelector("[data-youtube-trigger]");
|
|
58
|
+
if (!(trigger instanceof HTMLButtonElement)) return;
|
|
59
|
+
|
|
60
|
+
const embedUrl = trigger.dataset.embedUrl;
|
|
61
|
+
const title = trigger.dataset.videoTitle;
|
|
62
|
+
if (!embedUrl) return;
|
|
63
|
+
|
|
64
|
+
const activate = () => {
|
|
65
|
+
const iframe = document.createElement("iframe");
|
|
66
|
+
iframe.src = embedUrl;
|
|
67
|
+
iframe.title = title || "YouTube video player";
|
|
68
|
+
iframe.allow =
|
|
69
|
+
"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share";
|
|
70
|
+
iframe.allowFullscreen = true;
|
|
71
|
+
iframe.loading = "lazy";
|
|
72
|
+
iframe.referrerPolicy = "strict-origin-when-cross-origin";
|
|
73
|
+
iframe.classList.add("w-full", "h-full", "absolute", "inset-0");
|
|
74
|
+
|
|
75
|
+
root.replaceChildren(iframe);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// click and accessibility activation
|
|
79
|
+
trigger.addEventListener("click", activate, { once: true });
|
|
80
|
+
trigger.addEventListener("keydown", (event) => {
|
|
81
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
activate();
|
|
84
|
+
}
|
|
85
|
+
}, { once: true });
|
|
86
|
+
|
|
87
|
+
root.setAttribute("data-hydrated", "true");
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// Run on initial load and view transitions
|
|
92
|
+
setupYoutubeEmbeds();
|
|
93
|
+
document.addEventListener("astro:after-swap", setupYoutubeEmbeds);
|
|
94
|
+
</script>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
import type { button } from "../button/Button.astro";
|
|
6
|
+
import Button from "../button/Button.astro";
|
|
7
|
+
|
|
8
|
+
export interface HeroAction {
|
|
9
|
+
text: string;
|
|
10
|
+
href: string;
|
|
11
|
+
variant?: NonNullable<Parameters<typeof button>[0]>["variant"];
|
|
12
|
+
icon?: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface HeroProps extends HTMLAttributes<"section">, NonNullable<Parameters<typeof heroVariants>[0]> {
|
|
16
|
+
/** Main title text */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Description text */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** Action buttons */
|
|
21
|
+
actions?: HeroAction[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type Props = HeroProps;
|
|
25
|
+
|
|
26
|
+
const heroVariants = cv({
|
|
27
|
+
base: "container py-5xl",
|
|
28
|
+
|
|
29
|
+
variants: {
|
|
30
|
+
orientation: {
|
|
31
|
+
vertical: "flex flex-col gap-2xl items-center",
|
|
32
|
+
horizontal: "flex flex-col gap-2xl items-center lg:grid lg:grid-cols-2 lg:items-center lg:gap-4xl",
|
|
33
|
+
},
|
|
34
|
+
alignment: {
|
|
35
|
+
left: "text-start items-start",
|
|
36
|
+
center: "text-center items-center",
|
|
37
|
+
right: "text-end items-end",
|
|
38
|
+
},
|
|
39
|
+
inverted: {
|
|
40
|
+
true: "",
|
|
41
|
+
false: "",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
compoundVariants: [
|
|
45
|
+
{
|
|
46
|
+
orientation: "vertical",
|
|
47
|
+
inverted: false,
|
|
48
|
+
className: "flex-col-reverse",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
orientation: "vertical",
|
|
52
|
+
inverted: true,
|
|
53
|
+
className: "flex-col",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
orientation: "horizontal",
|
|
57
|
+
inverted: false,
|
|
58
|
+
className: "lg:[&_.hero-content-wrapper]:order-1 lg:[&_.hero-content]:order-2",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
orientation: "horizontal",
|
|
62
|
+
inverted: true,
|
|
63
|
+
className: "lg:[&_.hero-content]:order-1 lg:[&_.hero-content-wrapper]:order-2",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
orientation: "horizontal",
|
|
67
|
+
className: "[&_.hero-content]:text-start [&_.hero-content]:items-start lg:text-start lg:items-start",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
defaultVariants: {
|
|
71
|
+
orientation: "vertical",
|
|
72
|
+
alignment: "center",
|
|
73
|
+
inverted: false,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const {
|
|
78
|
+
title,
|
|
79
|
+
description,
|
|
80
|
+
actions = [],
|
|
81
|
+
orientation = "vertical",
|
|
82
|
+
alignment = "center",
|
|
83
|
+
inverted = false,
|
|
84
|
+
class: className,
|
|
85
|
+
...rest
|
|
86
|
+
} = Astro.props;
|
|
87
|
+
|
|
88
|
+
const effectiveAlignment = orientation === "horizontal" ? "left" : alignment;
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
<section class="relative w-full overflow-hidden" {...rest}>
|
|
92
|
+
<div class="absolute inset-0 -z-10" aria-hidden="true">
|
|
93
|
+
<slot name="bg" />
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div class:list={[heroVariants({ orientation, alignment, inverted }), className]}>
|
|
97
|
+
<div
|
|
98
|
+
class:list={[
|
|
99
|
+
"hero-content-wrapper flex flex-col w-full",
|
|
100
|
+
orientation === "vertical" && [
|
|
101
|
+
effectiveAlignment === "center" && "mx-auto",
|
|
102
|
+
effectiveAlignment === "left" && "mr-auto",
|
|
103
|
+
effectiveAlignment === "right" && "ml-auto",
|
|
104
|
+
],
|
|
105
|
+
effectiveAlignment === "center" && "text-center items-center",
|
|
106
|
+
effectiveAlignment === "left" && "text-start items-start",
|
|
107
|
+
effectiveAlignment === "right" && "text-end items-end",
|
|
108
|
+
]}
|
|
109
|
+
data-slot="main"
|
|
110
|
+
>
|
|
111
|
+
{
|
|
112
|
+
title && (
|
|
113
|
+
<h1 class="font-heading text-4xl font-bold tracking-tight text-pretty lg:text-5xl xl:text-6xl">
|
|
114
|
+
{title}
|
|
115
|
+
</h1>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
{
|
|
119
|
+
description && (
|
|
120
|
+
<p class="text-muted-foreground mt-xl text-pretty lg:text-lg">
|
|
121
|
+
{description}
|
|
122
|
+
</p>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
{
|
|
126
|
+
actions.length > 0 && (
|
|
127
|
+
<div
|
|
128
|
+
class:list={[
|
|
129
|
+
"mt-2xl flex w-full flex-wrap gap-xs md:w-fit",
|
|
130
|
+
effectiveAlignment === "center" && "justify-center mx-auto",
|
|
131
|
+
effectiveAlignment === "left" && "justify-start",
|
|
132
|
+
effectiveAlignment === "right" && "justify-end md:ml-auto",
|
|
133
|
+
]}
|
|
134
|
+
>
|
|
135
|
+
{actions.map(({ text, href, variant, icon: Icon }) => (
|
|
136
|
+
<Button variant={variant} class="group w-full md:w-auto" href={href}>
|
|
137
|
+
{text}
|
|
138
|
+
{Icon && (
|
|
139
|
+
<Icon class="transition-transform group-hover:translate-x-5xs" />
|
|
140
|
+
)}
|
|
141
|
+
</Button>
|
|
142
|
+
))}
|
|
143
|
+
</div>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
{
|
|
149
|
+
Astro.slots.has("content") && (
|
|
150
|
+
<div
|
|
151
|
+
class:list={[
|
|
152
|
+
"hero-content w-full flex",
|
|
153
|
+
effectiveAlignment === "center" && "justify-center",
|
|
154
|
+
effectiveAlignment === "left" && "justify-start",
|
|
155
|
+
effectiveAlignment === "right" && "justify-end",
|
|
156
|
+
]}
|
|
157
|
+
data-slot="content"
|
|
158
|
+
>
|
|
159
|
+
<slot name="content" />
|
|
160
|
+
</div>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
</div>
|
|
164
|
+
</section>
|
|
165
|
+
|
|
166
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
import IconGlobe from "~icons/lucide/globe"
|
|
3
|
+
import FlagUS from "~icons/flag/us-4x3"
|
|
4
|
+
import FlagDE from "~icons/flag/de-4x3"
|
|
5
|
+
import FlagES from "~icons/flag/es-4x3"
|
|
6
|
+
import FlagJP from "~icons/flag/jp-4x3"
|
|
7
|
+
import FlagBR from "~icons/flag/br-4x3"
|
|
8
|
+
|
|
9
|
+
import type { FlagCode } from '../../domain/i18n/flags'
|
|
10
|
+
|
|
11
|
+
const FLAG_COMPONENTS: Record<string, any> = {
|
|
12
|
+
// Legacy short codes
|
|
13
|
+
us: FlagUS,
|
|
14
|
+
de: FlagDE,
|
|
15
|
+
es: FlagES,
|
|
16
|
+
jp: FlagJP,
|
|
17
|
+
br: FlagBR,
|
|
18
|
+
|
|
19
|
+
// Full library codes
|
|
20
|
+
'us-4x3': FlagUS,
|
|
21
|
+
'de-4x3': FlagDE,
|
|
22
|
+
'es-4x3': FlagES,
|
|
23
|
+
'jp-4x3': FlagJP,
|
|
24
|
+
'br-4x3': FlagBR,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface FlagProps {
|
|
28
|
+
code: FlagCode | string | null;
|
|
29
|
+
size?: number;
|
|
30
|
+
title?: string;
|
|
31
|
+
class?: string;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}
|
|
34
|
+
type Props = FlagProps;
|
|
35
|
+
|
|
36
|
+
const { code, size = 16, title, class: className, ...rest } = Astro.props
|
|
37
|
+
const Svg = code ? FLAG_COMPONENTS[code] : undefined
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
{
|
|
41
|
+
Svg ? (
|
|
42
|
+
<Svg
|
|
43
|
+
width={size}
|
|
44
|
+
height={size}
|
|
45
|
+
class={className}
|
|
46
|
+
aria-hidden={title ? 'false' : 'true'}
|
|
47
|
+
role={title ? 'img' : 'presentation'}
|
|
48
|
+
{...rest}
|
|
49
|
+
>
|
|
50
|
+
{title && <title>{title}</title>}
|
|
51
|
+
</Svg>
|
|
52
|
+
) : (
|
|
53
|
+
<IconGlobe
|
|
54
|
+
width={size}
|
|
55
|
+
height={size}
|
|
56
|
+
aria-hidden={title ? undefined : true}
|
|
57
|
+
role={title ? 'img' : 'presentation'}
|
|
58
|
+
class={className}
|
|
59
|
+
{...rest}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
4
|
+
import Image from "./Image.astro";
|
|
5
|
+
|
|
6
|
+
type Props = ComponentProps<typeof Image> & {
|
|
7
|
+
darkSrc?: any;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const { src, darkSrc, class: className, ...rest } = Astro.props;
|
|
11
|
+
|
|
12
|
+
const isSvg = (source: any) => {
|
|
13
|
+
if (!source) return false;
|
|
14
|
+
const url = typeof source === 'string' ? source : (source.src || '');
|
|
15
|
+
if (!url) return false;
|
|
16
|
+
return url.split('?')[0].toLowerCase().endsWith('.svg') || source.format === 'svg';
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const getSrc = (source: any) => {
|
|
20
|
+
if (typeof source === 'string') return source;
|
|
21
|
+
return source?.src || source;
|
|
22
|
+
};
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
{
|
|
26
|
+
darkSrc ? (
|
|
27
|
+
<div class="contents group/extended-image">
|
|
28
|
+
{isSvg(src) ? (
|
|
29
|
+
<img src={getSrc(src)} class:list={[className, "dark:hidden"]} {...(rest as any)} />
|
|
30
|
+
) : (
|
|
31
|
+
<Image src={src} class:list={[className, "dark:hidden"]} {...(rest as any)} />
|
|
32
|
+
)}
|
|
33
|
+
{isSvg(darkSrc) ? (
|
|
34
|
+
<img src={getSrc(darkSrc)} class:list={[className, "hidden dark:block"]} {...(rest as any)} />
|
|
35
|
+
) : (
|
|
36
|
+
<Image src={darkSrc} class:list={[className, "hidden dark:block"]} {...(rest as any)} />
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
) : isSvg(src) ? (
|
|
40
|
+
<img src={getSrc(src)} class={className} {...(rest as any)} />
|
|
41
|
+
) : (
|
|
42
|
+
<Image src={src} class={className} {...(rest as any)} />
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
4
|
+
import { Image as AstroImage } from "astro:assets";
|
|
5
|
+
import { cv } from "css-variants";
|
|
6
|
+
|
|
7
|
+
export const image = cv({ base: "starwind-image" });
|
|
8
|
+
|
|
9
|
+
type Props = Partial<ComponentProps<typeof AstroImage>> & { inferSize?: boolean };
|
|
10
|
+
|
|
11
|
+
const { class: className, src, alt = "", inferSize = true, ...rest } = Astro.props;
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
src && (
|
|
16
|
+
<AstroImage
|
|
17
|
+
class:list={[image(), className]}
|
|
18
|
+
src={src}
|
|
19
|
+
alt={alt}
|
|
20
|
+
inferSize={inferSize}
|
|
21
|
+
{...(rest as any)}
|
|
22
|
+
data-slot="image"
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type VariantProps<T extends (...args: any) => any> = NonNullable<Parameters<T>[0]>;
|
|
6
|
+
|
|
7
|
+
type Props = HTMLAttributes<"input"> & VariantProps<typeof input>;
|
|
8
|
+
|
|
9
|
+
export const input = cv({
|
|
10
|
+
base: [
|
|
11
|
+
"border-input dark:bg-input/30 text-foreground w-full rounded-md b bg-transparent shadow-xs",
|
|
12
|
+
"focus-visible:border-outline focus-visible:ring-outline/50 transition-[color,box-shadow] focus-visible:ring-3",
|
|
13
|
+
"file:text-foreground file:my-auto file:mr-3xs file:h-full file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
14
|
+
"disabled:cursor-not-allowed disabled:op-50",
|
|
15
|
+
"aria-invalid:border-error aria-invalid:focus-visible:ring-error/40",
|
|
16
|
+
"peer placeholder:text-muted-foreground",
|
|
17
|
+
],
|
|
18
|
+
variants: {
|
|
19
|
+
size: { sm: "h-2xl px-3xs text-sm", md: "h-3xl px-xs text-base", lg: "h-3xl px-2xl text-lg" },
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: { size: "md" },
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const { size, class: className, ...rest } = Astro.props;
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<input class:list={[input({ size }), className]} {...rest} data-slot="input" />
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type Props = HTMLAttributes<"div">;
|
|
6
|
+
|
|
7
|
+
export const inputGroup = cv({
|
|
8
|
+
base: [
|
|
9
|
+
"border-input dark:bg-input/30 group/input-group relative flex h-11 w-full min-w-0 items-center rounded-lg b transition-colors outline-none",
|
|
10
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-outline has-[[data-slot=input-group-control]:focus-visible]:ring-outline/50 has-[[data-slot=input-group-control]:focus-visible]:ring-3",
|
|
11
|
+
"has-[[data-slot][aria-invalid=true]]:border-error has-[[data-slot][aria-invalid=true]]:ring-error/40 has-[[data-slot][aria-invalid=true]]:ring-3",
|
|
12
|
+
"has-disabled:bg-input/50 has-disabled:op-50",
|
|
13
|
+
"has-[>textarea]:h-auto",
|
|
14
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col",
|
|
15
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col",
|
|
16
|
+
"has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:pt-3",
|
|
17
|
+
"has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:pb-3",
|
|
18
|
+
"has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-1.5",
|
|
19
|
+
"has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-1.5",
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const { class: className, ...rest } = Astro.props;
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<div role="group" class:list={[inputGroup(), className]} {...rest} data-slot="input-group">
|
|
27
|
+
<slot />
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { cv } from "css-variants";
|
|
3
|
+
|
|
4
|
+
export const inputGroupAddon = cv({
|
|
5
|
+
base: [
|
|
6
|
+
"text-muted-foreground flex cursor-text items-center justify-center gap-md text-sm font-medium select-none",
|
|
7
|
+
"group-data-[disabled=true]/input-group:op-50 [&>kbd]:rounded-xs [&>svg:not([class*='size-'])]:size-4",
|
|
8
|
+
],
|
|
9
|
+
variants: {
|
|
10
|
+
align: {
|
|
11
|
+
"inline-start": "order-first pl-2.5 has-[>button]:ml-[-0.3rem]",
|
|
12
|
+
"inline-end": "order-last pr-2.5 has-[>button]:mr-[-0.3rem]",
|
|
13
|
+
"block-start":
|
|
14
|
+
"order-first w-full justify-start px-3 pt-2 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-2.5",
|
|
15
|
+
"block-end":
|
|
16
|
+
"order-last w-full justify-start px-3 pb-2 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-2.5",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
align: "inline-start",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const { align, class: className, ...rest } = Astro.props;
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
role="group"
|
|
29
|
+
data-align={align}
|
|
30
|
+
class:list={[inputGroupAddon({ align }), className]}
|
|
31
|
+
{...rest}
|
|
32
|
+
data-slot="input-group-addon"
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
class InputGroupAddonHandler {
|
|
39
|
+
private addon: HTMLElement;
|
|
40
|
+
|
|
41
|
+
constructor(addon: HTMLElement) {
|
|
42
|
+
this.addon = addon;
|
|
43
|
+
this.setupEventListeners();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private setupEventListeners(): void {
|
|
47
|
+
this.addon.addEventListener("click", (e) => this.handleClick(e));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private handleClick(e: MouseEvent): void {
|
|
51
|
+
if ((e.target as HTMLElement).closest("button")) return;
|
|
52
|
+
|
|
53
|
+
const input = this.addon.parentElement?.querySelector("input, textarea") as
|
|
54
|
+
| HTMLInputElement
|
|
55
|
+
| HTMLTextAreaElement;
|
|
56
|
+
|
|
57
|
+
if (input) {
|
|
58
|
+
input.focus();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const addonInstances = new WeakMap<HTMLElement, InputGroupAddonHandler>();
|
|
64
|
+
|
|
65
|
+
const setupAddons = () => {
|
|
66
|
+
document.querySelectorAll<HTMLElement>('[data-slot="input-group-addon"]').forEach((addon) => {
|
|
67
|
+
if (!addonInstances.has(addon)) {
|
|
68
|
+
addonInstances.set(addon, new InputGroupAddonHandler(addon));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
setupAddons();
|
|
74
|
+
document.addEventListener("astro:after-swap", setupAddons);
|
|
75
|
+
document.addEventListener("starwind:init", setupAddons);
|
|
76
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
type VariantProps<T extends (...args: any) => any> = NonNullable<Parameters<T>[0]>;
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line typescript/consistent-type-imports
|
|
8
|
+
import Button from "../button/Button.astro";
|
|
9
|
+
|
|
10
|
+
type Props = Omit<ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButton>;
|
|
11
|
+
|
|
12
|
+
export const inputGroupButton = cv({
|
|
13
|
+
base: "gap-3xs rounded-sm shadow-none",
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: "h-8 px-2",
|
|
17
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
size: "sm",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const { type = "button", variant = "ghost", size, class: className, ...rest } = Astro.props;
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
<Button
|
|
29
|
+
type={type}
|
|
30
|
+
data-size={size}
|
|
31
|
+
class:list={[inputGroupButton({ size: size as "sm" }), className]}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</Button>
|
|
36
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line typescript/consistent-type-imports
|
|
6
|
+
import Input from "../input/Input.astro";
|
|
7
|
+
|
|
8
|
+
type Props = ComponentProps<typeof Input>;
|
|
9
|
+
|
|
10
|
+
export const inputGroupInput = cv({
|
|
11
|
+
base: "h-full flex-1 rounded-none border-0 shadow-none ring-0 outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const { class: className, ...rest } = Astro.props;
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<Input class:list={[inputGroupInput(), className]} {...rest} data-slot="input-group-control" />
|
|
18
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from "astro/types";
|
|
3
|
+
|
|
4
|
+
type Props = HTMLAttributes<"span">;
|
|
5
|
+
|
|
6
|
+
const { class: className, ...rest } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<span
|
|
10
|
+
class:list={[
|
|
11
|
+
"text-muted-foreground flex items-center gap-md text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4.5",
|
|
12
|
+
className,
|
|
13
|
+
]}
|
|
14
|
+
{...rest}
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</span>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from "astro/types";
|
|
3
|
+
import { cv } from "css-variants";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line typescript/consistent-type-imports
|
|
6
|
+
import Textarea from "../textarea/Textarea.astro";
|
|
7
|
+
|
|
8
|
+
type Props = ComponentProps<typeof Textarea>;
|
|
9
|
+
|
|
10
|
+
export const inputGroupTextarea = cv({
|
|
11
|
+
base: "h-full flex-1 resize-none rounded-none border-0 shadow-none ring-0 outline-none focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const { class: className, ...rest } = Astro.props;
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<Textarea
|
|
18
|
+
class:list={[inputGroupTextarea(), className]}
|
|
19
|
+
{...rest}
|
|
20
|
+
data-slot="input-group-control"
|
|
21
|
+
/>
|
|
22
|
+
|