/** @module @airtable/blocks/ui: ColorPalette */ /** */ import * as PropTypes from 'prop-types'; import * as React from 'react'; import { MaxWidthProps, MinWidthProps, WidthProps, FlexItemSetProps, PositionSetProps, MarginProps } from './system'; import { TooltipAnchorProps } from './types/tooltip_anchor_props'; /** * Style props shared between the {@link ColorPalette} and {@link ColorPaletteSynced} components. Accepts: * * {@link FlexItemSetProps} * * {@link MarginProps} * * {@link MaxWidthProps} * * {@link MinWidthProps} * * {@link PositionSetProps} * * {@link WidthProps} * * @noInheritDoc */ export interface ColorPaletteStyleProps extends MaxWidthProps, MinWidthProps, WidthProps, FlexItemSetProps, PositionSetProps, MarginProps { } export declare const colorPaletteStylePropTypes: { [x: string]: PropTypes.Validator; }; /** * Props shared between the {@link ColorPalette} and {@link ColorPaletteSynced} components. */ export interface SharedColorPaletteProps extends ColorPaletteStyleProps, TooltipAnchorProps { /** The list of {@link Color|colors} to display in the color palette. */ allowedColors: Array; /** A function to be called when the selected color changes. */ onChange?: (arg1: string) => unknown; /** The margin between color squares in the color palette. */ squareMargin?: number; /** Additional class names to apply to the color palette, separated by spaces. */ className?: string; /** Additional styles to apply to the color palette. */ style?: React.CSSProperties; /** If set to `true`, the color palette will not allow color selection. */ disabled?: boolean; } export declare const sharedColorPalettePropTypes: { onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>; onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>; onClick: PropTypes.Requireable<(...args: any[]) => any>; hasOnClick: PropTypes.Requireable; allowedColors: PropTypes.Validator<(string | null | undefined)[]>; onChange: PropTypes.Requireable<(...args: any[]) => any>; squareMargin: PropTypes.Requireable; className: PropTypes.Requireable; style: PropTypes.Requireable; disabled: PropTypes.Requireable; }; /** * Props for the {@link ColorPalette} component. Also accepts: * * {@link ColorPaletteStyleProps} * * @docsPath UI/components/ColorPalette */ interface ColorPaletteProps extends SharedColorPaletteProps { /** The current selected {@link Color} option. */ color?: string | null; } /** @hidden */ interface ColorPaletteState { squareSize: number; } /** * A color selection component. Accepts a list of `allowedColors` to be displayed * as selectable color squares. * * [[ Story id="colorpalette--example" title="Color palette example" ]] * * @component * @docsPath UI/components/ColorPalette */ export declare class ColorPalette extends React.Component { /** @hidden */ static propTypes: { onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>; onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>; onClick: PropTypes.Requireable<(...args: any[]) => any>; hasOnClick: PropTypes.Requireable; allowedColors: PropTypes.Validator<(string | null | undefined)[]>; onChange: PropTypes.Requireable<(...args: any[]) => any>; squareMargin: PropTypes.Requireable; className: PropTypes.Requireable; style: PropTypes.Requireable; disabled: PropTypes.Requireable; color: PropTypes.Requireable; }; /** @hidden */ static defaultProps: { squareMargin: number; className: string; style: {}; }; /** @internal */ _detectElementResize: { addResizeListener: (element: HTMLElement, fn: () => void) => void; removeResizeListener: (element: HTMLElement, fn: () => void) => void; }; /** @internal */ _colorPaletteContainerRef: { current: HTMLElement | null; }; /** @hidden */ constructor(props: ColorPaletteProps); /** @hidden */ componentDidMount(): void; /** @hidden */ componentWillUnmount(): void; /** @hidden */ componentDidUpdate(prevProps: ColorPaletteProps): void; /** @internal */ _setColorSquareSize(): void; /** @internal */ _onChange(color: string): void; /** @hidden */ render(): JSX.Element; } declare const _default: React.RefForwardingComponent & ColorPaletteStyleProps & React.RefAttributes>; export default _default;