diff --git a/apps/website/pages/_app.tsx b/apps/website/pages/_app.tsx index a00a12b6d8..8325d771f6 100644 --- a/apps/website/pages/_app.tsx +++ b/apps/website/pages/_app.tsx @@ -11,8 +11,7 @@ import "../global-styles.css"; import createCache, { EmotionCache } from "@emotion/cache"; import { CacheProvider } from "@emotion/react"; import Link from "next/link"; -import { GroupItem, Item, Section } from "../../../packages/lib/src/base-menu/types"; -import { isGroupItem } from "../../../packages/lib/src/base-menu/utils"; +import { DxcBaseGroupItem, DxcBaseItem, DxcBaseSection } from "@dxc-technology/halstack-react"; import SidenavLogo from "@/common/sidenav/SidenavLogo"; import { dxcLogo } from "@/common/images/dxc_logo"; @@ -24,6 +23,8 @@ type AppPropsWithLayout = AppProps & { emotionCache?: EmotionCache; }; +export const isGroupItem = (item: DxcBaseItem | DxcBaseGroupItem): item is DxcBaseGroupItem => "items" in item; + const clientSideEmotionCache = createCache({ key: "css", prepend: true }); export default function App({ Component, pageProps, emotionCache = clientSideEmotionCache }: AppPropsWithLayout) { @@ -39,7 +40,7 @@ export default function App({ Component, pageProps, emotionCache = clientSideEmo return pathToBeMatched ? desiredPaths.includes(pathToBeMatched) : false; }; - const createNavItem = (link: LinkDetails): Item => ({ + const createNavItem = (link: LinkDetails): DxcBaseItem => ({ label: link.label, href: link.path, selected: matchPaths(link.path), @@ -52,7 +53,7 @@ export default function App({ Component, pageProps, emotionCache = clientSideEmo ), }); - const normalizeNavTabs = (links: (LinkDetails | LinksSectionDetails)[]): (Item | GroupItem)[] => { + const normalizeNavTabs = (links: (LinkDetails | LinksSectionDetails)[]): (DxcBaseItem | DxcBaseGroupItem)[] => { return links.map((link) => { if ("links" in link) { return { @@ -66,8 +67,8 @@ export default function App({ Component, pageProps, emotionCache = clientSideEmo }); }; - const filterNavTree = (items: (Item | GroupItem)[], q: string): (Item | GroupItem)[] => { - const result: (Item | GroupItem)[] = []; + const filterNavTree = (items: (DxcBaseItem | DxcBaseGroupItem)[], q: string): (DxcBaseItem | DxcBaseGroupItem)[] => { + const result: (DxcBaseItem | DxcBaseGroupItem)[] = []; for (const item of items) { if (isGroupItem(item)) { @@ -87,7 +88,7 @@ export default function App({ Component, pageProps, emotionCache = clientSideEmo return result; }; - const navItems: Section[] = useMemo(() => { + const navItems: DxcBaseSection[] = useMemo(() => { const q = filter.trim().toLowerCase(); return LinksSections.map((section) => { diff --git a/apps/website/screens/common/pagesList.tsx b/apps/website/screens/common/pagesList.tsx index 59a58c4ae1..8a5341d47e 100644 --- a/apps/website/screens/common/pagesList.tsx +++ b/apps/website/screens/common/pagesList.tsx @@ -1,4 +1,4 @@ -import { SVG } from "../../../../packages/lib/src/common/utils"; +import type { DxcSVG } from "@dxc-technology/halstack-react"; import componentsList from "./componentsList.json"; export type ComponentStatus = "experimental" | "new" | "stable" | "legacy" | "deprecated"; @@ -7,13 +7,13 @@ export type LinkDetails = { label: string; path: string; status?: ComponentStatus; - icon?: string | SVG; + icon?: string | DxcSVG; }; export type LinksSectionDetails = { label: string; links: (LinkDetails | LinksSectionDetails)[]; - icon?: string | SVG; + icon?: string | DxcSVG; }; type NavigationLinks = { diff --git a/apps/website/screens/components/message-input/overview/MessageInputOverviewPage.tsx b/apps/website/screens/components/message-input/overview/MessageInputOverviewPage.tsx index 4bed803f27..d301b0cb91 100644 --- a/apps/website/screens/components/message-input/overview/MessageInputOverviewPage.tsx +++ b/apps/website/screens/components/message-input/overview/MessageInputOverviewPage.tsx @@ -1,8 +1,6 @@ import QuickNavContainer from "@/common/QuickNavContainer"; -import DxcFlex from "../../../../../../packages/lib/src/flex/Flex"; import DocFooter from "@/common/DocFooter"; -import DxcParagraph from "../../../../../../packages/lib/src/paragraph/Paragraph"; -import { DxcBulletedList } from "@dxc-technology/halstack-react"; +import { DxcBulletedList, DxcParagraph, DxcFlex } from "@dxc-technology/halstack-react"; import Figure from "@/common/Figure"; import Image from "@/common/Image"; import messageInputAnatomy from "./images/message-input-anatomy.png"; diff --git a/apps/website/screens/foundations/tokens/tables/TokensTable.tsx b/apps/website/screens/foundations/tokens/tables/TokensTable.tsx index 968632bf5c..e878376b49 100644 --- a/apps/website/screens/foundations/tokens/tables/TokensTable.tsx +++ b/apps/website/screens/foundations/tokens/tables/TokensTable.tsx @@ -1,6 +1,6 @@ import { TableCode } from "@/common/Code"; import { DxcTable } from "@dxc-technology/halstack-react"; -import { aliasTokens, coreTokens } from "../../../../../../packages/lib/src/styles/tokens"; +import { DxcAliasTokens, DxcCoreTokens } from "@dxc-technology/halstack-react"; import getTokensByCategory from "./utils/mapCategory"; const TokensTable = ({ categories, type }: { categories: string[]; type: "alias" | "core" }) => ( @@ -12,7 +12,12 @@ const TokensTable = ({ categories, type }: { categories: string[]; type: "alias"
- {getTokensByCategory(type === "alias" ? aliasTokens : coreTokens, categories).map(([token, value]) => ( + {getTokensByCategory( + type === "alias" + ? (DxcAliasTokens as Record