diff --git a/package.json b/package.json index f60e025..c18ae22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/ui", - "version": "0.1.15", + "version": "0.1.16", "description": "Library of Internxt components", "repository": { "type": "git", @@ -98,4 +98,4 @@ "prettier --write" ] } -} +} \ No newline at end of file diff --git a/src/components/navigation/sidenav/Sidenav.tsx b/src/components/navigation/sidenav/Sidenav.tsx index 3986f93..cdcc014 100644 --- a/src/components/navigation/sidenav/Sidenav.tsx +++ b/src/components/navigation/sidenav/Sidenav.tsx @@ -39,6 +39,7 @@ export interface SidenavProps { showSubsections?: boolean; isCollapsed?: boolean; storage?: SidenavStorageProps; + notification?: ReactNode; onToggleCollapse?: () => void; } @@ -55,6 +56,7 @@ export interface SidenavProps { * @property {boolean} showSubsections - Determines whether to display the subsections of the sidenav * @property {boolean} isCollapsed - Determines whether the sidenav is collapsed or not * @property {SidenavStorage} storage - The storage information displayed at the bottom of the sidenav + * @property {ReactNode} notification - Optional notification node rendered above the storage section (hidden when collapsed) * @property {() => void} onToggleCollapse - A callback function triggered when the collapse button is clicked */ const Sidenav = ({ @@ -66,6 +68,7 @@ const Sidenav = ({ showSubsections, isCollapsed = false, storage, + notification, onToggleCollapse, }: SidenavProps) => { return ( @@ -94,18 +97,21 @@ const Sidenav = ({ - {storage && ( + {(notification || storage) && (
- + {notification &&
{notification}
} + {storage && ( + + )}
)} diff --git a/src/components/navigation/sidenav/__test__/__snapshots__/Sidenav.test.tsx.snap b/src/components/navigation/sidenav/__test__/__snapshots__/Sidenav.test.tsx.snap index f9c9a4d..4b12928 100644 --- a/src/components/navigation/sidenav/__test__/__snapshots__/Sidenav.test.tsx.snap +++ b/src/components/navigation/sidenav/__test__/__snapshots__/Sidenav.test.tsx.snap @@ -717,7 +717,7 @@ exports[`Sidenav Component > should match snapshot with storage 1`] = `