Skip to content

Commit ba0a64d

Browse files
authored
chore: move to using radix-ui over @radix-ui/react-* (#23911)
This pull-request moves using to using the plain `radix-ui` package over `@radix-ui/react-*` packages. Put simply, now we're not going to run into issues with inconsistent radix dependencies. This will have no effect to how the code is built, but will give us a single place to import from.
1 parent 7757cd8 commit ba0a64d

24 files changed

Lines changed: 613 additions & 223 deletions

File tree

.github/dependabot.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ updates:
8282
mui:
8383
patterns:
8484
- "@mui*"
85-
radix:
86-
patterns:
87-
- "@radix-ui/*"
8885
react:
8986
patterns:
9087
- "react"

site/package.json

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,6 @@
6363
"@mui/x-tree-view": "7.29.10",
6464
"@novnc/novnc": "^1.5.0",
6565
"@pierre/diffs": "1.1.0-beta.19",
66-
"@radix-ui/react-avatar": "1.1.11",
67-
"@radix-ui/react-checkbox": "1.3.3",
68-
"@radix-ui/react-collapsible": "1.1.12",
69-
"@radix-ui/react-dialog": "1.1.15",
70-
"@radix-ui/react-dropdown-menu": "2.1.16",
71-
"@radix-ui/react-label": "2.1.8",
72-
"@radix-ui/react-popover": "1.1.15",
73-
"@radix-ui/react-radio-group": "1.3.8",
74-
"@radix-ui/react-scroll-area": "1.2.10",
75-
"@radix-ui/react-select": "2.2.6",
76-
"@radix-ui/react-separator": "1.1.8",
77-
"@radix-ui/react-slider": "1.3.6",
78-
"@radix-ui/react-slot": "1.2.4",
79-
"@radix-ui/react-switch": "1.2.6",
80-
"@radix-ui/react-tabs": "1.1.13",
81-
"@radix-ui/react-tooltip": "1.2.8",
8266
"@tanstack/react-query-devtools": "5.77.0",
8367
"@xterm/addon-canvas": "0.7.0",
8468
"@xterm/addon-fit": "0.10.0",
@@ -109,6 +93,7 @@
10993
"monaco-editor": "0.55.1",
11094
"motion": "12.34.1",
11195
"pretty-bytes": "6.1.1",
96+
"radix-ui": "1.4.3",
11297
"react": "19.2.2",
11398
"react-color": "2.19.3",
11499
"react-confetti": "6.4.0",

site/pnpm-lock.yaml

Lines changed: 583 additions & 171 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/components/Avatar/Avatar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
* It was also simplified to make usage easier and reduce boilerplate.
1010
* @see {@link https://github.com/coder/coder/pull/15930#issuecomment-2552292440}
1111
*/
12-
1312
import { useTheme } from "@emotion/react";
14-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
1513
import { cva, type VariantProps } from "class-variance-authority";
14+
import { Avatar as AvatarPrimitive } from "radix-ui";
1615
import { getExternalImageStylesFromUrl } from "#/theme/externalImages";
1716
import { cn } from "#/utils/cn";
1817

site/src/components/Badge/Badge.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copied from shadc/ui on 11/13/2024
33
* @see {@link https://ui.shadcn.com/docs/components/badge}
44
*/
5-
import { Slot } from "@radix-ui/react-slot";
65
import { cva, type VariantProps } from "class-variance-authority";
6+
import { Slot } from "radix-ui";
77
import { cn } from "#/utils/cn";
88

99
const badgeVariants = cva(
@@ -78,7 +78,7 @@ export const Badge: React.FC<BadgeProps> = ({
7878
asChild = false,
7979
...props
8080
}) => {
81-
const Comp = asChild ? Slot : "div";
81+
const Comp = asChild ? Slot.Root : "div";
8282

8383
return (
8484
<Comp

site/src/components/Breadcrumb/Breadcrumb.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copied from shadc/ui on 12/13/2024
33
* @see {@link https://ui.shadcn.com/docs/components/breadcrumb}
44
*/
5-
import { Slot } from "@radix-ui/react-slot";
65
import { MoreHorizontal } from "lucide-react";
6+
import { Slot } from "radix-ui";
77
import { cn } from "#/utils/cn";
88

99
type BreadcrumbProps = React.ComponentPropsWithRef<"nav"> & {
@@ -53,7 +53,7 @@ export const BreadcrumbLink: React.FC<BreadcrumbLinkProps> = ({
5353
className,
5454
...props
5555
}) => {
56-
const Comp = asChild ? Slot : "a";
56+
const Comp = asChild ? Slot.Root : "a";
5757

5858
return (
5959
<Comp

site/src/components/Button/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copied from shadc/ui on 11/06/2024
33
* @see {@link https://ui.shadcn.com/docs/components/button}
44
*/
5-
import { Slot } from "@radix-ui/react-slot";
65
import { cva, type VariantProps } from "class-variance-authority";
6+
import { Slot } from "radix-ui";
77
import { cn } from "#/utils/cn";
88

99
// Be careful when changing the child styles from the button such as images
@@ -69,7 +69,7 @@ export const Button: React.FC<ButtonProps> = ({
6969
asChild = false,
7070
...props
7171
}) => {
72-
const Comp = asChild ? Slot : "button";
72+
const Comp = asChild ? Slot.Root : "button";
7373

7474
// We want `type` to default to `"button"` when the component is not being
7575
// used as a `Slot`. The default behavior of any given `<button>` element is

site/src/components/Checkbox/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copied from shadc/ui on 04/03/2025
33
* @see {@link https://ui.shadcn.com/docs/components/checkbox}
44
*/
5-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
65
import { Check, Minus } from "lucide-react";
6+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
77
import { cn } from "#/utils/cn";
88

99
/**

site/src/components/Collapsible/Collapsible.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
* Copied from shadc/ui on 12/26/2024
33
* @see {@link https://ui.shadcn.com/docs/components/collapsible}
44
*/
5-
6-
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
5+
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
76

87
const Collapsible = CollapsiblePrimitive.Root;
98

site/src/components/Dialog/Dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copied from shadc/ui on 11/13/2024
33
* @see {@link https://ui.shadcn.com/docs/components/dialog}
44
*/
5-
import * as DialogPrimitive from "@radix-ui/react-dialog";
65
import { cva, type VariantProps } from "class-variance-authority";
6+
import { Dialog as DialogPrimitive } from "radix-ui";
77
import { cn } from "#/utils/cn";
88

99
export const Dialog = DialogPrimitive.Root;

0 commit comments

Comments
 (0)