@stevederico/skateboard-ui 3.0.2 → 3.6.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.
Files changed (175) hide show
  1. package/App.jsx +13 -13
  2. package/CHANGELOG.md +64 -0
  3. package/README.md +59 -65
  4. package/components/AuthOverlay.jsx +4 -4
  5. package/components/ProtectedRoute.jsx +1 -1
  6. package/components/ThemeToggle.jsx +1 -1
  7. package/components/UpgradeSheet.jsx +2 -2
  8. package/{core → components/core}/DynamicIcon.jsx +1 -1
  9. package/{layout → components/layout}/Header.jsx +4 -4
  10. package/{layout → components/layout}/Layout.jsx +1 -1
  11. package/{layout → components/layout}/Sidebar.jsx +2 -2
  12. package/{layout → components/layout}/TabBar.jsx +1 -1
  13. package/{views → components/views}/LandingView.jsx +5 -5
  14. package/{views → components/views}/NotFound.jsx +2 -2
  15. package/{views → components/views}/PaymentView.jsx +1 -1
  16. package/{views → components/views}/SettingsView.jsx +6 -6
  17. package/{views → components/views}/SignInView.jsx +6 -6
  18. package/{views → components/views}/SignOutView.jsx +1 -1
  19. package/{views → components/views}/SignUpView.jsx +6 -6
  20. package/{views → components/views}/TextView.jsx +3 -3
  21. package/hooks/useAuthGate.js +1 -1
  22. package/index.js +1 -1
  23. package/package.json +32 -50
  24. package/shadcn/lib/base-ui/LICENSE +21 -0
  25. package/shadcn/lib/base-ui/_chunk-01rqe37g.js +70 -0
  26. package/shadcn/lib/base-ui/_chunk-0h5sskyw.js +347 -0
  27. package/shadcn/lib/base-ui/_chunk-0xhx4g7r.js +57 -0
  28. package/shadcn/lib/base-ui/_chunk-1e6khrvm.js +218 -0
  29. package/shadcn/lib/base-ui/_chunk-1s41sngz.js +302 -0
  30. package/shadcn/lib/base-ui/_chunk-20rtfsz9.js +23 -0
  31. package/shadcn/lib/base-ui/_chunk-2tyt8f8r.js +6034 -0
  32. package/shadcn/lib/base-ui/_chunk-3f31ka8n.js +11 -0
  33. package/shadcn/lib/base-ui/_chunk-3h6zpchb.js +89 -0
  34. package/shadcn/lib/base-ui/_chunk-4s0k3h7t.js +114 -0
  35. package/shadcn/lib/base-ui/_chunk-502wngfc.js +598 -0
  36. package/shadcn/lib/base-ui/_chunk-536jvgeq.js +68 -0
  37. package/shadcn/lib/base-ui/_chunk-611pz5sm.js +10 -0
  38. package/shadcn/lib/base-ui/_chunk-65zw5gs2.js +15 -0
  39. package/shadcn/lib/base-ui/_chunk-6b17g8t7.js +34 -0
  40. package/shadcn/lib/base-ui/_chunk-6xevjepc.js +15 -0
  41. package/shadcn/lib/base-ui/_chunk-71zm6zgv.js +16 -0
  42. package/shadcn/lib/base-ui/_chunk-7fmjymvh.js +32 -0
  43. package/shadcn/lib/base-ui/_chunk-7jjzay8b.js +176 -0
  44. package/shadcn/lib/base-ui/_chunk-7v1t86x1.js +43 -0
  45. package/shadcn/lib/base-ui/_chunk-85vrgzwr.js +227 -0
  46. package/shadcn/lib/base-ui/_chunk-8jz3hb7q.js +9 -0
  47. package/shadcn/lib/base-ui/_chunk-8kh3xk78.js +35 -0
  48. package/shadcn/lib/base-ui/_chunk-97tas84n.js +67 -0
  49. package/shadcn/lib/base-ui/_chunk-9nyxkvte.js +13 -0
  50. package/shadcn/lib/base-ui/_chunk-a8fwg9d0.js +52 -0
  51. package/shadcn/lib/base-ui/_chunk-agc6ew3g.js +29 -0
  52. package/shadcn/lib/base-ui/_chunk-aqwsk46c.js +64 -0
  53. package/shadcn/lib/base-ui/_chunk-atd5kq5q.js +803 -0
  54. package/shadcn/lib/base-ui/_chunk-atnkefgd.js +104 -0
  55. package/shadcn/lib/base-ui/_chunk-b40erthe.js +7 -0
  56. package/shadcn/lib/base-ui/_chunk-b5jsqt97.js +50 -0
  57. package/shadcn/lib/base-ui/_chunk-bk7n9s9e.js +15 -0
  58. package/shadcn/lib/base-ui/_chunk-c3572b5x.js +19 -0
  59. package/shadcn/lib/base-ui/_chunk-cwr896nf.js +25 -0
  60. package/shadcn/lib/base-ui/_chunk-drfb9kp2.js +27 -0
  61. package/shadcn/lib/base-ui/_chunk-ds8fnpjj.js +0 -0
  62. package/shadcn/lib/base-ui/_chunk-ek863ta9.js +82 -0
  63. package/shadcn/lib/base-ui/_chunk-f09cp81f.js +12 -0
  64. package/shadcn/lib/base-ui/_chunk-f5d01bp9.js +0 -0
  65. package/shadcn/lib/base-ui/_chunk-f9tgee1q.js +21 -0
  66. package/shadcn/lib/base-ui/_chunk-fch5cba8.js +84 -0
  67. package/shadcn/lib/base-ui/_chunk-gfce3j3z.js +18 -0
  68. package/shadcn/lib/base-ui/_chunk-ha06w2pp.js +2391 -0
  69. package/shadcn/lib/base-ui/_chunk-hzgetm70.js +23 -0
  70. package/shadcn/lib/base-ui/_chunk-j0eqdjta.js +39 -0
  71. package/shadcn/lib/base-ui/_chunk-k1e5fvcj.js +48 -0
  72. package/shadcn/lib/base-ui/_chunk-k4mc2kan.js +81 -0
  73. package/shadcn/lib/base-ui/_chunk-kfz96xv1.js +128 -0
  74. package/shadcn/lib/base-ui/_chunk-m45547cc.js +15 -0
  75. package/shadcn/lib/base-ui/_chunk-mbn76q14.js +184 -0
  76. package/shadcn/lib/base-ui/_chunk-mvv30fkv.js +9 -0
  77. package/shadcn/lib/base-ui/_chunk-mznt6ktj.js +33 -0
  78. package/shadcn/lib/base-ui/_chunk-n7dnqnbw.js +7 -0
  79. package/shadcn/lib/base-ui/_chunk-nya71ccw.js +546 -0
  80. package/shadcn/lib/base-ui/_chunk-p6qynd6r.js +146 -0
  81. package/shadcn/lib/base-ui/_chunk-q3nee19r.js +323 -0
  82. package/shadcn/lib/base-ui/_chunk-q7yw9mz4.js +385 -0
  83. package/shadcn/lib/base-ui/_chunk-qce0xt57.js +107 -0
  84. package/shadcn/lib/base-ui/_chunk-qgzhcjsj.js +14 -0
  85. package/shadcn/lib/base-ui/_chunk-qt6r015s.js +38 -0
  86. package/shadcn/lib/base-ui/_chunk-r0vsdknk.js +4 -0
  87. package/shadcn/lib/base-ui/_chunk-sx6vkz01.js +150 -0
  88. package/shadcn/lib/base-ui/_chunk-szcr6mhk.js +6 -0
  89. package/shadcn/lib/base-ui/_chunk-t7j3rbpv.js +67 -0
  90. package/shadcn/lib/base-ui/_chunk-tmfmrzwe.js +39 -0
  91. package/shadcn/lib/base-ui/_chunk-v92ycsfj.js +9 -0
  92. package/shadcn/lib/base-ui/_chunk-vdc01ss3.js +6 -0
  93. package/shadcn/lib/base-ui/_chunk-vjbnhhg1.js +26 -0
  94. package/shadcn/lib/base-ui/_chunk-w68yxg9d.js +21 -0
  95. package/shadcn/lib/base-ui/_chunk-wana68v3.js +477 -0
  96. package/shadcn/lib/base-ui/_chunk-wtw745qd.js +12 -0
  97. package/shadcn/lib/base-ui/_chunk-xb7ph1ka.js +6 -0
  98. package/shadcn/lib/base-ui/_chunk-xfagb0fq.js +28 -0
  99. package/shadcn/lib/base-ui/_chunk-xxhqanfd.js +16 -0
  100. package/shadcn/lib/base-ui/_chunk-y887e46p.js +15 -0
  101. package/shadcn/lib/base-ui/_chunk-ymj1dpqg.js +14 -0
  102. package/shadcn/lib/base-ui/accordion.js +650 -0
  103. package/shadcn/lib/base-ui/alert-dialog.js +138 -0
  104. package/shadcn/lib/base-ui/avatar.js +235 -0
  105. package/shadcn/lib/base-ui/button.js +52 -0
  106. package/shadcn/lib/base-ui/checkbox.js +454 -0
  107. package/shadcn/lib/base-ui/collapsible.js +283 -0
  108. package/shadcn/lib/base-ui/context-menu.js +324 -0
  109. package/shadcn/lib/base-ui/dialog.js +71 -0
  110. package/shadcn/lib/base-ui/input.js +1028 -0
  111. package/shadcn/lib/base-ui/menu.js +61 -0
  112. package/shadcn/lib/base-ui/menubar.js +157 -0
  113. package/shadcn/lib/base-ui/merge-props.js +15 -0
  114. package/shadcn/lib/base-ui/navigation-menu.js +1854 -0
  115. package/shadcn/lib/base-ui/popover.js +1090 -0
  116. package/shadcn/lib/base-ui/preview-card.js +709 -0
  117. package/shadcn/lib/base-ui/progress.js +278 -0
  118. package/shadcn/lib/base-ui/radio-group.js +247 -0
  119. package/shadcn/lib/base-ui/radio.js +382 -0
  120. package/shadcn/lib/base-ui/scroll-area.js +1061 -0
  121. package/shadcn/lib/base-ui/select.js +2438 -0
  122. package/shadcn/lib/base-ui/separator.js +11 -0
  123. package/shadcn/lib/base-ui/slider.js +1595 -0
  124. package/shadcn/lib/base-ui/switch.js +333 -0
  125. package/shadcn/lib/base-ui/tabs.js +892 -0
  126. package/shadcn/lib/base-ui/toggle-group.js +152 -0
  127. package/shadcn/lib/base-ui/toggle.js +133 -0
  128. package/shadcn/lib/base-ui/tooltip.js +791 -0
  129. package/shadcn/lib/base-ui/use-render.js +15 -0
  130. package/shadcn/lib/tailwind-merge.js +3312 -0
  131. package/shadcn/lib/utils.js +1 -1
  132. package/shadcn/ui/accordion.jsx +1 -1
  133. package/shadcn/ui/alert-dialog.jsx +1 -1
  134. package/shadcn/ui/avatar.jsx +1 -1
  135. package/shadcn/ui/badge.jsx +2 -2
  136. package/shadcn/ui/breadcrumb.jsx +2 -2
  137. package/shadcn/ui/button-group.jsx +2 -2
  138. package/shadcn/ui/button.jsx +1 -1
  139. package/shadcn/ui/calendar.jsx +1 -1
  140. package/shadcn/ui/checkbox.jsx +1 -1
  141. package/shadcn/ui/collapsible.jsx +1 -1
  142. package/shadcn/ui/command.jsx +1 -1
  143. package/shadcn/ui/context-menu.jsx +1 -1
  144. package/shadcn/ui/dialog.jsx +1 -1
  145. package/shadcn/ui/drawer.jsx +176 -74
  146. package/shadcn/ui/dropdown-menu.jsx +1 -1
  147. package/shadcn/ui/hover-card.jsx +1 -1
  148. package/shadcn/ui/input.jsx +1 -1
  149. package/shadcn/ui/item.jsx +2 -2
  150. package/shadcn/ui/menubar.jsx +2 -2
  151. package/shadcn/ui/navigation-menu.jsx +1 -1
  152. package/shadcn/ui/popover.jsx +1 -1
  153. package/shadcn/ui/progress.jsx +1 -1
  154. package/shadcn/ui/radio-group.jsx +2 -2
  155. package/shadcn/ui/scroll-area.jsx +1 -1
  156. package/shadcn/ui/select.jsx +1 -1
  157. package/shadcn/ui/separator.jsx +1 -1
  158. package/shadcn/ui/sheet.jsx +1 -1
  159. package/shadcn/ui/sidebar.jsx +3 -3
  160. package/shadcn/ui/slider.jsx +1 -1
  161. package/shadcn/ui/switch.jsx +1 -1
  162. package/shadcn/ui/tabs.jsx +1 -1
  163. package/shadcn/ui/toggle-group.jsx +2 -2
  164. package/shadcn/ui/toggle.jsx +1 -1
  165. package/shadcn/ui/tooltip.jsx +1 -1
  166. package/styles.css +31 -0
  167. package/MIGRATION.md +0 -230
  168. package/shadcn/ui/carousel.jsx +0 -195
  169. package/shadcn/ui/chart.jsx +0 -312
  170. package/shadcn/ui/resizable.jsx +0 -47
  171. /package/{core → components/core}/Calendar.jsx +0 -0
  172. /package/{core → components/core}/Command.jsx +0 -0
  173. /package/{core → components/core}/Context.jsx +0 -0
  174. /package/{core → components/core}/ThemeProvider.jsx +0 -0
  175. /package/{core → components/core}/Utilities.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import { clsx } from "./clsx.js";
2
- import { twMerge } from "tailwind-merge";
2
+ import { twMerge } from "./tailwind-merge.js";
3
3
 
4
4
  export function cn(...inputs) {
5
5
  return twMerge(clsx(inputs));
@@ -1,4 +1,4 @@
1
- import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
1
+ import { Accordion as AccordionPrimitive } from "../lib/base-ui/accordion.js"
2
2
 
3
3
  import { cn } from "../lib/utils.js"
4
4
  import { ChevronDownIcon, ChevronUpIcon } from "../../icons"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
4
+ import { AlertDialog as AlertDialogPrimitive } from "../lib/base-ui/alert-dialog.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
  import { Button } from "./button.jsx"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar"
4
+ import { Avatar as AvatarPrimitive } from "../lib/base-ui/avatar.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
 
@@ -1,5 +1,5 @@
1
- import { mergeProps } from "@base-ui/react/merge-props"
2
- import { useRender } from "@base-ui/react/use-render"
1
+ import { mergeProps } from "../lib/base-ui/merge-props.js"
2
+ import { useRender } from "../lib/base-ui/use-render.js"
3
3
  import { cva } from "../lib/cva.js";
4
4
 
5
5
  import { cn } from "../lib/utils.js"
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
- import { mergeProps } from "@base-ui/react/merge-props"
3
- import { useRender } from "@base-ui/react/use-render"
2
+ import { mergeProps } from "../lib/base-ui/merge-props.js"
3
+ import { useRender } from "../lib/base-ui/use-render.js"
4
4
 
5
5
  import { cn } from "../lib/utils.js"
6
6
  import { ChevronRightIcon, MoreHorizontalIcon } from "../../icons"
@@ -1,5 +1,5 @@
1
- import { mergeProps } from "@base-ui/react/merge-props"
2
- import { useRender } from "@base-ui/react/use-render"
1
+ import { mergeProps } from "../lib/base-ui/merge-props.js"
2
+ import { useRender } from "../lib/base-ui/use-render.js"
3
3
  import { cva } from "../lib/cva.js";
4
4
 
5
5
  import { cn } from "../lib/utils.js"
@@ -1,4 +1,4 @@
1
- import { Button as ButtonPrimitive } from "@base-ui/react/button"
1
+ import { Button as ButtonPrimitive } from "../lib/base-ui/button.js"
2
2
  import { cva } from "../lib/cva.js";
3
3
 
4
4
  import { cn } from "../lib/utils.js"
@@ -1,5 +1,5 @@
1
1
  import * as React from "react"
2
- import { DayPicker, getDefaultClassNames } from "../../core/Calendar.jsx";
2
+ import { DayPicker, getDefaultClassNames } from "../../components/core/Calendar.jsx";
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
  import { Button, buttonVariants } from "./button.jsx"
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
3
+ import { Checkbox as CheckboxPrimitive } from "../lib/base-ui/checkbox.js"
4
4
 
5
5
  import { cn } from "../lib/utils.js"
6
6
  import { CheckIcon } from "../../icons"
@@ -1,4 +1,4 @@
1
- import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"
1
+ import { Collapsible as CollapsiblePrimitive } from "../lib/base-ui/collapsible.js"
2
2
 
3
3
  function Collapsible({
4
4
  ...props
@@ -1,5 +1,5 @@
1
1
  import * as React from "react"
2
- import { Command as CommandPrimitive } from "../../core/Command.jsx"
2
+ import { Command as CommandPrimitive } from "../../components/core/Command.jsx"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
  import {
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu"
4
+ import { ContextMenu as ContextMenuPrimitive } from "../lib/base-ui/context-menu.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
  import { ChevronRightIcon, CheckIcon } from "../../icons"
@@ -1,5 +1,5 @@
1
1
  import * as React from "react"
2
- import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
2
+ import { Dialog as DialogPrimitive } from "../lib/base-ui/dialog.js"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
  import { Button } from "./button.jsx"
@@ -1,119 +1,221 @@
1
1
  import * as React from "react"
2
- import { Drawer as DrawerPrimitive } from "vaul"
2
+ import { Dialog as DialogPrimitive } from "../lib/base-ui/dialog.js"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
 
6
- function Drawer({
7
- ...props
8
- }) {
9
- return <DrawerPrimitive.Root data-slot="drawer" {...props} />;
6
+ // Drag thresholds and animation timing ported from vaul (MIT — Emil Kowalski).
7
+ // https://github.com/emilkowalski/vaul/blob/main/src/constants.ts
8
+ const VELOCITY_THRESHOLD = 0.4
9
+ const CLOSE_THRESHOLD = 0.25
10
+ const TRANSITION = "transform 500ms cubic-bezier(0.32, 0.72, 0, 1)"
11
+
12
+ function dampenValue(v) {
13
+ return 8 * (Math.log(v + 1) - 2)
14
+ }
15
+
16
+ // Ported from vaul/src/index.tsx `shouldDrag`. Skips drag when the pointer is
17
+ // inside a scrollable child that isn't at scrollTop=0 (lets content scroll
18
+ // naturally), on a <select>, on a [data-no-drag] subtree, or when text is
19
+ // highlighted.
20
+ function shouldDrag(el, popup) {
21
+ let element = el
22
+ if (window.getSelection()?.toString()) return false
23
+ while (element && element !== popup) {
24
+ if (element.tagName === "SELECT") return false
25
+ if (element.hasAttribute?.("data-no-drag") || element.closest?.("[data-no-drag]")) return false
26
+ if (element.scrollHeight > element.clientHeight && element.scrollTop !== 0) return false
27
+ element = element.parentNode
28
+ }
29
+ return true
30
+ }
31
+
32
+ const DrawerCtx = React.createContext(null)
33
+
34
+ function Drawer({ open, defaultOpen, onOpenChange, ...props }) {
35
+ const [internalOpen, setInternalOpen] = React.useState(defaultOpen ?? false)
36
+ const isControlled = open !== undefined
37
+ const actualOpen = isControlled ? open : internalOpen
38
+ const handleOpenChange = React.useCallback(
39
+ (next) => {
40
+ if (!isControlled) setInternalOpen(next)
41
+ onOpenChange?.(next)
42
+ },
43
+ [isControlled, onOpenChange]
44
+ )
45
+ return (
46
+ <DrawerCtx.Provider value={{ onOpenChange: handleOpenChange }}>
47
+ <DialogPrimitive.Root
48
+ data-slot="drawer"
49
+ open={actualOpen}
50
+ onOpenChange={handleOpenChange}
51
+ {...props}
52
+ />
53
+ </DrawerCtx.Provider>
54
+ )
10
55
  }
11
56
 
12
- function DrawerTrigger({
13
- ...props
14
- }) {
15
- return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
57
+ function DrawerTrigger(props) {
58
+ return <DialogPrimitive.Trigger data-slot="drawer-trigger" {...props} />
16
59
  }
17
60
 
18
- function DrawerPortal({
19
- ...props
20
- }) {
21
- return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
61
+ function DrawerPortal(props) {
62
+ return <DialogPrimitive.Portal data-slot="drawer-portal" {...props} />
22
63
  }
23
64
 
24
- function DrawerClose({
25
- ...props
26
- }) {
27
- return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
65
+ function DrawerClose(props) {
66
+ return <DialogPrimitive.Close data-slot="drawer-close" {...props} />
28
67
  }
29
68
 
30
- function DrawerOverlay({
31
- className,
32
- ...props
33
- }) {
69
+ function DrawerOverlay({ className, ...props }) {
34
70
  return (
35
- <DrawerPrimitive.Overlay
71
+ <DialogPrimitive.Backdrop
36
72
  data-slot="drawer-overlay"
37
- className={cn(
38
- "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",
39
- className
40
- )}
41
- {...props} />
42
- );
73
+ className={cn("drawer-backdrop fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs", className)}
74
+ {...props}
75
+ />
76
+ )
43
77
  }
44
78
 
45
- function DrawerContent({
46
- className,
47
- children,
48
- ...props
49
- }) {
79
+ function DrawerContent({ className, children, ...props }) {
80
+ const popupRef = React.useRef(null)
81
+ const ctx = React.useContext(DrawerCtx)
82
+ const dragState = React.useRef({ dragging: false, startY: 0, height: 0, startTime: 0 })
83
+
84
+ const snapBack = React.useCallback(() => {
85
+ const el = popupRef.current
86
+ if (!el) return
87
+ el.style.transition = ""
88
+ el.style.transform = ""
89
+ }, [])
90
+
91
+ const dismiss = React.useCallback(() => {
92
+ const el = popupRef.current
93
+ if (!el) {
94
+ ctx?.onOpenChange(false)
95
+ return
96
+ }
97
+ el.style.transition = TRANSITION
98
+ el.style.transform = "translate3d(0, 100%, 0)"
99
+ window.setTimeout(() => {
100
+ ctx?.onOpenChange(false)
101
+ }, 500)
102
+ }, [ctx])
103
+
104
+ const handlePointerDown = React.useCallback((event) => {
105
+ const el = popupRef.current
106
+ if (!el || !shouldDrag(event.target, el)) return
107
+ event.target.setPointerCapture?.(event.pointerId)
108
+ dragState.current = {
109
+ dragging: true,
110
+ startY: event.clientY,
111
+ height: el.getBoundingClientRect().height || 0,
112
+ startTime: event.timeStamp,
113
+ }
114
+ el.style.transition = "none"
115
+ }, [])
116
+
117
+ const handlePointerMove = React.useCallback((event) => {
118
+ const state = dragState.current
119
+ if (!state.dragging) return
120
+ const el = popupRef.current
121
+ if (!el) return
122
+ const delta = event.clientY - state.startY
123
+ if (delta >= 0) {
124
+ // Dragging down toward close — direct translate
125
+ el.style.transform = `translate3d(0, ${delta}px, 0)`
126
+ } else {
127
+ // Dragging up away from close — logarithmic rubber-band damping (vaul-style)
128
+ const damped = -dampenValue(-delta)
129
+ el.style.transform = `translate3d(0, ${damped}px, 0)`
130
+ }
131
+ }, [])
132
+
133
+ const handlePointerUp = React.useCallback(
134
+ (event) => {
135
+ const state = dragState.current
136
+ if (!state.dragging) return
137
+ state.dragging = false
138
+ const delta = event.clientY - state.startY
139
+ const elapsed = Math.max(1, event.timeStamp - state.startTime)
140
+ const velocity = Math.abs(delta) / elapsed
141
+
142
+ if (delta < 0) {
143
+ snapBack()
144
+ return
145
+ }
146
+ if (velocity > VELOCITY_THRESHOLD || delta >= state.height * CLOSE_THRESHOLD) {
147
+ dismiss()
148
+ } else {
149
+ snapBack()
150
+ }
151
+ },
152
+ [dismiss, snapBack]
153
+ )
154
+
155
+ const handlePointerCancel = React.useCallback(() => {
156
+ if (!dragState.current.dragging) return
157
+ dragState.current.dragging = false
158
+ snapBack()
159
+ }, [snapBack])
160
+
50
161
  return (
51
- <DrawerPortal data-slot="drawer-portal">
162
+ <DrawerPortal>
52
163
  <DrawerOverlay />
53
- <DrawerPrimitive.Content
164
+ <DialogPrimitive.Popup
165
+ ref={popupRef}
54
166
  data-slot="drawer-content"
55
- className={cn(
56
- "bg-background flex h-auto flex-col text-sm outline-none data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50",
57
- className
58
- )}
59
- {...props}>
60
- <div
61
- className="bg-muted mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block bg-muted mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
167
+ className={cn("drawer-popup bg-background text-sm", className)}
168
+ onPointerDown={handlePointerDown}
169
+ onPointerMove={handlePointerMove}
170
+ onPointerUp={handlePointerUp}
171
+ onPointerCancel={handlePointerCancel}
172
+ {...props}
173
+ >
174
+ <div className="bg-muted mx-auto mt-4 h-1.5 w-[100px] shrink-0 rounded-full" />
62
175
  {children}
63
- </DrawerPrimitive.Content>
176
+ </DialogPrimitive.Popup>
64
177
  </DrawerPortal>
65
- );
178
+ )
66
179
  }
67
180
 
68
- function DrawerHeader({
69
- className,
70
- ...props
71
- }) {
181
+ function DrawerHeader({ className, ...props }) {
72
182
  return (
73
183
  <div
74
184
  data-slot="drawer-header"
75
- className={cn(
76
- "gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left flex flex-col",
77
- className
78
- )}
79
- {...props} />
80
- );
185
+ className={cn("gap-0.5 p-4 text-center md:gap-1.5 md:text-left flex flex-col", className)}
186
+ {...props}
187
+ />
188
+ )
81
189
  }
82
190
 
83
- function DrawerFooter({
84
- className,
85
- ...props
86
- }) {
191
+ function DrawerFooter({ className, ...props }) {
87
192
  return (
88
193
  <div
89
194
  data-slot="drawer-footer"
90
195
  className={cn("gap-2 p-4 mt-auto flex flex-col", className)}
91
- {...props} />
92
- );
196
+ {...props}
197
+ />
198
+ )
93
199
  }
94
200
 
95
- function DrawerTitle({
96
- className,
97
- ...props
98
- }) {
201
+ function DrawerTitle({ className, ...props }) {
99
202
  return (
100
- <DrawerPrimitive.Title
203
+ <DialogPrimitive.Title
101
204
  data-slot="drawer-title"
102
205
  className={cn("text-foreground font-medium", className)}
103
- {...props} />
104
- );
206
+ {...props}
207
+ />
208
+ )
105
209
  }
106
210
 
107
- function DrawerDescription({
108
- className,
109
- ...props
110
- }) {
211
+ function DrawerDescription({ className, ...props }) {
111
212
  return (
112
- <DrawerPrimitive.Description
213
+ <DialogPrimitive.Description
113
214
  data-slot="drawer-description"
114
215
  className={cn("text-muted-foreground text-sm", className)}
115
- {...props} />
116
- );
216
+ {...props}
217
+ />
218
+ )
117
219
  }
118
220
 
119
221
  export {
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { Menu as MenuPrimitive } from "@base-ui/react/menu"
4
+ import { Menu as MenuPrimitive } from "../lib/base-ui/menu.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
  import { ChevronRightIcon, CheckIcon } from "../../icons"
@@ -1,4 +1,4 @@
1
- import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card"
1
+ import { PreviewCard as PreviewCardPrimitive } from "../lib/base-ui/preview-card.js"
2
2
 
3
3
  import { cn } from "../lib/utils.js"
4
4
 
@@ -1,5 +1,5 @@
1
1
  import * as React from "react"
2
- import { Input as InputPrimitive } from "@base-ui/react/input"
2
+ import { Input as InputPrimitive } from "../lib/base-ui/input.js"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
 
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
- import { mergeProps } from "@base-ui/react/merge-props"
3
- import { useRender } from "@base-ui/react/use-render"
2
+ import { mergeProps } from "../lib/base-ui/merge-props.js"
3
+ import { useRender } from "../lib/base-ui/use-render.js"
4
4
  import { cva } from "../lib/cva.js";
5
5
 
6
6
  import { cn } from "../lib/utils.js"
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { Menu as MenuPrimitive } from "@base-ui/react/menu"
5
- import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar"
4
+ import { Menu as MenuPrimitive } from "../lib/base-ui/menu.js"
5
+ import { Menubar as MenubarPrimitive } from "../lib/base-ui/menubar.js"
6
6
 
7
7
  import { cn } from "../lib/utils.js"
8
8
  import {
@@ -1,4 +1,4 @@
1
- import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu"
1
+ import { NavigationMenu as NavigationMenuPrimitive } from "../lib/base-ui/navigation-menu.js"
2
2
  import { cva } from "../lib/cva.js"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
4
+ import { Popover as PopoverPrimitive } from "../lib/base-ui/popover.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
 
@@ -1,4 +1,4 @@
1
- import { Progress as ProgressPrimitive } from "@base-ui/react/progress"
1
+ import { Progress as ProgressPrimitive } from "../lib/base-ui/progress.js"
2
2
 
3
3
  import { cn } from "../lib/utils.js"
4
4
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { Radio as RadioPrimitive } from "@base-ui/react/radio"
4
- import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
3
+ import { Radio as RadioPrimitive } from "../lib/base-ui/radio.js"
4
+ import { RadioGroup as RadioGroupPrimitive } from "../lib/base-ui/radio-group.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
  import { CircleIcon } from "../../icons"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
4
+ import { ScrollArea as ScrollAreaPrimitive } from "../lib/base-ui/scroll-area.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
 
@@ -1,5 +1,5 @@
1
1
  import * as React from "react"
2
- import { Select as SelectPrimitive } from "@base-ui/react/select"
2
+ import { Select as SelectPrimitive } from "../lib/base-ui/select.js"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
  import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "../../icons"
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
3
+ import { Separator as SeparatorPrimitive } from "../lib/base-ui/separator.js"
4
4
 
5
5
  import { cn } from "../lib/utils.js"
6
6
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
4
+ import { Dialog as SheetPrimitive } from "../lib/base-ui/dialog.js"
5
5
 
6
6
  import { cn } from "../lib/utils.js"
7
7
  import { Button } from "./button.jsx"
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as React from "react"
3
- import { mergeProps } from "@base-ui/react/merge-props"
4
- import { useRender } from "@base-ui/react/use-render"
3
+ import { mergeProps } from "../lib/base-ui/merge-props.js"
4
+ import { useRender } from "../lib/base-ui/use-render.js"
5
5
  import { cva } from "../lib/cva.js";
6
6
 
7
7
  import { cn } from "../lib/utils.js"
@@ -454,7 +454,7 @@ const sidebarMenuButtonVariants = cva(
454
454
  variants: {
455
455
  variant: {
456
456
  default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
457
- outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
457
+ outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
458
458
  },
459
459
  size: {
460
460
  default: "h-10 text-base",
@@ -1,5 +1,5 @@
1
1
  import * as React from "react"
2
- import { Slider as SliderPrimitive } from "@base-ui/react/slider"
2
+ import { Slider as SliderPrimitive } from "../lib/base-ui/slider.js"
3
3
 
4
4
  import { cn } from "../lib/utils.js"
5
5
 
@@ -1,4 +1,4 @@
1
- import { Switch as SwitchPrimitive } from "@base-ui/react/switch"
1
+ import { Switch as SwitchPrimitive } from "../lib/base-ui/switch.js"
2
2
 
3
3
  import { cn } from "../lib/utils.js"
4
4
 
@@ -1,4 +1,4 @@
1
- import { Tabs as TabsPrimitive } from "@base-ui/react/tabs"
1
+ import { Tabs as TabsPrimitive } from "../lib/base-ui/tabs.js"
2
2
  import { cva } from "../lib/cva.js";
3
3
 
4
4
  import { cn } from "../lib/utils.js"
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
- import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
3
- import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group"
2
+ import { Toggle as TogglePrimitive } from "../lib/base-ui/toggle.js"
3
+ import { ToggleGroup as ToggleGroupPrimitive } from "../lib/base-ui/toggle-group.js"
4
4
 
5
5
  import { cn } from "../lib/utils.js"
6
6
  import { toggleVariants } from "./toggle.jsx"
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
3
+ import { Toggle as TogglePrimitive } from "../lib/base-ui/toggle.js"
4
4
  import { cva } from "../lib/cva.js";
5
5
 
6
6
  import { cn } from "../lib/utils.js"
@@ -1,4 +1,4 @@
1
- import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
1
+ import { Tooltip as TooltipPrimitive } from "../lib/base-ui/tooltip.js"
2
2
 
3
3
  import { cn } from "../lib/utils.js"
4
4
 
package/styles.css CHANGED
@@ -87,6 +87,37 @@
87
87
  .slide-out-to-right-10 { --tw-exit-translate-x: 2.5rem; }
88
88
  .slide-out-to-right-52 { --tw-exit-translate-x: 13rem; }
89
89
 
90
+ /* Drawer (bottom sheet) — base-ui Dialog shell + ported vaul drag math.
91
+ Entrance/exit keyed off base-ui's data-starting-style / data-ending-style. */
92
+ .drawer-popup {
93
+ position: fixed;
94
+ inset-inline: 0;
95
+ bottom: 0;
96
+ z-index: 50;
97
+ display: flex;
98
+ flex-direction: column;
99
+ max-height: 80vh;
100
+ border-top: 1px solid var(--border);
101
+ border-top-left-radius: 0.75rem;
102
+ border-top-right-radius: 0.75rem;
103
+ outline: none;
104
+ transform: translate3d(0, 0, 0);
105
+ transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
106
+ touch-action: none;
107
+ }
108
+ .drawer-popup[data-starting-style],
109
+ .drawer-popup[data-ending-style] {
110
+ transform: translate3d(0, 100%, 0);
111
+ }
112
+ .drawer-backdrop {
113
+ opacity: 1;
114
+ transition: opacity 250ms cubic-bezier(0.32, 0.72, 0, 1);
115
+ }
116
+ .drawer-backdrop[data-starting-style],
117
+ .drawer-backdrop[data-ending-style] {
118
+ opacity: 0;
119
+ }
120
+
90
121
  @custom-variant dark (&:is(.dark *));
91
122
 
92
123
  @theme {