@tamagui/tailwind 3.0.0-beta.755.1 → 3.0.0-beta.804.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.
@@ -21,8 +21,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var candidate_exports = {};
22
22
  __export(candidate_exports, {
23
23
  getStyleGrammarConfig: () => getStyleGrammarConfig,
24
+ getTailwindClassPlan: () => getTailwindClassPlan,
24
25
  isTokenValueProp: () => isTokenValueProp,
25
- preprocessTailwindClassName: () => preprocessTailwindClassName,
26
+ resolveTailwindClassName: () => resolveTailwindClassName,
26
27
  setInAuthoredOrder: () => setInAuthoredOrder
27
28
  });
28
29
  module.exports = __toCommonJS(candidate_exports);
@@ -32,9 +33,13 @@ var import_runtime = require("@tamagui/style-grammar/runtime");
32
33
  const styleGrammarConfigCache = /* @__PURE__ */ new WeakMap();
33
34
  function getStyleGrammarConfig(config) {
34
35
  const cached = styleGrammarConfigCache.get(config);
35
- if (cached) return cached;
36
+ const revision = config[import_runtime.configRevisionSymbol]?.revision || 0;
37
+ if (cached && cached.revision === revision) return cached.value;
36
38
  const view = (0, import_runtime.createGrammarConfigView)(config);
37
- styleGrammarConfigCache.set(config, view);
39
+ styleGrammarConfigCache.set(config, {
40
+ revision,
41
+ value: view
42
+ });
38
43
  return view;
39
44
  }
40
45
  function isTokenValueProp(prop) {
@@ -238,13 +243,17 @@ function createPlanEntry(property, value, modifiers) {
238
243
  if (modifiers.length === 0) return [property, value];
239
244
  const payload = (0, import_internal_runtime.plainValueToPayload)(value, property);
240
245
  if (payload === null) return null;
241
- return [null, (0, import_internal_runtime.createFrontendProgram)(property, {
242
- base: null,
243
- clauses: [{
244
- modifiers,
245
- payload
246
- }]
247
- })];
246
+ let condition = "";
247
+ for (let index = 0; index < modifiers.length; index++) {
248
+ if (index) condition += ":";
249
+ condition += modifiers[index];
250
+ }
251
+ return [
252
+ property,
253
+ payload,
254
+ condition,
255
+ modifiers
256
+ ];
248
257
  }
249
258
  function computeClassPlan(cls, grammarConfig) {
250
259
  const groupMarker = /^group(?:\/([A-Za-z0-9_-]+))?$/.exec(cls);
@@ -259,13 +268,9 @@ function computeClassPlan(cls, grammarConfig) {
259
268
  const isSize = containerMarker[1] !== void 0;
260
269
  const name = containerMarker[2];
261
270
  const entries = [];
262
- if (name) entries.push(["containerName", name]);
271
+ entries.push(["container", name || true]);
263
272
  if (isSize) {
264
273
  entries.push(["containerType", "size"]);
265
- } else if (name) {
266
- entries.push(["containerType", "inline-size"]);
267
- } else {
268
- entries.push(["container", true]);
269
274
  }
270
275
  return {
271
276
  entries,
@@ -304,81 +309,63 @@ function computeClassPlan(cls, grammarConfig) {
304
309
  }
305
310
  return "raw";
306
311
  }
307
- const warnedNativePassthroughCandidates = /* @__PURE__ */ new Set();
308
- function setInAuthoredOrder(target, key, value) {
309
- if (key in target) delete target[key];
310
- target[key] = value;
311
- }
312
- function preprocessTailwindClassName(props, config, preservePassthroughPosition = false) {
313
- const className = props.className;
314
- if (!className || typeof className !== "string") {
315
- return props;
316
- }
317
- const classes = className.split(/\s+/).filter(Boolean);
318
- const result = {};
312
+ function getTailwindClassPlan(candidate, config) {
319
313
  const grammarConfig = getStyleGrammarConfig(config);
320
314
  const plans = getClassPlanCache(grammarConfig);
321
- const classPlans = classes.map((cls) => {
322
- let plan = plans.get(cls);
323
- if (plan === void 0) {
324
- plan = computeClassPlan(cls, grammarConfig);
325
- plans.set(cls, plan);
326
- }
327
- return plan;
328
- });
329
- const hasOwnedStyleCandidate = preservePassthroughPosition && classPlans.some((plan) => Array.isArray(plan));
330
- let frontendProgramIndex = 0;
331
- let passthroughIndex = 0;
332
- const regularClasses = [];
333
- const preserveRawClass = (cls) => {
334
- if (hasOwnedStyleCandidate) {
335
- result[`${import_internal_runtime.STYLE_FRONTEND_PASSTHROUGH_PREFIX}${passthroughIndex++}`] = cls;
336
- } else {
337
- regularClasses.push(cls);
338
- }
339
- };
340
- const applyEntry = ([key, value]) => {
341
- if (key === null) {
342
- result[`__tamagui_frontend_program_${frontendProgramIndex++}`] = value;
343
- } else {
344
- setInAuthoredOrder(result, key, value);
345
- }
346
- };
347
- for (const key in props) {
348
- if (key !== "className") {
349
- setInAuthoredOrder(result, key, props[key]);
315
+ let plan = plans.get(candidate);
316
+ if (plan === void 0) {
317
+ plan = computeClassPlan(candidate, grammarConfig);
318
+ plans.set(candidate, plan);
319
+ }
320
+ return plan;
321
+ }
322
+ function resolveTailwindClassName(className, config) {
323
+ const result = {};
324
+ let rawClassName = "";
325
+ let start = 0;
326
+ for (let index = 0; index <= className.length; index++) {
327
+ if (index !== className.length && className.charCodeAt(index) > 32) continue;
328
+ if (start === index) {
329
+ start = index + 1;
350
330
  continue;
351
331
  }
352
- for (let classIndex = 0; classIndex < classes.length; classIndex++) {
353
- const cls = classes[classIndex];
354
- const plan = classPlans[classIndex];
355
- if (plan === null) {
356
- if (process.env.NODE_ENV !== "production" && !warnedNativePassthroughCandidates.has(cls)) {
357
- warnedNativePassthroughCandidates.add(cls);
358
- 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.`);
359
- }
360
- continue;
361
- }
362
- if (plan === "raw") {
363
- preserveRawClass(cls);
364
- continue;
332
+ const candidate = className.slice(start, index);
333
+ const plan = getTailwindClassPlan(candidate, config);
334
+ if (plan === "raw") {
335
+ rawClassName = rawClassName ? `${rawClassName} ${candidate}` : candidate;
336
+ } else if (plan) {
337
+ const parentPlan = plan;
338
+ if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
339
+ rawClassName = rawClassName ? `${rawClassName} ${candidate}` : candidate;
365
340
  }
366
- if (!Array.isArray(plan)) {
367
- if (plan.preserveRawClass) {
368
- preserveRawClass(cls);
341
+ const entries = Array.isArray(plan) ? plan : parentPlan.entries;
342
+ for (let entryIndex = 0; entryIndex < entries.length; entryIndex++) {
343
+ const [key, value, condition] = entries[entryIndex];
344
+ const previous = result[key];
345
+ let next = value;
346
+ if (condition !== void 0) {
347
+ next = previous && typeof previous === "object" && !Array.isArray(previous) ? {
348
+ ...previous,
349
+ [condition]: value
350
+ } : previous === void 0 ? { [condition]: value } : {
351
+ default: previous,
352
+ [condition]: value
353
+ };
354
+ } else if (previous && typeof previous === "object" && !Array.isArray(previous)) {
355
+ next = {
356
+ ...previous,
357
+ default: value
358
+ };
369
359
  }
370
- for (let i = 0; i < plan.entries.length; i++) {
371
- applyEntry(plan.entries[i]);
372
- }
373
- continue;
374
- }
375
- for (let i = 0; i < plan.length; i++) {
376
- applyEntry(plan[i]);
360
+ setInAuthoredOrder(result, key, next);
377
361
  }
378
362
  }
379
- if (regularClasses.length > 0) {
380
- result.className = regularClasses.join(" ");
381
- }
363
+ start = index + 1;
382
364
  }
365
+ if (rawClassName) result.className = rawClassName;
383
366
  return result;
384
367
  }
368
+ function setInAuthoredOrder(target, key, value) {
369
+ if (key in target) delete target[key];
370
+ target[key] = value;
371
+ }
@@ -23,20 +23,30 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
23
23
  var candidate_exports = {};
24
24
  __export(candidate_exports, {
25
25
  getStyleGrammarConfig: () => getStyleGrammarConfig,
26
+ getTailwindClassPlan: () => getTailwindClassPlan,
26
27
  isTokenValueProp: () => isTokenValueProp,
27
- preprocessTailwindClassName: () => preprocessTailwindClassName,
28
+ resolveTailwindClassName: () => resolveTailwindClassName,
28
29
  setInAuthoredOrder: () => setInAuthoredOrder
29
30
  });
30
31
  module.exports = __toCommonJS(candidate_exports);
31
32
  var import_constants = require("@tamagui/constants");
32
33
  var import_internal_runtime = require("@tamagui/core/internal-runtime");
33
34
  var import_runtime = require("@tamagui/style-grammar/runtime");
35
+ function _type_of(obj) {
36
+ "@swc/helpers - typeof";
37
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
38
+ }
34
39
  var styleGrammarConfigCache = /* @__PURE__ */ new WeakMap();
35
40
  function getStyleGrammarConfig(config) {
41
+ var _config_configRevisionSymbol;
36
42
  var cached = styleGrammarConfigCache.get(config);
37
- if (cached) return cached;
43
+ var revision = ((_config_configRevisionSymbol = config[import_runtime.configRevisionSymbol]) === null || _config_configRevisionSymbol === void 0 ? void 0 : _config_configRevisionSymbol.revision) || 0;
44
+ if (cached && cached.revision === revision) return cached.value;
38
45
  var view = (0, import_runtime.createGrammarConfigView)(config);
39
- styleGrammarConfigCache.set(config, view);
46
+ styleGrammarConfigCache.set(config, {
47
+ revision,
48
+ value: view
49
+ });
40
50
  return view;
41
51
  }
42
52
  function isTokenValueProp(prop) {
@@ -280,13 +290,17 @@ function createPlanEntry(property, value, modifiers) {
280
290
  if (modifiers.length === 0) return [property, value];
281
291
  var payload = (0, import_internal_runtime.plainValueToPayload)(value, property);
282
292
  if (payload === null) return null;
283
- return [null, (0, import_internal_runtime.createFrontendProgram)(property, {
284
- base: null,
285
- clauses: [{
286
- modifiers,
287
- payload
288
- }]
289
- })];
293
+ var condition = "";
294
+ for (var index = 0; index < modifiers.length; index++) {
295
+ if (index) condition += ":";
296
+ condition += modifiers[index];
297
+ }
298
+ return [
299
+ property,
300
+ payload,
301
+ condition,
302
+ modifiers
303
+ ];
290
304
  }
291
305
  function computeClassPlan(cls, grammarConfig) {
292
306
  var groupMarker = /^group(?:\/([A-Za-z0-9_-]+))?$/.exec(cls);
@@ -301,13 +315,9 @@ function computeClassPlan(cls, grammarConfig) {
301
315
  var isSize = containerMarker[1] !== void 0;
302
316
  var name = containerMarker[2];
303
317
  var entries = [];
304
- if (name) entries.push(["containerName", name]);
318
+ entries.push(["container", name || true]);
305
319
  if (isSize) {
306
320
  entries.push(["containerType", "size"]);
307
- } else if (name) {
308
- entries.push(["containerType", "inline-size"]);
309
- } else {
310
- entries.push(["container", true]);
311
321
  }
312
322
  return {
313
323
  entries,
@@ -346,85 +356,63 @@ function computeClassPlan(cls, grammarConfig) {
346
356
  }
347
357
  return "raw";
348
358
  }
349
- var warnedNativePassthroughCandidates = /* @__PURE__ */ new Set();
350
- function setInAuthoredOrder(target, key, value) {
351
- if (key in target) delete target[key];
352
- target[key] = value;
353
- }
354
- function preprocessTailwindClassName(props, config) {
355
- var preservePassthroughPosition = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
356
- var className = props.className;
357
- if (!className || typeof className !== "string") {
358
- return props;
359
- }
360
- var classes = className.split(/\s+/).filter(Boolean);
361
- var result = {};
359
+ function getTailwindClassPlan(candidate, config) {
362
360
  var grammarConfig = getStyleGrammarConfig(config);
363
361
  var plans = getClassPlanCache(grammarConfig);
364
- var classPlans = classes.map(function(cls2) {
365
- var plan2 = plans.get(cls2);
366
- if (plan2 === void 0) {
367
- plan2 = computeClassPlan(cls2, grammarConfig);
368
- plans.set(cls2, plan2);
369
- }
370
- return plan2;
371
- });
372
- var hasOwnedStyleCandidate = preservePassthroughPosition && classPlans.some(function(plan2) {
373
- return Array.isArray(plan2);
374
- });
375
- var frontendProgramIndex = 0;
376
- var passthroughIndex = 0;
377
- var regularClasses = [];
378
- var preserveRawClass = function(cls2) {
379
- if (hasOwnedStyleCandidate) {
380
- result[`${import_internal_runtime.STYLE_FRONTEND_PASSTHROUGH_PREFIX}${passthroughIndex++}`] = cls2;
381
- } else {
382
- regularClasses.push(cls2);
383
- }
384
- };
385
- var applyEntry = function(param) {
386
- var [key2, value] = param;
387
- if (key2 === null) {
388
- result[`__tamagui_frontend_program_${frontendProgramIndex++}`] = value;
389
- } else {
390
- setInAuthoredOrder(result, key2, value);
391
- }
392
- };
393
- for (var key in props) {
394
- if (key !== "className") {
395
- setInAuthoredOrder(result, key, props[key]);
362
+ var plan = plans.get(candidate);
363
+ if (plan === void 0) {
364
+ plan = computeClassPlan(candidate, grammarConfig);
365
+ plans.set(candidate, plan);
366
+ }
367
+ return plan;
368
+ }
369
+ function resolveTailwindClassName(className, config) {
370
+ var result = {};
371
+ var rawClassName = "";
372
+ var start = 0;
373
+ for (var index = 0; index <= className.length; index++) {
374
+ if (index !== className.length && className.charCodeAt(index) > 32) continue;
375
+ if (start === index) {
376
+ start = index + 1;
396
377
  continue;
397
378
  }
398
- for (var classIndex = 0; classIndex < classes.length; classIndex++) {
399
- var cls = classes[classIndex];
400
- var plan = classPlans[classIndex];
401
- if (plan === null) {
402
- if (process.env.NODE_ENV !== "production" && !warnedNativePassthroughCandidates.has(cls)) {
403
- warnedNativePassthroughCandidates.add(cls);
404
- 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.`);
405
- }
406
- continue;
407
- }
408
- if (plan === "raw") {
409
- preserveRawClass(cls);
410
- continue;
379
+ var candidate = className.slice(start, index);
380
+ var plan = getTailwindClassPlan(candidate, config);
381
+ if (plan === "raw") {
382
+ rawClassName = rawClassName ? `${rawClassName} ${candidate}` : candidate;
383
+ } else if (plan) {
384
+ var parentPlan = plan;
385
+ if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
386
+ rawClassName = rawClassName ? `${rawClassName} ${candidate}` : candidate;
411
387
  }
412
- if (!Array.isArray(plan)) {
413
- if (plan.preserveRawClass) {
414
- preserveRawClass(cls);
388
+ var entries = Array.isArray(plan) ? plan : parentPlan.entries;
389
+ for (var entryIndex = 0; entryIndex < entries.length; entryIndex++) {
390
+ var [key, value, condition] = entries[entryIndex];
391
+ var previous = result[key];
392
+ var next = value;
393
+ if (condition !== void 0) {
394
+ next = previous && (typeof previous === "undefined" ? "undefined" : _type_of(previous)) === "object" && !Array.isArray(previous) ? {
395
+ ...previous,
396
+ [condition]: value
397
+ } : previous === void 0 ? { [condition]: value } : {
398
+ default: previous,
399
+ [condition]: value
400
+ };
401
+ } else if (previous && (typeof previous === "undefined" ? "undefined" : _type_of(previous)) === "object" && !Array.isArray(previous)) {
402
+ next = {
403
+ ...previous,
404
+ default: value
405
+ };
415
406
  }
416
- for (var i = 0; i < plan.entries.length; i++) {
417
- applyEntry(plan.entries[i]);
418
- }
419
- continue;
420
- }
421
- for (var i1 = 0; i1 < plan.length; i1++) {
422
- applyEntry(plan[i1]);
407
+ setInAuthoredOrder(result, key, next);
423
408
  }
424
409
  }
425
- if (regularClasses.length > 0) {
426
- result.className = regularClasses.join(" ");
427
- }
410
+ start = index + 1;
428
411
  }
412
+ if (rawClassName) result.className = rawClassName;
429
413
  return result;
430
414
  }
415
+ function setInAuthoredOrder(target, key, value) {
416
+ if (key in target) delete target[key];
417
+ target[key] = value;
418
+ }
@@ -23,20 +23,30 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
23
23
  var candidate_exports = {};
24
24
  __export(candidate_exports, {
25
25
  getStyleGrammarConfig: () => getStyleGrammarConfig,
26
+ getTailwindClassPlan: () => getTailwindClassPlan,
26
27
  isTokenValueProp: () => isTokenValueProp,
27
- preprocessTailwindClassName: () => preprocessTailwindClassName,
28
+ resolveTailwindClassName: () => resolveTailwindClassName,
28
29
  setInAuthoredOrder: () => setInAuthoredOrder
29
30
  });
30
31
  module.exports = __toCommonJS(candidate_exports);
31
32
  var import_constants = require("@tamagui/constants");
32
33
  var import_internal_runtime = require("@tamagui/core/internal-runtime");
33
34
  var import_runtime = require("@tamagui/style-grammar/runtime");
35
+ function _type_of(obj) {
36
+ "@swc/helpers - typeof";
37
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
38
+ }
34
39
  var styleGrammarConfigCache = /* @__PURE__ */ new WeakMap();
35
40
  function getStyleGrammarConfig(config) {
41
+ var _config_configRevisionSymbol;
36
42
  var cached = styleGrammarConfigCache.get(config);
37
- if (cached) return cached;
43
+ var revision = ((_config_configRevisionSymbol = config[import_runtime.configRevisionSymbol]) === null || _config_configRevisionSymbol === void 0 ? void 0 : _config_configRevisionSymbol.revision) || 0;
44
+ if (cached && cached.revision === revision) return cached.value;
38
45
  var view = (0, import_runtime.createGrammarConfigView)(config);
39
- styleGrammarConfigCache.set(config, view);
46
+ styleGrammarConfigCache.set(config, {
47
+ revision,
48
+ value: view
49
+ });
40
50
  return view;
41
51
  }
42
52
  function isTokenValueProp(prop) {
@@ -280,13 +290,17 @@ function createPlanEntry(property, value, modifiers) {
280
290
  if (modifiers.length === 0) return [property, value];
281
291
  var payload = (0, import_internal_runtime.plainValueToPayload)(value, property);
282
292
  if (payload === null) return null;
283
- return [null, (0, import_internal_runtime.createFrontendProgram)(property, {
284
- base: null,
285
- clauses: [{
286
- modifiers,
287
- payload
288
- }]
289
- })];
293
+ var condition = "";
294
+ for (var index = 0; index < modifiers.length; index++) {
295
+ if (index) condition += ":";
296
+ condition += modifiers[index];
297
+ }
298
+ return [
299
+ property,
300
+ payload,
301
+ condition,
302
+ modifiers
303
+ ];
290
304
  }
291
305
  function computeClassPlan(cls, grammarConfig) {
292
306
  var groupMarker = /^group(?:\/([A-Za-z0-9_-]+))?$/.exec(cls);
@@ -301,13 +315,9 @@ function computeClassPlan(cls, grammarConfig) {
301
315
  var isSize = containerMarker[1] !== void 0;
302
316
  var name = containerMarker[2];
303
317
  var entries = [];
304
- if (name) entries.push(["containerName", name]);
318
+ entries.push(["container", name || true]);
305
319
  if (isSize) {
306
320
  entries.push(["containerType", "size"]);
307
- } else if (name) {
308
- entries.push(["containerType", "inline-size"]);
309
- } else {
310
- entries.push(["container", true]);
311
321
  }
312
322
  return {
313
323
  entries,
@@ -346,87 +356,65 @@ function computeClassPlan(cls, grammarConfig) {
346
356
  }
347
357
  return "raw";
348
358
  }
349
- var warnedNativePassthroughCandidates = /* @__PURE__ */ new Set();
350
- function setInAuthoredOrder(target, key, value) {
351
- if (key in target) delete target[key];
352
- target[key] = value;
353
- }
354
- function preprocessTailwindClassName(props, config) {
355
- var preservePassthroughPosition = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
356
- var className = props.className;
357
- if (!className || typeof className !== "string") {
358
- return props;
359
- }
360
- var classes = className.split(/\s+/).filter(Boolean);
361
- var result = {};
359
+ function getTailwindClassPlan(candidate, config) {
362
360
  var grammarConfig = getStyleGrammarConfig(config);
363
361
  var plans = getClassPlanCache(grammarConfig);
364
- var classPlans = classes.map(function(cls2) {
365
- var plan2 = plans.get(cls2);
366
- if (plan2 === void 0) {
367
- plan2 = computeClassPlan(cls2, grammarConfig);
368
- plans.set(cls2, plan2);
369
- }
370
- return plan2;
371
- });
372
- var hasOwnedStyleCandidate = preservePassthroughPosition && classPlans.some(function(plan2) {
373
- return Array.isArray(plan2);
374
- });
375
- var frontendProgramIndex = 0;
376
- var passthroughIndex = 0;
377
- var regularClasses = [];
378
- var preserveRawClass = function(cls2) {
379
- if (hasOwnedStyleCandidate) {
380
- result[`${import_internal_runtime.STYLE_FRONTEND_PASSTHROUGH_PREFIX}${passthroughIndex++}`] = cls2;
381
- } else {
382
- regularClasses.push(cls2);
383
- }
384
- };
385
- var applyEntry = function(param) {
386
- var [key2, value] = param;
387
- if (key2 === null) {
388
- result[`__tamagui_frontend_program_${frontendProgramIndex++}`] = value;
389
- } else {
390
- setInAuthoredOrder(result, key2, value);
391
- }
392
- };
393
- for (var key in props) {
394
- if (key !== "className") {
395
- setInAuthoredOrder(result, key, props[key]);
362
+ var plan = plans.get(candidate);
363
+ if (plan === void 0) {
364
+ plan = computeClassPlan(candidate, grammarConfig);
365
+ plans.set(candidate, plan);
366
+ }
367
+ return plan;
368
+ }
369
+ function resolveTailwindClassName(className, config) {
370
+ var result = {};
371
+ var rawClassName = "";
372
+ var start = 0;
373
+ for (var index = 0; index <= className.length; index++) {
374
+ if (index !== className.length && className.charCodeAt(index) > 32) continue;
375
+ if (start === index) {
376
+ start = index + 1;
396
377
  continue;
397
378
  }
398
- for (var classIndex = 0; classIndex < classes.length; classIndex++) {
399
- var cls = classes[classIndex];
400
- var plan = classPlans[classIndex];
401
- if (plan === null) {
402
- if (process.env.NODE_ENV !== "production" && !warnedNativePassthroughCandidates.has(cls)) {
403
- warnedNativePassthroughCandidates.add(cls);
404
- 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.`);
405
- }
406
- continue;
407
- }
408
- if (plan === "raw") {
409
- preserveRawClass(cls);
410
- continue;
379
+ var candidate = className.slice(start, index);
380
+ var plan = getTailwindClassPlan(candidate, config);
381
+ if (plan === "raw") {
382
+ rawClassName = rawClassName ? `${rawClassName} ${candidate}` : candidate;
383
+ } else if (plan) {
384
+ var parentPlan = plan;
385
+ if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
386
+ rawClassName = rawClassName ? `${rawClassName} ${candidate}` : candidate;
411
387
  }
412
- if (!Array.isArray(plan)) {
413
- if (plan.preserveRawClass) {
414
- preserveRawClass(cls);
388
+ var entries = Array.isArray(plan) ? plan : parentPlan.entries;
389
+ for (var entryIndex = 0; entryIndex < entries.length; entryIndex++) {
390
+ var [key, value, condition] = entries[entryIndex];
391
+ var previous = result[key];
392
+ var next = value;
393
+ if (condition !== void 0) {
394
+ next = previous && (typeof previous === "undefined" ? "undefined" : _type_of(previous)) === "object" && !Array.isArray(previous) ? {
395
+ ...previous,
396
+ [condition]: value
397
+ } : previous === void 0 ? { [condition]: value } : {
398
+ default: previous,
399
+ [condition]: value
400
+ };
401
+ } else if (previous && (typeof previous === "undefined" ? "undefined" : _type_of(previous)) === "object" && !Array.isArray(previous)) {
402
+ next = {
403
+ ...previous,
404
+ default: value
405
+ };
415
406
  }
416
- for (var i = 0; i < plan.entries.length; i++) {
417
- applyEntry(plan.entries[i]);
418
- }
419
- continue;
420
- }
421
- for (var i1 = 0; i1 < plan.length; i1++) {
422
- applyEntry(plan[i1]);
407
+ setInAuthoredOrder(result, key, next);
423
408
  }
424
409
  }
425
- if (regularClasses.length > 0) {
426
- result.className = regularClasses.join(" ");
427
- }
410
+ start = index + 1;
428
411
  }
412
+ if (rawClassName) result.className = rawClassName;
429
413
  return result;
430
414
  }
415
+ function setInAuthoredOrder(target, key, value) {
416
+ if (key in target) delete target[key];
417
+ target[key] = value;
418
+ }
431
419
 
432
420
  //# sourceMappingURL=candidate.native.js.map