Skip to content

Commit

Permalink
fix(dropdown): improve typing of props
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprevot committed Oct 12, 2023
1 parent 6c882dc commit a84a2cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/fractal/src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export const Avatar = ({

<RxDropdown.Portal>
<RxDropdown.Content
align="center"
className={cx(
`${PREFIX}-${GROUP_NAME}-dropdown`,
typography({ variant: 'body-1' }),
Expand Down
12 changes: 3 additions & 9 deletions packages/fractal/src/components/Dropdown/Dropdown.types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import type { DropdownMenuContentProps as RxDropdownContentProps } from '@radix-ui/react-dropdown-menu'
import {
Content,
DropdownMenuItem,
Root,
MenuRadioGroupProps as RxDropdownRadioGroupProps,
MenuRadioItemProps as RxDropdownRadioItemProps,
} from '@radix-ui/react-dropdown-menu'
import type { AllHTMLAttributes, ComponentProps, ReactNode } from 'react'

export interface DropdownProps extends AllHTMLAttributes<HTMLDivElement> {
type Props = RxDropdownContentProps & AllHTMLAttributes<HTMLDivElement>
export interface DropdownProps extends Props {
/**
* The content of the dropdown menu.
*
Expand All @@ -24,13 +25,6 @@ export interface DropdownProps extends AllHTMLAttributes<HTMLDivElement> {
* (non-text) trigger.
*/
open?: boolean
/**
* The side to open the dropdown too.
*
* If none is given, it will be chosen automatically based on the available
* space.
*/
side?: ComponentProps<typeof Content>['side']
/** The trigger of the dropdown menu. */
trigger?: ReactNode
/** Indicates if the trigger should have an indicator (arrow). */
Expand Down

0 comments on commit a84a2cc

Please sign in to comment.