/** * makeIcon — factory function for Reapit DS icon components. * * Each icon component returned by this factory: * - Accepts `size` and `colour` props mapped to DS tokens. * - Applies `currentColor` to SVG fill/stroke so CSS drives the colour. * - Sets `aria-hidden` when no `title` is provided (decorative usage). * - Accepts `title` for screen-reader-accessible labelling, passed via * the `title` prop generated by SVGR's `titleProp: true` option. * - Forwards all other SVG props to the underlying element. * * No Linaria, no CSS Modules — colour is driven via a `data-colour` attribute * whose CSS rules live in `src/theme/globals.css` under the * `/* Icon colour data-attributes *\/` section. */ import React from 'react'; export declare namespace Icon { /** * DS size values mapped to Tailwind `size-*` classes. * * xs → size-3 (12 px) * sm → size-4 (16 px) * md → size-5 (20 px) — default * lg → size-6 (24 px) * xl → size-8 (32 px) */ type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; /** * DS colour values. Each value maps to a `data-colour` CSS rule in * `globals.css` that resolves the corresponding `--icon-*` CSS variable. * * When `colour` is omitted the attribute is not rendered and the icon * inherits its colour from the surrounding context. */ type Colour = 'primary' | 'secondary' | 'disabled' | 'white' | 'action' | 'pending' | 'warning' | 'error' | 'success' | 'info' | 'star' | 'accent-1' | 'accent-2'; interface Props extends React.SVGProps { /** DS size token. Defaults to `'md'` (20 px). */ size?: Size; /** DS colour token. When omitted, colour inherits from the parent element. */ colour?: Colour; /** * Accessible label. When provided, a `` element is rendered inside * the SVG and `aria-labelledby` is set. When omitted, `aria-hidden="true"` * is set (decorative usage). */ title?: string; /** Additional CSS classes, merged via `cn()`. */ className?: string; } } interface SvgComponentProps extends React.SVGProps<SVGSVGElement> { title?: string; titleId?: string; } /** * Creates a typed React icon component from an SVGR-generated component. * * The `SvgContent` component must be generated with SVGR's `titleProp: true` * option so it accepts `title` and `titleId` props natively. * * @param name Display name for the component (e.g. `'AddIcon'`). * @param SvgContent SVGR-generated React component accepting SVGProps plus * optional `title` and `titleId` string props. * * @example * ```tsx * import { makeIcon } from '@/src/icons/make-icon' * import AddIconSvg from './generated/AddIcon' * * export const AddIcon = makeIcon('AddIcon', AddIconSvg) * ``` */ export declare function makeIcon(name: string, SvgContent: React.ComponentType<SvgComponentProps>): React.FC<Icon.Props>; export {};