import React, { FC } from 'react' import { css, SimpleInterpolation } from 'styled-components' import { flexFlow } from '@monorail/helpers/exports' import { Choice, ChoiceFakeLabel, } from '@monorail/visualComponents/inputs/Choice' import { Label } from '@monorail/visualComponents/inputs/Label' import { Select, SelectOption } from '@monorail/visualComponents/inputs/Select' const checkboxSelectStyles = css` width: 400px; ${ChoiceFakeLabel} { ${flexFlow('row')}; align-items: center; justify-content: space-between; } i { top: 12px; } ` export type CheckboxSelectValue = { enabled: boolean; value: string } export type CheckboxSelectProps = { onChange: (value: CheckboxSelectValue) => void value: CheckboxSelectValue cssOverrides?: SimpleInterpolation disabled?: boolean readOnly?: boolean required?: boolean name?: string label?: string options: Array placeholder?: string } export const CheckboxSelect: FC = props => { const { value, label, options, onChange, cssOverrides, ...domProps } = props return ( { onChange({ enabled: value ? !value.enabled : false, value: value ? value.value : '', }) }} cssOverrides={cssOverrides} css={checkboxSelectStyles} >