praxis-kit 6.2.3 → 6.6.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.
@@ -236,6 +236,7 @@ type AriaResult = ValidResult | AriaInvalidResult;
236
236
 
237
237
  type AriaRule<C extends AriaContext = AriaContext> = ((context: C) => readonly AriaResult[]) & {
238
238
  readonly readsProps?: readonly string[];
239
+ readonly tags?: readonly string[];
239
240
  };
240
241
 
241
242
  type PropNormalizer = (props: Readonly<AnyRecord & IntrinsicProps>) => Partial<AnyRecord & IntrinsicProps>;
@@ -248,6 +249,16 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
248
249
  */
249
250
  readonly diagnostics?: Diagnostics | DiagnosticsMode;
250
251
  readonly aria?: readonly AriaRule[];
252
+ /**
253
+ * Rules that need `AriaPolicyEngine`'s fix-application/caching machinery
254
+ * (`AriaRule`'s `readsProps`, fixable `AriaFix` results) but have no
255
+ * relationship to ARIA semantics — an HTML fact or a security check like a
256
+ * dangerous-URL-scheme guard, for example. Evaluated together with `aria`
257
+ * (both run through the same engine, merged into one rule set) — this is a
258
+ * separate bucket purely so a non-ARIA rule doesn't have to sit under the
259
+ * misleading `aria` name to get the machinery it needs.
260
+ */
261
+ readonly rules?: readonly AriaRule[];
251
262
  readonly children?: readonly ChildRuleInput[];
252
263
  /**
253
264
  * When true, only children matching a `children` rule (or text, per `allowText`)
@@ -336,6 +347,15 @@ type PolymorphicWithAsChild<G extends PolymorphicGenerics, TAs extends ElementTy
336
347
  type PolymorphicComponent<G extends PolymorphicGenerics> = {
337
348
  <TAs extends ElementType = DefaultOf<G>>(props: PolymorphicWithAsChild<G, TAs>): AnyVNode;
338
349
  <TAs extends ElementType = DefaultOf<G>>(props: PolymorphicProps<G, TAs>): AnyVNode;
350
+ /**
351
+ * Non-generic fallback overload used for type extraction.
352
+ *
353
+ * TypeScript resolves conditional types such as
354
+ * `ComponentProps<typeof Component>` against only the final overload.
355
+ * Anchoring that overload to the default element preserves correct prop
356
+ * inference for tools such as Storybook and `ComponentProps`.
357
+ */
358
+ (props: PolymorphicProps<G, DefaultOf<G>>): AnyVNode;
339
359
  displayName?: string;
340
360
  };
341
361