feat: migrate button groups and toggle buttons with focus regressions
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import type { ComputedRef, InjectionKey } from "vue";
|
||||
import type { ButtonVariants, buttonGroupVariants } from "@heroui-vue/styles";
|
||||
|
||||
/** Marks direct children of ButtonGroup so nested Buttons do not inherit group props. */
|
||||
export const BUTTON_GROUP_CHILD = "__button_group_child" as const;
|
||||
|
||||
export type ButtonGroupSlots = ReturnType<typeof buttonGroupVariants>;
|
||||
|
||||
export interface ButtonGroupContextValue {
|
||||
slots: ButtonGroupSlots;
|
||||
size?: ButtonVariants["size"];
|
||||
variant?: ButtonVariants["variant"];
|
||||
isDisabled?: boolean;
|
||||
fullWidth?: boolean;
|
||||
orientation: "horizontal" | "vertical";
|
||||
}
|
||||
|
||||
export type ButtonGroupContext = ComputedRef<ButtonGroupContextValue>;
|
||||
|
||||
export const buttonGroupContextKey: InjectionKey<ButtonGroupContext> = Symbol(
|
||||
"HeroUIVue.ButtonGroup",
|
||||
);
|
||||
|
||||
/** Orientation inherited by ButtonGroup when nested in ToggleButtonGroup. */
|
||||
export const buttonGroupOrientationKey: InjectionKey<
|
||||
ComputedRef<"horizontal" | "vertical">
|
||||
> = Symbol("HeroUIVue.ButtonGroupOrientation");
|
||||
Reference in New Issue
Block a user