@nadicodeai/ui 0.4.0 → 0.4.1
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/AGENTS.md +2 -1
- package/README.md +4 -2
- package/dist/components/accordion.d.ts +15 -5
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +34 -9
- package/dist/components/ai-elements/chain-of-thought.js +1 -1
- package/dist/components/ai-elements/mic-selector.js +1 -1
- package/dist/components/ai-elements/plan.d.ts +3 -2
- package/dist/components/ai-elements/plan.d.ts.map +1 -1
- package/dist/components/ai-elements/reasoning.js +1 -1
- package/dist/components/ai-elements/stack-trace.js +1 -1
- package/dist/components/ai-elements/transcription.js +1 -1
- package/dist/components/ai-elements/voice-selector.d.ts +2 -1
- package/dist/components/ai-elements/voice-selector.d.ts.map +1 -1
- package/dist/components/ai-elements/voice-selector.js +1 -1
- package/dist/components/alert-dialog.d.ts +10 -9
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +16 -13
- package/dist/components/aspect-ratio.d.ts +3 -2
- package/dist/components/aspect-ratio.d.ts.map +1 -1
- package/dist/components/aspect-ratio.js +6 -3
- package/dist/components/avatar.d.ts +5 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +5 -5
- package/dist/components/badge.js +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button-group.js +1 -1
- package/dist/components/button.d.ts +4 -2
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +21 -17
- package/dist/components/checkbox.d.ts +2 -3
- package/dist/components/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/collapsible.d.ts +8 -4
- package/dist/components/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible.js +16 -6
- package/dist/components/command.d.ts +4 -3
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +13 -12
- package/dist/components/context-menu.d.ts +24 -15
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +38 -28
- package/dist/components/dialog.d.ts +10 -9
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +11 -10
- package/dist/components/direction.d.ts +6 -5
- package/dist/components/direction.d.ts.map +1 -1
- package/dist/components/direction.js +3 -4
- package/dist/components/drawer.d.ts +22 -10
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +70 -12
- package/dist/components/dropdown-menu.d.ts +25 -16
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +40 -30
- package/dist/components/form.d.ts +3 -3
- package/dist/components/form.d.ts.map +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/hover-card.d.ts +8 -4
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +12 -7
- package/dist/components/item.js +1 -1
- package/dist/components/label.d.ts +1 -2
- package/dist/components/label.d.ts.map +1 -1
- package/dist/components/label.js +1 -2
- package/dist/components/menubar.d.ts +21 -18
- package/dist/components/menubar.d.ts.map +1 -1
- package/dist/components/menubar.js +25 -23
- package/dist/components/navigation-menu.d.ts +16 -12
- package/dist/components/navigation-menu.d.ts.map +1 -1
- package/dist/components/navigation-menu.js +16 -13
- package/dist/components/popover.d.ts +11 -8
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +33 -12
- package/dist/components/progress.d.ts +7 -4
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +17 -5
- package/dist/components/radio-group.d.ts +4 -4
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js +4 -4
- package/dist/components/scroll-area.d.ts +3 -3
- package/dist/components/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-area.js +2 -4
- package/dist/components/select.d.ts +11 -11
- package/dist/components/select.d.ts.map +1 -1
- package/dist/components/select.js +14 -18
- package/dist/components/separator.d.ts +2 -3
- package/dist/components/separator.d.ts.map +1 -1
- package/dist/components/separator.js +3 -3
- package/dist/components/sheet.d.ts +8 -7
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +10 -12
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.d.ts +2 -3
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +10 -7
- package/dist/components/switch.d.ts +3 -4
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +2 -2
- package/dist/components/tabs.d.ts +5 -6
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +5 -5
- package/dist/components/theme-mode-switcher.js +1 -1
- package/dist/components/toggle-group.d.ts +12 -4
- package/dist/components/toggle-group.d.ts.map +1 -1
- package/dist/components/toggle-group.js +29 -7
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.d.ts.map +1 -1
- package/dist/components/toggle.js +9 -8
- package/dist/components/tooltip.d.ts +8 -6
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +7 -6
- package/dist/hooks/use-controllable-state.d.ts +9 -0
- package/dist/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/hooks/use-controllable-state.js +25 -0
- package/dist/lib/base-render.d.ts +14 -0
- package/dist/lib/base-render.d.ts.map +1 -0
- package/dist/lib/base-render.js +16 -0
- package/dist/lib/slot.d.ts +8 -0
- package/dist/lib/slot.d.ts.map +1 -0
- package/dist/lib/slot.js +17 -0
- package/docs/agents/nadicodeai-ui.md +1 -1
- package/docs/migration/base-ui-migration.md +49 -0
- package/llms.txt +2 -2
- package/package.json +3 -6
|
@@ -1,34 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
5
|
+
import { withAsChildRender } from "../lib/base-render.js";
|
|
3
6
|
import { cn } from "../lib/utils.js";
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
const drawerDirectionToSwipeDirection = {
|
|
8
|
+
bottom: "down",
|
|
9
|
+
left: "left",
|
|
10
|
+
right: "right",
|
|
11
|
+
top: "up",
|
|
12
|
+
};
|
|
13
|
+
const DrawerContext = React.createContext(null);
|
|
14
|
+
function useDrawer() {
|
|
15
|
+
const context = React.useContext(DrawerContext);
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error("useDrawer must be used within a Drawer.");
|
|
18
|
+
}
|
|
19
|
+
return context;
|
|
20
|
+
}
|
|
21
|
+
function Drawer({ activeSnapPoint, direction, modal = true, onSnapPointChange, setActiveSnapPoint, showSwipeHandle = false, snapPoints, snapPoint, swipeDirection = "down", ...props }) {
|
|
22
|
+
const resolvedSnapPoint = snapPoint ?? activeSnapPoint;
|
|
23
|
+
const resolvedSwipeDirection = direction
|
|
24
|
+
? drawerDirectionToSwipeDirection[direction]
|
|
25
|
+
: swipeDirection;
|
|
26
|
+
const handleSnapPointChange = onSnapPointChange ?? setActiveSnapPoint;
|
|
27
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
28
|
+
const contextValue = React.useMemo(() => ({
|
|
29
|
+
hasSnapPoints,
|
|
30
|
+
modal,
|
|
31
|
+
showSwipeHandle,
|
|
32
|
+
swipeDirection: resolvedSwipeDirection,
|
|
33
|
+
}), [hasSnapPoints, modal, resolvedSwipeDirection, showSwipeHandle]);
|
|
34
|
+
return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", modal: modal, onSnapPointChange: handleSnapPointChange, snapPoint: resolvedSnapPoint, snapPoints: snapPoints, swipeDirection: resolvedSwipeDirection, ...props }) }));
|
|
6
35
|
}
|
|
7
36
|
function DrawerTrigger({ ...props }) {
|
|
8
|
-
return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
37
|
+
return (_jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...withAsChildRender(props) }));
|
|
9
38
|
}
|
|
10
39
|
function DrawerPortal({ ...props }) {
|
|
11
40
|
return _jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
12
41
|
}
|
|
13
42
|
function DrawerClose({ ...props }) {
|
|
14
|
-
return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
43
|
+
return (_jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...withAsChildRender(props) }));
|
|
15
44
|
}
|
|
16
45
|
function DrawerOverlay({ className, ...props }) {
|
|
17
|
-
return (_jsx(DrawerPrimitive.
|
|
46
|
+
return (_jsx(DrawerPrimitive.Backdrop, { "data-slot": "drawer-overlay", className: cn("fixed inset-0 z-50 min-h-dvh bg-foreground/50 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute", className), ...props }));
|
|
47
|
+
}
|
|
48
|
+
function DrawerSwipeHandle({ className, ...props }) {
|
|
49
|
+
return (_jsx("div", { "data-slot": "drawer-swipe-handle", "aria-hidden": "true", className: cn("relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing", className), ...props }));
|
|
18
50
|
}
|
|
19
51
|
function DrawerContent({ className, children, ...props }) {
|
|
20
|
-
|
|
52
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
53
|
+
const swipeAxis = swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
54
|
+
return (_jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [modal === true && (_jsx(DrawerOverlay, { "data-snap-points": hasSnapPoints ? "" : undefined })), _jsx(DrawerPrimitive.Viewport, { "data-slot": "drawer-viewport", "data-modal": modal, className: "pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto", children: _jsxs(DrawerPrimitive.Popup, { "data-slot": "drawer-popup", "data-swipe-axis": swipeAxis, "data-snap-points": hasSnapPoints ? "" : undefined, className: cn(
|
|
55
|
+
// Base.
|
|
56
|
+
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
|
|
57
|
+
// Nested.
|
|
58
|
+
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
59
|
+
// Bleed.
|
|
60
|
+
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
|
|
61
|
+
// Sizing.
|
|
62
|
+
"[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
|
|
63
|
+
// Stack.
|
|
64
|
+
"[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
|
|
65
|
+
// Transitions.
|
|
66
|
+
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
|
|
67
|
+
// Axis: y.
|
|
68
|
+
"data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
|
|
69
|
+
// Axis: x.
|
|
70
|
+
"data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
|
|
71
|
+
// Direction: down.
|
|
72
|
+
"data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
|
|
73
|
+
// Direction: up.
|
|
74
|
+
"data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
|
|
75
|
+
// Direction: left.
|
|
76
|
+
"data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
|
|
77
|
+
// Direction: right.
|
|
78
|
+
"data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]", className), ...props, children: [showSwipeHandle && _jsx(DrawerSwipeHandle, {}), _jsx(DrawerPrimitive.Content, { "data-slot": "drawer-content", className: cn("flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none"), children: children })] }) })] }));
|
|
21
79
|
}
|
|
22
80
|
function DrawerHeader({ className, ...props }) {
|
|
23
|
-
return (_jsx("div", { "data-slot": "drawer-header", className: cn("flex flex-col gap-0.5 p-4
|
|
81
|
+
return (_jsx("div", { "data-slot": "drawer-header", className: cn("flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left", className), ...props }));
|
|
24
82
|
}
|
|
25
83
|
function DrawerFooter({ className, ...props }) {
|
|
26
|
-
return (_jsx("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props }));
|
|
84
|
+
return (_jsx("div", { "data-slot": "drawer-footer", className: cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className), ...props }));
|
|
27
85
|
}
|
|
28
86
|
function DrawerTitle({ className, ...props }) {
|
|
29
|
-
return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("font-
|
|
87
|
+
return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn("text-base font-medium text-foreground", className), ...props }));
|
|
30
88
|
}
|
|
31
89
|
function DrawerDescription({ className, ...props }) {
|
|
32
|
-
return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
90
|
+
return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn("text-sm text-balance text-muted-foreground", className), ...props }));
|
|
33
91
|
}
|
|
34
|
-
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
92
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerSwipeHandle, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
declare function
|
|
2
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3
|
+
import { type WithAsChild } from "../lib/base-render";
|
|
4
|
+
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuTrigger({ ...props }: WithAsChild<MenuPrimitive.Trigger.Props>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
9
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
|
|
9
10
|
inset?: boolean;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
type DropdownMenuSelectEventHandler = (event: Event) => void;
|
|
13
|
+
type DropdownMenuItemProps = WithAsChild<Omit<MenuPrimitive.Item.Props, "onClick" | "onSelect">> & {
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
onClick?: MenuPrimitive.Item.Props["onClick"];
|
|
16
|
+
onSelect?: DropdownMenuSelectEventHandler;
|
|
10
17
|
variant?: "default" | "destructive";
|
|
18
|
+
};
|
|
19
|
+
declare function DropdownMenuItem({ className, inset, onClick, onSelect, variant, ...props }: DropdownMenuItemProps): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, asChild, ...props }: WithAsChild<MenuPrimitive.SubmenuTrigger.Props> & {
|
|
22
|
+
inset?: boolean;
|
|
11
23
|
}): React.JSX.Element;
|
|
12
|
-
declare function
|
|
13
|
-
declare function
|
|
14
|
-
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
15
|
-
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
24
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
|
|
16
26
|
inset?: boolean;
|
|
17
27
|
}): React.JSX.Element;
|
|
18
|
-
declare function
|
|
19
|
-
declare function
|
|
20
|
-
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
28
|
+
declare function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props): React.JSX.Element;
|
|
29
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
|
|
22
30
|
inset?: boolean;
|
|
23
31
|
}): React.JSX.Element;
|
|
24
|
-
declare function
|
|
32
|
+
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
33
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
25
34
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
26
35
|
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,51 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
4
|
+
import { withAsChildRender } from "../lib/base-render.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
6
7
|
function DropdownMenu({ ...props }) {
|
|
7
|
-
return _jsx(
|
|
8
|
+
return _jsx(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
8
9
|
}
|
|
9
10
|
function DropdownMenuPortal({ ...props }) {
|
|
10
|
-
return
|
|
11
|
+
return _jsx(MenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
11
12
|
}
|
|
12
13
|
function DropdownMenuTrigger({ ...props }) {
|
|
13
|
-
return (_jsx(
|
|
14
|
+
return (_jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...withAsChildRender(props) }));
|
|
14
15
|
}
|
|
15
|
-
function DropdownMenuContent({
|
|
16
|
-
return (_jsx(
|
|
16
|
+
function DropdownMenuContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, className, ...props }) {
|
|
17
|
+
return (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
17
18
|
}
|
|
18
19
|
function DropdownMenuGroup({ ...props }) {
|
|
19
|
-
return
|
|
20
|
+
return _jsx(MenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
return (_jsx(
|
|
23
|
-
}
|
|
24
|
-
function
|
|
25
|
-
|
|
22
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
23
|
+
return (_jsx(MenuPrimitive.GroupLabel, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function DropdownMenuItem({ className, inset, onClick, onSelect, variant = "default", ...props }) {
|
|
26
|
+
const handleClick = (event) => {
|
|
27
|
+
onSelect?.(event.nativeEvent);
|
|
28
|
+
if (event.nativeEvent.defaultPrevented) {
|
|
29
|
+
event.preventBaseUIHandler?.();
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
onClick?.(event);
|
|
34
|
+
};
|
|
35
|
+
return (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive", className), onClick: handleClick, ...withAsChildRender(props) }));
|
|
26
36
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
37
|
+
function DropdownMenuSub({ ...props }) {
|
|
38
|
+
return _jsx(MenuPrimitive.SubmenuRoot, { "data-slot": "dropdown-menu-sub", ...props });
|
|
29
39
|
}
|
|
30
|
-
function
|
|
31
|
-
return (
|
|
40
|
+
function DropdownMenuSubTrigger({ className, inset, children, asChild, ...props }) {
|
|
41
|
+
return (_jsx(MenuPrimitive.SubmenuTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...withAsChildRender({ asChild, children, ...props }), children: !asChild && (_jsxs(_Fragment, { children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })) }));
|
|
32
42
|
}
|
|
33
|
-
function
|
|
34
|
-
return (_jsx(
|
|
43
|
+
function DropdownMenuSubContent({ align = "start", alignOffset = -3, side = "right", sideOffset = 0, className, ...props }) {
|
|
44
|
+
return (_jsx(DropdownMenuContent, { "data-slot": "dropdown-menu-sub-content", className: cn("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, ...props }));
|
|
35
45
|
}
|
|
36
|
-
function
|
|
37
|
-
return (
|
|
46
|
+
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
47
|
+
return (_jsxs(MenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(MenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
|
|
38
48
|
}
|
|
39
|
-
function
|
|
40
|
-
return (_jsx(
|
|
49
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
50
|
+
return (_jsx(MenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
|
|
41
51
|
}
|
|
42
|
-
function
|
|
43
|
-
return
|
|
52
|
+
function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
53
|
+
return (_jsxs(MenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(MenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
|
|
44
54
|
}
|
|
45
|
-
function
|
|
46
|
-
return (
|
|
55
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
56
|
+
return (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
47
57
|
}
|
|
48
|
-
function
|
|
49
|
-
return (_jsx(
|
|
58
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
59
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground", className), ...props }));
|
|
50
60
|
}
|
|
51
61
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
import { Slot } from "radix-ui";
|
|
2
|
+
import { Slot } from "../lib/slot";
|
|
4
3
|
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
4
|
+
import { Label } from "./label";
|
|
5
5
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, handleSubmit, unregister, control, register, setFocus, subscribe, }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
6
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
|
|
7
7
|
declare const useFormField: () => {
|
|
@@ -17,7 +17,7 @@ declare const useFormField: () => {
|
|
|
17
17
|
formMessageId: string;
|
|
18
18
|
};
|
|
19
19
|
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
|
-
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof
|
|
20
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof Label>): React.JSX.Element;
|
|
21
21
|
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>): React.JSX.Element;
|
|
22
22
|
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
23
23
|
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAE1C,QAAA,MAAM,IAAI,0YAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,sBAMtC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAYrE;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,qBAYpC;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,qBAgBxE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAW1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,4BAkBtE;AAED,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
package/dist/components/form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { Slot } from "
|
|
4
|
+
import { Slot } from "../lib/slot.js";
|
|
5
5
|
import { Controller, FormProvider, useFormContext, useFormState, } from "react-hook-form";
|
|
6
6
|
import { cn } from "../lib/utils.js";
|
|
7
7
|
import { Label } from "./label.js";
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
|
|
2
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
3
|
+
import { type WithAsChild } from "../lib/base-render";
|
|
4
|
+
declare function HoverCard({ closeDelay, openDelay, ...props }: PreviewCardPrimitive.Root.Props & {
|
|
5
|
+
closeDelay?: number;
|
|
6
|
+
openDelay?: number;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function HoverCardTrigger({ closeDelay, delay, ...props }: WithAsChild<PreviewCardPrimitive.Trigger.Props>): React.JSX.Element;
|
|
9
|
+
declare function HoverCardContent({ className, side, sideOffset, align, alignOffset, ...props }: PreviewCardPrimitive.Popup.Props & Pick<PreviewCardPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
|
|
6
10
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
7
11
|
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAUvE,iBAAS,SAAS,CAAC,EACjB,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,GAAG;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,qBAWA;AAED,iBAAS,gBAAgB,CAAC,EACxB,UAAU,EACV,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,qBAWjD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,IAAe,EACf,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,GACjC,IAAI,CACF,oBAAoB,CAAC,UAAU,CAAC,KAAK,EACrC,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,CAChD,qBAqBF;AAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
5
|
+
import { withAsChildRender } from "../lib/base-render.js";
|
|
4
6
|
import { cn } from "../lib/utils.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
const HoverCardDelayContext = React.createContext({});
|
|
8
|
+
function HoverCard({ closeDelay, openDelay, ...props }) {
|
|
9
|
+
const contextValue = React.useMemo(() => ({ closeDelay, openDelay }), [closeDelay, openDelay]);
|
|
10
|
+
return (_jsx(HoverCardDelayContext.Provider, { value: contextValue, children: _jsx(PreviewCardPrimitive.Root, { "data-slot": "hover-card", ...props }) }));
|
|
7
11
|
}
|
|
8
|
-
function HoverCardTrigger({ ...props }) {
|
|
9
|
-
|
|
12
|
+
function HoverCardTrigger({ closeDelay, delay, ...props }) {
|
|
13
|
+
const delayContext = React.useContext(HoverCardDelayContext);
|
|
14
|
+
return (_jsx(PreviewCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", closeDelay: closeDelay ?? delayContext.closeDelay, delay: delay ?? delayContext.openDelay, ...withAsChildRender(props) }));
|
|
10
15
|
}
|
|
11
|
-
function HoverCardContent({ className, align = "center",
|
|
12
|
-
return (_jsx(
|
|
16
|
+
function HoverCardContent({ className, side = "bottom", sideOffset = 4, align = "center", alignOffset = 4, ...props }) {
|
|
17
|
+
return (_jsx(PreviewCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(PreviewCardPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsx(PreviewCardPrimitive.Popup, { "data-slot": "hover-card-content", className: cn("z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
|
|
13
18
|
}
|
|
14
19
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
package/dist/components/item.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Slot } from "
|
|
4
|
+
import { Slot } from "../lib/slot.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
6
|
import { Separator } from "./separator.js";
|
|
7
7
|
function ItemGroup({ className, ...props }) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
|
|
2
|
+
declare function Label({ className, ...props }: React.ComponentProps<"label">): React.JSX.Element;
|
|
4
3
|
export { Label };
|
|
5
4
|
//# sourceMappingURL=label.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,qBAWpE;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
package/dist/components/label.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Label as LabelPrimitive } from "radix-ui";
|
|
4
3
|
import { cn } from "../lib/utils.js";
|
|
5
4
|
function Label({ className, ...props }) {
|
|
6
|
-
return (_jsx(
|
|
5
|
+
return (_jsx("label", { "data-slot": "label", className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props }));
|
|
7
6
|
}
|
|
8
7
|
export { Label };
|
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
8
|
-
declare function
|
|
9
|
-
declare function
|
|
10
|
-
declare function
|
|
2
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3
|
+
import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./dropdown-menu";
|
|
5
|
+
declare function Menubar({ className, ...props }: MenubarPrimitive.Props): React.JSX.Element;
|
|
6
|
+
declare function MenubarMenu({ ...props }: React.ComponentProps<typeof DropdownMenu>): React.JSX.Element;
|
|
7
|
+
declare function MenubarGroup({ ...props }: React.ComponentProps<typeof DropdownMenuGroup>): React.JSX.Element;
|
|
8
|
+
declare function MenubarPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPortal>): React.JSX.Element;
|
|
9
|
+
declare function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof DropdownMenuTrigger>): React.JSX.Element;
|
|
10
|
+
declare function MenubarContent({ className, align, alignOffset, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
11
|
+
declare function MenubarItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuItem>): React.JSX.Element;
|
|
12
|
+
declare function MenubarCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
|
|
11
13
|
inset?: boolean;
|
|
12
|
-
variant?: "default" | "destructive";
|
|
13
14
|
}): React.JSX.Element;
|
|
14
|
-
declare function
|
|
15
|
-
declare function MenubarRadioItem({ className, children, ...props }:
|
|
16
|
-
declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
15
|
+
declare function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuRadioGroup>): React.JSX.Element;
|
|
16
|
+
declare function MenubarRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
|
|
17
17
|
inset?: boolean;
|
|
18
18
|
}): React.JSX.Element;
|
|
19
|
-
declare function
|
|
20
|
-
declare function MenubarShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
21
|
-
declare function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>): React.JSX.Element;
|
|
22
|
-
declare function MenubarSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
19
|
+
declare function MenubarLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuLabel> & {
|
|
23
20
|
inset?: boolean;
|
|
24
21
|
}): React.JSX.Element;
|
|
25
|
-
declare function
|
|
22
|
+
declare function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuSeparator>): React.JSX.Element;
|
|
23
|
+
declare function MenubarShortcut({ className, ...props }: React.ComponentProps<typeof DropdownMenuShortcut>): React.JSX.Element;
|
|
24
|
+
declare function MenubarSub({ ...props }: React.ComponentProps<typeof DropdownMenuSub>): React.JSX.Element;
|
|
25
|
+
declare function MenubarSubTrigger({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuSubTrigger> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuSubContent>): React.JSX.Element;
|
|
26
29
|
export { Menubar, MenubarPortal, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarSeparator, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSub, MenubarSubTrigger, MenubarSubContent, };
|
|
27
30
|
//# sourceMappingURL=menubar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../src/components/menubar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../../src/components/menubar.tsx"],"names":[],"mappings":"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"}
|