praxis-kit 3.1.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/contract/index.d.ts +5 -5
- package/dist/lit/index.d.ts +10 -9
- package/dist/lit/index.js +11 -1
- package/dist/{merge-refs-CfAbwCKz.d.ts → merge-refs-BKyE8h8M.d.ts} +8 -7
- package/dist/preact/index.d.ts +8 -7
- package/dist/react/index.d.ts +7 -7
- package/dist/react/legacy.d.ts +7 -7
- package/dist/solid/index.d.ts +8 -7
- package/dist/svelte/index.d.ts +10 -8
- package/dist/vue/index.d.ts +8 -7
- package/dist/web/index.d.ts +10 -9
- package/dist/web/index.js +2 -1
- package/package.json +3 -3
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/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
|
@@ -1887,7 +1887,14 @@ function createContractComponent(options) {
|
|
|
1887
1887
|
const bundle = buildRuntime(options);
|
|
1888
1888
|
const looseBundle = toLooseBundle(bundle);
|
|
1889
1889
|
const variantKeys = options.styling?.variants ? Object.keys(options.styling.variants) : [];
|
|
1890
|
-
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
|
+
]);
|
|
1891
1898
|
const staticProps = {
|
|
1892
1899
|
as: { type: String, attribute: "as" },
|
|
1893
1900
|
recipe: { type: String, attribute: "variant-key" },
|
|
@@ -1898,6 +1905,9 @@ function createContractComponent(options) {
|
|
|
1898
1905
|
for (const key of variantKeys) {
|
|
1899
1906
|
staticProps[key] = { type: String, attribute: key };
|
|
1900
1907
|
}
|
|
1908
|
+
for (const key of pluginKeys) {
|
|
1909
|
+
staticProps[key] = { type: String, attribute: key };
|
|
1910
|
+
}
|
|
1901
1911
|
class PolymorphicLitElement extends LitElement {
|
|
1902
1912
|
// Tracks keys set by the pipeline last render so stale attrs are removed.
|
|
1903
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/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/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;
|
package/dist/solid/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 SolidElement = JSX.Element;
|
|
253
254
|
type SlotRenderFn = (props: UnknownProps) => SolidElement;
|
|
254
255
|
|
|
255
|
-
type SolidFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
256
|
+
type SolidFactoryOptions<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
|
/**
|
|
257
258
|
* Return true for any prop key that should be consumed but not forwarded to the DOM.
|
|
258
259
|
* Receives `runtime.options.variantKeys` as a convenience if needed.
|
|
@@ -286,6 +287,6 @@ 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: SolidFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
290
291
|
|
|
291
292
|
export { type AnyFactoryOptions, type ElementRef, type ElementType, type EmptyRecord, type PolymorphicComponent, type PolymorphicGenerics, type PolymorphicProps, type SolidFactoryOptions, createContractComponent, defineContractComponent };
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -160,6 +160,8 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
|
|
|
160
160
|
}>;
|
|
161
161
|
|
|
162
162
|
type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, strict: StrictMode) => ClassPlugin<TProps>;
|
|
163
|
+
type ExtractPluginProps<TPlugin extends ClassPluginFactory<AnyRecord> | undefined> = TPlugin extends ClassPluginFactory<infer T> ? string extends keyof T ? EmptyRecord : T : EmptyRecord;
|
|
164
|
+
type PluginInstance<TPlugin extends ClassPluginFactory<AnyRecord> | undefined> = TPlugin extends ClassPluginFactory<infer TProps> ? ClassPlugin<TProps> : undefined;
|
|
163
165
|
|
|
164
166
|
type AriaContext = {
|
|
165
167
|
readonly tag: IntrinsicTag;
|
|
@@ -218,27 +220,27 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
218
220
|
readonly allowedAs?: readonly TAllowed[];
|
|
219
221
|
};
|
|
220
222
|
|
|
221
|
-
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> = {
|
|
222
224
|
readonly base?: ClassName;
|
|
223
225
|
readonly variants?: V;
|
|
224
226
|
readonly defaults?: Partial<DefaultVariants<V>>;
|
|
225
227
|
readonly compounds?: readonly CompoundVariant<V>[];
|
|
226
228
|
readonly presets?: TPreset;
|
|
227
229
|
readonly tags?: Readonly<TagMap>;
|
|
228
|
-
readonly plugin?:
|
|
230
|
+
readonly plugin?: TPlugin;
|
|
229
231
|
readonly precomputedClasses?: Readonly<Record<string, string>>;
|
|
230
232
|
};
|
|
231
233
|
|
|
232
234
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
233
235
|
normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
|
|
234
236
|
}['normalize'];
|
|
235
|
-
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, AnyRecord>;
|
|
236
|
-
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> = {
|
|
237
239
|
readonly tag?: TDefault;
|
|
238
240
|
readonly name?: string;
|
|
239
241
|
readonly defaults?: Partial<NoInfer<Props>>;
|
|
240
242
|
readonly normalize?: NormalizeFn<NoInfer<Props>>;
|
|
241
|
-
readonly styling?: StylingOptions<V, TPreset,
|
|
243
|
+
readonly styling?: StylingOptions<V, TPreset, TPlugin>;
|
|
242
244
|
readonly enforcement?: EnforcementOptions<TAllowed>;
|
|
243
245
|
};
|
|
244
246
|
|
|
@@ -299,7 +301,7 @@ declare class ChildrenEvaluator extends StrictBase {
|
|
|
299
301
|
evaluate(children: unknown[]): void;
|
|
300
302
|
}
|
|
301
303
|
|
|
302
|
-
declare function createPolymorphic<TDefault extends ElementType, Props extends AnyRecord, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord
|
|
304
|
+
declare function createPolymorphic<TDefault extends ElementType, Props extends AnyRecord, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined>(options?: FactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicRuntime<TDefault, Props, Variants, Extract<keyof TPreset, string>, TPreset, PluginInstance<TPlugin>>;
|
|
303
305
|
|
|
304
306
|
declare class SlotValidator extends StrictBase {
|
|
305
307
|
#private;
|
|
@@ -323,7 +325,7 @@ declare function defineContractComponent<O extends FactoryOptions>(options: O):
|
|
|
323
325
|
|
|
324
326
|
type UnknownProps = Record<string, unknown>;
|
|
325
327
|
|
|
326
|
-
type SvelteFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
328
|
+
type SvelteFactoryOptions<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> & {
|
|
327
329
|
/**
|
|
328
330
|
* Return true for any prop key that should be consumed but not forwarded to the DOM.
|
|
329
331
|
* Receives `runtime.options.variantKeys` as a convenience if needed.
|
|
@@ -339,6 +341,6 @@ type BuiltRuntime<G extends PolymorphicGenerics = PolymorphicGenerics, TOptions
|
|
|
339
341
|
slotValidator: SlotValidator;
|
|
340
342
|
};
|
|
341
343
|
|
|
342
|
-
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
344
|
+
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, TOptions extends WithChildRules = SvelteFactoryOptions<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>(options: SvelteFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin> & TOptions): BuiltRuntime<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>, TOptions>;
|
|
343
345
|
|
|
344
346
|
export { type AnyFactoryOptions, type BuiltRuntime, type ElementType, type EmptyRecord, type FilterPredicate, type PolymorphicGenerics, type SvelteFactoryOptions, type UnknownProps, type WithChildRules, createContractComponent, defineContractComponent };
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -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
|
|
|
@@ -251,7 +252,7 @@ declare function defineContractComponent<O extends FactoryOptions>(options: O):
|
|
|
251
252
|
|
|
252
253
|
type UnknownProps = Record<string, unknown>;
|
|
253
254
|
|
|
254
|
-
type VueFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
255
|
+
type VueFactoryOptions<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> & {
|
|
255
256
|
/**
|
|
256
257
|
* Return true for any prop key that should be consumed but not forwarded to
|
|
257
258
|
* the DOM. Variant keys are always stripped automatically.
|
|
@@ -308,6 +309,6 @@ type PolymorphicComponent<G extends PolymorphicGenerics> = {
|
|
|
308
309
|
displayName?: string;
|
|
309
310
|
};
|
|
310
311
|
|
|
311
|
-
declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>,
|
|
312
|
+
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: VueFactoryOptions<TDefault, Props, Variants, TPreset, TPlugin>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & ExtractPluginProps<TPlugin>, Variants, TPreset>>;
|
|
312
313
|
|
|
313
314
|
export { type AnyFactoryOptions, type ElementType, type EmptyRecord, type PolymorphicComponent, type PolymorphicGenerics, type PolymorphicProps, type PolymorphicWithAsChild, Slottable, type SlottableProps, type VueFactoryOptions, createContractComponent, defineContractComponent };
|
package/dist/web/index.d.ts
CHANGED
|
@@ -146,6 +146,7 @@ type ClassPlugin<TProps extends AnyRecord = EmptyRecord> = Readonly<{
|
|
|
146
146
|
}>;
|
|
147
147
|
|
|
148
148
|
type ClassPluginFactory<TProps extends AnyRecord = EmptyRecord> = <V extends VariantMap>(options: ClassPipelineOptions<V>, strict: StrictMode) => ClassPlugin<TProps>;
|
|
149
|
+
type ExtractPluginProps<TPlugin extends ClassPluginFactory<AnyRecord> | undefined> = TPlugin extends ClassPluginFactory<infer T> ? string extends keyof T ? EmptyRecord : T : EmptyRecord;
|
|
149
150
|
|
|
150
151
|
type AriaContext = {
|
|
151
152
|
readonly tag: IntrinsicTag;
|
|
@@ -204,27 +205,27 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
204
205
|
readonly allowedAs?: readonly TAllowed[];
|
|
205
206
|
};
|
|
206
207
|
|
|
207
|
-
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>,
|
|
208
|
+
type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPlugin extends ClassPluginFactory<AnyRecord> | undefined = ClassPluginFactory<AnyRecord> | undefined> = {
|
|
208
209
|
readonly base?: ClassName;
|
|
209
210
|
readonly variants?: V;
|
|
210
211
|
readonly defaults?: Partial<DefaultVariants<V>>;
|
|
211
212
|
readonly compounds?: readonly CompoundVariant<V>[];
|
|
212
213
|
readonly presets?: TPreset;
|
|
213
214
|
readonly tags?: Readonly<TagMap>;
|
|
214
|
-
readonly plugin?:
|
|
215
|
+
readonly plugin?: TPlugin;
|
|
215
216
|
readonly precomputedClasses?: Readonly<Record<string, string>>;
|
|
216
217
|
};
|
|
217
218
|
|
|
218
219
|
type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
|
|
219
220
|
normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
|
|
220
221
|
}['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>,
|
|
222
|
+
type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, RecipeMap<VariantMap>, ClassPluginFactory<AnyRecord> | undefined>;
|
|
223
|
+
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
224
|
readonly tag?: TDefault;
|
|
224
225
|
readonly name?: string;
|
|
225
226
|
readonly defaults?: Partial<NoInfer<Props>>;
|
|
226
227
|
readonly normalize?: NormalizeFn<NoInfer<Props>>;
|
|
227
|
-
readonly styling?: StylingOptions<V, TPreset,
|
|
228
|
+
readonly styling?: StylingOptions<V, TPreset, TPlugin>;
|
|
228
229
|
readonly enforcement?: EnforcementOptions<TAllowed>;
|
|
229
230
|
};
|
|
230
231
|
|
|
@@ -238,7 +239,7 @@ declare function defineContractComponent<O extends FactoryOptions>(options: O):
|
|
|
238
239
|
* Identical shape to LitFactoryOptions — a plain HTMLElement subclass with
|
|
239
240
|
* no framework dependency. Light DOM only; Shadow DOM is out of scope.
|
|
240
241
|
*/
|
|
241
|
-
type WebFactoryOptions<TDefault extends ElementType = ElementType, TProps extends AnyRecord = EmptyRecord, TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<TVariants> = Readonly<EmptyRecord>,
|
|
242
|
+
type WebFactoryOptions<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> & {
|
|
242
243
|
readonly filterProps?: FilterPredicate;
|
|
243
244
|
};
|
|
244
245
|
|
|
@@ -249,7 +250,7 @@ type UnknownProps = Record<string, unknown>;
|
|
|
249
250
|
* Describes the public contract without exposing HTMLElement's internal members.
|
|
250
251
|
* Variant key instance properties are typed via TVariants.
|
|
251
252
|
*/
|
|
252
|
-
type WebContractComponent<TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord
|
|
253
|
+
type WebContractComponent<TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = {
|
|
253
254
|
new (): HTMLElement & {
|
|
254
255
|
as: string | undefined;
|
|
255
256
|
recipe: string | undefined;
|
|
@@ -258,7 +259,7 @@ type WebContractComponent<TVariants extends Readonly<VariantMap> = Readonly<Empt
|
|
|
258
259
|
update(): void;
|
|
259
260
|
} & {
|
|
260
261
|
[K in Extract<keyof TVariants, string>]?: string | null;
|
|
261
|
-
};
|
|
262
|
+
} & TPluginProps;
|
|
262
263
|
/** The resolved strict mode for this component — usable by subclasses for custom enforcement. */
|
|
263
264
|
readonly strict: Exclude<StrictMode, undefined>;
|
|
264
265
|
};
|
|
@@ -290,7 +291,7 @@ type WebContractComponent<TVariants extends Readonly<VariantMap> = Readonly<Empt
|
|
|
290
291
|
* For non-reactive attributes (`aria-*`, `role`, `data-*`) call `element.update()`
|
|
291
292
|
* after setting them to trigger an explicit pipeline re-run.
|
|
292
293
|
*/
|
|
293
|
-
declare function createContractComponent<TDefault extends ElementType, TProps extends UnknownProps = EmptyRecord, TVariants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<TVariants> = Readonly<EmptyRecord>,
|
|
294
|
+
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: WebFactoryOptions<TDefault, TProps, TVariants, TPreset, TPlugin>): WebContractComponent<TVariants, ExtractPluginProps<TPlugin>>;
|
|
294
295
|
|
|
295
296
|
/**
|
|
296
297
|
* Renders a praxis-kit web component to an HTML string without requiring a DOM.
|
package/dist/web/index.js
CHANGED
|
@@ -1879,7 +1879,8 @@ function createContractComponent(options) {
|
|
|
1879
1879
|
const bundle = buildRuntime(options);
|
|
1880
1880
|
const looseBundle = toLooseBundle(bundle);
|
|
1881
1881
|
const variantKeys = options.styling?.variants ? Object.keys(options.styling.variants) : [];
|
|
1882
|
-
const
|
|
1882
|
+
const pluginKeys = "classPlugin" in bundle.runtime ? [...bundle.runtime.classPlugin.ownedKeys ?? []] : [];
|
|
1883
|
+
const observedAttrNames = ["as", "variant-key", "praxis-class", ...variantKeys, ...pluginKeys];
|
|
1883
1884
|
const BaseElement = typeof HTMLElement !== "undefined" ? HTMLElement : class {
|
|
1884
1885
|
};
|
|
1885
1886
|
class PolymorphicWebElement extends BaseElement {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "praxis-kit",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./react": {
|
|
@@ -130,8 +130,8 @@
|
|
|
130
130
|
"vite": "^8.0.16",
|
|
131
131
|
"vue": "^3.5.38",
|
|
132
132
|
"@praxis-kit/adapter-utils": "0.0.0",
|
|
133
|
-
"@praxis-kit/
|
|
134
|
-
"@praxis-kit/
|
|
133
|
+
"@praxis-kit/shared": "0.8.0-beta.4",
|
|
134
|
+
"@praxis-kit/core": "0.8.0-beta.4"
|
|
135
135
|
},
|
|
136
136
|
"publishConfig": {
|
|
137
137
|
"access": "public"
|