UNPKG

@hashicorp/design-system-components

Version:
48 lines (47 loc) 1.9 kB
/** * Copyright IBM Corp. 2021, 2025 * SPDX-License-Identifier: MPL-2.0 */ import Component from '@glimmer/component'; import type { WithBoundArgs } from '@glint/template'; import { HdsFormFieldLayoutValues } from './types.ts'; import HdsFormLabel from '../label/index'; import HdsFormHelperText from '../helper-text/index'; import HdsFormCharacterCount from '../character-count/index'; import HdsFormError from '../error/index'; import HdsYield from '../../yield/index'; import type { HdsFormFieldLayouts } from './types.ts'; export declare const LAYOUT_TYPES: HdsFormFieldLayoutValues[]; export interface HdsFormFieldSignature { Args: { id?: string; extraAriaDescribedBy?: string; contextualClass?: string; isOptional?: boolean; isRequired?: boolean; layout?: HdsFormFieldLayouts; }; Blocks: { default: [ { Label?: WithBoundArgs<typeof HdsFormLabel, 'contextualClass' | 'controlId' | 'isRequired' | 'isOptional'>; HelperText?: WithBoundArgs<typeof HdsFormHelperText, 'contextualClass' | 'controlId' | 'onInsert'>; Control?: typeof HdsYield; CharacterCount?: WithBoundArgs<typeof HdsFormCharacterCount, 'contextualClass' | 'controlId' | 'onInsert'>; Error?: WithBoundArgs<typeof HdsFormError, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'>; id?: string; ariaDescribedBy?: string; } ]; }; Element: HTMLElement; } export default class HdsFormField extends Component<HdsFormFieldSignature> { get layout(): HdsFormFieldLayouts | undefined; get id(): string; get isRequired(): boolean; get isOptional(): boolean; get classNames(): string; appendDescriptor: (element: HTMLElement) => void; removeDescriptor: (element: HTMLElement) => void; }