Skip to content

Commit

Permalink
fix: apply disabled text color to NavigationMenu trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-aberg authored Dec 11, 2024
1 parent 62f88ec commit b747baa
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/kit/src/navigation-menu/NavigationMenuTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const StyledNavigationMenuTrigger = styled(NavigationMenuPrimitive.Trigger, {
fontSize: theme.fontSizes["100"],
lineHeight: theme.lineHeights.meta,
padding: theme.space["050"],
"&:disabled": {
color: "$onDisabled",
},
});

export type NavigationMenuTriggerProps = {
Expand Down
56 changes: 56 additions & 0 deletions packages/kit/src/navigation-menu/play.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,62 @@ export const Vertical = {
render: VerticalTemplate,
};

const DisabledTemplate: StoryFn<typeof NavigationMenu.Root> = (args) => {
return (
<NavigationMenu.Root {...args}>
<NavigationMenu.List>
<NavigationMenu.Item>
<NavigationMenu.Link href="https://www.washingtonpost.com/election-results/2022/house/">
House
</NavigationMenu.Link>
</NavigationMenu.Item>
<NavigationMenu.Item>
<NavigationMenu.Link href="https://www.washingtonpost.com/election-results/2022/governors">
Governors
</NavigationMenu.Link>
</NavigationMenu.Item>
<NavigationMenu.Item>
<NavigationMenu.Trigger disabled>
Results By State
<Icon
label=""
size="150"
css={{
marginBlock: "-2px",
transition: `transform ${theme.transitions.fast} ${theme.transitions.inOut}`,
"[aria-expanded='true'] > &": {
transform: "rotate(-180deg)",
},
}}
>
<ChevronDown />
</Icon>
</NavigationMenu.Trigger>
<NavigationMenu.Content>
<NavigationMenu.Sub orientation="vertical">
<NavigationMenu.List>
<NavigationMenu.Item>
<NavigationMenu.Link href="#">Alabama</NavigationMenu.Link>
</NavigationMenu.Item>
<NavigationMenu.Item>
<NavigationMenu.Link href="#">Alaska</NavigationMenu.Link>
</NavigationMenu.Item>
<NavigationMenu.Item>
<NavigationMenu.Link href="#">Arizona</NavigationMenu.Link>
</NavigationMenu.Item>
</NavigationMenu.List>
</NavigationMenu.Sub>
</NavigationMenu.Content>
</NavigationMenu.Item>
</NavigationMenu.List>
</NavigationMenu.Root>
);
};

export const Disabled = {
render: DisabledTemplate,
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const InteractionsTemplate: StoryFn<any> = () => (
<NavigationMenu.Root>
Expand Down

0 comments on commit b747baa

Please sign in to comment.