praxis-kit 2.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,9 +116,9 @@ type VariantSelection<V extends VariantMap> = {
116
116
  * Presets are named bundles of variant props that callers activate by key,
117
117
  * avoiding the need to repeat variant combinations at each call site.
118
118
  */
119
- type PresetMap<V extends VariantMap = VariantMap> = Readonly<Record<string, VariantSelection<V>>>;
119
+ type RecipeMap<V extends VariantMap = VariantMap> = Readonly<Record<string, VariantSelection<V>>>;
120
120
 
121
- interface PolymorphicGenerics<TDefault extends ElementType = ElementType, Props extends AnyRecord = AnyRecord, Variants extends Readonly<VariantMap> = Readonly<VariantMap>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>, TAllowed extends ElementType = ElementType> {
121
+ interface PolymorphicGenerics<TDefault extends ElementType = ElementType, Props extends AnyRecord = AnyRecord, Variants extends Readonly<VariantMap> = Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TAllowed extends ElementType = ElementType> {
122
122
  default: TDefault;
123
123
  props: Props;
124
124
  variants: Variants;
@@ -126,25 +126,25 @@ interface PolymorphicGenerics<TDefault extends ElementType = ElementType, Props
126
126
  allowed: TAllowed;
127
127
  }
128
128
  type VariantsOf<T extends PolymorphicGenerics> = T['variants'];
129
- type PresetOf<T extends PolymorphicGenerics> = T['preset'];
129
+ type RecipeOf<T extends PolymorphicGenerics> = T['preset'];
130
130
 
131
- type PresetTarget<TVariants extends VariantMap = VariantMap> = VariantSelection<TVariants>;
131
+ type RecipeTarget<TVariants extends VariantMap = VariantMap> = VariantSelection<TVariants>;
132
132
 
133
133
  interface BaseClassOptions {
134
134
  baseClassName?: ClassName;
135
135
  }
136
136
 
137
- type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, variantKey?: string) => string;
137
+ type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, recipe?: string) => string;
138
138
 
139
- interface PresetOptions<TVariants extends VariantMap = VariantMap> {
140
- presetMap?: Record<string, PresetTarget<TVariants>>;
139
+ interface RecipeOptions<TVariants extends VariantMap = VariantMap> {
140
+ recipeMap?: Record<string, RecipeTarget<TVariants>>;
141
141
  }
142
142
 
143
143
  interface TagMapOptions {
144
144
  tagMap?: TagMap;
145
145
  }
146
146
 
147
- type CompositionOptions<TVariants extends VariantMap = VariantMap> = Simplify<TagMapOptions & PresetOptions<TVariants>>;
147
+ type CompositionOptions<TVariants extends VariantMap = VariantMap> = Simplify<TagMapOptions & RecipeOptions<TVariants>>;
148
148
 
149
149
  type CVASystemOptions<TVariants extends VariantMap = VariantMap> = Simplify<CVAVariants<TVariants> & CVADefaults<TVariants> & CVACompounds<TVariants>>;
150
150
 
@@ -219,7 +219,7 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
219
219
  readonly allowedAs?: readonly TAllowed[];
220
220
  };
221
221
 
222
- type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<V> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = {
222
+ type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = {
223
223
  readonly base?: ClassName;
224
224
  readonly variants?: V;
225
225
  readonly defaults?: Partial<DefaultVariants<V>>;
@@ -233,8 +233,8 @@ type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPre
233
233
  type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
234
234
  normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
235
235
  }['normalize'];
236
- type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, PresetMap<VariantMap>, AnyRecord>;
237
- type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<V> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord, TAllowed extends ElementType = ElementType> = {
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>, TPluginProps extends AnyRecord = EmptyRecord, TAllowed extends ElementType = ElementType> = {
238
238
  readonly tag?: TDefault;
239
239
  readonly name?: string;
240
240
  readonly defaults?: Partial<NoInfer<Props>>;
@@ -246,11 +246,13 @@ type FactoryOptions<TDefault extends ElementType = ElementType, Props extends An
246
246
  type DefaultOf<T extends PolymorphicGenerics> = T['default'];
247
247
  type PropsOf<T extends PolymorphicGenerics> = T['props'];
248
248
 
249
+ declare function defineContractComponent<O extends FactoryOptions>(options: O): <R>(factory: (options: O) => R) => R;
250
+
249
251
  type UnknownProps = Record<string, unknown>;
250
252
  type SolidElement = JSX.Element;
251
253
  type SlotRenderFn = (props: UnknownProps) => SolidElement;
252
254
 
253
- type SolidFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = FactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps> & {
255
+ type SolidFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = FactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps> & {
254
256
  /**
255
257
  * Return true for any prop key that should be consumed but not forwarded to the DOM.
256
258
  * Receives `runtime.options.variantKeys` as a convenience if needed.
@@ -263,7 +265,7 @@ type IntrinsicJSXProps<T extends ElementType> = T extends IntrinsicTag ? JSX.Int
263
265
  type ControlProps<G extends PolymorphicGenerics, TAs extends ElementType> = OmitIndexSignature<PropsOf<G>> & OmitIndexSignature<VariantProps<VariantsOf<G>>> & {
264
266
  as?: TAs;
265
267
  class?: ClassName | undefined;
266
- variantKey?: keyof PresetOf<G>;
268
+ recipe?: keyof RecipeOf<G>;
267
269
  ref?: (el: ElementRef<TAs>) => void;
268
270
  };
269
271
  type SharedProps<G extends PolymorphicGenerics, TAs extends ElementType> = Omit<IntrinsicJSXProps<TAs>, keyof ControlProps<G, TAs> | 'children' | 'ref'> & ControlProps<G, TAs>;
@@ -272,7 +274,7 @@ type AsChildProps<G extends PolymorphicGenerics> = Partial<OmitIndexSignature<Pr
272
274
  asChild: true;
273
275
  children: SlotRenderFn;
274
276
  class?: ClassName | undefined;
275
- variantKey?: keyof PresetOf<G>;
277
+ recipe?: keyof RecipeOf<G>;
276
278
  ref?: unknown;
277
279
  };
278
280
  type PolymorphicProps<G extends PolymorphicGenerics, TAs extends ElementType = DefaultOf<G>> = Simplify<(SharedProps<G, TAs> & {
@@ -284,8 +286,6 @@ type PolymorphicComponent<G extends PolymorphicGenerics> = {
284
286
  displayName?: string;
285
287
  };
286
288
 
287
- declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord>(options: SolidFactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & TPluginProps, Variants, TPreset>>;
288
-
289
- declare function defineContractComponent<O extends FactoryOptions>(options: O): <R>(factory: (options: O) => R) => R;
289
+ declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord>(options: SolidFactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps>): PolymorphicComponent<PolymorphicGenerics<TDefault, Props & TPluginProps, Variants, TPreset>>;
290
290
 
291
291
  export { type AnyFactoryOptions, type ElementRef, type ElementType, type EmptyRecord, type PolymorphicComponent, type PolymorphicGenerics, type PolymorphicProps, type SolidFactoryOptions, createContractComponent, defineContractComponent };
@@ -1,5 +1,5 @@
1
1
  // ../shared/src/guards/children/component-id.ts
2
- var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol("praxis.component-default-tag");
2
+ var COMPONENT_DEFAULT_TAG = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
3
3
 
4
4
  // ../../adapters/solid/src/apply-display-name.ts
5
5
  function applyDisplayName(component, name) {
@@ -17,7 +17,12 @@ function applyFilter(props, filterProps, variantKeys) {
17
17
  return out;
18
18
  }
19
19
 
20
- // ../core/dist/chunk-XFCAUPVZ.js
20
+ // ../../lib/adapter-utils/src/define-component.ts
21
+ function defineContractComponent(options) {
22
+ return (factory) => factory(options);
23
+ }
24
+
25
+ // ../core/dist/chunk-KKSHJDE7.js
21
26
  function makeResolveTag(defaultTag) {
22
27
  return function tag(as) {
23
28
  return as ?? defaultTag;
@@ -86,7 +91,7 @@ function resolveFactoryOptions(options = {}) {
86
91
  ...whenDefined("defaultProps", options.defaults),
87
92
  ...whenDefined("baseClassName", styling?.base),
88
93
  ...whenDefined("tagMap", styling?.tags),
89
- ...whenDefined("presetMap", styling?.presets),
94
+ ...whenDefined("recipeMap", styling?.presets),
90
95
  ...whenDefined("variants", styling?.variants),
91
96
  ...whenDefined("defaultVariants", styling?.defaults),
92
97
  ...whenDefined("compoundVariants", styling?.compounds),
@@ -127,10 +132,10 @@ function validateFactoryOptions(resolved) {
127
132
  }
128
133
  }
129
134
  };
130
- const { presetMap } = resolved;
131
- if (presetMap) {
132
- for (const presetKey in presetMap) {
133
- checkSelection(`preset "${presetKey}"`, presetMap[presetKey]);
135
+ const { recipeMap } = resolved;
136
+ if (recipeMap) {
137
+ for (const recipeKey in recipeMap) {
138
+ checkSelection(`preset "${recipeKey}"`, recipeMap[recipeKey]);
134
139
  }
135
140
  }
136
141
  if (resolved.defaultVariants) checkSelection("defaults", resolved.defaultVariants);
@@ -166,12 +171,12 @@ function report2(strict, message) {
166
171
  function label(name) {
167
172
  return name ? `[${name}]` : "[createContractComponent]";
168
173
  }
169
- function validateRenderProps(options, props, presetKey) {
170
- const { strict, presetMap, variants, displayName } = options;
174
+ function validateRenderProps(options, props, recipeKey) {
175
+ const { strict, recipeMap, variants, displayName } = options;
171
176
  if (!strict) return;
172
177
  const tag = label(displayName);
173
- if (presetKey !== void 0 && (!presetMap || !Object.hasOwn(presetMap, presetKey))) {
174
- report2(strict, `${tag} Unknown presetKey "${presetKey}" \u2014 no preset with that name exists.`);
178
+ if (recipeKey !== void 0 && (!recipeMap || !Object.hasOwn(recipeMap, recipeKey))) {
179
+ report2(strict, `${tag} Unknown recipeKey "${recipeKey}" \u2014 no preset with that name exists.`);
175
180
  }
176
181
  if (variants) {
177
182
  for (const key in variants) {
@@ -209,8 +214,8 @@ function assertPluginShape(result) {
209
214
  }
210
215
  function guardPipeline(pipeline) {
211
216
  if (process.env.NODE_ENV === "production") return pipeline;
212
- return function guardedPipeline(tag, props, className, variantKey) {
213
- const result = pipeline(tag, props, className, variantKey);
217
+ return function guardedPipeline(tag, props, className, recipe) {
218
+ const result = pipeline(tag, props, className, recipe);
214
219
  if (typeof result !== "string")
215
220
  panic(`[praxis-kit] Plugin pipeline must return a string. Got: ${describe(result)}.`);
216
221
  return result;
@@ -235,11 +240,11 @@ function createRuntimeMethods(resolved, classPipeline, engine) {
235
240
  resolveProps(props) {
236
241
  return mergeProps(resolved.defaultProps, props);
237
242
  },
238
- resolveClasses(tag, props, className, variantKey) {
243
+ resolveClasses(tag, props, className, recipe) {
239
244
  if (process.env.NODE_ENV !== "production") {
240
- validateRenderProps(resolved, props, variantKey);
245
+ validateRenderProps(resolved, props, recipe);
241
246
  }
242
- return classPipeline(tag, props, className, variantKey);
247
+ return classPipeline(tag, props, className, recipe);
243
248
  },
244
249
  resolveAria(tag, props) {
245
250
  if (!engine) return { props };
@@ -588,7 +593,7 @@ function isKnownAriaRole(value) {
588
593
  return isString(value) && KNOWN_ARIA_ROLES_SET.has(value);
589
594
  }
590
595
 
591
- // ../core/dist/chunk-VU44HAB7.js
596
+ // ../core/dist/chunk-2NJ5XLOA.js
592
597
  var IMPLICIT_ROLE_RECORD2 = {
593
598
  article: "article",
594
599
  aside: "complementary",
@@ -617,26 +622,37 @@ function getImplicitRole(tag) {
617
622
  if (tag in IMPLICIT_ROLE_RECORD2) return IMPLICIT_ROLE_RECORD2[tag];
618
623
  return void 0;
619
624
  }
620
- var COMPONENT_DEFAULT_TAG2 = /* @__PURE__ */ Symbol("praxis.component-default-tag");
621
- function resolveChildTag(child) {
625
+ var COMPONENT_DEFAULT_TAG2 = /* @__PURE__ */ Symbol.for("praxis.component-default-tag");
626
+ function getAsProp(child) {
627
+ if (!isObject(child) || !("props" in child)) return void 0;
628
+ const props = child.props;
629
+ if (!isObject(props)) return void 0;
630
+ const as = props.as;
631
+ return isString(as) && as !== "" ? as : void 0;
632
+ }
633
+ function getTag(child) {
622
634
  if (!isObject(child) || !("type" in child)) return void 0;
623
635
  const t = child.type;
624
636
  if (isString(t)) return t;
625
- if (isObject(t) && COMPONENT_DEFAULT_TAG2 in t) {
637
+ if (typeof t === "function" || isObject(t)) {
626
638
  const defaultTag = t[COMPONENT_DEFAULT_TAG2];
627
639
  if (!isString(defaultTag)) return void 0;
628
- const props = child.props;
629
- const as = isObject(props) && "as" in props ? props.as : void 0;
630
- return isString(as) ? as : defaultTag;
640
+ return getAsProp(child) ?? defaultTag;
631
641
  }
632
642
  return void 0;
633
643
  }
634
- function isTag(...tags) {
644
+ function isTag(...args) {
645
+ if (isString(args[0])) {
646
+ const set2 = new Set(args);
647
+ return (child2) => {
648
+ const tag2 = getTag(child2);
649
+ return tag2 !== void 0 && set2.has(tag2);
650
+ };
651
+ }
652
+ const [child, ...tags] = args;
635
653
  const set = new Set(tags);
636
- return (child) => {
637
- const tag = resolveChildTag(child);
638
- return tag !== void 0 && set.has(tag);
639
- };
654
+ const tag = getTag(child);
655
+ return tag !== void 0 && set.has(tag);
640
656
  }
641
657
  var pendingAsyncWarns2 = /* @__PURE__ */ new Set();
642
658
  var asyncWarnScheduled2 = false;
@@ -1523,7 +1539,7 @@ function getHtmlPropNormalizers(tag) {
1523
1539
  return typeof tag === "string" ? HTML_FORM_NORMALIZERS.get(tag) : void 0;
1524
1540
  }
1525
1541
 
1526
- // ../core/dist/chunk-EHCOMLJ4.js
1542
+ // ../core/dist/chunk-3T4EM5FG.js
1527
1543
  var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
1528
1544
  var cx = clsx;
1529
1545
  var cva = (base, config) => (props) => {
@@ -1600,18 +1616,18 @@ var StaticClassResolver = class {
1600
1616
  };
1601
1617
  var VariantClassResolver = class _VariantClassResolver {
1602
1618
  #cvaFn;
1603
- #presetMap;
1619
+ #recipeMap;
1604
1620
  #variantKeys;
1605
1621
  #precomputedClasses;
1606
1622
  #cache = /* @__PURE__ */ new Map();
1607
- constructor(cvaFn, presetMap, variantKeys, precomputedClasses) {
1623
+ constructor(cvaFn, recipeMap, variantKeys, precomputedClasses) {
1608
1624
  this.#cvaFn = cvaFn ?? null;
1609
- this.#presetMap = Object.freeze(presetMap ?? {});
1625
+ this.#recipeMap = Object.freeze(recipeMap ?? {});
1610
1626
  this.#variantKeys = variantKeys ?? null;
1611
1627
  this.#precomputedClasses = precomputedClasses ?? null;
1612
1628
  }
1613
- resolve({ props, variantKey }) {
1614
- const normalizedKey = variantKey ?? "__none__";
1629
+ resolve({ props, recipe }) {
1630
+ const normalizedKey = recipe ?? "__none__";
1615
1631
  const cacheKey = this.#createCacheKey(props, normalizedKey);
1616
1632
  if (this.#precomputedClasses !== null) {
1617
1633
  const precomputed = this.#precomputedClasses[cacheKey];
@@ -1623,7 +1639,7 @@ var VariantClassResolver = class _VariantClassResolver {
1623
1639
  this.#cache.set(cacheKey, cached);
1624
1640
  return cached;
1625
1641
  }
1626
- const result = this.#compute(props, variantKey);
1642
+ const result = this.#compute(props, recipe);
1627
1643
  this.#cache.set(cacheKey, result);
1628
1644
  if (this.#cache.size > 1e3) {
1629
1645
  const lru = this.#cache.keys().next().value;
@@ -1631,10 +1647,10 @@ var VariantClassResolver = class _VariantClassResolver {
1631
1647
  }
1632
1648
  return result;
1633
1649
  }
1634
- #compute(props, variantKey) {
1650
+ #compute(props, recipe) {
1635
1651
  if (!this.#cvaFn) return "";
1636
- if (!variantKey) return this.#cvaFn(props);
1637
- const preset = this.#presetMap[variantKey];
1652
+ if (!recipe) return this.#cvaFn(props);
1653
+ const preset = this.#recipeMap[recipe];
1638
1654
  if (!preset) return this.#cvaFn(props);
1639
1655
  return this.#cvaFn({ ...preset, ...props });
1640
1656
  }
@@ -1642,15 +1658,15 @@ var VariantClassResolver = class _VariantClassResolver {
1642
1658
  // props (className, id, etc.) produce identical CVA output and must not fragment the cache.
1643
1659
  // Iterating #variantKeys directly (fixed Set insertion order) avoids Object.keys + filter + sort.
1644
1660
  // String is built incrementally to avoid a parts[] array allocation on every render.
1645
- #createCacheKey(props, variantKey) {
1661
+ #createCacheKey(props, recipe) {
1646
1662
  if (this.#variantKeys !== null) {
1647
- let key2 = variantKey;
1663
+ let key2 = recipe;
1648
1664
  for (const k of this.#variantKeys) {
1649
1665
  if (k in props) key2 += `|${k}:${_VariantClassResolver.#serializeValue(props[k])}`;
1650
1666
  }
1651
1667
  return key2;
1652
1668
  }
1653
- let key = variantKey;
1669
+ let key = recipe;
1654
1670
  for (const k of Object.keys(props).sort()) {
1655
1671
  key += `|${k}:${_VariantClassResolver.#serializeValue(props[k])}`;
1656
1672
  }
@@ -1675,13 +1691,13 @@ function createClassPipeline(resolved) {
1675
1691
  const staticResolver = new StaticClassResolver(baseClass, resolved.tagMap);
1676
1692
  const variantResolver = new VariantClassResolver(
1677
1693
  cvaFn,
1678
- resolved.presetMap,
1694
+ resolved.recipeMap,
1679
1695
  variantKeys,
1680
1696
  resolved.precomputedClasses
1681
1697
  );
1682
- return function resolveClasses(tag, props, className, variantKey) {
1683
- const staticClasses = staticResolver.resolve(tag, variantKey !== void 0);
1684
- const variantClasses = variantResolver.resolve({ props, variantKey });
1698
+ return function resolveClasses(tag, props, className, recipe) {
1699
+ const staticClasses = staticResolver.resolve(tag, recipe !== void 0);
1700
+ const variantClasses = variantResolver.resolve({ props, recipe });
1685
1701
  if (!className)
1686
1702
  return staticClasses && variantClasses ? `${staticClasses} ${variantClasses}` : staticClasses || variantClasses;
1687
1703
  return cn(staticClasses, variantClasses, className);
@@ -1778,7 +1794,7 @@ function buildRuntime(options) {
1778
1794
  import { createEffect, createMemo, splitProps } from "solid-js";
1779
1795
  import { Dynamic } from "solid-js/web";
1780
1796
  import { jsx } from "solid-js/jsx-runtime";
1781
- var SPLIT_KEYS = ["as", "asChild", "children", "class", "variantKey", "ref"];
1797
+ var SPLIT_KEYS = ["as", "asChild", "children", "class", "recipe", "ref"];
1782
1798
  function toChildArray(children) {
1783
1799
  if (children === void 0 || children === null) return [];
1784
1800
  if (Array.isArray(children)) return children;
@@ -1842,7 +1858,7 @@ function render({
1842
1858
  tag(),
1843
1859
  normalizedProps(),
1844
1860
  known.class,
1845
- known.variantKey
1861
+ known.recipe
1846
1862
  )
1847
1863
  );
1848
1864
  const filteredProps = createMemo(
@@ -1875,11 +1891,6 @@ function createContractComponent(options) {
1875
1891
  }
1876
1892
  return Component;
1877
1893
  }
1878
-
1879
- // ../../adapters/solid/src/define-contract-component.ts
1880
- function defineContractComponent(options) {
1881
- return (factory) => factory(options);
1882
- }
1883
1894
  export {
1884
1895
  createContractComponent,
1885
1896
  defineContractComponent
@@ -117,9 +117,9 @@ type VariantSelection<V extends VariantMap> = {
117
117
  * Presets are named bundles of variant props that callers activate by key,
118
118
  * avoiding the need to repeat variant combinations at each call site.
119
119
  */
120
- type PresetMap<V extends VariantMap = VariantMap> = Readonly<Record<string, VariantSelection<V>>>;
120
+ type RecipeMap<V extends VariantMap = VariantMap> = Readonly<Record<string, VariantSelection<V>>>;
121
121
 
122
- interface PolymorphicGenerics<TDefault extends ElementType = ElementType, Props extends AnyRecord = AnyRecord, Variants extends Readonly<VariantMap> = Readonly<VariantMap>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>, TAllowed extends ElementType = ElementType> {
122
+ interface PolymorphicGenerics<TDefault extends ElementType = ElementType, Props extends AnyRecord = AnyRecord, Variants extends Readonly<VariantMap> = Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TAllowed extends ElementType = ElementType> {
123
123
  default: TDefault;
124
124
  props: Props;
125
125
  variants: Variants;
@@ -127,23 +127,23 @@ interface PolymorphicGenerics<TDefault extends ElementType = ElementType, Props
127
127
  allowed: TAllowed;
128
128
  }
129
129
 
130
- type PresetTarget<TVariants extends VariantMap = VariantMap> = VariantSelection<TVariants>;
130
+ type RecipeTarget<TVariants extends VariantMap = VariantMap> = VariantSelection<TVariants>;
131
131
 
132
132
  interface BaseClassOptions {
133
133
  baseClassName?: ClassName;
134
134
  }
135
135
 
136
- type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, variantKey?: string) => string;
136
+ type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, recipe?: string) => string;
137
137
 
138
- interface PresetOptions<TVariants extends VariantMap = VariantMap> {
139
- presetMap?: Record<string, PresetTarget<TVariants>>;
138
+ interface RecipeOptions<TVariants extends VariantMap = VariantMap> {
139
+ recipeMap?: Record<string, RecipeTarget<TVariants>>;
140
140
  }
141
141
 
142
142
  interface TagMapOptions {
143
143
  tagMap?: TagMap;
144
144
  }
145
145
 
146
- type CompositionOptions<TVariants extends VariantMap = VariantMap> = Simplify<TagMapOptions & PresetOptions<TVariants>>;
146
+ type CompositionOptions<TVariants extends VariantMap = VariantMap> = Simplify<TagMapOptions & RecipeOptions<TVariants>>;
147
147
 
148
148
  type CVASystemOptions<TVariants extends VariantMap = VariantMap> = Simplify<CVAVariants<TVariants> & CVADefaults<TVariants> & CVACompounds<TVariants>>;
149
149
 
@@ -218,7 +218,7 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
218
218
  readonly allowedAs?: readonly TAllowed[];
219
219
  };
220
220
 
221
- type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<V> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = {
221
+ type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = {
222
222
  readonly base?: ClassName;
223
223
  readonly variants?: V;
224
224
  readonly defaults?: Partial<DefaultVariants<V>>;
@@ -232,8 +232,8 @@ type StylingOptions<V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPre
232
232
  type NormalizeFn<Props extends AnyRecord = AnyRecord> = {
233
233
  normalize(props: Readonly<Props & IntrinsicProps>): Props & IntrinsicProps;
234
234
  }['normalize'];
235
- type AnyFactoryOptions = FactoryOptions<ElementType, AnyRecord, VariantMap, PresetMap<VariantMap>, AnyRecord>;
236
- type FactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<V> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord, TAllowed extends ElementType = ElementType> = {
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>, TPluginProps extends AnyRecord = EmptyRecord, TAllowed extends ElementType = ElementType> = {
237
237
  readonly tag?: TDefault;
238
238
  readonly name?: string;
239
239
  readonly defaults?: Partial<NoInfer<Props>>;
@@ -242,12 +242,12 @@ type FactoryOptions<TDefault extends ElementType = ElementType, Props extends An
242
242
  readonly enforcement?: EnforcementOptions<TAllowed>;
243
243
  };
244
244
 
245
- type ResolvedFactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<V> = Readonly<EmptyRecord>> = {
245
+ type ResolvedFactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>> = {
246
246
  readonly defaultTag: TDefault;
247
247
  readonly baseClassName?: ClassName;
248
248
  readonly defaultProps?: Partial<Props>;
249
249
  readonly tagMap?: Readonly<TagMap>;
250
- readonly presetMap?: TPreset;
250
+ readonly recipeMap?: TPreset;
251
251
  readonly variants?: V;
252
252
  readonly defaultVariants?: Partial<DefaultVariants<V>>;
253
253
  readonly compoundVariants?: readonly CompoundVariant<V>[];
@@ -266,7 +266,7 @@ type ResolveAriaFn = <P extends IntrinsicProps>(tag: ElementType, props: P) => {
266
266
  props: P;
267
267
  };
268
268
 
269
- type ResolveClassNameFn<Props extends AnyRecord, TSlot extends string = never> = (tag: ElementType, props: Props, className?: ClassName, variantKey?: TSlot) => string;
269
+ type ResolveClassNameFn<Props extends AnyRecord, TSlot extends string = never> = (tag: ElementType, props: Props, className?: ClassName, recipe?: TSlot) => string;
270
270
 
271
271
  type ResolvePropsFn<Props extends AnyRecord> = <P extends Partial<Props>>(props: P) => Simplify<Omit<Props, keyof P> & P>;
272
272
 
@@ -277,7 +277,7 @@ type RuntimePluginField<TPlugin extends ClassPlugin | undefined> = TPlugin exten
277
277
  readonly hasStyling: true;
278
278
  } : EmptyRecord;
279
279
 
280
- type PolymorphicRuntime<TDefault extends ElementType, Props extends AnyRecord, Variants extends VariantMap, TSlot extends string = never, TPreset extends PresetMap<Variants> = Readonly<Record<string, VariantSelection<Variants>>>, TPlugin extends ClassPlugin | undefined = ClassPlugin | undefined> = RuntimePluginField<TPlugin> & {
280
+ type PolymorphicRuntime<TDefault extends ElementType, Props extends AnyRecord, Variants extends VariantMap, TSlot extends string = never, TPreset extends RecipeMap<Variants> = Readonly<Record<string, VariantSelection<Variants>>>, TPlugin extends ClassPlugin | undefined = ClassPlugin | undefined> = RuntimePluginField<TPlugin> & {
281
281
  readonly options: Readonly<ResolvedFactoryOptions<TDefault, Props, Variants, TPreset>>;
282
282
  readonly resolveTag: ResolveTagFn<TDefault>;
283
283
  readonly resolveProps: ResolvePropsFn<Props>;
@@ -299,7 +299,7 @@ declare class ChildrenEvaluator extends StrictBase {
299
299
  evaluate(children: unknown[]): void;
300
300
  }
301
301
 
302
- declare function createPolymorphic<TDefault extends ElementType, Props extends AnyRecord, Variants extends Readonly<VariantMap>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>>(options?: FactoryOptions<TDefault, Props, Variants, TPreset>): PolymorphicRuntime<TDefault, Props, Variants, Extract<keyof TPreset, string>, TPreset>;
302
+ declare function createPolymorphic<TDefault extends ElementType, Props extends AnyRecord, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>>(options?: FactoryOptions<TDefault, Props, Variants, TPreset>): PolymorphicRuntime<TDefault, Props, Variants, Extract<keyof TPreset, string>, TPreset>;
303
303
 
304
304
  declare class SlotValidator extends StrictBase {
305
305
  #private;
@@ -319,9 +319,11 @@ type BuiltChildrenEvaluator<TOptions extends WithChildRules> = TOptions extends
319
319
  childrenEvaluator: ChildrenEvaluator;
320
320
  } : EmptyRecord;
321
321
 
322
+ declare function defineContractComponent<O extends FactoryOptions>(options: O): <R>(factory: (options: O) => R) => R;
323
+
322
324
  type UnknownProps = Record<string, unknown>;
323
325
 
324
- type SvelteFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = FactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps> & {
326
+ type SvelteFactoryOptions<TDefault extends ElementType, Props extends UnknownProps, Variants extends Readonly<VariantMap>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord> = FactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps> & {
325
327
  /**
326
328
  * Return true for any prop key that should be consumed but not forwarded to the DOM.
327
329
  * Receives `runtime.options.variantKeys` as a convenience if needed.
@@ -329,7 +331,7 @@ type SvelteFactoryOptions<TDefault extends ElementType, Props extends UnknownPro
329
331
  filterProps?: (key: string, variantKeys: ReadonlySet<string>) => boolean;
330
332
  };
331
333
 
332
- type TypedRuntime<G extends PolymorphicGenerics> = ReturnType<typeof createPolymorphic<DefaultOf<G>, PropsOf<G>, VariantsOf<G>, PresetOf<G>>>;
334
+ type TypedRuntime<G extends PolymorphicGenerics> = ReturnType<typeof createPolymorphic<DefaultOf<G>, PropsOf<G>, VariantsOf<G>, RecipeOf<G>>>;
333
335
 
334
336
  type BuiltRuntime<G extends PolymorphicGenerics = PolymorphicGenerics, TOptions extends WithChildRules = WithChildRules> = BuiltChildrenEvaluator<TOptions> & {
335
337
  runtime: TypedRuntime<G>;
@@ -337,8 +339,6 @@ type BuiltRuntime<G extends PolymorphicGenerics = PolymorphicGenerics, TOptions
337
339
  slotValidator: SlotValidator;
338
340
  };
339
341
 
340
- declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends PresetMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord, TOptions extends WithChildRules = SvelteFactoryOptions<TDefault, Props & TPluginProps, Variants, TPreset>>(options: SvelteFactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps> & TOptions): BuiltRuntime<PolymorphicGenerics<TDefault, Props & TPluginProps, Variants, TPreset>, TOptions>;
341
-
342
- declare function defineContractComponent<O extends FactoryOptions>(options: O): <R>(factory: (options: O) => R) => R;
342
+ declare function createContractComponent<TDefault extends ElementType, Props extends UnknownProps = EmptyRecord, Variants extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<Variants> = Readonly<EmptyRecord>, TPluginProps extends AnyRecord = EmptyRecord, TOptions extends WithChildRules = SvelteFactoryOptions<TDefault, Props & TPluginProps, Variants, TPreset>>(options: SvelteFactoryOptions<TDefault, Props, Variants, TPreset, TPluginProps> & TOptions): BuiltRuntime<PolymorphicGenerics<TDefault, Props & TPluginProps, Variants, TPreset>, TOptions>;
343
343
 
344
344
  export { type AnyFactoryOptions, type BuiltRuntime, type ElementType, type EmptyRecord, type FilterPredicate, type PolymorphicGenerics, type SvelteFactoryOptions, type UnknownProps, type WithChildRules, createContractComponent, defineContractComponent };