Skip to content

Commit

Permalink
Merge pull request #185 from brainstormforce/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
vrundakansara authored Nov 8, 2024
2 parents 66b33e3 + dc002a7 commit b9fbbe8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const InputComponent = (
};

const baseClasses =
'bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full outline outline-1 outline-border-subtle border-none';
'bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full outline outline-1 outline-border-subtle border-none transition-[color,box-shadow,outline] duration-200';
const sizeClasses = {
xs: 'px-2 py-1 rounded',
sm: 'p-3 py-2 rounded',
Expand Down
12 changes: 10 additions & 2 deletions src/components/menu-item/menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface MenuListProps extends BaseMenuProps {
export const MenuList = ( {
heading,
arrow = false,
showArrowOnHover = true, // Prop to toggle hover-based arrow display
showArrowOnHover = false, // Prop to toggle hover-based arrow display
open: initialOpen = true,
onClick,
children,
Expand Down Expand Up @@ -93,6 +93,14 @@ export const MenuList = ( {
hidden: { opacity: 0 },
};

const getArrowAnimationVariant = () => {
if ( ! showArrowOnHover ) {
return 'visible';
}

return isOpen || isHovered ? 'visible' : 'hidden';
};

return (
<div>
<div
Expand Down Expand Up @@ -128,7 +136,7 @@ export const MenuList = ( {
>
<motion.div
initial="hidden"
animate={ isOpen || isHovered ? 'visible' : 'hidden' }
animate={ getArrowAnimationVariant() }
exit="hidden"
variants={ arrowFadeVariants }
transition={ { duration: 0.15 } }
Expand Down

0 comments on commit b9fbbe8

Please sign in to comment.