Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/demo/src/components/demo/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const DropdownMenuDemo = ({
<DropdownMenuContent align="start">
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem danger>Logout</DropdownMenuItem>
<DropdownMenuItem variant="danger">Logout</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</div>
Expand Down
14 changes: 7 additions & 7 deletions packages/demo/src/content/components/dropdown-menu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Basic usage:
<DropdownMenuContent align="start">
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem danger>Logout</DropdownMenuItem>
<DropdownMenuItem variant="danger">Logout</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
```
Expand Down Expand Up @@ -201,12 +201,12 @@ Wrap related items in `DropdownMenuGroup` to associate a label with its items fo

### DropdownMenuItem

| Name | Description | Type | Default | Required |
| ---------- | ----------------------------------------------------- | ------------ | ------- | -------- |
| `danger` | Styles the item as a destructive action | `boolean` | `false` | ❌ |
| `inset` | Adds left padding to align with items that have icons | `boolean` | `false` | ❌ |
| `disabled` | Prevents interaction and dims the item | `boolean` | `false` | ❌ |
| `onSelect` | Called when the item is selected | `() => void` | - | ❌ |
| Name | Description | Type | Default | Required |
| ---------- | ----------------------------------------------------- | ------------------- | --------- | -------- |
| `variant` | Visual style; `danger` marks a destructive action | `neutral`, `danger` | `neutral` | ❌ |
| `inset` | Adds left padding to align with items that have icons | `boolean` | `false` | ❌ |
| `disabled` | Prevents interaction and dims the item | `boolean` | `false` | ❌ |
| `onSelect` | Called when the item is selected | `() => void` | - | ❌ |

### DropdownMenuCheckboxItem

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@apply hover:not-disabled:text-red-700! focus:text-red-700!;
@apply hover:not-disabled:bg-red-300/50! focus:bg-red-300/50!;
@apply dark:hover:not-disabled:bg-red-600/50! dark:focus:bg-red-600/50!;
@apply dark:hover:not-disabled:text-red-100! dark:focus:text-red-100!;
@apply dark:hover:not-disabled:text-red-200! dark:focus:text-red-200!;
}

.dropdown-menu-item-indicator-checkbox,
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/dropdown-menu/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ const DropdownMenuItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
inset?: boolean;
danger?: boolean;
variant?: 'neutral' | 'danger';
}
>(({ className, inset, danger, ...props }, ref) => (
>(({ className, inset, variant = 'neutral', ...props }, ref) => (
<DropdownMenuPrimitive.Item
ref={ref}
className={cn(
styles['dropdown-menu-item'],
inset && styles['dropdown-menu-inset'],
danger && styles['dropdown-menu-item-danger'],
variant === 'danger' && styles['dropdown-menu-item-danger'],
className
)}
{...props}
Expand Down
Loading