tailwind-styled-v4 5.0.9 → 5.0.10
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/CHANGELOG.md +15 -1
- package/dist/{analyzeWorkspace-DuJKh7Ty.d.mts → analyzeWorkspace-BS5O4rhC.d.mts} +47 -2
- package/dist/{analyzeWorkspace-Ct_NTAWt.d.ts → analyzeWorkspace-DDOQdzzI.d.ts} +47 -2
- package/dist/analyzer.d.mts +5 -3
- package/dist/analyzer.d.ts +5 -3
- package/dist/analyzer.js +563 -468
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +562 -467
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +4 -7
- package/dist/animate.d.ts +4 -7
- package/dist/animate.js +171 -265
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +165 -264
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.d.mts +22 -1
- package/dist/atomic.d.ts +22 -1
- package/dist/atomic.js +221 -165
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +200 -165
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.d.mts +60 -1
- package/dist/cli.d.ts +60 -1
- package/dist/cli.js +1261 -1517
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1238 -1513
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +38 -7
- package/dist/compiler.d.ts +38 -7
- package/dist/compiler.js +174 -197
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +151 -194
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js +7 -31
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +7 -31
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +134 -63
- package/dist/engine.d.ts +134 -63
- package/dist/engine.js +2863 -2482
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +2852 -2485
- package/dist/engine.mjs.map +1 -1
- package/dist/{index-eWAocnD2.d.mts → index-NDINUhLN.d.mts} +3 -1
- package/dist/{index-eWAocnD2.d.ts → index-NDINUhLN.d.ts} +3 -1
- package/dist/index.d.mts +45 -32
- package/dist/index.d.ts +45 -32
- package/dist/index.js +271 -158
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +251 -158
- package/dist/index.mjs.map +1 -1
- package/dist/{liveTokenEngine-DSUk88P6.d.ts → liveTokenEngine-CN9ian1R.d.ts} +1 -1
- package/dist/{liveTokenEngine-CX5_0c4q.d.mts → liveTokenEngine-DKoWRtqH.d.mts} +1 -1
- package/dist/next.js +20 -39
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +18 -37
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.d.mts +8 -2
- package/dist/plugin-api.d.ts +8 -2
- package/dist/plugin-api.js +14 -2
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs +14 -3
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +51 -11
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +51 -11
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.d.mts +5 -7
- package/dist/plugin.d.ts +5 -7
- package/dist/plugin.js +16 -15
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +16 -16
- package/dist/plugin.mjs.map +1 -1
- package/dist/rspack.js +17 -38
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +15 -36
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime.d.mts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/scanner.d.mts +10 -1
- package/dist/scanner.d.ts +10 -1
- package/dist/scanner.js +298 -124
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +296 -124
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +1 -1
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +104 -176
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +85 -176
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.d.mts +1 -1
- package/dist/storybook-addon.d.ts +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +166 -3
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +143 -1
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +21 -21
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +21 -21
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +9 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +9 -1
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.d.mts +2 -2
- package/dist/theme.d.ts +2 -2
- package/dist/theme.js +40 -112
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +37 -110
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +79 -124
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +63 -122
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +1256 -1517
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +1236 -1513
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +1783 -823
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +1767 -821
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +165 -4
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +141 -1
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +65 -108
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +45 -104
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +22 -24
|
@@ -63,10 +63,12 @@ interface LoadNativeBindingResult<T> {
|
|
|
63
63
|
}
|
|
64
64
|
declare function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T>;
|
|
65
65
|
interface ResolveCandidatesOptions {
|
|
66
|
-
runtimeDir
|
|
66
|
+
runtimeDir?: string;
|
|
67
67
|
envVarNames?: string[];
|
|
68
68
|
includeDefaultCandidates?: boolean;
|
|
69
69
|
enforceNodeExtensionForEnvPath?: boolean;
|
|
70
|
+
/** @deprecated — ignored, kept for backward compat */
|
|
71
|
+
packageName?: string;
|
|
70
72
|
}
|
|
71
73
|
declare function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[];
|
|
72
74
|
declare function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string;
|
|
@@ -63,10 +63,12 @@ interface LoadNativeBindingResult<T> {
|
|
|
63
63
|
}
|
|
64
64
|
declare function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T>;
|
|
65
65
|
interface ResolveCandidatesOptions {
|
|
66
|
-
runtimeDir
|
|
66
|
+
runtimeDir?: string;
|
|
67
67
|
envVarNames?: string[];
|
|
68
68
|
includeDefaultCandidates?: boolean;
|
|
69
69
|
enforceNodeExtensionForEnvPath?: boolean;
|
|
70
|
+
/** @deprecated — ignored, kept for backward compat */
|
|
71
|
+
packageName?: string;
|
|
70
72
|
}
|
|
71
73
|
declare function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[];
|
|
72
74
|
declare function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { a as AnimateOptions } from './types-DXr2PmGP.mjs';
|
|
3
|
-
import { H as HtmlTagName } from './index-
|
|
4
|
-
export { T as TokenMap } from './index-
|
|
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-
|
|
3
|
+
import { H as HtmlTagName } from './index-NDINUhLN.mjs';
|
|
4
|
+
export { T as TokenMap } from './index-NDINUhLN.mjs';
|
|
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
6
|
|
|
7
7
|
/**
|
|
8
8
|
* tailwind-styled-v4 — Core Types
|
|
@@ -59,11 +59,11 @@ type TwSubComponentAccessor = React.FC<{
|
|
|
59
59
|
children?: React.ReactNode;
|
|
60
60
|
className?: string;
|
|
61
61
|
}>;
|
|
62
|
-
type TrimLeft<S extends string> = S extends ` ${infer R}` | `
|
|
63
|
-
${infer R}` | ` ${infer R}` | `
|
|
62
|
+
type TrimLeft<S extends string> = S extends ` ${infer R}` | `
|
|
63
|
+
${infer R}` | ` ${infer R}` | `
|
|
64
64
|
${infer R}` ? TrimLeft<R> : S;
|
|
65
|
-
type TrimRight<S extends string> = S extends `${infer L} ` | `${infer L}
|
|
66
|
-
` | `${infer L} ` | `${infer L}
|
|
65
|
+
type TrimRight<S extends string> = S extends `${infer L} ` | `${infer L}
|
|
66
|
+
` | `${infer L} ` | `${infer L}
|
|
67
67
|
` ? TrimRight<L> : S;
|
|
68
68
|
type Trim<S extends string> = TrimLeft<TrimRight<S>>;
|
|
69
69
|
type ExtractSubNames<T extends string> = T extends `${string}[${infer Name}]${string}{${string}}${infer Rest}` ? Trim<Name> | ExtractSubNames<Rest> : T extends `${string}\n${infer Name}{${string}}${infer Rest}` ? (Trim<Name> extends "" ? never : Trim<Name>) | ExtractSubNames<Rest> : never;
|
|
@@ -173,6 +173,12 @@ interface ContainerQueryResult {
|
|
|
173
173
|
hasContainer: true;
|
|
174
174
|
}
|
|
175
175
|
declare function processContainer(tag: string, container: ContainerConfig, containerName?: string): ContainerQueryResult;
|
|
176
|
+
/**
|
|
177
|
+
* Generate @container CSS rules dari breakpoint config.
|
|
178
|
+
*
|
|
179
|
+
* Native-first: Rust string building tanpa intermediate allocations.
|
|
180
|
+
* JS fallback: `buildContainerRules()` loop.
|
|
181
|
+
*/
|
|
176
182
|
declare function generateContainerCss(tag: string, container: ContainerConfig, containerName?: string): string;
|
|
177
183
|
declare function getContainerRegistry(): Map<string, ContainerEntry>;
|
|
178
184
|
|
|
@@ -181,13 +187,13 @@ declare function createComponent<P extends object = Record<string, unknown>>(tag
|
|
|
181
187
|
/**
|
|
182
188
|
* tailwind-styled-v4 — cv()
|
|
183
189
|
*
|
|
184
|
-
* Runtime:
|
|
190
|
+
* Runtime: native-first with fallback to generated variant tables.
|
|
185
191
|
*
|
|
186
192
|
* Dua mode:
|
|
187
193
|
* 1. GENERATED (optimal) — import dari variants.generated.ts hasil `npx tw compile-variants`
|
|
188
194
|
* → O(1) lookup, static, zero runtime computation
|
|
189
|
-
* 2. RUNTIME (fallback) — compute on-the-fly
|
|
190
|
-
* →
|
|
195
|
+
* 2. RUNTIME (fallback) — compute on-the-fly via native binding
|
|
196
|
+
* → Requires native Rust binding for variant resolution
|
|
191
197
|
*/
|
|
192
198
|
|
|
193
199
|
declare function cv<C extends ComponentConfig>(config: C, componentId?: string): CvFn<C>;
|
|
@@ -195,39 +201,32 @@ declare function cv<C extends ComponentConfig>(config: C, componentId?: string):
|
|
|
195
201
|
/**
|
|
196
202
|
* tailwind-styled-v4 v2 — cx / cn
|
|
197
203
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* cxm() → twMerge, correct — but obscure name
|
|
203
|
-
*
|
|
204
|
-
* AFTER:
|
|
205
|
-
* cn() → simple join (for cases where you know there's no conflict)
|
|
206
|
-
* cx() → twMerge-powered, conflict-aware (recommended for most use cases)
|
|
207
|
-
* cxm() → kept as alias for cx() for backward compat
|
|
204
|
+
* Native-first:
|
|
205
|
+
* cn() → simple join (no conflict resolution) — delegates ke Rust `resolve_class_names`
|
|
206
|
+
* cx() → conflict-aware merge — delegates ke Rust `tw_merge` (required)
|
|
207
|
+
* cxm() → alias cx() untuk backward compat
|
|
208
208
|
*/
|
|
209
209
|
type ClassValue = string | undefined | null | false | 0;
|
|
210
210
|
/**
|
|
211
211
|
* cn — simple class name joiner (no conflict resolution).
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* FIX #09: Previously named `cx`. Renamed to `cn` for clarity.
|
|
212
|
+
* Native-first: delegates ke Rust `resolve_class_names` yang filter+join
|
|
213
|
+
* dalam satu pass tanpa intermediate allocations.
|
|
215
214
|
*
|
|
216
215
|
* @example cn("p-4", isActive && "opacity-100") → "p-4 opacity-100"
|
|
217
216
|
*/
|
|
218
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
217
|
+
declare function cn(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
219
218
|
/**
|
|
220
|
-
* cx — conflict-aware class merger
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* FIX #09: Previously named `cxm`. Renamed to `cx` as the primary utility.
|
|
219
|
+
* cx — conflict-aware class merger.
|
|
220
|
+
* Native-first: delegates ke Rust `tw_merge` (required).
|
|
221
|
+
* Mendukung array inputs — flatten sebelum di-pass ke native.
|
|
224
222
|
*
|
|
225
|
-
* @example cx("p-4 p-8")
|
|
226
|
-
* @example cx("bg-red-500", "bg-blue-500")
|
|
223
|
+
* @example cx("p-4 p-8") → "p-8"
|
|
224
|
+
* @example cx("bg-red-500", "bg-blue-500") → "bg-blue-500"
|
|
225
|
+
* @example cx(["flex", "items-center"], "px-4") → "flex items-center px-4"
|
|
227
226
|
*/
|
|
228
|
-
declare function cx(...inputs: ClassValue[]): string;
|
|
227
|
+
declare function cx(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
229
228
|
/**
|
|
230
|
-
* cxm — alias
|
|
229
|
+
* cxm — alias untuk cx(), kept for backward compatibility.
|
|
231
230
|
* @deprecated Use cx() instead.
|
|
232
231
|
*/
|
|
233
232
|
declare const cxm: typeof cx;
|
|
@@ -241,11 +240,25 @@ interface ThemeConfig$1 {
|
|
|
241
240
|
raw: Record<string, string>;
|
|
242
241
|
}
|
|
243
242
|
|
|
243
|
+
/**
|
|
244
|
+
* tailwind-styled-v4 — createTwMerge()
|
|
245
|
+
*
|
|
246
|
+
* Native-only: uses Rust `tw_merge_many`; requires native binding.
|
|
247
|
+
* No JS fallback — tailwind-merge removed from bundle.
|
|
248
|
+
*/
|
|
249
|
+
|
|
244
250
|
interface MergeOptions {
|
|
245
251
|
prefix?: string;
|
|
246
252
|
separator?: string;
|
|
247
253
|
theme?: ThemeConfig$1;
|
|
248
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* createTwMerge — returns a conflict-aware merge function.
|
|
257
|
+
* Native-only: uses Rust `tw_merge_many`; throws if native binding unavailable.
|
|
258
|
+
*
|
|
259
|
+
* Note: `prefix` and `separator` options are not supported in native mode
|
|
260
|
+
* (Tailwind v3/v4 defaults are used).
|
|
261
|
+
*/
|
|
249
262
|
declare function createTwMerge(_options?: MergeOptions): (...classLists: Array<string | undefined | null | false>) => string;
|
|
250
263
|
declare const twMerge: (...classLists: Array<string | undefined | null | false>) => string;
|
|
251
264
|
declare function mergeWithRules(rules: Record<string, (classes: string[]) => string>, ...classLists: string[]): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { a as AnimateOptions } from './types-DXr2PmGP.js';
|
|
3
|
-
import { H as HtmlTagName } from './index-
|
|
4
|
-
export { T as TokenMap } from './index-
|
|
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-
|
|
3
|
+
import { H as HtmlTagName } from './index-NDINUhLN.js';
|
|
4
|
+
export { T as TokenMap } from './index-NDINUhLN.js';
|
|
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
6
|
|
|
7
7
|
/**
|
|
8
8
|
* tailwind-styled-v4 — Core Types
|
|
@@ -59,11 +59,11 @@ type TwSubComponentAccessor = React.FC<{
|
|
|
59
59
|
children?: React.ReactNode;
|
|
60
60
|
className?: string;
|
|
61
61
|
}>;
|
|
62
|
-
type TrimLeft<S extends string> = S extends ` ${infer R}` | `
|
|
63
|
-
${infer R}` | ` ${infer R}` | `
|
|
62
|
+
type TrimLeft<S extends string> = S extends ` ${infer R}` | `
|
|
63
|
+
${infer R}` | ` ${infer R}` | `
|
|
64
64
|
${infer R}` ? TrimLeft<R> : S;
|
|
65
|
-
type TrimRight<S extends string> = S extends `${infer L} ` | `${infer L}
|
|
66
|
-
` | `${infer L} ` | `${infer L}
|
|
65
|
+
type TrimRight<S extends string> = S extends `${infer L} ` | `${infer L}
|
|
66
|
+
` | `${infer L} ` | `${infer L}
|
|
67
67
|
` ? TrimRight<L> : S;
|
|
68
68
|
type Trim<S extends string> = TrimLeft<TrimRight<S>>;
|
|
69
69
|
type ExtractSubNames<T extends string> = T extends `${string}[${infer Name}]${string}{${string}}${infer Rest}` ? Trim<Name> | ExtractSubNames<Rest> : T extends `${string}\n${infer Name}{${string}}${infer Rest}` ? (Trim<Name> extends "" ? never : Trim<Name>) | ExtractSubNames<Rest> : never;
|
|
@@ -173,6 +173,12 @@ interface ContainerQueryResult {
|
|
|
173
173
|
hasContainer: true;
|
|
174
174
|
}
|
|
175
175
|
declare function processContainer(tag: string, container: ContainerConfig, containerName?: string): ContainerQueryResult;
|
|
176
|
+
/**
|
|
177
|
+
* Generate @container CSS rules dari breakpoint config.
|
|
178
|
+
*
|
|
179
|
+
* Native-first: Rust string building tanpa intermediate allocations.
|
|
180
|
+
* JS fallback: `buildContainerRules()` loop.
|
|
181
|
+
*/
|
|
176
182
|
declare function generateContainerCss(tag: string, container: ContainerConfig, containerName?: string): string;
|
|
177
183
|
declare function getContainerRegistry(): Map<string, ContainerEntry>;
|
|
178
184
|
|
|
@@ -181,13 +187,13 @@ declare function createComponent<P extends object = Record<string, unknown>>(tag
|
|
|
181
187
|
/**
|
|
182
188
|
* tailwind-styled-v4 — cv()
|
|
183
189
|
*
|
|
184
|
-
* Runtime:
|
|
190
|
+
* Runtime: native-first with fallback to generated variant tables.
|
|
185
191
|
*
|
|
186
192
|
* Dua mode:
|
|
187
193
|
* 1. GENERATED (optimal) — import dari variants.generated.ts hasil `npx tw compile-variants`
|
|
188
194
|
* → O(1) lookup, static, zero runtime computation
|
|
189
|
-
* 2. RUNTIME (fallback) — compute on-the-fly
|
|
190
|
-
* →
|
|
195
|
+
* 2. RUNTIME (fallback) — compute on-the-fly via native binding
|
|
196
|
+
* → Requires native Rust binding for variant resolution
|
|
191
197
|
*/
|
|
192
198
|
|
|
193
199
|
declare function cv<C extends ComponentConfig>(config: C, componentId?: string): CvFn<C>;
|
|
@@ -195,39 +201,32 @@ declare function cv<C extends ComponentConfig>(config: C, componentId?: string):
|
|
|
195
201
|
/**
|
|
196
202
|
* tailwind-styled-v4 v2 — cx / cn
|
|
197
203
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* cxm() → twMerge, correct — but obscure name
|
|
203
|
-
*
|
|
204
|
-
* AFTER:
|
|
205
|
-
* cn() → simple join (for cases where you know there's no conflict)
|
|
206
|
-
* cx() → twMerge-powered, conflict-aware (recommended for most use cases)
|
|
207
|
-
* cxm() → kept as alias for cx() for backward compat
|
|
204
|
+
* Native-first:
|
|
205
|
+
* cn() → simple join (no conflict resolution) — delegates ke Rust `resolve_class_names`
|
|
206
|
+
* cx() → conflict-aware merge — delegates ke Rust `tw_merge` (required)
|
|
207
|
+
* cxm() → alias cx() untuk backward compat
|
|
208
208
|
*/
|
|
209
209
|
type ClassValue = string | undefined | null | false | 0;
|
|
210
210
|
/**
|
|
211
211
|
* cn — simple class name joiner (no conflict resolution).
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* FIX #09: Previously named `cx`. Renamed to `cn` for clarity.
|
|
212
|
+
* Native-first: delegates ke Rust `resolve_class_names` yang filter+join
|
|
213
|
+
* dalam satu pass tanpa intermediate allocations.
|
|
215
214
|
*
|
|
216
215
|
* @example cn("p-4", isActive && "opacity-100") → "p-4 opacity-100"
|
|
217
216
|
*/
|
|
218
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
217
|
+
declare function cn(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
219
218
|
/**
|
|
220
|
-
* cx — conflict-aware class merger
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* FIX #09: Previously named `cxm`. Renamed to `cx` as the primary utility.
|
|
219
|
+
* cx — conflict-aware class merger.
|
|
220
|
+
* Native-first: delegates ke Rust `tw_merge` (required).
|
|
221
|
+
* Mendukung array inputs — flatten sebelum di-pass ke native.
|
|
224
222
|
*
|
|
225
|
-
* @example cx("p-4 p-8")
|
|
226
|
-
* @example cx("bg-red-500", "bg-blue-500")
|
|
223
|
+
* @example cx("p-4 p-8") → "p-8"
|
|
224
|
+
* @example cx("bg-red-500", "bg-blue-500") → "bg-blue-500"
|
|
225
|
+
* @example cx(["flex", "items-center"], "px-4") → "flex items-center px-4"
|
|
227
226
|
*/
|
|
228
|
-
declare function cx(...inputs: ClassValue[]): string;
|
|
227
|
+
declare function cx(...inputs: (ClassValue | ClassValue[])[]): string;
|
|
229
228
|
/**
|
|
230
|
-
* cxm — alias
|
|
229
|
+
* cxm — alias untuk cx(), kept for backward compatibility.
|
|
231
230
|
* @deprecated Use cx() instead.
|
|
232
231
|
*/
|
|
233
232
|
declare const cxm: typeof cx;
|
|
@@ -241,11 +240,25 @@ interface ThemeConfig$1 {
|
|
|
241
240
|
raw: Record<string, string>;
|
|
242
241
|
}
|
|
243
242
|
|
|
243
|
+
/**
|
|
244
|
+
* tailwind-styled-v4 — createTwMerge()
|
|
245
|
+
*
|
|
246
|
+
* Native-only: uses Rust `tw_merge_many`; requires native binding.
|
|
247
|
+
* No JS fallback — tailwind-merge removed from bundle.
|
|
248
|
+
*/
|
|
249
|
+
|
|
244
250
|
interface MergeOptions {
|
|
245
251
|
prefix?: string;
|
|
246
252
|
separator?: string;
|
|
247
253
|
theme?: ThemeConfig$1;
|
|
248
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* createTwMerge — returns a conflict-aware merge function.
|
|
257
|
+
* Native-only: uses Rust `tw_merge_many`; throws if native binding unavailable.
|
|
258
|
+
*
|
|
259
|
+
* Note: `prefix` and `separator` options are not supported in native mode
|
|
260
|
+
* (Tailwind v3/v4 defaults are used).
|
|
261
|
+
*/
|
|
249
262
|
declare function createTwMerge(_options?: MergeOptions): (...classLists: Array<string | undefined | null | false>) => string;
|
|
250
263
|
declare const twMerge: (...classLists: Array<string | undefined | null | false>) => string;
|
|
251
264
|
declare function mergeWithRules(rules: Record<string, (classes: string[]) => string>, ...classLists: string[]): string;
|