Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
♻️ Migrate Radio Group to Base UI (#2586)
Luke Vella0c90a90ed14d
diff --git a/apps/web/package.json b/apps/web/package.jsonindex 16a174e6a..b36e65191 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -32,7 +32,6 @@"@next/env": "16.2.6","@prisma/adapter-pg": "^7.8.0","@prisma/client": "^7.8.0",- "@radix-ui/react-radio-group": "^1.2.3","@radix-ui/react-select": "^2.2.2","@radix-ui/react-slot": "^1.1.2","@rallly/billing": "workspace:*",diff --git a/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx b/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsxindex 0085bea5d..733ee4708 100644--- a/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx+++ b/apps/web/src/app/[locale]/(space)/settings/preferences/components/theme-preference.tsx@@ -16,7 +16,7 @@ function ThemeOption({return (<labelkey={value}- className="flex aspect-video flex-1 flex-col items-center justify-center gap-4 rounded-lg border border-card-border bg-card p-4 transition-colors hover:bg-card-accent has-data-[state=checked]:border-primary/50 has-data-[state=checked]:bg-linear-to-b has-data-[state=checked]:from-primary/10 has-data-[state=checked]:to-primary/5 has-data-[state=checked]:ring-primary [&>svg]:size-5"+ className="flex aspect-video flex-1 flex-col items-center justify-center gap-4 rounded-lg border border-card-border bg-card p-4 transition-colors hover:bg-card-accent has-data-checked:border-primary/50 has-data-checked:bg-linear-to-b has-data-checked:from-primary/10 has-data-checked:to-primary/5 has-data-checked:ring-primary [&>svg]:size-5"htmlFor={value}><RadioGroupItem value={value} id={value} className="peer sr-only" />diff --git a/apps/web/src/features/billing/components/pay-wall-dialog.tsx b/apps/web/src/features/billing/components/pay-wall-dialog.tsxindex ce0bc18f1..17cb11de7 100644--- a/apps/web/src/features/billing/components/pay-wall-dialog.tsx+++ b/apps/web/src/features/billing/components/pay-wall-dialog.tsx@@ -85,7 +85,7 @@ function PlanRadioGroupItem({return (<labelhtmlFor={id}- className="flex cursor-pointer items-center justify-between gap-4 rounded-lg border border-popover-border p-4 transition-colors has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:ring-primary"+ className="flex cursor-pointer items-center justify-between gap-4 rounded-lg border border-popover-border p-4 transition-colors has-data-checked:border-primary has-data-checked:bg-primary/5 has-data-checked:ring-primary"><RadioGroupItem value={value} id={id} /><div className="flex-1">diff --git a/apps/web/src/features/event-types/components/event-type-form.tsx b/apps/web/src/features/event-types/components/event-type-form.tsxindex afb8b2824..53c8807ed 100644--- a/apps/web/src/features/event-types/components/event-type-form.tsx+++ b/apps/web/src/features/event-types/components/event-type-form.tsx@@ -440,9 +440,9 @@ function RadioCardOption({return (<labelhtmlFor={id}- className="group flex cursor-pointer items-center gap-2 rounded-lg border border-input bg-card px-3 py-2.5 text-sm transition-colors hover:bg-accent has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5"+ className="group flex cursor-pointer items-center gap-2 rounded-lg border border-input bg-card px-3 py-2.5 text-sm transition-colors hover:bg-accent has-data-checked:border-primary has-data-checked:bg-primary/5">- <span className="text-muted-foreground group-has-data-[state=checked]:text-primary">+ <span className="text-muted-foreground group-has-data-checked:text-primary">{icon}</span><span className="flex-1 font-normal">{label}</span>diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 20a79ab31..e0f4587eb 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -23,7 +23,6 @@"@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-radio-group": "^1.2.3","@radix-ui/react-select": "^2.2.2","@radix-ui/react-slot": "^1.1.2","@radix-ui/react-tabs": "^1.0.4",diff --git a/packages/ui/src/radio-group.tsx b/packages/ui/src/radio-group.tsxindex c00f286e8..5597a1c8b 100644--- a/packages/ui/src/radio-group.tsx+++ b/packages/ui/src/radio-group.tsx@@ -1,44 +1,39 @@"use client";-import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";+import { Radio as RadioPrimitive } from "@base-ui/react/radio";+import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";import { CircleIcon } from "lucide-react";-import * as React from "react";import { cn } from "./lib/utils";-const RadioGroup = React.forwardRef<- React.ElementRef<typeof RadioGroupPrimitive.Root>,- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>->(({ className, ...props }, ref) => {+function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {return (- <RadioGroupPrimitive.Root+ <RadioGroupPrimitive+ data-slot="radio-group"className={cn("grid gap-2", className)}{...props}- ref={ref}/>);-});-RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;+}-const RadioGroupItem = React.forwardRef<- React.ElementRef<typeof RadioGroupPrimitive.Item>,- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>->(({ className, ...props }, ref) => {+function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {return (- <RadioGroupPrimitive.Item- ref={ref}+ <RadioPrimitive.Root+ data-slot="radio-group-item"className={cn(- "aspect-square size-4 rounded-full border border-input bg-background text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",+ "flex aspect-square size-4 shrink-0 items-center justify-center rounded-full border border-input bg-background text-primary ring-offset-background focus:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",className,)}{...props}>- <RadioGroupPrimitive.Indicator className="flex items-center justify-center">+ <RadioPrimitive.Indicator+ data-slot="radio-group-indicator"+ className="flex items-center justify-center"+ ><CircleIcon className="h-2.5 w-2.5 fill-current text-current" />- </RadioGroupPrimitive.Indicator>- </RadioGroupPrimitive.Item>+ </RadioPrimitive.Indicator>+ </RadioPrimitive.Root>);-});-RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;+}export { RadioGroup, RadioGroupItem };diff --git a/packages/ui/src/radio-pills.tsx b/packages/ui/src/radio-pills.tsxindex f14f31b15..f5d3929f3 100644--- a/packages/ui/src/radio-pills.tsx+++ b/packages/ui/src/radio-pills.tsx@@ -1,35 +1,31 @@"use client";-import * as Primitive from "@radix-ui/react-radio-group";-import * as React from "react";+import { Radio as RadioPrimitive } from "@base-ui/react/radio";+import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";import { cn } from "./lib/utils";-const RadioPills = React.forwardRef<- React.ElementRef<typeof Primitive.Root>,- React.ComponentPropsWithoutRef<typeof Primitive.Root>->(({ className, ...props }, ref) => (- <Primitive.Root- ref={ref}- className={cn("display flex items-center gap-x-2", className)}- {...props}- />-));-RadioPills.displayName = Primitive.Root.displayName;+function RadioPills({ className, ...props }: RadioGroupPrimitive.Props) {+ return (+ <RadioGroupPrimitive+ data-slot="radio-pills"+ className={cn("display flex items-center gap-x-2", className)}+ {...props}+ />+ );+}-const RadioPillsItem = React.forwardRef<- React.ElementRef<typeof Primitive.Item>,- React.ComponentPropsWithoutRef<typeof Primitive.Item>->(({ className, ...props }, ref) => (- <Primitive.Item- ref={ref}- className={cn(- "h-8 rounded-full border px-3 font-medium text-muted-foreground text-sm data-[state=checked]:border-primary data-[state=checked]:text-primary data-[state=unchecked]:hover:text-foreground",- className,- )}- {...props}- />-));-RadioPillsItem.displayName = Primitive.Item.displayName;+function RadioPillsItem({ className, ...props }: RadioPrimitive.Root.Props) {+ return (+ <RadioPrimitive.Root+ data-slot="radio-pills-item"+ className={cn(+ "inline-flex h-8 cursor-pointer items-center rounded-full border px-3 font-medium text-muted-foreground text-sm data-checked:border-primary data-checked:text-primary data-unchecked:hover:text-foreground",+ className,+ )}+ {...props}+ />+ );+}export { RadioPills as RadioCards, RadioPillsItem as RadioCardsItem };diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex cb982266a..b912d10a4 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -228,9 +228,6 @@ importers:'@prisma/client':specifier: ^7.8.0version: 7.8.0([email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])- '@radix-ui/react-radio-group':- specifier: ^1.2.3- version: 1.3.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-select':specifier: ^2.2.2version: 2.2.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])@@ -779,9 +776,6 @@ importers:'@radix-ui/react-portal':specifier: ^1.1.6version: 1.1.10(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])- '@radix-ui/react-radio-group':- specifier: ^1.2.3- version: 1.3.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-select':specifier: ^2.2.2version: 2.2.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])