import { computed, inject, type ComputedRef, type InjectionKey } from "vue"; /** Semantic disabled scope, including controls with no native disabled attribute. */ export const disabledContextKey: InjectionKey> = Symbol("HeroUIVue.Disabled"); export function useInheritedDisabled(local: () => unknown = () => false) { const parent = inject(disabledContextKey, undefined); return computed(() => Boolean(local() || parent?.value)); }