myoperator-ui 0.0.4 → 0.0.6

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 +91 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -353,14 +353,75 @@ var CSS_VARIABLES_V4 = `@import "tailwindcss";
353
353
  --input: 217.2 32.6% 17.5%;
354
354
  --ring: 212.7 26.8% 83.9%;
355
355
  }
356
+ `;
357
+ var CSS_VARIABLES_V4_PREFIXED = `@import "tailwindcss/utilities" layer(utilities);
356
358
 
357
- * {
358
- border-color: hsl(var(--border));
359
+ @theme {
360
+ --color-background: hsl(0 0% 100%);
361
+ --color-foreground: hsl(222.2 84% 4.9%);
362
+ --color-card: hsl(0 0% 100%);
363
+ --color-card-foreground: hsl(222.2 84% 4.9%);
364
+ --color-popover: hsl(0 0% 100%);
365
+ --color-popover-foreground: hsl(222.2 84% 4.9%);
366
+ --color-primary: hsl(222.2 47.4% 11.2%);
367
+ --color-primary-foreground: hsl(210 40% 98%);
368
+ --color-secondary: hsl(210 40% 96.1%);
369
+ --color-secondary-foreground: hsl(222.2 47.4% 11.2%);
370
+ --color-muted: hsl(210 40% 96.1%);
371
+ --color-muted-foreground: hsl(215.4 16.3% 46.9%);
372
+ --color-accent: hsl(210 40% 96.1%);
373
+ --color-accent-foreground: hsl(222.2 47.4% 11.2%);
374
+ --color-destructive: hsl(0 84.2% 60.2%);
375
+ --color-destructive-foreground: hsl(210 40% 98%);
376
+ --color-border: hsl(214.3 31.8% 91.4%);
377
+ --color-input: hsl(214.3 31.8% 91.4%);
378
+ --color-ring: hsl(222.2 84% 4.9%);
379
+ --radius: 0.5rem;
359
380
  }
360
381
 
361
- body {
362
- background-color: hsl(var(--background));
363
- color: hsl(var(--foreground));
382
+ :root {
383
+ --background: 0 0% 100%;
384
+ --foreground: 222.2 84% 4.9%;
385
+ --card: 0 0% 100%;
386
+ --card-foreground: 222.2 84% 4.9%;
387
+ --popover: 0 0% 100%;
388
+ --popover-foreground: 222.2 84% 4.9%;
389
+ --primary: 222.2 47.4% 11.2%;
390
+ --primary-foreground: 210 40% 98%;
391
+ --secondary: 210 40% 96.1%;
392
+ --secondary-foreground: 222.2 47.4% 11.2%;
393
+ --muted: 210 40% 96.1%;
394
+ --muted-foreground: 215.4 16.3% 46.9%;
395
+ --accent: 210 40% 96.1%;
396
+ --accent-foreground: 222.2 47.4% 11.2%;
397
+ --destructive: 0 84.2% 60.2%;
398
+ --destructive-foreground: 210 40% 98%;
399
+ --border: 214.3 31.8% 91.4%;
400
+ --input: 214.3 31.8% 91.4%;
401
+ --ring: 222.2 84% 4.9%;
402
+ --radius: 0.5rem;
403
+ }
404
+
405
+ .dark {
406
+ --background: 222.2 84% 4.9%;
407
+ --foreground: 210 40% 98%;
408
+ --card: 222.2 84% 4.9%;
409
+ --card-foreground: 210 40% 98%;
410
+ --popover: 222.2 84% 4.9%;
411
+ --popover-foreground: 210 40% 98%;
412
+ --primary: 210 40% 98%;
413
+ --primary-foreground: 222.2 47.4% 11.2%;
414
+ --secondary: 217.2 32.6% 17.5%;
415
+ --secondary-foreground: 210 40% 98%;
416
+ --muted: 217.2 32.6% 17.5%;
417
+ --muted-foreground: 215 20.2% 65.1%;
418
+ --accent: 217.2 32.6% 17.5%;
419
+ --accent-foreground: 210 40% 98%;
420
+ --destructive: 0 62.8% 30.6%;
421
+ --destructive-foreground: 210 40% 98%;
422
+ --border: 217.2 32.6% 17.5%;
423
+ --input: 217.2 32.6% 17.5%;
424
+ --ring: 212.7 26.8% 83.9%;
364
425
  }
365
426
  `;
366
427
  var CSS_VARIABLES_V3 = `@tailwind base;
@@ -531,6 +592,17 @@ async function init() {
531
592
  process.exit(0);
532
593
  }
533
594
  }
595
+ const packageJsonPath = path2.join(cwd, "package.json");
596
+ let hasBootstrap = false;
597
+ let isESM = false;
598
+ if (await fs2.pathExists(packageJsonPath)) {
599
+ const packageJson = await fs2.readJson(packageJsonPath);
600
+ hasBootstrap = !!(packageJson.dependencies?.bootstrap || packageJson.devDependencies?.bootstrap);
601
+ isESM = packageJson.type === "module";
602
+ if (hasBootstrap) {
603
+ console.log(chalk2.blue(" \u2139 Bootstrap detected - will configure Tailwind to avoid conflicts\n"));
604
+ }
605
+ }
534
606
  const response = await prompts2([
535
607
  {
536
608
  type: "select",
@@ -546,7 +618,8 @@ async function init() {
546
618
  type: "confirm",
547
619
  name: "usePrefix",
548
620
  message: "Use a prefix for Tailwind classes? (recommended if using Bootstrap/other CSS frameworks)",
549
- initial: false
621
+ initial: hasBootstrap
622
+ // Auto-set to true if Bootstrap detected
550
623
  },
551
624
  {
552
625
  type: (prev) => prev ? "text" : null,
@@ -613,7 +686,12 @@ export function cn(...inputs: ClassValue[]) {
613
686
  const componentsPath = path2.join(cwd, response.componentsPath);
614
687
  await fs2.ensureDir(componentsPath);
615
688
  const globalCssPath = path2.join(cwd, response.globalCss);
616
- const cssContent = response.tailwindVersion === "v4" ? CSS_VARIABLES_V4 : CSS_VARIABLES_V3;
689
+ let cssContent;
690
+ if (response.tailwindVersion === "v4") {
691
+ cssContent = prefix || hasBootstrap ? CSS_VARIABLES_V4_PREFIXED : CSS_VARIABLES_V4;
692
+ } else {
693
+ cssContent = CSS_VARIABLES_V3;
694
+ }
617
695
  let cssUpdated = false;
618
696
  if (!await fs2.pathExists(globalCssPath)) {
619
697
  await fs2.ensureDir(path2.dirname(globalCssPath));
@@ -661,7 +739,12 @@ export function cn(...inputs: ClassValue[]) {
661
739
  }
662
740
  }
663
741
  const postcssConfigPath = path2.join(cwd, "postcss.config.js");
664
- const postcssConfigContent = `module.exports = {
742
+ const postcssConfigContent = isESM ? `export default {
743
+ plugins: {
744
+ '@tailwindcss/postcss': {},
745
+ },
746
+ }
747
+ ` : `module.exports = {
665
748
  plugins: {
666
749
  '@tailwindcss/postcss': {},
667
750
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",