@rzl-zone/utils-js 3.9.1 → 3.11.0
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 +111 -73
- package/dist/assertions/index.cjs +11 -11
- package/dist/assertions/index.d.ts +487 -215
- package/dist/assertions/index.js +5 -5
- package/dist/{chunk-SN5HAK3Y.js → chunk-22V4WP3H.js} +4 -4
- package/dist/{chunk-EJV5AF4L.js → chunk-2XSZ2ANI.js} +2 -2
- package/dist/{chunk-OSSFLQDD.js → chunk-3T6VSWYX.js} +2 -2
- package/dist/{chunk-3LE6NX57.js → chunk-5WIEDF2J.js} +4 -4
- package/dist/{chunk-WLEZ2KSG.cjs → chunk-6EDFZJZ5.cjs} +126 -126
- package/dist/{chunk-GHU356XQ.js → chunk-6LXWT2I5.js} +3 -3
- package/dist/{chunk-GKDSBOYE.js → chunk-6YGBRENU.js} +3 -3
- package/dist/{chunk-NAOVH4OH.cjs → chunk-7FGNVDEV.cjs} +7 -7
- package/dist/{chunk-X6ULJZ3X.js → chunk-AXDYWO67.js} +2 -2
- package/dist/{chunk-UV5BKAYW.cjs → chunk-B6PMNZ4M.cjs} +7 -7
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/{chunk-YHFRCVTN.js → chunk-BLF7SD66.js} +3 -3
- package/dist/{chunk-QZI5PVCI.cjs → chunk-BMZZXZJ2.cjs} +4 -4
- package/dist/{chunk-DXPM4NOU.js → chunk-BOYP3ARU.js} +4 -4
- package/dist/{chunk-UXT4XSUK.js → chunk-BPYW5YL7.js} +2 -2
- package/dist/{chunk-QGTFQ7RO.cjs → chunk-C2PV3VWC.cjs} +6 -6
- package/dist/{chunk-MZ3T6L7Z.js → chunk-CCJ2MSN7.js} +2 -2
- package/dist/{chunk-H44QVAZL.cjs → chunk-DAPAK2W3.cjs} +31 -31
- package/dist/{chunk-OYFUBKEG.cjs → chunk-DLS3G6WQ.cjs} +4 -4
- package/dist/{chunk-MS2KSKD7.js → chunk-DNMCR5JH.js} +9 -9
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/{chunk-IX6PF5ZP.cjs → chunk-EBYFYZW4.cjs} +4 -4
- package/dist/{chunk-5Y6JL47L.js → chunk-ENMRZ4BE.js} +3 -3
- package/dist/{chunk-7EIFPHV3.js → chunk-FJ4BQFVO.js} +8 -8
- package/dist/{chunk-TJ5OY6MC.cjs → chunk-GIKL4PUF.cjs} +10 -10
- package/dist/{chunk-M5QB2GM5.js → chunk-GOFINGT6.js} +2 -2
- package/dist/{chunk-J6VLFVIL.js → chunk-GXKQ3LHF.js} +3 -3
- package/dist/{chunk-5KDVIEVO.js → chunk-HNBRGN4R.js} +2 -2
- package/dist/{chunk-OCTHWEZK.cjs → chunk-HYN6FC5A.cjs} +34 -34
- package/dist/{chunk-MBFVTGYS.js → chunk-IZGVBYFN.js} +4 -4
- package/dist/{chunk-QXTJVDWE.js → chunk-JIE447J5.js} +3 -3
- package/dist/{chunk-UFYMRRJH.cjs → chunk-JXEIJM5M.cjs} +61 -61
- package/dist/{chunk-WB3FT62A.js → chunk-K47GZDBH.js} +3 -3
- package/dist/{chunk-KUVRZ2JW.cjs → chunk-K5536YHG.cjs} +50 -50
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-NJ24M6ZH.cjs → chunk-KXJ7X325.cjs} +37 -37
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/{chunk-SRWL4YCP.js → chunk-LJHPTLWB.js} +7 -7
- package/dist/{chunk-6AMDHVS2.cjs → chunk-M7ELWZXM.cjs} +9 -9
- package/dist/chunk-MSUW5VHZ.js +1590 -0
- package/dist/{chunk-2XGQQZ6A.cjs → chunk-MUHRPRR7.cjs} +3 -3
- package/dist/{chunk-XYWC4EQ3.cjs → chunk-MV3TSQSH.cjs} +71 -71
- package/dist/{chunk-VCYXNIZ2.cjs → chunk-NLZLXWAU.cjs} +9 -9
- package/dist/{chunk-76ATVDCR.cjs → chunk-NVRZPF5M.cjs} +3 -3
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-62FS7WMB.cjs → chunk-PGNL7JXO.cjs} +31 -31
- package/dist/{chunk-JI57K7D4.cjs → chunk-Q4GEQS7X.cjs} +161 -161
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/{chunk-ZTHJQJ5F.cjs → chunk-QYI2VJLS.cjs} +9 -9
- package/dist/{chunk-C7GC2PFX.js → chunk-RBWZII5I.js} +3 -3
- package/dist/{chunk-MMRHKYT6.cjs → chunk-RMP7VMPB.cjs} +12 -12
- package/dist/{chunk-TXOVQZPU.js → chunk-RZOGBYIS.js} +2 -2
- package/dist/{chunk-ALRISPTL.cjs → chunk-SU3UELUB.cjs} +3 -3
- package/dist/chunk-SYHPSOUU.cjs +1626 -0
- package/dist/{chunk-R2DR7SPJ.js → chunk-SZUNAEMR.js} +6 -6
- package/dist/{chunk-YVRUY4EW.cjs → chunk-TER22LO4.cjs} +8 -8
- package/dist/{chunk-WRGN6UBK.js → chunk-TJHGRQ4P.js} +2 -2
- package/dist/{chunk-I33PB44Q.cjs → chunk-U23I7JPB.cjs} +15 -15
- package/dist/{chunk-VBSLIIDB.js → chunk-U7HHN47R.js} +10 -10
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/{chunk-44X74C26.js → chunk-UIAWUZ4H.js} +4 -4
- package/dist/{chunk-5O66AUEC.js → chunk-ULQPCIA2.js} +2 -2
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/{chunk-6WVOUVWD.js → chunk-WETQI6HM.js} +9 -9
- package/dist/{chunk-FWWPEL7J.cjs → chunk-WLOQQFDS.cjs} +3 -3
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/{chunk-WKM6UVMG.cjs → chunk-WXFTVXBF.cjs} +4 -4
- package/dist/{chunk-YQHJB7KR.cjs → chunk-XPVTIGU2.cjs} +26 -26
- package/dist/{chunk-PWKOFPAH.cjs → chunk-XX6RUGTM.cjs} +3 -3
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/{chunk-7NXFGJJE.cjs → chunk-ZPDMWDGZ.cjs} +14 -14
- package/dist/{chunk-JYOCB6OV.js → chunk-ZVWZEGQP.js} +2 -2
- package/dist/conversions/index.cjs +34 -34
- package/dist/conversions/index.d.ts +489 -333
- package/dist/conversions/index.js +15 -15
- package/dist/events/index.cjs +8 -8
- package/dist/events/index.d.ts +35 -29
- package/dist/events/index.js +4 -4
- package/dist/formatters/index.cjs +19 -19
- package/dist/formatters/index.d.ts +917 -873
- package/dist/formatters/index.js +9 -9
- package/dist/generators/index.cjs +9 -9
- package/dist/generators/index.d.ts +104 -86
- package/dist/generators/index.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/isPlainObject-0p3VveWr.d.ts +534 -0
- package/dist/next/index.cjs +37 -37
- package/dist/next/index.d.ts +36 -21
- package/dist/next/index.js +9 -9
- package/dist/next/server/index.cjs +4 -4
- package/dist/next/server/index.d.ts +6 -3
- package/dist/next/server/index.js +2 -2
- package/dist/operations/index.cjs +11 -11
- package/dist/operations/index.d.ts +14 -5
- package/dist/operations/index.js +8 -8
- package/dist/parsers/index.cjs +6 -6
- package/dist/parsers/index.d.ts +68 -65
- package/dist/parsers/index.js +5 -5
- package/dist/predicates/index.cjs +77 -77
- package/dist/predicates/index.d.ts +442 -258
- package/dist/predicates/index.js +14 -14
- package/dist/promises/index.cjs +6 -6
- package/dist/promises/index.d.ts +28 -16
- package/dist/promises/index.js +4 -4
- package/dist/rzl-utils.global.js +2 -2
- package/dist/strings/index.cjs +23 -23
- package/dist/strings/index.d.ts +82 -54
- package/dist/strings/index.js +7 -7
- package/dist/tailwind/index.cjs +13 -13
- package/dist/tailwind/index.d.ts +186 -169
- package/dist/tailwind/index.js +5 -5
- package/dist/urls/index.cjs +23 -23
- package/dist/urls/index.d.ts +252 -229
- package/dist/urls/index.js +16 -16
- package/package.json +3 -3
- package/dist/chunk-7C7TQC5J.cjs +0 -620
- package/dist/chunk-J4TT33ZX.js +0 -584
- package/dist/isPlainObject-BTPjv6zB.d.ts +0 -178
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.11.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import{Config}from'tailwindcss';
|
|
10
|
+
import { Config } from 'tailwindcss';
|
|
11
|
+
import { ClassNameValue as ClassNameValue$1, ConfigExtension as ConfigExtension$1 } from 'tailwind-merge-v3';
|
|
12
|
+
import { ClassNameValue, ConfigExtension } from 'tailwind-merge-v4';
|
|
13
|
+
import { Stringify } from '@rzl-zone/ts-types-plus';
|
|
14
|
+
|
|
11
15
|
/** ----------------------------------------------------------
|
|
12
16
|
* * ***Type-Utility: `ClassValue`.***
|
|
13
17
|
* ----------------------------------------------------------
|
|
@@ -32,7 +36,7 @@ import{Config}from'tailwindcss';import{ClassNameValue as ClassNameValue$1,Config
|
|
|
32
36
|
* const val7: ClassValue = new Boolean("true"); // ➔ boxed boolean
|
|
33
37
|
* ```
|
|
34
38
|
*/
|
|
35
|
-
type ClassValue=ClassValues|ClassObject|string|number|bigint|null|boolean|undefined;
|
|
39
|
+
type ClassValue = ClassValues | ClassObject | string | number | bigint | null | boolean | undefined;
|
|
36
40
|
/** ----------------------------------------------------------
|
|
37
41
|
* * ***Type-Utility: `ClassObject`.***
|
|
38
42
|
* ----------------------------------------------------------
|
|
@@ -43,7 +47,7 @@ type ClassValue=ClassValues|ClassObject|string|number|bigint|null|boolean|undefi
|
|
|
43
47
|
* // ➔ "text-red" when processed by cx
|
|
44
48
|
* ```
|
|
45
49
|
*/
|
|
46
|
-
type ClassObject=Record<string,any>;
|
|
50
|
+
type ClassObject = Record<string, any>;
|
|
47
51
|
/** ----------------------------------------------------------
|
|
48
52
|
* * ***Type-Utility: `ClassValues`.***
|
|
49
53
|
* ----------------------------------------------------------
|
|
@@ -58,7 +62,7 @@ type ClassObject=Record<string,any>;
|
|
|
58
62
|
* ];
|
|
59
63
|
* ```
|
|
60
64
|
*/
|
|
61
|
-
type ClassValues=ClassValue[];
|
|
65
|
+
type ClassValues = ClassValue[];
|
|
62
66
|
/** ----------------------------------------------------------
|
|
63
67
|
* * ***Utility: `cx`.***
|
|
64
68
|
* ----------------------------------------------------------
|
|
@@ -112,7 +116,8 @@ type ClassValues=ClassValue[];
|
|
|
112
116
|
* // ➔ "own inherited"
|
|
113
117
|
* ```
|
|
114
118
|
*/
|
|
115
|
-
declare function cx(...values:ClassValues):string;
|
|
119
|
+
declare function cx(...values: ClassValues): string;
|
|
120
|
+
|
|
116
121
|
/** -------------------------------------------------------------
|
|
117
122
|
* * ***Default `cnV3` utility (Tailwind v3).***
|
|
118
123
|
* -------------------------------------------------------------
|
|
@@ -168,7 +173,7 @@ declare function cx(...values:ClassValues):string;
|
|
|
168
173
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
169
174
|
* ```
|
|
170
175
|
*/
|
|
171
|
-
declare const cnV3:(...classes:ClassValues)=>string;
|
|
176
|
+
declare const cnV3: (...classes: ClassValues) => string;
|
|
172
177
|
/** -------------------------------------------------------------
|
|
173
178
|
* * ***Default `cnV4` utility (Tailwind v4).***
|
|
174
179
|
* -------------------------------------------------------------
|
|
@@ -224,171 +229,178 @@ declare const cnV3:(...classes:ClassValues)=>string;
|
|
|
224
229
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
225
230
|
* ```
|
|
226
231
|
*/
|
|
227
|
-
declare const cnV4:(...classes:ClassValues)=>string;
|
|
232
|
+
declare const cnV4: (...classes: ClassValues) => string;
|
|
233
|
+
|
|
228
234
|
/** Tailwind Merge config extension type */
|
|
229
|
-
type TwMergeConfigExt$1=ConfigExtension<string,string>;
|
|
235
|
+
type TwMergeConfigExt$1 = ConfigExtension<string, string>;
|
|
230
236
|
/** * ***Extra options for customized Tailwind class merge.*** */
|
|
231
|
-
type OptionsConfigMergeTwCn$1={
|
|
232
|
-
/** ----------------------------------------------------------
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
config?:TailwindConfig;
|
|
255
|
-
/** ----------------------------------------------------------
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
prefix?:string;
|
|
237
|
+
type OptionsConfigMergeTwCn$1 = {
|
|
238
|
+
/** ----------------------------------------------------------
|
|
239
|
+
* * ***Optional Tailwind CSS configuration object.***
|
|
240
|
+
* ----------------------------------------------------------
|
|
241
|
+
* - **Pass your project’s `tailwind.config.ts` if you want to:**
|
|
242
|
+
* - Respect custom theme values (`colors`, `fontSize`, `spacing`, `etc`.)
|
|
243
|
+
* - Enable/disable `corePlugins`
|
|
244
|
+
* - Register `plugins`
|
|
245
|
+
* - Extend class groups (e.g., `text-shadow`)
|
|
246
|
+
* - **If omitted, the **default Tailwind config** is used.**
|
|
247
|
+
* @example
|
|
248
|
+
* ```ts
|
|
249
|
+
* import tailwindConfig from "../tailwind.config";
|
|
250
|
+
* import { twMergeDefaultV4 } from "@rzl-zone/utils-js/tailwind";
|
|
251
|
+
*
|
|
252
|
+
* const myCustomTwCls = twMergeDefaultV4({
|
|
253
|
+
* config: tailwindConfig,
|
|
254
|
+
* });
|
|
255
|
+
*
|
|
256
|
+
* myCustomTwCls("text-primary text-secondary");
|
|
257
|
+
* // => "text-secondary" (resolved from your theme config)
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
config?: TailwindConfig;
|
|
261
|
+
/** ----------------------------------------------------------
|
|
262
|
+
* * ***Prefix added to Tailwind-generated classes.***
|
|
263
|
+
* ----------------------------------------------------------
|
|
264
|
+
* - **Tailwind v3**:
|
|
265
|
+
* - Use {@link twMergeDefaultV3 | **`twMergeDefaultV3`**} instead.
|
|
266
|
+
* - Reference:
|
|
267
|
+
* [**`Tailwind v3 using prefix docs`**](https://v3.tailwindcss.com/docs/configuration#prefix).
|
|
268
|
+
*
|
|
269
|
+
* - **Tailwind v4**:
|
|
270
|
+
* - Configure in your CSS import, e.g. `@import "tailwindcss" prefix(tw);`
|
|
271
|
+
* - The prefix appears like a variant at the start of the class, e.g. `tw:flex`,
|
|
272
|
+
* `tw:bg-red-500`, `tw:hover:bg-red-600`.
|
|
273
|
+
* - Reference:
|
|
274
|
+
* [**`Tailwind v4 using prefix docs`**](https://tailwindcss.com/docs/upgrade-guide#using-a-prefix).
|
|
275
|
+
*
|
|
276
|
+
* - **ℹ️ Notes**:
|
|
277
|
+
* - Tailwind v3:
|
|
278
|
+
* - Use {@link twMergeDefaultV3 | **`twMergeDefaultV3`**} instead.
|
|
279
|
+
* - Tailwind v4: prefer identifier (e.g. `tw`) without `-`.
|
|
280
|
+
* - Fallback order:
|
|
281
|
+
* 1. `prefix` option
|
|
282
|
+
* 2. `config.prefix` (if defined)
|
|
283
|
+
* 3. `undefined`
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* - Tailwind version 4 (in CSS entry only):
|
|
287
|
+
* - CSS files:
|
|
288
|
+
* ```css
|
|
289
|
+
* `@import "tailwindcss" prefix(tw);`
|
|
290
|
+
* ```
|
|
291
|
+
* - Your custom TwMerge file:
|
|
292
|
+
* ```ts
|
|
293
|
+
* import { twMergeDefaultV4 } from "@rzl-zone/utils-js/tailwind";
|
|
294
|
+
*
|
|
295
|
+
* const twMergeV3 = twMergeDefaultV4({
|
|
296
|
+
* prefix: "tw",
|
|
297
|
+
* // ... other config
|
|
298
|
+
* });
|
|
299
|
+
* ```
|
|
300
|
+
* - Tailwind version 4 (with `tailwind.config.{js,ts,mjs,...etc}`):
|
|
301
|
+
* - Reference:
|
|
302
|
+
* [**`Tailwind v4 using @config docs`**](https://tailwindcss.com/docs/functions-and-directives#config-directive).
|
|
303
|
+
* - CSS files:
|
|
304
|
+
* ```css
|
|
305
|
+
* `@import "tailwindcss";`
|
|
306
|
+
* `@config "./tailwind.config.ts";`
|
|
307
|
+
* ```
|
|
308
|
+
* - Config files:
|
|
309
|
+
* ```ts
|
|
310
|
+
* import type { Config } from "tailwindcss";
|
|
311
|
+
*
|
|
312
|
+
* const config: Config = {
|
|
313
|
+
* prefix: 'tw-',
|
|
314
|
+
* // ... other config
|
|
315
|
+
* };
|
|
316
|
+
*
|
|
317
|
+
* export default config;
|
|
318
|
+
* ```
|
|
319
|
+
* - Your custom TwMerge file:
|
|
320
|
+
* ```ts
|
|
321
|
+
* import config from "../tailwind.config";
|
|
322
|
+
* import { twMergeDefaultV4 } from "@rzl-zone/utils-js/tailwind";
|
|
323
|
+
*
|
|
324
|
+
* const twMergeV4 = twMergeDefaultV4({ config });
|
|
325
|
+
* // now without passing `prefix` options, will use automatic from config.
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
prefix?: string;
|
|
329
|
+
};
|
|
323
330
|
/** * ***Options type for Tailwind Merge v4 wrapper.*** */
|
|
324
|
-
type OptionsMergeTwClsV4=Omit<TwMergeConfigExt$1,"prefix"
|
|
331
|
+
type OptionsMergeTwClsV4 = Omit<TwMergeConfigExt$1, "prefix"> & OptionsConfigMergeTwCn$1;
|
|
325
332
|
/** * ***Tailwind Merge function Version 4 signature (same as twMerge).*** */
|
|
326
|
-
type TwMergeDefaultFnV4=(...classLists:ClassNameValue[])=>string;
|
|
333
|
+
type TwMergeDefaultFnV4 = (...classLists: ClassNameValue[]) => string;
|
|
334
|
+
|
|
335
|
+
type TailwindConfig = Config;
|
|
336
|
+
|
|
327
337
|
/** Tailwind Merge config extension type */
|
|
328
|
-
type TwMergeConfigExt=ConfigExtension$1<string,string>;
|
|
338
|
+
type TwMergeConfigExt = ConfigExtension$1<string, string>;
|
|
329
339
|
/** * ***Extra options for customized Tailwind class merge.*** */
|
|
330
|
-
type OptionsConfigMergeTwCn={
|
|
331
|
-
/** ----------------------------------------------------------
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
config?:TailwindConfig;
|
|
354
|
-
/** ----------------------------------------------------------
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
prefix?:string;
|
|
340
|
+
type OptionsConfigMergeTwCn = {
|
|
341
|
+
/** ----------------------------------------------------------
|
|
342
|
+
* * ***Optional Tailwind CSS configuration object.***
|
|
343
|
+
* ----------------------------------------------------------
|
|
344
|
+
* - **Pass your project’s `tailwind.config.ts` if you want to:**
|
|
345
|
+
* - Respect custom theme values (`colors`, `fontSize`, `spacing`, `etc`.)
|
|
346
|
+
* - Enable/disable `corePlugins`
|
|
347
|
+
* - Register `plugins`
|
|
348
|
+
* - Extend class groups (e.g., `text-shadow`)
|
|
349
|
+
* - **If omitted, the **default Tailwind config** is used.**
|
|
350
|
+
* @example
|
|
351
|
+
* ```ts
|
|
352
|
+
* import tailwindConfig from "../tailwind.config";
|
|
353
|
+
* import { twMergeDefaultV3 } from "@rzl-zone/utils-js/tailwind";
|
|
354
|
+
*
|
|
355
|
+
* const myCustomTwCls = twMergeDefaultV3({
|
|
356
|
+
* config: tailwindConfig,
|
|
357
|
+
* });
|
|
358
|
+
*
|
|
359
|
+
* myCustomTwCls("text-primary text-secondary");
|
|
360
|
+
* // => "text-secondary" (resolved from your theme config)
|
|
361
|
+
* ```
|
|
362
|
+
*/
|
|
363
|
+
config?: TailwindConfig;
|
|
364
|
+
/** ----------------------------------------------------------
|
|
365
|
+
* * ***Prefix added to Tailwind-generated classes.***
|
|
366
|
+
* ----------------------------------------------------------
|
|
367
|
+
* - **Tailwind v3**:
|
|
368
|
+
* - Configure in `tailwind.config.js`, e.g. `prefix: 'tw-'`.
|
|
369
|
+
* - Variants first; negative utilities: `-mt-8` ➔ `-tw-mt-8`.
|
|
370
|
+
* - Reference:
|
|
371
|
+
* [**`Tailwind v3 using prefix docs`**](https://v3.tailwindcss.com/docs/configuration#prefix).
|
|
372
|
+
* - **Tailwind v4**:
|
|
373
|
+
* - Use {@link twMergeDefaultV4 | **`twMergeDefaultV4`**} instead.
|
|
374
|
+
* - Reference:
|
|
375
|
+
* [**`Tailwind v4 using prefix docs`**](https://tailwindcss.com/docs/upgrade-guide#using-a-prefix).
|
|
376
|
+
* - **ℹ️ Notes**:
|
|
377
|
+
* - Tailwind v3: use hyphenated prefix (`tw-`).
|
|
378
|
+
* - Fallback order:
|
|
379
|
+
* 1. `prefix` option
|
|
380
|
+
* 2. `config.prefix` (if defined)
|
|
381
|
+
* 3. `undefined`
|
|
382
|
+
* - Tailwind v4:
|
|
383
|
+
* - Use {@link twMergeDefaultV4 | **`twMergeDefaultV4`**} instead.
|
|
384
|
+
* @example
|
|
385
|
+
* - Tailwind version 3 (`tailwind.config.ts`):
|
|
386
|
+
* ```ts
|
|
387
|
+
* import type { Config } from "tailwindcss";
|
|
388
|
+
*
|
|
389
|
+
* const config: Config = {
|
|
390
|
+
* prefix: 'tw-',
|
|
391
|
+
* // ... other config
|
|
392
|
+
* };
|
|
393
|
+
*
|
|
394
|
+
* export default config;
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
prefix?: string;
|
|
398
|
+
};
|
|
388
399
|
/** * ***Options type for Tailwind Merge v3 wrapper.*** */
|
|
389
|
-
type OptionsMergeTwClsV3=Omit<TwMergeConfigExt,"prefix"
|
|
400
|
+
type OptionsMergeTwClsV3 = Omit<TwMergeConfigExt, "prefix"> & OptionsConfigMergeTwCn;
|
|
390
401
|
/** * ***Tailwind Merge function Version 3 signature (same as twMerge).*** */
|
|
391
|
-
type TwMergeDefaultFnV3=(...classLists:ClassNameValue$1[])=>string;
|
|
402
|
+
type TwMergeDefaultFnV3 = (...classLists: ClassNameValue$1[]) => string;
|
|
403
|
+
|
|
392
404
|
/** -------------------------------------------------------------
|
|
393
405
|
* * ***Factory utility for building a custom `cn` helper (Tailwind `v3`).***
|
|
394
406
|
* -------------------------------------------------------------
|
|
@@ -426,7 +438,7 @@ type TwMergeDefaultFnV3=(...classLists:ClassNameValue$1[])=>string;
|
|
|
426
438
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
427
439
|
* ```
|
|
428
440
|
*/
|
|
429
|
-
declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3
|
|
441
|
+
declare const customCnV3: (customTwMergeV3: TwMergeDefaultFnV3, ...classes: ClassValues) => string;
|
|
430
442
|
/** -------------------------------------------------------------
|
|
431
443
|
* * ***Factory utility for building a custom `cn` helper (Tailwind `v4`).***
|
|
432
444
|
* -------------------------------------------------------------
|
|
@@ -465,7 +477,8 @@ declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3,...classes:ClassVal
|
|
|
465
477
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
466
478
|
* ```
|
|
467
479
|
*/
|
|
468
|
-
declare const customCnV4:(customTwMergeV4:TwMergeDefaultFnV4
|
|
480
|
+
declare const customCnV4: (customTwMergeV4: TwMergeDefaultFnV4, ...classes: ClassValues) => string;
|
|
481
|
+
|
|
469
482
|
/** ----------------------------------------------------------
|
|
470
483
|
* * ***Utility: `shouldForwardProp`.***
|
|
471
484
|
* ----------------------------------------------------------
|
|
@@ -519,7 +532,8 @@ declare const customCnV4:(customTwMergeV4:TwMergeDefaultFnV4,...classes:ClassVal
|
|
|
519
532
|
* shouldForwardProp: shouldForwardProp<CustomProps>(["$internal"])
|
|
520
533
|
* });
|
|
521
534
|
*/
|
|
522
|
-
declare const shouldForwardProp
|
|
535
|
+
declare const shouldForwardProp: <CustomProps extends Record<string, unknown>>(props: readonly Stringify<keyof CustomProps>[]) => ((propName: keyof CustomProps | ({} & string)) => boolean);
|
|
536
|
+
|
|
523
537
|
/** -------------------------------------------------------------
|
|
524
538
|
* * ***Customized Tailwind class merger Version 3 with extended rules.***
|
|
525
539
|
* -------------------------------------------------------------
|
|
@@ -606,7 +620,8 @@ declare const shouldForwardProp:<CustomProps extends Record<string,unknown>>(pro
|
|
|
606
620
|
* // ➔ "text-xxs" (✅ respects config)
|
|
607
621
|
* ```
|
|
608
622
|
*/
|
|
609
|
-
declare const twMergeDefaultV3:(options?:OptionsMergeTwClsV3)=>TwMergeDefaultFnV3;
|
|
623
|
+
declare const twMergeDefaultV3: (options?: OptionsMergeTwClsV3) => TwMergeDefaultFnV3;
|
|
624
|
+
|
|
610
625
|
/** -------------------------------------------------------------
|
|
611
626
|
* * ***Customized Tailwind class merger Version 4 with extended rules.***
|
|
612
627
|
* -------------------------------------------------------------
|
|
@@ -693,4 +708,6 @@ declare const twMergeDefaultV3:(options?:OptionsMergeTwClsV3)=>TwMergeDefaultFnV
|
|
|
693
708
|
* // ➔ "text-xxs" (✅ respects config)
|
|
694
709
|
* ```
|
|
695
710
|
*/
|
|
696
|
-
declare const twMergeDefaultV4:(options?:OptionsMergeTwClsV4)=>TwMergeDefaultFnV4;
|
|
711
|
+
declare const twMergeDefaultV4: (options?: OptionsMergeTwClsV4) => TwMergeDefaultFnV4;
|
|
712
|
+
|
|
713
|
+
export { type ClassObject, type ClassValue, type ClassValues, cnV3, cnV4, customCnV3, customCnV4, cx, shouldForwardProp, twMergeDefaultV3, twMergeDefaultV4 };
|
package/dist/tailwind/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.11.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
export { cnV3, cnV4, customCnV3, customCnV4, cx, shouldForwardProp, twMergeDefaultV3, twMergeDefaultV4 } from '../chunk-
|
|
11
|
-
import '../chunk-
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
10
|
+
export { cnV3, cnV4, customCnV3, customCnV4, cx, shouldForwardProp, twMergeDefaultV3, twMergeDefaultV4 } from '../chunk-IZGVBYFN.js';
|
|
11
|
+
import '../chunk-ULQPCIA2.js';
|
|
12
|
+
import '../chunk-RZOGBYIS.js';
|
|
13
|
+
import '../chunk-MSUW5VHZ.js';
|
package/dist/urls/index.cjs
CHANGED
|
@@ -2,57 +2,57 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.11.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var chunkJXEIJM5M_cjs = require('../chunk-JXEIJM5M.cjs');
|
|
13
13
|
require('../chunk-KHO2SBNA.cjs');
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
17
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-NVRZPF5M.cjs');
|
|
15
|
+
require('../chunk-U23I7JPB.cjs');
|
|
16
|
+
require('../chunk-RMP7VMPB.cjs');
|
|
17
|
+
require('../chunk-XX6RUGTM.cjs');
|
|
18
18
|
require('../chunk-DVMHRLKP.cjs');
|
|
19
|
-
var
|
|
20
|
-
require('../chunk-
|
|
21
|
-
var
|
|
22
|
-
require('../chunk-
|
|
23
|
-
require('../chunk-
|
|
24
|
-
require('../chunk-
|
|
25
|
-
require('../chunk-
|
|
26
|
-
require('../chunk-
|
|
27
|
-
require('../chunk-
|
|
19
|
+
var chunkHYN6FC5A_cjs = require('../chunk-HYN6FC5A.cjs');
|
|
20
|
+
require('../chunk-M7ELWZXM.cjs');
|
|
21
|
+
var chunkQYI2VJLS_cjs = require('../chunk-QYI2VJLS.cjs');
|
|
22
|
+
require('../chunk-EBYFYZW4.cjs');
|
|
23
|
+
require('../chunk-WLOQQFDS.cjs');
|
|
24
|
+
require('../chunk-WXFTVXBF.cjs');
|
|
25
|
+
require('../chunk-7FGNVDEV.cjs');
|
|
26
|
+
require('../chunk-DLS3G6WQ.cjs');
|
|
27
|
+
require('../chunk-DAPAK2W3.cjs');
|
|
28
28
|
require('../chunk-UDA26MCU.cjs');
|
|
29
|
-
require('../chunk-
|
|
29
|
+
require('../chunk-SYHPSOUU.cjs');
|
|
30
30
|
|
|
31
31
|
Object.defineProperty(exports, "constructURL", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkJXEIJM5M_cjs.constructURL; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "extractURLs", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunkJXEIJM5M_cjs.extractURLs; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "getFirstPrefixPathname", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunkJXEIJM5M_cjs.getFirstPrefixPathname; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "getPrefixPathname", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunkJXEIJM5M_cjs.getPrefixPathname; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "formatEnvPort", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunkHYN6FC5A_cjs.formatEnvPort; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "normalizePathname", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunkHYN6FC5A_cjs.normalizePathname; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "punycodeUtilsJS", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkQYI2VJLS_cjs.punycodeUtilsJS; }
|
|
58
58
|
});
|