tailwind-styled-v4 5.0.11 → 5.0.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/README.md +100 -4
- package/dist/{analyzeWorkspace-DDOQdzzI.d.ts → analyzeWorkspace-CopJNGmi.d.ts} +2 -0
- package/dist/{analyzeWorkspace-BS5O4rhC.d.mts → analyzeWorkspace-DpVPccjz.d.mts} +2 -0
- package/dist/analyzer.d.mts +4 -4
- package/dist/analyzer.d.ts +4 -4
- package/dist/analyzer.js +34 -69
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +33 -68
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +4 -0
- package/dist/animate.d.ts +4 -0
- package/dist/animate.js +33 -11
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +33 -11
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +57 -6
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +57 -6
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +404 -190
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +401 -187
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +2700 -212
- package/dist/compiler.d.ts +2700 -212
- package/dist/compiler.js +1996 -503
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +1847 -448
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js +17 -4
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +17 -4
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +11 -470
- package/dist/engine.d.ts +11 -470
- package/dist/engine.js +2777 -455
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +2776 -454
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BDQw13kn.d.ts +464 -0
- package/dist/index-DJv28Uzq.d.mts +464 -0
- package/dist/index.browser.mjs +143 -255
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +23 -39
- package/dist/index.d.ts +23 -39
- package/dist/index.js +7234 -1400
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7234 -1400
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +44 -1
- package/dist/next.d.ts +44 -1
- package/dist/next.js +3224 -1065
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +3223 -1066
- package/dist/next.mjs.map +1 -1
- package/dist/rspack.d.mts +9 -0
- package/dist/rspack.d.ts +9 -0
- package/dist/rspack.js +99 -61
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +99 -61
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.d.mts +8 -0
- package/dist/runtime-css.d.ts +8 -0
- package/dist/runtime-css.js +23 -7
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +23 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/scanner.js +16 -37
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +15 -36
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +107 -1
- package/dist/shared.d.ts +107 -1
- package/dist/shared.js +3014 -466
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +3008 -445
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js +39 -35
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +38 -34
- package/dist/svelte.mjs.map +1 -1
- package/dist/theme.js +85 -76
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +83 -74
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +2351 -187
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +2351 -187
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +404 -190
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +401 -187
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +2657 -320
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +2657 -320
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +39 -35
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +38 -34
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +190 -33
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +190 -33
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/index.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
- package/package.json +9 -4
- package/CHANGELOG.md +0 -285
package/dist/index.d.mts
CHANGED
|
@@ -3,6 +3,10 @@ import { a as AnimateOptions } from './types-DXr2PmGP.mjs';
|
|
|
3
3
|
import { H as HtmlTagName } from './index-NDINUhLN.mjs';
|
|
4
4
|
export { T as TokenMap } from './index-NDINUhLN.mjs';
|
|
5
5
|
export { a as LiveTokenSet, T as TokenSubscriber, b as applyTokenSet, t as containerRef, c as createUseTokens, g as generateTokenCssString, d as getToken, e as getTokens, l as liveToken, s as setToken, h as setTokens, i as subscribeTokens, t as tokenRef, j as tokenVar } from './liveTokenEngine-DKoWRtqH.mjs';
|
|
6
|
+
export { K as createEngine } from './index-DJv28Uzq.mjs';
|
|
7
|
+
import './analyzeWorkspace-DpVPccjz.mjs';
|
|
8
|
+
import './schemas-DR-SLxZZ.mjs';
|
|
9
|
+
import 'zod';
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* tailwind-styled-v4 — Core Types
|
|
@@ -83,6 +87,13 @@ interface ComponentConfig {
|
|
|
83
87
|
states?: StatesConfig;
|
|
84
88
|
/** Sub-component definitions — string atau nested { tag: { name: classes } } */
|
|
85
89
|
sub?: Record<string, SubValue>;
|
|
90
|
+
/**
|
|
91
|
+
* Pre-computed hash — di-inject oleh turbopackLoader via `inject_state_hash()` (Rust).
|
|
92
|
+
* Kalau ada, `stateEngine.ts` skip runtime `hashState()` computation sepenuhnya.
|
|
93
|
+
* Format: 6-char FNV-1a hex string, identik dengan output `hashState()`.
|
|
94
|
+
* @internal — jangan set manual, ini di-inject otomatis saat build/dev.
|
|
95
|
+
*/
|
|
96
|
+
__hash?: string;
|
|
86
97
|
}
|
|
87
98
|
/**
|
|
88
99
|
* Strip tag prefix dari "tag:name" format sub key.
|
|
@@ -245,8 +256,7 @@ declare function processContainer(tag: string, container: ContainerConfig, conta
|
|
|
245
256
|
/**
|
|
246
257
|
* Generate @container CSS rules dari breakpoint config.
|
|
247
258
|
*
|
|
248
|
-
* Native-
|
|
249
|
-
* JS fallback: `buildContainerRules()` loop.
|
|
259
|
+
* Native-only: Rust string building tanpa intermediate allocations.
|
|
250
260
|
*/
|
|
251
261
|
declare function generateContainerCss(tag: string, container: ContainerConfig, containerName?: string): string;
|
|
252
262
|
declare function getContainerRegistry(): Map<string, ContainerEntry>;
|
|
@@ -269,40 +279,26 @@ declare function cv<C extends ComponentConfig>(config: C, componentId?: string):
|
|
|
269
279
|
|
|
270
280
|
/**
|
|
271
281
|
* tailwind-styled-v4 v2 — cx / cn
|
|
272
|
-
*
|
|
273
|
-
* Native-first:
|
|
274
|
-
* cn() → simple join (no conflict resolution) — delegates ke Rust `resolve_class_names`
|
|
275
|
-
* cx() → conflict-aware merge — delegates ke Rust `tw_merge` (preferred)
|
|
276
|
-
* cxm() → alias cx() untuk backward compat
|
|
277
|
-
*
|
|
278
|
-
* Browser fallback: simple join when native binding unavailable.
|
|
279
|
-
* In browser/client context, classes were already resolved on server during SSR.
|
|
282
|
+
* Pure Node.js — requires native Rust binding.
|
|
280
283
|
*/
|
|
281
284
|
type ClassValue = string | undefined | null | false | 0;
|
|
282
285
|
/**
|
|
283
286
|
* cn — simple class name joiner (no conflict resolution).
|
|
284
|
-
*
|
|
285
|
-
* dalam satu pass tanpa intermediate allocations.
|
|
286
|
-
* Browser fallback: flat+filter+join.
|
|
287
|
+
* Delegates ke Rust `resolve_class_names`.
|
|
287
288
|
*
|
|
288
289
|
* @example cn("p-4", isActive && "opacity-100") → "p-4 opacity-100"
|
|
289
290
|
*/
|
|
290
291
|
declare function cn(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
291
292
|
/**
|
|
292
293
|
* cx — conflict-aware class merger.
|
|
293
|
-
*
|
|
294
|
-
* Mendukung array inputs — flatten sebelum di-pass ke native.
|
|
295
|
-
* Browser fallback: simple join without conflict resolution.
|
|
294
|
+
* Delegates ke Rust `tw_merge_many`.
|
|
296
295
|
*
|
|
297
296
|
* @example cx("p-4 p-8") → "p-8"
|
|
298
297
|
* @example cx("bg-red-500", "bg-blue-500") → "bg-blue-500"
|
|
299
298
|
* @example cx(["flex", "items-center"], "px-4") → "flex items-center px-4"
|
|
300
299
|
*/
|
|
301
300
|
declare function cx(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
302
|
-
/**
|
|
303
|
-
* cxm — alias untuk cx(), kept for backward compatibility.
|
|
304
|
-
* @deprecated Use cx() instead.
|
|
305
|
-
*/
|
|
301
|
+
/** @deprecated Use cx() instead. */
|
|
306
302
|
declare const cxm: typeof cx;
|
|
307
303
|
|
|
308
304
|
interface ThemeConfig$1 {
|
|
@@ -316,10 +312,7 @@ interface ThemeConfig$1 {
|
|
|
316
312
|
|
|
317
313
|
/**
|
|
318
314
|
* tailwind-styled-v4 — createTwMerge()
|
|
319
|
-
*
|
|
320
|
-
* Native-first: uses Rust `tw_merge_many` when available.
|
|
321
|
-
* Browser fallback: simple join (no conflict resolution).
|
|
322
|
-
* In browser/client context, classes were already resolved on the server during SSR.
|
|
315
|
+
* Pure Node.js — requires native Rust binding.
|
|
323
316
|
*/
|
|
324
317
|
|
|
325
318
|
interface MergeOptions {
|
|
@@ -327,20 +320,6 @@ interface MergeOptions {
|
|
|
327
320
|
separator?: string;
|
|
328
321
|
theme?: ThemeConfig$1;
|
|
329
322
|
}
|
|
330
|
-
/**
|
|
331
|
-
* createTwMerge — returns a conflict-aware merge function.
|
|
332
|
-
* Native-first: uses Rust `tw_merge_many` when available.
|
|
333
|
-
* Browser fallback: simple join without conflict resolution.
|
|
334
|
-
*
|
|
335
|
-
* IMPORTANT: The browser fallback must produce output identical to the server
|
|
336
|
-
* (Rust) path to avoid React hydration mismatches. For static base classes this
|
|
337
|
-
* is fine because they are pre-resolved at build time. For runtime className
|
|
338
|
-
* overrides passed by the consumer, the join order must be stable and
|
|
339
|
-
* deterministic on both sides.
|
|
340
|
-
*
|
|
341
|
-
* Note: `prefix` and `separator` options are not supported in native mode
|
|
342
|
-
* (Tailwind v3/v4 defaults are used).
|
|
343
|
-
*/
|
|
344
323
|
declare function createTwMerge(_options?: MergeOptions): (...classLists: Array<string | undefined | null | false>) => string;
|
|
345
324
|
declare const twMerge: (...classLists: Array<string | undefined | null | false>) => string;
|
|
346
325
|
declare function mergeWithRules(rules: Record<string, (classes: string[]) => string>, ...classLists: string[]): string;
|
|
@@ -425,8 +404,13 @@ interface StateEngineResult {
|
|
|
425
404
|
/**
|
|
426
405
|
* Process a StateConfig for a component.
|
|
427
406
|
* Returns the state class and injects CSS (client-side only).
|
|
407
|
+
*
|
|
408
|
+
* @param tag HTML tag name
|
|
409
|
+
* @param state State config object
|
|
410
|
+
* @param precomputedHash Optional pre-computed hash dari `inject_state_hash()` Rust transform.
|
|
411
|
+
* Kalau ada, skip runtime `hashState()` sepenuhnya → zero hashing overhead.
|
|
428
412
|
*/
|
|
429
|
-
declare function processState(tag: string, state: StateConfig): StateEngineResult;
|
|
413
|
+
declare function processState(tag: string, state: StateConfig, precomputedHash?: string): StateEngineResult;
|
|
430
414
|
/**
|
|
431
415
|
* Generate SSR-safe CSS string for a state config.
|
|
432
416
|
* Used by SSR to inject styles into <head>.
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { a as AnimateOptions } from './types-DXr2PmGP.js';
|
|
|
3
3
|
import { H as HtmlTagName } from './index-NDINUhLN.js';
|
|
4
4
|
export { T as TokenMap } from './index-NDINUhLN.js';
|
|
5
5
|
export { a as LiveTokenSet, T as TokenSubscriber, b as applyTokenSet, t as containerRef, c as createUseTokens, g as generateTokenCssString, d as getToken, e as getTokens, l as liveToken, s as setToken, h as setTokens, i as subscribeTokens, t as tokenRef, j as tokenVar } from './liveTokenEngine-CN9ian1R.js';
|
|
6
|
+
export { K as createEngine } from './index-BDQw13kn.js';
|
|
7
|
+
import './analyzeWorkspace-CopJNGmi.js';
|
|
8
|
+
import './schemas-DR-SLxZZ.js';
|
|
9
|
+
import 'zod';
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* tailwind-styled-v4 — Core Types
|
|
@@ -83,6 +87,13 @@ interface ComponentConfig {
|
|
|
83
87
|
states?: StatesConfig;
|
|
84
88
|
/** Sub-component definitions — string atau nested { tag: { name: classes } } */
|
|
85
89
|
sub?: Record<string, SubValue>;
|
|
90
|
+
/**
|
|
91
|
+
* Pre-computed hash — di-inject oleh turbopackLoader via `inject_state_hash()` (Rust).
|
|
92
|
+
* Kalau ada, `stateEngine.ts` skip runtime `hashState()` computation sepenuhnya.
|
|
93
|
+
* Format: 6-char FNV-1a hex string, identik dengan output `hashState()`.
|
|
94
|
+
* @internal — jangan set manual, ini di-inject otomatis saat build/dev.
|
|
95
|
+
*/
|
|
96
|
+
__hash?: string;
|
|
86
97
|
}
|
|
87
98
|
/**
|
|
88
99
|
* Strip tag prefix dari "tag:name" format sub key.
|
|
@@ -245,8 +256,7 @@ declare function processContainer(tag: string, container: ContainerConfig, conta
|
|
|
245
256
|
/**
|
|
246
257
|
* Generate @container CSS rules dari breakpoint config.
|
|
247
258
|
*
|
|
248
|
-
* Native-
|
|
249
|
-
* JS fallback: `buildContainerRules()` loop.
|
|
259
|
+
* Native-only: Rust string building tanpa intermediate allocations.
|
|
250
260
|
*/
|
|
251
261
|
declare function generateContainerCss(tag: string, container: ContainerConfig, containerName?: string): string;
|
|
252
262
|
declare function getContainerRegistry(): Map<string, ContainerEntry>;
|
|
@@ -269,40 +279,26 @@ declare function cv<C extends ComponentConfig>(config: C, componentId?: string):
|
|
|
269
279
|
|
|
270
280
|
/**
|
|
271
281
|
* tailwind-styled-v4 v2 — cx / cn
|
|
272
|
-
*
|
|
273
|
-
* Native-first:
|
|
274
|
-
* cn() → simple join (no conflict resolution) — delegates ke Rust `resolve_class_names`
|
|
275
|
-
* cx() → conflict-aware merge — delegates ke Rust `tw_merge` (preferred)
|
|
276
|
-
* cxm() → alias cx() untuk backward compat
|
|
277
|
-
*
|
|
278
|
-
* Browser fallback: simple join when native binding unavailable.
|
|
279
|
-
* In browser/client context, classes were already resolved on server during SSR.
|
|
282
|
+
* Pure Node.js — requires native Rust binding.
|
|
280
283
|
*/
|
|
281
284
|
type ClassValue = string | undefined | null | false | 0;
|
|
282
285
|
/**
|
|
283
286
|
* cn — simple class name joiner (no conflict resolution).
|
|
284
|
-
*
|
|
285
|
-
* dalam satu pass tanpa intermediate allocations.
|
|
286
|
-
* Browser fallback: flat+filter+join.
|
|
287
|
+
* Delegates ke Rust `resolve_class_names`.
|
|
287
288
|
*
|
|
288
289
|
* @example cn("p-4", isActive && "opacity-100") → "p-4 opacity-100"
|
|
289
290
|
*/
|
|
290
291
|
declare function cn(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
291
292
|
/**
|
|
292
293
|
* cx — conflict-aware class merger.
|
|
293
|
-
*
|
|
294
|
-
* Mendukung array inputs — flatten sebelum di-pass ke native.
|
|
295
|
-
* Browser fallback: simple join without conflict resolution.
|
|
294
|
+
* Delegates ke Rust `tw_merge_many`.
|
|
296
295
|
*
|
|
297
296
|
* @example cx("p-4 p-8") → "p-8"
|
|
298
297
|
* @example cx("bg-red-500", "bg-blue-500") → "bg-blue-500"
|
|
299
298
|
* @example cx(["flex", "items-center"], "px-4") → "flex items-center px-4"
|
|
300
299
|
*/
|
|
301
300
|
declare function cx(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
302
|
-
/**
|
|
303
|
-
* cxm — alias untuk cx(), kept for backward compatibility.
|
|
304
|
-
* @deprecated Use cx() instead.
|
|
305
|
-
*/
|
|
301
|
+
/** @deprecated Use cx() instead. */
|
|
306
302
|
declare const cxm: typeof cx;
|
|
307
303
|
|
|
308
304
|
interface ThemeConfig$1 {
|
|
@@ -316,10 +312,7 @@ interface ThemeConfig$1 {
|
|
|
316
312
|
|
|
317
313
|
/**
|
|
318
314
|
* tailwind-styled-v4 — createTwMerge()
|
|
319
|
-
*
|
|
320
|
-
* Native-first: uses Rust `tw_merge_many` when available.
|
|
321
|
-
* Browser fallback: simple join (no conflict resolution).
|
|
322
|
-
* In browser/client context, classes were already resolved on the server during SSR.
|
|
315
|
+
* Pure Node.js — requires native Rust binding.
|
|
323
316
|
*/
|
|
324
317
|
|
|
325
318
|
interface MergeOptions {
|
|
@@ -327,20 +320,6 @@ interface MergeOptions {
|
|
|
327
320
|
separator?: string;
|
|
328
321
|
theme?: ThemeConfig$1;
|
|
329
322
|
}
|
|
330
|
-
/**
|
|
331
|
-
* createTwMerge — returns a conflict-aware merge function.
|
|
332
|
-
* Native-first: uses Rust `tw_merge_many` when available.
|
|
333
|
-
* Browser fallback: simple join without conflict resolution.
|
|
334
|
-
*
|
|
335
|
-
* IMPORTANT: The browser fallback must produce output identical to the server
|
|
336
|
-
* (Rust) path to avoid React hydration mismatches. For static base classes this
|
|
337
|
-
* is fine because they are pre-resolved at build time. For runtime className
|
|
338
|
-
* overrides passed by the consumer, the join order must be stable and
|
|
339
|
-
* deterministic on both sides.
|
|
340
|
-
*
|
|
341
|
-
* Note: `prefix` and `separator` options are not supported in native mode
|
|
342
|
-
* (Tailwind v3/v4 defaults are used).
|
|
343
|
-
*/
|
|
344
323
|
declare function createTwMerge(_options?: MergeOptions): (...classLists: Array<string | undefined | null | false>) => string;
|
|
345
324
|
declare const twMerge: (...classLists: Array<string | undefined | null | false>) => string;
|
|
346
325
|
declare function mergeWithRules(rules: Record<string, (classes: string[]) => string>, ...classLists: string[]): string;
|
|
@@ -425,8 +404,13 @@ interface StateEngineResult {
|
|
|
425
404
|
/**
|
|
426
405
|
* Process a StateConfig for a component.
|
|
427
406
|
* Returns the state class and injects CSS (client-side only).
|
|
407
|
+
*
|
|
408
|
+
* @param tag HTML tag name
|
|
409
|
+
* @param state State config object
|
|
410
|
+
* @param precomputedHash Optional pre-computed hash dari `inject_state_hash()` Rust transform.
|
|
411
|
+
* Kalau ada, skip runtime `hashState()` sepenuhnya → zero hashing overhead.
|
|
428
412
|
*/
|
|
429
|
-
declare function processState(tag: string, state: StateConfig): StateEngineResult;
|
|
413
|
+
declare function processState(tag: string, state: StateConfig, precomputedHash?: string): StateEngineResult;
|
|
430
414
|
/**
|
|
431
415
|
* Generate SSR-safe CSS string for a state config.
|
|
432
416
|
* Used by SSR to inject styles into <head>.
|