@hashicorp/design-system-components
Version:
Helios Design System Components
68 lines (67 loc) • 2.25 kB
TypeScript
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import HdsFormLegendComponent from '../legend/index.ts';
import HdsFormHelperTextComponent from '../helper-text/index.ts';
import HdsFormErrorComponent from '../error/index.ts';
import type { ComponentLike, WithBoundArgs } from '@glint/template';
import type { HdsFormFieldsetLayouts } from './types.ts';
import type { HdsYieldSignature } from '../../yield/index.ts';
export declare const LAYOUT_TYPES: HdsFormFieldsetLayouts[];
export interface HdsFormFieldsetSignature {
Args: {
extraAriaDescribedBy?: string;
isOptional?: boolean;
isRequired?: boolean;
layout?: HdsFormFieldsetLayouts;
};
Blocks: {
default: [
{
Legend?: WithBoundArgs<typeof HdsFormLegendComponent, 'contextualClass' | 'isRequired' | 'isOptional'>;
HelperText?: WithBoundArgs<typeof HdsFormHelperTextComponent, 'contextualClass' | 'controlId' | 'onInsert'>;
Control?: ComponentLike<HdsYieldSignature>;
Error?: WithBoundArgs<typeof HdsFormErrorComponent, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove'>;
id?: string;
ariaDescribedBy?: string;
}
];
};
Element: HTMLElement;
}
export default class HdsFormFieldset extends Component<HdsFormFieldsetSignature> {
/**
* Sets the layout of the group
*
* @param layout
* @type {enum}
* @default 'vertical'
*/
get layout(): HdsFormFieldsetLayouts;
/**
* Calculates the unique ID to assign to the fieldset
*/
get id(): string;
/**
* @param isRequired
* @type {boolean}
* @default false
*/
get isRequired(): boolean;
/**
* @param isOptional
* @type {boolean}
* @default false
*/
get isOptional(): boolean;
/**
* Get the class names to apply to the component.
* @method classNames
* @return {string} The "class" attribute to apply to the component.
*/
get classNames(): string;
appendDescriptor(element: HTMLElement): void;
removeDescriptor(element: HTMLElement): void;
}