@tamagui/tailwind 0.0.0-bootstrap.0 → 3.0.0-beta.643.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.
- package/dist/cjs/candidate.cjs +385 -0
- package/dist/cjs/candidate.native.cjs +431 -0
- package/dist/cjs/candidate.native.js +433 -0
- package/dist/cjs/candidate.native.js.map +1 -0
- package/dist/cjs/frontend.cjs +80 -0
- package/dist/cjs/frontend.native.cjs +95 -0
- package/dist/cjs/frontend.native.js +97 -0
- package/dist/cjs/frontend.native.js.map +1 -0
- package/dist/cjs/index.cjs +39 -0
- package/dist/cjs/index.native.cjs +41 -0
- package/dist/cjs/index.native.js +43 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/cjs/styled.cjs +30 -0
- package/dist/cjs/styled.native.cjs +32 -0
- package/dist/cjs/styled.native.js +34 -0
- package/dist/cjs/styled.native.js.map +1 -0
- package/dist/cjs/types.cjs +17 -0
- package/dist/cjs/types.native.cjs +19 -0
- package/dist/cjs/types.native.js +21 -0
- package/dist/cjs/types.native.js.map +1 -0
- package/dist/cjs/vite/state.cjs +249 -0
- package/dist/cjs/vite/state.native.cjs +331 -0
- package/dist/cjs/vite/state.native.js +333 -0
- package/dist/cjs/vite/state.native.js.map +1 -0
- package/dist/cjs/vite.cjs +148 -0
- package/dist/cjs/vite.native.cjs +188 -0
- package/dist/cjs/vite.native.js +190 -0
- package/dist/cjs/vite.native.js.map +1 -0
- package/dist/esm/candidate.mjs +360 -0
- package/dist/esm/candidate.mjs.map +1 -0
- package/dist/esm/candidate.native.js +404 -0
- package/dist/esm/candidate.native.js.map +1 -0
- package/dist/esm/frontend.mjs +57 -0
- package/dist/esm/frontend.mjs.map +1 -0
- package/dist/esm/frontend.native.js +70 -0
- package/dist/esm/frontend.native.js.map +1 -0
- package/dist/esm/index.mjs +11 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +11 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/esm/styled.mjs +10 -0
- package/dist/esm/styled.mjs.map +1 -0
- package/dist/esm/styled.native.js +10 -0
- package/dist/esm/styled.native.js.map +1 -0
- package/dist/esm/types.mjs +0 -0
- package/dist/esm/types.native.js +0 -0
- package/dist/esm/vite/state.mjs +215 -0
- package/dist/esm/vite/state.mjs.map +1 -0
- package/dist/esm/vite/state.native.js +295 -0
- package/dist/esm/vite/state.native.js.map +1 -0
- package/dist/esm/vite.mjs +116 -0
- package/dist/esm/vite.mjs.map +1 -0
- package/dist/esm/vite.native.js +154 -0
- package/dist/esm/vite.native.js.map +1 -0
- package/package.json +88 -5
- package/src/candidate.ts +527 -0
- package/src/frontend.ts +116 -0
- package/src/index.tsx +24 -0
- package/src/styled.tsx +52 -0
- package/src/types.ts +226 -0
- package/src/vite/state.ts +274 -0
- package/src/vite.ts +204 -0
- package/types/candidate.d.ts +23 -0
- package/types/candidate.d.ts.map +1 -0
- package/types/frontend.d.ts +20 -0
- package/types/frontend.d.ts.map +1 -0
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/styled.d.ts +12 -0
- package/types/styled.d.ts.map +1 -0
- package/types/types.d.ts +158 -0
- package/types/types.d.ts.map +1 -0
- package/types/vite/state.d.ts +28 -0
- package/types/vite/state.d.ts.map +1 -0
- package/types/vite.d.ts +20 -0
- package/types/vite.d.ts.map +1 -0
- package/README.md +0 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { isWeb } from "@tamagui/constants";
|
|
2
|
+
import { STYLE_FRONTEND_PASSTHROUGH_PREFIX, createFrontendProgram, plainValueToPayload } from "@tamagui/core/internal-runtime";
|
|
3
|
+
import { borderSideSuffix, classifyCandidate, createGrammarConfigView, decodeArbitrary, getSafeAreaEdge, getTokenCategory, percentUtilityProps, radiusCornerProps, splitColorOpacitySuffix } from "@tamagui/style-grammar/runtime";
|
|
4
|
+
|
|
5
|
+
var styleGrammarConfigCache = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function getStyleGrammarConfig(config) {
|
|
7
|
+
var cached = styleGrammarConfigCache.get(config);
|
|
8
|
+
if (cached) return cached;
|
|
9
|
+
var view = createGrammarConfigView(config);
|
|
10
|
+
styleGrammarConfigCache.set(config, view);
|
|
11
|
+
return view;
|
|
12
|
+
}
|
|
13
|
+
function isTokenValueProp(prop) {
|
|
14
|
+
return getTokenCategory(prop) !== null;
|
|
15
|
+
}
|
|
16
|
+
function arbitraryValue(inner) {
|
|
17
|
+
var px = /^(-?\d*\.?\d+)px$/.exec(inner);
|
|
18
|
+
if (px) return Number(px[1]);
|
|
19
|
+
if (/^-?\d*\.?\d+$/.test(inner)) return Number(inner);
|
|
20
|
+
return inner;
|
|
21
|
+
}
|
|
22
|
+
function tailwindSizingValue(prop, value) {
|
|
23
|
+
if (value === "full") return "100%";
|
|
24
|
+
if (value === "auto") return "auto";
|
|
25
|
+
if (value === "screen") return /[Hh]eight/.test(prop) ? "100vh" : "100vw";
|
|
26
|
+
if (value === "min") return "min-content";
|
|
27
|
+
if (value === "max") return "max-content";
|
|
28
|
+
if (value === "fit") return "fit-content";
|
|
29
|
+
var frac = /^(\d+)\/(\d+)$/.exec(value);
|
|
30
|
+
if (frac && Number(frac[2]) !== 0) {
|
|
31
|
+
return `${Number(frac[1]) / Number(frac[2]) * 100}%`;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function borderDimValue(raw) {
|
|
36
|
+
var inner = raw;
|
|
37
|
+
if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") {
|
|
38
|
+
inner = decodeArbitrary(raw.slice(1, -1));
|
|
39
|
+
}
|
|
40
|
+
var px = /^(-?\d*\.?\d+)px$/.exec(inner);
|
|
41
|
+
if (px) return Number.parseFloat(px[1]);
|
|
42
|
+
if (/^-?\d*\.?\d+$/.test(inner)) return Number(inner);
|
|
43
|
+
return inner;
|
|
44
|
+
}
|
|
45
|
+
function expandBorderCandidate(parsed, value) {
|
|
46
|
+
var _parsed_entry;
|
|
47
|
+
var prefix = parsed.prefix;
|
|
48
|
+
if (!prefix) return null;
|
|
49
|
+
if (prefix.startsWith("rounded-")) {
|
|
50
|
+
var props = radiusCornerProps[prefix.slice("rounded-".length)];
|
|
51
|
+
if (!props || props.length === 1) return null;
|
|
52
|
+
var out = {};
|
|
53
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
54
|
+
try {
|
|
55
|
+
for (var _iterator = props[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
56
|
+
var p = _step.value;
|
|
57
|
+
out[p] = value;
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
_didIteratorError = true;
|
|
61
|
+
_iteratorError = err;
|
|
62
|
+
} finally {
|
|
63
|
+
try {
|
|
64
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
65
|
+
_iterator.return();
|
|
66
|
+
}
|
|
67
|
+
} finally {
|
|
68
|
+
if (_didIteratorError) {
|
|
69
|
+
throw _iteratorError;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
var m = /^border-([trblxy])$/.exec(prefix);
|
|
76
|
+
if (!m) return null;
|
|
77
|
+
var sides = borderSideSuffix[m[1]];
|
|
78
|
+
var suffix = ((_parsed_entry = parsed.entry) === null || _parsed_entry === void 0 ? void 0 : _parsed_entry.prop.endsWith("Width")) ? "Width" : "Color";
|
|
79
|
+
var out1 = {};
|
|
80
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
81
|
+
try {
|
|
82
|
+
for (var _iterator1 = sides[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
83
|
+
var side = _step1.value;
|
|
84
|
+
out1[`border${side}${suffix}`] = value;
|
|
85
|
+
}
|
|
86
|
+
} catch (err) {
|
|
87
|
+
_didIteratorError1 = true;
|
|
88
|
+
_iteratorError1 = err;
|
|
89
|
+
} finally {
|
|
90
|
+
try {
|
|
91
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
92
|
+
_iterator1.return();
|
|
93
|
+
}
|
|
94
|
+
} finally {
|
|
95
|
+
if (_didIteratorError1) {
|
|
96
|
+
throw _iteratorError1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return out1;
|
|
101
|
+
}
|
|
102
|
+
function tailwindClassToFlatProp(parsed) {
|
|
103
|
+
var _parsed_prefix;
|
|
104
|
+
if (parsed.kind !== "dynamic" || !parsed.entry || parsed.rawValue === void 0) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
var prop = parsed.entry.prop;
|
|
108
|
+
var category = parsed.entry.tokenCategory;
|
|
109
|
+
var value = parsed.rawValue;
|
|
110
|
+
if (prop.endsWith("Width") && ((_parsed_prefix = parsed.prefix) === null || _parsed_prefix === void 0 ? void 0 : _parsed_prefix.startsWith("border"))) {
|
|
111
|
+
if (parsed.valueKind === "token") {
|
|
112
|
+
value = `${parsed.negative ? "-" : ""}${value}`;
|
|
113
|
+
} else if (parsed.valueKind === "arbitrary") {
|
|
114
|
+
value = borderDimValue(value);
|
|
115
|
+
} else {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
key: prop,
|
|
120
|
+
value
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (prop === "fontFamily") {
|
|
124
|
+
var famValue;
|
|
125
|
+
if (value.length > 2 && value[0] === "[" && value[value.length - 1] === "]") {
|
|
126
|
+
famValue = decodeArbitrary(value.slice(1, -1));
|
|
127
|
+
} else {
|
|
128
|
+
var generic = {
|
|
129
|
+
sans: "sans-serif",
|
|
130
|
+
serif: "serif",
|
|
131
|
+
mono: "monospace"
|
|
132
|
+
};
|
|
133
|
+
famValue = parsed.valueKind === "token" ? value : generic[value] || value;
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
key: "fontFamily",
|
|
137
|
+
value: famValue
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (prop === "fontSize") {
|
|
141
|
+
var fsValue;
|
|
142
|
+
if (value.length > 2 && value[0] === "[" && value[value.length - 1] === "]") {
|
|
143
|
+
fsValue = arbitraryValue(decodeArbitrary(value.slice(1, -1)));
|
|
144
|
+
} else {
|
|
145
|
+
fsValue = value;
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
key: "fontSize",
|
|
149
|
+
value: fsValue
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
if (prop === "lineHeight") {
|
|
153
|
+
var lhValue;
|
|
154
|
+
if (value.length > 2 && value[0] === "[" && value[value.length - 1] === "]") {
|
|
155
|
+
var inner = decodeArbitrary(value.slice(1, -1));
|
|
156
|
+
lhValue = /^-?\d*\.?\d+px$/.test(inner) ? Number.parseFloat(inner) : inner;
|
|
157
|
+
} else {
|
|
158
|
+
lhValue = value;
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
key: "lineHeight",
|
|
162
|
+
value: lhValue
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (prop === "letterSpacing") {
|
|
166
|
+
var lsValue;
|
|
167
|
+
if (value.length > 2 && value[0] === "[" && value[value.length - 1] === "]") {
|
|
168
|
+
lsValue = arbitraryValue(decodeArbitrary(value.slice(1, -1)));
|
|
169
|
+
} else {
|
|
170
|
+
lsValue = value;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
key: "letterSpacing",
|
|
174
|
+
value: lsValue
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
if (prop === "boxShadow" && value[0] === "[" && value[value.length - 1] === "]") {
|
|
178
|
+
return {
|
|
179
|
+
key: "boxShadow",
|
|
180
|
+
value: decodeArbitrary(value.slice(1, -1))
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
if (value.length > 2 && value[0] === "[" && value[value.length - 1] === "]") {
|
|
184
|
+
var inner1 = decodeArbitrary(value.slice(1, -1));
|
|
185
|
+
if (inner1 === "") return null;
|
|
186
|
+
return {
|
|
187
|
+
key: prop,
|
|
188
|
+
value: arbitraryValue(inner1)
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
if (category === "size" && parsed.valueKind !== "token") {
|
|
192
|
+
var sized = tailwindSizingValue(prop, value);
|
|
193
|
+
if (sized != null) {
|
|
194
|
+
return {
|
|
195
|
+
key: prop,
|
|
196
|
+
value: sized
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
var opacitySuffix = "";
|
|
201
|
+
if (category === "color" && typeof value === "string") {
|
|
202
|
+
var suffix = splitColorOpacitySuffix(value);
|
|
203
|
+
if (suffix.kind === "invalid") {
|
|
204
|
+
return {
|
|
205
|
+
key: prop,
|
|
206
|
+
value
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (suffix.kind === "valid") {
|
|
210
|
+
opacitySuffix = value.slice(suffix.name.length);
|
|
211
|
+
value = suffix.name;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (percentUtilityProps.has(prop) && /^\d+$/.test(value)) {
|
|
215
|
+
value = Number(value) / 100;
|
|
216
|
+
} else if (/^\d+(\.\d+)?$/.test(value)) {
|
|
217
|
+
if (category === "zIndex" && parsed.valueKind === "convenience") {
|
|
218
|
+
value = Number(value);
|
|
219
|
+
} else if (category) {
|
|
220
|
+
value = `${parsed.negative ? "-" : ""}${value}`;
|
|
221
|
+
} else {
|
|
222
|
+
value = Number(value);
|
|
223
|
+
}
|
|
224
|
+
} else if (typeof value === "string") {
|
|
225
|
+
if (category && !((category === "space" || category === "size" || category === "radius") && getSafeAreaEdge(value))) {
|
|
226
|
+
value = `${parsed.negative ? "-" : ""}${value}`;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (opacitySuffix && typeof value === "string") {
|
|
230
|
+
value = `${value}${opacitySuffix}`;
|
|
231
|
+
}
|
|
232
|
+
if (parsed.negative && !category) {
|
|
233
|
+
if (typeof value === "number") value = -value;
|
|
234
|
+
else if (typeof value === "string" && value[0] !== "-") value = `-${value}`;
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
key: prop,
|
|
238
|
+
value
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
var classPlanCache = /* @__PURE__ */ new WeakMap();
|
|
242
|
+
function getClassPlanCache(grammarConfig) {
|
|
243
|
+
var cache = classPlanCache.get(grammarConfig);
|
|
244
|
+
if (!cache) {
|
|
245
|
+
cache = /* @__PURE__ */ new Map();
|
|
246
|
+
classPlanCache.set(grammarConfig, cache);
|
|
247
|
+
}
|
|
248
|
+
return cache;
|
|
249
|
+
}
|
|
250
|
+
function createPlanEntry(property, value, modifiers) {
|
|
251
|
+
if (modifiers.length === 0) return [property, value];
|
|
252
|
+
var payload = plainValueToPayload(value, property);
|
|
253
|
+
if (payload === null) return null;
|
|
254
|
+
return [null, createFrontendProgram(property, {
|
|
255
|
+
base: null,
|
|
256
|
+
clauses: [{
|
|
257
|
+
modifiers,
|
|
258
|
+
payload
|
|
259
|
+
}]
|
|
260
|
+
})];
|
|
261
|
+
}
|
|
262
|
+
function computeClassPlan(cls, grammarConfig) {
|
|
263
|
+
var groupMarker = /^group(?:\/([A-Za-z0-9_-]+))?$/.exec(cls);
|
|
264
|
+
if (groupMarker) {
|
|
265
|
+
return {
|
|
266
|
+
entries: [["group", groupMarker[1] || true]],
|
|
267
|
+
preserveRawClass: isWeb
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
var containerMarker = /^@container(-size)?(?:\/([A-Za-z0-9_-]+))?$/.exec(cls);
|
|
271
|
+
if (containerMarker) {
|
|
272
|
+
var isSize = containerMarker[1] !== void 0;
|
|
273
|
+
var name = containerMarker[2];
|
|
274
|
+
var entries = [];
|
|
275
|
+
if (name) entries.push(["containerName", name]);
|
|
276
|
+
if (isSize) {
|
|
277
|
+
entries.push(["containerType", "size"]);
|
|
278
|
+
} else if (name) {
|
|
279
|
+
entries.push(["containerType", "inline-size"]);
|
|
280
|
+
} else {
|
|
281
|
+
entries.push(["container", true]);
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
entries,
|
|
285
|
+
preserveRawClass: isWeb
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
var classification = classifyCandidate(cls, grammarConfig);
|
|
289
|
+
if (classification.kind === "passthrough") {
|
|
290
|
+
return isWeb ? "raw" : null;
|
|
291
|
+
}
|
|
292
|
+
var parsed = classification.parsed;
|
|
293
|
+
var util = parsed.kind === "utility" ? parsed.properties : null;
|
|
294
|
+
if (util) {
|
|
295
|
+
var entries1 = [];
|
|
296
|
+
for (var p in util) {
|
|
297
|
+
var entry = createPlanEntry(p, util[p], parsed.modifiers);
|
|
298
|
+
if (!entry) return "raw";
|
|
299
|
+
entries1.push(entry);
|
|
300
|
+
}
|
|
301
|
+
return entries1;
|
|
302
|
+
}
|
|
303
|
+
var flatProp = tailwindClassToFlatProp(parsed);
|
|
304
|
+
if (flatProp) {
|
|
305
|
+
var expanded = expandBorderCandidate(parsed, flatProp.value);
|
|
306
|
+
if (expanded) {
|
|
307
|
+
var entries2 = [];
|
|
308
|
+
for (var p1 in expanded) {
|
|
309
|
+
var entry1 = createPlanEntry(p1, expanded[p1], parsed.modifiers);
|
|
310
|
+
if (!entry1) return "raw";
|
|
311
|
+
entries2.push(entry1);
|
|
312
|
+
}
|
|
313
|
+
return entries2;
|
|
314
|
+
}
|
|
315
|
+
var entry2 = createPlanEntry(flatProp.key, flatProp.value, parsed.modifiers);
|
|
316
|
+
return entry2 ? [entry2] : "raw";
|
|
317
|
+
}
|
|
318
|
+
return "raw";
|
|
319
|
+
}
|
|
320
|
+
var warnedNativePassthroughCandidates = /* @__PURE__ */ new Set();
|
|
321
|
+
function setInAuthoredOrder(target, key, value) {
|
|
322
|
+
if (key in target) delete target[key];
|
|
323
|
+
target[key] = value;
|
|
324
|
+
}
|
|
325
|
+
function preprocessTailwindClassName(props, config) {
|
|
326
|
+
var preservePassthroughPosition = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
327
|
+
var className = props.className;
|
|
328
|
+
if (!className || typeof className !== "string") {
|
|
329
|
+
return props;
|
|
330
|
+
}
|
|
331
|
+
var classes = className.split(/\s+/).filter(Boolean);
|
|
332
|
+
var result = {};
|
|
333
|
+
var grammarConfig = getStyleGrammarConfig(config);
|
|
334
|
+
var plans = getClassPlanCache(grammarConfig);
|
|
335
|
+
var classPlans = classes.map(function(cls2) {
|
|
336
|
+
var plan2 = plans.get(cls2);
|
|
337
|
+
if (plan2 === void 0) {
|
|
338
|
+
plan2 = computeClassPlan(cls2, grammarConfig);
|
|
339
|
+
plans.set(cls2, plan2);
|
|
340
|
+
}
|
|
341
|
+
return plan2;
|
|
342
|
+
});
|
|
343
|
+
var hasOwnedStyleCandidate = preservePassthroughPosition && classPlans.some(function(plan2) {
|
|
344
|
+
return Array.isArray(plan2);
|
|
345
|
+
});
|
|
346
|
+
var frontendProgramIndex = 0;
|
|
347
|
+
var passthroughIndex = 0;
|
|
348
|
+
var regularClasses = [];
|
|
349
|
+
var preserveRawClass = function(cls2) {
|
|
350
|
+
if (hasOwnedStyleCandidate) {
|
|
351
|
+
result[`${STYLE_FRONTEND_PASSTHROUGH_PREFIX}${passthroughIndex++}`] = cls2;
|
|
352
|
+
} else {
|
|
353
|
+
regularClasses.push(cls2);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
var applyEntry = function(param) {
|
|
357
|
+
var [key2, value] = param;
|
|
358
|
+
if (key2 === null) {
|
|
359
|
+
result[`__tamagui_frontend_program_${frontendProgramIndex++}`] = value;
|
|
360
|
+
} else {
|
|
361
|
+
setInAuthoredOrder(result, key2, value);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
for (var key in props) {
|
|
365
|
+
if (key !== "className") {
|
|
366
|
+
setInAuthoredOrder(result, key, props[key]);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
for (var classIndex = 0; classIndex < classes.length; classIndex++) {
|
|
370
|
+
var cls = classes[classIndex];
|
|
371
|
+
var plan = classPlans[classIndex];
|
|
372
|
+
if (plan === null) {
|
|
373
|
+
if (process.env.NODE_ENV !== "production" && !warnedNativePassthroughCandidates.has(cls)) {
|
|
374
|
+
warnedNativePassthroughCandidates.add(cls);
|
|
375
|
+
console.warn(`[tamagui] Tailwind candidate "${cls}" is web-only and was dropped on native. Use a Tamagui grammar candidate or a native style prop for cross-platform output.`);
|
|
376
|
+
}
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
if (plan === "raw") {
|
|
380
|
+
preserveRawClass(cls);
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
if (!Array.isArray(plan)) {
|
|
384
|
+
if (plan.preserveRawClass) {
|
|
385
|
+
preserveRawClass(cls);
|
|
386
|
+
}
|
|
387
|
+
for (var i = 0; i < plan.entries.length; i++) {
|
|
388
|
+
applyEntry(plan.entries[i]);
|
|
389
|
+
}
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
for (var i1 = 0; i1 < plan.length; i1++) {
|
|
393
|
+
applyEntry(plan[i1]);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (regularClasses.length > 0) {
|
|
397
|
+
result.className = regularClasses.join(" ");
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return result;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export { getStyleGrammarConfig, isTokenValueProp, preprocessTailwindClassName, setInAuthoredOrder };
|
|
404
|
+
//# sourceMappingURL=candidate.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate.native.js","names":[],"sources":["esm/candidate.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { STYLE_FRONTEND_PASSTHROUGH_PREFIX, createFrontendProgram, plainValueToPayload } from \"@tamagui/core/internal-runtime\";\nimport { borderSideSuffix, classifyCandidate, createGrammarConfigView, decodeArbitrary, getTokenCategory, getSafeAreaEdge, percentUtilityProps, radiusCornerProps, splitColorOpacitySuffix } from \"@tamagui/style-grammar/runtime\";\nvar styleGrammarConfigCache = /* @__PURE__ */ new WeakMap();\nfunction getStyleGrammarConfig(config) {\n var cached = styleGrammarConfigCache.get(config);\n if (cached) return cached;\n var view = createGrammarConfigView(config);\n styleGrammarConfigCache.set(config, view);\n return view;\n}\nfunction isTokenValueProp(prop) {\n return getTokenCategory(prop) !== null;\n}\nfunction arbitraryValue(inner) {\n var px = /^(-?\\d*\\.?\\d+)px$/.exec(inner);\n if (px) return Number(px[1]);\n if (/^-?\\d*\\.?\\d+$/.test(inner)) return Number(inner);\n return inner;\n}\nfunction tailwindSizingValue(prop, value) {\n if (value === \"full\") return \"100%\";\n if (value === \"auto\") return \"auto\";\n if (value === \"screen\") return /[Hh]eight/.test(prop) ? \"100vh\" : \"100vw\";\n if (value === \"min\") return \"min-content\";\n if (value === \"max\") return \"max-content\";\n if (value === \"fit\") return \"fit-content\";\n var frac = /^(\\d+)\\/(\\d+)$/.exec(value);\n if (frac && Number(frac[2]) !== 0) {\n return `${Number(frac[1]) / Number(frac[2]) * 100}%`;\n }\n return null;\n}\nfunction borderDimValue(raw) {\n var inner = raw;\n if (raw.length > 1 && raw[0] === \"[\" && raw[raw.length - 1] === \"]\") {\n inner = decodeArbitrary(raw.slice(1, -1));\n }\n var px = /^(-?\\d*\\.?\\d+)px$/.exec(inner);\n if (px) return Number.parseFloat(px[1]);\n if (/^-?\\d*\\.?\\d+$/.test(inner)) return Number(inner);\n return inner;\n}\nfunction expandBorderCandidate(parsed, value) {\n var _parsed_entry;\n var prefix = parsed.prefix;\n if (!prefix) return null;\n if (prefix.startsWith(\"rounded-\")) {\n var props = radiusCornerProps[prefix.slice(\"rounded-\".length)];\n if (!props || props.length === 1) return null;\n var out = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = props[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var p = _step.value;\n out[p] = value;\n }\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 out;\n }\n var m = /^border-([trblxy])$/.exec(prefix);\n if (!m) return null;\n var sides = borderSideSuffix[m[1]];\n var suffix = ((_parsed_entry = parsed.entry) === null || _parsed_entry === void 0 ? void 0 : _parsed_entry.prop.endsWith(\"Width\")) ? \"Width\" : \"Color\";\n var out1 = {};\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = sides[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var side = _step1.value;\n out1[`border${side}${suffix}`] = value;\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return out1;\n}\nfunction tailwindClassToFlatProp(parsed) {\n var _parsed_prefix;\n if (parsed.kind !== \"dynamic\" || !parsed.entry || parsed.rawValue === void 0) {\n return null;\n }\n var prop = parsed.entry.prop;\n var category = parsed.entry.tokenCategory;\n var value = parsed.rawValue;\n if (prop.endsWith(\"Width\") && ((_parsed_prefix = parsed.prefix) === null || _parsed_prefix === void 0 ? void 0 : _parsed_prefix.startsWith(\"border\"))) {\n if (parsed.valueKind === \"token\") {\n value = `${parsed.negative ? \"-\" : \"\"}${value}`;\n } else if (parsed.valueKind === \"arbitrary\") {\n value = borderDimValue(value);\n } else {\n return null;\n }\n return {\n key: prop,\n value\n };\n }\n if (prop === \"fontFamily\") {\n var famValue;\n if (value.length > 2 && value[0] === \"[\" && value[value.length - 1] === \"]\") {\n famValue = decodeArbitrary(value.slice(1, -1));\n } else {\n var generic = {\n sans: \"sans-serif\",\n serif: \"serif\",\n mono: \"monospace\"\n };\n famValue = parsed.valueKind === \"token\" ? value : generic[value] || value;\n }\n return {\n key: \"fontFamily\",\n value: famValue\n };\n }\n if (prop === \"fontSize\") {\n var fsValue;\n if (value.length > 2 && value[0] === \"[\" && value[value.length - 1] === \"]\") {\n fsValue = arbitraryValue(decodeArbitrary(value.slice(1, -1)));\n } else {\n fsValue = value;\n }\n return {\n key: \"fontSize\",\n value: fsValue\n };\n }\n if (prop === \"lineHeight\") {\n var lhValue;\n if (value.length > 2 && value[0] === \"[\" && value[value.length - 1] === \"]\") {\n var inner = decodeArbitrary(value.slice(1, -1));\n lhValue = /^-?\\d*\\.?\\d+px$/.test(inner) ? Number.parseFloat(inner) : inner;\n } else {\n lhValue = value;\n }\n return {\n key: \"lineHeight\",\n value: lhValue\n };\n }\n if (prop === \"letterSpacing\") {\n var lsValue;\n if (value.length > 2 && value[0] === \"[\" && value[value.length - 1] === \"]\") {\n lsValue = arbitraryValue(decodeArbitrary(value.slice(1, -1)));\n } else {\n lsValue = value;\n }\n return {\n key: \"letterSpacing\",\n value: lsValue\n };\n }\n if (prop === \"boxShadow\" && value[0] === \"[\" && value[value.length - 1] === \"]\") {\n return {\n key: \"boxShadow\",\n value: decodeArbitrary(value.slice(1, -1))\n };\n }\n if (value.length > 2 && value[0] === \"[\" && value[value.length - 1] === \"]\") {\n var inner1 = decodeArbitrary(value.slice(1, -1));\n if (inner1 === \"\") return null;\n return {\n key: prop,\n value: arbitraryValue(inner1)\n };\n }\n if (category === \"size\" && parsed.valueKind !== \"token\") {\n var sized = tailwindSizingValue(prop, value);\n if (sized != null) {\n return {\n key: prop,\n value: sized\n };\n }\n }\n var opacitySuffix = \"\";\n if (category === \"color\" && typeof value === \"string\") {\n var suffix = splitColorOpacitySuffix(value);\n if (suffix.kind === \"invalid\") {\n return {\n key: prop,\n value\n };\n }\n if (suffix.kind === \"valid\") {\n opacitySuffix = value.slice(suffix.name.length);\n value = suffix.name;\n }\n }\n if (percentUtilityProps.has(prop) && /^\\d+$/.test(value)) {\n value = Number(value) / 100;\n } else if (/^\\d+(\\.\\d+)?$/.test(value)) {\n if (category === \"zIndex\" && parsed.valueKind === \"convenience\") {\n value = Number(value);\n } else if (category) {\n value = `${parsed.negative ? \"-\" : \"\"}${value}`;\n } else {\n value = Number(value);\n }\n } else if (typeof value === \"string\") {\n if (category && !((category === \"space\" || category === \"size\" || category === \"radius\") && getSafeAreaEdge(value))) {\n value = `${parsed.negative ? \"-\" : \"\"}${value}`;\n }\n }\n if (opacitySuffix && typeof value === \"string\") {\n value = `${value}${opacitySuffix}`;\n }\n if (parsed.negative && !category) {\n if (typeof value === \"number\") value = -value;\n else if (typeof value === \"string\" && value[0] !== \"-\") value = `-${value}`;\n }\n return {\n key: prop,\n value\n };\n}\nvar classPlanCache = /* @__PURE__ */ new WeakMap();\nfunction getClassPlanCache(grammarConfig) {\n var cache = classPlanCache.get(grammarConfig);\n if (!cache) {\n cache = /* @__PURE__ */ new Map();\n classPlanCache.set(grammarConfig, cache);\n }\n return cache;\n}\nfunction createPlanEntry(property, value, modifiers) {\n if (modifiers.length === 0) return [\n property,\n value\n ];\n var payload = plainValueToPayload(value, property);\n if (payload === null) return null;\n return [\n null,\n createFrontendProgram(property, {\n base: null,\n clauses: [\n {\n modifiers,\n payload\n }\n ]\n })\n ];\n}\nfunction computeClassPlan(cls, grammarConfig) {\n var groupMarker = /^group(?:\\/([A-Za-z0-9_-]+))?$/.exec(cls);\n if (groupMarker) {\n return {\n entries: [\n [\n \"group\",\n groupMarker[1] || true\n ]\n ],\n preserveRawClass: isWeb\n };\n }\n var containerMarker = /^@container(-size)?(?:\\/([A-Za-z0-9_-]+))?$/.exec(cls);\n if (containerMarker) {\n var isSize = containerMarker[1] !== void 0;\n var name = containerMarker[2];\n var entries = [];\n if (name) entries.push([\n \"containerName\",\n name\n ]);\n if (isSize) {\n entries.push([\n \"containerType\",\n \"size\"\n ]);\n } else if (name) {\n entries.push([\n \"containerType\",\n \"inline-size\"\n ]);\n } else {\n entries.push([\n \"container\",\n true\n ]);\n }\n return {\n entries,\n preserveRawClass: isWeb\n };\n }\n var classification = classifyCandidate(cls, grammarConfig);\n if (classification.kind === \"passthrough\") {\n return isWeb ? \"raw\" : null;\n }\n var parsed = classification.parsed;\n var util = parsed.kind === \"utility\" ? parsed.properties : null;\n if (util) {\n var entries1 = [];\n for (var p in util) {\n var entry = createPlanEntry(p, util[p], parsed.modifiers);\n if (!entry) return \"raw\";\n entries1.push(entry);\n }\n return entries1;\n }\n var flatProp = tailwindClassToFlatProp(parsed);\n if (flatProp) {\n var expanded = expandBorderCandidate(parsed, flatProp.value);\n if (expanded) {\n var entries2 = [];\n for (var p1 in expanded) {\n var entry1 = createPlanEntry(p1, expanded[p1], parsed.modifiers);\n if (!entry1) return \"raw\";\n entries2.push(entry1);\n }\n return entries2;\n }\n var entry2 = createPlanEntry(flatProp.key, flatProp.value, parsed.modifiers);\n return entry2 ? [\n entry2\n ] : \"raw\";\n }\n return \"raw\";\n}\nvar warnedNativePassthroughCandidates = /* @__PURE__ */ new Set();\nfunction setInAuthoredOrder(target, key, value) {\n if (key in target) delete target[key];\n target[key] = value;\n}\nfunction preprocessTailwindClassName(props, config) {\n var preservePassthroughPosition = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;\n var className = props.className;\n if (!className || typeof className !== \"string\") {\n return props;\n }\n var classes = className.split(/\\s+/).filter(Boolean);\n var result = {};\n var grammarConfig = getStyleGrammarConfig(config);\n var plans = getClassPlanCache(grammarConfig);\n var classPlans = classes.map(function(cls2) {\n var plan2 = plans.get(cls2);\n if (plan2 === void 0) {\n plan2 = computeClassPlan(cls2, grammarConfig);\n plans.set(cls2, plan2);\n }\n return plan2;\n });\n var hasOwnedStyleCandidate = preservePassthroughPosition && classPlans.some(function(plan2) {\n return Array.isArray(plan2);\n });\n var frontendProgramIndex = 0;\n var passthroughIndex = 0;\n var regularClasses = [];\n var preserveRawClass = function(cls2) {\n if (hasOwnedStyleCandidate) {\n result[`${STYLE_FRONTEND_PASSTHROUGH_PREFIX}${passthroughIndex++}`] = cls2;\n } else {\n regularClasses.push(cls2);\n }\n };\n var applyEntry = function(param) {\n var [key2, value] = param;\n if (key2 === null) {\n result[`__tamagui_frontend_program_${frontendProgramIndex++}`] = value;\n } else {\n setInAuthoredOrder(result, key2, value);\n }\n };\n for (var key in props) {\n if (key !== \"className\") {\n setInAuthoredOrder(result, key, props[key]);\n continue;\n }\n for (var classIndex = 0; classIndex < classes.length; classIndex++) {\n var cls = classes[classIndex];\n var plan = classPlans[classIndex];\n if (plan === null) {\n if (process.env.NODE_ENV !== \"production\" && !warnedNativePassthroughCandidates.has(cls)) {\n warnedNativePassthroughCandidates.add(cls);\n console.warn(`[tamagui] Tailwind candidate \"${cls}\" is web-only and was dropped on native. Use a Tamagui grammar candidate or a native style prop for cross-platform output.`);\n }\n continue;\n }\n if (plan === \"raw\") {\n preserveRawClass(cls);\n continue;\n }\n if (!Array.isArray(plan)) {\n if (plan.preserveRawClass) {\n preserveRawClass(cls);\n }\n for (var i = 0; i < plan.entries.length; i++) {\n applyEntry(plan.entries[i]);\n }\n continue;\n }\n for (var i1 = 0; i1 < plan.length; i1++) {\n applyEntry(plan[i1]);\n }\n }\n if (regularClasses.length > 0) {\n result.className = regularClasses.join(\" \");\n }\n }\n return result;\n}\nexport {\n getStyleGrammarConfig,\n isTokenValueProp,\n preprocessTailwindClassName,\n setInAuthoredOrder\n};\n//# sourceMappingURL=candidate.js.map\n"],"mappings":";;;;;AAGA,IAAI,0CAA0C,IAAI,QAAQ;AAC1D,SAAS,sBAAsB,QAAQ;CACrC,IAAI,SAAS,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EAC1B;CACF;CACA,IAAI,aAAa,SAAS,OAAO;EAC/B,IAAI,CAAC,MAAM,SAAS;EACpB,IAAI,SAAS,MAAM;GACjB,OAAO,8BAA8B,4BAA4B;EACnE,OAAO;GACL,mBAAmB,QAAQ,MAAM,KAAK;EACxC;CACF;CACA,KAAK,IAAI,OAAO,OAAO;EACrB,IAAI,QAAQ,aAAa;GACvB,mBAAmB,QAAQ,KAAK,MAAM,IAAI;GAC1C;EACF;EACA,KAAK,IAAI,aAAa,GAAG,aAAa,QAAQ,QAAQ,cAAc;GAClE,IAAI,MAAM,QAAQ;GAClB,IAAI,OAAO,WAAW;GACtB,IAAI,SAAS,MAAM;IACjB,IAAI,QAAQ,IAAI,aAAa,gBAAgB,CAAC,kCAAkC,IAAI,GAAG,GAAG;KACxF,kCAAkC,IAAI,GAAG;KACzC,QAAQ,KAAK,iCAAiC,IAAI,2HAA2H;IAC/K;IACA;GACF;GACA,IAAI,SAAS,OAAO;IAClB,iBAAiB,GAAG;IACpB;GACF;GACA,IAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;IACxB,IAAI,KAAK,kBAAkB;KACzB,iBAAiB,GAAG;IACtB;IACA,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,QAAQ,KAAK;KAC5C,WAAW,KAAK,QAAQ,EAAE;IAC5B;IACA;GACF;GACA,KAAK,IAAI,KAAK,GAAG,KAAK,KAAK,QAAQ,MAAM;IACvC,WAAW,KAAK,GAAG;GACrB;EACF;EACA,IAAI,eAAe,SAAS,GAAG;GAC7B,OAAO,YAAY,eAAe,KAAK,GAAG;EAC5C;CACF;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { STYLE_FRONTEND_PREPROCESSED } from "@tamagui/core/internal-runtime";
|
|
2
|
+
import { preprocessTailwindClassName } from "./candidate.mjs";
|
|
3
|
+
|
|
4
|
+
function parseStaticStyle(input, config) {
|
|
5
|
+
return preprocessTailwindClassName({ className: input }, config);
|
|
6
|
+
}
|
|
7
|
+
const normalizedStaticConfigCache = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
const normalizedStaticConfigs = /* @__PURE__ */ new WeakSet();
|
|
9
|
+
function normalizeTailwindStaticConfig(staticConfig, config) {
|
|
10
|
+
if (normalizedStaticConfigs.has(staticConfig)) {
|
|
11
|
+
return staticConfig;
|
|
12
|
+
}
|
|
13
|
+
let configCache = normalizedStaticConfigCache.get(staticConfig);
|
|
14
|
+
const cached = configCache?.get(config);
|
|
15
|
+
if (cached) return cached;
|
|
16
|
+
let variants = staticConfig.variants;
|
|
17
|
+
if (variants) {
|
|
18
|
+
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]));
|
|
19
|
+
}
|
|
20
|
+
const compoundVariants = staticConfig.compoundVariants?.map((compoundVariant) => ({
|
|
21
|
+
...compoundVariant,
|
|
22
|
+
style: typeof compoundVariant.style === "string" ? parseStaticStyle(compoundVariant.style, config) : compoundVariant.style
|
|
23
|
+
}));
|
|
24
|
+
let baseStyle = staticConfig.baseStyle;
|
|
25
|
+
let passthroughClassName = staticConfig.passthroughClassName;
|
|
26
|
+
if (staticConfig.baseClassName) {
|
|
27
|
+
const { className, ...styles } = parseStaticStyle(staticConfig.baseClassName, config);
|
|
28
|
+
baseStyle = styles;
|
|
29
|
+
passthroughClassName = className;
|
|
30
|
+
}
|
|
31
|
+
const normalized = {
|
|
32
|
+
...staticConfig,
|
|
33
|
+
baseStyle,
|
|
34
|
+
passthroughClassName,
|
|
35
|
+
variants,
|
|
36
|
+
compoundVariants
|
|
37
|
+
};
|
|
38
|
+
normalizedStaticConfigs.add(normalized);
|
|
39
|
+
configCache ||= /* @__PURE__ */ new WeakMap();
|
|
40
|
+
configCache.set(config, normalized);
|
|
41
|
+
normalizedStaticConfigCache.set(staticConfig, configCache);
|
|
42
|
+
return normalized;
|
|
43
|
+
}
|
|
44
|
+
const tailwindStyleFrontend = {
|
|
45
|
+
preprocessProps(props, config) {
|
|
46
|
+
const transformed = typeof props.className === "string" ? preprocessTailwindClassName(props, config, true) : props;
|
|
47
|
+
if (transformed !== props) {
|
|
48
|
+
;
|
|
49
|
+
transformed[STYLE_FRONTEND_PREPROCESSED] = true;
|
|
50
|
+
}
|
|
51
|
+
return transformed;
|
|
52
|
+
},
|
|
53
|
+
normalizeStaticConfig: normalizeTailwindStaticConfig
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { parseStaticStyle, tailwindStyleFrontend };
|
|
57
|
+
//# sourceMappingURL=frontend.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend.js","names":[],"sources":["esm/frontend.js"],"sourcesContent":["import {\n STYLE_FRONTEND_PREPROCESSED\n} from \"@tamagui/core/internal-runtime\";\nimport { preprocessTailwindClassName } from \"./candidate\";\nfunction parseStaticStyle(input, config) {\n return preprocessTailwindClassName({ className: input }, config);\n}\nconst normalizedStaticConfigCache = /* @__PURE__ */ new WeakMap();\nconst normalizedStaticConfigs = /* @__PURE__ */ new WeakSet();\nfunction normalizeTailwindStaticConfig(staticConfig, config) {\n if (normalizedStaticConfigs.has(staticConfig)) {\n return staticConfig;\n }\n let configCache = normalizedStaticConfigCache.get(staticConfig);\n const cached = configCache?.get(config);\n if (cached) return cached;\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 const compoundVariants = staticConfig.compoundVariants?.map((compoundVariant) => ({\n ...compoundVariant,\n style: typeof compoundVariant.style === \"string\" ? parseStaticStyle(compoundVariant.style, config) : compoundVariant.style\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 const normalized = {\n ...staticConfig,\n baseStyle,\n passthroughClassName,\n variants,\n compoundVariants\n };\n normalizedStaticConfigs.add(normalized);\n configCache ||= /* @__PURE__ */ new WeakMap();\n configCache.set(config, normalized);\n normalizedStaticConfigCache.set(staticConfig, configCache);\n return normalized;\n}\nconst tailwindStyleFrontend = {\n preprocessProps(props, config) {\n const transformed = typeof props.className === \"string\" ? preprocessTailwindClassName(props, config, true) : props;\n if (transformed !== props) {\n ;\n transformed[STYLE_FRONTEND_PREPROCESSED] = true;\n }\n return transformed;\n },\n normalizeStaticConfig: normalizeTailwindStaticConfig\n};\nexport {\n parseStaticStyle,\n tailwindStyleFrontend\n};\n//# sourceMappingURL=frontend.js.map\n"],"mappings":";;;;AAIA,SAAS,iBAAiB,OAAO,QAAQ;CACvC,OAAO,4BAA4B,EAAE,WAAW,MAAM,GAAG,MAAM;AACjE;AACA,MAAM,8CAA8C,IAAI,QAAQ;AAChE,MAAM,0CAA0C,IAAI,QAAQ;AAC5D,SAAS,8BAA8B,cAAc,QAAQ;CAC3D,IAAI,wBAAwB,IAAI,YAAY,GAAG;EAC7C,OAAO;CACT;CACA,IAAI,cAAc,4BAA4B,IAAI,YAAY;CAC9D,MAAM,SAAS,aAAa,IAAI,MAAM;CACtC,IAAI,QAAQ,OAAO;CACnB,IAAI,WAAW,aAAa;CAC5B,IAAI,UAAU;EACZ,WAAW,OAAO,YAChB,OAAO,QAAQ,QAAQ,EAAE,KAAK,CAAC,aAAa,gBAAgB,CAC1D,aACA,OAAO,eAAe,YAAY,aAAa,OAAO,YACpD,OAAO,QAAQ,UAAU,EAAE,KAAK,CAAC,SAAS,WAAW,CACnD,SACA,OAAO,UAAU,WAAW,iBAAiB,OAAO,MAAM,IAAI,KAChE,CAAC,CACH,IAAI,UACN,CAAC,CACH;CACF;CACA,MAAM,mBAAmB,aAAa,kBAAkB,KAAK,qBAAqB;EAChF,GAAG;EACH,OAAO,OAAO,gBAAgB,UAAU,WAAW,iBAAiB,gBAAgB,OAAO,MAAM,IAAI,gBAAgB;CACvH,EAAE;CACF,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,MAAM,aAAa;EACjB,GAAG;EACH;EACA;EACA;EACA;CACF;CACA,wBAAwB,IAAI,UAAU;CACtC,gCAAgC,IAAI,QAAQ;CAC5C,YAAY,IAAI,QAAQ,UAAU;CAClC,4BAA4B,IAAI,cAAc,WAAW;CACzD,OAAO;AACT;AACA,MAAM,wBAAwB;CAC5B,gBAAgB,OAAO,QAAQ;EAC7B,MAAM,cAAc,OAAO,MAAM,cAAc,WAAW,4BAA4B,OAAO,QAAQ,IAAI,IAAI;EAC7G,IAAI,gBAAgB,OAAO;GACzB;GACA,YAAY,+BAA+B;EAC7C;EACA,OAAO;CACT;CACA,uBAAuB;AACzB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { STYLE_FRONTEND_PREPROCESSED } from "@tamagui/core/internal-runtime";
|
|
2
|
+
import { preprocessTailwindClassName } from "./candidate.native.js";
|
|
3
|
+
|
|
4
|
+
function _type_of(obj) {
|
|
5
|
+
"@swc/helpers - typeof";
|
|
6
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
7
|
+
}
|
|
8
|
+
function parseStaticStyle(input, config) {
|
|
9
|
+
return preprocessTailwindClassName({ className: input }, config);
|
|
10
|
+
}
|
|
11
|
+
var normalizedStaticConfigCache = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
var normalizedStaticConfigs = /* @__PURE__ */ new WeakSet();
|
|
13
|
+
function normalizeTailwindStaticConfig(staticConfig, config) {
|
|
14
|
+
var _staticConfig_compoundVariants;
|
|
15
|
+
if (normalizedStaticConfigs.has(staticConfig)) {
|
|
16
|
+
return staticConfig;
|
|
17
|
+
}
|
|
18
|
+
var configCache = normalizedStaticConfigCache.get(staticConfig);
|
|
19
|
+
var cached = configCache === null || configCache === void 0 ? void 0 : configCache.get(config);
|
|
20
|
+
if (cached) return cached;
|
|
21
|
+
var variants = staticConfig.variants;
|
|
22
|
+
if (variants) {
|
|
23
|
+
variants = Object.fromEntries(Object.entries(variants).map(function(param) {
|
|
24
|
+
var [variantName, definition] = param;
|
|
25
|
+
return [variantName, (typeof definition === "undefined" ? "undefined" : _type_of(definition)) === "object" && definition ? Object.fromEntries(Object.entries(definition).map(function(param2) {
|
|
26
|
+
var [matcher, value] = param2;
|
|
27
|
+
return [matcher, typeof value === "string" ? parseStaticStyle(value, config) : value];
|
|
28
|
+
})) : definition];
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
var compoundVariants = (_staticConfig_compoundVariants = staticConfig.compoundVariants) === null || _staticConfig_compoundVariants === void 0 ? void 0 : _staticConfig_compoundVariants.map(function(compoundVariant) {
|
|
32
|
+
return {
|
|
33
|
+
...compoundVariant,
|
|
34
|
+
style: typeof compoundVariant.style === "string" ? parseStaticStyle(compoundVariant.style, config) : compoundVariant.style
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
var baseStyle = staticConfig.baseStyle;
|
|
38
|
+
var passthroughClassName = staticConfig.passthroughClassName;
|
|
39
|
+
if (staticConfig.baseClassName) {
|
|
40
|
+
var { className, ...styles } = parseStaticStyle(staticConfig.baseClassName, config);
|
|
41
|
+
baseStyle = styles;
|
|
42
|
+
passthroughClassName = className;
|
|
43
|
+
}
|
|
44
|
+
var normalized = {
|
|
45
|
+
...staticConfig,
|
|
46
|
+
baseStyle,
|
|
47
|
+
passthroughClassName,
|
|
48
|
+
variants,
|
|
49
|
+
compoundVariants
|
|
50
|
+
};
|
|
51
|
+
normalizedStaticConfigs.add(normalized);
|
|
52
|
+
configCache || (configCache = /* @__PURE__ */ new WeakMap());
|
|
53
|
+
configCache.set(config, normalized);
|
|
54
|
+
normalizedStaticConfigCache.set(staticConfig, configCache);
|
|
55
|
+
return normalized;
|
|
56
|
+
}
|
|
57
|
+
var tailwindStyleFrontend = {
|
|
58
|
+
preprocessProps(props, config) {
|
|
59
|
+
var transformed = typeof props.className === "string" ? preprocessTailwindClassName(props, config, true) : props;
|
|
60
|
+
if (transformed !== props) {
|
|
61
|
+
;
|
|
62
|
+
transformed[STYLE_FRONTEND_PREPROCESSED] = true;
|
|
63
|
+
}
|
|
64
|
+
return transformed;
|
|
65
|
+
},
|
|
66
|
+
normalizeStaticConfig: normalizeTailwindStaticConfig
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { parseStaticStyle, tailwindStyleFrontend };
|
|
70
|
+
//# sourceMappingURL=frontend.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontend.native.js","names":[],"sources":["esm/frontend.native.js"],"sourcesContent":["import { STYLE_FRONTEND_PREPROCESSED } from \"@tamagui/core/internal-runtime\";\nimport { preprocessTailwindClassName } from \"./candidate\";\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nfunction parseStaticStyle(input, config) {\n return preprocessTailwindClassName({\n className: input\n }, config);\n}\nvar normalizedStaticConfigCache = /* @__PURE__ */ new WeakMap();\nvar normalizedStaticConfigs = /* @__PURE__ */ new WeakSet();\nfunction normalizeTailwindStaticConfig(staticConfig, config) {\n var _staticConfig_compoundVariants;\n if (normalizedStaticConfigs.has(staticConfig)) {\n return staticConfig;\n }\n var configCache = normalizedStaticConfigCache.get(staticConfig);\n var cached = configCache === null || configCache === void 0 ? void 0 : configCache.get(config);\n if (cached) return cached;\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 === \"undefined\" ? \"undefined\" : _type_of(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 compoundVariants = (_staticConfig_compoundVariants = staticConfig.compoundVariants) === null || _staticConfig_compoundVariants === void 0 ? void 0 : _staticConfig_compoundVariants.map(function(compoundVariant) {\n return {\n ...compoundVariant,\n style: typeof compoundVariant.style === \"string\" ? parseStaticStyle(compoundVariant.style, config) : compoundVariant.style\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 var normalized = {\n ...staticConfig,\n baseStyle,\n passthroughClassName,\n variants,\n compoundVariants\n };\n normalizedStaticConfigs.add(normalized);\n configCache || (configCache = /* @__PURE__ */ new WeakMap());\n configCache.set(config, normalized);\n normalizedStaticConfigCache.set(staticConfig, configCache);\n return normalized;\n}\nvar tailwindStyleFrontend = {\n preprocessProps(props, config) {\n var transformed = typeof props.className === \"string\" ? preprocessTailwindClassName(props, config, true) : props;\n if (transformed !== props) {\n ;\n transformed[STYLE_FRONTEND_PREPROCESSED] = true;\n }\n return transformed;\n },\n normalizeStaticConfig: normalizeTailwindStaticConfig\n};\nexport {\n parseStaticStyle,\n tailwindStyleFrontend\n};\n//# sourceMappingURL=frontend.js.map\n"],"mappings":";;;;AAEA,SAAS,SAAS,KAAK;CACrB;CACA,OAAO,OAAO,OAAO,WAAW,eAAe,IAAI,gBAAgB,SAAS,WAAW,OAAO;AAChG;AACA,SAAS,iBAAiB,OAAO,QAAQ;CACvC,OAAO,4BAA4B,EACjC,WAAW,MACb,GAAG,MAAM;AACX;AACA,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AgB,8BAA8B,IAAI,QAAQ;CAC1D,YAAY,IAAI,QAAQ,UAAU;CAClC,4BAA4B,IAAI,cAAc,WAAW;CACzD,OAAO;AACT;AACA,IAAI,wBAAwB;CAC1B,gBAAgB,OAAO,QAAQ;EAC7B,IAAI,cAAc,OAAO,MAAM,cAAc,WAAW,4BAA4B,OAAO,QAAQ,IAAI,IAAI;EAC3G,IAAI,gBAAgB,OAAO;GACzB;GACA,YAAY,+BAA+B;EAC7C;EACA,OAAO;CACT;CACA,uBAAuB;AACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFrontendViews } from "@tamagui/core/internal-runtime";
|
|
2
|
+
import { parseStaticStyle, tailwindStyleFrontend, tailwindStyleFrontend as tailwindStyleFrontend2 } from "./frontend.mjs";
|
|
3
|
+
import { styled } from "./styled.mjs";
|
|
4
|
+
import { preprocessTailwindClassName } from "./candidate.mjs";
|
|
5
|
+
|
|
6
|
+
const frontendViews = createFrontendViews(tailwindStyleFrontend);
|
|
7
|
+
const View = frontendViews.View;
|
|
8
|
+
const Text = frontendViews.Text;
|
|
9
|
+
|
|
10
|
+
export { Text, View, parseStaticStyle, preprocessTailwindClassName, 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 { createFrontendViews } from \"@tamagui/core/internal-runtime\";\nimport { tailwindStyleFrontend } from \"./frontend\";\nimport { styled } from \"./styled\";\nimport { parseStaticStyle, tailwindStyleFrontend as tailwindStyleFrontend2 } from \"./frontend\";\nimport { preprocessTailwindClassName } from \"./candidate\";\nconst frontendViews = createFrontendViews(tailwindStyleFrontend);\nconst View = frontendViews.View;\nconst Text = frontendViews.Text;\nexport {\n Text,\n View,\n parseStaticStyle,\n preprocessTailwindClassName,\n styled,\n tailwindStyleFrontend2 as tailwindStyleFrontend\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAKA,MAAM,gBAAgB,oBAAoB,qBAAqB;AAC/D,MAAM,OAAO,cAAc;AAC3B,MAAM,OAAO,cAAc"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { 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
|
+
import { preprocessTailwindClassName } from "./candidate.native.js";
|
|
5
|
+
|
|
6
|
+
var frontendViews = createFrontendViews(tailwindStyleFrontend);
|
|
7
|
+
var View = frontendViews.View;
|
|
8
|
+
var Text = frontendViews.Text;
|
|
9
|
+
|
|
10
|
+
export { Text, View, parseStaticStyle, preprocessTailwindClassName, 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 { createFrontendViews } from \"@tamagui/core/internal-runtime\";\nimport { tailwindStyleFrontend } from \"./frontend\";\nimport { styled } from \"./styled\";\nimport { parseStaticStyle, tailwindStyleFrontend as tailwindStyleFrontend2 } from \"./frontend\";\nimport { preprocessTailwindClassName } from \"./candidate\";\nvar frontendViews = createFrontendViews(tailwindStyleFrontend);\nvar View = frontendViews.View;\nvar Text = frontendViews.Text;\nexport {\n Text,\n View,\n parseStaticStyle,\n preprocessTailwindClassName,\n styled,\n tailwindStyleFrontend2 as tailwindStyleFrontend\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;AAKA,IAAI,gBAAgB,oBAAoB,qBAAqB;AAC7D,IAAI,OAAO,cAAc;AACzB,IAAI,OAAO,cAAc"}
|
|
@@ -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
|