@quarklab/rad-ui 0.2.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +218 -93
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import { Command } from "commander";
7
7
  import path3 from "path";
8
8
  import fs3 from "fs-extra";
9
9
  import * as p from "@clack/prompts";
10
- import chalk3 from "chalk";
10
+ import chalk2 from "chalk";
11
11
 
12
12
  // src/utils/detect-project.ts
13
13
  import path from "path";
@@ -34,6 +34,76 @@ async function detectPackageManager(cwd) {
34
34
  if (await fs.pathExists(path.resolve(cwd, "yarn.lock"))) return "yarn";
35
35
  return "npm";
36
36
  }
37
+ async function detectTailwindVersion(cwd, cssPath) {
38
+ const pkgPath = path.resolve(cwd, "package.json");
39
+ if (await fs.pathExists(pkgPath)) {
40
+ try {
41
+ const pkg = await fs.readJson(pkgPath);
42
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
43
+ const twVersion = allDeps["tailwindcss"];
44
+ if (twVersion) {
45
+ const cleanVersion = twVersion.replace(/^[\^~>=<]+/, "");
46
+ if (cleanVersion.startsWith("4")) return "v4";
47
+ if (cleanVersion.startsWith("3")) return "v3";
48
+ }
49
+ } catch {
50
+ }
51
+ }
52
+ if (cssPath) {
53
+ const fullCssPath = path.resolve(cwd, cssPath);
54
+ if (await fs.pathExists(fullCssPath)) {
55
+ try {
56
+ const cssContent = await fs.readFile(fullCssPath, "utf-8");
57
+ if (cssContent.includes('@import "tailwindcss"') || cssContent.includes("@import 'tailwindcss'")) {
58
+ return "v4";
59
+ }
60
+ if (cssContent.includes("@tailwind base")) {
61
+ return "v3";
62
+ }
63
+ } catch {
64
+ }
65
+ }
66
+ }
67
+ const configFiles = [
68
+ "tailwind.config.ts",
69
+ "tailwind.config.js",
70
+ "tailwind.config.cjs",
71
+ "tailwind.config.mjs"
72
+ ];
73
+ for (const file of configFiles) {
74
+ if (await fs.pathExists(path.resolve(cwd, file))) {
75
+ return "v3";
76
+ }
77
+ }
78
+ return "v4";
79
+ }
80
+ async function detectSrcDir(cwd) {
81
+ const tsconfigPath = path.resolve(cwd, "tsconfig.json");
82
+ if (await fs.pathExists(tsconfigPath)) {
83
+ try {
84
+ const raw = await fs.readFile(tsconfigPath, "utf-8");
85
+ const cleaned = raw.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
86
+ const tsconfig = JSON.parse(cleaned);
87
+ const paths = tsconfig?.compilerOptions?.paths;
88
+ if (paths) {
89
+ const aliasKey = Object.keys(paths).find(
90
+ (k) => k === "@/*" || k === "~/*"
91
+ );
92
+ if (aliasKey) {
93
+ const aliasTargets = paths[aliasKey];
94
+ if (Array.isArray(aliasTargets) && aliasTargets.length > 0) {
95
+ const target = aliasTargets[0].replace(/^\.\//, "").replace(/\/\*$/, "");
96
+ if (target) return target;
97
+ }
98
+ }
99
+ }
100
+ } catch {
101
+ }
102
+ }
103
+ if (await fs.pathExists(path.resolve(cwd, "src"))) return "src";
104
+ if (await fs.pathExists(path.resolve(cwd, "app"))) return "app";
105
+ return "src";
106
+ }
37
107
  function getDefaultCssPath(projectType) {
38
108
  switch (projectType) {
39
109
  case "nextjs":
@@ -72,7 +142,7 @@ async function readConfig(cwd) {
72
142
  const exists = await fs2.pathExists(configPath);
73
143
  if (!exists) {
74
144
  throw new Error(
75
- `Configuration file not found. Run ${chalk("rad-ui init")} first.`
145
+ `Configuration file not found. Run \`rad-ui init\` first.`
76
146
  );
77
147
  }
78
148
  return fs2.readJson(configPath);
@@ -81,19 +151,19 @@ async function writeConfig(cwd, config) {
81
151
  const configPath = getConfigPath(cwd);
82
152
  await fs2.writeJson(configPath, config, { spaces: 2 });
83
153
  }
84
- function chalk(text2) {
85
- return `\`${text2}\``;
154
+ function resolveAlias(alias, srcDir) {
155
+ return alias.replace(/^@\//, srcDir + "/").replace(/^~\//, srcDir + "/");
86
156
  }
87
157
  function resolveComponentsDir(cwd, config) {
88
- const aliasPath = config.aliases.components.replace(/^@\//, "src/");
89
- return path2.resolve(cwd, aliasPath);
158
+ const relPath = resolveAlias(config.aliases.components, config.srcDir);
159
+ return path2.resolve(cwd, relPath);
90
160
  }
91
161
 
92
162
  // src/registry/themes.ts
93
163
  var themes = [
94
164
  {
95
165
  name: "kahgel",
96
- label: "Kahgel (\u06A9\u0627\u0647\u06AF\u0644) \u2014 Warm Clay",
166
+ label: "Kahgel \u2014 Warm Clay",
97
167
  cssVars: {
98
168
  light: {
99
169
  "--background": "40 20% 98%",
@@ -132,7 +202,7 @@ var themes = [
132
202
  },
133
203
  {
134
204
  name: "firouzeh",
135
- label: "Firouzeh (\u0641\u06CC\u0631\u0648\u0632\u0647) \u2014 Persian Turquoise",
205
+ label: "Firouzeh \u2014 Persian Turquoise",
136
206
  cssVars: {
137
207
  light: {
138
208
  "--background": "180 20% 98%",
@@ -171,7 +241,7 @@ var themes = [
171
241
  },
172
242
  {
173
243
  name: "lajvard",
174
- label: "Lajvard (\u0644\u0627\u062C\u0648\u0631\u062F) \u2014 Lapis Lazuli",
244
+ label: "Lajvard \u2014 Lapis Lazuli",
175
245
  cssVars: {
176
246
  light: {
177
247
  "--background": "225 25% 98%",
@@ -210,7 +280,7 @@ var themes = [
210
280
  },
211
281
  {
212
282
  name: "puste",
213
- label: "Puste (\u067E\u0633\u062A\u0647) \u2014 Pistachio",
283
+ label: "Puste \u2014 Pistachio",
214
284
  cssVars: {
215
285
  light: {
216
286
  "--background": "80 20% 98%",
@@ -249,7 +319,7 @@ var themes = [
249
319
  },
250
320
  {
251
321
  name: "anar",
252
- label: "Anar (\u0627\u0646\u0627\u0631) \u2014 Pomegranate",
322
+ label: "Anar \u2014 Pomegranate",
253
323
  cssVars: {
254
324
  light: {
255
325
  "--background": "0 20% 98%",
@@ -287,7 +357,29 @@ var themes = [
287
357
  }
288
358
  }
289
359
  ];
290
- function generateThemeCSS(theme) {
360
+ var COLOR_VARS = [
361
+ "background",
362
+ "foreground",
363
+ "primary",
364
+ "primary-foreground",
365
+ "secondary",
366
+ "secondary-foreground",
367
+ "destructive",
368
+ "destructive-foreground",
369
+ "card",
370
+ "card-foreground",
371
+ "border",
372
+ "muted",
373
+ "muted-foreground",
374
+ "ring"
375
+ ];
376
+ function generateThemeCSS(theme, tailwindVersion = "v3") {
377
+ if (tailwindVersion === "v4") {
378
+ return generateV4CSS(theme);
379
+ }
380
+ return generateV3CSS(theme);
381
+ }
382
+ function generateV3CSS(theme) {
291
383
  const lightVars = Object.entries(theme.cssVars.light).map(([key, value]) => ` ${key}: ${value};`).join("\n");
292
384
  const darkVars = Object.entries(theme.cssVars.dark).map(([key, value]) => ` ${key}: ${value};`).join("\n");
293
385
  return `@tailwind base;
@@ -314,21 +406,49 @@ ${darkVars}
314
406
  }
315
407
  `;
316
408
  }
409
+ function generateV4CSS(theme) {
410
+ const lightVars = Object.entries(theme.cssVars.light).map(([key, value]) => {
411
+ if (key === "--radius") return ` ${key}: ${value};`;
412
+ return ` ${key}: hsl(${value});`;
413
+ }).join("\n");
414
+ const darkVars = Object.entries(theme.cssVars.dark).map(([key, value]) => {
415
+ if (key === "--radius") return ` ${key}: ${value};`;
416
+ return ` ${key}: hsl(${value});`;
417
+ }).join("\n");
418
+ const themeColorMappings = COLOR_VARS.map((name) => ` --color-${name}: var(--${name});`).join("\n");
419
+ return `@import "tailwindcss";
420
+
421
+ :root {
422
+ ${lightVars}
423
+ }
424
+
425
+ .dark {
426
+ ${darkVars}
427
+ }
428
+
429
+ @theme inline {
430
+ ${themeColorMappings}
431
+ --radius-sm: calc(var(--radius) - 4px);
432
+ --radius-md: calc(var(--radius) - 2px);
433
+ --radius-lg: var(--radius);
434
+ }
435
+ `;
436
+ }
317
437
 
318
438
  // src/utils/logger.ts
319
- import chalk2 from "chalk";
439
+ import chalk from "chalk";
320
440
  var logger = {
321
- info: (msg) => console.log(chalk2.cyan("\u2139"), msg),
322
- success: (msg) => console.log(chalk2.green("\u2713"), msg),
323
- warn: (msg) => console.log(chalk2.yellow("\u26A0"), msg),
324
- error: (msg) => console.log(chalk2.red("\u2717"), msg),
441
+ info: (msg) => console.log(chalk.cyan("\u2139"), msg),
442
+ success: (msg) => console.log(chalk.green("\u2713"), msg),
443
+ warn: (msg) => console.log(chalk.yellow("\u26A0"), msg),
444
+ error: (msg) => console.log(chalk.red("\u2717"), msg),
325
445
  break: () => console.log("")
326
446
  };
327
447
 
328
448
  // src/commands/init.ts
329
449
  async function initCommand(opts) {
330
450
  const cwd = process.cwd();
331
- p.intro(chalk3.bold("Welcome to Rad UI"));
451
+ p.intro(chalk2.bold("Welcome to Rad UI"));
332
452
  if (await configExists(cwd)) {
333
453
  const shouldContinue = await p.confirm({
334
454
  message: "Rad UI is already initialized in this project. Reinitialize?",
@@ -341,53 +461,52 @@ async function initCommand(opts) {
341
461
  }
342
462
  const projectType = await detectProjectType(cwd);
343
463
  const packageManager = await detectPackageManager(cwd);
464
+ const detectedSrcDir = await detectSrcDir(cwd);
465
+ const defaultCssPath = getDefaultCssPath(projectType);
466
+ const tailwindVersion = await detectTailwindVersion(cwd, defaultCssPath);
344
467
  if (projectType !== "unknown") {
345
- p.log.info(`Detected project: ${chalk3.cyan(projectType)}`);
468
+ p.log.info(`Detected project: ${chalk2.cyan(projectType)}`);
346
469
  }
347
- p.log.info(`Package manager: ${chalk3.cyan(packageManager)}`);
470
+ p.log.info(`Package manager: ${chalk2.cyan(packageManager)}`);
471
+ p.log.info(`Tailwind CSS: ${chalk2.cyan(tailwindVersion)}`);
472
+ p.log.info(`Source directory: ${chalk2.cyan(detectedSrcDir + "/")}`);
348
473
  const responses = await p.group(
349
474
  {
350
- platform: () => p.select({
351
- message: "Which platform are you building for?",
352
- options: [
353
- { value: "web", label: "Web", hint: "React + Tailwind CSS" },
354
- {
355
- value: "mobile",
356
- label: "Mobile",
357
- hint: "React Native + NativeWind (coming soon)"
358
- },
359
- { value: "both", label: "Both", hint: "Web + Mobile" }
360
- ],
361
- initialValue: "web"
362
- }),
363
475
  theme: () => p.select({
364
- message: "Choose a theme:",
476
+ message: "Choose a color theme for your project:",
365
477
  options: themes.map((t) => ({
366
478
  value: t.name,
367
479
  label: t.label
368
480
  })),
369
481
  initialValue: "kahgel"
370
482
  }),
483
+ srcDir: () => p.text({
484
+ message: `Base directory that @ resolves to:`,
485
+ placeholder: detectedSrcDir,
486
+ defaultValue: detectedSrcDir
487
+ }),
371
488
  componentsPath: () => p.text({
372
- message: "Where would you like to store components?",
489
+ message: `Where to add UI components (e.g. ${detectedSrcDir}/components/ui):`,
373
490
  placeholder: "@/components/ui",
374
491
  defaultValue: "@/components/ui"
375
492
  }),
376
493
  utilsPath: () => p.text({
377
- message: "Where is your utils file?",
494
+ message: `Where to create the cn() helper (e.g. ${detectedSrcDir}/lib/utils.ts):`,
378
495
  placeholder: "@/lib/utils",
379
496
  defaultValue: "@/lib/utils"
380
497
  }),
381
498
  cssPath: () => p.text({
382
- message: "Where is your global CSS file?",
383
- placeholder: getDefaultCssPath(projectType),
384
- defaultValue: getDefaultCssPath(projectType)
499
+ message: `Path to your global CSS file:`,
500
+ placeholder: defaultCssPath,
501
+ defaultValue: defaultCssPath
385
502
  }),
386
- tailwindConfig: () => p.text({
387
- message: "Where is your Tailwind config file?",
388
- placeholder: getDefaultTailwindConfig(projectType),
389
- defaultValue: getDefaultTailwindConfig(projectType)
390
- })
503
+ ...tailwindVersion === "v3" ? {
504
+ tailwindConfig: () => p.text({
505
+ message: `Path to your Tailwind config file:`,
506
+ placeholder: getDefaultTailwindConfig(projectType),
507
+ defaultValue: getDefaultTailwindConfig(projectType)
508
+ })
509
+ } : {}
391
510
  },
392
511
  {
393
512
  onCancel: () => {
@@ -396,15 +515,18 @@ async function initCommand(opts) {
396
515
  }
397
516
  }
398
517
  );
518
+ const srcDir = responses.srcDir || detectedSrcDir;
399
519
  const s = p.spinner();
400
520
  s.start("Creating configuration...");
401
521
  const config = {
402
522
  $schema: "https://www.quarklab.dev/schema.json",
403
523
  registry: "https://www.quarklab.dev/r",
404
- platform: responses.platform,
524
+ tailwindVersion,
525
+ srcDir,
526
+ platform: "web",
405
527
  theme: responses.theme,
406
528
  tailwind: {
407
- config: responses.tailwindConfig,
529
+ ...tailwindVersion === "v3" && responses.tailwindConfig ? { config: responses.tailwindConfig } : {},
408
530
  css: responses.cssPath
409
531
  },
410
532
  aliases: {
@@ -420,13 +542,13 @@ async function initCommand(opts) {
420
542
  const cssPath = path3.resolve(cwd, config.tailwind.css);
421
543
  const cssDir = path3.dirname(cssPath);
422
544
  await fs3.ensureDir(cssDir);
423
- const cssContent = generateThemeCSS(selectedTheme);
545
+ const cssContent = generateThemeCSS(selectedTheme, tailwindVersion);
424
546
  await fs3.writeFile(cssPath, cssContent, "utf-8");
425
547
  }
426
548
  s.stop("Theme configured.");
427
549
  s.start("Setting up utilities...");
428
550
  const utilsAlias = config.aliases.utils;
429
- const utilsRelPath = utilsAlias.replace(/^@\//, "src/") + ".ts";
551
+ const utilsRelPath = utilsAlias.replace(/^@\//, srcDir + "/").replace(/^~\//, srcDir + "/") + ".ts";
430
552
  const utilsDestPath = path3.resolve(cwd, utilsRelPath);
431
553
  const utilsDir = path3.dirname(utilsDestPath);
432
554
  await fs3.ensureDir(utilsDir);
@@ -439,29 +561,30 @@ export function cn(...inputs: ClassValue[]) {
439
561
  `;
440
562
  await fs3.writeFile(utilsDestPath, utilsContent, "utf-8");
441
563
  s.stop("Utilities ready.");
442
- s.start("Configuring Tailwind CSS...");
443
- const tailwindConfigPath = path3.resolve(cwd, config.tailwind.config);
444
- const componentsRelPath = config.aliases.components.replace(/^@\//, "src/");
445
- if (await fs3.pathExists(tailwindConfigPath)) {
446
- let tailwindContent = await fs3.readFile(tailwindConfigPath, "utf-8");
447
- const contentPath = `./${componentsRelPath}/**/*.{ts,tsx}`;
448
- if (!tailwindContent.includes(contentPath)) {
449
- tailwindContent = tailwindContent.replace(
450
- /(content\s*:\s*\[)/,
451
- `$1
564
+ if (tailwindVersion === "v3" && config.tailwind.config) {
565
+ s.start("Configuring Tailwind CSS...");
566
+ const tailwindConfigPath = path3.resolve(cwd, config.tailwind.config);
567
+ const componentsRelPath = config.aliases.components.replace(/^@\//, srcDir + "/").replace(/^~\//, srcDir + "/");
568
+ if (await fs3.pathExists(tailwindConfigPath)) {
569
+ let tailwindContent = await fs3.readFile(tailwindConfigPath, "utf-8");
570
+ const contentPath = `./${componentsRelPath}/**/*.{ts,tsx}`;
571
+ if (!tailwindContent.includes(contentPath)) {
572
+ tailwindContent = tailwindContent.replace(
573
+ /(content\s*:\s*\[)/,
574
+ `$1
452
575
  "${contentPath}",`
453
- );
454
- await fs3.writeFile(tailwindConfigPath, tailwindContent, "utf-8");
455
- p.log.info(`Added component path to ${config.tailwind.config}`);
456
- }
457
- } else {
458
- const isTS = config.tailwind.config.endsWith(".ts");
459
- const newConfig = isTS ? `import type { Config } from "tailwindcss";
576
+ );
577
+ await fs3.writeFile(tailwindConfigPath, tailwindContent, "utf-8");
578
+ p.log.info(`Added component path to ${config.tailwind.config}`);
579
+ }
580
+ } else {
581
+ const isTS = config.tailwind.config.endsWith(".ts");
582
+ const newConfig = isTS ? `import type { Config } from "tailwindcss";
460
583
 
461
584
  const config: Config = {
462
585
  darkMode: ["class"],
463
586
  content: [
464
- "./src/**/*.{js,ts,jsx,tsx,mdx}",
587
+ "./${srcDir}/**/*.{js,ts,jsx,tsx,mdx}",
465
588
  "./${componentsRelPath}/**/*.{ts,tsx}",
466
589
  ],
467
590
  theme: {
@@ -516,7 +639,7 @@ export default config;
516
639
  module.exports = {
517
640
  darkMode: ["class"],
518
641
  content: [
519
- "./src/**/*.{js,ts,jsx,tsx,mdx}",
642
+ "./${srcDir}/**/*.{js,ts,jsx,tsx,mdx}",
520
643
  "./${componentsRelPath}/**/*.{ts,tsx}",
521
644
  ],
522
645
  theme: {
@@ -566,16 +689,17 @@ module.exports = {
566
689
  plugins: [],
567
690
  };
568
691
  `;
569
- await fs3.writeFile(tailwindConfigPath, newConfig, "utf-8");
692
+ await fs3.writeFile(tailwindConfigPath, newConfig, "utf-8");
693
+ }
694
+ s.stop("Tailwind CSS configured.");
695
+ } else {
696
+ p.log.info(
697
+ `Tailwind v4 detected \u2014 theme variables added directly to ${chalk2.cyan(config.tailwind.css)}`
698
+ );
570
699
  }
571
- s.stop("Tailwind CSS configured.");
572
700
  s.start("Installing base dependencies...");
573
- const installCmd = getInstallCommand(packageManager, [
574
- "tailwindcss",
575
- "clsx",
576
- "tailwind-merge",
577
- "class-variance-authority"
578
- ]);
701
+ const baseDeps = ["clsx", "tailwind-merge", "class-variance-authority"];
702
+ const installCmd = getInstallCommand(packageManager, baseDeps);
579
703
  try {
580
704
  const { execa } = await import("execa");
581
705
  await execa(installCmd.command, installCmd.args, {
@@ -586,20 +710,21 @@ module.exports = {
586
710
  } catch {
587
711
  s.stop("Could not auto-install dependencies.");
588
712
  p.log.warn(
589
- `Please manually install: ${chalk3.cyan("tailwindcss clsx tailwind-merge class-variance-authority")}`
713
+ `Please manually install: ${chalk2.cyan(baseDeps.join(" "))}`
590
714
  );
591
715
  }
592
716
  logger.break();
593
717
  p.note(
594
718
  [
595
- `${chalk3.green("Rad UI has been initialized!")}`,
719
+ `${chalk2.green("Rad UI has been initialized!")}`,
596
720
  "",
597
- `Add components with: ${chalk3.cyan("npx @quarklab/rad-ui add <component>")}`,
598
- `Add all components: ${chalk3.cyan("npx @quarklab/rad-ui add --all")}`,
721
+ `Add components with: ${chalk2.cyan("npx @quarklab/rad-ui add <component>")}`,
722
+ `Add all components: ${chalk2.cyan("npx @quarklab/rad-ui add --all")}`,
599
723
  "",
600
- `Theme: ${chalk3.cyan(selectedTheme?.label || config.theme)}`,
601
- `Components: ${chalk3.cyan(config.aliases.components)}`,
602
- `Utils: ${chalk3.cyan(config.aliases.utils)}`
724
+ `Theme: ${chalk2.cyan(selectedTheme?.label || config.theme)}`,
725
+ `Tailwind: ${chalk2.cyan(tailwindVersion)}`,
726
+ `Components: ${chalk2.cyan(config.aliases.components)} \u2192 ${chalk2.dim(srcDir + "/" + config.aliases.components.replace(/^@\//, "").replace(/^~\//, ""))}`,
727
+ `Utils: ${chalk2.cyan(config.aliases.utils)} \u2192 ${chalk2.dim(srcDir + "/" + config.aliases.utils.replace(/^@\//, "").replace(/^~\//, "") + ".ts")}`
603
728
  ].join("\n"),
604
729
  "Next steps"
605
730
  );
@@ -623,7 +748,7 @@ import path4 from "path";
623
748
  import { fileURLToPath } from "url";
624
749
  import fs4 from "fs-extra";
625
750
  import * as p2 from "@clack/prompts";
626
- import chalk4 from "chalk";
751
+ import chalk3 from "chalk";
627
752
 
628
753
  // src/registry/index.ts
629
754
  var components = [
@@ -956,10 +1081,10 @@ async function getComponentContent(name, config) {
956
1081
  }
957
1082
  async function addCommand(componentNames, opts) {
958
1083
  const cwd = process.cwd();
959
- p2.intro(chalk4.bold("Add Rad UI Components"));
1084
+ p2.intro(chalk3.bold("Add Rad UI Components"));
960
1085
  if (!await configExists(cwd)) {
961
1086
  p2.log.error(
962
- `Configuration not found. Run ${chalk4.cyan("npx @quarklab/rad-ui init")} first.`
1087
+ `Configuration not found. Run ${chalk3.cyan("npx @quarklab/rad-ui init")} first.`
963
1088
  );
964
1089
  process.exit(1);
965
1090
  }
@@ -987,10 +1112,10 @@ async function addCommand(componentNames, opts) {
987
1112
  const invalid = componentNames.filter((n) => !availableNames.includes(n));
988
1113
  if (invalid.length > 0) {
989
1114
  p2.log.error(
990
- `Unknown component(s): ${invalid.map((n) => chalk4.red(n)).join(", ")}`
1115
+ `Unknown component(s): ${invalid.map((n) => chalk3.red(n)).join(", ")}`
991
1116
  );
992
1117
  p2.log.info(
993
- `Available: ${availableNames.map((n) => chalk4.cyan(n)).join(", ")}`
1118
+ `Available: ${availableNames.map((n) => chalk3.cyan(n)).join(", ")}`
994
1119
  );
995
1120
  process.exit(1);
996
1121
  }
@@ -1015,7 +1140,7 @@ async function addCommand(componentNames, opts) {
1015
1140
  const extraDeps = allNames.filter((n) => !selectedNames.includes(n));
1016
1141
  if (extraDeps.length > 0) {
1017
1142
  p2.log.info(
1018
- `Also adding dependencies: ${extraDeps.map((n) => chalk4.cyan(n)).join(", ")}`
1143
+ `Also adding dependencies: ${extraDeps.map((n) => chalk3.cyan(n)).join(", ")}`
1019
1144
  );
1020
1145
  }
1021
1146
  const componentsDir = opts.path ? path4.resolve(cwd, opts.path) : resolveComponentsDir(cwd, config);
@@ -1034,7 +1159,7 @@ async function addCommand(componentNames, opts) {
1034
1159
  }
1035
1160
  if (existing.length > 0) {
1036
1161
  const shouldOverwrite = await p2.confirm({
1037
- message: `The following components already exist: ${existing.map((n) => chalk4.yellow(n)).join(", ")}. Overwrite?`,
1162
+ message: `The following components already exist: ${existing.map((n) => chalk3.yellow(n)).join(", ")}. Overwrite?`,
1038
1163
  initialValue: false
1039
1164
  });
1040
1165
  if (p2.isCancel(shouldOverwrite) || !shouldOverwrite) {
@@ -1098,19 +1223,19 @@ async function addCommand(componentNames, opts) {
1098
1223
  s.stop("Could not auto-install dependencies.");
1099
1224
  p2.log.warn(
1100
1225
  `Please manually install:
1101
- ${chalk4.cyan(depsToInstall.join(" "))}`
1226
+ ${chalk3.cyan(depsToInstall.join(" "))}`
1102
1227
  );
1103
1228
  }
1104
1229
  }
1105
1230
  logger.break();
1106
1231
  p2.note(
1107
1232
  [
1108
- `Components added to ${chalk4.cyan(componentsDir.replace(cwd + "/", ""))}:`,
1233
+ `Components added to ${chalk3.cyan(componentsDir.replace(cwd + "/", ""))}:`,
1109
1234
  "",
1110
- ...allNames.map((n) => ` ${chalk4.green("+")} ${n}`),
1235
+ ...allNames.map((n) => ` ${chalk3.green("+")} ${n}`),
1111
1236
  "",
1112
1237
  "Import example:",
1113
- chalk4.gray(
1238
+ chalk3.gray(
1114
1239
  ` import { Button } from "${config.aliases.components}/button";`
1115
1240
  )
1116
1241
  ].join("\n"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quarklab/rad-ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A CLI for adding Rad UI components to your project. Beautiful Persian-themed React components built on Radix UI and Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",