/** @jsxImportSource react */ import { DropdownWidgetProps, Instance } from "../../ui/Instance"; import type { RenderingContext } from "../../ui/RenderingContext"; import { DropdownConfig } from "../overlay/Dropdown"; import { Field, FieldConfig, FieldInstance } from "./Field"; import { BooleanProp, StringProp } from "../../ui/Prop"; export interface ColorFieldConfig extends FieldConfig { /** Either `rgba`, `hsla` or `hex` value of the selected color. */ value?: StringProp; /** Defaults to `false`. Used to make the field read-only. */ readOnly?: BooleanProp; /** The opposite of `disabled`. */ enabled?: BooleanProp; /** Default text displayed when the field is empty. */ placeholder?: StringProp; /** Set to `true` to hide the clear button. Default value is `false`. */ hideClear?: boolean; /** Set to `false` to hide the clear button. Default value is `true`. */ showClear?: boolean; /** Set to `true` to display the clear button even if `required` is set. Default is `false`. */ alwaysShowClear?: boolean; /** Base CSS class to be applied to the element. Defaults to `colorfield`. */ baseClass?: string; /** Format of the color representation. Either `rgba`, `hsla` or `hex`. */ format?: "rgba" | "hsla" | "hex"; /** Additional configuration to be passed to the dropdown, such as `style`, `positioning`, etc. */ dropdownOptions?: Partial; /** Custom validation function. */ onValidate?: string | ((value: string, instance: Instance, validationParams: Record) => unknown); } export declare class ColorFieldInstance extends FieldInstance implements DropdownWidgetProps { lastDropdown?: Instance; dropdownOpen?: boolean; selectedIndex?: number; } export declare class ColorField extends Field { baseClass: string; showClear?: boolean; alwaysShowClear?: boolean; hideClear?: boolean; format: string; lastDropdown?: string; value?: string; dropdownOptions?: Partial; constructor(config?: ColorFieldConfig); declareData(...args: Record[]): void; init(): void; prepareData(context: RenderingContext, instance: ColorFieldInstance): void; renderInput(context: RenderingContext, instance: ColorFieldInstance, key: string): React.ReactNode; } //# sourceMappingURL=ColorField.d.ts.map