myoperator-ui 0.0.21 → 0.0.23
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.js +15 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import ora from "ora";
|
|
|
14
14
|
// src/utils/registry.ts
|
|
15
15
|
function prefixTailwindClasses(content, prefix) {
|
|
16
16
|
if (!prefix) return content;
|
|
17
|
-
const cleanPrefix = prefix
|
|
17
|
+
const cleanPrefix = prefix;
|
|
18
18
|
return content.replace(/"([^"]+)"/g, (match, classString) => {
|
|
19
19
|
if (classString.startsWith("@") || classString.startsWith(".") || classString.includes("::")) {
|
|
20
20
|
return match;
|
|
@@ -62,7 +62,7 @@ import { Loader2 } from "lucide-react"
|
|
|
62
62
|
import { cn } from "@/lib/utils"
|
|
63
63
|
|
|
64
64
|
const buttonVariants = cva(
|
|
65
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1e293b] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
65
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1e293b] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
66
66
|
{
|
|
67
67
|
variants: {
|
|
68
68
|
variant: {
|
|
@@ -77,10 +77,10 @@ const buttonVariants = cva(
|
|
|
77
77
|
link: "text-[#343E55] underline-offset-4 hover:underline",
|
|
78
78
|
},
|
|
79
79
|
size: {
|
|
80
|
-
default: "py-2.5 px-4",
|
|
81
|
-
sm: "py-2 px-3 text-xs",
|
|
82
|
-
lg: "py-3 px-6",
|
|
83
|
-
icon: "p-2.5",
|
|
80
|
+
default: "h-10 py-2.5 px-4",
|
|
81
|
+
sm: "h-9 py-2 px-3 text-xs",
|
|
82
|
+
lg: "h-11 py-3 px-6",
|
|
83
|
+
icon: "h-10 w-10 p-2.5",
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
defaultVariants: {
|
|
@@ -334,14 +334,11 @@ var CSS_VARIABLES_V4 = `@import "tailwindcss";
|
|
|
334
334
|
--ring: 212.7 26.8% 83.9%;
|
|
335
335
|
}
|
|
336
336
|
`;
|
|
337
|
-
var
|
|
338
|
-
const cleanPrefix = prefix ? prefix.replace(/-/g, "") : "";
|
|
339
|
-
const prefixOption = cleanPrefix ? ` prefix(${cleanPrefix})` : "";
|
|
340
|
-
return `/* myOperator UI - Tailwind CSS for Bootstrap projects */
|
|
337
|
+
var CSS_VARIABLES_V4_BOOTSTRAP = `/* myOperator UI - Tailwind CSS for Bootstrap projects */
|
|
341
338
|
/* Selective imports to avoid Preflight conflicts with Bootstrap */
|
|
342
339
|
@layer theme, base, components, utilities;
|
|
343
340
|
@import "tailwindcss/theme.css" layer(theme);
|
|
344
|
-
@import "tailwindcss/utilities.css" layer(utilities)
|
|
341
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
345
342
|
|
|
346
343
|
/* Tell Tailwind to scan component files for utility classes */
|
|
347
344
|
@source "./components/**/*.{js,ts,jsx,tsx}";
|
|
@@ -350,7 +347,6 @@ var getCSS_VARIABLES_V4_BOOTSTRAP = (prefix) => {
|
|
|
350
347
|
/* End myOperator UI imports */
|
|
351
348
|
|
|
352
349
|
`;
|
|
353
|
-
};
|
|
354
350
|
var CSS_VARIABLES_V3 = `@tailwind base;
|
|
355
351
|
@tailwind components;
|
|
356
352
|
@tailwind utilities;
|
|
@@ -542,14 +538,17 @@ async function init() {
|
|
|
542
538
|
initial: 0
|
|
543
539
|
},
|
|
544
540
|
{
|
|
545
|
-
|
|
541
|
+
// Skip prefix prompt for Bootstrap + v4 since prefix() doesn't work with selective imports
|
|
542
|
+
type: (prev, values) => hasBootstrap && values.tailwindVersion === "v4" ? null : "confirm",
|
|
546
543
|
name: "usePrefix",
|
|
547
544
|
message: "Use a prefix for Tailwind classes? (recommended if using Bootstrap/other CSS frameworks)",
|
|
548
545
|
initial: hasBootstrap
|
|
549
|
-
// Auto-set to true if Bootstrap detected
|
|
550
546
|
},
|
|
551
547
|
{
|
|
552
|
-
type: (prev) =>
|
|
548
|
+
type: (prev, values) => {
|
|
549
|
+
if (hasBootstrap && values.tailwindVersion === "v4") return null;
|
|
550
|
+
return prev ? "text" : null;
|
|
551
|
+
},
|
|
553
552
|
name: "prefix",
|
|
554
553
|
message: "Enter prefix for Tailwind classes:",
|
|
555
554
|
initial: "tw"
|
|
@@ -615,7 +614,7 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
615
614
|
const globalCssPath = path2.join(cwd, response.globalCss);
|
|
616
615
|
let cssContent;
|
|
617
616
|
if (response.tailwindVersion === "v4") {
|
|
618
|
-
cssContent = hasBootstrap ?
|
|
617
|
+
cssContent = hasBootstrap ? CSS_VARIABLES_V4_BOOTSTRAP : CSS_VARIABLES_V4;
|
|
619
618
|
} else {
|
|
620
619
|
cssContent = CSS_VARIABLES_V3;
|
|
621
620
|
}
|