@flanksource/clicky-ui
Version:
Flanksource Clicky UI — React component library built on shadcn/ui with light/dark and density theming.
53 lines • 2.16 kB
TypeScript
import { ComponentType } from 'react';
import { SizeToken } from '../lib/size';
export type IconStyle = "plain" | "badge";
export type IconTone = "emerald" | "amber" | "rose" | "slate" | "sky" | "violet" | "neutral";
export type IconProps = {
name: string;
className?: string;
width?: string | number;
height?: string | number;
rotate?: string | number;
flip?: string;
inline?: boolean;
title?: string;
/**
* Presentation style. `plain` (default) renders the icon inline.
* `badge` wraps the icon in a circular chip (white background, ring, shadow)
* sized by `size` — use in stage/approval cells so the chip scales with a
* neighbouring avatar.
*/
style?: IconStyle;
/**
* Named size token (xxs..xxl). Drives the badge diameter and glyph. The
* glyph is always ~50% of the badge diameter so it scales consistently
* across sizes. For `style="plain"` it sets width/height when neither is
* provided.
*/
size?: SizeToken;
/** Semantic color for `style="badge"`. Ignored for plain icons. */
tone?: IconTone;
};
/**
* Optional secondary icon provider. Consumers can plug in a component
* (e.g. `Icon` from `@flanksource/icons/icon`) to supply glyphs that the
* iconify registry doesn't know about (brand logos, k8s resource icons,
* etc.). Clicky-ui never imports the package directly so consumers that
* don't need it avoid the dependency entirely.
*/
export type FallbackIconProps = {
name?: string;
className?: string;
size?: string | number;
alt?: string;
};
type FallbackIconComponent = ComponentType<FallbackIconProps>;
/**
* Register a secondary glyph provider. Pass the flanksource Icon (or any
* compatible component) to resolve names that `@iconify/react` hasn't
* loaded. Call this once at app bootstrap.
*/
export declare function setFallbackIconProvider(component: FallbackIconComponent | null): void;
export declare function Icon({ name, className, width, height, rotate, flip, inline, title, style, size, tone, }: IconProps): import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=Icon.d.ts.map