-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Logging-Stuff/menu
- Loading branch information
Showing
16 changed files
with
341 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ jobs: | |
|
||
- name: Build and push to DockerHub | ||
run: | | ||
docker build -t devarifhossain/retroui:1.0.7 ./ | ||
docker push devarifhossain/retroui:1.0.7 | ||
docker build -t devarifhossain/retroui:1.0.8 ./ | ||
docker push devarifhossain/retroui:1.0.8 | ||
- name: Set up SSH | ||
uses: webfactory/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: Menu | ||
description: Show your users a list of actions they can take. 📋 | ||
lastUpdated: 19 Oct, 2024 | ||
links: | ||
api_reference: https://www.radix-ui.com/primitives/docs/components/dropdown-menu#api-reference | ||
source: https://github.com/Logging-Stuff/RetroUI/blob/main/packages/ui/Menu/Menu.tsx | ||
--- | ||
|
||
<ComponentShowcase name="menu-style-default" /> | ||
<br /> | ||
<br /> | ||
|
||
## Installation | ||
|
||
#### 1. Install dependencies: | ||
|
||
```sh | ||
npm install @radix-ui/react-dropdown-menu | ||
``` | ||
|
||
<br /> | ||
|
||
#### 2. Copy the code 👇 into your project: | ||
|
||
<ComponentSource name="menu" /> | ||
|
||
<br /> | ||
<br /> | ||
|
||
## Examples | ||
|
||
### Default | ||
|
||
<ComponentShowcase name="menu-style-default" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
"use client"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
import * as DropdownMenu from "@radix-ui/react-dropdown-menu"; | ||
import React, { ComponentPropsWithoutRef, HTMLAttributes } from "react"; | ||
|
||
const Menu = DropdownMenu.Root; | ||
const Trigger = DropdownMenu.Trigger; | ||
|
||
interface IMenuContent | ||
extends ComponentPropsWithoutRef<typeof DropdownMenu.Content> {} | ||
|
||
const Content = ({ className, ...props }: IMenuContent) => ( | ||
<DropdownMenu.Portal> | ||
<DropdownMenu.Content | ||
side="bottom" | ||
align="start" | ||
className={cn( | ||
"bg-white border-2 border-black shadow-md absolute top-2 min-w-20", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
</DropdownMenu.Portal> | ||
); | ||
|
||
const MenuItem = React.forwardRef< | ||
HTMLDivElement, | ||
ComponentPropsWithoutRef<typeof DropdownMenu.Item> | ||
>(({ className, ...props }, ref) => ( | ||
<DropdownMenu.Item | ||
ref={ref} | ||
className={cn( | ||
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-primary-400 hover:text-white focus:bg-primary-400 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
MenuItem.displayName = "MenuItem"; | ||
|
||
const MenuComponent = Object.assign(Menu, { | ||
Trigger, | ||
Content, | ||
Item: MenuItem, | ||
}); | ||
|
||
export { MenuComponent as Menu }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./Menu"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.