@rimelight/ui 0.0.10 → 0.0.14
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 -7
- package/src/env.d.ts +23 -0
- package/src/integrations/index.ts +0 -2
- package/src/integrations/ui.ts +47 -44
- package/src/plugins/index.ts +2 -0
- package/src/plugins/starlightAddons/PackageManagers.astro +4 -4
- package/src/plugins/starlightAddons/PageTitle.astro +8 -9
- package/src/plugins/starlightAddons/index.ts +4 -10
- package/src/preset.ts +22 -37
- package/src/presets/index.ts +379 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimelight/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Rimelight Entertainment UI Library.",
|
|
6
6
|
"homepage": "https://rimelight.com/docs",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"./utils": "./src/utils/index.ts",
|
|
35
35
|
"./utils/*": "./src/utils/*",
|
|
36
36
|
"./integrations": "./src/integrations/index.ts",
|
|
37
|
-
"./integrations/vue-entrypoint": "./src/integrations/vue-entrypoint.ts",
|
|
38
37
|
"./integrations/*": "./src/integrations/*",
|
|
38
|
+
"./integrations/vue-entrypoint": "./src/integrations/vue-entrypoint.ts",
|
|
39
|
+
"./plugins": "./src/plugins/index.ts",
|
|
39
40
|
"./plugins/*": "./src/plugins/*",
|
|
40
41
|
"./middleware": "./src/middleware/index.ts",
|
|
41
42
|
"./middleware/*": "./src/middleware/*",
|
|
42
43
|
"./nuxt": "./src/nuxt.ts",
|
|
43
|
-
"./
|
|
44
|
-
"./
|
|
45
|
-
"./package-managers": "./src/plugins/starlightAddons/PackageManagers.astro",
|
|
44
|
+
"./presets": "./src/presets/index.ts",
|
|
45
|
+
"./presets/*": "./src/presets/*",
|
|
46
46
|
"./*": "./src/*"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"tailwindcss": "^4.2.3",
|
|
62
62
|
"turndown": "^7.2.4",
|
|
63
63
|
"turndown-plugin-gfm": "^1.0.2",
|
|
64
|
-
"unplugin-icons": "23.0.1"
|
|
64
|
+
"unplugin-icons": "23.0.1",
|
|
65
|
+
"vite-plugin-virtual": "^0.5.0"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@astrojs/check": "0.9.8",
|
|
@@ -72,7 +73,6 @@
|
|
|
72
73
|
"astro": "6.1.8",
|
|
73
74
|
"eslint-plugin-regexp": "3.1.0",
|
|
74
75
|
"unocss": "66.6.8",
|
|
75
|
-
"vite-plugin-virtual": "^0.5.0",
|
|
76
76
|
"vite-plus": "0.1.19"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
package/src/env.d.ts
CHANGED
|
@@ -12,6 +12,29 @@ declare module "virtual:rimelight-ui" {
|
|
|
12
12
|
export function getUIConfig(): DefaultUIConfig
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
interface StarlightAddonsConfig {
|
|
16
|
+
copy?: boolean
|
|
17
|
+
share?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare module "virtual:rimelight-starlight-addons-config" {
|
|
21
|
+
const config: StarlightAddonsConfig
|
|
22
|
+
export default config
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare module "turndown" {
|
|
26
|
+
class TurndownService {
|
|
27
|
+
constructor(options?: Record<string, unknown>)
|
|
28
|
+
turndown(html: Node | string): string
|
|
29
|
+
use(plugin: () => void): void
|
|
30
|
+
}
|
|
31
|
+
export default TurndownService
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module "turndown-plugin-gfm" {
|
|
35
|
+
export function gfm(): void
|
|
36
|
+
}
|
|
37
|
+
|
|
15
38
|
declare namespace App {
|
|
16
39
|
interface Locals {
|
|
17
40
|
cfContext?: Record<string, unknown>
|
package/src/integrations/ui.ts
CHANGED
|
@@ -51,55 +51,58 @@ export function ui(options: UIOptions = {}): AstroIntegration[] {
|
|
|
51
51
|
const virtualModuleId = "virtual:rimelight-ui"
|
|
52
52
|
const resolvedVirtualModuleId = "\0" + virtualModuleId
|
|
53
53
|
|
|
54
|
+
function setViteConfig(updateConfig: (config: Record<string, unknown>) => void) {
|
|
55
|
+
updateConfig({
|
|
56
|
+
vite: {
|
|
57
|
+
optimizeDeps: {
|
|
58
|
+
exclude: [
|
|
59
|
+
"@rimelight/ui",
|
|
60
|
+
"@rimelight/ui/vue-plugin",
|
|
61
|
+
"@rimelight/ui/integrations/vue-entrypoint",
|
|
62
|
+
"@nuxt/ui"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
ssr: {
|
|
66
|
+
noExternal: ["@rimelight/ui", "@nuxt/ui"],
|
|
67
|
+
optimizeDeps: {
|
|
68
|
+
exclude: ["@rimelight/ui/vue-plugin", "@rimelight/ui/integrations/vue-entrypoint"]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
plugins: [
|
|
72
|
+
uiPlugin({
|
|
73
|
+
router: false,
|
|
74
|
+
scanPackages: ["@rimelight/ui"]
|
|
75
|
+
}),
|
|
76
|
+
Icons({
|
|
77
|
+
compiler: "astro",
|
|
78
|
+
autoInstall: true
|
|
79
|
+
}),
|
|
80
|
+
tailwindcss(),
|
|
81
|
+
{
|
|
82
|
+
name: "vite-plugin-rimelight-ui-config",
|
|
83
|
+
enforce: "pre",
|
|
84
|
+
resolveId(id: string) {
|
|
85
|
+
if (id === virtualModuleId) return resolvedVirtualModuleId
|
|
86
|
+
return null
|
|
87
|
+
},
|
|
88
|
+
load(id: string) {
|
|
89
|
+
if (id === resolvedVirtualModuleId) {
|
|
90
|
+
return `export const getUIConfig = () => (${JSON.stringify(resolvedConfig)});`
|
|
91
|
+
}
|
|
92
|
+
return null
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
|
|
54
100
|
const rimelightUIIntegration: AstroIntegration = {
|
|
55
101
|
name: "@rimelight/ui",
|
|
56
102
|
hooks: {
|
|
57
103
|
"astro:config:setup": ({ updateConfig, logger }) => {
|
|
58
104
|
logger.info("Initializing @rimelight/ui core")
|
|
59
|
-
|
|
60
|
-
updateConfig({
|
|
61
|
-
vite: {
|
|
62
|
-
optimizeDeps: {
|
|
63
|
-
exclude: [
|
|
64
|
-
"@rimelight/ui",
|
|
65
|
-
"@rimelight/ui/vue-plugin",
|
|
66
|
-
"@rimelight/ui/integrations/vue-entrypoint",
|
|
67
|
-
"@nuxt/ui"
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
ssr: {
|
|
71
|
-
noExternal: ["@rimelight/ui", "@nuxt/ui"],
|
|
72
|
-
optimizeDeps: {
|
|
73
|
-
exclude: ["@rimelight/ui/vue-plugin", "@rimelight/ui/integrations/vue-entrypoint"]
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
plugins: [
|
|
77
|
-
uiPlugin({
|
|
78
|
-
router: false,
|
|
79
|
-
scanPackages: ["@rimelight/ui"]
|
|
80
|
-
}),
|
|
81
|
-
Icons({
|
|
82
|
-
compiler: "astro",
|
|
83
|
-
autoInstall: true
|
|
84
|
-
}),
|
|
85
|
-
tailwindcss(),
|
|
86
|
-
{
|
|
87
|
-
name: "vite-plugin-rimelight-ui-config",
|
|
88
|
-
enforce: "pre",
|
|
89
|
-
resolveId(id: string) {
|
|
90
|
-
if (id === virtualModuleId) return resolvedVirtualModuleId
|
|
91
|
-
return null
|
|
92
|
-
},
|
|
93
|
-
load(id: string) {
|
|
94
|
-
if (id === resolvedVirtualModuleId) {
|
|
95
|
-
return `export const getUIConfig = () => (${JSON.stringify(resolvedConfig)});`
|
|
96
|
-
}
|
|
97
|
-
return null
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
] as any
|
|
101
|
-
}
|
|
102
|
-
})
|
|
105
|
+
setViteConfig(updateConfig)
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
}
|
|
@@ -27,16 +27,16 @@ function getCommand(manager: string, cmdType: string, pkgName: string, devFlag:
|
|
|
27
27
|
return cmd
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const managers = ["npm", "pnpm", "yarn", "bun"]
|
|
31
|
-
const singleManager = managers[0]
|
|
30
|
+
const managers = ["npm", "pnpm", "yarn", "bun"] as const
|
|
31
|
+
const singleManager = managers[0] as string
|
|
32
32
|
const command = getCommand(singleManager, type, pkg, dev)
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
{managers.length === 1 ? (
|
|
35
|
+
{(managers.length as number) === 1 ? (
|
|
36
36
|
<AstroCode code={command} lang="sh" />
|
|
37
37
|
) : (
|
|
38
38
|
<Tabs syncKey="package-managers">
|
|
39
|
-
{managers.map((manager
|
|
39
|
+
{managers.map((manager) => (
|
|
40
40
|
<TabItem label={manager}>
|
|
41
41
|
<AstroCode code={getCommand(manager, type, pkg, dev)} lang="sh" />
|
|
42
42
|
</TabItem>
|
|
@@ -3,9 +3,6 @@ import DefaultPageTitle from "@astrojs/starlight/components/PageTitle.astro";
|
|
|
3
3
|
import config from "virtual:rimelight-starlight-addons-config";
|
|
4
4
|
|
|
5
5
|
const { copy = true, share = true } = config ?? {};
|
|
6
|
-
|
|
7
|
-
const currentUrl = Astro.url.href;
|
|
8
|
-
const currentTitle = (Astro.locals as any).starlightRoute?.entry?.data?.title || "";
|
|
9
6
|
---
|
|
10
7
|
|
|
11
8
|
<DefaultPageTitle />
|
|
@@ -67,7 +64,7 @@ const currentTitle = (Astro.locals as any).starlightRoute?.entry?.data?.title ||
|
|
|
67
64
|
});
|
|
68
65
|
turndown.use(gfm);
|
|
69
66
|
|
|
70
|
-
const copyBtn = document.getElementById("rl-copy-markdown");
|
|
67
|
+
const copyBtn = document.getElementById("rl-copy-markdown") as HTMLButtonElement | null;
|
|
71
68
|
const shareBtn = document.getElementById("rl-share");
|
|
72
69
|
|
|
73
70
|
if (copyBtn) {
|
|
@@ -78,8 +75,8 @@ const currentTitle = (Astro.locals as any).starlightRoute?.entry?.data?.title ||
|
|
|
78
75
|
if (!contentEl) {
|
|
79
76
|
throw new Error("Content not found");
|
|
80
77
|
}
|
|
81
|
-
const clone = contentEl.cloneNode(true);
|
|
82
|
-
clone.querySelectorAll("script, style, noscript, .sl-anchor-link, [data-pagefind-ignore]").forEach(el => el.remove());
|
|
78
|
+
const clone = contentEl.cloneNode(true) as Element;
|
|
79
|
+
clone.querySelectorAll("script, style, noscript, .sl-anchor-link, [data-pagefind-ignore]").forEach((el: Element) => el.remove());
|
|
83
80
|
const markdown = turndown.turndown(clone as HTMLElement);
|
|
84
81
|
await navigator.clipboard.writeText(markdown);
|
|
85
82
|
copyBtn.classList.add("copied");
|
|
@@ -92,13 +89,15 @@ const currentTitle = (Astro.locals as any).starlightRoute?.entry?.data?.title ||
|
|
|
92
89
|
});
|
|
93
90
|
}
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
const typedShareBtn = shareBtn as HTMLButtonElement | null;
|
|
93
|
+
if (typedShareBtn) {
|
|
94
|
+
typedShareBtn.addEventListener("click", async () => {
|
|
97
95
|
if (navigator.share) {
|
|
98
96
|
try {
|
|
99
97
|
await navigator.share({ title: document.title, url: window.location.href });
|
|
100
98
|
} catch (err) {
|
|
101
|
-
|
|
99
|
+
const error = err as { name?: string };
|
|
100
|
+
if (error.name !== "AbortError") {
|
|
102
101
|
console.error("Share failed:", err);
|
|
103
102
|
}
|
|
104
103
|
}
|
|
@@ -8,20 +8,14 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
8
8
|
export interface StarlightAddonsConfig {
|
|
9
9
|
copy?: boolean
|
|
10
10
|
share?: boolean
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface PackageManagersProps {
|
|
15
|
-
pkg: string
|
|
16
|
-
type?: "add" | "create" | "install" | "remove" | "run"
|
|
17
|
-
dev?: boolean
|
|
11
|
+
packageManagers?: string[]
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
export default function starlightAddons(userConfig?: StarlightAddonsConfig): StarlightPlugin {
|
|
21
15
|
const defaultConfig: StarlightAddonsConfig = {
|
|
22
16
|
copy: true,
|
|
23
17
|
share: true,
|
|
24
|
-
|
|
18
|
+
packageManagers: ["npm"]
|
|
25
19
|
}
|
|
26
20
|
|
|
27
21
|
const config: StarlightAddonsConfig = {
|
|
@@ -36,7 +30,7 @@ export default function starlightAddons(userConfig?: StarlightAddonsConfig): Sta
|
|
|
36
30
|
if (
|
|
37
31
|
!config.copy &&
|
|
38
32
|
!config.share &&
|
|
39
|
-
(!config.
|
|
33
|
+
(!config.packageManagers || config.packageManagers.length === 0)
|
|
40
34
|
) {
|
|
41
35
|
logger.warn("StarlightAddons: Nothing enabled.")
|
|
42
36
|
}
|
|
@@ -53,7 +47,7 @@ export default function starlightAddons(userConfig?: StarlightAddonsConfig): Sta
|
|
|
53
47
|
})
|
|
54
48
|
]
|
|
55
49
|
}
|
|
56
|
-
})
|
|
50
|
+
} as Record<string, unknown>)
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
53
|
})
|
package/src/preset.ts
CHANGED
|
@@ -60,49 +60,34 @@ export default definePreset(() => {
|
|
|
60
60
|
([, t, r, b, l]) => ({ clip: `rect(${t}px, ${r}px, ${b}px, ${l}px)` })
|
|
61
61
|
],
|
|
62
62
|
[
|
|
63
|
-
/^([hw])-(
|
|
64
|
-
([, prop, s]
|
|
65
|
-
if (!s) return
|
|
66
|
-
const
|
|
67
|
-
|
|
63
|
+
/^([hw])-(6xs|5xs|4xs|3xs|2xs|xs|sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl)$/,
|
|
64
|
+
([, prop, s]) => {
|
|
65
|
+
if (!s) return false
|
|
66
|
+
const spacing: Record<string, string> = {
|
|
67
|
+
"6xs": "0.125rem",
|
|
68
|
+
"5xs": "0.25rem",
|
|
69
|
+
"4xs": "0.375rem",
|
|
70
|
+
"3xs": "0.5rem",
|
|
71
|
+
"2xs": "0.625rem",
|
|
72
|
+
"xs": "0.75rem",
|
|
73
|
+
"sm": "0.875rem",
|
|
74
|
+
"md": "1rem",
|
|
75
|
+
"lg": "1.25rem",
|
|
76
|
+
"xl": "1.5rem",
|
|
77
|
+
"2xl": "2rem",
|
|
78
|
+
"3xl": "3rem",
|
|
79
|
+
"4xl": "4rem",
|
|
80
|
+
"5xl": "6rem",
|
|
81
|
+
"6xl": "8rem"
|
|
82
|
+
}
|
|
83
|
+
const val = spacing[s]
|
|
84
|
+
if (!val) return false
|
|
68
85
|
return prop === "h" ? { height: val } : { width: val }
|
|
69
86
|
}
|
|
70
87
|
]
|
|
71
88
|
],
|
|
72
89
|
|
|
73
90
|
theme: {
|
|
74
|
-
spacing: {
|
|
75
|
-
// 2px
|
|
76
|
-
"6xs": "0.125rem",
|
|
77
|
-
// 4px
|
|
78
|
-
"5xs": "0.25rem",
|
|
79
|
-
// 6px
|
|
80
|
-
"4xs": "0.375rem",
|
|
81
|
-
// 8px
|
|
82
|
-
"3xs": "0.5rem",
|
|
83
|
-
// 10px
|
|
84
|
-
"2xs": "0.625rem",
|
|
85
|
-
// 12px
|
|
86
|
-
"xs": "0.75rem",
|
|
87
|
-
// 14px
|
|
88
|
-
"sm": "0.875rem",
|
|
89
|
-
// 16px
|
|
90
|
-
"md": "1rem",
|
|
91
|
-
// 20px
|
|
92
|
-
"lg": "1.25rem",
|
|
93
|
-
// 24px
|
|
94
|
-
"xl": "1.5rem",
|
|
95
|
-
// 32px
|
|
96
|
-
"2xl": "2rem",
|
|
97
|
-
// 48px
|
|
98
|
-
"3xl": "3rem",
|
|
99
|
-
// 64px
|
|
100
|
-
"4xl": "4rem",
|
|
101
|
-
// 96px
|
|
102
|
-
"5xl": "6rem",
|
|
103
|
-
// 128px
|
|
104
|
-
"6xl": "8rem"
|
|
105
|
-
},
|
|
106
91
|
colors: {
|
|
107
92
|
"background": "var(--background)",
|
|
108
93
|
"foreground": "var(--foreground)",
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import {
|
|
2
|
+
definePreset,
|
|
3
|
+
presetTypography,
|
|
4
|
+
presetWind4,
|
|
5
|
+
transformerDirectives,
|
|
6
|
+
transformerVariantGroup
|
|
7
|
+
} from "unocss"
|
|
8
|
+
|
|
9
|
+
export default definePreset(() => {
|
|
10
|
+
return {
|
|
11
|
+
name: "rimelight-ui",
|
|
12
|
+
presets: [
|
|
13
|
+
presetWind4(),
|
|
14
|
+
presetTypography({
|
|
15
|
+
cssExtend: {
|
|
16
|
+
"h1,h2,h3,h4,h5,h6": {
|
|
17
|
+
"font-family": "var(--font-sans), system-ui, sans-serif"
|
|
18
|
+
},
|
|
19
|
+
"p,li,blockquote,code": {
|
|
20
|
+
"font-family": "var(--font-sans), system-ui, sans-serif"
|
|
21
|
+
},
|
|
22
|
+
"pre,code": {
|
|
23
|
+
"font-family": "var(--font-mono), monospace"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
],
|
|
28
|
+
transformers: [transformerDirectives(), transformerVariantGroup()],
|
|
29
|
+
|
|
30
|
+
outputToCssLayers: true,
|
|
31
|
+
layers: {
|
|
32
|
+
theme: 1,
|
|
33
|
+
preflights: 2,
|
|
34
|
+
shortcuts: 3,
|
|
35
|
+
default: 4
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
content: {
|
|
39
|
+
pipeline: {
|
|
40
|
+
include: [
|
|
41
|
+
/\.(vue|svelte|[jt]sx|mdx?|astro|elm|php|phtml|html)($|\?)/,
|
|
42
|
+
"src/**/*.{js,ts,jsx,tsx,vue,svelte,astro}",
|
|
43
|
+
"../ui/src/**/*.{js,ts,jsx,tsx,vue,svelte,astro}"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
filesystem: ["../ui/src/**/*", "src/components/**/*", "src/pages/**/*"]
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
shortcuts: {
|
|
50
|
+
"container": "mx-auto w-full max-w-90rem px-md",
|
|
51
|
+
"sr-only":
|
|
52
|
+
"absolute w-px h-px p-0 m-0 overflow-hidden clip-rect-1-1-1-1 whitespace-nowrap border-0"
|
|
53
|
+
},
|
|
54
|
+
rules: [
|
|
55
|
+
[
|
|
56
|
+
/^clip-rect-(\d+)-(\d+)-(\d+)-(\d+)$/,
|
|
57
|
+
([, t, r, b, l]) => ({ clip: `rect(${t}px, ${r}px, ${b}px, ${l}px)` })
|
|
58
|
+
]
|
|
59
|
+
],
|
|
60
|
+
|
|
61
|
+
theme: {
|
|
62
|
+
spacing: {
|
|
63
|
+
"6xs": "0.125rem",
|
|
64
|
+
"5xs": "0.25rem",
|
|
65
|
+
"4xs": "0.375rem",
|
|
66
|
+
"3xs": "0.5rem",
|
|
67
|
+
"2xs": "0.625rem",
|
|
68
|
+
"xs": "0.75rem",
|
|
69
|
+
"sm": "0.875rem",
|
|
70
|
+
"md": "1rem",
|
|
71
|
+
"lg": "1.25rem",
|
|
72
|
+
"xl": "1.5rem",
|
|
73
|
+
"2xl": "2rem",
|
|
74
|
+
"3xl": "3rem",
|
|
75
|
+
"4xl": "4rem",
|
|
76
|
+
"5xl": "6rem",
|
|
77
|
+
"6xl": "8rem"
|
|
78
|
+
},
|
|
79
|
+
colors: {
|
|
80
|
+
"background": "var(--background)",
|
|
81
|
+
"foreground": "var(--foreground)",
|
|
82
|
+
"card": {
|
|
83
|
+
DEFAULT: "var(--card)",
|
|
84
|
+
foreground: "var(--card-foreground)"
|
|
85
|
+
},
|
|
86
|
+
"popover": {
|
|
87
|
+
DEFAULT: "var(--popover)",
|
|
88
|
+
foreground: "var(--popover-foreground)"
|
|
89
|
+
},
|
|
90
|
+
"primary": {
|
|
91
|
+
DEFAULT: "var(--primary)",
|
|
92
|
+
foreground: "var(--primary-foreground)",
|
|
93
|
+
accent: "var(--primary-accent)"
|
|
94
|
+
},
|
|
95
|
+
"secondary": {
|
|
96
|
+
DEFAULT: "var(--secondary)",
|
|
97
|
+
foreground: "var(--secondary-foreground)",
|
|
98
|
+
accent: "var(--secondary-accent)"
|
|
99
|
+
},
|
|
100
|
+
"muted": {
|
|
101
|
+
DEFAULT: "var(--muted)",
|
|
102
|
+
foreground: "var(--muted-foreground)"
|
|
103
|
+
},
|
|
104
|
+
"accent": {
|
|
105
|
+
DEFAULT: "var(--accent)",
|
|
106
|
+
foreground: "var(--accent-foreground)"
|
|
107
|
+
},
|
|
108
|
+
"info": {
|
|
109
|
+
DEFAULT: "var(--info)",
|
|
110
|
+
foreground: "var(--info-foreground)"
|
|
111
|
+
},
|
|
112
|
+
"success": {
|
|
113
|
+
DEFAULT: "var(--success)",
|
|
114
|
+
foreground: "var(--success-foreground)"
|
|
115
|
+
},
|
|
116
|
+
"warning": {
|
|
117
|
+
DEFAULT: "var(--warning)",
|
|
118
|
+
foreground: "var(--warning-foreground)"
|
|
119
|
+
},
|
|
120
|
+
"error": {
|
|
121
|
+
DEFAULT: "var(--error)",
|
|
122
|
+
foreground: "var(--error-foreground)"
|
|
123
|
+
},
|
|
124
|
+
"commentary": {
|
|
125
|
+
DEFAULT: "var(--commentary)",
|
|
126
|
+
foreground: "var(--commentary-foreground)"
|
|
127
|
+
},
|
|
128
|
+
"ideation": {
|
|
129
|
+
DEFAULT: "var(--ideation)",
|
|
130
|
+
foreground: "var(--ideation-foreground)"
|
|
131
|
+
},
|
|
132
|
+
"source": {
|
|
133
|
+
DEFAULT: "var(--source)",
|
|
134
|
+
foreground: "var(--source-foreground)"
|
|
135
|
+
},
|
|
136
|
+
"border": "var(--border)",
|
|
137
|
+
"input": "var(--input)",
|
|
138
|
+
"outline": "var(--outline)",
|
|
139
|
+
"ring": "var(--ring)",
|
|
140
|
+
"destructive": {
|
|
141
|
+
DEFAULT: "var(--destructive)",
|
|
142
|
+
subtle: "var(--color-destructive-subtle)"
|
|
143
|
+
},
|
|
144
|
+
"sidebar": {
|
|
145
|
+
DEFAULT: "var(--sidebar)",
|
|
146
|
+
foreground: "var(--sidebar-foreground)",
|
|
147
|
+
primary: {
|
|
148
|
+
DEFAULT: "var(--sidebar-primary)",
|
|
149
|
+
foreground: "var(--sidebar-primary-foreground)"
|
|
150
|
+
},
|
|
151
|
+
accent: {
|
|
152
|
+
DEFAULT: "var(--sidebar-accent)",
|
|
153
|
+
foreground: "var(--sidebar-accent-foreground)"
|
|
154
|
+
},
|
|
155
|
+
border: "var(--sidebar-border)",
|
|
156
|
+
ring: "var(--sidebar-ring)"
|
|
157
|
+
},
|
|
158
|
+
"chart": {
|
|
159
|
+
"1": "var(--chart-1)",
|
|
160
|
+
"2": "var(--chart-2)",
|
|
161
|
+
"3": "var(--chart-3)",
|
|
162
|
+
"4": "var(--chart-4)",
|
|
163
|
+
"5": "var(--chart-5)"
|
|
164
|
+
},
|
|
165
|
+
"hover": "var(--color-hover)",
|
|
166
|
+
"surface": "var(--color-surface)",
|
|
167
|
+
"muted-strong": "var(--color-muted-strong)",
|
|
168
|
+
"foreground-secondary": "var(--color-foreground-secondary)",
|
|
169
|
+
"foreground-tertiary": "var(--color-foreground-tertiary)",
|
|
170
|
+
"placeholder": "var(--color-placeholder)",
|
|
171
|
+
"input-border": "var(--color-input-border)",
|
|
172
|
+
"accent-subtle": "var(--color-accent-subtle)"
|
|
173
|
+
},
|
|
174
|
+
radius: {
|
|
175
|
+
"xs": "calc(var(--radius) - 0.375rem)",
|
|
176
|
+
"sm": "calc(var(--radius) - 0.25rem)",
|
|
177
|
+
"md": "calc(var(--radius) - 0.125rem)",
|
|
178
|
+
"lg": "var(--radius)",
|
|
179
|
+
"xl": "calc(var(--radius) + 0.25rem)",
|
|
180
|
+
"2xl": "calc(var(--radius) + 0.5rem)",
|
|
181
|
+
"3xl": "calc(var(--radius) + 1rem)"
|
|
182
|
+
},
|
|
183
|
+
animation: {
|
|
184
|
+
keyframes: {
|
|
185
|
+
"accordion-down":
|
|
186
|
+
"{ from { height: 0; } to { height: var(--starwind-accordion-content-height); } }",
|
|
187
|
+
"accordion-up":
|
|
188
|
+
"{ from { height: var(--starwind-accordion-content-height); } to { height: 0; } }",
|
|
189
|
+
"marquee": "{ from { transform: translateX(0); } to { transform: translateX(-100%); } }"
|
|
190
|
+
},
|
|
191
|
+
durations: {
|
|
192
|
+
"accordion-down": "0.2s",
|
|
193
|
+
"accordion-up": "0.2s",
|
|
194
|
+
"marquee": "30s"
|
|
195
|
+
},
|
|
196
|
+
timingFns: {
|
|
197
|
+
"accordion-down": "ease-out",
|
|
198
|
+
"accordion-up": "ease-out",
|
|
199
|
+
"marquee": "linear"
|
|
200
|
+
},
|
|
201
|
+
counts: { marquee: "infinite" }
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
preflights: [
|
|
206
|
+
{
|
|
207
|
+
getCSS: () => `
|
|
208
|
+
:root {
|
|
209
|
+
--background: #ffffff;
|
|
210
|
+
--foreground: #030712;
|
|
211
|
+
--card: #ffffff;
|
|
212
|
+
--card-foreground: #030712;
|
|
213
|
+
--popover: #ffffff;
|
|
214
|
+
--popover-foreground: #030712;
|
|
215
|
+
--primary: #f97316;
|
|
216
|
+
--primary-foreground: #f9fafb;
|
|
217
|
+
--primary-accent: #ea580c;
|
|
218
|
+
--secondary: #8b5cf6;
|
|
219
|
+
--secondary-foreground: #f9fafb;
|
|
220
|
+
--secondary-accent: #7c3aed;
|
|
221
|
+
--muted: #f3f4f6;
|
|
222
|
+
--muted-foreground: #4b5563;
|
|
223
|
+
--accent: #f3f4f6;
|
|
224
|
+
--accent-foreground: #111827;
|
|
225
|
+
--info: #3b82f6;
|
|
226
|
+
--info-foreground: #ffffff;
|
|
227
|
+
--success: #22c55e;
|
|
228
|
+
--success-foreground: #ffffff;
|
|
229
|
+
--warning: #f59e0b;
|
|
230
|
+
--warning-foreground: #000000;
|
|
231
|
+
--error: #ef4444;
|
|
232
|
+
--error-foreground: #f9fafb;
|
|
233
|
+
--commentary: #ec4899;
|
|
234
|
+
--commentary-foreground: #f9fafb;
|
|
235
|
+
--ideation: #8b5cf6;
|
|
236
|
+
--ideation-foreground: #f9fafb;
|
|
237
|
+
--source: #38bdf8;
|
|
238
|
+
--source-foreground: #0f172a;
|
|
239
|
+
--border: #e5e7eb;
|
|
240
|
+
--input: #e5e7eb;
|
|
241
|
+
--outline: #9ca3af;
|
|
242
|
+
--ring: #9ca3af;
|
|
243
|
+
--radius: 0.625rem;
|
|
244
|
+
--sidebar: #f9fafb;
|
|
245
|
+
--sidebar-foreground: #030712;
|
|
246
|
+
--sidebar-primary: #1d4ed8;
|
|
247
|
+
--sidebar-primary-foreground: #f9fafb;
|
|
248
|
+
--sidebar-accent: #f3f4f6;
|
|
249
|
+
--sidebar-accent-foreground: #111827;
|
|
250
|
+
--sidebar-border: #e5e7eb;
|
|
251
|
+
--sidebar-ring: #9ca3af;
|
|
252
|
+
--chart-1: #3b82f6;
|
|
253
|
+
--chart-2: #6366f1;
|
|
254
|
+
--chart-3: #8b5cf6;
|
|
255
|
+
--chart-4: #a855f7;
|
|
256
|
+
--chart-5: #ec4899;
|
|
257
|
+
--destructive: #ef4444;
|
|
258
|
+
--color-surface: #ffffff;
|
|
259
|
+
--color-muted-strong: #e5e7eb;
|
|
260
|
+
--color-foreground-secondary: #4b5563;
|
|
261
|
+
--color-foreground-tertiary: #6b7280;
|
|
262
|
+
--color-placeholder: #9ca3af;
|
|
263
|
+
--color-input-border: #d1d5db;
|
|
264
|
+
--color-hover: #f3f4f6;
|
|
265
|
+
--color-destructive-subtle: #fef2f2;
|
|
266
|
+
--color-accent-subtle: #eff6ff;
|
|
267
|
+
--font-sans: "Noto Sans", sans-serif;
|
|
268
|
+
--font-serif: "Noto Serif", serif;
|
|
269
|
+
--font-mono: "Noto Sans Mono", monospace;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.dark {
|
|
273
|
+
--background: #030712;
|
|
274
|
+
--foreground: #f9fafb;
|
|
275
|
+
--card: #111827;
|
|
276
|
+
--card-foreground: #f9fafb;
|
|
277
|
+
--popover: #1f2937;
|
|
278
|
+
--popover-foreground: #f9fafb;
|
|
279
|
+
--primary: #f97316;
|
|
280
|
+
--primary-foreground: #f9fafb;
|
|
281
|
+
--primary-accent: #fb923c;
|
|
282
|
+
--secondary: #8b5cf6;
|
|
283
|
+
--secondary-foreground: #f9fafb;
|
|
284
|
+
--secondary-accent: #a78bfa;
|
|
285
|
+
--muted: #1f2937;
|
|
286
|
+
--muted-foreground: #9ca3af;
|
|
287
|
+
--accent: #374151;
|
|
288
|
+
--accent-foreground: #f3f4f6;
|
|
289
|
+
--info: #3b82f6;
|
|
290
|
+
--info-foreground: #ffffff;
|
|
291
|
+
--success: #22c55e;
|
|
292
|
+
--success-foreground: #ffffff;
|
|
293
|
+
--warning: #f59e0b;
|
|
294
|
+
--warning-foreground: #000000;
|
|
295
|
+
--error: #ef4444;
|
|
296
|
+
--error-foreground: #f9fafb;
|
|
297
|
+
--commentary: #f472b6;
|
|
298
|
+
--commentary-foreground: #0f172a;
|
|
299
|
+
--ideation: #a78bfa;
|
|
300
|
+
--ideation-foreground: #0f172a;
|
|
301
|
+
--source: #7dd3fc;
|
|
302
|
+
--source-foreground: #0f172a;
|
|
303
|
+
--border: rgba(249, 250, 251, 0.1);
|
|
304
|
+
--input: rgba(249, 250, 251, 0.15);
|
|
305
|
+
--outline: #6b7280;
|
|
306
|
+
--ring: #6b7280;
|
|
307
|
+
--sidebar: #111827;
|
|
308
|
+
--sidebar-foreground: #f9fafb;
|
|
309
|
+
--sidebar-primary: #1d4ed8;
|
|
310
|
+
--sidebar-primary-foreground: #f9fafb;
|
|
311
|
+
--sidebar-accent: #1f2937;
|
|
312
|
+
--sidebar-accent-foreground: #f3f4f6;
|
|
313
|
+
--sidebar-border: #1f2937;
|
|
314
|
+
--sidebar-ring: #6b7280;
|
|
315
|
+
--chart-1: #60a5fa;
|
|
316
|
+
--chart-2: #818cf8;
|
|
317
|
+
--chart-3: #a78bfa;
|
|
318
|
+
--chart-4: #c084fc;
|
|
319
|
+
--chart-5: #f472b6;
|
|
320
|
+
--destructive: #f87171;
|
|
321
|
+
--color-surface: #1f2937;
|
|
322
|
+
--color-muted-strong: #374151;
|
|
323
|
+
--color-foreground-secondary: #d1d5db;
|
|
324
|
+
--color-foreground-tertiary: #9ca3af;
|
|
325
|
+
--color-placeholder: #6b7280;
|
|
326
|
+
--color-input-border: #4b5563;
|
|
327
|
+
--color-hover: #374151;
|
|
328
|
+
--color-destructive-subtle: #451a1a;
|
|
329
|
+
--color-accent-subtle: #1e293b;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
* {
|
|
333
|
+
border-color: var(--border);
|
|
334
|
+
outline-color: rgba(156, 163, 175, 0.5);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
body {
|
|
338
|
+
background-color: var(--background);
|
|
339
|
+
color: var(--foreground);
|
|
340
|
+
font-family: var(--font-sans);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
button {
|
|
344
|
+
cursor: pointer;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
::selection {
|
|
348
|
+
background-color: var(--primary);
|
|
349
|
+
color: var(--primary-foreground);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@view-transition {
|
|
353
|
+
navigation: auto;
|
|
354
|
+
}
|
|
355
|
+
`
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
|
|
359
|
+
async configResolved(config) {
|
|
360
|
+
if (process.env.NODE_ENV === "development" && !process.env.UNO_CONFIG_LOGGED) {
|
|
361
|
+
process.env.UNO_CONFIG_LOGGED = "true"
|
|
362
|
+
|
|
363
|
+
console.log(
|
|
364
|
+
`[UnoCSS] Config resolved. Presets: ${config.presets.map((p) => p.name).join(", ")}`
|
|
365
|
+
)
|
|
366
|
+
console.log(`[UnoCSS] Total rules: ${config.rules.length}`)
|
|
367
|
+
console.log(`[UnoCSS] Total shortcuts: ${Object.keys(config.shortcuts).length}`)
|
|
368
|
+
|
|
369
|
+
const ruleNames = config.rules.map((r) => (Array.isArray(r) ? r[0].toString() : "dynamic"))
|
|
370
|
+
const duplicates = ruleNames.filter((item, index) => ruleNames.indexOf(item) !== index)
|
|
371
|
+
const filteredDuplicates = duplicates.filter((d) => d !== "/^(.+?)-(\\$.+)$/")
|
|
372
|
+
|
|
373
|
+
if (filteredDuplicates.length > 0) {
|
|
374
|
+
console.warn(`[UnoCSS] Potential Rule Collisions: ${filteredDuplicates.join(", ")}`)
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
})
|