import React from 'react'
import { get, ThemeUICSSObject } from '@theme-ui/css'
import { Box, BoxOwnProps, BoxProps } from './Box'
import { SVG, SVGProps } from './SVG'
import { getMargin, omitMargin, __internalProps } from './util'
import { Assign, ForwardRef } from './types'
const DownArrow = (props: SVGProps) => (
)
export interface SelectProps
extends Assign, BoxOwnProps> {
arrow?: React.ReactElement
}
/**
* Select variants can be defined in `theme.forms`
* and the component uses the `theme.forms.select` variant by default.
* @see https://theme-ui.com/components/select/
*/
export const Select: ForwardRef =
React.forwardRef(function Select({ arrow, ...props }, ref) {
const __css: ThemeUICSSObject = {
display: 'block',
width: '100%',
p: 2,
paddingRight: 4,
appearance: 'none',
fontSize: 'inherit',
lineHeight: 'inherit',
border: '1px solid',
borderRadius: 4,
color: 'inherit',
backgroundColor: (theme) => get(theme, 'colors.background', null),
}
return (
{arrow || (
)}
)
})