website refactor
This commit is contained in:
@@ -14,6 +14,7 @@ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement
|
||||
hint?: string;
|
||||
fullWidth?: boolean;
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
pl?: number;
|
||||
}
|
||||
|
||||
export const Select = forwardRef<HTMLSelectElement, SelectProps>(({
|
||||
@@ -23,6 +24,7 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(({
|
||||
hint,
|
||||
fullWidth = false,
|
||||
size = 'md',
|
||||
pl,
|
||||
...props
|
||||
}, ref) => {
|
||||
const sizeClasses = {
|
||||
@@ -42,6 +44,10 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(({
|
||||
widthClasses,
|
||||
].filter(Boolean).join(' ');
|
||||
|
||||
const style: React.CSSProperties = {
|
||||
...(pl !== undefined ? { paddingLeft: `${pl * 0.25}rem` } : {}),
|
||||
};
|
||||
|
||||
return (
|
||||
<Box width={fullWidth ? '100%' : undefined}>
|
||||
{label && (
|
||||
@@ -55,6 +61,7 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(({
|
||||
<select
|
||||
ref={ref}
|
||||
className={classes}
|
||||
style={style}
|
||||
{...props}
|
||||
>
|
||||
{options.map((option) => (
|
||||
|
||||
Reference in New Issue
Block a user