@tamagui/tailwind 0.0.0-bootstrap.0 → 3.0.0-beta.1097.1

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 (97) hide show
  1. package/dist/cjs/candidate.cjs +540 -0
  2. package/dist/cjs/candidate.native.cjs +578 -0
  3. package/dist/cjs/candidate.native.js +580 -0
  4. package/dist/cjs/candidate.native.js.map +1 -0
  5. package/dist/cjs/compose.cjs +352 -0
  6. package/dist/cjs/compose.native.cjs +358 -0
  7. package/dist/cjs/compose.native.js +360 -0
  8. package/dist/cjs/compose.native.js.map +1 -0
  9. package/dist/cjs/composedResolver.cjs +175 -0
  10. package/dist/cjs/composedResolver.native.cjs +201 -0
  11. package/dist/cjs/composedResolver.native.js +203 -0
  12. package/dist/cjs/composedResolver.native.js.map +1 -0
  13. package/dist/cjs/frontend.cjs +54 -0
  14. package/dist/cjs/frontend.native.cjs +62 -0
  15. package/dist/cjs/frontend.native.js +64 -0
  16. package/dist/cjs/frontend.native.js.map +1 -0
  17. package/dist/cjs/index.cjs +38 -0
  18. package/dist/cjs/index.native.cjs +40 -0
  19. package/dist/cjs/index.native.js +42 -0
  20. package/dist/cjs/index.native.js.map +1 -0
  21. package/dist/cjs/styled.cjs +29 -0
  22. package/dist/cjs/styled.native.cjs +31 -0
  23. package/dist/cjs/styled.native.js +33 -0
  24. package/dist/cjs/styled.native.js.map +1 -0
  25. package/dist/cjs/types.cjs +16 -0
  26. package/dist/cjs/types.native.cjs +18 -0
  27. package/dist/cjs/types.native.js +20 -0
  28. package/dist/cjs/types.native.js.map +1 -0
  29. package/dist/cjs/vite/state.cjs +249 -0
  30. package/dist/cjs/vite/state.native.cjs +331 -0
  31. package/dist/cjs/vite/state.native.js +333 -0
  32. package/dist/cjs/vite/state.native.js.map +1 -0
  33. package/dist/cjs/vite.cjs +147 -0
  34. package/dist/cjs/vite.native.cjs +187 -0
  35. package/dist/cjs/vite.native.js +189 -0
  36. package/dist/cjs/vite.native.js.map +1 -0
  37. package/dist/esm/candidate.mjs +514 -0
  38. package/dist/esm/candidate.mjs.map +1 -0
  39. package/dist/esm/candidate.native.js +550 -0
  40. package/dist/esm/candidate.native.js.map +1 -0
  41. package/dist/esm/compose.mjs +328 -0
  42. package/dist/esm/compose.mjs.map +1 -0
  43. package/dist/esm/compose.native.js +332 -0
  44. package/dist/esm/compose.native.js.map +1 -0
  45. package/dist/esm/composedResolver.mjs +155 -0
  46. package/dist/esm/composedResolver.mjs.map +1 -0
  47. package/dist/esm/composedResolver.native.js +179 -0
  48. package/dist/esm/composedResolver.native.js.map +1 -0
  49. package/dist/esm/frontend.mjs +32 -0
  50. package/dist/esm/frontend.mjs.map +1 -0
  51. package/dist/esm/frontend.native.js +38 -0
  52. package/dist/esm/frontend.native.js.map +1 -0
  53. package/dist/esm/index.mjs +11 -0
  54. package/dist/esm/index.mjs.map +1 -0
  55. package/dist/esm/index.native.js +11 -0
  56. package/dist/esm/index.native.js.map +1 -0
  57. package/dist/esm/styled.mjs +10 -0
  58. package/dist/esm/styled.mjs.map +1 -0
  59. package/dist/esm/styled.native.js +10 -0
  60. package/dist/esm/styled.native.js.map +1 -0
  61. package/dist/esm/types.mjs +0 -0
  62. package/dist/esm/types.native.js +0 -0
  63. package/dist/esm/vite/state.mjs +216 -0
  64. package/dist/esm/vite/state.mjs.map +1 -0
  65. package/dist/esm/vite/state.native.js +296 -0
  66. package/dist/esm/vite/state.native.js.map +1 -0
  67. package/dist/esm/vite.mjs +116 -0
  68. package/dist/esm/vite.mjs.map +1 -0
  69. package/dist/esm/vite.native.js +154 -0
  70. package/dist/esm/vite.native.js.map +1 -0
  71. package/package.json +90 -5
  72. package/src/candidate.ts +805 -0
  73. package/src/frontend.ts +73 -0
  74. package/src/index.tsx +35 -0
  75. package/src/styled.tsx +52 -0
  76. package/src/types.ts +249 -0
  77. package/src/vite/state.ts +274 -0
  78. package/src/vite.ts +204 -0
  79. package/types/candidate.d.ts +18 -0
  80. package/types/candidate.d.ts.map +1 -0
  81. package/types/compose.d.ts +19 -0
  82. package/types/compose.d.ts.map +1 -0
  83. package/types/composedResolver.d.ts +18 -0
  84. package/types/composedResolver.d.ts.map +1 -0
  85. package/types/frontend.d.ts +19 -0
  86. package/types/frontend.d.ts.map +1 -0
  87. package/types/index.d.ts +17 -0
  88. package/types/index.d.ts.map +1 -0
  89. package/types/styled.d.ts +12 -0
  90. package/types/styled.d.ts.map +1 -0
  91. package/types/types.d.ts +169 -0
  92. package/types/types.d.ts.map +1 -0
  93. package/types/vite/state.d.ts +28 -0
  94. package/types/vite/state.d.ts.map +1 -0
  95. package/types/vite.d.ts +20 -0
  96. package/types/vite.d.ts.map +1 -0
  97. package/README.md +0 -1
@@ -0,0 +1,179 @@
1
+ function compose(props, keys, build) {
2
+ var conditions = null;
3
+ var present = false;
4
+ for (var index = 0; index < keys.length; index++) {
5
+ var value = props[keys[index]];
6
+ if (value == null) continue;
7
+ present = true;
8
+ if (typeof value === "object" && !Array.isArray(value)) {
9
+ conditions || (conditions = /* @__PURE__ */ new Set());
10
+ for (var condition in value) conditions.add(condition);
11
+ }
12
+ }
13
+ if (!present) return null;
14
+ if (!conditions) return build(function(key) {
15
+ return props[key];
16
+ });
17
+ conditions.add("default");
18
+ var result = {};
19
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
20
+ try {
21
+ var _loop = function() {
22
+ var condition2 = _step.value;
23
+ var value2 = build(function(key) {
24
+ var raw = props[key];
25
+ var _raw_condition;
26
+ return raw && typeof raw === "object" && !Array.isArray(raw) ? (_raw_condition = raw[condition2]) !== null && _raw_condition !== void 0 ? _raw_condition : raw.default : raw;
27
+ });
28
+ if (value2) result[condition2] = value2;
29
+ };
30
+ for (var _iterator = conditions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();
31
+ } catch (err) {
32
+ _didIteratorError = true;
33
+ _iteratorError = err;
34
+ } finally {
35
+ try {
36
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
37
+ _iterator.return();
38
+ }
39
+ } finally {
40
+ if (_didIteratorError) {
41
+ throw _iteratorError;
42
+ }
43
+ }
44
+ }
45
+ return Object.keys(result).length > 0 ? result : null;
46
+ }
47
+ var gradientKeys = [
48
+ "__gradientDirection",
49
+ "__gradientFrom",
50
+ "__gradientVia",
51
+ "__gradientTo"
52
+ ];
53
+ function buildGradient(at) {
54
+ var dir = at("__gradientDirection");
55
+ var from = at("__gradientFrom");
56
+ var via = at("__gradientVia");
57
+ var to = at("__gradientTo");
58
+ if (!dir || !from && !via && !to) return null;
59
+ var start = from || "transparent";
60
+ var end = to || "transparent";
61
+ return via ? `linear-gradient(${dir}, ${start}, ${via}, ${end})` : `linear-gradient(${dir}, ${start}, ${end})`;
62
+ }
63
+ var boxShadowKeys = [
64
+ "__ring",
65
+ "__ringColor",
66
+ "__ringInset",
67
+ "__insetRingWidth",
68
+ "__insetRingColor",
69
+ "__insetShadowGeometry",
70
+ "__insetShadowDefaultColor",
71
+ "__insetShadowColor",
72
+ "__shadow"
73
+ ];
74
+ function buildBoxShadow(at) {
75
+ var shadows = [];
76
+ var insetShadowGeometry = at("__insetShadowGeometry");
77
+ if (insetShadowGeometry) {
78
+ var color = at("__insetShadowColor") || at("__insetShadowDefaultColor") || "rgb(0 0 0 / 0.05)";
79
+ shadows.push(`${insetShadowGeometry} ${color}`.trim());
80
+ }
81
+ var insetRingWidth = at("__insetRingWidth");
82
+ if (insetRingWidth != null) {
83
+ shadows.push(`inset 0 0 0 ${insetRingWidth} ${at("__insetRingColor") || "currentColor"}`);
84
+ }
85
+ var ring = at("__ring");
86
+ if (ring != null) {
87
+ var inset = at("__ringInset") ? "inset " : "";
88
+ shadows.push(`${inset}0 0 0 ${ring} ${at("__ringColor") || "currentColor"}`);
89
+ }
90
+ var shadow = at("__shadow");
91
+ if (shadow && shadow !== "none") shadows.push(shadow);
92
+ return shadows.length > 0 ? shadows.join(", ") : null;
93
+ }
94
+ var filterFunctions = [
95
+ ["__filter_blur", "blur"],
96
+ ["__filter_brightness", "brightness"],
97
+ ["__filter_contrast", "contrast"],
98
+ ["__filter_grayscale", "grayscale"],
99
+ ["__filter_hueRotate", "hue-rotate"],
100
+ ["__filter_invert", "invert"],
101
+ ["__filter_saturate", "saturate"],
102
+ ["__filter_sepia", "sepia"]
103
+ ];
104
+ var filterKeys = [
105
+ "__filter_blur",
106
+ "__filter_brightness",
107
+ "__filter_contrast",
108
+ "__filter_grayscale",
109
+ "__filter_hueRotate",
110
+ "__filter_invert",
111
+ "__filter_saturate",
112
+ "__filter_sepia",
113
+ "__dropShadowGeometry",
114
+ "__dropShadowDefaultColor",
115
+ "__dropShadowColor"
116
+ ];
117
+ function buildFilter(at) {
118
+ var parts = [];
119
+ for (var index = 0; index < filterFunctions.length; index++) {
120
+ var [key, cssName] = filterFunctions[index];
121
+ var value = at(key);
122
+ if (value != null && value !== "") parts.push(`${cssName}(${value})`);
123
+ }
124
+ var geometry = at("__dropShadowGeometry");
125
+ if (geometry) {
126
+ var color = at("__dropShadowColor") || at("__dropShadowDefaultColor") || "rgb(0 0 0 / 0.15)";
127
+ parts.push(`drop-shadow(${geometry} ${color})`.trim());
128
+ }
129
+ return parts.length > 0 ? parts.join(" ") : null;
130
+ }
131
+ var transformFunctions = [
132
+ ["__transform_perspective", "perspective"],
133
+ ["__transform_rotateX", "rotateX"],
134
+ ["__transform_rotateY", "rotateY"],
135
+ ["__transform_rotateZ", "rotateZ"],
136
+ ["__transform_skewX", "skewX"],
137
+ ["__transform_skewY", "skewY"]
138
+ ];
139
+ var transformKeys = transformFunctions.map(function(param) {
140
+ var [key] = param;
141
+ return key;
142
+ });
143
+ function buildTransform(at) {
144
+ var parts = [];
145
+ for (var index = 0; index < transformFunctions.length; index++) {
146
+ var [key, cssName] = transformFunctions[index];
147
+ var value = at(key);
148
+ if (value != null && value !== "") parts.push(`${cssName}(${value})`);
149
+ }
150
+ return parts.length > 0 ? parts.join(" ") : null;
151
+ }
152
+ function composedResolver(props) {
153
+ var result = null;
154
+ var backgroundImage = compose(props, gradientKeys, buildGradient);
155
+ if (backgroundImage) (result !== null && result !== void 0 ? result : result = {}).backgroundImage = backgroundImage;
156
+ if (props.__ring != null || props.__insetRingWidth != null || props.__insetShadowGeometry != null) {
157
+ var boxShadow = compose(props, boxShadowKeys, buildBoxShadow);
158
+ if (boxShadow) (result !== null && result !== void 0 ? result : result = {}).boxShadow = boxShadow;
159
+ }
160
+ var filter = compose(props, filterKeys, buildFilter);
161
+ if (filter) (result !== null && result !== void 0 ? result : result = {}).filter = filter;
162
+ var transform = compose(props, transformKeys, buildTransform);
163
+ if (transform) (result !== null && result !== void 0 ? result : result = {}).transform = transform;
164
+ var preset = props.__textShadow_preset;
165
+ var color = props.__textShadow_color;
166
+ if (preset) {
167
+ result !== null && result !== void 0 ? result : result = {};
168
+ result.textShadowOffset = preset.offset;
169
+ result.textShadowRadius = preset.radius;
170
+ result.textShadowColor = color || preset.defaultColor;
171
+ } else if (color) {
172
+ ;
173
+ (result !== null && result !== void 0 ? result : result = {}).textShadowColor = color;
174
+ }
175
+ return result;
176
+ }
177
+
178
+ export { composedResolver };
179
+ //# sourceMappingURL=composedResolver.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composedResolver.native.js","names":[],"sources":["esm/composedResolver.native.js"],"sourcesContent":["function compose(props, keys, build) {\n var conditions = null;\n var present = false;\n for (var index = 0; index < keys.length; index++) {\n var value = props[keys[index]];\n if (value == null) continue;\n present = true;\n if (typeof value === \"object\" && !Array.isArray(value)) {\n conditions || (conditions = /* @__PURE__ */ new Set());\n for (var condition in value) conditions.add(condition);\n }\n }\n if (!present) return null;\n if (!conditions) return build(function(key) {\n return props[key];\n });\n conditions.add(\"default\");\n var result = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var condition2 = _step.value;\n var value2 = build(function(key) {\n var raw = props[key];\n var _raw_condition;\n return raw && typeof raw === \"object\" && !Array.isArray(raw) ? (_raw_condition = raw[condition2]) !== null && _raw_condition !== void 0 ? _raw_condition : raw.default : raw;\n });\n if (value2) result[condition2] = value2;\n };\n for (var _iterator = conditions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return Object.keys(result).length > 0 ? result : null;\n}\nvar gradientKeys = [\n \"__gradientDirection\",\n \"__gradientFrom\",\n \"__gradientVia\",\n \"__gradientTo\"\n];\nfunction buildGradient(at) {\n var dir = at(\"__gradientDirection\");\n var from = at(\"__gradientFrom\");\n var via = at(\"__gradientVia\");\n var to = at(\"__gradientTo\");\n if (!dir || !from && !via && !to) return null;\n var start = from || \"transparent\";\n var end = to || \"transparent\";\n return via ? `linear-gradient(${dir}, ${start}, ${via}, ${end})` : `linear-gradient(${dir}, ${start}, ${end})`;\n}\nvar boxShadowKeys = [\n \"__ring\",\n \"__ringColor\",\n \"__ringInset\",\n \"__insetRingWidth\",\n \"__insetRingColor\",\n \"__insetShadowGeometry\",\n \"__insetShadowDefaultColor\",\n \"__insetShadowColor\",\n \"__shadow\"\n];\nfunction buildBoxShadow(at) {\n var shadows = [];\n var insetShadowGeometry = at(\"__insetShadowGeometry\");\n if (insetShadowGeometry) {\n var color = at(\"__insetShadowColor\") || at(\"__insetShadowDefaultColor\") || \"rgb(0 0 0 / 0.05)\";\n shadows.push(`${insetShadowGeometry} ${color}`.trim());\n }\n var insetRingWidth = at(\"__insetRingWidth\");\n if (insetRingWidth != null) {\n shadows.push(`inset 0 0 0 ${insetRingWidth} ${at(\"__insetRingColor\") || \"currentColor\"}`);\n }\n var ring = at(\"__ring\");\n if (ring != null) {\n var inset = at(\"__ringInset\") ? \"inset \" : \"\";\n shadows.push(`${inset}0 0 0 ${ring} ${at(\"__ringColor\") || \"currentColor\"}`);\n }\n var shadow = at(\"__shadow\");\n if (shadow && shadow !== \"none\") shadows.push(shadow);\n return shadows.length > 0 ? shadows.join(\", \") : null;\n}\nvar filterFunctions = [\n [\n \"__filter_blur\",\n \"blur\"\n ],\n [\n \"__filter_brightness\",\n \"brightness\"\n ],\n [\n \"__filter_contrast\",\n \"contrast\"\n ],\n [\n \"__filter_grayscale\",\n \"grayscale\"\n ],\n [\n \"__filter_hueRotate\",\n \"hue-rotate\"\n ],\n [\n \"__filter_invert\",\n \"invert\"\n ],\n [\n \"__filter_saturate\",\n \"saturate\"\n ],\n [\n \"__filter_sepia\",\n \"sepia\"\n ]\n];\nvar filterKeys = [\n \"__filter_blur\",\n \"__filter_brightness\",\n \"__filter_contrast\",\n \"__filter_grayscale\",\n \"__filter_hueRotate\",\n \"__filter_invert\",\n \"__filter_saturate\",\n \"__filter_sepia\",\n \"__dropShadowGeometry\",\n \"__dropShadowDefaultColor\",\n \"__dropShadowColor\"\n];\nfunction buildFilter(at) {\n var parts = [];\n for (var index = 0; index < filterFunctions.length; index++) {\n var [key, cssName] = filterFunctions[index];\n var value = at(key);\n if (value != null && value !== \"\") parts.push(`${cssName}(${value})`);\n }\n var geometry = at(\"__dropShadowGeometry\");\n if (geometry) {\n var color = at(\"__dropShadowColor\") || at(\"__dropShadowDefaultColor\") || \"rgb(0 0 0 / 0.15)\";\n parts.push(`drop-shadow(${geometry} ${color})`.trim());\n }\n return parts.length > 0 ? parts.join(\" \") : null;\n}\nvar transformFunctions = [\n [\n \"__transform_perspective\",\n \"perspective\"\n ],\n [\n \"__transform_rotateX\",\n \"rotateX\"\n ],\n [\n \"__transform_rotateY\",\n \"rotateY\"\n ],\n [\n \"__transform_rotateZ\",\n \"rotateZ\"\n ],\n [\n \"__transform_skewX\",\n \"skewX\"\n ],\n [\n \"__transform_skewY\",\n \"skewY\"\n ]\n];\nvar transformKeys = transformFunctions.map(function(param) {\n var [key] = param;\n return key;\n});\nfunction buildTransform(at) {\n var parts = [];\n for (var index = 0; index < transformFunctions.length; index++) {\n var [key, cssName] = transformFunctions[index];\n var value = at(key);\n if (value != null && value !== \"\") parts.push(`${cssName}(${value})`);\n }\n return parts.length > 0 ? parts.join(\" \") : null;\n}\nfunction composedResolver(props) {\n var result = null;\n var backgroundImage = compose(props, gradientKeys, buildGradient);\n if (backgroundImage) (result !== null && result !== void 0 ? result : result = {}).backgroundImage = backgroundImage;\n if (props.__ring != null || props.__insetRingWidth != null || props.__insetShadowGeometry != null) {\n var boxShadow = compose(props, boxShadowKeys, buildBoxShadow);\n if (boxShadow) (result !== null && result !== void 0 ? result : result = {}).boxShadow = boxShadow;\n }\n var filter = compose(props, filterKeys, buildFilter);\n if (filter) (result !== null && result !== void 0 ? result : result = {}).filter = filter;\n var transform = compose(props, transformKeys, buildTransform);\n if (transform) (result !== null && result !== void 0 ? result : result = {}).transform = transform;\n var preset = props.__textShadow_preset;\n var color = props.__textShadow_color;\n if (preset) {\n result !== null && result !== void 0 ? result : result = {};\n result.textShadowOffset = preset.offset;\n result.textShadowRadius = preset.radius;\n result.textShadowColor = color || preset.defaultColor;\n } else if (color) {\n ;\n (result !== null && result !== void 0 ? result : result = {}).textShadowColor = color;\n }\n return result;\n}\nexport {\n composedResolver\n};\n//# sourceMappingURL=composedResolver.js.map\n"],"mappings":";AAAA,SAAS,QAAQ,OAAO,MAAM,OAAO;CACnC,IAAI,aAAa;CACjB,IAAI,UAAU;CACd,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,IAAI,QAAQ,MAAM,KAAK;EACvB,IAAI,SAAS,MAAM;EACnB,UAAU;EACV,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG;GACtD,eAAe,6BAA6B,IAAI,IAAI;GACpD,KAAK,IAAI,aAAa,OAAO,WAAW,IAAI,SAAS;EACvD;CACF;CACA,IAAI,CAAC,S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,YAAY,QAAQ,OAAO,eAAe,cAAc;EAC5D,IAAI,WAAW,CAAC,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,CAAC,EAAC,CAAE,YAAY;CAC3F;CACA,IAAI,SAAS,QAAQ,OAAO,YAAY,WAAW;CACnD,IAAI,QAAQ,CAAC,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,CAAC,EAAC,CAAE,SAAS;CACnF,IAAI,YAAY,QAAQ,OAAO,eAAe,cAAc;CAC5D,IAAI,WAAW,CAAC,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,CAAC,EAAC,CAAE,YAAY;CACzF,IAAI,SAAS,MAAM;CACnB,IAAI,QAAQ,MAAM;CAClB,IAAI,QAAQ;EACV,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,CAAC;EAC1D,OAAO,mBAAmB,OAAO;EACjC,OAAO,mBAAmB,OAAO;EACjC,OAAO,kBAAkB,SAAS,OAAO;CAC3C,OAAO,IAAI,OAAO;EAChB;EACA,CAAC,WAAW,QAAQ,WAAW,KAAK,IAAI,SAAS,SAAS,CAAC,EAAC,CAAE,kBAAkB;CAClF;CACA,OAAO;AACT"}
@@ -0,0 +1,32 @@
1
+ import { resolveTailwindCandidate, resolveTailwindClassName } from "./candidate.mjs";
2
+ import { composedResolver } from "./composedResolver.mjs";
3
+
4
+ function parseStaticStyle(input, config) {
5
+ return resolveTailwindClassName(input, config);
6
+ }
7
+ function normalizeTailwindStaticConfig(staticConfig, config) {
8
+ let variants = staticConfig.variants;
9
+ if (variants) {
10
+ variants = Object.fromEntries(Object.entries(variants).map(([variantName, definition]) => [variantName, typeof definition === "object" && definition ? Object.fromEntries(Object.entries(definition).map(([matcher, value]) => [matcher, typeof value === "string" ? parseStaticStyle(value, config) : value])) : definition]));
11
+ }
12
+ let baseStyle = staticConfig.baseStyle;
13
+ let passthroughClassName = staticConfig.passthroughClassName;
14
+ if (staticConfig.baseClassName) {
15
+ const { className, ...styles } = parseStaticStyle(staticConfig.baseClassName, config);
16
+ baseStyle = styles;
17
+ passthroughClassName = className;
18
+ }
19
+ return {
20
+ baseStyle,
21
+ passthroughClassName,
22
+ variants
23
+ };
24
+ }
25
+ const tailwindStyleFrontend = {
26
+ resolveClassName: resolveTailwindCandidate,
27
+ normalizeStaticConfig: normalizeTailwindStaticConfig,
28
+ compose: composedResolver
29
+ };
30
+
31
+ export { parseStaticStyle, tailwindStyleFrontend };
32
+ //# sourceMappingURL=frontend.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend.js","names":[],"sources":["esm/frontend.js"],"sourcesContent":["import { resolveTailwindCandidate, resolveTailwindClassName } from \"./candidate\";\nimport { composedResolver } from \"./composedResolver\";\nfunction parseStaticStyle(input, config) {\n return resolveTailwindClassName(input, config);\n}\nfunction normalizeTailwindStaticConfig(staticConfig, config) {\n let variants = staticConfig.variants;\n if (variants) {\n variants = Object.fromEntries(\n Object.entries(variants).map(([variantName, definition]) => [\n variantName,\n typeof definition === \"object\" && definition ? Object.fromEntries(\n Object.entries(definition).map(([matcher, value]) => [\n matcher,\n typeof value === \"string\" ? parseStaticStyle(value, config) : value\n ])\n ) : definition\n ])\n );\n }\n let baseStyle = staticConfig.baseStyle;\n let passthroughClassName = staticConfig.passthroughClassName;\n if (staticConfig.baseClassName) {\n const { className, ...styles } = parseStaticStyle(staticConfig.baseClassName, config);\n baseStyle = styles;\n passthroughClassName = className;\n }\n return { baseStyle, passthroughClassName, variants };\n}\nconst tailwindStyleFrontend = {\n resolveClassName: resolveTailwindCandidate,\n normalizeStaticConfig: normalizeTailwindStaticConfig,\n compose: composedResolver\n};\nexport {\n parseStaticStyle,\n tailwindStyleFrontend\n};\n//# sourceMappingURL=frontend.js.map\n"],"mappings":";;;;AAEA,SAAS,iBAAiB,OAAO,QAAQ;CACvC,OAAO,yBAAyB,OAAO,MAAM;AAC/C;AACA,SAAS,8BAA8B,cAAc,QAAQ;CAC3D,IAAI,WAAW,aAAa;CAC5B,IAAI,UAAU;EACZ,WAAW,OAAO,YAChB,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK,CAAC,aAAa,gBAAgB,CAC1D,aACA,OAAO,eAAe,YAAY,aAAa,OAAO,YACpD,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,SAAS,WAAW,CACnD,SACA,OAAO,UAAU,WAAW,iBAAiB,OAAO,MAAM,IAAI,KAChE,CAAC,CACH,IAAI,UACN,CAAC,CACH;CACF;CACA,IAAI,YAAY,aAAa;CAC7B,IAAI,uBAAuB,aAAa;CACxC,IAAI,aAAa,eAAe;EAC9B,MAAM,EAAE,WAAW,GAAG,WAAW,iBAAiB,aAAa,eAAe,MAAM;EACpF,YAAY;EACZ,uBAAuB;CACzB;CACA,OAAO;EAAE;EAAW;EAAsB;CAAS;AACrD;AACA,MAAM,wBAAwB;CAC5B,kBAAkB;CAClB,uBAAuB;CACvB,SAAS;AACX"}
@@ -0,0 +1,38 @@
1
+ import { resolveTailwindCandidate, resolveTailwindClassName } from "./candidate.native.js";
2
+ import { composedResolver } from "./composedResolver.native.js";
3
+
4
+ function parseStaticStyle(input, config) {
5
+ return resolveTailwindClassName(input, config);
6
+ }
7
+ function normalizeTailwindStaticConfig(staticConfig, config) {
8
+ var variants = staticConfig.variants;
9
+ if (variants) {
10
+ variants = Object.fromEntries(Object.entries(variants).map(function(param) {
11
+ var [variantName, definition] = param;
12
+ return [variantName, typeof definition === "object" && definition ? Object.fromEntries(Object.entries(definition).map(function(param2) {
13
+ var [matcher, value] = param2;
14
+ return [matcher, typeof value === "string" ? parseStaticStyle(value, config) : value];
15
+ })) : definition];
16
+ }));
17
+ }
18
+ var baseStyle = staticConfig.baseStyle;
19
+ var passthroughClassName = staticConfig.passthroughClassName;
20
+ if (staticConfig.baseClassName) {
21
+ var { className, ...styles } = parseStaticStyle(staticConfig.baseClassName, config);
22
+ baseStyle = styles;
23
+ passthroughClassName = className;
24
+ }
25
+ return {
26
+ baseStyle,
27
+ passthroughClassName,
28
+ variants
29
+ };
30
+ }
31
+ var tailwindStyleFrontend = {
32
+ resolveClassName: resolveTailwindCandidate,
33
+ normalizeStaticConfig: normalizeTailwindStaticConfig,
34
+ compose: composedResolver
35
+ };
36
+
37
+ export { parseStaticStyle, tailwindStyleFrontend };
38
+ //# sourceMappingURL=frontend.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontend.native.js","names":[],"sources":["esm/frontend.native.js"],"sourcesContent":["import { resolveTailwindCandidate, resolveTailwindClassName } from \"./candidate\";\nimport { composedResolver } from \"./composedResolver\";\nfunction parseStaticStyle(input, config) {\n return resolveTailwindClassName(input, config);\n}\nfunction normalizeTailwindStaticConfig(staticConfig, config) {\n var variants = staticConfig.variants;\n if (variants) {\n variants = Object.fromEntries(Object.entries(variants).map(function(param) {\n var [variantName, definition] = param;\n return [\n variantName,\n typeof definition === \"object\" && definition ? Object.fromEntries(Object.entries(definition).map(function(param2) {\n var [matcher, value] = param2;\n return [\n matcher,\n typeof value === \"string\" ? parseStaticStyle(value, config) : value\n ];\n })) : definition\n ];\n }));\n }\n var baseStyle = staticConfig.baseStyle;\n var passthroughClassName = staticConfig.passthroughClassName;\n if (staticConfig.baseClassName) {\n var { className, ...styles } = parseStaticStyle(staticConfig.baseClassName, config);\n baseStyle = styles;\n passthroughClassName = className;\n }\n return {\n baseStyle,\n passthroughClassName,\n variants\n };\n}\nvar tailwindStyleFrontend = {\n resolveClassName: resolveTailwindCandidate,\n normalizeStaticConfig: normalizeTailwindStaticConfig,\n compose: composedResolver\n};\nexport {\n parseStaticStyle,\n tailwindStyleFrontend\n};\n//# sourceMappingURL=frontend.js.map\n"],"mappings":";;;;AAEA,SAAS,iBAAiB,OAAO,QAAQ;CACvC,OAAO,yBAAyB,OAAO,MAAM;AAC/C;AACA,SAAS,8BAA8B,cAAc,QAAQ;CAC3D,IAAI,WAAW,aAAa;CAC5B,IAAI,UAAU;EACZ,WAAW,OAAO,YAAY,OAAO,QAAQ,QAAQ,CAAC,CAAC,IAAI,SAAS,OAAO;GACzE,IAAI,CAAC,aAAa,cAAc;GAChC,OAAO,CACL,aACA,OAAO,eAAe,YAAY,aAAa,OAAO,YAAY,OAAO,QAAQ,UAAU,CAAC,CAAC,IAAI,SAAS,QAAQ;IAChH,IAAI,CAAC,SAAS,SAAS;IACvB,OAAO,CACL,SACA,OAAO,UAAU,WAAW,iBAAiB,OAAO,MAAM,IAAI,KAChE;GACF,CAAC,CAAC,IAAI,UACR;EACF,CAAC,CAAC;CACJ;CACA,IAAI,YAAY,aAAa;CAC7B,IAAI,uBAAuB,aAAa;CACxC,IAAI,aAAa,eAAe;EAC9B,IAAI,EAAE,WAAW,GAAG,WAAW,iBAAiB,aAAa,eAAe,MAAM;EAClF,YAAY;EACZ,uBAAuB;CACzB;CACA,OAAO;EACL;EACA;EACA;CACF;AACF;AACA,IAAI,wBAAwB;CAC1B,kBAAkB;CAClB,uBAAuB;CACvB,SAAS;AACX"}
@@ -0,0 +1,11 @@
1
+ import { createFrontendHTML, createFrontendViews } from "@tamagui/core/internal-runtime";
2
+ import { parseStaticStyle, tailwindStyleFrontend, tailwindStyleFrontend as tailwindStyleFrontend2 } from "./frontend.mjs";
3
+ import { styled } from "./styled.mjs";
4
+
5
+ const frontendViews = createFrontendViews(tailwindStyleFrontend);
6
+ const View = frontendViews.View;
7
+ const Text = frontendViews.Text;
8
+ const html = createFrontendHTML(tailwindStyleFrontend);
9
+
10
+ export { Text, View, html, parseStaticStyle, styled, tailwindStyleFrontend2 as tailwindStyleFrontend };
11
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import { createFrontendHTML, createFrontendViews } from \"@tamagui/core/internal-runtime\";\nimport { tailwindStyleFrontend } from \"./frontend\";\nimport { styled } from \"./styled\";\nimport { parseStaticStyle, tailwindStyleFrontend as tailwindStyleFrontend2 } from \"./frontend\";\nconst frontendViews = createFrontendViews(tailwindStyleFrontend);\nconst View = frontendViews.View;\nconst Text = frontendViews.Text;\nconst html = createFrontendHTML(tailwindStyleFrontend);\nexport {\n Text,\n View,\n html,\n parseStaticStyle,\n styled,\n tailwindStyleFrontend2 as tailwindStyleFrontend\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;AAIA,MAAM,gBAAgB,oBAAoB,qBAAqB;AAC/D,MAAM,OAAO,cAAc;AAC3B,MAAM,OAAO,cAAc;AAC3B,MAAM,OAAO,mBAAmB,qBAAqB"}
@@ -0,0 +1,11 @@
1
+ import { createFrontendHTML, createFrontendViews } from "@tamagui/core/internal-runtime";
2
+ import { parseStaticStyle, tailwindStyleFrontend, tailwindStyleFrontend as tailwindStyleFrontend2 } from "./frontend.native.js";
3
+ import { styled } from "./styled.native.js";
4
+
5
+ var frontendViews = createFrontendViews(tailwindStyleFrontend);
6
+ var View = frontendViews.View;
7
+ var Text = frontendViews.Text;
8
+ var html = createFrontendHTML(tailwindStyleFrontend);
9
+
10
+ export { Text, View, html, parseStaticStyle, styled, tailwindStyleFrontend2 as tailwindStyleFrontend };
11
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["esm/index.native.js"],"sourcesContent":["import { createFrontendHTML, createFrontendViews } from \"@tamagui/core/internal-runtime\";\nimport { tailwindStyleFrontend } from \"./frontend\";\nimport { styled } from \"./styled\";\nimport { parseStaticStyle, tailwindStyleFrontend as tailwindStyleFrontend2 } from \"./frontend\";\nvar frontendViews = createFrontendViews(tailwindStyleFrontend);\nvar View = frontendViews.View;\nvar Text = frontendViews.Text;\nvar html = createFrontendHTML(tailwindStyleFrontend);\nexport {\n Text,\n View,\n html,\n parseStaticStyle,\n styled,\n tailwindStyleFrontend2 as tailwindStyleFrontend\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;AAIA,IAAI,gBAAgB,oBAAoB,qBAAqB;AAC7D,IAAI,OAAO,cAAc;AACzB,IAAI,OAAO,cAAc;AACzB,IAAI,OAAO,mBAAmB,qBAAqB"}
@@ -0,0 +1,10 @@
1
+ import { createFrontendStyled } from "@tamagui/core/internal-runtime";
2
+ import { tailwindStyleFrontend } from "./frontend.mjs";
3
+
4
+ const styledWithFrontend = createFrontendStyled(tailwindStyleFrontend);
5
+ function styled(Component, optionsOrBaseClassName, maybeOptions) {
6
+ return styledWithFrontend(Component, optionsOrBaseClassName, maybeOptions);
7
+ }
8
+
9
+ export { styled };
10
+ //# sourceMappingURL=styled.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.js","names":[],"sources":["esm/styled.js"],"sourcesContent":["import { createFrontendStyled } from \"@tamagui/core/internal-runtime\";\nimport { tailwindStyleFrontend } from \"./frontend\";\nconst styledWithFrontend = createFrontendStyled(tailwindStyleFrontend);\nfunction styled(Component, optionsOrBaseClassName, maybeOptions) {\n return styledWithFrontend(Component, optionsOrBaseClassName, maybeOptions);\n}\nexport {\n styled\n};\n//# sourceMappingURL=styled.js.map\n"],"mappings":";;;;AAEA,MAAM,qBAAqB,qBAAqB,qBAAqB;AACrE,SAAS,OAAO,WAAW,wBAAwB,cAAc;CAC/D,OAAO,mBAAmB,WAAW,wBAAwB,YAAY;AAC3E"}
@@ -0,0 +1,10 @@
1
+ import { createFrontendStyled } from "@tamagui/core/internal-runtime";
2
+ import { tailwindStyleFrontend } from "./frontend.native.js";
3
+
4
+ var styledWithFrontend = createFrontendStyled(tailwindStyleFrontend);
5
+ function styled(Component, optionsOrBaseClassName, maybeOptions) {
6
+ return styledWithFrontend(Component, optionsOrBaseClassName, maybeOptions);
7
+ }
8
+
9
+ export { styled };
10
+ //# sourceMappingURL=styled.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styled.native.js","names":[],"sources":["esm/styled.native.js"],"sourcesContent":["import { createFrontendStyled } from \"@tamagui/core/internal-runtime\";\nimport { tailwindStyleFrontend } from \"./frontend\";\nvar styledWithFrontend = createFrontendStyled(tailwindStyleFrontend);\nfunction styled(Component, optionsOrBaseClassName, maybeOptions) {\n return styledWithFrontend(Component, optionsOrBaseClassName, maybeOptions);\n}\nexport {\n styled\n};\n//# sourceMappingURL=styled.js.map\n"],"mappings":";;;;AAEA,IAAI,qBAAqB,qBAAqB,qBAAqB;AACnE,SAAS,OAAO,WAAW,wBAAwB,cAAc;CAC/D,OAAO,mBAAmB,WAAW,wBAAwB,YAAY;AAC3E"}
File without changes
File without changes
@@ -0,0 +1,216 @@
1
+ import { compile } from "@tailwindcss/node";
2
+ import { Scanner } from "@tailwindcss/oxide";
3
+ import { createGrammarConfigView } from "@tamagui/style-grammar/runtime";
4
+ import { classifyCandidate } from "@tamagui/style-grammar/tooling";
5
+ import { readFile, realpath } from "node:fs/promises";
6
+ import { createRequire } from "node:module";
7
+ import path from "node:path";
8
+
9
+ const TAILWIND_VERSION = "4.3.0";
10
+ const TAILWIND_VIRTUAL_ID = "virtual:tamagui-tailwind.css";
11
+ const TAILWIND_RESOLVED_ID = `\0${TAILWIND_VIRTUAL_ID}`;
12
+ function wrapWithTamaguiLayer(css) {
13
+ return `@layer tamagui {
14
+ ${css}
15
+ }`;
16
+ }
17
+ function isTamaguiCoreResetCSS(id) {
18
+ const normalizedId = id.split("?", 1)[0].replace(/\\/g, "/");
19
+ return normalizedId.endsWith("/@tamagui/core/reset.css") || normalizedId.endsWith("/code/core/core/reset.css");
20
+ }
21
+ const TAILWIND_INPUT = `@layer tamagui, theme, utilities;
22
+ @import "tailwindcss/theme.css" layer(theme);
23
+ @import "tailwindcss/utilities.css" layer(utilities);`;
24
+ function extensionForFile(id) {
25
+ return path.extname(id.split("?", 1)[0]).slice(1) || "html";
26
+ }
27
+ async function assertHostTailwind(root) {
28
+ const requireFromRoot = createRequire(path.join(root, "package.json"));
29
+ let packagePath;
30
+ try {
31
+ packagePath = requireFromRoot.resolve("tailwindcss/package.json");
32
+ } catch {
33
+ throw new Error(`[tamagui] @tamagui/tailwind/vite requires tailwindcss@${TAILWIND_VERSION} in the app. Install it with \`bun add -D tailwindcss@${TAILWIND_VERSION}\` (resolved from ${root}).`);
34
+ }
35
+ const packageJSON = JSON.parse(await readFile(packagePath, "utf8"));
36
+ if (packageJSON.version !== "4.3.0") {
37
+ throw new Error(`[tamagui] @tamagui/tailwind/vite requires tailwindcss@${TAILWIND_VERSION}, but ${packageJSON.version || "an unknown version"} was resolved from ${packagePath}. Align the app dependency before starting Vite.`);
38
+ }
39
+ }
40
+ function createTailwindScannerState() {
41
+ let root = "";
42
+ let generation = -1;
43
+ let enabled = false;
44
+ let scanner = null;
45
+ let compiler = null;
46
+ let grammarConfig = createGrammarConfigView({});
47
+ let candidatesByFile = /* @__PURE__ */ new Map();
48
+ let compiledCandidates = /* @__PURE__ */ new Set();
49
+ let addDependency = () => {};
50
+ let css = "";
51
+ function clear() {
52
+ root = "";
53
+ generation = -1;
54
+ enabled = false;
55
+ scanner = null;
56
+ compiler = null;
57
+ grammarConfig = createGrammarConfigView({});
58
+ candidatesByFile = /* @__PURE__ */ new Map();
59
+ compiledCandidates = /* @__PURE__ */ new Set();
60
+ addDependency = () => {};
61
+ css = "";
62
+ }
63
+ async function configure(nextRoot, nextGeneration, config, onDependency, onSourceGlob = () => {}) {
64
+ if (!config) {
65
+ clear();
66
+ generation = nextGeneration;
67
+ return false;
68
+ }
69
+ if (compiler && scanner && enabled && generation === nextGeneration && root === nextRoot) {
70
+ return true;
71
+ }
72
+ await assertHostTailwind(nextRoot);
73
+ root = nextRoot;
74
+ generation = nextGeneration;
75
+ enabled = true;
76
+ grammarConfig = createGrammarConfigView(config);
77
+ addDependency = onDependency;
78
+ scanner = new Scanner({ sources: [
79
+ {
80
+ base: root,
81
+ pattern: "**/*",
82
+ negated: false
83
+ },
84
+ {
85
+ base: root,
86
+ pattern: "node_modules/**",
87
+ negated: true
88
+ },
89
+ {
90
+ base: root,
91
+ pattern: ".git/**",
92
+ negated: true
93
+ },
94
+ {
95
+ base: root,
96
+ pattern: ".vite/**",
97
+ negated: true
98
+ },
99
+ {
100
+ base: root,
101
+ pattern: "dist/**",
102
+ negated: true
103
+ },
104
+ {
105
+ base: root,
106
+ pattern: "build/**",
107
+ negated: true
108
+ },
109
+ {
110
+ base: root,
111
+ pattern: "coverage/**",
112
+ negated: true
113
+ }
114
+ ] });
115
+ compiler = await createCompiler();
116
+ scanner.scan();
117
+ registerScannerSources(scanner, onDependency, onSourceGlob);
118
+ candidatesByFile = /* @__PURE__ */ new Map();
119
+ await Promise.all(scanner.files.map(async (file) => {
120
+ try {
121
+ const source = await readFile(file, "utf8");
122
+ candidatesByFile.set(await normalizeSourcePath(file), candidatesForSource(scanner, file, source));
123
+ } catch {}
124
+ }));
125
+ await rebuild();
126
+ return true;
127
+ }
128
+ async function createCompiler() {
129
+ return compile(TAILWIND_INPUT, {
130
+ base: root,
131
+ onDependency: addDependency
132
+ });
133
+ }
134
+ async function rebuild() {
135
+ if (!compiler) return false;
136
+ const allCandidates = /* @__PURE__ */ new Set();
137
+ for (const candidates of candidatesByFile.values()) {
138
+ for (const candidate of candidates) allCandidates.add(candidate);
139
+ }
140
+ const passthrough = [...allCandidates].filter((candidate) => classifyCandidate(candidate, grammarConfig).kind === "passthrough").sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
141
+ const nextCandidates = new Set(passthrough);
142
+ const removedCandidate = [...compiledCandidates].some((candidate) => !nextCandidates.has(candidate));
143
+ if (removedCandidate) {
144
+ compiler = await createCompiler();
145
+ }
146
+ const nextCSS = compiler.build(passthrough);
147
+ compiledCandidates = nextCandidates;
148
+ if (nextCSS === css) return false;
149
+ css = nextCSS;
150
+ return true;
151
+ }
152
+ async function scanSource(id, source) {
153
+ if (!enabled || !scanner) return false;
154
+ candidatesByFile.set(await normalizeSourcePath(id), candidatesForSource(scanner, id, source));
155
+ return rebuild();
156
+ }
157
+ async function removeSource(id) {
158
+ if (!candidatesByFile.delete(await normalizeSourcePath(id))) return false;
159
+ return rebuild();
160
+ }
161
+ return {
162
+ clear,
163
+ configure,
164
+ removeSource,
165
+ scanSource,
166
+ get enabled() {
167
+ return enabled;
168
+ },
169
+ get css() {
170
+ return css;
171
+ },
172
+ get candidateCount() {
173
+ return compiledCandidates.size;
174
+ }
175
+ };
176
+ }
177
+ async function updateTailwindForWatchChange(state, id, event, configure) {
178
+ if (!await configure()) return false;
179
+ if (event === "delete") {
180
+ return state.removeSource(id);
181
+ }
182
+ try {
183
+ return state.scanSource(id, await readFile(id, "utf8"));
184
+ } catch {
185
+ return state.removeSource(id);
186
+ }
187
+ }
188
+ function registerScannerSources(scanner, onDependency, onSourceGlob) {
189
+ for (const file of scanner.files) {
190
+ onDependency(file);
191
+ }
192
+ for (const { base, pattern } of scanner.globs) {
193
+ onSourceGlob(path.join(base, pattern));
194
+ }
195
+ }
196
+ async function normalizeSourcePath(id) {
197
+ const cleanId = path.resolve(id.split("?", 1)[0]);
198
+ try {
199
+ return await realpath(cleanId);
200
+ } catch {
201
+ try {
202
+ return path.join(await realpath(path.dirname(cleanId)), path.basename(cleanId));
203
+ } catch {
204
+ return cleanId;
205
+ }
206
+ }
207
+ }
208
+ function candidatesForSource(scanner, id, source) {
209
+ return new Set(scanner.getCandidatesWithPositions({
210
+ content: source,
211
+ extension: extensionForFile(id)
212
+ }).map(({ candidate }) => candidate));
213
+ }
214
+
215
+ export { TAILWIND_RESOLVED_ID, TAILWIND_VERSION, TAILWIND_VIRTUAL_ID, createTailwindScannerState, isTamaguiCoreResetCSS, updateTailwindForWatchChange, wrapWithTamaguiLayer };
216
+ //# sourceMappingURL=state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","names":[],"sources":["esm/vite/state.js"],"sourcesContent":["import { compile } from \"@tailwindcss/node\";\nimport { Scanner } from \"@tailwindcss/oxide\";\nimport {\n createGrammarConfigView\n} from \"@tamagui/style-grammar/runtime\";\nimport { classifyCandidate } from \"@tamagui/style-grammar/tooling\";\nimport { readFile, realpath } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nconst TAILWIND_VERSION = \"4.3.0\";\nconst TAILWIND_VIRTUAL_ID = \"virtual:tamagui-tailwind.css\";\nconst TAILWIND_RESOLVED_ID = `\\0${TAILWIND_VIRTUAL_ID}`;\nfunction wrapWithTamaguiLayer(css) {\n return `@layer tamagui {\n${css}\n}`;\n}\nfunction isTamaguiCoreResetCSS(id) {\n const normalizedId = id.split(\"?\", 1)[0].replace(/\\\\/g, \"/\");\n return normalizedId.endsWith(\"/@tamagui/core/reset.css\") || normalizedId.endsWith(\"/code/core/core/reset.css\");\n}\nconst TAILWIND_INPUT = `@layer tamagui, theme, utilities;\n@import \"tailwindcss/theme.css\" layer(theme);\n@import \"tailwindcss/utilities.css\" layer(utilities);`;\nfunction extensionForFile(id) {\n return path.extname(id.split(\"?\", 1)[0]).slice(1) || \"html\";\n}\nasync function assertHostTailwind(root) {\n const requireFromRoot = createRequire(path.join(root, \"package.json\"));\n let packagePath;\n try {\n packagePath = requireFromRoot.resolve(\"tailwindcss/package.json\");\n } catch {\n throw new Error(\n `[tamagui] @tamagui/tailwind/vite requires tailwindcss@${TAILWIND_VERSION} in the app. Install it with \\`bun add -D tailwindcss@${TAILWIND_VERSION}\\` (resolved from ${root}).`\n );\n }\n const packageJSON = JSON.parse(await readFile(packagePath, \"utf8\"));\n if (packageJSON.version !== TAILWIND_VERSION) {\n throw new Error(\n `[tamagui] @tamagui/tailwind/vite requires tailwindcss@${TAILWIND_VERSION}, but ${packageJSON.version || \"an unknown version\"} was resolved from ${packagePath}. Align the app dependency before starting Vite.`\n );\n }\n}\nfunction createTailwindScannerState() {\n let root = \"\";\n let generation = -1;\n let enabled = false;\n let scanner = null;\n let compiler = null;\n let grammarConfig = createGrammarConfigView({});\n let candidatesByFile = /* @__PURE__ */ new Map();\n let compiledCandidates = /* @__PURE__ */ new Set();\n let addDependency = () => {\n };\n let css = \"\";\n function clear() {\n root = \"\";\n generation = -1;\n enabled = false;\n scanner = null;\n compiler = null;\n grammarConfig = createGrammarConfigView({});\n candidatesByFile = /* @__PURE__ */ new Map();\n compiledCandidates = /* @__PURE__ */ new Set();\n addDependency = () => {\n };\n css = \"\";\n }\n async function configure(nextRoot, nextGeneration, config, onDependency, onSourceGlob = () => {\n }) {\n if (!config) {\n clear();\n generation = nextGeneration;\n return false;\n }\n if (compiler && scanner && enabled && generation === nextGeneration && root === nextRoot) {\n return true;\n }\n await assertHostTailwind(nextRoot);\n root = nextRoot;\n generation = nextGeneration;\n enabled = true;\n grammarConfig = createGrammarConfigView(config);\n addDependency = onDependency;\n scanner = new Scanner({\n sources: [\n { base: root, pattern: \"**/*\", negated: false },\n { base: root, pattern: \"node_modules/**\", negated: true },\n { base: root, pattern: \".git/**\", negated: true },\n { base: root, pattern: \".vite/**\", negated: true },\n { base: root, pattern: \"dist/**\", negated: true },\n { base: root, pattern: \"build/**\", negated: true },\n { base: root, pattern: \"coverage/**\", negated: true }\n ]\n });\n compiler = await createCompiler();\n scanner.scan();\n registerScannerSources(scanner, onDependency, onSourceGlob);\n candidatesByFile = /* @__PURE__ */ new Map();\n await Promise.all(\n scanner.files.map(async (file) => {\n try {\n const source = await readFile(file, \"utf8\");\n candidatesByFile.set(\n await normalizeSourcePath(file),\n candidatesForSource(scanner, file, source)\n );\n } catch {\n }\n })\n );\n await rebuild();\n return true;\n }\n async function createCompiler() {\n return compile(TAILWIND_INPUT, {\n base: root,\n onDependency: addDependency\n });\n }\n async function rebuild() {\n if (!compiler) return false;\n const allCandidates = /* @__PURE__ */ new Set();\n for (const candidates of candidatesByFile.values()) {\n for (const candidate of candidates) allCandidates.add(candidate);\n }\n const passthrough = [...allCandidates].filter(\n (candidate) => classifyCandidate(candidate, grammarConfig).kind === \"passthrough\"\n ).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);\n const nextCandidates = new Set(passthrough);\n const removedCandidate = [...compiledCandidates].some(\n (candidate) => !nextCandidates.has(candidate)\n );\n if (removedCandidate) {\n compiler = await createCompiler();\n }\n const nextCSS = compiler.build(passthrough);\n compiledCandidates = nextCandidates;\n if (nextCSS === css) return false;\n css = nextCSS;\n return true;\n }\n async function scanSource(id, source) {\n if (!enabled || !scanner) return false;\n candidatesByFile.set(\n await normalizeSourcePath(id),\n candidatesForSource(scanner, id, source)\n );\n return rebuild();\n }\n async function removeSource(id) {\n if (!candidatesByFile.delete(await normalizeSourcePath(id))) return false;\n return rebuild();\n }\n return {\n clear,\n configure,\n removeSource,\n scanSource,\n get enabled() {\n return enabled;\n },\n get css() {\n return css;\n },\n get candidateCount() {\n return compiledCandidates.size;\n }\n };\n}\nasync function updateTailwindForWatchChange(state, id, event, configure) {\n if (!await configure()) return false;\n if (event === \"delete\") {\n return state.removeSource(id);\n }\n try {\n return state.scanSource(id, await readFile(id, \"utf8\"));\n } catch {\n return state.removeSource(id);\n }\n}\nfunction registerScannerSources(scanner, onDependency, onSourceGlob) {\n for (const file of scanner.files) {\n onDependency(file);\n }\n for (const { base, pattern } of scanner.globs) {\n onSourceGlob(path.join(base, pattern));\n }\n}\nasync function normalizeSourcePath(id) {\n const cleanId = path.resolve(id.split(\"?\", 1)[0]);\n try {\n return await realpath(cleanId);\n } catch {\n try {\n return path.join(await realpath(path.dirname(cleanId)), path.basename(cleanId));\n } catch {\n return cleanId;\n }\n }\n}\nfunction candidatesForSource(scanner, id, source) {\n return new Set(\n scanner.getCandidatesWithPositions({\n content: source,\n extension: extensionForFile(id)\n }).map(({ candidate }) => candidate)\n );\n}\nexport {\n TAILWIND_RESOLVED_ID,\n TAILWIND_VERSION,\n TAILWIND_VIRTUAL_ID,\n createTailwindScannerState,\n isTamaguiCoreResetCSS,\n updateTailwindForWatchChange,\n wrapWithTamaguiLayer\n};\n//# sourceMappingURL=state.js.map\n"],"mappings":";;;;;;;;;AASA,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB,KAAK;AAClC,SAAS,qBAAqB,KAAK;CACjC,OAAO;EACP,IAAI;;AAEN;AACA,SAAS,sBAAsB,IAAI;CACjC,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