From 0c43ae6effa7574886cd4009a4fee0ff10cea7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kre=C5=A1imir=20=C4=8Coko?= Date: Fri, 10 Apr 2020 14:09:08 +0200 Subject: [PATCH] chore(@clayui/localized-input): Add JSDoc --- packages/clay-localized-input/src/index.tsx | 46 ++++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/packages/clay-localized-input/src/index.tsx b/packages/clay-localized-input/src/index.tsx index 681891c0fa..7818817afb 100644 --- a/packages/clay-localized-input/src/index.tsx +++ b/packages/clay-localized-input/src/index.tsx @@ -20,22 +20,64 @@ interface ITranslations { } interface IProps extends React.InputHTMLAttributes { + /** + * Labels for the aria attributes + */ ariaLabels?: { default: string; openLocalizations: string; translated: string; untranslated: string; }; + + /** + * Add informational text at the top of Localized Input. + */ helpText?: React.ReactText; + + /** + * Label of the input + */ label?: React.ReactText; + + /** + * Content to be prepended in case you want to localize a URL. + */ prependContent?: React.ReactText; + + /** + * List of locales to allow localization for + */ locales: Array; + + /** + * Callback that gets called when a selected locale gets changed + */ onSelectedLocaleChange: (val: IItem) => void; + + /** + * Callback that gets called when a translation of the selected locale gets changed + */ onTranslationsChange: (val: ITranslations) => void; + + /** + * Allows specifying custom formatter, for example for formatting URLs, to be output after translating + */ resultFormatter?: (val: string) => React.ReactNode; + + /** + * Exposes the currently selected locale + */ selectedLocale: IItem; + + /** + * Path to the location of the spritemap resource. + */ spritemap?: string; - textarea?: boolean; + + /** + * Translations provided to the component to be used and modified by it + */ translations: ITranslations; } @@ -61,7 +103,7 @@ const ClayLocalizedInput = React.forwardRef( spritemap, translations, ...otherProps - }, + }: IProps, ref ) => { const [active, setActive] = React.useState(false);