next-yak
Version:
next-yak is a CSS-in-JS solution tailored for Next.js that seamlessly combines the expressive power of styled-components syntax with efficient build-time extraction of CSS using Next.js's built-in CSS configuration
36 lines (32 loc) • 1.49 kB
TypeScript
import * as React$1 from 'react';
import ReactJSXRuntime from 'react/jsx-runtime';
type ComponentStyles<TProps> = (props: TProps) => {
className: string;
style?: {
[key: string]: string;
};
};
type WithConditionalCSSProp<P> = "className" | "style" extends keyof P ? string extends P["className" & keyof P] ? Record<string, any> extends P["style" & keyof P] ? {
css?: ComponentStyles<Record<keyof any, never>>;
} : {} : {} : {};
declare const Fragment: React$1.ExoticComponent<{
children?: React$1.ReactNode | undefined;
}>;
declare const jsx: typeof ReactJSXRuntime.jsx;
declare const jsxs: typeof ReactJSXRuntime.jsxs;
declare namespace YakJSX {
type Element = React.JSX.Element;
type ElementType = React.JSX.ElementType;
type ElementClass = React.JSX.ElementClass;
type ElementAttributesProperty = React.JSX.ElementAttributesProperty;
type ElementChildrenAttribute = React.JSX.ElementChildrenAttribute;
type LibraryManagedAttributes<C, P> = P extends unknown ? WithConditionalCSSProp<P> & React.JSX.LibraryManagedAttributes<C, P> : never;
type IntrinsicAttributes = React.JSX.IntrinsicAttributes;
type IntrinsicClassAttributes<T> = React.JSX.IntrinsicClassAttributes<T>;
type IntrinsicElements = {
[K in keyof React.JSX.IntrinsicElements]: React.JSX.IntrinsicElements[K] & {
css?: ComponentStyles<Record<keyof any, never>>;
};
};
}
export { Fragment, YakJSX as JSX, YakJSX, jsx, jsxs };