From 7c38527b46e81c4a5d395e565e867bc8ac6c7163 Mon Sep 17 00:00:00 2001
From: Osama Abdul Latif <62595605+OsamaAbdellateef@users.noreply.github.com>
Date: Wed, 28 Aug 2024 17:19:40 +0300
Subject: [PATCH] [DST-518]: Revise "menu" Page (#4124)
* Adding anatomy section
* Adding anatomy slots
* adding appearance example
* Adding usage section
* Adding dos
* revise examples
* revise section example
* Revising more examples
* Adding changeset
* enhance description
* Resolving comments
* remove unwanted description
* Resolving comments
* Edit image
* Edit image
* Edit anatomy
* Change order
* Edit anatomy image
* Resolving comments
* enhance menu section usage example "Adding more description"
* Edit anatomy picture
* make the anatomy pic bigger
* Enhance multiselect example
* Adding more sections
* Add more explanation for meni item opens dialog section example
* Fixing typo
---
.changeset/afraid-donuts-search.md | 5 +
.../overlay/menu/menu-action-table.demo.tsx | 78 +++++++++++++++
.../overlay/menu/menu-action.demo.tsx | 2 +-
.../overlay/menu/menu-appearance.demo.tsx | 14 +++
.../overlay/menu/menu-disabled.demo.tsx | 11 +-
.../overlay/menu/menu-section.demo.tsx | 19 ++--
.../overlay/menu/menu-selection.demo.tsx | 26 +++--
docs/content/components/overlay/menu/menu.mdx | 94 +++++++++++++-----
docs/public/menu/menu-anatomy.jpg | Bin 0 -> 51185 bytes
9 files changed, 197 insertions(+), 52 deletions(-)
create mode 100644 .changeset/afraid-donuts-search.md
create mode 100644 docs/content/components/overlay/menu/menu-action-table.demo.tsx
create mode 100644 docs/content/components/overlay/menu/menu-appearance.demo.tsx
create mode 100644 docs/public/menu/menu-anatomy.jpg
diff --git a/.changeset/afraid-donuts-search.md b/.changeset/afraid-donuts-search.md
new file mode 100644
index 0000000000..544de773bb
--- /dev/null
+++ b/.changeset/afraid-donuts-search.md
@@ -0,0 +1,5 @@
+---
+'@marigold/docs': patch
+---
+
+[DST-518]: Revise "Menu" Page
diff --git a/docs/content/components/overlay/menu/menu-action-table.demo.tsx b/docs/content/components/overlay/menu/menu-action-table.demo.tsx
new file mode 100644
index 0000000000..0efaf7559d
--- /dev/null
+++ b/docs/content/components/overlay/menu/menu-action-table.demo.tsx
@@ -0,0 +1,78 @@
+import { useState } from 'react';
+import { ActionMenu, Menu, Table } from '@marigold/components';
+
+const rows = [
+ {
+ ticketId: 'TCK-001',
+ eventName: 'Champions League Final',
+ status: 'Confirmed',
+ },
+ {
+ ticketId: 'TCK-002',
+ eventName: 'Rock Concert',
+ status: 'Pending',
+ },
+ {
+ ticketId: 'TCK-003',
+ eventName: 'Broadway Show',
+ status: 'Cancelled',
+ },
+];
+
+interface Ticket {
+ ticketId: string;
+ eventName: string;
+ status: 'Cancelled' | 'Pending' | 'Confirmed';
+}
+
+export default () => {
+ const [tickets, setTickets] = useState(rows);
+
+ const handleViewDetails = (ticket: Ticket) => {
+ alert(
+ `Ticket ID: ${ticket.ticketId}\nEvent: ${ticket.eventName}\nStatus: ${ticket.status}`
+ );
+ };
+
+ return (
+
+
+ ID
+ Event Name
+ Status
+ Action
+
+
+ {tickets.map((ticket: Ticket) => (
+
+ {ticket.ticketId}
+ {ticket.eventName}
+ {ticket.status}
+
+
+ handleViewDetails(ticket)}
+ id="view-details"
+ >
+ View Details
+
+
+ setTickets(
+ tickets.filter(
+ ticketItem => ticketItem.ticketId !== ticket.ticketId
+ )
+ )
+ }
+ id="delete"
+ >
+ Delete
+
+
+
+
+ ))}
+
+
+ );
+};
diff --git a/docs/content/components/overlay/menu/menu-action.demo.tsx b/docs/content/components/overlay/menu/menu-action.demo.tsx
index f5f1f6e35e..3c54001ec9 100644
--- a/docs/content/components/overlay/menu/menu-action.demo.tsx
+++ b/docs/content/components/overlay/menu/menu-action.demo.tsx
@@ -3,7 +3,7 @@ import { Menu } from '@marigold/components';
export default () => {
return (
-