Files
Ivan Vasilov 02cf09212e chore: Remove tsconfig paths (#49770)
This PR removes all `paths` in `tsconfig.json` for all apps and
packages. They were added previosly because some of the components had a
`_Shadcn` suffix because of an ongoing migration. How that the migration
is done, the paths can be removed.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Standardized shared UI component, utility, and icon imports across
design-system examples and application screens.
  * Simplified shared component access and project configuration.
  * Added shared access to anchor-link helpers and animation styles.

* **Compatibility**
* Updated component exports and imports without changing existing
behavior.
  * No changes to user-facing workflows, screens, or functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-01 13:13:30 +02:00

70 lines
2.3 KiB
TypeScript

import { HelpCircle } from 'lucide-react'
import Link from 'next/link'
import type { Control, FieldPath, FieldValues } from 'react-hook-form'
import { cn, FormControl, FormField, Input, InputVariants, Textarea } from 'ui'
import { Input as PasswordInput } from 'ui-patterns/DataInputs/Input'
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
import type { ServerOption } from './Wrappers.types'
interface InputFieldProps<TFieldValues extends FieldValues = FieldValues> {
option: ServerOption
control: Control<TFieldValues>
loading?: boolean
}
const InputField = <
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
>({
control,
option,
loading = false,
}: InputFieldProps<TFieldValues>) => {
return (
<FormField
control={control}
name={option.name as TName}
defaultValue={(option.defaultValue ?? '') as any}
render={({ field }) => (
<FormItemLayout
layout="vertical"
label={
<div className="flex items-center space-x-2">
<p>{option.label}</p>
{option.urlHelper !== undefined && (
<Link href={option.urlHelper} target="_blank" rel="noreferrer">
<span className="sr-only">Documentation</span>
<HelpCircle
strokeWidth={2}
size={14}
className="text-foreground-light hover:text-foreground cursor-pointer transition"
/>
</Link>
)}
</div>
}
labelOptional={!option.required ? 'Optional' : undefined}
description={option.description}
>
<FormControl>
{loading ? (
<span className={cn(InputVariants({ size: 'small' }))}>
Fetching value from Vault...
</span>
) : option.isTextArea ? (
<Textarea {...field} rows={6} className="input-mono resize-none" />
) : option.secureEntry ? (
<PasswordInput copy reveal {...field} />
) : (
<Input {...field} />
)}
</FormControl>
</FormItemLayout>
)}
/>
)
}
export default InputField