kira-kit 0.2.1 → 0.4.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/README.md +132 -43
- package/dist/index.mjs +2544 -0
- package/package.json +38 -17
- package/templates/monorepo/components.json +23 -0
- package/templates/monorepo/package.json +13 -0
- package/templates/monorepo/packages/app/index.html +13 -0
- package/templates/monorepo/packages/app/package.json +27 -0
- package/templates/monorepo/packages/app/src/App.tsx +21 -0
- package/templates/monorepo/packages/app/src/index.css +3 -0
- package/templates/monorepo/packages/app/src/main.tsx +10 -0
- package/templates/monorepo/packages/app/tsconfig.json +8 -0
- package/templates/monorepo/packages/app/vite.config.ts +10 -0
- package/templates/monorepo/packages/ui/package.json +32 -0
- package/templates/monorepo/packages/ui/src/components/ui/welcome.tsx +52 -0
- package/templates/monorepo/packages/ui/src/index.css +123 -0
- package/templates/monorepo/packages/ui/src/index.ts +3 -0
- package/templates/monorepo/packages/ui/src/lib/utils.ts +1 -0
- package/templates/monorepo/packages/ui/tsconfig.json +7 -0
- package/templates/monorepo/tsconfig.json +23 -0
- package/templates/next/app/globals.css +124 -0
- package/templates/next/app/layout.tsx +18 -0
- package/templates/next/app/page.tsx +9 -0
- package/templates/next/components/ui/welcome.tsx +62 -0
- package/templates/next/components.json +23 -0
- package/templates/next/lib/utils.ts +1 -0
- package/templates/next/next-env.d.ts +2 -0
- package/templates/next/next.config.ts +5 -0
- package/templates/next/package.json +28 -0
- package/templates/next/postcss.config.mjs +7 -0
- package/templates/next/tsconfig.json +24 -0
- package/templates/tanstack-start/README.md +16 -0
- package/templates/tanstack-start/components.json +23 -0
- package/templates/tanstack-start/package.json +30 -0
- package/templates/tanstack-start/src/components/ui/welcome.tsx +52 -0
- package/templates/tanstack-start/src/index.css +123 -0
- package/templates/tanstack-start/src/lib/utils.ts +1 -0
- package/templates/tanstack-start/src/router.tsx +15 -0
- package/templates/tanstack-start/src/routes/__root.tsx +41 -0
- package/templates/tanstack-start/src/routes/index.tsx +26 -0
- package/{tsconfig.json → templates/tanstack-start/tsconfig.json} +6 -7
- package/templates/tanstack-start/vite.config.ts +11 -0
- package/templates/vite/components.json +23 -0
- package/templates/vite/index.html +16 -0
- package/templates/vite/package.json +28 -0
- package/templates/vite/src/App.tsx +9 -0
- package/templates/vite/src/components/ui/welcome.tsx +60 -0
- package/templates/vite/src/index.css +124 -0
- package/templates/vite/src/lib/utils.ts +1 -0
- package/templates/vite/src/main.tsx +10 -0
- package/templates/vite/tsconfig.json +29 -0
- package/templates/vite/tsconfig.node.json +22 -0
- package/templates/vite/vite.config.ts +13 -0
- package/bin/kira-kit.js +0 -27329
- package/bun.lock +0 -247
- package/src/commands/add.ts +0 -146
- package/src/commands/build.ts +0 -212
- package/src/commands/init.ts +0 -164
- package/src/commands/list.ts +0 -31
- package/src/index.ts +0 -118
- package/src/lib/build-config.ts +0 -81
- package/src/lib/config.ts +0 -109
- package/src/lib/deps.ts +0 -135
- package/src/lib/file.ts +0 -64
- package/src/lib/logger.ts +0 -102
- package/src/lib/registry.ts +0 -81
- package/src/lib/templates.ts +0 -123
- package/src/lib/theme-generator.ts +0 -246
- package/src/prompts/base-color.ts +0 -20
- package/src/prompts/primary-color.ts +0 -23
- package/src/prompts/project-type.ts +0 -71
- package/src/types.ts +0 -61
package/src/lib/logger.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import picocolors from "picocolors";
|
|
2
|
-
|
|
3
|
-
export const colors = {
|
|
4
|
-
primary: picocolors.cyan,
|
|
5
|
-
success: picocolors.green,
|
|
6
|
-
error: picocolors.red,
|
|
7
|
-
warning: picocolors.yellow,
|
|
8
|
-
dim: picocolors.dim,
|
|
9
|
-
bold: picocolors.bold,
|
|
10
|
-
italic: picocolors.italic,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function log(message: string): void {
|
|
14
|
-
console.log(message);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function info(message: string): void {
|
|
18
|
-
console.log(colors.primary("info") + " " + message);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function success(message: string): void {
|
|
22
|
-
console.log(colors.success("success") + " " + message);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function error(message: string): void {
|
|
26
|
-
console.error(colors.error("error") + " " + message);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function warning(message: string): void {
|
|
30
|
-
console.warn(colors.warning("warning") + " " + message);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function banner(text: string): void {
|
|
34
|
-
const line = "=".repeat(text.length + 4);
|
|
35
|
-
console.log(
|
|
36
|
-
picocolors.cyan(`
|
|
37
|
-
${line}
|
|
38
|
-
${text}
|
|
39
|
-
${line}
|
|
40
|
-
`),
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function welcome(name: string): void {
|
|
45
|
-
console.log(
|
|
46
|
-
picocolors.cyan(`
|
|
47
|
-
██╗ ██╗██╗██████╗ █████╗ ██╗ ██╗██╗████████╗
|
|
48
|
-
██║ ██╔╝██║██╔══██╗██╔══██╗ ██║ ██╔╝██║╚══██╔══╝
|
|
49
|
-
█████╔╝ ██║██████╔╝███████║█████╗█████╔╝ ██║ ██║
|
|
50
|
-
██╔═██╗ ██║██╔══██╗██╔══██║╚════╝██╔═██╗ ██║ ██║
|
|
51
|
-
██║ ██╗██║██║ ██║██║ ██║ ██║ ██╗██║ ██║
|
|
52
|
-
╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
|
53
|
-
|
|
54
|
-
CLI v0.2.0. Welcome!
|
|
55
|
-
`),
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function spinner(message: string): {
|
|
60
|
-
start(): void;
|
|
61
|
-
stop(msg: string): void;
|
|
62
|
-
} {
|
|
63
|
-
const frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
64
|
-
let interval: ReturnType<typeof setInterval>;
|
|
65
|
-
let i = 0;
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
start() {
|
|
69
|
-
process.stdout.write(colors.dim(message) + " " + frames[0] + " \r");
|
|
70
|
-
interval = setInterval(() => {
|
|
71
|
-
process.stdout.write(
|
|
72
|
-
"\r" + colors.dim(message) + " " + frames[i] + " \r",
|
|
73
|
-
);
|
|
74
|
-
i = (i + 1) % frames.length;
|
|
75
|
-
}, 80);
|
|
76
|
-
},
|
|
77
|
-
stop(msg: string) {
|
|
78
|
-
clearInterval(interval);
|
|
79
|
-
process.stdout.write("\r" + " ".repeat(message.length + 5) + "\r");
|
|
80
|
-
success(msg);
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function table(rows: string[][]): void {
|
|
86
|
-
const maxLengths: number[] = [];
|
|
87
|
-
|
|
88
|
-
for (const row of rows) {
|
|
89
|
-
row.forEach((cell, i) => {
|
|
90
|
-
maxLengths[i] = Math.max(maxLengths[i] || 0, cell.length);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
for (const row of rows) {
|
|
95
|
-
const line = row.map((cell, i) => cell.padEnd(maxLengths[i])).join(" ");
|
|
96
|
-
console.log(line);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function dim(message: string): string {
|
|
101
|
-
return colors.dim(message);
|
|
102
|
-
}
|
package/src/lib/registry.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { RegistryItem } from "../types";
|
|
2
|
-
|
|
3
|
-
import { getRegistryUrl } from "./config";
|
|
4
|
-
|
|
5
|
-
export async function fetchRegistryItem(
|
|
6
|
-
componentName: string,
|
|
7
|
-
cwd: string = process.cwd(),
|
|
8
|
-
): Promise<RegistryItem | null> {
|
|
9
|
-
const registryUrl = getRegistryUrl(cwd);
|
|
10
|
-
const url = `${registryUrl}/${componentName}.json`;
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
const response = await fetch(url);
|
|
14
|
-
|
|
15
|
-
if (!response.ok) {
|
|
16
|
-
if (response.status === 404) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
throw new Error(`Failed to fetch ${url}: ${response.statusText}`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const data = await response.json();
|
|
23
|
-
return data as RegistryItem;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
if (error instanceof TypeError && error.message.includes("fetch")) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`Unable to fetch from ${url}. Make sure you're connected to the internet.`,
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
throw error;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export async function fetchRegistryIndex(cwd: string = process.cwd()): Promise<{
|
|
35
|
-
name: string;
|
|
36
|
-
homepage: string;
|
|
37
|
-
components: Array<{
|
|
38
|
-
name: string;
|
|
39
|
-
title: string;
|
|
40
|
-
dependencies: string[];
|
|
41
|
-
registryDependencies: string[];
|
|
42
|
-
}>;
|
|
43
|
-
}> {
|
|
44
|
-
const registryUrl = getRegistryUrl(cwd);
|
|
45
|
-
const url = `${registryUrl}/index.json`;
|
|
46
|
-
|
|
47
|
-
const response = await fetch(url);
|
|
48
|
-
|
|
49
|
-
if (!response.ok) {
|
|
50
|
-
throw new Error(`Failed to fetch registry index: ${response.statusText}`);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const data = await response.json();
|
|
54
|
-
return data as {
|
|
55
|
-
name: string;
|
|
56
|
-
homepage: string;
|
|
57
|
-
components: Array<{
|
|
58
|
-
name: string;
|
|
59
|
-
title: string;
|
|
60
|
-
dependencies: string[];
|
|
61
|
-
registryDependencies: string[];
|
|
62
|
-
}>;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export async function fetchAllRegistries(
|
|
67
|
-
cwd: string = process.cwd(),
|
|
68
|
-
): Promise<RegistryItem[]> {
|
|
69
|
-
const index = await fetchRegistryIndex(cwd);
|
|
70
|
-
|
|
71
|
-
const items: RegistryItem[] = [];
|
|
72
|
-
|
|
73
|
-
for (const component of index.components) {
|
|
74
|
-
const item = await fetchRegistryItem(component.name, cwd);
|
|
75
|
-
if (item) {
|
|
76
|
-
items.push(item);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return items;
|
|
81
|
-
}
|
package/src/lib/templates.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export const STATIC_STYLES = `
|
|
2
|
-
/* Mac-like scrollbar styling with cross-browser support */
|
|
3
|
-
@layer base {
|
|
4
|
-
/* Standard scrollbar styling (Firefox) */
|
|
5
|
-
* {
|
|
6
|
-
scrollbar-width: thin;
|
|
7
|
-
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
:root {
|
|
11
|
-
--scrollbar-thumb: oklch(0.7 0 0 / 40%);
|
|
12
|
-
--scrollbar-track: transparent;
|
|
13
|
-
--scrollbar-thumb-hover: oklch(0.6 0 0 / 60%);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.dark {
|
|
17
|
-
--scrollbar-thumb: oklch(0.5 0 0 / 40%);
|
|
18
|
-
--scrollbar-thumb-hover: oklch(0.6 0 0 / 60%);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Webkit scrollbar styling (Chrome, Safari, Edge) */
|
|
22
|
-
::-webkit-scrollbar {
|
|
23
|
-
width: 8px;
|
|
24
|
-
height: 8px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
::-webkit-scrollbar-track {
|
|
28
|
-
background: var(--scrollbar-track);
|
|
29
|
-
border-radius: 4px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
::-webkit-scrollbar-thumb {
|
|
33
|
-
background: var(--scrollbar-thumb);
|
|
34
|
-
border-radius: 4px;
|
|
35
|
-
border: 2px solid transparent;
|
|
36
|
-
background-clip: content-box;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
::-webkit-scrollbar-thumb:hover {
|
|
40
|
-
background: var(--scrollbar-thumb-hover);
|
|
41
|
-
background-clip: content-box;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
::-webkit-scrollbar-corner {
|
|
45
|
-
background: transparent;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Accessibility: Respect user preferences for reduced motion */
|
|
49
|
-
@media (prefers-reduced-motion: reduce) {
|
|
50
|
-
::-webkit-scrollbar-thumb {
|
|
51
|
-
transition: none;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* Accessibility: High contrast mode support */
|
|
56
|
-
@media (forced-colors: active) {
|
|
57
|
-
::-webkit-scrollbar-thumb {
|
|
58
|
-
background: CanvasText;
|
|
59
|
-
}
|
|
60
|
-
::-webkit-scrollbar-track {
|
|
61
|
-
background: Canvas;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* Shimmer animation for skeleton loading */
|
|
67
|
-
@keyframes shimmer {
|
|
68
|
-
0% { transform: translateX(-100%); }
|
|
69
|
-
100% { transform: translateX(100%); }
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Wave animation for skeleton loading */
|
|
73
|
-
@keyframes skeleton-wave {
|
|
74
|
-
0%, 100% { opacity: 1; }
|
|
75
|
-
50% { opacity: 0.5; }
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* Progress bar animations */
|
|
79
|
-
@keyframes progress-stripes {
|
|
80
|
-
from { background-position: 1rem 0; }
|
|
81
|
-
to { background-position: 0 0; }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@keyframes progress-indeterminate {
|
|
85
|
-
0% { transform: translateX(-100%); }
|
|
86
|
-
100% { transform: translateX(400%); }
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Date Picker Calendar Styles */
|
|
90
|
-
@layer components {
|
|
91
|
-
.rdp-nav, .rdp-button_previous, .rdp-button_next { display: none !important; }
|
|
92
|
-
.rdp-month_caption { margin-top: 0 !important; padding-top: 0 !important; }
|
|
93
|
-
.rdp-months { margin-top: 0 !important; padding-top: 0 !important; }
|
|
94
|
-
[data-picker-grid], [data-picker-container] { width: 100% !important; min-width: 0; }
|
|
95
|
-
|
|
96
|
-
.rdp-day_selected { @apply bg-primary text-primary-foreground rounded-md; }
|
|
97
|
-
.rdp-day_selected:hover { @apply bg-primary/90; }
|
|
98
|
-
.rdp-day_selected .rdp-day_button { @apply ring-0 outline-none; box-shadow: none !important; border: none !important; }
|
|
99
|
-
|
|
100
|
-
.rdp-day_today:not(.rdp-day_selected) { @apply bg-muted/30; }
|
|
101
|
-
.rdp-day_today:not(.rdp-day_selected) .rdp-day_button::after {
|
|
102
|
-
content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
|
|
103
|
-
width: 4px; height: 4px; border-radius: 50%; background-color: var(--primary);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.rdp-day_selected .rdp-day_button::after, .rdp-day_today.rdp-day_selected .rdp-day_button::after { display: none !important; }
|
|
107
|
-
|
|
108
|
-
.rdp-day_button { @apply rounded-md; }
|
|
109
|
-
.rdp-day_button:hover:not(.rdp-day_selected):not(.rdp-day_disabled) { @apply bg-muted/50; }
|
|
110
|
-
.rdp-day_button:focus-visible { @apply ring-2 ring-ring ring-offset-2 ring-offset-background; }
|
|
111
|
-
|
|
112
|
-
.rdp-day_range_start, .rdp-day_range_end { @apply bg-primary text-primary-foreground rounded-md; }
|
|
113
|
-
.rdp-day_range_middle { @apply bg-primary/10 rounded-none; }
|
|
114
|
-
.rdp-day_range_middle:hover { @apply bg-primary/15; }
|
|
115
|
-
.rdp-day_range_middle .rdp-day_button { @apply text-foreground font-medium; color: var(--foreground) !important; }
|
|
116
|
-
|
|
117
|
-
@media (forced-colors: active) {
|
|
118
|
-
.rdp-day_selected { @apply bg-[Highlight] text-[HighlightText]; }
|
|
119
|
-
.rdp-day_today:not(.rdp-day_selected) { @apply border-2 border-[Highlight]; }
|
|
120
|
-
.rdp-day_today .rdp-day_button::after { background-color: Highlight; }
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
`;
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { converter } from "culori";
|
|
2
|
-
import { STATIC_STYLES } from "./templates";
|
|
3
|
-
|
|
4
|
-
const oklch = converter("oklch");
|
|
5
|
-
|
|
6
|
-
function generatePalette(primaryColor: string) {
|
|
7
|
-
const p = oklch(primaryColor);
|
|
8
|
-
if (!p) throw new Error(`Invalid color: ${primaryColor}`);
|
|
9
|
-
const h = p.h || 0;
|
|
10
|
-
const c = p.c || 0.15;
|
|
11
|
-
|
|
12
|
-
const genVal = (lightness: number, chroma: number = c) =>
|
|
13
|
-
`${lightness} ${chroma} ${h}`;
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
light: {
|
|
17
|
-
background: "1 0 0",
|
|
18
|
-
foreground: "0.145 0 0",
|
|
19
|
-
card: "1 0 0",
|
|
20
|
-
cardForeground: "0.145 0 0",
|
|
21
|
-
popover: "1 0 0",
|
|
22
|
-
popoverForeground: "0.145 0 0",
|
|
23
|
-
primary: genVal(0.59, c),
|
|
24
|
-
primaryForeground: "0.97 0.01 343",
|
|
25
|
-
secondary: genVal(0.75, c * 0.5),
|
|
26
|
-
secondaryForeground: "0.2 0.03 15",
|
|
27
|
-
muted: genVal(0.95, c * 0.1),
|
|
28
|
-
mutedForeground: genVal(0.5, c * 0.2),
|
|
29
|
-
accent: genVal(0.92, c * 0.2),
|
|
30
|
-
accentForeground: genVal(0.3, c * 0.2),
|
|
31
|
-
destructive: "0.6 0.22 20",
|
|
32
|
-
destructiveForeground: "0.98 0.01 20",
|
|
33
|
-
border: "0.9 0.01 20",
|
|
34
|
-
input: "0.9 0.01 20",
|
|
35
|
-
ring: genVal(0.7, c * 0.5),
|
|
36
|
-
chart1: genVal(0.75, c),
|
|
37
|
-
chart2: `oklch(0.75 ${c} ${h + 60})`
|
|
38
|
-
.replace("oklch(", "")
|
|
39
|
-
.replace(")", ""),
|
|
40
|
-
chart3: `oklch(0.75 ${c} ${h + 120})`
|
|
41
|
-
.replace("oklch(", "")
|
|
42
|
-
.replace(")", ""),
|
|
43
|
-
chart4: `oklch(0.75 ${c} ${h + 180})`
|
|
44
|
-
.replace("oklch(", "")
|
|
45
|
-
.replace(")", ""),
|
|
46
|
-
chart5: `oklch(0.75 ${c} ${h + 240})`
|
|
47
|
-
.replace("oklch(", "")
|
|
48
|
-
.replace(")", ""),
|
|
49
|
-
sidebar: "0.985 0 0",
|
|
50
|
-
sidebarForeground: "0.145 0 0",
|
|
51
|
-
sidebarPrimary: genVal(0.59, c),
|
|
52
|
-
sidebarPrimaryForeground: "0.97 0.01 343",
|
|
53
|
-
sidebarAccent: genVal(0.9, c * 0.2),
|
|
54
|
-
sidebarAccentForeground: genVal(0.25, c * 0.2),
|
|
55
|
-
sidebarBorder: "0.922 0 0",
|
|
56
|
-
sidebarRing: genVal(0.7, c * 0.5),
|
|
57
|
-
},
|
|
58
|
-
dark: {
|
|
59
|
-
background: "0.145 0 0",
|
|
60
|
-
foreground: "0.985 0 0",
|
|
61
|
-
card: "0.205 0 0",
|
|
62
|
-
cardForeground: "0.985 0 0",
|
|
63
|
-
popover: "0.205 0 0",
|
|
64
|
-
popoverForeground: "0.985 0 0",
|
|
65
|
-
primary: genVal(0.66, c),
|
|
66
|
-
primaryForeground: "0.97 0.01 343",
|
|
67
|
-
secondary: genVal(0.6, c * 0.4),
|
|
68
|
-
secondaryForeground: "0.985 0 0",
|
|
69
|
-
muted: genVal(0.25, c * 0.1),
|
|
70
|
-
mutedForeground: genVal(0.65, c * 0.2),
|
|
71
|
-
accent: genVal(0.4, c * 0.3),
|
|
72
|
-
accentForeground: "0.98 0.01 10",
|
|
73
|
-
destructive: "0.65 0.2 15",
|
|
74
|
-
destructiveForeground: "0.98 0.01 15",
|
|
75
|
-
border: "1 0 0 / 15%",
|
|
76
|
-
input: "1 0 0 / 20%",
|
|
77
|
-
ring: genVal(0.65, c * 0.5),
|
|
78
|
-
chart1: genVal(0.7, c),
|
|
79
|
-
chart2: `oklch(0.7 ${c} ${h + 60})`
|
|
80
|
-
.replace("oklch(", "")
|
|
81
|
-
.replace(")", ""),
|
|
82
|
-
chart3: `oklch(0.7 ${c} ${h + 120})`
|
|
83
|
-
.replace("oklch(", "")
|
|
84
|
-
.replace(")", ""),
|
|
85
|
-
chart4: `oklch(0.7 ${c} ${h + 180})`
|
|
86
|
-
.replace("oklch(", "")
|
|
87
|
-
.replace(")", ""),
|
|
88
|
-
chart5: `oklch(0.7 ${c} ${h + 240})`
|
|
89
|
-
.replace("oklch(", "")
|
|
90
|
-
.replace(")", ""),
|
|
91
|
-
sidebar: "0.205 0 0",
|
|
92
|
-
sidebarForeground: "0.985 0 0",
|
|
93
|
-
sidebarPrimary: genVal(0.73, c),
|
|
94
|
-
sidebarPrimaryForeground: "0.97 0.01 343",
|
|
95
|
-
sidebarAccent: genVal(0.45, c * 0.3),
|
|
96
|
-
sidebarAccentForeground: "0.98 0.01 10",
|
|
97
|
-
sidebarBorder: "1 0 0 / 10%",
|
|
98
|
-
sidebarRing: genVal(0.65, c * 0.5),
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export function generateCss(primaryColor: string): string {
|
|
104
|
-
const palette = generatePalette(primaryColor);
|
|
105
|
-
|
|
106
|
-
return `@import "tailwindcss";
|
|
107
|
-
@import "tw-animate-css";
|
|
108
|
-
@import "shadcn/tailwind.css";
|
|
109
|
-
@import "@fontsource-variable/geist";
|
|
110
|
-
|
|
111
|
-
@custom-variant dark (&:is(.dark *));
|
|
112
|
-
|
|
113
|
-
:root {
|
|
114
|
-
--background: oklch(${palette.light.background});
|
|
115
|
-
--foreground: oklch(${palette.light.foreground});
|
|
116
|
-
--card: oklch(${palette.light.card});
|
|
117
|
-
--card-foreground: oklch(${palette.light.cardForeground});
|
|
118
|
-
--popover: oklch(${palette.light.popover});
|
|
119
|
-
--popover-foreground: oklch(${palette.light.popoverForeground});
|
|
120
|
-
--primary: oklch(${palette.light.primary});
|
|
121
|
-
--primary-foreground: oklch(${palette.light.primaryForeground});
|
|
122
|
-
--secondary: oklch(${palette.light.secondary});
|
|
123
|
-
--secondary-foreground: oklch(${palette.light.secondaryForeground});
|
|
124
|
-
--muted: oklch(${palette.light.muted});
|
|
125
|
-
--muted-foreground: oklch(${palette.light.mutedForeground});
|
|
126
|
-
--accent: oklch(${palette.light.accent});
|
|
127
|
-
--accent-foreground: oklch(${palette.light.accentForeground});
|
|
128
|
-
--destructive: oklch(${palette.light.destructive});
|
|
129
|
-
--destructive-foreground: oklch(${palette.light.destructiveForeground});
|
|
130
|
-
--border: oklch(${palette.light.border});
|
|
131
|
-
--input: oklch(${palette.light.input});
|
|
132
|
-
--ring: oklch(${palette.light.ring});
|
|
133
|
-
--radius: 0.45rem;
|
|
134
|
-
|
|
135
|
-
--chart-1: oklch(${palette.light.chart1});
|
|
136
|
-
--chart-2: oklch(${palette.light.chart2});
|
|
137
|
-
--chart-3: oklch(${palette.light.chart3});
|
|
138
|
-
--chart-4: oklch(${palette.light.chart4});
|
|
139
|
-
--chart-5: oklch(${palette.light.chart5});
|
|
140
|
-
|
|
141
|
-
--sidebar: oklch(${palette.light.sidebar});
|
|
142
|
-
--sidebar-foreground: oklch(${palette.light.sidebarForeground});
|
|
143
|
-
--sidebar-primary: oklch(${palette.light.sidebarPrimary});
|
|
144
|
-
--sidebar-primary-foreground: oklch(${palette.light.sidebarPrimaryForeground});
|
|
145
|
-
--sidebar-accent: oklch(${palette.light.sidebarAccent});
|
|
146
|
-
--sidebar-accent-foreground: oklch(${palette.light.sidebarAccentForeground});
|
|
147
|
-
--sidebar-border: oklch(${palette.light.sidebarBorder});
|
|
148
|
-
--sidebar-ring: oklch(${palette.light.sidebarRing});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.dark {
|
|
152
|
-
--background: oklch(${palette.dark.background});
|
|
153
|
-
--foreground: oklch(${palette.dark.foreground});
|
|
154
|
-
--card: oklch(${palette.dark.card});
|
|
155
|
-
--card-foreground: oklch(${palette.dark.cardForeground});
|
|
156
|
-
--popover: oklch(${palette.dark.popover});
|
|
157
|
-
--popover-foreground: oklch(${palette.dark.popoverForeground});
|
|
158
|
-
--primary: oklch(${palette.dark.primary});
|
|
159
|
-
--primary-foreground: oklch(${palette.dark.primaryForeground});
|
|
160
|
-
--secondary: oklch(${palette.dark.secondary});
|
|
161
|
-
--secondary-foreground: oklch(${palette.dark.secondaryForeground});
|
|
162
|
-
--muted: oklch(${palette.dark.muted});
|
|
163
|
-
--muted-foreground: oklch(${palette.dark.mutedForeground});
|
|
164
|
-
--accent: oklch(${palette.dark.accent});
|
|
165
|
-
--accent-foreground: oklch(${palette.dark.accentForeground});
|
|
166
|
-
--destructive: oklch(${palette.dark.destructive});
|
|
167
|
-
--destructive-foreground: oklch(${palette.dark.destructiveForeground});
|
|
168
|
-
--border: oklch(${palette.dark.border});
|
|
169
|
-
--input: oklch(${palette.dark.input});
|
|
170
|
-
--ring: oklch(${palette.dark.ring});
|
|
171
|
-
|
|
172
|
-
--chart-1: oklch(${palette.dark.chart1});
|
|
173
|
-
--chart-2: oklch(${palette.dark.chart2});
|
|
174
|
-
--chart-3: oklch(${palette.dark.chart3});
|
|
175
|
-
--chart-4: oklch(${palette.dark.chart4});
|
|
176
|
-
--chart-5: oklch(${palette.dark.chart5});
|
|
177
|
-
|
|
178
|
-
--sidebar: oklch(${palette.dark.sidebar});
|
|
179
|
-
--sidebar-foreground: oklch(${palette.dark.sidebarForeground});
|
|
180
|
-
--sidebar-primary: oklch(${palette.dark.sidebarPrimary});
|
|
181
|
-
--sidebar-primary-foreground: oklch(${palette.dark.sidebarPrimaryForeground});
|
|
182
|
-
--sidebar-accent: oklch(${palette.dark.sidebarAccent});
|
|
183
|
-
--sidebar-accent-foreground: oklch(${palette.dark.sidebarAccentForeground});
|
|
184
|
-
--sidebar-border: oklch(${palette.dark.sidebarBorder});
|
|
185
|
-
--sidebar-ring: oklch(${palette.dark.sidebarRing});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
@theme inline {
|
|
189
|
-
--font-sans: "Geist Variable", sans-serif;
|
|
190
|
-
|
|
191
|
-
/* Animation tokens */
|
|
192
|
-
--animate-shimmer: shimmer 2s infinite;
|
|
193
|
-
--animate-skeleton-wave: skeleton-wave 2s ease-in-out infinite;
|
|
194
|
-
|
|
195
|
-
/* Colors */
|
|
196
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
197
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
198
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
199
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
200
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
201
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
202
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
203
|
-
--color-sidebar: var(--sidebar);
|
|
204
|
-
--color-chart-5: var(--chart-5);
|
|
205
|
-
--color-chart-4: var(--chart-4);
|
|
206
|
-
--color-chart-3: var(--chart-3);
|
|
207
|
-
--color-chart-2: var(--chart-2);
|
|
208
|
-
--color-chart-1: var(--chart-1);
|
|
209
|
-
--color-ring: var(--ring);
|
|
210
|
-
--color-input: var(--input);
|
|
211
|
-
--color-border: var(--border);
|
|
212
|
-
--color-destructive: var(--destructive);
|
|
213
|
-
--color-destructive-foreground: var(--destructive-foreground);
|
|
214
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
215
|
-
--color-accent: var(--accent);
|
|
216
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
217
|
-
--color-muted: var(--muted);
|
|
218
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
219
|
-
--color-secondary: var(--secondary);
|
|
220
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
221
|
-
--color-primary: var(--primary);
|
|
222
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
223
|
-
--color-popover: var(--popover);
|
|
224
|
-
--color-card-foreground: var(--card-foreground);
|
|
225
|
-
--color-card: var(--card);
|
|
226
|
-
--color-foreground: var(--foreground);
|
|
227
|
-
--color-background: var(--background);
|
|
228
|
-
|
|
229
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
230
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
231
|
-
--radius-lg: var(--radius);
|
|
232
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
233
|
-
--radius-2xl: calc(var(--radius) + 8px);
|
|
234
|
-
--radius-3xl: calc(var(--radius) + 12px);
|
|
235
|
-
--radius-4xl: calc(var(--radius) + 16px);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
@layer base {
|
|
239
|
-
* { @apply border-border outline-ring/50; }
|
|
240
|
-
body { @apply font-sans bg-background text-foreground; }
|
|
241
|
-
html { @apply font-sans; }
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
${STATIC_STYLES}
|
|
245
|
-
`;
|
|
246
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
|
|
3
|
-
export async function selectBaseColor(): Promise<string> {
|
|
4
|
-
const { baseColor } = await inquirer.prompt([
|
|
5
|
-
{
|
|
6
|
-
type: "list",
|
|
7
|
-
name: "baseColor",
|
|
8
|
-
message: "Choose base color:",
|
|
9
|
-
choices: [
|
|
10
|
-
{ name: "Slate", value: "slate" },
|
|
11
|
-
{ name: "Gray", value: "gray" },
|
|
12
|
-
{ name: "Zinc", value: "zinc" },
|
|
13
|
-
{ name: "Neutral", value: "neutral" },
|
|
14
|
-
{ name: "Stone", value: "stone" },
|
|
15
|
-
],
|
|
16
|
-
default: "neutral",
|
|
17
|
-
},
|
|
18
|
-
]);
|
|
19
|
-
return baseColor;
|
|
20
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
|
|
3
|
-
export async function selectPrimaryColor(): Promise<string> {
|
|
4
|
-
const { primaryColor } = await inquirer.prompt([
|
|
5
|
-
{
|
|
6
|
-
type: "list",
|
|
7
|
-
name: "primaryColor",
|
|
8
|
-
message: "Choose primary color:",
|
|
9
|
-
choices: [
|
|
10
|
-
{ name: "Blue", value: "blue" },
|
|
11
|
-
{ name: "Green", value: "green" },
|
|
12
|
-
{ name: "Orange", value: "orange" },
|
|
13
|
-
{ name: "Pink", value: "pink" },
|
|
14
|
-
{ name: "Purple", value: "purple" },
|
|
15
|
-
{ name: "Red", value: "red" },
|
|
16
|
-
{ name: "Violet", value: "violet" },
|
|
17
|
-
{ name: "Yellow", value: "yellow" },
|
|
18
|
-
],
|
|
19
|
-
default: "blue",
|
|
20
|
-
},
|
|
21
|
-
]);
|
|
22
|
-
return primaryColor;
|
|
23
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import inquirer from "inquirer";
|
|
2
|
-
import { existsSync } from "fs";
|
|
3
|
-
import { join } from "path";
|
|
4
|
-
|
|
5
|
-
export type ProjectType = "nextjs" | "vite" | "remix" | "gatsby" | "other";
|
|
6
|
-
|
|
7
|
-
export async function detectProjectType(cwd: string): Promise<ProjectType> {
|
|
8
|
-
const files = ["next.config.js", "vite.config.ts", "remix.config.js", "gatsby-config.js"];
|
|
9
|
-
|
|
10
|
-
for (const file of files) {
|
|
11
|
-
if (existsSync(join(cwd, file))) {
|
|
12
|
-
if (file === "next.config.js") return "nextjs";
|
|
13
|
-
if (file === "vite.config.ts") return "vite";
|
|
14
|
-
if (file === "remix.config.js") return "remix";
|
|
15
|
-
if (file === "gatsby-config.js") return "gatsby";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return "other";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function selectProjectType(cwd: string): Promise<ProjectType> {
|
|
23
|
-
const detected = await detectProjectType(cwd);
|
|
24
|
-
|
|
25
|
-
const { projectType } = await inquirer.prompt([
|
|
26
|
-
{
|
|
27
|
-
type: "list",
|
|
28
|
-
name: "projectType",
|
|
29
|
-
message: `Detected: ${detected}. Choose project type:`,
|
|
30
|
-
choices: [
|
|
31
|
-
{ name: "Next.js", value: "nextjs" },
|
|
32
|
-
{ name: "Vite", value: "vite" },
|
|
33
|
-
{ name: "Remix", value: "remix" },
|
|
34
|
-
{ name: "Gatsby", value: "gatsby" },
|
|
35
|
-
{ name: "Other", value: "other" },
|
|
36
|
-
],
|
|
37
|
-
default: detected,
|
|
38
|
-
},
|
|
39
|
-
]);
|
|
40
|
-
|
|
41
|
-
return projectType;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export async function confirmProjectType(
|
|
45
|
-
detected: ProjectType
|
|
46
|
-
): Promise<boolean> {
|
|
47
|
-
const { confirm } = await inquirer.prompt([
|
|
48
|
-
{
|
|
49
|
-
type: "confirm",
|
|
50
|
-
name: "confirm",
|
|
51
|
-
message: `Detected project type: ${detected}. Is this correct?`,
|
|
52
|
-
default: true,
|
|
53
|
-
},
|
|
54
|
-
]);
|
|
55
|
-
return confirm;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export async function inputAlias(
|
|
59
|
-
name: string,
|
|
60
|
-
defaultValue: string
|
|
61
|
-
): Promise<string> {
|
|
62
|
-
const { alias } = await inquirer.prompt([
|
|
63
|
-
{
|
|
64
|
-
type: "input",
|
|
65
|
-
name: "alias",
|
|
66
|
-
message: `Enter ${name} alias:`,
|
|
67
|
-
default: defaultValue,
|
|
68
|
-
},
|
|
69
|
-
]);
|
|
70
|
-
return alias;
|
|
71
|
-
}
|