praxis-kit 3.0.0 → 3.1.1
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-PBBPAHMV.js → chunk-6RJN5B6L.js} +25 -14
- package/dist/codemod/index.d.ts +1 -20
- package/dist/codemod/index.js +668 -637
- package/dist/contract/index.d.ts +5 -5
- package/dist/contract/index.js +23 -12
- package/dist/eslint/index.js +16 -16
- package/dist/lit/index.d.ts +10 -9
- package/dist/lit/index.js +34 -13
- package/dist/{merge-refs-CfAbwCKz.d.ts → merge-refs-BKyE8h8M.d.ts} +8 -7
- package/dist/preact/index.d.ts +8 -7
- package/dist/preact/index.js +24 -13
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.d.ts +7 -7
- package/dist/react/legacy.js +1 -1
- package/dist/solid/index.d.ts +8 -7
- package/dist/solid/index.js +24 -13
- package/dist/svelte/index.d.ts +10 -8
- package/dist/svelte/index.js +23 -12
- package/dist/vue/index.d.ts +8 -7
- package/dist/vue/index.js +24 -13
- package/dist/web/index.d.ts +10 -9
- package/dist/web/index.js +25 -13
- package/package.json +4 -4
package/dist/contract/index.d.ts
CHANGED
|
@@ -204,27 +204,27 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
204
204
|
readonly allowedAs?: readonly TAllowed[];
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
207
|
+
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = {
|
|
208
208
|
readonly base?: ClassName;
|
|
209
209
|
readonly variants?: V;
|
|
210
210
|
readonly defaults?: Partial<DefaultVariants<V>>;
|
|
211
211
|
readonly compounds?: readonly CompoundVariant<V>[];
|
|
212
212
|
readonly presets?: TPreset;
|
|
213
213
|
readonly tags?: Readonly<TagMap>;
|
|
214
|
-
readonly plugin?:
|
|
214
|
+
readonly plugin?: TPlugin;
|
|
215
215
|
readonly precomputedClasses?: Readonly<Record<string, string>>;
|
|
216
216
|
};
|
|
217
217
|
|
|
218
218
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
219
219
|
normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
|
|
220
220
|
}['normalize'];
|
|
221
|
-
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, AnyRecord>;
|
|
222
|
-
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
221
|
+
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, ClassPluginFactory<AnyRecord> | undefined>;
|
|
222
|
+
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType> = {
|
|
223
223
|
readonly tag?: TDefault;
|
|
224
224
|
readonly name?: string;
|
|
225
225
|
readonly defaults?: Partial<NoInfer<Props>>;
|
|
226
226
|
readonly normalize?: NormalizeFn<NoInfer<Props>>;
|
|
227
|
-
readonly styling?: StylingOptions<V, TPreset,
|
|
227
|
+
readonly styling?: StylingOptions<V, TPreset, TPlugin>;
|
|
228
228
|
readonly enforcement?: EnforcementOptions<TAllowed>;
|
|
229
229
|
};
|
|
230
230
|
|
package/dist/contract/index.js
CHANGED
|
@@ -321,7 +321,7 @@ function isStandaloneTag(tag) {
|
|
|
321
321
|
return STANDALONE_ROLES_SET.has(IMPLICIT_ROLE_RECORD[tag]);
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
// ../core/dist/chunk-
|
|
324
|
+
// ../core/dist/chunk-2NJ5XLOA.js
|
|
325
325
|
var IMPLICIT_ROLE_RECORD2 = {
|
|
326
326
|
article: "article",
|
|
327
327
|
aside: "complementary",
|
|
@@ -350,26 +350,37 @@ function getImplicitRole(tag) {
|
|
|
350
350
|
if (tag in IMPLICIT_ROLE_RECORD2) return IMPLICIT_ROLE_RECORD2[tag];
|
|
351
351
|
return void 0;
|
|
352
352
|
}
|
|
353
|
-
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol("praxis.component-default-tag");
|
|
354
|
-
function
|
|
353
|
+
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
354
|
+
function getAsProp(child) {
|
|
355
|
+
if (!isObject(child) || !("props" in child)) return void 0;
|
|
356
|
+
const props = child.props;
|
|
357
|
+
if (!isObject(props)) return void 0;
|
|
358
|
+
const as = props.as;
|
|
359
|
+
return isString(as) && as !== "" ? as : void 0;
|
|
360
|
+
}
|
|
361
|
+
function getTag(child) {
|
|
355
362
|
if (!isObject(child) || !("type" in child)) return void 0;
|
|
356
363
|
const t = child.type;
|
|
357
364
|
if (isString(t)) return t;
|
|
358
|
-
if (
|
|
365
|
+
if (typeof t === "function" || isObject(t)) {
|
|
359
366
|
const defaultTag = t[COMPONENT_DEFAULT_TAG];
|
|
360
367
|
if (!isString(defaultTag)) return void 0;
|
|
361
|
-
|
|
362
|
-
const as = isObject(props) && "as" in props ? props.as : void 0;
|
|
363
|
-
return isString(as) ? as : defaultTag;
|
|
368
|
+
return getAsProp(child) ?? defaultTag;
|
|
364
369
|
}
|
|
365
370
|
return void 0;
|
|
366
371
|
}
|
|
367
|
-
function isTag(...
|
|
372
|
+
function isTag(...args) {
|
|
373
|
+
if (isString(args[0])) {
|
|
374
|
+
const set2 = new Set(args);
|
|
375
|
+
return (child2) => {
|
|
376
|
+
const tag2 = getTag(child2);
|
|
377
|
+
return tag2 !== void 0 && set2.has(tag2);
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
const [child, ...tags] = args;
|
|
368
381
|
const set = new Set(tags);
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return tag !== void 0 && set.has(tag);
|
|
372
|
-
};
|
|
382
|
+
const tag = getTag(child);
|
|
383
|
+
return tag !== void 0 && set.has(tag);
|
|
373
384
|
}
|
|
374
385
|
var pendingAsyncWarns = /* @__PURE__ */ new Set();
|
|
375
386
|
var asyncWarnScheduled = false;
|
package/dist/eslint/index.js
CHANGED
|
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
mod
|
|
25
25
|
));
|
|
26
26
|
|
|
27
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
27
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
|
|
28
28
|
var require_deepMerge = __commonJS({
|
|
29
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
29
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js"(exports) {
|
|
30
30
|
"use strict";
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.isObjectNotArray = isObjectNotArray;
|
|
@@ -59,9 +59,9 @@ var require_deepMerge = __commonJS({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
62
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
|
|
63
63
|
var require_applyDefault = __commonJS({
|
|
64
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
64
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js"(exports) {
|
|
65
65
|
"use strict";
|
|
66
66
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
67
|
exports.applyDefault = applyDefault;
|
|
@@ -86,9 +86,9 @@ var require_applyDefault = __commonJS({
|
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
89
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
|
|
90
90
|
var require_parserSeemsToBeTSESLint = __commonJS({
|
|
91
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
91
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js"(exports) {
|
|
92
92
|
"use strict";
|
|
93
93
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
94
94
|
exports.parserSeemsToBeTSESLint = parserSeemsToBeTSESLint;
|
|
@@ -98,9 +98,9 @@ var require_parserSeemsToBeTSESLint = __commonJS({
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
101
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
|
|
102
102
|
var require_getParserServices = __commonJS({
|
|
103
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
103
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js"(exports) {
|
|
104
104
|
"use strict";
|
|
105
105
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
106
106
|
exports.getParserServices = getParserServices;
|
|
@@ -131,17 +131,17 @@ var require_getParserServices = __commonJS({
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
134
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
|
|
135
135
|
var require_InferTypesFromRule = __commonJS({
|
|
136
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
136
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js"(exports) {
|
|
137
137
|
"use strict";
|
|
138
138
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
142
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
|
|
143
143
|
var require_nullThrows = __commonJS({
|
|
144
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
144
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js"(exports) {
|
|
145
145
|
"use strict";
|
|
146
146
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
147
147
|
exports.NullThrowsReasons = void 0;
|
|
@@ -159,9 +159,9 @@ var require_nullThrows = __commonJS({
|
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
162
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
|
|
163
163
|
var require_RuleCreator = __commonJS({
|
|
164
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
164
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js"(exports) {
|
|
165
165
|
"use strict";
|
|
166
166
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
167
167
|
exports.RuleCreator = RuleCreator8;
|
|
@@ -207,9 +207,9 @@ var require_RuleCreator = __commonJS({
|
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
|
|
210
|
-
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
210
|
+
// ../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
|
|
211
211
|
var require_eslint_utils = __commonJS({
|
|
212
|
-
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.
|
|
212
|
+
"../../node_modules/.pnpm/@typescript-eslint+utils@8.60.0_eslint@10.5.0_jiti@2.7.0__typescript@6.0.3/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js"(exports) {
|
|
213
213
|
"use strict";
|
|
214
214
|
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
215
215
|
if (k2 === void 0) k2 = k;
|
package/dist/lit/index.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
|
|
|
147
147
|
}>;
|
|
148
148
|
|
|
149
149
|
type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, strict: StrictMode) => ClassPlugin<TProps>;
|
|
150
|
+
type ExtractPluginProps<TPlugin extends ClassPluginFactory<AnyRecord> | undefined> = TPlugin extends ClassPluginFactory<infer T> ? string extends keyof T ? EmptyRecord : T : EmptyRecord;
|
|
150
151
|
|
|
151
152
|
type AriaContext = {
|
|
152
153
|
readonly tag: IntrinsicTag;
|
|
@@ -205,27 +206,27 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
205
206
|
readonly allowedAs?: readonly TAllowed[];
|
|
206
207
|
};
|
|
207
208
|
|
|
208
|
-
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
209
|
+
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = {
|
|
209
210
|
readonly base?: ClassName;
|
|
210
211
|
readonly variants?: V;
|
|
211
212
|
readonly defaults?: Partial<DefaultVariants<V>>;
|
|
212
213
|
readonly compounds?: readonly CompoundVariant<V>[];
|
|
213
214
|
readonly presets?: TPreset;
|
|
214
215
|
readonly tags?: Readonly<TagMap>;
|
|
215
|
-
readonly plugin?:
|
|
216
|
+
readonly plugin?: TPlugin;
|
|
216
217
|
readonly precomputedClasses?: Readonly<Record<string, string>>;
|
|
217
218
|
};
|
|
218
219
|
|
|
219
220
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
220
221
|
normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
|
|
221
222
|
}['normalize'];
|
|
222
|
-
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, AnyRecord>;
|
|
223
|
-
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
223
|
+
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, ClassPluginFactory<AnyRecord> | undefined>;
|
|
224
|
+
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType> = {
|
|
224
225
|
readonly tag?: TDefault;
|
|
225
226
|
readonly name?: string;
|
|
226
227
|
readonly defaults?: Partial<NoInfer<Props>>;
|
|
227
228
|
readonly normalize?: NormalizeFn<NoInfer<Props>>;
|
|
228
|
-
readonly styling?: StylingOptions<V, TPreset,
|
|
229
|
+
readonly styling?: StylingOptions<V, TPreset, TPlugin>;
|
|
229
230
|
readonly enforcement?: EnforcementOptions<TAllowed>;
|
|
230
231
|
};
|
|
231
232
|
|
|
@@ -244,7 +245,7 @@ declare function defineContractComponent<O extends FactoryOptions>(options: O):
|
|
|
244
245
|
* Note: this adapter targets Light DOM composition only. Shadow DOM slot
|
|
245
246
|
* protocol is intentionally out of scope.
|
|
246
247
|
*/
|
|
247
|
-
type LitFactoryOptions<TDefault extends ElementType = ElementType, TProps extends AnyRecord = EmptyRecord, TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<TVariants> = Readonly<EmptyRecord>,
|
|
248
|
+
type LitFactoryOptions<TDefault extends ElementType = ElementType, TProps extends AnyRecord = EmptyRecord, TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<TVariants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = FactoryOptions<TDefault, TProps, TVariants, TPreset, TPlugin> & {
|
|
248
249
|
readonly filterProps?: FilterPredicate;
|
|
249
250
|
};
|
|
250
251
|
|
|
@@ -256,14 +257,14 @@ type UnknownProps = AnyRecord;
|
|
|
256
257
|
* (which would trigger TS4094 in declaration emit). Variant key instance
|
|
257
258
|
* properties are typed via the TVariants parameter.
|
|
258
259
|
*/
|
|
259
|
-
type LitContractComponent<TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord
|
|
260
|
+
type LitContractComponent<TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = {
|
|
260
261
|
new (): LitElement & {
|
|
261
262
|
as: string | undefined;
|
|
262
263
|
recipe: string | undefined;
|
|
263
264
|
praxisClass: string | undefined;
|
|
264
265
|
} & {
|
|
265
266
|
[K in Extract<keyof TVariants, string>]?: string | null;
|
|
266
|
-
};
|
|
267
|
+
} & TPluginProps;
|
|
267
268
|
};
|
|
268
269
|
|
|
269
270
|
/**
|
|
@@ -286,7 +287,7 @@ type LitContractComponent<TVariants extends Readonly<VariantMap> = Readonly<Empt
|
|
|
286
287
|
* customElements.define('praxis-button', Button)
|
|
287
288
|
* ```
|
|
288
289
|
*/
|
|
289
|
-
declare function createContractComponent<TDefault extends ElementType, TProps extends UnknownProps = EmptyRecord, TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<TVariants> = Readonly<EmptyRecord>,
|
|
290
|
+
declare function createContractComponent<TDefault extends ElementType, TProps extends UnknownProps = EmptyRecord, TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<TVariants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: LitFactoryOptions<TDefault, TProps, TVariants, TPreset, TPlugin>): LitContractComponent<TVariants, ExtractPluginProps<TPlugin>>;
|
|
290
291
|
|
|
291
292
|
/**
|
|
292
293
|
* Renders a praxis-kit Lit component to an HTML string without requiring a DOM.
|
package/dist/lit/index.js
CHANGED
|
@@ -585,7 +585,7 @@ function isStandaloneTag(tag) {
|
|
|
585
585
|
return STANDALONE_ROLES_SET.has(IMPLICIT_ROLE_RECORD[tag]);
|
|
586
586
|
}
|
|
587
587
|
|
|
588
|
-
// ../core/dist/chunk-
|
|
588
|
+
// ../core/dist/chunk-2NJ5XLOA.js
|
|
589
589
|
var IMPLICIT_ROLE_RECORD2 = {
|
|
590
590
|
article: "article",
|
|
591
591
|
aside: "complementary",
|
|
@@ -614,26 +614,37 @@ function getImplicitRole(tag) {
|
|
|
614
614
|
if (tag in IMPLICIT_ROLE_RECORD2) return IMPLICIT_ROLE_RECORD2[tag];
|
|
615
615
|
return void 0;
|
|
616
616
|
}
|
|
617
|
-
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol("praxis.component-default-tag");
|
|
618
|
-
function
|
|
617
|
+
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
618
|
+
function getAsProp(child) {
|
|
619
|
+
if (!isObject(child) || !("props" in child)) return void 0;
|
|
620
|
+
const props = child.props;
|
|
621
|
+
if (!isObject(props)) return void 0;
|
|
622
|
+
const as = props.as;
|
|
623
|
+
return isString(as) && as !== "" ? as : void 0;
|
|
624
|
+
}
|
|
625
|
+
function getTag(child) {
|
|
619
626
|
if (!isObject(child) || !("type" in child)) return void 0;
|
|
620
627
|
const t = child.type;
|
|
621
628
|
if (isString(t)) return t;
|
|
622
|
-
if (
|
|
629
|
+
if (typeof t === "function" || isObject(t)) {
|
|
623
630
|
const defaultTag = t[COMPONENT_DEFAULT_TAG];
|
|
624
631
|
if (!isString(defaultTag)) return void 0;
|
|
625
|
-
|
|
626
|
-
const as = isObject(props) && "as" in props ? props.as : void 0;
|
|
627
|
-
return isString(as) ? as : defaultTag;
|
|
632
|
+
return getAsProp(child) ?? defaultTag;
|
|
628
633
|
}
|
|
629
634
|
return void 0;
|
|
630
635
|
}
|
|
631
|
-
function isTag(...
|
|
636
|
+
function isTag(...args) {
|
|
637
|
+
if (isString(args[0])) {
|
|
638
|
+
const set2 = new Set(args);
|
|
639
|
+
return (child2) => {
|
|
640
|
+
const tag2 = getTag(child2);
|
|
641
|
+
return tag2 !== void 0 && set2.has(tag2);
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
const [child, ...tags] = args;
|
|
632
645
|
const set = new Set(tags);
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return tag !== void 0 && set.has(tag);
|
|
636
|
-
};
|
|
646
|
+
const tag = getTag(child);
|
|
647
|
+
return tag !== void 0 && set.has(tag);
|
|
637
648
|
}
|
|
638
649
|
var pendingAsyncWarns2 = /* @__PURE__ */ new Set();
|
|
639
650
|
var asyncWarnScheduled2 = false;
|
|
@@ -1876,7 +1887,14 @@ function createContractComponent(options) {
|
|
|
1876
1887
|
const bundle = buildRuntime(options);
|
|
1877
1888
|
const looseBundle = toLooseBundle(bundle);
|
|
1878
1889
|
const variantKeys = options.styling?.variants ? Object.keys(options.styling.variants) : [];
|
|
1879
|
-
const
|
|
1890
|
+
const pluginKeys = "classPlugin" in bundle.runtime ? [...bundle.runtime.classPlugin.ownedKeys ?? []] : [];
|
|
1891
|
+
const praxisProps = /* @__PURE__ */ new Set([
|
|
1892
|
+
"as",
|
|
1893
|
+
"recipe",
|
|
1894
|
+
"praxisClass",
|
|
1895
|
+
...variantKeys,
|
|
1896
|
+
...pluginKeys
|
|
1897
|
+
]);
|
|
1880
1898
|
const staticProps = {
|
|
1881
1899
|
as: { type: String, attribute: "as" },
|
|
1882
1900
|
recipe: { type: String, attribute: "variant-key" },
|
|
@@ -1887,6 +1905,9 @@ function createContractComponent(options) {
|
|
|
1887
1905
|
for (const key of variantKeys) {
|
|
1888
1906
|
staticProps[key] = { type: String, attribute: key };
|
|
1889
1907
|
}
|
|
1908
|
+
for (const key of pluginKeys) {
|
|
1909
|
+
staticProps[key] = { type: String, attribute: key };
|
|
1910
|
+
}
|
|
1890
1911
|
class PolymorphicLitElement extends LitElement {
|
|
1891
1912
|
// Tracks keys set by the pipeline last render so stale attrs are removed.
|
|
1892
1913
|
_pipelineAttrs = /* @__PURE__ */ new Set();
|
|
@@ -162,6 +162,7 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
|
|
|
162
162
|
}>;
|
|
163
163
|
|
|
164
164
|
type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, strict: StrictMode) => ClassPlugin<TProps>;
|
|
165
|
+
type ExtractPluginProps<TPlugin extends ClassPluginFactory<AnyRecord> | undefined> = TPlugin extends ClassPluginFactory<infer T> ? string extends keyof T ? EmptyRecord : T : EmptyRecord;
|
|
165
166
|
|
|
166
167
|
type AriaContext = {
|
|
167
168
|
readonly tag: IntrinsicTag;
|
|
@@ -220,27 +221,27 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
220
221
|
readonly allowedAs?: readonly TAllowed[];
|
|
221
222
|
};
|
|
222
223
|
|
|
223
|
-
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
224
|
+
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = {
|
|
224
225
|
readonly base?: ClassName;
|
|
225
226
|
readonly variants?: V;
|
|
226
227
|
readonly defaults?: Partial<DefaultVariants<V>>;
|
|
227
228
|
readonly compounds?: readonly CompoundVariant<V>[];
|
|
228
229
|
readonly presets?: TPreset;
|
|
229
230
|
readonly tags?: Readonly<TagMap>;
|
|
230
|
-
readonly plugin?:
|
|
231
|
+
readonly plugin?: TPlugin;
|
|
231
232
|
readonly precomputedClasses?: Readonly<Record<string, string>>;
|
|
232
233
|
};
|
|
233
234
|
|
|
234
235
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
235
236
|
normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
|
|
236
237
|
}['normalize'];
|
|
237
|
-
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, AnyRecord>;
|
|
238
|
-
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
238
|
+
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, ClassPluginFactory<AnyRecord> | undefined>;
|
|
239
|
+
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType> = {
|
|
239
240
|
readonly tag?: TDefault;
|
|
240
241
|
readonly name?: string;
|
|
241
242
|
readonly defaults?: Partial<NoInfer<Props>>;
|
|
242
243
|
readonly normalize?: NormalizeFn<NoInfer<Props>>;
|
|
243
|
-
readonly styling?: StylingOptions<V, TPreset,
|
|
244
|
+
readonly styling?: StylingOptions<V, TPreset, TPlugin>;
|
|
244
245
|
readonly enforcement?: EnforcementOptions<TAllowed>;
|
|
245
246
|
};
|
|
246
247
|
|
|
@@ -264,7 +265,7 @@ type RenderCallbackProps = Readonly<Record<string, unknown>>;
|
|
|
264
265
|
* Extends FactoryOptions with React-specific configuration.
|
|
265
266
|
* slotComponent is intentionally not in core — it is a React rendering concern.
|
|
266
267
|
*/
|
|
267
|
-
type ReactFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
268
|
+
type ReactFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType> = FactoryOptions<TDefault, Props, Variants, TPreset, TPlugin, TAllowed> & {
|
|
268
269
|
/** Component used to render the asChild slot. Defaults to the built-in Slot. */
|
|
269
270
|
slotComponent?: SlotComponent;
|
|
270
271
|
/**
|
|
@@ -377,4 +378,4 @@ type PolymorphicComponent<G extends PolymorphicGenerics> = {
|
|
|
377
378
|
|
|
378
379
|
declare function mergeRefs<T>(...refs: (Ref<T> | null | undefined)[]): Ref<T> | null;
|
|
379
380
|
|
|
380
|
-
export { type AnyRecord as A, type ElementType as E, type FactoryOptions as F, type PolymorphicComponent as P, type RecipeMap as R, Slottable as S, type UnknownProps as U, type VariantMap as V, type EmptyRecord as a, type ReactFactoryOptions as b, type PolymorphicGenerics as c, type
|
|
381
|
+
export { type AnyRecord as A, type ClassPluginFactory as C, type ElementType as E, type FactoryOptions as F, type PolymorphicComponent as P, type RecipeMap as R, Slottable as S, type UnknownProps as U, type VariantMap as V, type EmptyRecord as a, type ReactFactoryOptions as b, type PolymorphicGenerics as c, type ExtractPluginProps as d, type AnyFactoryOptions as e, type ElementRef as f, type PolymorphicProps as g, type PolymorphicWithAsChild as h, type PolymorphicWithRender as i, type RenderCallbackProps as j, type SlottableProps as k, defineContractComponent as l, mergeRefs as m };
|
package/dist/preact/index.d.ts
CHANGED
|
@@ -161,6 +161,7 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
|
|
|
161
161
|
}>;
|
|
162
162
|
|
|
163
163
|
type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, strict: StrictMode) => ClassPlugin<TProps>;
|
|
164
|
+
type ExtractPluginProps<TPlugin extends ClassPluginFactory<AnyRecord> | undefined> = TPlugin extends ClassPluginFactory<infer T> ? string extends keyof T ? EmptyRecord : T : EmptyRecord;
|
|
164
165
|
|
|
165
166
|
type AriaContext = {
|
|
166
167
|
readonly tag: IntrinsicTag;
|
|
@@ -219,27 +220,27 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
219
220
|
readonly allowedAs?: readonly TAllowed[];
|
|
220
221
|
};
|
|
221
222
|
|
|
222
|
-
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
223
|
+
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = {
|
|
223
224
|
readonly base?: ClassName;
|
|
224
225
|
readonly variants?: V;
|
|
225
226
|
readonly defaults?: Partial<DefaultVariants<V>>;
|
|
226
227
|
readonly compounds?: readonly CompoundVariant<V>[];
|
|
227
228
|
readonly presets?: TPreset;
|
|
228
229
|
readonly tags?: Readonly<TagMap>;
|
|
229
|
-
readonly plugin?:
|
|
230
|
+
readonly plugin?: TPlugin;
|
|
230
231
|
readonly precomputedClasses?: Readonly<Record<string, string>>;
|
|
231
232
|
};
|
|
232
233
|
|
|
233
234
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
234
235
|
normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
|
|
235
236
|
}['normalize'];
|
|
236
|
-
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, AnyRecord>;
|
|
237
|
-
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
237
|
+
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, ClassPluginFactory<AnyRecord> | undefined>;
|
|
238
|
+
type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType> = {
|
|
238
239
|
readonly tag?: TDefault;
|
|
239
240
|
readonly name?: string;
|
|
240
241
|
readonly defaults?: Partial<NoInfer<Props>>;
|
|
241
242
|
readonly normalize?: NormalizeFn<NoInfer<Props>>;
|
|
242
|
-
readonly styling?: StylingOptions<V, TPreset,
|
|
243
|
+
readonly styling?: StylingOptions<V, TPreset, TPlugin>;
|
|
243
244
|
readonly enforcement?: EnforcementOptions<TAllowed>;
|
|
244
245
|
};
|
|
245
246
|
|
|
@@ -252,7 +253,7 @@ type UnknownProps = Record<string, unknown>;
|
|
|
252
253
|
type SlotComponent = ComponentType<UnknownProps>;
|
|
253
254
|
type AnyVNode = VNode<any>;
|
|
254
255
|
|
|
255
|
-
type PreactFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
256
|
+
type PreactFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = FactoryOptions<TDefault, Props, Variants, TPreset, TPlugin> & {
|
|
256
257
|
/** Component used to render the asChild slot. Defaults to the built-in Slot. */
|
|
257
258
|
slotComponent?: SlotComponent;
|
|
258
259
|
/**
|
|
@@ -286,7 +287,7 @@ type PolymorphicComponent<G extends PolymorphicGenerics> = {
|
|
|
286
287
|
displayName?: string;
|
|
287
288
|
};
|
|
288
289
|
|
|
289
|
-
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
290
|
+
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: PreactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
290
291
|
|
|
291
292
|
type SlottableProps = {
|
|
292
293
|
children?: ComponentChildren;
|
package/dist/preact/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function normalizeChildren(children) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// ../shared/src/guards/children/component-id.ts
|
|
13
|
-
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol("praxis.component-default-tag");
|
|
13
|
+
var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
14
14
|
|
|
15
15
|
// ../../lib/primitive/src/utils/is-object.ts
|
|
16
16
|
function isNull(value) {
|
|
@@ -625,7 +625,7 @@ function isKnownAriaRole(value) {
|
|
|
625
625
|
return isString(value) && KNOWN_ARIA_ROLES_SET.has(value);
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
-
// ../core/dist/chunk-
|
|
628
|
+
// ../core/dist/chunk-2NJ5XLOA.js
|
|
629
629
|
var IMPLICIT_ROLE_RECORD2 = {
|
|
630
630
|
article: "article",
|
|
631
631
|
aside: "complementary",
|
|
@@ -654,26 +654,37 @@ function getImplicitRole(tag) {
|
|
|
654
654
|
if (tag in IMPLICIT_ROLE_RECORD2) return IMPLICIT_ROLE_RECORD2[tag];
|
|
655
655
|
return void 0;
|
|
656
656
|
}
|
|
657
|
-
var COMPONENT_DEFAULT_TAG2 = /* @__PURE__ */ Symbol("praxis.component-default-tag");
|
|
658
|
-
function
|
|
657
|
+
var COMPONENT_DEFAULT_TAG2 = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
|
|
658
|
+
function getAsProp(child) {
|
|
659
|
+
if (!isObject2(child) || !("props" in child)) return void 0;
|
|
660
|
+
const props = child.props;
|
|
661
|
+
if (!isObject2(props)) return void 0;
|
|
662
|
+
const as = props.as;
|
|
663
|
+
return isString(as) && as !== "" ? as : void 0;
|
|
664
|
+
}
|
|
665
|
+
function getTag(child) {
|
|
659
666
|
if (!isObject2(child) || !("type" in child)) return void 0;
|
|
660
667
|
const t = child.type;
|
|
661
668
|
if (isString(t)) return t;
|
|
662
|
-
if (
|
|
669
|
+
if (typeof t === "function" || isObject2(t)) {
|
|
663
670
|
const defaultTag = t[COMPONENT_DEFAULT_TAG2];
|
|
664
671
|
if (!isString(defaultTag)) return void 0;
|
|
665
|
-
|
|
666
|
-
const as = isObject2(props) && "as" in props ? props.as : void 0;
|
|
667
|
-
return isString(as) ? as : defaultTag;
|
|
672
|
+
return getAsProp(child) ?? defaultTag;
|
|
668
673
|
}
|
|
669
674
|
return void 0;
|
|
670
675
|
}
|
|
671
|
-
function isTag(...
|
|
676
|
+
function isTag(...args) {
|
|
677
|
+
if (isString(args[0])) {
|
|
678
|
+
const set2 = new Set(args);
|
|
679
|
+
return (child2) => {
|
|
680
|
+
const tag2 = getTag(child2);
|
|
681
|
+
return tag2 !== void 0 && set2.has(tag2);
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
const [child, ...tags] = args;
|
|
672
685
|
const set = new Set(tags);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
return tag !== void 0 && set.has(tag);
|
|
676
|
-
};
|
|
686
|
+
const tag = getTag(child);
|
|
687
|
+
return tag !== void 0 && set.has(tag);
|
|
677
688
|
}
|
|
678
689
|
var pendingAsyncWarns2 = /* @__PURE__ */ new Set();
|
|
679
690
|
var asyncWarnScheduled2 = false;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { E as ElementType, U as UnknownProps, V as VariantMap, R as RecipeMap, a as EmptyRecord, A as AnyRecord, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics } from '../merge-refs-
|
|
2
|
-
export {
|
|
1
|
+
import { E as ElementType, U as UnknownProps, V as VariantMap, R as RecipeMap, a as EmptyRecord, C as ClassPluginFactory, A as AnyRecord, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics, d as ExtractPluginProps } from '../merge-refs-BKyE8h8M.js';
|
|
2
|
+
export { e as AnyFactoryOptions, f as ElementRef, F as FactoryOptions, g as PolymorphicProps, h as PolymorphicWithAsChild, i as PolymorphicWithRender, j as RenderCallbackProps, S as Slottable, k as SlottableProps, l as defineContractComponent, m as mergeRefs } from '../merge-refs-BKyE8h8M.js';
|
|
3
3
|
import { Ref, ReactElement } from 'react';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
|
|
6
|
-
declare function createAriaEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
6
|
+
declare function createAriaEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
7
7
|
|
|
8
|
-
declare function createChildrenEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
8
|
+
declare function createChildrenEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
9
9
|
|
|
10
|
-
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
10
|
+
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin, TAllowed>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset, TAllowed>>;
|
|
11
11
|
|
|
12
|
-
declare function createContractedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
12
|
+
declare function createContractedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
13
13
|
|
|
14
|
-
declare function createPolymorphicComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
14
|
+
declare function createPolymorphicComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
15
15
|
|
|
16
16
|
type SlotProps = {
|
|
17
17
|
ref?: Ref<unknown> | null;
|
package/dist/react/index.js
CHANGED
package/dist/react/legacy.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { E as ElementType, U as UnknownProps, V as VariantMap, R as RecipeMap, a as EmptyRecord, A as AnyRecord, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics } from '../merge-refs-
|
|
2
|
-
export {
|
|
1
|
+
import { E as ElementType, U as UnknownProps, V as VariantMap, R as RecipeMap, a as EmptyRecord, C as ClassPluginFactory, A as AnyRecord, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics, d as ExtractPluginProps } from '../merge-refs-BKyE8h8M.js';
|
|
2
|
+
export { e as AnyFactoryOptions, f as ElementRef, F as FactoryOptions, g as PolymorphicProps, h as PolymorphicWithAsChild, i as PolymorphicWithRender, j as RenderCallbackProps, S as Slottable, k as SlottableProps, l as defineContractComponent, m as mergeRefs } from '../merge-refs-BKyE8h8M.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
|
|
6
|
-
declare function createAriaEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
6
|
+
declare function createAriaEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
7
7
|
|
|
8
|
-
declare function createChildrenEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
8
|
+
declare function createChildrenEnforcedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
9
9
|
|
|
10
|
-
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
10
|
+
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined, TAllowed extends ElementType = ElementType>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin, TAllowed>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset, TAllowed>>;
|
|
11
11
|
|
|
12
|
-
declare function createContractedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
12
|
+
declare function createContractedComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
13
13
|
|
|
14
|
-
declare function createPolymorphicComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
14
|
+
declare function createPolymorphicComponent<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options: ReactFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
15
15
|
|
|
16
16
|
type SlotProps = {
|
|
17
17
|
[key: string]: unknown;
|