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/index.browser.mjs +228 -203
- 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 +229 -204
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -204
- package/dist/index.mjs.map +1 -1
- 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/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/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
|
|
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
|
|
275
|
-
return
|
|
276
|
-
}
|
|
277
|
-
if (DISPLAY_VALUES.has(
|
|
278
|
-
if (POSITION_VALUES.has(
|
|
279
|
-
if (
|
|
280
|
-
if (
|
|
281
|
-
if (
|
|
282
|
-
if (
|
|
283
|
-
if (
|
|
284
|
-
if (
|
|
285
|
-
if (
|
|
286
|
-
if (
|
|
287
|
-
if (
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
if (
|
|
291
|
-
if (
|
|
292
|
-
if (
|
|
293
|
-
if (
|
|
294
|
-
if (
|
|
295
|
-
if (
|
|
296
|
-
if (
|
|
297
|
-
if (
|
|
298
|
-
if (
|
|
299
|
-
if (
|
|
300
|
-
if (
|
|
301
|
-
if (
|
|
302
|
-
if (
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
305
|
-
if (
|
|
306
|
-
if (
|
|
307
|
-
if (
|
|
308
|
-
if (
|
|
309
|
-
if (
|
|
310
|
-
if (
|
|
311
|
-
if (
|
|
312
|
-
if (
|
|
313
|
-
if (
|
|
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 (
|
|
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 (
|
|
343
|
-
if (
|
|
344
|
-
if (
|
|
345
|
-
if (
|
|
346
|
-
const suffix =
|
|
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 (
|
|
353
|
-
const suffix =
|
|
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 (
|
|
358
|
-
if (
|
|
359
|
-
if (
|
|
360
|
-
const suffix =
|
|
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 (
|
|
375
|
-
if (
|
|
376
|
-
if (
|
|
377
|
-
if (
|
|
378
|
-
const firstChar =
|
|
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 (
|
|
382
|
-
if (
|
|
383
|
-
if (
|
|
384
|
-
if (
|
|
385
|
-
if (
|
|
386
|
-
const rest =
|
|
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 (
|
|
393
|
-
if (
|
|
394
|
-
if (
|
|
395
|
-
if (
|
|
396
|
-
if (
|
|
397
|
-
if (
|
|
398
|
-
if (
|
|
399
|
-
if (
|
|
400
|
-
if (
|
|
401
|
-
if (
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
404
|
-
if (
|
|
405
|
-
if (
|
|
406
|
-
if (
|
|
407
|
-
if (
|
|
408
|
-
if (
|
|
409
|
-
if (
|
|
410
|
-
if (
|
|
411
|
-
if (
|
|
412
|
-
if (
|
|
413
|
-
if (
|
|
414
|
-
if (
|
|
415
|
-
if (
|
|
416
|
-
if (
|
|
417
|
-
const rest =
|
|
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 (
|
|
422
|
-
if (
|
|
423
|
-
if (
|
|
424
|
-
if (
|
|
425
|
-
if (
|
|
426
|
-
if (
|
|
427
|
-
if (
|
|
428
|
-
if (
|
|
429
|
-
if (
|
|
430
|
-
if (
|
|
431
|
-
if (
|
|
432
|
-
if (
|
|
433
|
-
if (
|
|
434
|
-
if (
|
|
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
|
|
497
|
-
|
|
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();
|