diff --git a/package.json b/package.json index 50a7b7e..a031402 100644 --- a/package.json +++ b/package.json @@ -40,11 +40,11 @@ "access": "public" }, "dependencies": { - "@inubekit/stack": "^1.1.0", - "@inubekit/text": "^1.3.0", + "@inubekit/foundations": "^2.12.1", "@inubekit/grid": "^2.0.0", - "@inubekit/icon": "^1.1.0", - "@inubekit/foundations": "^1.1.2" + "@inubekit/icon": "^1.5.0", + "@inubekit/stack": "^2.1.1", + "@inubekit/text": "^2.2.0" }, "peerDependencies": { "react": "^18.2.0", diff --git a/src/Nav/index.tsx b/src/Nav/index.tsx index 430eed3..db08066 100644 --- a/src/Nav/index.tsx +++ b/src/Nav/index.tsx @@ -1,32 +1,16 @@ import { useLocation } from "react-router-dom"; import { MdLogout } from "react-icons/md"; -import { Text } from "@inubekit/text"; +import { ITextAppearance, Text } from "@inubekit/text"; import { Stack } from "@inubekit/stack"; +import { inube } from "@inubekit/foundations"; import { StyledNav, StyledFooter, SeparatorLine } from "./styles"; import { NavLink } from "../NavLink"; +import { ILink, INavNavigation } from "./props"; -interface INavLink { - section: ILink[]; -} - -interface ILink { - id: string; - label: string; - icon: React.ReactNode; - path: string; -} - -interface INavSection { - name: string; - links: { [key: string]: ILink }; -} - -interface INavNavigation { - title: string; - sections: { [key: string]: INavSection }; -} +import { useContext } from "react"; +import { ThemeContext } from "styled-components"; interface INav { navigation: INavNavigation; @@ -34,6 +18,10 @@ interface INav { logoutTitle: string; } +interface INavLink { + section: ILink[]; +} + const year = new Date().getFullYear(); const Links = (props: INavLink) => { @@ -57,6 +45,10 @@ const Links = (props: INavLink) => { const MultiSections = ({ navigation }: INav) => { const sections = Object.keys(navigation.sections); + const theme: typeof inube = useContext(ThemeContext); + const navTitleAppearance = + (theme?.nav?.title?.appearance as ITextAppearance) || + inube.nav.title.appearance; return ( @@ -69,7 +61,7 @@ const MultiSections = ({ navigation }: INav) => { { const Nav = (props: INav) => { const { navigation, logoutTitle, logoutPath } = props; - + const theme: typeof inube = useContext(ThemeContext); + const navSubtitleAppearance = + (theme?.nav?.subtitle?.appearance?.regular as ITextAppearance) || + inube.nav.subtitle.appearance.regular; + const navCopyrightAppearance = + (theme?.nav?.copyright?.appearance as ITextAppearance) || + inube.nav.copyright.appearance; return ( @@ -109,7 +107,7 @@ const Nav = (props: INav) => { { @@ -156,4 +154,4 @@ const Nav = (props: INav) => { }; export { Nav }; -export type { INav, INavLink, ILink, INavSection, INavNavigation }; +export type { INav }; diff --git a/src/Nav/props.ts b/src/Nav/props.ts index 49c4e9c..c339b1f 100644 --- a/src/Nav/props.ts +++ b/src/Nav/props.ts @@ -1,3 +1,20 @@ +interface ILink { + id: string; + label: string; + icon: React.ReactNode; + path: string; +} + +interface INavSection { + name: string; + links: { [key: string]: ILink }; +} + +interface INavNavigation { + title: string; + sections: { [key: string]: INavSection }; +} + const parameters = { layout: "fullscreen", docs: { @@ -20,3 +37,4 @@ const props = { }; export { parameters, props }; +export type { ILink, INavSection, INavNavigation }; diff --git a/src/Nav/stories/Nav.WithoutSections.stories.tsx b/src/Nav/stories/Nav.WithoutSections.stories.tsx deleted file mode 100644 index af9b53d..0000000 --- a/src/Nav/stories/Nav.WithoutSections.stories.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { BrowserRouter } from "react-router-dom"; -import { - MdKey, - MdMeetingRoom, - MdPhone, - MdBadge, - MdStarBorder, - MdAccountBalance, - MdAccountBalanceWallet, -} from "react-icons/md"; - -import { Nav, INav } from ".."; - -import { props } from "../props"; - -const story = { - title: "navigation/Nav", - components: Nav, - argTypes: props, - decorators: [ - (Story: React.ElementType) => ( - - - - ), - ], -}; - -const WithoutSections = (args: INav) =>