@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
33 lines (32 loc) • 1.35 kB
TypeScript
/**
* This module includes UI control for showing a color and for picking a color.
*
* @packageDocumentation
*/
import { JSX } from 'react';
import '@rc-component/color-picker/assets/index.css';
import { PopoverOrigin } from '@mui/material';
/**
* Properties of the ColorControl React component.
*/
export interface ColorControlProps {
/** The currently selected color in hex string format or a color name (e.g., "#RRGGBB" or "#RRGGBBAA" or "red"). */
color: string;
/** A callback that will be called when the user selects a new color.
* @param color - The newly selected color in hex string format.
*/
onChange: (color: string) => void;
/** The origin for the popover that contains the color picker. Default is \{ vertical: 'bottom', horizontal: 'left' \}. */
anchorOrigin?: PopoverOrigin;
/** The size of the color button. Default is "24px". */
size?: string | number;
/** Optional predefined colors that the user can select from. */
predefinedColors?: string[];
}
/**
* This component provides a UI control for displaying and selecting a color.
* @param props - Component properties.
* @returns The ColorControl React component.
*/
declare function ColorControl({ color, onChange, anchorOrigin, size, predefinedColors, }: ColorControlProps): JSX.Element;
export default ColorControl;