@object-ui/components 3.1.2 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +44 -14
- package/CHANGELOG.md +16 -0
- package/dist/index.css +3 -1
- package/dist/index.js +78089 -59928
- package/dist/index.umd.cjs +80 -55
- package/dist/src/custom/mobile-dialog-content.d.ts +1 -1
- package/dist/src/lib/use-sync-external-store-shim.d.ts +10 -0
- package/dist/src/lib/use-sync-external-store-with-selector-shim.d.ts +1 -0
- package/dist/src/ui/accordion.d.ts +1 -1
- package/dist/src/ui/alert-dialog.d.ts +1 -1
- package/dist/src/ui/aspect-ratio.d.ts +1 -8
- package/dist/src/ui/avatar.d.ts +1 -1
- package/dist/src/ui/chart.d.ts +21 -15
- package/dist/src/ui/checkbox.d.ts +1 -1
- package/dist/src/ui/collapsible.d.ts +1 -8
- package/dist/src/ui/command.d.ts +2 -2
- package/dist/src/ui/context-menu.d.ts +1 -1
- package/dist/src/ui/dialog.d.ts +1 -1
- package/dist/src/ui/drawer.d.ts +10 -6
- package/dist/src/ui/dropdown-menu.d.ts +1 -1
- package/dist/src/ui/form.d.ts +2 -2
- package/dist/src/ui/hover-card.d.ts +1 -1
- package/dist/src/ui/label.d.ts +1 -1
- package/dist/src/ui/menubar.d.ts +1 -1
- package/dist/src/ui/navigation-menu.d.ts +1 -1
- package/dist/src/ui/popover.d.ts +1 -1
- package/dist/src/ui/progress.d.ts +1 -1
- package/dist/src/ui/radio-group.d.ts +1 -1
- package/dist/src/ui/scroll-area.d.ts +1 -1
- package/dist/src/ui/select.d.ts +1 -1
- package/dist/src/ui/separator.d.ts +1 -1
- package/dist/src/ui/sheet.d.ts +1 -1
- package/dist/src/ui/sidebar.d.ts +4 -1
- package/dist/src/ui/slider.d.ts +1 -1
- package/dist/src/ui/switch.d.ts +1 -1
- package/dist/src/ui/tabs.d.ts +1 -1
- package/dist/src/ui/toast.d.ts +1 -1
- package/dist/src/ui/toggle-group.d.ts +1 -1
- package/dist/src/ui/toggle.d.ts +1 -1
- package/dist/src/ui/tooltip.d.ts +1 -1
- package/package.json +19 -45
- package/shadcn-components.json +179 -54
- package/src/__tests__/navigation-overlay.test.tsx +2 -2
- package/src/custom/button-group.tsx +2 -2
- package/src/custom/field.tsx +3 -3
- package/src/custom/item.tsx +2 -2
- package/src/custom/mobile-dialog-content.tsx +1 -1
- package/src/lib/use-sync-external-store-shim.ts +10 -0
- package/src/lib/use-sync-external-store-with-selector-shim.ts +90 -0
- package/src/renderers/form/form.tsx +7 -0
- package/src/ui/accordion.tsx +1 -1
- package/src/ui/alert-dialog.tsx +1 -1
- package/src/ui/aspect-ratio.tsx +1 -1
- package/src/ui/avatar.tsx +1 -1
- package/src/ui/breadcrumb.tsx +2 -2
- package/src/ui/button.tsx +2 -2
- package/src/ui/checkbox.tsx +1 -1
- package/src/ui/collapsible.tsx +1 -1
- package/src/ui/command.tsx +2 -2
- package/src/ui/context-menu.tsx +3 -3
- package/src/ui/dialog.tsx +1 -1
- package/src/ui/drawer.tsx +13 -13
- package/src/ui/dropdown-menu.tsx +3 -3
- package/src/ui/form.tsx +5 -5
- package/src/ui/hover-card.tsx +2 -2
- package/src/ui/label.tsx +1 -1
- package/src/ui/menubar.tsx +3 -3
- package/src/ui/navigation-menu.tsx +1 -1
- package/src/ui/popover.tsx +2 -2
- package/src/ui/progress.tsx +1 -1
- package/src/ui/radio-group.tsx +1 -1
- package/src/ui/scroll-area.tsx +1 -1
- package/src/ui/select.tsx +2 -2
- package/src/ui/separator.tsx +1 -1
- package/src/ui/sheet.tsx +1 -1
- package/src/ui/sidebar.tsx +11 -8
- package/src/ui/slider.tsx +1 -1
- package/src/ui/switch.tsx +1 -1
- package/src/ui/tabs.tsx +1 -1
- package/src/ui/toast.tsx +1 -1
- package/src/ui/toggle-group.tsx +1 -1
- package/src/ui/toggle.tsx +1 -1
- package/src/ui/tooltip.tsx +2 -2
- package/vite.config.ts +19 -11
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESM re-export of useSyncExternalStoreWithSelector.
|
|
3
|
+
*
|
|
4
|
+
* The CJS shim package uses `require("react")` which produces a
|
|
5
|
+
* Rolldown `require` polyfill incompatible with Next.js Turbopack SSR.
|
|
6
|
+
* This module provides a pure-ESM implementation using React 18+
|
|
7
|
+
* native useSyncExternalStore.
|
|
8
|
+
*/
|
|
9
|
+
import { useRef, useEffect, useMemo, useDebugValue, useSyncExternalStore } from 'react';
|
|
10
|
+
|
|
11
|
+
function is(x: unknown, y: unknown): boolean {
|
|
12
|
+
return (x === y && (0 !== x || 1 / (x as number) === 1 / (y as number))) || (x !== x && y !== y);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const objectIs: (x: unknown, y: unknown) => boolean =
|
|
16
|
+
typeof Object.is === 'function' ? Object.is : is;
|
|
17
|
+
|
|
18
|
+
export function useSyncExternalStoreWithSelector<Snapshot, Selection>(
|
|
19
|
+
subscribe: (onStoreChange: () => void) => () => void,
|
|
20
|
+
getSnapshot: () => Snapshot,
|
|
21
|
+
getServerSnapshot: undefined | null | (() => Snapshot),
|
|
22
|
+
selector: (snapshot: Snapshot) => Selection,
|
|
23
|
+
isEqual?: (a: Selection, b: Selection) => boolean,
|
|
24
|
+
): Selection {
|
|
25
|
+
const instRef = useRef<{
|
|
26
|
+
hasValue: boolean;
|
|
27
|
+
value: Selection;
|
|
28
|
+
} | null>(null);
|
|
29
|
+
let inst: { hasValue: boolean; value: Selection };
|
|
30
|
+
if (instRef.current === null) {
|
|
31
|
+
inst = { hasValue: false, value: null as Selection };
|
|
32
|
+
instRef.current = inst;
|
|
33
|
+
} else {
|
|
34
|
+
inst = instRef.current;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const [getSelection, getServerSelection] = useMemo(() => {
|
|
38
|
+
let hasMemo = false;
|
|
39
|
+
let memoizedSnapshot: Snapshot;
|
|
40
|
+
let memoizedSelection: Selection;
|
|
41
|
+
const memoizedSelector = (nextSnapshot: Snapshot): Selection => {
|
|
42
|
+
if (!hasMemo) {
|
|
43
|
+
hasMemo = true;
|
|
44
|
+
memoizedSnapshot = nextSnapshot;
|
|
45
|
+
const nextSelection = selector(nextSnapshot);
|
|
46
|
+
if (isEqual !== undefined) {
|
|
47
|
+
if (inst.hasValue) {
|
|
48
|
+
const currentSelection = inst.value;
|
|
49
|
+
if (isEqual(currentSelection, nextSelection)) {
|
|
50
|
+
memoizedSelection = currentSelection;
|
|
51
|
+
return currentSelection;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
memoizedSelection = nextSelection;
|
|
56
|
+
return nextSelection;
|
|
57
|
+
}
|
|
58
|
+
const prevSnapshot = memoizedSnapshot;
|
|
59
|
+
const prevSelection = memoizedSelection;
|
|
60
|
+
if (objectIs(prevSnapshot, nextSnapshot)) {
|
|
61
|
+
return prevSelection;
|
|
62
|
+
}
|
|
63
|
+
const nextSelection = selector(nextSnapshot);
|
|
64
|
+
if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {
|
|
65
|
+
memoizedSnapshot = nextSnapshot;
|
|
66
|
+
return prevSelection;
|
|
67
|
+
}
|
|
68
|
+
memoizedSnapshot = nextSnapshot;
|
|
69
|
+
memoizedSelection = nextSelection;
|
|
70
|
+
return nextSelection;
|
|
71
|
+
};
|
|
72
|
+
const maybeGetServerSelection =
|
|
73
|
+
getServerSnapshot === undefined || getServerSnapshot === null
|
|
74
|
+
? undefined
|
|
75
|
+
: () => memoizedSelector(getServerSnapshot());
|
|
76
|
+
return [() => memoizedSelector(getSnapshot()), maybeGetServerSelection];
|
|
77
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
|
+
}, [getSnapshot, getServerSnapshot, selector, isEqual]);
|
|
79
|
+
|
|
80
|
+
const value = useSyncExternalStore(subscribe, getSelection, getServerSelection);
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
inst.hasValue = true;
|
|
84
|
+
inst.value = value;
|
|
85
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
|
+
}, [value]);
|
|
87
|
+
|
|
88
|
+
useDebugValue(value);
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
@@ -27,6 +27,7 @@ import { Alert, AlertDescription } from '../../ui/alert';
|
|
|
27
27
|
import { AlertCircle, Loader2 } from 'lucide-react';
|
|
28
28
|
import { cn } from '../../lib/utils';
|
|
29
29
|
import React from 'react';
|
|
30
|
+
import { SchemaRendererContext } from '@object-ui/react';
|
|
30
31
|
|
|
31
32
|
// Form renderer component - Airtable-style feature-complete form
|
|
32
33
|
ComponentRegistry.register('form',
|
|
@@ -57,6 +58,11 @@ ComponentRegistry.register('form',
|
|
|
57
58
|
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
58
59
|
const [submitError, setSubmitError] = React.useState<string | null>(null);
|
|
59
60
|
|
|
61
|
+
// Read DataSource from SchemaRendererContext and propagate it to field
|
|
62
|
+
// widgets as a prop so they can dynamically load related records.
|
|
63
|
+
const schemaCtx = React.useContext(SchemaRendererContext);
|
|
64
|
+
const contextDataSource = schemaCtx?.dataSource ?? null;
|
|
65
|
+
|
|
60
66
|
// React to defaultValues changes
|
|
61
67
|
React.useEffect(() => {
|
|
62
68
|
form.reset(defaultValues);
|
|
@@ -313,6 +319,7 @@ ComponentRegistry.register('form',
|
|
|
313
319
|
options: fieldProps.options,
|
|
314
320
|
placeholder: fieldProps.placeholder,
|
|
315
321
|
disabled: disabled || fieldDisabled || readonly || isSubmitting,
|
|
322
|
+
dataSource: contextDataSource,
|
|
316
323
|
})}
|
|
317
324
|
</FormControl>
|
|
318
325
|
{description && (
|
package/src/ui/accordion.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { Accordion as AccordionPrimitive } from "radix-ui"
|
|
13
13
|
import { ChevronDown } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
package/src/ui/alert-dialog.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui"
|
|
13
13
|
|
|
14
14
|
import { cn } from "../lib/utils"
|
|
15
15
|
import { buttonVariants } from "./button"
|
package/src/ui/aspect-ratio.tsx
CHANGED
package/src/ui/avatar.tsx
CHANGED
package/src/ui/breadcrumb.tsx
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as React from "react"
|
|
10
|
-
import { Slot } from "
|
|
10
|
+
import { Slot as SlotPrimitive } from "radix-ui"
|
|
11
11
|
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
12
12
|
|
|
13
13
|
import { cn } from "../lib/utils"
|
|
@@ -53,7 +53,7 @@ const BreadcrumbLink = React.forwardRef<
|
|
|
53
53
|
asChild?: boolean
|
|
54
54
|
}
|
|
55
55
|
>(({ asChild, className, ...props }, ref) => {
|
|
56
|
-
const Comp = asChild ? Slot : "a"
|
|
56
|
+
const Comp = asChild ? SlotPrimitive.Slot : "a"
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<Comp
|
package/src/ui/button.tsx
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as React from "react"
|
|
10
|
-
import { Slot } from "
|
|
10
|
+
import { Slot as SlotPrimitive } from "radix-ui"
|
|
11
11
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
12
12
|
|
|
13
13
|
import { cn } from "../lib/utils"
|
|
@@ -51,7 +51,7 @@ export interface ButtonProps
|
|
|
51
51
|
|
|
52
52
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
53
53
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
54
|
-
const Comp = asChild ? Slot : "button"
|
|
54
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button"
|
|
55
55
|
return (
|
|
56
56
|
<Comp
|
|
57
57
|
className={cn(buttonVariants({ variant, size, className }))}
|
package/src/ui/checkbox.tsx
CHANGED
package/src/ui/collapsible.tsx
CHANGED
package/src/ui/command.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import {
|
|
12
|
+
import { Dialog as DialogPrimitive } from "radix-ui"
|
|
13
13
|
import { Command as CommandPrimitive } from "cmdk"
|
|
14
14
|
import { Search } from "lucide-react"
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ const Command = React.forwardRef<
|
|
|
31
31
|
))
|
|
32
32
|
Command.displayName = CommandPrimitive.displayName
|
|
33
33
|
|
|
34
|
-
const CommandDialog = ({ children, ...props }:
|
|
34
|
+
const CommandDialog = ({ children, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => {
|
|
35
35
|
return (
|
|
36
36
|
<Dialog {...props}>
|
|
37
37
|
<DialogContent className="overflow-hidden p-0 shadow-lg">
|
package/src/ui/context-menu.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { ContextMenu as ContextMenuPrimitive } from "radix-ui"
|
|
13
13
|
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
|
@@ -54,7 +54,7 @@ const ContextMenuSubContent = React.forwardRef<
|
|
|
54
54
|
<ContextMenuPrimitive.SubContent
|
|
55
55
|
ref={ref}
|
|
56
56
|
className={cn(
|
|
57
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-context-menu-content-transform-origin]",
|
|
57
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-context-menu-content-transform-origin]",
|
|
58
58
|
className
|
|
59
59
|
)}
|
|
60
60
|
{...props}
|
|
@@ -70,7 +70,7 @@ const ContextMenuContent = React.forwardRef<
|
|
|
70
70
|
<ContextMenuPrimitive.Content
|
|
71
71
|
ref={ref}
|
|
72
72
|
className={cn(
|
|
73
|
-
"z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-context-menu-content-transform-origin]",
|
|
73
|
+
"z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-context-menu-content-transform-origin]",
|
|
74
74
|
className
|
|
75
75
|
)}
|
|
76
76
|
{...props}
|
package/src/ui/dialog.tsx
CHANGED
package/src/ui/drawer.tsx
CHANGED
|
@@ -24,15 +24,15 @@ const Drawer = ({
|
|
|
24
24
|
)
|
|
25
25
|
Drawer.displayName = "Drawer"
|
|
26
26
|
|
|
27
|
-
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
27
|
+
const DrawerTrigger: React.FC<React.ComponentPropsWithoutRef<"button"> & { asChild?: boolean }> = DrawerPrimitive.Trigger
|
|
28
28
|
|
|
29
29
|
const DrawerPortal = DrawerPrimitive.Portal
|
|
30
30
|
|
|
31
|
-
const DrawerClose = DrawerPrimitive.Close
|
|
31
|
+
const DrawerClose: React.FC<React.ComponentPropsWithoutRef<"button"> & { asChild?: boolean }> = DrawerPrimitive.Close
|
|
32
32
|
|
|
33
33
|
const DrawerOverlay = React.forwardRef<
|
|
34
|
-
|
|
35
|
-
React.ComponentPropsWithoutRef<
|
|
34
|
+
HTMLDivElement,
|
|
35
|
+
React.ComponentPropsWithoutRef<"div">
|
|
36
36
|
>(({ className, ...props }, ref) => (
|
|
37
37
|
<DrawerPrimitive.Overlay
|
|
38
38
|
ref={ref}
|
|
@@ -40,11 +40,11 @@ const DrawerOverlay = React.forwardRef<
|
|
|
40
40
|
{...props}
|
|
41
41
|
/>
|
|
42
42
|
))
|
|
43
|
-
DrawerOverlay.displayName =
|
|
43
|
+
DrawerOverlay.displayName = "DrawerOverlay"
|
|
44
44
|
|
|
45
45
|
const DrawerContent = React.forwardRef<
|
|
46
|
-
|
|
47
|
-
React.ComponentPropsWithoutRef<
|
|
46
|
+
HTMLDivElement,
|
|
47
|
+
React.ComponentPropsWithoutRef<"div">
|
|
48
48
|
>(({ className, children, ...props }, ref) => (
|
|
49
49
|
<DrawerPortal>
|
|
50
50
|
<DrawerOverlay />
|
|
@@ -86,8 +86,8 @@ const DrawerFooter = ({
|
|
|
86
86
|
DrawerFooter.displayName = "DrawerFooter"
|
|
87
87
|
|
|
88
88
|
const DrawerTitle = React.forwardRef<
|
|
89
|
-
|
|
90
|
-
React.ComponentPropsWithoutRef<
|
|
89
|
+
HTMLHeadingElement,
|
|
90
|
+
React.ComponentPropsWithoutRef<"h2">
|
|
91
91
|
>(({ className, ...props }, ref) => (
|
|
92
92
|
<DrawerPrimitive.Title
|
|
93
93
|
ref={ref}
|
|
@@ -98,11 +98,11 @@ const DrawerTitle = React.forwardRef<
|
|
|
98
98
|
{...props}
|
|
99
99
|
/>
|
|
100
100
|
))
|
|
101
|
-
DrawerTitle.displayName =
|
|
101
|
+
DrawerTitle.displayName = "DrawerTitle"
|
|
102
102
|
|
|
103
103
|
const DrawerDescription = React.forwardRef<
|
|
104
|
-
|
|
105
|
-
React.ComponentPropsWithoutRef<
|
|
104
|
+
HTMLParagraphElement,
|
|
105
|
+
React.ComponentPropsWithoutRef<"p">
|
|
106
106
|
>(({ className, ...props }, ref) => (
|
|
107
107
|
<DrawerPrimitive.Description
|
|
108
108
|
ref={ref}
|
|
@@ -110,7 +110,7 @@ const DrawerDescription = React.forwardRef<
|
|
|
110
110
|
{...props}
|
|
111
111
|
/>
|
|
112
112
|
))
|
|
113
|
-
DrawerDescription.displayName =
|
|
113
|
+
DrawerDescription.displayName = "DrawerDescription"
|
|
114
114
|
|
|
115
115
|
export {
|
|
116
116
|
Drawer,
|
package/src/ui/dropdown-menu.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
|
|
13
13
|
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
|
@@ -55,7 +55,7 @@ const DropdownMenuSubContent = React.forwardRef<
|
|
|
55
55
|
<DropdownMenuPrimitive.SubContent
|
|
56
56
|
ref={ref}
|
|
57
57
|
className={cn(
|
|
58
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
58
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
59
59
|
className
|
|
60
60
|
)}
|
|
61
61
|
{...props}
|
|
@@ -73,7 +73,7 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
73
73
|
ref={ref}
|
|
74
74
|
sideOffset={sideOffset}
|
|
75
75
|
className={cn(
|
|
76
|
-
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
76
|
+
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
77
77
|
className
|
|
78
78
|
)}
|
|
79
79
|
{...props}
|
package/src/ui/form.tsx
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
13
|
-
import { Slot } from "
|
|
12
|
+
import { Label as LabelPrimitive } from "radix-ui"
|
|
13
|
+
import { Slot as SlotPrimitive } from "radix-ui"
|
|
14
14
|
import {
|
|
15
15
|
Controller,
|
|
16
16
|
FormProvider,
|
|
@@ -112,13 +112,13 @@ const FormLabel = React.forwardRef<
|
|
|
112
112
|
FormLabel.displayName = "FormLabel"
|
|
113
113
|
|
|
114
114
|
const FormControl = React.forwardRef<
|
|
115
|
-
React.ElementRef<typeof Slot>,
|
|
116
|
-
React.ComponentPropsWithoutRef<typeof Slot>
|
|
115
|
+
React.ElementRef<typeof SlotPrimitive.Slot>,
|
|
116
|
+
React.ComponentPropsWithoutRef<typeof SlotPrimitive.Slot>
|
|
117
117
|
>(({ ...props }, ref) => {
|
|
118
118
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
119
119
|
|
|
120
120
|
return (
|
|
121
|
-
<Slot
|
|
121
|
+
<SlotPrimitive.Slot
|
|
122
122
|
ref={ref}
|
|
123
123
|
id={formItemId}
|
|
124
124
|
aria-describedby={
|
package/src/ui/hover-card.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { HoverCard as HoverCardPrimitive } from "radix-ui"
|
|
13
13
|
|
|
14
14
|
import { cn } from "../lib/utils"
|
|
15
15
|
|
|
@@ -26,7 +26,7 @@ const HoverCardContent = React.forwardRef<
|
|
|
26
26
|
align={align}
|
|
27
27
|
sideOffset={sideOffset}
|
|
28
28
|
className={cn(
|
|
29
|
-
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-hover-card-content-transform-origin]",
|
|
29
|
+
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-hover-card-content-transform-origin]",
|
|
30
30
|
className
|
|
31
31
|
)}
|
|
32
32
|
{...props}
|
package/src/ui/label.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { Label as LabelPrimitive } from "radix-ui"
|
|
13
13
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
package/src/ui/menubar.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { Menubar as MenubarPrimitive } from "radix-ui"
|
|
13
13
|
import { Check, ChevronRight, Circle } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
|
@@ -102,7 +102,7 @@ const MenubarSubContent = React.forwardRef<
|
|
|
102
102
|
<MenubarPrimitive.SubContent
|
|
103
103
|
ref={ref}
|
|
104
104
|
className={cn(
|
|
105
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-menubar-content-transform-origin]",
|
|
105
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-menubar-content-transform-origin]",
|
|
106
106
|
className
|
|
107
107
|
)}
|
|
108
108
|
{...props}
|
|
@@ -125,7 +125,7 @@ const MenubarContent = React.forwardRef<
|
|
|
125
125
|
alignOffset={alignOffset}
|
|
126
126
|
sideOffset={sideOffset}
|
|
127
127
|
className={cn(
|
|
128
|
-
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-menubar-content-transform-origin]",
|
|
128
|
+
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-menubar-content-transform-origin]",
|
|
129
129
|
className
|
|
130
130
|
)}
|
|
131
131
|
{...props}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as React from "react"
|
|
10
|
-
import
|
|
10
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"
|
|
11
11
|
import { cva } from "class-variance-authority"
|
|
12
12
|
import { ChevronDown } from "lucide-react"
|
|
13
13
|
|
package/src/ui/popover.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { Popover as PopoverPrimitive } from "radix-ui"
|
|
13
13
|
|
|
14
14
|
import { cn } from "../lib/utils"
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ const PopoverContent = React.forwardRef<
|
|
|
27
27
|
align={align}
|
|
28
28
|
sideOffset={sideOffset}
|
|
29
29
|
className={cn(
|
|
30
|
-
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-popover-content-transform-origin]",
|
|
30
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-popover-content-transform-origin]",
|
|
31
31
|
className
|
|
32
32
|
)}
|
|
33
33
|
{...props}
|
package/src/ui/progress.tsx
CHANGED
package/src/ui/radio-group.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
|
|
13
13
|
import { Circle } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
package/src/ui/scroll-area.tsx
CHANGED
package/src/ui/select.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
13
13
|
import { Check, ChevronDown, ChevronUp } from "lucide-react"
|
|
14
14
|
|
|
15
15
|
import { cn } from "../lib/utils"
|
|
@@ -83,7 +83,7 @@ const SelectContent = React.forwardRef<
|
|
|
83
83
|
<SelectPrimitive.Content
|
|
84
84
|
ref={ref}
|
|
85
85
|
className={cn(
|
|
86
|
-
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 origin-[--radix-select-content-transform-origin]",
|
|
86
|
+
"relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 origin-[--radix-select-content-transform-origin]",
|
|
87
87
|
position === "popper" &&
|
|
88
88
|
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
89
89
|
className
|
package/src/ui/separator.tsx
CHANGED
package/src/ui/sheet.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import
|
|
12
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
13
13
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
14
14
|
import { X } from "lucide-react"
|
|
15
15
|
|
package/src/ui/sidebar.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"use client"
|
|
10
10
|
|
|
11
11
|
import * as React from "react"
|
|
12
|
-
import { Slot } from "
|
|
12
|
+
import { Slot as SlotPrimitive } from "radix-ui"
|
|
13
13
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
14
14
|
import { PanelLeft } from "lucide-react"
|
|
15
15
|
|
|
@@ -473,8 +473,11 @@ const SidebarFooter = React.forwardRef<
|
|
|
473
473
|
SidebarFooter.displayName = "SidebarFooter"
|
|
474
474
|
|
|
475
475
|
const SidebarSeparator = React.forwardRef<
|
|
476
|
-
|
|
477
|
-
React.
|
|
476
|
+
HTMLDivElement,
|
|
477
|
+
React.ComponentPropsWithoutRef<"div"> & {
|
|
478
|
+
orientation?: "horizontal" | "vertical"
|
|
479
|
+
decorative?: boolean
|
|
480
|
+
}
|
|
478
481
|
>(({ className, ...props }, ref) => {
|
|
479
482
|
return (
|
|
480
483
|
<Separator
|
|
@@ -524,7 +527,7 @@ const SidebarGroupLabel = React.forwardRef<
|
|
|
524
527
|
HTMLDivElement,
|
|
525
528
|
React.ComponentProps<"div"> & { asChild?: boolean }
|
|
526
529
|
>(({ className, asChild = false, ...props }, ref) => {
|
|
527
|
-
const Comp = asChild ? Slot : "div"
|
|
530
|
+
const Comp = asChild ? SlotPrimitive.Slot : "div"
|
|
528
531
|
|
|
529
532
|
return (
|
|
530
533
|
<Comp
|
|
@@ -545,7 +548,7 @@ const SidebarGroupAction = React.forwardRef<
|
|
|
545
548
|
HTMLButtonElement,
|
|
546
549
|
React.ComponentProps<"button"> & { asChild?: boolean }
|
|
547
550
|
>(({ className, asChild = false, ...props }, ref) => {
|
|
548
|
-
const Comp = asChild ? Slot : "button"
|
|
551
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button"
|
|
549
552
|
|
|
550
553
|
return (
|
|
551
554
|
<Comp
|
|
@@ -655,7 +658,7 @@ const SidebarMenuButton = React.forwardRef<
|
|
|
655
658
|
},
|
|
656
659
|
ref
|
|
657
660
|
) => {
|
|
658
|
-
const Comp = asChild ? Slot : "button"
|
|
661
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button"
|
|
659
662
|
const { isMobile, state } = useSidebar()
|
|
660
663
|
|
|
661
664
|
const button = (
|
|
@@ -701,7 +704,7 @@ const SidebarMenuAction = React.forwardRef<
|
|
|
701
704
|
showOnHover?: boolean
|
|
702
705
|
}
|
|
703
706
|
>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
704
|
-
const Comp = asChild ? Slot : "button"
|
|
707
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button"
|
|
705
708
|
|
|
706
709
|
return (
|
|
707
710
|
<Comp
|
|
@@ -813,7 +816,7 @@ const SidebarMenuSubButton = React.forwardRef<
|
|
|
813
816
|
isActive?: boolean
|
|
814
817
|
}
|
|
815
818
|
>(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
816
|
-
const Comp = asChild ? Slot : "a"
|
|
819
|
+
const Comp = asChild ? SlotPrimitive.Slot : "a"
|
|
817
820
|
|
|
818
821
|
return (
|
|
819
822
|
<Comp
|
package/src/ui/slider.tsx
CHANGED