/** The four pieces of the Alfadocs mark. */ export type PrismPiece = 'top' | 'right' | 'bottom' | 'left'; /** How long one drift through the four hues takes. */ export type PrismSpeed = 'slower' | 'slow' | 'normal' | 'fast' | 'faster'; /** The order the colour travels in: clockwise from the top. */ export declare const PRISM_PIECES: readonly ["top", "right", "bottom", "left"]; /** * One full drift, in milliseconds, per speed. Each hue holds for a quarter * of it, and each piece runs a quarter behind the piece before it. */ export declare const PRISM_DURATION_MS: Record; export declare const PRISM_DURATION_CLASS: Record; /** * How many drifts a prism runs before it settles, when it does not loop. * The extra quarter ends each piece on violet, the mark's own colour, so * the logo comes to rest without a jump. At the `normal` pace the last * piece settles 4.8 seconds in: inside the five seconds WCAG 2.2.2 allows * motion that starts by itself and cannot be paused. */ export declare const PRISM_SETTLE_CYCLES = 2.25; /** A looping drift, plus the piece's place in the order. For a loader. */ export declare const PRISM_LOOP_CLASS: Record; /** A drift that settles, plus the piece's place. For decoration. */ export declare const PRISM_SETTLE_CLASS: Record; export interface UsePrismOptions { /** Whether the pieces drift at all. Default `true`. */ enabled?: boolean; /** Default `normal` (2400ms), the pace of the kit's default `Spinner`. */ speed?: PrismSpeed; /** * `false` (default): decoration. The drift plays `PRISM_SETTLE_CYCLES` * times and settles on the host's own colours. It does not play in the * accessible themes or in forced colours. At `normal` and faster it is * over within five seconds; a slower pace runs longer, so keep those for * a loader. * * `true`: a loader. The drift runs until the host stops it, in every * theme. Motion that loops beside other content needs a way to pause it * (WCAG 2.2.2) unless it is a loading indicator. * * Either way, reduced motion holds the pieces still. */ loop?: boolean; } export interface UsePrismRootProps { /** A plain styling hook: present while the prism is enabled. */ 'data-prism': 'on' | undefined; /** Sets the pace for the pieces inside. `undefined` when disabled. */ className: string | undefined; } export interface UsePrismPieceProps { /** Which piece this is. Always set, so the four stay addressable. */ 'data-shape': PrismPiece; /** * The drift for this piece. `undefined` when disabled, so spreading the * props never wipes a class the piece already has. */ className: string | undefined; } export interface UsePrismReturn { /** Spread (or pick) onto the element that contains the four pieces. */ rootProps: UsePrismRootProps; /** Spread (or pick) onto each piece: an SVG shape with a `fill`. */ pieceProps: (piece: PrismPiece) => UsePrismPieceProps; } /** * The Alfadocs prism: the four pieces of the mark drifting through the * brand hues, one after another, clockwise. * * The hook paints nothing itself. It hands out the classes that run the * drift: `rootProps` for the element around the mark, which sets the pace, * and `pieceProps(piece)` for each of the four shapes. At rest a piece * shows whatever fill its host gives it, so the host decides what a still * mark looks like. * * Whether the pieces are moving is decided in CSS (reduced motion, the * accessible themes, forced colours), so the hook holds no state and * reports none. * * The kit's `Spinner` (a loop) and `Logo` (`prism`, which settles) read * the same tables, so a prism has the same pace and order wherever it * appears. */ export declare function usePrism(options?: UsePrismOptions): UsePrismReturn; //# sourceMappingURL=use-prism.d.ts.map