Skip to main content
Glama
deleonio
by deleonio
TextArea.tsx1.51 kB
import { h, type FunctionalComponent as FC } from '@stencil/core'; import type { JSXBase } from '@stencil/core/internal'; import clsx from 'clsx'; import { checkHasMsg, type MsgPropType, type Stringified } from '../../../schema'; import { getDefaultProps } from '../_helpers/getDefaultProps'; import type { DefaultInputProps } from '../_types'; export type TextAreaProps = DefaultInputProps<JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement>> & { value: string; touched?: boolean; msg?: Stringified<MsgPropType>; } & { [key: `aria-${string}`]: unknown; [key: `data-${string}`]: unknown; }; const TextAreaFc: FC<TextAreaProps> = (props) => { const { class: classNames, msg, touched, readonly, disabled, required, ariaDescribedBy, hideLabel, label, ...other } = props; const showMsg = checkHasMsg(msg, touched); const msgType = typeof msg === 'string' ? 'error' : msg?._type; const stateCssClasses = { ['kol-textarea--disabled']: Boolean(disabled), ['kol-textarea--required']: Boolean(required), ['kol-textarea--touched']: Boolean(touched), ['kol-textarea--readonly']: Boolean(readonly), [`kol-textarea--${msgType || 'error'}`]: showMsg, }; const inputProps: JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement> = { class: clsx('kol-textarea', stateCssClasses, classNames), required: required, disabled: disabled, readonly: readonly, ...getDefaultProps({ ariaDescribedBy, hideLabel, label }), ...other, }; return <textarea {...inputProps} />; }; export default TextAreaFc;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server