@bison-lab/create-theme 0.1.0 → 0.2.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/index.mjs CHANGED
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import * as p from "@clack/prompts";
3
3
  import pc from "picocolors";
4
+ import { execSync } from "child_process";
4
5
  import { existsSync, readFileSync, writeFileSync } from "fs";
5
- import { resolve } from "path";
6
+ import { join, resolve } from "path";
7
+ import { GREY_SCALES, hexToHSL, hslToString } from "@bison-lab/tokens";
6
8
  //#region src/preview.ts
7
9
  function hexToRgb(hex) {
8
10
  hex = hex.replace("#", "");
@@ -23,7 +25,7 @@ function isValidHex(hex) {
23
25
  }
24
26
  async function runPrompts(existing) {
25
27
  p.log.info(pc.bold("Brand Colors"));
26
- if (existing) p.log.message(`Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)}`);
28
+ if (existing) p.log.message(`Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)} Highlight ${previewHexColor(existing.brandHighlight)}`);
27
29
  const brandPrimary = await p.text({
28
30
  message: "Primary brand color (hex)",
29
31
  placeholder: "#1e3a5f",
@@ -41,13 +43,54 @@ async function runPrompts(existing) {
41
43
  if (p.isCancel(brandSecondary)) return null;
42
44
  p.log.message(` ${previewHexColor(brandSecondary)} Secondary`);
43
45
  const brandAccent = await p.text({
44
- message: "Accent brand color (hex)",
46
+ message: "Accent color (hex)",
45
47
  placeholder: "#e89b20",
46
48
  ...existing?.brandAccent && { defaultValue: existing.brandAccent },
47
49
  validate: (v) => !isValidHex(v) ? "Enter a valid hex color (e.g. #e89b20)" : void 0
48
50
  });
49
51
  if (p.isCancel(brandAccent)) return null;
50
52
  p.log.message(` ${previewHexColor(brandAccent)} Accent`);
53
+ const brandHighlight = await p.text({
54
+ message: "Highlight color (hex)",
55
+ placeholder: "#7c3aed",
56
+ ...existing?.brandHighlight && { defaultValue: existing.brandHighlight },
57
+ validate: (v) => !isValidHex(v) ? "Enter a valid hex color (e.g. #7c3aed)" : void 0
58
+ });
59
+ if (p.isCancel(brandHighlight)) return null;
60
+ p.log.message(` ${previewHexColor(brandHighlight)} Highlight`);
61
+ p.log.info(pc.bold("Grey Scale"));
62
+ const greyScale = await p.select({
63
+ message: "Grey palette for borders, text, backgrounds",
64
+ initialValue: existing?.greyScale ?? "slate",
65
+ options: [
66
+ {
67
+ value: "slate",
68
+ label: "Slate",
69
+ hint: "Cool blue-grey — modern, tech-forward"
70
+ },
71
+ {
72
+ value: "gray",
73
+ label: "Gray",
74
+ hint: "Balanced blue-grey — neutral default"
75
+ },
76
+ {
77
+ value: "zinc",
78
+ label: "Zinc",
79
+ hint: "Cool desaturated — minimal, sharp"
80
+ },
81
+ {
82
+ value: "neutral",
83
+ label: "Neutral",
84
+ hint: "Pure grey — zero hue bias"
85
+ },
86
+ {
87
+ value: "stone",
88
+ label: "Stone",
89
+ hint: "Warm earthy grey — organic, approachable"
90
+ }
91
+ ]
92
+ });
93
+ if (p.isCancel(greyScale)) return null;
51
94
  const radius = await p.select({
52
95
  message: "Border radius preset",
53
96
  initialValue: existing?.radius ?? "rounded",
@@ -195,6 +238,8 @@ async function runPrompts(existing) {
195
238
  brandPrimary,
196
239
  brandSecondary,
197
240
  brandAccent,
241
+ brandHighlight,
242
+ greyScale,
198
243
  radius,
199
244
  shadow,
200
245
  motion,
@@ -205,102 +250,97 @@ async function runPrompts(existing) {
205
250
  }
206
251
  //#endregion
207
252
  //#region src/generate.ts
208
- function hexToHSL(hex) {
209
- hex = hex.replace("#", "");
210
- const r = parseInt(hex.substring(0, 2), 16) / 255;
211
- const g = parseInt(hex.substring(2, 4), 16) / 255;
212
- const b = parseInt(hex.substring(4, 6), 16) / 255;
213
- const max = Math.max(r, g, b);
214
- const min = Math.min(r, g, b);
215
- const l = (max + min) / 2;
216
- let h = 0;
217
- let s = 0;
218
- if (max !== min) {
219
- const d = max - min;
220
- s = l > .5 ? d / (2 - max - min) : d / (max + min);
221
- switch (max) {
222
- case r:
223
- h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
224
- break;
225
- case g:
226
- h = ((b - r) / d + 2) / 6;
227
- break;
228
- case b:
229
- h = ((r - g) / d + 4) / 6;
230
- break;
231
- }
232
- }
233
- return {
234
- h: Math.round(h * 360),
235
- s: Math.round(s * 100),
236
- l: Math.round(l * 100)
237
- };
238
- }
239
- function hsl(h, s, l) {
240
- return `${h} ${s}% ${l}%`;
241
- }
242
253
  function clamp(v, min, max) {
243
254
  return Math.min(Math.max(v, min), max);
244
255
  }
245
- function deriveLight(primary, secondary, accent) {
256
+ function contrastForeground(color) {
257
+ return color.l > 55 ? hslToString({
258
+ h: color.h,
259
+ s: clamp(color.s - 20, 0, 100),
260
+ l: 10
261
+ }) : hslToString({
262
+ h: color.h,
263
+ s: clamp(color.s - 25, 0, 100),
264
+ l: 98
265
+ });
266
+ }
267
+ function boostForDark(color) {
268
+ if (color.l < 40) return {
269
+ ...color,
270
+ l: clamp(color.l + 25, 0, 100)
271
+ };
272
+ return color;
273
+ }
274
+ function deriveLight(primary, secondary, accent, highlight, grey) {
246
275
  return {
247
- background: hsl(primary.h, clamp(primary.s - 30, 0, 100), 100),
248
- foreground: hsl(primary.h, clamp(primary.s - 20, 0, 100), 10),
249
- card: hsl(primary.h, clamp(primary.s - 30, 0, 100), 100),
250
- "card-foreground": hsl(primary.h, clamp(primary.s - 20, 0, 100), 10),
251
- popover: hsl(primary.h, clamp(primary.s - 30, 0, 100), 100),
252
- "popover-foreground": hsl(primary.h, clamp(primary.s - 20, 0, 100), 10),
253
- primary: hsl(primary.h, primary.s, primary.l),
254
- "primary-foreground": hsl(primary.h, clamp(primary.s - 30, 0, 100), primary.l > 50 ? 10 : 98),
255
- secondary: hsl(secondary.h, clamp(secondary.s - 30, 0, 100), clamp(secondary.l + 40, 0, 100)),
256
- "secondary-foreground": hsl(secondary.h, secondary.s, clamp(secondary.l - 30, 0, 100)),
257
- accent: hsl(accent.h, accent.s, clamp(accent.l + 10, 0, 100)),
258
- "accent-foreground": hsl(accent.h, accent.s, clamp(accent.l - 60, 0, 100)),
259
- muted: hsl(primary.h, clamp(primary.s - 30, 0, 100), 96),
260
- "muted-foreground": hsl(primary.h, clamp(primary.s - 25, 0, 100), 45),
276
+ background: grey["50"],
277
+ foreground: grey["950"],
278
+ card: grey["50"],
279
+ "card-foreground": grey["950"],
280
+ popover: grey["50"],
281
+ "popover-foreground": grey["950"],
282
+ primary: hslToString(primary),
283
+ "primary-foreground": contrastForeground(primary),
284
+ secondary: hslToString(secondary),
285
+ "secondary-foreground": contrastForeground(secondary),
286
+ accent: grey["100"],
287
+ "accent-foreground": grey["950"],
288
+ "brand-accent": hslToString(accent),
289
+ "brand-accent-foreground": contrastForeground(accent),
290
+ highlight: hslToString(highlight),
291
+ "highlight-foreground": contrastForeground(highlight),
292
+ muted: grey["100"],
293
+ "muted-foreground": grey["500"],
261
294
  destructive: "0 84% 60%",
262
295
  "destructive-foreground": "0 0% 98%",
263
- border: hsl(primary.h, clamp(primary.s - 25, 0, 100), 91),
264
- input: hsl(primary.h, clamp(primary.s - 25, 0, 100), 91),
265
- ring: hsl(primary.h, primary.s, primary.l)
296
+ border: grey["200"],
297
+ input: grey["200"],
298
+ ring: hslToString(primary)
266
299
  };
267
300
  }
268
- function deriveDark(primary, secondary, accent) {
269
- const darkPrimary = {
270
- ...primary,
271
- l: primary.l < 50 ? primary.l + 20 : primary.l
272
- };
301
+ function deriveDark(primary, secondary, accent, highlight, grey) {
302
+ const dp = boostForDark(primary);
303
+ const ds = boostForDark(secondary);
304
+ const da = boostForDark(accent);
305
+ const dh = boostForDark(highlight);
273
306
  return {
274
- background: hsl(primary.h, clamp(primary.s - 25, 0, 100), 7),
275
- foreground: hsl(primary.h, clamp(primary.s - 30, 0, 100), 98),
276
- card: hsl(primary.h, clamp(primary.s - 25, 0, 100), 10),
277
- "card-foreground": hsl(primary.h, clamp(primary.s - 30, 0, 100), 98),
278
- popover: hsl(primary.h, clamp(primary.s - 25, 0, 100), 10),
279
- "popover-foreground": hsl(primary.h, clamp(primary.s - 30, 0, 100), 98),
280
- primary: hsl(darkPrimary.h, darkPrimary.s, darkPrimary.l),
281
- "primary-foreground": hsl(primary.h, clamp(primary.s - 30, 0, 100), darkPrimary.l > 50 ? 10 : 98),
282
- secondary: hsl(secondary.h, clamp(secondary.s - 20, 0, 100), 18),
283
- "secondary-foreground": hsl(secondary.h, secondary.s, clamp(secondary.l + 30, 0, 100)),
284
- accent: hsl(accent.h, clamp(accent.s - 10, 0, 100), 20),
285
- "accent-foreground": hsl(accent.h, accent.s, clamp(accent.l + 40, 0, 100)),
286
- muted: hsl(primary.h, clamp(primary.s - 25, 0, 100), 18),
287
- "muted-foreground": hsl(primary.h, clamp(primary.s - 20, 0, 100), 65),
307
+ background: grey["950"],
308
+ foreground: grey["50"],
309
+ card: grey["900"],
310
+ "card-foreground": grey["50"],
311
+ popover: grey["900"],
312
+ "popover-foreground": grey["50"],
313
+ primary: hslToString(dp),
314
+ "primary-foreground": contrastForeground(dp),
315
+ secondary: hslToString(ds),
316
+ "secondary-foreground": contrastForeground(ds),
317
+ accent: grey["800"],
318
+ "accent-foreground": grey["50"],
319
+ "brand-accent": hslToString(da),
320
+ "brand-accent-foreground": contrastForeground(da),
321
+ highlight: hslToString(dh),
322
+ "highlight-foreground": contrastForeground(dh),
323
+ muted: grey["800"],
324
+ "muted-foreground": grey["400"],
288
325
  destructive: "0 62% 30%",
289
326
  "destructive-foreground": "0 0% 98%",
290
- border: hsl(primary.h, clamp(primary.s - 25, 0, 100), 18),
291
- input: hsl(primary.h, clamp(primary.s - 25, 0, 100), 18),
292
- ring: hsl(darkPrimary.h, darkPrimary.s, darkPrimary.l)
327
+ border: grey["800"],
328
+ input: grey["800"],
329
+ ring: hslToString(dp)
293
330
  };
294
331
  }
295
332
  function generateThemeCSS(config) {
296
333
  const primary = hexToHSL(config.brandPrimary);
297
334
  const secondary = hexToHSL(config.brandSecondary);
298
335
  const accent = hexToHSL(config.brandAccent);
299
- const light = deriveLight(primary, secondary, accent);
300
- const dark = deriveDark(primary, secondary, accent);
336
+ const highlight = hexToHSL(config.brandHighlight);
337
+ const grey = GREY_SCALES[config.greyScale];
338
+ const light = deriveLight(primary, secondary, accent, highlight, grey);
339
+ const dark = deriveDark(primary, secondary, accent, highlight, grey);
301
340
  return [
302
341
  `/* Bison Lab Theme — Generated by @bison-lab/create-theme */`,
303
- `/* Brand: ${config.brandPrimary} / ${config.brandSecondary} / ${config.brandAccent} */`,
342
+ `/* Brand: ${config.brandPrimary} / ${config.brandSecondary} / ${config.brandAccent} / ${config.brandHighlight} */`,
343
+ `/* Grey: ${config.greyScale} */`,
304
344
  ``,
305
345
  `:root {`,
306
346
  ...Object.entries(light).map(([k, v]) => ` --${k}: ${v};`),
@@ -333,8 +373,87 @@ function generateTailwindConfig(config) {
333
373
  `};`
334
374
  ].join("\n");
335
375
  }
376
+ function generateImports(config, themeFile) {
377
+ return [
378
+ `import '@bison-lab/tokens/css/globals.css';`,
379
+ `import '@bison-lab/tokens/css/themes/radius-${config.radius}.css';`,
380
+ `import '@bison-lab/tokens/css/themes/shadow-${config.shadow}.css';`,
381
+ `import '@bison-lab/tokens/css/themes/motion-${config.motion}.css';`,
382
+ `import '@bison-lab/tokens/css/themes/density-${config.density}.css';`,
383
+ `import './${themeFile}';`
384
+ ].join("\n");
385
+ }
336
386
  //#endregion
337
387
  //#region src/index.ts
388
+ const BISON_PACKAGES = [
389
+ "@bison-lab/tokens",
390
+ "@bison-lab/ui",
391
+ "@bison-lab/tailwind-preset"
392
+ ];
393
+ function copyToClipboard(text) {
394
+ try {
395
+ const platform = process.platform;
396
+ if (platform === "darwin") execSync("pbcopy", { input: text });
397
+ else if (platform === "linux") execSync("xclip -selection clipboard", { input: text });
398
+ else if (platform === "win32") execSync("clip", { input: text });
399
+ else return false;
400
+ return true;
401
+ } catch {
402
+ return false;
403
+ }
404
+ }
405
+ function detectPackageManager() {
406
+ const cwd = process.cwd();
407
+ if (existsSync(join(cwd, "pnpm-lock.yaml"))) return "pnpm";
408
+ if (existsSync(join(cwd, "bun.lockb")) || existsSync(join(cwd, "bun.lock"))) return "bun";
409
+ if (existsSync(join(cwd, "yarn.lock"))) return "yarn";
410
+ return "npm";
411
+ }
412
+ function installCommand(pm) {
413
+ const pkgs = BISON_PACKAGES.join(" ");
414
+ switch (pm) {
415
+ case "pnpm": return `pnpm add ${pkgs}`;
416
+ case "yarn": return `yarn add ${pkgs}`;
417
+ case "bun": return `bun add ${pkgs}`;
418
+ default: return `npm install ${pkgs}`;
419
+ }
420
+ }
421
+ function areBisonPackagesInstalled() {
422
+ return BISON_PACKAGES.every((pkg) => {
423
+ try {
424
+ return existsSync(join(process.cwd(), "node_modules", pkg, "package.json"));
425
+ } catch {
426
+ return false;
427
+ }
428
+ });
429
+ }
430
+ function findLayoutFile() {
431
+ for (const candidate of [
432
+ "app/layout.tsx",
433
+ "app/layout.jsx",
434
+ "src/app/layout.tsx",
435
+ "src/app/layout.jsx"
436
+ ]) {
437
+ const full = resolve(process.cwd(), candidate);
438
+ if (existsSync(full)) return full;
439
+ }
440
+ return null;
441
+ }
442
+ function injectImportsIntoLayout(layoutPath, imports) {
443
+ const content = readFileSync(layoutPath, "utf-8");
444
+ if (content.includes("@bison-lab/tokens/css/globals.css")) return false;
445
+ const importRegex = /^import\s[\s\S]*?from\s+['"][^'"]+['"];?\s*$/gm;
446
+ let lastMatchEnd = -1;
447
+ let match;
448
+ while ((match = importRegex.exec(content)) !== null) lastMatchEnd = match.index + match[0].length;
449
+ if (lastMatchEnd === -1) writeFileSync(layoutPath, imports + "\n\n" + content, "utf-8");
450
+ else {
451
+ const before = content.slice(0, lastMatchEnd);
452
+ const after = content.slice(lastMatchEnd);
453
+ writeFileSync(layoutPath, before + "\n\n" + imports + after, "utf-8");
454
+ }
455
+ return true;
456
+ }
338
457
  const CONFIG_FILE = "bison.config.json";
339
458
  const THEME_FILE = "bison-theme.css";
340
459
  async function main() {
@@ -366,30 +485,99 @@ async function main() {
366
485
  p.cancel("Cancelled.");
367
486
  process.exit(0);
368
487
  }
488
+ if (!areBisonPackagesInstalled()) {
489
+ const pm = detectPackageManager();
490
+ const cmd = installCommand(pm);
491
+ const shouldInstall = await p.confirm({
492
+ message: `Install Bison Lab packages? (${pc.dim(cmd)})`,
493
+ initialValue: true
494
+ });
495
+ if (p.isCancel(shouldInstall)) {
496
+ p.cancel("Cancelled.");
497
+ process.exit(0);
498
+ }
499
+ if (shouldInstall) {
500
+ const s = p.spinner();
501
+ s.start(`Installing packages with ${pm}...`);
502
+ try {
503
+ execSync(cmd, {
504
+ cwd: process.cwd(),
505
+ stdio: "pipe"
506
+ });
507
+ s.stop("Packages installed!");
508
+ } catch (err) {
509
+ s.stop("Package installation failed.");
510
+ p.log.warning(`Run manually: ${pc.cyan(cmd)}`);
511
+ }
512
+ } else p.log.warning(`Skipped. Run manually: ${pc.cyan(installCommand(pm))}`);
513
+ } else p.log.success("Bison Lab packages already installed.");
369
514
  const s = p.spinner();
370
515
  s.start("Generating theme files...");
371
516
  const themeCSS = generateThemeCSS(config);
372
517
  writeFileSync(resolve(process.cwd(), THEME_FILE), themeCSS, "utf-8");
373
518
  writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
374
- const tailwindSnippet = generateTailwindConfig(config);
375
519
  s.stop("Theme files generated!");
376
- p.note([
377
- `${pc.green("Created:")} ${THEME_FILE}`,
378
- `${pc.green("Created:")} ${CONFIG_FILE}`,
379
- "",
380
- `${pc.bold("Add to your tailwind.config.ts:")}`,
381
- "",
382
- tailwindSnippet,
383
- "",
384
- `${pc.bold("Import in your app/layout.tsx:")}`,
385
- "",
386
- `import '@bison-lab/tokens/css/globals.css';`,
387
- `import '@bison-lab/tokens/css/themes/radius-${config.radius}.css';`,
388
- `import '@bison-lab/tokens/css/themes/shadow-${config.shadow}.css';`,
389
- `import '@bison-lab/tokens/css/themes/motion-${config.motion}.css';`,
390
- `import '@bison-lab/tokens/css/themes/density-${config.density}.css';`,
391
- `import './${THEME_FILE}';`
392
- ].join("\n"), "Next steps");
520
+ p.log.success(`${pc.green("Created:")} ${THEME_FILE}`);
521
+ p.log.success(`${pc.green("Created:")} ${CONFIG_FILE}`);
522
+ const tailwindSnippet = generateTailwindConfig(config);
523
+ const tailwindPath = resolve(process.cwd(), "tailwind.config.ts");
524
+ if (!existsSync(tailwindPath)) {
525
+ writeFileSync(tailwindPath, tailwindSnippet, "utf-8");
526
+ p.log.success(`${pc.green("Created:")} tailwind.config.ts`);
527
+ } else if (readFileSync(tailwindPath, "utf-8").includes("@bison-lab/tailwind-preset")) p.log.success("tailwind.config.ts already includes Bison Lab preset.");
528
+ else {
529
+ p.note(tailwindSnippet, "tailwind.config.ts");
530
+ const action = await p.select({
531
+ message: "tailwind.config.ts already exists. How should we handle it?",
532
+ options: [
533
+ {
534
+ value: "overwrite",
535
+ label: "Overwrite",
536
+ hint: "Replace with Bison Lab config"
537
+ },
538
+ {
539
+ value: "copy",
540
+ label: "Copy to clipboard",
541
+ hint: "Paste manually"
542
+ },
543
+ {
544
+ value: "skip",
545
+ label: "Skip",
546
+ hint: "I'll handle it"
547
+ }
548
+ ]
549
+ });
550
+ if (p.isCancel(action)) {
551
+ p.cancel("Cancelled.");
552
+ process.exit(0);
553
+ }
554
+ if (action === "overwrite") {
555
+ writeFileSync(tailwindPath, tailwindSnippet, "utf-8");
556
+ p.log.success("tailwind.config.ts overwritten.");
557
+ } else if (action === "copy") if (copyToClipboard(tailwindSnippet)) p.log.success("Copied tailwind config to clipboard!");
558
+ else p.log.warning("Could not access clipboard — copy manually from above.");
559
+ }
560
+ const importsSnippet = generateImports(config, THEME_FILE);
561
+ const layoutPath = findLayoutFile();
562
+ if (layoutPath) if (injectImportsIntoLayout(layoutPath, importsSnippet)) {
563
+ const relative = layoutPath.replace(process.cwd() + "/", "");
564
+ p.log.success(`${pc.green("Updated:")} ${relative} with Bison Lab imports.`);
565
+ } else p.log.success("Layout file already includes Bison Lab imports.");
566
+ else {
567
+ p.note(importsSnippet, "app/layout.tsx imports");
568
+ const action = await p.select({
569
+ message: "No layout file found. Copy imports to clipboard?",
570
+ options: [{
571
+ value: "copy",
572
+ label: "Copy to clipboard"
573
+ }, {
574
+ value: "skip",
575
+ label: "Skip"
576
+ }]
577
+ });
578
+ if (!p.isCancel(action) && action === "copy") if (copyToClipboard(importsSnippet)) p.log.success("Copied CSS imports to clipboard!");
579
+ else p.log.warning("Could not access clipboard — copy manually from above.");
580
+ }
393
581
  p.outro(pc.green("Done! Your Bison Lab theme is ready."));
394
582
  }
395
583
  main().catch(console.error);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/preview.ts","../src/prompts.ts","../src/generate.ts","../src/index.ts"],"sourcesContent":["import pc from \"picocolors\";\n\nexport function hexToRgb(hex: string): [number, number, number] {\n hex = hex.replace(\"#\", \"\");\n return [\n parseInt(hex.substring(0, 2), 16),\n parseInt(hex.substring(2, 4), 16),\n parseInt(hex.substring(4, 6), 16),\n ];\n}\n\nexport function previewHexColor(hex: string): string {\n const [r, g, b] = hexToRgb(hex);\n // Use ANSI 24-bit color for background\n return `\\x1b[48;2;${r};${g};${b}m \\x1b[0m ${pc.dim(hex)}`;\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { previewHexColor } from \"./preview\";\n\nexport interface ThemeConfig {\n brandPrimary: string;\n brandSecondary: string;\n brandAccent: string;\n radius: \"sharp\" | \"subtle\" | \"rounded\" | \"pill\";\n shadow: \"flat\" | \"subtle\" | \"elevated\";\n motion: \"snappy\" | \"smooth\" | \"minimal\";\n density: \"compact\" | \"default\" | \"spacious\";\n fontFamily: string;\n fontWeights: {\n normal: number;\n medium: number;\n semibold: number;\n bold: number;\n };\n}\n\nfunction isValidHex(hex: string | undefined): boolean {\n return hex != null && /^#[0-9A-Fa-f]{6}$/.test(hex);\n}\n\nexport async function runPrompts(existing?: ThemeConfig): Promise<ThemeConfig | null> {\n // Brand colors\n p.log.info(pc.bold(\"Brand Colors\"));\n\n if (existing) {\n p.log.message(\n `Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)}`\n );\n }\n\n const brandPrimary = await p.text({\n message: \"Primary brand color (hex)\",\n placeholder: \"#1e3a5f\",\n ...(existing?.brandPrimary && { defaultValue: existing.brandPrimary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #1e3a5f)\" : undefined),\n });\n if (p.isCancel(brandPrimary)) return null;\n\n p.log.message(` ${previewHexColor(brandPrimary as string)} Primary`);\n\n const brandSecondary = await p.text({\n message: \"Secondary brand color (hex)\",\n placeholder: \"#2d9d6e\",\n ...(existing?.brandSecondary && { defaultValue: existing.brandSecondary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #2d9d6e)\" : undefined),\n });\n if (p.isCancel(brandSecondary)) return null;\n\n p.log.message(` ${previewHexColor(brandSecondary as string)} Secondary`);\n\n const brandAccent = await p.text({\n message: \"Accent brand color (hex)\",\n placeholder: \"#e89b20\",\n ...(existing?.brandAccent && { defaultValue: existing.brandAccent }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #e89b20)\" : undefined),\n });\n if (p.isCancel(brandAccent)) return null;\n\n p.log.message(` ${previewHexColor(brandAccent as string)} Accent`);\n\n // Radius\n const radius = await p.select({\n message: \"Border radius preset\",\n initialValue: existing?.radius ?? \"rounded\",\n options: [\n { value: \"sharp\" as const, label: \"Sharp\", hint: \"0px — square corners\" },\n { value: \"subtle\" as const, label: \"Subtle\", hint: \"6px — barely rounded\" },\n { value: \"rounded\" as const, label: \"Rounded\", hint: \"8px — balanced (default)\" },\n { value: \"pill\" as const, label: \"Pill\", hint: \"12px — soft, bubbly\" },\n ],\n });\n if (p.isCancel(radius)) return null;\n\n // Shadow\n const shadow = await p.select({\n message: \"Shadow preset\",\n initialValue: existing?.shadow ?? \"subtle\",\n options: [\n { value: \"flat\" as const, label: \"Flat\", hint: \"No shadows — clean, modern\" },\n { value: \"subtle\" as const, label: \"Subtle\", hint: \"Soft low-opacity shadows (default)\" },\n { value: \"elevated\" as const, label: \"Elevated\", hint: \"Prominent layered shadows\" },\n ],\n });\n if (p.isCancel(shadow)) return null;\n\n // Motion\n const motion = await p.select({\n message: \"Motion preset\",\n initialValue: existing?.motion ?? \"smooth\",\n options: [\n { value: \"snappy\" as const, label: \"Snappy\", hint: \"Fast, spring-like (150ms)\" },\n { value: \"smooth\" as const, label: \"Smooth\", hint: \"Balanced ease-out (200ms, default)\" },\n { value: \"minimal\" as const, label: \"Minimal\", hint: \"Barely-there, linear (100ms)\" },\n ],\n });\n if (p.isCancel(motion)) return null;\n\n // Density\n const density = await p.select({\n message: \"Component density\",\n initialValue: existing?.density ?? \"default\",\n options: [\n { value: \"compact\" as const, label: \"Compact\", hint: \"Tight padding, smaller components\" },\n { value: \"default\" as const, label: \"Default\", hint: \"Balanced spacing\" },\n { value: \"spacious\" as const, label: \"Spacious\", hint: \"Generous padding, larger components\" },\n ],\n });\n if (p.isCancel(density)) return null;\n\n // Font\n p.log.info(pc.bold(\"Typography\"));\n\n const fontFamily = await p.text({\n message: \"Font family name\",\n placeholder: \"Inter\",\n defaultValue: existing?.fontFamily ?? \"Inter\",\n });\n if (p.isCancel(fontFamily)) return null;\n\n // Font weights\n const customizeWeights = await p.confirm({\n message: \"Customize font weights? (default: 400/500/600/700)\",\n initialValue: false,\n });\n if (p.isCancel(customizeWeights)) return null;\n\n let fontWeights = existing?.fontWeights ?? { normal: 400, medium: 500, semibold: 600, bold: 700 };\n\n if (customizeWeights) {\n const normal = await p.text({\n message: \"Normal weight\",\n defaultValue: String(fontWeights.normal),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(normal)) return null;\n\n const medium = await p.text({\n message: \"Medium weight\",\n defaultValue: String(fontWeights.medium),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(medium)) return null;\n\n const semibold = await p.text({\n message: \"Semibold weight\",\n defaultValue: String(fontWeights.semibold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(semibold)) return null;\n\n const bold = await p.text({\n message: \"Bold weight\",\n defaultValue: String(fontWeights.bold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(bold)) return null;\n\n fontWeights = {\n normal: Number(normal),\n medium: Number(medium),\n semibold: Number(semibold),\n bold: Number(bold),\n };\n }\n\n return {\n brandPrimary: brandPrimary as string,\n brandSecondary: brandSecondary as string,\n brandAccent: brandAccent as string,\n radius: radius as ThemeConfig[\"radius\"],\n shadow: shadow as ThemeConfig[\"shadow\"],\n motion: motion as ThemeConfig[\"motion\"],\n density: density as ThemeConfig[\"density\"],\n fontFamily: fontFamily as string,\n fontWeights,\n };\n}\n","import type { ThemeConfig } from \"./prompts\";\n\nfunction hexToHSL(hex: string): { h: number; s: number; l: number } {\n hex = hex.replace(\"#\", \"\");\n const r = parseInt(hex.substring(0, 2), 16) / 255;\n const g = parseInt(hex.substring(2, 4), 16) / 255;\n const b = parseInt(hex.substring(4, 6), 16) / 255;\n\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h = 0;\n let s = 0;\n\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n break;\n case g:\n h = ((b - r) / d + 2) / 6;\n break;\n case b:\n h = ((r - g) / d + 4) / 6;\n break;\n }\n }\n\n return {\n h: Math.round(h * 360),\n s: Math.round(s * 100),\n l: Math.round(l * 100),\n };\n}\n\nfunction hsl(h: number, s: number, l: number): string {\n return `${h} ${s}% ${l}%`;\n}\n\nfunction clamp(v: number, min: number, max: number): number {\n return Math.min(Math.max(v, min), max);\n}\n\ninterface HSL {\n h: number;\n s: number;\n l: number;\n}\n\nfunction deriveLight(primary: HSL, secondary: HSL, accent: HSL): Record<string, string> {\n return {\n background: hsl(primary.h, clamp(primary.s - 30, 0, 100), 100),\n foreground: hsl(primary.h, clamp(primary.s - 20, 0, 100), 10),\n card: hsl(primary.h, clamp(primary.s - 30, 0, 100), 100),\n \"card-foreground\": hsl(primary.h, clamp(primary.s - 20, 0, 100), 10),\n popover: hsl(primary.h, clamp(primary.s - 30, 0, 100), 100),\n \"popover-foreground\": hsl(primary.h, clamp(primary.s - 20, 0, 100), 10),\n primary: hsl(primary.h, primary.s, primary.l),\n \"primary-foreground\": hsl(primary.h, clamp(primary.s - 30, 0, 100), primary.l > 50 ? 10 : 98),\n secondary: hsl(secondary.h, clamp(secondary.s - 30, 0, 100), clamp(secondary.l + 40, 0, 100)),\n \"secondary-foreground\": hsl(secondary.h, secondary.s, clamp(secondary.l - 30, 0, 100)),\n accent: hsl(accent.h, accent.s, clamp(accent.l + 10, 0, 100)),\n \"accent-foreground\": hsl(accent.h, accent.s, clamp(accent.l - 60, 0, 100)),\n muted: hsl(primary.h, clamp(primary.s - 30, 0, 100), 96),\n \"muted-foreground\": hsl(primary.h, clamp(primary.s - 25, 0, 100), 45),\n destructive: \"0 84% 60%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: hsl(primary.h, clamp(primary.s - 25, 0, 100), 91),\n input: hsl(primary.h, clamp(primary.s - 25, 0, 100), 91),\n ring: hsl(primary.h, primary.s, primary.l),\n };\n}\n\nfunction deriveDark(primary: HSL, secondary: HSL, accent: HSL): Record<string, string> {\n const darkPrimary = { ...primary, l: primary.l < 50 ? primary.l + 20 : primary.l };\n\n return {\n background: hsl(primary.h, clamp(primary.s - 25, 0, 100), 7),\n foreground: hsl(primary.h, clamp(primary.s - 30, 0, 100), 98),\n card: hsl(primary.h, clamp(primary.s - 25, 0, 100), 10),\n \"card-foreground\": hsl(primary.h, clamp(primary.s - 30, 0, 100), 98),\n popover: hsl(primary.h, clamp(primary.s - 25, 0, 100), 10),\n \"popover-foreground\": hsl(primary.h, clamp(primary.s - 30, 0, 100), 98),\n primary: hsl(darkPrimary.h, darkPrimary.s, darkPrimary.l),\n \"primary-foreground\": hsl(primary.h, clamp(primary.s - 30, 0, 100), darkPrimary.l > 50 ? 10 : 98),\n secondary: hsl(secondary.h, clamp(secondary.s - 20, 0, 100), 18),\n \"secondary-foreground\": hsl(secondary.h, secondary.s, clamp(secondary.l + 30, 0, 100)),\n accent: hsl(accent.h, clamp(accent.s - 10, 0, 100), 20),\n \"accent-foreground\": hsl(accent.h, accent.s, clamp(accent.l + 40, 0, 100)),\n muted: hsl(primary.h, clamp(primary.s - 25, 0, 100), 18),\n \"muted-foreground\": hsl(primary.h, clamp(primary.s - 20, 0, 100), 65),\n destructive: \"0 62% 30%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: hsl(primary.h, clamp(primary.s - 25, 0, 100), 18),\n input: hsl(primary.h, clamp(primary.s - 25, 0, 100), 18),\n ring: hsl(darkPrimary.h, darkPrimary.s, darkPrimary.l),\n };\n}\n\nexport function generateThemeCSS(config: ThemeConfig): string {\n const primary = hexToHSL(config.brandPrimary);\n const secondary = hexToHSL(config.brandSecondary);\n const accent = hexToHSL(config.brandAccent);\n\n const light = deriveLight(primary, secondary, accent);\n const dark = deriveDark(primary, secondary, accent);\n\n const lines: string[] = [\n `/* Bison Lab Theme — Generated by @bison-lab/create-theme */`,\n `/* Brand: ${config.brandPrimary} / ${config.brandSecondary} / ${config.brandAccent} */`,\n ``,\n `:root {`,\n ...Object.entries(light).map(([k, v]) => ` --${k}: ${v};`),\n ``,\n ` /* Typography */`,\n ` --font-sans: '${config.fontFamily}', ui-sans-serif, system-ui, sans-serif;`,\n ` --font-weight-normal: ${config.fontWeights.normal};`,\n ` --font-weight-medium: ${config.fontWeights.medium};`,\n ` --font-weight-semibold: ${config.fontWeights.semibold};`,\n ` --font-weight-bold: ${config.fontWeights.bold};`,\n `}`,\n ``,\n `.dark {`,\n ...Object.entries(dark).map(([k, v]) => ` --${k}: ${v};`),\n `}`,\n ``,\n ];\n\n return lines.join(\"\\n\");\n}\n\nexport function generateTailwindConfig(config: ThemeConfig): string {\n return [\n `import bisonPreset from '@bison-lab/tailwind-preset';`,\n ``,\n `export default {`,\n ` presets: [bisonPreset],`,\n ` content: [`,\n ` './app/**/*.{ts,tsx}',`,\n ` './components/**/*.{ts,tsx}',`,\n ` './node_modules/@bison-lab/ui/dist/**/*.js',`,\n ` ],`,\n `};`,\n ].join(\"\\n\");\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { resolve } from \"path\";\nimport { runPrompts, type ThemeConfig } from \"./prompts\";\nimport { generateThemeCSS, generateTailwindConfig } from \"./generate\";\n\nconst CONFIG_FILE = \"bison.config.json\";\nconst THEME_FILE = \"bison-theme.css\";\n\nasync function main() {\n p.intro(pc.bgCyan(pc.black(\" Bison Lab Theme Generator \")));\n\n const configPath = resolve(process.cwd(), CONFIG_FILE);\n let existingConfig: ThemeConfig | undefined;\n\n if (existsSync(configPath)) {\n const raw = JSON.parse(readFileSync(configPath, \"utf-8\")) as ThemeConfig;\n existingConfig = raw;\n\n const mode = await p.select({\n message: \"An existing theme was found. What would you like to do?\",\n options: [\n { value: \"update\", label: \"Update existing theme\", hint: \"Modify individual properties\" },\n { value: \"fresh\", label: \"Start fresh\", hint: \"Overwrite everything\" },\n ],\n });\n\n if (p.isCancel(mode)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (mode === \"fresh\") {\n existingConfig = undefined;\n }\n }\n\n const config = await runPrompts(existingConfig);\n\n if (!config) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n const s = p.spinner();\n s.start(\"Generating theme files...\");\n\n const themeCSS = generateThemeCSS(config);\n const themePath = resolve(process.cwd(), THEME_FILE);\n writeFileSync(themePath, themeCSS, \"utf-8\");\n\n writeFileSync(configPath, JSON.stringify(config, null, 2), \"utf-8\");\n\n const tailwindSnippet = generateTailwindConfig(config);\n\n s.stop(\"Theme files generated!\");\n\n p.note(\n [\n `${pc.green(\"Created:\")} ${THEME_FILE}`,\n `${pc.green(\"Created:\")} ${CONFIG_FILE}`,\n \"\",\n `${pc.bold(\"Add to your tailwind.config.ts:\")}`,\n \"\",\n tailwindSnippet,\n \"\",\n `${pc.bold(\"Import in your app/layout.tsx:\")}`,\n \"\",\n `import '@bison-lab/tokens/css/globals.css';`,\n `import '@bison-lab/tokens/css/themes/radius-${config.radius}.css';`,\n `import '@bison-lab/tokens/css/themes/shadow-${config.shadow}.css';`,\n `import '@bison-lab/tokens/css/themes/motion-${config.motion}.css';`,\n `import '@bison-lab/tokens/css/themes/density-${config.density}.css';`,\n `import './${THEME_FILE}';`,\n ].join(\"\\n\"),\n \"Next steps\"\n );\n\n p.outro(pc.green(\"Done! Your Bison Lab theme is ready.\"));\n}\n\nmain().catch(console.error);\n"],"mappings":";;;;;;AAEA,SAAgB,SAAS,KAAuC;AAC9D,OAAM,IAAI,QAAQ,KAAK,GAAG;AAC1B,QAAO;EACL,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EAClC;;AAGH,SAAgB,gBAAgB,KAAqB;CACnD,MAAM,CAAC,GAAG,GAAG,KAAK,SAAS,IAAI;AAE/B,QAAO,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,IAAI;;;;ACO1D,SAAS,WAAW,KAAkC;AACpD,QAAO,OAAO,QAAQ,oBAAoB,KAAK,IAAI;;AAGrD,eAAsB,WAAW,UAAqD;AAEpF,GAAE,IAAI,KAAK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AAK,KAAK,EACZ,aACD;AAED,GAAE,MAAM,GAAG,MAAM,uCAAuC,CAAC;;AAG3D,MAAM,CAAC,MAAM,QAAQ,MAAM"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/preview.ts","../src/prompts.ts","../src/generate.ts","../src/index.ts"],"sourcesContent":["import pc from \"picocolors\";\n\nexport function hexToRgb(hex: string): [number, number, number] {\n hex = hex.replace(\"#\", \"\");\n return [\n parseInt(hex.substring(0, 2), 16),\n parseInt(hex.substring(2, 4), 16),\n parseInt(hex.substring(4, 6), 16),\n ];\n}\n\nexport function previewHexColor(hex: string): string {\n const [r, g, b] = hexToRgb(hex);\n // Use ANSI 24-bit color for background\n return `\\x1b[48;2;${r};${g};${b}m \\x1b[0m ${pc.dim(hex)}`;\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { previewHexColor } from \"./preview\";\n\nexport type GreyScale = \"slate\" | \"gray\" | \"zinc\" | \"neutral\" | \"stone\";\n\nexport interface ThemeConfig {\n brandPrimary: string;\n brandSecondary: string;\n brandAccent: string;\n brandHighlight: string;\n greyScale: GreyScale;\n radius: \"sharp\" | \"subtle\" | \"rounded\" | \"pill\";\n shadow: \"flat\" | \"subtle\" | \"elevated\";\n motion: \"snappy\" | \"smooth\" | \"minimal\";\n density: \"compact\" | \"default\" | \"spacious\";\n fontFamily: string;\n fontWeights: {\n normal: number;\n medium: number;\n semibold: number;\n bold: number;\n };\n}\n\nfunction isValidHex(hex: string | undefined): boolean {\n return hex != null && /^#[0-9A-Fa-f]{6}$/.test(hex);\n}\n\nexport async function runPrompts(existing?: ThemeConfig): Promise<ThemeConfig | null> {\n // Brand colors\n p.log.info(pc.bold(\"Brand Colors\"));\n\n if (existing) {\n p.log.message(\n `Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)} Highlight ${previewHexColor(existing.brandHighlight)}`\n );\n }\n\n const brandPrimary = await p.text({\n message: \"Primary brand color (hex)\",\n placeholder: \"#1e3a5f\",\n ...(existing?.brandPrimary && { defaultValue: existing.brandPrimary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #1e3a5f)\" : undefined),\n });\n if (p.isCancel(brandPrimary)) return null;\n\n p.log.message(` ${previewHexColor(brandPrimary as string)} Primary`);\n\n const brandSecondary = await p.text({\n message: \"Secondary brand color (hex)\",\n placeholder: \"#2d9d6e\",\n ...(existing?.brandSecondary && { defaultValue: existing.brandSecondary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #2d9d6e)\" : undefined),\n });\n if (p.isCancel(brandSecondary)) return null;\n\n p.log.message(` ${previewHexColor(brandSecondary as string)} Secondary`);\n\n const brandAccent = await p.text({\n message: \"Accent color (hex)\",\n placeholder: \"#e89b20\",\n ...(existing?.brandAccent && { defaultValue: existing.brandAccent }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #e89b20)\" : undefined),\n });\n if (p.isCancel(brandAccent)) return null;\n\n p.log.message(` ${previewHexColor(brandAccent as string)} Accent`);\n\n const brandHighlight = await p.text({\n message: \"Highlight color (hex)\",\n placeholder: \"#7c3aed\",\n ...(existing?.brandHighlight && { defaultValue: existing.brandHighlight }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #7c3aed)\" : undefined),\n });\n if (p.isCancel(brandHighlight)) return null;\n\n p.log.message(` ${previewHexColor(brandHighlight as string)} Highlight`);\n\n // Grey scale\n p.log.info(pc.bold(\"Grey Scale\"));\n\n const greyScale = await p.select({\n message: \"Grey palette for borders, text, backgrounds\",\n initialValue: existing?.greyScale ?? \"slate\",\n options: [\n { value: \"slate\" as const, label: \"Slate\", hint: \"Cool blue-grey — modern, tech-forward\" },\n { value: \"gray\" as const, label: \"Gray\", hint: \"Balanced blue-grey — neutral default\" },\n { value: \"zinc\" as const, label: \"Zinc\", hint: \"Cool desaturated — minimal, sharp\" },\n { value: \"neutral\" as const, label: \"Neutral\", hint: \"Pure grey — zero hue bias\" },\n { value: \"stone\" as const, label: \"Stone\", hint: \"Warm earthy grey — organic, approachable\" },\n ],\n });\n if (p.isCancel(greyScale)) return null;\n\n // Radius\n const radius = await p.select({\n message: \"Border radius preset\",\n initialValue: existing?.radius ?? \"rounded\",\n options: [\n { value: \"sharp\" as const, label: \"Sharp\", hint: \"0px — square corners\" },\n { value: \"subtle\" as const, label: \"Subtle\", hint: \"6px — barely rounded\" },\n { value: \"rounded\" as const, label: \"Rounded\", hint: \"8px — balanced (default)\" },\n { value: \"pill\" as const, label: \"Pill\", hint: \"12px — soft, bubbly\" },\n ],\n });\n if (p.isCancel(radius)) return null;\n\n // Shadow\n const shadow = await p.select({\n message: \"Shadow preset\",\n initialValue: existing?.shadow ?? \"subtle\",\n options: [\n { value: \"flat\" as const, label: \"Flat\", hint: \"No shadows — clean, modern\" },\n { value: \"subtle\" as const, label: \"Subtle\", hint: \"Soft low-opacity shadows (default)\" },\n { value: \"elevated\" as const, label: \"Elevated\", hint: \"Prominent layered shadows\" },\n ],\n });\n if (p.isCancel(shadow)) return null;\n\n // Motion\n const motion = await p.select({\n message: \"Motion preset\",\n initialValue: existing?.motion ?? \"smooth\",\n options: [\n { value: \"snappy\" as const, label: \"Snappy\", hint: \"Fast, spring-like (150ms)\" },\n { value: \"smooth\" as const, label: \"Smooth\", hint: \"Balanced ease-out (200ms, default)\" },\n { value: \"minimal\" as const, label: \"Minimal\", hint: \"Barely-there, linear (100ms)\" },\n ],\n });\n if (p.isCancel(motion)) return null;\n\n // Density\n const density = await p.select({\n message: \"Component density\",\n initialValue: existing?.density ?? \"default\",\n options: [\n { value: \"compact\" as const, label: \"Compact\", hint: \"Tight padding, smaller components\" },\n { value: \"default\" as const, label: \"Default\", hint: \"Balanced spacing\" },\n { value: \"spacious\" as const, label: \"Spacious\", hint: \"Generous padding, larger components\" },\n ],\n });\n if (p.isCancel(density)) return null;\n\n // Font\n p.log.info(pc.bold(\"Typography\"));\n\n const fontFamily = await p.text({\n message: \"Font family name\",\n placeholder: \"Inter\",\n defaultValue: existing?.fontFamily ?? \"Inter\",\n });\n if (p.isCancel(fontFamily)) return null;\n\n // Font weights\n const customizeWeights = await p.confirm({\n message: \"Customize font weights? (default: 400/500/600/700)\",\n initialValue: false,\n });\n if (p.isCancel(customizeWeights)) return null;\n\n let fontWeights = existing?.fontWeights ?? { normal: 400, medium: 500, semibold: 600, bold: 700 };\n\n if (customizeWeights) {\n const normal = await p.text({\n message: \"Normal weight\",\n defaultValue: String(fontWeights.normal),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(normal)) return null;\n\n const medium = await p.text({\n message: \"Medium weight\",\n defaultValue: String(fontWeights.medium),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(medium)) return null;\n\n const semibold = await p.text({\n message: \"Semibold weight\",\n defaultValue: String(fontWeights.semibold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(semibold)) return null;\n\n const bold = await p.text({\n message: \"Bold weight\",\n defaultValue: String(fontWeights.bold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(bold)) return null;\n\n fontWeights = {\n normal: Number(normal),\n medium: Number(medium),\n semibold: Number(semibold),\n bold: Number(bold),\n };\n }\n\n return {\n brandPrimary: brandPrimary as string,\n brandSecondary: brandSecondary as string,\n brandAccent: brandAccent as string,\n brandHighlight: brandHighlight as string,\n greyScale: greyScale as GreyScale,\n radius: radius as ThemeConfig[\"radius\"],\n shadow: shadow as ThemeConfig[\"shadow\"],\n motion: motion as ThemeConfig[\"motion\"],\n density: density as ThemeConfig[\"density\"],\n fontFamily: fontFamily as string,\n fontWeights,\n };\n}\n","import type { ThemeConfig } from \"./prompts\";\nimport {\n hexToHSL,\n hslToString,\n GREY_SCALES,\n type GreyScale,\n} from \"@bison-lab/tokens\";\n\n// --- Local HSL utilities (not exported from tokens) ---\n\nfunction clamp(v: number, min: number, max: number): number {\n return Math.min(Math.max(v, min), max);\n}\n\nfunction contrastForeground(color: { h: number; s: number; l: number }): string {\n return color.l > 55\n ? hslToString({ h: color.h, s: clamp(color.s - 20, 0, 100), l: 10 })\n : hslToString({ h: color.h, s: clamp(color.s - 25, 0, 100), l: 98 });\n}\n\nfunction boostForDark(color: { h: number; s: number; l: number }): { h: number; s: number; l: number } {\n if (color.l < 40) {\n return { ...color, l: clamp(color.l + 25, 0, 100) };\n }\n return color;\n}\n\n// --- Palette derivation ---\n\ntype GreyShade = \"50\" | \"100\" | \"200\" | \"300\" | \"400\" | \"500\" | \"600\" | \"700\" | \"800\" | \"900\" | \"950\";\n\nfunction deriveLight(\n primary: { h: number; s: number; l: number },\n secondary: { h: number; s: number; l: number },\n accent: { h: number; s: number; l: number },\n highlight: { h: number; s: number; l: number },\n grey: Record<GreyShade, string>,\n): Record<string, string> {\n return {\n background: grey[\"50\"],\n foreground: grey[\"950\"],\n card: grey[\"50\"],\n \"card-foreground\": grey[\"950\"],\n popover: grey[\"50\"],\n \"popover-foreground\": grey[\"950\"],\n primary: hslToString(primary),\n \"primary-foreground\": contrastForeground(primary),\n secondary: hslToString(secondary),\n \"secondary-foreground\": contrastForeground(secondary),\n accent: grey[\"100\"],\n \"accent-foreground\": grey[\"950\"],\n \"brand-accent\": hslToString(accent),\n \"brand-accent-foreground\": contrastForeground(accent),\n highlight: hslToString(highlight),\n \"highlight-foreground\": contrastForeground(highlight),\n muted: grey[\"100\"],\n \"muted-foreground\": grey[\"500\"],\n destructive: \"0 84% 60%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: grey[\"200\"],\n input: grey[\"200\"],\n ring: hslToString(primary),\n };\n}\n\nfunction deriveDark(\n primary: { h: number; s: number; l: number },\n secondary: { h: number; s: number; l: number },\n accent: { h: number; s: number; l: number },\n highlight: { h: number; s: number; l: number },\n grey: Record<GreyShade, string>,\n): Record<string, string> {\n const dp = boostForDark(primary);\n const ds = boostForDark(secondary);\n const da = boostForDark(accent);\n const dh = boostForDark(highlight);\n\n return {\n background: grey[\"950\"],\n foreground: grey[\"50\"],\n card: grey[\"900\"],\n \"card-foreground\": grey[\"50\"],\n popover: grey[\"900\"],\n \"popover-foreground\": grey[\"50\"],\n primary: hslToString(dp),\n \"primary-foreground\": contrastForeground(dp),\n secondary: hslToString(ds),\n \"secondary-foreground\": contrastForeground(ds),\n accent: grey[\"800\"],\n \"accent-foreground\": grey[\"50\"],\n \"brand-accent\": hslToString(da),\n \"brand-accent-foreground\": contrastForeground(da),\n highlight: hslToString(dh),\n \"highlight-foreground\": contrastForeground(dh),\n muted: grey[\"800\"],\n \"muted-foreground\": grey[\"400\"],\n destructive: \"0 62% 30%\",\n \"destructive-foreground\": \"0 0% 98%\",\n border: grey[\"800\"],\n input: grey[\"800\"],\n ring: hslToString(dp),\n };\n}\n\n// --- Public generators ---\n\nexport function generateThemeCSS(config: ThemeConfig): string {\n const primary = hexToHSL(config.brandPrimary);\n const secondary = hexToHSL(config.brandSecondary);\n const accent = hexToHSL(config.brandAccent);\n const highlight = hexToHSL(config.brandHighlight);\n const grey = GREY_SCALES[config.greyScale as GreyScale];\n\n const light = deriveLight(primary, secondary, accent, highlight, grey);\n const dark = deriveDark(primary, secondary, accent, highlight, grey);\n\n const lines: string[] = [\n `/* Bison Lab Theme — Generated by @bison-lab/create-theme */`,\n `/* Brand: ${config.brandPrimary} / ${config.brandSecondary} / ${config.brandAccent} / ${config.brandHighlight} */`,\n `/* Grey: ${config.greyScale} */`,\n ``,\n `:root {`,\n ...Object.entries(light).map(([k, v]) => ` --${k}: ${v};`),\n ``,\n ` /* Typography */`,\n ` --font-sans: '${config.fontFamily}', ui-sans-serif, system-ui, sans-serif;`,\n ` --font-weight-normal: ${config.fontWeights.normal};`,\n ` --font-weight-medium: ${config.fontWeights.medium};`,\n ` --font-weight-semibold: ${config.fontWeights.semibold};`,\n ` --font-weight-bold: ${config.fontWeights.bold};`,\n `}`,\n ``,\n `.dark {`,\n ...Object.entries(dark).map(([k, v]) => ` --${k}: ${v};`),\n `}`,\n ``,\n ];\n\n return lines.join(\"\\n\");\n}\n\nexport function generateTailwindConfig(config: ThemeConfig): string {\n return [\n `import bisonPreset from '@bison-lab/tailwind-preset';`,\n ``,\n `export default {`,\n ` presets: [bisonPreset],`,\n ` content: [`,\n ` './app/**/*.{ts,tsx}',`,\n ` './components/**/*.{ts,tsx}',`,\n ` './node_modules/@bison-lab/ui/dist/**/*.js',`,\n ` ],`,\n `};`,\n ].join(\"\\n\");\n}\n\nexport function generateImports(config: ThemeConfig, themeFile: string): string {\n return [\n `import '@bison-lab/tokens/css/globals.css';`,\n `import '@bison-lab/tokens/css/themes/radius-${config.radius}.css';`,\n `import '@bison-lab/tokens/css/themes/shadow-${config.shadow}.css';`,\n `import '@bison-lab/tokens/css/themes/motion-${config.motion}.css';`,\n `import '@bison-lab/tokens/css/themes/density-${config.density}.css';`,\n `import './${themeFile}';`,\n ].join(\"\\n\");\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { execSync } from \"child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { resolve, join } from \"path\";\nimport { runPrompts, type ThemeConfig } from \"./prompts\";\nimport { generateThemeCSS, generateTailwindConfig, generateImports } from \"./generate\";\n\nconst BISON_PACKAGES = [\n \"@bison-lab/tokens\",\n \"@bison-lab/ui\",\n \"@bison-lab/tailwind-preset\",\n];\n\nfunction copyToClipboard(text: string): boolean {\n try {\n const platform = process.platform;\n if (platform === \"darwin\") {\n execSync(\"pbcopy\", { input: text });\n } else if (platform === \"linux\") {\n execSync(\"xclip -selection clipboard\", { input: text });\n } else if (platform === \"win32\") {\n execSync(\"clip\", { input: text });\n } else {\n return false;\n }\n return true;\n } catch {\n return false;\n }\n}\n\nfunction detectPackageManager(): \"pnpm\" | \"npm\" | \"yarn\" | \"bun\" {\n const cwd = process.cwd();\n if (existsSync(join(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (existsSync(join(cwd, \"bun.lockb\")) || existsSync(join(cwd, \"bun.lock\"))) return \"bun\";\n if (existsSync(join(cwd, \"yarn.lock\"))) return \"yarn\";\n return \"npm\";\n}\n\nfunction installCommand(pm: \"pnpm\" | \"npm\" | \"yarn\" | \"bun\"): string {\n const pkgs = BISON_PACKAGES.join(\" \");\n switch (pm) {\n case \"pnpm\": return `pnpm add ${pkgs}`;\n case \"yarn\": return `yarn add ${pkgs}`;\n case \"bun\": return `bun add ${pkgs}`;\n default: return `npm install ${pkgs}`;\n }\n}\n\nfunction areBisonPackagesInstalled(): boolean {\n return BISON_PACKAGES.every((pkg) => {\n try {\n const pkgJsonPath = join(process.cwd(), \"node_modules\", pkg, \"package.json\");\n return existsSync(pkgJsonPath);\n } catch {\n return false;\n }\n });\n}\n\nfunction findLayoutFile(): string | null {\n const candidates = [\n \"app/layout.tsx\",\n \"app/layout.jsx\",\n \"src/app/layout.tsx\",\n \"src/app/layout.jsx\",\n ];\n for (const candidate of candidates) {\n const full = resolve(process.cwd(), candidate);\n if (existsSync(full)) return full;\n }\n return null;\n}\n\nfunction injectImportsIntoLayout(layoutPath: string, imports: string): boolean {\n const content = readFileSync(layoutPath, \"utf-8\");\n\n // Check if already injected\n if (content.includes(\"@bison-lab/tokens/css/globals.css\")) {\n return false;\n }\n\n // Match all import statements including multiline ones (e.g. import { \\n Foo,\\n } from \"bar\";)\n const importRegex = /^import\\s[\\s\\S]*?from\\s+['\"][^'\"]+['\"];?\\s*$/gm;\n let lastMatchEnd = -1;\n let match: RegExpExecArray | null;\n\n while ((match = importRegex.exec(content)) !== null) {\n lastMatchEnd = match.index + match[0].length;\n }\n\n if (lastMatchEnd === -1) {\n // No imports found, prepend to file\n writeFileSync(layoutPath, imports + \"\\n\\n\" + content, \"utf-8\");\n } else {\n // Insert after the last import statement\n const before = content.slice(0, lastMatchEnd);\n const after = content.slice(lastMatchEnd);\n writeFileSync(layoutPath, before + \"\\n\\n\" + imports + after, \"utf-8\");\n }\n\n return true;\n}\n\nconst CONFIG_FILE = \"bison.config.json\";\nconst THEME_FILE = \"bison-theme.css\";\n\nasync function main() {\n p.intro(pc.bgCyan(pc.black(\" Bison Lab Theme Generator \")));\n\n const configPath = resolve(process.cwd(), CONFIG_FILE);\n let existingConfig: ThemeConfig | undefined;\n\n if (existsSync(configPath)) {\n const raw = JSON.parse(readFileSync(configPath, \"utf-8\")) as ThemeConfig;\n existingConfig = raw;\n\n const mode = await p.select({\n message: \"An existing theme was found. What would you like to do?\",\n options: [\n { value: \"update\", label: \"Update existing theme\", hint: \"Modify individual properties\" },\n { value: \"fresh\", label: \"Start fresh\", hint: \"Overwrite everything\" },\n ],\n });\n\n if (p.isCancel(mode)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (mode === \"fresh\") {\n existingConfig = undefined;\n }\n }\n\n const config = await runPrompts(existingConfig);\n\n if (!config) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n // --- Install dependencies ---\n if (!areBisonPackagesInstalled()) {\n const pm = detectPackageManager();\n const cmd = installCommand(pm);\n\n const shouldInstall = await p.confirm({\n message: `Install Bison Lab packages? (${pc.dim(cmd)})`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldInstall)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (shouldInstall) {\n const s = p.spinner();\n s.start(`Installing packages with ${pm}...`);\n try {\n execSync(cmd, { cwd: process.cwd(), stdio: \"pipe\" });\n s.stop(\"Packages installed!\");\n } catch (err) {\n s.stop(\"Package installation failed.\");\n p.log.warning(`Run manually: ${pc.cyan(cmd)}`);\n }\n } else {\n p.log.warning(`Skipped. Run manually: ${pc.cyan(installCommand(pm))}`);\n }\n } else {\n p.log.success(\"Bison Lab packages already installed.\");\n }\n\n // --- Generate theme files ---\n const s = p.spinner();\n s.start(\"Generating theme files...\");\n\n const themeCSS = generateThemeCSS(config);\n const themePath = resolve(process.cwd(), THEME_FILE);\n writeFileSync(themePath, themeCSS, \"utf-8\");\n writeFileSync(configPath, JSON.stringify(config, null, 2), \"utf-8\");\n\n s.stop(\"Theme files generated!\");\n\n p.log.success(`${pc.green(\"Created:\")} ${THEME_FILE}`);\n p.log.success(`${pc.green(\"Created:\")} ${CONFIG_FILE}`);\n\n // --- Tailwind config ---\n const tailwindSnippet = generateTailwindConfig(config);\n const tailwindPath = resolve(process.cwd(), \"tailwind.config.ts\");\n\n if (!existsSync(tailwindPath)) {\n writeFileSync(tailwindPath, tailwindSnippet, \"utf-8\");\n p.log.success(`${pc.green(\"Created:\")} tailwind.config.ts`);\n } else {\n const existing = readFileSync(tailwindPath, \"utf-8\");\n if (existing.includes(\"@bison-lab/tailwind-preset\")) {\n p.log.success(\"tailwind.config.ts already includes Bison Lab preset.\");\n } else {\n p.note(tailwindSnippet, \"tailwind.config.ts\");\n\n const action = await p.select({\n message: \"tailwind.config.ts already exists. How should we handle it?\",\n options: [\n { value: \"overwrite\", label: \"Overwrite\", hint: \"Replace with Bison Lab config\" },\n { value: \"copy\", label: \"Copy to clipboard\", hint: \"Paste manually\" },\n { value: \"skip\", label: \"Skip\", hint: \"I'll handle it\" },\n ],\n });\n\n if (p.isCancel(action)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (action === \"overwrite\") {\n writeFileSync(tailwindPath, tailwindSnippet, \"utf-8\");\n p.log.success(\"tailwind.config.ts overwritten.\");\n } else if (action === \"copy\") {\n if (copyToClipboard(tailwindSnippet)) {\n p.log.success(\"Copied tailwind config to clipboard!\");\n } else {\n p.log.warning(\"Could not access clipboard — copy manually from above.\");\n }\n }\n }\n }\n\n // --- Layout imports ---\n const importsSnippet = generateImports(config, THEME_FILE);\n const layoutPath = findLayoutFile();\n\n if (layoutPath) {\n const injected = injectImportsIntoLayout(layoutPath, importsSnippet);\n if (injected) {\n const relative = layoutPath.replace(process.cwd() + \"/\", \"\");\n p.log.success(`${pc.green(\"Updated:\")} ${relative} with Bison Lab imports.`);\n } else {\n p.log.success(\"Layout file already includes Bison Lab imports.\");\n }\n } else {\n p.note(importsSnippet, \"app/layout.tsx imports\");\n\n const action = await p.select({\n message: \"No layout file found. Copy imports to clipboard?\",\n options: [\n { value: \"copy\", label: \"Copy to clipboard\" },\n { value: \"skip\", label: \"Skip\" },\n ],\n });\n\n if (!p.isCancel(action) && action === \"copy\") {\n if (copyToClipboard(importsSnippet)) {\n p.log.success(\"Copied CSS imports to clipboard!\");\n } else {\n p.log.warning(\"Could not access clipboard — copy manually from above.\");\n }\n }\n }\n\n p.outro(pc.green(\"Done! Your Bison Lab theme is ready.\"));\n}\n\nmain().catch(console.error);\n"],"mappings":";;;;;;;;AAEA,SAAgB,SAAS,KAAuC;AAC9D,OAAM,IAAI,QAAQ,KAAK,GAAG;AAC1B,QAAO;EACL,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EAClC;;AAGH,SAAgB,gBAAgB,KAAqB;CACnD,MAAM,CAAC,GAAG,GAAG,KAAK,SAAS,IAAI;AAE/B,QAAO,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,IAAI;;;;ACW1D,SAAS,WAAW,KAAkC;AACpD,QAAO,OAAO,QAAQ,oBAAoB,KAAK,IAAI;;AAGrD,eAAsB,WAAW,UAAqD;AAEpF,GAAE,IAAI,KAAK,GAAG,KAAK,eAAe,CAAC;AAEnC,KAAI,SACF,GAAE,IAAI,QACJ,oBAAoB,gBAAgB,SAAS,aAAa,CAAC,aAAa,gBAAgB,SAAS,eAAe,CAAC,UAAU,gBAAgB,SAAS,YAAY,CAAC,aAAa,gBAAgB,SAAS,eAAe,GACvN;CAGH,MAAM,eAAe,MAAM,EAAE,KAAK;EAChC,SAAS;EACT,aAAa;EACb,GAAI,UAAU,gBAAgB,EAAE,cA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,cAAc,iBAAiB,QAAQ;AACrD,KAAE,IAAI,QAAQ,kCAAkC;aACvC,WAAW,OACpB,KAAI,gBAAgB,gBAAgB,CAClC,GAAE,IAAI,QAAQ,uCAAuC;MAErD,GAAE,IAAI,QAAQ,yDAAyD;;CAO/E,MAAM,iBAAiB,gBAAgB,QAAQ,WAAW;CAC1D,MAAM,aAAa,gBAAgB;AAEnC,KAAI,WAEF,KADiB,wBAAwB,YAAY,eAAe,EACtD;EACZ,MAAM,WAAW,WAAW,QAAQ,QAAQ,KAAK,GAAG,KAAK,GAAG;AAC5D,IAAE,IAAI,QAAQ,GAAG,GAAG,MAAM,WAAW,CAAC,GAAG,SAAS,0BAA0B;OAE5E,GAAE,IAAI,QAAQ,kDAAkD;MAE7D;AACL,IAAE,KAAK,gBAAgB,yBAAyB;EAEhD,MAAM,SAAS,MAAM,EAAE,OAAO;GAC5B,SAAS;GACT,SAAS,CACP;IAAE,OAAO;IAAQ,OAAO;IAAqB,EAC7C;IAAE,OAAO;IAAQ,OAAO;IAAQ,CACjC;GACF,CAAC;AAEF,MAAI,CAAC,EAAE,SAAS,OAAO,IAAI,WAAW,OACpC,KAAI,gBAAgB,eAAe,CACjC,GAAE,IAAI,QAAQ,mCAAmC;MAEjD,GAAE,IAAI,QAAQ,yDAAyD;;AAK7E,GAAE,MAAM,GAAG,MAAM,uCAAuC,CAAC;;AAG3D,MAAM,CAAC,MAAM,QAAQ,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bison-lab/create-theme",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Interactive CLI for generating and updating Bison Lab theme files",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,7 +11,8 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "@clack/prompts": "^1.1.0",
14
- "picocolors": "^1.1.1"
14
+ "picocolors": "^1.1.1",
15
+ "@bison-lab/tokens": "0.2.0"
15
16
  },
16
17
  "devDependencies": {
17
18
  "@types/node": "^25.5.0",