import { createEffect, createSignal } from "solid-js"; import type { PropsLike } from "../merge-props-n"; import { createStableCallback } from "../stable-callback"; import { useFocusableWhenDisabled } from "../use-focusable-when-disabled"; /** * Accessor-or-value input. Consumers may pass a plain boolean/number or a * reactive accessor; we always coerce via `read()` at call time. */ type MaybeAccessor = T | (() => T); function read(value: MaybeAccessor): T { return typeof value === "function" ? (value as () => T)() : value; } /** * Parameters for {@link useButton}. Each flag may be a plain value or an * accessor so consumers can thread reactive state in without us having to * re-create the primitive on every change. */ export interface UseButtonOptions { /** * Whether the component should ignore user interaction. * @default false */ disabled?: MaybeAccessor | undefined; /** * Whether the button may receive focus even if it is disabled. * @default false */ focusableWhenDisabled?: MaybeAccessor | undefined; /** * `tabindex` when non-composite. Ignored when `composite` is true. * @default 0 */ tabIndex?: MaybeAccessor | undefined; /** * Whether the component is being rendered as a native `