Skip to content

Commit b4a080e

Browse files
committed
added menu examples
1 parent d46fc3d commit b4a080e

File tree

6 files changed

+68
-11
lines changed

6 files changed

+68
-11
lines changed

app/(sink)/demo/components/page.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ export default function page() {
106106
<Menu.Trigger asChild>
107107
<Button>Menu</Button>
108108
</Menu.Trigger>
109-
{/* <Menu.Trigger asChild>
110-
<button className="IconButton" aria-label="Customise options">
111-
Click Me
112-
</button>
113-
</Menu.Trigger> */}
114109
<Menu.Content className="min-w-36">
115110
<Menu.Item>Menu Item 1</Menu.Item>
116111
<Menu.Item>Menu Item 2</Menu.Item>

config/components.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,19 @@ export const componentConfig = {
2626
name: "card",
2727
filePath: "packages/ui/Cards/Card.tsx",
2828
},
29-
text: {
30-
name: "text",
31-
filePath: "packages/ui/Text/Text.tsx",
32-
},
29+
3330
dialog: {
3431
name: "dialog",
3532
filePath: "packages/ui/Dialog/Dialog.tsx",
3633
},
34+
menu: {
35+
name: "menu",
36+
filePath: "packages/ui/Menu/Menu.tsx",
37+
},
38+
text: {
39+
name: "text",
40+
filePath: "packages/ui/Text/Text.tsx",
41+
},
3742
},
3843
examples: {
3944
"accordion-style-default": {
@@ -134,6 +139,11 @@ export const componentConfig = {
134139
filePath: "preview/components/input-style-default.tsx",
135140
preview: lazy(() => import("@/preview/components/input-style-default")),
136141
},
142+
"menu-style-default": {
143+
name: "menu-style-default",
144+
filePath: "preview/components/menu-style-default.tsx",
145+
preview: lazy(() => import("@/preview/components/menu-style-default")),
146+
},
137147
"textarea-style-default": {
138148
name: "textarea-style-default",
139149
filePath: "preview/components/textarea-style-default.tsx",

config/navigation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ export const navConfig: INavigationConfig = {
2222
{ title: "Badge", href: `${componentsRoute}/badge` },
2323
{ title: "Button", href: `${componentsRoute}/button` },
2424
{ title: "Card", href: `${componentsRoute}/card` },
25+
{ title: "Dialog", href: `${componentsRoute}/dialog` },
2526
{ title: "Input", href: `${componentsRoute}/input` },
27+
{ title: "Menu", href: `${componentsRoute}/menu` },
2628
{ title: "Tab", href: `${componentsRoute}/tab` },
2729
{ title: "Textarea", href: `${componentsRoute}/textarea` },
2830
{ title: "Text", href: `${componentsRoute}/text` },
29-
{ title: "Dialog", href: `${componentsRoute}/dialog` },
3031
],
3132
},
3233
{

content/docs/components/menu.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Menu
3+
description: Show your users a list of actions they can take. 📋
4+
lastUpdated: 19 Oct, 2024
5+
links:
6+
api_reference: https://www.radix-ui.com/primitives/docs/components/dropdown-menu#api-reference
7+
source: https://github.com/Logging-Stuff/RetroUI/blob/main/packages/ui/Menu/Menu.tsx
8+
---
9+
10+
<ComponentShowcase name="menu-style-default" />
11+
<br />
12+
<br />
13+
14+
## Installation
15+
16+
#### 1. Install dependencies:
17+
18+
```sh
19+
npm install @radix-ui/react-dropdown-menu
20+
```
21+
22+
<br />
23+
24+
#### 2. Copy the code 👇 into your project:
25+
26+
<ComponentSource name="menu" />
27+
28+
<br />
29+
<br />
30+
31+
## Examples
32+
33+
### Default
34+
35+
<ComponentShowcase name="menu-style-default" />

packages/ui/Menu/Menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Content = ({ className, ...props }: IMenuContent) => (
2727

2828
const MenuItem = (props: any) => (
2929
<DropdownMenu.Item
30-
className="p-2 hover:bg-primary-300 outline-none cursor-pointer "
30+
className="p-2 hover:bg-primary-400 outline-none cursor-pointer "
3131
{...props}
3232
/>
3333
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Button, Menu } from "@/packages/ui";
2+
3+
export default function MenuDefault() {
4+
return (
5+
<Menu>
6+
<Menu.Trigger asChild>
7+
<Button>Menu</Button>
8+
</Menu.Trigger>
9+
<Menu.Content className="min-w-36">
10+
<Menu.Item>Menu Item 1</Menu.Item>
11+
<Menu.Item>Menu Item 2</Menu.Item>
12+
<Menu.Item>Menu Item 3</Menu.Item>
13+
</Menu.Content>
14+
</Menu>
15+
);
16+
}

0 commit comments

Comments
 (0)