feat: migrate ScrollShadow and Tabs with docs and keyboard support

This commit is contained in:
maoyingjie
2026-10-23 00:25:45 +08:00
parent 2b4ac04df1
commit 99df0f1c91
55 changed files with 3290 additions and 5 deletions
+78
View File
@@ -978,3 +978,81 @@ export const tooltipVariants = tv({
});
export type TooltipVariants = VariantProps<typeof tooltipVariants>;
export const scrollShadowVariants = tv({
defaultVariants: {
hideScrollBar: false,
orientation: "vertical",
variant: "fade",
},
slots: {
base: "hv-scroll-shadow",
},
variants: {
hideScrollBar: {
false: {},
true: {
base: "hv-scroll-shadow--hide-scrollbar",
},
},
orientation: {
horizontal: {
base: "hv-scroll-shadow--horizontal",
},
vertical: {
base: "hv-scroll-shadow--vertical",
},
},
variant: {
fade: {
base: "hv-scroll-shadow--fade",
},
},
},
});
export type ScrollShadowVariants = VariantProps<typeof scrollShadowVariants>;
export const tabsVariants = tv({
defaultVariants: {
align: "center",
variant: "primary",
},
slots: {
base: "hv-tabs",
scrollNext: "hv-tabs__list-container__scroll-next",
scrollPrev: "hv-tabs__list-container__scroll-prev",
scroller: "hv-tabs__list-container__scroller",
separator: "hv-tabs__separator",
tab: "hv-tabs__tab",
tabIndicator: "hv-tabs__indicator",
tabList: "hv-tabs__list",
tabListContainer: "hv-tabs__list-container",
tabPanel: "hv-tabs__panel",
},
variants: {
align: {
center: {}, // No class as the base already centers tab content
end: {
base: "hv-tabs--align-end",
},
start: {
base: "hv-tabs--align-start",
},
},
variant: {
primary: {},
secondary: {
base: "hv-tabs--secondary",
},
},
},
});
// Render props that should be excluded from TabsVariants (framework-specific)
type TabsRenderPropsKeys = "selectedKey";
export type TabsVariants = Omit<
VariantProps<typeof tabsVariants>,
TabsRenderPropsKeys
>;