tailwind-styled-v4 5.1.11 → 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/index.browser.mjs +224 -156
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +226 -156
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +226 -156
- package/dist/index.mjs.map +1 -1
- package/dist/runtime-css.js +1 -0
- package/dist/runtime-css.mjs +1 -0
- package/dist/runtime.js +1 -0
- package/dist/runtime.mjs +1 -0
- package/dist/svelte.js +143 -136
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +143 -136
- package/dist/svelte.mjs.map +1 -1
- package/dist/theme.js +1 -0
- package/dist/theme.mjs +1 -0
- package/dist/vue.js +144 -137
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +144 -137
- package/dist/vue.mjs.map +1 -1
- package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +1 -1
- package/dist/metafile-cjs.json +0 -1
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
|
|
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
|
|
310
|
-
return
|
|
311
|
-
}
|
|
312
|
-
if (DISPLAY_VALUES.has(
|
|
313
|
-
if (POSITION_VALUES.has(
|
|
314
|
-
if (
|
|
315
|
-
if (
|
|
316
|
-
if (
|
|
317
|
-
if (
|
|
318
|
-
if (
|
|
319
|
-
if (
|
|
320
|
-
if (
|
|
321
|
-
if (
|
|
322
|
-
if (
|
|
323
|
-
if (
|
|
324
|
-
if (
|
|
325
|
-
if (
|
|
326
|
-
if (
|
|
327
|
-
if (
|
|
328
|
-
if (
|
|
329
|
-
if (
|
|
330
|
-
if (
|
|
331
|
-
if (
|
|
332
|
-
if (
|
|
333
|
-
if (
|
|
334
|
-
if (
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
if (
|
|
338
|
-
if (
|
|
339
|
-
if (
|
|
340
|
-
if (
|
|
341
|
-
if (
|
|
342
|
-
if (
|
|
343
|
-
if (
|
|
344
|
-
if (
|
|
345
|
-
if (
|
|
346
|
-
if (
|
|
347
|
-
if (
|
|
348
|
-
if (
|
|
349
|
-
if (
|
|
350
|
-
if (
|
|
351
|
-
if (
|
|
352
|
-
if (
|
|
353
|
-
if (
|
|
354
|
-
if (
|
|
355
|
-
if (
|
|
356
|
-
if (
|
|
357
|
-
if (
|
|
358
|
-
if (
|
|
359
|
-
if (
|
|
360
|
-
if (
|
|
361
|
-
if (
|
|
362
|
-
if (
|
|
363
|
-
if (
|
|
364
|
-
if (
|
|
365
|
-
if (
|
|
366
|
-
if (
|
|
367
|
-
if (
|
|
368
|
-
if (
|
|
369
|
-
if (
|
|
370
|
-
if (
|
|
371
|
-
if (
|
|
372
|
-
if (
|
|
373
|
-
if (
|
|
374
|
-
if (
|
|
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 (
|
|
378
|
-
if (
|
|
379
|
-
if (
|
|
380
|
-
if (
|
|
381
|
-
const suffix =
|
|
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 (
|
|
388
|
-
const suffix =
|
|
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 (
|
|
393
|
-
if (
|
|
394
|
-
if (
|
|
395
|
-
const suffix =
|
|
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 (
|
|
410
|
-
if (
|
|
411
|
-
if (
|
|
412
|
-
if (
|
|
413
|
-
const firstChar =
|
|
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 (
|
|
417
|
-
if (
|
|
418
|
-
if (
|
|
419
|
-
if (
|
|
420
|
-
if (
|
|
421
|
-
const rest =
|
|
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 (
|
|
428
|
-
if (
|
|
429
|
-
if (
|
|
430
|
-
if (
|
|
431
|
-
if (
|
|
432
|
-
if (
|
|
433
|
-
if (
|
|
434
|
-
if (
|
|
435
|
-
if (
|
|
436
|
-
if (
|
|
437
|
-
if (
|
|
438
|
-
if (
|
|
439
|
-
if (
|
|
440
|
-
if (
|
|
441
|
-
if (
|
|
442
|
-
if (
|
|
443
|
-
if (
|
|
444
|
-
if (
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
447
|
-
if (
|
|
448
|
-
if (
|
|
449
|
-
if (
|
|
450
|
-
if (
|
|
451
|
-
if (
|
|
452
|
-
const rest =
|
|
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 (
|
|
457
|
-
if (
|
|
458
|
-
if (
|
|
459
|
-
if (
|
|
460
|
-
if (
|
|
461
|
-
if (
|
|
462
|
-
if (
|
|
463
|
-
if (
|
|
464
|
-
if (
|
|
465
|
-
if (
|
|
466
|
-
if (
|
|
467
|
-
if (
|
|
468
|
-
if (
|
|
469
|
-
if (
|
|
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
|
|
532
|
-
|
|
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();
|