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/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/runtime-css.d.mts +2 -90
- package/dist/runtime-css.d.ts +2 -90
- package/dist/runtime-css.js +2 -55
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +2 -54
- package/dist/runtime-css.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 +7 -2
package/dist/index.d.mts
CHANGED
|
@@ -253,19 +253,34 @@ declare function cv<C extends ComponentConfig>(config: C, componentId?: string):
|
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* tailwind-styled-v4 v2 — cx / cn
|
|
256
|
-
*
|
|
256
|
+
*
|
|
257
|
+
* Native Rust binding dipakai di Node.js/SSR untuk performa maksimal.
|
|
258
|
+
*
|
|
259
|
+
* Browser fallback (Bug 2 — "Native binding 'resolveClassNames' is required
|
|
260
|
+
* but not available." crash di browser):
|
|
261
|
+
*
|
|
262
|
+
* getNativeBinding() return `null` di browser (bukan throw). Ketika itu terjadi
|
|
263
|
+
* kita gunakan pure-TS fallback yang semantiknya identik dengan implementasi Rust:
|
|
264
|
+
* - cn(): filter falsy + join spasi (identik dengan resolve_class_names di Rust)
|
|
265
|
+
* - cx(): conflict-aware merge via twMergeRawJs (port dari tw_merge.rs)
|
|
266
|
+
* - cxn(): flatten nested array + filter falsy + join spasi
|
|
267
|
+
*
|
|
268
|
+
* Server path TIDAK DIUBAH: throw Error tetap dijalankan jika native null di
|
|
269
|
+
* Node.js (menandakan miskonfigurasi). Fallback hanya aktif saat isBrowser=true.
|
|
257
270
|
*/
|
|
258
271
|
type ClassValue = string | undefined | null | false | 0;
|
|
259
272
|
/**
|
|
260
273
|
* cn — simple class name joiner (no conflict resolution).
|
|
261
|
-
*
|
|
274
|
+
* Node.js: delegates ke Rust `resolve_class_names`.
|
|
275
|
+
* Browser: pure-TS fallback — filter falsy + join spasi.
|
|
262
276
|
*
|
|
263
277
|
* @example cn("p-4", isActive && "opacity-100") → "p-4 opacity-100"
|
|
264
278
|
*/
|
|
265
279
|
declare function cn(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
266
280
|
/**
|
|
267
281
|
* cx — conflict-aware class merger.
|
|
268
|
-
*
|
|
282
|
+
* Node.js: delegates ke Rust `tw_merge_many`.
|
|
283
|
+
* Browser: pure-TS fallback via twMergeRawJs (port algoritma Rust).
|
|
269
284
|
*
|
|
270
285
|
* @example cx("p-4 p-8") → "p-8"
|
|
271
286
|
* @example cx("bg-red-500", "bg-blue-500") → "bg-blue-500"
|
package/dist/index.d.ts
CHANGED
|
@@ -253,19 +253,34 @@ declare function cv<C extends ComponentConfig>(config: C, componentId?: string):
|
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* tailwind-styled-v4 v2 — cx / cn
|
|
256
|
-
*
|
|
256
|
+
*
|
|
257
|
+
* Native Rust binding dipakai di Node.js/SSR untuk performa maksimal.
|
|
258
|
+
*
|
|
259
|
+
* Browser fallback (Bug 2 — "Native binding 'resolveClassNames' is required
|
|
260
|
+
* but not available." crash di browser):
|
|
261
|
+
*
|
|
262
|
+
* getNativeBinding() return `null` di browser (bukan throw). Ketika itu terjadi
|
|
263
|
+
* kita gunakan pure-TS fallback yang semantiknya identik dengan implementasi Rust:
|
|
264
|
+
* - cn(): filter falsy + join spasi (identik dengan resolve_class_names di Rust)
|
|
265
|
+
* - cx(): conflict-aware merge via twMergeRawJs (port dari tw_merge.rs)
|
|
266
|
+
* - cxn(): flatten nested array + filter falsy + join spasi
|
|
267
|
+
*
|
|
268
|
+
* Server path TIDAK DIUBAH: throw Error tetap dijalankan jika native null di
|
|
269
|
+
* Node.js (menandakan miskonfigurasi). Fallback hanya aktif saat isBrowser=true.
|
|
257
270
|
*/
|
|
258
271
|
type ClassValue = string | undefined | null | false | 0;
|
|
259
272
|
/**
|
|
260
273
|
* cn — simple class name joiner (no conflict resolution).
|
|
261
|
-
*
|
|
274
|
+
* Node.js: delegates ke Rust `resolve_class_names`.
|
|
275
|
+
* Browser: pure-TS fallback — filter falsy + join spasi.
|
|
262
276
|
*
|
|
263
277
|
* @example cn("p-4", isActive && "opacity-100") → "p-4 opacity-100"
|
|
264
278
|
*/
|
|
265
279
|
declare function cn(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
266
280
|
/**
|
|
267
281
|
* cx — conflict-aware class merger.
|
|
268
|
-
*
|
|
282
|
+
* Node.js: delegates ke Rust `tw_merge_many`.
|
|
283
|
+
* Browser: pure-TS fallback via twMergeRawJs (port algoritma Rust).
|
|
269
284
|
*
|
|
270
285
|
* @example cx("p-4 p-8") → "p-8"
|
|
271
286
|
* @example cx("bg-red-500", "bg-blue-500") → "bg-blue-500"
|