praxis-kit 4.0.3 → 4.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/_shared/diagnostics.d.ts +14 -17
- package/dist/{chunk-DRGZ4ZI2.js → chunk-LA6WGQA6.js} +963 -633
- package/dist/contract/index.d.ts +39 -27
- package/dist/lit/index.d.ts +42 -30
- package/dist/lit/index.js +649 -413
- package/dist/preact/index.d.ts +45 -31
- package/dist/preact/index.js +1004 -684
- package/dist/react/index.d.ts +24 -11
- package/dist/react/index.js +21 -143
- package/dist/react/legacy.d.ts +3 -3
- package/dist/react/legacy.js +28 -147
- package/dist/{merge-refs-B0YcfdtP.d.ts → react-options-XrRof248.d.ts} +156 -100
- package/dist/solid/index.d.ts +45 -31
- package/dist/solid/index.js +517 -296
- package/dist/svelte/index.d.ts +55 -34
- package/dist/svelte/index.js +500 -296
- package/dist/tailwind/index.d.ts +29 -22
- package/dist/vite-plugin/index.d.ts +10 -12
- package/dist/vue/index.d.ts +45 -31
- package/dist/vue/index.js +893 -692
- package/dist/web/index.d.ts +43 -31
- package/dist/web/index.js +648 -406
- package/package.json +4 -4
package/dist/svelte/index.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
// ../../lib/
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// ../../lib/adapter-utils/src/runtime/define-component.ts
|
|
2
|
+
function defineContractComponent(options) {
|
|
3
|
+
return (factory) => factory(options);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// ../../lib/primitive/src/guards/foundational/is-defined.ts
|
|
7
|
+
function isUndefined(value) {
|
|
8
|
+
return value === void 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// ../../lib/primitive/src/guards/foundational/is-null.ts
|
|
12
|
+
function isNull(value) {
|
|
13
|
+
return value === null;
|
|
6
14
|
}
|
|
7
15
|
|
|
8
16
|
// ../../lib/primitive/src/utils/is-object.ts
|
|
@@ -17,195 +25,6 @@ function isNumber(value) {
|
|
|
17
25
|
return typeof value === "number";
|
|
18
26
|
}
|
|
19
27
|
|
|
20
|
-
// ../../lib/primitive/src/utils/assert-never.ts
|
|
21
|
-
function assertNever(value) {
|
|
22
|
-
throw new Error(`Unexpected value: ${String(value)}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// ../../lib/primitive/src/utils/cn.ts
|
|
26
|
-
import { clsx } from "clsx";
|
|
27
|
-
function cn(...inputs) {
|
|
28
|
-
return clsx(...inputs);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ../../lib/primitive/src/utils/iterate.ts
|
|
32
|
-
function find(iterable, callback) {
|
|
33
|
-
for (const value of iterable) {
|
|
34
|
-
const result = callback(value);
|
|
35
|
-
if (result != null) {
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
function some(iterable, predicate) {
|
|
42
|
-
for (const value of iterable) {
|
|
43
|
-
if (predicate(value)) return true;
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
function every(iterable, predicate) {
|
|
48
|
-
let index = 0;
|
|
49
|
-
for (const value of iterable) {
|
|
50
|
-
if (!predicate(value, index++)) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
function* filter(iterable, predicate) {
|
|
57
|
-
let index = 0;
|
|
58
|
-
for (const value of iterable) {
|
|
59
|
-
if (predicate(value, index++)) {
|
|
60
|
-
yield value;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function* map(iterable, callback) {
|
|
65
|
-
let index = 0;
|
|
66
|
-
for (const value of iterable) {
|
|
67
|
-
yield callback(value, index++);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function forEach(iterable, callback) {
|
|
71
|
-
let index = 0;
|
|
72
|
-
for (const value of iterable) {
|
|
73
|
-
callback(value, index++);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function reduce(iterable, initial, callback) {
|
|
77
|
-
let accumulator = initial;
|
|
78
|
-
let index = 0;
|
|
79
|
-
for (const value of iterable) {
|
|
80
|
-
accumulator = callback(accumulator, value, index++);
|
|
81
|
-
}
|
|
82
|
-
return accumulator;
|
|
83
|
-
}
|
|
84
|
-
function collect(iterable, callback) {
|
|
85
|
-
const result = {};
|
|
86
|
-
let index = 0;
|
|
87
|
-
for (const value of iterable) {
|
|
88
|
-
const entry = callback(value, index++);
|
|
89
|
-
if (entry === null) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
result[entry[0]] = entry[1];
|
|
93
|
-
}
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
function findLast(value, callback) {
|
|
97
|
-
for (let index = value.length - 1; index >= 0; index--) {
|
|
98
|
-
const result = callback(value[index], index);
|
|
99
|
-
if (result != null) {
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
function* items(collection) {
|
|
106
|
-
for (let i = 0; i < collection.length; i++) {
|
|
107
|
-
const item = collection.item(i);
|
|
108
|
-
if (item !== null) {
|
|
109
|
-
yield item;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function nodeList(list) {
|
|
114
|
-
return {
|
|
115
|
-
*[Symbol.iterator]() {
|
|
116
|
-
for (let i = 0; i < list.length; i++) {
|
|
117
|
-
const node = list.item(i);
|
|
118
|
-
if (node !== null) {
|
|
119
|
-
yield node;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function mapEntries(m) {
|
|
126
|
-
return m.entries();
|
|
127
|
-
}
|
|
128
|
-
function set(s) {
|
|
129
|
-
return s.values();
|
|
130
|
-
}
|
|
131
|
-
function hasOwn(object, key) {
|
|
132
|
-
return Object.hasOwn(object, key);
|
|
133
|
-
}
|
|
134
|
-
function* entries(object) {
|
|
135
|
-
for (const key in object) {
|
|
136
|
-
if (!hasOwn(object, key)) continue;
|
|
137
|
-
yield [key, object[key]];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function* keys(object) {
|
|
141
|
-
for (const [key] of entries(object)) {
|
|
142
|
-
yield key;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function* values(object) {
|
|
146
|
-
for (const [, value] of entries(object)) {
|
|
147
|
-
yield value;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function mapValues(object, callback) {
|
|
151
|
-
const result = {};
|
|
152
|
-
for (const [key, value] of entries(object)) {
|
|
153
|
-
result[key] = callback(value, key);
|
|
154
|
-
}
|
|
155
|
-
return result;
|
|
156
|
-
}
|
|
157
|
-
function forEachEntry(object, callback) {
|
|
158
|
-
for (const [key, value] of entries(object)) {
|
|
159
|
-
callback(key, value);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function forEachKey(object, callback) {
|
|
163
|
-
for (const key of keys(object)) {
|
|
164
|
-
callback(key);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function forEachValue(object, callback) {
|
|
168
|
-
for (const value of values(object)) {
|
|
169
|
-
callback(value);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function forEachSet(s, callback) {
|
|
173
|
-
for (const value of s) {
|
|
174
|
-
callback(value);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
var iterate = Object.freeze({
|
|
178
|
-
entries,
|
|
179
|
-
filter,
|
|
180
|
-
find,
|
|
181
|
-
findLast,
|
|
182
|
-
forEach,
|
|
183
|
-
forEachEntry,
|
|
184
|
-
forEachKey,
|
|
185
|
-
forEachSet,
|
|
186
|
-
forEachValue,
|
|
187
|
-
items,
|
|
188
|
-
keys,
|
|
189
|
-
map,
|
|
190
|
-
mapEntries,
|
|
191
|
-
mapValues,
|
|
192
|
-
nodeList,
|
|
193
|
-
reduce,
|
|
194
|
-
collect,
|
|
195
|
-
set,
|
|
196
|
-
some,
|
|
197
|
-
every,
|
|
198
|
-
values
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
// ../../lib/primitive/src/utils/merge-props.ts
|
|
202
|
-
function mergeProps(defaultProps, props) {
|
|
203
|
-
return {
|
|
204
|
-
...defaultProps ?? {},
|
|
205
|
-
...props
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
28
|
// ../../lib/primitive/src/constants/aria/global-aria-attributes.ts
|
|
210
29
|
var GLOBAL_ARIA_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
211
30
|
"aria-atomic",
|
|
@@ -228,7 +47,7 @@ var GLOBAL_ARIA_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
228
47
|
]);
|
|
229
48
|
|
|
230
49
|
// ../../lib/primitive/src/constants/aria/implicit-role-record.ts
|
|
231
|
-
var IMPLICIT_ROLE_RECORD = {
|
|
50
|
+
var IMPLICIT_ROLE_RECORD = Object.freeze({
|
|
232
51
|
// Landmarks
|
|
233
52
|
article: "article",
|
|
234
53
|
aside: "complementary",
|
|
@@ -264,8 +83,8 @@ var IMPLICIT_ROLE_RECORD = {
|
|
|
264
83
|
meter: "meter",
|
|
265
84
|
output: "status",
|
|
266
85
|
progress: "progressbar"
|
|
267
|
-
};
|
|
268
|
-
var INPUT_TYPE_ROLE_MAP = {
|
|
86
|
+
});
|
|
87
|
+
var INPUT_TYPE_ROLE_MAP = Object.freeze({
|
|
269
88
|
checkbox: "checkbox",
|
|
270
89
|
radio: "radio",
|
|
271
90
|
range: "slider",
|
|
@@ -279,15 +98,17 @@ var INPUT_TYPE_ROLE_MAP = {
|
|
|
279
98
|
submit: "button",
|
|
280
99
|
reset: "button",
|
|
281
100
|
image: "button"
|
|
282
|
-
};
|
|
283
|
-
var STRONG_ROLES = [
|
|
101
|
+
});
|
|
102
|
+
var STRONG_ROLES = Object.freeze([
|
|
284
103
|
"main",
|
|
285
104
|
"navigation",
|
|
286
105
|
"complementary",
|
|
287
106
|
"contentinfo",
|
|
288
107
|
"banner"
|
|
289
|
-
];
|
|
290
|
-
var STANDALONE_ROLES = [
|
|
108
|
+
]);
|
|
109
|
+
var STANDALONE_ROLES = Object.freeze([
|
|
110
|
+
"article"
|
|
111
|
+
]);
|
|
291
112
|
var STRONG_ROLES_SET = new Set(STRONG_ROLES);
|
|
292
113
|
var STANDALONE_ROLES_SET = new Set(STANDALONE_ROLES);
|
|
293
114
|
|
|
@@ -442,16 +263,6 @@ var ROLE_RESTRICTED_ATTRIBUTES = /* @__PURE__ */ new Map([
|
|
|
442
263
|
]
|
|
443
264
|
]);
|
|
444
265
|
|
|
445
|
-
// ../../lib/primitive/src/guards/foundational/is-defined.ts
|
|
446
|
-
function isUndefined(value) {
|
|
447
|
-
return value === void 0;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// ../../lib/primitive/src/guards/foundational/is-null.ts
|
|
451
|
-
function isNull(value) {
|
|
452
|
-
return value === null;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
266
|
// ../../lib/primitive/src/guards/aria/is-aria-attribute.ts
|
|
456
267
|
function isGlobalAriaAttribute(attr) {
|
|
457
268
|
return GLOBAL_ARIA_ATTRIBUTES.has(attr);
|
|
@@ -473,11 +284,11 @@ function isStandaloneTag(tag) {
|
|
|
473
284
|
return STANDALONE_ROLES_SET.has(IMPLICIT_ROLE_RECORD[tag]);
|
|
474
285
|
}
|
|
475
286
|
function getInputImplicitRole(type) {
|
|
476
|
-
if (type
|
|
287
|
+
if (!isString(type) || !(type in INPUT_TYPE_ROLE_MAP)) return void 0;
|
|
477
288
|
return INPUT_TYPE_ROLE_MAP[type];
|
|
478
289
|
}
|
|
479
290
|
function getConditionalImplicitRole(tag, ariaLabel, ariaLabelledBy) {
|
|
480
|
-
const isNamed =
|
|
291
|
+
const isNamed = isString(ariaLabel) || isString(ariaLabelledBy);
|
|
481
292
|
if (!isNamed) return void 0;
|
|
482
293
|
if (tag === "section") return "region";
|
|
483
294
|
if (tag === "form") return "form";
|
|
@@ -495,6 +306,238 @@ function getImplicitRole(tag, props) {
|
|
|
495
306
|
return void 0;
|
|
496
307
|
}
|
|
497
308
|
|
|
309
|
+
// ../../lib/primitive/src/tag/resolve-tag.ts
|
|
310
|
+
function makeResolveTag(defaultTag) {
|
|
311
|
+
return function tag(as) {
|
|
312
|
+
return as ?? defaultTag;
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ../../lib/primitive/src/utils/assert-never.ts
|
|
317
|
+
function assertNever(value) {
|
|
318
|
+
throw new Error(`Unexpected value: ${String(value)}`);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// ../../lib/primitive/src/utils/cn.ts
|
|
322
|
+
import { clsx } from "clsx";
|
|
323
|
+
function cn(...inputs) {
|
|
324
|
+
return clsx(...inputs);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// ../../lib/primitive/src/utils/iterate.ts
|
|
328
|
+
function find(iterable, callback) {
|
|
329
|
+
for (const value of iterable) {
|
|
330
|
+
const result = callback(value);
|
|
331
|
+
if (result != null) {
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
function some(iterable, predicate) {
|
|
338
|
+
for (const value of iterable) {
|
|
339
|
+
if (predicate(value)) return true;
|
|
340
|
+
}
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
function every(iterable, predicate) {
|
|
344
|
+
let index = 0;
|
|
345
|
+
for (const value of iterable) {
|
|
346
|
+
if (!predicate(value, index++)) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
function* filter(iterable, predicate) {
|
|
353
|
+
let index = 0;
|
|
354
|
+
for (const value of iterable) {
|
|
355
|
+
if (predicate(value, index++)) {
|
|
356
|
+
yield value;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function* map(iterable, callback) {
|
|
361
|
+
let index = 0;
|
|
362
|
+
for (const value of iterable) {
|
|
363
|
+
yield callback(value, index++);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function forEach(iterable, callback) {
|
|
367
|
+
let index = 0;
|
|
368
|
+
for (const value of iterable) {
|
|
369
|
+
callback(value, index++);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function reduce(iterable, initial, callback) {
|
|
373
|
+
let accumulator = initial;
|
|
374
|
+
let index = 0;
|
|
375
|
+
for (const value of iterable) {
|
|
376
|
+
accumulator = callback(accumulator, value, index++);
|
|
377
|
+
}
|
|
378
|
+
return accumulator;
|
|
379
|
+
}
|
|
380
|
+
function collect(iterable, callback) {
|
|
381
|
+
const result = {};
|
|
382
|
+
let index = 0;
|
|
383
|
+
for (const value of iterable) {
|
|
384
|
+
const entry = callback(value, index++);
|
|
385
|
+
if (entry === null) {
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
result[entry[0]] = entry[1];
|
|
389
|
+
}
|
|
390
|
+
return result;
|
|
391
|
+
}
|
|
392
|
+
function findLast(value, callback) {
|
|
393
|
+
for (let index = value.length - 1; index >= 0; index--) {
|
|
394
|
+
const result = callback(value[index], index);
|
|
395
|
+
if (result != null) {
|
|
396
|
+
return result;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
function* items(collection) {
|
|
402
|
+
for (let i = 0; i < collection.length; i++) {
|
|
403
|
+
const item = collection.item(i);
|
|
404
|
+
if (item !== null) {
|
|
405
|
+
yield item;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function nodeList(list) {
|
|
410
|
+
return {
|
|
411
|
+
*[Symbol.iterator]() {
|
|
412
|
+
for (let i = 0; i < list.length; i++) {
|
|
413
|
+
const node = list.item(i);
|
|
414
|
+
if (node !== null) {
|
|
415
|
+
yield node;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function mapEntries(m) {
|
|
422
|
+
return m.entries();
|
|
423
|
+
}
|
|
424
|
+
function set(s) {
|
|
425
|
+
return s.values();
|
|
426
|
+
}
|
|
427
|
+
function hasOwn(object, key) {
|
|
428
|
+
return Object.hasOwn(object, key);
|
|
429
|
+
}
|
|
430
|
+
function* entries(object) {
|
|
431
|
+
for (const key in object) {
|
|
432
|
+
if (!hasOwn(object, key)) continue;
|
|
433
|
+
yield [key, object[key]];
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function* keys(object) {
|
|
437
|
+
for (const [key] of entries(object)) {
|
|
438
|
+
yield key;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
function* values(object) {
|
|
442
|
+
for (const [, value] of entries(object)) {
|
|
443
|
+
yield value;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
function mapValues(object, callback) {
|
|
447
|
+
const result = {};
|
|
448
|
+
for (const [key, value] of entries(object)) {
|
|
449
|
+
result[key] = callback(value, key);
|
|
450
|
+
}
|
|
451
|
+
return result;
|
|
452
|
+
}
|
|
453
|
+
function forEachEntry(object, callback) {
|
|
454
|
+
for (const [key, value] of entries(object)) {
|
|
455
|
+
callback(key, value);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function forEachKey(object, callback) {
|
|
459
|
+
for (const key of keys(object)) {
|
|
460
|
+
callback(key);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
function forEachValue(object, callback) {
|
|
464
|
+
for (const value of values(object)) {
|
|
465
|
+
callback(value);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function forEachSet(s, callback) {
|
|
469
|
+
for (const value of s) {
|
|
470
|
+
callback(value);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
var iterate = Object.freeze({
|
|
474
|
+
entries,
|
|
475
|
+
filter,
|
|
476
|
+
find,
|
|
477
|
+
findLast,
|
|
478
|
+
forEach,
|
|
479
|
+
forEachEntry,
|
|
480
|
+
forEachKey,
|
|
481
|
+
forEachSet,
|
|
482
|
+
forEachValue,
|
|
483
|
+
items,
|
|
484
|
+
keys,
|
|
485
|
+
map,
|
|
486
|
+
mapEntries,
|
|
487
|
+
mapValues,
|
|
488
|
+
nodeList,
|
|
489
|
+
reduce,
|
|
490
|
+
collect,
|
|
491
|
+
set,
|
|
492
|
+
some,
|
|
493
|
+
every,
|
|
494
|
+
values
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
// ../../lib/primitive/src/utils/merge-props.ts
|
|
498
|
+
function mergeProps(defaultProps, props) {
|
|
499
|
+
return {
|
|
500
|
+
...defaultProps ?? {},
|
|
501
|
+
...props
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// ../../lib/primitive/src/guards/children/component-id.ts
|
|
506
|
+
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
507
|
+
|
|
508
|
+
// ../../lib/primitive/src/guards/children/is-tag.ts
|
|
509
|
+
function getAsProp(child) {
|
|
510
|
+
if (!isObject(child) || !("props" in child)) return void 0;
|
|
511
|
+
const props = child.props;
|
|
512
|
+
if (!isObject(props)) return void 0;
|
|
513
|
+
const as = props.as;
|
|
514
|
+
return isString(as) && as !== "" ? as : void 0;
|
|
515
|
+
}
|
|
516
|
+
function getTag(child) {
|
|
517
|
+
if (!isObject(child) || !("type" in child)) return void 0;
|
|
518
|
+
const t = child.type;
|
|
519
|
+
if (isString(t)) return t;
|
|
520
|
+
if (typeof t === "function" || isObject(t)) {
|
|
521
|
+
const defaultTag = t[COMPONENT_DEFAULT_TAG];
|
|
522
|
+
if (!isString(defaultTag)) return void 0;
|
|
523
|
+
return getAsProp(child) ?? defaultTag;
|
|
524
|
+
}
|
|
525
|
+
return void 0;
|
|
526
|
+
}
|
|
527
|
+
function isTag(...args) {
|
|
528
|
+
if (isString(args[0])) {
|
|
529
|
+
const set3 = new Set(args);
|
|
530
|
+
return (child2) => {
|
|
531
|
+
const tag2 = getTag(child2);
|
|
532
|
+
return tag2 !== void 0 && set3.has(tag2);
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
const [child, ...tags] = args;
|
|
536
|
+
const set2 = new Set(tags);
|
|
537
|
+
const tag = getTag(child);
|
|
538
|
+
return tag !== void 0 && set2.has(tag);
|
|
539
|
+
}
|
|
540
|
+
|
|
498
541
|
// ../../lib/contract/src/strict/invariant-base.ts
|
|
499
542
|
var InvariantBase = class {
|
|
500
543
|
diagnostics;
|
|
@@ -1550,7 +1593,7 @@ function getTypeName(value) {
|
|
|
1550
1593
|
return primitive;
|
|
1551
1594
|
}
|
|
1552
1595
|
const name = value.constructor?.name;
|
|
1553
|
-
return
|
|
1596
|
+
return isString(name) && name !== "Object" ? name : "object";
|
|
1554
1597
|
}
|
|
1555
1598
|
|
|
1556
1599
|
// ../../lib/contract/src/children/normalize-child-rule.ts
|
|
@@ -1801,6 +1844,9 @@ var readonlyProps = ({
|
|
|
1801
1844
|
};
|
|
1802
1845
|
};
|
|
1803
1846
|
|
|
1847
|
+
// ../core/src/html/evaluators.ts
|
|
1848
|
+
import { warnDiagnostics as warnDiagnostics2 } from "../_shared/diagnostics.js";
|
|
1849
|
+
|
|
1804
1850
|
// ../core/src/html/aria-rules.ts
|
|
1805
1851
|
var LANDMARK_TAG_SET = /* @__PURE__ */ new Set(["article", "aside", "footer", "header", "main", "nav"]);
|
|
1806
1852
|
var removeLandmarkRoleOverride = {
|
|
@@ -1843,6 +1889,167 @@ function landmarkNameAdvisory(ctx) {
|
|
|
1843
1889
|
}
|
|
1844
1890
|
var HTML_ARIA_RULES = [landmarkRoleRule, landmarkNameAdvisory];
|
|
1845
1891
|
|
|
1892
|
+
// ../core/src/html/contracts.ts
|
|
1893
|
+
import { warnDiagnostics } from "../_shared/diagnostics.js";
|
|
1894
|
+
function isOpenContent(...blockedTags) {
|
|
1895
|
+
const set2 = new Set(blockedTags);
|
|
1896
|
+
return (child) => isObject(child) && "type" in child && (!isString(child.type) || !set2.has(child.type));
|
|
1897
|
+
}
|
|
1898
|
+
var METADATA_TAGS = ["script", "template"];
|
|
1899
|
+
var metadataMatch = isTag(...METADATA_TAGS);
|
|
1900
|
+
function metadata(name = "metadata") {
|
|
1901
|
+
return { name, match: metadataMatch };
|
|
1902
|
+
}
|
|
1903
|
+
function firstOptional(name, tag) {
|
|
1904
|
+
return { name, match: isTag(tag), cardinality: { max: 1 }, position: "first" };
|
|
1905
|
+
}
|
|
1906
|
+
function contract(children) {
|
|
1907
|
+
return { diagnostics: warnDiagnostics, children };
|
|
1908
|
+
}
|
|
1909
|
+
function ariaContract(aria) {
|
|
1910
|
+
return { diagnostics: warnDiagnostics, aria };
|
|
1911
|
+
}
|
|
1912
|
+
function firstChildContract(name, tag) {
|
|
1913
|
+
return contract([firstOptional(name, tag), { name: "content", match: isOpenContent(tag) }]);
|
|
1914
|
+
}
|
|
1915
|
+
var VOID_TAGS = [
|
|
1916
|
+
"area",
|
|
1917
|
+
"base",
|
|
1918
|
+
"br",
|
|
1919
|
+
"col",
|
|
1920
|
+
"embed",
|
|
1921
|
+
"hr",
|
|
1922
|
+
"img",
|
|
1923
|
+
"input",
|
|
1924
|
+
"link",
|
|
1925
|
+
"meta",
|
|
1926
|
+
"param",
|
|
1927
|
+
"source",
|
|
1928
|
+
"track",
|
|
1929
|
+
"wbr"
|
|
1930
|
+
];
|
|
1931
|
+
var TEXT_ONLY_TAGS = ["option", "script", "style", "textarea", "title"];
|
|
1932
|
+
var LANDMARK_TAGS = ["article", "aside", "footer", "header", "main", "nav"];
|
|
1933
|
+
var listContract = contract([{ name: "list-item", match: isTag("li", ...METADATA_TAGS) }]);
|
|
1934
|
+
var tableContract = contract([
|
|
1935
|
+
firstOptional("caption", "caption"),
|
|
1936
|
+
{ name: "colgroup", match: isTag("colgroup") },
|
|
1937
|
+
{ name: "thead", match: isTag("thead"), cardinality: { max: 1 } },
|
|
1938
|
+
{ name: "tbody", match: isTag("tbody") },
|
|
1939
|
+
{ name: "tfoot", match: isTag("tfoot"), cardinality: { max: 1 } },
|
|
1940
|
+
{ name: "table-row", match: isTag("tr", ...METADATA_TAGS) }
|
|
1941
|
+
]);
|
|
1942
|
+
var tableBodyContract = contract([
|
|
1943
|
+
{ name: "table-row", match: isTag("tr", ...METADATA_TAGS) }
|
|
1944
|
+
]);
|
|
1945
|
+
var tableRowContract = contract([
|
|
1946
|
+
{ name: "table-cell", match: isTag("td", "th", ...METADATA_TAGS) }
|
|
1947
|
+
]);
|
|
1948
|
+
var colgroupContract = contract([{ name: "column", match: isTag("col", "template") }]);
|
|
1949
|
+
var dlContract = contract([
|
|
1950
|
+
{ name: "term", match: isTag("dt") },
|
|
1951
|
+
{ name: "description", match: isTag("dd") },
|
|
1952
|
+
{ name: "group", match: isTag("div") },
|
|
1953
|
+
metadata()
|
|
1954
|
+
]);
|
|
1955
|
+
var selectContract = contract([
|
|
1956
|
+
{ name: "option", match: isTag("option", "optgroup", "hr", ...METADATA_TAGS) }
|
|
1957
|
+
]);
|
|
1958
|
+
var optgroupContract = contract([
|
|
1959
|
+
{ name: "option", match: isTag("option", ...METADATA_TAGS) }
|
|
1960
|
+
]);
|
|
1961
|
+
var datalistContract = contract([
|
|
1962
|
+
{ name: "option", match: isTag("option", ...METADATA_TAGS) }
|
|
1963
|
+
]);
|
|
1964
|
+
var pictureContract = contract([
|
|
1965
|
+
{ name: "source", match: isTag("source", ...METADATA_TAGS) },
|
|
1966
|
+
{ name: "image", match: isTag("img"), cardinality: { min: 1, max: 1 }, position: "last" }
|
|
1967
|
+
]);
|
|
1968
|
+
var figureContract = contract([
|
|
1969
|
+
{ name: "caption", match: isTag("figcaption"), cardinality: { max: 1 } },
|
|
1970
|
+
{ name: "content", match: isOpenContent("figcaption") }
|
|
1971
|
+
]);
|
|
1972
|
+
var detailsContract = firstChildContract("summary", "summary");
|
|
1973
|
+
var fieldsetContract = firstChildContract("legend", "legend");
|
|
1974
|
+
var mediaContract = contract([
|
|
1975
|
+
{ name: "source", match: isTag("source") },
|
|
1976
|
+
{ name: "track", match: isTag("track") },
|
|
1977
|
+
metadata(),
|
|
1978
|
+
{ name: "content", match: isOpenContent("source", "track", ...METADATA_TAGS) }
|
|
1979
|
+
]);
|
|
1980
|
+
var headContract = contract([
|
|
1981
|
+
{
|
|
1982
|
+
name: "metadata",
|
|
1983
|
+
match: isTag("base", "link", "meta", "noscript", "script", "style", "template", "title")
|
|
1984
|
+
}
|
|
1985
|
+
]);
|
|
1986
|
+
var htmlContract = contract([
|
|
1987
|
+
{ name: "head", match: isTag("head"), cardinality: { min: 1, max: 1 }, position: "first" },
|
|
1988
|
+
{ name: "body", match: isTag("body"), cardinality: { min: 1, max: 1 } }
|
|
1989
|
+
]);
|
|
1990
|
+
var voidContract = contract([]);
|
|
1991
|
+
var textOnlyContract = contract([
|
|
1992
|
+
{
|
|
1993
|
+
name: "text",
|
|
1994
|
+
match: (child) => isString(child) || isNumber(child)
|
|
1995
|
+
}
|
|
1996
|
+
]);
|
|
1997
|
+
var landmarkContract = ariaContract([landmarkRoleRule, landmarkNameAdvisory]);
|
|
1998
|
+
var dialogContract = ariaContract([requireAccessibleName]);
|
|
1999
|
+
var menuContract = ariaContract([requireAccessibleName]);
|
|
2000
|
+
var menubarContract = ariaContract([requireAccessibleName]);
|
|
2001
|
+
var treeContract = ariaContract([requireAccessibleName]);
|
|
2002
|
+
var gridContract = ariaContract([requireAccessibleName]);
|
|
2003
|
+
var listboxContract = ariaContract([requireAccessibleName]);
|
|
2004
|
+
var tablistContract = ariaContract([requireAccessibleName]);
|
|
2005
|
+
var radiogroupContract = ariaContract([requireAccessibleName]);
|
|
2006
|
+
var CONTRACT_GROUPS = [
|
|
2007
|
+
[VOID_TAGS, voidContract],
|
|
2008
|
+
[TEXT_ONLY_TAGS, textOnlyContract],
|
|
2009
|
+
[LANDMARK_TAGS, landmarkContract],
|
|
2010
|
+
[["ul", "ol", "menu"], listContract],
|
|
2011
|
+
[["audio", "video"], mediaContract],
|
|
2012
|
+
[["thead", "tbody", "tfoot"], tableBodyContract]
|
|
2013
|
+
];
|
|
2014
|
+
function contractMap(groups) {
|
|
2015
|
+
return Object.fromEntries(
|
|
2016
|
+
groups.flatMap(([tags, enforcement]) => tags.map((tag) => [tag, enforcement]))
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
var htmlContracts = {
|
|
2020
|
+
...contractMap(CONTRACT_GROUPS),
|
|
2021
|
+
table: tableContract,
|
|
2022
|
+
tr: tableRowContract,
|
|
2023
|
+
colgroup: colgroupContract,
|
|
2024
|
+
dl: dlContract,
|
|
2025
|
+
select: selectContract,
|
|
2026
|
+
optgroup: optgroupContract,
|
|
2027
|
+
datalist: datalistContract,
|
|
2028
|
+
picture: pictureContract,
|
|
2029
|
+
figure: figureContract,
|
|
2030
|
+
details: detailsContract,
|
|
2031
|
+
fieldset: fieldsetContract,
|
|
2032
|
+
dialog: dialogContract,
|
|
2033
|
+
head: headContract,
|
|
2034
|
+
html: htmlContract
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
// ../core/src/html/evaluators.ts
|
|
2038
|
+
var htmlDiagnostics = warnDiagnostics2;
|
|
2039
|
+
function buildEvaluatorMap() {
|
|
2040
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
2041
|
+
iterate.forEachEntry(htmlContracts, (tag, { children }) => {
|
|
2042
|
+
if (children?.length) {
|
|
2043
|
+
map2.set(tag, new ChildrenEvaluator(children, htmlDiagnostics, `<${tag}>`));
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
return map2;
|
|
2047
|
+
}
|
|
2048
|
+
var HTML_EVALUATORS = buildEvaluatorMap();
|
|
2049
|
+
function getHtmlChildrenEvaluator(tag) {
|
|
2050
|
+
return typeof tag === "string" ? HTML_EVALUATORS.get(tag) : void 0;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
1846
2053
|
// ../core/src/html/prop-normalizers.ts
|
|
1847
2054
|
var HTML_FORM_NORMALIZERS = /* @__PURE__ */ new Map([
|
|
1848
2055
|
["button", [disabledProps]],
|
|
@@ -2030,6 +2237,19 @@ function createClassPipeline(resolved) {
|
|
|
2030
2237
|
};
|
|
2031
2238
|
}
|
|
2032
2239
|
|
|
2240
|
+
// ../../lib/pipeline-kit/src/factory/define-pipeline.ts
|
|
2241
|
+
function definePipeline(factory) {
|
|
2242
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
2243
|
+
return (resolved) => {
|
|
2244
|
+
let pipeline = cache.get(resolved);
|
|
2245
|
+
if (!pipeline) {
|
|
2246
|
+
pipeline = factory(resolved);
|
|
2247
|
+
cache.set(resolved, pipeline);
|
|
2248
|
+
}
|
|
2249
|
+
return pipeline;
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2033
2253
|
// ../core/src/options/resolve-factory-options.ts
|
|
2034
2254
|
import { silentDiagnostics } from "../_shared/diagnostics.js";
|
|
2035
2255
|
var EMPTY_VARIANT_KEYS = /* @__PURE__ */ new Set();
|
|
@@ -2165,89 +2385,73 @@ function guardPipeline(pipeline) {
|
|
|
2165
2385
|
};
|
|
2166
2386
|
}
|
|
2167
2387
|
|
|
2168
|
-
// ../core/src/factory/create-
|
|
2169
|
-
var
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2388
|
+
// ../core/src/factory/create-polymorphic2.ts
|
|
2389
|
+
var createTagPipeline = (resolved) => makeResolveTag(resolved.defaultTag);
|
|
2390
|
+
var createPropsPipeline = (resolved) => (props) => mergeProps(resolved.defaultProps, props);
|
|
2391
|
+
var createHtmlPropNormalizersPipeline = () => getHtmlPropNormalizers;
|
|
2392
|
+
var createHtmlChildrenEvaluatorPipeline = () => getHtmlChildrenEvaluator;
|
|
2393
|
+
var createStylingClassPipeline = (resolved) => createClassPipeline(resolved);
|
|
2394
|
+
function resolveAriaRules(resolved) {
|
|
2395
|
+
return [.../* @__PURE__ */ new Set([...HTML_ARIA_RULES, ...resolved.ariaRules ?? []])];
|
|
2396
|
+
}
|
|
2397
|
+
var createAriaPipeline = (resolved) => {
|
|
2398
|
+
const rules = resolveAriaRules(resolved);
|
|
2399
|
+
const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
|
|
2400
|
+
return (tag, props) => engine.validate(tag, props);
|
|
2401
|
+
};
|
|
2402
|
+
var memoizedTagPipeline = definePipeline(createTagPipeline);
|
|
2403
|
+
var memoizedPropsPipeline = definePipeline(createPropsPipeline);
|
|
2404
|
+
var memoizedHtmlPropNormalizersPipeline = definePipeline(createHtmlPropNormalizersPipeline);
|
|
2405
|
+
var memoizedHtmlChildrenEvaluatorPipeline = definePipeline(createHtmlChildrenEvaluatorPipeline);
|
|
2406
|
+
var memoizedClassPipeline = definePipeline(createStylingClassPipeline);
|
|
2407
|
+
var memoizedAriaPipeline = definePipeline(createAriaPipeline);
|
|
2408
|
+
function resolveAriaPassthrough(_tag, props) {
|
|
2409
|
+
return { props };
|
|
2410
|
+
}
|
|
2411
|
+
function resolveClassPlugin(factory, resolved, diagnostics) {
|
|
2412
|
+
if (!factory) return { pluginResult: void 0, classPipeline: memoizedClassPipeline(resolved) };
|
|
2177
2413
|
const pluginResult = factory(resolved, diagnostics);
|
|
2178
2414
|
assertPluginShape(pluginResult);
|
|
2179
|
-
|
|
2180
|
-
return { pluginResult, classPipeline };
|
|
2415
|
+
return { pluginResult, classPipeline: guardPipeline(pluginResult.pipeline) };
|
|
2181
2416
|
}
|
|
2182
|
-
function
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2417
|
+
function createPolymorphic2(options = {}) {
|
|
2418
|
+
const baseResolved = resolveFactoryOptions(options);
|
|
2419
|
+
const anyBaseResolved = baseResolved;
|
|
2420
|
+
const resolved = Object.freeze({
|
|
2421
|
+
...baseResolved,
|
|
2422
|
+
htmlPropNormalizersFn: memoizedHtmlPropNormalizersPipeline(anyBaseResolved),
|
|
2423
|
+
htmlChildrenEvaluatorFn: memoizedHtmlChildrenEvaluatorPipeline(anyBaseResolved)
|
|
2424
|
+
});
|
|
2425
|
+
const anyResolved = resolved;
|
|
2426
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2427
|
+
validateFactoryOptions(resolved, resolved.diagnostics);
|
|
2428
|
+
}
|
|
2429
|
+
const { pluginResult, classPipeline } = resolveClassPlugin(
|
|
2430
|
+
options.styling?.plugin,
|
|
2431
|
+
anyResolved,
|
|
2432
|
+
resolved.diagnostics
|
|
2433
|
+
);
|
|
2434
|
+
const resolveTag2 = memoizedTagPipeline(anyResolved);
|
|
2435
|
+
const resolveProps = memoizedPropsPipeline(anyResolved);
|
|
2436
|
+
const resolveAriaFn = options.enforcement !== void 0 ? memoizedAriaPipeline(anyResolved) : resolveAriaPassthrough;
|
|
2437
|
+
const methods = {
|
|
2438
|
+
resolveTag: resolveTag2,
|
|
2439
|
+
resolveProps,
|
|
2188
2440
|
resolveClasses(tag, props, className, recipe) {
|
|
2189
2441
|
if (process.env.NODE_ENV !== "production") {
|
|
2190
|
-
validateRenderProps(
|
|
2442
|
+
validateRenderProps(resolved.diagnostics, resolved, props, recipe);
|
|
2191
2443
|
}
|
|
2192
2444
|
return classPipeline(tag, props, className, recipe);
|
|
2193
2445
|
},
|
|
2194
2446
|
resolveAria(tag, props) {
|
|
2195
|
-
|
|
2196
|
-
const result = engine.validate(tag, props);
|
|
2197
|
-
return { props: result.props };
|
|
2447
|
+
return resolveAriaFn(tag, props);
|
|
2198
2448
|
}
|
|
2199
2449
|
};
|
|
2200
|
-
}
|
|
2201
|
-
|
|
2202
|
-
return pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
|
|
2203
|
-
}
|
|
2204
|
-
function createPolymorphic(options = {}, capabilities) {
|
|
2205
|
-
const baseResolved = resolveFactoryOptions(options);
|
|
2206
|
-
const resolved = capabilities?.htmlPropNormalizersFn !== void 0 ? Object.freeze({
|
|
2207
|
-
...baseResolved,
|
|
2208
|
-
htmlPropNormalizersFn: capabilities.htmlPropNormalizersFn
|
|
2209
|
-
}) : baseResolved;
|
|
2210
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2211
|
-
validateFactoryOptions(resolved, resolved.diagnostics);
|
|
2212
|
-
}
|
|
2213
|
-
const { pluginResult, classPipeline } = resolveClassPipeline(
|
|
2214
|
-
options,
|
|
2215
|
-
resolved,
|
|
2216
|
-
resolved.diagnostics,
|
|
2217
|
-
capabilities
|
|
2218
|
-
);
|
|
2219
|
-
const allAriaRules = [
|
|
2220
|
-
.../* @__PURE__ */ new Set([...capabilities?.htmlAriaRules ?? [], ...resolved.ariaRules ?? []])
|
|
2221
|
-
];
|
|
2222
|
-
const engine = options.enforcement !== void 0 && capabilities?.AriaEngine ? new capabilities.AriaEngine(
|
|
2223
|
-
resolved.diagnostics,
|
|
2224
|
-
allAriaRules.length ? { rules: allAriaRules } : void 0
|
|
2225
|
-
) : null;
|
|
2226
|
-
const methods = createRuntimeMethods(resolved, classPipeline, engine, resolved.diagnostics);
|
|
2227
|
-
return createRuntimeObject(
|
|
2228
|
-
methods,
|
|
2229
|
-
resolved,
|
|
2230
|
-
pluginResult
|
|
2231
|
-
);
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
// ../core/src/factory/create-polymorphic-full.ts
|
|
2235
|
-
var FULL_CAPABILITIES = {
|
|
2236
|
-
createClassPipeline,
|
|
2237
|
-
AriaEngine: AriaPolicyEngine,
|
|
2238
|
-
htmlAriaRules: HTML_ARIA_RULES,
|
|
2239
|
-
htmlPropNormalizersFn: getHtmlPropNormalizers
|
|
2240
|
-
};
|
|
2241
|
-
function createPolymorphic2(options = {}) {
|
|
2242
|
-
return createPolymorphic(options, FULL_CAPABILITIES);
|
|
2243
|
-
}
|
|
2244
|
-
|
|
2245
|
-
// ../../lib/adapter-utils/src/define-component.ts
|
|
2246
|
-
function defineContractComponent(options) {
|
|
2247
|
-
return (factory) => factory(options);
|
|
2450
|
+
const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
|
|
2451
|
+
return runtimeObject;
|
|
2248
2452
|
}
|
|
2249
2453
|
|
|
2250
|
-
// ../../lib/adapter-utils/src/build-core-runtime.ts
|
|
2454
|
+
// ../../lib/adapter-utils/src/runtime/build-core-runtime.ts
|
|
2251
2455
|
var EMPTY_SET = /* @__PURE__ */ new Set();
|
|
2252
2456
|
function buildCoreRuntime(normalized) {
|
|
2253
2457
|
const runtime = createPolymorphic2(normalized);
|
|
@@ -2255,21 +2459,12 @@ function buildCoreRuntime(normalized) {
|
|
|
2255
2459
|
return { runtime, ownedKeys };
|
|
2256
2460
|
}
|
|
2257
2461
|
|
|
2258
|
-
// ../../lib/adapter-utils/src/build-engines.ts
|
|
2462
|
+
// ../../lib/adapter-utils/src/runtime/build-engines.ts
|
|
2259
2463
|
function buildEngines(diagnostics, childRules, context) {
|
|
2260
2464
|
return childRules?.length ? { childrenEvaluator: new ChildrenEvaluator(childRules, diagnostics, context) } : {};
|
|
2261
2465
|
}
|
|
2262
2466
|
|
|
2263
|
-
// ../../lib/adapter-utils/src/
|
|
2264
|
-
function composeFilter(ownedKeys, filterProps) {
|
|
2265
|
-
const defaultFilter = (key, variantKeys) => variantKeys.has(key) || ownedKeys.has(key);
|
|
2266
|
-
if (!filterProps) {
|
|
2267
|
-
return defaultFilter;
|
|
2268
|
-
}
|
|
2269
|
-
return (key, variantKeys) => defaultFilter(key, variantKeys) || filterProps(key, variantKeys);
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
// ../../lib/adapter-utils/src/resolve-adapter-common-options.ts
|
|
2467
|
+
// ../../lib/adapter-utils/src/runtime/resolve-adapter-common-options.ts
|
|
2273
2468
|
import { throwDiagnostics as throwDiagnostics2, silentDiagnostics as silentDiagnostics2 } from "../_shared/diagnostics.js";
|
|
2274
2469
|
function resolveAdapterCommonOptions(options, defaultName = "PolymorphicComponent", defaultDiagnostics = throwDiagnostics2) {
|
|
2275
2470
|
return {
|
|
@@ -2278,7 +2473,16 @@ function resolveAdapterCommonOptions(options, defaultName = "PolymorphicComponen
|
|
|
2278
2473
|
};
|
|
2279
2474
|
}
|
|
2280
2475
|
|
|
2281
|
-
// ../../lib/adapter-utils/src/
|
|
2476
|
+
// ../../lib/adapter-utils/src/props/compose-filter.ts
|
|
2477
|
+
function composeFilter(ownedKeys, filterProps) {
|
|
2478
|
+
const defaultFilter = (key, variantKeys) => variantKeys.has(key) || ownedKeys.has(key);
|
|
2479
|
+
if (!filterProps) {
|
|
2480
|
+
return defaultFilter;
|
|
2481
|
+
}
|
|
2482
|
+
return (key, variantKeys) => defaultFilter(key, variantKeys) || filterProps(key, variantKeys);
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
// ../../lib/adapter-utils/src/slot/slot-validator.ts
|
|
2282
2486
|
var SlotValidator = class extends InvariantBase {
|
|
2283
2487
|
#name;
|
|
2284
2488
|
#elementTerm;
|