@rzl-zone/utils-js 3.6.0 → 3.7.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/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +1 -1
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-2CQI36UD.cjs +1 -1
- package/dist/chunk-2VO2CBTU.js +1 -1
- package/dist/chunk-3KTD3QDI.js +1 -1
- package/dist/{chunk-RS5RBLPB.js → chunk-3LEWQV3R.js} +46 -8
- package/dist/chunk-4ACKNPL5.js +1 -1
- package/dist/chunk-4ZOXSUXB.js +1 -1
- package/dist/chunk-5NN4ZDE2.cjs +1 -1
- package/dist/chunk-66WLOZOD.cjs +1 -1
- package/dist/chunk-6PKW4WCT.js +1 -1
- package/dist/chunk-6RFNZ2ZZ.cjs +1 -1
- package/dist/chunk-6WMB5AJR.js +1 -1
- package/dist/chunk-7QQV66RX.cjs +1 -1
- package/dist/chunk-7WBMA2VE.cjs +1 -1
- package/dist/chunk-7ZNEUWYP.js +1 -1
- package/dist/chunk-A3YI6Y2P.js +1 -1
- package/dist/chunk-ABA2ZSBQ.js +1 -1
- package/dist/chunk-AKKM6MOX.cjs +1 -1
- package/dist/chunk-ATLFMKAF.cjs +1 -1
- package/dist/chunk-B4SDEBN7.cjs +1 -1
- package/dist/chunk-B6UIKBHR.cjs +1 -1
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/chunk-BG3AS5BU.cjs +1 -1
- package/dist/chunk-BYUT376O.cjs +1 -1
- package/dist/chunk-CKUEZF4R.cjs +1 -1
- package/dist/chunk-D53CE4BT.js +1 -1
- package/dist/chunk-DPLL67OT.js +1 -1
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/chunk-EK7FSI7F.cjs +1 -1
- package/dist/chunk-F3WBQKRI.cjs +1 -1
- package/dist/chunk-FI76UZRF.js +1 -1
- package/dist/chunk-GAJBF6DR.js +1 -1
- package/dist/chunk-JY4HLZ4W.js +1 -1
- package/dist/chunk-K3SONK25.cjs +1 -1
- package/dist/chunk-K63WO3XA.cjs +1 -1
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/{chunk-TPYENEQ4.cjs → chunk-KIYALQQF.cjs} +44 -9
- package/dist/chunk-KPCDDYTZ.js +1 -1
- package/dist/chunk-KTQLDIIT.cjs +1 -1
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/chunk-LEX4TQW2.js +1 -1
- package/dist/chunk-LIU4S3JA.cjs +1 -1
- package/dist/chunk-NREACG6M.cjs +1 -1
- package/dist/chunk-OFBFGFVH.js +1 -1
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/chunk-OS5OT5JA.cjs +1 -1
- package/dist/chunk-PZQC3FZY.js +1 -1
- package/dist/chunk-QAPYHLHC.cjs +1 -1
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/chunk-QUITZ3GP.js +1 -1
- package/dist/chunk-R3PBF6F7.cjs +1 -1
- package/dist/chunk-RMJC3B5P.cjs +1 -1
- package/dist/chunk-SZJ7OI4S.js +1 -1
- package/dist/chunk-TDPYR5JY.js +1 -1
- package/dist/chunk-TDYGYHSH.js +1 -1
- package/dist/chunk-TFDXRT6D.cjs +1 -1
- package/dist/chunk-U5VR4TJN.js +1 -1
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/chunk-UKAUXY2U.cjs +1 -1
- package/dist/chunk-VCVND6CH.js +1 -1
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/chunk-VJVCXEH7.cjs +1 -1
- package/dist/chunk-VNADVWSJ.js +1 -1
- package/dist/chunk-WNO3EPYT.js +1 -1
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/chunk-XFTUHS4Y.js +1 -1
- package/dist/chunk-YC7AK3KX.cjs +1 -1
- package/dist/chunk-YGB2BQPB.cjs +1 -1
- package/dist/chunk-YS27V6LS.js +1 -1
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/chunk-ZN53RM3R.js +1 -1
- package/dist/conversions/index.cjs +1 -1
- package/dist/conversions/index.d.ts +1 -1
- package/dist/conversions/index.js +1 -1
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +1 -1
- package/dist/formatters/index.cjs +1 -1
- package/dist/formatters/index.d.ts +1 -1
- package/dist/formatters/index.js +1 -1
- package/dist/generators/index.cjs +1 -1
- package/dist/generators/index.d.ts +1 -1
- package/dist/generators/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/isPlainObject-FWmcJF6k.d.ts +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +1 -1
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +1 -1
- package/dist/next/server/index.js +1 -1
- package/dist/operations/index.cjs +1 -1
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +1 -1
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +1 -1
- package/dist/predicates/index.js +1 -1
- package/dist/promises/index.cjs +1 -1
- package/dist/promises/index.d.ts +1 -1
- package/dist/promises/index.js +1 -1
- package/dist/rzl-utils.global.js +1 -1
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/tailwind/index.cjs +13 -9
- package/dist/tailwind/index.d.ts +124 -19
- package/dist/tailwind/index.js +2 -2
- package/dist/urls/index.cjs +1 -1
- package/dist/urls/index.d.ts +1 -1
- package/dist/urls/index.js +1 -1
- package/package.json +1 -2
package/dist/strings/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.7.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
package/dist/tailwind/index.cjs
CHANGED
|
@@ -2,43 +2,47 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.7.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 chunkKIYALQQF_cjs = require('../chunk-KIYALQQF.cjs');
|
|
13
13
|
require('../chunk-NREACG6M.cjs');
|
|
14
14
|
require('../chunk-7WBMA2VE.cjs');
|
|
15
15
|
require('../chunk-F3WBQKRI.cjs');
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(exports, "cnV3", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkKIYALQQF_cjs.cnV3; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "cnV4", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkKIYALQQF_cjs.cnV4; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "customCnV3", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkKIYALQQF_cjs.customCnV3; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "customCnV4", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkKIYALQQF_cjs.customCnV4; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "cx", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkKIYALQQF_cjs.cx; }
|
|
32
36
|
});
|
|
33
37
|
Object.defineProperty(exports, "shouldForwardProp", {
|
|
34
38
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkKIYALQQF_cjs.shouldForwardProp; }
|
|
36
40
|
});
|
|
37
41
|
Object.defineProperty(exports, "twMergeDefaultV3", {
|
|
38
42
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkKIYALQQF_cjs.twMergeDefaultV3; }
|
|
40
44
|
});
|
|
41
45
|
Object.defineProperty(exports, "twMergeDefaultV4", {
|
|
42
46
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkKIYALQQF_cjs.twMergeDefaultV4; }
|
|
44
48
|
});
|
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -2,12 +2,117 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.7.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import{
|
|
10
|
+
import{Config}from'tailwindcss';import{ClassNameValue as ClassNameValue$1,ConfigExtension as ConfigExtension$1}from'tailwind-merge-v3';import{ClassNameValue,ConfigExtension}from'tailwind-merge-v4';import{Stringify}from'@rzl-zone/ts-types-plus';
|
|
11
|
+
/** ----------------------------------------------------------
|
|
12
|
+
* * ***Type-Utility: `ClassValue`.***
|
|
13
|
+
* ----------------------------------------------------------
|
|
14
|
+
* **Represents a single valid value that can be converted to a CSS class string.**
|
|
15
|
+
* @description
|
|
16
|
+
* - Supports the following types:
|
|
17
|
+
* - `string` → literal class names (non-empty only)
|
|
18
|
+
* - `number | bigint` → numeric class names
|
|
19
|
+
* - `boolean` → only `true` is considered in objects/arrays
|
|
20
|
+
* - `null | undefined` → ignored
|
|
21
|
+
* - `ClassObject` → objects where **keys with truthy values** are included
|
|
22
|
+
* - `ClassValues` → arrays recursively flattened
|
|
23
|
+
* - Used internally by **{@link cx | `cx`}** to process mixed input values.
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const val1: ClassValue = "button"; // ➔ string
|
|
27
|
+
* const val2: ClassValue = 0; // ➔ number
|
|
28
|
+
* const val3: ClassValue = ["a", { b: true }]; // ➔ array with object
|
|
29
|
+
* const val4: ClassValue = { d: true, e: false }; // ➔ object
|
|
30
|
+
* const val5: ClassValue = new String("foo"); // ➔ boxed string
|
|
31
|
+
* const val6: ClassValue = new Number("123"); // ➔ boxed number
|
|
32
|
+
* const val7: ClassValue = new Boolean("true"); // ➔ boxed boolean
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
type ClassValue=ClassValues|ClassObject|string|number|bigint|null|boolean|undefined;
|
|
36
|
+
/** ----------------------------------------------------------
|
|
37
|
+
* * ***Type-Utility: `ClassObject`.***
|
|
38
|
+
* ----------------------------------------------------------
|
|
39
|
+
* **Represents an object whose keys with truthy values are included in the final class string.**
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const obj: ClassObject = { "text-red": true, "hidden": false };
|
|
43
|
+
* // ➔ "text-red" when processed by cx
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
type ClassObject=Record<string,any>;
|
|
47
|
+
/** ----------------------------------------------------------
|
|
48
|
+
* * ***Type-Utility: `ClassValues`.***
|
|
49
|
+
* ----------------------------------------------------------
|
|
50
|
+
* **Represents an array of {@link ClassValue | `ClassValue's`}, potentially nested.**
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const arr: ClassValues = [
|
|
54
|
+
* "a",
|
|
55
|
+
* 1,
|
|
56
|
+
* ["b", { c: true, d: false }],
|
|
57
|
+
* { e: 2 }
|
|
58
|
+
* ];
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
type ClassValues=ClassValue[];
|
|
62
|
+
/** ----------------------------------------------------------
|
|
63
|
+
* * ***Utility: `cx`.***
|
|
64
|
+
* ----------------------------------------------------------
|
|
65
|
+
* **Merge multiple class values into a single, space-separated string suitable for CSS usage.**
|
|
66
|
+
* @param {ClassValues} args
|
|
67
|
+
* A list of mixed class values, which can include:
|
|
68
|
+
* - **Strings** → literal class names.
|
|
69
|
+
* - **Numbers** → numeric class names.
|
|
70
|
+
* - **BigInt** → numeric class names larger than JS safe integer limit.
|
|
71
|
+
* - **Arrays** → recursively flattened, can contain nested arrays or objects.
|
|
72
|
+
* - **Objects** → include keys whose values are truthy. Inherited keys are also included.
|
|
73
|
+
* - **Boxed primitives** (`new String()`, `new Number()`, `new Boolean()`) → automatically unwrapped.
|
|
74
|
+
* - **Falsy values** (`false`, `null`, `undefined`, `""`, `0`) are ignored according to original behavior.
|
|
75
|
+
* @returns {string}
|
|
76
|
+
* A single space-separated string containing all valid class names.
|
|
77
|
+
* @description
|
|
78
|
+
* - Supports **nested combinations** of arrays and objects, recursively.
|
|
79
|
+
* - **Falsy values** are skipped:
|
|
80
|
+
* - `false`, `null`, `undefined`, empty strings `""` are ignored anywhere.
|
|
81
|
+
* - Numbers `0` are ignored inside nested arrays/objects.
|
|
82
|
+
* - **Boxed primitives** are correctly unwrapped to their primitive value.
|
|
83
|
+
* - **Inherited object keys** are included in the final class string.
|
|
84
|
+
* - Optimized for **CSS class merging** where conditional inclusion is common.
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* // Basic string merge
|
|
88
|
+
* cx("btn", "btn-primary");
|
|
89
|
+
* // ➔ "btn btn-primary"
|
|
90
|
+
*
|
|
91
|
+
* // Mixed arrays and objects
|
|
92
|
+
* cx("a", ["b", { c: true, d: false }], { e: 1, f: 0 }, null, 2);
|
|
93
|
+
* // ➔ "a b c e 2"
|
|
94
|
+
*
|
|
95
|
+
* // Empty and falsy values are ignored
|
|
96
|
+
* cx("", null, undefined, false, 0);
|
|
97
|
+
* // ➔ ""
|
|
98
|
+
*
|
|
99
|
+
* // Nested arrays with objects
|
|
100
|
+
* cx(["a", ["b", { c: true, d: false }]]);
|
|
101
|
+
* // ➔ "a b c"
|
|
102
|
+
*
|
|
103
|
+
* // Boxed primitives are unwrapped
|
|
104
|
+
* cx(new String("foo"), new Number(42), new Boolean(true), new Number(0), new Boolean(false));
|
|
105
|
+
* // ➔ "foo 42 true"
|
|
106
|
+
*
|
|
107
|
+
* // Inherited keys from objects are included
|
|
108
|
+
* const proto = { inherited: true };
|
|
109
|
+
* const obj = Object.create(proto);
|
|
110
|
+
* obj.own = true;
|
|
111
|
+
* cx(obj);
|
|
112
|
+
* // ➔ "own inherited"
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare function cx(...args:ClassValues):string;
|
|
11
116
|
/** -------------------------------------------------------------
|
|
12
117
|
* * ***Default `cnV3` utility (Tailwind v3).***
|
|
13
118
|
* -------------------------------------------------------------
|
|
@@ -21,7 +126,7 @@ import{ClassValue}from'clsx';import{Config}from'tailwindcss';import{ClassNameVal
|
|
|
21
126
|
* - Create a project-wide helper using
|
|
22
127
|
* {@link twMergeDefaultV3 | `twMergeDefaultV3`} +
|
|
23
128
|
* {@link customCnV3 | `customCnV3`} (see Example 2).
|
|
24
|
-
* @param {
|
|
129
|
+
* @param {ClassValues} classes - Class values (`string`, `array`, `object`, `etc`).
|
|
25
130
|
* @returns {string} Merged Tailwind class string.
|
|
26
131
|
* @example
|
|
27
132
|
* #### Example 1: ✅ Default usage (Tailwind v3).
|
|
@@ -38,9 +143,9 @@ import{ClassValue}from'clsx';import{Config}from'tailwindcss';import{ClassNameVal
|
|
|
38
143
|
* #### Example 2: ⚡ Custom project-wide usage with Tailwind config.
|
|
39
144
|
* ```ts
|
|
40
145
|
* import tailwindConfig from "../tailwind.config";
|
|
41
|
-
* import { twMergeDefaultV3, customCnV3, type
|
|
146
|
+
* import { twMergeDefaultV3, customCnV3, type ClassValues } from "@rzl-zone/utils-js/tailwind";
|
|
42
147
|
*
|
|
43
|
-
* const cnApp = (...classes:
|
|
148
|
+
* const cnApp = (...classes: ClassValues) => {
|
|
44
149
|
* return customCnV3(
|
|
45
150
|
* twMergeDefaultV3({
|
|
46
151
|
* config: tailwindConfig,
|
|
@@ -63,7 +168,7 @@ import{ClassValue}from'clsx';import{Config}from'tailwindcss';import{ClassNameVal
|
|
|
63
168
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
64
169
|
* ```
|
|
65
170
|
*/
|
|
66
|
-
declare const cnV3:(...classes:
|
|
171
|
+
declare const cnV3:(...classes:ClassValues)=>string;
|
|
67
172
|
/** -------------------------------------------------------------
|
|
68
173
|
* * ***Default `cnV4` utility (Tailwind v4).***
|
|
69
174
|
* -------------------------------------------------------------
|
|
@@ -77,7 +182,7 @@ declare const cnV3:(...classes:ClassesValue)=>string;
|
|
|
77
182
|
* - Create a project-wide helper using
|
|
78
183
|
* {@link twMergeDefaultV4 | `twMergeDefaultV4`} +
|
|
79
184
|
* {@link customCnV4 | `customCnV4`} (see Example 2).
|
|
80
|
-
* @param {
|
|
185
|
+
* @param {ClassValues} classes - Class values (`string`, `array`, `object`, `etc`).
|
|
81
186
|
* @returns {string} Merged Tailwind class string.
|
|
82
187
|
* @example
|
|
83
188
|
* #### Example 1: ✅ Default usage (Tailwind v4).
|
|
@@ -94,9 +199,9 @@ declare const cnV3:(...classes:ClassesValue)=>string;
|
|
|
94
199
|
* #### Example 2: ⚡ Custom project-wide usage with Tailwind config.
|
|
95
200
|
* ```ts
|
|
96
201
|
* import tailwindConfig from "../tailwind.config";
|
|
97
|
-
* import { twMergeDefaultV4, customCnV4, type
|
|
202
|
+
* import { twMergeDefaultV4, customCnV4, type ClassValues } from "@rzl-zone/utils-js/tailwind";
|
|
98
203
|
*
|
|
99
|
-
* const cnApp = (...classes:
|
|
204
|
+
* const cnApp = (...classes: ClassValues) => {
|
|
100
205
|
* return customCnV4(
|
|
101
206
|
* twMergeDefaultV4({
|
|
102
207
|
* config: tailwindConfig,
|
|
@@ -119,7 +224,7 @@ declare const cnV3:(...classes:ClassesValue)=>string;
|
|
|
119
224
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
120
225
|
* ```
|
|
121
226
|
*/
|
|
122
|
-
declare const cnV4:(...classes:
|
|
227
|
+
declare const cnV4:(...classes:ClassValues)=>string;
|
|
123
228
|
/** Tailwind Merge config extension type */
|
|
124
229
|
type TwMergeConfigExt$1=ConfigExtension<string,string>;
|
|
125
230
|
/** * ***Extra options for customized Tailwind class merge.*** */
|
|
@@ -294,12 +399,12 @@ type TwMergeDefaultFnV3=(...classLists:ClassNameValue$1[])=>string;
|
|
|
294
399
|
* - You extend Tailwind merge rules (`classGroups`, `tailwind.config`).
|
|
295
400
|
* - You need multiple `cn*` variants across apps/packages.
|
|
296
401
|
* @param {TwMergeDefaultFnV3} customTwMergeV3 - Merge function created via {@link twMergeDefaultV3 | `twMergeDefaultV3`}.
|
|
297
|
-
* @param {
|
|
402
|
+
* @param {ClassValues} classes - Class values (`string`, `array`, `object`, `etc`).
|
|
298
403
|
* @returns {string} Merged Tailwind class string.
|
|
299
404
|
* @example
|
|
300
405
|
* ```ts
|
|
301
406
|
* import tailwindConfig from "../tailwind.config";
|
|
302
|
-
* import { twMergeDefaultV3, customCnV3, type
|
|
407
|
+
* import { twMergeDefaultV3, customCnV3, type ClassValues } from "@rzl-zone/utils-js/tailwind";
|
|
303
408
|
*
|
|
304
409
|
* // 1. Create a custom merge function
|
|
305
410
|
* const myCustomTwMerge = twMergeDefaultV3({
|
|
@@ -312,7 +417,7 @@ type TwMergeDefaultFnV3=(...classLists:ClassNameValue$1[])=>string;
|
|
|
312
417
|
* });
|
|
313
418
|
*
|
|
314
419
|
* // 2. Build your helper using `customCnV3`
|
|
315
|
-
* export const cnApp = (...classes:
|
|
420
|
+
* export const cnApp = (...classes: ClassValues) => {
|
|
316
421
|
* return customCnV3(myCustomTwMerge, ...classes);
|
|
317
422
|
* };
|
|
318
423
|
* // ✅ Usage
|
|
@@ -321,7 +426,7 @@ type TwMergeDefaultFnV3=(...classLists:ClassNameValue$1[])=>string;
|
|
|
321
426
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
322
427
|
* ```
|
|
323
428
|
*/
|
|
324
|
-
declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3,...classes:
|
|
429
|
+
declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3,...classes:ClassValues)=>string;
|
|
325
430
|
/** -------------------------------------------------------------
|
|
326
431
|
* * ***Factory utility for building a custom `cn` helper (Tailwind `v4`).***
|
|
327
432
|
* -------------------------------------------------------------
|
|
@@ -332,12 +437,12 @@ declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3,...classes:ClassesV
|
|
|
332
437
|
* - You extend Tailwind merge rules (`classGroups`, `tailwind.config`).
|
|
333
438
|
* - You need multiple `cn*` variants across apps/packages.
|
|
334
439
|
* @param {TwMergeDefaultFnV4} customTwMergeV4 - Merge function created via {@link twMergeDefaultV4 | `twMergeDefaultV4`}.
|
|
335
|
-
* @param {
|
|
440
|
+
* @param {ClassValues} classes - Class values (`string`, `array`, `object`, `etc`).
|
|
336
441
|
* @returns {string} Merged Tailwind class string.
|
|
337
442
|
* @example
|
|
338
443
|
* ```ts
|
|
339
444
|
* import tailwindConfig from "../tailwind.config";
|
|
340
|
-
* import { twMergeDefaultV4, customCnV4, type
|
|
445
|
+
* import { twMergeDefaultV4, customCnV4, type ClassValues } from "@rzl-zone/utils-js/tailwind";
|
|
341
446
|
*
|
|
342
447
|
* // 1. Create a custom merge function
|
|
343
448
|
* const myCustomTwMerge = twMergeDefaultV4({
|
|
@@ -350,7 +455,7 @@ declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3,...classes:ClassesV
|
|
|
350
455
|
* });
|
|
351
456
|
*
|
|
352
457
|
* // 2. Build your helper using `customCnV4`
|
|
353
|
-
* export const cnApp = (...classes:
|
|
458
|
+
* export const cnApp = (...classes: ClassValues) => {
|
|
354
459
|
* return customCnV4(myCustomTwMerge, ...classes);
|
|
355
460
|
* };
|
|
356
461
|
*
|
|
@@ -360,7 +465,7 @@ declare const customCnV3:(customTwMergeV3:TwMergeDefaultFnV3,...classes:ClassesV
|
|
|
360
465
|
* cnApp("text-base text-xxs"); // ➔ "text-xxs" (resolved from config)
|
|
361
466
|
* ```
|
|
362
467
|
*/
|
|
363
|
-
declare const customCnV4:(customTwMergeV4:TwMergeDefaultFnV4,...classes:
|
|
468
|
+
declare const customCnV4:(customTwMergeV4:TwMergeDefaultFnV4,...classes:ClassValues)=>string;
|
|
364
469
|
/** ----------------------------------------------------------
|
|
365
470
|
* * ***Utility: `shouldForwardProp`.***
|
|
366
471
|
* ----------------------------------------------------------
|
|
@@ -588,4 +693,4 @@ declare const twMergeDefaultV3:(options?:OptionsMergeTwClsV3)=>TwMergeDefaultFnV
|
|
|
588
693
|
* // ➔ "text-xxs" (✅ respects config)
|
|
589
694
|
* ```
|
|
590
695
|
*/
|
|
591
|
-
declare const twMergeDefaultV4:(options?:OptionsMergeTwClsV4)=>TwMergeDefaultFnV4;export{type
|
|
696
|
+
declare const twMergeDefaultV4:(options?:OptionsMergeTwClsV4)=>TwMergeDefaultFnV4;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.7.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, shouldForwardProp, twMergeDefaultV3, twMergeDefaultV4 } from '../chunk-
|
|
10
|
+
export { cnV3, cnV4, customCnV3, customCnV4, cx, shouldForwardProp, twMergeDefaultV3, twMergeDefaultV4 } from '../chunk-3LEWQV3R.js';
|
|
11
11
|
import '../chunk-JY4HLZ4W.js';
|
|
12
12
|
import '../chunk-6WMB5AJR.js';
|
|
13
13
|
import '../chunk-3KTD3QDI.js';
|
package/dist/urls/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.7.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
package/dist/urls/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.7.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
package/dist/urls/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.7.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rzl-zone/utils-js",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@rzl-zone/ts-types-plus": "latest",
|
|
22
|
-
"clsx": "^2.1.1",
|
|
23
22
|
"date-fns": "^4.1.0",
|
|
24
23
|
"libphonenumber-js": "^1.12.17",
|
|
25
24
|
"server-only": "^0.0.1",
|