@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,202 @@
|
|
|
1
|
+
// Auto-generated by scripts/bundle-translations.ts
|
|
2
|
+
// Do not edit manually.
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
namespace I18n {
|
|
6
|
+
export interface Schema {
|
|
7
|
+
"blog": {
|
|
8
|
+
"meta_title": string;
|
|
9
|
+
"hero_title": string;
|
|
10
|
+
"hero_description": string;
|
|
11
|
+
"latest_article": string;
|
|
12
|
+
"latest": string;
|
|
13
|
+
"read_article": string;
|
|
14
|
+
"all_posts": string;
|
|
15
|
+
};
|
|
16
|
+
"chat": {
|
|
17
|
+
"title": string;
|
|
18
|
+
"description": string;
|
|
19
|
+
"heading": string;
|
|
20
|
+
"intro": string;
|
|
21
|
+
"label": string;
|
|
22
|
+
"placeholder": string;
|
|
23
|
+
"button": string;
|
|
24
|
+
"room": {
|
|
25
|
+
"title": string;
|
|
26
|
+
"connecting": string;
|
|
27
|
+
"connected": string;
|
|
28
|
+
"disconnected": string;
|
|
29
|
+
"placeholder": string;
|
|
30
|
+
"send": string;
|
|
31
|
+
"system": {
|
|
32
|
+
"joining": string;
|
|
33
|
+
"error": string;
|
|
34
|
+
"joined": string;
|
|
35
|
+
"left": string;
|
|
36
|
+
"reconnecting": string;
|
|
37
|
+
"fail_reconnect": string;
|
|
38
|
+
"no_connect": string;
|
|
39
|
+
"prompt_user": string;
|
|
40
|
+
"you": string;
|
|
41
|
+
"online_users": string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
"common": {
|
|
46
|
+
"seo": {
|
|
47
|
+
"title": string;
|
|
48
|
+
"description": string;
|
|
49
|
+
};
|
|
50
|
+
"nav": {
|
|
51
|
+
"home": string;
|
|
52
|
+
"blog": string;
|
|
53
|
+
"mobileButton": string;
|
|
54
|
+
};
|
|
55
|
+
"footer": {
|
|
56
|
+
"license": string;
|
|
57
|
+
};
|
|
58
|
+
"notFound": {
|
|
59
|
+
"title": string;
|
|
60
|
+
"message": string;
|
|
61
|
+
"backToHome": string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
"cookie_notice": {
|
|
65
|
+
"title": string;
|
|
66
|
+
"description": string;
|
|
67
|
+
"privacy_policy": string;
|
|
68
|
+
"reject_all": string;
|
|
69
|
+
"accept_all": string;
|
|
70
|
+
"accepted_toast": string;
|
|
71
|
+
"accepted_description": string;
|
|
72
|
+
"rejected_toast": string;
|
|
73
|
+
"rejected_description": string;
|
|
74
|
+
};
|
|
75
|
+
"editor": {
|
|
76
|
+
"title": string;
|
|
77
|
+
"description": string;
|
|
78
|
+
"collaborative_editor": string;
|
|
79
|
+
"status": {
|
|
80
|
+
"connecting": string;
|
|
81
|
+
"connected": string;
|
|
82
|
+
"disconnected": string;
|
|
83
|
+
};
|
|
84
|
+
"history": string;
|
|
85
|
+
"version_history": string;
|
|
86
|
+
"no_versions": string;
|
|
87
|
+
"placeholder": string;
|
|
88
|
+
"word_count": {
|
|
89
|
+
"word": string;
|
|
90
|
+
"words": string;
|
|
91
|
+
"character": string;
|
|
92
|
+
"characters": string;
|
|
93
|
+
};
|
|
94
|
+
"save": {
|
|
95
|
+
"saved": string;
|
|
96
|
+
};
|
|
97
|
+
"restore_confirm": string;
|
|
98
|
+
};
|
|
99
|
+
"errors": {
|
|
100
|
+
"404_title": string;
|
|
101
|
+
"404_description": string;
|
|
102
|
+
"500_title": string;
|
|
103
|
+
"500_description": string;
|
|
104
|
+
};
|
|
105
|
+
"home": {
|
|
106
|
+
"meta_title": string;
|
|
107
|
+
"meta_description": string;
|
|
108
|
+
"hero_title": string;
|
|
109
|
+
"hero_description": string;
|
|
110
|
+
"hero_view_components": string;
|
|
111
|
+
"hero_contact_me": string;
|
|
112
|
+
"stack_title": string;
|
|
113
|
+
"stack_description": string;
|
|
114
|
+
"stack_view_services": string;
|
|
115
|
+
"stack_resume": string;
|
|
116
|
+
"marquee_title": string;
|
|
117
|
+
"projects_title": string;
|
|
118
|
+
"projects_description": string;
|
|
119
|
+
"projects_view_all": string;
|
|
120
|
+
"cta_title": string;
|
|
121
|
+
"cta_description": string;
|
|
122
|
+
"cta_contact": string;
|
|
123
|
+
"cta_resume": string;
|
|
124
|
+
};
|
|
125
|
+
"messages": {
|
|
126
|
+
"errors": {
|
|
127
|
+
"ui": {
|
|
128
|
+
"MISSING_TRANSLATED_UI": string;
|
|
129
|
+
"MISSING_TRANSLATED_CONTENT": string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
"nav": {
|
|
134
|
+
"home": string;
|
|
135
|
+
"projects": string;
|
|
136
|
+
"blog": string;
|
|
137
|
+
"about": string;
|
|
138
|
+
"services": string;
|
|
139
|
+
"resume": string;
|
|
140
|
+
"contact": string;
|
|
141
|
+
"components": string;
|
|
142
|
+
"privacy_policy": string;
|
|
143
|
+
"terms_of_service": string;
|
|
144
|
+
"cookie_policy": string;
|
|
145
|
+
};
|
|
146
|
+
"projects": {
|
|
147
|
+
"meta_title": string;
|
|
148
|
+
"hero_title": string;
|
|
149
|
+
"hero_description": string;
|
|
150
|
+
"latest": string;
|
|
151
|
+
"latest_badge": string;
|
|
152
|
+
"view_project": string;
|
|
153
|
+
"all": string;
|
|
154
|
+
};
|
|
155
|
+
"services": {
|
|
156
|
+
"meta_title": string;
|
|
157
|
+
"hero_title": string;
|
|
158
|
+
"hero_description": string;
|
|
159
|
+
"capabilities_title": string;
|
|
160
|
+
"capabilities_description": string;
|
|
161
|
+
"web_dev_title": string;
|
|
162
|
+
"web_dev_description": string;
|
|
163
|
+
"ui_ux_title": string;
|
|
164
|
+
"ui_ux_description": string;
|
|
165
|
+
"perf_title": string;
|
|
166
|
+
"perf_description": string;
|
|
167
|
+
"perf_security_title": string;
|
|
168
|
+
"perf_security_description": string;
|
|
169
|
+
"testimonials_title": string;
|
|
170
|
+
"testimonials_description": string;
|
|
171
|
+
"faq_title": string;
|
|
172
|
+
"faq_description": string;
|
|
173
|
+
"cta_title": string;
|
|
174
|
+
"cta_description": string;
|
|
175
|
+
"cta_contact": string;
|
|
176
|
+
"cta_portfolio": string;
|
|
177
|
+
"badge_ceo": string;
|
|
178
|
+
"badge_founder": string;
|
|
179
|
+
"badge_cto": string;
|
|
180
|
+
"badge_senior_ui": string;
|
|
181
|
+
"badge_chef": string;
|
|
182
|
+
"badge_product_designer": string;
|
|
183
|
+
"testimonial_1": string;
|
|
184
|
+
"testimonial_2": string;
|
|
185
|
+
"testimonial_3": string;
|
|
186
|
+
"testimonial_4": string;
|
|
187
|
+
"testimonial_5": string;
|
|
188
|
+
"testimonial_6": string;
|
|
189
|
+
"faq_category_general": string;
|
|
190
|
+
"faq_q1": string;
|
|
191
|
+
"faq_a1": string;
|
|
192
|
+
"faq_q2": string;
|
|
193
|
+
"faq_a2": string;
|
|
194
|
+
"faq_category_technical": string;
|
|
195
|
+
"faq_q3": string;
|
|
196
|
+
"faq_a3": string;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export {}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Preview Renderer
|
|
3
|
+
*
|
|
4
|
+
* A simple registry-based system for rendering component previews with dynamic props. Import this
|
|
5
|
+
* module in your page to register component renderers.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type RendererFunction = (props: Record<string, any>, container: HTMLElement) => void
|
|
9
|
+
|
|
10
|
+
const renderers = new Map<string, RendererFunction>()
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Register a component renderer
|
|
14
|
+
*
|
|
15
|
+
* @param componentName - The component name (e.g., 'hero', 'button')
|
|
16
|
+
* @param renderFn - Function that renders the component with given props
|
|
17
|
+
*/
|
|
18
|
+
export function registerRenderer(componentName: string, renderFn: RendererFunction) {
|
|
19
|
+
renderers.set(componentName, renderFn)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get a registered renderer
|
|
24
|
+
*/
|
|
25
|
+
export function getRenderer(componentName: string): RendererFunction | undefined {
|
|
26
|
+
return renderers.get(componentName)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update a preview container with new props
|
|
31
|
+
*/
|
|
32
|
+
export function renderPreview(
|
|
33
|
+
container: HTMLElement,
|
|
34
|
+
componentName: string,
|
|
35
|
+
props: Record<string, any>
|
|
36
|
+
) {
|
|
37
|
+
const renderer = renderers.get(componentName)
|
|
38
|
+
if (renderer) {
|
|
39
|
+
renderer(props, container)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Helper to create a simple attribute-based renderer For components that can update via data
|
|
45
|
+
* attributes and CSS
|
|
46
|
+
*/
|
|
47
|
+
export function createAttributeRenderer(
|
|
48
|
+
attributeMap: Record<string, string>,
|
|
49
|
+
classUpdater?: (props: Record<string, any>, element: HTMLElement) => void
|
|
50
|
+
): RendererFunction {
|
|
51
|
+
return (props, container) => {
|
|
52
|
+
// Update data attributes
|
|
53
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
54
|
+
const attrName = attributeMap[key] || key
|
|
55
|
+
if (value === undefined || value === null) {
|
|
56
|
+
container.removeAttribute(`data-${attrName}`)
|
|
57
|
+
} else if (typeof value === "boolean") {
|
|
58
|
+
if (value) {
|
|
59
|
+
container.setAttribute(`data-${attrName}`, "true")
|
|
60
|
+
} else {
|
|
61
|
+
container.removeAttribute(`data-${attrName}`)
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
container.setAttribute(`data-${attrName}`, String(value))
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
// Call custom class updater if provided
|
|
69
|
+
if (classUpdater) {
|
|
70
|
+
classUpdater(props, container)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
package/src/lib/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { execSync } from "child_process"
|
|
2
|
+
|
|
3
|
+
export function remarkModifiedTime() {
|
|
4
|
+
return function (_tree: any, file: any) {
|
|
5
|
+
try {
|
|
6
|
+
const filepath = file.history[0]
|
|
7
|
+
const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`)
|
|
8
|
+
file.data.astro.frontmatter.lastModified = result.toString()
|
|
9
|
+
} catch {
|
|
10
|
+
file.data.astro.frontmatter.lastModified = new Date().toISOString()
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Showcase Preview Custom Elements
|
|
3
|
+
*
|
|
4
|
+
* This module defines all the custom elements used in the component showcase. It must be imported
|
|
5
|
+
* client-side before the showcase renderers run.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Register all custom elements
|
|
9
|
+
export function registerShowcasePreviewElements() {
|
|
10
|
+
if (typeof HTMLElement === "undefined" || typeof customElements === "undefined") return
|
|
11
|
+
|
|
12
|
+
// Hero Preview Custom Element
|
|
13
|
+
class HeroPreviewElement extends HTMLElement {
|
|
14
|
+
innerEl: HTMLElement | null = null
|
|
15
|
+
contentWrapper: HTMLElement | null = null
|
|
16
|
+
titleEl: HTMLElement | null = null
|
|
17
|
+
descEl: HTMLElement | null = null
|
|
18
|
+
|
|
19
|
+
static get observedAttributes() {
|
|
20
|
+
return ["data-orientation", "data-alignment", "data-inverted"]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this.innerEl = this.querySelector<HTMLElement>(".hero-preview-inner")
|
|
25
|
+
this.contentWrapper = this.querySelector<HTMLElement>(".hero-content-wrapper")
|
|
26
|
+
this.titleEl = this.querySelector<HTMLElement>("[data-hero-title]")
|
|
27
|
+
this.descEl = this.querySelector<HTMLElement>("[data-hero-description]")
|
|
28
|
+
if (!this.innerEl || !this.contentWrapper) return
|
|
29
|
+
this.updateClasses()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
attributeChangedCallback(_name: string, _oldValue: string, newValue: string) {
|
|
33
|
+
if (_oldValue !== newValue) {
|
|
34
|
+
this.updateClasses()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
updateClasses() {
|
|
39
|
+
if (!this.innerEl || !this.contentWrapper) return
|
|
40
|
+
|
|
41
|
+
const orientation = this.dataset.orientation || "vertical"
|
|
42
|
+
const alignment = this.dataset.alignment || "center"
|
|
43
|
+
const inverted = this.dataset.inverted === "true"
|
|
44
|
+
|
|
45
|
+
const effectiveAlignment = orientation === "horizontal" ? "left" : alignment
|
|
46
|
+
|
|
47
|
+
// Reset inner container classes
|
|
48
|
+
this.innerEl.className = "hero-preview-inner w-full"
|
|
49
|
+
|
|
50
|
+
// Apply orientation classes
|
|
51
|
+
if (orientation === "horizontal") {
|
|
52
|
+
this.innerEl.classList.add(
|
|
53
|
+
"flex",
|
|
54
|
+
"flex-col",
|
|
55
|
+
"gap-8",
|
|
56
|
+
"items-center",
|
|
57
|
+
"lg:grid",
|
|
58
|
+
"lg:grid-cols-2",
|
|
59
|
+
"lg:items-center",
|
|
60
|
+
"lg:gap-16"
|
|
61
|
+
)
|
|
62
|
+
} else {
|
|
63
|
+
this.innerEl.classList.add("flex", "flex-col", "gap-8", "items-center")
|
|
64
|
+
if (!inverted) {
|
|
65
|
+
this.innerEl.classList.add("flex-col-reverse")
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Apply alignment classes
|
|
70
|
+
this.innerEl.classList.remove(
|
|
71
|
+
"text-start",
|
|
72
|
+
"text-center",
|
|
73
|
+
"text-end",
|
|
74
|
+
"items-start",
|
|
75
|
+
"items-end"
|
|
76
|
+
)
|
|
77
|
+
if (effectiveAlignment === "left") {
|
|
78
|
+
this.innerEl.classList.add("text-start", "items-start")
|
|
79
|
+
} else if (effectiveAlignment === "right") {
|
|
80
|
+
this.innerEl.classList.add("text-end", "items-end")
|
|
81
|
+
} else {
|
|
82
|
+
this.innerEl.classList.add("text-center", "items-center")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Update content wrapper
|
|
86
|
+
this.contentWrapper.classList.remove(
|
|
87
|
+
"text-center",
|
|
88
|
+
"items-center",
|
|
89
|
+
"text-start",
|
|
90
|
+
"items-start",
|
|
91
|
+
"text-end",
|
|
92
|
+
"items-end"
|
|
93
|
+
)
|
|
94
|
+
if (effectiveAlignment === "left") {
|
|
95
|
+
this.contentWrapper.classList.add("text-start", "items-start")
|
|
96
|
+
} else if (effectiveAlignment === "right") {
|
|
97
|
+
this.contentWrapper.classList.add("text-end", "items-end")
|
|
98
|
+
} else {
|
|
99
|
+
this.contentWrapper.classList.add("text-center", "items-center")
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Section Preview Custom Element
|
|
105
|
+
class SectionPreviewElement extends HTMLElement {
|
|
106
|
+
innerEl: HTMLElement | null = null
|
|
107
|
+
contentEl: HTMLElement | null = null
|
|
108
|
+
titleEl: HTMLElement | null = null
|
|
109
|
+
descEl: HTMLElement | null = null
|
|
110
|
+
|
|
111
|
+
static get observedAttributes() {
|
|
112
|
+
return ["data-orientation", "data-alignment", "data-inverted"]
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
connectedCallback() {
|
|
116
|
+
this.innerEl = this.querySelector<HTMLElement>(".section-preview-inner")
|
|
117
|
+
this.contentEl = this.querySelector<HTMLElement>(".section-content")
|
|
118
|
+
this.titleEl = this.querySelector<HTMLElement>("[data-section-title]")
|
|
119
|
+
this.descEl = this.querySelector<HTMLElement>("[data-section-description]")
|
|
120
|
+
if (!this.innerEl || !this.contentEl) return
|
|
121
|
+
this.updateClasses()
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
attributeChangedCallback(_name: string, _oldValue: string, newValue: string) {
|
|
125
|
+
if (_oldValue !== newValue) {
|
|
126
|
+
this.updateClasses()
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
updateClasses() {
|
|
131
|
+
if (!this.innerEl || !this.contentEl) return
|
|
132
|
+
|
|
133
|
+
const orientation = this.dataset.orientation || "vertical"
|
|
134
|
+
const alignment = this.dataset.alignment || "center"
|
|
135
|
+
const inverted = this.dataset.inverted === "true"
|
|
136
|
+
|
|
137
|
+
const effectiveAlignment = orientation === "horizontal" ? "left" : alignment
|
|
138
|
+
|
|
139
|
+
// Reset inner container classes
|
|
140
|
+
this.innerEl.className = "section-preview-inner w-full"
|
|
141
|
+
this.innerEl.classList.add("container", "py-24")
|
|
142
|
+
|
|
143
|
+
// Apply orientation classes
|
|
144
|
+
if (orientation === "horizontal") {
|
|
145
|
+
this.innerEl.classList.add("lg:grid", "lg:grid-cols-2", "lg:items-center", "lg:gap-16")
|
|
146
|
+
} else {
|
|
147
|
+
this.innerEl.classList.add("flex", "flex-col", "gap-12")
|
|
148
|
+
if (inverted) {
|
|
149
|
+
this.innerEl.classList.add("flex-col-reverse")
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Apply alignment classes
|
|
154
|
+
this.innerEl.classList.remove(
|
|
155
|
+
"text-start",
|
|
156
|
+
"text-center",
|
|
157
|
+
"text-end",
|
|
158
|
+
"items-start",
|
|
159
|
+
"items-end"
|
|
160
|
+
)
|
|
161
|
+
if (effectiveAlignment === "left") {
|
|
162
|
+
this.innerEl.classList.add("text-start", "items-start")
|
|
163
|
+
} else if (effectiveAlignment === "right") {
|
|
164
|
+
this.innerEl.classList.add("text-end", "items-end")
|
|
165
|
+
} else {
|
|
166
|
+
this.innerEl.classList.add("text-center", "items-center")
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Update content element
|
|
170
|
+
this.contentEl.classList.remove(
|
|
171
|
+
"text-center",
|
|
172
|
+
"items-center",
|
|
173
|
+
"text-start",
|
|
174
|
+
"items-start",
|
|
175
|
+
"text-end",
|
|
176
|
+
"items-end"
|
|
177
|
+
)
|
|
178
|
+
if (effectiveAlignment === "left") {
|
|
179
|
+
this.contentEl.classList.add("text-start", "items-start")
|
|
180
|
+
} else if (effectiveAlignment === "right") {
|
|
181
|
+
this.contentEl.classList.add("text-end", "items-end")
|
|
182
|
+
} else {
|
|
183
|
+
this.contentEl.classList.add("text-center", "items-center")
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Button Preview Custom Element
|
|
189
|
+
class ButtonPreviewElement extends HTMLElement {
|
|
190
|
+
button: HTMLElement | null = null
|
|
191
|
+
|
|
192
|
+
static get observedAttributes() {
|
|
193
|
+
return ["data-variant", "data-size", "data-children"]
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
connectedCallback() {
|
|
197
|
+
this.button = this.querySelector<HTMLElement>("[data-preview-button]")
|
|
198
|
+
if (!this.button) return
|
|
199
|
+
this.updateButton()
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
attributeChangedCallback(_name: string, oldValue: string, newValue: string) {
|
|
203
|
+
if (oldValue !== newValue && this.button) {
|
|
204
|
+
this.updateButton()
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
updateButton() {
|
|
209
|
+
if (!this.button) return
|
|
210
|
+
|
|
211
|
+
const variant = this.dataset.variant || "default"
|
|
212
|
+
const size = this.dataset.size || "md"
|
|
213
|
+
const children = this.dataset.children || "Button"
|
|
214
|
+
|
|
215
|
+
// Remove all variant classes
|
|
216
|
+
this.button.classList.remove(
|
|
217
|
+
"bg-input",
|
|
218
|
+
"hover:bg-input/90",
|
|
219
|
+
"text-foreground",
|
|
220
|
+
"bg-primary",
|
|
221
|
+
"text-primary-foreground",
|
|
222
|
+
"hover:bg-primary/90",
|
|
223
|
+
"bg-secondary",
|
|
224
|
+
"text-secondary-foreground",
|
|
225
|
+
"hover:bg-secondary/90",
|
|
226
|
+
"border",
|
|
227
|
+
"border-input",
|
|
228
|
+
"bg-background",
|
|
229
|
+
"hover:bg-accent",
|
|
230
|
+
"hover:text-accent-foreground",
|
|
231
|
+
"bg-info",
|
|
232
|
+
"text-info-foreground",
|
|
233
|
+
"hover:bg-info/90",
|
|
234
|
+
"bg-success",
|
|
235
|
+
"text-success-foreground",
|
|
236
|
+
"hover:bg-success/90",
|
|
237
|
+
"bg-warning",
|
|
238
|
+
"text-warning-foreground",
|
|
239
|
+
"hover:bg-warning/90",
|
|
240
|
+
"bg-error",
|
|
241
|
+
"text-error-foreground",
|
|
242
|
+
"hover:bg-error/90"
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
// Add new variant classes
|
|
246
|
+
const variantClasses: Record<string, string[]> = {
|
|
247
|
+
default: ["bg-input", "hover:bg-input/90", "text-foreground"],
|
|
248
|
+
primary: ["bg-primary", "text-primary-foreground", "hover:bg-primary/90"],
|
|
249
|
+
secondary: ["bg-secondary", "text-secondary-foreground", "hover:bg-secondary/90"],
|
|
250
|
+
outline: [
|
|
251
|
+
"border",
|
|
252
|
+
"border-input",
|
|
253
|
+
"bg-background",
|
|
254
|
+
"hover:bg-accent",
|
|
255
|
+
"hover:text-accent-foreground"
|
|
256
|
+
],
|
|
257
|
+
ghost: ["hover:bg-accent", "hover:text-accent-foreground"],
|
|
258
|
+
info: ["bg-info", "text-info-foreground", "hover:bg-info/90"],
|
|
259
|
+
success: ["bg-success", "text-success-foreground", "hover:bg-success/90"],
|
|
260
|
+
warning: ["bg-warning", "text-warning-foreground", "hover:bg-warning/90"],
|
|
261
|
+
error: ["bg-error", "text-error-foreground", "hover:bg-error/90"]
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
variantClasses[variant]?.forEach((cls: string) => this.button?.classList.add(cls))
|
|
265
|
+
|
|
266
|
+
// Remove all size classes
|
|
267
|
+
this.button.classList.remove(
|
|
268
|
+
"h-9",
|
|
269
|
+
"px-3",
|
|
270
|
+
"text-sm",
|
|
271
|
+
"h-11",
|
|
272
|
+
"px-4",
|
|
273
|
+
"text-base",
|
|
274
|
+
"h-12",
|
|
275
|
+
"px-6",
|
|
276
|
+
"text-lg"
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
// Add new size classes
|
|
280
|
+
const sizeClasses: Record<string, string[]> = {
|
|
281
|
+
sm: ["h-9", "px-3", "text-sm"],
|
|
282
|
+
md: ["h-11", "px-4", "text-base"],
|
|
283
|
+
lg: ["h-12", "px-6", "text-lg"]
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
sizeClasses[size]?.forEach((cls: string) => this.button?.classList.add(cls))
|
|
287
|
+
|
|
288
|
+
// Update text
|
|
289
|
+
this.button.textContent = children
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Testimonials Preview Custom Element
|
|
294
|
+
class TestimonialsPreviewElement extends HTMLElement {
|
|
295
|
+
card: HTMLElement | null = null
|
|
296
|
+
quoteEl: HTMLElement | null = null
|
|
297
|
+
personEl: HTMLElement | null = null
|
|
298
|
+
metaEl: HTMLElement | null = null
|
|
299
|
+
|
|
300
|
+
static get observedAttributes() {
|
|
301
|
+
return ["data-alignment"]
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
connectedCallback() {
|
|
305
|
+
this.card = this.querySelector<HTMLElement>(".testimonial-card")
|
|
306
|
+
this.quoteEl = this.querySelector<HTMLElement>("[data-testimonials-quote]")
|
|
307
|
+
this.personEl = this.querySelector<HTMLElement>(".testimonial-person")
|
|
308
|
+
this.metaEl = this.querySelector<HTMLElement>(".testimonial-meta")
|
|
309
|
+
if (!this.card || !this.quoteEl || !this.personEl || !this.metaEl) return
|
|
310
|
+
this.updateClasses()
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
attributeChangedCallback(_name: string, oldValue: string, newValue: string) {
|
|
314
|
+
if (oldValue !== newValue) {
|
|
315
|
+
this.updateClasses()
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
updateClasses() {
|
|
320
|
+
if (!this.card || !this.quoteEl || !this.personEl || !this.metaEl) return
|
|
321
|
+
|
|
322
|
+
const alignment = this.dataset.alignment || "center"
|
|
323
|
+
|
|
324
|
+
// Reset all alignment classes
|
|
325
|
+
this.quoteEl.classList.remove("text-left", "text-center", "text-right")
|
|
326
|
+
this.personEl.classList.remove(
|
|
327
|
+
"flex-row",
|
|
328
|
+
"flex-row-reverse",
|
|
329
|
+
"items-center",
|
|
330
|
+
"justify-start",
|
|
331
|
+
"justify-end",
|
|
332
|
+
"flex-col",
|
|
333
|
+
"text-center"
|
|
334
|
+
)
|
|
335
|
+
this.metaEl.classList.remove(
|
|
336
|
+
"text-left",
|
|
337
|
+
"text-right",
|
|
338
|
+
"items-start",
|
|
339
|
+
"items-end",
|
|
340
|
+
"items-center"
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
if (alignment === "left") {
|
|
344
|
+
this.quoteEl.classList.add("text-left")
|
|
345
|
+
this.personEl.classList.add("flex-row", "items-center", "justify-start")
|
|
346
|
+
this.metaEl.classList.add("text-left", "items-start")
|
|
347
|
+
} else if (alignment === "right") {
|
|
348
|
+
this.quoteEl.classList.add("text-right")
|
|
349
|
+
this.personEl.classList.add("flex-row-reverse", "items-center", "justify-end")
|
|
350
|
+
this.metaEl.classList.add("text-right", "items-end")
|
|
351
|
+
} else {
|
|
352
|
+
// center
|
|
353
|
+
this.quoteEl.classList.add("text-center")
|
|
354
|
+
this.personEl.classList.add("flex-col", "items-center", "justify-center", "text-center")
|
|
355
|
+
this.metaEl.classList.add("items-center")
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// Language Switcher Preview Custom Element
|
|
361
|
+
class LanguageSwitcherPreviewElement extends HTMLElement {
|
|
362
|
+
static get observedAttributes() {
|
|
363
|
+
return ["data-variant"]
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
connectedCallback() {
|
|
367
|
+
this.updateVariant()
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
attributeChangedCallback(_name: string, oldValue: string, newValue: string) {
|
|
371
|
+
if (oldValue !== newValue) {
|
|
372
|
+
this.updateVariant()
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
updateVariant() {
|
|
377
|
+
// Dispatch event for the actual component to handle
|
|
378
|
+
this.dispatchEvent(
|
|
379
|
+
new CustomEvent("language-switcher:variant-change", {
|
|
380
|
+
detail: { variant: this.dataset.variant },
|
|
381
|
+
bubbles: true
|
|
382
|
+
})
|
|
383
|
+
)
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Register all custom elements
|
|
388
|
+
if (!customElements.get("hero-preview")) {
|
|
389
|
+
customElements.define("hero-preview", HeroPreviewElement)
|
|
390
|
+
}
|
|
391
|
+
if (!customElements.get("section-preview")) {
|
|
392
|
+
customElements.define("section-preview", SectionPreviewElement)
|
|
393
|
+
}
|
|
394
|
+
if (!customElements.get("button-preview")) {
|
|
395
|
+
customElements.define("button-preview", ButtonPreviewElement)
|
|
396
|
+
}
|
|
397
|
+
if (!customElements.get("testimonials-preview")) {
|
|
398
|
+
customElements.define("testimonials-preview", TestimonialsPreviewElement)
|
|
399
|
+
}
|
|
400
|
+
if (!customElements.get("language-switcher-preview")) {
|
|
401
|
+
customElements.define("language-switcher-preview", LanguageSwitcherPreviewElement)
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Auto-register when module is imported
|
|
406
|
+
if (typeof window !== "undefined") {
|
|
407
|
+
registerShowcasePreviewElements()
|
|
408
|
+
}
|