@exegia/corpora-ui 0.17.0 → 0.19.0
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/dist-lib/components/blocks/nav/sidebar-block.d.ts +1 -1
- package/dist-lib/components/blocks/scaffold/__tests__/scaffold.test.d.ts +1 -0
- package/dist-lib/components/blocks/scaffold/constants.d.ts +23 -0
- package/dist-lib/components/blocks/scaffold/index.d.ts +27 -0
- package/dist-lib/components/blocks/scaffold/panel-close-button.d.ts +4 -0
- package/dist-lib/components/blocks/scaffold/panel-menu-button.d.ts +8 -0
- package/dist-lib/components/blocks/scaffold/scaffold-actions.d.ts +10 -0
- package/dist-lib/components/blocks/scaffold/scaffold-canvas.d.ts +7 -0
- package/dist-lib/components/blocks/scaffold/scaffold-context.d.ts +5 -0
- package/dist-lib/components/blocks/scaffold/scaffold-inspector.d.ts +9 -0
- package/dist-lib/components/blocks/scaffold/scaffold-main.d.ts +8 -0
- package/dist-lib/components/blocks/scaffold/scaffold-panel.d.ts +10 -0
- package/dist-lib/components/blocks/scaffold/scaffold-root.d.ts +8 -0
- package/dist-lib/components/blocks/scaffold/scaffold-sidebar.d.ts +7 -0
- package/dist-lib/components/blocks/scaffold/scaffold-sub-panel.d.ts +3 -0
- package/dist-lib/components/blocks/scaffold/scaffold-tab.d.ts +9 -0
- package/dist-lib/components/blocks/scaffold/type.d.ts +135 -0
- package/dist-lib/components/blocks/scaffold/use-scaffold.d.ts +8 -0
- package/dist-lib/components/blocks/scaffold/utils.d.ts +21 -0
- package/dist-lib/components/blocks/shell/animated-panel-inset.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-panel-provider.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-panel-trigger.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-panel.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-content.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-footer.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-group-content.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-group-label.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-group.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-header.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-button.d.ts +3 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-item.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-sub-button.d.ts +3 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-sub-item.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-menu-sub.d.ts +2 -0
- package/dist-lib/components/blocks/shell/animated-sidebar-menu.d.ts +2 -0
- package/dist-lib/components/blocks/shell/index.d.ts +16 -0
- package/dist-lib/components/blocks/shell/type.d.ts +90 -4
- package/dist-lib/components/blocks/shell/utils.d.ts +37 -0
- package/dist-lib/components/motion/index.d.ts +1 -0
- package/dist-lib/components/motion/overflow-actions.d.ts +35 -0
- package/dist-lib/components/ui/button-group.d.ts +11 -0
- package/dist-lib/components/ui/glasscn/glass-button-group.d.ts +5 -0
- package/dist-lib/components/ui/glasscn/glass-container.d.ts +7 -0
- package/dist-lib/components/ui/glasscn/glass-separator.d.ts +5 -0
- package/dist-lib/components/ui/group.d.ts +17 -0
- package/dist-lib/components/ui/separator.d.ts +2 -3
- package/dist-lib/components/ui/sheet.d.ts +14 -0
- package/dist-lib/components/ui/tooltip.d.ts +6 -0
- package/dist-lib/index.d.ts +2 -1
- package/dist-lib/index.js +1631 -1101
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/lib/ease.d.ts +3 -0
- package/dist-lib/lib/hooks/use-hover-capable.d.ts +6 -0
- package/package.json +2 -1
- package/src/components/beste/piece/browser-frame.tsx +2 -2
- package/src/components/blocks/nav/sidebar-block.tsx +5 -5
- package/src/components/blocks/nav/sidebar-nav-row.tsx +4 -5
- package/src/components/blocks/scaffold/__tests__/scaffold.test.tsx +286 -0
- package/src/components/blocks/scaffold/constants.ts +32 -0
- package/src/components/blocks/scaffold/index.ts +41 -0
- package/src/components/blocks/scaffold/panel-close-button.tsx +36 -0
- package/src/components/blocks/scaffold/panel-menu-button.tsx +218 -0
- package/src/components/blocks/scaffold/scaffold-actions.tsx +88 -0
- package/src/components/blocks/scaffold/scaffold-canvas.tsx +29 -0
- package/src/components/blocks/scaffold/scaffold-context.ts +18 -0
- package/src/components/blocks/scaffold/scaffold-inspector.tsx +80 -0
- package/src/components/blocks/scaffold/scaffold-main.tsx +28 -0
- package/src/components/blocks/scaffold/scaffold-panel.tsx +88 -0
- package/src/components/blocks/scaffold/scaffold-root.tsx +68 -0
- package/src/components/blocks/scaffold/scaffold-sidebar.tsx +31 -0
- package/src/components/blocks/scaffold/scaffold-sub-panel.tsx +51 -0
- package/src/components/blocks/scaffold/scaffold-tab.tsx +66 -0
- package/src/components/blocks/scaffold/type.ts +172 -0
- package/src/components/blocks/scaffold/use-scaffold.ts +48 -0
- package/src/components/blocks/scaffold/utils.ts +46 -0
- package/src/components/blocks/shell/animated-panel-inset.tsx +23 -0
- package/src/components/blocks/shell/animated-panel-provider.tsx +155 -0
- package/src/components/blocks/shell/animated-panel-trigger.tsx +42 -0
- package/src/components/blocks/shell/animated-panel.tsx +135 -0
- package/src/components/blocks/shell/animated-sidebar-content.tsx +19 -0
- package/src/components/blocks/shell/animated-sidebar-footer.tsx +19 -0
- package/src/components/blocks/shell/animated-sidebar-group-content.tsx +16 -0
- package/src/components/blocks/shell/animated-sidebar-group-label.tsx +29 -0
- package/src/components/blocks/shell/animated-sidebar-group.tsx +16 -0
- package/src/components/blocks/shell/animated-sidebar-header.tsx +16 -0
- package/src/components/blocks/shell/animated-sidebar-menu-button.tsx +151 -0
- package/src/components/blocks/shell/animated-sidebar-menu-item.tsx +20 -0
- package/src/components/blocks/shell/animated-sidebar-menu-sub-button.tsx +85 -0
- package/src/components/blocks/shell/animated-sidebar-menu-sub-item.tsx +19 -0
- package/src/components/blocks/shell/animated-sidebar-menu-sub.tsx +44 -0
- package/src/components/blocks/shell/animated-sidebar-menu.tsx +26 -0
- package/src/components/blocks/shell/index.ts +18 -0
- package/src/components/blocks/shell/shell-layout.tsx +28 -36
- package/src/components/blocks/shell/type.ts +112 -6
- package/src/components/blocks/shell/use-shell-panels.ts +1 -1
- package/src/components/blocks/shell/utils.ts +142 -1
- package/src/components/docs/demo-controls.tsx +1 -1
- package/src/components/motion/index.ts +0 -0
- package/src/components/motion/overflow-actions.tsx +376 -0
- package/src/components/ui/button-group.tsx +88 -0
- package/src/components/ui/glasscn/glass-button-group.tsx +48 -0
- package/src/components/ui/glasscn/glass-container.tsx +125 -0
- package/src/components/ui/glasscn/glass-separator.tsx +39 -0
- package/src/components/ui/glasscn/liquid-glass.tsx +250 -210
- package/src/components/ui/group.tsx +92 -0
- package/src/components/ui/separator.tsx +11 -11
- package/src/components/ui/sheet.tsx +135 -0
- package/src/components/ui/tooltip.tsx +66 -0
- package/src/index.css +1 -1
- package/src/index.ts +13 -1
- package/src/lib/ease.ts +26 -0
- package/src/lib/hooks/use-hover-capable.ts +23 -0
- package/dist-lib/components/motion/animated-sidebar.d.ts +0 -106
- package/src/components/motion/animated-sidebar.tsx +0 -1171
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Button } from "@/components/ui/button"
|
|
6
|
+
import { XIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
9
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
|
|
13
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
|
|
17
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
|
|
21
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
|
|
25
|
+
return (
|
|
26
|
+
<SheetPrimitive.Backdrop
|
|
27
|
+
data-slot="sheet-overlay"
|
|
28
|
+
className={cn(
|
|
29
|
+
"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function SheetContent({
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
side = "right",
|
|
41
|
+
showCloseButton = true,
|
|
42
|
+
...props
|
|
43
|
+
}: SheetPrimitive.Popup.Props & {
|
|
44
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
45
|
+
showCloseButton?: boolean
|
|
46
|
+
}) {
|
|
47
|
+
return (
|
|
48
|
+
<SheetPortal>
|
|
49
|
+
<SheetOverlay />
|
|
50
|
+
<SheetPrimitive.Popup
|
|
51
|
+
data-slot="sheet-content"
|
|
52
|
+
data-side={side}
|
|
53
|
+
className={cn(
|
|
54
|
+
"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
{showCloseButton && (
|
|
61
|
+
<SheetPrimitive.Close
|
|
62
|
+
data-slot="sheet-close"
|
|
63
|
+
render={
|
|
64
|
+
<Button
|
|
65
|
+
variant="ghost"
|
|
66
|
+
className="absolute top-3 right-3"
|
|
67
|
+
size="icon-sm"
|
|
68
|
+
/>
|
|
69
|
+
}
|
|
70
|
+
>
|
|
71
|
+
<XIcon />
|
|
72
|
+
<span className="sr-only">Close</span>
|
|
73
|
+
</SheetPrimitive.Close>
|
|
74
|
+
)}
|
|
75
|
+
</SheetPrimitive.Popup>
|
|
76
|
+
</SheetPortal>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
81
|
+
return (
|
|
82
|
+
<div
|
|
83
|
+
data-slot="sheet-header"
|
|
84
|
+
className={cn("flex flex-col gap-0.5 p-4", className)}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
data-slot="sheet-footer"
|
|
94
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
95
|
+
{...props}
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
101
|
+
return (
|
|
102
|
+
<SheetPrimitive.Title
|
|
103
|
+
data-slot="sheet-title"
|
|
104
|
+
className={cn(
|
|
105
|
+
"font-heading text-base font-medium text-foreground",
|
|
106
|
+
className
|
|
107
|
+
)}
|
|
108
|
+
{...props}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function SheetDescription({
|
|
114
|
+
className,
|
|
115
|
+
...props
|
|
116
|
+
}: SheetPrimitive.Description.Props) {
|
|
117
|
+
return (
|
|
118
|
+
<SheetPrimitive.Description
|
|
119
|
+
data-slot="sheet-description"
|
|
120
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
Sheet,
|
|
128
|
+
SheetTrigger,
|
|
129
|
+
SheetClose,
|
|
130
|
+
SheetContent,
|
|
131
|
+
SheetHeader,
|
|
132
|
+
SheetFooter,
|
|
133
|
+
SheetTitle,
|
|
134
|
+
SheetDescription,
|
|
135
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
function TooltipProvider({
|
|
8
|
+
delay = 0,
|
|
9
|
+
...props
|
|
10
|
+
}: TooltipPrimitive.Provider.Props) {
|
|
11
|
+
return (
|
|
12
|
+
<TooltipPrimitive.Provider
|
|
13
|
+
data-slot="tooltip-provider"
|
|
14
|
+
delay={delay}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
|
|
21
|
+
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
|
|
25
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function TooltipContent({
|
|
29
|
+
className,
|
|
30
|
+
side = "top",
|
|
31
|
+
sideOffset = 4,
|
|
32
|
+
align = "center",
|
|
33
|
+
alignOffset = 0,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: TooltipPrimitive.Popup.Props &
|
|
37
|
+
Pick<
|
|
38
|
+
TooltipPrimitive.Positioner.Props,
|
|
39
|
+
"align" | "alignOffset" | "side" | "sideOffset"
|
|
40
|
+
>) {
|
|
41
|
+
return (
|
|
42
|
+
<TooltipPrimitive.Portal>
|
|
43
|
+
<TooltipPrimitive.Positioner
|
|
44
|
+
align={align}
|
|
45
|
+
alignOffset={alignOffset}
|
|
46
|
+
side={side}
|
|
47
|
+
sideOffset={sideOffset}
|
|
48
|
+
className="isolate z-50"
|
|
49
|
+
>
|
|
50
|
+
<TooltipPrimitive.Popup
|
|
51
|
+
data-slot="tooltip-content"
|
|
52
|
+
className={cn(
|
|
53
|
+
"z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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",
|
|
54
|
+
className
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />
|
|
60
|
+
</TooltipPrimitive.Popup>
|
|
61
|
+
</TooltipPrimitive.Positioner>
|
|
62
|
+
</TooltipPrimitive.Portal>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
package/src/index.css
CHANGED
package/src/index.ts
CHANGED
|
@@ -43,13 +43,25 @@ export * from "./components/blocks/nav/sidebar-block"
|
|
|
43
43
|
export * from "./components/blocks/nav/sidebar"
|
|
44
44
|
export * from "./components/blocks/shell"
|
|
45
45
|
export { default as ShellLayout } from "./components/blocks/shell"
|
|
46
|
+
export * from "./components/blocks/scaffold"
|
|
46
47
|
export { default as Layout } from "./components/blocks/layout"
|
|
47
48
|
export * from "./components/blocks/profile/profile-card-block"
|
|
48
49
|
|
|
49
50
|
// motion primitives
|
|
50
|
-
export * from "./components/motion/animated-sidebar"
|
|
51
51
|
export * from "./components/motion/shared-layout-bg"
|
|
52
52
|
|
|
53
|
+
// The v0.17 sidebar monolith became the shell block's AnimatedPanel parts.
|
|
54
|
+
// `blocks/shell` above already exports every part under its new name; these
|
|
55
|
+
// aliases keep the published AnimatedSidebar* names working for consumers.
|
|
56
|
+
// `MobileSidebar` is intentionally absent — AnimatedPanel carries a TODO for
|
|
57
|
+
// the replacement mobile experience.
|
|
58
|
+
export {
|
|
59
|
+
AnimatedPanel as AnimatedSidebar,
|
|
60
|
+
AnimatedPanelProvider as AnimatedSidebarProvider,
|
|
61
|
+
AnimatedPanelTrigger as AnimatedSidebarTrigger,
|
|
62
|
+
AnimatedPanelInset as AnimatedSidebarInset,
|
|
63
|
+
} from "./components/blocks/shell"
|
|
64
|
+
|
|
53
65
|
// lib
|
|
54
66
|
export * from "./lib/auth-accent"
|
|
55
67
|
export * from "./lib/ease"
|
package/src/lib/ease.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Transition, Variants } from "motion/react"
|
|
2
|
+
|
|
1
3
|
export const EASE_OUT = [0.16, 1, 0.3, 1] as const;
|
|
2
4
|
export const EASE_IN_OUT = [0.77, 0, 0.175, 1] as const;
|
|
3
5
|
export const EASE_DRAWER = [0.32, 0.72, 0, 1] as const;
|
|
@@ -51,3 +53,27 @@ export const SPRING_GLIDE = {
|
|
|
51
53
|
damping: 50,
|
|
52
54
|
mass: 0.5,
|
|
53
55
|
} as const;
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// This needs a softer layout spring than the app defaults, so the overflow group
|
|
59
|
+
// stays visually attached to the toggle while entering and leaving.
|
|
60
|
+
export const SHELL_TRANSITION: Transition = {
|
|
61
|
+
type: "spring",
|
|
62
|
+
stiffness: 220,
|
|
63
|
+
damping: 17,
|
|
64
|
+
mass: 0.85,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const ICON_VARIANTS: Variants = {
|
|
68
|
+
hidden: { opacity: 0, filter: "blur(3px)" },
|
|
69
|
+
visible: {
|
|
70
|
+
opacity: 1,
|
|
71
|
+
filter: "blur(0px)",
|
|
72
|
+
transition: { duration: 0.18, ease: EASE_OUT },
|
|
73
|
+
},
|
|
74
|
+
exit: {
|
|
75
|
+
opacity: 0,
|
|
76
|
+
filter: "blur(3px)",
|
|
77
|
+
transition: { duration: 0.18, ease: EASE_OUT },
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns true only on devices that have a true hover (mouse / trackpad).
|
|
7
|
+
* Touch devices fire phantom `:hover` on tap that sticks until tap-elsewhere
|
|
8
|
+
* — gate hover-only effects (scale lifts, magnetic pulls) behind this.
|
|
9
|
+
*/
|
|
10
|
+
export function useHoverCapable() {
|
|
11
|
+
const [canHover, setCanHover] = useState(false);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
15
|
+
const mq = window.matchMedia("(hover: hover) and (pointer: fine)");
|
|
16
|
+
const update = () => setCanHover(mq.matches);
|
|
17
|
+
update();
|
|
18
|
+
mq.addEventListener?.("change", update);
|
|
19
|
+
return () => mq.removeEventListener?.("change", update);
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
return canHover;
|
|
23
|
+
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { HTMLMotionProps } from 'motion/react';
|
|
2
|
-
import { ButtonHTMLAttributes, CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
export type SidebarSide = "left" | "right";
|
|
4
|
-
/** Open flags keyed by the side. Sides left out stay uncontrolled / at their
|
|
5
|
-
* default — there is no per-side prop, the record IS the API. */
|
|
6
|
-
export type SidebarOpenState = Partial<Record<SidebarSide, boolean>>;
|
|
7
|
-
type SidebarVariant = "sidebar" | "floating" | "inset";
|
|
8
|
-
type SidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
9
|
-
interface AnimatedSidebarContextValue {
|
|
10
|
-
isMobile: boolean;
|
|
11
|
-
layoutId: string;
|
|
12
|
-
/** Desktop open state, keyed by side. */
|
|
13
|
-
open: Record<SidebarSide, boolean>;
|
|
14
|
-
/** Mobile overlay open state, keyed by side. */
|
|
15
|
-
openMobile: Record<SidebarSide, boolean>;
|
|
16
|
-
reduce: boolean;
|
|
17
|
-
setOpen: (open: boolean, side: SidebarSide) => void;
|
|
18
|
-
setOpenMobile: (open: boolean, side: SidebarSide) => void;
|
|
19
|
-
/** Mobile-aware: toggles the overlay below md, the docked panel above. */
|
|
20
|
-
toggleSidebar: (side: SidebarSide) => void;
|
|
21
|
-
triggerRefs: Record<SidebarSide, React.RefObject<HTMLButtonElement | null>>;
|
|
22
|
-
}
|
|
23
|
-
export declare function useAnimatedSidebar(): AnimatedSidebarContextValue;
|
|
24
|
-
type SidebarProviderStyle = CSSProperties & {
|
|
25
|
-
"--sidebar-width"?: string;
|
|
26
|
-
"--sidebar-width-icon"?: string;
|
|
27
|
-
"--sidebar-width-mobile"?: string;
|
|
28
|
-
};
|
|
29
|
-
export interface AnimatedSidebarProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
30
|
-
/** Controlled desktop open state, keyed by the side. A side left undefined
|
|
31
|
-
* stays uncontrolled. */
|
|
32
|
-
open?: SidebarOpenState;
|
|
33
|
-
/** Initial desktop open state, merged over `{ left: true, right: false }`. */
|
|
34
|
-
defaultOpen?: SidebarOpenState;
|
|
35
|
-
onOpenChange?: (open: boolean, side: SidebarSide) => void;
|
|
36
|
-
/** Controlled mobile overlay state, keyed by side. */
|
|
37
|
-
openMobile?: SidebarOpenState;
|
|
38
|
-
/** Initial mobile overlay state — every side starts closed. */
|
|
39
|
-
defaultOpenMobile?: SidebarOpenState;
|
|
40
|
-
onOpenMobileChange?: (open: boolean, side: SidebarSide) => void;
|
|
41
|
-
style?: SidebarProviderStyle;
|
|
42
|
-
}
|
|
43
|
-
export declare function AnimatedSidebarProvider({ children, open, defaultOpen, onOpenChange, openMobile, defaultOpenMobile, onOpenMobileChange, className, style, ...props }: AnimatedSidebarProviderProps): import("react").JSX.Element;
|
|
44
|
-
export interface AnimatedSidebarProps extends Omit<HTMLMotionProps<"aside">, "children"> {
|
|
45
|
-
children?: ReactNode;
|
|
46
|
-
side?: SidebarSide;
|
|
47
|
-
variant?: SidebarVariant;
|
|
48
|
-
collapsible?: SidebarCollapsible;
|
|
49
|
-
ariaLabel?: string;
|
|
50
|
-
panelClassName?: string;
|
|
51
|
-
}
|
|
52
|
-
export declare const AnimatedSidebar: import('react').ForwardRefExoticComponent<Omit<AnimatedSidebarProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
53
|
-
export interface AnimatedSidebarTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
54
|
-
side?: SidebarSide;
|
|
55
|
-
}
|
|
56
|
-
export declare const AnimatedSidebarTrigger: import('react').ForwardRefExoticComponent<AnimatedSidebarTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
57
|
-
export interface AnimatedSidebarCloseProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
58
|
-
side?: SidebarSide;
|
|
59
|
-
}
|
|
60
|
-
export declare const AnimatedSidebarClose: import('react').ForwardRefExoticComponent<AnimatedSidebarCloseProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
61
|
-
export interface AnimatedSidebarInsetProps extends HTMLMotionProps<"main"> {
|
|
62
|
-
}
|
|
63
|
-
export declare const AnimatedSidebarInset: import('react').ForwardRefExoticComponent<Omit<AnimatedSidebarInsetProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
|
|
64
|
-
export declare const AnimatedSidebarHeader: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
65
|
-
export declare const AnimatedSidebarContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
66
|
-
export declare const AnimatedSidebarFooter: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
67
|
-
export declare const AnimatedSidebarGroup: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
68
|
-
export declare const AnimatedSidebarGroupLabel: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
69
|
-
export declare const AnimatedSidebarGroupContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
70
|
-
export declare const AnimatedSidebarMenu: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLUListElement> & import('react').RefAttributes<HTMLUListElement>>;
|
|
71
|
-
export declare const AnimatedSidebarMenuItem: import('react').ForwardRefExoticComponent<Omit<HTMLMotionProps<"li">, "ref"> & import('react').RefAttributes<HTMLLIElement>>;
|
|
72
|
-
export interface AnimatedSidebarMenuSubProps extends Omit<HTMLMotionProps<"ul">, "children"> {
|
|
73
|
-
open: boolean;
|
|
74
|
-
children?: ReactNode;
|
|
75
|
-
}
|
|
76
|
-
export declare const AnimatedSidebarMenuSub: import('react').ForwardRefExoticComponent<Omit<AnimatedSidebarMenuSubProps, "ref"> & import('react').RefAttributes<HTMLUListElement>>;
|
|
77
|
-
export declare const AnimatedSidebarMenuSubItem: import('react').ForwardRefExoticComponent<Omit<HTMLMotionProps<"li">, "ref"> & import('react').RefAttributes<HTMLLIElement>>;
|
|
78
|
-
export interface AnimatedSidebarMenuSubButtonProps {
|
|
79
|
-
children: ReactNode;
|
|
80
|
-
icon?: ReactNode;
|
|
81
|
-
href?: string;
|
|
82
|
-
isActive?: boolean;
|
|
83
|
-
disabled?: boolean;
|
|
84
|
-
closeOnSelect?: boolean;
|
|
85
|
-
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
86
|
-
rel?: string;
|
|
87
|
-
onSelect?: () => void;
|
|
88
|
-
className?: string;
|
|
89
|
-
}
|
|
90
|
-
export declare function AnimatedSidebarMenuSubButton({ children, icon, href, isActive, disabled, closeOnSelect, target, rel, onSelect, className, }: AnimatedSidebarMenuSubButtonProps): import("react").JSX.Element;
|
|
91
|
-
export interface AnimatedSidebarMenuButtonProps {
|
|
92
|
-
children: ReactNode;
|
|
93
|
-
icon?: ReactNode;
|
|
94
|
-
badge?: ReactNode;
|
|
95
|
-
href?: string;
|
|
96
|
-
isActive?: boolean;
|
|
97
|
-
ariaExpanded?: boolean;
|
|
98
|
-
disabled?: boolean;
|
|
99
|
-
closeOnSelect?: boolean;
|
|
100
|
-
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
101
|
-
rel?: string;
|
|
102
|
-
onSelect?: () => void;
|
|
103
|
-
className?: string;
|
|
104
|
-
}
|
|
105
|
-
export declare function AnimatedSidebarMenuButton({ children, icon, badge, href, isActive, ariaExpanded, disabled, closeOnSelect, target, rel, onSelect, className, }: AnimatedSidebarMenuButtonProps): import("react").JSX.Element;
|
|
106
|
-
export {};
|