9207d7bb95
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
583 B
TypeScript
18 lines
583 B
TypeScript
import type {ComputedRef, InjectionKey} from 'vue'
|
|
|
|
export type RadioValue = string | number | boolean | null | undefined
|
|
|
|
export interface RadioGroupContext {
|
|
name: ComputedRef<string>
|
|
isSelected: (value: RadioValue) => boolean
|
|
select: (value: RadioValue) => void
|
|
hasError: ComputedRef<boolean>
|
|
hasSuccess: ComputedRef<boolean>
|
|
disabled: ComputedRef<boolean>
|
|
readonly: ComputedRef<boolean>
|
|
required: ComputedRef<boolean>
|
|
describedBy: ComputedRef<string | undefined>
|
|
}
|
|
|
|
export const radioGroupContextKey: InjectionKey<RadioGroupContext> = Symbol('MalioRadioGroup')
|