import * as react from 'react'; import { HTMLUIProps, CSSUIObject, PropGetter, RequiredPropGetter, ThemeProps } from '@yamada-ui/core'; import { FormControlOptions } from '@yamada-ui/form-control'; import { InputProps } from '@yamada-ui/input'; import { ColorFormat } from '@yamada-ui/utils'; import { AlphaSliderProps } from './alpha-slider.js'; import { ColorSwatchProps } from './color-swatch.js'; import { HueSliderProps } from './hue-slider.js'; import { SaturationSliderProps } from './saturation-slider.js'; import './use-color-slider.js'; import './use-saturation-slider.js'; type Space = keyof Hsla | keyof Rgba; interface Hsla { a: number; h: number; l: number; s: number; } interface Rgba { a: number; b: number; g: number; r: number; } interface Hsva { a: number; h: number; s: number; v: number; } interface Channel { label: string; max: number; min: number; space: Space; value: number; } interface ColorSelectorContext { channels: Channel[]; eyeDropperSupported: boolean; interactive: boolean; styles: { [key: string]: CSSUIObject | undefined; }; value: string; withAlpha: boolean; getAlphaSliderProps: PropGetter; getChannelProps: RequiredPropGetter<{ space: Space; } & InputProps, InputProps>; getEyeDropperProps: PropGetter<"button">; getHueSliderProps: PropGetter; getSwatchProps: PropGetter; onChange: (value: Partial | string) => void; size?: ThemeProps<"ColorSelector">["size"]; disabled?: boolean; readOnly?: boolean; } declare const ColorSelectorProvider: react.Provider; declare const useColorSelectorContext: () => ColorSelectorContext; interface UseColorSelectorOptions { /** * The base `id` to use for the color selector. */ id?: string; /** * The name attribute of the hidden `input` field. * This is particularly useful in forms. */ name?: string; /** * The initial value of the color selector. */ defaultValue?: string; /** * The fallback value returned when color determination fails. */ fallbackValue?: string; /** * Color format. For example, `hex`, `rgba`, etc. * * @default "hexa" */ format?: ColorFormat; /** * The value of the color selector. */ value?: string; /** * Function called whenever the color selector value changes. */ onChange?: (value: string) => void; /** * Function called when the user is done selecting a new value. */ onChangeEnd?: (value: string) => void; /** * Function called when the user starts selecting a new value. */ onChangeStart?: (value: string) => void; /** * Function called whenever the color swatch click. */ onSwatchClick?: (value: string) => void; } interface UseColorSelectorBaseProps extends UseColorSelectorOptions, FormControlOptions { } interface UseColorSelectorProps extends Omit, UseColorSelectorBaseProps { } declare const useColorSelector: ({ isInvalid, ...props }: UseColorSelectorProps) => { channels: Channel[]; disabled: boolean | undefined; eyeDropperSupported: boolean; interactive: boolean; readOnly: boolean | undefined; value: string; withAlpha: boolean; getAlphaSliderProps: PropGetter; getChannelProps: RequiredPropGetter<{ space: Space; } & InputProps, InputProps>; getContainerProps: PropGetter<"div", undefined>; getEyeDropperProps: PropGetter<"button", undefined>; getHueSliderProps: PropGetter; getInputProps: PropGetter<"input", undefined>; getSaturationSliderProps: PropGetter; getSwatchProps: PropGetter; onChange: (value: Partial | string) => void; }; type UseColorSelectorReturn = ReturnType; export { ColorSelectorProvider, type UseColorSelectorBaseProps, type UseColorSelectorProps, type UseColorSelectorReturn, useColorSelector, useColorSelectorContext };