import { getClassNames } from '@websolutespa/bom-core'; import { ComponentPropsWithRef, forwardRef, SVGProps } from 'react'; import styled from 'styled-components'; import { UIComponentWithRef, UIStyledComponentProps } from '../../components/types'; import { getCssResponsive } from '../../components/utils'; import { FormControlCss } from '../styles'; import { SelectLegacyIcon } from './select-legacy-icon'; type Props = ComponentPropsWithRef<'select'> & { }; export type SelectLegacyProps = UIStyledComponentProps; export type SelectLegacyComponent = UIComponentWithRef; const DownArrowSvg = (props: SVGProps) => ( ); const DownArrow = styled(DownArrowSvg)` flex-shrink: 0; width: 24px; height: 24px; margin-left: -2.8rem; align-self: center; pointer-events: none; `; const StyledSelect = styled.div` ${FormControlCss} display: block; width: 100%; padding: var(--form-control-padding); appearance: none; cursor: pointer; .icon { pointer-events: none; transition: color 200ms ease, transform 200ms ease; } &.opened { .icon { transform: rotate(180deg); } } ${props => getCssResponsive(props)} `; const StyledWrapper = styled.div` display: flex; align-items: center; ${props => getCssResponsive(props)} `; export const SelectLegacy: SelectLegacyComponent = forwardRef(({ as = 'select', className, ...props }, ref) => { const classNames = getClassNames('select', className); return ( ); }); SelectLegacy.displayName = 'SelectLegacy';