diff --git a/ui/src/components/core/input/input.styles.ts b/ui/src/components/core/input/input.styles.ts index a2a9a4d..bb82e2e 100644 --- a/ui/src/components/core/input/input.styles.ts +++ b/ui/src/components/core/input/input.styles.ts @@ -1,9 +1,6 @@ import { styled } from '@/theme'; -import { Icon } from '../icon'; - const styles = { - all: 'unset', width: '100%', boxSizing: 'border-box', borderStyle: 'solid', @@ -32,7 +29,9 @@ const styles = { color: '$slate8', }, }, +}; +const variants = { variants: { size: { sm: { @@ -59,13 +58,49 @@ const styles = { }, }; -export const InputStyled = styled('input', styles); - -export const InputIconStyled = styled(Icon, { - position: 'absolute', - left: '$4', - top: '0.9375rem', - color: 'slate8', +export const InputStyled = styled('input', { + all: 'unset', + ...variants, + ...styles, }); -export const TextareaStyled = styled('textarea', styles); +export const InputGroupStyled = styled('div', { + display: 'flex', + flexDirection: 'row', + gap: '$2h', + + ...styles, + + variants: { + size: { + sm: { + borderRadius: '$md', + fontSize: '$xs', + lineHeight: '$4', + }, + md: { + borderRadius: '$lg', + fontSize: '$sm', + height: '$11', + px: '$3h', + }, + lg: { + borderRadius: '$xl', + fontSize: '$md', + }, + }, + }, + defaultVariants: { + size: 'md', + }, +}); + +export const InputGroupTextSyled = styled('input', { + all: 'unset', +}); + +export const TextareaStyled = styled('textarea', { + all: 'unset', + ...variants, + ...styles, +}); diff --git a/ui/src/components/core/input/input.tsx b/ui/src/components/core/input/input.tsx index 2d48507..94e9434 100644 --- a/ui/src/components/core/input/input.tsx +++ b/ui/src/components/core/input/input.tsx @@ -1,37 +1,17 @@ -import React from 'react'; - -import { forwardStyledRef } from '@/theme'; - -import { IconName } from '../icon'; -import { InputIconStyled, InputStyled, TextareaStyled } from './input.styles'; +import { + InputGroupStyled, + InputGroupTextSyled, + InputStyled, + TextareaStyled, +} from './input.styles'; import { StyledInputFile } from './input-file'; export const Textarea = TextareaStyled; export const LogoFileInput = StyledInputFile; -type InputProps = { - leftIcon?: IconName; - wrapperClassName?: string; //tailwind css -} & React.ComponentPropsWithRef; +export const Input = InputStyled; -export const Input = forwardStyledRef( - (props, ref) => { - const { leftIcon, wrapperClassName: css = '', ...ownProps } = props; +export const InputGroup = InputGroupStyled; - return ( -
- {leftIcon && ( - - )} - -
- ); - } -); - -Input.displayName = 'Input'; +export const InputGroupText = InputGroupTextSyled; diff --git a/ui/src/views/explore/explore-list/nfa-search.fragment.tsx b/ui/src/views/explore/explore-list/nfa-search.fragment.tsx index 91b9c82..4ed683f 100644 --- a/ui/src/views/explore/explore-list/nfa-search.fragment.tsx +++ b/ui/src/views/explore/explore-list/nfa-search.fragment.tsx @@ -1,6 +1,11 @@ import { useState } from 'react'; -import { Dropdown, DropdownItem, Input } from '@/components'; +import { + Dropdown, + DropdownItem, + InputGroup, + InputGroupText, +} from '@/components'; import { useDebounce } from '@/hooks'; import { Explore } from '../explore.context'; @@ -69,12 +74,11 @@ export const NFASearchFragment: React.FC = () => { - + + + + + { }; return ( - + { /> } /> - - - + + + - - + + + + + {queryLoading === 'loading' || queryUserAndOrganizations === 'loading' ? ( ) : ( )} - - - + + + ); };