📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Use Input component over custom implementation
Blue Mousea849bbc637ea
diff --git a/web/app/pages/Dashboard/Dashboard.tsx b/web/app/pages/Dashboard/Dashboard.tsxindex 5e6103213..2de8fbc47 100644--- a/web/app/pages/Dashboard/Dashboard.tsx+++ b/web/app/pages/Dashboard/Dashboard.tsx@@ -391,20 +391,17 @@ const Dashboard = () => {<label htmlFor='project-search' className='sr-only'>{t('project.search')}</label>- <div className='relative w-full'>- <div className='pointer-events-none absolute inset-y-0 left-0 hidden items-center sm:flex'>- <MagnifyingGlassIcon className='ml-2 h-5 w-5 cursor-pointer text-gray-900 hover:opacity-80 dark:text-gray-50' />- </div>- <input- ref={searchInputRef}- type='text'- id='project-search'- onChange={onSearch}- value={search}- className='block h-7 w-full rounded-lg border-none bg-white p-2.5 text-sm text-gray-900 ring-1 ring-gray-300 ring-inset focus:ring-slate-900 sm:pl-10 dark:bg-slate-950 dark:text-gray-50 dark:placeholder-gray-400 dark:ring-slate-700/80 dark:focus:ring-slate-300'- placeholder={t('project.search')}- />- </div>+ <Input+ ref={searchInputRef}+ id='project-search'+ type='search'+ onChange={onSearch}+ value={search}+ className='w-full'+ classes={{ input: 'h-7 py-1.5' }}+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ placeholder={t('project.search')}+ /></div>) : null}</div>@@ -449,22 +446,18 @@ const Dashboard = () => {</div>{isSearchActive ? (<div className='mb-2 flex w-full items-center sm:hidden'>- <label htmlFor='project-search' className='sr-only'>+ <label htmlFor='project-search-mobile' className='sr-only'>{t('project.search')}</label>- <div className='relative w-full'>- <div className='pointer-events-none absolute inset-y-0 left-0 flex items-center'>- <MagnifyingGlassIcon className='ml-2 h-5 w-5 cursor-pointer text-gray-900 hover:opacity-80 dark:text-gray-50' />- </div>- <input- id='project-search'- type='text'- onChange={onSearch}- value={search}- className='block h-7 w-full rounded-lg border-none bg-gray-50 p-2.5 py-5 pl-10 text-sm text-gray-900 ring-1 ring-gray-300 focus:ring-slate-900 dark:bg-slate-950 dark:text-white dark:placeholder-gray-400 dark:ring-slate-600 dark:focus:ring-slate-300'- placeholder={t('project.search')}- />- </div>+ <Input+ id='project-search-mobile'+ type='search'+ onChange={onSearch}+ value={search}+ className='w-full'+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ placeholder={t('project.search')}+ /></div>) : null}{isLoading && !_isEmpty(projects) ? <LoadingBar /> : null}diff --git a/web/app/pages/Organisations/Organisations.tsx b/web/app/pages/Organisations/Organisations.tsxindex a9baf9e1a..5219dd53d 100644--- a/web/app/pages/Organisations/Organisations.tsx+++ b/web/app/pages/Organisations/Organisations.tsx@@ -216,20 +216,17 @@ const Organisations = () => {<label htmlFor='organisation-search' className='sr-only'>{t('project.search')}</label>- <div className='relative w-full'>- <div className='pointer-events-none absolute inset-y-0 left-0 hidden items-center sm:flex'>- <MagnifyingGlassIcon className='ml-2 h-5 w-5 cursor-pointer text-gray-900 hover:opacity-80 dark:text-gray-50' />- </div>- <input- ref={searchInputRef}- type='text'- id='organisation-search'- onChange={onSearch}- value={search}- className='block h-7 w-full rounded-lg border-none bg-gray-50 p-2.5 text-sm text-gray-900 ring-1 ring-gray-300 focus:ring-slate-900 sm:pl-10 dark:bg-slate-950 dark:text-white dark:placeholder-gray-400 dark:ring-slate-600 dark:focus:ring-slate-300'- placeholder={t('project.search')}- />- </div>+ <Input+ ref={searchInputRef}+ id='organisation-search'+ type='search'+ onChange={onSearch}+ value={search}+ className='w-full'+ classes={{ input: 'h-7 py-1.5' }}+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ placeholder={t('project.search')}+ /></div>) : null}</div>@@ -243,19 +240,15 @@ const Organisations = () => {<label htmlFor='organisation-search-mobile' className='sr-only'>{t('project.search')}</label>- <div className='relative w-full'>- <div className='pointer-events-none absolute inset-y-0 left-0 flex items-center'>- <MagnifyingGlassIcon className='ml-2 h-5 w-5 cursor-pointer text-gray-900 hover:opacity-80 dark:text-gray-50' />- </div>- <input- id='organisation-search-mobile'- type='text'- onChange={onSearch}- value={search}- className='block h-7 w-full rounded-lg border-none bg-gray-50 p-2.5 py-5 pl-10 text-sm text-gray-900 ring-1 ring-gray-300 focus:ring-slate-900 dark:bg-slate-950 dark:text-white dark:placeholder-gray-400 dark:ring-slate-600 dark:focus:ring-slate-300'- placeholder={t('project.search')}- />- </div>+ <Input+ id='organisation-search-mobile'+ type='search'+ onChange={onSearch}+ value={search}+ className='w-full'+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ placeholder={t('project.search')}+ /></div>) : null}<div>diff --git a/web/app/pages/Organisations/Settings/Projects.tsx b/web/app/pages/Organisations/Settings/Projects.tsxindex fb4bd7dac..be0f66b56 100644--- a/web/app/pages/Organisations/Settings/Projects.tsx+++ b/web/app/pages/Organisations/Settings/Projects.tsx@@ -20,6 +20,7 @@ import { Project } from '~/lib/models/Project'import { useAuth } from '~/providers/AuthProvider'import type { OrganisationSettingsActionData } from '~/routes/organisations.$id'import Button from '~/ui/Button'+import Input from '~/ui/Input'import Loader from '~/ui/Loader'import Modal from '~/ui/Modal'import Pagination from '~/ui/Pagination'@@ -78,18 +79,15 @@ const SelectAProject = ({ onSelect }: SelectAProjectProps) => {return (<div className='mt-4 flex flex-col'><div className='mb-4'>- <div className='relative'>- <div className='pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3'>- <MagnifyingGlassIcon className='h-5 w-5 text-gray-400' />- </div>- <input- type='text'- className='block w-full rounded-md border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-gray-300 ring-inset placeholder:text-gray-400 focus:ring-2 focus:ring-slate-900 focus:ring-inset sm:text-sm sm:leading-6 dark:bg-slate-900 dark:text-white dark:ring-slate-600 dark:focus:ring-slate-300'- placeholder={t('project.search')}- value={search}- onChange={(e) => setSearch(e.target.value)}- />- </div>+ <Input+ type='search'+ aria-label={t('project.search')}+ placeholder={t('project.search')}+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ classes={{ input: 'py-1.5' }}+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ /></div>{isLoading ? (@@ -309,21 +307,18 @@ export const Projects = ({ organisation }: ProjectsProps) => {</Button></div>{isSearchActive ? (- <div className='relative w-full'>- <div className='pointer-events-none absolute inset-y-0 left-0 hidden items-center sm:flex'>- <MagnifyingGlassIcon className='ml-2 h-5 w-5 cursor-pointer text-gray-900 hover:opacity-80 dark:text-gray-50' />- </div>- <input- type='text'- onChange={(e) => {- setSearch(e.target.value.toLowerCase())- setCurrentPage(1)- }}- value={search}- className='block h-8 w-full rounded-lg border-none bg-gray-50 p-2.5 text-sm text-gray-900 ring-1 ring-gray-300 focus:ring-slate-900 sm:pl-10 dark:bg-slate-950 dark:text-white dark:placeholder-gray-400 dark:ring-slate-600 dark:focus:ring-slate-300'- placeholder={t('project.search')}- />- </div>+ <Input+ type='search'+ aria-label={t('project.search')}+ onChange={(e) => {+ setSearch(e.target.value.toLowerCase())+ setCurrentPage(1)+ }}+ value={search}+ classes={{ input: 'h-8 py-1.5' }}+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ placeholder={t('project.search')}+ />) : null}<div>{_isEmpty(filteredProjects) ? (diff --git a/web/app/pages/Project/View/Panels.tsx b/web/app/pages/Project/View/Panels.tsxindex 5dbd540ad..2a0fa0e06 100644--- a/web/app/pages/Project/View/Panels.tsx+++ b/web/app/pages/Project/View/Panels.tsx@@ -25,6 +25,7 @@ import {StackIcon,ArrowLineRightIcon,ArrowLineLeftIcon,+ MagnifyingGlassIcon,} from '@phosphor-icons/react'import React, {memo,@@ -45,6 +46,7 @@ import { Entry } from '~/lib/models/Entry'import { useCurrentProject } from '~/providers/CurrentProjectProvider'import Button from '~/ui/Button'import Dropdown from '~/ui/Dropdown'+import Input from '~/ui/Input'import Sort from '~/ui/icons/Sort'import Spin from '~/ui/icons/Spin'import Modal from '~/ui/Modal'@@ -1871,12 +1873,14 @@ const DetailsTable = ({return (<div><div className='mb-2'>- <input- type='text'+ <Input+ type='search'+ aria-label={t('project.search')}placeholder={t('project.search')}value={search}onChange={(e) => setSearch(e.target.value)}- className='w-full rounded-md border border-gray-200 bg-white px-2 py-1 text-sm text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-slate-700/80 dark:bg-slate-950 dark:text-gray-50'+ classes={{ input: 'py-1.5' }}+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}/></div><divdiff --git a/web/app/pages/Project/tabs/Experiments/ExperimentsView.tsx b/web/app/pages/Project/tabs/Experiments/ExperimentsView.tsxindex d1228dede..aeb5732a2 100644--- a/web/app/pages/Project/tabs/Experiments/ExperimentsView.tsx+++ b/web/app/pages/Project/tabs/Experiments/ExperimentsView.tsx@@ -30,6 +30,7 @@ import { useCurrentProject } from '~/providers/CurrentProjectProvider'import type { ProjectViewActionData } from '~/routes/projects.$id'import Button from '~/ui/Button'import { Badge } from '~/ui/Badge'+import Input from '~/ui/Input'import Spin from '~/ui/icons/Spin'import LoadingBar from '~/ui/LoadingBar'import Modal from '~/ui/Modal'@@ -840,16 +841,15 @@ const ExperimentsView = ({) : (<><div className='mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between'>- <div className='relative'>- <MagnifyingGlassIcon className='absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400' />- <input- type='text'- placeholder={t('experiments.filterExperiments')}- value={filterQuery}- onChange={handleSearchChange}- className='w-full rounded-lg border-0 bg-white py-2 pr-4 pl-9 text-sm text-gray-900 placeholder-gray-500 ring-1 ring-gray-300 ring-inset focus:ring-slate-900 focus:outline-none sm:w-64 dark:bg-slate-950 dark:text-gray-50 dark:placeholder-gray-400 dark:ring-slate-700/80 dark:focus:ring-slate-300'- />- </div>+ <Input+ type='search'+ aria-label={t('experiments.filterExperiments')}+ placeholder={t('experiments.filterExperiments')}+ value={filterQuery}+ onChange={handleSearchChange}+ className='sm:w-64'+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ /><Button onClick={handleNewExperiment}><PlusIcon className='mr-1.5 size-4' />{t('experiments.create')}diff --git a/web/app/pages/Project/tabs/FeatureFlags/FeatureFlagsView.tsx b/web/app/pages/Project/tabs/FeatureFlags/FeatureFlagsView.tsxindex 860a18eb0..cc2983982 100644--- a/web/app/pages/Project/tabs/FeatureFlags/FeatureFlagsView.tsx+++ b/web/app/pages/Project/tabs/FeatureFlags/FeatureFlagsView.tsx@@ -59,6 +59,7 @@ import type {} from '~/routes/projects.$id'import { Badge } from '~/ui/Badge'import Button from '~/ui/Button'+import Input from '~/ui/Input'import Spin from '~/ui/icons/Spin'import LoadingBar from '~/ui/LoadingBar'import Modal from '~/ui/Modal'@@ -991,16 +992,15 @@ const FeatureFlagsViewInner = ({<>{/* Header with filter and add button */}<div className='mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between'>- <div className='relative'>- <MagnifyingGlassIcon className='absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400' />- <input- type='text'- placeholder={t('featureFlags.filterFlags')}- value={filterQuery}- onChange={handleSearchChange}- className='w-full rounded-lg border-0 bg-white py-2 pr-4 pl-9 text-sm text-gray-900 placeholder-gray-500 ring-1 ring-gray-300 ring-inset focus:ring-slate-900 focus:outline-none sm:w-64 dark:bg-slate-950 dark:text-gray-50 dark:placeholder-gray-400 dark:ring-slate-700/80 dark:focus:ring-slate-300'- />- </div>+ <Input+ type='search'+ aria-label={t('featureFlags.filterFlags')}+ placeholder={t('featureFlags.filterFlags')}+ value={filterQuery}+ onChange={handleSearchChange}+ className='sm:w-64'+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ /><Button onClick={handleNewFlag}><PlusIcon className='mr-1.5 size-4' />{t('featureFlags.addFlag')}diff --git a/web/app/pages/Project/tabs/Goals/GoalsView.tsx b/web/app/pages/Project/tabs/Goals/GoalsView.tsxindex c7f29c1f9..504766176 100644--- a/web/app/pages/Project/tabs/Goals/GoalsView.tsx+++ b/web/app/pages/Project/tabs/Goals/GoalsView.tsx@@ -58,6 +58,7 @@ import type {} from '~/routes/projects.$id'import BillboardChart from '~/ui/BillboardChart'import Button from '~/ui/Button'+import Input from '~/ui/Input'import Spin from '~/ui/icons/Spin'import LoadingBar from '~/ui/LoadingBar'import Modal from '~/ui/Modal'@@ -879,16 +880,15 @@ const GoalsViewInner = ({<>{/* Header with filter and add button */}<div className='mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between'>- <div className='relative'>- <MagnifyingGlassIcon className='absolute top-1/2 left-3 size-4 -translate-y-1/2 text-gray-400' />- <input- type='text'- placeholder={t('goals.filterGoals')}- value={filterQuery}- onChange={(e) => setFilterQuery(e.target.value)}- className='w-full rounded-lg border-0 bg-white py-2 pr-4 pl-9 text-sm text-gray-900 placeholder-gray-500 ring-1 ring-gray-300 ring-inset focus:ring-slate-900 focus:outline-none sm:w-64 dark:bg-slate-950 dark:text-gray-50 dark:placeholder-gray-400 dark:ring-slate-700/80 dark:focus:ring-slate-300'- />- </div>+ <Input+ type='search'+ aria-label={t('goals.filterGoals')}+ placeholder={t('goals.filterGoals')}+ value={filterQuery}+ onChange={(e) => setFilterQuery(e.target.value)}+ className='sm:w-64'+ leadingIcon={<MagnifyingGlassIcon className='size-4' />}+ /><Button onClick={handleNewGoal}><PlusIcon className='mr-1.5 size-4' />{t('goals.addGoal')}diff --git a/web/app/ui/Input.tsx b/web/app/ui/Input.tsxindex 5ce029f89..0d0993809 100644--- a/web/app/ui/Input.tsx+++ b/web/app/ui/Input.tsx@@ -9,10 +9,11 @@ import _isEmpty from 'lodash/isEmpty'import { EyeIcon, EyeSlashIcon } from '@phosphor-icons/react'import React, { memo, useState } from 'react'-interface InputProps {+interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {label?: React.ReactNodelabelCorner?: React.ReactNodehint?: React.ReactNode+ leadingIcon?: React.ReactNodeclassName?: stringerror?: string | null | booleandisabled?: boolean@@ -20,116 +21,146 @@ interface InputProps {hintPosition?: 'top' | 'bottom'classes?: {input?: string+ leadingIcon?: string}}// TODO: Merge className and classes-const Input = ({- label,- labelCorner,- hint,- className,- error,- disabled,- readOnly,- classes,- hintPosition = 'bottom',- ...rest-}: InputProps & React.InputHTMLAttributes<HTMLInputElement>) => {- const isError = !_isEmpty(error)- const type = rest.type || 'text'- const isPassword = type === 'password'- const [showPassword, setShowPassword] = useState(false)+const Input = React.forwardRef<HTMLInputElement, InputProps>(+ (+ {+ label,+ labelCorner,+ hint,+ leadingIcon,+ className,+ error,+ disabled,+ readOnly,+ classes,+ hintPosition = 'bottom',+ ...rest+ },+ ref,+ ) => {+ const isError = !_isEmpty(error)+ const type = rest.type || 'text'+ const isPassword = type === 'password'+ const hasLeadingIcon = Boolean(leadingIcon)+ const [showPassword, setShowPassword] = useState(false)- const { type: _type, ...restWithoutType } = rest+ const { type: _type, ...restWithoutType } = rest- const inputElement = (- <HeadlessInput- className={cx(- 'block w-full rounded-md border-0 bg-white px-3 py-2 text-sm text-gray-900 ring-1 transition-shadow duration-150 ease-out ring-inset placeholder:text-gray-400 focus:ring-2 focus:ring-slate-900 focus:outline-hidden dark:bg-slate-950 dark:text-gray-50 dark:placeholder:text-gray-500 dark:focus:ring-slate-300',- {- 'ring-red-500 placeholder:text-red-300 focus:ring-red-500 dark:ring-red-500/80 dark:focus:ring-red-400':- isError,- 'ring-gray-300 hover:ring-gray-400 dark:ring-slate-700/80 dark:hover:ring-slate-600':- !isError && !disabled && !readOnly,- 'cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200 dark:bg-slate-900 dark:text-gray-400 dark:ring-slate-800':- disabled,- 'cursor-default bg-gray-50 text-gray-700 ring-gray-200 dark:bg-slate-900/60 dark:text-gray-300 dark:ring-slate-800':- readOnly && !disabled,- 'pr-10': isPassword,- },- classes?.input,- )}- disabled={disabled}- readOnly={readOnly}- invalid={isError}- aria-invalid={isError || undefined}- {...restWithoutType}- type={isPassword && showPassword ? 'text' : type}- />- )+ const inputElement = (+ <HeadlessInput+ ref={ref}+ className={cx(+ 'block w-full rounded-md border-0 bg-white px-3 py-2 text-sm text-gray-900 ring-1 transition-shadow duration-150 ease-out ring-inset placeholder:text-gray-400 focus:ring-2 focus:ring-slate-900 focus:outline-hidden dark:bg-slate-950 dark:text-gray-50 dark:placeholder:text-gray-500 dark:focus:ring-slate-300',+ {+ 'ring-red-500 placeholder:text-red-300 focus:ring-red-500 dark:ring-red-500/80 dark:focus:ring-red-400':+ isError,+ 'ring-gray-300 hover:ring-gray-400 dark:ring-slate-700/80 dark:hover:ring-slate-600':+ !isError && !disabled && !readOnly,+ 'cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200 dark:bg-slate-900 dark:text-gray-400 dark:ring-slate-800':+ disabled,+ 'cursor-default bg-gray-50 text-gray-700 ring-gray-200 dark:bg-slate-900/60 dark:text-gray-300 dark:ring-slate-800':+ readOnly && !disabled,+ 'pl-10': hasLeadingIcon,+ 'pr-10': isPassword,+ },+ classes?.input,+ )}+ disabled={disabled}+ readOnly={readOnly}+ invalid={isError}+ aria-invalid={isError || undefined}+ {...restWithoutType}+ type={isPassword && showPassword ? 'text' : type}+ />+ )- return (- <Field as='div' className={className}>- {label || labelCorner ? (- <div className='mb-1 flex items-center justify-between gap-x-2'>- {label ? (- <Label className='flex text-sm font-medium text-gray-900 dark:text-gray-200'>- {label}- </Label>- ) : (- <span />- )}- {labelCorner ? <span className='text-sm'>{labelCorner}</span> : null}- </div>- ) : null}- {hint && hintPosition === 'top' ? (- <Description className='mt-1 text-sm whitespace-pre-line text-gray-500 dark:text-gray-400'>- {hint}- </Description>- ) : null}- {isPassword ? (+ const inputWithAdornments =+ hasLeadingIcon || isPassword ? (<div className='relative'>+ {hasLeadingIcon ? (+ <div+ aria-hidden='true'+ className={cx(+ 'pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-gray-400 dark:text-gray-500',+ classes?.leadingIcon,+ )}+ >+ {leadingIcon}+ </div>+ ) : null}{inputElement}- <button- type='button'- onClick={() => {- if (disabled || readOnly) return- setShowPassword(!showPassword)- }}- aria-label={showPassword ? 'Hide password' : 'Show password'}- aria-pressed={showPassword}- disabled={disabled || readOnly}- aria-disabled={disabled || readOnly || undefined}- tabIndex={disabled || readOnly ? -1 : 0}- className='absolute inset-y-0 right-0 my-1 mr-1 flex items-center rounded-md px-2 text-gray-400 transition-colors hover:text-gray-700 focus-visible:ring-2 focus-visible:ring-slate-900 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:text-gray-400 dark:text-gray-500 dark:hover:text-gray-200 dark:focus-visible:ring-slate-300 dark:disabled:hover:text-gray-500'- >- {showPassword ? (- <EyeSlashIcon className='size-4.5' />- ) : (- <EyeIcon className='size-4.5' />- )}- </button>+ {isPassword ? (+ <button+ type='button'+ onClick={() => {+ if (disabled || readOnly) return+ setShowPassword(!showPassword)+ }}+ aria-label={showPassword ? 'Hide password' : 'Show password'}+ aria-pressed={showPassword}+ disabled={disabled || readOnly}+ aria-disabled={disabled || readOnly || undefined}+ tabIndex={disabled || readOnly ? -1 : 0}+ className='absolute inset-y-0 right-0 my-1 mr-1 flex items-center rounded-md px-2 text-gray-400 transition-colors hover:text-gray-700 focus-visible:ring-2 focus-visible:ring-slate-900 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:text-gray-400 dark:text-gray-500 dark:hover:text-gray-200 dark:focus-visible:ring-slate-300 dark:disabled:hover:text-gray-500'+ >+ {showPassword ? (+ <EyeSlashIcon className='size-4.5' />+ ) : (+ <EyeIcon className='size-4.5' />+ )}+ </button>+ ) : null}</div>) : (inputElement- )}- {isError ? (- <p- className='mt-1.5 text-sm text-red-600 dark:text-red-400'- role='alert'- >- {error}- </p>- ) : null}- {hint && hintPosition === 'bottom' ? (- <Description className='mt-1.5 text-sm whitespace-pre-line text-gray-500 dark:text-gray-400'>- {hint}- </Description>- ) : null}- </Field>- )-}+ )++ return (+ <Field as='div' className={className}>+ {label || labelCorner ? (+ <div className='mb-1 flex items-center justify-between gap-x-2'>+ {label ? (+ <Label className='flex text-sm font-medium text-gray-900 dark:text-gray-200'>+ {label}+ </Label>+ ) : (+ <span />+ )}+ {labelCorner ? (+ <span className='text-sm'>{labelCorner}</span>+ ) : null}+ </div>+ ) : null}+ {hint && hintPosition === 'top' ? (+ <Description className='mt-1 text-sm whitespace-pre-line text-gray-500 dark:text-gray-400'>+ {hint}+ </Description>+ ) : null}+ {inputWithAdornments}+ {isError ? (+ <p+ className='mt-1.5 text-sm text-red-600 dark:text-red-400'+ role='alert'+ >+ {error}+ </p>+ ) : null}+ {hint && hintPosition === 'bottom' ? (+ <Description className='mt-1.5 text-sm whitespace-pre-line text-gray-500 dark:text-gray-400'>+ {hint}+ </Description>+ ) : null}+ </Field>+ )+ },+)++Input.displayName = 'Input'export default memo(Input)