clava 0.7.1 → 0.7.2
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 +18 -0
- package/README.md +32 -8
- package/dist/index.d.ts +78 -10
- package/dist/index.js +168 -45
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +386 -47
- package/src/types.ts +110 -9
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
|
-
|
|
2
|
+
// src/utils.ts
|
|
3
3
|
const hasOwn = Object.hasOwn;
|
|
4
4
|
function getOwn(record, key) {
|
|
5
5
|
if (!hasOwn(record, key)) return void 0;
|
|
@@ -224,8 +224,7 @@ function styleValueToHTMLObjStyle(style) {
|
|
|
224
224
|
}
|
|
225
225
|
return result;
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
//#region src/refine-warning.ts
|
|
227
|
+
// src/refine-warning.ts
|
|
229
228
|
function captureCreationFrame(skipFn) {
|
|
230
229
|
if (process.env.NODE_ENV === "production") return void 0;
|
|
231
230
|
if (typeof Error.captureStackTrace === "function") {
|
|
@@ -314,8 +313,7 @@ function warnRefineLimit({ creationFrame, unstableChanges }) {
|
|
|
314
313
|
}
|
|
315
314
|
console.warn(message);
|
|
316
315
|
}
|
|
317
|
-
|
|
318
|
-
//#region src/index.ts
|
|
316
|
+
// src/index.ts
|
|
319
317
|
const META_KEY = "__meta";
|
|
320
318
|
const EMPTY_DEFAULTS = {};
|
|
321
319
|
function deduplicateExtensions(extensions, seen = /* @__PURE__ */ new Set()) {
|
|
@@ -364,6 +362,24 @@ function mergeProtectedIntoBase(baseResolved, protection) {
|
|
|
364
362
|
if (!protectedVariants) return baseResolved;
|
|
365
363
|
return Object.assign({}, baseResolved, protectedVariants);
|
|
366
364
|
}
|
|
365
|
+
function isPendingKey(frames, key) {
|
|
366
|
+
for (let i = 0; i < frames.length; i++) if (frames[i]?.keys?.has(key)) return true;
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
function isDisabledOnPath(frames, key, value) {
|
|
370
|
+
for (let i = 0; i < frames.length; i++) if (frames[i]?.isDisabled?.(key, value)) return true;
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
const NO_KEYS = /* @__PURE__ */ new Set();
|
|
374
|
+
function getActiveComputedDefaultKeys(meta) {
|
|
375
|
+
return getOwn(meta, "activeComputedDefaultKeys") ?? NO_KEYS;
|
|
376
|
+
}
|
|
377
|
+
function withVariant(variants, key, value) {
|
|
378
|
+
const copy = Object.assign({}, variants);
|
|
379
|
+
if (value === void 0) delete copy[key];
|
|
380
|
+
else copy[key] = value;
|
|
381
|
+
return copy;
|
|
382
|
+
}
|
|
367
383
|
function identityClass(className) {
|
|
368
384
|
return className;
|
|
369
385
|
}
|
|
@@ -490,7 +506,9 @@ function buildPrebuiltVariant(variantDef) {
|
|
|
490
506
|
}
|
|
491
507
|
function create(params = {}) {
|
|
492
508
|
const transformClass = getOwn(params, "transformClass") ?? identityClass;
|
|
493
|
-
const
|
|
509
|
+
const transformedCx = (...classes) => {
|
|
510
|
+
return transformClass(clsx(classes));
|
|
511
|
+
};
|
|
494
512
|
const buildRecipe = (config = {}) => {
|
|
495
513
|
const extend = getOwn(config, "extend");
|
|
496
514
|
const variants = getOwn(config, "variants");
|
|
@@ -521,6 +539,7 @@ function create(params = {}) {
|
|
|
521
539
|
const variantEntryDefs = [];
|
|
522
540
|
const functionVariantNames = [];
|
|
523
541
|
const functionVariantFns = [];
|
|
542
|
+
const ownVariantDefs = /* @__PURE__ */ new Map();
|
|
524
543
|
if (variants) for (const name in variants) {
|
|
525
544
|
if (!hasOwn(variants, name)) continue;
|
|
526
545
|
const variant = variants[name];
|
|
@@ -533,9 +552,11 @@ function create(params = {}) {
|
|
|
533
552
|
if (typeof variant === "function") {
|
|
534
553
|
functionVariantNames.push(name);
|
|
535
554
|
functionVariantFns.push(variant);
|
|
555
|
+
ownVariantDefs.set(name, null);
|
|
536
556
|
continue;
|
|
537
557
|
}
|
|
538
558
|
const prebuiltVariant = buildPrebuiltVariant(variant);
|
|
559
|
+
ownVariantDefs.set(name, prebuiltVariant);
|
|
539
560
|
variantEntryNames.push(name);
|
|
540
561
|
variantEntryDefs.push(prebuiltVariant);
|
|
541
562
|
if (prebuiltVariant.disabledValues) {
|
|
@@ -544,6 +565,15 @@ function create(params = {}) {
|
|
|
544
565
|
}
|
|
545
566
|
if (prebuiltVariant.values?.has("false") && !initialExtensions.some((meta) => hasOwn(meta.staticDefaults, name))) ownStaticDefaults[name] = false;
|
|
546
567
|
}
|
|
568
|
+
const definesOwnValue = (key, value) => {
|
|
569
|
+
const variant = ownVariantDefs.get(key);
|
|
570
|
+
if (variant === void 0) return false;
|
|
571
|
+
if (variant === null) return true;
|
|
572
|
+
if (!variant.values) return typeof value === "boolean";
|
|
573
|
+
if (value === false && variant.values.has("true")) return true;
|
|
574
|
+
const valueKey = getVariantValueKey(value);
|
|
575
|
+
return valueKey != null && variant.values.has(valueKey);
|
|
576
|
+
};
|
|
547
577
|
const variantKeys = Array.from(variantKeySet);
|
|
548
578
|
const variantKeysLength = variantKeys.length;
|
|
549
579
|
const variantEntryCount = variantEntryNames.length;
|
|
@@ -605,12 +635,10 @@ function create(params = {}) {
|
|
|
605
635
|
if (valueKey != null && getOwn(disabledVariantValues, key)?.has(valueKey)) delete staticDefaults[key];
|
|
606
636
|
}
|
|
607
637
|
}
|
|
608
|
-
|
|
609
|
-
for (let i = 0; i < extCount; i++)
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
const extMetasWithRefineCount = extMetasWithRefine.length;
|
|
638
|
+
let extMetasWithRefineCount = 0;
|
|
639
|
+
for (let i = 0; i < extCount; i++) if (extMetas[i].resolveRefine) extMetasWithRefineCount += 1;
|
|
640
|
+
const extResolvers = extMetas.map((meta) => getOwn(meta, "resolveVariants") ?? meta.resolveRefine);
|
|
641
|
+
const canResolveVariants = hasExtend && hasAnyDisabled || !!refine || computedDefaultCount > 0 || extResolvers.some(Boolean);
|
|
614
642
|
const canProtectVariants = !!refine || extMetasWithRefineCount > 0;
|
|
615
643
|
const needsUserVariantProps = computedDefaultCount > 0 || inheritedComputedDefaultKeys.size > 0;
|
|
616
644
|
const functionVariantKeys = /* @__PURE__ */ new Set();
|
|
@@ -660,6 +688,53 @@ function create(params = {}) {
|
|
|
660
688
|
}
|
|
661
689
|
return false;
|
|
662
690
|
};
|
|
691
|
+
const isDisabledValue = (key, value) => {
|
|
692
|
+
if (isOwnDisabledValue(key, value)) return true;
|
|
693
|
+
if (definesOwnValue(key, value)) return false;
|
|
694
|
+
return extMetas.some((meta) => getOwn(meta, "isDisabledValue")?.(key, value));
|
|
695
|
+
};
|
|
696
|
+
const disabledKeys = new Set(disabledVariantKeys);
|
|
697
|
+
for (const key in disabledVariantValues) {
|
|
698
|
+
if (!hasOwn(disabledVariantValues, key)) continue;
|
|
699
|
+
disabledKeys.add(key);
|
|
700
|
+
}
|
|
701
|
+
const restorableKeys = [];
|
|
702
|
+
for (const meta of extMetas) {
|
|
703
|
+
const extDisabledKeys = getOwn(meta, "disabledKeys");
|
|
704
|
+
if (!extDisabledKeys) continue;
|
|
705
|
+
for (const key of extDisabledKeys) {
|
|
706
|
+
disabledKeys.add(key);
|
|
707
|
+
if (ownVariantDefs.has(key) && !restorableKeys.includes(key)) restorableKeys.push(key);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
const restoreOwnValues = (before, after, extMeta, fallback, protection) => {
|
|
711
|
+
let restored = after;
|
|
712
|
+
for (const key of restorableKeys) {
|
|
713
|
+
const value = getOwn(before, key);
|
|
714
|
+
if (value === void 0) continue;
|
|
715
|
+
if (!definesOwnValue(key, value)) continue;
|
|
716
|
+
if (!getOwn(extMeta, "isDisabledValue")?.(key, value)) continue;
|
|
717
|
+
const current = getOwn(after, key);
|
|
718
|
+
if (Object.is(current, value)) continue;
|
|
719
|
+
const protectedVariants = protection?.variants;
|
|
720
|
+
if (protectedVariants && hasOwn(protectedVariants, key) && !Object.is(protectedVariants[key], value)) continue;
|
|
721
|
+
if (current !== void 0 && !Object.is(current, getOwn(fallback, key))) continue;
|
|
722
|
+
if (restored === after) restored = Object.assign({}, after);
|
|
723
|
+
restored[key] = value;
|
|
724
|
+
}
|
|
725
|
+
return restored;
|
|
726
|
+
};
|
|
727
|
+
const extPendingFrames = [];
|
|
728
|
+
const laterComputedDefaultKeys = new Set(computedDefaultNames);
|
|
729
|
+
for (let i = extCount - 1; i >= 0; i--) {
|
|
730
|
+
const keys = laterComputedDefaultKeys.size > 0 ? new Set(laterComputedDefaultKeys) : null;
|
|
731
|
+
extPendingFrames.unshift(keys || hasAnyDisabled ? {
|
|
732
|
+
keys,
|
|
733
|
+
isDisabled: hasAnyDisabled ? isOwnDisabledValue : null
|
|
734
|
+
} : null);
|
|
735
|
+
for (const key of getActiveComputedDefaultKeys(extMetas[i])) laterComputedDefaultKeys.add(key);
|
|
736
|
+
}
|
|
737
|
+
const activeComputedDefaultKeys = laterComputedDefaultKeys;
|
|
663
738
|
const filterOwnDisabledVariants = (input, fallback) => {
|
|
664
739
|
if (!hasAnyDisabled) return input;
|
|
665
740
|
let hasOwnDisabledValue = false;
|
|
@@ -685,6 +760,14 @@ function create(params = {}) {
|
|
|
685
760
|
}
|
|
686
761
|
return filtered;
|
|
687
762
|
};
|
|
763
|
+
const filterOwnDisabledChainValues = (chainValues, fallback) => {
|
|
764
|
+
if (!hasAnyDisabled) return;
|
|
765
|
+
for (const [key, value] of chainValues) {
|
|
766
|
+
if (!isOwnDisabledValue(key, value)) continue;
|
|
767
|
+
const fallbackValue = getOwn(fallback, key);
|
|
768
|
+
chainValues.set(key, fallbackValue !== void 0 && !isOwnDisabledValue(key, fallbackValue) ? fallbackValue : void 0);
|
|
769
|
+
}
|
|
770
|
+
};
|
|
688
771
|
function resolveVariantsHot(propsVariants) {
|
|
689
772
|
const defaults = Object.assign({}, staticDefaults);
|
|
690
773
|
for (let i = 0; i < variantKeysLength; i++) {
|
|
@@ -699,7 +782,7 @@ function create(params = {}) {
|
|
|
699
782
|
filterDisabledInto(defaults, result);
|
|
700
783
|
return result;
|
|
701
784
|
}
|
|
702
|
-
const runComputedDefaults = (resolved, defaultResolved, userVariantProps, filterOwnVariants, protection) => {
|
|
785
|
+
const runComputedDefaults = (resolved, defaultResolved, userVariantProps, filterOwnVariants, protection, pass) => {
|
|
703
786
|
const protectedVariants = protection?.variants;
|
|
704
787
|
let ownVariants = filterOwnVariants ? null : resolved;
|
|
705
788
|
const getOwnVariants = () => {
|
|
@@ -726,21 +809,33 @@ function create(params = {}) {
|
|
|
726
809
|
}
|
|
727
810
|
if (protectedVariants && hasOwn(protectedVariants, key)) continue;
|
|
728
811
|
const variantSnapshot = getOwnVariants();
|
|
729
|
-
const
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
812
|
+
const currentValue = getOwn(variantSnapshot, key);
|
|
813
|
+
const chainValues = pass?.chainValues;
|
|
814
|
+
const latestValue = chainValues && chainValues.has(key) ? chainValues.get(key) : currentValue;
|
|
815
|
+
const defaultValue = inheritedComputedDefaultKeys.has(key) ? latestValue : getOwn(defaultResolved, key);
|
|
816
|
+
let value = computedDefaultFns[i](defaultValue, Object.is(latestValue, currentValue) ? variantSnapshot : withVariant(variantSnapshot, key, latestValue));
|
|
817
|
+
if (hasAnyDisabled && isOwnDisabledValue(key, value)) {
|
|
818
|
+
if (Object.is(latestValue, currentValue)) continue;
|
|
819
|
+
if (pass && isPendingKey(pass.frames, key)) continue;
|
|
820
|
+
value = latestValue;
|
|
821
|
+
} else if (pass) {
|
|
822
|
+
if (Object.is(value, currentValue)) {
|
|
823
|
+
chainValues?.delete(key);
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
if (isPendingKey(pass.frames, key) && !isDisabledOnPath(pass.frames, key, value)) {
|
|
827
|
+
pass.chainValues ??= /* @__PURE__ */ new Map();
|
|
828
|
+
pass.chainValues.set(key, value);
|
|
829
|
+
continue;
|
|
736
830
|
}
|
|
737
831
|
}
|
|
832
|
+
chainValues?.delete(key);
|
|
738
833
|
if (value === void 0) {
|
|
739
834
|
if (!hasOwn(variantSnapshot, key)) continue;
|
|
740
835
|
delete ensureUpdated()[key];
|
|
741
836
|
continue;
|
|
742
837
|
}
|
|
743
|
-
if (Object.is(
|
|
838
|
+
if (Object.is(currentValue, value)) continue;
|
|
744
839
|
ensureUpdated()[key] = value;
|
|
745
840
|
}
|
|
746
841
|
return updatedVariants ?? resolved;
|
|
@@ -816,7 +911,7 @@ function create(params = {}) {
|
|
|
816
911
|
style: cStyle
|
|
817
912
|
};
|
|
818
913
|
};
|
|
819
|
-
const computeOnce = (resolved, userVariantProps, skipKeys, skipValues, classesOut, styleOut, protection, defaultResolved = resolved, renderOnly = false) => {
|
|
914
|
+
const computeOnce = (resolved, userVariantProps, skipKeys, skipValues, classesOut, styleOut, protection, defaultResolved = resolved, renderOnly = false, pass) => {
|
|
820
915
|
let workingResolved = resolved;
|
|
821
916
|
let cClasses = null;
|
|
822
917
|
let cStyle = null;
|
|
@@ -849,18 +944,24 @@ function create(params = {}) {
|
|
|
849
944
|
}
|
|
850
945
|
}
|
|
851
946
|
for (let i = 0; i < extCount; i++) {
|
|
947
|
+
const pendingFrame = pass ? extPendingFrames[i] : null;
|
|
948
|
+
if (pass && pendingFrame) pass.frames.push(pendingFrame);
|
|
949
|
+
const beforeExtend = workingResolved;
|
|
852
950
|
if (hasIsolatedExt && extIsolated[i]) {
|
|
853
951
|
const extClasses = [];
|
|
854
|
-
workingResolved = extMetas[i].compute(workingResolved, userVariantProps, extSkipKeys, extSkipVals, extClasses, styleOut, protection, defaultResolved, renderOnly);
|
|
952
|
+
workingResolved = extMetas[i].compute(workingResolved, userVariantProps, extSkipKeys, extSkipVals, extClasses, styleOut, protection, defaultResolved, renderOnly, pass);
|
|
855
953
|
if (extClasses.length > 0) {
|
|
856
954
|
const joined = clsx(extClasses);
|
|
857
955
|
if (joined.length > 0) classesOut.push(extMetas[i].transformClass(joined));
|
|
858
956
|
}
|
|
859
|
-
} else workingResolved = extMetas[i].compute(workingResolved, userVariantProps, extSkipKeys, extSkipVals, classesOut, styleOut, protection, defaultResolved, renderOnly);
|
|
957
|
+
} else workingResolved = extMetas[i].compute(workingResolved, userVariantProps, extSkipKeys, extSkipVals, classesOut, styleOut, protection, defaultResolved, renderOnly, pass);
|
|
958
|
+
if (pass && pendingFrame) pass.frames.pop();
|
|
959
|
+
if (restorableKeys.length > 0) workingResolved = restoreOwnValues(beforeExtend, workingResolved, extMetas[i], defaultResolved, protection);
|
|
860
960
|
workingResolved = filterOwnDisabledVariants(workingResolved, defaultResolved);
|
|
961
|
+
if (pass?.chainValues) filterOwnDisabledChainValues(pass.chainValues, defaultResolved);
|
|
861
962
|
}
|
|
862
963
|
}
|
|
863
|
-
if (!renderOnly && computedDefaultCount > 0) workingResolved = runComputedDefaults(workingResolved, defaultResolved, userVariantProps, true, protection);
|
|
964
|
+
if (!renderOnly && computedDefaultCount > 0) workingResolved = runComputedDefaults(workingResolved, defaultResolved, userVariantProps, true, protection, pass);
|
|
864
965
|
if (refine) {
|
|
865
966
|
const refineResult = runRefineContext(workingResolved, true, true, !renderOnly, protection);
|
|
866
967
|
workingResolved = refineResult.workingResolved;
|
|
@@ -917,6 +1018,7 @@ function create(params = {}) {
|
|
|
917
1018
|
let lastClasses = [];
|
|
918
1019
|
let lastStyle = {};
|
|
919
1020
|
let isFirstRun = true;
|
|
1021
|
+
let pass = null;
|
|
920
1022
|
while (remaining > 0) {
|
|
921
1023
|
remaining -= 1;
|
|
922
1024
|
const useDirectOutput = isFirstRun;
|
|
@@ -924,15 +1026,17 @@ function create(params = {}) {
|
|
|
924
1026
|
const nextClasses = useDirectOutput ? classesOut : [];
|
|
925
1027
|
const nextStyle = useDirectOutput ? styleOut : {};
|
|
926
1028
|
const defaultResolved = mergeProtectedIntoBase(incomingDefaultResolved, protection);
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
1029
|
+
if (!isFirstRun) {
|
|
1030
|
+
pass ??= {
|
|
1031
|
+
frames: [],
|
|
1032
|
+
chainValues: null
|
|
1033
|
+
};
|
|
1034
|
+
pass.chainValues?.clear();
|
|
1035
|
+
}
|
|
1036
|
+
const nextResolved = computeOnce(workingResolved, userVariantProps, skipKeys, skipValues, nextClasses, nextStyle, protection, defaultResolved, false, pass);
|
|
1037
|
+
if (nextResolved === workingResolved || !isFirstRun && areVariantsEqual(workingResolved, nextResolved)) {
|
|
1038
|
+
if (nextResolved !== workingResolved) computeOnce(nextResolved, userVariantProps, skipKeys, skipValues, classesOut, styleOut, protection, defaultResolved, true);
|
|
1039
|
+
else if (!useDirectOutput) {
|
|
936
1040
|
for (let i = 0; i < nextClasses.length; i++) classesOut.push(nextClasses[i]);
|
|
937
1041
|
Object.assign(styleOut, nextStyle);
|
|
938
1042
|
}
|
|
@@ -960,15 +1064,23 @@ function create(params = {}) {
|
|
|
960
1064
|
Object.assign(styleOut, lastStyle);
|
|
961
1065
|
return workingResolved;
|
|
962
1066
|
};
|
|
963
|
-
const resolveRefineOnce = (resolved, userVariantProps, filterOwnVariants = true, protection, defaultResolved = resolved) => {
|
|
1067
|
+
const resolveRefineOnce = (resolved, userVariantProps, filterOwnVariants = true, protection, defaultResolved = resolved, pass, renderOnly = false) => {
|
|
964
1068
|
let workingResolved = resolved;
|
|
965
|
-
for (let i = 0; i <
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
|
|
1069
|
+
for (let i = 0; i < extCount; i++) {
|
|
1070
|
+
const resolveExtend = extResolvers[i];
|
|
1071
|
+
const beforeExtend = workingResolved;
|
|
1072
|
+
if (resolveExtend) {
|
|
1073
|
+
const pendingFrame = pass ? extPendingFrames[i] : null;
|
|
1074
|
+
if (pass && pendingFrame) pass.frames.push(pendingFrame);
|
|
1075
|
+
workingResolved = resolveExtend(workingResolved, userVariantProps, true, protection, defaultResolved, pass, renderOnly);
|
|
1076
|
+
if (pass && pendingFrame) pass.frames.pop();
|
|
1077
|
+
if (restorableKeys.length > 0) workingResolved = restoreOwnValues(beforeExtend, workingResolved, extMetas[i], defaultResolved, protection);
|
|
1078
|
+
}
|
|
969
1079
|
workingResolved = filterOwnDisabledVariants(workingResolved, defaultResolved);
|
|
1080
|
+
if (pass?.chainValues) filterOwnDisabledChainValues(pass.chainValues, defaultResolved);
|
|
970
1081
|
}
|
|
971
|
-
if (
|
|
1082
|
+
if (renderOnly) return workingResolved;
|
|
1083
|
+
if (computedDefaultCount > 0) workingResolved = runComputedDefaults(workingResolved, defaultResolved, userVariantProps, filterOwnVariants, protection, pass);
|
|
972
1084
|
if (refine) workingResolved = runRefineContext(workingResolved, filterOwnVariants, false, true, protection).workingResolved;
|
|
973
1085
|
return workingResolved;
|
|
974
1086
|
};
|
|
@@ -978,16 +1090,23 @@ function create(params = {}) {
|
|
|
978
1090
|
const incomingDefaultResolved = resolved;
|
|
979
1091
|
let workingResolved = resolved;
|
|
980
1092
|
let unstableChanges = null;
|
|
1093
|
+
let pass = null;
|
|
981
1094
|
while (remaining > 0) {
|
|
982
1095
|
remaining -= 1;
|
|
983
1096
|
const defaultResolved = mergeProtectedIntoBase(incomingDefaultResolved, protection);
|
|
984
|
-
const nextResolved = resolveRefineOnce(workingResolved, userVariantProps, filterOwnVariants, protection, defaultResolved);
|
|
985
|
-
if (nextResolved === workingResolved
|
|
1097
|
+
const nextResolved = resolveRefineOnce(workingResolved, userVariantProps, filterOwnVariants, protection, defaultResolved, pass);
|
|
1098
|
+
if (nextResolved === workingResolved) return nextResolved;
|
|
1099
|
+
if (pass && areVariantsEqual(workingResolved, nextResolved)) return resolveRefineOnce(nextResolved, userVariantProps, filterOwnVariants, protection, defaultResolved, null, true);
|
|
986
1100
|
if (remaining < 10 && process.env.NODE_ENV !== "production") {
|
|
987
1101
|
if (!unstableChanges) unstableChanges = /* @__PURE__ */ new Map();
|
|
988
1102
|
accumulateUnstableVariantChanges(unstableChanges, workingResolved, nextResolved);
|
|
989
1103
|
}
|
|
990
1104
|
workingResolved = nextResolved;
|
|
1105
|
+
pass ??= {
|
|
1106
|
+
frames: [],
|
|
1107
|
+
chainValues: null
|
|
1108
|
+
};
|
|
1109
|
+
pass.chainValues?.clear();
|
|
991
1110
|
}
|
|
992
1111
|
if (process.env.NODE_ENV !== "production") warnRefineLimit({
|
|
993
1112
|
creationFrame,
|
|
@@ -1054,6 +1173,7 @@ function create(params = {}) {
|
|
|
1054
1173
|
}
|
|
1055
1174
|
let resolvedVariants = resolveVariantsHot(variantProps);
|
|
1056
1175
|
if (resolveRefine) resolvedVariants = resolveRefine(resolvedVariants, variantProps, false);
|
|
1176
|
+
else if (canResolveVariants) resolvedVariants = resolveRefineOnce(resolvedVariants, variantProps);
|
|
1057
1177
|
return resolvedVariants;
|
|
1058
1178
|
};
|
|
1059
1179
|
const computedBaseClass = hasExtend ? clsx(extBaseClassesArr, baseClass) : baseClass;
|
|
@@ -1068,9 +1188,13 @@ function create(params = {}) {
|
|
|
1068
1188
|
staticDefaults,
|
|
1069
1189
|
compute: computeOnce,
|
|
1070
1190
|
resolveRefine: resolveRefine ? resolveRefineOnce : null,
|
|
1191
|
+
resolveVariants: canResolveVariants ? resolveRefineOnce : void 0,
|
|
1071
1192
|
transformClass,
|
|
1072
1193
|
functionVariantKeys,
|
|
1073
|
-
computedDefaultKeys
|
|
1194
|
+
computedDefaultKeys,
|
|
1195
|
+
activeComputedDefaultKeys,
|
|
1196
|
+
disabledKeys,
|
|
1197
|
+
isDisabledValue
|
|
1074
1198
|
};
|
|
1075
1199
|
const initRecipe = (recipe, propKeys, style) => {
|
|
1076
1200
|
recipe.class = classFn;
|
|
@@ -1140,14 +1264,13 @@ function create(params = {}) {
|
|
|
1140
1264
|
const cv = (config = {}) => buildRecipe(config).recipe;
|
|
1141
1265
|
return {
|
|
1142
1266
|
cv,
|
|
1143
|
-
cx
|
|
1267
|
+
cx: transformedCx
|
|
1144
1268
|
};
|
|
1145
1269
|
}
|
|
1146
1270
|
const cv = /* @__PURE__ */ (() => create().cv)();
|
|
1147
1271
|
function cx(...classes) {
|
|
1148
1272
|
return clsx(classes);
|
|
1149
1273
|
}
|
|
1150
|
-
//#endregion
|
|
1151
1274
|
export { create, cv, cx, splitProps };
|
|
1152
1275
|
|
|
1153
1276
|
//# sourceMappingURL=index.js.map
|