Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

♻️ Migrate DropdownMenu to Base UI (#2623)

Luke Vella9179ad620b42
diff --git a/apps/landing/src/app/[locale]/(main)/layout.tsx b/apps/landing/src/app/[locale]/(main)/layout.tsx
index b5169e20a..248baeb83 100644
--- a/apps/landing/src/app/[locale]/(main)/layout.tsx
+++ b/apps/landing/src/app/[locale]/(main)/layout.tsx
@@ -81,33 +81,31 @@ export default async function Root(props: {
</div>
<div className="flex items-center justify-center lg:hidden">
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button size="sm" variant="ghost">
- <Icon>
- <MenuIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={<Button size="sm" variant="ghost" />}
+ >
+ <Icon>
+ <MenuIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-48" align="end" sideOffset={16}>
- <DropdownMenuItem asChild>
- <LinkBase href="https://support.rallly.co/workflow/create">
- <Trans t={t} i18nKey="howItWorks" defaults="How it Works" />
- </LinkBase>
+ <DropdownMenuItem
+ render={
+ <LinkBase href="https://support.rallly.co/workflow/create" />
+ }
+ >
+ <Trans t={t} i18nKey="howItWorks" defaults="How it Works" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <LinkBase href="/pricing">
- <Trans t={t} i18nKey="pricing" defaults="Pricing" />
- </LinkBase>
+ <DropdownMenuItem render={<LinkBase href="/pricing" />}>
+ <Trans t={t} i18nKey="pricing" defaults="Pricing" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <LinkBase href="/blog">
- <Trans t={t} i18nKey="blog" />
- </LinkBase>
+ <DropdownMenuItem render={<LinkBase href="/blog" />}>
+ <Trans t={t} i18nKey="blog" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <LinkBase href="https://support.rallly.co">
- <Trans t={t} i18nKey="support" />
- </LinkBase>
+ <DropdownMenuItem
+ render={<LinkBase href="https://support.rallly.co" />}
+ >
+ <Trans t={t} i18nKey="support" />
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuLabel className="space-y-2">
diff --git a/apps/web/src/app/[locale]/(space)/settings/api-keys/components/revoke-api-key-button.tsx b/apps/web/src/app/[locale]/(space)/settings/api-keys/components/revoke-api-key-button.tsx
index 025c4ed38..45c23f345 100644
--- a/apps/web/src/app/[locale]/(space)/settings/api-keys/components/revoke-api-key-button.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/api-keys/components/revoke-api-key-button.tsx
@@ -38,16 +38,18 @@ export function RevokeApiKeyButton({
return (
<>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", { defaultValue: "More options" })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", { defaultValue: "More options" })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
diff --git a/apps/web/src/app/[locale]/(space)/settings/calendars/components/calendar-connection-list.tsx b/apps/web/src/app/[locale]/(space)/settings/calendars/components/calendar-connection-list.tsx
index 9dba83779..0d51ea92f 100644
--- a/apps/web/src/app/[locale]/(space)/settings/calendars/components/calendar-connection-list.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/calendars/components/calendar-connection-list.tsx
@@ -105,23 +105,25 @@ export function CalendarConnectionList() {
</TooltipContent>
</Tooltip>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", {
- defaultValue: "More options",
- })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
variant="destructive"
- onSelect={() => {
+ onClick={() => {
toast.promise(
disconnectCalendar.mutateAsync({
id: calendar.id,
diff --git a/apps/web/src/app/[locale]/(space)/settings/calendars/components/connect-calendar-dropdown.tsx b/apps/web/src/app/[locale]/(space)/settings/calendars/components/connect-calendar-dropdown.tsx
index 944e07235..980946c0f 100644
--- a/apps/web/src/app/[locale]/(space)/settings/calendars/components/connect-calendar-dropdown.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/calendars/components/connect-calendar-dropdown.tsx
@@ -16,16 +16,14 @@ import { Trans } from "@/i18n/client";
export function ConnectCalendarDropdown() {
return (
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button>
- <PlusIcon data-icon="inline-start" />
- <Trans i18nKey="connectCalendar" defaults="Connect Calendar" />
- <ChevronDownIcon data-icon="inline-end" />
- </Button>
+ <DropdownMenuTrigger render={<Button />}>
+ <PlusIcon data-icon="inline-start" />
+ <Trans i18nKey="connectCalendar" defaults="Connect Calendar" />
+ <ChevronDownIcon data-icon="inline-end" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
- onSelect={() => {
+ onClick={() => {
connectToCalendar("google-calendar");
}}
>
@@ -38,7 +36,7 @@ export function ConnectCalendarDropdown() {
<Trans i18nKey="connectGoogleCalendar" defaults="Google Calendar" />
</DropdownMenuItem>
<DropdownMenuItem
- onSelect={() => {
+ onClick={() => {
connectToCalendar("outlook");
}}
>
diff --git a/apps/web/src/app/[locale]/(space)/settings/event-types/event-types-settings-page.tsx b/apps/web/src/app/[locale]/(space)/settings/event-types/event-types-settings-page.tsx
index ba8c8e2f3..5a145d84e 100644
--- a/apps/web/src/app/[locale]/(space)/settings/event-types/event-types-settings-page.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/event-types/event-types-settings-page.tsx
@@ -43,7 +43,7 @@ import { CreateEventTypeDialog } from "@/features/event-types/components/create-
import { DeleteEventTypeDialog } from "@/features/event-types/components/delete-event-type-dialog";
import { EditEventTypeDialog } from "@/features/event-types/components/edit-event-type-dialog";
import type { EventTypeDTO } from "@/features/event-types/types";
-import { Trans } from "@/i18n/client";
+import { Trans, useTranslation } from "@/i18n/client";
import { formatDuration } from "@/lib/datetime/format";
import { useLocale } from "@/lib/locale/client";
import type { LocationType } from "@/lib/location";
@@ -96,6 +96,7 @@ function EventTypeCard({
onDelete: () => void;
}) {
const { locale } = useLocale();
+ const { t } = useTranslation();
return (
<div className="flex flex-col overflow-hidden rounded-2xl border border-card-border bg-card">
<RandomGradientBar />
@@ -103,18 +104,20 @@ function EventTypeCard({
<div className="flex items-start justify-between gap-2">
<OptimizedAvatarImage size="md" src={hostImage} name={hostName} />
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button variant="ghost" size="icon">
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- <span className="sr-only">
- <Trans
- i18nKey="eventTypeActionsLabel"
- defaults="Event type actions"
- />
- </span>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("eventTypeActionsLabel", {
+ defaultValue: "Event type actions",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={onEdit}>
diff --git a/apps/web/src/app/[locale]/(space)/settings/members/components/invite-dropdown-menu.tsx b/apps/web/src/app/[locale]/(space)/settings/members/components/invite-dropdown-menu.tsx
index a10a44ddc..d36a44021 100644
--- a/apps/web/src/app/[locale]/(space)/settings/members/components/invite-dropdown-menu.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/members/components/invite-dropdown-menu.tsx
@@ -44,16 +44,18 @@ export function InviteDropdownMenu({ invite }: { invite: SpaceMemberInvite }) {
return (
<>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", { defaultValue: "More options" })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", { defaultValue: "More options" })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
diff --git a/apps/web/src/app/[locale]/(space)/settings/members/components/member-dropdown-menu.tsx b/apps/web/src/app/[locale]/(space)/settings/members/components/member-dropdown-menu.tsx
index dee29157a..165a8f4d3 100644
--- a/apps/web/src/app/[locale]/(space)/settings/members/components/member-dropdown-menu.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/members/components/member-dropdown-menu.tsx
@@ -66,16 +66,18 @@ export function MemberDropdownMenu({ member }: { member: MemberDTO }) {
return (
<>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", { defaultValue: "More options" })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", { defaultValue: "More options" })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
{member.role === "member" ? (
diff --git a/apps/web/src/app/[locale]/(space)/settings/spaces/components/spaces-list.tsx b/apps/web/src/app/[locale]/(space)/settings/spaces/components/spaces-list.tsx
index ee1705924..fbb4f7a2c 100644
--- a/apps/web/src/app/[locale]/(space)/settings/spaces/components/spaces-list.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/spaces/components/spaces-list.tsx
@@ -97,18 +97,20 @@ export function SpacesList({ spaces, currentUserId }: SpacesListProps) {
</div>
</div>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", {
- defaultValue: "More options",
- })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
diff --git a/apps/web/src/app/[locale]/control-panel/users/user-row.tsx b/apps/web/src/app/[locale]/control-panel/users/user-row.tsx
index 10b506ac4..608be50ae 100644
--- a/apps/web/src/app/[locale]/control-panel/users/user-row.tsx
+++ b/apps/web/src/app/[locale]/control-panel/users/user-row.tsx
@@ -65,16 +65,20 @@ export function UserRow({
<div className="flex items-center gap-4">
<span className="capitalize">{role}</span>
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", { defaultValue: "More options" })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreHorizontal />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreHorizontal />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuSub>
diff --git a/apps/web/src/app/[locale]/e/[id]/components/user-dropdown.tsx b/apps/web/src/app/[locale]/e/[id]/components/user-dropdown.tsx
index 2c183a8dc..0fc3668d6 100644
--- a/apps/web/src/app/[locale]/e/[id]/components/user-dropdown.tsx
+++ b/apps/web/src/app/[locale]/e/[id]/components/user-dropdown.tsx
@@ -33,15 +33,18 @@ export function UserDropdown({
return (
<DropdownMenu modal={false}>
- <DropdownMenuTrigger asChild className={cn("group min-w-0", className)}>
- <Button
- aria-label={t("accountMenu", { defaultValue: "Account menu" })}
- variant="ghost"
- className="rounded-full"
- size="icon"
- >
- <OptimizedAvatarImage src={image} name={name} size="sm" />
- </Button>
+ <DropdownMenuTrigger
+ className={cn("group min-w-0", className)}
+ render={
+ <Button
+ aria-label={t("accountMenu", { defaultValue: "Account menu" })}
+ variant="ghost"
+ className="rounded-full"
+ size="icon"
+ />
+ }
+ >
+ <OptimizedAvatarImage src={image} name={name} size="sm" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="min-w-48">
<DropdownMenuLabel className="flex items-center gap-2">
@@ -56,20 +59,27 @@ export function UserDropdown({
</div>
</DropdownMenuLabel>
<DropdownMenuSeparator />
- <DropdownMenuItem asChild>
- <Link href="/settings/profile" className="flex items-center gap-x-2">
- <UserIcon className="size-4 text-muted-foreground" />
- <Trans i18nKey="profile" defaults="Profile" />
- </Link>
+ <DropdownMenuItem
+ render={
+ <Link
+ href="/settings/profile"
+ className="flex items-center gap-x-2"
+ />
+ }
+ >
+ <UserIcon className="size-4 text-muted-foreground" />
+ <Trans i18nKey="profile" defaults="Profile" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <Link
- href="/settings/preferences"
- className="flex items-center gap-x-2"
- >
- <Settings2Icon className="size-4 text-muted-foreground" />
- <Trans i18nKey="preferences" defaults="Preferences" />
- </Link>
+ <DropdownMenuItem
+ render={
+ <Link
+ href="/settings/preferences"
+ className="flex items-center gap-x-2"
+ />
+ }
+ >
+ <Settings2Icon className="size-4 text-muted-foreground" />
+ <Trans i18nKey="preferences" defaults="Preferences" />
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem
diff --git a/apps/web/src/components/nav-user.tsx b/apps/web/src/components/nav-user.tsx
index de4407665..e6e2f6b9a 100644
--- a/apps/web/src/components/nav-user.tsx
+++ b/apps/web/src/components/nav-user.tsx
@@ -6,7 +6,6 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
- DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
@@ -50,43 +49,41 @@ export function NavUser() {
<>
{isPending && <RouterLoadingIndicator />}
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button className="flex h-auto w-full gap-2 p-2" variant="ghost">
- <OptimizedAvatarImage size="lg" src={user.image} name={user.name} />
- <div className="flex-1 truncate text-left">
- <div className="font-medium">{user.name}</div>
- <div className="mt-0.5 truncate font-normal text-muted-foreground text-xs">
- {user.email}
- </div>
+ <DropdownMenuTrigger
+ render={
+ <Button className="flex h-auto w-full gap-2 p-2" variant="ghost" />
+ }
+ >
+ <OptimizedAvatarImage size="lg" src={user.image} name={user.name} />
+ <div className="flex-1 truncate text-left">
+ <div className="font-medium">{user.name}</div>
+ <div className="mt-0.5 truncate font-normal text-muted-foreground text-xs">
+ {user.email}
</div>
- <Icon>
- <ChevronDownIcon />
- </Icon>
- </Button>
+ </div>
+ <Icon>
+ <ChevronDownIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent
- className="w-(--radix-dropdown-menu-trigger-width)"
+ className="w-(--anchor-width)"
align="end"
side="top"
>
<DropdownMenuLabel>
<Trans i18nKey="account" defaults="Account" />
</DropdownMenuLabel>
- <DropdownMenuItem asChild>
- <Link href="/settings/profile">
- <Icon>
- <UserIcon />
- </Icon>
- <Trans i18nKey="profile" defaults="Profile" />
- </Link>
+ <DropdownMenuItem render={<Link href="/settings/profile" />}>
+ <Icon>
+ <UserIcon />
+ </Icon>
+ <Trans i18nKey="profile" defaults="Profile" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <Link href="/settings/preferences">
- <Icon>
- <Settings2Icon />
- </Icon>
- <Trans i18nKey="preferences" defaults="Preferences" />
- </Link>
+ <DropdownMenuItem render={<Link href="/settings/preferences" />}>
+ <Icon>
+ <Settings2Icon />
+ </Icon>
+ <Trans i18nKey="preferences" defaults="Preferences" />
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuSub>
@@ -96,30 +93,28 @@ export function NavUser() {
</Icon>
<Trans i18nKey="theme" defaults="Theme" />
</DropdownMenuSubTrigger>
- <DropdownMenuPortal>
- <DropdownMenuSubContent>
- <DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
- <DropdownMenuRadioItem value="system">
- <Icon>
- <MonitorIcon />
- </Icon>
- <Trans i18nKey="themeSystem" defaults="System" />
- </DropdownMenuRadioItem>
- <DropdownMenuRadioItem value="light">
- <Icon>
- <SunIcon />
- </Icon>
- <Trans i18nKey="themeLight" defaults="Light" />
- </DropdownMenuRadioItem>
- <DropdownMenuRadioItem value="dark">
- <Icon>
- <MoonIcon />
- </Icon>
- <Trans i18nKey="themeDark" defaults="Dark" />
- </DropdownMenuRadioItem>
- </DropdownMenuRadioGroup>
- </DropdownMenuSubContent>
- </DropdownMenuPortal>
+ <DropdownMenuSubContent>
+ <DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
+ <DropdownMenuRadioItem value="system">
+ <Icon>
+ <MonitorIcon />
+ </Icon>
+ <Trans i18nKey="themeSystem" defaults="System" />
+ </DropdownMenuRadioItem>
+ <DropdownMenuRadioItem value="light">
+ <Icon>
+ <SunIcon />
+ </Icon>
+ <Trans i18nKey="themeLight" defaults="Light" />
+ </DropdownMenuRadioItem>
+ <DropdownMenuRadioItem value="dark">
+ <Icon>
+ <MoonIcon />
+ </Icon>
+ <Trans i18nKey="themeDark" defaults="Dark" />
+ </DropdownMenuRadioItem>
+ </DropdownMenuRadioGroup>
+ </DropdownMenuSubContent>
</DropdownMenuSub>
<DropdownMenuSeparator />
<DropdownMenuItem
diff --git a/apps/web/src/features/calendars/components/add-to-calendar-button.tsx b/apps/web/src/features/calendars/components/add-to-calendar-button.tsx
index 2fd566bba..43a100c63 100644
--- a/apps/web/src/features/calendars/components/add-to-calendar-button.tsx
+++ b/apps/web/src/features/calendars/components/add-to-calendar-button.tsx
@@ -29,61 +29,69 @@ export function AddToCalendarButton({
}) {
return (
<DropdownMenu modal={false}>
- <DropdownMenuTrigger asChild>
- <Button size={size} className={className}>
- <PlusIcon data-icon="inline-start" />
- <Trans i18nKey="addToCalendar" defaults="Add to Calendar" />
- </Button>
+ <DropdownMenuTrigger
+ render={<Button size={size} className={className} />}
+ >
+ <PlusIcon data-icon="inline-start" />
+ <Trans i18nKey="addToCalendar" defaults="Add to Calendar" />
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
- <DropdownMenuItem asChild>
- <a
- href={`/api/event/${eventId}/google-calendar`}
- target="_blank"
- rel="noopener noreferrer"
- >
- <GoogleCalendarIcon className="size-4" />
- Google Calendar
- </a>
+ <DropdownMenuItem
+ render={
+ <a
+ href={`/api/event/${eventId}/google-calendar`}
+ target="_blank"
+ rel="noopener noreferrer"
+ />
+ }
+ >
+ <GoogleCalendarIcon className="size-4" />
+ Google Calendar
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <a
- href={`/api/event/${eventId}/office365`}
- target="_blank"
- rel="noopener noreferrer"
- >
- <Microsoft365Icon className="size-4" />
- <Trans i18nKey="microsoft365" defaults="Microsoft 365" />
- </a>
+ <DropdownMenuItem
+ render={
+ <a
+ href={`/api/event/${eventId}/office365`}
+ target="_blank"
+ rel="noopener noreferrer"
+ />
+ }
+ >
+ <Microsoft365Icon className="size-4" />
+ <Trans i18nKey="microsoft365" defaults="Microsoft 365" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <a
- href={`/api/event/${eventId}/outlook`}
- target="_blank"
- rel="noopener noreferrer"
- >
- <OutlookIcon className="size-4" />
- <Trans i18nKey="outlook" defaults="Outlook" />
- </a>
+ <DropdownMenuItem
+ render={
+ <a
+ href={`/api/event/${eventId}/outlook`}
+ target="_blank"
+ rel="noopener noreferrer"
+ />
+ }
+ >
+ <OutlookIcon className="size-4" />
+ <Trans i18nKey="outlook" defaults="Outlook" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <a
- href={`/api/event/${eventId}/yahoo`}
- target="_blank"
- rel="noopener noreferrer"
- >
- <YahooIcon className="size-4" />
- <Trans i18nKey="yahoo" defaults="Yahoo" />
- </a>
+ <DropdownMenuItem
+ render={
+ <a
+ href={`/api/event/${eventId}/yahoo`}
+ target="_blank"
+ rel="noopener noreferrer"
+ />
+ }
+ >
+ <YahooIcon className="size-4" />
+ <Trans i18nKey="yahoo" defaults="Yahoo" />
</DropdownMenuItem>
<DropdownMenuSeparator />
- <DropdownMenuItem asChild>
- <a href={`/api/event/${eventId}/ics`} download>
- <Icon>
- <DownloadIcon />
- </Icon>
- <Trans i18nKey="downloadICSFile" defaults="Download ICS File" />
- </a>
+ <DropdownMenuItem
+ render={<a href={`/api/event/${eventId}/ics`} download />}
+ >
+ <Icon>
+ <DownloadIcon />
+ </Icon>
+ <Trans i18nKey="downloadICSFile" defaults="Download ICS File" />
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/apps/web/src/features/poll/components/discussion.tsx b/apps/web/src/features/poll/components/discussion.tsx
index 851aabd34..b152d9fc0 100644
--- a/apps/web/src/features/poll/components/discussion.tsx
+++ b/apps/web/src/features/poll/components/discussion.tsx
@@ -207,16 +207,18 @@ function DiscussionInner() {
</div>
{canDelete && (
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", {
- defaultValue: "More options",
- })}
- variant="ghost"
- size="icon-xs"
- >
- <MoreHorizontalIcon />
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon-xs"
+ />
+ }
+ >
+ <MoreHorizontalIcon />
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
<DropdownMenuItem
diff --git a/apps/web/src/features/poll/components/forms/poll-options-form/month-calendar/month-calendar.tsx b/apps/web/src/features/poll/components/forms/poll-options-form/month-calendar/month-calendar.tsx
index 25576ecfc..c51c63348 100644
--- a/apps/web/src/features/poll/components/forms/poll-options-form/month-calendar/month-calendar.tsx
+++ b/apps/web/src/features/poll/components/forms/poll-options-form/month-calendar/month-calendar.tsx
@@ -474,16 +474,18 @@ const MonthCalendar: React.FunctionComponent<DateTimePickerProps> = ({
{t("addTimeOption")}
</Button>
<DropdownMenu>
- <DropdownMenuTrigger asChild={true}>
- <Button
- aria-label={t("moreOptions", {
- defaultValue: "More options",
- })}
- variant="ghost"
- size="icon"
- >
- <MoreVerticalIcon />
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <MoreVerticalIcon />
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
<DropdownMenuItem
diff --git a/apps/web/src/features/poll/components/manage-poll.tsx b/apps/web/src/features/poll/components/manage-poll.tsx
index e43e53aec..38e7e3d56 100644
--- a/apps/web/src/features/poll/components/manage-poll.tsx
+++ b/apps/web/src/features/poll/components/manage-poll.tsx
@@ -129,35 +129,35 @@ const ManagePoll: React.FunctionComponent<{
return (
<>
<DropdownMenu modal={false}>
- <DropdownMenuTrigger asChild={true}>
- <Button variant="ghost" disabled={disabled}>
- <span>
- <Trans i18nKey="manage" />
- </span>
- <ChevronDownIcon data-icon="inline-end" />
- </Button>
+ <DropdownMenuTrigger
+ render={<Button variant="ghost" disabled={disabled} />}
+ >
+ <span>
+ <Trans i18nKey="manage" />
+ </span>
+ <ChevronDownIcon data-icon="inline-end" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
- <DropdownMenuItem asChild>
- <Link href={`/poll/${poll.id}/edit-details`}>
- <DropdownMenuItemIconLabel icon={PencilIcon}>
- <Trans i18nKey="editDetails" />
- </DropdownMenuItemIconLabel>
- </Link>
+ <DropdownMenuItem
+ render={<Link href={`/poll/${poll.id}/edit-details`} />}
+ >
+ <DropdownMenuItemIconLabel icon={PencilIcon}>
+ <Trans i18nKey="editDetails" />
+ </DropdownMenuItemIconLabel>
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <Link href={`/poll/${poll.id}/edit-options`}>
- <DropdownMenuItemIconLabel icon={TableIcon}>
- <Trans i18nKey="editOptions" />
- </DropdownMenuItemIconLabel>
- </Link>
+ <DropdownMenuItem
+ render={<Link href={`/poll/${poll.id}/edit-options`} />}
+ >
+ <DropdownMenuItemIconLabel icon={TableIcon}>
+ <Trans i18nKey="editOptions" />
+ </DropdownMenuItemIconLabel>
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <Link href={`/poll/${poll.id}/edit-settings`}>
- <DropdownMenuItemIconLabel icon={Settings2Icon}>
- <Trans i18nKey="editSettings" defaults="Edit settings" />
- </DropdownMenuItemIconLabel>
- </Link>
+ <DropdownMenuItem
+ render={<Link href={`/poll/${poll.id}/edit-settings`} />}
+ >
+ <DropdownMenuItemIconLabel icon={Settings2Icon}>
+ <Trans i18nKey="editSettings" defaults="Edit settings" />
+ </DropdownMenuItemIconLabel>
</DropdownMenuItem>
<DropdownMenuSeparator />
{poll.status === "scheduled" || poll.status === "canceled" ? null : (
diff --git a/apps/web/src/features/poll/components/participant-dropdown.tsx b/apps/web/src/features/poll/components/participant-dropdown.tsx
index 3afeec32b..0579cd49f 100644
--- a/apps/web/src/features/poll/components/participant-dropdown.tsx
+++ b/apps/web/src/features/poll/components/participant-dropdown.tsx
@@ -58,7 +58,7 @@ export const ParticipantDropdown = ({
};
align?: "start" | "end";
onEdit: () => void;
- children: React.ReactNode;
+ children: React.ReactElement;
}) => {
const [isChangeNameModalVisible, setIsChangeNameModalVisible] =
React.useState(false);
@@ -70,11 +70,9 @@ export const ParticipantDropdown = ({
<DropdownMenu modal={false}>
<DropdownMenuTrigger
disabled={disabled}
- asChild={true}
data-testid="participant-menu"
- >
- {children}
- </DropdownMenuTrigger>
+ render={children}
+ />
<DropdownMenuContent align={align}>
<DropdownMenuLabel>
<div className="grid gap-0.5">
diff --git a/apps/web/src/features/poll/components/polls-infinite-list.tsx b/apps/web/src/features/poll/components/polls-infinite-list.tsx
index 68b28440e..4ea13ce5c 100644
--- a/apps/web/src/features/poll/components/polls-infinite-list.tsx
+++ b/apps/web/src/features/poll/components/polls-infinite-list.tsx
@@ -131,19 +131,23 @@ function PollListItem({
)}
<CopyLinkButton href={shortUrl(`/invite/${id}`)} />
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", { defaultValue: "More options" })}
- variant="ghost"
- size="icon"
- >
- <MoreVerticalIcon />
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <MoreVerticalIcon />
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
{status === "open" && (
<DropdownMenuItem
- onSelect={() => {
+ onClick={() => {
toast.promise(closePoll.mutateAsync({ pollId: id }), {
loading: <Trans i18nKey="loading" defaults="Loading…" />,
success: (
@@ -160,7 +164,7 @@ function PollListItem({
)}
{status === "closed" && (
<DropdownMenuItem
- onSelect={() => {
+ onClick={() => {
toast.promise(reopenPoll.mutateAsync({ pollId: id }), {
loading: <Trans i18nKey="loading" defaults="Loading…" />,
success: (
@@ -178,7 +182,7 @@ function PollListItem({
<Trans i18nKey="reopenPoll" defaults="Reopen" />
</DropdownMenuItem>
)}
- <DropdownMenuItem onSelect={() => deletePollDialog.trigger()}>
+ <DropdownMenuItem onClick={() => deletePollDialog.trigger()}>
<Icon>
<TrashIcon />
</Icon>
diff --git a/apps/web/src/features/scheduled-event/components/scheduled-event-list.tsx b/apps/web/src/features/scheduled-event/components/scheduled-event-list.tsx
index 1c9a69811..f170c6e70 100644
--- a/apps/web/src/features/scheduled-event/components/scheduled-event-list.tsx
+++ b/apps/web/src/features/scheduled-event/components/scheduled-event-list.tsx
@@ -155,16 +155,20 @@ export function ScheduledEventListItem({
)}
{status !== "canceled" ? (
<DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label={t("moreOptions", { defaultValue: "More options" })}
- variant="ghost"
- size="icon"
- >
- <Icon>
- <MoreVerticalIcon />
- </Icon>
- </Button>
+ <DropdownMenuTrigger
+ render={
+ <Button
+ aria-label={t("moreOptions", {
+ defaultValue: "More options",
+ })}
+ variant="ghost"
+ size="icon"
+ />
+ }
+ >
+ <Icon>
+ <MoreVerticalIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
diff --git a/apps/web/src/features/space/components/space-dropdown.tsx b/apps/web/src/features/space/components/space-dropdown.tsx
index b076b3d48..397d0c42f 100644
--- a/apps/web/src/features/space/components/space-dropdown.tsx
+++ b/apps/web/src/features/space/components/space-dropdown.tsx
@@ -51,33 +51,35 @@ export function SpaceDropdown() {
return (
<>
<DropdownMenu>
- <DropdownMenuTrigger asChild={true}>
- <Button
- className={cn("flex h-auto w-full gap-2.5 p-2", {
- "pointer-events-none animate-pulse": setActiveSpace.isExecuting,
- })}
- variant="ghost"
- >
- <SpaceIcon
- src={activeSpace.image}
- name={activeSpace.name}
- size="lg"
+ <DropdownMenuTrigger
+ render={
+ <Button
+ className={cn("flex h-auto w-full gap-2.5 p-2", {
+ "pointer-events-none animate-pulse": setActiveSpace.isExecuting,
+ })}
+ variant="ghost"
/>
- <div className="min-w-0 flex-1 px-0.5 text-left">
- <div className="truncate font-medium text-sm">
- {activeSpace.name}
- </div>
- <div className="text-xs">
- <SpaceTierLabel tier={activeSpace.tier} />
- </div>
+ }
+ >
+ <SpaceIcon
+ src={activeSpace.image}
+ name={activeSpace.name}
+ size="lg"
+ />
+ <div className="min-w-0 flex-1 px-0.5 text-left">
+ <div className="truncate font-medium text-sm">
+ {activeSpace.name}
</div>
- <Icon>
- <ChevronsUpDownIcon />
- </Icon>
- </Button>
+ <div className="text-xs">
+ <SpaceTierLabel tier={activeSpace.tier} />
+ </div>
+ </div>
+ <Icon>
+ <ChevronsUpDownIcon />
+ </Icon>
</DropdownMenuTrigger>
<DropdownMenuContent
- className="min-w-[var(--radix-dropdown-menu-trigger-width)]"
+ className="min-w-[var(--anchor-width)]"
align="start"
>
<DropdownMenuLabel>
@@ -108,21 +110,17 @@ export function SpaceDropdown() {
<Trans i18nKey="createSpace" defaults="Create Space" />
</DropdownMenuItem>
<DropdownMenuSeparator />
- <DropdownMenuItem asChild>
- <Link href="/settings/general">
- <Icon>
- <SettingsIcon />
- </Icon>
- <Trans i18nKey="spaceSettings" defaults="Space Settings" />
- </Link>
+ <DropdownMenuItem render={<Link href="/settings/general" />}>
+ <Icon>
+ <SettingsIcon />
+ </Icon>
+ <Trans i18nKey="spaceSettings" defaults="Space Settings" />
</DropdownMenuItem>
- <DropdownMenuItem asChild>
- <Link href="/settings/members">
- <Icon>
- <UserPlusIcon />
- </Icon>
- <Trans i18nKey="spaceInviteMember" defaults="Invite Member" />
- </Link>
+ <DropdownMenuItem render={<Link href="/settings/members" />}>
+ <Icon>
+ <UserPlusIcon />
+ </Icon>
+ <Trans i18nKey="spaceInviteMember" defaults="Invite Member" />
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/apps/web/src/features/user/components/user-dropdown.tsx b/apps/web/src/features/user/components/user-dropdown.tsx
index 243c71e12..198fe5b6c 100644
--- a/apps/web/src/features/user/components/user-dropdown.tsx
+++ b/apps/web/src/features/user/components/user-dropdown.tsx
@@ -6,7 +6,6 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
- DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
@@ -72,17 +71,17 @@ export const UserDropdown = ({ className }: { className?: string }) => {
<DropdownMenu modal={false}>
<DropdownMenuTrigger
data-testid="user-dropdown"
- asChild
className={cn("group min-w-0", className)}
+ render={
+ <Button
+ aria-label={t("accountMenu", { defaultValue: "Account menu" })}
+ variant="ghost"
+ className="rounded-full"
+ size="icon"
+ />
+ }
>
- <Button
- aria-label={t("accountMenu", { defaultValue: "Account menu" })}
- variant="ghost"
- className="rounded-full"
- size="icon"
- >
- <OptimizedAvatarImage src={image} name={name} size="sm" />
- </Button>
+ <OptimizedAvatarImage src={image} name={name} size="sm" />
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="min-w-48">
<DropdownMenuLabel className="flex items-center gap-2">
@@ -97,40 +96,54 @@ export const UserDropdown = ({ className }: { className?: string }) => {
</div>
</DropdownMenuLabel>
<DropdownMenuSeparator />
- <DropdownMenuItem asChild={true}>
- <Link href="/polls" className="flex items-center gap-x-2 sm:hidden">
- <ListIcon className="size-4 text-muted-foreground" />
- <Trans i18nKey="polls" defaults="Polls" />
- </Link>
+ <DropdownMenuItem
+ render={
+ <Link
+ href="/polls"
+ className="flex items-center gap-x-2 sm:hidden"
+ />
+ }
+ >
+ <ListIcon className="size-4 text-muted-foreground" />
+ <Trans i18nKey="polls" defaults="Polls" />
</DropdownMenuItem>
- <DropdownMenuItem asChild={true}>
- <Link href="/settings/profile" className="flex items-center gap-x-2">
- <UserIcon className="size-4 text-muted-foreground" />
- <Trans i18nKey="profile" defaults="Profile" />
- </Link>
+ <DropdownMenuItem
+ render={
+ <Link
+ href="/settings/profile"
+ className="flex items-center gap-x-2"
+ />
+ }
+ >
+ <UserIcon className="size-4 text-muted-foreground" />
+ <Trans i18nKey="profile" defaults="Profile" />
</DropdownMenuItem>
- <DropdownMenuItem asChild={true}>
- <Link
- href="/settings/preferences"
- className="flex items-center gap-x-2"
- >
- <Settings2Icon className="size-4 text-muted-foreground" />
- <Trans i18nKey="preferences" defaults="Preferences" />
- </Link>
+ <DropdownMenuItem
+ render={
+ <Link
+ href="/settings/preferences"
+ className="flex items-center gap-x-2"
+ />
+ }
+ >
+ <Settings2Icon className="size-4 text-muted-foreground" />
+ <Trans i18nKey="preferences" defaults="Preferences" />
</DropdownMenuItem>
- <DropdownMenuItem asChild={true}>
- <Link
- target="_blank"
- href="https://support.rallly.co"
- className="flex items-center gap-x-2"
- >
- <LifeBuoyIcon className="size-4 text-muted-foreground" />
- <Trans i18nKey="support" defaults="Support" />
- <Icon>
- <ArrowUpRight />
- </Icon>
- </Link>
+ <DropdownMenuItem
+ render={
+ <Link
+ target="_blank"
+ href="https://support.rallly.co"
+ className="flex items-center gap-x-2"
+ />
+ }
+ >
+ <LifeBuoyIcon className="size-4 text-muted-foreground" />
+ <Trans i18nKey="support" defaults="Support" />
+ <Icon>
+ <ArrowUpRight />
+ </Icon>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuSub>
@@ -140,30 +153,28 @@ export const UserDropdown = ({ className }: { className?: string }) => {
</Icon>
<Trans i18nKey="theme" defaults="Theme" />
</DropdownMenuSubTrigger>
- <DropdownMenuPortal>
- <DropdownMenuSubContent>
- <DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
- <DropdownMenuRadioItem value="system">
- <Icon>
- <MonitorIcon />
- </Icon>
- <Trans i18nKey="themeSystem" defaults="System" />
- </DropdownMenuRadioItem>
- <DropdownMenuRadioItem value="light">
- <Icon>
- <SunIcon />
- </Icon>
- <Trans i18nKey="themeLight" defaults="Light" />
- </DropdownMenuRadioItem>
- <DropdownMenuRadioItem value="dark">
- <Icon>
- <MoonIcon />
- </Icon>
- <Trans i18nKey="themeDark" defaults="Dark" />
- </DropdownMenuRadioItem>
- </DropdownMenuRadioGroup>
- </DropdownMenuSubContent>
- </DropdownMenuPortal>
+ <DropdownMenuSubContent>
+ <DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
+ <DropdownMenuRadioItem value="system">
+ <Icon>
+ <MonitorIcon />
+ </Icon>
+ <Trans i18nKey="themeSystem" defaults="System" />
+ </DropdownMenuRadioItem>
+ <DropdownMenuRadioItem value="light">
+ <Icon>
+ <SunIcon />
+ </Icon>
+ <Trans i18nKey="themeLight" defaults="Light" />
+ </DropdownMenuRadioItem>
+ <DropdownMenuRadioItem value="dark">
+ <Icon>
+ <MoonIcon />
+ </Icon>
+ <Trans i18nKey="themeDark" defaults="Dark" />
+ </DropdownMenuRadioItem>
+ </DropdownMenuRadioGroup>
+ </DropdownMenuSubContent>
</DropdownMenuSub>
<DropdownMenuSeparator />
<DropdownMenuItem
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 086a9e822..9f1fb78d9 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -19,7 +19,6 @@
"dependencies": {
"@base-ui/react": "^1.2.0",
"@radix-ui/react-avatar": "^1.1.0",
- "@radix-ui/react-dropdown-menu": "^2.0.4",
"@radix-ui/react-popover": "^1.0.5",
"@radix-ui/react-portal": "^1.1.6",
"@radix-ui/react-slot": "^1.1.2",
diff --git a/packages/ui/src/dropdown-menu.tsx b/packages/ui/src/dropdown-menu.tsx
index 781a4b733..914ef5bf9 100644
--- a/packages/ui/src/dropdown-menu.tsx
+++ b/packages/ui/src/dropdown-menu.tsx
@@ -1,101 +1,63 @@
"use client";
-import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
+import { Menu as MenuPrimitive } from "@base-ui/react/menu";
import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import { CheckIcon, ChevronRightIcon } from "lucide-react";
-import * as React from "react";
+import type * as React from "react";
import { Icon } from "./icon";
import { cn } from "./lib/utils";
-const DropdownMenu = DropdownMenuPrimitive.Root;
-
-const DropdownMenuTrigger = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.Trigger>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>
->(({ ...props }, ref) => (
- <DropdownMenuPrimitive.Trigger
- ref={ref}
- {...props}
- onFocusCapture={(e) => {
- e.stopPropagation();
- }}
- />
-));
-DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
-const DropdownMenuGroup = DropdownMenuPrimitive.Group;
-
-const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
-
-const DropdownMenuSub = DropdownMenuPrimitive.Sub;
-
-const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
-
-const DropdownMenuSubTrigger = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
- inset?: boolean;
- }
->(({ className, inset, children, ...props }, ref) => (
- <DropdownMenuPrimitive.SubTrigger
- ref={ref}
- className={cn(
- dropdownMenuItemVariants({ variant: "default" }),
- inset && "pl-8",
- className,
- )}
- {...props}
- >
- {children}
- <ChevronRightIcon className="ml-auto size-4" />
- </DropdownMenuPrimitive.SubTrigger>
-));
-DropdownMenuSubTrigger.displayName =
- DropdownMenuPrimitive.SubTrigger.displayName;
-
-const DropdownMenuSubContent = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
->(({ className, ...props }, ref) => (
- <DropdownMenuPrimitive.SubContent
- ref={ref}
- className={cn(
- "data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 z-50 min-w-32 animate-in overflow-hidden rounded-xl border border-popover-border bg-popover p-1 text-popover-foreground shadow-md",
- className,
- )}
- {...props}
- />
-));
-DropdownMenuSubContent.displayName =
- DropdownMenuPrimitive.SubContent.displayName;
-
-const DropdownMenuContent = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.Content>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
->(({ className, sideOffset = 4, ...props }, ref) => (
- <DropdownMenuPrimitive.Portal>
- <DropdownMenuPrimitive.Content
- ref={ref}
- sideOffset={sideOffset}
- className={cn(
- "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[100px] animate-in overflow-hidden rounded-xl border border-popover-border bg-popover p-1 text-popover-foreground shadow-md",
- className,
- )}
- {...props}
- />
- </DropdownMenuPrimitive.Portal>
-));
-DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
+function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
+ return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
+}
-export const dropdownMenuItemVariants = cva(
- "relative flex cursor-default select-none items-center gap-x-2.5 rounded-lg px-2 py-1.5 text-sm outline-hidden focus:bg-popover-accent focus:ring-1 focus:ring-menu-item-outline focus:ring-inset data-disabled:pointer-events-none data-disabled:opacity-50",
+function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
+ return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
+}
+function DropdownMenuContent({
+ className,
+ side,
+ sideOffset = 4,
+ align,
+ alignOffset,
+ ...props
+}: MenuPrimitive.Popup.Props &
+ Pick<
+ MenuPrimitive.Positioner.Props,
+ "side" | "sideOffset" | "align" | "alignOffset"
+ >) {
+ return (
+ <MenuPrimitive.Portal>
+ <MenuPrimitive.Positioner
+ side={side}
+ sideOffset={sideOffset}
+ align={align}
+ alignOffset={alignOffset}
+ className="isolate z-50"
+ >
+ <MenuPrimitive.Popup
+ data-slot="dropdown-menu-content"
+ className={cn(
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[100px] animate-in overflow-hidden rounded-xl border border-popover-border bg-popover p-1 text-popover-foreground shadow-md",
+ className,
+ )}
+ {...props}
+ />
+ </MenuPrimitive.Positioner>
+ </MenuPrimitive.Portal>
+ );
+}
+
+const dropdownMenuItemVariants = cva(
+ "relative flex cursor-default select-none items-center gap-x-2.5 rounded-lg px-2 py-1.5 text-sm outline-hidden data-disabled:pointer-events-none data-highlighted:bg-popover-accent data-disabled:opacity-50 data-highlighted:ring-1 data-highlighted:ring-menu-item-outline data-highlighted:ring-inset",
{
variants: {
variant: {
default: "",
- destructive: "text-destructive focus:bg-popover-accent",
+ destructive: "text-destructive",
},
},
defaultVariants: {
@@ -104,141 +66,159 @@ export const dropdownMenuItemVariants = cva(
},
);
-const DropdownMenuItem = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.Item>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> &
- VariantProps<typeof dropdownMenuItemVariants> & {
- inset?: boolean;
- }
->(({ className, inset, variant, ...props }, ref) => (
- <DropdownMenuPrimitive.Item
- ref={ref}
- className={cn(
- dropdownMenuItemVariants({ variant }),
- inset && "pl-8",
- className,
- )}
- {...props}
- />
-));
-DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
-
-const DropdownMenuCheckboxItem = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
->(({ className, children, checked, ...props }, ref) => (
- <DropdownMenuPrimitive.CheckboxItem
- ref={ref}
- className={cn(dropdownMenuItemVariants({ variant: "default" }), className)}
- checked={checked}
- {...props}
- >
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
- <DropdownMenuPrimitive.ItemIndicator>
- <Icon>
- <CheckIcon />
- </Icon>
- </DropdownMenuPrimitive.ItemIndicator>
- </span>
- <span className="flex items-center gap-2 text-sm">{children}</span>
- </DropdownMenuPrimitive.CheckboxItem>
-));
-DropdownMenuCheckboxItem.displayName =
- DropdownMenuPrimitive.CheckboxItem.displayName;
-
-const DropdownMenuRadioItem = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
->(({ className, children, ...props }, ref) => (
- <DropdownMenuPrimitive.RadioItem
- ref={ref}
- className={cn(dropdownMenuItemVariants({ variant: "default" }), className)}
- {...props}
- >
- <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
- <DropdownMenuPrimitive.ItemIndicator>
- <Icon>
- <CheckIcon />
- </Icon>
- </DropdownMenuPrimitive.ItemIndicator>
- </span>
- {children}
- </DropdownMenuPrimitive.RadioItem>
-));
-DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
-
-const DropdownMenuLabel = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.Label>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
- inset?: boolean;
- }
->(({ className, inset, ...props }, ref) => (
- <DropdownMenuPrimitive.Label
- ref={ref}
- className={cn(
- "px-2 py-1.5 text-muted-foreground text-xs",
- inset && "pl-8",
- className,
- )}
- {...props}
- />
-));
-DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
-
-const DropdownMenuSeparator = React.forwardRef<
- React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
->(({ className, ...props }, ref) => (
- <DropdownMenuPrimitive.Separator
- ref={ref}
- className={cn("-mx-1 my-1 h-px bg-popover-border", className)}
- {...props}
- />
-));
-DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
-
-const DropdownMenuShortcut = ({
+function DropdownMenuItem({
className,
+ variant,
...props
-}: React.HTMLAttributes<HTMLSpanElement>) => {
+}: MenuPrimitive.Item.Props & VariantProps<typeof dropdownMenuItemVariants>) {
return (
- <span
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
+ <MenuPrimitive.Item
+ data-slot="dropdown-menu-item"
+ className={cn(dropdownMenuItemVariants({ variant }), className)}
{...props}
/>
);
-};
-DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
+}
+
+function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
+ return (
+ <MenuPrimitive.RadioGroup
+ data-slot="dropdown-menu-radio-group"
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuRadioItem({
+ className,
+ children,
+ ...props
+}: MenuPrimitive.RadioItem.Props) {
+ return (
+ <MenuPrimitive.RadioItem
+ data-slot="dropdown-menu-radio-item"
+ className={cn(
+ dropdownMenuItemVariants({ variant: "default" }),
+ className,
+ )}
+ closeOnClick
+ {...props}
+ >
+ <span className="absolute right-2 flex h-3.5 w-3.5 items-center justify-center">
+ <MenuPrimitive.RadioItemIndicator>
+ <Icon>
+ <CheckIcon />
+ </Icon>
+ </MenuPrimitive.RadioItemIndicator>
+ </span>
+ {children}
+ </MenuPrimitive.RadioItem>
+ );
+}
+
+function DropdownMenuLabel({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="dropdown-menu-label"
+ className={cn("px-2 py-1.5 text-muted-foreground text-xs", className)}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuSeparator({
+ className,
+ ...props
+}: MenuPrimitive.Separator.Props) {
+ return (
+ <MenuPrimitive.Separator
+ data-slot="dropdown-menu-separator"
+ className={cn("-mx-1 my-1 h-px bg-popover-border", className)}
+ {...props}
+ />
+ );
+}
+
+function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
+ return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
+}
+
+function DropdownMenuSubTrigger({
+ className,
+ children,
+ ...props
+}: MenuPrimitive.SubmenuTrigger.Props) {
+ return (
+ <MenuPrimitive.SubmenuTrigger
+ data-slot="dropdown-menu-sub-trigger"
+ className={cn(
+ dropdownMenuItemVariants({ variant: "default" }),
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRightIcon className="ml-auto size-4" />
+ </MenuPrimitive.SubmenuTrigger>
+ );
+}
+
+function DropdownMenuSubContent({
+ className,
+ sideOffset,
+ alignOffset,
+ ...props
+}: MenuPrimitive.Popup.Props &
+ Pick<MenuPrimitive.Positioner.Props, "sideOffset" | "alignOffset">) {
+ return (
+ <MenuPrimitive.Portal>
+ <MenuPrimitive.Positioner
+ sideOffset={sideOffset}
+ alignOffset={alignOffset}
+ className="isolate z-50"
+ >
+ <MenuPrimitive.Popup
+ data-slot="dropdown-menu-sub-content"
+ className={cn(
+ "data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1 z-50 min-w-32 animate-in overflow-hidden rounded-xl border border-popover-border bg-popover p-1 text-popover-foreground shadow-md",
+ className,
+ )}
+ {...props}
+ />
+ </MenuPrimitive.Positioner>
+ </MenuPrimitive.Portal>
+ );
+}
+
+function DropdownMenuItemIconLabel({
+ icon: IconComponent,
+ children,
+}: {
+ icon: React.ComponentType<{ className?: string }>;
+ children: React.ReactNode;
+}) {
+ return (
+ <span className="flex items-center gap-2.5">
+ <IconComponent className="size-4 text-muted-foreground" />
+ {children}
+ </span>
+ );
+}
export {
DropdownMenu,
- DropdownMenuCheckboxItem,
DropdownMenuContent,
- DropdownMenuGroup,
DropdownMenuItem,
+ DropdownMenuItemIconLabel,
DropdownMenuLabel,
- DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
- DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
};
-
-export const DropdownMenuItemIconLabel = ({
- icon: Icon,
- children,
-}: {
- icon: React.ComponentType<{ className?: string }>;
- children: React.ReactNode;
-}) => {
- return (
- <span className="flex items-center gap-2.5">
- <Icon className="size-4 text-muted-foreground" />
- {children}
- </span>
- );
-};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 83f13f2d8..8734d642b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -94,7 +94,7 @@ importers:
version: 8.1.0([email protected])
'@vercel/analytics':
specifier: ^1.5.0
dayjs:
specifier: ^1.11.13
version: 1.11.19
@@ -133,7 +133,7 @@ importers:
version: 6.0.0(@types/[email protected])([email protected])
next-seo:
specifier: ^6.1.0
pg:
specifier: ^8.17.1
version: 8.18.0
@@ -761,9 +761,6 @@ importers:
'@radix-ui/react-avatar':
specifier: ^1.1.0
- '@radix-ui/react-dropdown-menu':
- specifier: ^2.0.4
'@radix-ui/react-popover':
specifier: ^1.0.5
@@ -3580,19 +3577,6 @@ packages:
'@types/react-dom':
optional: true
- '@radix-ui/[email protected]':
- resolution: {integrity: sha512-1PLGQEynI/3OX/ftV54COn+3Sud/Mn8vALg2rWnBLnRaGtJDduNW/22XjlGgPdpcIbiQxjKtb7BkcjP00nqfJw==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
'@radix-ui/[email protected]':
resolution: {integrity: sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw==}
peerDependencies:
@@ -3624,19 +3608,6 @@ packages:
'@types/react':
optional: true
- '@radix-ui/[email protected]':
- resolution: {integrity: sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg==}
- peerDependencies:
- '@types/react': '*'
- '@types/react-dom': '*'
- react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
'@radix-ui/[email protected]':
resolution: {integrity: sha512-kr0X2+6Yy/vJzLYJUPCZEc8SfQcf+1COFoAqauJm74umQhta9M7lNJHP7QQS3vkvcGLQUbWpMzwrXYwrYztHKA==}
peerDependencies:
@@ -14835,21 +14806,6 @@ snapshots:
'@types/react': 19.2.13
'@types/react-dom': 19.2.3(@types/[email protected])
- dependencies:
- '@radix-ui/primitive': 1.1.3
- '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
- '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- optionalDependencies:
- '@types/react': 19.2.13
- '@types/react-dom': 19.2.3(@types/[email protected])
-
dependencies:
react: 19.2.6
@@ -14874,32 +14830,6 @@ snapshots:
optionalDependencies:
'@types/react': 19.2.13
- dependencies:
- '@radix-ui/primitive': 1.1.3
- '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-direction': 1.1.1(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-focus-guards': 1.1.3(@types/[email protected])([email protected])
- '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
- '@radix-ui/react-roving-focus': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
- '@radix-ui/react-use-callback-ref': 1.1.1(@types/[email protected])([email protected])
- aria-hidden: 1.2.6
- react: 19.2.6
- react-dom: 19.2.6([email protected])
- react-remove-scroll: 2.7.2(@types/[email protected])([email protected])
- optionalDependencies:
- '@types/react': 19.2.13
- '@types/react-dom': 19.2.3(@types/[email protected])
-
dependencies:
'@radix-ui/primitive': 1.1.3
@@ -17831,7 +17761,7 @@ snapshots:
dependencies:
uncrypto: 0.1.3
optionalDependencies:
react: 19.2.6
@@ -21591,7 +21521,7 @@ snapshots:
react: 19.2.6
react-dom: 19.2.6([email protected])
dependencies:
react: 19.2.6