tailwind-styled-v4 5.1.12 → 5.1.14

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