Ajoute Card, Badge, Checkbox, Radio, Select, Spinner, EmptyState, Dialog, TabBar et Toolbar au package @napps/design-system, tous construits à partir des tokens existants (fills, labels par opacité, deux familles de matière) — aucune valeur ad hoc introduite.
21 lines
736 B
TypeScript
21 lines
736 B
TypeScript
import { SelectHTMLAttributes, forwardRef } from 'react';
|
|
|
|
export type SelectProps = SelectHTMLAttributes<HTMLSelectElement>;
|
|
|
|
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
({ className, ...props }, ref) => {
|
|
return (
|
|
<div className="select-wrapper">
|
|
<select ref={ref} className={['select', className].filter(Boolean).join(' ')} {...props} />
|
|
<span className="select-chevron" aria-hidden="true">
|
|
<svg width="10" height="10" viewBox="0 0 10 10" fill="none">
|
|
<path d="M1 3.5L5 7.5L9 3.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
);
|
|
}
|
|
);
|
|
|
|
Select.displayName = 'Select';
|