7onic 0.1.9 → 0.1.10

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 +12 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1242,9 +1242,13 @@ export function cn(...inputs: ClassValue[]) {
1242
1242
  return twMerge(clsx(inputs))
1243
1243
  }
1244
1244
  `;
1245
- var CSS_V3_IMPORTS = `@import '@7onic-ui/tokens/css/variables.css';
1246
- @import '@7onic-ui/tokens/css/themes/light.css';
1247
- @import '@7onic-ui/tokens/css/themes/dark.css';
1245
+ var CSS_V3_IMPORTS = `@import '@7onic-ui/tokens/css/all.css';
1246
+
1247
+ @tailwind base;
1248
+ @tailwind components;
1249
+ @tailwind utilities;
1250
+ `;
1251
+ var CSS_V3_TOKEN_ONLY = `@import '@7onic-ui/tokens/css/all.css';
1248
1252
  `;
1249
1253
  var CSS_V4_IMPORTS = `@import "tailwindcss";
1250
1254
  @import '@7onic-ui/tokens/css/variables.css';
@@ -1400,18 +1404,19 @@ async function init(args) {
1400
1404
  } else {
1401
1405
  const cssContent = import_node_fs4.default.readFileSync(cssFullPath, "utf-8");
1402
1406
  if (!cssContent.includes("@7onic-ui/tokens")) {
1403
- const tokenImports = tailwindVersion === 3 ? CSS_V3_IMPORTS : CSS_V4_TOKEN_ONLY;
1404
1407
  if (tailwindVersion === 4) {
1405
1408
  const twMatch = cssContent.match(/@import\s+["']tailwindcss["'].*\n/);
1406
1409
  if (twMatch) {
1407
1410
  const insertAt = twMatch.index + twMatch[0].length;
1408
- const updated = cssContent.slice(0, insertAt) + tokenImports + cssContent.slice(insertAt);
1411
+ const updated = cssContent.slice(0, insertAt) + CSS_V4_TOKEN_ONLY + cssContent.slice(insertAt);
1409
1412
  import_node_fs4.default.writeFileSync(cssFullPath, updated, "utf-8");
1410
1413
  } else {
1411
1414
  import_node_fs4.default.writeFileSync(cssFullPath, CSS_V4_IMPORTS + "\n" + cssContent, "utf-8");
1412
1415
  }
1413
1416
  } else {
1414
- import_node_fs4.default.writeFileSync(cssFullPath, tokenImports + "\n" + cssContent, "utf-8");
1417
+ const hasTailwindDirectives = /@tailwind\s+(base|components|utilities)/.test(cssContent);
1418
+ const v3Imports = hasTailwindDirectives ? CSS_V3_TOKEN_ONLY : CSS_V3_IMPORTS;
1419
+ import_node_fs4.default.writeFileSync(cssFullPath, v3Imports + "\n" + cssContent, "utf-8");
1415
1420
  }
1416
1421
  O2.success(`Added token imports to ${config.cssPath}`);
1417
1422
  } else {
@@ -14069,7 +14074,7 @@ function showSetupHints(names) {
14069
14074
 
14070
14075
  // cli/src/index.ts
14071
14076
  var import_picocolors4 = __toESM(require_picocolors());
14072
- var VERSION = "0.1.9";
14077
+ var VERSION = "0.1.10";
14073
14078
  var HELP = `
14074
14079
  ${import_picocolors4.default.bold("7onic")} \u2014 Add 7onic design system components to your project
14075
14080
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "7onic",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "CLI for adding 7onic design system components to your project",
5
5
  "bin": {
6
6
  "7onic": "./dist/index.js"