feat: migrate button groups and toggle buttons with focus regressions

This commit is contained in:
maoyingjie
2026-10-23 09:57:41 +08:00
parent 99df0f1c91
commit 9c93647ad2
61 changed files with 4535 additions and 10 deletions
+92
View File
@@ -1056,3 +1056,95 @@ export type TabsVariants = Omit<
VariantProps<typeof tabsVariants>,
TabsRenderPropsKeys
>;
export const buttonGroupVariants = tv({
defaultVariants: {
fullWidth: false,
orientation: "horizontal",
},
slots: {
base: "hv-button-group",
separator: "hv-button-group__separator",
},
variants: {
fullWidth: {
false: {},
true: {
base: "hv-button-group--full-width",
},
},
orientation: {
horizontal: {
base: "hv-button-group--horizontal",
},
vertical: {
base: "hv-button-group--vertical",
},
},
},
});
export type ButtonGroupVariants = VariantProps<typeof buttonGroupVariants>;
export const toggleButtonVariants = tv({
base: "hv-toggle-button",
defaultVariants: {
isIconOnly: false,
size: "md",
variant: "default",
},
variants: {
isIconOnly: {
true: "hv-toggle-button--icon-only",
},
size: {
lg: "hv-toggle-button--lg",
md: "hv-toggle-button--md",
sm: "hv-toggle-button--sm",
},
variant: {
default: "hv-toggle-button--default",
ghost: "hv-toggle-button--ghost",
},
},
});
export type ToggleButtonVariants = VariantProps<typeof toggleButtonVariants>;
export const toggleButtonGroupVariants = tv({
defaultVariants: {
fullWidth: false,
isDetached: false,
orientation: "horizontal",
},
slots: {
base: "hv-toggle-button-group",
separator: "hv-toggle-button-group__separator",
},
variants: {
fullWidth: {
false: {},
true: {
base: "hv-toggle-button-group--full-width",
},
},
isDetached: {
false: {},
true: {
base: "hv-toggle-button-group--detached",
},
},
orientation: {
horizontal: {
base: "hv-toggle-button-group--horizontal",
},
vertical: {
base: "hv-toggle-button-group--vertical",
},
},
},
});
export type ToggleButtonGroupVariants = VariantProps<
typeof toggleButtonGroupVariants
>;