import { CSSProperties, PropsWithoutRef, RefAttributes, JSX, SVGAttributes } from 'react'; import { MotionNodeOptions, MotionValue, TransformProperties, SVGPathProperties } from 'motion-dom'; /** * Either a string, or array of strings, that reference variants defined via the `variants` prop. * @public */ type VariantLabels = string | string[]; type MotionValueString = MotionValue; type MotionValueNumber = MotionValue; type MotionValueAny = MotionValue; type AnyMotionValue = MotionValueNumber | MotionValueString | MotionValueAny; type MotionValueHelper = T | AnyMotionValue; type MakeMotionHelper = { [K in keyof T]: MotionValueHelper; }; type MakeCustomValueTypeHelper = MakeMotionHelper; type MakeMotion = MakeCustomValueTypeHelper; type MotionCSS = MakeMotion>; /** * @public */ type MotionTransform = MakeMotion; type MotionSVGProps = MakeMotion; /** * @public */ interface MotionStyle extends MotionCSS, MotionTransform, MotionSVGProps { } /** * Props for `motion` components. * * @public */ interface MotionProps extends MotionNodeOptions { /** * * The React DOM `style` prop, enhanced with support for `MotionValue`s and separate `transform` values. * * ```jsx * export const MyComponent = () => { * const x = useMotionValue(0) * * return * } * ``` */ style?: MotionStyle; children?: React.ReactNode | MotionValueNumber | MotionValueString; } interface HTMLElements { a: HTMLAnchorElement; abbr: HTMLElement; address: HTMLElement; area: HTMLAreaElement; article: HTMLElement; aside: HTMLElement; audio: HTMLAudioElement; b: HTMLElement; base: HTMLBaseElement; bdi: HTMLElement; bdo: HTMLElement; big: HTMLElement; blockquote: HTMLQuoteElement; body: HTMLBodyElement; br: HTMLBRElement; button: HTMLButtonElement; canvas: HTMLCanvasElement; caption: HTMLElement; center: HTMLElement; cite: HTMLElement; code: HTMLElement; col: HTMLTableColElement; colgroup: HTMLTableColElement; data: HTMLDataElement; datalist: HTMLDataListElement; dd: HTMLElement; del: HTMLModElement; details: HTMLDetailsElement; dfn: HTMLElement; dialog: HTMLDialogElement; div: HTMLDivElement; dl: HTMLDListElement; dt: HTMLElement; em: HTMLElement; embed: HTMLEmbedElement; fieldset: HTMLFieldSetElement; figcaption: HTMLElement; figure: HTMLElement; footer: HTMLElement; form: HTMLFormElement; h1: HTMLHeadingElement; h2: HTMLHeadingElement; h3: HTMLHeadingElement; h4: HTMLHeadingElement; h5: HTMLHeadingElement; h6: HTMLHeadingElement; head: HTMLHeadElement; header: HTMLElement; hgroup: HTMLElement; hr: HTMLHRElement; html: HTMLHtmlElement; i: HTMLElement; iframe: HTMLIFrameElement; img: HTMLImageElement; input: HTMLInputElement; ins: HTMLModElement; kbd: HTMLElement; keygen: HTMLElement; label: HTMLLabelElement; legend: HTMLLegendElement; li: HTMLLIElement; link: HTMLLinkElement; main: HTMLElement; map: HTMLMapElement; mark: HTMLElement; menu: HTMLElement; menuitem: HTMLElement; meta: HTMLMetaElement; meter: HTMLMeterElement; nav: HTMLElement; noindex: HTMLElement; noscript: HTMLElement; object: HTMLObjectElement; ol: HTMLOListElement; optgroup: HTMLOptGroupElement; option: HTMLOptionElement; output: HTMLOutputElement; p: HTMLParagraphElement; param: HTMLParamElement; picture: HTMLElement; pre: HTMLPreElement; progress: HTMLProgressElement; q: HTMLQuoteElement; rp: HTMLElement; rt: HTMLElement; ruby: HTMLElement; s: HTMLElement; samp: HTMLElement; search: HTMLElement; slot: HTMLSlotElement; script: HTMLScriptElement; section: HTMLElement; select: HTMLSelectElement; small: HTMLElement; source: HTMLSourceElement; span: HTMLSpanElement; strong: HTMLElement; style: HTMLStyleElement; sub: HTMLElement; summary: HTMLElement; sup: HTMLElement; table: HTMLTableElement; template: HTMLTemplateElement; tbody: HTMLTableSectionElement; td: HTMLTableDataCellElement; textarea: HTMLTextAreaElement; tfoot: HTMLTableSectionElement; th: HTMLTableHeaderCellElement; thead: HTMLTableSectionElement; time: HTMLTimeElement; title: HTMLTitleElement; tr: HTMLTableRowElement; track: HTMLTrackElement; u: HTMLElement; ul: HTMLUListElement; var: HTMLElement; video: HTMLVideoElement; wbr: HTMLElement; webview: HTMLWebViewElement; } /** * @public */ type ForwardRefComponent = { readonly $$typeof: symbol; } & ((props: PropsWithoutRef

& RefAttributes) => JSX.Element); type AttributesWithoutMotionProps = { [K in Exclude]?: Attributes[K]; }; /** * @public */ type HTMLMotionProps = AttributesWithoutMotionProps & MotionProps; /** * Motion-optimised versions of React's HTML components. * * @public */ type HTMLMotionComponents = { [K in keyof HTMLElements]: ForwardRefComponent>; }; type UnionStringArray> = T[number]; declare const svgElements: readonly ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "linearGradient", "radialGradient", "textPath"]; type SVGElements = UnionStringArray; interface SVGAttributesWithoutMotionProps extends Pick, Exclude, keyof MotionProps>> { } /** * Blanket-accept any SVG attribute as a `MotionValue` * @public */ type SVGAttributesAsMotionValues = MakeMotion>; type UnwrapSVGFactoryElement = F extends React.SVGProps ? P : never; /** * @public */ interface SVGMotionProps extends SVGAttributesAsMotionValues, MotionProps { } /** * Motion-optimised versions of React's SVG components. * * @public */ type SVGMotionComponents = { [K in SVGElements]: ForwardRefComponent, SVGMotionProps>>; }; export type { ForwardRefComponent as F, HTMLMotionComponents as H, MotionProps as M, SVGMotionComponents as S, VariantLabels as V, HTMLElements as a, HTMLMotionProps as b, MotionStyle as c, MotionTransform as d, SVGAttributesAsMotionValues as e, SVGMotionProps as f };