-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-components): Add
DropdownMenu
component (#200)
Add `DropdownMenu` component
- Loading branch information
Showing
34 changed files
with
1,254 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+16.7 KB
.yarn/cache/@floating-ui-react-dom-npm-2.0.2-6bf24b7b13-4797e1f7a1.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.58 KB
.yarn/cache/@radix-ui-react-arrow-npm-1.0.3-d57b8cf08f-8cca086f0d.zip
Binary file not shown.
Binary file added
BIN
+12.2 KB
.yarn/cache/@radix-ui-react-collection-npm-1.0.3-e63f97f38b-acfbc9b0b2.zip
Binary file not shown.
Binary file added
BIN
+6.24 KB
.yarn/cache/@radix-ui-react-compose-refs-npm-1.0.1-02d1046f7d-2b9a613b6d.zip
Binary file not shown.
Binary file added
BIN
+12.4 KB
.yarn/cache/@radix-ui-react-context-npm-1.0.1-c6d8414c9a-60e9b81d36.zip
Binary file not shown.
Binary file added
BIN
+5.74 KB
.yarn/cache/@radix-ui-react-direction-npm-1.0.1-ab286e4395-5336a8b0d4.zip
Binary file not shown.
Binary file added
BIN
+25.6 KB
.yarn/cache/@radix-ui-react-dismissable-layer-npm-1.0.4-1867822920-ea86004ed5.zip
Binary file not shown.
Binary file added
BIN
+26.5 KB
.yarn/cache/@radix-ui-react-dropdown-menu-npm-2.0.5-bf739b09ab-42fd72f243.zip
Binary file not shown.
Binary file added
BIN
+7.42 KB
.yarn/cache/@radix-ui-react-focus-guards-npm-1.0.1-415ba52867-1f8ca8f83b.zip
Binary file not shown.
Binary file added
BIN
+28.4 KB
.yarn/cache/@radix-ui-react-focus-scope-npm-1.0.3-4759094e87-e5b1a08907.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+30.2 KB
.yarn/cache/@radix-ui-react-popper-npm-1.1.2-2ec2059680-4929daa0d1.zip
Binary file not shown.
Binary file added
BIN
+6.48 KB
.yarn/cache/@radix-ui-react-portal-npm-1.0.3-4c59d6f96d-d352bcd6ad.zip
Binary file not shown.
Binary file added
BIN
+14.8 KB
.yarn/cache/@radix-ui-react-presence-npm-1.0.1-2057bd46b4-ed2ff9faf9.zip
Binary file not shown.
Binary file added
BIN
+13.9 KB
.yarn/cache/@radix-ui-react-primitive-npm-1.0.3-1983a5adc0-9402bc2292.zip
Binary file not shown.
Binary file added
BIN
+25.4 KB
.yarn/cache/@radix-ui-react-roving-focus-npm-1.0.4-7106f3083a-69b1c82c2d.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.85 KB
.yarn/cache/@radix-ui-react-use-callback-ref-npm-1.0.1-e521cb00a3-b9fd39911c.zip
Binary file not shown.
Binary file added
BIN
+7.72 KB
.yarn/cache/@radix-ui-react-use-controllable-state-npm-1.0.1-cbe6fcf1d7-dee2be1937.zip
Binary file not shown.
Binary file added
BIN
+5.9 KB
.yarn/cache/@radix-ui-react-use-escape-keydown-npm-1.0.3-2455d95aa3-c6ed0d9ce7.zip
Binary file not shown.
Binary file added
BIN
+5.43 KB
.yarn/cache/@radix-ui-react-use-layout-effect-npm-1.0.1-fa00f2498d-bed9c7e8de.zip
Binary file not shown.
Binary file added
BIN
+5.44 KB
.yarn/cache/@radix-ui-react-use-rect-npm-1.0.1-ea3f7a385f-433f07e61e.zip
Binary file not shown.
Binary file added
BIN
+7.76 KB
.yarn/cache/@radix-ui-react-use-size-npm-1.0.1-97c8358b35-6cc150ad1e.zip
Binary file not shown.
Binary file not shown.
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
51 changes: 51 additions & 0 deletions
51
packages/react-components/src/components/DropdownMenu/index.tsx
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,51 @@ | ||
import * as RadixDropdownMenu from "@radix-ui/react-dropdown-menu"; | ||
import styled from "styled-components"; | ||
|
||
export const DropdownMenu = { | ||
Root: RadixDropdownMenu.Root, | ||
|
||
Trigger: styled(RadixDropdownMenu.Trigger)` | ||
cursor: pointer; | ||
`, | ||
|
||
Content: styled(RadixDropdownMenu.Content)` | ||
display: grid; | ||
gap: 0.5rem; | ||
min-width: 22rem; | ||
background: ${({ theme }) => theme.color.backgroundLighter}; | ||
border-radius: ${({ theme }) => theme.borderRadius}; | ||
box-shadow: 0 5px 5px 0 ${({ theme }) => theme.color.black40}; | ||
padding: 1rem 0; | ||
`, | ||
|
||
Arrow: styled(RadixDropdownMenu.Arrow)` | ||
fill: ${({ theme }) => theme.color.black40}; | ||
`, | ||
|
||
Item: styled(RadixDropdownMenu.Item)` | ||
border-radius: 3px; | ||
display: flex; | ||
gap: 1.5rem; | ||
align-items: center; | ||
padding: 0.5rem 1rem; | ||
margin: 0 0.5rem; | ||
user-select: none; | ||
outline: none; | ||
&[data-disabled] { | ||
pointer-events: none; | ||
opacity: 0.8; | ||
} | ||
&:focus { | ||
background: ${({ theme }) => theme.color.comment}; | ||
cursor: pointer; | ||
} | ||
`, | ||
|
||
Divider: styled.div` | ||
height: 1px; | ||
background: ${({ theme }) => theme.color.selection}; | ||
margin: 0.5rem 0; | ||
`, | ||
}; |
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.