Skip to content

Commit 26ced98

Browse files
Claudehotlong
andauthored
feat: upgrade all shadcn components to latest version
- Updated 47 shadcn UI components from registry - Replaced incorrect radix-ui package with individual @radix-ui/* packages - Fixed import paths from @/registry/* to relative paths - Added use-mobile hook for sidebar component - Fixed icon-sm button size references to use icon variant - Fixed Slot component imports in custom components - Updated dependencies in package.json and pnpm-lock.yaml - Build successful Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/05fb973c-72d7-4b10-a572-8e218fe226eb Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9ac3005 commit 26ced98

44 files changed

Lines changed: 236 additions & 541 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/components/package.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,33 @@
3939
"@object-ui/i18n": "workspace:*",
4040
"@object-ui/react": "workspace:*",
4141
"@object-ui/types": "workspace:*",
42+
"@radix-ui/react-accordion": "^1.2.2",
43+
"@radix-ui/react-alert-dialog": "^1.1.4",
44+
"@radix-ui/react-aspect-ratio": "^1.1.1",
45+
"@radix-ui/react-avatar": "^1.1.2",
46+
"@radix-ui/react-checkbox": "^1.1.4",
47+
"@radix-ui/react-collapsible": "^1.1.2",
48+
"@radix-ui/react-context-menu": "^2.2.7",
49+
"@radix-ui/react-dialog": "^1.1.4",
50+
"@radix-ui/react-dropdown-menu": "^2.1.5",
51+
"@radix-ui/react-hover-card": "^1.1.4",
52+
"@radix-ui/react-label": "^2.1.2",
53+
"@radix-ui/react-menubar": "^1.1.3",
54+
"@radix-ui/react-navigation-menu": "^1.2.4",
55+
"@radix-ui/react-popover": "^1.1.4",
56+
"@radix-ui/react-progress": "^1.1.1",
57+
"@radix-ui/react-radio-group": "^1.2.3",
58+
"@radix-ui/react-scroll-area": "^1.2.3",
59+
"@radix-ui/react-select": "^2.1.8",
60+
"@radix-ui/react-separator": "^1.1.1",
61+
"@radix-ui/react-slider": "^1.2.3",
62+
"@radix-ui/react-slot": "^1.1.2",
63+
"@radix-ui/react-switch": "^1.1.4",
64+
"@radix-ui/react-tabs": "^1.1.3",
65+
"@radix-ui/react-toast": "^1.2.6",
66+
"@radix-ui/react-toggle": "^1.1.1",
67+
"@radix-ui/react-toggle-group": "^1.1.1",
68+
"@radix-ui/react-tooltip": "^1.1.8",
4269
"class-variance-authority": "^0.7.1",
4370
"clsx": "^2.1.1",
4471
"cmdk": "^1.1.1",
@@ -47,7 +74,6 @@
4774
"input-otp": "^1.4.2",
4875
"lucide-react": "^1.7.0",
4976
"next-themes": "^0.4.6",
50-
"radix-ui": "^1.4.3",
5177
"react-day-picker": "^9.14.0",
5278
"react-hook-form": "^7.72.1",
5379
"react-resizable-panels": "^4.9.0",

packages/components/src/custom/button-group.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
import { Slot as SlotPrimitive } from "radix-ui"
9+
import { Slot as SlotPrimitive } from "@radix-ui/react-slot"
1010
import { cva, type VariantProps } from "class-variance-authority"
1111

1212
import { cn } from "../lib/utils"
@@ -52,7 +52,7 @@ function ButtonGroupText({
5252
}: React.ComponentProps<"div"> & {
5353
asChild?: boolean
5454
}) {
55-
const Comp = asChild ? SlotPrimitive.Slot : "div"
55+
const Comp = asChild ? SlotPrimitive : "div"
5656

5757
return (
5858
<Comp

packages/components/src/custom/field.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import * as React from "react"
10-
import { Slot as SlotPrimitive } from "radix-ui"
10+
import { Slot as SlotPrimitive } from "@radix-ui/react-slot"
1111
import { cva, type VariantProps } from "class-variance-authority"
1212

1313
import { cn } from "../lib/utils"
@@ -43,7 +43,7 @@ const Field = React.forwardRef<HTMLDivElement, FieldProps>(
4343
</Label>
4444
)}
4545

46-
<SlotPrimitive.Slot
46+
<SlotPrimitive
4747
id={fieldId}
4848
aria-describedby={
4949
[description && descriptionId, error && errorId]
@@ -53,7 +53,7 @@ const Field = React.forwardRef<HTMLDivElement, FieldProps>(
5353
aria-invalid={!!error}
5454
>
5555
{children}
56-
</SlotPrimitive.Slot>
56+
</SlotPrimitive>
5757

5858
{description && !error && (
5959
<p

packages/components/src/custom/filter-builder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ function FilterBuilder({
388388

389389
<Button
390390
variant="ghost"
391-
size="icon-sm"
391+
size="icon"
392392
className="h-9 w-9 shrink-0"
393393
onClick={() => removeCondition(condition.id)}
394394
>

packages/components/src/custom/item.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import * as React from "react"
10-
import { Slot as SlotPrimitive } from "radix-ui"
10+
import { Slot as SlotPrimitive } from "@radix-ui/react-slot"
1111
import { cva, type VariantProps } from "class-variance-authority"
1212

1313
import { cn } from "../lib/utils"
@@ -67,7 +67,7 @@ function Item({
6767
...props
6868
}: React.ComponentProps<"div"> &
6969
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
70-
const Comp = asChild ? SlotPrimitive.Slot : "div"
70+
const Comp = asChild ? SlotPrimitive : "div"
7171
return (
7272
<Comp
7373
data-slot="item"

packages/components/src/custom/mobile-dialog-content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import * as React from 'react';
21-
import { Dialog as DialogPrimitive } from "radix-ui";
21+
import * as DialogPrimitive from "@radix-ui/react-dialog";
2222
import { X } from 'lucide-react';
2323
import { cn } from '../lib/utils';
2424
import { DialogOverlay, DialogPortal } from '../ui/dialog';

packages/components/src/custom/sort-builder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export function SortBuilder({
105105
</div>
106106
<Button
107107
variant="ghost"
108-
size="icon-sm"
108+
size="icon"
109109
className="h-9 w-9 shrink-0"
110110
onClick={() => removeItem(item.id)}
111111
>

packages/components/src/renderers/complex/data-table.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => {
986986
<>
987987
<Button
988988
variant="ghost"
989-
size="icon-sm"
989+
size="icon"
990990
onClick={() => cancelRowChanges(rowIndex)}
991991
disabled={isSaving}
992992
title="Cancel changes"
@@ -995,7 +995,7 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => {
995995
</Button>
996996
<Button
997997
variant="ghost"
998-
size="icon-sm"
998+
size="icon"
999999
onClick={() => saveRow(rowIndex)}
10001000
disabled={isSaving}
10011001
title="Save row"
@@ -1007,14 +1007,14 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => {
10071007
<>
10081008
<Button
10091009
variant="ghost"
1010-
size="icon-sm"
1010+
size="icon"
10111011
onClick={() => schema.onRowEdit?.(row)}
10121012
>
10131013
<Edit className="h-4 w-4" />
10141014
</Button>
10151015
<Button
10161016
variant="ghost"
1017-
size="icon-sm"
1017+
size="icon"
10181018
onClick={() => schema.onRowDelete?.(row)}
10191019
>
10201020
<Trash2 className="h-4 w-4 text-destructive" />
@@ -1089,31 +1089,31 @@ const DataTableRenderer = ({ schema }: { schema: DataTableSchema }) => {
10891089
<div className="flex items-center gap-1">
10901090
<Button
10911091
variant="outline"
1092-
size="icon-sm"
1092+
size="icon"
10931093
onClick={() => setCurrentPage(1)}
10941094
disabled={currentPage === 1}
10951095
>
10961096
<ChevronsLeft className="h-4 w-4" />
10971097
</Button>
10981098
<Button
10991099
variant="outline"
1100-
size="icon-sm"
1100+
size="icon"
11011101
onClick={() => setCurrentPage(Math.max(1, currentPage - 1))}
11021102
disabled={currentPage === 1}
11031103
>
11041104
<ChevronLeft className="h-4 w-4" />
11051105
</Button>
11061106
<Button
11071107
variant="outline"
1108-
size="icon-sm"
1108+
size="icon"
11091109
onClick={() => setCurrentPage(Math.min(totalPages, currentPage + 1))}
11101110
disabled={currentPage === totalPages}
11111111
>
11121112
<ChevronRight className="h-4 w-4" />
11131113
</Button>
11141114
<Button
11151115
variant="outline"
1116-
size="icon-sm"
1116+
size="icon"
11171117
onClick={() => setCurrentPage(totalPages)}
11181118
disabled={currentPage === totalPages}
11191119
>

packages/components/src/ui/accordion.tsx

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/src/ui/alert-dialog.tsx

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)