import { type ComponentType, type ReactNode, type SVGProps } from 'react'; import type { IconName } from './types'; /** * The props of an Apsara icon: the SVG attributes, without `children`. * * An icon draws a fixed shape, so it takes no children. Leaving `children` out * is also what keeps a real icon library assignable to `IconComponent`: props * are contravariant, so an override has to accept every prop this type permits, * and some libraries declare `children?: undefined` to forbid children. */ export type IconProps = Omit, 'children'>; export type IconComponent = ComponentType; export type IconOverrides = Partial>; /** * The icons and the icon props together, so `` takes one object. * * `components` replaces a drawing by key. `props` applies to every icon built * by `createIcon`, the consumer's own included. */ export interface IconOptions { components?: IconOverrides; props?: IconProps; } /** What `createIcon` reads: the override map, and the shared props. */ export interface IconContextValue { icons?: IconOverrides; props?: IconProps; } export interface IconProviderProps extends IconOptions { children: ReactNode; } export declare function IconProvider({ components, props, children }: IconProviderProps): import("react/jsx-runtime").JSX.Element; export declare namespace IconProvider { var displayName: string; } /** * Builds an Apsara icon: a wrapper that applies the base props, stamps * `data-icon`, and lets a `` above it swap the drawing. * * Use it for an icon Apsara does not ship, and it behaves like the ones it does: * * ```tsx * // src/icons.ts * import { createIcon } from '@raystack/apsara/icons'; * import { Rocket } from 'lucide-react'; * * export const RocketIcon = createIcon('RocketIcon', Rocket); * ``` * * `name` is any string. `IconName` covers the keys Apsara ships, so those are * the ones `` can replace with types on your side — but every icon * built here reads the same context, so its `props` reach yours too. * * Resolution: the override from the context, then `Default`. * Prop priority: the base values, then the provider `props`, then the props at * the call site. */ export declare function createIcon(name: string, Default: IconComponent): { (callProps: IconProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; //# sourceMappingURL=create-icon.d.ts.map