praxis-kit 6.1.0 → 6.2.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.
@@ -50,7 +50,7 @@
50
50
 
51
51
  function buildDomProps(
52
52
  props: UnknownProps,
53
- classStr: string,
53
+ classStr: string | undefined,
54
54
  tag: ElementType,
55
55
  ): ResolvedAttributes {
56
56
  const { role, style, ...r } = normalizeEventKeys(props)
@@ -67,7 +67,7 @@
67
67
  return bundle.runtime.resolveAria(tag, ep).props as ResolvedAttributes
68
68
  }
69
69
 
70
- function buildSlotProps(props: UnknownProps, classStr: string): UnknownProps {
70
+ function buildSlotProps(props: UnknownProps, classStr: string | undefined): UnknownProps {
71
71
  const { role, ...r } = props
72
72
  return {
73
73
  ...r,
@@ -159,7 +159,7 @@ interface BaseClassOptions {
159
159
  baseClassName?: ClassName;
160
160
  }
161
161
 
162
- type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, recipe?: string) => string;
162
+ type ClassPipelineFn = (tag: unknown, props: AnyRecord, className?: ClassName, recipe?: string) => string | undefined;
163
163
 
164
164
  interface RecipeOptions<TVariants extends VariantMap = VariantMap> {
165
165
  recipeMap?: Record<string, RecipeTarget<TVariants>>;
@@ -238,7 +238,9 @@ type AriaInvalidWithoutFix<M extends string = string> = AriaInvalidBase<M> & {
238
238
  type AriaInvalidResult<M extends string = string> = AriaInvalidWithFix<M> | AriaInvalidWithoutFix<M>;
239
239
  type AriaResult = ValidResult | AriaInvalidResult;
240
240
 
241
- type AriaRule<C extends AriaContext = AriaContext> = (context: C) => readonly AriaResult[];
241
+ type AriaRule<C extends AriaContext = AriaContext> = ((context: C) => readonly AriaResult[]) & {
242
+ readonly readsProps?: readonly string[];
243
+ };
242
244
 
243
245
  type PropNormalizer = (props: Readonly<AnyRecord & IntrinsicProps>) => Partial<AnyRecord & IntrinsicProps>;
244
246
 
@@ -289,6 +291,11 @@ type FactoryOptions<TDefault extends ElementType = ElementType, Props extends An
289
291
  readonly normalize?: NormalizeFn<NoInfer<Props>>;
290
292
  readonly styling?: StylingOptions<V, TPreset, TPlugin>;
291
293
  readonly enforcement?: EnforcementOptions<TAllowed>;
294
+ /**
295
+ * Adapter-resolved diagnostics default, spread in by `resolveAdapterCommonOptions`. Not meant to
296
+ * be set directly by component authors — use `enforcement.diagnostics` to override per component.
297
+ */
298
+ readonly diagnostics?: Diagnostics;
292
299
  };
293
300
 
294
301
  type ResolvedFactoryOptions<TDefault extends ElementType = ElementType, Props extends AnyRecord = EmptyRecord, V extends Readonly<VariantMap> = Readonly<EmptyRecord>, TPreset extends RecipeMap<V> = Readonly<EmptyRecord>> = {
@@ -318,7 +325,7 @@ type ResolveAriaFn = <P extends IntrinsicProps>(tag: ElementType, props: P) => {
318
325
  props: P;
319
326
  };
320
327
 
321
- type ResolveClassNameFn<Props extends AnyRecord, TSlot extends string = never> = (tag: ElementType, props: Props, className?: ClassName, recipe?: TSlot) => string;
328
+ type ResolveClassNameFn<Props extends AnyRecord, TSlot extends string = never> = (tag: ElementType, props: Props, className?: ClassName, recipe?: TSlot) => string | undefined;
322
329
 
323
330
  type ResolvePropsFn<Props extends AnyRecord> = <P extends Partial<Props>>(props: P) => Simplify<Omit<Props, keyof P> & P>;
324
331