1"use client"
2
3import React, {
4 createContext,
5 useContext,
6 useEffect,
7 useId,
8 useRef,
9 useState,
10} from "react"
11import { ArrowLeftIcon } from "lucide-react"
12import { AnimatePresence, motion, MotionConfig, Variants } from "motion/react"
13
14import { cn } from "@/lib/utils"
15
16const TRANSITION = {
17 type: "spring" as const,
18 bounce: 0.1,
19 duration: 0.4,
20}
21
22interface FloatingPanelContextType {
23 isOpen: boolean
24 openFloatingPanel: (rect: DOMRect) => void
25 closeFloatingPanel: () => void
26 uniqueId: string
27 note: string
28 setNote: (note: string) => void
29 triggerRect: DOMRect | null
30 title: string
31 setTitle: (title: string) => void
32}
33
34const FloatingPanelContext = createContext<
35 FloatingPanelContextType | undefined
36>(undefined)
37
38function useFloatingPanel() {
39 const context = useContext(FloatingPanelContext)
40 if (!context) {
41 throw new Error(
42 "useFloatingPanel must be used within a FloatingPanelProvider"
43 )
44 }
45 return context
46}
47
48function useFloatingPanelLogic() {
49 const uniqueId = useId()
50 const [isOpen, setIsOpen] = useState(false)
51 const [note, setNote] = useState("")
52 const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null)
53 const [title, setTitle] = useState("")
54
55 const openFloatingPanel = (rect: DOMRect) => {
56 setTriggerRect(rect)
57 setIsOpen(true)
58 }
59 const closeFloatingPanel = () => {
60 setIsOpen(false)
61 setNote("")
62 }
63
64 return {
65 isOpen,
66 openFloatingPanel,
67 closeFloatingPanel,
68 uniqueId,
69 note,
70 setNote,
71 triggerRect,
72 title,
73 setTitle,
74 }
75}
76
77interface FloatingPanelRootProps {
78 children: React.ReactNode
79 className?: string
80}
81
82export function FloatingPanelRoot({
83 children,
84 className,
85}: FloatingPanelRootProps) {
86 const floatingPanelLogic = useFloatingPanelLogic()
87
88 return (
89 <FloatingPanelContext.Provider value={floatingPanelLogic}>
90 <MotionConfig transition={TRANSITION}>
91 <div className={cn("relative", className)}>{children}</div>
92 </MotionConfig>
93 </FloatingPanelContext.Provider>
94 )
95}
96
97interface FloatingPanelTriggerProps {
98 children: React.ReactNode
99 className?: string
100 title: string
101}
102
103export function FloatingPanelTrigger({
104 children,
105 className,
106 title,
107}: FloatingPanelTriggerProps) {
108 const { openFloatingPanel, uniqueId, setTitle } = useFloatingPanel()
109 const triggerRef = useRef<HTMLButtonElement>(null)
110
111 const handleClick = () => {
112 if (triggerRef.current) {
113 openFloatingPanel(triggerRef.current.getBoundingClientRect())
114 setTitle(title)
115 }
116 }
117
118 return (
119 <motion.button
120 ref={triggerRef}
121 layoutId={`floating-panel-trigger-${uniqueId}`}
122 className={cn(
123 "flex h-9 items-center border border-zinc-950/10 bg-white px-3 text-zinc-950 dark:border-zinc-50/10 dark:bg-zinc-700 dark:text-zinc-50",
124 className
125 )}
126 style={{ borderRadius: 8 }}
127 onClick={handleClick}
128 whileHover={{ scale: 1.05 }}
129 whileTap={{ scale: 0.95 }}
130 aria-haspopup="dialog"
131 aria-expanded={false}
132 >
133 <motion.div
134 layoutId={`floating-panel-label-container-${uniqueId}`}
135 className="flex items-center"
136 >
137 <motion.span
138 layoutId={`floating-panel-label-${uniqueId}`}
139 className="text-sm font-semibold"
140 >
141 {children}
142 </motion.span>
143 </motion.div>
144 </motion.button>
145 )
146}
147
148interface FloatingPanelContentProps {
149 children: React.ReactNode
150 className?: string
151}
152
153export function FloatingPanelContent({
154 children,
155 className,
156}: FloatingPanelContentProps) {
157 const { isOpen, closeFloatingPanel, uniqueId, triggerRect, title } =
158 useFloatingPanel()
159 const contentRef = useRef<HTMLDivElement>(null)
160
161 useEffect(() => {
162 const handleClickOutside = (event: MouseEvent) => {
163 if (
164 contentRef.current &&
165 !contentRef.current.contains(event.target as Node)
166 ) {
167 closeFloatingPanel()
168 }
169 }
170 document.addEventListener("mousedown", handleClickOutside)
171 return () => document.removeEventListener("mousedown", handleClickOutside)
172 }, [closeFloatingPanel])
173
174 useEffect(() => {
175 const handleKeyDown = (event: KeyboardEvent) => {
176 if (event.key === "Escape") closeFloatingPanel()
177 }
178 document.addEventListener("keydown", handleKeyDown)
179 return () => document.removeEventListener("keydown", handleKeyDown)
180 }, [closeFloatingPanel])
181
182 const variants: Variants = {
183 hidden: { opacity: 0, scale: 0.9, y: 10 },
184 visible: { opacity: 1, scale: 1, y: 0 },
185 }
186
187 return (
188 <AnimatePresence>
189 {isOpen && (
190 <>
191 <motion.div
192 initial={{ backdropFilter: "blur(0px)" }}
193 animate={{ backdropFilter: "blur(4px)" }}
194 exit={{ backdropFilter: "blur(0px)" }}
195 className="fixed inset-0 z-40"
196 />
197 <motion.div
198 ref={contentRef}
199 layoutId={`floating-panel-${uniqueId}`}
200 className={cn(
201 "fixed z-50 overflow-hidden border border-zinc-950/10 bg-white shadow-lg outline-none dark:border-zinc-50/10 dark:bg-zinc-800",
202 className
203 )}
204 style={{
205 borderRadius: 12,
206 left: triggerRect ? triggerRect.left : "50%",
207 top: triggerRect ? triggerRect.bottom + 8 : "50%",
208 transformOrigin: "top left",
209 }}
210 initial="hidden"
211 animate="visible"
212 exit="hidden"
213 variants={variants}
214 role="dialog"
215 aria-modal="true"
216 aria-labelledby={`floating-panel-title-${uniqueId}`}
217 >
218 <FloatingPanelTitle>{title}</FloatingPanelTitle>
219 {children}
220 </motion.div>
221 </>
222 )}
223 </AnimatePresence>
224 )
225}
226
227interface FloatingPanelTitleProps {
228 children: React.ReactNode
229}
230
231function FloatingPanelTitle({ children }: FloatingPanelTitleProps) {
232 const { uniqueId } = useFloatingPanel()
233
234 return (
235 <motion.div
236 layoutId={`floating-panel-label-container-${uniqueId}`}
237 className="px-4 py-2 bg-white dark:bg-zinc-800"
238 >
239 <motion.div
240 layoutId={`floating-panel-label-${uniqueId}`}
241 className="text-sm font-semibold text-zinc-900 dark:text-zinc-100"
242 id={`floating-panel-title-${uniqueId}`}
243 >
244 {children}
245 </motion.div>
246 </motion.div>
247 )
248}
249
250interface FloatingPanelFormProps {
251 children: React.ReactNode
252 onSubmit?: (note: string) => void
253 className?: string
254}
255
256export function FloatingPanelForm({
257 children,
258 onSubmit,
259 className,
260}: FloatingPanelFormProps) {
261 const { note, closeFloatingPanel } = useFloatingPanel()
262
263 const handleSubmit = (e: React.FormEvent) => {
264 e.preventDefault()
265 onSubmit?.(note)
266 closeFloatingPanel()
267 }
268
269 return (
270 <form
271 className={cn("flex h-full flex-col", className)}
272 onSubmit={handleSubmit}
273 >
274 {children}
275 </form>
276 )
277}
278
279interface FloatingPanelLabelProps {
280 children: React.ReactNode
281 htmlFor: string
282 className?: string
283}
284
285export function FloatingPanelLabel({
286 children,
287 htmlFor,
288 className,
289}: FloatingPanelLabelProps) {
290 const { note } = useFloatingPanel()
291
292 return (
293 <motion.label
294 htmlFor={htmlFor}
295 style={{ opacity: note ? 0 : 1 }}
296 className={cn(
297 "block mb-2 text-sm font-medium text-zinc-900 dark:text-zinc-100",
298 className
299 )}
300 >
301 {children}
302 </motion.label>
303 )
304}
305
306interface FloatingPanelTextareaProps {
307 className?: string
308 id?: string
309}
310
311export function FloatingPanelTextarea({
312 className,
313 id,
314}: FloatingPanelTextareaProps) {
315 const { note, setNote } = useFloatingPanel()
316
317 return (
318 <textarea
319 id={id}
320 className={cn(
321 "h-full w-full resize-none rounded-md bg-transparent px-4 py-3 text-sm outline-none",
322 className
323 )}
324 autoFocus
325 value={note}
326 onChange={(e) => setNote(e.target.value)}
327 />
328 )
329}
330
331interface FloatingPanelHeaderProps {
332 children: React.ReactNode
333 className?: string
334}
335
336export function FloatingPanelHeader({
337 children,
338 className,
339}: FloatingPanelHeaderProps) {
340 return (
341 <motion.div
342 className={cn(
343 "px-4 py-2 font-semibold text-zinc-900 dark:text-zinc-100",
344 className
345 )}
346 initial={{ opacity: 0, y: -10 }}
347 animate={{ opacity: 1, y: 0 }}
348 transition={{ delay: 0.1 }}
349 >
350 {children}
351 </motion.div>
352 )
353}
354
355interface FloatingPanelBodyProps {
356 children: React.ReactNode
357 className?: string
358}
359
360export function FloatingPanelBody({
361 children,
362 className,
363}: FloatingPanelBodyProps) {
364 return (
365 <motion.div
366 className={cn("p-4", className)}
367 initial={{ opacity: 0, y: 10 }}
368 animate={{ opacity: 1, y: 0 }}
369 transition={{ delay: 0.2 }}
370 >
371 {children}
372 </motion.div>
373 )
374}
375
376interface FloatingPanelFooterProps {
377 children: React.ReactNode
378 className?: string
379}
380
381export function FloatingPanelFooter({
382 children,
383 className,
384}: FloatingPanelFooterProps) {
385 return (
386 <motion.div
387 className={cn("flex justify-between px-4 py-3", className)}
388 initial={{ opacity: 0, y: 10 }}
389 animate={{ opacity: 1, y: 0 }}
390 transition={{ delay: 0.3 }}
391 >
392 {children}
393 </motion.div>
394 )
395}
396
397interface FloatingPanelCloseButtonProps {
398 className?: string
399}
400
401export function FloatingPanelCloseButton({
402 className,
403}: FloatingPanelCloseButtonProps) {
404 const { closeFloatingPanel } = useFloatingPanel()
405
406 return (
407 <motion.button
408 type="button"
409 className={cn("flex items-center", className)}
410 onClick={closeFloatingPanel}
411 aria-label="Close floating panel"
412 whileHover={{ scale: 1.1 }}
413 whileTap={{ scale: 0.9 }}
414 >
415 <ArrowLeftIcon size={16} className="text-zinc-900 dark:text-zinc-100" />
416 </motion.button>
417 )
418}
419
420interface FloatingPanelSubmitButtonProps {
421 className?: string
422}
423
424export function FloatingPanelSubmitButton({
425 className,
426}: FloatingPanelSubmitButtonProps) {
427 return (
428 <motion.button
429 className={cn(
430 "relative ml-1 flex h-8 shrink-0 scale-100 select-none appearance-none items-center justify-center rounded-lg border border-zinc-950/10 bg-transparent px-2 text-sm text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-800 focus-visible:ring-2 active:scale-[0.98] dark:border-zinc-50/10 dark:text-zinc-50 dark:hover:bg-zinc-800",
431 className
432 )}
433 type="submit"
434 aria-label="Submit note"
435 whileHover={{ scale: 1.05 }}
436 whileTap={{ scale: 0.95 }}
437 >
438 Submit Note
439 </motion.button>
440 )
441}
442
443interface FloatingPanelButtonProps {
444 children: React.ReactNode
445 onClick?: () => void
446 className?: string
447}
448
449export function FloatingPanelButton({
450 children,
451 onClick,
452 className,
453}: FloatingPanelButtonProps) {
454 return (
455 <motion.button
456 className={cn(
457 "flex w-full items-center gap-2 rounded-md px-4 py-2 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-700",
458 className
459 )}
460 onClick={onClick}
461 whileHover={{ backgroundColor: "rgba(0, 0, 0, 0.05)" }}
462 whileTap={{ scale: 0.98 }}
463 >
464 {children}
465 </motion.button>
466 )
467}
468
469export default {
470 Root: FloatingPanelRoot,
471 Trigger: FloatingPanelTrigger,
472 Content: FloatingPanelContent,
473 Form: FloatingPanelForm,
474 Label: FloatingPanelLabel,
475 Textarea: FloatingPanelTextarea,
476 Header: FloatingPanelHeader,
477 Body: FloatingPanelBody,
478 Footer: FloatingPanelFooter,
479 CloseButton: FloatingPanelCloseButton,
480 SubmitButton: FloatingPanelSubmitButton,
481 Button: FloatingPanelButton,
482}
483// "use client"
484
485// import React, {
486// createContext,
487// useContext,
488// useEffect,
489// useId,
490// useRef,
491// useState,
492// } from "react"
493// import { AnimatePresence, MotionConfig, motion } from "motion/react"
494// import { ArrowLeftIcon } from "lucide-react"
495
496// import { cn } from "@/lib/utils"
497
498// const TRANSITION = {
499// type: "spring",
500// bounce: 0.1,
501// duration: 0.4,
502// }
503
504// interface FloatingPanelContextType {
505// isOpen: boolean
506// openFloatingPanel: (rect: DOMRect) => void
507// closeFloatingPanel: () => void
508// uniqueId: string
509// note: string
510// setNote: (note: string) => void
511// triggerRect: DOMRect | null
512// title: string
513// setTitle: (title: string) => void
514// }
515
516// const FloatingPanelContext = createContext<
517// FloatingPanelContextType | undefined
518// >(undefined)
519
520// function useFloatingPanel() {
521// const context = useContext(FloatingPanelContext)
522// if (!context) {
523// throw new Error(
524// "useFloatingPanel must be used within a FloatingPanelProvider"
525// )
526// }
527// return context
528// }
529
530// function useFloatingPanelLogic() {
531// const uniqueId = useId()
532// const [isOpen, setIsOpen] = useState(false)
533// const [note, setNote] = useState("")
534// const [triggerRect, setTriggerRect] = useState<DOMRect | null>(null)
535// const [title, setTitle] = useState("")
536
537// const openFloatingPanel = (rect: DOMRect) => {
538// setTriggerRect(rect)
539// setIsOpen(true)
540// }
541// const closeFloatingPanel = () => {
542// setIsOpen(false)
543// setNote("")
544// }
545
546// return {
547// isOpen,
548// openFloatingPanel,
549// closeFloatingPanel,
550// uniqueId,
551// note,
552// setNote,
553// triggerRect,
554// title,
555// setTitle,
556// }
557// }
558
559// interface FloatingPanelRootProps {
560// children: React.ReactNode
561// className?: string
562// }
563
564// export function FloatingPanelRoot({
565// children,
566// className,
567// }: FloatingPanelRootProps) {
568// const floatingPanelLogic = useFloatingPanelLogic()
569
570// return (
571// <FloatingPanelContext.Provider value={floatingPanelLogic}>
572// <MotionConfig transition={TRANSITION}>
573// <div className={cn("relative", className)}>{children}</div>
574// </MotionConfig>
575// </FloatingPanelContext.Provider>
576// )
577// }
578
579// interface FloatingPanelTriggerProps {
580// children: React.ReactNode
581// className?: string
582// title: string
583// }
584
585// export function FloatingPanelTrigger({
586// children,
587// className,
588// title,
589// }: FloatingPanelTriggerProps) {
590// const { openFloatingPanel, uniqueId, setTitle } = useFloatingPanel()
591// const triggerRef = useRef<HTMLButtonElement>(null)
592
593// const handleClick = () => {
594// if (triggerRef.current) {
595// openFloatingPanel(triggerRef.current.getBoundingClientRect())
596// setTitle(title)
597// }
598// }
599
600// return (
601// <motion.button
602// ref={triggerRef}
603// layoutId={`floating-panel-trigger-${uniqueId}`}
604// className={cn(
605// "flex h-9 items-center border border-zinc-950/10 bg-white px-3 text-zinc-950 dark:border-zinc-50/10 dark:bg-zinc-700 dark:text-zinc-50",
606// className
607// )}
608// style={{ borderRadius: 8 }}
609// onClick={handleClick}
610// whileHover={{ scale: 1.05 }}
611// whileTap={{ scale: 0.95 }}
612// >
613// <motion.span
614// layoutId={`floating-panel-label-${uniqueId}`}
615// className="text-sm"
616// >
617// {children}
618// </motion.span>
619// </motion.button>
620// )
621// }
622
623// interface FloatingPanelContentProps {
624// children: React.ReactNode
625// className?: string
626// }
627
628// export function FloatingPanelContent({
629// children,
630// className,
631// }: FloatingPanelContentProps) {
632// const { isOpen, closeFloatingPanel, uniqueId, triggerRect, title } =
633// useFloatingPanel()
634// const contentRef = useRef<HTMLDivElement>(null)
635
636// useEffect(() => {
637// const handleClickOutside = (event: MouseEvent) => {
638// if (
639// contentRef.current &&
640// !contentRef.current.contains(event.target as Node)
641// ) {
642// closeFloatingPanel()
643// }
644// }
645// document.addEventListener("mousedown", handleClickOutside)
646// return () => document.removeEventListener("mousedown", handleClickOutside)
647// }, [closeFloatingPanel])
648
649// useEffect(() => {
650// const handleKeyDown = (event: KeyboardEvent) => {
651// if (event.key === "Escape") closeFloatingPanel()
652// }
653// document.addEventListener("keydown", handleKeyDown)
654// return () => document.removeEventListener("keydown", handleKeyDown)
655// }, [closeFloatingPanel])
656
657// const variants = {
658// hidden: { opacity: 0, scale: 0.9, y: 10 },
659// visible: { opacity: 1, scale: 1, y: 0 },
660// }
661
662// return (
663// <AnimatePresence>
664// {isOpen && (
665// <>
666// <motion.div
667// initial={{ backdropFilter: "blur(0px)" }}
668// animate={{ backdropFilter: "blur(4px)" }}
669// exit={{ backdropFilter: "blur(0px)" }}
670// className="fixed inset-0 z-40"
671// />
672// <motion.div
673// ref={contentRef}
674// layoutId={`floating-panel-${uniqueId}`}
675// className={cn(
676// "fixed z-50 overflow-hidden border border-zinc-950/10 bg-white shadow-lg outline-none dark:border-zinc-50/10 dark:bg-zinc-800",
677// className
678// )}
679// style={{
680// borderRadius: 12,
681// left: triggerRect ? triggerRect.left : "50%",
682// top: triggerRect ? triggerRect.bottom + 8 : "50%",
683// transformOrigin: "top left",
684// }}
685// initial="hidden"
686// animate="visible"
687// exit="hidden"
688// variants={variants}
689// >
690// <FloatingPanelTitle>{title}</FloatingPanelTitle>
691// {children}
692// </motion.div>
693// </>
694// )}
695// </AnimatePresence>
696// )
697// }
698
699// interface FloatingPanelTitleProps {
700// children: React.ReactNode
701// }
702
703// function FloatingPanelTitle({ children }: FloatingPanelTitleProps) {
704// const { uniqueId } = useFloatingPanel()
705
706// return (
707// <motion.div
708// layoutId={`floating-panel-label-${uniqueId}`}
709// className="px-4 py-2 font-semibold text-zinc-900 dark:text-zinc-100"
710// >
711// {children}
712// </motion.div>
713// )
714// }
715
716// interface FloatingPanelFormProps {
717// children: React.ReactNode
718// onSubmit?: (note: string) => void
719// className?: string
720// }
721
722// export function FloatingPanelForm({
723// children,
724// onSubmit,
725// className,
726// }: FloatingPanelFormProps) {
727// const { note, closeFloatingPanel } = useFloatingPanel()
728
729// const handleSubmit = (e: React.FormEvent) => {
730// e.preventDefault()
731// onSubmit?.(note)
732// closeFloatingPanel()
733// }
734
735// return (
736// <form
737// className={cn("flex h-full flex-col", className)}
738// onSubmit={handleSubmit}
739// >
740// {children}
741// </form>
742// )
743// }
744
745// interface FloatingPanelLabelProps {
746// children: React.ReactNode
747// htmlFor: string
748// className?: string
749// }
750
751// export function FloatingPanelLabel({
752// children,
753// htmlFor,
754// className,
755// }: FloatingPanelLabelProps) {
756// const { note } = useFloatingPanel()
757
758// return (
759// <motion.label
760// htmlFor={htmlFor}
761// style={{ opacity: note ? 0 : 1 }}
762// className={cn(
763// "block mb-2 text-sm font-medium text-zinc-900 dark:text-zinc-100",
764// className
765// )}
766// >
767// {children}
768// </motion.label>
769// )
770// }
771
772// interface FloatingPanelTextareaProps {
773// className?: string
774// id?: string
775// }
776
777// export function FloatingPanelTextarea({
778// className,
779// id,
780// }: FloatingPanelTextareaProps) {
781// const { note, setNote } = useFloatingPanel()
782
783// return (
784// <textarea
785// id={id}
786// className={cn(
787// "h-full w-full resize-none rounded-md bg-transparent px-4 py-3 text-sm outline-none",
788// className
789// )}
790// autoFocus
791// value={note}
792// onChange={(e) => setNote(e.target.value)}
793// />
794// )
795// }
796
797// interface FloatingPanelHeaderProps {
798// children: React.ReactNode
799// className?: string
800// }
801
802// export function FloatingPanelHeader({
803// children,
804// className,
805// }: FloatingPanelHeaderProps) {
806// return (
807// <motion.div
808// className={cn(
809// "px-4 py-2 font-semibold text-zinc-900 dark:text-zinc-100",
810// className
811// )}
812// initial={{ opacity: 0, y: -10 }}
813// animate={{ opacity: 1, y: 0 }}
814// transition={{ delay: 0.1 }}
815// >
816// {children}
817// </motion.div>
818// )
819// }
820
821// interface FloatingPanelBodyProps {
822// children: React.ReactNode
823// className?: string
824// }
825
826// export function FloatingPanelBody({
827// children,
828// className,
829// }: FloatingPanelBodyProps) {
830// return (
831// <motion.div
832// className={cn("p-4", className)}
833// initial={{ opacity: 0, y: 10 }}
834// animate={{ opacity: 1, y: 0 }}
835// transition={{ delay: 0.2 }}
836// >
837// {children}
838// </motion.div>
839// )
840// }
841
842// interface FloatingPanelFooterProps {
843// children: React.ReactNode
844// className?: string
845// }
846
847// export function FloatingPanelFooter({
848// children,
849// className,
850// }: FloatingPanelFooterProps) {
851// return (
852// <motion.div
853// className={cn("flex justify-between px-4 py-3", className)}
854// initial={{ opacity: 0, y: 10 }}
855// animate={{ opacity: 1, y: 0 }}
856// transition={{ delay: 0.3 }}
857// >
858// {children}
859// </motion.div>
860// )
861// }
862
863// interface FloatingPanelCloseButtonProps {
864// className?: string
865// }
866
867// export function FloatingPanelCloseButton({
868// className,
869// }: FloatingPanelCloseButtonProps) {
870// const { closeFloatingPanel } = useFloatingPanel()
871
872// return (
873// <motion.button
874// type="button"
875// className={cn("flex items-center", className)}
876// onClick={closeFloatingPanel}
877// aria-label="Close floating panel"
878// whileHover={{ scale: 1.1 }}
879// whileTap={{ scale: 0.9 }}
880// >
881// <ArrowLeftIcon size={16} className="text-zinc-900 dark:text-zinc-100" />
882// </motion.button>
883// )
884// }
885
886// interface FloatingPanelSubmitButtonProps {
887// className?: string
888// }
889
890// export function FloatingPanelSubmitButton({
891// className,
892// }: FloatingPanelSubmitButtonProps) {
893// return (
894// <motion.button
895// className={cn(
896// "relative ml-1 flex h-8 shrink-0 scale-100 select-none appearance-none items-center justify-center rounded-lg border border-zinc-950/10 bg-transparent px-2 text-sm text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-zinc-800 focus-visible:ring-2 active:scale-[0.98] dark:border-zinc-50/10 dark:text-zinc-50 dark:hover:bg-zinc-800",
897// className
898// )}
899// type="submit"
900// aria-label="Submit note"
901// whileHover={{ scale: 1.05 }}
902// whileTap={{ scale: 0.95 }}
903// >
904// Submit Note
905// </motion.button>
906// )
907// }
908
909// interface FloatingPanelButtonProps {
910// children: React.ReactNode
911// onClick?: () => void
912// className?: string
913// }
914
915// export function FloatingPanelButton({
916// children,
917// onClick,
918// className,
919// }: FloatingPanelButtonProps) {
920// return (
921// <motion.button
922// className={cn(
923// "flex w-full items-center gap-2 rounded-md px-4 py-2 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-700",
924// className
925// )}
926// onClick={onClick}
927// whileHover={{ backgroundColor: "rgba(0, 0, 0, 0.05)" }}
928// whileTap={{ scale: 0.98 }}
929// >
930// {children}
931// </motion.button>
932// )
933// }
934
935// export default {
936// Root: FloatingPanelRoot,
937// Trigger: FloatingPanelTrigger,
938// Content: FloatingPanelContent,
939// Form: FloatingPanelForm,
940// Label: FloatingPanelLabel,
941// Textarea: FloatingPanelTextarea,
942// Header: FloatingPanelHeader,
943// Body: FloatingPanelBody,
944// Footer: FloatingPanelFooter,
945// CloseButton: FloatingPanelCloseButton,
946// SubmitButton: FloatingPanelSubmitButton,
947// Button: FloatingPanelButton,
948// }
949