@rimelight/ui 0.0.24 → 0.0.26
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/package.json +7 -3
- package/src/components/Head.astro +199 -156
- package/src/components/ThemeToggle.astro +2 -2
- package/src/components/astro/RLAAccordion.astro +22 -0
- package/src/components/astro/RLAButton.astro +104 -118
- package/src/components/astro/RLAFooter.astro +17 -43
- package/src/components/astro/RLAHeader.astro +21 -80
- package/src/components/astro/RLAIcon.astro +14 -39
- package/src/components/astro/RLALogo.astro +14 -48
- package/src/components/astro/RLAPlaceholder.astro +11 -35
- package/src/components/astro/RLAQuote.astro +15 -0
- package/src/components/astro/RLAScrollToTop.astro +171 -221
- package/src/components/astro/RLASection.astro +210 -0
- package/src/components/vue/RLVButton.vue +166 -139
- package/src/components/vue/RLVFooter.vue +17 -54
- package/src/components/vue/RLVHeader.vue +22 -105
- package/src/components/vue/RLVIcon.vue +14 -45
- package/src/components/vue/RLVLogo.vue +11 -58
- package/src/components/vue/RLVPlaceholder.vue +14 -35
- package/src/components/vue/RLVScrollToTop.vue +18 -89
- package/src/components/vue/RLVSection.vue +166 -0
- package/src/composables/index.ts +0 -1
- package/src/env.d.ts +5 -0
- package/src/integrations/ui.ts +2 -6
- package/src/plugins/index.ts +5 -2
- package/src/plugins/starlightAddons/index.ts +3 -64
- package/src/plugins/starlightDocsApi/components/ApiEmits.astro +46 -0
- package/src/plugins/starlightDocsApi/components/ApiProps.astro +47 -0
- package/src/plugins/starlightDocsApi/components/ApiSlots.astro +50 -0
- package/src/plugins/starlightDocsApi/components/ApiTheme.astro +27 -0
- package/src/plugins/starlightDocsApi/extract-vue.ts +286 -0
- package/src/plugins/starlightDocsApi/index.ts +265 -0
- package/src/plugins/starlightDocsApi/types.ts +40 -0
- package/src/plugins/starlightDocsApi/utils.ts +45 -0
- package/src/themes/button.theme.ts +29 -14
- package/src/themes/footer.theme.ts +4 -6
- package/src/themes/header.theme.ts +4 -28
- package/src/themes/icon.theme.ts +4 -2
- package/src/themes/index.ts +15 -20
- package/src/themes/logo.theme.ts +4 -2
- package/src/themes/placeholder.theme.ts +4 -6
- package/src/themes/scroll-to-top.theme.ts +4 -6
- package/src/themes/section.theme.ts +187 -0
- package/src/types/componentVariant.ts +14 -0
- package/src/types/index.ts +1 -0
- package/src/utils/defineTheme.ts +11 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/resolveClasses.ts +21 -0
- package/src/utils/useUi.ts +19 -0
- package/src/composables/useUi.ts +0 -27
- package/src/plugins/starlightAddons/Sidebar.astro +0 -89
- package/src/plugins/starlightAddons/data.ts +0 -39
- package/src/plugins/starlightAddons/libs/config.ts +0 -107
- package/src/plugins/starlightAddons/libs/content.ts +0 -20
- package/src/plugins/starlightAddons/libs/i18n.ts +0 -51
- package/src/plugins/starlightAddons/libs/locals.ts +0 -12
- package/src/plugins/starlightAddons/libs/pathname.ts +0 -22
- package/src/plugins/starlightAddons/libs/plugin.ts +0 -9
- package/src/plugins/starlightAddons/libs/sidebar.ts +0 -183
- package/src/plugins/starlightAddons/libs/vite.ts +0 -46
- package/src/plugins/starlightAddons/locals.d.ts +0 -14
- package/src/plugins/starlightAddons/middleware.ts +0 -132
- package/src/plugins/starlightAddons/overrides/Sidebar.astro +0 -8
- package/src/plugins/starlightAddons/schema.ts +0 -13
- package/src/plugins/starlightAddons/virtual.d.ts +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment UI Library.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"defu": "6.1.6",
|
|
68
68
|
"embla-carousel": "8.6.0",
|
|
69
69
|
"picomatch": "^4.0.4",
|
|
70
|
-
"tailwind-merge": "^3.3.1",
|
|
71
70
|
"tailwindcss": "^4.2.3",
|
|
72
71
|
"turndown": "^7.2.4",
|
|
73
72
|
"turndown-plugin-gfm": "^1.0.2",
|
|
@@ -82,6 +81,9 @@
|
|
|
82
81
|
"@unocss/eslint-plugin": "66.6.8",
|
|
83
82
|
"astro": "6.1.8",
|
|
84
83
|
"eslint-plugin-regexp": "3.1.0",
|
|
84
|
+
"knip": "6.12.2",
|
|
85
|
+
"tsx": "4.21.0",
|
|
86
|
+
"typescript": "6.0.3",
|
|
85
87
|
"unocss": "66.6.8",
|
|
86
88
|
"vite-plus": "0.1.19"
|
|
87
89
|
},
|
|
@@ -96,6 +98,8 @@
|
|
|
96
98
|
}
|
|
97
99
|
},
|
|
98
100
|
"scripts": {
|
|
99
|
-
"
|
|
101
|
+
"knip": "knip",
|
|
102
|
+
"astro": "astro",
|
|
103
|
+
"docs:meta": "tsx scripts/extract-meta.ts"
|
|
100
104
|
}
|
|
101
105
|
}
|
|
@@ -1,156 +1,199 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { ClientRouter } from 'astro:transitions';
|
|
3
|
-
import type { SiteConfig } from '@/config';
|
|
4
|
-
import { App } from '../nuxt.ts';
|
|
5
|
-
|
|
6
|
-
export interface
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
config
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
{
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
1
|
+
---
|
|
2
|
+
import { ClientRouter } from 'astro:transitions';
|
|
3
|
+
import type { SiteConfig } from '@/config';
|
|
4
|
+
import { App } from '../nuxt.ts';
|
|
5
|
+
|
|
6
|
+
export interface OGImage {
|
|
7
|
+
/** Image URL (relative or absolute) */
|
|
8
|
+
src: string;
|
|
9
|
+
/** Alt text for the image */
|
|
10
|
+
alt: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RSSFeed {
|
|
14
|
+
/** RSS feed URL */
|
|
15
|
+
href: string;
|
|
16
|
+
/** Feed title (defaults to "RSS") */
|
|
17
|
+
title?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface HeadProps {
|
|
21
|
+
/** Page title */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** Page description */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** Open Graph image with alt text */
|
|
26
|
+
ogImage?: OGImage;
|
|
27
|
+
/** Open Graph type (e.g., "website", "article") */
|
|
28
|
+
ogType?: string;
|
|
29
|
+
/** Open Graph locale (defaults to "en_US") */
|
|
30
|
+
ogLocale?: string;
|
|
31
|
+
/** Whether to prevent indexing */
|
|
32
|
+
noindex?: boolean;
|
|
33
|
+
/** Whether this is a 404 page */
|
|
34
|
+
is404?: boolean;
|
|
35
|
+
/** Robots metadata (overrides noindex/is404 logic if provided) */
|
|
36
|
+
robots?: string;
|
|
37
|
+
/** Canonical URL */
|
|
38
|
+
canonical?: string;
|
|
39
|
+
/** Language alternates for i18n */
|
|
40
|
+
languageAlternates?: Array<{ hreflang: string; href: string }>;
|
|
41
|
+
/** Site configuration for defaults */
|
|
42
|
+
config?: SiteConfig;
|
|
43
|
+
/** Whether to enable View Transitions (ClientRouter) */
|
|
44
|
+
transitions?: boolean;
|
|
45
|
+
/** Meta charset */
|
|
46
|
+
charset?: string;
|
|
47
|
+
/** Meta viewport */
|
|
48
|
+
viewport?: string;
|
|
49
|
+
/** RSS feed configuration */
|
|
50
|
+
rssFeed?: RSSFeed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const {
|
|
54
|
+
title,
|
|
55
|
+
description,
|
|
56
|
+
ogImage,
|
|
57
|
+
ogType = 'website',
|
|
58
|
+
ogLocale = 'en_US',
|
|
59
|
+
noindex = false,
|
|
60
|
+
is404 = false,
|
|
61
|
+
robots,
|
|
62
|
+
canonical,
|
|
63
|
+
languageAlternates = [],
|
|
64
|
+
config,
|
|
65
|
+
transitions = true,
|
|
66
|
+
charset = 'utf-8',
|
|
67
|
+
viewport = 'width=device-width,initial-scale=1',
|
|
68
|
+
rssFeed,
|
|
69
|
+
} = Astro.props as HeadProps;
|
|
70
|
+
|
|
71
|
+
// Resolve defaults from config if available
|
|
72
|
+
const siteName = config?.name || 'Rimelight';
|
|
73
|
+
const siteDescription = config?.description || '';
|
|
74
|
+
const ogImageFallback = config?.seo?.ogImageFallback || config?.ogImage || '';
|
|
75
|
+
const themeColor = config?.branding?.colors?.themeColor;
|
|
76
|
+
const favicon = config?.branding?.favicon?.svg || '/favicon.svg';
|
|
77
|
+
const twitterHandle = config?.seo?.authorHandle;
|
|
78
|
+
const titleTemplate = config?.seo?.titleTemplate || `%s | ${siteName}`;
|
|
79
|
+
|
|
80
|
+
// Calculated Values
|
|
81
|
+
const displayTitle = is404
|
|
82
|
+
? `404 - Not Found | ${siteName}`
|
|
83
|
+
: title
|
|
84
|
+
? titleTemplate.replace('%s', title)
|
|
85
|
+
: siteName;
|
|
86
|
+
|
|
87
|
+
const finalDescription = description || siteDescription;
|
|
88
|
+
const safeDescription = finalDescription && config?.seo?.maxDescriptionLength
|
|
89
|
+
? (finalDescription.length > config.seo.maxDescriptionLength
|
|
90
|
+
? finalDescription.slice(0, config.seo.maxDescriptionLength - 3) + '...'
|
|
91
|
+
: finalDescription)
|
|
92
|
+
: finalDescription;
|
|
93
|
+
|
|
94
|
+
const finalOgImage = ogImage || (ogImageFallback ? { src: ogImageFallback, alt: siteName } : undefined);
|
|
95
|
+
const absoluteOgImage = finalOgImage
|
|
96
|
+
? new URL(finalOgImage.src, Astro.site).toString()
|
|
97
|
+
: undefined;
|
|
98
|
+
|
|
99
|
+
function formatCanonicalURL(url: string | URL) {
|
|
100
|
+
const resolved = new URL(url, Astro.site);
|
|
101
|
+
const path = resolved.toString();
|
|
102
|
+
const hasQueryParams = path.includes('?');
|
|
103
|
+
if (hasQueryParams) {
|
|
104
|
+
return path.replace(/\/?$/, '');
|
|
105
|
+
}
|
|
106
|
+
return path.replace(/\/?$/, '/');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const finalCanonical = canonical
|
|
110
|
+
? formatCanonicalURL(canonical)
|
|
111
|
+
: (!is404 ? formatCanonicalURL(Astro.url) : undefined);
|
|
112
|
+
|
|
113
|
+
const isIndexable = !noindex && !is404;
|
|
114
|
+
const defaultRobots = isIndexable ? 'index, follow, max-image-preview:large' : 'noindex, nofollow';
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
<!-- Basic Metadata -->
|
|
118
|
+
<meta charset={charset} />
|
|
119
|
+
<meta name="viewport" content={viewport} />
|
|
120
|
+
<meta name="generator" content={Astro.generator} />
|
|
121
|
+
|
|
122
|
+
<!-- Sitemap -->
|
|
123
|
+
<link rel="sitemap" href="/sitemap-index.xml" />
|
|
124
|
+
|
|
125
|
+
<!-- RSS Feed -->
|
|
126
|
+
{rssFeed && <link rel="alternate" type="application/rss+xml" href={rssFeed.href} title={rssFeed.title || 'RSS'} />}
|
|
127
|
+
|
|
128
|
+
<!-- SEO -->
|
|
129
|
+
<title>{displayTitle}</title>
|
|
130
|
+
{safeDescription && <meta name="description" content={safeDescription} />}
|
|
131
|
+
<meta name="robots" content={robots || defaultRobots} />
|
|
132
|
+
{finalCanonical && <link rel="canonical" href={finalCanonical} />}
|
|
133
|
+
|
|
134
|
+
<!-- i18n Alternates -->
|
|
135
|
+
{languageAlternates.map((alt) => (
|
|
136
|
+
<link rel="alternate" hreflang={alt.hreflang} href={alt.href} />
|
|
137
|
+
))}
|
|
138
|
+
|
|
139
|
+
<!-- Open Graph / Facebook -->
|
|
140
|
+
<meta property="og:type" content={ogType} />
|
|
141
|
+
<meta property="og:locale" content={ogLocale} />
|
|
142
|
+
<meta property="og:url" content={Astro.url.href} />
|
|
143
|
+
<meta property="og:title" content={title || siteName} />
|
|
144
|
+
{safeDescription && <meta property="og:description" content={safeDescription} />}
|
|
145
|
+
{absoluteOgImage && <meta property="og:image" content={absoluteOgImage} />}
|
|
146
|
+
{finalOgImage && <meta property="og:image:alt" content={finalOgImage.alt} />}
|
|
147
|
+
<meta property="og:site_name" content={siteName} />
|
|
148
|
+
|
|
149
|
+
<!-- Twitter -->
|
|
150
|
+
<meta property="twitter:card" content="summary_large_image" />
|
|
151
|
+
<meta property="twitter:url" content={Astro.url.href} />
|
|
152
|
+
<meta property="twitter:title" content={title || siteName} />
|
|
153
|
+
{safeDescription && <meta property="twitter:description" content={safeDescription} />}
|
|
154
|
+
{absoluteOgImage && <meta property="twitter:image" content={absoluteOgImage} />}
|
|
155
|
+
{finalOgImage && <meta property="twitter:image:alt" content={finalOgImage.alt} />}
|
|
156
|
+
{twitterHandle && <meta property="twitter:site" content={twitterHandle} />}
|
|
157
|
+
{twitterHandle && <meta property="twitter:creator" content={twitterHandle} />}
|
|
158
|
+
|
|
159
|
+
<!-- Icons -->
|
|
160
|
+
<link rel="icon" type="image/svg+xml" href={favicon} />
|
|
161
|
+
|
|
162
|
+
<!-- Theme -->
|
|
163
|
+
{themeColor && <meta name="theme-color" content={themeColor} />}
|
|
164
|
+
|
|
165
|
+
<script is:inline>
|
|
166
|
+
const theme = (() => {
|
|
167
|
+
if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
|
|
168
|
+
return localStorage.getItem('theme');
|
|
169
|
+
}
|
|
170
|
+
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
171
|
+
return 'dark';
|
|
172
|
+
}
|
|
173
|
+
return 'light';
|
|
174
|
+
})();
|
|
175
|
+
|
|
176
|
+
if (theme === 'dark') {
|
|
177
|
+
document.documentElement.classList.add('dark');
|
|
178
|
+
} else {
|
|
179
|
+
document.documentElement.classList.remove('dark');
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
window.localStorage.setItem('theme', theme);
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<script>
|
|
186
|
+
document.addEventListener('astro:after-swap', () => {
|
|
187
|
+
if (localStorage.getItem('theme') === 'dark') {
|
|
188
|
+
document.documentElement.classList.add('dark');
|
|
189
|
+
} else {
|
|
190
|
+
document.documentElement.classList.remove('dark');
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
</script>
|
|
194
|
+
|
|
195
|
+
{transitions && <ClientRouter />}
|
|
196
|
+
|
|
197
|
+
<App client:load>
|
|
198
|
+
<slot />
|
|
199
|
+
</App>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import RLAButton from "./astro/RLAButton.astro";
|
|
3
3
|
|
|
4
4
|
export interface ThemeToggleProps {
|
|
5
|
-
class?: string;
|
|
6
5
|
size?: "sm" | "md" | "lg";
|
|
6
|
+
class?: any;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
type Props = ThemeToggleProps;
|
|
10
10
|
|
|
11
|
-
const {
|
|
11
|
+
const { size = "md", class: className } = Astro.props as Props
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
<RLAButton
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLAttributes } from 'astro/types';
|
|
3
|
+
|
|
4
|
+
export type Props = HTMLAttributes<'details'> & {
|
|
5
|
+
summary: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const { summary, class: className, ...attrs } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<details class:list={['group', className]} {...attrs}>
|
|
12
|
+
<summary
|
|
13
|
+
class="accordion code flex cursor-pointer list-none items-center justify-between text-astro-gray-200"
|
|
14
|
+
>
|
|
15
|
+
<span>{summary}</span>
|
|
16
|
+
<span class="i-lucide-chevron s-4 rotate-0 transition-transform duration-300 ease-in-out group-open:-rotate-180" />
|
|
17
|
+
</summary>
|
|
18
|
+
|
|
19
|
+
<div class="pt-4">
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</details>
|