import * as React from 'react'; import { TextControl } from '@tesseract-design/web-base'; import clsx from 'clsx'; export type YearMonthInputDerivedElement = HTMLInputElement; export interface YearMonthInputProps extends Omit, 'size' | 'type' | 'label' | 'pattern'> { /** * Short textual description indicating the nature of the component's value. */ label?: React.ReactNode, /** * Short textual description as guidelines for valid input values. */ hint?: React.ReactNode, /** * Size of the component. */ size?: TextControl.Size, /** * Additional description, usually graphical, indicating the nature of the component's value. */ indicator?: React.ReactNode, /** * Should the component display a border? */ border?: boolean, /** * Should the component occupy the whole width of its parent? */ block?: boolean, /** * Style of the component. */ variant?: TextControl.Variant, /** * Is the label hidden? */ hiddenLabel?: boolean, } /** * Component for inputting textual values. */ export const YearMonthInput = React.forwardRef< YearMonthInputDerivedElement, YearMonthInputProps >(( { label, hint, indicator, size = 'medium' as const, border = false, block = false, variant = 'default' as const, hiddenLabel = false, className, id: idProp, style, ...etcProps }: YearMonthInputProps, forwardedRef, ) => { const labelId = React.useId(); const defaultId = React.useId(); const id = idProp ?? defaultId; // TODO render enhanced version return (
{label && ( <> {' '} )} {hint && (
{hint}
)} {indicator && (
{indicator}
)} {border && ( )}
); }); YearMonthInput.displayName = 'YearMonthInput'; YearMonthInput.defaultProps = { label: undefined, hint: undefined, size: 'medium', indicator: undefined, border: false, block: false, variant: 'default', hiddenLabel: false, };