import * as React from "react"; import { BaseSolidColorPickerProps } from "./view.pc"; import { CSSSolidBackground, CSSBackgroundType } from "./state"; import { ColorSwatchGroup } from "../../../../../../../../inputs/color/color-swatch-controller"; export type Props = { value: CSSSolidBackground; onChange?: any; onChangeComplete?: any; swatchOptionGroups: ColorSwatchGroup[]; }; export default (Base: React.ComponentClass) => class BackgroundPickerController extends React.PureComponent { onChange = (color: string) => { this.props.onChange({ type: CSSBackgroundType.SOLID, color } as CSSSolidBackground); }; onChangeComplete = (color: string) => { this.props.onChangeComplete({ type: CSSBackgroundType.SOLID, color } as CSSSolidBackground); }; render() { const { onChange, onChangeComplete } = this; const { value, swatchOptionGroups, ...rest } = this.props; return ( ); } };