UNPKG

@melt-ui/svelte

Version:
67 lines (66 loc) 4.93 kB
/// <reference types="svelte" /> import type { MeltActionReturn } from '../../internal/types.js'; import type { RadioGroupEvents } from './events.js'; import type { CreateRadioGroupProps, RadioGroupItemProps } from './types.js'; export declare function createRadioGroup(props?: CreateRadioGroupProps): { elements: { root: import("../../internal/helpers/index.js").MeltElement<[import("../../internal/helpers/index.js").WithGet<import("svelte/store").Writable<boolean>>, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Writable<import("../../internal/types.js").Orientation>>], import("svelte/action").Action<any, any, Record<never, any>>, ([$required, $orientation]: [boolean, import("../../internal/types.js").Orientation]) => { readonly role: "radiogroup"; readonly 'aria-required': boolean; readonly 'data-orientation': import("../../internal/types.js").Orientation; }, string>; item: import("../../internal/helpers/index.js").MeltElement<[{ update: (updater: import("svelte/store").Updater<string>, sideEffect?: ((newValue: string) => void) | undefined) => void; set: (this: void, value: string) => void; subscribe(this: void, run: import("svelte/store").Subscriber<string>, invalidate?: import("svelte/store").Invalidator<string> | undefined): import("svelte/store").Unsubscriber; get: () => string; destroy?: (() => void) | undefined; }, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Writable<import("../../internal/types.js").Orientation>>, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Writable<boolean>>], (node: HTMLElement) => MeltActionReturn<RadioGroupEvents['item']>, ([$value, $orientation, $disabled]: [string, import("../../internal/types.js").Orientation, boolean]) => (props: RadioGroupItemProps) => { readonly disabled: boolean; readonly 'data-value': string; readonly 'data-orientation': import("../../internal/types.js").Orientation; readonly 'data-disabled': true | undefined; readonly 'data-state': "checked" | "unchecked"; readonly 'aria-checked': boolean; readonly type: "button"; readonly role: "radio"; readonly tabindex: 0 | -1; }, string>; hiddenInput: import("../../internal/helpers/index.js").MeltElement<[import("../../internal/helpers/index.js").WithGet<import("svelte/store").Readable<string>>, import("svelte/motion").Readable<string | undefined>, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Readable<boolean>>, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Readable<boolean>>, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Readable<import("svelte/elements.js").HTMLInputTypeAttribute | null | undefined>>, import("../../internal/helpers/index.js").WithGet<import("svelte/store").Readable<boolean | undefined>>], (node: HTMLInputElement) => { destroy: () => void; }, ([$value, $name, $disabled, $required, $type, $checked]: [string, string | undefined, boolean, boolean, import("svelte/elements.js").HTMLInputTypeAttribute | null | undefined, boolean | undefined]) => { readonly name: string | undefined; readonly value: string; readonly 'aria-hidden': "true"; readonly hidden: true; readonly disabled: boolean; readonly required: boolean; readonly tabIndex: -1; readonly type: import("svelte/elements.js").HTMLInputTypeAttribute | null | undefined; readonly checked: boolean | undefined; readonly style: string; }, string>; }; states: { value: { update: (updater: import("svelte/store").Updater<string>, sideEffect?: ((newValue: string) => void) | undefined) => void; set: (this: void, value: string) => void; subscribe(this: void, run: import("svelte/store").Subscriber<string>, invalidate?: import("svelte/store").Invalidator<string> | undefined): import("svelte/store").Unsubscriber; get: () => string; destroy?: (() => void) | undefined; }; }; helpers: { isChecked: import("svelte/store").Readable<(itemValue: string) => boolean>; }; options: import("../../internal/helpers/index.js").ToWritableStores<Omit<{ disabled: boolean; required: boolean; name: string | undefined; loop: boolean; orientation: import("../../internal/types.js").Orientation; defaultValue: string | undefined; value?: import("svelte/store").Writable<string> | undefined; onValueChange?: import("../../internal/helpers/index.js").ChangeFn<string> | undefined; }, "value">>; };