import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Specify the value of the radio button. * @default "" */ value?: Value; /** * Set to `true` to check the radio button. * Follows the radio button when the owning form resets. * @default false */ checked?: boolean; /** * Set to `true` to disable the radio button * @default false */ disabled?: boolean; /** * Set to `true` for the radio button to be read-only * @default false */ readonly?: boolean; /** * Specify the assistive text announced to screen readers when read-only. * Exposed because VoiceOver does not announce `aria-readonly`, and ARIA * does not support `aria-readonly` on role "radio" at all. * @default "Read-only" */ readonlyText?: string; /** * Set to `true` to mark the field as required * @default false */ required?: boolean; /** * Specify the label position. * @default "right" */ labelPosition?: "right" | "left"; /** * Specify the label text * @default "" */ labelText?: string; /** * Set to `true` to visually hide the label text * @default false */ hideLabel?: boolean; /** * Set an id for the input element * @default uniqueId() */ id?: string; /** * Specify a name attribute for the radio button input. * When multiple standalone RadioButton components share the same `name`, * they form an implicit group and their `checked` state will be synchronized. */ name?: string | undefined; /** * Specify the id of a form element outside the component to associate * the radio input with. */ form?: string | undefined; /** * Obtain a reference to the input HTML element. * @default null */ ref?: null | HTMLInputElement; decorator?: (this: void) => void; labelChildren?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type RadioButtonProps = Omit<$RestProps, keyof $Props> & $Props; export default class RadioButton extends SvelteComponentTyped< RadioButtonProps, { blur: WindowEventMap["blur"]; change: WindowEventMap["change"]; focus: WindowEventMap["focus"]; }, { decorator: Record; labelChildren: Record; } > {}