feat: add Fieldset and SearchField infrastructure

This commit is contained in:
maoyingjie
2026-10-22 08:46:02 +08:00
parent 116056832c
commit a4fb3c550a
59 changed files with 3131 additions and 331 deletions
@@ -0,0 +1,9 @@
import { computed, inject, type ComputedRef, type InjectionKey } from "vue";
/** Semantic disabled scope, including controls with no native disabled attribute. */
export const disabledContextKey: InjectionKey<ComputedRef<boolean>> =
Symbol("HeroUIVue.Disabled");
export function useInheritedDisabled(local: () => unknown = () => false) {
const parent = inject(disabledContextKey, undefined);
return computed(() => Boolean(local() || parent?.value));
}