Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(app): Adding a new ghost state for textfield component #3062

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions weave-js/src/components/Form/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ type TextFieldProps = {
autoComplete?: string;
dataTest?: string;
step?: number;
variant?: 'default' | 'ghost';
};

export const TextField = ({
size,
variant = 'default',
placeholder,
value,
onChange,
Expand Down Expand Up @@ -86,13 +88,17 @@ export const TextField = ({
textFieldSize === 'medium' ? 'h-32' : 'h-40',
'bg-white dark:bg-moon-900',
'text-moon-800 dark:text-moon-200',
'outline outline-1 outline-moon-250 dark:outline-moon-700',
variant === 'default' &&
'outline outline-1 outline-moon-250 dark:outline-moon-700',
variant === 'ghost' &&
'outline outline-1 outline-transparent dark:outline-transparent',
{
'hover:outline-2 [&:hover:not(:focus-within)]:outline-[#83E4EB] dark:[&:hover:not(:focus-within)]:outline-teal-650':
!errorState,
!errorState && variant === 'default',
'focus-within:outline-2 focus-within:outline-teal-400 dark:focus-within:outline-teal-600':
!errorState,
'outline-2 outline-red-450 dark:outline-red-550': errorState,
!errorState && variant === 'default',
'outline-2 outline-red-450 dark:outline-red-550':
errorState && variant === 'default',
'pointer-events-none opacity-50': disabled,
}
)}>
Expand Down
Loading