@tamagui/tailwind 0.0.0-bootstrap.0 → 3.0.0-beta.1093.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,352 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
+ get: () => from[key],
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var compose_exports = {};
22
+ __export(compose_exports, {
23
+ noteBoxShadow: () => noteBoxShadow,
24
+ noteTailwindTransform: () => noteTailwindTransform,
25
+ tryCompose: () => tryCompose
26
+ });
27
+ module.exports = __toCommonJS(compose_exports);
28
+ var import_internal_runtime = require("@tamagui/core/internal-runtime");
29
+ var import_runtime = require("@tamagui/style-grammar/runtime");
30
+ var import_candidate = require("@tamagui/style-grammar/tooling/candidate");
31
+ var import_constants = require("@tamagui/constants");
32
+ const transformProps = new Set([
33
+ "perspective",
34
+ "rotateX",
35
+ "rotateY",
36
+ "rotateZ",
37
+ "skewX",
38
+ "skewY"
39
+ ]);
40
+ const nativeTarget = !import_constants.isWeb || false;
41
+ const linearTo = {
42
+ t: "to top",
43
+ tr: "to top right",
44
+ r: "to right",
45
+ br: "to bottom right",
46
+ b: "to bottom",
47
+ bl: "to bottom left",
48
+ l: "to left",
49
+ tl: "to top left"
50
+ };
51
+ const colorKeywords = {
52
+ transparent: "transparent",
53
+ current: "currentColor",
54
+ inherit: "inherit",
55
+ black: "black",
56
+ white: "white"
57
+ };
58
+ const dropShadowPresets = {
59
+ xs: {
60
+ geometry: "0 1px 1px",
61
+ defaultColor: "rgb(0 0 0 / 0.05)"
62
+ },
63
+ sm: {
64
+ geometry: "0 1px 2px",
65
+ defaultColor: "rgb(0 0 0 / 0.15)"
66
+ },
67
+ md: {
68
+ geometry: "0 3px 3px",
69
+ defaultColor: "rgb(0 0 0 / 0.12)"
70
+ },
71
+ lg: {
72
+ geometry: "0 4px 4px",
73
+ defaultColor: "rgb(0 0 0 / 0.15)"
74
+ },
75
+ xl: {
76
+ geometry: "0 9px 7px",
77
+ defaultColor: "rgb(0 0 0 / 0.1)"
78
+ },
79
+ "2xl": {
80
+ geometry: "0 25px 25px",
81
+ defaultColor: "rgb(0 0 0 / 0.15)"
82
+ },
83
+ none: {
84
+ geometry: "0 0 0",
85
+ defaultColor: "transparent"
86
+ }
87
+ };
88
+ const textShadowPresets = {
89
+ "2xs": {
90
+ offset: {
91
+ width: 0,
92
+ height: 1
93
+ },
94
+ radius: 0,
95
+ defaultColor: "rgb(0 0 0 / 0.15)"
96
+ },
97
+ xs: {
98
+ offset: {
99
+ width: 0,
100
+ height: 1
101
+ },
102
+ radius: 1,
103
+ defaultColor: "rgb(0 0 0 / 0.2)"
104
+ },
105
+ none: {
106
+ offset: {
107
+ width: 0,
108
+ height: 0
109
+ },
110
+ radius: 0,
111
+ defaultColor: "transparent"
112
+ }
113
+ };
114
+ const insetShadowPresets = {
115
+ "2xs": {
116
+ geometry: "inset 0 1px 0",
117
+ defaultColor: "rgb(0 0 0 / 0.05)"
118
+ },
119
+ xs: {
120
+ geometry: "inset 0 1px 1px",
121
+ defaultColor: "rgb(0 0 0 / 0.05)"
122
+ },
123
+ sm: {
124
+ geometry: "inset 0 2px 4px",
125
+ defaultColor: "rgb(0 0 0 / 0.05)"
126
+ },
127
+ none: {
128
+ geometry: "",
129
+ defaultColor: "transparent"
130
+ }
131
+ };
132
+ const filterPropMap = {
133
+ blur: "__filter_blur",
134
+ brightness: "__filter_brightness",
135
+ contrast: "__filter_contrast",
136
+ grayscale: "__filter_grayscale",
137
+ "hue-rotate": "__filter_hueRotate",
138
+ invert: "__filter_invert",
139
+ saturate: "__filter_saturate",
140
+ sepia: "__filter_sepia"
141
+ };
142
+ function composerKind(core) {
143
+ const first = core.charCodeAt(0);
144
+ if (first === 100) return core.startsWith("drop-shadow-") ? "drop-shadow" : null;
145
+ if (first === 102) return core.startsWith("from-") ? "from" : null;
146
+ if (first === 118) return core.startsWith("via-") ? "via" : null;
147
+ if (first === 116) {
148
+ if (core.startsWith("text-shadow-")) return "text-shadow";
149
+ return core.startsWith("to-") ? "to" : null;
150
+ }
151
+ if (first === 98) {
152
+ if (core.startsWith("bg-linear-to-")) return "image";
153
+ return core.startsWith("blur-") || core.startsWith("brightness-") ? "filter" : null;
154
+ }
155
+ if (first === 114) return core === "ring" || core.startsWith("ring-") ? "ring" : null;
156
+ if (first === 99) return core.startsWith("contrast-") ? "filter" : null;
157
+ if (first === 103) return core === "grayscale" || core.startsWith("grayscale-") ? "filter" : null;
158
+ if (first === 104) return core.startsWith("hue-rotate-") ? "filter" : null;
159
+ if (first === 105) return core.startsWith("inset-ring") ? "inset-ring" : core.startsWith("inset-shadow-") ? "inset-shadow" : core === "invert" || core.startsWith("invert-") ? "filter" : null;
160
+ if (first === 115) return core.startsWith("saturate-") || core === "sepia" || core.startsWith("sepia-") ? "filter" : null;
161
+ return null;
162
+ }
163
+ function filterPart(core) {
164
+ if (core.startsWith("blur-")) {
165
+ const value = {
166
+ none: 0,
167
+ xs: 4,
168
+ sm: 8,
169
+ md: 12,
170
+ lg: 16,
171
+ xl: 24,
172
+ "2xl": 40,
173
+ "3xl": 64
174
+ }[core.slice(5)];
175
+ return value === void 0 ? null : ["blur", `${value}px`];
176
+ }
177
+ for (const name of [
178
+ "brightness",
179
+ "contrast",
180
+ "saturate"
181
+ ]) {
182
+ if (!core.startsWith(`${name}-`)) continue;
183
+ const value = core.slice(name.length + 1);
184
+ if (!/^\d+$/.test(value)) return null;
185
+ return [name, `${value}%`];
186
+ }
187
+ for (const name of [
188
+ "grayscale",
189
+ "invert",
190
+ "sepia"
191
+ ]) {
192
+ if (core === name) return [name, "100%"];
193
+ if (!core.startsWith(`${name}-`)) continue;
194
+ const value = core.slice(name.length + 1);
195
+ if (!/^\d+$/.test(value)) return null;
196
+ return [name, `${value}%`];
197
+ }
198
+ if (core.startsWith("hue-rotate-")) {
199
+ const value = core.slice(11);
200
+ if (!/^\d+$/.test(value)) return null;
201
+ return ["hue-rotate", `${value}deg`];
202
+ }
203
+ return null;
204
+ }
205
+ function resolveColor(raw, config) {
206
+ if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") return (0, import_candidate.decodeArbitrary)(raw.slice(1, -1)) || null;
207
+ if (raw.endsWith("%")) return null;
208
+ const keyword = colorKeywords[raw];
209
+ if (keyword) return keyword;
210
+ const suffix = (0, import_runtime.splitColorOpacitySuffix)(raw);
211
+ const name = suffix.kind === "none" ? raw : suffix.name;
212
+ if (!(0, import_candidate.hasTokenName)(config, "color", name)) return null;
213
+ return raw;
214
+ }
215
+ function emit(sink, property, value, modifiers) {
216
+ if (modifiers.length === 0) {
217
+ sink([property, value]);
218
+ return;
219
+ }
220
+ const payload = (0, import_internal_runtime.plainValueToPayload)(value, property) ?? value;
221
+ if (payload === null) return;
222
+ let condition = modifiers[0];
223
+ for (let index = 1; index < modifiers.length; index++) condition += `:${modifiers[index]}`;
224
+ sink([
225
+ property,
226
+ payload,
227
+ condition,
228
+ modifiers
229
+ ]);
230
+ }
231
+ function ringWidth(raw) {
232
+ if (raw === "inset") return null;
233
+ if (/^\d+$/.test(raw)) return `${raw}px`;
234
+ if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") {
235
+ const inner = (0, import_candidate.decodeArbitrary)(raw.slice(1, -1));
236
+ if (/^-?(?:\d+|\d*\.\d+)$/.test(inner)) return `${inner}px`;
237
+ if (/^-?(?:\d+|\d*\.\d+)px$/.test(inner)) return inner;
238
+ return null;
239
+ }
240
+ return null;
241
+ }
242
+ function tryCompose(candidate, config, sink) {
243
+ const modified = candidate.indexOf(":") !== -1;
244
+ const split = modified ? (0, import_candidate.splitCandidate)(candidate) : null;
245
+ if (modified && !split) return void 0;
246
+ const core = split ? split.base : candidate;
247
+ if (!core) return void 0;
248
+ const kind = composerKind(core);
249
+ if (kind == null) return void 0;
250
+ const modifiers = split ? split.modifiers.map(import_runtime.canonicalClauseModifier) : [];
251
+ if (kind === "filter") {
252
+ const part = filterPart(core);
253
+ if (!part) return true;
254
+ if (nativeTarget && part[0] !== "brightness" && !import_constants.isAndroid) return null;
255
+ const prop = filterPropMap[part[0]];
256
+ if (prop) emit(sink, prop, part[1], modifiers);
257
+ return false;
258
+ }
259
+ if (kind === "drop-shadow") {
260
+ if (nativeTarget && !import_constants.isAndroid) return null;
261
+ const raw2 = core.slice(12);
262
+ const shadow = dropShadowPresets[raw2];
263
+ if (shadow) {
264
+ emit(sink, "__dropShadowGeometry", shadow.geometry, modifiers);
265
+ emit(sink, "__dropShadowDefaultColor", shadow.defaultColor, modifiers);
266
+ } else {
267
+ const color2 = resolveColor(raw2, config);
268
+ if (color2 == null) return void 0;
269
+ emit(sink, "__dropShadowColor", color2, modifiers);
270
+ }
271
+ return false;
272
+ }
273
+ if (kind === "text-shadow") {
274
+ const raw2 = core.slice(12);
275
+ const geometry = textShadowPresets[raw2];
276
+ if (geometry) {
277
+ if (modifiers.length > 0) return nativeTarget ? null : void 0;
278
+ emit(sink, "__textShadow_preset", geometry, modifiers);
279
+ } else {
280
+ const resolved = resolveColor(raw2, config);
281
+ const classified = resolved == null ? (0, import_candidate.classifyCandidate)(core, config) : null;
282
+ const color2 = resolved ?? (classified?.kind === "tamagui" && classified.parsed.entry?.prop === "textShadowColor" ? raw2 : null);
283
+ if (color2 == null) return void 0;
284
+ emit(sink, "__textShadow_color", color2, modifiers);
285
+ }
286
+ return false;
287
+ }
288
+ if (kind === "inset-ring") {
289
+ const raw2 = core === "inset-ring" ? "" : core.slice(11);
290
+ const width2 = raw2 === "" ? "1px" : ringWidth(raw2);
291
+ if (width2 != null) emit(sink, "__insetRingWidth", width2, modifiers);
292
+ else {
293
+ const color2 = resolveColor(raw2, config);
294
+ if (color2 == null) return void 0;
295
+ emit(sink, "__insetRingColor", color2, modifiers);
296
+ }
297
+ return false;
298
+ }
299
+ if (kind === "inset-shadow") {
300
+ const raw2 = core.slice(13);
301
+ const shadow = insetShadowPresets[raw2];
302
+ if (shadow) {
303
+ emit(sink, "__insetShadowGeometry", shadow.geometry, modifiers);
304
+ emit(sink, "__insetShadowDefaultColor", shadow.defaultColor, modifiers);
305
+ } else {
306
+ const color2 = resolveColor(raw2, config);
307
+ if (color2 == null) return void 0;
308
+ emit(sink, "__insetShadowColor", color2, modifiers);
309
+ }
310
+ return false;
311
+ }
312
+ if (kind === "image") {
313
+ const dir = linearTo[core.slice(13)];
314
+ if (!dir) return true;
315
+ emit(sink, "__gradientDirection", dir, modifiers);
316
+ return false;
317
+ }
318
+ if (kind === "from" || kind === "via" || kind === "to") {
319
+ const color2 = resolveColor(core.slice(kind.length + 1), config);
320
+ if (color2 == null) return true;
321
+ emit(sink, kind === "from" ? "__gradientFrom" : kind === "via" ? "__gradientVia" : "__gradientTo", color2, modifiers);
322
+ return false;
323
+ }
324
+ if (core === "ring") {
325
+ emit(sink, "__ring", "1px", modifiers);
326
+ return false;
327
+ }
328
+ if (core === "ring-inset") {
329
+ emit(sink, "__ringInset", true, modifiers);
330
+ return false;
331
+ }
332
+ const raw = core.slice(5);
333
+ const width = ringWidth(raw);
334
+ if (width != null) {
335
+ emit(sink, "__ring", width, modifiers);
336
+ return false;
337
+ }
338
+ const color = resolveColor(raw, config);
339
+ if (color == null) return true;
340
+ emit(sink, "__ringColor", color, modifiers);
341
+ return false;
342
+ }
343
+ function noteTailwindTransform(sink, entry) {
344
+ if (!transformProps.has(entry[0])) return false;
345
+ emit(sink, `__transform_${entry[0]}`, entry[1], entry[3] || []);
346
+ return true;
347
+ }
348
+ function noteBoxShadow(sink, value, modifiers) {
349
+ if (typeof value !== "string" || value === "unset") return;
350
+ if (value.indexOf(" ") === -1 && value !== "none" && !value.startsWith("inset")) return;
351
+ emit(sink, "__shadow", value, modifiers);
352
+ }
@@ -0,0 +1,358 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var compose_exports = {};
24
+ __export(compose_exports, {
25
+ noteBoxShadow: () => noteBoxShadow,
26
+ noteTailwindTransform: () => noteTailwindTransform,
27
+ tryCompose: () => tryCompose
28
+ });
29
+ module.exports = __toCommonJS(compose_exports);
30
+ var import_internal_runtime = require("@tamagui/core/internal-runtime");
31
+ var import_runtime = require("@tamagui/style-grammar/runtime");
32
+ var import_candidate = require("@tamagui/style-grammar/tooling/candidate");
33
+ var import_constants = require("@tamagui/constants");
34
+ var transformProps = new Set([
35
+ "perspective",
36
+ "rotateX",
37
+ "rotateY",
38
+ "rotateZ",
39
+ "skewX",
40
+ "skewY"
41
+ ]);
42
+ var nativeTarget = !import_constants.isWeb || true;
43
+ var linearTo = {
44
+ t: "to top",
45
+ tr: "to top right",
46
+ r: "to right",
47
+ br: "to bottom right",
48
+ b: "to bottom",
49
+ bl: "to bottom left",
50
+ l: "to left",
51
+ tl: "to top left"
52
+ };
53
+ var colorKeywords = {
54
+ transparent: "transparent",
55
+ current: "currentColor",
56
+ inherit: "inherit",
57
+ black: "black",
58
+ white: "white"
59
+ };
60
+ var dropShadowPresets = {
61
+ xs: {
62
+ geometry: "0 1px 1px",
63
+ defaultColor: "rgb(0 0 0 / 0.05)"
64
+ },
65
+ sm: {
66
+ geometry: "0 1px 2px",
67
+ defaultColor: "rgb(0 0 0 / 0.15)"
68
+ },
69
+ md: {
70
+ geometry: "0 3px 3px",
71
+ defaultColor: "rgb(0 0 0 / 0.12)"
72
+ },
73
+ lg: {
74
+ geometry: "0 4px 4px",
75
+ defaultColor: "rgb(0 0 0 / 0.15)"
76
+ },
77
+ xl: {
78
+ geometry: "0 9px 7px",
79
+ defaultColor: "rgb(0 0 0 / 0.1)"
80
+ },
81
+ "2xl": {
82
+ geometry: "0 25px 25px",
83
+ defaultColor: "rgb(0 0 0 / 0.15)"
84
+ },
85
+ none: {
86
+ geometry: "0 0 0",
87
+ defaultColor: "transparent"
88
+ }
89
+ };
90
+ var textShadowPresets = {
91
+ "2xs": {
92
+ offset: {
93
+ width: 0,
94
+ height: 1
95
+ },
96
+ radius: 0,
97
+ defaultColor: "rgb(0 0 0 / 0.15)"
98
+ },
99
+ xs: {
100
+ offset: {
101
+ width: 0,
102
+ height: 1
103
+ },
104
+ radius: 1,
105
+ defaultColor: "rgb(0 0 0 / 0.2)"
106
+ },
107
+ none: {
108
+ offset: {
109
+ width: 0,
110
+ height: 0
111
+ },
112
+ radius: 0,
113
+ defaultColor: "transparent"
114
+ }
115
+ };
116
+ var insetShadowPresets = {
117
+ "2xs": {
118
+ geometry: "inset 0 1px 0",
119
+ defaultColor: "rgb(0 0 0 / 0.05)"
120
+ },
121
+ xs: {
122
+ geometry: "inset 0 1px 1px",
123
+ defaultColor: "rgb(0 0 0 / 0.05)"
124
+ },
125
+ sm: {
126
+ geometry: "inset 0 2px 4px",
127
+ defaultColor: "rgb(0 0 0 / 0.05)"
128
+ },
129
+ none: {
130
+ geometry: "",
131
+ defaultColor: "transparent"
132
+ }
133
+ };
134
+ var filterPropMap = {
135
+ blur: "__filter_blur",
136
+ brightness: "__filter_brightness",
137
+ contrast: "__filter_contrast",
138
+ grayscale: "__filter_grayscale",
139
+ "hue-rotate": "__filter_hueRotate",
140
+ invert: "__filter_invert",
141
+ saturate: "__filter_saturate",
142
+ sepia: "__filter_sepia"
143
+ };
144
+ function composerKind(core) {
145
+ var first = core.charCodeAt(0);
146
+ if (first === 100) return core.startsWith("drop-shadow-") ? "drop-shadow" : null;
147
+ if (first === 102) return core.startsWith("from-") ? "from" : null;
148
+ if (first === 118) return core.startsWith("via-") ? "via" : null;
149
+ if (first === 116) {
150
+ if (core.startsWith("text-shadow-")) return "text-shadow";
151
+ return core.startsWith("to-") ? "to" : null;
152
+ }
153
+ if (first === 98) {
154
+ if (core.startsWith("bg-linear-to-")) return "image";
155
+ return core.startsWith("blur-") || core.startsWith("brightness-") ? "filter" : null;
156
+ }
157
+ if (first === 114) return core === "ring" || core.startsWith("ring-") ? "ring" : null;
158
+ if (first === 99) return core.startsWith("contrast-") ? "filter" : null;
159
+ if (first === 103) return core === "grayscale" || core.startsWith("grayscale-") ? "filter" : null;
160
+ if (first === 104) return core.startsWith("hue-rotate-") ? "filter" : null;
161
+ if (first === 105) return core.startsWith("inset-ring") ? "inset-ring" : core.startsWith("inset-shadow-") ? "inset-shadow" : core === "invert" || core.startsWith("invert-") ? "filter" : null;
162
+ if (first === 115) return core.startsWith("saturate-") || core === "sepia" || core.startsWith("sepia-") ? "filter" : null;
163
+ return null;
164
+ }
165
+ function filterPart(core) {
166
+ if (core.startsWith("blur-")) {
167
+ var value = {
168
+ none: 0,
169
+ xs: 4,
170
+ sm: 8,
171
+ md: 12,
172
+ lg: 16,
173
+ xl: 24,
174
+ "2xl": 40,
175
+ "3xl": 64
176
+ }[core.slice(5)];
177
+ return value === void 0 ? null : ["blur", `${value}px`];
178
+ }
179
+ for (var _i = 0, _iter = [
180
+ "brightness",
181
+ "contrast",
182
+ "saturate"
183
+ ]; _i < _iter.length; _i++) {
184
+ var name = _iter[_i];
185
+ if (!core.startsWith(`${name}-`)) continue;
186
+ var value1 = core.slice(name.length + 1);
187
+ if (!/^\d+$/.test(value1)) return null;
188
+ return [name, `${value1}%`];
189
+ }
190
+ for (var _i1 = 0, _iter1 = [
191
+ "grayscale",
192
+ "invert",
193
+ "sepia"
194
+ ]; _i1 < _iter1.length; _i1++) {
195
+ var name1 = _iter1[_i1];
196
+ if (core === name1) return [name1, "100%"];
197
+ if (!core.startsWith(`${name1}-`)) continue;
198
+ var value2 = core.slice(name1.length + 1);
199
+ if (!/^\d+$/.test(value2)) return null;
200
+ return [name1, `${value2}%`];
201
+ }
202
+ if (core.startsWith("hue-rotate-")) {
203
+ var value3 = core.slice(11);
204
+ if (!/^\d+$/.test(value3)) return null;
205
+ return ["hue-rotate", `${value3}deg`];
206
+ }
207
+ return null;
208
+ }
209
+ function resolveColor(raw, config) {
210
+ if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") return (0, import_candidate.decodeArbitrary)(raw.slice(1, -1)) || null;
211
+ if (raw.endsWith("%")) return null;
212
+ var keyword = colorKeywords[raw];
213
+ if (keyword) return keyword;
214
+ var suffix = (0, import_runtime.splitColorOpacitySuffix)(raw);
215
+ var name = suffix.kind === "none" ? raw : suffix.name;
216
+ if (!(0, import_candidate.hasTokenName)(config, "color", name)) return null;
217
+ return raw;
218
+ }
219
+ function emit(sink, property, value, modifiers) {
220
+ if (modifiers.length === 0) {
221
+ sink([property, value]);
222
+ return;
223
+ }
224
+ var _plainValueToPayload;
225
+ var payload = (_plainValueToPayload = (0, import_internal_runtime.plainValueToPayload)(value, property)) !== null && _plainValueToPayload !== void 0 ? _plainValueToPayload : value;
226
+ if (payload === null) return;
227
+ var condition = modifiers[0];
228
+ for (var index = 1; index < modifiers.length; index++) condition += `:${modifiers[index]}`;
229
+ sink([
230
+ property,
231
+ payload,
232
+ condition,
233
+ modifiers
234
+ ]);
235
+ }
236
+ function ringWidth(raw) {
237
+ if (raw === "inset") return null;
238
+ if (/^\d+$/.test(raw)) return `${raw}px`;
239
+ if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") {
240
+ var inner = (0, import_candidate.decodeArbitrary)(raw.slice(1, -1));
241
+ if (/^-?(?:\d+|\d*\.\d+)$/.test(inner)) return `${inner}px`;
242
+ if (/^-?(?:\d+|\d*\.\d+)px$/.test(inner)) return inner;
243
+ return null;
244
+ }
245
+ return null;
246
+ }
247
+ function tryCompose(candidate, config, sink) {
248
+ var modified = candidate.indexOf(":") !== -1;
249
+ var split = modified ? (0, import_candidate.splitCandidate)(candidate) : null;
250
+ if (modified && !split) return void 0;
251
+ var core = split ? split.base : candidate;
252
+ if (!core) return void 0;
253
+ var kind = composerKind(core);
254
+ if (kind == null) return void 0;
255
+ var modifiers = split ? split.modifiers.map(import_runtime.canonicalClauseModifier) : [];
256
+ if (kind === "filter") {
257
+ var part = filterPart(core);
258
+ if (!part) return true;
259
+ if (nativeTarget && part[0] !== "brightness" && !import_constants.isAndroid) return null;
260
+ var prop = filterPropMap[part[0]];
261
+ if (prop) emit(sink, prop, part[1], modifiers);
262
+ return false;
263
+ }
264
+ if (kind === "drop-shadow") {
265
+ if (nativeTarget && !import_constants.isAndroid) return null;
266
+ var raw = core.slice(12);
267
+ var shadow = dropShadowPresets[raw];
268
+ if (shadow) {
269
+ emit(sink, "__dropShadowGeometry", shadow.geometry, modifiers);
270
+ emit(sink, "__dropShadowDefaultColor", shadow.defaultColor, modifiers);
271
+ } else {
272
+ var color = resolveColor(raw, config);
273
+ if (color == null) return void 0;
274
+ emit(sink, "__dropShadowColor", color, modifiers);
275
+ }
276
+ return false;
277
+ }
278
+ if (kind === "text-shadow") {
279
+ var raw1 = core.slice(12);
280
+ var geometry = textShadowPresets[raw1];
281
+ if (geometry) {
282
+ if (modifiers.length > 0) return nativeTarget ? null : void 0;
283
+ emit(sink, "__textShadow_preset", geometry, modifiers);
284
+ } else {
285
+ var _classified_parsed_entry;
286
+ var resolved = resolveColor(raw1, config);
287
+ var classified = resolved == null ? (0, import_candidate.classifyCandidate)(core, config) : null;
288
+ var color1 = resolved !== null && resolved !== void 0 ? resolved : (classified === null || classified === void 0 ? void 0 : classified.kind) === "tamagui" && ((_classified_parsed_entry = classified.parsed.entry) === null || _classified_parsed_entry === void 0 ? void 0 : _classified_parsed_entry.prop) === "textShadowColor" ? raw1 : null;
289
+ if (color1 == null) return void 0;
290
+ emit(sink, "__textShadow_color", color1, modifiers);
291
+ }
292
+ return false;
293
+ }
294
+ if (kind === "inset-ring") {
295
+ var raw2 = core === "inset-ring" ? "" : core.slice(11);
296
+ var width = raw2 === "" ? "1px" : ringWidth(raw2);
297
+ if (width != null) emit(sink, "__insetRingWidth", width, modifiers);
298
+ else {
299
+ var color2 = resolveColor(raw2, config);
300
+ if (color2 == null) return void 0;
301
+ emit(sink, "__insetRingColor", color2, modifiers);
302
+ }
303
+ return false;
304
+ }
305
+ if (kind === "inset-shadow") {
306
+ var raw3 = core.slice(13);
307
+ var shadow1 = insetShadowPresets[raw3];
308
+ if (shadow1) {
309
+ emit(sink, "__insetShadowGeometry", shadow1.geometry, modifiers);
310
+ emit(sink, "__insetShadowDefaultColor", shadow1.defaultColor, modifiers);
311
+ } else {
312
+ var color3 = resolveColor(raw3, config);
313
+ if (color3 == null) return void 0;
314
+ emit(sink, "__insetShadowColor", color3, modifiers);
315
+ }
316
+ return false;
317
+ }
318
+ if (kind === "image") {
319
+ var dir = linearTo[core.slice(13)];
320
+ if (!dir) return true;
321
+ emit(sink, "__gradientDirection", dir, modifiers);
322
+ return false;
323
+ }
324
+ if (kind === "from" || kind === "via" || kind === "to") {
325
+ var color4 = resolveColor(core.slice(kind.length + 1), config);
326
+ if (color4 == null) return true;
327
+ emit(sink, kind === "from" ? "__gradientFrom" : kind === "via" ? "__gradientVia" : "__gradientTo", color4, modifiers);
328
+ return false;
329
+ }
330
+ if (core === "ring") {
331
+ emit(sink, "__ring", "1px", modifiers);
332
+ return false;
333
+ }
334
+ if (core === "ring-inset") {
335
+ emit(sink, "__ringInset", true, modifiers);
336
+ return false;
337
+ }
338
+ var raw4 = core.slice(5);
339
+ var width1 = ringWidth(raw4);
340
+ if (width1 != null) {
341
+ emit(sink, "__ring", width1, modifiers);
342
+ return false;
343
+ }
344
+ var color5 = resolveColor(raw4, config);
345
+ if (color5 == null) return true;
346
+ emit(sink, "__ringColor", color5, modifiers);
347
+ return false;
348
+ }
349
+ function noteTailwindTransform(sink, entry) {
350
+ if (!transformProps.has(entry[0])) return false;
351
+ emit(sink, `__transform_${entry[0]}`, entry[1], entry[3] || []);
352
+ return true;
353
+ }
354
+ function noteBoxShadow(sink, value, modifiers) {
355
+ if (typeof value !== "string" || value === "unset") return;
356
+ if (value.indexOf(" ") === -1 && value !== "none" && !value.startsWith("inset")) return;
357
+ emit(sink, "__shadow", value, modifiers);
358
+ }