tailwind-styled-v4 5.1.12 → 5.1.13

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/vue.mjs CHANGED
@@ -268,96 +268,97 @@ var FONT_WEIGHT_NAMES = /* @__PURE__ */ new Set([
268
268
  var TEXT_ALIGN_VALUES = /* @__PURE__ */ new Set(["left", "center", "right", "justify", "start", "end"]);
269
269
  var BORDER_SIDE_PREFIXES = ["t-", "r-", "b-", "l-", "x-", "y-", "s-", "e-"];
270
270
  var BORDER_STYLE_VALUES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double", "hidden", "none"]);
271
- function conflictGroup(base) {
272
- const bracket = base.indexOf("[");
271
+ function conflictGroup(base, prefix = "") {
272
+ const b = prefix && base.startsWith(prefix) ? base.slice(prefix.length) : base;
273
+ const bracket = b.indexOf("[");
273
274
  if (bracket !== -1) {
274
- const prefix = base.slice(0, bracket).replace(/-+$/, "");
275
- return prefix.length > 0 ? prefix : "arbitrary";
276
- }
277
- if (DISPLAY_VALUES.has(base)) return "display";
278
- if (POSITION_VALUES.has(base)) return "position";
279
- if (base.startsWith("overflow-x-")) return "overflow-x";
280
- if (base.startsWith("overflow-y-")) return "overflow-y";
281
- if (base.startsWith("overflow-")) return "overflow";
282
- if (base.startsWith("flex-")) return "flex";
283
- if (base.startsWith("grid-cols-")) return "grid-cols";
284
- if (base.startsWith("grid-rows-")) return "grid-rows";
285
- if (base.startsWith("grid-flow-")) return "grid-flow";
286
- if (base.startsWith("col-")) return "col";
287
- if (base.startsWith("row-")) return "row";
288
- if (base === "grow" || base.startsWith("grow-")) return "grow";
289
- if (base === "shrink" || base.startsWith("shrink-")) return "shrink";
290
- if (base.startsWith("gap-x-")) return "gap-x";
291
- if (base.startsWith("gap-y-")) return "gap-y";
292
- if (base.startsWith("gap-")) return "gap";
293
- if (base.startsWith("justify-items-")) return "justify-items";
294
- if (base.startsWith("justify-self-")) return "justify-self";
295
- if (base.startsWith("justify-")) return "justify";
296
- if (base.startsWith("items-")) return "items";
297
- if (base.startsWith("self-")) return "self";
298
- if (base.startsWith("place-content-")) return "place-content";
299
- if (base.startsWith("place-items-")) return "place-items";
300
- if (base.startsWith("place-self-")) return "place-self";
301
- if (base.startsWith("content-")) return "content";
302
- if (base.startsWith("px-")) return "px";
303
- if (base.startsWith("py-")) return "py";
304
- if (base.startsWith("pt-")) return "pt";
305
- if (base.startsWith("pr-")) return "pr";
306
- if (base.startsWith("pb-")) return "pb";
307
- if (base.startsWith("pl-")) return "pl";
308
- if (base.startsWith("ps-")) return "ps";
309
- if (base.startsWith("pe-")) return "pe";
310
- if (base.startsWith("p-")) return "p";
311
- if (base.startsWith("mx-")) return "mx";
312
- if (base.startsWith("my-")) return "my";
313
- if (base.startsWith("mt-")) return "mt";
314
- if (base.startsWith("mr-")) return "mr";
315
- if (base.startsWith("mb-")) return "mb";
316
- if (base.startsWith("ml-")) return "ml";
317
- if (base.startsWith("ms-")) return "ms";
318
- if (base.startsWith("me-")) return "me";
319
- if (base === "-m" || base.startsWith("m-") || base.startsWith("-m-")) return "m";
320
- if (base.startsWith("space-x-")) return "space-x";
321
- if (base.startsWith("space-y-")) return "space-y";
322
- if (base.startsWith("size-")) return "size";
323
- if (base.startsWith("min-w-")) return "min-w";
324
- if (base.startsWith("max-w-")) return "max-w";
325
- if (base.startsWith("w-")) return "w";
326
- if (base.startsWith("min-h-")) return "min-h";
327
- if (base.startsWith("max-h-")) return "max-h";
328
- if (base.startsWith("h-")) return "h";
329
- if (base.startsWith("inset-x-")) return "inset-x";
330
- if (base.startsWith("inset-y-")) return "inset-y";
331
- if (base.startsWith("inset-")) return "inset";
332
- if (base.startsWith("top-")) return "top";
333
- if (base.startsWith("right-") || base.startsWith("end-")) return "right";
334
- if (base.startsWith("bottom-")) return "bottom";
335
- if (base.startsWith("left-") || base.startsWith("start-")) return "left";
336
- if (base.startsWith("z-")) return "z";
337
- if (base.startsWith("opacity-")) return "opacity";
338
- if (base.startsWith("bg-")) {
339
- if (base.startsWith("bg-opacity-")) return "bg-opacity";
275
+ const grp = b.slice(0, bracket).replace(/-+$/, "");
276
+ return grp.length > 0 ? grp : "arbitrary";
277
+ }
278
+ if (DISPLAY_VALUES.has(b)) return "display";
279
+ if (POSITION_VALUES.has(b)) return "position";
280
+ if (b.startsWith("overflow-x-")) return "overflow-x";
281
+ if (b.startsWith("overflow-y-")) return "overflow-y";
282
+ if (b.startsWith("overflow-")) return "overflow";
283
+ if (b.startsWith("flex-")) return "flex";
284
+ if (b.startsWith("grid-cols-")) return "grid-cols";
285
+ if (b.startsWith("grid-rows-")) return "grid-rows";
286
+ if (b.startsWith("grid-flow-")) return "grid-flow";
287
+ if (b.startsWith("col-")) return "col";
288
+ if (b.startsWith("row-")) return "row";
289
+ if (b === "grow" || b.startsWith("grow-")) return "grow";
290
+ if (b === "shrink" || b.startsWith("shrink-")) return "shrink";
291
+ if (b.startsWith("gap-x-")) return "gap-x";
292
+ if (b.startsWith("gap-y-")) return "gap-y";
293
+ if (b.startsWith("gap-")) return "gap";
294
+ if (b.startsWith("justify-items-")) return "justify-items";
295
+ if (b.startsWith("justify-self-")) return "justify-self";
296
+ if (b.startsWith("justify-")) return "justify";
297
+ if (b.startsWith("items-")) return "items";
298
+ if (b.startsWith("self-")) return "self";
299
+ if (b.startsWith("place-content-")) return "place-content";
300
+ if (b.startsWith("place-items-")) return "place-items";
301
+ if (b.startsWith("place-self-")) return "place-self";
302
+ if (b.startsWith("content-")) return "content";
303
+ if (b.startsWith("px-")) return "px";
304
+ if (b.startsWith("py-")) return "py";
305
+ if (b.startsWith("pt-")) return "pt";
306
+ if (b.startsWith("pr-")) return "pr";
307
+ if (b.startsWith("pb-")) return "pb";
308
+ if (b.startsWith("pl-")) return "pl";
309
+ if (b.startsWith("ps-")) return "ps";
310
+ if (b.startsWith("pe-")) return "pe";
311
+ if (b.startsWith("p-")) return "p";
312
+ if (b.startsWith("mx-")) return "mx";
313
+ if (b.startsWith("my-")) return "my";
314
+ if (b.startsWith("mt-")) return "mt";
315
+ if (b.startsWith("mr-")) return "mr";
316
+ if (b.startsWith("mb-")) return "mb";
317
+ if (b.startsWith("ml-")) return "ml";
318
+ if (b.startsWith("ms-")) return "ms";
319
+ if (b.startsWith("me-")) return "me";
320
+ if (b === "-m" || b.startsWith("m-") || b.startsWith("-m-")) return "m";
321
+ if (b.startsWith("space-x-")) return "space-x";
322
+ if (b.startsWith("space-y-")) return "space-y";
323
+ if (b.startsWith("size-")) return "size";
324
+ if (b.startsWith("min-w-")) return "min-w";
325
+ if (b.startsWith("max-w-")) return "max-w";
326
+ if (b.startsWith("w-")) return "w";
327
+ if (b.startsWith("min-h-")) return "min-h";
328
+ if (b.startsWith("max-h-")) return "max-h";
329
+ if (b.startsWith("h-")) return "h";
330
+ if (b.startsWith("inset-x-")) return "inset-x";
331
+ if (b.startsWith("inset-y-")) return "inset-y";
332
+ if (b.startsWith("inset-")) return "inset";
333
+ if (b.startsWith("top-")) return "top";
334
+ if (b.startsWith("right-") || b.startsWith("end-")) return "right";
335
+ if (b.startsWith("bottom-")) return "bottom";
336
+ if (b.startsWith("left-") || b.startsWith("start-")) return "left";
337
+ if (b.startsWith("z-")) return "z";
338
+ if (b.startsWith("opacity-")) return "opacity";
339
+ if (b.startsWith("bg-")) {
340
+ if (b.startsWith("bg-opacity-")) return "bg-opacity";
340
341
  return "bg";
341
342
  }
342
- if (base.startsWith("from-")) return "from";
343
- if (base.startsWith("via-")) return "via";
344
- if (base.startsWith("to-")) return "to";
345
- if (base.startsWith("text-")) {
346
- const suffix = base.slice("text-".length);
343
+ if (b.startsWith("from-")) return "from";
344
+ if (b.startsWith("via-")) return "via";
345
+ if (b.startsWith("to-")) return "to";
346
+ if (b.startsWith("text-")) {
347
+ const suffix = b.slice("text-".length);
347
348
  if (isTextSize(suffix)) return "text-size";
348
349
  if (suffix.startsWith("opacity-")) return "text-opacity";
349
350
  if (TEXT_ALIGN_VALUES.has(suffix)) return "text-align";
350
351
  return "text-color";
351
352
  }
352
- if (base.startsWith("font-")) {
353
- const suffix = base.slice("font-".length);
353
+ if (b.startsWith("font-")) {
354
+ const suffix = b.slice("font-".length);
354
355
  if (FONT_WEIGHT_NAMES.has(suffix) || isAsciiDigits(suffix)) return "font-weight";
355
356
  return "font-family";
356
357
  }
357
- if (base.startsWith("leading-")) return "leading";
358
- if (base.startsWith("tracking-")) return "tracking";
359
- if (base.startsWith("border-")) {
360
- const suffix = base.slice("border-".length);
358
+ if (b.startsWith("leading-")) return "leading";
359
+ if (b.startsWith("tracking-")) return "tracking";
360
+ if (b.startsWith("border-")) {
361
+ const suffix = b.slice("border-".length);
361
362
  const sidePrefix = BORDER_SIDE_PREFIXES.find((p) => suffix.startsWith(p));
362
363
  if (sidePrefix) {
363
364
  const side = suffix.slice(0, 1);
@@ -371,67 +372,67 @@ function conflictGroup(base) {
371
372
  if (BORDER_STYLE_VALUES.has(suffix)) return "border-style";
372
373
  return "border-color";
373
374
  }
374
- if (base === "border") return "border-width";
375
- if (base.startsWith("outline-")) return "outline";
376
- if (base === "outline") return "outline";
377
- if (base.startsWith("rounded-t") || base.startsWith("rounded-r") || base.startsWith("rounded-b") || base.startsWith("rounded-l") || base.startsWith("rounded-s") || base.startsWith("rounded-e")) {
378
- const firstChar = base.slice("rounded-".length).charAt(0) || "x";
375
+ if (b === "border") return "border-width";
376
+ if (b.startsWith("outline-")) return "outline";
377
+ if (b === "outline") return "outline";
378
+ if (b.startsWith("rounded-t") || b.startsWith("rounded-r") || b.startsWith("rounded-b") || b.startsWith("rounded-l") || b.startsWith("rounded-s") || b.startsWith("rounded-e")) {
379
+ const firstChar = b.slice("rounded-".length).charAt(0) || "x";
379
380
  return `rounded-${firstChar}`;
380
381
  }
381
- if (base === "rounded" || base.startsWith("rounded-")) return "rounded";
382
- if (base === "shadow" || base.startsWith("shadow-")) return "shadow";
383
- if (base.startsWith("ring-offset-")) return "ring-offset";
384
- if (base === "ring") return "ring-width";
385
- if (base.startsWith("ring-")) {
386
- const rest = base.slice("ring-".length);
382
+ if (b === "rounded" || b.startsWith("rounded-")) return "rounded";
383
+ if (b === "shadow" || b.startsWith("shadow-")) return "shadow";
384
+ if (b.startsWith("ring-offset-")) return "ring-offset";
385
+ if (b === "ring") return "ring-width";
386
+ if (b.startsWith("ring-")) {
387
+ const rest = b.slice("ring-".length);
387
388
  const isWidth = rest === "0" || rest === "1" || rest === "2" || rest === "4" || rest === "8" || /^-?\d+(\.\d+)?$/.test(rest) || rest.startsWith("[") && rest.endsWith("]");
388
389
  if (isWidth) return "ring-width";
389
390
  if (rest === "inset") return "ring-inset";
390
391
  return "ring-color";
391
392
  }
392
- if (base.startsWith("rotate-")) return "rotate";
393
- if (base.startsWith("scale-x-")) return "scale-x";
394
- if (base.startsWith("scale-y-")) return "scale-y";
395
- if (base.startsWith("scale-")) return "scale";
396
- if (base.startsWith("translate-x-")) return "translate-x";
397
- if (base.startsWith("translate-y-")) return "translate-y";
398
- if (base.startsWith("skew-x-")) return "skew-x";
399
- if (base.startsWith("skew-y-")) return "skew-y";
400
- if (base === "transition" || base.startsWith("transition-")) return "transition";
401
- if (base.startsWith("duration-")) return "duration";
402
- if (base.startsWith("ease-")) return "ease";
403
- if (base.startsWith("delay-")) return "delay";
404
- if (base === "animate" || base.startsWith("animate-")) return "animate";
405
- if (base.startsWith("cursor-")) return "cursor";
406
- if (base.startsWith("pointer-events-")) return "pointer-events";
407
- if (base.startsWith("select-")) return "select";
408
- if (base === "visible" || base === "invisible" || base === "collapse") return "visibility";
409
- if (base.startsWith("object-")) return "object";
410
- if (base.startsWith("aspect-")) return "aspect";
411
- if (base.startsWith("order-")) return "order";
412
- if (base.startsWith("whitespace-")) return "whitespace";
413
- if (base.startsWith("list-")) return "list";
414
- if (base.startsWith("fill-")) return "fill";
415
- if (base.startsWith("stroke-")) return "stroke";
416
- if (base.startsWith("backdrop-")) {
417
- const rest = base.slice("backdrop-".length);
393
+ if (b.startsWith("rotate-")) return "rotate";
394
+ if (b.startsWith("scale-x-")) return "scale-x";
395
+ if (b.startsWith("scale-y-")) return "scale-y";
396
+ if (b.startsWith("scale-")) return "scale";
397
+ if (b.startsWith("translate-x-")) return "translate-x";
398
+ if (b.startsWith("translate-y-")) return "translate-y";
399
+ if (b.startsWith("skew-x-")) return "skew-x";
400
+ if (b.startsWith("skew-y-")) return "skew-y";
401
+ if (b === "transition" || b.startsWith("transition-")) return "transition";
402
+ if (b.startsWith("duration-")) return "duration";
403
+ if (b.startsWith("ease-")) return "ease";
404
+ if (b.startsWith("delay-")) return "delay";
405
+ if (b === "animate" || b.startsWith("animate-")) return "animate";
406
+ if (b.startsWith("cursor-")) return "cursor";
407
+ if (b.startsWith("pointer-events-")) return "pointer-events";
408
+ if (b.startsWith("select-")) return "select";
409
+ if (b === "visible" || b === "invisible" || b === "collapse") return "visibility";
410
+ if (b.startsWith("object-")) return "object";
411
+ if (b.startsWith("aspect-")) return "aspect";
412
+ if (b.startsWith("order-")) return "order";
413
+ if (b.startsWith("whitespace-")) return "whitespace";
414
+ if (b.startsWith("list-")) return "list";
415
+ if (b.startsWith("fill-")) return "fill";
416
+ if (b.startsWith("stroke-")) return "stroke";
417
+ if (b.startsWith("backdrop-")) {
418
+ const rest = b.slice("backdrop-".length);
418
419
  const seg = rest.split("-")[0] || "x";
419
420
  return `backdrop-${seg}`;
420
421
  }
421
- if (base.startsWith("scroll-")) return "scroll";
422
- if (base.startsWith("snap-")) return "snap";
423
- if (base.startsWith("touch-")) return "touch";
424
- if (base.startsWith("decoration-")) return "text-decoration";
425
- if (base.startsWith("caret-")) return "caret";
426
- if (base.startsWith("accent-")) return "accent";
427
- if (base.startsWith("appearance-")) return "appearance";
428
- if (base === "isolate" || base === "isolation-auto") return "isolation";
429
- if (base.startsWith("mix-blend-")) return "mix-blend";
430
- if (base.startsWith("bg-blend-")) return "bg-blend";
431
- if (base.startsWith("float-")) return "float";
432
- if (base.startsWith("clear-")) return "clear";
433
- if (base.startsWith("break-")) return "break";
434
- if (base.startsWith("columns-")) return "columns";
422
+ if (b.startsWith("scroll-")) return "scroll";
423
+ if (b.startsWith("snap-")) return "snap";
424
+ if (b.startsWith("touch-")) return "touch";
425
+ if (b.startsWith("decoration-")) return "text-decoration";
426
+ if (b.startsWith("caret-")) return "caret";
427
+ if (b.startsWith("accent-")) return "accent";
428
+ if (b.startsWith("appearance-")) return "appearance";
429
+ if (b === "isolate" || b === "isolation-auto") return "isolation";
430
+ if (b.startsWith("mix-blend-")) return "mix-blend";
431
+ if (b.startsWith("bg-blend-")) return "bg-blend";
432
+ if (b.startsWith("float-")) return "float";
433
+ if (b.startsWith("clear-")) return "clear";
434
+ if (b.startsWith("break-")) return "break";
435
+ if (b.startsWith("columns-")) return "columns";
435
436
  return null;
436
437
  }
437
438
  function splitVariants(klass) {
@@ -446,7 +447,7 @@ function splitVariants(klass) {
446
447
  if (lastColon === 0) return ["", klass];
447
448
  return [klass.slice(0, lastColon), klass.slice(lastColon)];
448
449
  }
449
- function mergeClassStringJs(input) {
450
+ function mergeClassStringJs(input, prefix = "") {
450
451
  const tokens = input.split(/\s+/).filter(Boolean);
451
452
  if (tokens.length === 0) return "";
452
453
  if (tokens.length === 1) return tokens[0];
@@ -454,7 +455,7 @@ function mergeClassStringJs(input) {
454
455
  const slots = [];
455
456
  for (const token of tokens) {
456
457
  const [variants, base] = splitVariants(token);
457
- const group = conflictGroup(base);
458
+ const group = conflictGroup(base, prefix);
458
459
  if (group !== null) {
459
460
  const key = `${variants}::${group}`;
460
461
  const prevIdx = groupOwner.get(key);
@@ -467,10 +468,10 @@ function mergeClassStringJs(input) {
467
468
  }
468
469
  return slots.filter((s) => s !== null).join(" ");
469
470
  }
470
- function twMergeRawJs(classLists) {
471
+ function twMergeRawJs(classLists, prefix = "") {
471
472
  const joined = classLists.map((s) => s.trim()).filter((s) => s.length > 0).join(" ");
472
473
  if (joined.length === 0) return "";
473
- return mergeClassStringJs(joined);
474
+ return mergeClassStringJs(joined, prefix);
474
475
  }
475
476
 
476
477
  // packages/domain/core/src/merge.ts
@@ -485,6 +486,7 @@ function warnFallbackOnce() {
485
486
  }
486
487
  }
487
488
  function createTwMerge(options = {}) {
489
+ const prefix = options.prefix ?? "";
488
490
  return function twMerge2(...classLists) {
489
491
  const inputs = [];
490
492
  for (let i = 0; i < classLists.length; i++) {
@@ -493,11 +495,16 @@ function createTwMerge(options = {}) {
493
495
  }
494
496
  if (inputs.length === 0) return "";
495
497
  const native = getNativeBinding();
496
- if (native?.twMergeRaw) {
497
- return native.twMergeRaw(inputs);
498
+ if (native) {
499
+ if (prefix && native.twMergeRawWithOptions) {
500
+ return native.twMergeRawWithOptions(inputs, { prefix });
501
+ }
502
+ if (native.twMergeRaw) {
503
+ return native.twMergeRaw(inputs);
504
+ }
498
505
  }
499
506
  warnFallbackOnce();
500
- return twMergeRawJs(inputs);
507
+ return twMergeRawJs(inputs, prefix);
501
508
  };
502
509
  }
503
510
  var twMerge = createTwMerge();