tailwind-styled-v4 5.1.22 → 5.1.24

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 (61) hide show
  1. package/README.md +216 -0
  2. package/dist/atomic.js +34 -4
  3. package/dist/atomic.js.map +1 -1
  4. package/dist/atomic.mjs +31 -2
  5. package/dist/atomic.mjs.map +1 -1
  6. package/dist/cli.js +132 -97
  7. package/dist/cli.js.map +1 -1
  8. package/dist/cli.mjs +129 -95
  9. package/dist/cli.mjs.map +1 -1
  10. package/dist/compiler.d.mts +195 -1
  11. package/dist/compiler.d.ts +195 -1
  12. package/dist/compiler.js +356 -12
  13. package/dist/compiler.js.map +1 -1
  14. package/dist/compiler.mjs +340 -10
  15. package/dist/compiler.mjs.map +1 -1
  16. package/dist/engine.js +194 -164
  17. package/dist/engine.js.map +1 -1
  18. package/dist/engine.mjs +184 -155
  19. package/dist/engine.mjs.map +1 -1
  20. package/dist/index.browser.mjs +136 -14
  21. package/dist/index.browser.mjs.map +1 -1
  22. package/dist/index.d.mts +45 -4
  23. package/dist/index.d.ts +45 -4
  24. package/dist/index.js +166 -9
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +177 -21
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/next.js +489 -158
  29. package/dist/next.js.map +1 -1
  30. package/dist/next.mjs +483 -153
  31. package/dist/next.mjs.map +1 -1
  32. package/dist/runtime-css.js +1 -1
  33. package/dist/runtime-css.js.map +1 -1
  34. package/dist/runtime-css.mjs +1 -1
  35. package/dist/runtime-css.mjs.map +1 -1
  36. package/dist/runtime.js +17 -0
  37. package/dist/runtime.js.map +1 -1
  38. package/dist/runtime.mjs +23 -0
  39. package/dist/runtime.mjs.map +1 -1
  40. package/dist/shared.js +91 -61
  41. package/dist/shared.js.map +1 -1
  42. package/dist/shared.mjs +85 -56
  43. package/dist/shared.mjs.map +1 -1
  44. package/dist/turbopackLoader.js +79 -49
  45. package/dist/turbopackLoader.js.map +1 -1
  46. package/dist/turbopackLoader.mjs +76 -47
  47. package/dist/turbopackLoader.mjs.map +1 -1
  48. package/dist/tw.js +132 -97
  49. package/dist/tw.js.map +1 -1
  50. package/dist/tw.mjs +129 -95
  51. package/dist/tw.mjs.map +1 -1
  52. package/dist/vite.js +157 -127
  53. package/dist/vite.js.map +1 -1
  54. package/dist/vite.mjs +150 -121
  55. package/dist/vite.mjs.map +1 -1
  56. package/dist/webpackLoader.js +39 -9
  57. package/dist/webpackLoader.js.map +1 -1
  58. package/dist/webpackLoader.mjs +36 -7
  59. package/dist/webpackLoader.mjs.map +1 -1
  60. package/package.json +1 -1
  61. package/CHANGELOG.md +0 -182
package/dist/cli.mjs CHANGED
@@ -997,8 +997,8 @@ var require_command = __commonJS({
997
997
  init_esm_shims();
998
998
  var EventEmitter = __require("events").EventEmitter;
999
999
  var childProcess = __require("child_process");
1000
- var path33 = __require("path");
1001
- var fs18 = __require("fs");
1000
+ var path34 = __require("path");
1001
+ var fs19 = __require("fs");
1002
1002
  var process2 = __require("process");
1003
1003
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1004
1004
  var { CommanderError: CommanderError2 } = require_error();
@@ -1930,11 +1930,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
1930
1930
  let launchWithNode = false;
1931
1931
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1932
1932
  function findFile(baseDir, baseName) {
1933
- const localBin = path33.resolve(baseDir, baseName);
1934
- if (fs18.existsSync(localBin)) return localBin;
1935
- if (sourceExt.includes(path33.extname(baseName))) return void 0;
1933
+ const localBin = path34.resolve(baseDir, baseName);
1934
+ if (fs19.existsSync(localBin)) return localBin;
1935
+ if (sourceExt.includes(path34.extname(baseName))) return void 0;
1936
1936
  const foundExt = sourceExt.find(
1937
- (ext) => fs18.existsSync(`${localBin}${ext}`)
1937
+ (ext) => fs19.existsSync(`${localBin}${ext}`)
1938
1938
  );
1939
1939
  if (foundExt) return `${localBin}${foundExt}`;
1940
1940
  return void 0;
@@ -1946,21 +1946,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
1946
1946
  if (this._scriptPath) {
1947
1947
  let resolvedScriptPath;
1948
1948
  try {
1949
- resolvedScriptPath = fs18.realpathSync(this._scriptPath);
1949
+ resolvedScriptPath = fs19.realpathSync(this._scriptPath);
1950
1950
  } catch (err) {
1951
1951
  resolvedScriptPath = this._scriptPath;
1952
1952
  }
1953
- executableDir = path33.resolve(
1954
- path33.dirname(resolvedScriptPath),
1953
+ executableDir = path34.resolve(
1954
+ path34.dirname(resolvedScriptPath),
1955
1955
  executableDir
1956
1956
  );
1957
1957
  }
1958
1958
  if (executableDir) {
1959
1959
  let localFile = findFile(executableDir, executableFile);
1960
1960
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
1961
- const legacyName = path33.basename(
1961
+ const legacyName = path34.basename(
1962
1962
  this._scriptPath,
1963
- path33.extname(this._scriptPath)
1963
+ path34.extname(this._scriptPath)
1964
1964
  );
1965
1965
  if (legacyName !== this._name) {
1966
1966
  localFile = findFile(
@@ -1971,7 +1971,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1971
1971
  }
1972
1972
  executableFile = localFile || executableFile;
1973
1973
  }
1974
- launchWithNode = sourceExt.includes(path33.extname(executableFile));
1974
+ launchWithNode = sourceExt.includes(path34.extname(executableFile));
1975
1975
  let proc;
1976
1976
  if (process2.platform !== "win32") {
1977
1977
  if (launchWithNode) {
@@ -2811,7 +2811,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2811
2811
  * @return {Command}
2812
2812
  */
2813
2813
  nameFromFilename(filename) {
2814
- this._name = path33.basename(filename, path33.extname(filename));
2814
+ this._name = path34.basename(filename, path34.extname(filename));
2815
2815
  return this;
2816
2816
  }
2817
2817
  /**
@@ -2825,9 +2825,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2825
2825
  * @param {string} [path]
2826
2826
  * @return {(string|null|Command)}
2827
2827
  */
2828
- executableDir(path34) {
2829
- if (path34 === void 0) return this._executableDir;
2830
- this._executableDir = path34;
2828
+ executableDir(path35) {
2829
+ if (path35 === void 0) return this._executableDir;
2830
+ this._executableDir = path35;
2831
2831
  return this;
2832
2832
  }
2833
2833
  /**
@@ -3345,9 +3345,9 @@ function createDebugLogger(namespace, label) {
3345
3345
  }
3346
3346
  };
3347
3347
  }
3348
- function formatIssuePath(path33) {
3349
- if (!path33 || path33.length === 0) return "(root)";
3350
- return path33.map(
3348
+ function formatIssuePath(path34) {
3349
+ if (!path34 || path34.length === 0) return "(root)";
3350
+ return path34.map(
3351
3351
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
3352
3352
  ).join(".");
3353
3353
  }
@@ -3463,8 +3463,8 @@ var init_src = __esm({
3463
3463
  /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */
3464
3464
  static fromZod(err) {
3465
3465
  const first = err.issues?.[0] ?? err.errors?.[0];
3466
- const path33 = formatIssuePath(first?.path);
3467
- const message = first ? `${path33}: ${first.message}` : "Schema validation failed";
3466
+ const path34 = formatIssuePath(first?.path);
3467
+ const message = first ? `${path34}: ${first.message}` : "Schema validation failed";
3468
3468
  return new _TwError("validation", "SCHEMA_VALIDATION_FAILED", message, err);
3469
3469
  }
3470
3470
  static wrap(source, code, err) {
@@ -4020,12 +4020,12 @@ var init_schemas = __esm({
4020
4020
  "use strict";
4021
4021
  init_esm_shims();
4022
4022
  init_src();
4023
- formatIssuePath2 = (path33) => path33.length > 0 ? path33.map(
4023
+ formatIssuePath2 = (path34) => path34.length > 0 ? path34.map(
4024
4024
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
4025
4025
  ).join(".") : "<root>";
4026
4026
  formatIssues = (error) => error.issues.map((issue) => {
4027
- const path33 = formatIssuePath2(issue.path);
4028
- return `${path33}: ${issue.message}`;
4027
+ const path34 = formatIssuePath2(issue.path);
4028
+ return `${path34}: ${issue.message}`;
4029
4029
  }).join("; ");
4030
4030
  parseWithSchema = (schema, data, label) => {
4031
4031
  const parsed = schema.safeParse(data);
@@ -4630,7 +4630,7 @@ var init_schemas2 = __esm({
4630
4630
  "use strict";
4631
4631
  init_esm_shims();
4632
4632
  init_src();
4633
- formatIssuePath3 = (path33) => path33.length > 0 ? path33.map(
4633
+ formatIssuePath3 = (path34) => path34.length > 0 ? path34.map(
4634
4634
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
4635
4635
  ).join(".") : "<root>";
4636
4636
  isPlainObject = (value) => {
@@ -4639,8 +4639,8 @@ var init_schemas2 = __esm({
4639
4639
  return proto === Object.prototype || proto === null;
4640
4640
  };
4641
4641
  formatIssues2 = (error) => error.issues.map((issue) => {
4642
- const path33 = formatIssuePath3(issue.path);
4643
- return `${path33}: ${issue.message}`;
4642
+ const path34 = formatIssuePath3(issue.path);
4643
+ return `${path34}: ${issue.message}`;
4644
4644
  }).join("; ");
4645
4645
  parseWithSchema2 = (schema, data, label) => {
4646
4646
  const parsed = schema.safeParse(data);
@@ -6261,7 +6261,7 @@ var init_nativeBridge = __esm({
6261
6261
  "use strict";
6262
6262
  init_esm_shims();
6263
6263
  init_src();
6264
- _loadNative = (path33) => __require(path33);
6264
+ _loadNative = (path34) => __require(path34);
6265
6265
  log3 = (...args) => {
6266
6266
  if (process.env.DEBUG?.includes("compiler:native")) {
6267
6267
  console.log("[compiler:native]", ...args);
@@ -6413,9 +6413,35 @@ var init_routeGraph = __esm({
6413
6413
  }
6414
6414
  });
6415
6415
 
6416
- // packages/domain/compiler/src/index.ts
6416
+ // packages/domain/compiler/src/semanticComponentAnalyzer.ts
6417
+ var init_semanticComponentAnalyzer = __esm({
6418
+ "packages/domain/compiler/src/semanticComponentAnalyzer.ts"() {
6419
+ "use strict";
6420
+ init_esm_shims();
6421
+ }
6422
+ });
6423
+
6424
+ // packages/domain/compiler/src/typeGeneratorFromMetadata.ts
6425
+ var init_typeGeneratorFromMetadata = __esm({
6426
+ "packages/domain/compiler/src/typeGeneratorFromMetadata.ts"() {
6427
+ "use strict";
6428
+ init_esm_shims();
6429
+ }
6430
+ });
6431
+
6432
+ // packages/domain/compiler/src/typeGenerationPlugin.ts
6417
6433
  import fs14 from "fs";
6418
6434
  import path27 from "path";
6435
+ var init_typeGenerationPlugin = __esm({
6436
+ "packages/domain/compiler/src/typeGenerationPlugin.ts"() {
6437
+ "use strict";
6438
+ init_esm_shims();
6439
+ }
6440
+ });
6441
+
6442
+ // packages/domain/compiler/src/index.ts
6443
+ import fs15 from "fs";
6444
+ import path28 from "path";
6419
6445
  import { createRequire as createRequire4 } from "module";
6420
6446
  var _require3, compileCssFromClasses;
6421
6447
  var init_src4 = __esm({
@@ -6430,6 +6456,9 @@ var init_src4 = __esm({
6430
6456
  init_redis();
6431
6457
  init_watch();
6432
6458
  init_routeGraph();
6459
+ init_semanticComponentAnalyzer();
6460
+ init_typeGeneratorFromMetadata();
6461
+ init_typeGenerationPlugin();
6433
6462
  _require3 = createRequire4(
6434
6463
  typeof __require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : import.meta.url
6435
6464
  );
@@ -8772,7 +8801,7 @@ function figmaVariablesToTokens(variablesData) {
8772
8801
  const tokens = {};
8773
8802
  const { variables = {}, variableCollections = {} } = variablesData;
8774
8803
  for (const [id, variable] of Object.entries(variables)) {
8775
- const collection = variableCollections[variable.variableCollectionId];
8804
+ const collection = variableCollections?.[variable.variableCollectionId];
8776
8805
  if (!collection) continue;
8777
8806
  const modeId = Object.keys(variable.valuesByMode)[0];
8778
8807
  const rawValue = variable.valuesByMode[modeId];
@@ -8787,12 +8816,13 @@ function figmaVariablesToTokens(variablesData) {
8787
8816
  }
8788
8817
  const leafKey = parts[parts.length - 1];
8789
8818
  if (variable.resolvedType === "COLOR") {
8790
- cursor[leafKey] = {
8791
- $value: typeof rawValue === "object" && "r" in rawValue ? figmaColorToHex(rawValue) : String(rawValue),
8792
- $type: "color",
8793
- $description: variable.description || void 0,
8794
- _figmaId: id
8819
+ const token = {
8820
+ $value: typeof rawValue === "object" && rawValue !== null && "r" in rawValue ? figmaColorToHex(rawValue) : String(rawValue),
8821
+ $type: "color"
8795
8822
  };
8823
+ if (variable.description) token.$description = variable.description;
8824
+ token._figmaId = id;
8825
+ cursor[leafKey] = token;
8796
8826
  } else if (variable.resolvedType === "FLOAT") {
8797
8827
  cursor[leafKey] = {
8798
8828
  $value: typeof rawValue === "number" ? `${rawValue}px` : String(rawValue),
@@ -8814,10 +8844,11 @@ function figmaVariablesToTokens(variablesData) {
8814
8844
  init_esm_shims();
8815
8845
  function tokensToFigmaUpdates(tokens, existingVariables = {}) {
8816
8846
  const updates = [];
8817
- function walk(obj, path33 = []) {
8847
+ function walk(obj, path34 = []) {
8818
8848
  for (const [key, val] of Object.entries(obj)) {
8819
- if (val.$value !== void 0) {
8820
- const name = path33.concat(key).map(
8849
+ if (typeof val === "object" && val !== null && "$value" in val) {
8850
+ const tokenVal = val;
8851
+ const name = path34.concat(key).map(
8821
8852
  (p) => p.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("")
8822
8853
  ).join("/");
8823
8854
  const existing = Object.values(existingVariables).find(
@@ -8827,12 +8858,12 @@ function tokensToFigmaUpdates(tokens, existingVariables = {}) {
8827
8858
  updates.push({
8828
8859
  id: existing.id,
8829
8860
  name,
8830
- value: val.$value,
8831
- type: val.$type
8861
+ value: tokenVal.$value,
8862
+ type: tokenVal.$type
8832
8863
  });
8833
8864
  }
8834
- } else if (typeof val === "object" && !val.$type) {
8835
- walk(val, path33.concat(key));
8865
+ } else if (typeof val === "object" && val !== null && !("$type" in val)) {
8866
+ walk(val, path34.concat(key));
8836
8867
  }
8837
8868
  }
8838
8869
  }
@@ -8842,9 +8873,10 @@ function tokensToFigmaUpdates(tokens, existingVariables = {}) {
8842
8873
  function flattenTokens(obj, prefix = "", target = {}) {
8843
8874
  for (const [k, v] of Object.entries(obj)) {
8844
8875
  const key = [prefix, k].filter(Boolean).join(".");
8845
- if (v.$value !== void 0) {
8846
- target[key] = v.$value;
8847
- } else if (typeof v === "object" && !v.$type) {
8876
+ if (typeof v === "object" && v !== null && "$value" in v) {
8877
+ const tokenVal = v;
8878
+ target[key] = tokenVal.$value;
8879
+ } else if (typeof v === "object" && v !== null && !("$type" in v)) {
8848
8880
  flattenTokens(v, key, target);
8849
8881
  }
8850
8882
  }
@@ -8875,7 +8907,7 @@ var figmaCommand = {
8875
8907
  const FIGMA_FILE_KEY = process.env.FIGMA_FILE_KEY;
8876
8908
  const TOKEN_FILE = path24.join(context.cwd, "tokens.sync.json");
8877
8909
  if (!cmd || cmd === "help") {
8878
- context.output.log(`Usage: tw figma <pull|push|diff> [--dry-run]
8910
+ context.output.writeText(`Usage: tw figma <pull|push|diff> [--dry-run]
8879
8911
 
8880
8912
  Environment variables:
8881
8913
  FIGMA_TOKEN \u2014 Figma personal access token (figd_...)
@@ -8897,16 +8929,18 @@ Options:
8897
8929
  );
8898
8930
  }
8899
8931
  try {
8900
- context.output.status("[figma] Fetching Figma variables...");
8932
+ const spinner = context.output.spinner();
8933
+ spinner.start("Fetching Figma variables...");
8901
8934
  const data = await figmaRequest("/files/:fileKey/variables/local", {
8902
8935
  token: FIGMA_TOKEN,
8903
8936
  fileKey: FIGMA_FILE_KEY
8904
8937
  });
8938
+ spinner.stop();
8905
8939
  const tokens = figmaVariablesToTokens(data);
8906
8940
  const variableCount = Object.values(data.variables ?? {}).length;
8907
8941
  if (isDryRun) {
8908
- context.output.log("[figma] DRY RUN \u2014 would write:");
8909
- context.output.log(JSON.stringify({ version: 1, tokens }, null, 2));
8942
+ context.output.info("DRY RUN \u2014 would write:");
8943
+ context.output.writeText(JSON.stringify({ version: 1, tokens }, null, 2));
8910
8944
  } else {
8911
8945
  let existing = { version: 1, tokens: {} };
8912
8946
  if (fs12.existsSync(TOKEN_FILE)) {
@@ -8947,15 +8981,15 @@ Options:
8947
8981
  token: FIGMA_TOKEN,
8948
8982
  fileKey: FIGMA_FILE_KEY
8949
8983
  });
8950
- const updates = tokensToFigmaUpdates(local.tokens ?? {}, data.variables ?? {});
8984
+ const updates = tokensToFigmaUpdates(local.tokens ?? {}, data.variables?.length ? Object.entries(data.variables ?? {}).reduce((acc, [id, v]) => ({ ...acc, [id]: { ...v, id } }), {}) : {});
8951
8985
  if (isDryRun) {
8952
- context.output.log(
8953
- `[figma] DRY RUN \u2014 would update ${updates.length} variables in Figma:`
8986
+ context.output.info(
8987
+ `DRY RUN \u2014 would update ${updates.length} variables in Figma:`
8954
8988
  );
8955
- updates.forEach((u) => context.output.log(` ${u.name}: ${u.value}`));
8989
+ updates.forEach((u) => context.output.writeText(` ${u.name}: ${u.value}`));
8956
8990
  } else {
8957
8991
  if (updates.length === 0) {
8958
- context.output.log("[figma] No matching variables to update");
8992
+ context.output.info("No matching variables to update");
8959
8993
  } else {
8960
8994
  context.output.success(`Updated ${updates.length} variables in Figma`);
8961
8995
  }
@@ -8989,12 +9023,12 @@ Options:
8989
9023
  if (diffs.length === 0) {
8990
9024
  context.output.success("No differences \u2014 local and Figma are in sync");
8991
9025
  } else {
8992
- context.output.log(`${diffs.length} differences found:
9026
+ context.output.info(`${diffs.length} differences found:
8993
9027
  `);
8994
9028
  diffs.forEach((d) => {
8995
- context.output.log(` ${d.key}`);
8996
- context.output.log(` local: ${d.local ?? "(missing)"}`);
8997
- context.output.log(` figma: ${d.figma ?? "(missing)"}`);
9029
+ context.output.writeText(` ${d.key}`);
9030
+ context.output.writeText(` local: ${d.local ?? "(missing)"}`);
9031
+ context.output.writeText(` figma: ${d.figma ?? "(missing)"}`);
8998
9032
  });
8999
9033
  }
9000
9034
  } catch (e) {
@@ -9384,7 +9418,7 @@ init_errors();
9384
9418
  init_fs();
9385
9419
  init_json();
9386
9420
  init_src4();
9387
- import path28 from "path";
9421
+ import path29 from "path";
9388
9422
  import { pathToFileURL as pathToFileURL2 } from "url";
9389
9423
  var DEFAULT_TAILWIND_CSS2 = '@import "tailwindcss";\n';
9390
9424
  var DEFAULT_TW_CONFIG = `${JSON.stringify(
@@ -9411,8 +9445,8 @@ async function validateThemeConfig(cwd2) {
9411
9445
  const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
9412
9446
  let configPath = null;
9413
9447
  for (const file of twConfigFiles) {
9414
- if (await pathExists2(path28.join(cwd2, file))) {
9415
- configPath = path28.join(cwd2, file);
9448
+ if (await pathExists2(path29.join(cwd2, file))) {
9449
+ configPath = path29.join(cwd2, file);
9416
9450
  break;
9417
9451
  }
9418
9452
  }
@@ -9503,7 +9537,7 @@ function resolveCliEntry(scriptPath) {
9503
9537
  async function hasTailwindCssImport(cwd2) {
9504
9538
  const cssFiles = ["src/app/globals.css", "src/index.css", "src/style.css", "app/globals.css"];
9505
9539
  for (const file of cssFiles) {
9506
- const raw = await readFileSafe(path28.join(cwd2, file));
9540
+ const raw = await readFileSafe(path29.join(cwd2, file));
9507
9541
  if (raw?.includes("tailwindcss")) return true;
9508
9542
  }
9509
9543
  return false;
@@ -9519,7 +9553,7 @@ async function hasSafelistSource(cwd2) {
9519
9553
  "app/globals.css"
9520
9554
  ];
9521
9555
  for (const file of cssFiles) {
9522
- const raw = await readFileSafe(path28.join(cwd2, file));
9556
+ const raw = await readFileSafe(path29.join(cwd2, file));
9523
9557
  if (raw === null) continue;
9524
9558
  if (raw.includes("tw-classes")) return { found: true, cssFile: file };
9525
9559
  if (raw.includes("tailwindcss")) return { found: false, cssFile: file };
@@ -9527,8 +9561,8 @@ async function hasSafelistSource(cwd2) {
9527
9561
  return { found: false, cssFile: null };
9528
9562
  }
9529
9563
  async function applyTailwindInit(cwd2) {
9530
- await ensureFileSafe(path28.join(cwd2, "src", "tailwind.css"), DEFAULT_TAILWIND_CSS2);
9531
- await ensureFileSafe(path28.join(cwd2, "tailwind-styled.config.json"), DEFAULT_TW_CONFIG);
9564
+ await ensureFileSafe(path29.join(cwd2, "src", "tailwind.css"), DEFAULT_TAILWIND_CSS2);
9565
+ await ensureFileSafe(path29.join(cwd2, "tailwind-styled.config.json"), DEFAULT_TW_CONFIG);
9532
9566
  }
9533
9567
  function check(results, id, label, pass, message, fix) {
9534
9568
  results.push({ id, label, pass, message, fix });
@@ -9550,7 +9584,7 @@ async function runPreflightCli(rawArgs) {
9550
9584
  node.major >= 20 ? `Node ${node.full} OK` : `Node ${node.full} - requires >=20. Download: https://nodejs.org`,
9551
9585
  node.major < 20 ? "Install Node.js 20 LTS or newer from https://nodejs.org" : void 0
9552
9586
  );
9553
- const pkg = await readJsonSafe(path28.join(cwd2, "package.json"));
9587
+ const pkg = await readJsonSafe(path29.join(cwd2, "package.json"));
9554
9588
  check(
9555
9589
  results,
9556
9590
  "package-json",
@@ -9584,7 +9618,7 @@ async function runPreflightCli(rawArgs) {
9584
9618
  }
9585
9619
  const twConfigFiles = ["tailwind.config.ts", "tailwind.config.js", "tailwind.config.mjs"];
9586
9620
  const twConfigChecks = await Promise.all(
9587
- twConfigFiles.map(async (file) => ({ file, exists: await pathExists2(path28.join(cwd2, file)) }))
9621
+ twConfigFiles.map(async (file) => ({ file, exists: await pathExists2(path29.join(cwd2, file)) }))
9588
9622
  );
9589
9623
  const foundTwConfig = twConfigChecks.find((item) => item.exists)?.file ?? null;
9590
9624
  const hasCssConfig = await hasTailwindCssImport(cwd2);
@@ -9596,7 +9630,7 @@ async function runPreflightCli(rawArgs) {
9596
9630
  foundTwConfig ? `${foundTwConfig} found OK` : hasCssConfig ? "@import tailwindcss found in CSS OK" : "No Tailwind config found - run: tw init",
9597
9631
  "tw init"
9598
9632
  );
9599
- const oldConfig = await readJsonSafe(path28.join(cwd2, "tailwind.config.js")) ?? await readJsonSafe(path28.join(cwd2, "tailwind.config.ts"));
9633
+ const oldConfig = await readJsonSafe(path29.join(cwd2, "tailwind.config.js")) ?? await readJsonSafe(path29.join(cwd2, "tailwind.config.ts"));
9600
9634
  if (oldConfig) {
9601
9635
  const hasOldJit = oldConfig.mode === "jit";
9602
9636
  const hasOldPurge = "purge" in oldConfig;
@@ -9620,7 +9654,7 @@ async function runPreflightCli(rawArgs) {
9620
9654
  validation.message
9621
9655
  );
9622
9656
  }
9623
- const hasTsConfig = await pathExists2(path28.join(cwd2, "tsconfig.json"));
9657
+ const hasTsConfig = await pathExists2(path29.join(cwd2, "tsconfig.json"));
9624
9658
  check(
9625
9659
  results,
9626
9660
  "typescript",
@@ -9982,7 +10016,7 @@ init_esm_shims();
9982
10016
  init_errors();
9983
10017
  init_fs();
9984
10018
  init_json();
9985
- import path29 from "path";
10019
+ import path30 from "path";
9986
10020
  import { parseArgs as parseNodeArgs11 } from "util";
9987
10021
  var storybookCommand = {
9988
10022
  name: "storybook",
@@ -10021,7 +10055,7 @@ var storybookCommand = {
10021
10055
  context.output.writeText(
10022
10056
  `[tw storybook] Tip: use --variants='{"size":["sm","lg"]}' to enumerate variant combinations`
10023
10057
  );
10024
- const localBin = path29.join(
10058
+ const localBin = path30.join(
10025
10059
  process.cwd(),
10026
10060
  "node_modules",
10027
10061
  ".bin",
@@ -11208,10 +11242,10 @@ async function traceClass(className, options) {
11208
11242
  init_esm_shims();
11209
11243
  init_internal();
11210
11244
  init_src2();
11211
- import fs15 from "fs";
11212
- import path30 from "path";
11245
+ import fs16 from "fs";
11246
+ import path31 from "path";
11213
11247
  function toRelativePath(root, value) {
11214
- const relative = path30.relative(root, value);
11248
+ const relative = path31.relative(root, value);
11215
11249
  return relative.length > 0 ? relative : ".";
11216
11250
  }
11217
11251
  function uniqueSorted(values) {
@@ -11280,7 +11314,7 @@ function tryCompileClasses(classes) {
11280
11314
  }
11281
11315
  }
11282
11316
  function traceSingleFile(filePath, root) {
11283
- const source = fs15.readFileSync(filePath, "utf8");
11317
+ const source = fs16.readFileSync(filePath, "utf8");
11284
11318
  const classes = uniqueSorted(scanSource(source));
11285
11319
  const imports = extractImports(source);
11286
11320
  const compiled = tryCompileClasses(classes);
@@ -11311,7 +11345,7 @@ function traceDirectory(targetDir, root) {
11311
11345
  const imports = [];
11312
11346
  const importKeys = /* @__PURE__ */ new Set();
11313
11347
  const files = scanResult.files.filter((entry) => isScannableFile2(entry.file, DEFAULT_EXTENSIONS)).map((entry) => {
11314
- const source = fs15.readFileSync(entry.file, "utf8");
11348
+ const source = fs16.readFileSync(entry.file, "utf8");
11315
11349
  const fileImports = extractImports(source);
11316
11350
  for (const fileImport of fileImports) {
11317
11351
  const key = `${fileImport.kind}:${fileImport.source}`;
@@ -11342,12 +11376,12 @@ function traceDirectory(targetDir, root) {
11342
11376
  };
11343
11377
  }
11344
11378
  async function traceTarget(target, options = {}) {
11345
- const root = path30.resolve(options.root ?? process.cwd());
11346
- const resolvedTarget = path30.resolve(root, target);
11347
- if (!fs15.existsSync(resolvedTarget)) {
11379
+ const root = path31.resolve(options.root ?? process.cwd());
11380
+ const resolvedTarget = path31.resolve(root, target);
11381
+ if (!fs16.existsSync(resolvedTarget)) {
11348
11382
  throw new Error(`Trace target not found: ${resolvedTarget}`);
11349
11383
  }
11350
- const stat = fs15.statSync(resolvedTarget);
11384
+ const stat = fs16.statSync(resolvedTarget);
11351
11385
  if (stat.isDirectory()) {
11352
11386
  return traceDirectory(resolvedTarget, root);
11353
11387
  }
@@ -11512,14 +11546,14 @@ function printClassTraceOutput(result, output) {
11512
11546
  init_esm_shims();
11513
11547
  var import_picocolors6 = __toESM(require_picocolors(), 1);
11514
11548
  init_output();
11515
- import fs16 from "fs";
11516
- import path31 from "path";
11549
+ import fs17 from "fs";
11550
+ import path32 from "path";
11517
11551
  async function runGenerateTypesCli(rawArgs) {
11518
11552
  const output = createCliOutput({ json: rawArgs.includes("--json") });
11519
11553
  const logger = createCliLogger({ output });
11520
11554
  const cwd2 = process.cwd();
11521
11555
  const outFile = rawArgs.find((a) => a.startsWith("--out="))?.slice(6) ?? "src/types/tailwind-styled.d.ts";
11522
- const outPath = path31.resolve(cwd2, outFile);
11556
+ const outPath = path32.resolve(cwd2, outFile);
11523
11557
  output.writeText("");
11524
11558
  output.writeText(import_picocolors6.default.bold(import_picocolors6.default.cyan(" \u25C6 tw generate-types")));
11525
11559
  output.writeText(import_picocolors6.default.dim(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
@@ -11555,12 +11589,12 @@ async function runGenerateTypesCli(rawArgs) {
11555
11589
  }
11556
11590
  output.writeText("");
11557
11591
  output.writeText(import_picocolors6.default.bold(" [2/2]") + import_picocolors6.default.cyan(" generate .d.ts"));
11558
- const outDir = path31.dirname(outPath);
11559
- if (!fs16.existsSync(outDir)) {
11560
- fs16.mkdirSync(outDir, { recursive: true });
11592
+ const outDir = path32.dirname(outPath);
11593
+ if (!fs17.existsSync(outDir)) {
11594
+ fs17.mkdirSync(outDir, { recursive: true });
11561
11595
  }
11562
- fs16.writeFileSync(outPath, result.dtsContent, "utf-8");
11563
- logger.ok(path31.relative(cwd2, outPath));
11596
+ fs17.writeFileSync(outPath, result.dtsContent, "utf-8");
11597
+ logger.ok(path32.relative(cwd2, outPath));
11564
11598
  output.writeText("");
11565
11599
  output.writeText(import_picocolors6.default.dim(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
11566
11600
  output.writeText(import_picocolors6.default.bold(import_picocolors6.default.green(" \u2713 types generated")));
@@ -11571,11 +11605,11 @@ async function runGenerateTypesCli(rawArgs) {
11571
11605
  }
11572
11606
  async function loadNativeBinding2(cwd2) {
11573
11607
  const candidates = [
11574
- path31.join(cwd2, "native", "tailwind-styled-native.node"),
11575
- path31.join(cwd2, "node_modules", "tailwind-styled-v4", "native", "tailwind-styled-native.node")
11608
+ path32.join(cwd2, "native", "tailwind-styled-native.node"),
11609
+ path32.join(cwd2, "node_modules", "tailwind-styled-v4", "native", "tailwind-styled-native.node")
11576
11610
  ];
11577
11611
  for (const candidate of candidates) {
11578
- if (fs16.existsSync(candidate)) {
11612
+ if (fs17.existsSync(candidate)) {
11579
11613
  try {
11580
11614
  return __require(candidate);
11581
11615
  } catch {
@@ -11593,8 +11627,8 @@ import { parseArgs as parseNodeArgs14 } from "util";
11593
11627
  // packages/infrastructure/cli/src/utils/whyService.ts
11594
11628
  init_esm_shims();
11595
11629
  init_internal();
11596
- import fs17 from "fs";
11597
- import path32 from "path";
11630
+ import fs18 from "fs";
11631
+ import path33 from "path";
11598
11632
  init_src2();
11599
11633
  function extractVariantChain(usage) {
11600
11634
  const segments = normalizeScannedClass(usage).split(":").filter(Boolean);
@@ -11642,7 +11676,7 @@ async function whyClass(className, options) {
11642
11676
  for (const file of scanResult.files) {
11643
11677
  const source = (() => {
11644
11678
  try {
11645
- return fs17.readFileSync(file.file, "utf8");
11679
+ return fs18.readFileSync(file.file, "utf8");
11646
11680
  } catch {
11647
11681
  return "";
11648
11682
  }
@@ -11656,7 +11690,7 @@ async function whyClass(className, options) {
11656
11690
  className
11657
11691
  ]);
11658
11692
  usedIn.push({
11659
- file: path32.relative(root, file.file) || path32.basename(file.file),
11693
+ file: path33.relative(root, file.file) || path33.basename(file.file),
11660
11694
  line: location.line,
11661
11695
  column: location.column,
11662
11696
  usage: normalizeScannedClass(fileClass)