@rimelight/ui 0.0.6 → 0.0.8

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.
@@ -1,11 +1,13 @@
1
1
  import type { AstroIntegration } from "astro"
2
+ import vue from "@astrojs/vue"
3
+ import uiPlugin from "@nuxt/ui/vite"
2
4
  import defu from "defu"
3
5
  import Icons from "unplugin-icons/vite"
6
+ import tailwindcss from '@tailwindcss/vite'
4
7
  import { defaultUIConfig } from "../themes"
5
8
 
6
9
  /**
7
- * Shape of the `ui` config that can be passed to the integration. Keys are component names, values
8
- * are partial theme configs.
10
+ * Shape of the `ui` config that can be passed to the integration.
9
11
  */
10
12
  export type UIConfigOverrides = {
11
13
  button?: Partial<(typeof defaultUIConfig)["button"]>
@@ -42,33 +44,35 @@ export interface UIOptions {
42
44
  * ]
43
45
  * })
44
46
  */
45
- export function ui(options: UIOptions = {}): AstroIntegration {
46
- // Merge user overrides with defaults (user-provided values win)
47
+ export function ui(options: UIOptions = {}): AstroIntegration[] {
47
48
  const resolvedConfig = defu(options.ui ?? {}, defaultUIConfig)
48
49
 
49
50
  const virtualModuleId = "virtual:rimelight-ui"
50
51
  const resolvedVirtualModuleId = "\0" + virtualModuleId
51
52
 
52
- return {
53
+ const rimelightUIIntegration: AstroIntegration = {
53
54
  name: "@rimelight/ui",
54
55
  hooks: {
55
56
  "astro:config:setup": ({ updateConfig, logger }) => {
56
- logger.info("Initializing @rimelight/ui configuration")
57
+ logger.info("Initializing @rimelight/ui core")
57
58
 
58
59
  updateConfig({
59
60
  vite: {
60
61
  plugins: [
62
+ uiPlugin({
63
+ router: false,
64
+ scanPackages: ["@rimelight/ui"]
65
+ }),
61
66
  Icons({
62
67
  compiler: "astro",
63
68
  autoInstall: true
64
69
  }),
70
+ tailwindcss(),
65
71
  {
66
72
  name: "vite-plugin-rimelight-ui-config",
67
73
  enforce: "pre",
68
74
  resolveId(id: string) {
69
- if (id === virtualModuleId) {
70
- return resolvedVirtualModuleId
71
- }
75
+ if (id === virtualModuleId) return resolvedVirtualModuleId
72
76
  return null
73
77
  },
74
78
  load(id: string) {
@@ -78,10 +82,17 @@ export function ui(options: UIOptions = {}): AstroIntegration {
78
82
  return null
79
83
  }
80
84
  }
81
- ]
85
+ ] as any
82
86
  }
83
87
  })
84
88
  }
85
89
  }
86
90
  }
91
+
92
+ return [
93
+ vue({
94
+ appEntrypoint: "@rimelight/ui/integrations/vue-entrypoint"
95
+ }),
96
+ rimelightUIIntegration
97
+ ]
87
98
  }
@@ -0,0 +1,6 @@
1
+ import type { App } from "vue"
2
+ import ui from "@nuxt/ui/vue-plugin"
3
+
4
+ export default (app: App) => {
5
+ app.use(ui)
6
+ }
@@ -59,14 +59,14 @@ export const sri = defineMiddleware(async (_, next) => {
59
59
  const scriptRegex = new RegExp(`(<script[^>]+src=["']${url}["'][^>]*)(/?>)`, "g")
60
60
  modifiedHtml = modifiedHtml.replace(
61
61
  scriptRegex,
62
- `$1 integrity="${String(hash)}" crossorigin="anonymous"$2`
62
+ `$1 integrity="${hash}" crossorigin="anonymous"$2`
63
63
  )
64
64
 
65
65
  // Look for link tags with the specific URL
66
66
  const linkRegex = new RegExp(`(<link[^>]+href=["']${url}["'][^>]*)(/?>)`, "g")
67
67
  modifiedHtml = modifiedHtml.replace(
68
68
  linkRegex,
69
- `$1 integrity="${String(hash)}" crossorigin="anonymous"$2`
69
+ `$1 integrity="${hash}" crossorigin="anonymous"$2`
70
70
  )
71
71
  }
72
72
 
package/src/nuxt.ts ADDED
@@ -0,0 +1,125 @@
1
+ // Components
2
+ export { default as Accordion } from "@nuxt/ui/components/Accordion.vue";
3
+ export { default as Alert } from "@nuxt/ui/components/Alert.vue";
4
+ export { default as App } from "@nuxt/ui/components/App.vue";
5
+ export { default as AuthForm } from "@nuxt/ui/components/AuthForm.vue";
6
+ export { default as Avatar } from "@nuxt/ui/components/Avatar.vue";
7
+ export { default as AvatarGroup } from "@nuxt/ui/components/AvatarGroup.vue";
8
+ export { default as Badge } from "@nuxt/ui/components/Badge.vue";
9
+ export { default as Banner } from "@nuxt/ui/components/Banner.vue";
10
+ export { default as BlogPost } from "@nuxt/ui/components/BlogPost.vue";
11
+ export { default as BlogPosts } from "@nuxt/ui/components/BlogPosts.vue";
12
+ export { default as Breadcrumb } from "@nuxt/ui/components/Breadcrumb.vue";
13
+ export { default as Button } from "@nuxt/ui/components/Button.vue";
14
+ export { default as Calendar } from "@nuxt/ui/components/Calendar.vue";
15
+ export { default as Card } from "@nuxt/ui/components/Card.vue";
16
+ export { default as Carousel } from "@nuxt/ui/components/Carousel.vue";
17
+ export { default as ChangelogVersion } from "@nuxt/ui/components/ChangelogVersion.vue";
18
+ export { default as ChangelogVersions } from "@nuxt/ui/components/ChangelogVersions.vue";
19
+ export { default as ChatMessage } from "@nuxt/ui/components/ChatMessage.vue";
20
+ export { default as ChatMessages } from "@nuxt/ui/components/ChatMessages.vue";
21
+ export { default as ChatPalette } from "@nuxt/ui/components/ChatPalette.vue";
22
+ export { default as ChatPrompt } from "@nuxt/ui/components/ChatPrompt.vue";
23
+ export { default as ChatPromptSubmit } from "@nuxt/ui/components/ChatPromptSubmit.vue";
24
+ export { default as ChatReasoning } from "@nuxt/ui/components/ChatReasoning.vue";
25
+ export { default as ChatShimmer } from "@nuxt/ui/components/ChatShimmer.vue";
26
+ export { default as ChatTool } from "@nuxt/ui/components/ChatTool.vue";
27
+ export { default as Checkbox } from "@nuxt/ui/components/Checkbox.vue";
28
+ export { default as CheckboxGroup } from "@nuxt/ui/components/CheckboxGroup.vue";
29
+ export { default as Chip } from "@nuxt/ui/components/Chip.vue";
30
+ export { default as Collapsible } from "@nuxt/ui/components/Collapsible.vue";
31
+ export { default as ColorPicker } from "@nuxt/ui/components/ColorPicker.vue";
32
+ export { default as CommandPalette } from "@nuxt/ui/components/CommandPalette.vue";
33
+ export { default as Container } from "@nuxt/ui/components/Container.vue";
34
+ export { default as ContextMenu } from "@nuxt/ui/components/ContextMenu.vue";
35
+ export { default as DashboardGroup } from "@nuxt/ui/components/DashboardGroup.vue";
36
+ export { default as DashboardNavbar } from "@nuxt/ui/components/DashboardNavbar.vue";
37
+ export { default as DashboardPanel } from "@nuxt/ui/components/DashboardPanel.vue";
38
+ export { default as DashboardResizeHandle } from "@nuxt/ui/components/DashboardResizeHandle.vue";
39
+ export { default as DashboardSearch } from "@nuxt/ui/components/DashboardSearch.vue";
40
+ export { default as DashboardSearchButton } from "@nuxt/ui/components/DashboardSearchButton.vue";
41
+ export { default as DashboardSidebar } from "@nuxt/ui/components/DashboardSidebar.vue";
42
+ export { default as DashboardSidebarCollapse } from "@nuxt/ui/components/DashboardSidebarCollapse.vue";
43
+ export { default as DashboardSidebarToggle } from "@nuxt/ui/components/DashboardSidebarToggle.vue";
44
+ export { default as DashboardToolbar } from "@nuxt/ui/components/DashboardToolbar.vue";
45
+ export { default as Drawer } from "@nuxt/ui/components/Drawer.vue";
46
+ export { default as DropdownMenu } from "@nuxt/ui/components/DropdownMenu.vue";
47
+ export { default as Editor } from "@nuxt/ui/components/Editor.vue";
48
+ export { default as EditorDragHandle } from "@nuxt/ui/components/EditorDragHandle.vue";
49
+ export { default as EditorEmojiMenu } from "@nuxt/ui/components/EditorEmojiMenu.vue";
50
+ export { default as EditorMentionMenu } from "@nuxt/ui/components/EditorMentionMenu.vue";
51
+ export { default as EditorSuggestionMenu } from "@nuxt/ui/components/EditorSuggestionMenu.vue";
52
+ export { default as EditorToolbar } from "@nuxt/ui/components/EditorToolbar.vue";
53
+ export { default as Empty } from "@nuxt/ui/components/Empty.vue";
54
+ export { default as Error } from "@nuxt/ui/components/Error.vue";
55
+ export { default as FieldGroup } from "@nuxt/ui/components/FieldGroup.vue";
56
+ export { default as FileUpload } from "@nuxt/ui/components/FileUpload.vue";
57
+ export { default as Footer } from "@nuxt/ui/components/Footer.vue";
58
+ export { default as FooterColumns } from "@nuxt/ui/components/FooterColumns.vue";
59
+ export { default as Form } from "@nuxt/ui/components/Form.vue";
60
+ export { default as FormField } from "@nuxt/ui/components/FormField.vue";
61
+ export { default as Header } from "@nuxt/ui/components/Header.vue";
62
+ export { default as Icon } from "@nuxt/ui/components/Icon.vue";
63
+ export { default as Input } from "@nuxt/ui/components/Input.vue";
64
+ export { default as InputDate } from "@nuxt/ui/components/InputDate.vue";
65
+ export { default as InputMenu } from "@nuxt/ui/components/InputMenu.vue";
66
+ export { default as InputNumber } from "@nuxt/ui/components/InputNumber.vue";
67
+ export { default as InputTags } from "@nuxt/ui/components/InputTags.vue";
68
+ export { default as InputTime } from "@nuxt/ui/components/InputTime.vue";
69
+ export { default as Kbd } from "@nuxt/ui/components/Kbd.vue";
70
+ export { default as Link } from "@nuxt/ui/components/Link.vue";
71
+ export { default as Main } from "@nuxt/ui/components/Main.vue";
72
+ export { default as Marquee } from "@nuxt/ui/components/Marquee.vue";
73
+ export { default as Modal } from "@nuxt/ui/components/Modal.vue";
74
+ export { default as NavigationMenu } from "@nuxt/ui/components/NavigationMenu.vue";
75
+ export { default as Page } from "@nuxt/ui/components/Page.vue";
76
+ export { default as PageAnchors } from "@nuxt/ui/components/PageAnchors.vue";
77
+ export { default as PageAside } from "@nuxt/ui/components/PageAside.vue";
78
+ export { default as PageBody } from "@nuxt/ui/components/PageBody.vue";
79
+ export { default as PageCard } from "@nuxt/ui/components/PageCard.vue";
80
+ export { default as PageColumns } from "@nuxt/ui/components/PageColumns.vue";
81
+ export { default as PageCTA } from "@nuxt/ui/components/PageCTA.vue";
82
+ export { default as PageFeature } from "@nuxt/ui/components/PageFeature.vue";
83
+ export { default as PageGrid } from "@nuxt/ui/components/PageGrid.vue";
84
+ export { default as PageHeader } from "@nuxt/ui/components/PageHeader.vue";
85
+ export { default as PageHero } from "@nuxt/ui/components/PageHero.vue";
86
+ export { default as PageLinks } from "@nuxt/ui/components/PageLinks.vue";
87
+ export { default as PageList } from "@nuxt/ui/components/PageList.vue";
88
+ export { default as PageLogos } from "@nuxt/ui/components/PageLogos.vue";
89
+ export { default as PageSection } from "@nuxt/ui/components/PageSection.vue";
90
+ export { default as Pagination } from "@nuxt/ui/components/Pagination.vue";
91
+ export { default as PinInput } from "@nuxt/ui/components/PinInput.vue";
92
+ export { default as Popover } from "@nuxt/ui/components/Popover.vue";
93
+ export { default as PricingPlan } from "@nuxt/ui/components/PricingPlan.vue";
94
+ export { default as PricingPlans } from "@nuxt/ui/components/PricingPlans.vue";
95
+ export { default as PricingTable } from "@nuxt/ui/components/PricingTable.vue";
96
+ export { default as Progress } from "@nuxt/ui/components/Progress.vue";
97
+ export { default as RadioGroup } from "@nuxt/ui/components/RadioGroup.vue";
98
+ export { default as ScrollArea } from "@nuxt/ui/components/ScrollArea.vue";
99
+ export { default as Select } from "@nuxt/ui/components/Select.vue";
100
+ export { default as SelectMenu } from "@nuxt/ui/components/SelectMenu.vue";
101
+ export { default as Separator } from "@nuxt/ui/components/Separator.vue";
102
+ export { default as Sidebar } from "@nuxt/ui/components/Sidebar.vue";
103
+ export { default as Skeleton } from "@nuxt/ui/components/Skeleton.vue";
104
+ export { default as Slideover } from "@nuxt/ui/components/Slideover.vue";
105
+ export { default as Slider } from "@nuxt/ui/components/Slider.vue";
106
+ export { default as Stepper } from "@nuxt/ui/components/Stepper.vue";
107
+ export { default as Switch } from "@nuxt/ui/components/Switch.vue";
108
+ export { default as Table } from "@nuxt/ui/components/Table.vue";
109
+ export { default as Tabs } from "@nuxt/ui/components/Tabs.vue";
110
+ export { default as Textarea } from "@nuxt/ui/components/Textarea.vue";
111
+ export { default as Timeline } from "@nuxt/ui/components/Timeline.vue";
112
+ export { default as Toast } from "@nuxt/ui/components/Toast.vue";
113
+ export { default as Toaster } from "@nuxt/ui/components/Toaster.vue";
114
+ export { default as Tooltip } from "@nuxt/ui/components/Tooltip.vue";
115
+ export { default as Tree } from "@nuxt/ui/components/Tree.vue";
116
+ export { default as User } from "@nuxt/ui/components/User.vue";
117
+ export { default as ColorModeAvatar } from "@nuxt/ui/components/color-mode/ColorModeAvatar.vue";
118
+ export { default as ColorModeButton } from "@nuxt/ui/components/color-mode/ColorModeButton.vue";
119
+ export { default as ColorModeImage } from "@nuxt/ui/components/color-mode/ColorModeImage.vue";
120
+ export { default as ColorModeSelect } from "@nuxt/ui/components/color-mode/ColorModeSelect.vue";
121
+ export { default as ColorModeSwitch } from "@nuxt/ui/components/color-mode/ColorModeSwitch.vue";
122
+ export { default as LocaleSelect } from "@nuxt/ui/components/locale/LocaleSelect.vue";
123
+
124
+ // Explicitly allowed composables
125
+ export * from "@nuxt/ui/composables/defineShortcuts";
@@ -0,0 +1,2 @@
1
+ @import "tailwindcss";
2
+ @import "@nuxt/ui";
@@ -1,3 +1 @@
1
- export * from "./parse-boolean"
2
- export * from "./deep-merge"
3
1
  export * from "./embed"
@@ -1,181 +0,0 @@
1
- ---
2
- import { Image } from "astro:assets";
3
- import { scv } from "css-variants";
4
- import type { CollectionEntry } from "astro:content";
5
- import Separator from "@rimelight/ui/components/separator/Separator.astro";
6
- import Avatar from "@rimelight/ui/components/avatar/Avatar.astro";
7
- import AvatarImage from "@rimelight/ui/components/avatar/AvatarImage.astro";
8
- import avatarAsset from "../assets/team/Daniel-Marchi_0000_00.webp";
9
- import { fetchTranslations } from "@rimelight/ui/domain";
10
-
11
- const { translationLocale, cfContext } = Astro.locals;
12
- const runtime = { cf: Astro.request.cf, cfContext };
13
- const { blog: t } = await fetchTranslations(runtime, translationLocale, ["blog"]);
14
-
15
- // Support both Astro content collections and CMS documents
16
- export type CMSPostDocument = {
17
- _id: string;
18
- slug?: string;
19
- title: string;
20
- excerpt?: string;
21
- description?: string;
22
- image?: string;
23
- publishedDate?: string | Date | null;
24
- featured?: boolean;
25
- _updatedAt?: string;
26
- _createdAt?: string;
27
- };
28
-
29
- export interface BlogPostProps extends NonNullable<Parameters<typeof blogPostVariants>[0]> {
30
- post: CollectionEntry<"blog"> | CMSPostDocument;
31
- class?: string;
32
- showImage?: boolean;
33
- separator?: boolean;
34
- }
35
-
36
- type Props = BlogPostProps;
37
-
38
- const blogPostVariants = scv({
39
- slots: [
40
- "root",
41
- "imageWrapper",
42
- "image",
43
- "content",
44
- "title",
45
- "description",
46
- "footer",
47
- "authorGroup",
48
- "author",
49
- "link",
50
- "badge",
51
- "featuredBadge"
52
- ],
53
- base: {
54
- root: "group flex transition-all duration-300 w-full",
55
- imageWrapper: "relative overflow-hidden ring-1 ring-border shadow-sm shrink-0 bg-muted isolate",
56
- image: "absolute inset-0 h-full w-full !object-cover transition-transform duration-500 group-hover:scale-105 block",
57
- content: "flex flex-col flex-1",
58
- title: "font-heading font-bold tracking-tight text-pretty group-hover:text-primary transition-colors",
59
- description: "text-muted-foreground line-clamp-2 text-base text-pretty",
60
- footer: "mt-auto flex items-end justify-end w-full",
61
- authorGroup: "flex flex-col gap-5xs text-xs font-medium text-muted-foreground",
62
- author: "font-bold text-foreground",
63
- link: "inline-flex items-center gap-5xs text-sm font-semibold hover:underline decoration-primary underline-offset-4",
64
- badge: "px-2xs py-6xs rounded-full bg-muted text-muted-foreground text-[10px] font-bold uppercase tracking-wider",
65
- featuredBadge: "absolute top-3 left-3 z-20 flex items-center gap-5xs px-3xs py-5xs rounded-full bg-primary text-primary-foreground text-[10px] font-bold uppercase tracking-wider shadow-lg ring-1 ring-white/20",
66
- },
67
- variants: {
68
- variant: {
69
- flat: {
70
- root: "flex-col md:flex-row gap-3xl md:gap-4xl items-stretch py-4xl first:pt-0 last:pb-0 text-left",
71
- imageWrapper: "w-full md:w-5/12 aspect-video self-stretch rounded-3xl shrink-0 shadow-none ring-0",
72
- content: "gap-2xl justify-center items-start text-left",
73
- title: "text-xl",
74
- description: "text-base",
75
- },
76
- card: {
77
- root: "flex-col bg-muted/20 p-2xl rounded-3xl border border-border/50 hover:bg-muted/40 hover:shadow-2xl hover:-translate-y-1 gap-2xl text-left items-stretch",
78
- imageWrapper: "w-full aspect-video rounded-2xl shadow-lg",
79
- title: "text-xl",
80
- content: "gap-2xl text-left items-start",
81
- },
82
- },
83
- },
84
- defaultVariants: {
85
- variant: "flat",
86
- },
87
- });
88
-
89
- const { post, variant, class: className, showImage = true, separator = false } = Astro.props;
90
-
91
- // Detect if this is a CMS document or Astro content entry
92
- const isCMSDocument = "_id" in post && !("id" in post);
93
-
94
- // Extract fields based on source type
95
- const postTitle = isCMSDocument ? post.title : post.data.title;
96
- const postDescription = isCMSDocument ? (post.description || post.excerpt) : post.data.description;
97
- const postImage = isCMSDocument ? post.image : post.data.heroImage;
98
- const postFeatured = isCMSDocument ? (post.featured ?? false) : post.data.featured;
99
-
100
- // Handle date formatting
101
- const rawDate = isCMSDocument ? (post.publishedDate || post._createdAt) : post.data.publishedDate;
102
- const d = rawDate ? new Date(rawDate) : null;
103
- const formattedDate = d && !isNaN(d.getTime())
104
- ? new Intl.DateTimeFormat(translationLocale, {
105
- dateStyle: "medium",
106
- }).format(d)
107
- : "";
108
-
109
- // Get slug from CMS or Astro content
110
- const postSlug = isCMSDocument
111
- ? (post.slug || "")
112
- : post.id.replace(/^(en|pt|de|es|ja)\//, "");
113
-
114
- const { root, imageWrapper, image, content, title, description, footer, authorGroup, author, link, badge, featuredBadge } = blogPostVariants({ variant });
115
- ---
116
-
117
- <div class="flex flex-col w-full">
118
- <a href={`/${translationLocale}/blog/${postSlug}`} class:list={[root, className]}>
119
- {showImage && (
120
- <div class={imageWrapper}>
121
- {postFeatured && (
122
- <div class={featuredBadge}>
123
- <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"></path></svg>
124
- {t.latest}
125
- </div>
126
- )}
127
- {postImage && (
128
- <Image
129
- src={postImage as any}
130
- alt={postTitle}
131
- width={800}
132
- height={450}
133
- class={image}
134
- loading="lazy"
135
- decoding="async"
136
- />
137
- )}
138
- </div>
139
- )}
140
-
141
- <div class={content}>
142
- <h3 class={title}>
143
- {postTitle}
144
- </h3>
145
-
146
- <div class="flex items-center gap-3xs mt-3xs">
147
- <Avatar size="sm" variant="primary">
148
- <AvatarImage image={avatarAsset} alt="Daniel Marchi" />
149
- </Avatar>
150
- <div class={authorGroup}>
151
- <span class={author}>Daniel Marchi</span>
152
- <div class="flex items-center gap-3xs">
153
- <span>{formattedDate}</span>
154
- <div class="flex flex-wrap gap-5xs ml-3xs">
155
- <span class={badge}>Engineering</span>
156
- <span class={badge}>Astro</span>
157
- </div>
158
- </div>
159
- </div>
160
- </div>
161
-
162
- <p class={description}>
163
- {postDescription}
164
- </p>
165
-
166
- <div class={footer}>
167
- <span class={link}>
168
- {t.read_article}
169
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="transition-transform group-hover:translate-x-1"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg>
170
- </span>
171
- </div>
172
- </div>
173
- </a>
174
-
175
- {separator && (
176
- <div class="py-4xl last:hidden">
177
- <Separator />
178
- </div>
179
- )}
180
- </div>
181
-