Skip to content

Commit

Permalink
feat(verticalNav): add icon variations property in vertical nav compo…
Browse files Browse the repository at this point in the history
…nent
  • Loading branch information
anuradha9712 committed Sep 15, 2023
1 parent b1b6424 commit 828a706
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/components/organisms/verticalNav/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ export const MenuItem = (props: MenuItemProps) => {
<Link componentType="a" className={ItemClass} {...baseProps}>
<div className="d-flex align-items-center overflow-hidden">
{menu.icon && (
<Icon data-test="DesignSystem-VerticalNav--Icon" className={expanded ? 'mr-4' : ''} name={menu.icon} />
<Icon
data-test="DesignSystem-VerticalNav--Icon"
className={expanded ? 'mr-4' : ''}
name={menu.icon}
variations={menu.iconVariations}
/>
)}
{expanded && <MenuLabel label={menu.label} labelColor={itemColor} />}
</div>
Expand Down
7 changes: 7 additions & 0 deletions core/components/organisms/verticalNav/VerticalNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export interface VerticalNavProps extends BaseProps {
* count?: number;
* subMenu?: Menu[];
* icon?: string;
* iconVariations?: {
* fill?: number;
* weight?: number; Range: [100, 700]
* grade?: number; Range: [-25, 200]
* opticalSize?: number; Range: [20px, 48px]
* };
* };
* </pre>
*
Expand All @@ -32,6 +38,7 @@ export interface VerticalNavProps extends BaseProps {
* | group | Section of menu | |
* | subMenu | Menu submenus of type `Menu[]` | |
* | icon | Menu icon | |
* | iconVariations | Set font-variation-settings CSS property for Icons ||
*/
menus: Menu[];
/**
Expand Down
3 changes: 3 additions & 0 deletions core/utils/navigationHelper.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { FontVariationType } from '@/common.type';

export type Menu = {
name: string;
label: string;
Expand All @@ -7,6 +9,7 @@ export type Menu = {
count?: number;
disabled?: boolean;
subMenu?: Menu[];
iconVariations?: FontVariationType;
};

export type ActiveMenu = ({ name: string } | { link: string }) & Partial<Menu>;
Expand Down

0 comments on commit 828a706

Please sign in to comment.