InvokeAI/frontend/src/common/components/IAIInput.tsx

46 lines
1.0 KiB
TypeScript
Raw Normal View History

import { FormControl, FormLabel, Input, InputProps } from '@chakra-ui/react';
import { ChangeEvent } from 'react';
interface IAIInputProps extends InputProps {
styleClass?: string;
label?: string;
width?: string | number;
2022-12-24 20:28:59 +00:00
value?: string;
2022-12-26 15:07:40 +00:00
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
}
export default function IAIInput(props: IAIInputProps) {
const {
2022-12-24 20:28:59 +00:00
label = '',
styleClass,
isDisabled = false,
[WebUI] Localization Support (#2050) * Initial Localization Implementation * Fix Initial Spinner * Language Picker Dropdown * RU Localization Update Co-Authored-By: Artur <83028930+netsvetaev@users.noreply.github.com> * Fixed localization breaking themes * useUpdateTranslation Hook To force trigger translations for data objects * Localize Tab Data * Localize Prompt Input & Current Image Buttons * Localize Gallery & Bug FIxes Fix a bug where the delete image from the context menu wasn't working. Removed tooltips that were broken as they don't work in context menu. * Fix localization breaking in production * Add Toast Localization Support * Localize Unified Canvas * Localize WIP Tabs * Localize Hotkeys * Localize Settings * RU Localization Update Co-Authored-By: Artur <83028930+netsvetaev@users.noreply.github.com> * Add Support for Italian and Portuguese * Localize Toasts * Fix width of language picker items * Localize Backend Messages * Disable Debug Messages * Add Support for French * Fix missing localization for a string in the SettingsModal * Disable French * Styling updates to normalize text and accommodate other langs * Add Portuguese Brazilian * Fix Hotkey headers not being localized. * Fix styling issue on models tag in Settings * Fix Slider Styling to accommodate different languages * Fix slider styling in light mode. * Add German * Add Italian * Add Polish * Update Italian * Localized Frontend Build * Updated RU Translations * Fresh Build with updated RU changes * Bug Fixes and Loc Updates * Updated Frontend Build * Fresh Build Co-authored-by: Artur <83028930+netsvetaev@users.noreply.github.com>
2022-12-24 18:23:21 +00:00
fontSize = 'sm',
width,
isInvalid,
...rest
} = props;
return (
<FormControl
className={`input ${styleClass}`}
isInvalid={isInvalid}
isDisabled={isDisabled}
>
2022-12-26 15:07:40 +00:00
{label !== '' && (
<FormLabel
fontSize={fontSize}
fontWeight="bold"
alignItems="center"
whiteSpace="nowrap"
marginBottom={0}
marginRight={0}
className="input-label"
>
{label}
</FormLabel>
)}
<Input {...rest} className="input-entry" size={'sm'} width={width} />
</FormControl>
);
}