import type { Component, Snippet } from 'svelte'; import type { ValidationContext, ValidationResult } from '../../utils/validation'; export type CheckboxGroupValidator = (context: ValidationContext) => ValidationResult; export type Option = string | ({ label: string; value: string } & Record); export type Props = { /** Configuration key and HTML name attribute. */ name?: string; /** Checkbox options, supplied as strings or objects with `label` and `value`. */ options?: Option[]; /** Group legend, a string or Svelte snippet. */ legend?: string | Snippet; /** Field label, a string or Svelte snippet. */ label?: string | Snippet; /** Description shown below the field, a string or Svelte snippet. */ description?: string | Snippet; /** Visually hides the legend while keeping it available to assistive technology. */ legendVisuallyHidden?: boolean; /** Disables the group, or the listed option values. */ disabled?: boolean | string[]; /** Set the field as required. */ required?: boolean; /** Shows or hides the group without destroying it. */ show?: boolean; /** Selected option values. */ value?: string[]; /** CSS class added to the form-group wrapper. */ class?: string; /** Renders an individual option. */ option?: Snippet<[option: Option]>; /** Content rendered after the group and validation message. */ children?: Snippet; /** Callback for the native input event with the updated value. */ onInput?: (value: string[], event: Event) => void | Promise; /** Callback for the native change event with the updated value. */ onChange?: (value: string[], event: Event) => void | Promise; /** Custom validator. */ validate?: CheckboxGroupValidator; }; /** * A checkbox group component. * See [Readme](https://docs.soleil.se/packages/config-svelte/components/checkboxgroup/). */ declare const CheckboxGroup: Component; export default CheckboxGroup;