tailwind-styled-v4 5.1.10 → 5.1.12
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 +334 -9
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.js +342 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +342 -12
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +31 -1
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +31 -1
- package/dist/next.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 +292 -7
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +292 -7
- package/dist/svelte.mjs.map +1 -1
- package/dist/theme.js +1 -0
- package/dist/theme.mjs +1 -0
- package/dist/vue.js +292 -7
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +292 -7
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/metafile-cjs.json +0 -1
package/dist/vue.mjs
CHANGED
|
@@ -170,7 +170,7 @@ var nativeBinding = null;
|
|
|
170
170
|
var bindingLoadAttempted = false;
|
|
171
171
|
var getBinding = () => {
|
|
172
172
|
if (isBrowser2) {
|
|
173
|
-
|
|
173
|
+
return null;
|
|
174
174
|
}
|
|
175
175
|
if (nativeBinding) return nativeBinding;
|
|
176
176
|
if (bindingLoadAttempted) {
|
|
@@ -178,10 +178,10 @@ var getBinding = () => {
|
|
|
178
178
|
}
|
|
179
179
|
bindingLoadAttempted = true;
|
|
180
180
|
try {
|
|
181
|
-
const runtimeDir =
|
|
181
|
+
const runtimeDir = dirname(
|
|
182
182
|
typeof __filename !== "undefined" ? __filename : typeof import.meta !== "undefined" && import.meta.url ? fileURLToPath3(import.meta.url) : process.cwd()
|
|
183
183
|
);
|
|
184
|
-
const result =
|
|
184
|
+
const result = resolveNativeBinary(runtimeDir);
|
|
185
185
|
if (result.path && result.path.endsWith(".node")) {
|
|
186
186
|
const mod = _loadNative(result.path);
|
|
187
187
|
if (mod?.batchSplitClasses) {
|
|
@@ -200,7 +200,291 @@ var getNativeBinding = getBinding;
|
|
|
200
200
|
|
|
201
201
|
// packages/domain/core/src/merge.ts
|
|
202
202
|
init_esm_shims();
|
|
203
|
-
|
|
203
|
+
|
|
204
|
+
// packages/domain/core/src/mergeFallback.ts
|
|
205
|
+
init_esm_shims();
|
|
206
|
+
var TEXT_SIZE_SUFFIXES = /* @__PURE__ */ new Set([
|
|
207
|
+
"xs",
|
|
208
|
+
"sm",
|
|
209
|
+
"base",
|
|
210
|
+
"lg",
|
|
211
|
+
"xl",
|
|
212
|
+
"2xl",
|
|
213
|
+
"3xl",
|
|
214
|
+
"4xl",
|
|
215
|
+
"5xl",
|
|
216
|
+
"6xl",
|
|
217
|
+
"7xl",
|
|
218
|
+
"8xl",
|
|
219
|
+
"9xl"
|
|
220
|
+
]);
|
|
221
|
+
function isTextSize(suffix) {
|
|
222
|
+
if (TEXT_SIZE_SUFFIXES.has(suffix)) return true;
|
|
223
|
+
if (suffix.startsWith("[")) return true;
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
function isAsciiDigits(s) {
|
|
227
|
+
if (s.length === 0) return true;
|
|
228
|
+
for (let i = 0; i < s.length; i++) {
|
|
229
|
+
const code = s.charCodeAt(i);
|
|
230
|
+
if (code < 48 || code > 57) return false;
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
function isU32(s) {
|
|
235
|
+
return s.length > 0 && /^[0-9]+$/.test(s);
|
|
236
|
+
}
|
|
237
|
+
var DISPLAY_VALUES = /* @__PURE__ */ new Set([
|
|
238
|
+
"block",
|
|
239
|
+
"inline-block",
|
|
240
|
+
"inline",
|
|
241
|
+
"flex",
|
|
242
|
+
"inline-flex",
|
|
243
|
+
"grid",
|
|
244
|
+
"inline-grid",
|
|
245
|
+
"table",
|
|
246
|
+
"inline-table",
|
|
247
|
+
"table-row",
|
|
248
|
+
"table-cell",
|
|
249
|
+
"table-column",
|
|
250
|
+
"table-caption",
|
|
251
|
+
"contents",
|
|
252
|
+
"list-item",
|
|
253
|
+
"hidden",
|
|
254
|
+
"flow-root"
|
|
255
|
+
]);
|
|
256
|
+
var POSITION_VALUES = /* @__PURE__ */ new Set(["static", "relative", "absolute", "fixed", "sticky"]);
|
|
257
|
+
var FONT_WEIGHT_NAMES = /* @__PURE__ */ new Set([
|
|
258
|
+
"thin",
|
|
259
|
+
"extralight",
|
|
260
|
+
"light",
|
|
261
|
+
"normal",
|
|
262
|
+
"medium",
|
|
263
|
+
"semibold",
|
|
264
|
+
"bold",
|
|
265
|
+
"extrabold",
|
|
266
|
+
"black"
|
|
267
|
+
]);
|
|
268
|
+
var TEXT_ALIGN_VALUES = /* @__PURE__ */ new Set(["left", "center", "right", "justify", "start", "end"]);
|
|
269
|
+
var BORDER_SIDE_PREFIXES = ["t-", "r-", "b-", "l-", "x-", "y-", "s-", "e-"];
|
|
270
|
+
var BORDER_STYLE_VALUES = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "double", "hidden", "none"]);
|
|
271
|
+
function conflictGroup(base) {
|
|
272
|
+
const bracket = base.indexOf("[");
|
|
273
|
+
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";
|
|
340
|
+
return "bg";
|
|
341
|
+
}
|
|
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);
|
|
347
|
+
if (isTextSize(suffix)) return "text-size";
|
|
348
|
+
if (suffix.startsWith("opacity-")) return "text-opacity";
|
|
349
|
+
if (TEXT_ALIGN_VALUES.has(suffix)) return "text-align";
|
|
350
|
+
return "text-color";
|
|
351
|
+
}
|
|
352
|
+
if (base.startsWith("font-")) {
|
|
353
|
+
const suffix = base.slice("font-".length);
|
|
354
|
+
if (FONT_WEIGHT_NAMES.has(suffix) || isAsciiDigits(suffix)) return "font-weight";
|
|
355
|
+
return "font-family";
|
|
356
|
+
}
|
|
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);
|
|
361
|
+
const sidePrefix = BORDER_SIDE_PREFIXES.find((p) => suffix.startsWith(p));
|
|
362
|
+
if (sidePrefix) {
|
|
363
|
+
const side = suffix.slice(0, 1);
|
|
364
|
+
const rest = suffix.slice(2);
|
|
365
|
+
if (isU32(rest) || rest.length === 0) return `border-${side}-width`;
|
|
366
|
+
return `border-${side}-color`;
|
|
367
|
+
}
|
|
368
|
+
if (isU32(suffix) || suffix.length === 0) return "border-width";
|
|
369
|
+
if (suffix.startsWith("opacity-")) return "border-opacity";
|
|
370
|
+
if (suffix === "collapse" || suffix === "separate") return "border-collapse";
|
|
371
|
+
if (BORDER_STYLE_VALUES.has(suffix)) return "border-style";
|
|
372
|
+
return "border-color";
|
|
373
|
+
}
|
|
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";
|
|
379
|
+
return `rounded-${firstChar}`;
|
|
380
|
+
}
|
|
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);
|
|
387
|
+
const isWidth = rest === "0" || rest === "1" || rest === "2" || rest === "4" || rest === "8" || /^-?\d+(\.\d+)?$/.test(rest) || rest.startsWith("[") && rest.endsWith("]");
|
|
388
|
+
if (isWidth) return "ring-width";
|
|
389
|
+
if (rest === "inset") return "ring-inset";
|
|
390
|
+
return "ring-color";
|
|
391
|
+
}
|
|
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);
|
|
418
|
+
const seg = rest.split("-")[0] || "x";
|
|
419
|
+
return `backdrop-${seg}`;
|
|
420
|
+
}
|
|
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";
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
function splitVariants(klass) {
|
|
438
|
+
let depth = 0;
|
|
439
|
+
let lastColon = 0;
|
|
440
|
+
for (let i = 0; i < klass.length; i++) {
|
|
441
|
+
const ch = klass.charCodeAt(i);
|
|
442
|
+
if (ch === 91) depth++;
|
|
443
|
+
else if (ch === 93) depth = depth > 0 ? depth - 1 : 0;
|
|
444
|
+
else if (ch === 58 && depth === 0) lastColon = i + 1;
|
|
445
|
+
}
|
|
446
|
+
if (lastColon === 0) return ["", klass];
|
|
447
|
+
return [klass.slice(0, lastColon), klass.slice(lastColon)];
|
|
448
|
+
}
|
|
449
|
+
function mergeClassStringJs(input) {
|
|
450
|
+
const tokens = input.split(/\s+/).filter(Boolean);
|
|
451
|
+
if (tokens.length === 0) return "";
|
|
452
|
+
if (tokens.length === 1) return tokens[0];
|
|
453
|
+
const groupOwner = /* @__PURE__ */ new Map();
|
|
454
|
+
const slots = [];
|
|
455
|
+
for (const token of tokens) {
|
|
456
|
+
const [variants, base] = splitVariants(token);
|
|
457
|
+
const group = conflictGroup(base);
|
|
458
|
+
if (group !== null) {
|
|
459
|
+
const key = `${variants}::${group}`;
|
|
460
|
+
const prevIdx = groupOwner.get(key);
|
|
461
|
+
if (prevIdx !== void 0) slots[prevIdx] = null;
|
|
462
|
+
groupOwner.set(key, slots.length);
|
|
463
|
+
slots.push(token);
|
|
464
|
+
} else {
|
|
465
|
+
slots.push(token);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
return slots.filter((s) => s !== null).join(" ");
|
|
469
|
+
}
|
|
470
|
+
function twMergeRawJs(classLists) {
|
|
471
|
+
const joined = classLists.map((s) => s.trim()).filter((s) => s.length > 0).join(" ");
|
|
472
|
+
if (joined.length === 0) return "";
|
|
473
|
+
return mergeClassStringJs(joined);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// packages/domain/core/src/merge.ts
|
|
477
|
+
var warnedFallback = false;
|
|
478
|
+
function warnFallbackOnce() {
|
|
479
|
+
if (warnedFallback) return;
|
|
480
|
+
warnedFallback = true;
|
|
481
|
+
if (typeof console !== "undefined") {
|
|
482
|
+
console.warn(
|
|
483
|
+
"[tailwind-styled-v4] Native binding 'twMergeRaw' tidak tersedia (normal di browser) \u2014 pakai pure-TS port dari algoritma Rust-nya. Hasil className tetap benar; ini cuma informasi, bukan error."
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function createTwMerge(options = {}) {
|
|
204
488
|
return function twMerge2(...classLists) {
|
|
205
489
|
const inputs = [];
|
|
206
490
|
for (let i = 0; i < classLists.length; i++) {
|
|
@@ -209,10 +493,11 @@ function createTwMerge(_options = {}) {
|
|
|
209
493
|
}
|
|
210
494
|
if (inputs.length === 0) return "";
|
|
211
495
|
const native = getNativeBinding();
|
|
212
|
-
if (
|
|
213
|
-
|
|
496
|
+
if (native?.twMergeRaw) {
|
|
497
|
+
return native.twMergeRaw(inputs);
|
|
214
498
|
}
|
|
215
|
-
|
|
499
|
+
warnFallbackOnce();
|
|
500
|
+
return twMergeRawJs(inputs);
|
|
216
501
|
};
|
|
217
502
|
}
|
|
218
503
|
var twMerge = createTwMerge();
|