@stagewise/ui 0.1.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 (266) hide show
  1. package/README.md +135 -0
  2. package/package.json +80 -0
  3. package/src/components/ui/accordion.tsx +66 -0
  4. package/src/components/ui/alert-dialog.tsx +185 -0
  5. package/src/components/ui/alert.tsx +76 -0
  6. package/src/components/ui/aspect-ratio.tsx +22 -0
  7. package/src/components/ui/avatar.tsx +107 -0
  8. package/src/components/ui/badge.tsx +52 -0
  9. package/src/components/ui/breadcrumb.tsx +125 -0
  10. package/src/components/ui/bubble.tsx +128 -0
  11. package/src/components/ui/button-group.tsx +87 -0
  12. package/src/components/ui/button.tsx +58 -0
  13. package/src/components/ui/calendar.tsx +221 -0
  14. package/src/components/ui/card.tsx +103 -0
  15. package/src/components/ui/carousel.tsx +240 -0
  16. package/src/components/ui/chart.tsx +371 -0
  17. package/src/components/ui/checkbox.tsx +30 -0
  18. package/src/components/ui/collapsible.tsx +19 -0
  19. package/src/components/ui/combobox.tsx +295 -0
  20. package/src/components/ui/command.tsx +348 -0
  21. package/src/components/ui/context-menu.tsx +271 -0
  22. package/src/components/ui/dialog.tsx +160 -0
  23. package/src/components/ui/direction.tsx +4 -0
  24. package/src/components/ui/drawer.tsx +228 -0
  25. package/src/components/ui/dropdown-menu.tsx +266 -0
  26. package/src/components/ui/empty.tsx +104 -0
  27. package/src/components/ui/field.tsx +236 -0
  28. package/src/components/ui/hover-card.tsx +51 -0
  29. package/src/components/ui/input-group.tsx +158 -0
  30. package/src/components/ui/input-otp.tsx +85 -0
  31. package/src/components/ui/input.tsx +20 -0
  32. package/src/components/ui/item.tsx +201 -0
  33. package/src/components/ui/kbd.tsx +26 -0
  34. package/src/components/ui/label.tsx +20 -0
  35. package/src/components/ui/marker.tsx +71 -0
  36. package/src/components/ui/menubar.tsx +280 -0
  37. package/src/components/ui/message.tsx +92 -0
  38. package/src/components/ui/native-select.tsx +61 -0
  39. package/src/components/ui/navigation-menu.tsx +168 -0
  40. package/src/components/ui/pagination.tsx +130 -0
  41. package/src/components/ui/popover.tsx +88 -0
  42. package/src/components/ui/progress.tsx +83 -0
  43. package/src/components/ui/questionnaire.tsx +324 -0
  44. package/src/components/ui/radio-group.tsx +36 -0
  45. package/src/components/ui/resizable.tsx +50 -0
  46. package/src/components/ui/scroll-area.tsx +53 -0
  47. package/src/components/ui/select.tsx +201 -0
  48. package/src/components/ui/separator.tsx +23 -0
  49. package/src/components/ui/sheet.tsx +136 -0
  50. package/src/components/ui/sidebar.tsx +723 -0
  51. package/src/components/ui/skeleton.tsx +13 -0
  52. package/src/components/ui/slider.tsx +52 -0
  53. package/src/components/ui/spinner.tsx +10 -0
  54. package/src/components/ui/switch.tsx +32 -0
  55. package/src/components/ui/table.tsx +114 -0
  56. package/src/components/ui/tabs.tsx +82 -0
  57. package/src/components/ui/textarea.tsx +18 -0
  58. package/src/components/ui/toast.tsx +234 -0
  59. package/src/components/ui/toggle-group.tsx +87 -0
  60. package/src/components/ui/toggle.tsx +43 -0
  61. package/src/components/ui/tooltip.tsx +66 -0
  62. package/src/fonts/OFL.txt +92 -0
  63. package/src/fonts/geist-variable-italic.woff2 +0 -0
  64. package/src/fonts/geist-variable.woff2 +0 -0
  65. package/src/hooks/use-mobile.ts +19 -0
  66. package/src/icons/custom/index.ts +1 -0
  67. package/src/icons/custom/ui-outline-18/Icon.tsx +28 -0
  68. package/src/icons/custom/ui-outline-18/IconBrowserTab.tsx +40 -0
  69. package/src/icons/custom/ui-outline-18/IconNewTerminal.tsx +77 -0
  70. package/src/icons/custom/ui-outline-18/index.ts +3 -0
  71. package/src/icons/index.ts +52 -0
  72. package/src/icons/nucleo/LICENSE.md +29 -0
  73. package/src/icons/nucleo/core-outline-24/Icon.tsx +27 -0
  74. package/src/icons/nucleo/core-outline-24/IconArrowUpOutline24.tsx +36 -0
  75. package/src/icons/nucleo/core-outline-24/IconBluetoothOutline24.tsx +26 -0
  76. package/src/icons/nucleo/core-outline-24/IconTrash2Outline24.tsx +76 -0
  77. package/src/icons/nucleo/core-outline-24/IconUsbOutline24.tsx +64 -0
  78. package/src/icons/nucleo/core-outline-24/index.ts +5 -0
  79. package/src/icons/nucleo/index.ts +48 -0
  80. package/src/icons/nucleo/micro-bold/Icon.tsx +27 -0
  81. package/src/icons/nucleo/micro-bold/IconArrowLeft.tsx +28 -0
  82. package/src/icons/nucleo/micro-bold/IconArrowRight.tsx +28 -0
  83. package/src/icons/nucleo/micro-bold/IconArrowRotateAnticlockwise.tsx +27 -0
  84. package/src/icons/nucleo/micro-bold/IconChevronLeft.tsx +16 -0
  85. package/src/icons/nucleo/micro-bold/IconChevronRight.tsx +16 -0
  86. package/src/icons/nucleo/micro-bold/IconClipboardContent.tsx +59 -0
  87. package/src/icons/nucleo/micro-bold/IconMagicWandSparkle.tsx +44 -0
  88. package/src/icons/nucleo/micro-bold/IconTriangleWarning.tsx +30 -0
  89. package/src/icons/nucleo/micro-bold/IconXmark.tsx +31 -0
  90. package/src/icons/nucleo/micro-bold/index.ts +10 -0
  91. package/src/icons/nucleo/social-media/Icon.tsx +27 -0
  92. package/src/icons/nucleo/social-media/IconApple.tsx +12 -0
  93. package/src/icons/nucleo/social-media/IconGithub.tsx +11 -0
  94. package/src/icons/nucleo/social-media/IconGoogle.tsx +20 -0
  95. package/src/icons/nucleo/social-media/index.ts +4 -0
  96. package/src/icons/nucleo/ui-fill-18/Icon.tsx +27 -0
  97. package/src/icons/nucleo/ui-fill-18/IconArrowLeftFill18.tsx +17 -0
  98. package/src/icons/nucleo/ui-fill-18/IconArrowRightFill18.tsx +17 -0
  99. package/src/icons/nucleo/ui-fill-18/IconCheckFill18.tsx +12 -0
  100. package/src/icons/nucleo/ui-fill-18/IconChevronDownFill18.tsx +12 -0
  101. package/src/icons/nucleo/ui-fill-18/IconGlobe2Fill18.tsx +17 -0
  102. package/src/icons/nucleo/ui-fill-18/IconLinkFill18.tsx +21 -0
  103. package/src/icons/nucleo/ui-fill-18/IconMediaStopFill18.tsx +17 -0
  104. package/src/icons/nucleo/ui-fill-18/IconPinTackFill18.tsx +17 -0
  105. package/src/icons/nucleo/ui-fill-18/IconPlusFill18.tsx +17 -0
  106. package/src/icons/nucleo/ui-fill-18/IconVolumeUpFill18.tsx +22 -0
  107. package/src/icons/nucleo/ui-fill-18/IconVolumeXmarkFill18.tsx +17 -0
  108. package/src/icons/nucleo/ui-fill-18/IconXmarkFill18.tsx +17 -0
  109. package/src/icons/nucleo/ui-fill-18/index.ts +13 -0
  110. package/src/icons/nucleo/ui-fill-duo-18/Icon.tsx +27 -0
  111. package/src/icons/nucleo/ui-fill-duo-18/IconBrainNodesFillDuo18.tsx +32 -0
  112. package/src/icons/nucleo/ui-fill-duo-18/IconCloudeCodeFillDuo18.tsx +25 -0
  113. package/src/icons/nucleo/ui-fill-duo-18/IconDatabaseFillDuo18.tsx +24 -0
  114. package/src/icons/nucleo/ui-fill-duo-18/IconDownload4FillDuo18.tsx +18 -0
  115. package/src/icons/nucleo/ui-fill-duo-18/IconEarthFillDuo18.tsx +20 -0
  116. package/src/icons/nucleo/ui-fill-duo-18/IconFinderFillDuo18.tsx +36 -0
  117. package/src/icons/nucleo/ui-fill-duo-18/IconFolderContent2FillDuo18.tsx +22 -0
  118. package/src/icons/nucleo/ui-fill-duo-18/IconGear3FillDuo18.tsx +18 -0
  119. package/src/icons/nucleo/ui-fill-duo-18/IconHistoryFillDuo18.tsx +20 -0
  120. package/src/icons/nucleo/ui-fill-duo-18/IconLockKeyFillDuo18.tsx +24 -0
  121. package/src/icons/nucleo/ui-fill-duo-18/IconNoteFillDuo18.tsx +34 -0
  122. package/src/icons/nucleo/ui-fill-duo-18/IconPenDrawSparkleFillDuo18.tsx +34 -0
  123. package/src/icons/nucleo/ui-fill-duo-18/IconServerFillDuo18.tsx +22 -0
  124. package/src/icons/nucleo/ui-fill-duo-18/IconSpace3dFillDuo18.tsx +24 -0
  125. package/src/icons/nucleo/ui-fill-duo-18/IconTriangleWarningFillDuo18.tsx +24 -0
  126. package/src/icons/nucleo/ui-fill-duo-18/index.ts +16 -0
  127. package/src/icons/nucleo/ui-outline-18/Icon.tsx +27 -0
  128. package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +33 -0
  129. package/src/icons/nucleo/ui-outline-18/IconArrowRightOutline18.tsx +34 -0
  130. package/src/icons/nucleo/ui-outline-18/IconArrowUpRightOutline18.tsx +34 -0
  131. package/src/icons/nucleo/ui-outline-18/IconArrowsOppositeDirectionXOutline18.tsx +54 -0
  132. package/src/icons/nucleo/ui-outline-18/IconArrowsToCenterOutline18.tsx +101 -0
  133. package/src/icons/nucleo/ui-outline-18/IconBanOutline18.tsx +37 -0
  134. package/src/icons/nucleo/ui-outline-18/IconBellDotOutline18.tsx +43 -0
  135. package/src/icons/nucleo/ui-outline-18/IconBookOpen5Outline18.tsx +40 -0
  136. package/src/icons/nucleo/ui-outline-18/IconBookOpenOutline18.tsx +32 -0
  137. package/src/icons/nucleo/ui-outline-18/IconBooks2Outline18.tsx +100 -0
  138. package/src/icons/nucleo/ui-outline-18/IconBoxSparkleOutline18.tsx +75 -0
  139. package/src/icons/nucleo/ui-outline-18/IconBrainOutline18.tsx +57 -0
  140. package/src/icons/nucleo/ui-outline-18/IconBranchOutOutline18.tsx +52 -0
  141. package/src/icons/nucleo/ui-outline-18/IconBugOutline18.tsx +98 -0
  142. package/src/icons/nucleo/ui-outline-18/IconCameraOutline18.tsx +42 -0
  143. package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +30 -0
  144. package/src/icons/nucleo/ui-outline-18/IconCheck2Outline18.tsx +23 -0
  145. package/src/icons/nucleo/ui-outline-18/IconCheckOutline18.tsx +23 -0
  146. package/src/icons/nucleo/ui-outline-18/IconChevronDownOutline18.tsx +22 -0
  147. package/src/icons/nucleo/ui-outline-18/IconChevronExpandYOutline18.tsx +31 -0
  148. package/src/icons/nucleo/ui-outline-18/IconChevronLeftOutline18.tsx +22 -0
  149. package/src/icons/nucleo/ui-outline-18/IconChevronReduceYOutline18.tsx +31 -0
  150. package/src/icons/nucleo/ui-outline-18/IconChevronRightOutline18.tsx +22 -0
  151. package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +22 -0
  152. package/src/icons/nucleo/ui-outline-18/IconCircleCheckOutline18.tsx +32 -0
  153. package/src/icons/nucleo/ui-outline-18/IconCircleInfoOutline18.tsx +37 -0
  154. package/src/icons/nucleo/ui-outline-18/IconCircleQuestionOutline18.tsx +39 -0
  155. package/src/icons/nucleo/ui-outline-18/IconClipboardContentOutline18.tsx +60 -0
  156. package/src/icons/nucleo/ui-outline-18/IconClipboardOutline18.tsx +37 -0
  157. package/src/icons/nucleo/ui-outline-18/IconClone2Outline18.tsx +32 -0
  158. package/src/icons/nucleo/ui-outline-18/IconCloneDashed2Outline18.tsx +49 -0
  159. package/src/icons/nucleo/ui-outline-18/IconCodeBranchOutline18.tsx +65 -0
  160. package/src/icons/nucleo/ui-outline-18/IconCodeCommitOutline18.tsx +48 -0
  161. package/src/icons/nucleo/ui-outline-18/IconColorPaletteOutline18.tsx +56 -0
  162. package/src/icons/nucleo/ui-outline-18/IconConnection2Outline18.tsx +43 -0
  163. package/src/icons/nucleo/ui-outline-18/IconCopyIdOutline18.tsx +52 -0
  164. package/src/icons/nucleo/ui-outline-18/IconCopyOutline18.tsx +32 -0
  165. package/src/icons/nucleo/ui-outline-18/IconCreditCardOutline18.tsx +61 -0
  166. package/src/icons/nucleo/ui-outline-18/IconDatabaseSearchOutline18.tsx +64 -0
  167. package/src/icons/nucleo/ui-outline-18/IconDotsOutline18.tsx +46 -0
  168. package/src/icons/nucleo/ui-outline-18/IconDownload4Outline18.tsx +43 -0
  169. package/src/icons/nucleo/ui-outline-18/IconEarthOutline18.tsx +47 -0
  170. package/src/icons/nucleo/ui-outline-18/IconEarthSearchOutline18.tsx +61 -0
  171. package/src/icons/nucleo/ui-outline-18/IconEnvelopeOutline18.tsx +38 -0
  172. package/src/icons/nucleo/ui-outline-18/IconEye2Outline18.tsx +34 -0
  173. package/src/icons/nucleo/ui-outline-18/IconEyeOutline18.tsx +32 -0
  174. package/src/icons/nucleo/ui-outline-18/IconFilePenOutline18.tsx +56 -0
  175. package/src/icons/nucleo/ui-outline-18/IconFileSearchOutline18.tsx +64 -0
  176. package/src/icons/nucleo/ui-outline-18/IconFloppyDiskOutline18.tsx +40 -0
  177. package/src/icons/nucleo/ui-outline-18/IconFolder5Outline18.tsx +37 -0
  178. package/src/icons/nucleo/ui-outline-18/IconFolderCloudOutline18.tsx +39 -0
  179. package/src/icons/nucleo/ui-outline-18/IconFolderOpenOutline18.tsx +31 -0
  180. package/src/icons/nucleo/ui-outline-18/IconFolderOutline18.tsx +32 -0
  181. package/src/icons/nucleo/ui-outline-18/IconFolderPenOutline18.tsx +40 -0
  182. package/src/icons/nucleo/ui-outline-18/IconFolderPlusOutline18.tsx +48 -0
  183. package/src/icons/nucleo/ui-outline-18/IconFolderSearchOutline18.tsx +48 -0
  184. package/src/icons/nucleo/ui-outline-18/IconGear2Outline18.tsx +193 -0
  185. package/src/icons/nucleo/ui-outline-18/IconGear3Outline18.tsx +32 -0
  186. package/src/icons/nucleo/ui-outline-18/IconGlobe3Outline18.tsx +61 -0
  187. package/src/icons/nucleo/ui-outline-18/IconGripDotsVerticalOutline18.tsx +74 -0
  188. package/src/icons/nucleo/ui-outline-18/IconHardDriveOutline18.tsx +40 -0
  189. package/src/icons/nucleo/ui-outline-18/IconHelpChatOutline18.tsx +47 -0
  190. package/src/icons/nucleo/ui-outline-18/IconHotDrinkOutline18.tsx +60 -0
  191. package/src/icons/nucleo/ui-outline-18/IconImageSparkle3Outline18.tsx +41 -0
  192. package/src/icons/nucleo/ui-outline-18/IconKey2Outline18.tsx +61 -0
  193. package/src/icons/nucleo/ui-outline-18/IconLoader6Outline18.tsx +23 -0
  194. package/src/icons/nucleo/ui-outline-18/IconLocation2Outline18.tsx +45 -0
  195. package/src/icons/nucleo/ui-outline-18/IconLockKeyOutline18.tsx +58 -0
  196. package/src/icons/nucleo/ui-outline-18/IconMagicWandOutline18.tsx +32 -0
  197. package/src/icons/nucleo/ui-outline-18/IconMagnifierMinusOutline18.tsx +39 -0
  198. package/src/icons/nucleo/ui-outline-18/IconMagnifierOutline18.tsx +32 -0
  199. package/src/icons/nucleo/ui-outline-18/IconMagnifierPlusOutline18.tsx +48 -0
  200. package/src/icons/nucleo/ui-outline-18/IconMicrophone3Outline18.tsx +57 -0
  201. package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +25 -0
  202. package/src/icons/nucleo/ui-outline-18/IconMoonOutline18.tsx +23 -0
  203. package/src/icons/nucleo/ui-outline-18/IconMsgSleepOutline18.tsx +41 -0
  204. package/src/icons/nucleo/ui-outline-18/IconMsgWritingOutline18.tsx +42 -0
  205. package/src/icons/nucleo/ui-outline-18/IconMusicOutline18.tsx +67 -0
  206. package/src/icons/nucleo/ui-outline-18/IconOctagonWarningOutline18.tsx +35 -0
  207. package/src/icons/nucleo/ui-outline-18/IconOpenExternalOutline18.tsx +51 -0
  208. package/src/icons/nucleo/ui-outline-18/IconOpenRectArrowInOutline18.tsx +43 -0
  209. package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +39 -0
  210. package/src/icons/nucleo/ui-outline-18/IconPaperclip2Outline18.tsx +22 -0
  211. package/src/icons/nucleo/ui-outline-18/IconPen2Outline18.tsx +35 -0
  212. package/src/icons/nucleo/ui-outline-18/IconPenDrawSparkleOutline18.tsx +46 -0
  213. package/src/icons/nucleo/ui-outline-18/IconPenOutline18.tsx +23 -0
  214. package/src/icons/nucleo/ui-outline-18/IconPenPlusOutline18.tsx +47 -0
  215. package/src/icons/nucleo/ui-outline-18/IconPenWriting3Outline18.tsx +31 -0
  216. package/src/icons/nucleo/ui-outline-18/IconPhoneOutline18.tsx +23 -0
  217. package/src/icons/nucleo/ui-outline-18/IconPinTackOutline18.tsx +35 -0
  218. package/src/icons/nucleo/ui-outline-18/IconPinTackSlashOutline18.tsx +47 -0
  219. package/src/icons/nucleo/ui-outline-18/IconPlusOutline18.tsx +38 -0
  220. package/src/icons/nucleo/ui-outline-18/IconPowerOffOutline18.tsx +36 -0
  221. package/src/icons/nucleo/ui-outline-18/IconPresentationScreenVideoOutline18.tsx +55 -0
  222. package/src/icons/nucleo/ui-outline-18/IconPuzzlePieceOutline18.tsx +22 -0
  223. package/src/icons/nucleo/ui-outline-18/IconRedoOutline18.tsx +32 -0
  224. package/src/icons/nucleo/ui-outline-18/IconRefreshAnticlockwiseOutline18.tsx +48 -0
  225. package/src/icons/nucleo/ui-outline-18/IconReuseOutline18.tsx +50 -0
  226. package/src/icons/nucleo/ui-outline-18/IconSearchContentOutline18.tsx +81 -0
  227. package/src/icons/nucleo/ui-outline-18/IconServerOutline18.tsx +73 -0
  228. package/src/icons/nucleo/ui-outline-18/IconSideProfileSparkleOutline18.tsx +28 -0
  229. package/src/icons/nucleo/ui-outline-18/IconSidebarLeftHideOutline18.tsx +49 -0
  230. package/src/icons/nucleo/ui-outline-18/IconSidebarLeftShowOutline18.tsx +49 -0
  231. package/src/icons/nucleo/ui-outline-18/IconSidebarRightHideOutline18.tsx +48 -0
  232. package/src/icons/nucleo/ui-outline-18/IconSidebarRightShowOutline18.tsx +48 -0
  233. package/src/icons/nucleo/ui-outline-18/IconSparkleOutline18.tsx +43 -0
  234. package/src/icons/nucleo/ui-outline-18/IconSpeakerOutline18.tsx +47 -0
  235. package/src/icons/nucleo/ui-outline-18/IconSplitViewOutline18.tsx +32 -0
  236. package/src/icons/nucleo/ui-outline-18/IconSquareCodeOutline18.tsx +40 -0
  237. package/src/icons/nucleo/ui-outline-18/IconSquareDashedOutline18.tsx +94 -0
  238. package/src/icons/nucleo/ui-outline-18/IconSquareTerminalOutline18.tsx +48 -0
  239. package/src/icons/nucleo/ui-outline-18/IconSunOutline18.tsx +121 -0
  240. package/src/icons/nucleo/ui-outline-18/IconTerminalOutline18.tsx +35 -0
  241. package/src/icons/nucleo/ui-outline-18/IconTextAlignLeft2Outline18.tsx +60 -0
  242. package/src/icons/nucleo/ui-outline-18/IconTextBgColorOutline18.tsx +48 -0
  243. package/src/icons/nucleo/ui-outline-18/IconTextColorOutline18.tsx +48 -0
  244. package/src/icons/nucleo/ui-outline-18/IconThumbsDownOutline18.tsx +36 -0
  245. package/src/icons/nucleo/ui-outline-18/IconThumbsUpOutline18.tsx +37 -0
  246. package/src/icons/nucleo/ui-outline-18/IconTrashOutline18.tsx +41 -0
  247. package/src/icons/nucleo/ui-outline-18/IconTriangleWarningOutline18.tsx +37 -0
  248. package/src/icons/nucleo/ui-outline-18/IconUndoOutline18.tsx +32 -0
  249. package/src/icons/nucleo/ui-outline-18/IconVersionsOutline18.tsx +46 -0
  250. package/src/icons/nucleo/ui-outline-18/IconVideoOutline18.tsx +45 -0
  251. package/src/icons/nucleo/ui-outline-18/IconWaveformLinesOutline18.tsx +80 -0
  252. package/src/icons/nucleo/ui-outline-18/IconWindowCodeOutline18.tsx +62 -0
  253. package/src/icons/nucleo/ui-outline-18/IconWindowPointerOutline18.tsx +51 -0
  254. package/src/icons/nucleo/ui-outline-18/IconXmarkOutline18.tsx +38 -0
  255. package/src/icons/nucleo/ui-outline-18/index.ts +128 -0
  256. package/src/index.ts +66 -0
  257. package/src/lib/utils.ts +6 -0
  258. package/src/plugin/index.ts +611 -0
  259. package/src/styles/animations.css +59 -0
  260. package/src/styles/bridge.css +117 -0
  261. package/src/styles/derived-utilities.css +179 -0
  262. package/src/styles/fonts.css +23 -0
  263. package/src/styles/index.css +72 -0
  264. package/src/styles/palette.css +189 -0
  265. package/src/styles/tailwind-tokens.css +56 -0
  266. package/src/styles/theme.css +103 -0
@@ -0,0 +1,271 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu"
5
+
6
+ import { cn } from "../../lib/utils"
7
+ import { IconChevronRightOutline18, IconCheckOutline18 } from "../../icons"
8
+
9
+ function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
10
+ return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
11
+ }
12
+
13
+ function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
14
+ return (
15
+ <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
16
+ )
17
+ }
18
+
19
+ function ContextMenuTrigger({
20
+ className,
21
+ ...props
22
+ }: ContextMenuPrimitive.Trigger.Props) {
23
+ return (
24
+ <ContextMenuPrimitive.Trigger
25
+ data-slot="context-menu-trigger"
26
+ className={cn("select-none", className)}
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function ContextMenuContent({
33
+ className,
34
+ align = "start",
35
+ alignOffset = 4,
36
+ side = "right",
37
+ sideOffset = 0,
38
+ ...props
39
+ }: ContextMenuPrimitive.Popup.Props &
40
+ Pick<
41
+ ContextMenuPrimitive.Positioner.Props,
42
+ "align" | "alignOffset" | "side" | "sideOffset"
43
+ >) {
44
+ return (
45
+ <ContextMenuPrimitive.Portal>
46
+ <ContextMenuPrimitive.Positioner
47
+ className="isolate z-50 outline-none"
48
+ align={align}
49
+ alignOffset={alignOffset}
50
+ side={side}
51
+ sideOffset={sideOffset}
52
+ >
53
+ <ContextMenuPrimitive.Popup
54
+ data-slot="context-menu-content"
55
+ className={cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 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:fade-out-0 data-closed:zoom-out-95 relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!", className )}
56
+ {...props}
57
+ />
58
+ </ContextMenuPrimitive.Positioner>
59
+ </ContextMenuPrimitive.Portal>
60
+ )
61
+ }
62
+
63
+ function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
64
+ return (
65
+ <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
66
+ )
67
+ }
68
+
69
+ function ContextMenuLabel({
70
+ className,
71
+ inset,
72
+ ...props
73
+ }: ContextMenuPrimitive.GroupLabel.Props & {
74
+ inset?: boolean
75
+ }) {
76
+ return (
77
+ <ContextMenuPrimitive.GroupLabel
78
+ data-slot="context-menu-label"
79
+ data-inset={inset}
80
+ className={cn(
81
+ "px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
82
+ className
83
+ )}
84
+ {...props}
85
+ />
86
+ )
87
+ }
88
+
89
+ function ContextMenuItem({
90
+ className,
91
+ inset,
92
+ variant = "default",
93
+ ...props
94
+ }: ContextMenuPrimitive.Item.Props & {
95
+ inset?: boolean
96
+ variant?: "default" | "destructive"
97
+ }) {
98
+ return (
99
+ <ContextMenuPrimitive.Item
100
+ data-slot="context-menu-item"
101
+ data-inset={inset}
102
+ data-variant={variant}
103
+ className={cn(
104
+ "group/context-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 data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
105
+ className
106
+ )}
107
+ {...props}
108
+ />
109
+ )
110
+ }
111
+
112
+ function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
113
+ return (
114
+ <ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
115
+ )
116
+ }
117
+
118
+ function ContextMenuSubTrigger({
119
+ className,
120
+ inset,
121
+ children,
122
+ ...props
123
+ }: ContextMenuPrimitive.SubmenuTrigger.Props & {
124
+ inset?: boolean
125
+ }) {
126
+ return (
127
+ <ContextMenuPrimitive.SubmenuTrigger
128
+ data-slot="context-menu-sub-trigger"
129
+ data-inset={inset}
130
+ className={cn(
131
+ "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 data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
132
+ className
133
+ )}
134
+ {...props}
135
+ >
136
+ {children}
137
+ <IconChevronRightOutline18 className="ml-auto" />
138
+ </ContextMenuPrimitive.SubmenuTrigger>
139
+ )
140
+ }
141
+
142
+ function ContextMenuSubContent({
143
+ ...props
144
+ }: React.ComponentProps<typeof ContextMenuContent>) {
145
+ return (
146
+ <ContextMenuContent
147
+ data-slot="context-menu-sub-content"
148
+ className="shadow-lg relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!"
149
+ side="right"
150
+ {...props}
151
+ />
152
+ )
153
+ }
154
+
155
+ function ContextMenuCheckboxItem({
156
+ className,
157
+ children,
158
+ checked,
159
+ inset,
160
+ ...props
161
+ }: ContextMenuPrimitive.CheckboxItem.Props & {
162
+ inset?: boolean
163
+ }) {
164
+ return (
165
+ <ContextMenuPrimitive.CheckboxItem
166
+ data-slot="context-menu-checkbox-item"
167
+ data-inset={inset}
168
+ className={cn(
169
+ "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 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",
170
+ className
171
+ )}
172
+ checked={checked}
173
+ {...props}
174
+ >
175
+ <span className="pointer-events-none absolute right-2">
176
+ <ContextMenuPrimitive.CheckboxItemIndicator>
177
+ <IconCheckOutline18
178
+ />
179
+ </ContextMenuPrimitive.CheckboxItemIndicator>
180
+ </span>
181
+ {children}
182
+ </ContextMenuPrimitive.CheckboxItem>
183
+ )
184
+ }
185
+
186
+ function ContextMenuRadioGroup({
187
+ ...props
188
+ }: ContextMenuPrimitive.RadioGroup.Props) {
189
+ return (
190
+ <ContextMenuPrimitive.RadioGroup
191
+ data-slot="context-menu-radio-group"
192
+ {...props}
193
+ />
194
+ )
195
+ }
196
+
197
+ function ContextMenuRadioItem({
198
+ className,
199
+ children,
200
+ inset,
201
+ ...props
202
+ }: ContextMenuPrimitive.RadioItem.Props & {
203
+ inset?: boolean
204
+ }) {
205
+ return (
206
+ <ContextMenuPrimitive.RadioItem
207
+ data-slot="context-menu-radio-item"
208
+ data-inset={inset}
209
+ className={cn(
210
+ "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 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",
211
+ className
212
+ )}
213
+ {...props}
214
+ >
215
+ <span className="pointer-events-none absolute right-2">
216
+ <ContextMenuPrimitive.RadioItemIndicator>
217
+ <IconCheckOutline18
218
+ />
219
+ </ContextMenuPrimitive.RadioItemIndicator>
220
+ </span>
221
+ {children}
222
+ </ContextMenuPrimitive.RadioItem>
223
+ )
224
+ }
225
+
226
+ function ContextMenuSeparator({
227
+ className,
228
+ ...props
229
+ }: ContextMenuPrimitive.Separator.Props) {
230
+ return (
231
+ <ContextMenuPrimitive.Separator
232
+ data-slot="context-menu-separator"
233
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
234
+ {...props}
235
+ />
236
+ )
237
+ }
238
+
239
+ function ContextMenuShortcut({
240
+ className,
241
+ ...props
242
+ }: React.ComponentProps<"span">) {
243
+ return (
244
+ <span
245
+ data-slot="context-menu-shortcut"
246
+ className={cn(
247
+ "ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",
248
+ className
249
+ )}
250
+ {...props}
251
+ />
252
+ )
253
+ }
254
+
255
+ export {
256
+ ContextMenu,
257
+ ContextMenuTrigger,
258
+ ContextMenuContent,
259
+ ContextMenuItem,
260
+ ContextMenuCheckboxItem,
261
+ ContextMenuRadioItem,
262
+ ContextMenuLabel,
263
+ ContextMenuSeparator,
264
+ ContextMenuShortcut,
265
+ ContextMenuGroup,
266
+ ContextMenuPortal,
267
+ ContextMenuSub,
268
+ ContextMenuSubContent,
269
+ ContextMenuSubTrigger,
270
+ ContextMenuRadioGroup,
271
+ }
@@ -0,0 +1,160 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
5
+
6
+ import { cn } from "../../lib/utils"
7
+ import { Button } from "./button"
8
+ import { IconXmarkOutline18 } from "../../icons"
9
+
10
+ function Dialog({ ...props }: DialogPrimitive.Root.Props) {
11
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
12
+ }
13
+
14
+ function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
15
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
16
+ }
17
+
18
+ function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
19
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
20
+ }
21
+
22
+ function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
23
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
24
+ }
25
+
26
+ function DialogOverlay({
27
+ className,
28
+ ...props
29
+ }: DialogPrimitive.Backdrop.Props) {
30
+ return (
31
+ <DialogPrimitive.Backdrop
32
+ data-slot="dialog-overlay"
33
+ className={cn(
34
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
35
+ className
36
+ )}
37
+ {...props}
38
+ />
39
+ )
40
+ }
41
+
42
+ function DialogContent({
43
+ className,
44
+ children,
45
+ showCloseButton = true,
46
+ ...props
47
+ }: DialogPrimitive.Popup.Props & {
48
+ showCloseButton?: boolean
49
+ }) {
50
+ return (
51
+ <DialogPortal>
52
+ <DialogOverlay />
53
+ <DialogPrimitive.Popup
54
+ data-slot="dialog-content"
55
+ className={cn(
56
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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",
57
+ className
58
+ )}
59
+ {...props}
60
+ >
61
+ {children}
62
+ {showCloseButton && (
63
+ <DialogPrimitive.Close
64
+ data-slot="dialog-close"
65
+ render={
66
+ <Button
67
+ variant="ghost"
68
+ className="absolute top-2 right-2"
69
+ size="icon-sm"
70
+ />
71
+ }
72
+ >
73
+ <IconXmarkOutline18
74
+ />
75
+ <span className="sr-only">Close</span>
76
+ </DialogPrimitive.Close>
77
+ )}
78
+ </DialogPrimitive.Popup>
79
+ </DialogPortal>
80
+ )
81
+ }
82
+
83
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
84
+ return (
85
+ <div
86
+ data-slot="dialog-header"
87
+ className={cn("flex flex-col gap-1.5", className)}
88
+ {...props}
89
+ />
90
+ )
91
+ }
92
+
93
+ function DialogFooter({
94
+ className,
95
+ showCloseButton = false,
96
+ children,
97
+ ...props
98
+ }: React.ComponentProps<"div"> & {
99
+ showCloseButton?: boolean
100
+ }) {
101
+ return (
102
+ <div
103
+ data-slot="dialog-footer"
104
+ className={cn(
105
+ "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
106
+ className
107
+ )}
108
+ {...props}
109
+ >
110
+ {children}
111
+ {showCloseButton && (
112
+ <DialogPrimitive.Close render={<Button variant="outline" />}>
113
+ Close
114
+ </DialogPrimitive.Close>
115
+ )}
116
+ </div>
117
+ )
118
+ }
119
+
120
+ function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
121
+ return (
122
+ <DialogPrimitive.Title
123
+ data-slot="dialog-title"
124
+ className={cn(
125
+ "font-heading text-base leading-none font-medium",
126
+ className
127
+ )}
128
+ {...props}
129
+ />
130
+ )
131
+ }
132
+
133
+ function DialogDescription({
134
+ className,
135
+ ...props
136
+ }: DialogPrimitive.Description.Props) {
137
+ return (
138
+ <DialogPrimitive.Description
139
+ data-slot="dialog-description"
140
+ className={cn(
141
+ "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
142
+ className
143
+ )}
144
+ {...props}
145
+ />
146
+ )
147
+ }
148
+
149
+ export {
150
+ Dialog,
151
+ DialogClose,
152
+ DialogContent,
153
+ DialogDescription,
154
+ DialogFooter,
155
+ DialogHeader,
156
+ DialogOverlay,
157
+ DialogPortal,
158
+ DialogTitle,
159
+ DialogTrigger,
160
+ }
@@ -0,0 +1,4 @@
1
+ export {
2
+ DirectionProvider,
3
+ useDirection,
4
+ } from "@base-ui/react/direction-provider"
@@ -0,0 +1,228 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"
5
+
6
+ import { cn } from "../../lib/utils"
7
+
8
+ type DrawerContextProps = {
9
+ hasSnapPoints: boolean
10
+ modal: DrawerPrimitive.Root.Props["modal"]
11
+ showSwipeHandle: boolean
12
+ swipeDirection: NonNullable<DrawerPrimitive.Root.Props["swipeDirection"]>
13
+ }
14
+
15
+ const DrawerContext = React.createContext<DrawerContextProps | null>(null)
16
+
17
+ function useDrawer() {
18
+ const context = React.useContext(DrawerContext)
19
+
20
+ if (!context) {
21
+ throw new Error("useDrawer must be used within a Drawer.")
22
+ }
23
+
24
+ return context
25
+ }
26
+
27
+ function Drawer({
28
+ modal = true,
29
+ showSwipeHandle = false,
30
+ snapPoints,
31
+ swipeDirection = "down",
32
+ ...props
33
+ }: DrawerPrimitive.Root.Props & {
34
+ showSwipeHandle?: boolean
35
+ }) {
36
+ const hasSnapPoints = snapPoints != null && snapPoints.length > 0
37
+ const contextValue = React.useMemo(
38
+ () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
39
+ [hasSnapPoints, modal, showSwipeHandle, swipeDirection]
40
+ )
41
+
42
+ return (
43
+ <DrawerContext.Provider value={contextValue}>
44
+ <DrawerPrimitive.Root
45
+ data-slot="drawer"
46
+ modal={modal}
47
+ snapPoints={snapPoints}
48
+ swipeDirection={swipeDirection}
49
+ {...props}
50
+ />
51
+ </DrawerContext.Provider>
52
+ )
53
+ }
54
+
55
+ function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
56
+ return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
57
+ }
58
+
59
+ function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
60
+ return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
61
+ }
62
+
63
+ function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
64
+ return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
65
+ }
66
+
67
+ function DrawerOverlay({
68
+ className,
69
+ ...props
70
+ }: DrawerPrimitive.Backdrop.Props) {
71
+ return (
72
+ <DrawerPrimitive.Backdrop
73
+ data-slot="drawer-overlay"
74
+ className={cn(
75
+ "fixed inset-0 z-50 min-h-dvh bg-black/10 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",
76
+ className
77
+ )}
78
+ {...props}
79
+ />
80
+ )
81
+ }
82
+
83
+ function DrawerSwipeHandle({
84
+ className,
85
+ ...props
86
+ }: React.ComponentProps<"div">) {
87
+ return (
88
+ <div
89
+ data-slot="drawer-swipe-handle"
90
+ aria-hidden="true"
91
+ className={cn(
92
+ "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",
93
+ className
94
+ )}
95
+ {...props}
96
+ />
97
+ )
98
+ }
99
+
100
+ function DrawerContent({
101
+ className,
102
+ children,
103
+ ...props
104
+ }: DrawerPrimitive.Popup.Props) {
105
+ const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer()
106
+ const swipeAxis =
107
+ swipeDirection === "down" || swipeDirection === "up" ? "y" : "x"
108
+
109
+ return (
110
+ <DrawerPortal data-slot="drawer-portal">
111
+ {modal === true && (
112
+ <DrawerOverlay data-snap-points={hasSnapPoints ? "" : undefined} />
113
+ )}
114
+ <DrawerPrimitive.Viewport
115
+ data-slot="drawer-viewport"
116
+ data-modal={modal}
117
+ className="pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
118
+ >
119
+ <DrawerPrimitive.Popup
120
+ data-slot="drawer-popup"
121
+ data-swipe-axis={swipeAxis}
122
+ data-snap-points={hasSnapPoints ? "" : undefined}
123
+ className={cn(
124
+ // Base.
125
+ "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",
126
+ // Nested.
127
+ "data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
128
+ // Bleed.
129
+ "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",
130
+ // Sizing.
131
+ "[--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]",
132
+ // Stack.
133
+ "[--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]",
134
+ // Transitions.
135
+ "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)]",
136
+ // Axis: y.
137
+ "data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
138
+ // Axis: x.
139
+ "data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
140
+ // Direction: down.
141
+ "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)))]",
142
+ // Direction: up.
143
+ "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)))]",
144
+ // Direction: left.
145
+ "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%))]",
146
+ // Direction: right.
147
+ "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%))]",
148
+ className
149
+ )}
150
+ {...props}
151
+ >
152
+ {showSwipeHandle && <DrawerSwipeHandle />}
153
+ <DrawerPrimitive.Content
154
+ data-slot="drawer-content"
155
+ className={cn(
156
+ "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"
157
+ )}
158
+ >
159
+ {children}
160
+ </DrawerPrimitive.Content>
161
+ </DrawerPrimitive.Popup>
162
+ </DrawerPrimitive.Viewport>
163
+ </DrawerPortal>
164
+ )
165
+ }
166
+
167
+ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
168
+ return (
169
+ <div
170
+ data-slot="drawer-header"
171
+ className={cn(
172
+ "flex shrink-0 flex-col gap-0 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0 md:text-left",
173
+ className
174
+ )}
175
+ {...props}
176
+ />
177
+ )
178
+ }
179
+
180
+ function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
181
+ return (
182
+ <div
183
+ data-slot="drawer-footer"
184
+ className={cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className)}
185
+ {...props}
186
+ />
187
+ )
188
+ }
189
+
190
+ function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
191
+ return (
192
+ <DrawerPrimitive.Title
193
+ data-slot="drawer-title"
194
+ className={cn(
195
+ "font-heading text-base font-medium text-foreground",
196
+ className
197
+ )}
198
+ {...props}
199
+ />
200
+ )
201
+ }
202
+
203
+ function DrawerDescription({
204
+ className,
205
+ ...props
206
+ }: DrawerPrimitive.Description.Props) {
207
+ return (
208
+ <DrawerPrimitive.Description
209
+ data-slot="drawer-description"
210
+ className={cn("text-sm text-balance text-muted-foreground", className)}
211
+ {...props}
212
+ />
213
+ )
214
+ }
215
+
216
+ export {
217
+ Drawer,
218
+ DrawerPortal,
219
+ DrawerOverlay,
220
+ DrawerSwipeHandle,
221
+ DrawerTrigger,
222
+ DrawerClose,
223
+ DrawerContent,
224
+ DrawerHeader,
225
+ DrawerFooter,
226
+ DrawerTitle,
227
+ DrawerDescription,
228
+ }