@pequity/squirrel 11.0.1 → 11.0.3

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.
Files changed (32) hide show
  1. package/dist/cjs/chunks/index.js +374 -216
  2. package/dist/cjs/chunks/p-btn.js +1 -1
  3. package/dist/cjs/dateLocale.js +1221 -280
  4. package/dist/cjs/index.js +19 -8
  5. package/dist/cjs/inputClasses.js +3 -3
  6. package/dist/es/chunks/index.js +374 -216
  7. package/dist/es/chunks/p-btn.js +2 -2
  8. package/dist/es/dateLocale.js +1221 -280
  9. package/dist/es/index.js +48 -37
  10. package/dist/es/inputClasses.js +4 -4
  11. package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -2
  12. package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -2
  13. package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -1
  14. package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +2 -2
  15. package/package.json +31 -31
  16. package/squirrel/components/p-btn/p-btn.spec.js +15 -5
  17. package/squirrel/components/p-drawer/p-drawer.spec.js +16 -11
  18. package/squirrel/components/p-dropdown/p-dropdown.spec.js +15 -10
  19. package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +44 -27
  20. package/squirrel/components/p-pagination/p-pagination.spec.js +22 -30
  21. package/squirrel/components/p-select-btn/p-select-btn.spec.js +35 -27
  22. package/squirrel/components/p-select-list/p-select-list.spec.js +44 -27
  23. package/squirrel/components/p-select-pill/p-select-pill.spec.js +7 -6
  24. package/squirrel/components/p-table/p-table.spec.js +50 -43
  25. package/squirrel/components/p-tabs-pills/p-tabs-pills.spec.js +10 -8
  26. package/squirrel/locales/de-DE.json +47 -0
  27. package/squirrel/locales/es-ES.json +47 -0
  28. package/squirrel/plugin/index.spec.ts +32 -12
  29. package/squirrel/plugin/index.ts +6 -2
  30. package/squirrel/utils/dateLocale.spec.ts +9 -5
  31. package/squirrel/utils/dateLocale.ts +7 -3
  32. /package/squirrel/locales/{fr-CA.json → fr-FR.json} +0 -0
@@ -1,239 +1,373 @@
1
- var y = /\s+/g, a = (t) => typeof t != "string" || !t ? t : t.replace(y, " ").trim(), u = (...t) => {
2
- let r = [], n = (e) => {
3
- if (!e && e !== 0 && e !== 0n) return;
4
- if (Array.isArray(e)) {
5
- for (let s = 0, o = e.length; s < o; s++) n(e[s]);
1
+ var SPACE_REGEX = /\s+/g;
2
+ var removeExtraSpaces = (str) => {
3
+ if (typeof str !== "string" || !str) return str;
4
+ return str.replace(SPACE_REGEX, " ").trim();
5
+ };
6
+ var cx = (...classnames) => {
7
+ const classList = [];
8
+ const buildClassString = (input) => {
9
+ if (!input && input !== 0 && input !== 0n) return;
10
+ if (Array.isArray(input)) {
11
+ for (let i = 0, len = input.length; i < len; i++) buildClassString(input[i]);
6
12
  return;
7
13
  }
8
- let f2 = typeof e;
9
- if (f2 === "string" || f2 === "number" || f2 === "bigint") {
10
- if (f2 === "number" && e !== e) return;
11
- r.push(String(e));
12
- } else if (f2 === "object") {
13
- let s = Object.keys(e);
14
- for (let o = 0, i2 = s.length; o < i2; o++) {
15
- let l = s[o];
16
- e[l] && r.push(l);
14
+ const type = typeof input;
15
+ if (type === "string" || type === "number" || type === "bigint") {
16
+ if (type === "number" && input !== input) return;
17
+ classList.push(String(input));
18
+ } else if (type === "object") {
19
+ const keys = Object.keys(input);
20
+ for (let i = 0, len = keys.length; i < len; i++) {
21
+ const key = keys[i];
22
+ if (input[key]) classList.push(key);
17
23
  }
18
24
  }
19
25
  };
20
- for (let e = 0, f2 = t.length; e < f2; e++) {
21
- let s = t[e];
22
- s != null && n(s);
26
+ for (let i = 0, len = classnames.length; i < len; i++) {
27
+ const c = classnames[i];
28
+ if (c !== null && c !== void 0) buildClassString(c);
23
29
  }
24
- return r.length > 0 ? a(r.join(" ")) : void 0;
25
- }, h = (t) => t === false ? "false" : t === true ? "true" : t === 0 ? "0" : t, x = (t) => {
26
- if (!t || typeof t != "object") return true;
27
- for (let r in t) return false;
30
+ return classList.length > 0 ? removeExtraSpaces(classList.join(" ")) : void 0;
31
+ };
32
+ var falsyToString = (value) => value === false ? "false" : value === true ? "true" : value === 0 ? "0" : value;
33
+ var isEmptyObject = (obj) => {
34
+ if (!obj || typeof obj !== "object") return true;
35
+ for (const _ in obj) return false;
28
36
  return true;
29
- }, k = (t, r) => {
30
- if (t === r) return true;
31
- if (!t || !r) return false;
32
- let n = Object.keys(t), e = Object.keys(r);
33
- if (n.length !== e.length) return false;
34
- for (let f2 = 0; f2 < n.length; f2++) {
35
- let s = n[f2];
36
- if (!e.includes(s) || t[s] !== r[s]) return false;
37
+ };
38
+ var isEqual = (obj1, obj2) => {
39
+ if (obj1 === obj2) return true;
40
+ if (!obj1 || !obj2) return false;
41
+ const keys1 = Object.keys(obj1);
42
+ const keys2 = Object.keys(obj2);
43
+ if (keys1.length !== keys2.length) return false;
44
+ for (let i = 0; i < keys1.length; i++) {
45
+ const key = keys1[i];
46
+ if (!keys2.includes(key)) return false;
47
+ if (obj1[key] !== obj2[key]) return false;
37
48
  }
38
49
  return true;
39
- }, d = (t, r) => {
40
- for (let n in r) if (Object.prototype.hasOwnProperty.call(r, n)) {
41
- let e = r[n];
42
- n in t ? t[n] = u(t[n], e) : t[n] = e;
50
+ };
51
+ var joinObjects = (obj1, obj2) => {
52
+ for (const key in obj2) {
53
+ if (Object.prototype.hasOwnProperty.call(obj2, key)) {
54
+ const val2 = obj2[key];
55
+ if (key in obj1) {
56
+ obj1[key] = cx(obj1[key], val2);
57
+ } else {
58
+ obj1[key] = val2;
59
+ }
60
+ }
43
61
  }
44
- return t;
45
- }, c = (t, r) => {
46
- for (let n = 0; n < t.length; n++) {
47
- let e = t[n];
48
- Array.isArray(e) ? c(e, r) : e && r.push(e);
62
+ return obj1;
63
+ };
64
+ var flat = (arr, target) => {
65
+ for (let i = 0; i < arr.length; i++) {
66
+ const el = arr[i];
67
+ if (Array.isArray(el)) flat(el, target);
68
+ else if (el) target.push(el);
49
69
  }
50
70
  };
51
- var g = (...t) => {
52
- let r = [];
53
- c(t, r);
54
- let n = [];
55
- for (let e = 0; e < r.length; e++) r[e] && n.push(r[e]);
56
- return n;
57
- }, p = (t, r) => {
58
- let n = {};
59
- for (let e in t) {
60
- let f2 = t[e];
61
- if (e in r) {
62
- let s = r[e];
63
- Array.isArray(f2) || Array.isArray(s) ? n[e] = g(s, f2) : typeof f2 == "object" && typeof s == "object" && f2 && s ? n[e] = p(f2, s) : n[e] = s + " " + f2;
64
- } else n[e] = f2;
71
+ var flatMergeArrays = (...arrays) => {
72
+ const result = [];
73
+ flat(arrays, result);
74
+ const filtered = [];
75
+ for (let i = 0; i < result.length; i++) {
76
+ if (result[i]) filtered.push(result[i]);
65
77
  }
66
- for (let e in r) e in t || (n[e] = r[e]);
67
- return n;
78
+ return filtered;
68
79
  };
69
- var Q = { twMerge: true, twMergeConfig: {}, responsiveVariants: false };
70
- function ne() {
71
- let b = null, w = {}, A = false;
72
- return { get cachedTwMerge() {
73
- return b;
74
- }, set cachedTwMerge(u2) {
75
- b = u2;
76
- }, get cachedTwMergeConfig() {
77
- return w;
78
- }, set cachedTwMergeConfig(u2) {
79
- w = u2;
80
- }, get didTwMergeConfigChange() {
81
- return A;
82
- }, set didTwMergeConfigChange(u2) {
83
- A = u2;
84
- }, reset() {
85
- b = null, w = {}, A = false;
86
- } };
80
+ var mergeObjects = (obj1, obj2) => {
81
+ const result = {};
82
+ for (const key in obj1) {
83
+ const val1 = obj1[key];
84
+ if (key in obj2) {
85
+ const val2 = obj2[key];
86
+ if (Array.isArray(val1) || Array.isArray(val2)) {
87
+ result[key] = flatMergeArrays(val2, val1);
88
+ } else if (typeof val1 === "object" && typeof val2 === "object" && val1 && val2) {
89
+ result[key] = mergeObjects(val1, val2);
90
+ } else {
91
+ result[key] = val2 + " " + val1;
92
+ }
93
+ } else {
94
+ result[key] = val1;
95
+ }
96
+ }
97
+ for (const key in obj2) {
98
+ if (!(key in obj1)) {
99
+ result[key] = obj2[key];
100
+ }
101
+ }
102
+ return result;
103
+ };
104
+ var defaultConfig = {
105
+ twMerge: true,
106
+ twMergeConfig: {}
107
+ };
108
+ function createState() {
109
+ let cachedTwMerge = null;
110
+ let cachedTwMergeConfig = {};
111
+ let didTwMergeConfigChange = false;
112
+ return {
113
+ get cachedTwMerge() {
114
+ return cachedTwMerge;
115
+ },
116
+ set cachedTwMerge(value) {
117
+ cachedTwMerge = value;
118
+ },
119
+ get cachedTwMergeConfig() {
120
+ return cachedTwMergeConfig;
121
+ },
122
+ set cachedTwMergeConfig(value) {
123
+ cachedTwMergeConfig = value;
124
+ },
125
+ get didTwMergeConfigChange() {
126
+ return didTwMergeConfigChange;
127
+ },
128
+ set didTwMergeConfigChange(value) {
129
+ didTwMergeConfigChange = value;
130
+ },
131
+ reset() {
132
+ cachedTwMerge = null;
133
+ cachedTwMergeConfig = {};
134
+ didTwMergeConfigChange = false;
135
+ }
136
+ };
87
137
  }
88
- var S = ne();
89
- var le = (b$1) => {
90
- let w = (u$1, $) => {
91
- let { extend: c$1 = null, slots: M = {}, variants: q = {}, compoundVariants: L = [], compoundSlots: v = [], defaultVariants: U = {} } = u$1, d$1 = { ...Q, ...$ }, x$1 = c$1?.base ? u(c$1.base, u$1?.base) : u$1?.base, p$1 = c$1?.variants && !x(c$1.variants) ? p(q, c$1.variants) : q, E = c$1?.defaultVariants && !x(c$1.defaultVariants) ? { ...c$1.defaultVariants, ...U } : U;
92
- !x(d$1.twMergeConfig) && !k(d$1.twMergeConfig, S.cachedTwMergeConfig) && (S.didTwMergeConfigChange = true, S.cachedTwMergeConfig = d$1.twMergeConfig);
93
- let N = x(c$1?.slots), O = x(M) ? {} : { base: u(u$1?.base, N && c$1?.base), ...M }, j$1 = N ? O : d({ ...c$1?.slots }, x(O) ? { base: u$1?.base } : O), T2 = x(c$1?.compoundVariants) ? L : g(c$1?.compoundVariants, L), y2 = (h$1) => {
94
- if (x(p$1) && x(M) && N) return b$1(x$1, h$1?.class, h$1?.className)(d$1);
95
- if (T2 && !Array.isArray(T2)) throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof T2}`);
96
- if (v && !Array.isArray(v)) throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof v}`);
97
- let Y = (t, e, n = [], a$1) => {
98
- let r = n;
99
- if (typeof e == "string") {
100
- let i2 = a(e).split(" ");
101
- for (let l = 0; l < i2.length; l++) r.push(`${t}:${i2[l]}`);
102
- } else if (Array.isArray(e)) for (let s = 0; s < e.length; s++) r.push(`${t}:${e[s]}`);
103
- else if (typeof e == "object" && typeof a$1 == "string" && a$1 in e) {
104
- let s = e[a$1];
105
- if (s && typeof s == "string") {
106
- let l = a(s).split(" "), f2 = [];
107
- for (let o = 0; o < l.length; o++) f2.push(`${t}:${l[o]}`);
108
- r[a$1] = r[a$1] ? r[a$1].concat(f2) : f2;
109
- } else if (Array.isArray(s) && s.length > 0) {
110
- let i2 = [];
111
- for (let l = 0; l < s.length; l++) i2.push(`${t}:${s[l]}`);
112
- r[a$1] = i2;
113
- }
138
+ var state = createState();
139
+ var getTailwindVariants = (cn2) => {
140
+ const tv2 = (options, configProp) => {
141
+ const {
142
+ extend = null,
143
+ slots: slotProps = {},
144
+ variants: variantsProps = {},
145
+ compoundVariants: compoundVariantsProps = [],
146
+ compoundSlots = [],
147
+ defaultVariants: defaultVariantsProps = {}
148
+ } = options;
149
+ const config = { ...defaultConfig, ...configProp };
150
+ const base = extend?.base ? cx(extend.base, options?.base) : options?.base;
151
+ const variants = extend?.variants && !isEmptyObject(extend.variants) ? mergeObjects(variantsProps, extend.variants) : variantsProps;
152
+ const defaultVariants = extend?.defaultVariants && !isEmptyObject(extend.defaultVariants) ? { ...extend.defaultVariants, ...defaultVariantsProps } : defaultVariantsProps;
153
+ if (!isEmptyObject(config.twMergeConfig) && !isEqual(config.twMergeConfig, state.cachedTwMergeConfig)) {
154
+ state.didTwMergeConfigChange = true;
155
+ state.cachedTwMergeConfig = config.twMergeConfig;
156
+ }
157
+ const isExtendedSlotsEmpty = isEmptyObject(extend?.slots);
158
+ const componentSlots = !isEmptyObject(slotProps) ? {
159
+ // add "base" to the slots object
160
+ base: cx(options?.base, isExtendedSlotsEmpty && extend?.base),
161
+ ...slotProps
162
+ } : {};
163
+ const slots = isExtendedSlotsEmpty ? componentSlots : joinObjects(
164
+ { ...extend?.slots },
165
+ isEmptyObject(componentSlots) ? { base: options?.base } : componentSlots
166
+ );
167
+ const compoundVariants = isEmptyObject(extend?.compoundVariants) ? compoundVariantsProps : flatMergeArrays(extend?.compoundVariants, compoundVariantsProps);
168
+ const component = (props) => {
169
+ if (isEmptyObject(variants) && isEmptyObject(slotProps) && isExtendedSlotsEmpty) {
170
+ return cn2(base, props?.class, props?.className)(config);
171
+ }
172
+ if (compoundVariants && !Array.isArray(compoundVariants)) {
173
+ throw new TypeError(
174
+ `The "compoundVariants" prop must be an array. Received: ${typeof compoundVariants}`
175
+ );
176
+ }
177
+ if (compoundSlots && !Array.isArray(compoundSlots)) {
178
+ throw new TypeError(
179
+ `The "compoundSlots" prop must be an array. Received: ${typeof compoundSlots}`
180
+ );
181
+ }
182
+ const getVariantValue = (variant, vrs = variants, _slotKey = null, slotProps2 = null) => {
183
+ const variantObj = vrs[variant];
184
+ if (!variantObj || isEmptyObject(variantObj)) {
185
+ return null;
114
186
  }
115
- return r;
116
- }, W = (t, e = p$1, n = null, a2 = null) => {
117
- let r = e[t];
118
- if (!r || x(r)) return null;
119
- let s = a2?.[t] ?? h$1?.[t];
120
- if (s === null) return null;
121
- let i2 = h(s), l = Array.isArray(d$1.responsiveVariants) && d$1.responsiveVariants.length > 0 || d$1.responsiveVariants === true, f2 = E?.[t], o = [];
122
- if (typeof i2 == "object" && l) for (let [C2, H] of Object.entries(i2)) {
123
- let te = r[H];
124
- if (C2 === "initial") {
125
- f2 = H;
126
- continue;
127
- }
128
- Array.isArray(d$1.responsiveVariants) && !d$1.responsiveVariants.includes(C2) || (o = Y(C2, te, o, n));
187
+ const variantProp = slotProps2?.[variant] ?? props?.[variant];
188
+ if (variantProp === null) return null;
189
+ const variantKey = falsyToString(variantProp);
190
+ if (typeof variantKey === "object") {
191
+ return null;
129
192
  }
130
- let V = i2 != null && typeof i2 != "object" ? i2 : h(f2), m = r[V || "false"];
131
- return typeof o == "object" && typeof n == "string" && o[n] ? d(o, m) : o.length > 0 ? (o.push(m), n === "base" ? o.join(" ") : o) : m;
132
- }, Z = () => {
133
- if (!p$1) return null;
134
- let t = Object.keys(p$1), e = [];
135
- for (let n = 0; n < t.length; n++) {
136
- let a2 = W(t[n], p$1);
137
- a2 && e.push(a2);
193
+ const defaultVariantProp = defaultVariants?.[variant];
194
+ const key = variantKey != null ? variantKey : falsyToString(defaultVariantProp);
195
+ const value = variantObj[key || "false"];
196
+ return value;
197
+ };
198
+ const getVariantClassNames = () => {
199
+ if (!variants) return null;
200
+ const keys = Object.keys(variants);
201
+ const result = [];
202
+ for (let i = 0; i < keys.length; i++) {
203
+ const value = getVariantValue(keys[i], variants);
204
+ if (value) result.push(value);
138
205
  }
139
- return e;
140
- }, _ = (t, e) => {
141
- if (!p$1 || typeof p$1 != "object") return null;
142
- let n = [];
143
- for (let a2 in p$1) {
144
- let r = W(a2, p$1, t, e), s = t === "base" && typeof r == "string" ? r : r && r[t];
145
- s && n.push(s);
206
+ return result;
207
+ };
208
+ const getVariantClassNamesBySlotKey = (slotKey, slotProps2) => {
209
+ if (!variants || typeof variants !== "object") return null;
210
+ const result = [];
211
+ for (const variant in variants) {
212
+ const variantValue = getVariantValue(variant, variants, slotKey, slotProps2);
213
+ const value = slotKey === "base" && typeof variantValue === "string" ? variantValue : variantValue && variantValue[slotKey];
214
+ if (value) result.push(value);
146
215
  }
147
- return n;
148
- }, z = {};
149
- for (let t in h$1) {
150
- let e = h$1[t];
151
- e !== void 0 && (z[t] = e);
216
+ return result;
217
+ };
218
+ const propsWithoutUndefined = {};
219
+ for (const prop in props) {
220
+ const value = props[prop];
221
+ if (value !== void 0) propsWithoutUndefined[prop] = value;
152
222
  }
153
- let D = (t, e) => {
154
- let n = typeof h$1?.[t] == "object" ? { [t]: h$1[t]?.initial } : {};
155
- return { ...E, ...z, ...n, ...e };
156
- }, G = (t = [], e) => {
157
- let n = [], a2 = t.length;
158
- for (let r = 0; r < a2; r++) {
159
- let { class: s, className: i2, ...l } = t[r], f2 = true, o = D(null, e);
160
- for (let V in l) {
161
- let m = l[V], C2 = o[V];
162
- if (Array.isArray(m)) {
163
- if (!m.includes(C2)) {
164
- f2 = false;
223
+ const getCompleteProps = (key, slotProps2) => {
224
+ const initialProp = typeof props?.[key] === "object" ? {
225
+ [key]: props[key]?.initial
226
+ } : {};
227
+ return {
228
+ ...defaultVariants,
229
+ ...propsWithoutUndefined,
230
+ ...initialProp,
231
+ ...slotProps2
232
+ };
233
+ };
234
+ const getCompoundVariantsValue = (cv = [], slotProps2) => {
235
+ const result = [];
236
+ const cvLength = cv.length;
237
+ for (let i = 0; i < cvLength; i++) {
238
+ const { class: tvClass, className: tvClassName, ...compoundVariantOptions } = cv[i];
239
+ let isValid = true;
240
+ const completeProps = getCompleteProps(null, slotProps2);
241
+ for (const key in compoundVariantOptions) {
242
+ const value = compoundVariantOptions[key];
243
+ const completePropsValue = completeProps[key];
244
+ if (Array.isArray(value)) {
245
+ if (!value.includes(completePropsValue)) {
246
+ isValid = false;
165
247
  break;
166
248
  }
167
249
  } else {
168
- if ((m == null || m === false) && (C2 == null || C2 === false)) continue;
169
- if (C2 !== m) {
170
- f2 = false;
250
+ if ((value == null || value === false) && (completePropsValue == null || completePropsValue === false))
251
+ continue;
252
+ if (completePropsValue !== value) {
253
+ isValid = false;
171
254
  break;
172
255
  }
173
256
  }
174
257
  }
175
- f2 && (s && n.push(s), i2 && n.push(i2));
258
+ if (isValid) {
259
+ if (tvClass) result.push(tvClass);
260
+ if (tvClassName) result.push(tvClassName);
261
+ }
176
262
  }
177
- return n;
178
- }, K = (t) => {
179
- let e = G(T2, t);
180
- if (!Array.isArray(e)) return e;
181
- let n = {}, a2 = b$1;
182
- for (let r = 0; r < e.length; r++) {
183
- let s = e[r];
184
- if (typeof s == "string") n.base = a2(n.base, s)(d$1);
185
- else if (typeof s == "object") for (let i2 in s) n[i2] = a2(n[i2], s[i2])(d$1);
263
+ return result;
264
+ };
265
+ const getCompoundVariantClassNamesBySlot = (slotProps2) => {
266
+ const compoundClassNames = getCompoundVariantsValue(compoundVariants, slotProps2);
267
+ if (!Array.isArray(compoundClassNames)) return compoundClassNames;
268
+ const result = {};
269
+ const cnFn = cn2;
270
+ for (let i = 0; i < compoundClassNames.length; i++) {
271
+ const className = compoundClassNames[i];
272
+ if (typeof className === "string") {
273
+ result.base = cnFn(result.base, className)(config);
274
+ } else if (typeof className === "object") {
275
+ for (const slot in className) {
276
+ result[slot] = cnFn(result[slot], className[slot])(config);
277
+ }
278
+ }
186
279
  }
187
- return n;
188
- }, ee = (t) => {
189
- if (v.length < 1) return null;
190
- let e = {}, n = D(null, t);
191
- for (let a2 = 0; a2 < v.length; a2++) {
192
- let { slots: r = [], class: s, className: i2, ...l } = v[a2];
193
- if (!x(l)) {
194
- let f2 = true;
195
- for (let o in l) {
196
- let V = n[o], m = l[o];
197
- if (V === void 0 || (Array.isArray(m) ? !m.includes(V) : m !== V)) {
198
- f2 = false;
280
+ return result;
281
+ };
282
+ const getCompoundSlotClassNameBySlot = (slotProps2) => {
283
+ if (compoundSlots.length < 1) return null;
284
+ const result = {};
285
+ const completeProps = getCompleteProps(null, slotProps2);
286
+ for (let i = 0; i < compoundSlots.length; i++) {
287
+ const {
288
+ slots: slots2 = [],
289
+ class: slotClass,
290
+ className: slotClassName,
291
+ ...slotVariants
292
+ } = compoundSlots[i];
293
+ if (!isEmptyObject(slotVariants)) {
294
+ let isValid = true;
295
+ for (const key in slotVariants) {
296
+ const completePropsValue = completeProps[key];
297
+ const slotVariantValue = slotVariants[key];
298
+ if (completePropsValue === void 0 || (Array.isArray(slotVariantValue) ? !slotVariantValue.includes(completePropsValue) : slotVariantValue !== completePropsValue)) {
299
+ isValid = false;
199
300
  break;
200
301
  }
201
302
  }
202
- if (!f2) continue;
303
+ if (!isValid) continue;
203
304
  }
204
- for (let f2 = 0; f2 < r.length; f2++) {
205
- let o = r[f2];
206
- e[o] || (e[o] = []), e[o].push([s, i2]);
305
+ for (let j = 0; j < slots2.length; j++) {
306
+ const slotName = slots2[j];
307
+ if (!result[slotName]) result[slotName] = [];
308
+ result[slotName].push([slotClass, slotClassName]);
207
309
  }
208
310
  }
209
- return e;
311
+ return result;
210
312
  };
211
- if (!x(M) || !N) {
212
- let t = {};
213
- if (typeof j$1 == "object" && !x(j$1)) {
214
- let e = b$1;
215
- for (let n in j$1) t[n] = (a2) => {
216
- let r = K(a2), s = ee(a2);
217
- return e(j$1[n], _(n, a2), r ? r[n] : void 0, s ? s[n] : void 0, a2?.class, a2?.className)(d$1);
218
- };
313
+ if (!isEmptyObject(slotProps) || !isExtendedSlotsEmpty) {
314
+ const slotsFns = {};
315
+ if (typeof slots === "object" && !isEmptyObject(slots)) {
316
+ const cnFn = cn2;
317
+ for (const slotKey in slots) {
318
+ slotsFns[slotKey] = (slotProps2) => {
319
+ const compoundVariantClasses = getCompoundVariantClassNamesBySlot(slotProps2);
320
+ const compoundSlotClasses = getCompoundSlotClassNameBySlot(slotProps2);
321
+ return cnFn(
322
+ slots[slotKey],
323
+ getVariantClassNamesBySlotKey(slotKey, slotProps2),
324
+ compoundVariantClasses ? compoundVariantClasses[slotKey] : void 0,
325
+ compoundSlotClasses ? compoundSlotClasses[slotKey] : void 0,
326
+ slotProps2?.class,
327
+ slotProps2?.className
328
+ )(config);
329
+ };
330
+ }
219
331
  }
220
- return t;
332
+ return slotsFns;
221
333
  }
222
- return b$1(x$1, Z(), G(T2), h$1?.class, h$1?.className)(d$1);
223
- }, X = () => {
224
- if (!(!p$1 || typeof p$1 != "object")) return Object.keys(p$1);
334
+ return cn2(
335
+ base,
336
+ getVariantClassNames(),
337
+ getCompoundVariantsValue(compoundVariants),
338
+ props?.class,
339
+ props?.className
340
+ )(config);
341
+ };
342
+ const getVariantKeys = () => {
343
+ if (!variants || typeof variants !== "object") return;
344
+ return Object.keys(variants);
225
345
  };
226
- return y2.variantKeys = X(), y2.extend = c$1, y2.base = x$1, y2.slots = j$1, y2.variants = p$1, y2.defaultVariants = E, y2.compoundSlots = v, y2.compoundVariants = T2, y2;
346
+ component.variantKeys = getVariantKeys();
347
+ component.extend = extend;
348
+ component.base = base;
349
+ component.slots = slots;
350
+ component.variants = variants;
351
+ component.defaultVariants = defaultVariants;
352
+ component.compoundSlots = compoundSlots;
353
+ component.compoundVariants = compoundVariants;
354
+ return component;
355
+ };
356
+ const createTV2 = (configProp) => {
357
+ return (options, config) => tv2(options, config ? mergeObjects(configProp, config) : configProp);
358
+ };
359
+ return {
360
+ tv: tv2,
361
+ createTV: createTV2
227
362
  };
228
- return { tv: w, createTV: (u2) => ($, c2) => w($, c2 ? p(u2, c2) : u2) };
229
363
  };
230
364
  const concatArrays = (array1, array2) => {
231
365
  const combinedArray = new Array(array1.length + array2.length);
232
- for (let i2 = 0; i2 < array1.length; i2++) {
233
- combinedArray[i2] = array1[i2];
366
+ for (let i = 0; i < array1.length; i++) {
367
+ combinedArray[i] = array1[i];
234
368
  }
235
- for (let i2 = 0; i2 < array2.length; i2++) {
236
- combinedArray[array1.length + i2] = array2[i2];
369
+ for (let i = 0; i < array2.length; i++) {
370
+ combinedArray[array1.length + i] = array2[i];
237
371
  }
238
372
  return combinedArray;
239
373
  };
@@ -299,8 +433,8 @@ const getGroupRecursive = (classParts, startIndex, classPartObject) => {
299
433
  }
300
434
  const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
301
435
  const validatorsLength = validators.length;
302
- for (let i2 = 0; i2 < validatorsLength; i2++) {
303
- const validatorObj = validators[i2];
436
+ for (let i = 0; i < validatorsLength; i++) {
437
+ const validatorObj = validators[i];
304
438
  if (validatorObj.validator(classRest)) {
305
439
  return validatorObj.classGroupId;
306
440
  }
@@ -330,8 +464,8 @@ const processClassGroups = (classGroups, theme) => {
330
464
  };
331
465
  const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
332
466
  const len = classGroup.length;
333
- for (let i2 = 0; i2 < len; i2++) {
334
- const classDefinition = classGroup[i2];
467
+ for (let i = 0; i < len; i++) {
468
+ const classDefinition = classGroup[i];
335
469
  processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
336
470
  }
337
471
  };
@@ -363,8 +497,8 @@ const processFunctionDefinition = (classDefinition, classPartObject, classGroupI
363
497
  const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
364
498
  const entries = Object.entries(classDefinition);
365
499
  const len = entries.length;
366
- for (let i2 = 0; i2 < len; i2++) {
367
- const [key, value] = entries[i2];
500
+ for (let i = 0; i < len; i++) {
501
+ const [key, value] = entries[i];
368
502
  processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
369
503
  }
370
504
  };
@@ -372,8 +506,8 @@ const getPart = (classPartObject, path) => {
372
506
  let current = classPartObject;
373
507
  const parts = path.split(CLASS_PART_SEPARATOR);
374
508
  const len = parts.length;
375
- for (let i2 = 0; i2 < len; i2++) {
376
- const part = parts[i2];
509
+ for (let i = 0; i < len; i++) {
510
+ const part = parts[i];
377
511
  let next = current.nextPart.get(part);
378
512
  if (!next) {
379
513
  next = createClassPartObject();
@@ -505,8 +639,8 @@ const createSortModifiers = (config) => {
505
639
  return (modifiers) => {
506
640
  const result = [];
507
641
  let currentSegment = [];
508
- for (let i2 = 0; i2 < modifiers.length; i2++) {
509
- const modifier = modifiers[i2];
642
+ for (let i = 0; i < modifiers.length; i++) {
643
+ const modifier = modifiers[i];
510
644
  const isArbitrary = modifier[0] === "[";
511
645
  const isOrderSensitive = modifierWeights.has(modifier);
512
646
  if (isArbitrary || isOrderSensitive) {
@@ -579,8 +713,8 @@ const mergeClassList = (classList, configUtils) => {
579
713
  }
580
714
  classGroupsInConflict.push(classId);
581
715
  const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
582
- for (let i2 = 0; i2 < conflictGroups.length; ++i2) {
583
- const group = conflictGroups[i2];
716
+ for (let i = 0; i < conflictGroups.length; ++i) {
717
+ const group = conflictGroups[i];
584
718
  classGroupsInConflict.push(modifierId + group);
585
719
  }
586
720
  result = originalClassName + (result.length > 0 ? " " + result : result);
@@ -608,9 +742,9 @@ const toValue = (mix) => {
608
742
  }
609
743
  let resolvedValue;
610
744
  let string = "";
611
- for (let k2 = 0; k2 < mix.length; k2++) {
612
- if (mix[k2]) {
613
- if (resolvedValue = toValue(mix[k2])) {
745
+ for (let k = 0; k < mix.length; k++) {
746
+ if (mix[k]) {
747
+ if (resolvedValue = toValue(mix[k])) {
614
748
  string && (string += " ");
615
749
  string += resolvedValue;
616
750
  }
@@ -3282,15 +3416,39 @@ const mergeArrayProperties = (baseObject, mergeObject, key) => {
3282
3416
  };
3283
3417
  const extendTailwindMerge = (configExtension, ...createConfig) => typeof configExtension === "function" ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);
3284
3418
  const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
3285
- var f = (e) => x(e) ? twMerge : extendTailwindMerge({ ...e, extend: { theme: e.theme, classGroups: e.classGroups, conflictingClassGroupModifiers: e.conflictingClassGroupModifiers, conflictingClassGroups: e.conflictingClassGroups, ...e.extend } }), i = (...e) => (a2) => {
3286
- let t = u(e);
3287
- return !t || !a2.twMerge ? t : ((!S.cachedTwMerge || S.didTwMergeConfigChange) && (S.didTwMergeConfigChange = false, S.cachedTwMerge = f(S.cachedTwMergeConfig)), S.cachedTwMerge(t) || void 0);
3419
+ var createTwMerge = (cachedTwMergeConfig) => {
3420
+ return isEmptyObject(cachedTwMergeConfig) ? twMerge : extendTailwindMerge({
3421
+ ...cachedTwMergeConfig,
3422
+ extend: {
3423
+ theme: cachedTwMergeConfig.theme,
3424
+ classGroups: cachedTwMergeConfig.classGroups,
3425
+ conflictingClassGroupModifiers: cachedTwMergeConfig.conflictingClassGroupModifiers,
3426
+ conflictingClassGroups: cachedTwMergeConfig.conflictingClassGroups,
3427
+ ...cachedTwMergeConfig.extend
3428
+ }
3429
+ });
3430
+ };
3431
+ var executeMerge = (classnames, config) => {
3432
+ const base = cx(classnames);
3433
+ if (!base || !(config?.twMerge ?? true)) return base;
3434
+ if (!state.cachedTwMerge || state.didTwMergeConfigChange) {
3435
+ state.didTwMergeConfigChange = false;
3436
+ state.cachedTwMerge = createTwMerge(state.cachedTwMergeConfig);
3437
+ }
3438
+ return state.cachedTwMerge(base) || void 0;
3439
+ };
3440
+ var cn = (...classnames) => {
3441
+ return executeMerge(classnames, {});
3442
+ };
3443
+ var cnMerge = (...classnames) => {
3444
+ return (config) => executeMerge(classnames, config);
3288
3445
  };
3289
- var { createTV: C, tv: T } = le(i);
3446
+ var { createTV, tv } = getTailwindVariants(cnMerge);
3290
3447
  export {
3291
- C,
3292
- Q,
3293
- T,
3294
- i,
3295
- u
3448
+ cnMerge as a,
3449
+ createTV as b,
3450
+ cn as c,
3451
+ defaultConfig as d,
3452
+ cx as e,
3453
+ tv as t
3296
3454
  };