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.
- package/dist/_shared/diagnostics.d.ts +4 -0
- package/dist/_shared/diagnostics.js +4 -0
- package/dist/{chunk-H3D2JA3J.js → chunk-OCG5VM4H.js} +519 -326
- package/dist/contract/index.d.ts +11 -0
- package/dist/contract/index.js +2 -0
- package/dist/guards/index.d.ts +11 -2
- package/dist/html/index.d.ts +98 -0
- package/dist/html/index.js +860 -0
- package/dist/lit/index.d.ts +11 -0
- package/dist/lit/index.js +519 -326
- package/dist/preact/index.d.ts +20 -0
- package/dist/preact/index.js +519 -326
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +1 -1
- package/dist/react/legacy.d.ts +2 -2
- package/dist/react/legacy.js +1 -1
- package/dist/{react-options-DQTX4YS_.d.ts → react-options-BUBVohU6.d.ts} +50 -33
- package/dist/solid/index.d.ts +20 -0
- package/dist/solid/index.js +519 -326
- package/dist/svelte/index.d.ts +11 -0
- package/dist/svelte/index.js +519 -326
- package/dist/vite-plugin/index.d.ts +4 -0
- package/dist/vue/index.d.ts +11 -0
- package/dist/vue/index.js +519 -326
- package/dist/web/index.d.ts +11 -0
- package/dist/web/index.js +519 -326
- package/package.json +12 -5
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as UnknownProps, E as ElementType, a as EmptyRecord, V as VariantMap, R as RecipeMap, A as AnyClassPluginFactory, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics, d as ExtractPluginProps } from '../react-options-
|
|
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, m as composeRefs, l as defineContractComponent, m as mergeRefs } from '../react-options-
|
|
1
|
+
import { U as UnknownProps, E as ElementType, a as EmptyRecord, V as VariantMap, R as RecipeMap, A as AnyClassPluginFactory, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics, d as ExtractPluginProps } from '../react-options-BUBVohU6.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, m as composeRefs, l as defineContractComponent, m as mergeRefs } from '../react-options-BUBVohU6.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactElement, Ref } from 'react';
|
|
5
5
|
import 'type-fest';
|
package/dist/react/index.js
CHANGED
package/dist/react/legacy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ElementType, U as UnknownProps, a as EmptyRecord, V as VariantMap, R as RecipeMap, A as AnyClassPluginFactory, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics, d as ExtractPluginProps } from '../react-options-
|
|
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 '../react-options-
|
|
1
|
+
import { E as ElementType, U as UnknownProps, a as EmptyRecord, V as VariantMap, R as RecipeMap, A as AnyClassPluginFactory, b as ReactFactoryOptions, P as PolymorphicComponent, c as PolymorphicGenerics, d as ExtractPluginProps } from '../react-options-BUBVohU6.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 '../react-options-BUBVohU6.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
import '../_shared/diagnostics.js';
|
package/dist/react/legacy.js
CHANGED
|
@@ -237,6 +237,7 @@ type AriaResult = ValidResult | AriaInvalidResult;
|
|
|
237
237
|
|
|
238
238
|
type AriaRule<C extends AriaContext = AriaContext> = ((context: C) => readonly AriaResult[]) & {
|
|
239
239
|
readonly readsProps?: readonly string[];
|
|
240
|
+
readonly tags?: readonly string[];
|
|
240
241
|
};
|
|
241
242
|
|
|
242
243
|
type PropNormalizer = (props: Readonly<AnyRecord & IntrinsicProps>) => Partial<AnyRecord & IntrinsicProps>;
|
|
@@ -249,6 +250,16 @@ type EnforcementOptions<TAllowed extends ElementType = ElementType> = {
|
|
|
249
250
|
*/
|
|
250
251
|
readonly diagnostics?: Diagnostics | DiagnosticsMode;
|
|
251
252
|
readonly aria?: readonly AriaRule[];
|
|
253
|
+
/**
|
|
254
|
+
* Rules that need `AriaPolicyEngine`'s fix-application/caching machinery
|
|
255
|
+
* (`AriaRule`'s `readsProps`, fixable `AriaFix` results) but have no
|
|
256
|
+
* relationship to ARIA semantics — an HTML fact or a security check like a
|
|
257
|
+
* dangerous-URL-scheme guard, for example. Evaluated together with `aria`
|
|
258
|
+
* (both run through the same engine, merged into one rule set) — this is a
|
|
259
|
+
* separate bucket purely so a non-ARIA rule doesn't have to sit under the
|
|
260
|
+
* misleading `aria` name to get the machinery it needs.
|
|
261
|
+
*/
|
|
262
|
+
readonly rules?: readonly AriaRule[];
|
|
252
263
|
readonly children?: readonly ChildRuleInput[];
|
|
253
264
|
/**
|
|
254
265
|
* When true, only children matching a `children` rule (or text, per `allowText`)
|
|
@@ -338,25 +349,27 @@ type SlotComponent = ComponentType<UnknownProps>;
|
|
|
338
349
|
type RenderCallbackProps = Readonly<AnyRecord>;
|
|
339
350
|
|
|
340
351
|
/**
|
|
341
|
-
*
|
|
352
|
+
* Resolves the instance type exposed through `ref` for a polymorphic
|
|
353
|
+
* element.
|
|
342
354
|
*
|
|
343
|
-
* Intrinsic HTML elements
|
|
344
|
-
* custom React components currently
|
|
355
|
+
* Intrinsic HTML elements map to their corresponding DOM element type;
|
|
356
|
+
* custom React components currently resolve to `unknown`.
|
|
345
357
|
*/
|
|
346
358
|
type ElementRef<T extends ElementType> = T extends IntrinsicTag ? HTMLElementTagNameMap[T] : unknown;
|
|
347
359
|
/**
|
|
348
|
-
* React's intrinsic JSX props for
|
|
360
|
+
* React's intrinsic JSX props for an element type.
|
|
349
361
|
*
|
|
350
|
-
* Custom components intentionally
|
|
351
|
-
*
|
|
362
|
+
* Custom components intentionally resolve to `UnknownProps`; their own
|
|
363
|
+
* prop definitions determine the accepted props.
|
|
352
364
|
*/
|
|
353
365
|
type IntrinsicJSXProps<T extends ElementType> = T extends IntrinsicTag ? JSX.IntrinsicElements[T] : UnknownProps;
|
|
354
366
|
/**
|
|
355
|
-
* Removes index signatures while preserving explicitly
|
|
367
|
+
* Removes index signatures while preserving explicitly declared
|
|
368
|
+
* properties.
|
|
356
369
|
*
|
|
357
|
-
*
|
|
358
|
-
* from
|
|
359
|
-
*
|
|
370
|
+
* Prevents broad index signatures (for example `Record<string, unknown>`)
|
|
371
|
+
* from causing `keyof T` to become `string`, which would otherwise erase
|
|
372
|
+
* every intrinsic prop during `Omit`.
|
|
360
373
|
*/
|
|
361
374
|
type StripIndexSignature<T> = {
|
|
362
375
|
[K in keyof T as string extends K ? never : K]: T[K];
|
|
@@ -366,18 +379,16 @@ type ComponentProps<G extends PolymorphicGenerics> = StripIndexSignature<PropsOf
|
|
|
366
379
|
/** Variant props generated from the component's variant definitions. */
|
|
367
380
|
type ComponentVariants<G extends PolymorphicGenerics> = StripIndexSignature<VariantProps<VariantsOf<G>>>;
|
|
368
381
|
/**
|
|
369
|
-
* Props
|
|
382
|
+
* Props defined by the component itself.
|
|
370
383
|
*
|
|
371
|
-
* These
|
|
384
|
+
* These override intrinsic JSX props with the same name.
|
|
372
385
|
*/
|
|
373
386
|
type OwnedProps<G extends PolymorphicGenerics> = ComponentProps<G> & ComponentVariants<G>;
|
|
374
387
|
/**
|
|
375
|
-
*
|
|
388
|
+
* Props that control how the component renders.
|
|
376
389
|
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
* `children` and `asChild` are intentionally omitted so each render mode
|
|
380
|
-
* can provide its own stricter contract.
|
|
390
|
+
* `children` and `asChild` are intentionally omitted so each render
|
|
391
|
+
* strategy can define its own contract.
|
|
381
392
|
*/
|
|
382
393
|
type PolymorphicControlProps<G extends PolymorphicGenerics, TAs extends ElementType> = {
|
|
383
394
|
/**
|
|
@@ -397,22 +408,21 @@ type PolymorphicControlProps<G extends PolymorphicGenerics, TAs extends ElementT
|
|
|
397
408
|
ref?: Ref<ElementRef<TAs>>;
|
|
398
409
|
};
|
|
399
410
|
/**
|
|
400
|
-
*
|
|
411
|
+
* All props reserved by the polymorphic component.
|
|
401
412
|
*
|
|
402
|
-
* Used primarily
|
|
413
|
+
* Used primarily to exclude conflicting intrinsic JSX props.
|
|
403
414
|
*/
|
|
404
415
|
type ControlProps<G extends PolymorphicGenerics, TAs extends ElementType> = OwnedProps<G> & PolymorphicControlProps<G, TAs>;
|
|
405
416
|
/**
|
|
406
|
-
* Intrinsic JSX props after removing every
|
|
417
|
+
* Intrinsic JSX props after removing every reserved component prop.
|
|
407
418
|
*
|
|
408
|
-
* Component props always
|
|
419
|
+
* Component-defined props always take precedence.
|
|
409
420
|
*/
|
|
410
421
|
type IntrinsicPropsWithoutOwned<G extends PolymorphicGenerics, TAs extends ElementType> = Omit<IntrinsicJSXProps<TAs>, keyof ControlProps<G, TAs> | 'children'>;
|
|
411
422
|
/**
|
|
412
|
-
*
|
|
423
|
+
* Props shared by every rendering strategy.
|
|
413
424
|
*
|
|
414
|
-
*
|
|
415
|
-
* `children`, etc.).
|
|
425
|
+
* Each render mode contributes only its discriminating props.
|
|
416
426
|
*/
|
|
417
427
|
type BaseProps<G extends PolymorphicGenerics, TAs extends ElementType> = IntrinsicPropsWithoutOwned<G, TAs> & ControlProps<G, TAs>;
|
|
418
428
|
/** Standard rendering (`asChild` absent or false). */
|
|
@@ -432,12 +442,9 @@ type SlotRenderMode = {
|
|
|
432
442
|
children: ReactElement | NonEmptyTuple<ReactElement>;
|
|
433
443
|
};
|
|
434
444
|
/**
|
|
435
|
-
* Render callback.
|
|
436
|
-
*
|
|
437
|
-
* The callback receives fully resolved props (classes, refs, filtered props)
|
|
438
|
-
* and is responsible for rendering the target element.
|
|
445
|
+
* Render callback mode.
|
|
439
446
|
*
|
|
440
|
-
*
|
|
447
|
+
* Receives the fully resolved props and returns the rendered element.
|
|
441
448
|
*/
|
|
442
449
|
type CallbackRenderMode = {
|
|
443
450
|
render: (props: RenderCallbackProps) => ReactElement;
|
|
@@ -463,16 +470,26 @@ type PolymorphicWithRender<G extends PolymorphicGenerics, TAs extends ElementTyp
|
|
|
463
470
|
/**
|
|
464
471
|
* A polymorphic React component.
|
|
465
472
|
*
|
|
466
|
-
* Overloads
|
|
473
|
+
* Overloads provide three rendering strategies:
|
|
467
474
|
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
475
|
+
* - `render` — render callback
|
|
476
|
+
* - `asChild` — slot rendering
|
|
477
|
+
* - default — standard polymorphic rendering
|
|
471
478
|
*/
|
|
472
479
|
type PolymorphicComponent<G extends PolymorphicGenerics> = {
|
|
473
480
|
<TAs extends ElementType = DefaultOf<G>>(props: PolymorphicWithRender<G, TAs>): ReactElement;
|
|
474
481
|
<TAs extends ElementType = DefaultOf<G>>(props: PolymorphicWithAsChild<G, TAs>): ReactElement;
|
|
475
482
|
<TAs extends ElementType = DefaultOf<G>>(props: PolymorphicProps<G, TAs>): ReactElement;
|
|
483
|
+
/**
|
|
484
|
+
* Non-generic fallback overload used for type extraction.
|
|
485
|
+
*
|
|
486
|
+
* TypeScript resolves conditional types such as
|
|
487
|
+
* `React.ComponentProps<typeof Component>` against only the final
|
|
488
|
+
* overload. Anchoring that overload to the default element preserves
|
|
489
|
+
* correct prop inference for tools such as Storybook and
|
|
490
|
+
* `React.ComponentProps`.
|
|
491
|
+
*/
|
|
492
|
+
(props: PolymorphicProps<G, DefaultOf<G>>): ReactElement;
|
|
476
493
|
displayName?: string;
|
|
477
494
|
};
|
|
478
495
|
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -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`)
|
|
@@ -331,6 +342,15 @@ type PolymorphicProps<G extends PolymorphicGenerics, TAs extends ElementType = D
|
|
|
331
342
|
}) | AsChildProps<G>>;
|
|
332
343
|
type PolymorphicComponent<G extends PolymorphicGenerics> = {
|
|
333
344
|
<TAs extends ElementType = DefaultOf<G>>(props: PolymorphicProps<G, TAs>): JSX.Element;
|
|
345
|
+
/**
|
|
346
|
+
* Non-generic fallback overload used for type extraction.
|
|
347
|
+
*
|
|
348
|
+
* TypeScript resolves conditional types such as
|
|
349
|
+
* `ComponentProps<typeof Component>` against only the final overload.
|
|
350
|
+
* Anchoring that overload to the default element preserves correct prop
|
|
351
|
+
* inference for tools such as Storybook and `ComponentProps`.
|
|
352
|
+
*/
|
|
353
|
+
(props: PolymorphicProps<G, DefaultOf<G>>): JSX.Element;
|
|
334
354
|
displayName?: string;
|
|
335
355
|
};
|
|
336
356
|
|