tailwind-styled-v4 5.0.36 → 5.0.38

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 (163) hide show
  1. package/dist/analyzer.d.mts +152 -5
  2. package/dist/analyzer.d.ts +152 -5
  3. package/dist/analyzer.js +213 -161
  4. package/dist/analyzer.js.map +1 -1
  5. package/dist/analyzer.mjs +118 -82
  6. package/dist/analyzer.mjs.map +1 -1
  7. package/dist/animate.d.mts +30 -3
  8. package/dist/animate.d.ts +30 -3
  9. package/dist/animate.js +131 -87
  10. package/dist/animate.js.map +1 -1
  11. package/dist/animate.mjs +28 -14
  12. package/dist/animate.mjs.map +1 -1
  13. package/dist/atomic.js +105 -68
  14. package/dist/atomic.js.map +1 -1
  15. package/dist/atomic.mjs +40 -13
  16. package/dist/atomic.mjs.map +1 -1
  17. package/dist/cli.js +577 -426
  18. package/dist/cli.js.map +1 -1
  19. package/dist/cli.mjs +466 -304
  20. package/dist/cli.mjs.map +1 -1
  21. package/dist/compiler.d.mts +5 -0
  22. package/dist/compiler.d.ts +5 -0
  23. package/dist/compiler.js +826 -508
  24. package/dist/compiler.js.map +1 -1
  25. package/dist/compiler.mjs +287 -29
  26. package/dist/compiler.mjs.map +1 -1
  27. package/dist/dashboard.js +71 -41
  28. package/dist/dashboard.js.map +1 -1
  29. package/dist/dashboard.mjs +12 -6
  30. package/dist/dashboard.mjs.map +1 -1
  31. package/dist/devtools.d.mts +88 -2
  32. package/dist/devtools.d.ts +88 -2
  33. package/dist/devtools.js +333 -289
  34. package/dist/devtools.js.map +1 -1
  35. package/dist/devtools.mjs +26 -11
  36. package/dist/devtools.mjs.map +1 -1
  37. package/dist/engine.d.mts +557 -6
  38. package/dist/engine.d.ts +557 -6
  39. package/dist/engine.js +679 -502
  40. package/dist/engine.js.map +1 -1
  41. package/dist/engine.mjs +467 -307
  42. package/dist/engine.mjs.map +1 -1
  43. package/dist/index.d.mts +180 -127
  44. package/dist/index.d.ts +180 -127
  45. package/dist/index.js +1329 -7441
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +1266 -7385
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/next.js +318 -243
  50. package/dist/next.js.map +1 -1
  51. package/dist/next.mjs +256 -181
  52. package/dist/next.mjs.map +1 -1
  53. package/dist/plugin-api.d.mts +4 -2
  54. package/dist/plugin-api.d.ts +4 -2
  55. package/dist/plugin-api.js +93 -49
  56. package/dist/plugin-api.js.map +1 -1
  57. package/dist/plugin-api.mjs +26 -6
  58. package/dist/plugin-api.mjs.map +1 -1
  59. package/dist/plugin-registry.js +103 -62
  60. package/dist/plugin-registry.js.map +1 -1
  61. package/dist/plugin-registry.mjs +53 -35
  62. package/dist/plugin-registry.mjs.map +1 -1
  63. package/dist/plugin.d.mts +165 -5
  64. package/dist/plugin.d.ts +165 -5
  65. package/dist/plugin.js +115 -50
  66. package/dist/plugin.js.map +1 -1
  67. package/dist/plugin.mjs +44 -6
  68. package/dist/plugin.mjs.map +1 -1
  69. package/dist/preset.js +47 -15
  70. package/dist/preset.js.map +1 -1
  71. package/dist/preset.mjs +13 -5
  72. package/dist/preset.mjs.map +1 -1
  73. package/dist/rspack.js +82 -50
  74. package/dist/rspack.js.map +1 -1
  75. package/dist/rspack.mjs +20 -12
  76. package/dist/rspack.mjs.map +1 -1
  77. package/dist/runtime-css.js +62 -24
  78. package/dist/runtime-css.js.map +1 -1
  79. package/dist/runtime-css.mjs +15 -7
  80. package/dist/runtime-css.mjs.map +1 -1
  81. package/dist/runtime.d.mts +38 -3
  82. package/dist/runtime.d.ts +38 -3
  83. package/dist/runtime.js +97 -44
  84. package/dist/runtime.js.map +1 -1
  85. package/dist/runtime.mjs +31 -8
  86. package/dist/runtime.mjs.map +1 -1
  87. package/dist/scanner.d.mts +58 -4
  88. package/dist/scanner.d.ts +58 -4
  89. package/dist/scanner.js +163 -120
  90. package/dist/scanner.js.map +1 -1
  91. package/dist/scanner.mjs +67 -39
  92. package/dist/scanner.mjs.map +1 -1
  93. package/dist/shared.d.mts +185 -3
  94. package/dist/shared.d.ts +185 -3
  95. package/dist/shared.js +441 -295
  96. package/dist/shared.js.map +1 -1
  97. package/dist/shared.mjs +253 -122
  98. package/dist/shared.mjs.map +1 -1
  99. package/dist/storybook-addon.d.mts +2 -2
  100. package/dist/storybook-addon.d.ts +2 -2
  101. package/dist/storybook-addon.js +39 -10
  102. package/dist/storybook-addon.js.map +1 -1
  103. package/dist/storybook-addon.mjs +8 -3
  104. package/dist/storybook-addon.mjs.map +1 -1
  105. package/dist/svelte.d.mts +2 -1
  106. package/dist/svelte.d.ts +2 -1
  107. package/dist/svelte.js +88 -64
  108. package/dist/svelte.js.map +1 -1
  109. package/dist/svelte.mjs +28 -13
  110. package/dist/svelte.mjs.map +1 -1
  111. package/dist/syntax.js +68 -37
  112. package/dist/syntax.js.map +1 -1
  113. package/dist/syntax.mjs +8 -7
  114. package/dist/syntax.mjs.map +1 -1
  115. package/dist/testing.js +55 -18
  116. package/dist/testing.js.map +1 -1
  117. package/dist/testing.mjs +16 -3
  118. package/dist/testing.mjs.map +1 -1
  119. package/dist/theme.d.mts +38 -3
  120. package/dist/theme.d.ts +38 -3
  121. package/dist/theme.js +131 -74
  122. package/dist/theme.js.map +1 -1
  123. package/dist/theme.mjs +42 -13
  124. package/dist/theme.mjs.map +1 -1
  125. package/dist/turbopackLoader.js +150 -116
  126. package/dist/turbopackLoader.js.map +1 -1
  127. package/dist/turbopackLoader.mjs +124 -81
  128. package/dist/turbopackLoader.mjs.map +1 -1
  129. package/dist/tw.js +560 -421
  130. package/dist/tw.js.map +1 -1
  131. package/dist/tw.mjs +460 -302
  132. package/dist/tw.mjs.map +1 -1
  133. package/dist/vite.js +561 -446
  134. package/dist/vite.js.map +1 -1
  135. package/dist/vite.mjs +433 -321
  136. package/dist/vite.mjs.map +1 -1
  137. package/dist/vue.d.mts +4 -1
  138. package/dist/vue.d.ts +4 -1
  139. package/dist/vue.js +95 -70
  140. package/dist/vue.js.map +1 -1
  141. package/dist/vue.mjs +30 -14
  142. package/dist/vue.mjs.map +1 -1
  143. package/dist/webpackLoader.js +110 -78
  144. package/dist/webpackLoader.js.map +1 -1
  145. package/dist/webpackLoader.mjs +45 -17
  146. package/dist/webpackLoader.mjs.map +1 -1
  147. package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
  148. package/native/tailwind-styled-native.node +0 -0
  149. package/package.json +3 -1
  150. package/dist/analyzeWorkspace-B1_XRfdl.d.ts +0 -134
  151. package/dist/analyzeWorkspace-hYfu4Hg3.d.mts +0 -134
  152. package/dist/index-DQI6O24n.d.mts +0 -464
  153. package/dist/index-NDINUhLN.d.mts +0 -90
  154. package/dist/index-NDINUhLN.d.ts +0 -90
  155. package/dist/index-UkYbyBkR.d.ts +0 -464
  156. package/dist/liveTokenEngine-CN9ian1R.d.ts +0 -38
  157. package/dist/liveTokenEngine-DKoWRtqH.d.mts +0 -38
  158. package/dist/schemas-DR-SLxZZ.d.mts +0 -59
  159. package/dist/schemas-DR-SLxZZ.d.ts +0 -59
  160. package/dist/trace-Dz4vmZdy.d.mts +0 -96
  161. package/dist/trace-Dz4vmZdy.d.ts +0 -96
  162. package/dist/types-DXr2PmGP.d.mts +0 -31
  163. package/dist/types-DXr2PmGP.d.ts +0 -31
package/dist/vue.d.mts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { App, Component, DefineComponent } from 'vue';
2
- import { H as HtmlTagName$1, a as VariantValue, b as VariantProps } from './index-NDINUhLN.mjs';
2
+
3
+ type VariantValue = string | number | boolean | undefined;
4
+ type VariantProps = Record<string, VariantValue>;
5
+ type HtmlTagName$1 = keyof HTMLElementTagNameMap;
3
6
 
4
7
  /**
5
8
  * tailwind-styled-v4 — Vue Adapter
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { App, Component, DefineComponent } from 'vue';
2
- import { H as HtmlTagName$1, a as VariantValue, b as VariantProps } from './index-NDINUhLN.js';
2
+
3
+ type VariantValue = string | number | boolean | undefined;
4
+ type VariantProps = Record<string, VariantValue>;
5
+ type HtmlTagName$1 = keyof HTMLElementTagNameMap;
3
6
 
4
7
  /**
5
8
  * tailwind-styled-v4 — Vue Adapter
package/dist/vue.js CHANGED
@@ -1,45 +1,37 @@
1
- 'use strict';
2
-
3
- var module$1 = require('module');
4
- var fs = require('fs');
5
- var path = require('path');
6
- require('crypto');
7
- var url = require('url');
8
- var vue = require('vue');
9
-
10
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
11
- function _interopNamespace(e) {
12
- if (e && e.__esModule) return e;
13
- var n = Object.create(null);
14
- if (e) {
15
- Object.keys(e).forEach(function (k) {
16
- if (k !== 'default') {
17
- var d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: function () { return e[k]; }
21
- });
22
- }
23
- });
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
30
- var path__namespace = /*#__PURE__*/_interopNamespace(path);
31
-
32
1
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
33
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
34
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
35
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
36
- }) : x)(function(x) {
37
- if (typeof require !== "undefined") return require.apply(this, arguments);
38
- throw Error('Dynamic require of "' + x + '" is not supported');
39
- });
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
40
9
  var __esm = (fn, res) => function __init() {
41
10
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
42
11
  };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // packages/domain/shared/src/native-resolution.ts
43
35
  function platformKey() {
44
36
  if (isBrowser) return "browser";
45
37
  return `${process.platform}-${process.arch}`;
@@ -55,7 +47,7 @@ function resolveNativeBinary(runtimeDir) {
55
47
  }
56
48
  const envPath = process.env.TW_NATIVE_PATH?.trim();
57
49
  if (envPath) {
58
- if (fs__namespace.existsSync(envPath)) {
50
+ if (fs.existsSync(envPath)) {
59
51
  return { path: envPath, source: "env", platform, tried };
60
52
  }
61
53
  tried.push(`env:${envPath} (not found)`);
@@ -64,7 +56,7 @@ function resolveNativeBinary(runtimeDir) {
64
56
  for (const pkg of prebuiltPkgs) {
65
57
  try {
66
58
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
67
- if (fs__namespace.existsSync(candidate)) {
59
+ if (fs.existsSync(candidate)) {
68
60
  return { path: candidate, source: "prebuilt", platform, tried };
69
61
  }
70
62
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -75,13 +67,13 @@ function resolveNativeBinary(runtimeDir) {
75
67
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
76
68
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
77
69
  if (runtimeDir) {
78
- for (const depth of ["..", path__namespace.join("..", ".."), path__namespace.join("..", "..", "..")]) {
79
- const pkgRoot = path__namespace.resolve(runtimeDir, depth);
70
+ for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
71
+ const pkgRoot = path.resolve(runtimeDir, depth);
80
72
  for (const bin of BINARY_NAMES_SELF) {
81
73
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
82
- const candidate = path__namespace.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
74
+ const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
83
75
  tried.push(`self-bundled:${candidate}`);
84
- if (fs__namespace.existsSync(candidate)) {
76
+ if (fs.existsSync(candidate)) {
85
77
  return { path: candidate, source: "prebuilt", platform, tried };
86
78
  }
87
79
  }
@@ -93,39 +85,44 @@ function resolveNativeBinary(runtimeDir) {
93
85
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
94
86
  const localCandidates = [];
95
87
  for (const bin of BINARY_NAMES) {
96
- localCandidates.push(path__namespace.resolve(base, `${bin}.node`));
97
- localCandidates.push(path__namespace.resolve(base, "..", `${bin}.node`));
98
- localCandidates.push(path__namespace.resolve(base, `${bin}.${platform}.node`));
99
- localCandidates.push(path__namespace.resolve(base, `${bin}.${napiPlatform}.node`));
88
+ localCandidates.push(path.resolve(base, `${bin}.node`));
89
+ localCandidates.push(path.resolve(base, "..", `${bin}.node`));
90
+ localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
91
+ localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
100
92
  }
101
93
  for (const startDir of [cwd, base]) {
102
94
  let dir = startDir;
103
95
  for (let i = 0; i < 6; i++) {
104
- const nativeDir = path__namespace.resolve(dir, "native");
96
+ const nativeDir = path.resolve(dir, "native");
105
97
  for (const bin of BINARY_NAMES) {
106
- localCandidates.push(path__namespace.resolve(nativeDir, `${bin}.node`));
107
- localCandidates.push(path__namespace.resolve(nativeDir, `${bin}.${platform}.node`));
108
- localCandidates.push(path__namespace.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
109
- localCandidates.push(path__namespace.resolve(nativeDir, "target", "release", `${bin}.node`));
98
+ localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
99
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
100
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
101
+ localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
110
102
  }
111
- const parent = path__namespace.resolve(dir, "..");
103
+ const parent = path.resolve(dir, "..");
112
104
  if (parent === dir) break;
113
105
  dir = parent;
114
106
  }
115
107
  }
116
108
  for (const candidate of localCandidates) {
117
109
  tried.push(`local:${candidate}`);
118
- if (fs__namespace.existsSync(candidate)) {
110
+ if (fs.existsSync(candidate)) {
119
111
  return { path: candidate, source: "local", platform, tried };
120
112
  }
121
113
  }
122
114
  return { path: null, source: "not-found", platform, tried };
123
115
  }
124
- var isBrowser, _require, PLATFORM_MAP;
116
+ var import_node_module, fs, path, import_meta, isBrowser, _require, PLATFORM_MAP;
125
117
  var init_native_resolution = __esm({
126
118
  "packages/domain/shared/src/native-resolution.ts"() {
119
+ "use strict";
120
+ import_node_module = require("module");
121
+ fs = __toESM(require("fs"));
122
+ path = __toESM(require("path"));
123
+ import_meta = {};
127
124
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
128
- _require = typeof __require !== "undefined" ? __require : module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href)));
125
+ _require = typeof require !== "undefined" ? require : (0, import_node_module.createRequire)(import_meta.url);
129
126
  PLATFORM_MAP = {
130
127
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
131
128
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -136,18 +133,42 @@ var init_native_resolution = __esm({
136
133
  };
137
134
  }
138
135
  });
136
+
137
+ // packages/domain/shared/src/index.ts
138
+ var import_node_crypto, import_node_fs, import_node_path, import_node_url, import_node_module2, import_meta2, _require2;
139
139
  var init_src = __esm({
140
140
  "packages/domain/shared/src/index.ts"() {
141
+ "use strict";
142
+ import_node_crypto = require("crypto");
143
+ import_node_fs = __toESM(require("fs"));
144
+ import_node_path = __toESM(require("path"));
145
+ import_node_url = require("url");
146
+ import_node_module2 = require("module");
141
147
  init_native_resolution();
142
- module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href)));
148
+ import_meta2 = {};
149
+ _require2 = (0, import_node_module2.createRequire)(import_meta2.url);
143
150
  }
144
151
  });
145
152
 
153
+ // src/umbrella/vue.ts
154
+ var vue_exports = {};
155
+ __export(vue_exports, {
156
+ TailwindStyledPlugin: () => TailwindStyledPlugin,
157
+ cv: () => cv2,
158
+ extend: () => extend,
159
+ tw: () => tw
160
+ });
161
+ module.exports = __toCommonJS(vue_exports);
162
+
146
163
  // packages/domain/core/src/native.ts
164
+ var import_node_module3 = require("module");
165
+ var import_node_path2 = require("path");
166
+ var import_node_url2 = require("url");
147
167
  init_src();
168
+ var import_meta3 = {};
148
169
  var isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
149
170
  var NATIVE_UNAVAILABLE_MESSAGE = "[tailwind-styled/core] Native binding is required but not available.\nPlease ensure you have run: npm run build:rust";
150
- var _nodeRequire = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href)));
171
+ var _nodeRequire = (0, import_node_module3.createRequire)(import_meta3.url);
151
172
  var _loadNative = (path3) => _nodeRequire(path3);
152
173
  var nativeBinding = null;
153
174
  var bindingLoadAttempted = false;
@@ -161,7 +182,7 @@ var getBinding = () => {
161
182
  }
162
183
  bindingLoadAttempted = true;
163
184
  try {
164
- const runtimeDir = isBrowser2 ? "" : path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href))));
185
+ const runtimeDir = isBrowser2 ? "" : (0, import_node_path2.dirname)((0, import_node_url2.fileURLToPath)(import_meta3.url));
165
186
  const result = isBrowser2 ? { path: null, source: "not-found", platform: "browser", tried: [] } : resolveNativeBinary(runtimeDir);
166
187
  if (result.path && result.path.endsWith(".node")) {
167
188
  const mod = _loadNative(result.path);
@@ -196,6 +217,9 @@ function createTwMerge(_options = {}) {
196
217
  };
197
218
  }
198
219
  var twMerge = createTwMerge();
220
+
221
+ // packages/presentation/vue/src/index.ts
222
+ var import_vue = require("vue");
199
223
  var isVariantValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0;
200
224
  var toVariantProps = (input) => {
201
225
  const props = {};
@@ -235,12 +259,12 @@ function tw(tag, config = {}) {
235
259
  propsDefinition[key] = { type: null, default: void 0 };
236
260
  }
237
261
  propsDefinition.class = { type: null, default: void 0 };
238
- return vue.defineComponent({
262
+ return (0, import_vue.defineComponent)({
239
263
  name: `TwStyled${String(tag).charAt(0).toUpperCase() + String(tag).slice(1)}`,
240
264
  inheritAttrs: false,
241
265
  props: propsDefinition,
242
266
  setup(props, { attrs, slots }) {
243
- const className = vue.computed(() => {
267
+ const className = (0, import_vue.computed)(() => {
244
268
  const variantProps = toVariantProps(props);
245
269
  const attrProps = toVariantProps(attrs);
246
270
  const mergedProps = { ...defaultVariants, ...variantProps, ...attrProps };
@@ -261,7 +285,7 @@ function tw(tag, config = {}) {
261
285
  filteredAttrs[key] = attrs[key];
262
286
  }
263
287
  }
264
- return vue.h(tag, { ...filteredAttrs, class: className.value }, slots.default?.());
288
+ return (0, import_vue.h)(tag, { ...filteredAttrs, class: className.value }, slots.default?.());
265
289
  };
266
290
  }
267
291
  });
@@ -276,12 +300,12 @@ function cv2(config) {
276
300
  };
277
301
  }
278
302
  function extend(component, extraClasses) {
279
- return vue.defineComponent({
303
+ return (0, import_vue.defineComponent)({
280
304
  name: `Extended${("name" in component ? component.name : void 0) ?? "Component"}`,
281
305
  inheritAttrs: false,
282
306
  props: { class: { type: null, default: void 0 } },
283
307
  setup(props, { attrs, slots }) {
284
- return () => vue.h(
308
+ return () => (0, import_vue.h)(
285
309
  component,
286
310
  {
287
311
  ...attrs,
@@ -300,10 +324,11 @@ var TailwindStyledPlugin = {
300
324
  app.provide("cv", cv2);
301
325
  }
302
326
  };
303
-
304
- exports.TailwindStyledPlugin = TailwindStyledPlugin;
305
- exports.cv = cv2;
306
- exports.extend = extend;
307
- exports.tw = tw;
308
- //# sourceMappingURL=vue.js.map
327
+ // Annotate the CommonJS export names for ESM import in node:
328
+ 0 && (module.exports = {
329
+ TailwindStyledPlugin,
330
+ cv,
331
+ extend,
332
+ tw
333
+ });
309
334
  //# sourceMappingURL=vue.js.map
package/dist/vue.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../packages/domain/shared/src/native-resolution.ts","../packages/domain/shared/src/index.ts","../packages/domain/core/src/native.ts","../packages/domain/core/src/merge.ts","../packages/presentation/vue/src/index.ts"],"names":["fs","path","createRequire","isBrowser","dirname","fileURLToPath","twMerge","defineComponent","computed","h","cv"],"mappings":";;;;;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AG,KAAA;AAAA,UACH,OAAO,OAAA,CAAQ,YAAA,EAAc,KAAA,CAAM,KAAA,EAAiB,MAAM,KAAe;AAAA,SAC3E;AAAA,QACA,MAAM,OAAA;AAAU,OAClB;AAAA,IACJ;AAAA,GACD,CAAA;AACH;AAiBO,IAAM,oBAAA,GAAuB;AAAA,EAClC,QAAQ,GAAA,EAAU;AAChB,IAAA,GAAA,CAAI,MAAA,CAAO,iBAAiB,GAAA,GAAM,EAAA;AAClC,IAAA,GAAA,CAAI,MAAA,CAAO,iBAAiB,GAAA,GAAMC,GAAAA;AAClC,IAAA,GAAA,CAAI,OAAA,CAAQ,MAAM,EAAE,CAAA;AACpB,IAAA,GAAA,CAAI,OAAA,CAAQ,MAAMA,GAAE,CAAA;AAAA,EACtB;AACF","file":"vue.js","sourcesContent":["/**\n * Prebuilt binary resolution untuk native NAPI bindings.\n * QA #1: Resolve native binary dari prebuilt packages atau local build.\n *\n * Prioritas:\n * 1. TW_NATIVE_PATH env var (explicit override)\n * 2. Prebuilt binary dari platform-specific npm package\n * 3. Local build dari source (developer mode)\n */\n\nimport { createRequire } from \"node:module\"\nimport * as fs from \"node:fs\"\nimport * as path from \"node:path\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// ESM-safe require — works in both ESM and CJS contexts\nconst _require = typeof require !== \"undefined\" ? require : createRequire(import.meta.url)\n\nexport interface NativeResolutionResult {\n path: string | null\n source: \"env\" | \"prebuilt\" | \"local\" | \"not-found\"\n platform: string\n tried: string[]\n}\n\n/** Platform key → prebuilt npm package name */\nconst PLATFORM_MAP: Record<string, string[]> = {\n \"linux-x64\": [\"@tailwind-styled/native-linux-x64-gnu\", \"@tailwind-styled/native-linux-x64\"],\n \"linux-arm64\": [\"@tailwind-styled/native-linux-arm64-gnu\", \"@tailwind-styled/native-linux-arm64\"],\n \"darwin-x64\": [\"@tailwind-styled/native-darwin-x64\"],\n \"darwin-arm64\": [\"@tailwind-styled/native-darwin-arm64\"],\n \"win32-x64\": [\"@tailwind-styled/native-win32-x64-msvc\", \"@tailwind-styled/native-win32-x64\"],\n \"win32-arm64\": [\"@tailwind-styled/native-win32-arm64-msvc\", \"@tailwind-styled/native-win32-arm64\"],\n}\n\nfunction platformKey(): string {\n if (isBrowser) return \"browser\"\n return `${process.platform}-${process.arch}`\n}\n\n/**\n * Resolve native binary path dari semua sumber yang tersedia.\n *\n * @example\n * const result = resolveNativeBinary()\n * if (result.path) {\n * const binding = require(result.path)\n * } else {\n * throw new Error(\"Native binding not found — run npm run build:rust\")\n * }\n */\nexport function resolveNativeBinary(runtimeDir?: string): NativeResolutionResult {\n const platform = platformKey()\n const tried: string[] = []\n\n if (isBrowser) {\n return { path: null, source: \"not-found\", platform, tried: [\"not available in browser\"] }\n }\n\n // 0. Disabled flag — always short-circuit before any I/O\n // TWS_NO_NATIVE adalah nama canonical; TWS_DISABLE_NATIVE diterima untuk backward compat\n if (process.env.TWS_NO_NATIVE === \"1\" || process.env.TWS_DISABLE_NATIVE === \"1\") {\n return { path: null, source: \"not-found\", platform, tried: [] }\n }\n\n // 1. Env var override\n const envPath = process.env.TW_NATIVE_PATH?.trim()\n if (envPath) {\n if (fs.existsSync(envPath)) {\n return { path: envPath, source: \"env\", platform, tried }\n }\n tried.push(`env:${envPath} (not found)`)\n }\n\n // 2. Prebuilt binary dari platform-specific npm package\n const prebuiltPkgs = PLATFORM_MAP[platform] ?? []\n for (const pkg of prebuiltPkgs) {\n try {\n const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n tried.push(`prebuilt:${pkg} (resolved but missing)`)\n } catch {\n tried.push(`prebuilt:${pkg} (not installed)`)\n }\n }\n\n // 2b. .node file bundled inside this package itself (via \"files\": [\"native/*.node\"])\n // Covers the case where user installs tailwind-styled-v4 directly from npm\n // and the .node file lands at node_modules/tailwind-styled-v4/native/*.node\n const napiPlatform = platform === \"linux-x64\" ? \"linux-x64-gnu\"\n : platform === \"linux-arm64\" ? \"linux-arm64-gnu\"\n : platform\n const BINARY_NAMES_SELF = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n if (runtimeDir) {\n // runtimeDir is typically dist/ — go up to package root, then into native/\n for (const depth of [\"..\", path.join(\"..\", \"..\"), path.join(\"..\", \"..\", \"..\")]) {\n const pkgRoot = path.resolve(runtimeDir, depth)\n for (const bin of BINARY_NAMES_SELF) {\n for (const suffix of [\"\", `.${platform}`, `.${napiPlatform}`]) {\n const candidate = path.resolve(pkgRoot, \"native\", `${bin}${suffix}.node`)\n tried.push(`self-bundled:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n }\n }\n }\n }\n\n // 3. Local build candidates\n const cwd = process.cwd()\n const base = runtimeDir ?? cwd\n // napi-rs naming: platform key may have -gnu suffix on Linux (already computed above)\n\n // Both possible binary names:\n // - \"tailwind_styled_parser\" (old hardcoded name in resolvers)\n // - \"tailwind-styled-native\" (actual binaryName in native/package.json)\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n\n const localCandidates: string[] = []\n\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(base, `${bin}.node`))\n localCandidates.push(path.resolve(base, \"..\", `${bin}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`))\n }\n\n // Walk up from cwd AND base to find repo root native/ dir\n // Needed when npm workspaces sets cwd to the package subdir\n for (const startDir of [cwd, base]) {\n let dir = startDir\n for (let i = 0; i < 6; i++) {\n const nativeDir = path.resolve(dir, \"native\")\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(nativeDir, `${bin}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`))\n localCandidates.push(path.resolve(nativeDir, \"target\", \"release\", `${bin}.node`))\n }\n const parent = path.resolve(dir, \"..\")\n if (parent === dir) break\n dir = parent\n }\n }\n\n for (const candidate of localCandidates) {\n tried.push(`local:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"local\", platform, tried }\n }\n }\n\n return { path: null, source: \"not-found\", platform, tried }\n}\n\n/**\n * Format human-readable error untuk \"binary not found\".\n */\nexport function formatNativeNotFoundError(result: NativeResolutionResult): string {\n const lines = [\n `[tailwind-styled] Native binding not found for ${result.platform}`,\n ``,\n `Tried:`,\n ...result.tried.map(t => ` - ${t}`),\n ``,\n `Solutions:`,\n ` 1. Build locally: npm run build:rust`,\n ` 2. Install prebuilt: npm install @tailwind-styled/native-${result.platform}`,\n ` 3. Override path: TW_NATIVE_PATH=/path/to/parser.node`,\n ]\n return lines.join(\"\\n\")\n}","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(import.meta.url)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","/**\n * tailwind-styled-v5 — Native Rust Bindings\n *\n * All functions require native Rust bindings.\n * Uses @tailwind-styled/shared for native resolution.\n */\n\nimport { createRequire } from \"node:module\"\nimport { dirname } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { resolveNativeBinary } from \"@tailwind-styled/shared\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\nconst NATIVE_UNAVAILABLE_MESSAGE =\n \"[tailwind-styled/core] Native binding is required but not available.\\n\" +\n \"Please ensure you have run: npm run build:rust\"\n\nconst _nodeRequire = createRequire(import.meta.url)\nconst _loadNative = (path: string): unknown => _nodeRequire(path)\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Type Definitions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface ParsedClassModifier {\n type: \"opacity\" | \"arbitrary\"\n value: string\n}\n\nexport interface ParsedClass {\n raw: string\n base: string\n variants: string[]\n modifier?: ParsedClassModifier\n}\n\nexport interface ThemeConfig {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n}\n\ninterface NativeBinding {\n batchSplitClasses?: (input: string[]) => Array<{\n variantKey: string\n base: string\n variants: string[]\n isArbitrary: boolean\n hasModifier: boolean\n }>\n \n twMergeRaw?: (classLists: string[]) => string\n flattenAndResolve?: (nestedJson: string) => string\n resolveConflictGroup?: (base: string) => string\n\n compileTheme?: (themeConfig: string) => { css: string; variables: Record<string, string> }\n extractCssVars?: (css: string) => Record<string, string>\n extractThemeFromCss?: (css: string) => Array<{ key: string; value: string }>\n parseCssRules?: (css: string) => Array<{\n className: string\n property: string\n value: string\n isImportant: boolean\n variants: string[]\n specificity: number\n }>\n parseCssToRules?: (css: string) => string\n detectDeadCode?: (css: string, usedClasses: string[]) => string[]\n classifyKnownClasses?: (classes: string[]) => Array<{ className: string; category: string }>\n detectClassConflicts?: (classes: string) => { conflicts: Array<{ class1: string; class2: string; reason: string }>; conflictedClassNames: string[] }\n resolveVariants?: (configJson: string, propsJson: string) => { classes: string; resolvedCount: number }\n resolveSimpleVariants?: (base: string | null, variants: Record<string, Record<string, string>>, defaults: Record<string, string>, props: Record<string, string>) => string\n /** Parse template literal yang sudah di-join. Menggantikan parseTemplate() di twProxy.ts */\n parseTemplate?: (raw: string) => {\n base: string\n subsJson: string\n hasSubs: boolean\n }\n /** Validate ComponentConfig — menggantikan validateVariantConfig() di cv.ts */\n validateVariantConfig?: (configJson: string) => {\n valid: boolean\n errors: Array<{ errorType: string; key: string; value?: string; message: string }>\n warnings: string[]\n }\n /** Build lookup key untuk generated registry — menggantikan key builder di lookupGenerated() */\n buildVariantLookupKey?: (defaultVariantsJson: string, propsJson: string) => string\n /** Menggantikan cn() — filter+join class names dalam satu Rust pass. (class_utils.rs) */\n resolveClassNames?: (inputs: string[]) => string\n /** tw_merge dengan custom separator dan optional debug */\n twMergeWithSeparator?: (classString: string, opts: { separator?: string; debug?: boolean }) => string\n /** tw_merge_many dengan custom separator */\n twMergeManyWithSeparator?: (classStrings: string[], opts: { separator?: string; debug?: boolean }) => string\n /** conflict-aware Tailwind class merger — port of tailwind-merge. (tw_merge.rs) */\n twMerge?: (classString: string) => string\n /** variadic convenience wrapper untuk twMerge. (tw_merge.rs) */\n twMergeMany?: (classStrings: string[]) => string\n /** Tailwind classes → semicolon-separated inline CSS declarations. (state_css.rs) */\n twClassesToCss?: (classes: string) => string\n /**\n * Generate semua CSS rules untuk satu component dari state config — satu Rust call.\n *\n * Menggantikan JS loop di `injectStateStyles()` dan `generateStateCss()` yang\n * memanggil `twClassesToCss()` per state entry (N × NAPI calls → 1 call).\n *\n * @param id Component state class, e.g. `\"tw-s-abc123\"`\n * @param stateMapJson JSON object `{\"loading\":\"opacity-60 cursor-wait\",\"selected\":\"ring-2\"}`\n * @param resolvedCss Opsional Tailwind pipeline CSS untuk resolve named classes\n * @returns Array of `{ cssRule, stateName, declarations }` — satu per state entry\n */\n generateRuntimeStateCss?: (\n id: string,\n stateMapJson: string,\n resolvedCss: string | null\n ) => Array<{ cssRule: string; stateName: string; declarations: string }>\n /**\n * Hash a content string — menggantikan JS djb2 loop di hashState() dan hashContainer().\n * algorithm: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\" (default: \"md5\")\n * length: potong output hex ke N karakter (mis. 6 untuk short ID)\n */\n hashContent?: (content: string, algorithm?: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\", length?: number) => string\n /** Iterative CSS var() chain resolver. (theme.rs) */\n resolveThemeValue?: (key: string, rawMapJson: string) => string\n /**\n * Parse @theme CSS blocks, classify tokens ke buckets, resolve semua var() —\n * satu Rust call menggantikan extractThemeFromCss() + N × resolveThemeValue().\n * Return ClassifiedThemeConfig: { colors, spacing, fonts, breakpoints, animations, raw }\n */\n extractThemeFromCssClassified?: (css: string) => {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n }\n /**\n * Generate TypeScript interface TailwindStyledThemeTokens dari theme JSON.\n * Build-time CLI only (tw generate-types). Menggantikan generateTypeDefinitions() JS.\n */\n generateTypeDefinitions?: (themeJson: string) => string\n /**\n * Generate `:root { --prefix-group-name: value; ... }` CSS block dari SystemTokenMap.\n *\n * Menggantikan nested JS loop di `injectTokensToRoot()` dan `setTokens()` di `styledSystem.ts`.\n *\n * `tokensJson`: JSON dari `SystemTokenMap` — `{\"colors\":{\"primary\":\"#6366f1\"},\"radius\":{\"base\":\"0.5rem\"}}`\n * `prefix`: CSS variable prefix, e.g. `\"sys\"` → `--sys-colors-primary`\n */\n generateSystemTokenCss?: (tokensJson: string, prefix: string) => string\n /** Parse sub-component block syntax from tw`` template. (tw_merge.rs) */\n parseSubcomponentBlocksNapi?: (template: string, componentName: string) => {\n baseClasses: string\n subMapJson: string\n }\n /** Menggantikan layoutClassesToCss() — static lookup + split dalam satu Rust pass. (container_query.rs) */\n layoutClassesToCss?: (classes: string) => string\n /** Menggantikan buildContainerRules() — generate @container CSS rules. (container_query.rs) */\n buildContainerRules?: (\n id: string,\n breakpoints: Array<{ key: string; classes: string }>,\n containerName: string | null\n ) => string\n /** Pre-generate semua kombinasi boolean states via bitmask (tw_merge.rs) */\n pregenerateStatesNapi?: (states: Record<string, string>) => {\n lookupJson: string\n stateKeys: string[]\n combinations: number\n }\n\n // ── Theme Parsing (napi_bridge_theme_parsing.rs) ───────────────────────────\n parseColorsNapi?: (colorsJson: string) => string | Record<string, string>\n parseSpacingNapi?: (spacingJson: string) => string | Record<string, string>\n parseTransformNapi?: (transformJson: string) => string | Record<string, string>\n normalizeColorNapi?: (color: string, opacity: string) => string\n sanitizeColorNapi?: (color: string) => string\n splitRgbaNapi?: (color: string) => string | { r: number; g: number; b: number; a: number }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Binding Loader\n// ─────────────────────────────────────────────────────────────────────────────\n\nlet nativeBinding: NativeBinding | null = null\nlet bindingLoadAttempted = false\n\nconst getBinding = (): NativeBinding => {\n if (isBrowser) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE + \"\\n\\nNative bindings are not available in browser. Use the compiled CSS output instead.\")\n }\n \n if (nativeBinding) return nativeBinding\n\n if (bindingLoadAttempted) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n\n bindingLoadAttempted = true\n\n try {\n const runtimeDir = isBrowser ? \"\" : dirname(fileURLToPath(import.meta.url))\n const result = isBrowser\n ? { path: null, source: \"not-found\", platform: \"browser\", tried: [] }\n : resolveNativeBinary(runtimeDir)\n\n if (result.path && result.path.endsWith(\".node\")) {\n const mod = _loadNative(result.path) as NativeBinding\n if (mod?.batchSplitClasses) {\n nativeBinding = mod\n return nativeBinding\n }\n }\n\n throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}\\n\\nTried: ${result.tried.join(\"\\n\")}`)\n } catch (err) {\n throw err instanceof Error ? err : new Error(String(err))\n }\n}\n\nexport const resetNativeBinding = (): void => {\n nativeBinding = null\n bindingLoadAttempted = false\n}\n\nexport const getNativeBinding = getBinding\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Parser Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction splitClassListNative(input: string): string[] {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([input])\n if (result.length === 0) return []\n return result[0].base.split(\" \").filter(Boolean)\n}\n\nfunction parseClassTokenNative(rawToken: string): ParsedClass {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([rawToken])\n if (result.length === 0) {\n return { raw: rawToken, base: rawToken, variants: [] }\n }\n const r = result[0]\n const parsed: ParsedClass = {\n raw: r.base,\n base: r.base,\n variants: r.variants,\n }\n if (r.hasModifier) {\n const opacityMatch = r.base.match(/^(.*)\\/(\\d{1,3})$/)\n if (opacityMatch && opacityMatch[1].length > 0) {\n parsed.base = opacityMatch[1]\n parsed.modifier = { type: \"opacity\", value: opacityMatch[2] }\n } else {\n const arbitraryMatch = r.base.match(/\\((--[a-zA-Z0-9_-]+)\\)/)\n if (arbitraryMatch) {\n parsed.modifier = { type: \"arbitrary\", value: arbitraryMatch[1] }\n }\n }\n }\n return parsed\n}\n\nexport function splitClassList(input: string): string[] {\n return splitClassListNative(input)\n}\n\nexport function parseClassToken(rawToken: string): ParsedClass {\n return parseClassTokenNative(rawToken)\n}\n\nexport function parseTailwindClasses(input: string): ParsedClass[] {\n const classes = splitClassListNative(input)\n return classes.map((c) => parseClassTokenNative(c))\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CSS/Theme Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function compileTheme(themeConfig: Record<string, unknown>) {\n const binding = getBinding()\n if (!binding?.compileTheme) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.compileTheme(JSON.stringify(themeConfig))\n}\n\nexport function extractCssVars(css: string): Record<string, string> {\n const binding = getBinding()\n if (!binding?.extractCssVars) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.extractCssVars(css)\n}\n\nexport function parseCssRules(css: string) {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssRules(css)\n}\n\nexport function parseCssToRules(css: string): string {\n const binding = getBinding()\n if (!binding?.parseCssToRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssToRules(css)\n}\n\nexport function detectDeadCode(css: string, usedClasses: string[]): string[] {\n const binding = getBinding()\n if (!binding?.detectDeadCode) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectDeadCode(css, usedClasses)\n}\n\nexport function classifyKnownClasses(classes: string[]) {\n const binding = getBinding()\n if (!binding?.classifyKnownClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.classifyKnownClasses(classes)\n}\n\nexport function detectClassConflicts(classes: string[]) {\n const binding = getBinding()\n if (!binding?.detectClassConflicts) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectClassConflicts(classes.join(\" \"))\n}\n\nexport function extractThemeFromCSS(cssContent: string): ThemeConfig {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n \n const properties = binding.parseCssRules(cssContent)\n const theme: ThemeConfig = {\n colors: {},\n spacing: {},\n fonts: {},\n breakpoints: {},\n animations: {},\n raw: {},\n }\n \n const prefixMap: Record<string, keyof ThemeConfig> = {\n \"color-\": \"colors\",\n \"spacing-\": \"spacing\",\n \"font-\": \"fonts\",\n \"breakpoint-\": \"breakpoints\",\n \"animate-\": \"animations\",\n }\n \n for (const prop of properties) {\n const cssVar = prop.property.replace(/^--/, \"\")\n theme.raw[cssVar] = prop.value\n \n for (const [prefix, category] of Object.entries(prefixMap)) {\n if (cssVar.startsWith(prefix)) {\n const name = cssVar.slice(prefix.length)\n if (name) theme[category][name] = prop.value\n break\n }\n }\n }\n \n return theme\n}","/**\n * tailwind-styled-v4 — createTwMerge()\n * Pure Node.js — requires native Rust binding.\n */\n\nimport { getNativeBinding } from \"./native\"\nimport type { ThemeConfig } from \"./themeReader\"\n\nexport interface MergeOptions {\n prefix?: string\n separator?: string\n theme?: ThemeConfig\n}\n\nexport function createTwMerge(_options: MergeOptions = {}) {\n return function twMerge(...classLists: Array<string | undefined | null | false>): string {\n const inputs: string[] = []\n for (let i = 0; i < classLists.length; i++) {\n const v = classLists[i]\n if (v) inputs.push(String(v))\n }\n if (inputs.length === 0) return \"\"\n\n const native = getNativeBinding()\n if (!native?.twMergeRaw) {\n throw new Error(\"Native binding 'twMergeRaw' is required but not available.\")\n }\n return native.twMergeRaw(inputs)\n }\n}\n\nexport const twMerge = createTwMerge()\n\nexport function mergeWithRules(\n rules: Record<string, (classes: string[]) => string>,\n ...classLists: string[]\n): string {\n const base = twMerge(...classLists)\n const classes = Object.values(rules).reduce(\n (acc, rule) => twMerge(rule(acc)).split(/\\s+/).filter(Boolean),\n base.split(/\\s+/).filter(Boolean)\n )\n return classes.join(\" \")\n}","/**\n * tailwind-styled-v4 — Vue Adapter\n *\n * Pola seperti `createComponent` di React tapi untuk Vue 3 Composition API.\n * Mendukung: base, variants, defaultVariants, compoundVariants.\n *\n * @example\n * import { tw } from '@tailwind-styled/vue'\n *\n * const Button = tw('button', {\n * base: 'px-4 py-2 rounded font-medium',\n * variants: {\n * intent: {\n * primary: 'bg-blue-500 text-white hover:bg-blue-600',\n * danger: 'bg-red-500 text-white hover:bg-red-600',\n * },\n * size: { sm: 'h-8 text-sm', md: 'h-10 text-base', lg: 'h-12 text-lg' },\n * },\n * defaultVariants: { intent: 'primary', size: 'md' },\n * })\n *\n * // In template:\n * // <Button intent=\"danger\" size=\"lg\">Delete</Button>\n */\n\nimport { twMerge } from \"@tailwind-styled/core\"\nimport { type App, type Component, computed, type DefineComponent, defineComponent, h } from \"vue\"\n\nimport type { VariantValue, VariantProps as Props, HtmlTagName as HtmlTag } from '@tailwind-styled/shared'\n\n\nconst isVariantValue = (value: unknown): value is VariantValue =>\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === undefined\n\nconst toVariantProps = (input: Record<string, unknown>): Props => {\n const props: Props = {}\n for (const [key, value] of Object.entries(input)) {\n if (isVariantValue(value)) {\n props[key] = value\n }\n }\n return props\n}\n\nconst toClassName = (value: VariantValue): string | undefined => {\n if (typeof value === \"string\") return value\n if (typeof value === \"number\") return String(value)\n return undefined\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface VueComponentConfig {\n base?: string\n variants?: Record<string, Record<string, string>>\n compoundVariants?: Array<{ class: string; [key: string]: VariantValue }>\n defaultVariants?: Record<string, string>\n}\n\nexport type HtmlTagName = HtmlTag\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Variant resolver (sama dengan React adapter)\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction resolveVariants(\n variants: Record<string, Record<string, string>>,\n props: Props,\n defaults: Record<string, string> = {}\n): string {\n const classes: string[] = []\n for (const key in variants) {\n const val = props[key] ?? defaults[key]\n if (val !== undefined && variants[key][String(val)]) {\n classes.push(variants[key][String(val)])\n }\n }\n return classes.join(\" \")\n}\n\nfunction resolveCompound(\n compounds: Array<{ class: string; [key: string]: VariantValue }>,\n props: Props\n): string {\n return compounds\n .filter((c) => {\n const { class: _cls, ...conditions } = c\n return Object.entries(conditions).every(([k, v]) => props[k] === v)\n })\n .map((c) => c.class)\n .join(\" \")\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Buat Vue component dengan Tailwind class yang terstruktur.\n *\n * @param tag - HTML tag atau Vue component\n * @param config - Konfigurasi base, variants, defaultVariants\n */\nexport function tw<Tag extends HtmlTag>(\n tag: Tag,\n config: VueComponentConfig = {}\n): DefineComponent<Record<string, unknown>> {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n\n const variantKeys = new Set(Object.keys(variants))\n\n // Props definition untuk Vue — semua variant key jadi optional prop\n const propsDefinition: Record<string, { type: null; default: undefined }> = {}\n for (const key of variantKeys) {\n propsDefinition[key] = { type: null, default: undefined }\n }\n propsDefinition.class = { type: null, default: undefined }\n\n return defineComponent({\n name: `TwStyled${String(tag).charAt(0).toUpperCase() + String(tag).slice(1)}`,\n inheritAttrs: false,\n props: propsDefinition,\n setup(props, { attrs, slots }) {\n const className = computed(() => {\n const variantProps = toVariantProps(props as Record<string, unknown>)\n const attrProps = toVariantProps(attrs as Record<string, unknown>)\n const mergedProps = { ...defaultVariants, ...variantProps, ...attrProps }\n const variantClasses = resolveVariants(variants, mergedProps, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, mergedProps)\n return twMerge(\n base,\n variantClasses,\n compoundClasses,\n toClassName(variantProps.class),\n toClassName(attrProps.class)\n )\n })\n\n return () => {\n // Filter out variant props — jangan diteruskan ke HTML element\n const filteredAttrs: Record<string, unknown> = {}\n for (const key in attrs) {\n if (!variantKeys.has(key)) {\n filteredAttrs[key] = attrs[key]\n }\n }\n\n return h(tag as string, { ...filteredAttrs, class: className.value }, slots.default?.())\n }\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// cv() — class variant helper (framework-agnostic, sama dengan React)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Class variant function — returns a class string resolver.\n * Framework-agnostic, bisa dipakai di mana saja.\n *\n * @example\n * const buttonCv = cv({\n * base: 'px-4 py-2 rounded',\n * variants: { size: { sm: 'h-8', lg: 'h-12' } },\n * defaultVariants: { size: 'sm' },\n * })\n *\n * buttonCv({ size: 'lg' }) // 'px-4 py-2 rounded h-12'\n */\nexport function cv(config: VueComponentConfig) {\n return (props: Props = {}) => {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n const merged = { ...defaultVariants, ...props }\n const variantClasses = resolveVariants(variants, merged, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, merged)\n return twMerge(base, variantClasses, compoundClasses, toClassName(props.class))\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Extend — tambahkan class ke komponen yang sudah ada\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Extend komponen Vue yang sudah ada dengan class tambahan.\n *\n * @example\n * const PrimaryButton = extend(Button, 'bg-blue-500 text-white')\n */\nexport function extend(\n component: Component,\n extraClasses: string\n): DefineComponent<Record<string, unknown>> {\n return defineComponent({\n name: `Extended${(\"name\" in component ? component.name : undefined) ?? \"Component\"}`,\n inheritAttrs: false,\n props: { class: { type: null, default: undefined } },\n setup(props, { attrs, slots }) {\n return () =>\n h(\n component,\n {\n ...attrs,\n class: twMerge(extraClasses, props.class as string, attrs.class as string),\n },\n slots.default?.()\n )\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Plugin Vue\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Vue plugin — daftarkan `tw` sebagai global composable.\n *\n * @example\n * // main.ts\n * import { createApp } from 'vue'\n * import { TailwindStyledPlugin } from '@tailwind-styled/vue'\n * import App from './App.vue'\n *\n * createApp(App).use(TailwindStyledPlugin).mount('#app')\n */\nexport const TailwindStyledPlugin = {\n install(app: App) {\n app.config.globalProperties.$tw = tw\n app.config.globalProperties.$cv = cv\n app.provide(\"tw\", tw)\n app.provide(\"cv\", cv)\n },\n}\n"]}
1
+ {"version":3,"sources":["../packages/domain/shared/src/native-resolution.ts","../packages/domain/shared/src/index.ts","../src/umbrella/vue.ts","../packages/domain/core/src/native.ts","../packages/domain/core/src/merge.ts","../packages/presentation/vue/src/index.ts"],"sourcesContent":["/**\n * Prebuilt binary resolution untuk native NAPI bindings.\n * QA #1: Resolve native binary dari prebuilt packages atau local build.\n *\n * Prioritas:\n * 1. TW_NATIVE_PATH env var (explicit override)\n * 2. Prebuilt binary dari platform-specific npm package\n * 3. Local build dari source (developer mode)\n */\n\nimport { createRequire } from \"node:module\"\nimport * as fs from \"node:fs\"\nimport * as path from \"node:path\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// ESM-safe require — works in both ESM and CJS contexts\nconst _require = typeof require !== \"undefined\" ? require : createRequire(import.meta.url)\n\nexport interface NativeResolutionResult {\n path: string | null\n source: \"env\" | \"prebuilt\" | \"local\" | \"not-found\"\n platform: string\n tried: string[]\n}\n\n/** Platform key → prebuilt npm package name */\nconst PLATFORM_MAP: Record<string, string[]> = {\n \"linux-x64\": [\"@tailwind-styled/native-linux-x64-gnu\", \"@tailwind-styled/native-linux-x64\"],\n \"linux-arm64\": [\"@tailwind-styled/native-linux-arm64-gnu\", \"@tailwind-styled/native-linux-arm64\"],\n \"darwin-x64\": [\"@tailwind-styled/native-darwin-x64\"],\n \"darwin-arm64\": [\"@tailwind-styled/native-darwin-arm64\"],\n \"win32-x64\": [\"@tailwind-styled/native-win32-x64-msvc\", \"@tailwind-styled/native-win32-x64\"],\n \"win32-arm64\": [\"@tailwind-styled/native-win32-arm64-msvc\", \"@tailwind-styled/native-win32-arm64\"],\n}\n\nfunction platformKey(): string {\n if (isBrowser) return \"browser\"\n return `${process.platform}-${process.arch}`\n}\n\n/**\n * Resolve native binary path dari semua sumber yang tersedia.\n *\n * @example\n * const result = resolveNativeBinary()\n * if (result.path) {\n * const binding = require(result.path)\n * } else {\n * throw new Error(\"Native binding not found — run npm run build:rust\")\n * }\n */\nexport function resolveNativeBinary(runtimeDir?: string): NativeResolutionResult {\n const platform = platformKey()\n const tried: string[] = []\n\n if (isBrowser) {\n return { path: null, source: \"not-found\", platform, tried: [\"not available in browser\"] }\n }\n\n // 0. Disabled flag — always short-circuit before any I/O\n // TWS_NO_NATIVE adalah nama canonical; TWS_DISABLE_NATIVE diterima untuk backward compat\n if (process.env.TWS_NO_NATIVE === \"1\" || process.env.TWS_DISABLE_NATIVE === \"1\") {\n return { path: null, source: \"not-found\", platform, tried: [] }\n }\n\n // 1. Env var override\n const envPath = process.env.TW_NATIVE_PATH?.trim()\n if (envPath) {\n if (fs.existsSync(envPath)) {\n return { path: envPath, source: \"env\", platform, tried }\n }\n tried.push(`env:${envPath} (not found)`)\n }\n\n // 2. Prebuilt binary dari platform-specific npm package\n const prebuiltPkgs = PLATFORM_MAP[platform] ?? []\n for (const pkg of prebuiltPkgs) {\n try {\n const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n tried.push(`prebuilt:${pkg} (resolved but missing)`)\n } catch {\n tried.push(`prebuilt:${pkg} (not installed)`)\n }\n }\n\n // 2b. .node file bundled inside this package itself (via \"files\": [\"native/*.node\"])\n // Covers the case where user installs tailwind-styled-v4 directly from npm\n // and the .node file lands at node_modules/tailwind-styled-v4/native/*.node\n const napiPlatform = platform === \"linux-x64\" ? \"linux-x64-gnu\"\n : platform === \"linux-arm64\" ? \"linux-arm64-gnu\"\n : platform\n const BINARY_NAMES_SELF = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n if (runtimeDir) {\n // runtimeDir is typically dist/ — go up to package root, then into native/\n for (const depth of [\"..\", path.join(\"..\", \"..\"), path.join(\"..\", \"..\", \"..\")]) {\n const pkgRoot = path.resolve(runtimeDir, depth)\n for (const bin of BINARY_NAMES_SELF) {\n for (const suffix of [\"\", `.${platform}`, `.${napiPlatform}`]) {\n const candidate = path.resolve(pkgRoot, \"native\", `${bin}${suffix}.node`)\n tried.push(`self-bundled:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n }\n }\n }\n }\n\n // 3. Local build candidates\n const cwd = process.cwd()\n const base = runtimeDir ?? cwd\n // napi-rs naming: platform key may have -gnu suffix on Linux (already computed above)\n\n // Both possible binary names:\n // - \"tailwind_styled_parser\" (old hardcoded name in resolvers)\n // - \"tailwind-styled-native\" (actual binaryName in native/package.json)\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n\n const localCandidates: string[] = []\n\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(base, `${bin}.node`))\n localCandidates.push(path.resolve(base, \"..\", `${bin}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`))\n }\n\n // Walk up from cwd AND base to find repo root native/ dir\n // Needed when npm workspaces sets cwd to the package subdir\n for (const startDir of [cwd, base]) {\n let dir = startDir\n for (let i = 0; i < 6; i++) {\n const nativeDir = path.resolve(dir, \"native\")\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(nativeDir, `${bin}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`))\n localCandidates.push(path.resolve(nativeDir, \"target\", \"release\", `${bin}.node`))\n }\n const parent = path.resolve(dir, \"..\")\n if (parent === dir) break\n dir = parent\n }\n }\n\n for (const candidate of localCandidates) {\n tried.push(`local:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"local\", platform, tried }\n }\n }\n\n return { path: null, source: \"not-found\", platform, tried }\n}\n\n/**\n * Format human-readable error untuk \"binary not found\".\n */\nexport function formatNativeNotFoundError(result: NativeResolutionResult): string {\n const lines = [\n `[tailwind-styled] Native binding not found for ${result.platform}`,\n ``,\n `Tried:`,\n ...result.tried.map(t => ` - ${t}`),\n ``,\n `Solutions:`,\n ` 1. Build locally: npm run build:rust`,\n ` 2. Install prebuilt: npm install @tailwind-styled/native-${result.platform}`,\n ` 3. Override path: TW_NATIVE_PATH=/path/to/parser.node`,\n ]\n return lines.join(\"\\n\")\n}","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(import.meta.url)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/vue\"\n","/**\n * tailwind-styled-v5 — Native Rust Bindings\n *\n * All functions require native Rust bindings.\n * Uses @tailwind-styled/shared for native resolution.\n */\n\nimport { createRequire } from \"node:module\"\nimport { dirname } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { resolveNativeBinary } from \"@tailwind-styled/shared\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\nconst NATIVE_UNAVAILABLE_MESSAGE =\n \"[tailwind-styled/core] Native binding is required but not available.\\n\" +\n \"Please ensure you have run: npm run build:rust\"\n\nconst _nodeRequire = createRequire(import.meta.url)\nconst _loadNative = (path: string): unknown => _nodeRequire(path)\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Type Definitions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface ParsedClassModifier {\n type: \"opacity\" | \"arbitrary\"\n value: string\n}\n\nexport interface ParsedClass {\n raw: string\n base: string\n variants: string[]\n modifier?: ParsedClassModifier\n}\n\nexport interface ThemeConfig {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n}\n\ninterface NativeBinding {\n batchSplitClasses?: (input: string[]) => Array<{\n variantKey: string\n base: string\n variants: string[]\n isArbitrary: boolean\n hasModifier: boolean\n }>\n \n twMergeRaw?: (classLists: string[]) => string\n flattenAndResolve?: (nestedJson: string) => string\n resolveConflictGroup?: (base: string) => string\n\n compileTheme?: (themeConfig: string) => { css: string; variables: Record<string, string> }\n extractCssVars?: (css: string) => Record<string, string>\n extractThemeFromCss?: (css: string) => Array<{ key: string; value: string }>\n parseCssRules?: (css: string) => Array<{\n className: string\n property: string\n value: string\n isImportant: boolean\n variants: string[]\n specificity: number\n }>\n parseCssToRules?: (css: string) => string\n detectDeadCode?: (css: string, usedClasses: string[]) => string[]\n classifyKnownClasses?: (classes: string[]) => Array<{ className: string; category: string }>\n detectClassConflicts?: (classes: string) => { conflicts: Array<{ class1: string; class2: string; reason: string }>; conflictedClassNames: string[] }\n resolveVariants?: (configJson: string, propsJson: string) => { classes: string; resolvedCount: number }\n resolveSimpleVariants?: (base: string | null, variants: Record<string, Record<string, string>>, defaults: Record<string, string>, props: Record<string, string>) => string\n /** Parse template literal yang sudah di-join. Menggantikan parseTemplate() di twProxy.ts */\n parseTemplate?: (raw: string) => {\n base: string\n subsJson: string\n hasSubs: boolean\n }\n /** Validate ComponentConfig — menggantikan validateVariantConfig() di cv.ts */\n validateVariantConfig?: (configJson: string) => {\n valid: boolean\n errors: Array<{ errorType: string; key: string; value?: string; message: string }>\n warnings: string[]\n }\n /** Build lookup key untuk generated registry — menggantikan key builder di lookupGenerated() */\n buildVariantLookupKey?: (defaultVariantsJson: string, propsJson: string) => string\n /** Menggantikan cn() — filter+join class names dalam satu Rust pass. (class_utils.rs) */\n resolveClassNames?: (inputs: string[]) => string\n /** tw_merge dengan custom separator dan optional debug */\n twMergeWithSeparator?: (classString: string, opts: { separator?: string; debug?: boolean }) => string\n /** tw_merge_many dengan custom separator */\n twMergeManyWithSeparator?: (classStrings: string[], opts: { separator?: string; debug?: boolean }) => string\n /** conflict-aware Tailwind class merger — port of tailwind-merge. (tw_merge.rs) */\n twMerge?: (classString: string) => string\n /** variadic convenience wrapper untuk twMerge. (tw_merge.rs) */\n twMergeMany?: (classStrings: string[]) => string\n /** Tailwind classes → semicolon-separated inline CSS declarations. (state_css.rs) */\n twClassesToCss?: (classes: string) => string\n /**\n * Generate semua CSS rules untuk satu component dari state config — satu Rust call.\n *\n * Menggantikan JS loop di `injectStateStyles()` dan `generateStateCss()` yang\n * memanggil `twClassesToCss()` per state entry (N × NAPI calls → 1 call).\n *\n * @param id Component state class, e.g. `\"tw-s-abc123\"`\n * @param stateMapJson JSON object `{\"loading\":\"opacity-60 cursor-wait\",\"selected\":\"ring-2\"}`\n * @param resolvedCss Opsional Tailwind pipeline CSS untuk resolve named classes\n * @returns Array of `{ cssRule, stateName, declarations }` — satu per state entry\n */\n generateRuntimeStateCss?: (\n id: string,\n stateMapJson: string,\n resolvedCss: string | null\n ) => Array<{ cssRule: string; stateName: string; declarations: string }>\n /**\n * Hash a content string — menggantikan JS djb2 loop di hashState() dan hashContainer().\n * algorithm: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\" (default: \"md5\")\n * length: potong output hex ke N karakter (mis. 6 untuk short ID)\n */\n hashContent?: (content: string, algorithm?: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\", length?: number) => string\n /** Iterative CSS var() chain resolver. (theme.rs) */\n resolveThemeValue?: (key: string, rawMapJson: string) => string\n /**\n * Parse @theme CSS blocks, classify tokens ke buckets, resolve semua var() —\n * satu Rust call menggantikan extractThemeFromCss() + N × resolveThemeValue().\n * Return ClassifiedThemeConfig: { colors, spacing, fonts, breakpoints, animations, raw }\n */\n extractThemeFromCssClassified?: (css: string) => {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n }\n /**\n * Generate TypeScript interface TailwindStyledThemeTokens dari theme JSON.\n * Build-time CLI only (tw generate-types). Menggantikan generateTypeDefinitions() JS.\n */\n generateTypeDefinitions?: (themeJson: string) => string\n /**\n * Generate `:root { --prefix-group-name: value; ... }` CSS block dari SystemTokenMap.\n *\n * Menggantikan nested JS loop di `injectTokensToRoot()` dan `setTokens()` di `styledSystem.ts`.\n *\n * `tokensJson`: JSON dari `SystemTokenMap` — `{\"colors\":{\"primary\":\"#6366f1\"},\"radius\":{\"base\":\"0.5rem\"}}`\n * `prefix`: CSS variable prefix, e.g. `\"sys\"` → `--sys-colors-primary`\n */\n generateSystemTokenCss?: (tokensJson: string, prefix: string) => string\n /** Parse sub-component block syntax from tw`` template. (tw_merge.rs) */\n parseSubcomponentBlocksNapi?: (template: string, componentName: string) => {\n baseClasses: string\n subMapJson: string\n }\n /** Menggantikan layoutClassesToCss() — static lookup + split dalam satu Rust pass. (container_query.rs) */\n layoutClassesToCss?: (classes: string) => string\n /** Menggantikan buildContainerRules() — generate @container CSS rules. (container_query.rs) */\n buildContainerRules?: (\n id: string,\n breakpoints: Array<{ key: string; classes: string }>,\n containerName: string | null\n ) => string\n /** Pre-generate semua kombinasi boolean states via bitmask (tw_merge.rs) */\n pregenerateStatesNapi?: (states: Record<string, string>) => {\n lookupJson: string\n stateKeys: string[]\n combinations: number\n }\n\n // ── Theme Parsing (napi_bridge_theme_parsing.rs) ───────────────────────────\n parseColorsNapi?: (colorsJson: string) => string | Record<string, string>\n parseSpacingNapi?: (spacingJson: string) => string | Record<string, string>\n parseTransformNapi?: (transformJson: string) => string | Record<string, string>\n normalizeColorNapi?: (color: string, opacity: string) => string\n sanitizeColorNapi?: (color: string) => string\n splitRgbaNapi?: (color: string) => string | { r: number; g: number; b: number; a: number }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Binding Loader\n// ─────────────────────────────────────────────────────────────────────────────\n\nlet nativeBinding: NativeBinding | null = null\nlet bindingLoadAttempted = false\n\nconst getBinding = (): NativeBinding => {\n if (isBrowser) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE + \"\\n\\nNative bindings are not available in browser. Use the compiled CSS output instead.\")\n }\n \n if (nativeBinding) return nativeBinding\n\n if (bindingLoadAttempted) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n\n bindingLoadAttempted = true\n\n try {\n const runtimeDir = isBrowser ? \"\" : dirname(fileURLToPath(import.meta.url))\n const result = isBrowser\n ? { path: null, source: \"not-found\", platform: \"browser\", tried: [] }\n : resolveNativeBinary(runtimeDir)\n\n if (result.path && result.path.endsWith(\".node\")) {\n const mod = _loadNative(result.path) as NativeBinding\n if (mod?.batchSplitClasses) {\n nativeBinding = mod\n return nativeBinding\n }\n }\n\n throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}\\n\\nTried: ${result.tried.join(\"\\n\")}`)\n } catch (err) {\n throw err instanceof Error ? err : new Error(String(err))\n }\n}\n\nexport const resetNativeBinding = (): void => {\n nativeBinding = null\n bindingLoadAttempted = false\n}\n\nexport const getNativeBinding = getBinding\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Parser Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction splitClassListNative(input: string): string[] {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([input])\n if (result.length === 0) return []\n return result[0].base.split(\" \").filter(Boolean)\n}\n\nfunction parseClassTokenNative(rawToken: string): ParsedClass {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([rawToken])\n if (result.length === 0) {\n return { raw: rawToken, base: rawToken, variants: [] }\n }\n const r = result[0]\n const parsed: ParsedClass = {\n raw: r.base,\n base: r.base,\n variants: r.variants,\n }\n if (r.hasModifier) {\n const opacityMatch = r.base.match(/^(.*)\\/(\\d{1,3})$/)\n if (opacityMatch && opacityMatch[1].length > 0) {\n parsed.base = opacityMatch[1]\n parsed.modifier = { type: \"opacity\", value: opacityMatch[2] }\n } else {\n const arbitraryMatch = r.base.match(/\\((--[a-zA-Z0-9_-]+)\\)/)\n if (arbitraryMatch) {\n parsed.modifier = { type: \"arbitrary\", value: arbitraryMatch[1] }\n }\n }\n }\n return parsed\n}\n\nexport function splitClassList(input: string): string[] {\n return splitClassListNative(input)\n}\n\nexport function parseClassToken(rawToken: string): ParsedClass {\n return parseClassTokenNative(rawToken)\n}\n\nexport function parseTailwindClasses(input: string): ParsedClass[] {\n const classes = splitClassListNative(input)\n return classes.map((c) => parseClassTokenNative(c))\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CSS/Theme Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function compileTheme(themeConfig: Record<string, unknown>) {\n const binding = getBinding()\n if (!binding?.compileTheme) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.compileTheme(JSON.stringify(themeConfig))\n}\n\nexport function extractCssVars(css: string): Record<string, string> {\n const binding = getBinding()\n if (!binding?.extractCssVars) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.extractCssVars(css)\n}\n\nexport function parseCssRules(css: string) {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssRules(css)\n}\n\nexport function parseCssToRules(css: string): string {\n const binding = getBinding()\n if (!binding?.parseCssToRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssToRules(css)\n}\n\nexport function detectDeadCode(css: string, usedClasses: string[]): string[] {\n const binding = getBinding()\n if (!binding?.detectDeadCode) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectDeadCode(css, usedClasses)\n}\n\nexport function classifyKnownClasses(classes: string[]) {\n const binding = getBinding()\n if (!binding?.classifyKnownClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.classifyKnownClasses(classes)\n}\n\nexport function detectClassConflicts(classes: string[]) {\n const binding = getBinding()\n if (!binding?.detectClassConflicts) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectClassConflicts(classes.join(\" \"))\n}\n\nexport function extractThemeFromCSS(cssContent: string): ThemeConfig {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n \n const properties = binding.parseCssRules(cssContent)\n const theme: ThemeConfig = {\n colors: {},\n spacing: {},\n fonts: {},\n breakpoints: {},\n animations: {},\n raw: {},\n }\n \n const prefixMap: Record<string, keyof ThemeConfig> = {\n \"color-\": \"colors\",\n \"spacing-\": \"spacing\",\n \"font-\": \"fonts\",\n \"breakpoint-\": \"breakpoints\",\n \"animate-\": \"animations\",\n }\n \n for (const prop of properties) {\n const cssVar = prop.property.replace(/^--/, \"\")\n theme.raw[cssVar] = prop.value\n \n for (const [prefix, category] of Object.entries(prefixMap)) {\n if (cssVar.startsWith(prefix)) {\n const name = cssVar.slice(prefix.length)\n if (name) theme[category][name] = prop.value\n break\n }\n }\n }\n \n return theme\n}","/**\n * tailwind-styled-v4 — createTwMerge()\n * Pure Node.js — requires native Rust binding.\n */\n\nimport { getNativeBinding } from \"./native\"\nimport type { ThemeConfig } from \"./themeReader\"\n\nexport interface MergeOptions {\n prefix?: string\n separator?: string\n theme?: ThemeConfig\n}\n\nexport function createTwMerge(_options: MergeOptions = {}) {\n return function twMerge(...classLists: Array<string | undefined | null | false>): string {\n const inputs: string[] = []\n for (let i = 0; i < classLists.length; i++) {\n const v = classLists[i]\n if (v) inputs.push(String(v))\n }\n if (inputs.length === 0) return \"\"\n\n const native = getNativeBinding()\n if (!native?.twMergeRaw) {\n throw new Error(\"Native binding 'twMergeRaw' is required but not available.\")\n }\n return native.twMergeRaw(inputs)\n }\n}\n\nexport const twMerge = createTwMerge()\n\nexport function mergeWithRules(\n rules: Record<string, (classes: string[]) => string>,\n ...classLists: string[]\n): string {\n const base = twMerge(...classLists)\n const classes = Object.values(rules).reduce(\n (acc, rule) => twMerge(rule(acc)).split(/\\s+/).filter(Boolean),\n base.split(/\\s+/).filter(Boolean)\n )\n return classes.join(\" \")\n}","/**\n * tailwind-styled-v4 — Vue Adapter\n *\n * Pola seperti `createComponent` di React tapi untuk Vue 3 Composition API.\n * Mendukung: base, variants, defaultVariants, compoundVariants.\n *\n * @example\n * import { tw } from '@tailwind-styled/vue'\n *\n * const Button = tw('button', {\n * base: 'px-4 py-2 rounded font-medium',\n * variants: {\n * intent: {\n * primary: 'bg-blue-500 text-white hover:bg-blue-600',\n * danger: 'bg-red-500 text-white hover:bg-red-600',\n * },\n * size: { sm: 'h-8 text-sm', md: 'h-10 text-base', lg: 'h-12 text-lg' },\n * },\n * defaultVariants: { intent: 'primary', size: 'md' },\n * })\n *\n * // In template:\n * // <Button intent=\"danger\" size=\"lg\">Delete</Button>\n */\n\nimport { twMerge } from \"@tailwind-styled/core\"\nimport { type App, type Component, computed, type DefineComponent, defineComponent, h } from \"vue\"\n\nimport type { VariantValue, VariantProps as Props, HtmlTagName as HtmlTag } from '@tailwind-styled/shared'\n\n\nconst isVariantValue = (value: unknown): value is VariantValue =>\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === undefined\n\nconst toVariantProps = (input: Record<string, unknown>): Props => {\n const props: Props = {}\n for (const [key, value] of Object.entries(input)) {\n if (isVariantValue(value)) {\n props[key] = value\n }\n }\n return props\n}\n\nconst toClassName = (value: VariantValue): string | undefined => {\n if (typeof value === \"string\") return value\n if (typeof value === \"number\") return String(value)\n return undefined\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface VueComponentConfig {\n base?: string\n variants?: Record<string, Record<string, string>>\n compoundVariants?: Array<{ class: string; [key: string]: VariantValue }>\n defaultVariants?: Record<string, string>\n}\n\nexport type HtmlTagName = HtmlTag\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Variant resolver (sama dengan React adapter)\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction resolveVariants(\n variants: Record<string, Record<string, string>>,\n props: Props,\n defaults: Record<string, string> = {}\n): string {\n const classes: string[] = []\n for (const key in variants) {\n const val = props[key] ?? defaults[key]\n if (val !== undefined && variants[key][String(val)]) {\n classes.push(variants[key][String(val)])\n }\n }\n return classes.join(\" \")\n}\n\nfunction resolveCompound(\n compounds: Array<{ class: string; [key: string]: VariantValue }>,\n props: Props\n): string {\n return compounds\n .filter((c) => {\n const { class: _cls, ...conditions } = c\n return Object.entries(conditions).every(([k, v]) => props[k] === v)\n })\n .map((c) => c.class)\n .join(\" \")\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Buat Vue component dengan Tailwind class yang terstruktur.\n *\n * @param tag - HTML tag atau Vue component\n * @param config - Konfigurasi base, variants, defaultVariants\n */\nexport function tw<Tag extends HtmlTag>(\n tag: Tag,\n config: VueComponentConfig = {}\n): DefineComponent<Record<string, unknown>> {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n\n const variantKeys = new Set(Object.keys(variants))\n\n // Props definition untuk Vue — semua variant key jadi optional prop\n const propsDefinition: Record<string, { type: null; default: undefined }> = {}\n for (const key of variantKeys) {\n propsDefinition[key] = { type: null, default: undefined }\n }\n propsDefinition.class = { type: null, default: undefined }\n\n return defineComponent({\n name: `TwStyled${String(tag).charAt(0).toUpperCase() + String(tag).slice(1)}`,\n inheritAttrs: false,\n props: propsDefinition,\n setup(props, { attrs, slots }) {\n const className = computed(() => {\n const variantProps = toVariantProps(props as Record<string, unknown>)\n const attrProps = toVariantProps(attrs as Record<string, unknown>)\n const mergedProps = { ...defaultVariants, ...variantProps, ...attrProps }\n const variantClasses = resolveVariants(variants, mergedProps, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, mergedProps)\n return twMerge(\n base,\n variantClasses,\n compoundClasses,\n toClassName(variantProps.class),\n toClassName(attrProps.class)\n )\n })\n\n return () => {\n // Filter out variant props — jangan diteruskan ke HTML element\n const filteredAttrs: Record<string, unknown> = {}\n for (const key in attrs) {\n if (!variantKeys.has(key)) {\n filteredAttrs[key] = attrs[key]\n }\n }\n\n return h(tag as string, { ...filteredAttrs, class: className.value }, slots.default?.())\n }\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// cv() — class variant helper (framework-agnostic, sama dengan React)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Class variant function — returns a class string resolver.\n * Framework-agnostic, bisa dipakai di mana saja.\n *\n * @example\n * const buttonCv = cv({\n * base: 'px-4 py-2 rounded',\n * variants: { size: { sm: 'h-8', lg: 'h-12' } },\n * defaultVariants: { size: 'sm' },\n * })\n *\n * buttonCv({ size: 'lg' }) // 'px-4 py-2 rounded h-12'\n */\nexport function cv(config: VueComponentConfig) {\n return (props: Props = {}) => {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n const merged = { ...defaultVariants, ...props }\n const variantClasses = resolveVariants(variants, merged, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, merged)\n return twMerge(base, variantClasses, compoundClasses, toClassName(props.class))\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Extend — tambahkan class ke komponen yang sudah ada\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Extend komponen Vue yang sudah ada dengan class tambahan.\n *\n * @example\n * const PrimaryButton = extend(Button, 'bg-blue-500 text-white')\n */\nexport function extend(\n component: Component,\n extraClasses: string\n): DefineComponent<Record<string, unknown>> {\n return defineComponent({\n name: `Extended${(\"name\" in component ? component.name : undefined) ?? \"Component\"}`,\n inheritAttrs: false,\n props: { class: { type: null, default: undefined } },\n setup(props, { attrs, slots }) {\n return () =>\n h(\n component,\n {\n ...attrs,\n class: twMerge(extraClasses, props.class as string, attrs.class as string),\n },\n slots.default?.()\n )\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Plugin Vue\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Vue plugin — daftarkan `tw` sebagai global composable.\n *\n * @example\n * // main.ts\n * import { createApp } from 'vue'\n * import { TailwindStyledPlugin } from '@tailwind-styled/vue'\n * import App from './App.vue'\n *\n * createApp(App).use(TailwindStyledPlugin).mount('#app')\n */\nexport const TailwindStyledPlugin = {\n install(app: App) {\n app.config.globalProperties.$tw = tw\n app.config.globalProperties.$cv = cv\n app.provide(\"tw\", tw)\n app.provide(\"cv\", cv)\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,cAAsB;AAC7B,MAAI,UAAW,QAAO;AACtB,SAAO,GAAG,QAAQ,QAAQ,IAAI,QAAQ,IAAI;AAC5C;AAaO,SAAS,oBAAoB,YAA6C;AAC/E,QAAM,WAAW,YAAY;AAC7B,QAAM,QAAkB,CAAC;AAEzB,MAAI,WAAW;AACb,WAAO,EAAE,MAAM,MAAM,QAAQ,aAAa,UAAU,OAAO,CAAC,0BAA0B,EAAE;AAAA,EAC1F;AAIA,MAAI,QAAQ,IAAI,kBAAkB,OAAO,QAAQ,IAAI,uBAAuB,KAAK;AAC/E,WAAO,EAAE,MAAM,MAAM,QAAQ,aAAa,UAAU,OAAO,CAAC,EAAE;AAAA,EAChE;AAGA,QAAM,UAAU,QAAQ,IAAI,gBAAgB,KAAK;AACjD,MAAI,SAAS;AACX,QAAO,cAAW,OAAO,GAAG;AAC1B,aAAO,EAAE,MAAM,SAAS,QAAQ,OAAO,UAAU,MAAM;AAAA,IACzD;AACA,UAAM,KAAK,OAAO,OAAO,cAAc;AAAA,EACzC;AA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SAAS,OAAU,EAAE;AAAA,IACnD,MAAM,OAAO,EAAE,OAAO,MAAM,GAAG;AAC7B,aAAO,UACL;AAAA,QACE;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,OAAO,QAAQ,cAAc,MAAM,OAAiB,MAAM,KAAe;AAAA,QAC3E;AAAA,QACA,MAAM,UAAU;AAAA,MAClB;AAAA,IACJ;AAAA,EACF,CAAC;AACH;AAiBO,IAAM,uBAAuB;AAAA,EAClC,QAAQ,KAAU;AAChB,QAAI,OAAO,iBAAiB,MAAM;AAClC,QAAI,OAAO,iBAAiB,MAAMA;AAClC,QAAI,QAAQ,MAAM,EAAE;AACpB,QAAI,QAAQ,MAAMA,GAAE;AAAA,EACtB;AACF;","names":["import_node_module","import_meta","_require","cv","import_node_module","import_node_path","import_node_url","import_meta","isBrowser","path","twMerge","cv"]}