parent
f89ce686ee
commit
96d08f93cd
@ -2,7 +2,7 @@ import type { SelectHTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Icon } from '..';
|
||||
import { defaultFormElement } from '../../utils/shared';
|
||||
import { defaultSelectElement } from '../../utils/shared';
|
||||
|
||||
export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
||||
hasError?: boolean;
|
||||
@ -18,7 +18,7 @@ export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
||||
ref={ref}
|
||||
{...props}
|
||||
className={classNames(
|
||||
defaultFormElement(hasError),
|
||||
defaultSelectElement(hasError),
|
||||
className,
|
||||
'appearance-none rounded-md'
|
||||
)}
|
||||
|
@ -1,10 +1,13 @@
|
||||
import classnames from 'classnames';
|
||||
|
||||
export const defaultSelectElement = (hasError?: boolean) =>
|
||||
classnames(defaultFormElement(hasError), 'dark:bg-black');
|
||||
|
||||
export const defaultFormElement = (hasError?: boolean) =>
|
||||
classnames(
|
||||
'flex items-center w-full text-sm',
|
||||
'p-2 border-2 rounded-none',
|
||||
'bg-transparent ',
|
||||
'bg-transparent',
|
||||
'border border-neutral-500 focus:border-black dark:focus:border-white',
|
||||
'disabled:opacity-40',
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user