diff --git a/apps/website/pages/components/contextual-menu/code.tsx b/apps/website/pages/components/contextual-menu/code.tsx
new file mode 100644
index 0000000000..265615d2ad
--- /dev/null
+++ b/apps/website/pages/components/contextual-menu/code.tsx
@@ -0,0 +1,17 @@
+import Head from "next/head";
+import type { ReactElement } from "react";
+import ContextualMenuPageLayout from "screens/components/contextual-menu/ContextualMenuPageLayout";
+import ContextualMenuCodePage from "screens/components/contextual-menu/code/ContextualMenuCodePage";
+
+const Code = () => (
+ <>
+
+ Contextual Menu Code — Halstack Design System
+
+
+ >
+);
+
+Code.getLayout = (page: ReactElement) => {page};
+
+export default Code;
diff --git a/apps/website/pages/components/contextual-menu/index.tsx b/apps/website/pages/components/contextual-menu/index.tsx
index 616e6a7067..9cfdf09f6a 100644
--- a/apps/website/pages/components/contextual-menu/index.tsx
+++ b/apps/website/pages/components/contextual-menu/index.tsx
@@ -1,21 +1,17 @@
import Head from "next/head";
import type { ReactElement } from "react";
-import ContextualMenuCodePage from "screens/components/contextual-menu/code/ContextualMenuCodePage";
+import ContextualMenuOverviewPage from "screens/components/contextual-menu/overview/ContextualMenuOverviewPage";
import ContextualMenuPageLayout from "screens/components/contextual-menu/ContextualMenuPageLayout";
-const Usage = () => {
- return (
- <>
-
- Contextual Menu — Halstack Design System
-
-
- >
- );
-};
+const Usage = () => (
+ <>
+
+ Contextual Menu — Halstack Design System
+
+
+ >
+);
-Usage.getLayout = function getLayout(page: ReactElement) {
- return {page};
-};
+Usage.getLayout = (page: ReactElement) => {page};
export default Usage;
diff --git a/apps/website/pages/components/contextual-menu/specifications.tsx b/apps/website/pages/components/contextual-menu/specifications.tsx
deleted file mode 100644
index 0c92317af0..0000000000
--- a/apps/website/pages/components/contextual-menu/specifications.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import Head from "next/head";
-import type { ReactElement } from "react";
-import ContextualMenuSpecsPage from "screens/components/contextual-menu/specs/ContextualMenuSpecsPage";
-import ContextualMenuPageLayout from "screens/components/contextual-menu/ContextualMenuPageLayout";
-
-const Specifications = () => {
- return (
- <>
-
- Contextual Menu Specs — Halstack Design System
-
-
- >
- );
-};
-
-Specifications.getLayout = function getLayout(page: ReactElement) {
- return {page};
-};
-
-export default Specifications;
diff --git a/apps/website/pages/components/contextual-menu/usage.tsx b/apps/website/pages/components/contextual-menu/usage.tsx
deleted file mode 100644
index d2d652977e..0000000000
--- a/apps/website/pages/components/contextual-menu/usage.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import Head from "next/head";
-import type { ReactElement } from "react";
-import ContextualMenuPageLayout from "screens/components/contextual-menu/ContextualMenuPageLayout";
-import ContextualMenuUsagePage from "screens/components/contextual-menu/usage/ContextualMenuUsagePage";
-
-const Usage = () => {
- return (
- <>
-
- Contextual Menu Usage — Halstack Design System
-
-
- >
- );
-};
-
-Usage.getLayout = function getLayout(page: ReactElement) {
- return {page};
-};
-
-export default Usage;
diff --git a/apps/website/screens/components/contextual-menu/ContextualMenuPageLayout.tsx b/apps/website/screens/components/contextual-menu/ContextualMenuPageLayout.tsx
index 000323545b..1d50e8da02 100644
--- a/apps/website/screens/components/contextual-menu/ContextualMenuPageLayout.tsx
+++ b/apps/website/screens/components/contextual-menu/ContextualMenuPageLayout.tsx
@@ -6,9 +6,8 @@ import { ReactNode } from "react";
const ContextualMenuPageHeading = ({ children }: { children: ReactNode }) => {
const tabs = [
- { label: "Code", path: "/components/contextual-menu" },
- { label: "Usage", path: "/components/contextual-menu/usage" },
- { label: "Specifications", path: "/components/contextual-menu/specifications" },
+ { label: "Overview", path: "/components/contextual-menu" },
+ { label: "Code", path: "/components/contextual-menu/code" },
];
return (
@@ -17,11 +16,10 @@ const ContextualMenuPageHeading = ({ children }: { children: ReactNode }) => {
- The Contextual menu is a powerful component that improves user experience by allowing users to navigate
- through page-level content or choose from a list of actions while complementing the general disposition of
- the main content within the interface.
+ The Contextual menu provides quick access to navigation or actions related to the current context, enhancing
+ usability and content organization.
-
+
{children}
diff --git a/apps/website/screens/components/contextual-menu/code/ContextualMenuCodePage.tsx b/apps/website/screens/components/contextual-menu/code/ContextualMenuCodePage.tsx
index 01259eab52..c7e80cc18e 100644
--- a/apps/website/screens/components/contextual-menu/code/ContextualMenuCodePage.tsx
+++ b/apps/website/screens/components/contextual-menu/code/ContextualMenuCodePage.tsx
@@ -86,15 +86,13 @@ const sections = [
},
];
-const ContextualMenuCodePage = () => {
- return (
-
-
-
-
-
-
- );
-};
+const ContextualMenuCodePage = () => (
+
+
+
+
+
+
+);
export default ContextualMenuCodePage;
diff --git a/apps/website/screens/components/contextual-menu/overview/ContextualMenuOverviewPage.tsx b/apps/website/screens/components/contextual-menu/overview/ContextualMenuOverviewPage.tsx
new file mode 100644
index 0000000000..b2a4d6dc58
--- /dev/null
+++ b/apps/website/screens/components/contextual-menu/overview/ContextualMenuOverviewPage.tsx
@@ -0,0 +1,141 @@
+import { DxcParagraph, DxcFlex, DxcBulletedList } from "@dxc-technology/halstack-react";
+import DocFooter from "@/common/DocFooter";
+import QuickNavContainer from "@/common/QuickNavContainer";
+import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
+import Image from "@/common/Image";
+import anatomy from "./images/contextual-menu_anatomy.png";
+
+const sections = [
+ {
+ title: "Introduction",
+ content: (
+
+ This powerful component improves user experience by allowing users to{" "}
+ navigate through page-level content or choose from a list of actions while complementing the
+ general disposition of the main content within the interface. It also allows a wide range of possibilities when
+ it comes to placing content cohesively and comprehensively. To achieve this, it's important to understand how
+ the items in our contextual menu behave and interact with each other.
+
+ ),
+ },
+ {
+ title: "Anatomy",
+ content: (
+ <>
+
+
+
+ Section title: a label that groups related menu items within a contextual menu, enhancing
+ organization and readability.
+
+
+ Container: the structural wrapper that holds all menu elements, ensuring proper alignment,
+ spacing, and visual consistency.
+
+
+ Group item: they are nests of other group items or individual items that are related to
+ each other and show indentation as they are unfolded.
+
+
+ Badge: a small visual indicator, often used to display counts, status updates or categories
+ within a menu item.
+
+
+ Single item: an actionable element within the menu that triggers navigation or an operation
+ when selected.
+
+
+ Expand/collapse Icon: a visual indicator for nested menus, allowing users to reveal or hide
+ subitems.
+
+
+ Icon: a graphical representation within a menu item that aids recognition and reinforces
+ meaning.
+
+
+ Section: they are a collection of group and single items within the menu that share a
+ certain relationship and have a title that describes them.
+
+
+ Divider: a subtle separator that groups related menu items and improves menu structure.
+
+
+ Scrollbar: appears when the menu content exceeds the container's height, enabling vertical
+ navigation.
+
+
+ >
+ ),
+ },
+ {
+ title: "Contextual menu and Sidenav",
+ content: (
+ <>
+
+ Although visually similar, the Sidenav component and the contextual menu differ significantly in
+ functionality. Our Sidenav is designed to provide a consistent and persistent navigation structure throughout
+ the application, allowing users to easily switch between different sections or pages within the app.
+
+
+ On the other hand, the contextual menu is more{" "}
+ context-sensitive, and appears in response to specific user actions, offering a set of
+ relevant options or actions that can be performed on the current page. This means that it{" "}
+ operates on a page level, so the component may appear or not depending on the specific needs
+ and requirements for each screen or interaction.
+
+ >
+ ),
+ },
+ {
+ title: "Best practices",
+ content: (
+ <>
+
+
+ Use meaningful icons: Select icons that accurately represent menu items, ensuring clarity
+ and intuitive navigation.
+
+
+ Align properly: position the contextual menu to the left or right, avoiding placement in
+ the center to prevent obstruction of main content.
+
+
+ Enhance navigation with hierarchy: structure menu items using different levels to maintain
+ logical organization.
+
+
+ Use badges for status indication: incorporate a Badge component to display status updates,
+ counts or categories for navigable sections.
+
+
+ Default selection: when pre-selecting an option, try to limit it to the first menu item to
+ maintain intuitive user interactions.
+
+
+ Avoid deep hierarchies: limit navigation depth to a maximum of three levels to prevent
+ excessive indentation and complexity.
+
+
+ Restrict icon usage: use icons only at the first navigation level to maintain readability
+ and avoid visual clutter.
+
+
+ Don't overload with icons: too many icons can create confusion rather than improve
+ usability. Keep them purposeful and minimal.
+
+
+ >
+ ),
+ },
+];
+
+const ContextualMenuOverviewPage = () => (
+
+
+
+
+
+
+);
+
+export default ContextualMenuOverviewPage;
diff --git a/apps/website/screens/components/contextual-menu/overview/images/contextual-menu_anatomy.png b/apps/website/screens/components/contextual-menu/overview/images/contextual-menu_anatomy.png
new file mode 100644
index 0000000000..46a3d0396e
Binary files /dev/null and b/apps/website/screens/components/contextual-menu/overview/images/contextual-menu_anatomy.png differ
diff --git a/apps/website/screens/components/contextual-menu/specs/ContextualMenuSpecsPage.tsx b/apps/website/screens/components/contextual-menu/specs/ContextualMenuSpecsPage.tsx
deleted file mode 100644
index ae6c4bcf68..0000000000
--- a/apps/website/screens/components/contextual-menu/specs/ContextualMenuSpecsPage.tsx
+++ /dev/null
@@ -1,335 +0,0 @@
-import { DxcFlex, DxcBulletedList, DxcParagraph, DxcTable } from "@dxc-technology/halstack-react";
-import QuickNavContainer from "@/common/QuickNavContainer";
-import QuickNavContainerLayout from "@/common/QuickNavContainerLayout";
-import DocFooter from "@/common/DocFooter";
-import Figure from "@/common/Figure";
-import Image from "@/common/Image";
-import anatomy from "./images/contextual_menu_anatomy.png";
-import contextualMenuSpecs from "./images/contextual_menu_specs.png";
-import contextualMenuItemSpecs from "./images/contextual_menu_item_specs.png";
-import itemStates from "./images/contextual_menu_item_states.png";
-import Code from "@/common/Code";
-
-const sections = [
- {
- title: "Specifications",
- subSections: [
- {
- title: "Contextual menu",
- content: (
-
-
-
- ),
- },
- {
- title: "Contextual menu item",
- content: (
-
-
-
- ),
- },
- ],
- },
- {
- title: "States",
- content: (
- <>
-
-
-
- >
- ),
- },
- {
- title: "Anatomy",
- content: (
- <>
-
-
- Section title
- Container
- Badge
- Menu item
- Expand/collapse icon
- Icon
- Divider
-
- >
- ),
- },
- {
- title: "Design tokens",
- subSections: [
- {
- title: "Color",
- content: (
-
-
-