praxis-kit 6.0.0 → 6.1.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/{chunk-P5ZJBPAR.js → chunk-VUULGK5M.js} +80 -52
- package/dist/lit/index.js +66 -50
- package/dist/preact/index.js +66 -50
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.js +1 -1
- package/dist/solid/index.js +66 -50
- package/dist/svelte/index.js +66 -50
- package/dist/tailwind/index.js +43 -20
- package/dist/vite-plugin/index.js +14 -2
- package/dist/vue/index.js +66 -50
- package/dist/web/index.js +66 -50
- package/package.json +4 -4
package/dist/solid/index.js
CHANGED
|
@@ -639,6 +639,45 @@ var iterate = Object.freeze({
|
|
|
639
639
|
values
|
|
640
640
|
});
|
|
641
641
|
|
|
642
|
+
// ../../lib/primitive/src/utils/lru-cache.ts
|
|
643
|
+
var LRUCache = class {
|
|
644
|
+
#maxSize;
|
|
645
|
+
#store = /* @__PURE__ */ new Map();
|
|
646
|
+
constructor(maxSize) {
|
|
647
|
+
if (!Number.isInteger(maxSize) || maxSize < 1) {
|
|
648
|
+
throw new RangeError("LRUCache maxSize must be a positive integer.");
|
|
649
|
+
}
|
|
650
|
+
this.#maxSize = maxSize;
|
|
651
|
+
}
|
|
652
|
+
get(key) {
|
|
653
|
+
if (!this.#store.has(key)) return void 0;
|
|
654
|
+
const value = this.#store.get(key);
|
|
655
|
+
this.#store.delete(key);
|
|
656
|
+
this.#store.set(key, value);
|
|
657
|
+
return value;
|
|
658
|
+
}
|
|
659
|
+
set(key, value) {
|
|
660
|
+
this.#store.delete(key);
|
|
661
|
+
this.#store.set(key, value);
|
|
662
|
+
if (this.#store.size > this.#maxSize) {
|
|
663
|
+
const lru = this.#store.keys().next().value;
|
|
664
|
+
if (lru !== void 0) this.#store.delete(lru);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
has(key) {
|
|
668
|
+
return this.#store.has(key);
|
|
669
|
+
}
|
|
670
|
+
delete(key) {
|
|
671
|
+
return this.#store.delete(key);
|
|
672
|
+
}
|
|
673
|
+
get size() {
|
|
674
|
+
return this.#store.size;
|
|
675
|
+
}
|
|
676
|
+
clear() {
|
|
677
|
+
this.#store.clear();
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
|
|
642
681
|
// ../../lib/primitive/src/utils/merge-props.ts
|
|
643
682
|
function mergeProps(defaultProps, props) {
|
|
644
683
|
return {
|
|
@@ -647,28 +686,6 @@ function mergeProps(defaultProps, props) {
|
|
|
647
686
|
};
|
|
648
687
|
}
|
|
649
688
|
|
|
650
|
-
// ../../lib/contract/src/strict/invariant-base.ts
|
|
651
|
-
var InvariantBase = class {
|
|
652
|
-
diagnostics;
|
|
653
|
-
constructor(diagnostics) {
|
|
654
|
-
this.diagnostics = diagnostics;
|
|
655
|
-
}
|
|
656
|
-
get active() {
|
|
657
|
-
return this.diagnostics.active;
|
|
658
|
-
}
|
|
659
|
-
violate(input) {
|
|
660
|
-
this.diagnostics.error(input);
|
|
661
|
-
}
|
|
662
|
-
// Always caps at warn — never throws. ARIA 'warning' violations route here
|
|
663
|
-
// so they surface even in strict='throw' mode without aborting a render.
|
|
664
|
-
warn(input) {
|
|
665
|
-
this.diagnostics.warn(input);
|
|
666
|
-
}
|
|
667
|
-
invariant(condition, input) {
|
|
668
|
-
if (!condition) this.violate(input);
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
|
|
672
689
|
// ../../lib/contract/src/diagnostics/aria.ts
|
|
673
690
|
import { DiagnosticCategory, DiagnosticCode } from "../_shared/diagnostics.js";
|
|
674
691
|
var AriaDiagnostics = {
|
|
@@ -1025,6 +1042,28 @@ var SlotDiagnostics = {
|
|
|
1025
1042
|
}
|
|
1026
1043
|
};
|
|
1027
1044
|
|
|
1045
|
+
// ../../lib/contract/src/strict/invariant-base.ts
|
|
1046
|
+
var InvariantBase = class {
|
|
1047
|
+
diagnostics;
|
|
1048
|
+
constructor(diagnostics) {
|
|
1049
|
+
this.diagnostics = diagnostics;
|
|
1050
|
+
}
|
|
1051
|
+
get active() {
|
|
1052
|
+
return this.diagnostics.active;
|
|
1053
|
+
}
|
|
1054
|
+
violate(input) {
|
|
1055
|
+
this.diagnostics.error(input);
|
|
1056
|
+
}
|
|
1057
|
+
// Always caps at warn — never throws. ARIA 'warning' violations route here
|
|
1058
|
+
// so they surface even in strict='throw' mode without aborting a render.
|
|
1059
|
+
warn(input) {
|
|
1060
|
+
this.diagnostics.warn(input);
|
|
1061
|
+
}
|
|
1062
|
+
invariant(condition, input) {
|
|
1063
|
+
if (!condition) this.violate(input);
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1028
1067
|
// ../../lib/contract/src/aria/polymorphic-validator.ts
|
|
1029
1068
|
var VALID = [{ valid: true }];
|
|
1030
1069
|
function isIntrinsicTag(tag) {
|
|
@@ -1036,8 +1075,7 @@ function omitProp(obj, key) {
|
|
|
1036
1075
|
}
|
|
1037
1076
|
var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
1038
1077
|
#extraRules;
|
|
1039
|
-
#planCache =
|
|
1040
|
-
static #MAX_CACHE = 100;
|
|
1078
|
+
#planCache = new LRUCache(100);
|
|
1041
1079
|
// Memoized AriaFix objects keyed by attribute name — the ARIA attribute set is
|
|
1042
1080
|
// finite so this Map is bounded and avoids recreating closures on every cache miss.
|
|
1043
1081
|
static #removeAttributeFixCache = /* @__PURE__ */ new Map();
|
|
@@ -1193,8 +1231,6 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
|
1193
1231
|
if (!isNull(key)) {
|
|
1194
1232
|
const cached = this.#planCache.get(key);
|
|
1195
1233
|
if (cached !== void 0) {
|
|
1196
|
-
this.#planCache.delete(key);
|
|
1197
|
-
this.#planCache.set(key, cached);
|
|
1198
1234
|
if (cached.violations.length > 0) this.report(cached.violations);
|
|
1199
1235
|
return {
|
|
1200
1236
|
props: _AriaPolicyEngine.#applyPlan(props, cached.removals, cached.updates),
|
|
@@ -1211,10 +1247,6 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
|
1211
1247
|
);
|
|
1212
1248
|
const plan = { removals, updates, violations: result.violations };
|
|
1213
1249
|
this.#planCache.set(key, plan);
|
|
1214
|
-
if (this.#planCache.size > _AriaPolicyEngine.#MAX_CACHE) {
|
|
1215
|
-
const lru = this.#planCache.keys().next().value;
|
|
1216
|
-
if (lru !== void 0) this.#planCache.delete(lru);
|
|
1217
|
-
}
|
|
1218
1250
|
}
|
|
1219
1251
|
return result;
|
|
1220
1252
|
}
|
|
@@ -2289,7 +2321,7 @@ function cva2(base, config) {
|
|
|
2289
2321
|
// ../../lib/styling/src/static-class-resolver.ts
|
|
2290
2322
|
var StaticClassResolver = class {
|
|
2291
2323
|
#baseClass;
|
|
2292
|
-
#cache =
|
|
2324
|
+
#cache = new LRUCache(200);
|
|
2293
2325
|
#resolveTag;
|
|
2294
2326
|
constructor(baseClass, tagMap) {
|
|
2295
2327
|
this.#baseClass = Array.isArray(baseClass) ? baseClass.join(" ") : baseClass;
|
|
@@ -2303,17 +2335,9 @@ var StaticClassResolver = class {
|
|
|
2303
2335
|
resolve(tag, skipTagMap = false) {
|
|
2304
2336
|
if (typeof tag !== "string" || skipTagMap) return this.#baseClass;
|
|
2305
2337
|
const cached = this.#cache.get(tag);
|
|
2306
|
-
if (cached !== void 0)
|
|
2307
|
-
this.#cache.delete(tag);
|
|
2308
|
-
this.#cache.set(tag, cached);
|
|
2309
|
-
return cached;
|
|
2310
|
-
}
|
|
2338
|
+
if (cached !== void 0) return cached;
|
|
2311
2339
|
const result = this.#resolveTag(tag);
|
|
2312
2340
|
this.#cache.set(tag, result);
|
|
2313
|
-
if (this.#cache.size > 200) {
|
|
2314
|
-
const lru = this.#cache.keys().next().value;
|
|
2315
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
2316
|
-
}
|
|
2317
2341
|
return result;
|
|
2318
2342
|
}
|
|
2319
2343
|
};
|
|
@@ -2324,7 +2348,7 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
2324
2348
|
#recipeMap;
|
|
2325
2349
|
#variantKeys;
|
|
2326
2350
|
#precomputedClasses;
|
|
2327
|
-
#cache =
|
|
2351
|
+
#cache = new LRUCache(1e3);
|
|
2328
2352
|
constructor(cvaFn, recipeMap, variantKeys, precomputedClasses) {
|
|
2329
2353
|
this.#cvaFn = cvaFn ?? null;
|
|
2330
2354
|
this.#recipeMap = Object.freeze(recipeMap ?? {});
|
|
@@ -2339,17 +2363,9 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
2339
2363
|
if (precomputed !== void 0) return precomputed;
|
|
2340
2364
|
}
|
|
2341
2365
|
const cached = this.#cache.get(cacheKey);
|
|
2342
|
-
if (cached !== void 0)
|
|
2343
|
-
this.#cache.delete(cacheKey);
|
|
2344
|
-
this.#cache.set(cacheKey, cached);
|
|
2345
|
-
return cached;
|
|
2346
|
-
}
|
|
2366
|
+
if (cached !== void 0) return cached;
|
|
2347
2367
|
const result = this.#compute(props, recipe);
|
|
2348
2368
|
this.#cache.set(cacheKey, result);
|
|
2349
|
-
if (this.#cache.size > 1e3) {
|
|
2350
|
-
const lru = this.#cache.keys().next().value;
|
|
2351
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
2352
|
-
}
|
|
2353
2369
|
return result;
|
|
2354
2370
|
}
|
|
2355
2371
|
#compute(props, recipe) {
|
package/dist/svelte/index.js
CHANGED
|
@@ -507,6 +507,45 @@ var iterate = Object.freeze({
|
|
|
507
507
|
values
|
|
508
508
|
});
|
|
509
509
|
|
|
510
|
+
// ../../lib/primitive/src/utils/lru-cache.ts
|
|
511
|
+
var LRUCache = class {
|
|
512
|
+
#maxSize;
|
|
513
|
+
#store = /* @__PURE__ */ new Map();
|
|
514
|
+
constructor(maxSize) {
|
|
515
|
+
if (!Number.isInteger(maxSize) || maxSize < 1) {
|
|
516
|
+
throw new RangeError("LRUCache maxSize must be a positive integer.");
|
|
517
|
+
}
|
|
518
|
+
this.#maxSize = maxSize;
|
|
519
|
+
}
|
|
520
|
+
get(key) {
|
|
521
|
+
if (!this.#store.has(key)) return void 0;
|
|
522
|
+
const value = this.#store.get(key);
|
|
523
|
+
this.#store.delete(key);
|
|
524
|
+
this.#store.set(key, value);
|
|
525
|
+
return value;
|
|
526
|
+
}
|
|
527
|
+
set(key, value) {
|
|
528
|
+
this.#store.delete(key);
|
|
529
|
+
this.#store.set(key, value);
|
|
530
|
+
if (this.#store.size > this.#maxSize) {
|
|
531
|
+
const lru = this.#store.keys().next().value;
|
|
532
|
+
if (lru !== void 0) this.#store.delete(lru);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
has(key) {
|
|
536
|
+
return this.#store.has(key);
|
|
537
|
+
}
|
|
538
|
+
delete(key) {
|
|
539
|
+
return this.#store.delete(key);
|
|
540
|
+
}
|
|
541
|
+
get size() {
|
|
542
|
+
return this.#store.size;
|
|
543
|
+
}
|
|
544
|
+
clear() {
|
|
545
|
+
this.#store.clear();
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
|
|
510
549
|
// ../../lib/primitive/src/utils/merge-props.ts
|
|
511
550
|
function mergeProps(defaultProps, props) {
|
|
512
551
|
return {
|
|
@@ -551,28 +590,6 @@ function isTag(...args) {
|
|
|
551
590
|
return tag !== void 0 && set2.has(tag);
|
|
552
591
|
}
|
|
553
592
|
|
|
554
|
-
// ../../lib/contract/src/strict/invariant-base.ts
|
|
555
|
-
var InvariantBase = class {
|
|
556
|
-
diagnostics;
|
|
557
|
-
constructor(diagnostics) {
|
|
558
|
-
this.diagnostics = diagnostics;
|
|
559
|
-
}
|
|
560
|
-
get active() {
|
|
561
|
-
return this.diagnostics.active;
|
|
562
|
-
}
|
|
563
|
-
violate(input) {
|
|
564
|
-
this.diagnostics.error(input);
|
|
565
|
-
}
|
|
566
|
-
// Always caps at warn — never throws. ARIA 'warning' violations route here
|
|
567
|
-
// so they surface even in strict='throw' mode without aborting a render.
|
|
568
|
-
warn(input) {
|
|
569
|
-
this.diagnostics.warn(input);
|
|
570
|
-
}
|
|
571
|
-
invariant(condition, input) {
|
|
572
|
-
if (!condition) this.violate(input);
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
|
|
576
593
|
// ../../lib/contract/src/diagnostics/aria.ts
|
|
577
594
|
import { DiagnosticCategory, DiagnosticCode } from "../_shared/diagnostics.js";
|
|
578
595
|
var AriaDiagnostics = {
|
|
@@ -929,6 +946,28 @@ var SlotDiagnostics = {
|
|
|
929
946
|
}
|
|
930
947
|
};
|
|
931
948
|
|
|
949
|
+
// ../../lib/contract/src/strict/invariant-base.ts
|
|
950
|
+
var InvariantBase = class {
|
|
951
|
+
diagnostics;
|
|
952
|
+
constructor(diagnostics) {
|
|
953
|
+
this.diagnostics = diagnostics;
|
|
954
|
+
}
|
|
955
|
+
get active() {
|
|
956
|
+
return this.diagnostics.active;
|
|
957
|
+
}
|
|
958
|
+
violate(input) {
|
|
959
|
+
this.diagnostics.error(input);
|
|
960
|
+
}
|
|
961
|
+
// Always caps at warn — never throws. ARIA 'warning' violations route here
|
|
962
|
+
// so they surface even in strict='throw' mode without aborting a render.
|
|
963
|
+
warn(input) {
|
|
964
|
+
this.diagnostics.warn(input);
|
|
965
|
+
}
|
|
966
|
+
invariant(condition, input) {
|
|
967
|
+
if (!condition) this.violate(input);
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
|
|
932
971
|
// ../../lib/contract/src/aria/polymorphic-validator.ts
|
|
933
972
|
var VALID = [{ valid: true }];
|
|
934
973
|
function isIntrinsicTag(tag) {
|
|
@@ -940,8 +979,7 @@ function omitProp(obj, key) {
|
|
|
940
979
|
}
|
|
941
980
|
var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
942
981
|
#extraRules;
|
|
943
|
-
#planCache =
|
|
944
|
-
static #MAX_CACHE = 100;
|
|
982
|
+
#planCache = new LRUCache(100);
|
|
945
983
|
// Memoized AriaFix objects keyed by attribute name — the ARIA attribute set is
|
|
946
984
|
// finite so this Map is bounded and avoids recreating closures on every cache miss.
|
|
947
985
|
static #removeAttributeFixCache = /* @__PURE__ */ new Map();
|
|
@@ -1097,8 +1135,6 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
|
1097
1135
|
if (!isNull(key)) {
|
|
1098
1136
|
const cached = this.#planCache.get(key);
|
|
1099
1137
|
if (cached !== void 0) {
|
|
1100
|
-
this.#planCache.delete(key);
|
|
1101
|
-
this.#planCache.set(key, cached);
|
|
1102
1138
|
if (cached.violations.length > 0) this.report(cached.violations);
|
|
1103
1139
|
return {
|
|
1104
1140
|
props: _AriaPolicyEngine.#applyPlan(props, cached.removals, cached.updates),
|
|
@@ -1115,10 +1151,6 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
|
1115
1151
|
);
|
|
1116
1152
|
const plan = { removals, updates, violations: result.violations };
|
|
1117
1153
|
this.#planCache.set(key, plan);
|
|
1118
|
-
if (this.#planCache.size > _AriaPolicyEngine.#MAX_CACHE) {
|
|
1119
|
-
const lru = this.#planCache.keys().next().value;
|
|
1120
|
-
if (lru !== void 0) this.#planCache.delete(lru);
|
|
1121
|
-
}
|
|
1122
1154
|
}
|
|
1123
1155
|
return result;
|
|
1124
1156
|
}
|
|
@@ -2193,7 +2225,7 @@ function cva2(base, config) {
|
|
|
2193
2225
|
// ../../lib/styling/src/static-class-resolver.ts
|
|
2194
2226
|
var StaticClassResolver = class {
|
|
2195
2227
|
#baseClass;
|
|
2196
|
-
#cache =
|
|
2228
|
+
#cache = new LRUCache(200);
|
|
2197
2229
|
#resolveTag;
|
|
2198
2230
|
constructor(baseClass, tagMap) {
|
|
2199
2231
|
this.#baseClass = Array.isArray(baseClass) ? baseClass.join(" ") : baseClass;
|
|
@@ -2207,17 +2239,9 @@ var StaticClassResolver = class {
|
|
|
2207
2239
|
resolve(tag, skipTagMap = false) {
|
|
2208
2240
|
if (typeof tag !== "string" || skipTagMap) return this.#baseClass;
|
|
2209
2241
|
const cached = this.#cache.get(tag);
|
|
2210
|
-
if (cached !== void 0)
|
|
2211
|
-
this.#cache.delete(tag);
|
|
2212
|
-
this.#cache.set(tag, cached);
|
|
2213
|
-
return cached;
|
|
2214
|
-
}
|
|
2242
|
+
if (cached !== void 0) return cached;
|
|
2215
2243
|
const result = this.#resolveTag(tag);
|
|
2216
2244
|
this.#cache.set(tag, result);
|
|
2217
|
-
if (this.#cache.size > 200) {
|
|
2218
|
-
const lru = this.#cache.keys().next().value;
|
|
2219
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
2220
|
-
}
|
|
2221
2245
|
return result;
|
|
2222
2246
|
}
|
|
2223
2247
|
};
|
|
@@ -2228,7 +2252,7 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
2228
2252
|
#recipeMap;
|
|
2229
2253
|
#variantKeys;
|
|
2230
2254
|
#precomputedClasses;
|
|
2231
|
-
#cache =
|
|
2255
|
+
#cache = new LRUCache(1e3);
|
|
2232
2256
|
constructor(cvaFn, recipeMap, variantKeys, precomputedClasses) {
|
|
2233
2257
|
this.#cvaFn = cvaFn ?? null;
|
|
2234
2258
|
this.#recipeMap = Object.freeze(recipeMap ?? {});
|
|
@@ -2243,17 +2267,9 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
2243
2267
|
if (precomputed !== void 0) return precomputed;
|
|
2244
2268
|
}
|
|
2245
2269
|
const cached = this.#cache.get(cacheKey);
|
|
2246
|
-
if (cached !== void 0)
|
|
2247
|
-
this.#cache.delete(cacheKey);
|
|
2248
|
-
this.#cache.set(cacheKey, cached);
|
|
2249
|
-
return cached;
|
|
2250
|
-
}
|
|
2270
|
+
if (cached !== void 0) return cached;
|
|
2251
2271
|
const result = this.#compute(props, recipe);
|
|
2252
2272
|
this.#cache.set(cacheKey, result);
|
|
2253
|
-
if (this.#cache.size > 1e3) {
|
|
2254
|
-
const lru = this.#cache.keys().next().value;
|
|
2255
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
2256
|
-
}
|
|
2257
2273
|
return result;
|
|
2258
2274
|
}
|
|
2259
2275
|
#compute(props, recipe) {
|
package/dist/tailwind/index.js
CHANGED
|
@@ -184,6 +184,45 @@ var iterate = Object.freeze({
|
|
|
184
184
|
values
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
+
// ../../lib/primitive/src/utils/lru-cache.ts
|
|
188
|
+
var LRUCache = class {
|
|
189
|
+
#maxSize;
|
|
190
|
+
#store = /* @__PURE__ */ new Map();
|
|
191
|
+
constructor(maxSize) {
|
|
192
|
+
if (!Number.isInteger(maxSize) || maxSize < 1) {
|
|
193
|
+
throw new RangeError("LRUCache maxSize must be a positive integer.");
|
|
194
|
+
}
|
|
195
|
+
this.#maxSize = maxSize;
|
|
196
|
+
}
|
|
197
|
+
get(key) {
|
|
198
|
+
if (!this.#store.has(key)) return void 0;
|
|
199
|
+
const value = this.#store.get(key);
|
|
200
|
+
this.#store.delete(key);
|
|
201
|
+
this.#store.set(key, value);
|
|
202
|
+
return value;
|
|
203
|
+
}
|
|
204
|
+
set(key, value) {
|
|
205
|
+
this.#store.delete(key);
|
|
206
|
+
this.#store.set(key, value);
|
|
207
|
+
if (this.#store.size > this.#maxSize) {
|
|
208
|
+
const lru = this.#store.keys().next().value;
|
|
209
|
+
if (lru !== void 0) this.#store.delete(lru);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
has(key) {
|
|
213
|
+
return this.#store.has(key);
|
|
214
|
+
}
|
|
215
|
+
delete(key) {
|
|
216
|
+
return this.#store.delete(key);
|
|
217
|
+
}
|
|
218
|
+
get size() {
|
|
219
|
+
return this.#store.size;
|
|
220
|
+
}
|
|
221
|
+
clear() {
|
|
222
|
+
this.#store.clear();
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
187
226
|
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
188
227
|
import { clsx as clsx2 } from "clsx";
|
|
189
228
|
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
@@ -236,7 +275,7 @@ function cva2(base, config) {
|
|
|
236
275
|
// ../../lib/styling/src/static-class-resolver.ts
|
|
237
276
|
var StaticClassResolver = class {
|
|
238
277
|
#baseClass;
|
|
239
|
-
#cache =
|
|
278
|
+
#cache = new LRUCache(200);
|
|
240
279
|
#resolveTag;
|
|
241
280
|
constructor(baseClass, tagMap) {
|
|
242
281
|
this.#baseClass = Array.isArray(baseClass) ? baseClass.join(" ") : baseClass;
|
|
@@ -250,17 +289,9 @@ var StaticClassResolver = class {
|
|
|
250
289
|
resolve(tag, skipTagMap = false) {
|
|
251
290
|
if (typeof tag !== "string" || skipTagMap) return this.#baseClass;
|
|
252
291
|
const cached = this.#cache.get(tag);
|
|
253
|
-
if (cached !== void 0)
|
|
254
|
-
this.#cache.delete(tag);
|
|
255
|
-
this.#cache.set(tag, cached);
|
|
256
|
-
return cached;
|
|
257
|
-
}
|
|
292
|
+
if (cached !== void 0) return cached;
|
|
258
293
|
const result = this.#resolveTag(tag);
|
|
259
294
|
this.#cache.set(tag, result);
|
|
260
|
-
if (this.#cache.size > 200) {
|
|
261
|
-
const lru = this.#cache.keys().next().value;
|
|
262
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
263
|
-
}
|
|
264
295
|
return result;
|
|
265
296
|
}
|
|
266
297
|
};
|
|
@@ -271,7 +302,7 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
271
302
|
#recipeMap;
|
|
272
303
|
#variantKeys;
|
|
273
304
|
#precomputedClasses;
|
|
274
|
-
#cache =
|
|
305
|
+
#cache = new LRUCache(1e3);
|
|
275
306
|
constructor(cvaFn, recipeMap, variantKeys, precomputedClasses) {
|
|
276
307
|
this.#cvaFn = cvaFn ?? null;
|
|
277
308
|
this.#recipeMap = Object.freeze(recipeMap ?? {});
|
|
@@ -286,17 +317,9 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
286
317
|
if (precomputed !== void 0) return precomputed;
|
|
287
318
|
}
|
|
288
319
|
const cached = this.#cache.get(cacheKey);
|
|
289
|
-
if (cached !== void 0)
|
|
290
|
-
this.#cache.delete(cacheKey);
|
|
291
|
-
this.#cache.set(cacheKey, cached);
|
|
292
|
-
return cached;
|
|
293
|
-
}
|
|
320
|
+
if (cached !== void 0) return cached;
|
|
294
321
|
const result = this.#compute(props, recipe);
|
|
295
322
|
this.#cache.set(cacheKey, result);
|
|
296
|
-
if (this.#cache.size > 1e3) {
|
|
297
|
-
const lru = this.#cache.keys().next().value;
|
|
298
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
299
|
-
}
|
|
300
323
|
return result;
|
|
301
324
|
}
|
|
302
325
|
#compute(props, recipe) {
|
|
@@ -171,6 +171,19 @@ var iterate = Object.freeze({
|
|
|
171
171
|
values
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
+
// ../../lib/primitive/src/utils/lazy.ts
|
|
175
|
+
function lazy(factory) {
|
|
176
|
+
let initialized = false;
|
|
177
|
+
let value;
|
|
178
|
+
return () => {
|
|
179
|
+
if (!initialized) {
|
|
180
|
+
value = factory();
|
|
181
|
+
initialized = true;
|
|
182
|
+
}
|
|
183
|
+
return value;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
174
187
|
// ../../plugins/vite/src/ast.ts
|
|
175
188
|
function getProperty(obj, key) {
|
|
176
189
|
return iterate.find(obj.properties, (prop) => {
|
|
@@ -744,8 +757,7 @@ function analyzeJsxSites(source, constraints, severity) {
|
|
|
744
757
|
count = ZERO;
|
|
745
758
|
}
|
|
746
759
|
if (!tagName) return;
|
|
747
|
-
|
|
748
|
-
const getPos = () => pos ??= source.getLineAndCharacterOfPosition(node.getStart(source));
|
|
760
|
+
const getPos = lazy(() => source.getLineAndCharacterOfPosition(node.getStart(source)));
|
|
749
761
|
if (count !== void 0) {
|
|
750
762
|
const c = byName.get(tagName);
|
|
751
763
|
if (c && (count.max < c.totalMin || c.exclusiveChildren && count.min > c.totalMax)) {
|
package/dist/vue/index.js
CHANGED
|
@@ -650,6 +650,45 @@ var iterate = Object.freeze({
|
|
|
650
650
|
values
|
|
651
651
|
});
|
|
652
652
|
|
|
653
|
+
// ../../lib/primitive/src/utils/lru-cache.ts
|
|
654
|
+
var LRUCache = class {
|
|
655
|
+
#maxSize;
|
|
656
|
+
#store = /* @__PURE__ */ new Map();
|
|
657
|
+
constructor(maxSize) {
|
|
658
|
+
if (!Number.isInteger(maxSize) || maxSize < 1) {
|
|
659
|
+
throw new RangeError("LRUCache maxSize must be a positive integer.");
|
|
660
|
+
}
|
|
661
|
+
this.#maxSize = maxSize;
|
|
662
|
+
}
|
|
663
|
+
get(key) {
|
|
664
|
+
if (!this.#store.has(key)) return void 0;
|
|
665
|
+
const value = this.#store.get(key);
|
|
666
|
+
this.#store.delete(key);
|
|
667
|
+
this.#store.set(key, value);
|
|
668
|
+
return value;
|
|
669
|
+
}
|
|
670
|
+
set(key, value) {
|
|
671
|
+
this.#store.delete(key);
|
|
672
|
+
this.#store.set(key, value);
|
|
673
|
+
if (this.#store.size > this.#maxSize) {
|
|
674
|
+
const lru = this.#store.keys().next().value;
|
|
675
|
+
if (lru !== void 0) this.#store.delete(lru);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
has(key) {
|
|
679
|
+
return this.#store.has(key);
|
|
680
|
+
}
|
|
681
|
+
delete(key) {
|
|
682
|
+
return this.#store.delete(key);
|
|
683
|
+
}
|
|
684
|
+
get size() {
|
|
685
|
+
return this.#store.size;
|
|
686
|
+
}
|
|
687
|
+
clear() {
|
|
688
|
+
this.#store.clear();
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
|
|
653
692
|
// ../../lib/primitive/src/utils/merge-props.ts
|
|
654
693
|
function mergeProps(defaultProps, props) {
|
|
655
694
|
return {
|
|
@@ -658,28 +697,6 @@ function mergeProps(defaultProps, props) {
|
|
|
658
697
|
};
|
|
659
698
|
}
|
|
660
699
|
|
|
661
|
-
// ../../lib/contract/src/strict/invariant-base.ts
|
|
662
|
-
var InvariantBase = class {
|
|
663
|
-
diagnostics;
|
|
664
|
-
constructor(diagnostics) {
|
|
665
|
-
this.diagnostics = diagnostics;
|
|
666
|
-
}
|
|
667
|
-
get active() {
|
|
668
|
-
return this.diagnostics.active;
|
|
669
|
-
}
|
|
670
|
-
violate(input) {
|
|
671
|
-
this.diagnostics.error(input);
|
|
672
|
-
}
|
|
673
|
-
// Always caps at warn — never throws. ARIA 'warning' violations route here
|
|
674
|
-
// so they surface even in strict='throw' mode without aborting a render.
|
|
675
|
-
warn(input) {
|
|
676
|
-
this.diagnostics.warn(input);
|
|
677
|
-
}
|
|
678
|
-
invariant(condition, input) {
|
|
679
|
-
if (!condition) this.violate(input);
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
|
|
683
700
|
// ../../lib/contract/src/diagnostics/aria.ts
|
|
684
701
|
import { DiagnosticCategory, DiagnosticCode } from "../_shared/diagnostics.js";
|
|
685
702
|
var AriaDiagnostics = {
|
|
@@ -1036,6 +1053,28 @@ var SlotDiagnostics = {
|
|
|
1036
1053
|
}
|
|
1037
1054
|
};
|
|
1038
1055
|
|
|
1056
|
+
// ../../lib/contract/src/strict/invariant-base.ts
|
|
1057
|
+
var InvariantBase = class {
|
|
1058
|
+
diagnostics;
|
|
1059
|
+
constructor(diagnostics) {
|
|
1060
|
+
this.diagnostics = diagnostics;
|
|
1061
|
+
}
|
|
1062
|
+
get active() {
|
|
1063
|
+
return this.diagnostics.active;
|
|
1064
|
+
}
|
|
1065
|
+
violate(input) {
|
|
1066
|
+
this.diagnostics.error(input);
|
|
1067
|
+
}
|
|
1068
|
+
// Always caps at warn — never throws. ARIA 'warning' violations route here
|
|
1069
|
+
// so they surface even in strict='throw' mode without aborting a render.
|
|
1070
|
+
warn(input) {
|
|
1071
|
+
this.diagnostics.warn(input);
|
|
1072
|
+
}
|
|
1073
|
+
invariant(condition, input) {
|
|
1074
|
+
if (!condition) this.violate(input);
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1039
1078
|
// ../../lib/contract/src/aria/polymorphic-validator.ts
|
|
1040
1079
|
var VALID = [{ valid: true }];
|
|
1041
1080
|
function isIntrinsicTag(tag) {
|
|
@@ -1047,8 +1086,7 @@ function omitProp(obj, key) {
|
|
|
1047
1086
|
}
|
|
1048
1087
|
var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
1049
1088
|
#extraRules;
|
|
1050
|
-
#planCache =
|
|
1051
|
-
static #MAX_CACHE = 100;
|
|
1089
|
+
#planCache = new LRUCache(100);
|
|
1052
1090
|
// Memoized AriaFix objects keyed by attribute name — the ARIA attribute set is
|
|
1053
1091
|
// finite so this Map is bounded and avoids recreating closures on every cache miss.
|
|
1054
1092
|
static #removeAttributeFixCache = /* @__PURE__ */ new Map();
|
|
@@ -1204,8 +1242,6 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
|
1204
1242
|
if (!isNull(key)) {
|
|
1205
1243
|
const cached = this.#planCache.get(key);
|
|
1206
1244
|
if (cached !== void 0) {
|
|
1207
|
-
this.#planCache.delete(key);
|
|
1208
|
-
this.#planCache.set(key, cached);
|
|
1209
1245
|
if (cached.violations.length > 0) this.report(cached.violations);
|
|
1210
1246
|
return {
|
|
1211
1247
|
props: _AriaPolicyEngine.#applyPlan(props, cached.removals, cached.updates),
|
|
@@ -1222,10 +1258,6 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
|
|
|
1222
1258
|
);
|
|
1223
1259
|
const plan = { removals, updates, violations: result.violations };
|
|
1224
1260
|
this.#planCache.set(key, plan);
|
|
1225
|
-
if (this.#planCache.size > _AriaPolicyEngine.#MAX_CACHE) {
|
|
1226
|
-
const lru = this.#planCache.keys().next().value;
|
|
1227
|
-
if (lru !== void 0) this.#planCache.delete(lru);
|
|
1228
|
-
}
|
|
1229
1261
|
}
|
|
1230
1262
|
return result;
|
|
1231
1263
|
}
|
|
@@ -2300,7 +2332,7 @@ function cva2(base, config) {
|
|
|
2300
2332
|
// ../../lib/styling/src/static-class-resolver.ts
|
|
2301
2333
|
var StaticClassResolver = class {
|
|
2302
2334
|
#baseClass;
|
|
2303
|
-
#cache =
|
|
2335
|
+
#cache = new LRUCache(200);
|
|
2304
2336
|
#resolveTag;
|
|
2305
2337
|
constructor(baseClass, tagMap) {
|
|
2306
2338
|
this.#baseClass = Array.isArray(baseClass) ? baseClass.join(" ") : baseClass;
|
|
@@ -2314,17 +2346,9 @@ var StaticClassResolver = class {
|
|
|
2314
2346
|
resolve(tag, skipTagMap = false) {
|
|
2315
2347
|
if (typeof tag !== "string" || skipTagMap) return this.#baseClass;
|
|
2316
2348
|
const cached = this.#cache.get(tag);
|
|
2317
|
-
if (cached !== void 0)
|
|
2318
|
-
this.#cache.delete(tag);
|
|
2319
|
-
this.#cache.set(tag, cached);
|
|
2320
|
-
return cached;
|
|
2321
|
-
}
|
|
2349
|
+
if (cached !== void 0) return cached;
|
|
2322
2350
|
const result = this.#resolveTag(tag);
|
|
2323
2351
|
this.#cache.set(tag, result);
|
|
2324
|
-
if (this.#cache.size > 200) {
|
|
2325
|
-
const lru = this.#cache.keys().next().value;
|
|
2326
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
2327
|
-
}
|
|
2328
2352
|
return result;
|
|
2329
2353
|
}
|
|
2330
2354
|
};
|
|
@@ -2335,7 +2359,7 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
2335
2359
|
#recipeMap;
|
|
2336
2360
|
#variantKeys;
|
|
2337
2361
|
#precomputedClasses;
|
|
2338
|
-
#cache =
|
|
2362
|
+
#cache = new LRUCache(1e3);
|
|
2339
2363
|
constructor(cvaFn, recipeMap, variantKeys, precomputedClasses) {
|
|
2340
2364
|
this.#cvaFn = cvaFn ?? null;
|
|
2341
2365
|
this.#recipeMap = Object.freeze(recipeMap ?? {});
|
|
@@ -2350,17 +2374,9 @@ var VariantClassResolver = class _VariantClassResolver {
|
|
|
2350
2374
|
if (precomputed !== void 0) return precomputed;
|
|
2351
2375
|
}
|
|
2352
2376
|
const cached = this.#cache.get(cacheKey);
|
|
2353
|
-
if (cached !== void 0)
|
|
2354
|
-
this.#cache.delete(cacheKey);
|
|
2355
|
-
this.#cache.set(cacheKey, cached);
|
|
2356
|
-
return cached;
|
|
2357
|
-
}
|
|
2377
|
+
if (cached !== void 0) return cached;
|
|
2358
2378
|
const result = this.#compute(props, recipe);
|
|
2359
2379
|
this.#cache.set(cacheKey, result);
|
|
2360
|
-
if (this.#cache.size > 1e3) {
|
|
2361
|
-
const lru = this.#cache.keys().next().value;
|
|
2362
|
-
if (lru !== void 0) this.#cache.delete(lru);
|
|
2363
|
-
}
|
|
2364
2380
|
return result;
|
|
2365
2381
|
}
|
|
2366
2382
|
#compute(props, recipe) {
|