ghostcn 1.5.0 → 1.6.0
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/dist/commands/create.js +10 -3
- package/dist/commands/diff.js +47 -5
- package/dist/commands/init.js +17 -8
- package/dist/commands/list.js +22 -4
- package/dist/registry/components/accordion.json +66 -0
- package/dist/registry/components/announcement-bar.json +79 -0
- package/dist/registry/components/archive-header.json +1 -1
- package/dist/registry/components/author-card.json +2 -2
- package/dist/registry/components/author-list.json +1 -1
- package/dist/registry/components/avatar.json +62 -0
- package/dist/registry/components/breadcrumbs.json +59 -0
- package/dist/registry/components/button.json +1 -1
- package/dist/registry/components/featured-posts.json +2 -2
- package/dist/registry/components/input.json +8 -2
- package/dist/registry/components/member-cta.json +1 -1
- package/dist/registry/components/newsletter-form.json +12 -3
- package/dist/registry/components/pagination.json +2 -2
- package/dist/registry/components/post-card.json +2 -2
- package/dist/registry/components/post-grid.json +1 -1
- package/dist/registry/components/post-header.json +2 -2
- package/dist/registry/components/pricing-table.json +24 -4
- package/dist/registry/components/reading-progress.json +73 -0
- package/dist/registry/components/related-posts.json +6 -0
- package/dist/registry/components/share-buttons.json +76 -0
- package/dist/registry/components/site-footer.json +2 -2
- package/dist/registry/components/site-header.json +1 -1
- package/dist/registry/components/table-of-contents.json +12 -2
- package/dist/registry/components/tag-grid.json +1 -1
- package/dist/registry/components/tag-list.json +1 -1
- package/dist/registry/components/theme-toggle.json +65 -0
- package/dist/registry/components/visibility-badge.json +71 -0
- package/dist/registry/index.json +89 -4
- package/dist/templates/playground/index.html +2 -2
- package/dist/templates/playground/playground.css +8 -1
- package/dist/templates/playground/playground.js +39 -5
- package/dist/templates/playground/preview.css +1 -0
- package/dist/templates/theme-tools.mjs +62 -24
- package/dist/utils/component-diff.d.ts +1 -1
- package/dist/utils/component-diff.js +46 -17
- package/dist/utils/component-files.js +3 -2
- package/dist/utils/component-history.js +1 -1
- package/dist/utils/playground-server.js +34 -12
- package/dist/utils/preview-renderer.d.ts +5 -0
- package/dist/utils/preview-renderer.js +20 -6
- package/dist/utils/registry.js +15 -5
- package/dist/utils/theme-files.js +14 -7
- package/dist/utils/theme-project.js +6 -4
- package/dist/utils/theme-scaffold.js +22 -7
- package/dist/utils/theme.js +39 -32
- package/package.json +1 -1
|
@@ -53,9 +53,9 @@ function syncGhostcnScripts(themeRoot, scriptsDir) {
|
|
|
53
53
|
const templatePath = safeThemePath(themeRoot, 'default.hbs');
|
|
54
54
|
const directory = safeThemePath(themeRoot, scriptsDir);
|
|
55
55
|
const assetPaths = fs_1.default.existsSync(directory) ? fs_1.default.readdirSync(directory, { withFileTypes: true })
|
|
56
|
-
.filter(entry => entry.isFile() && entry.name.endsWith('.js'))
|
|
56
|
+
.filter(entry => entry.isFile() && entry.name.toLowerCase().endsWith('.js'))
|
|
57
57
|
.map(entry => toGhostAssetPath(path_1.default.relative(themeRoot, path_1.default.join(directory, entry.name))))
|
|
58
|
-
.sort() : [];
|
|
58
|
+
.sort((a, b) => a.localeCompare(b)) : [];
|
|
59
59
|
if (!fs_1.default.existsSync(templatePath))
|
|
60
60
|
return { status: 'missing-template', templatePath, assetPaths };
|
|
61
61
|
if (!assetPaths.length)
|
|
@@ -64,12 +64,17 @@ function syncGhostcnScripts(themeRoot, scriptsDir) {
|
|
|
64
64
|
const newline = original.includes('\r\n') ? '\r\n' : '\n';
|
|
65
65
|
const start = '{{!-- ghostcn:scripts:start --}}', end = '{{!-- ghostcn:scripts:end --}}';
|
|
66
66
|
const block = [start, ...assetPaths.map(asset => `<script defer src="{{asset "${asset}"}}"></script>`), end].join(newline);
|
|
67
|
-
let updated = original.replace(
|
|
67
|
+
let updated = original.replace(/^[ \t]*\{\{!-- ghostcn:scripts:start --\}\}[\s\S]*?\{\{!-- ghostcn:scripts:end --\}\}[ \t]*(?:\r?\n)?/gm, '');
|
|
68
68
|
// Preserve unrelated host scripts; deduplicate only these owned asset URLs.
|
|
69
|
-
updated = updated.replace(
|
|
69
|
+
updated = updated.replace(/^[ \t]*<script\b[^>]*\bsrc=["'][^"']*\{\{asset\s+["']([^"']+)["']\}\}[^>]*>\s*<\/script>[ \t]*(?:\r?\n)?/gim, (tag, asset) => assetPaths.includes(asset) ? '' : tag);
|
|
70
70
|
if (!/<\/body\s*>/i.test(updated))
|
|
71
71
|
return { status: 'missing-template', templatePath, assetPaths };
|
|
72
|
-
|
|
72
|
+
if (/^[ \t]*<\/body\s*>/im.test(updated)) {
|
|
73
|
+
updated = updated.replace(/^([ \t]*)<\/body\s*>/im, (_match, indent) => `${indentBlock(block, indent, newline)}${newline}${indent}</body>`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
updated = updated.replace(/<\/body\s*>/i, `${newline}${block}${newline}</body>`);
|
|
77
|
+
}
|
|
73
78
|
if (updated !== original)
|
|
74
79
|
fs_1.default.writeFileSync(templatePath, updated, 'utf8');
|
|
75
80
|
return { status: updated === original ? 'unchanged' : 'updated', templatePath, assetPaths };
|
|
@@ -100,12 +105,14 @@ function syncGhostcnStyles(options) {
|
|
|
100
105
|
const templatePath = safeThemePath(options.themeRoot, 'default.hbs');
|
|
101
106
|
const cssPath = safeThemePath(options.themeRoot, options.cssFile);
|
|
102
107
|
const stylesDirPath = safeThemePath(options.themeRoot, options.stylesDir);
|
|
103
|
-
const
|
|
108
|
+
const rootAsset = toGhostAssetPath(options.cssFile);
|
|
109
|
+
const assetPaths = [rootAsset];
|
|
104
110
|
if (fs_1.default.existsSync(stylesDirPath)) {
|
|
105
111
|
const componentStyles = fs_1.default
|
|
106
112
|
.readdirSync(stylesDirPath, { withFileTypes: true })
|
|
107
113
|
.filter(entry => entry.isFile() && entry.name.toLowerCase().endsWith('.css'))
|
|
108
114
|
.map(entry => toGhostAssetPath(path_1.default.relative(options.themeRoot, path_1.default.join(stylesDirPath, entry.name))))
|
|
115
|
+
.filter(assetPath => assetPath !== rootAsset)
|
|
109
116
|
.sort((a, b) => a.localeCompare(b));
|
|
110
117
|
assetPaths.push(...componentStyles);
|
|
111
118
|
}
|
|
@@ -118,7 +125,7 @@ function syncGhostcnStyles(options) {
|
|
|
118
125
|
const original = fs_1.default.readFileSync(templatePath, 'utf8');
|
|
119
126
|
const newline = original.includes('\r\n') ? '\r\n' : '\n';
|
|
120
127
|
const block = stylesheetBlock(assetPaths, newline);
|
|
121
|
-
const managedBlockPattern = new RegExp(`^[ \\t]*${STYLES_START.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[\\s\\S]*?${STYLES_END.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[ \\t]*(?:\\r?\\n)?`, '
|
|
128
|
+
const managedBlockPattern = new RegExp(`^[ \\t]*${STYLES_START.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[\\s\\S]*?${STYLES_END.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[ \\t]*(?:\\r?\\n)?`, 'gm');
|
|
122
129
|
const withoutManagedBlock = original.replace(managedBlockPattern, '');
|
|
123
130
|
const withoutOwnedLinks = removeOwnedStylesheetLinks(withoutManagedBlock, assetPaths);
|
|
124
131
|
const ghostHeadPattern = /^([ \t]*)\{\{ghost_head\}\}/m;
|
|
@@ -13,7 +13,7 @@ const styles_1 = require("./styles");
|
|
|
13
13
|
function buildGhostcnConfig(theme, paths = {}) {
|
|
14
14
|
const normalized = (value, fallback) => value?.trim().replace(/\\/g, '/') || fallback;
|
|
15
15
|
return {
|
|
16
|
-
$schema: 'https://ghostcn.
|
|
16
|
+
$schema: 'https://ghostcn.geekbits.dev/schema.json',
|
|
17
17
|
style: theme.style,
|
|
18
18
|
theme: {
|
|
19
19
|
baseColor: theme.baseColor,
|
|
@@ -29,13 +29,15 @@ function buildGhostcnConfig(theme, paths = {}) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
function initializeThemeProject(options) {
|
|
32
|
-
const configPath = (0, theme_files_1.
|
|
33
|
-
const cssPath = (0, theme_files_1.
|
|
32
|
+
const configPath = (0, theme_files_1.safeThemePath)(options.themeRoot, 'components.json');
|
|
33
|
+
const cssPath = (0, theme_files_1.safeThemePath)(options.themeRoot, options.config.cssFile);
|
|
34
34
|
fs_1.default.mkdirSync(path_1.default.dirname(cssPath), { recursive: true });
|
|
35
35
|
fs_1.default.writeFileSync(configPath, JSON.stringify(options.config, null, 2) + '\n', 'utf8');
|
|
36
36
|
fs_1.default.writeFileSync(cssPath, (0, theme_1.generateThemeCss)({ style: options.config.style, ...options.config.theme }), 'utf8');
|
|
37
37
|
if (options.config.style === 'tailwind') {
|
|
38
|
-
|
|
38
|
+
const tailwindRelative = path_1.default.posix.join(path_1.default.posix.dirname(options.config.cssFile.replace(/\\/g, '/')), 'ghostcn-tailwind.css');
|
|
39
|
+
const tailwindPath = (0, theme_files_1.safeThemePath)(options.themeRoot, tailwindRelative);
|
|
40
|
+
fs_1.default.writeFileSync(tailwindPath, (0, styles_1.tailwindTheme)(), 'utf8');
|
|
39
41
|
}
|
|
40
42
|
const styleSync = (0, theme_files_1.syncGhostcnStyles)({
|
|
41
43
|
themeRoot: options.themeRoot,
|
|
@@ -47,7 +47,7 @@ img { max-width: 100%; }
|
|
|
47
47
|
Match the embedded document's native scheme so dark mode does not force a white canvas. */
|
|
48
48
|
iframe[title="comments-frame"] { color-scheme: normal; }
|
|
49
49
|
h1, h2, h3, h4, h5, h6 { font-family: var(--gh-font-heading, inherit); }
|
|
50
|
-
.ghcn-main { min-height: 65vh; }
|
|
50
|
+
.ghcn-main { min-height: 65vh; overflow-x: clip; }
|
|
51
51
|
.ghcn-page-heading { width: min(100% - 32px, 1152px); margin: var(--ghcn-section-space) auto var(--ghcn-section-gap); }
|
|
52
52
|
.ghcn-page-heading h1 { margin: 0; font-size: var(--ghcn-title-display); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; text-wrap: balance; }
|
|
53
53
|
.ghcn-page-heading p { max-width: 42rem; margin: 1rem 0 0; color: var(--muted-foreground); font-size: 1.125rem; }
|
|
@@ -61,9 +61,13 @@ h1, h2, h3, h4, h5, h6 { font-family: var(--gh-font-heading, inherit); }
|
|
|
61
61
|
.ghcn-article-content .kg-width-wide { width: min(72rem, 100vw - 2rem); max-width: none; margin-left: 50%; transform: translateX(-50%); }
|
|
62
62
|
.ghcn-article-content .kg-width-full { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
|
|
63
63
|
.ghcn-empty { width: min(100% - 2rem, 42rem); margin: 4rem auto; padding: 3rem; border: 1px dashed var(--border); border-radius: min(var(--radius), 1rem); color: var(--muted-foreground); text-align: center; }
|
|
64
|
+
.ghcn-error { width: min(100% - 2rem, 38rem); margin: 5rem auto; text-align: center; }
|
|
65
|
+
.ghcn-error__code { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
|
|
66
|
+
.ghcn-error__title { margin: 0.75rem 0 0; font-size: var(--ghcn-title-display); line-height: 1.1; letter-spacing: -0.04em; }
|
|
67
|
+
.ghcn-error__message { margin: 1rem auto 1.75rem; color: var(--muted-foreground); max-width: 30rem; }
|
|
64
68
|
`;
|
|
65
69
|
}
|
|
66
|
-
function defaultTemplate(
|
|
70
|
+
function defaultTemplate() {
|
|
67
71
|
return `<!DOCTYPE html>
|
|
68
72
|
<html lang="{{@site.locale}}"{{#match @custom.color_scheme "Dark"}} class="dark-mode"{{else match @custom.color_scheme "Auto"}} class="auto-color"{{/match}}>
|
|
69
73
|
<head>
|
|
@@ -150,6 +154,17 @@ ${header}
|
|
|
150
154
|
{{pagination}}
|
|
151
155
|
`;
|
|
152
156
|
}
|
|
157
|
+
function errorTemplate() {
|
|
158
|
+
return `{{!< default}}
|
|
159
|
+
|
|
160
|
+
<section class="ghcn-error">
|
|
161
|
+
<p class="ghcn-error__code">{{statusCode}}</p>
|
|
162
|
+
<h1 class="ghcn-error__title">{{message}}</h1>
|
|
163
|
+
<p class="ghcn-error__message">The page you are looking for may have moved or no longer exists.</p>
|
|
164
|
+
<a class="ghcn-button" href="{{@site.url}}">Back to {{@site.title}}</a>
|
|
165
|
+
</section>
|
|
166
|
+
`;
|
|
167
|
+
}
|
|
153
168
|
function packageJson(options) {
|
|
154
169
|
const gscanCommand = {
|
|
155
170
|
npm: 'npx --yes gscan@6.4.2 .',
|
|
@@ -157,24 +172,23 @@ function packageJson(options) {
|
|
|
157
172
|
yarn: 'yarn dlx gscan@6.4.2 .',
|
|
158
173
|
bun: 'bunx gscan@6.4.2 .'
|
|
159
174
|
};
|
|
175
|
+
const zipScript = `${options.packageManager} run build && node ./scripts/zip.mjs`;
|
|
160
176
|
const scripts = options.style === 'tailwind'
|
|
161
177
|
? {
|
|
162
178
|
dev: 'tailwindcss -i ./assets/css/source.css -o ./assets/built/screen.css --watch',
|
|
163
179
|
build: 'tailwindcss -i ./assets/css/source.css -o ./assets/built/screen.css --minify',
|
|
164
180
|
test: 'node ./scripts/check.mjs',
|
|
165
|
-
zip:
|
|
181
|
+
zip: zipScript,
|
|
166
182
|
validate: gscanCommand[options.packageManager]
|
|
167
183
|
}
|
|
168
184
|
: {
|
|
169
185
|
dev: 'node ./scripts/dev.mjs',
|
|
170
186
|
build: 'node ./scripts/build.mjs',
|
|
171
187
|
test: 'node ./scripts/check.mjs',
|
|
172
|
-
zip:
|
|
188
|
+
zip: zipScript,
|
|
173
189
|
validate: gscanCommand[options.packageManager]
|
|
174
190
|
};
|
|
175
191
|
const devDependencies = {};
|
|
176
|
-
// Use the selected package manager for the build preceding archive creation.
|
|
177
|
-
scripts.zip = `${options.packageManager} run build && node ./scripts/zip.mjs`;
|
|
178
192
|
if (options.style === 'tailwind') {
|
|
179
193
|
devDependencies.tailwindcss = '^4.1.0';
|
|
180
194
|
devDependencies['@tailwindcss/cli'] = '^4.1.0';
|
|
@@ -294,13 +308,14 @@ function scaffoldTheme(options) {
|
|
|
294
308
|
: css;
|
|
295
309
|
const files = {
|
|
296
310
|
'package.json': packageJson({ ...options, themeName }),
|
|
297
|
-
'default.hbs': defaultTemplate(
|
|
311
|
+
'default.hbs': defaultTemplate(),
|
|
298
312
|
'index.hbs': indexTemplate(options),
|
|
299
313
|
'post.hbs': postTemplate(options),
|
|
300
314
|
'partials/content-cta.hbs': '{{{html}}}\n{{> "components/member-cta"}}\n',
|
|
301
315
|
'page.hbs': pageTemplate(),
|
|
302
316
|
'tag.hbs': archiveTemplate('tag'),
|
|
303
317
|
'author.hbs': archiveTemplate('author'),
|
|
318
|
+
'error.hbs': errorTemplate(),
|
|
304
319
|
'assets/css/source.css': sourceCss,
|
|
305
320
|
'assets/built/screen.css': css,
|
|
306
321
|
'scripts/check.mjs': "import { fileURLToPath } from 'node:url';\nimport { reportTheme } from './theme-tools.mjs';\nif (!reportTheme(fileURLToPath(new URL('../', import.meta.url)))) process.exitCode = 1;\n",
|
package/dist/utils/theme.js
CHANGED
|
@@ -62,8 +62,8 @@ exports.BASE_PALETTES = {
|
|
|
62
62
|
mutedForeground: '#71717a',
|
|
63
63
|
accent: '#f4f4f5',
|
|
64
64
|
accentForeground: '#18181b',
|
|
65
|
-
destructive: '#
|
|
66
|
-
destructiveForeground: '#
|
|
65
|
+
destructive: '#dc2626',
|
|
66
|
+
destructiveForeground: '#ffffff',
|
|
67
67
|
border: '#e4e4e7',
|
|
68
68
|
input: '#e4e4e7',
|
|
69
69
|
ring: '#18181b'
|
|
@@ -81,8 +81,8 @@ exports.BASE_PALETTES = {
|
|
|
81
81
|
mutedForeground: '#a1a1aa',
|
|
82
82
|
accent: '#27272a',
|
|
83
83
|
accentForeground: '#fafafa',
|
|
84
|
-
destructive: '#
|
|
85
|
-
destructiveForeground: '#
|
|
84
|
+
destructive: '#f87171',
|
|
85
|
+
destructiveForeground: '#450a0a',
|
|
86
86
|
border: '#27272a',
|
|
87
87
|
input: '#27272a',
|
|
88
88
|
ring: '#d4d4d8'
|
|
@@ -102,8 +102,8 @@ exports.BASE_PALETTES = {
|
|
|
102
102
|
mutedForeground: '#64748b',
|
|
103
103
|
accent: '#f1f5f9',
|
|
104
104
|
accentForeground: '#0f172a',
|
|
105
|
-
destructive: '#
|
|
106
|
-
destructiveForeground: '#
|
|
105
|
+
destructive: '#dc2626',
|
|
106
|
+
destructiveForeground: '#ffffff',
|
|
107
107
|
border: '#e2e8f0',
|
|
108
108
|
input: '#e2e8f0',
|
|
109
109
|
ring: '#0f172a'
|
|
@@ -121,8 +121,8 @@ exports.BASE_PALETTES = {
|
|
|
121
121
|
mutedForeground: '#94a3b8',
|
|
122
122
|
accent: '#1e293b',
|
|
123
123
|
accentForeground: '#f8fafc',
|
|
124
|
-
destructive: '#
|
|
125
|
-
destructiveForeground: '#
|
|
124
|
+
destructive: '#f87171',
|
|
125
|
+
destructiveForeground: '#450a0a',
|
|
126
126
|
border: '#1e293b',
|
|
127
127
|
input: '#1e293b',
|
|
128
128
|
ring: '#cbd5e1'
|
|
@@ -142,8 +142,8 @@ exports.BASE_PALETTES = {
|
|
|
142
142
|
mutedForeground: '#78716c',
|
|
143
143
|
accent: '#f5f5f4',
|
|
144
144
|
accentForeground: '#1c1917',
|
|
145
|
-
destructive: '#
|
|
146
|
-
destructiveForeground: '#
|
|
145
|
+
destructive: '#dc2626',
|
|
146
|
+
destructiveForeground: '#ffffff',
|
|
147
147
|
border: '#e7e5e4',
|
|
148
148
|
input: '#e7e5e4',
|
|
149
149
|
ring: '#1c1917'
|
|
@@ -161,8 +161,8 @@ exports.BASE_PALETTES = {
|
|
|
161
161
|
mutedForeground: '#a8a29e',
|
|
162
162
|
accent: '#292524',
|
|
163
163
|
accentForeground: '#fafaf9',
|
|
164
|
-
destructive: '#
|
|
165
|
-
destructiveForeground: '#
|
|
164
|
+
destructive: '#f87171',
|
|
165
|
+
destructiveForeground: '#450a0a',
|
|
166
166
|
border: '#292524',
|
|
167
167
|
input: '#292524',
|
|
168
168
|
ring: '#d6d3d1'
|
|
@@ -182,8 +182,8 @@ exports.BASE_PALETTES = {
|
|
|
182
182
|
mutedForeground: '#6b7280',
|
|
183
183
|
accent: '#f3f4f6',
|
|
184
184
|
accentForeground: '#1f2937',
|
|
185
|
-
destructive: '#
|
|
186
|
-
destructiveForeground: '#
|
|
185
|
+
destructive: '#dc2626',
|
|
186
|
+
destructiveForeground: '#ffffff',
|
|
187
187
|
border: '#e5e7eb',
|
|
188
188
|
input: '#e5e7eb',
|
|
189
189
|
ring: '#1f2937'
|
|
@@ -201,8 +201,8 @@ exports.BASE_PALETTES = {
|
|
|
201
201
|
mutedForeground: '#9ca3af',
|
|
202
202
|
accent: '#1f2937',
|
|
203
203
|
accentForeground: '#f9fafb',
|
|
204
|
-
destructive: '#
|
|
205
|
-
destructiveForeground: '#
|
|
204
|
+
destructive: '#f87171',
|
|
205
|
+
destructiveForeground: '#450a0a',
|
|
206
206
|
border: '#1f2937',
|
|
207
207
|
input: '#1f2937',
|
|
208
208
|
ring: '#d1d5db'
|
|
@@ -222,8 +222,8 @@ exports.BASE_PALETTES = {
|
|
|
222
222
|
mutedForeground: '#737373',
|
|
223
223
|
accent: '#f5f5f5',
|
|
224
224
|
accentForeground: '#171717',
|
|
225
|
-
destructive: '#
|
|
226
|
-
destructiveForeground: '#
|
|
225
|
+
destructive: '#dc2626',
|
|
226
|
+
destructiveForeground: '#ffffff',
|
|
227
227
|
border: '#e5e5e5',
|
|
228
228
|
input: '#e5e5e5',
|
|
229
229
|
ring: '#171717'
|
|
@@ -241,8 +241,8 @@ exports.BASE_PALETTES = {
|
|
|
241
241
|
mutedForeground: '#a3a3a3',
|
|
242
242
|
accent: '#262626',
|
|
243
243
|
accentForeground: '#fafafa',
|
|
244
|
-
destructive: '#
|
|
245
|
-
destructiveForeground: '#
|
|
244
|
+
destructive: '#f87171',
|
|
245
|
+
destructiveForeground: '#450a0a',
|
|
246
246
|
border: '#262626',
|
|
247
247
|
input: '#262626',
|
|
248
248
|
ring: '#d4d4d4'
|
|
@@ -261,9 +261,9 @@ exports.ACCENT_COLORS = {
|
|
|
261
261
|
ring: 'var(--ghost-accent-color, #18181b)'
|
|
262
262
|
},
|
|
263
263
|
dark: {
|
|
264
|
-
primary: 'var(--ghost-accent-color, #
|
|
265
|
-
primaryForeground: '#
|
|
266
|
-
ring: 'var(--ghost-accent-color, #
|
|
264
|
+
primary: 'var(--ghost-accent-color, #4f46e5)',
|
|
265
|
+
primaryForeground: '#ffffff',
|
|
266
|
+
ring: 'var(--ghost-accent-color, #a5b4fc)'
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
269
|
zinc: {
|
|
@@ -272,27 +272,27 @@ exports.ACCENT_COLORS = {
|
|
|
272
272
|
},
|
|
273
273
|
indigo: {
|
|
274
274
|
light: { primary: '#4f46e5', primaryForeground: '#ffffff', ring: '#4f46e5' },
|
|
275
|
-
dark: { primary: '#
|
|
275
|
+
dark: { primary: '#818cf8', primaryForeground: '#1e1b4b', ring: '#818cf8' }
|
|
276
276
|
},
|
|
277
277
|
violet: {
|
|
278
278
|
light: { primary: '#7c3aed', primaryForeground: '#ffffff', ring: '#7c3aed' },
|
|
279
|
-
dark: { primary: '#
|
|
279
|
+
dark: { primary: '#a78bfa', primaryForeground: '#1e1b4b', ring: '#a78bfa' }
|
|
280
280
|
},
|
|
281
281
|
blue: {
|
|
282
282
|
light: { primary: '#2563eb', primaryForeground: '#ffffff', ring: '#2563eb' },
|
|
283
|
-
dark: { primary: '#
|
|
283
|
+
dark: { primary: '#60a5fa', primaryForeground: '#0f172a', ring: '#60a5fa' }
|
|
284
284
|
},
|
|
285
285
|
emerald: {
|
|
286
|
-
light: { primary: '#
|
|
287
|
-
dark: { primary: '#
|
|
286
|
+
light: { primary: '#047857', primaryForeground: '#ffffff', ring: '#047857' },
|
|
287
|
+
dark: { primary: '#34d399', primaryForeground: '#022c22', ring: '#34d399' }
|
|
288
288
|
},
|
|
289
289
|
rose: {
|
|
290
|
-
light: { primary: '#
|
|
291
|
-
dark: { primary: '#
|
|
290
|
+
light: { primary: '#be123c', primaryForeground: '#ffffff', ring: '#be123c' },
|
|
291
|
+
dark: { primary: '#fb7185', primaryForeground: '#4c0519', ring: '#fb7185' }
|
|
292
292
|
},
|
|
293
293
|
orange: {
|
|
294
|
-
light: { primary: '#
|
|
295
|
-
dark: { primary: '#
|
|
294
|
+
light: { primary: '#c2410c', primaryForeground: '#ffffff', ring: '#c2410c' },
|
|
295
|
+
dark: { primary: '#fb923c', primaryForeground: '#431407', ring: '#fb923c' }
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
298
|
function generateThemeCss(config) {
|
|
@@ -317,6 +317,8 @@ function generateThemeCss(config) {
|
|
|
317
317
|
--accent-foreground: ${base.dark.accentForeground};
|
|
318
318
|
--destructive: ${base.dark.destructive};
|
|
319
319
|
--destructive-foreground: ${base.dark.destructiveForeground};
|
|
320
|
+
--success: #4ade80;
|
|
321
|
+
--success-foreground: #052e16;
|
|
320
322
|
--border: ${base.dark.border};
|
|
321
323
|
--input: ${base.dark.input};
|
|
322
324
|
--ring: ${accent.dark.ring || base.dark.ring};`;
|
|
@@ -343,6 +345,8 @@ function generateThemeCss(config) {
|
|
|
343
345
|
--accent-foreground: ${base.light.accentForeground};
|
|
344
346
|
--destructive: ${base.light.destructive};
|
|
345
347
|
--destructive-foreground: ${base.light.destructiveForeground};
|
|
348
|
+
--success: #15803d;
|
|
349
|
+
--success-foreground: #ffffff;
|
|
346
350
|
--border: ${base.light.border};
|
|
347
351
|
--input: ${base.light.input};
|
|
348
352
|
--ring: ${accent.light.ring || base.light.ring};
|
|
@@ -476,6 +480,9 @@ ${Object.entries(design_defaults_json_1.default).map(([name, value]) => ` --ghc
|
|
|
476
480
|
white-space: nowrap;
|
|
477
481
|
border: 0;
|
|
478
482
|
}
|
|
483
|
+
@media (prefers-reduced-motion: reduce) {
|
|
484
|
+
.ghcn-button, .ghcn-icon-button { transition: none; }
|
|
485
|
+
}
|
|
479
486
|
`;
|
|
480
487
|
return (0, styles_1.componentCss)(css, config.style);
|
|
481
488
|
}
|