npm package diff
Package: @radix-ui/react-primitive
Versions: 1.0.3 - 2.0.0
File: package/dist/index.d.mts
Index: package/dist/index.d.mts
===================================================================
--- package/dist/index.d.mts
+++ package/dist/index.d.mts
@@ -1,17 +1,16 @@
-import * as React from "react";
+import * as React from 'react';
+
declare const NODES: readonly ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "li", "nav", "ol", "p", "span", "svg", "ul"];
-type PropsWithoutRef<P> = P extends any ? ('ref' extends keyof P ? Pick<P, Exclude<keyof P, 'ref'>> : P) : P;
-export type ComponentPropsWithoutRef<T extends React.ElementType> = PropsWithoutRef<React.ComponentProps<T>>;
type Primitives = {
- [E in typeof NODES[number]]: PrimitiveForwardRefComponent<E>;
+ [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E>;
};
-export type PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {
+type PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {
asChild?: boolean;
};
interface PrimitiveForwardRefComponent<E extends React.ElementType> extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {
}
-export const Primitive: Primitives;
+declare const Primitive: Primitives;
/**
* Flush custom event dispatch
* https://github.com/radix-ui/primitives/pull/1378
*
@@ -46,8 +45,8 @@
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
*/
-export function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E): void;
-export const Root: Primitives;
+declare function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E): void;
+declare const Root: Primitives;
-//# sourceMappingURL=index.d.ts.map
+export { Primitive, type PrimitivePropsWithRef, Root, dispatchDiscreteCustomEvent };