zudoku 0.0.0-f90a252 → 0.0.0-f9211eb

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 (735) hide show
  1. package/README.md +1 -1
  2. package/cli.js +3 -0
  3. package/dist/app/entry.client.d.ts +5 -0
  4. package/dist/app/entry.client.js +1 -0
  5. package/dist/app/entry.client.js.map +1 -1
  6. package/dist/app/entry.server.d.ts +8 -6
  7. package/dist/app/entry.server.js +12 -8
  8. package/dist/app/entry.server.js.map +1 -1
  9. package/dist/app/main.js +3 -1
  10. package/dist/app/main.js.map +1 -1
  11. package/dist/app/tailwind.js +20 -0
  12. package/dist/app/tailwind.js.map +1 -1
  13. package/dist/cli/build/handler.d.ts +1 -3
  14. package/dist/cli/build/handler.js +9 -1
  15. package/dist/cli/build/handler.js.map +1 -1
  16. package/dist/cli/cli.js +5 -0
  17. package/dist/cli/cli.js.map +1 -1
  18. package/dist/cli/cmds/build.d.ts +11 -3
  19. package/dist/cli/cmds/build.js +20 -13
  20. package/dist/cli/cmds/build.js.map +1 -1
  21. package/dist/cli/cmds/dev.d.ts +1 -1
  22. package/dist/cli/cmds/dev.js.map +1 -1
  23. package/dist/cli/cmds/preview.d.ts +16 -0
  24. package/dist/cli/cmds/preview.js +25 -0
  25. package/dist/cli/cmds/preview.js.map +1 -0
  26. package/dist/cli/dev/handler.js +2 -1
  27. package/dist/cli/dev/handler.js.map +1 -1
  28. package/dist/cli/preview/handler.d.ts +3 -0
  29. package/dist/cli/preview/handler.js +35 -0
  30. package/dist/cli/preview/handler.js.map +1 -0
  31. package/dist/config/common.d.ts +5 -3
  32. package/dist/config/config.d.ts +15 -15
  33. package/dist/config/loader.d.ts +6 -6
  34. package/dist/config/loader.js +20 -28
  35. package/dist/config/loader.js.map +1 -1
  36. package/dist/config/validators/InputSidebarSchema.d.ts +15 -15
  37. package/dist/config/validators/InputSidebarSchema.js +10 -1
  38. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  39. package/dist/config/validators/common.d.ts +2993 -599
  40. package/dist/config/validators/common.js +107 -12
  41. package/dist/config/validators/common.js.map +1 -1
  42. package/dist/config/validators/icon-types.d.ts +1 -1
  43. package/dist/config/validators/validate.d.ts +1127 -284
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.js +1 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/lib/authentication/authentication.d.ts +1 -0
  48. package/dist/lib/authentication/hook.d.ts +1 -0
  49. package/dist/lib/authentication/hook.js +11 -1
  50. package/dist/lib/authentication/hook.js.map +1 -1
  51. package/dist/lib/authentication/providers/auth0.d.ts +2 -2
  52. package/dist/lib/authentication/providers/auth0.js +1 -0
  53. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  54. package/dist/lib/authentication/providers/clerk.d.ts +2 -2
  55. package/dist/lib/authentication/providers/clerk.js +25 -6
  56. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  57. package/dist/lib/authentication/providers/openid.d.ts +5 -3
  58. package/dist/lib/authentication/providers/openid.js +24 -10
  59. package/dist/lib/authentication/providers/openid.js.map +1 -1
  60. package/dist/lib/authentication/providers/supabase.d.ts +4 -0
  61. package/dist/lib/authentication/providers/supabase.js +117 -0
  62. package/dist/lib/authentication/providers/supabase.js.map +1 -0
  63. package/dist/lib/authentication/state.d.ts +0 -26
  64. package/dist/lib/authentication/state.js +9 -18
  65. package/dist/lib/authentication/state.js.map +1 -1
  66. package/dist/lib/components/AnchorLink.d.ts +2 -2
  67. package/dist/lib/components/AnchorLink.js +5 -4
  68. package/dist/lib/components/AnchorLink.js.map +1 -1
  69. package/dist/lib/components/Banner.js +1 -1
  70. package/dist/lib/components/Banner.js.map +1 -1
  71. package/dist/lib/components/Bootstrap.d.ts +2 -1
  72. package/dist/lib/components/Bootstrap.js +3 -2
  73. package/dist/lib/components/Bootstrap.js.map +1 -1
  74. package/dist/lib/components/Footer.d.ts +1 -0
  75. package/dist/lib/components/Footer.js +32 -0
  76. package/dist/lib/components/Footer.js.map +1 -0
  77. package/dist/lib/components/Header.js +4 -4
  78. package/dist/lib/components/Header.js.map +1 -1
  79. package/dist/lib/components/Heading.d.ts +2 -2
  80. package/dist/lib/components/InlineCode.d.ts +2 -1
  81. package/dist/lib/components/InlineCode.js +2 -9
  82. package/dist/lib/components/InlineCode.js.map +1 -1
  83. package/dist/lib/components/Layout.js +8 -29
  84. package/dist/lib/components/Layout.js.map +1 -1
  85. package/dist/lib/components/Main.d.ts +2 -0
  86. package/dist/lib/components/Main.js +17 -0
  87. package/dist/lib/components/Main.js.map +1 -0
  88. package/dist/lib/components/MobileTopNavigation.js +6 -3
  89. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  90. package/dist/lib/components/Pagination.d.ts +11 -0
  91. package/dist/lib/components/Pagination.js +10 -0
  92. package/dist/lib/components/Pagination.js.map +1 -0
  93. package/dist/lib/components/ThemeSwitch.js +1 -1
  94. package/dist/lib/components/ThemeSwitch.js.map +1 -1
  95. package/dist/lib/components/TopNavigation.d.ts +3 -2
  96. package/dist/lib/components/TopNavigation.js +28 -14
  97. package/dist/lib/components/TopNavigation.js.map +1 -1
  98. package/dist/lib/components/Zudoku.d.ts +1 -1
  99. package/dist/lib/components/Zudoku.js +15 -8
  100. package/dist/lib/components/Zudoku.js.map +1 -1
  101. package/dist/lib/components/cache.d.ts +7 -0
  102. package/dist/lib/components/cache.js +7 -0
  103. package/dist/lib/components/cache.js.map +1 -1
  104. package/dist/lib/components/context/BypassProtectedRoutesContext.d.ts +1 -0
  105. package/dist/lib/components/context/BypassProtectedRoutesContext.js +3 -0
  106. package/dist/lib/components/context/BypassProtectedRoutesContext.js.map +1 -0
  107. package/dist/lib/components/context/RouterEventsEmitter.d.ts +1 -0
  108. package/dist/lib/components/context/RouterEventsEmitter.js +17 -0
  109. package/dist/lib/components/context/RouterEventsEmitter.js.map +1 -0
  110. package/dist/lib/components/context/ViewportAnchorContext.d.ts +2 -4
  111. package/dist/lib/components/context/ViewportAnchorContext.js +5 -10
  112. package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
  113. package/dist/lib/components/context/ZudokuContext.d.ts +2 -2
  114. package/dist/lib/components/context/ZudokuContext.js +13 -7
  115. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  116. package/dist/lib/components/index.d.ts +7 -3
  117. package/dist/lib/components/index.js +2 -0
  118. package/dist/lib/components/index.js.map +1 -1
  119. package/dist/lib/components/navigation/PoweredByZudoku.d.ts +3 -0
  120. package/dist/lib/components/navigation/PoweredByZudoku.js +6 -0
  121. package/dist/lib/components/navigation/PoweredByZudoku.js.map +1 -0
  122. package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
  123. package/dist/lib/components/navigation/Sidebar.js +1 -12
  124. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  125. package/dist/lib/components/navigation/SidebarBadge.d.ts +2 -0
  126. package/dist/lib/components/navigation/SidebarBadge.js +3 -1
  127. package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
  128. package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
  129. package/dist/lib/components/navigation/SidebarCategory.js +10 -6
  130. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  131. package/dist/lib/components/navigation/SidebarItem.d.ts +1 -0
  132. package/dist/lib/components/navigation/SidebarItem.js +17 -11
  133. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  134. package/dist/lib/components/navigation/SidebarWrapper.d.ts +7 -6
  135. package/dist/lib/components/navigation/SidebarWrapper.js +18 -3
  136. package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
  137. package/dist/lib/{plugins/markdown → components/navigation}/Toc.js +5 -7
  138. package/dist/lib/components/navigation/Toc.js.map +1 -0
  139. package/dist/lib/components/navigation/ZudokuLogo.d.ts +6 -0
  140. package/dist/lib/components/navigation/ZudokuLogo.js +5 -0
  141. package/dist/lib/components/navigation/ZudokuLogo.js.map +1 -0
  142. package/dist/lib/core/RouteGuard.d.ts +2 -1
  143. package/dist/lib/core/RouteGuard.js +31 -11
  144. package/dist/lib/core/RouteGuard.js.map +1 -1
  145. package/dist/lib/core/ZudokuContext.d.ts +32 -6
  146. package/dist/lib/core/ZudokuContext.js +29 -6
  147. package/dist/lib/core/ZudokuContext.js.map +1 -1
  148. package/dist/lib/core/plugins.d.ts +15 -7
  149. package/dist/lib/core/plugins.js +1 -0
  150. package/dist/lib/core/plugins.js.map +1 -1
  151. package/dist/lib/errors/ErrorAlert.js +6 -1
  152. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  153. package/dist/lib/hooks/index.d.ts +3 -0
  154. package/dist/lib/hooks/index.js +5 -0
  155. package/dist/lib/hooks/index.js.map +1 -0
  156. package/dist/lib/hooks/useEvent.d.ts +11 -0
  157. package/dist/lib/hooks/useEvent.js +19 -0
  158. package/dist/lib/hooks/useEvent.js.map +1 -0
  159. package/dist/lib/hooks/useEvent.test.js +100 -0
  160. package/dist/lib/hooks/useEvent.test.js.map +1 -0
  161. package/dist/lib/oas/graphql/index.d.ts +17 -4
  162. package/dist/lib/oas/graphql/index.js +151 -39
  163. package/dist/lib/oas/graphql/index.js.map +1 -1
  164. package/dist/lib/oas/parser/dereference/index.js +2 -0
  165. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  166. package/dist/lib/oas/parser/index.d.ts +5 -3
  167. package/dist/lib/oas/parser/index.js +0 -22
  168. package/dist/lib/oas/parser/index.js.map +1 -1
  169. package/dist/lib/plugins/api-catalog/Catalog.d.ts +4 -2
  170. package/dist/lib/plugins/api-catalog/Catalog.js +16 -26
  171. package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
  172. package/dist/lib/plugins/api-catalog/index.d.ts +1 -0
  173. package/dist/lib/plugins/api-catalog/index.js +39 -8
  174. package/dist/lib/plugins/api-catalog/index.js.map +1 -1
  175. package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
  176. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  177. package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
  178. package/dist/lib/plugins/markdown/MdxPage.js +3 -9
  179. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  180. package/dist/lib/plugins/openapi/ColorizedParam.js +1 -1
  181. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  182. package/dist/lib/plugins/openapi/Endpoint.js +1 -1
  183. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  184. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  185. package/dist/lib/plugins/openapi/OperationList.js +63 -18
  186. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  187. package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
  188. package/dist/lib/plugins/openapi/OperationListItem.js +7 -12
  189. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  190. package/dist/lib/plugins/openapi/ParamInfos.d.ts +6 -0
  191. package/dist/lib/plugins/openapi/ParamInfos.js +42 -0
  192. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -0
  193. package/dist/lib/plugins/openapi/ParameterList.d.ts +2 -1
  194. package/dist/lib/plugins/openapi/ParameterList.js +3 -2
  195. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  196. package/dist/lib/plugins/openapi/ParameterListItem.js +9 -4
  197. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  198. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -1
  199. package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
  200. package/dist/lib/plugins/openapi/SchemaList.d.ts +1 -0
  201. package/dist/lib/plugins/openapi/SchemaList.js +52 -0
  202. package/dist/lib/plugins/openapi/SchemaList.js.map +1 -0
  203. package/dist/lib/plugins/openapi/Sidecar.js +39 -10
  204. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  205. package/dist/lib/plugins/openapi/SidecarExamples.js +2 -2
  206. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  207. package/dist/lib/plugins/openapi/SimpleSelect.js +1 -1
  208. package/dist/lib/plugins/openapi/SimpleSelect.js.map +1 -1
  209. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
  210. package/dist/lib/plugins/openapi/client/GraphQLClient.js +1 -1
  211. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
  212. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +6 -2
  213. package/dist/lib/plugins/openapi/client/useCreateQuery.js +6 -5
  214. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
  215. package/dist/lib/plugins/openapi/components/EnumValues.d.ts +5 -0
  216. package/dist/lib/plugins/openapi/components/EnumValues.js +15 -0
  217. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -0
  218. package/dist/lib/plugins/openapi/components/SelectOnClick.d.ts +5 -0
  219. package/dist/lib/plugins/openapi/components/SelectOnClick.js +16 -0
  220. package/dist/lib/plugins/openapi/components/SelectOnClick.js.map +1 -0
  221. package/dist/lib/plugins/openapi/graphql/gql.d.ts +9 -5
  222. package/dist/lib/plugins/openapi/graphql/gql.js +5 -15
  223. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  224. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +108 -55
  225. package/dist/lib/plugins/openapi/graphql/graphql.js +59 -34
  226. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  227. package/dist/lib/plugins/openapi/index.d.ts +6 -11
  228. package/dist/lib/plugins/openapi/index.js +41 -60
  229. package/dist/lib/plugins/openapi/index.js.map +1 -1
  230. package/dist/lib/plugins/openapi/interfaces.d.ts +36 -10
  231. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
  232. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
  233. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  234. package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
  235. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  236. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  237. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  238. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  239. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  240. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  241. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  242. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +3 -2
  243. package/dist/lib/plugins/openapi/playground/PathParams.js +3 -2
  244. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  245. package/dist/lib/plugins/openapi/playground/Playground.d.ts +13 -2
  246. package/dist/lib/plugins/openapi/playground/Playground.js +81 -27
  247. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  248. package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
  249. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  250. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  251. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  252. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  253. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  254. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  255. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  256. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +20 -14
  257. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  258. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
  259. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
  260. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  261. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.d.ts +1 -2
  262. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js +2 -2
  263. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.js.map +1 -1
  264. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.d.ts +2 -1
  265. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js +2 -2
  266. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.js.map +1 -1
  267. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.d.ts +0 -1
  268. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js +1 -1
  269. package/dist/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.js.map +1 -1
  270. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.d.ts +4 -0
  271. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +12 -0
  272. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -0
  273. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.d.ts +2 -4
  274. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +18 -13
  275. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  276. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -2
  277. package/dist/lib/plugins/openapi/schema/SchemaView.js +33 -48
  278. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  279. package/dist/lib/plugins/openapi/schema/utils.d.ts +1 -0
  280. package/dist/lib/plugins/openapi/schema/utils.js +3 -1
  281. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  282. package/dist/lib/plugins/openapi/state.d.ts +25 -0
  283. package/dist/lib/plugins/openapi/state.js +18 -0
  284. package/dist/lib/plugins/openapi/state.js.map +1 -0
  285. package/dist/lib/plugins/openapi/util/createSidebarCategory.js +5 -7
  286. package/dist/lib/plugins/openapi/util/createSidebarCategory.js.map +1 -1
  287. package/dist/lib/plugins/openapi/util/getRoutes.js +9 -3
  288. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  289. package/dist/lib/plugins/search-pagefind/PagefindSearch.d.ts +6 -0
  290. package/dist/lib/plugins/search-pagefind/PagefindSearch.js +80 -0
  291. package/dist/lib/plugins/search-pagefind/PagefindSearch.js.map +1 -0
  292. package/dist/lib/plugins/search-pagefind/ResultList.d.ts +8 -0
  293. package/dist/lib/plugins/search-pagefind/ResultList.js +32 -0
  294. package/dist/lib/plugins/search-pagefind/ResultList.js.map +1 -0
  295. package/dist/lib/plugins/search-pagefind/get-results.d.ts +10 -0
  296. package/dist/lib/plugins/search-pagefind/get-results.js +42 -0
  297. package/dist/lib/plugins/search-pagefind/get-results.js.map +1 -0
  298. package/dist/lib/plugins/search-pagefind/index.d.ts +6 -0
  299. package/dist/lib/plugins/search-pagefind/index.js +9 -0
  300. package/dist/lib/plugins/search-pagefind/index.js.map +1 -0
  301. package/dist/lib/plugins/search-pagefind/types.d.ts +85 -0
  302. package/dist/lib/plugins/search-pagefind/types.js +2 -0
  303. package/dist/lib/plugins/search-pagefind/types.js.map +1 -0
  304. package/dist/lib/ui/Badge.d.ts +1 -1
  305. package/dist/lib/ui/Button.d.ts +2 -2
  306. package/dist/lib/ui/Button.js +2 -1
  307. package/dist/lib/ui/Button.js.map +1 -1
  308. package/dist/lib/ui/Callout.d.ts +2 -1
  309. package/dist/lib/ui/Callout.js +3 -2
  310. package/dist/lib/ui/Callout.js.map +1 -1
  311. package/dist/lib/ui/Checkbox.d.ts +2 -8
  312. package/dist/lib/ui/Checkbox.js +1 -13
  313. package/dist/lib/ui/Checkbox.js.map +1 -1
  314. package/dist/lib/ui/Command.d.ts +7 -1
  315. package/dist/lib/ui/Command.js +2 -2
  316. package/dist/lib/ui/Command.js.map +1 -1
  317. package/dist/lib/ui/Select.js +1 -1
  318. package/dist/lib/ui/Select.js.map +1 -1
  319. package/dist/lib/ui/Stepper.d.ts +3 -0
  320. package/dist/lib/ui/Stepper.js +7 -0
  321. package/dist/lib/ui/Stepper.js.map +1 -0
  322. package/dist/lib/ui/SyntaxHighlight.d.ts +15 -0
  323. package/dist/lib/ui/SyntaxHighlight.js +62 -0
  324. package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
  325. package/dist/lib/ui/util.d.ts +2 -0
  326. package/dist/lib/ui/util.js +3 -0
  327. package/dist/lib/ui/util.js.map +1 -0
  328. package/dist/lib/util/MdxComponents.d.ts +5 -2
  329. package/dist/lib/util/MdxComponents.js +6 -3
  330. package/dist/lib/util/MdxComponents.js.map +1 -1
  331. package/dist/lib/util/joinPath.d.ts +3 -0
  332. package/dist/lib/util/joinPath.js +3 -0
  333. package/dist/lib/util/joinPath.js.map +1 -1
  334. package/dist/lib/util/traverse.d.ts +2 -8
  335. package/dist/lib/util/traverse.js +2 -2
  336. package/dist/lib/util/traverse.js.map +1 -1
  337. package/dist/lib/util/types.d.ts +7 -0
  338. package/dist/lib/util/types.js +2 -0
  339. package/dist/lib/util/types.js.map +1 -0
  340. package/dist/lib/util/useOnScreen.d.ts +3 -2
  341. package/dist/lib/util/useOnScreen.js +3 -3
  342. package/dist/lib/util/useOnScreen.js.map +1 -1
  343. package/dist/lib/util/useScrollToAnchor.js +26 -20
  344. package/dist/lib/util/useScrollToAnchor.js.map +1 -1
  345. package/dist/vite/api/schema-codegen.d.ts +1 -1
  346. package/dist/vite/api/schema-codegen.js +31 -9
  347. package/dist/vite/api/schema-codegen.js.map +1 -1
  348. package/dist/vite/api/schema-codegen.test.js +66 -0
  349. package/dist/vite/api/schema-codegen.test.js.map +1 -1
  350. package/dist/vite/build.js +2 -0
  351. package/dist/vite/build.js.map +1 -1
  352. package/dist/vite/config.d.ts +2 -5
  353. package/dist/vite/config.js +39 -56
  354. package/dist/vite/config.js.map +1 -1
  355. package/dist/vite/config.test.js +1 -1
  356. package/dist/vite/config.test.js.map +1 -1
  357. package/dist/vite/create-pagefind-index.d.ts +4 -0
  358. package/dist/vite/create-pagefind-index.js +12 -0
  359. package/dist/vite/create-pagefind-index.js.map +1 -0
  360. package/dist/vite/css/plugin.d.ts +2 -2
  361. package/dist/vite/css/plugin.js.map +1 -1
  362. package/dist/vite/dev-server.js +12 -4
  363. package/dist/vite/dev-server.js.map +1 -1
  364. package/dist/vite/plugin-api-keys.d.ts +2 -2
  365. package/dist/vite/plugin-api-keys.js +3 -3
  366. package/dist/vite/plugin-api-keys.js.map +1 -1
  367. package/dist/vite/plugin-api.d.ts +2 -2
  368. package/dist/vite/plugin-api.js +42 -35
  369. package/dist/vite/plugin-api.js.map +1 -1
  370. package/dist/vite/plugin-auth.d.ts +2 -2
  371. package/dist/vite/plugin-auth.js +3 -3
  372. package/dist/vite/plugin-auth.js.map +1 -1
  373. package/dist/vite/plugin-component.d.ts +2 -2
  374. package/dist/vite/plugin-component.js +7 -2
  375. package/dist/vite/plugin-component.js.map +1 -1
  376. package/dist/vite/plugin-config-reload.d.ts +4 -3
  377. package/dist/vite/plugin-config-reload.js +13 -6
  378. package/dist/vite/plugin-config-reload.js.map +1 -1
  379. package/dist/vite/plugin-config.d.ts +2 -2
  380. package/dist/vite/plugin-config.js +7 -4
  381. package/dist/vite/plugin-config.js.map +1 -1
  382. package/dist/vite/plugin-custom-pages.d.ts +2 -2
  383. package/dist/vite/plugin-custom-pages.js +3 -3
  384. package/dist/vite/plugin-custom-pages.js.map +1 -1
  385. package/dist/vite/plugin-docs.d.ts +3 -3
  386. package/dist/vite/plugin-docs.js +23 -6
  387. package/dist/vite/plugin-docs.js.map +1 -1
  388. package/dist/vite/plugin-frontmatter.d.ts +2 -2
  389. package/dist/vite/plugin-frontmatter.js +5 -4
  390. package/dist/vite/plugin-frontmatter.js.map +1 -1
  391. package/dist/vite/plugin-mdx.d.ts +2 -2
  392. package/dist/vite/plugin-mdx.js +1 -1
  393. package/dist/vite/plugin-mdx.js.map +1 -1
  394. package/dist/vite/plugin-redirect.d.ts +2 -2
  395. package/dist/vite/plugin-redirect.js +3 -3
  396. package/dist/vite/plugin-redirect.js.map +1 -1
  397. package/dist/vite/plugin-search.d.ts +2 -2
  398. package/dist/vite/plugin-search.js +5 -1
  399. package/dist/vite/plugin-search.js.map +1 -1
  400. package/dist/vite/plugin-sidebar.d.ts +2 -2
  401. package/dist/vite/plugin-sidebar.js +2 -2
  402. package/dist/vite/plugin-sidebar.js.map +1 -1
  403. package/dist/vite/plugin-theme-css.d.ts +2 -2
  404. package/dist/vite/plugin-theme-css.js.map +1 -1
  405. package/dist/vite/plugin.d.ts +2 -2
  406. package/dist/vite/plugin.js.map +1 -1
  407. package/dist/vite/prerender/FileWritingResponse.d.ts +11 -6
  408. package/dist/vite/prerender/FileWritingResponse.js +9 -6
  409. package/dist/vite/prerender/FileWritingResponse.js.map +1 -1
  410. package/dist/vite/prerender/InMemoryResponse.d.ts +16 -0
  411. package/dist/vite/prerender/InMemoryResponse.js +32 -0
  412. package/dist/vite/prerender/InMemoryResponse.js.map +1 -0
  413. package/dist/vite/prerender/PrerenderResponse.d.ts +10 -0
  414. package/dist/vite/prerender/PrerenderResponse.js +2 -0
  415. package/dist/vite/prerender/PrerenderResponse.js.map +1 -0
  416. package/dist/vite/prerender/prerender.d.ts +1 -0
  417. package/dist/vite/prerender/prerender.js +34 -28
  418. package/dist/vite/prerender/prerender.js.map +1 -1
  419. package/dist/vite/prerender/worker.d.ts +1 -1
  420. package/dist/vite/prerender/worker.js +42 -12
  421. package/dist/vite/prerender/worker.js.map +1 -1
  422. package/dist/vite/sitemap.js +2 -1
  423. package/dist/vite/sitemap.js.map +1 -1
  424. package/dist/zuplo/with-zuplo.js +4 -0
  425. package/dist/zuplo/with-zuplo.js.map +1 -1
  426. package/lib/{AuthenticationPlugin-_YVa673u.js → AuthenticationPlugin-foqdvvkf.js} +4 -4
  427. package/lib/{AuthenticationPlugin-_YVa673u.js.map → AuthenticationPlugin-foqdvvkf.js.map} +1 -1
  428. package/lib/Button-Fp19CMUr.js +49 -0
  429. package/lib/Button-Fp19CMUr.js.map +1 -0
  430. package/lib/Callout-B2vsR09t.js +229 -0
  431. package/lib/Callout-B2vsR09t.js.map +1 -0
  432. package/lib/{CategoryHeading-MYL1u_6K.js → CategoryHeading-DpB47wvk.js} +3 -3
  433. package/lib/{CategoryHeading-MYL1u_6K.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
  434. package/lib/Dialog-sbgekbjb.js +98 -0
  435. package/lib/Dialog-sbgekbjb.js.map +1 -0
  436. package/lib/Drawer-kDAfOq_2.js +1133 -0
  437. package/lib/Drawer-kDAfOq_2.js.map +1 -0
  438. package/lib/{Markdown-8mv9nhGd.js → Markdown-aF5FdsNi.js} +7822 -6052
  439. package/lib/Markdown-aF5FdsNi.js.map +1 -0
  440. package/lib/MdxPage-Vw_dc9Yz.js +85 -0
  441. package/lib/MdxPage-Vw_dc9Yz.js.map +1 -0
  442. package/lib/{OasProvider-IS9wBrb7.js → OasProvider-CjXTP-nz.js} +6 -6
  443. package/lib/{OasProvider-IS9wBrb7.js.map → OasProvider-CjXTP-nz.js.map} +1 -1
  444. package/lib/OperationList-BYemrDYk.js +5068 -0
  445. package/lib/OperationList-BYemrDYk.js.map +1 -0
  446. package/lib/Pagination-SdlocK96.js +48 -0
  447. package/lib/Pagination-SdlocK96.js.map +1 -0
  448. package/lib/{index.esm-9-TF9KQB.js → RouteGuard-CqZPoZYJ.js} +196 -144
  449. package/lib/RouteGuard-CqZPoZYJ.js.map +1 -0
  450. package/lib/SchemaList-CAeKy9pV.js +148 -0
  451. package/lib/SchemaList-CAeKy9pV.js.map +1 -0
  452. package/lib/SchemaView-B3fOPR4V.js +357 -0
  453. package/lib/SchemaView-B3fOPR4V.js.map +1 -0
  454. package/lib/{Select-D9CKL33X.js → Select-DVFRKf1R.js} +71 -71
  455. package/lib/{Select-D9CKL33X.js.map → Select-DVFRKf1R.js.map} +1 -1
  456. package/lib/SlotletProvider-DXvc0aY6.js +338 -0
  457. package/lib/SlotletProvider-DXvc0aY6.js.map +1 -0
  458. package/lib/Spinner-CE68iCm0.js +7 -0
  459. package/lib/Spinner-CE68iCm0.js.map +1 -0
  460. package/lib/{SyntaxHighlight-B0L4SC_N.js → SyntaxHighlight-BEoSoPEo.js} +496 -592
  461. package/lib/SyntaxHighlight-BEoSoPEo.js.map +1 -0
  462. package/lib/Toc-YBsgI72s.js +92 -0
  463. package/lib/Toc-YBsgI72s.js.map +1 -0
  464. package/lib/{chunk-SYFQ2XB5-QijJrSf0.js → chunk-HA7DTUK3-C4gP41vD.js} +560 -560
  465. package/lib/chunk-HA7DTUK3-C4gP41vD.js.map +1 -0
  466. package/lib/{circular-DxaIIlWD.js → circular-ByJI6Mci.js} +5461 -4993
  467. package/lib/circular-ByJI6Mci.js.map +1 -0
  468. package/lib/context-DLCwaMXN.js +22 -0
  469. package/lib/{context-rwLGh-6_.js.map → context-DLCwaMXN.js.map} +1 -1
  470. package/lib/{createServer-DSQiPwjN.js → createServer-mYvGvmc0.js} +5062 -5209
  471. package/lib/createServer-mYvGvmc0.js.map +1 -0
  472. package/lib/{hook-C_t2ISLC.js → hook-CqpVYDqN.js} +495 -467
  473. package/lib/hook-CqpVYDqN.js.map +1 -0
  474. package/lib/index-Bn6Lc9tq.js +9 -0
  475. package/lib/index-Bn6Lc9tq.js.map +1 -0
  476. package/lib/index-C1OzjGUK.js +2227 -0
  477. package/lib/index-C1OzjGUK.js.map +1 -0
  478. package/lib/index-CPNSgwSb.js +36 -0
  479. package/lib/{index-Djenk2Hj.js.map → index-CPNSgwSb.js.map} +1 -1
  480. package/lib/index-D48iOQvJ.js +1973 -0
  481. package/lib/index-D48iOQvJ.js.map +1 -0
  482. package/lib/index-DwT-v3zK.js +86 -0
  483. package/lib/index-DwT-v3zK.js.map +1 -0
  484. package/lib/{index-CjJS0l4l.js → index-LNp6rxyU.js} +2 -2
  485. package/lib/{index-CjJS0l4l.js.map → index-LNp6rxyU.js.map} +1 -1
  486. package/lib/index-gQD2h1wX.js +447 -0
  487. package/lib/index-gQD2h1wX.js.map +1 -0
  488. package/lib/{index.esm-CrSoEshU.js → index.esm--gIChbWs.js} +3 -3
  489. package/lib/{index.esm-CrSoEshU.js.map → index.esm--gIChbWs.js.map} +1 -1
  490. package/lib/{jsx-runtime-Bdg6XQ1m.js → jsx-runtime-CYK1ROHF.js} +99 -99
  491. package/lib/{jsx-runtime-Bdg6XQ1m.js.map → jsx-runtime-CYK1ROHF.js.map} +1 -1
  492. package/lib/{mutation-Cm3O9f3X.js → mutation-8LjrN7uz.js} +26 -26
  493. package/lib/{mutation-Cm3O9f3X.js.map → mutation-8LjrN7uz.js.map} +1 -1
  494. package/lib/objectEntries-yMIkr2mI.js +5 -0
  495. package/lib/objectEntries-yMIkr2mI.js.map +1 -0
  496. package/lib/post-processors/removeExtensions.js +4 -4
  497. package/lib/post-processors/traverse.js +2 -2
  498. package/lib/post-processors/traverse.js.map +1 -1
  499. package/lib/prism-bash.min-HHIMdNJ_.js.map +1 -1
  500. package/lib/prism-csharp.min-bQAo2pmx.js.map +1 -1
  501. package/lib/prism-java.min-BpvsOuIa.js.map +1 -1
  502. package/lib/prism-javascript.min-CEqHqgbm.js.map +1 -1
  503. package/lib/prism-json.min-B1GJqK1k.js.map +1 -1
  504. package/lib/prism-jsstacktrace.min-BfobCF2F.js +2 -0
  505. package/lib/prism-jsstacktrace.min-BfobCF2F.js.map +1 -0
  506. package/lib/prism-markdown.min-C0Qn0m-5.js.map +1 -1
  507. package/lib/prism-markup-BNGj0Tvm.js.map +1 -1
  508. package/lib/prism-objectivec.min-BXSWqpJJ.js.map +1 -1
  509. package/lib/prism-ruby.min-Dx9KO9ds.js.map +1 -1
  510. package/lib/prism-typescript.min-CD7H2IYQ.js.map +1 -1
  511. package/lib/ui/Accordion.js +1 -1
  512. package/lib/ui/ActionButton.js +11 -10
  513. package/lib/ui/ActionButton.js.map +1 -1
  514. package/lib/ui/Alert.js +2 -2
  515. package/lib/ui/AlertDialog.js +1 -1
  516. package/lib/ui/Badge.js +2 -2
  517. package/lib/ui/Breadcrumb.js +4 -4
  518. package/lib/ui/Button.js +13 -12
  519. package/lib/ui/Button.js.map +1 -1
  520. package/lib/ui/Callout.js +39 -21
  521. package/lib/ui/Callout.js.map +1 -1
  522. package/lib/ui/Card.js +1 -1
  523. package/lib/ui/Carousel.js +1 -1
  524. package/lib/ui/Checkbox.js +16 -26
  525. package/lib/ui/Checkbox.js.map +1 -1
  526. package/lib/ui/Command.js +105 -78
  527. package/lib/ui/Command.js.map +1 -1
  528. package/lib/ui/Dialog.js +1 -1
  529. package/lib/ui/Drawer.js +14 -1151
  530. package/lib/ui/Drawer.js.map +1 -1
  531. package/lib/ui/DropdownMenu.js +1 -1
  532. package/lib/ui/Form.js +5 -5
  533. package/lib/ui/HoverCard.js +1 -1
  534. package/lib/ui/Input.js +1 -1
  535. package/lib/ui/Label.js +2 -2
  536. package/lib/ui/Pagination.js +10 -10
  537. package/lib/ui/Popover.js +1 -1
  538. package/lib/ui/Progress.js +1 -1
  539. package/lib/ui/RadioGroup.js +1 -1
  540. package/lib/ui/ScrollArea.js +1 -1
  541. package/lib/ui/Select.js +2 -2
  542. package/lib/ui/Select.js.map +1 -1
  543. package/lib/ui/Skeleton.js +1 -1
  544. package/lib/ui/Slider.js +1 -1
  545. package/lib/ui/Stepper.js +6 -0
  546. package/lib/ui/Stepper.js.map +1 -0
  547. package/lib/ui/Switch.js +1 -1
  548. package/lib/ui/SyntaxHighlight.js +11 -0
  549. package/lib/ui/SyntaxHighlight.js.map +1 -0
  550. package/lib/ui/Tabs.js +1 -1
  551. package/lib/ui/Textarea.js +1 -1
  552. package/lib/ui/Toggle.js +2 -2
  553. package/lib/ui/ToggleGroup.js +1 -1
  554. package/lib/ui/Tooltip.js +1 -1
  555. package/lib/ui/util.js +6 -0
  556. package/lib/ui/util.js.map +1 -0
  557. package/lib/{useExposedProps-Bbf99zic.js → useExposedProps-B9qXJedG.js} +2 -2
  558. package/lib/{useExposedProps-Bbf99zic.js.map → useExposedProps-B9qXJedG.js.map} +1 -1
  559. package/lib/useLatest-hmRS46UF.js +11 -0
  560. package/lib/useLatest-hmRS46UF.js.map +1 -0
  561. package/lib/zudoku.auth-auth0.js +15 -14
  562. package/lib/zudoku.auth-auth0.js.map +1 -1
  563. package/lib/zudoku.auth-clerk.js +67 -49
  564. package/lib/zudoku.auth-clerk.js.map +1 -1
  565. package/lib/zudoku.auth-openid.js +370 -404
  566. package/lib/zudoku.auth-openid.js.map +1 -1
  567. package/lib/zudoku.components.js +32 -1334
  568. package/lib/zudoku.components.js.map +1 -1
  569. package/lib/zudoku.hooks.js +19 -0
  570. package/lib/zudoku.hooks.js.map +1 -0
  571. package/lib/zudoku.icons.js +1 -1
  572. package/lib/zudoku.plugin-api-catalog.js +106 -111
  573. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  574. package/lib/zudoku.plugin-api-keys.js +108 -106
  575. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  576. package/lib/zudoku.plugin-custom-pages.js +3 -3
  577. package/lib/zudoku.plugin-markdown.js +2 -2
  578. package/lib/zudoku.plugin-openapi.js +6 -8
  579. package/lib/zudoku.plugin-openapi.js.map +1 -1
  580. package/lib/zudoku.plugin-redirect.js +1 -1
  581. package/lib/zudoku.plugin-search-inkeep.js +9 -9
  582. package/lib/zudoku.plugin-search-pagefind.js +233 -0
  583. package/lib/zudoku.plugin-search-pagefind.js.map +1 -0
  584. package/lib/zudoku.plugins.js +9 -8
  585. package/lib/zudoku.plugins.js.map +1 -1
  586. package/package.json +76 -56
  587. package/src/app/entry.client.tsx +8 -0
  588. package/src/app/entry.server.tsx +23 -13
  589. package/src/app/main.css +98 -57
  590. package/src/app/main.tsx +3 -1
  591. package/src/app/tailwind.ts +20 -0
  592. package/src/lib/authentication/authentication.ts +2 -0
  593. package/src/lib/authentication/hook.ts +12 -1
  594. package/src/lib/authentication/providers/auth0.tsx +3 -2
  595. package/src/lib/authentication/providers/clerk.tsx +32 -8
  596. package/src/lib/authentication/providers/openid.tsx +31 -15
  597. package/src/lib/authentication/providers/supabase.tsx +157 -0
  598. package/src/lib/authentication/state.ts +9 -37
  599. package/src/lib/components/AnchorLink.tsx +9 -7
  600. package/src/lib/components/Banner.tsx +1 -0
  601. package/src/lib/components/Bootstrap.tsx +13 -6
  602. package/src/lib/components/Footer.tsx +136 -0
  603. package/src/lib/components/Header.tsx +12 -8
  604. package/src/lib/components/Heading.tsx +1 -1
  605. package/src/lib/components/InlineCode.tsx +13 -16
  606. package/src/lib/components/Layout.tsx +22 -67
  607. package/src/lib/components/Main.tsx +50 -0
  608. package/src/lib/components/MobileTopNavigation.tsx +27 -18
  609. package/src/lib/components/Pagination.tsx +50 -0
  610. package/src/lib/components/ThemeSwitch.tsx +1 -1
  611. package/src/lib/components/TopNavigation.tsx +51 -24
  612. package/src/lib/components/Zudoku.tsx +20 -7
  613. package/src/lib/components/cache.ts +8 -0
  614. package/src/lib/components/context/BypassProtectedRoutesContext.ts +3 -0
  615. package/src/lib/components/context/RouterEventsEmitter.tsx +19 -0
  616. package/src/lib/components/context/ViewportAnchorContext.tsx +6 -15
  617. package/src/lib/components/context/ZudokuContext.ts +17 -8
  618. package/src/lib/components/index.ts +2 -0
  619. package/src/lib/components/navigation/PoweredByZudoku.tsx +23 -0
  620. package/src/lib/components/navigation/Sidebar.tsx +30 -44
  621. package/src/lib/components/navigation/SidebarBadge.tsx +4 -1
  622. package/src/lib/components/navigation/SidebarCategory.tsx +15 -12
  623. package/src/lib/components/navigation/SidebarItem.tsx +22 -29
  624. package/src/lib/components/navigation/SidebarWrapper.tsx +42 -23
  625. package/src/lib/{plugins/markdown → components/navigation}/Toc.tsx +5 -14
  626. package/src/lib/components/navigation/ZudokuLogo.tsx +25 -0
  627. package/src/lib/core/RouteGuard.tsx +69 -12
  628. package/src/lib/core/ZudokuContext.ts +63 -12
  629. package/src/lib/core/plugins.ts +21 -7
  630. package/src/lib/errors/ErrorAlert.tsx +24 -17
  631. package/src/lib/hooks/index.ts +5 -0
  632. package/src/lib/hooks/useEvent.test.tsx +149 -0
  633. package/src/lib/hooks/useEvent.ts +41 -0
  634. package/src/lib/oas/graphql/index.ts +206 -55
  635. package/src/lib/oas/parser/dereference/index.ts +2 -0
  636. package/src/lib/oas/parser/index.ts +7 -29
  637. package/src/lib/plugins/api-catalog/Catalog.tsx +50 -100
  638. package/src/lib/plugins/api-catalog/index.tsx +66 -15
  639. package/src/lib/plugins/api-keys/CreateApiKey.tsx +7 -3
  640. package/src/lib/plugins/markdown/MdxPage.tsx +15 -47
  641. package/src/lib/plugins/openapi/ColorizedParam.tsx +1 -1
  642. package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
  643. package/src/lib/plugins/openapi/OperationList.tsx +171 -81
  644. package/src/lib/plugins/openapi/OperationListItem.tsx +118 -104
  645. package/src/lib/plugins/openapi/ParamInfos.tsx +87 -0
  646. package/src/lib/plugins/openapi/ParameterList.tsx +4 -0
  647. package/src/lib/plugins/openapi/ParameterListItem.tsx +35 -23
  648. package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +7 -0
  649. package/src/lib/plugins/openapi/SchemaList.tsx +151 -0
  650. package/src/lib/plugins/openapi/Sidecar.tsx +50 -13
  651. package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -2
  652. package/src/lib/plugins/openapi/SimpleSelect.tsx +1 -1
  653. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +1 -1
  654. package/src/lib/plugins/openapi/client/useCreateQuery.ts +13 -5
  655. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -0
  656. package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -0
  657. package/src/lib/plugins/openapi/graphql/gql.ts +34 -17
  658. package/src/lib/plugins/openapi/graphql/graphql.ts +172 -86
  659. package/src/lib/plugins/openapi/index.tsx +55 -87
  660. package/src/lib/plugins/openapi/interfaces.ts +44 -15
  661. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
  662. package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
  663. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  664. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  665. package/src/lib/plugins/openapi/playground/PathParams.tsx +8 -2
  666. package/src/lib/plugins/openapi/playground/Playground.tsx +176 -89
  667. package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
  668. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  669. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  670. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +25 -5
  671. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +67 -45
  672. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroup.tsx +1 -8
  673. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupConnector.tsx +3 -0
  674. package/src/lib/plugins/openapi/schema/LogicalGroup/LogicalGroupItem.tsx +6 -3
  675. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +36 -0
  676. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +47 -50
  677. package/src/lib/plugins/openapi/schema/SchemaView.tsx +84 -138
  678. package/src/lib/plugins/openapi/schema/utils.ts +7 -1
  679. package/src/lib/plugins/openapi/state.ts +36 -0
  680. package/src/lib/plugins/openapi/util/createSidebarCategory.tsx +5 -7
  681. package/src/lib/plugins/openapi/util/getRoutes.tsx +9 -6
  682. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +164 -0
  683. package/src/lib/plugins/search-pagefind/ResultList.tsx +105 -0
  684. package/src/lib/plugins/search-pagefind/get-results.tsx +75 -0
  685. package/src/lib/plugins/search-pagefind/index.tsx +21 -0
  686. package/src/lib/plugins/search-pagefind/types.ts +118 -0
  687. package/src/lib/ui/Button.tsx +4 -2
  688. package/src/lib/ui/Callout.tsx +28 -10
  689. package/src/lib/ui/Checkbox.tsx +8 -24
  690. package/src/lib/ui/Command.tsx +25 -3
  691. package/src/lib/ui/Select.tsx +1 -1
  692. package/src/lib/ui/Stepper.tsx +8 -0
  693. package/src/lib/ui/SyntaxHighlight.tsx +186 -0
  694. package/src/lib/ui/util.tsx +3 -0
  695. package/src/lib/util/MdxComponents.tsx +7 -4
  696. package/src/lib/util/joinPath.tsx +3 -0
  697. package/src/lib/util/traverse.ts +4 -8
  698. package/src/lib/util/types.ts +7 -0
  699. package/src/lib/util/useOnScreen.ts +6 -4
  700. package/src/lib/util/useScrollToAnchor.ts +30 -20
  701. package/dist/lib/components/SyntaxHighlight.d.ts +0 -12
  702. package/dist/lib/components/SyntaxHighlight.js +0 -53
  703. package/dist/lib/components/SyntaxHighlight.js.map +0 -1
  704. package/dist/lib/components/context/PluginSystem.js +0 -2
  705. package/dist/lib/components/context/PluginSystem.js.map +0 -1
  706. package/dist/lib/plugins/markdown/Toc.js.map +0 -1
  707. package/lib/Markdown-8mv9nhGd.js.map +0 -1
  708. package/lib/MdxPage-GM1T5jmO.js +0 -193
  709. package/lib/MdxPage-GM1T5jmO.js.map +0 -1
  710. package/lib/OperationList-BTmRbbXk.js +0 -5179
  711. package/lib/OperationList-BTmRbbXk.js.map +0 -1
  712. package/lib/SlotletProvider-D0mFmGJu.js +0 -221
  713. package/lib/SlotletProvider-D0mFmGJu.js.map +0 -1
  714. package/lib/Spinner-BlzrEEk1.js +0 -51
  715. package/lib/Spinner-BlzrEEk1.js.map +0 -1
  716. package/lib/SyntaxHighlight-B0L4SC_N.js.map +0 -1
  717. package/lib/chunk-SYFQ2XB5-QijJrSf0.js.map +0 -1
  718. package/lib/circular-DxaIIlWD.js.map +0 -1
  719. package/lib/context-rwLGh-6_.js +0 -22
  720. package/lib/createServer-DSQiPwjN.js.map +0 -1
  721. package/lib/hook-C_t2ISLC.js.map +0 -1
  722. package/lib/index-B7mqiOei.js +0 -509
  723. package/lib/index-B7mqiOei.js.map +0 -1
  724. package/lib/index-BANyVRgL.js +0 -2098
  725. package/lib/index-BANyVRgL.js.map +0 -1
  726. package/lib/index-Djenk2Hj.js +0 -36
  727. package/lib/index.esm-9-TF9KQB.js.map +0 -1
  728. package/lib/joinUrl-nLx9pD-Z.js +0 -20
  729. package/lib/joinUrl-nLx9pD-Z.js.map +0 -1
  730. package/lib/useScrollToAnchor-BGEcH3HM.js +0 -286
  731. package/lib/useScrollToAnchor-BGEcH3HM.js.map +0 -1
  732. package/src/lib/components/SyntaxHighlight.tsx +0 -171
  733. package/src/lib/components/context/PluginSystem.ts +0 -0
  734. /package/dist/lib/{plugins/markdown → components/navigation}/Toc.d.ts +0 -0
  735. /package/dist/lib/{components/context/PluginSystem.d.ts → hooks/useEvent.test.d.ts} +0 -0
package/lib/ui/Drawer.js CHANGED
@@ -1,1154 +1,17 @@
1
- import { j as X } from "../jsx-runtime-Bdg6XQ1m.js";
2
- import * as pe from "react";
3
- import r, { useMemo as St, useLayoutEffect as Rt, useEffect as Dt } from "react";
4
- import * as Z from "@radix-ui/react-dialog";
5
- import { c as oe } from "../cn-qaFjX9_3.js";
6
- function Tt(e) {
7
- if (typeof document > "u") return;
8
- let n = document.head || document.getElementsByTagName("head")[0], t = document.createElement("style");
9
- t.type = "text/css", n.appendChild(t), t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e));
10
- }
11
- const qe = r.createContext({
12
- drawerRef: {
13
- current: null
14
- },
15
- overlayRef: {
16
- current: null
17
- },
18
- onPress: () => {
19
- },
20
- onRelease: () => {
21
- },
22
- onDrag: () => {
23
- },
24
- onNestedDrag: () => {
25
- },
26
- onNestedOpenChange: () => {
27
- },
28
- onNestedRelease: () => {
29
- },
30
- openProp: void 0,
31
- dismissible: !1,
32
- isOpen: !1,
33
- isDragging: !1,
34
- keyboardIsOpen: {
35
- current: !1
36
- },
37
- snapPointsOffset: null,
38
- snapPoints: null,
39
- handleOnly: !1,
40
- modal: !1,
41
- shouldFade: !1,
42
- activeSnapPoint: null,
43
- onOpenChange: () => {
44
- },
45
- setActiveSnapPoint: () => {
46
- },
47
- closeDrawer: () => {
48
- },
49
- direction: "bottom",
50
- shouldAnimate: {
51
- current: !0
52
- },
53
- shouldScaleBackground: !1,
54
- setBackgroundColorOnScale: !0,
55
- noBodyStyles: !1,
56
- container: null,
57
- autoFocus: !1
58
- }), ie = () => {
59
- const e = r.useContext(qe);
60
- if (!e)
61
- throw new Error("useDrawerContext must be used within a Drawer.Root");
62
- return e;
63
- };
64
- Tt(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
65
- [data-state=closed]
66
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);
67
- function Et() {
68
- const e = navigator.userAgent;
69
- return typeof window < "u" && (/Firefox/.test(e) && /Mobile/.test(e) || // Android Firefox
70
- /FxiOS/.test(e));
71
- }
72
- function xt() {
73
- return Me(/^Mac/);
74
- }
75
- function Ot() {
76
- return Me(/^iPhone/);
77
- }
78
- function We() {
79
- return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
80
- }
81
- function Ct() {
82
- return Me(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
83
- xt() && navigator.maxTouchPoints > 1;
84
- }
85
- function Xe() {
86
- return Ot() || Ct();
87
- }
88
- function Me(e) {
89
- return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
90
- }
91
- const $t = 24, At = typeof window < "u" ? Rt : Dt;
92
- function ze(...e) {
93
- return (...n) => {
94
- for (let t of e)
95
- typeof t == "function" && t(...n);
96
- };
97
- }
98
- const xe = typeof document < "u" && window.visualViewport;
99
- function Ve(e) {
100
- let n = window.getComputedStyle(e);
101
- return /(auto|scroll)/.test(n.overflow + n.overflowX + n.overflowY);
102
- }
103
- function Ke(e) {
104
- for (Ve(e) && (e = e.parentElement); e && !Ve(e); )
105
- e = e.parentElement;
106
- return e || document.scrollingElement || document.documentElement;
107
- }
108
- const Nt = /* @__PURE__ */ new Set([
109
- "checkbox",
110
- "radio",
111
- "range",
112
- "color",
113
- "file",
114
- "image",
115
- "button",
116
- "submit",
117
- "reset"
118
- ]);
119
- let ve = 0, Oe;
120
- function Mt(e = {}) {
121
- let { isDisabled: n } = e;
122
- At(() => {
123
- if (!n)
124
- return ve++, ve === 1 && Xe() && (Oe = Pt()), () => {
125
- ve--, ve === 0 && (Oe == null || Oe());
126
- };
127
- }, [
128
- n
129
- ]);
130
- }
131
- function Pt() {
132
- let e, n = 0, t = (m) => {
133
- e = Ke(m.target), !(e === document.documentElement && e === document.body) && (n = m.changedTouches[0].pageY);
134
- }, a = (m) => {
135
- if (!e || e === document.documentElement || e === document.body) {
136
- m.preventDefault();
137
- return;
138
- }
139
- let p = m.changedTouches[0].pageY, B = e.scrollTop, k = e.scrollHeight - e.clientHeight;
140
- k !== 0 && ((B <= 0 && p > n || B >= k && p < n) && m.preventDefault(), n = p);
141
- }, i = (m) => {
142
- let p = m.target;
143
- Ae(p) && p !== document.activeElement && (m.preventDefault(), p.style.transform = "translateY(-2000px)", p.focus(), requestAnimationFrame(() => {
144
- p.style.transform = "";
145
- }));
146
- }, o = (m) => {
147
- let p = m.target;
148
- Ae(p) && (p.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
149
- p.style.transform = "", xe && (xe.height < window.innerHeight ? requestAnimationFrame(() => {
150
- Ye(p);
151
- }) : xe.addEventListener("resize", () => Ye(p), {
152
- once: !0
153
- }));
154
- }));
155
- }, g = () => {
156
- window.scrollTo(0, 0);
157
- }, u = window.pageXOffset, b = window.pageYOffset, T = ze(It(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
158
- window.scrollTo(0, 0);
159
- let h = ze(fe(document, "touchstart", t, {
160
- passive: !1,
161
- capture: !0
162
- }), fe(document, "touchmove", a, {
163
- passive: !1,
164
- capture: !0
165
- }), fe(document, "touchend", i, {
166
- passive: !1,
167
- capture: !0
168
- }), fe(document, "focus", o, !0), fe(window, "scroll", g));
169
- return () => {
170
- T(), h(), window.scrollTo(u, b);
171
- };
172
- }
173
- function It(e, n, t) {
174
- let a = e.style[n];
175
- return e.style[n] = t, () => {
176
- e.style[n] = a;
177
- };
178
- }
179
- function fe(e, n, t, a) {
180
- return e.addEventListener(n, t, a), () => {
181
- e.removeEventListener(n, t, a);
182
- };
183
- }
184
- function Ye(e) {
185
- let n = document.scrollingElement || document.documentElement;
186
- for (; e && e !== n; ) {
187
- let t = Ke(e);
188
- if (t !== document.documentElement && t !== document.body && t !== e) {
189
- let a = t.getBoundingClientRect().top, i = e.getBoundingClientRect().top, o = e.getBoundingClientRect().bottom;
190
- const g = t.getBoundingClientRect().bottom + $t;
191
- o > g && (t.scrollTop += i - a);
192
- }
193
- e = t.parentElement;
194
- }
195
- }
196
- function Ae(e) {
197
- return e instanceof HTMLInputElement && !Nt.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
198
- }
199
- function _t(e, n) {
200
- typeof e == "function" ? e(n) : e != null && (e.current = n);
201
- }
202
- function Ht(...e) {
203
- return (n) => e.forEach((t) => _t(t, n));
204
- }
205
- function Ge(...e) {
206
- return pe.useCallback(Ht(...e), e);
207
- }
208
- const Je = /* @__PURE__ */ new WeakMap();
209
- function $(e, n, t = !1) {
210
- if (!e || !(e instanceof HTMLElement)) return;
211
- let a = {};
212
- Object.entries(n).forEach(([i, o]) => {
213
- if (i.startsWith("--")) {
214
- e.style.setProperty(i, o);
215
- return;
216
- }
217
- a[i] = e.style[i], e.style[i] = o;
218
- }), !t && Je.set(e, a);
219
- }
220
- function kt(e, n) {
221
- if (!e || !(e instanceof HTMLElement)) return;
222
- let t = Je.get(e);
223
- t && (e.style[n] = t[n]);
224
- }
225
- const C = (e) => {
226
- switch (e) {
227
- case "top":
228
- case "bottom":
229
- return !0;
230
- case "left":
231
- case "right":
232
- return !1;
233
- default:
234
- return e;
235
- }
236
- };
237
- function ye(e, n) {
238
- if (!e)
239
- return null;
240
- const t = window.getComputedStyle(e), a = (
241
- // @ts-ignore
242
- t.transform || t.webkitTransform || t.mozTransform
243
- );
244
- let i = a.match(/^matrix3d\((.+)\)$/);
245
- return i ? parseFloat(i[1].split(", ")[C(n) ? 13 : 12]) : (i = a.match(/^matrix\((.+)\)$/), i ? parseFloat(i[1].split(", ")[C(n) ? 5 : 4]) : null);
246
- }
247
- function Lt(e) {
248
- return 8 * (Math.log(e + 1) - 2);
249
- }
250
- function Ce(e, n) {
251
- if (!e) return () => {
252
- };
253
- const t = e.style.cssText;
254
- return Object.assign(e.style, n), () => {
255
- e.style.cssText = t;
256
- };
257
- }
258
- function Bt(...e) {
259
- return (...n) => {
260
- for (const t of e)
261
- typeof t == "function" && t(...n);
262
- };
263
- }
264
- const x = {
265
- DURATION: 0.5,
266
- EASE: [
267
- 0.32,
268
- 0.72,
269
- 0,
270
- 1
271
- ]
272
- }, Qe = 0.4, Ft = 0.25, Ut = 100, Ze = 8, be = 16, Ne = 26, $e = "vaul-dragging";
273
- function et(e) {
274
- const n = r.useRef(e);
275
- return r.useEffect(() => {
276
- n.current = e;
277
- }), r.useMemo(() => (...t) => n.current == null ? void 0 : n.current.call(n, ...t), []);
278
- }
279
- function jt({ defaultProp: e, onChange: n }) {
280
- const t = r.useState(e), [a] = t, i = r.useRef(a), o = et(n);
281
- return r.useEffect(() => {
282
- i.current !== a && (o(a), i.current = a);
283
- }, [
284
- a,
285
- i,
286
- o
287
- ]), t;
288
- }
289
- function tt({ prop: e, defaultProp: n, onChange: t = () => {
290
- } }) {
291
- const [a, i] = jt({
292
- defaultProp: n,
293
- onChange: t
294
- }), o = e !== void 0, g = o ? e : a, u = et(t), b = r.useCallback((T) => {
295
- if (o) {
296
- const m = typeof T == "function" ? T(e) : T;
297
- m !== e && u(m);
298
- } else
299
- i(T);
300
- }, [
301
- o,
302
- e,
303
- i,
304
- u
305
- ]);
306
- return [
307
- g,
308
- b
309
- ];
310
- }
311
- function Wt({ activeSnapPointProp: e, setActiveSnapPointProp: n, snapPoints: t, drawerRef: a, overlayRef: i, fadeFromIndex: o, onSnapPointChange: g, direction: u = "bottom", container: b, snapToSequentialPoint: T }) {
312
- const [h, m] = tt({
313
- prop: e,
314
- defaultProp: t == null ? void 0 : t[0],
315
- onChange: n
316
- }), [p, B] = r.useState(typeof window < "u" ? {
317
- innerWidth: window.innerWidth,
318
- innerHeight: window.innerHeight
319
- } : void 0);
320
- r.useEffect(() => {
321
- function c() {
322
- B({
323
- innerWidth: window.innerWidth,
324
- innerHeight: window.innerHeight
325
- });
326
- }
327
- return window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
328
- }, []);
329
- const k = r.useMemo(() => h === (t == null ? void 0 : t[t.length - 1]) || null, [
330
- t,
331
- h
332
- ]), E = r.useMemo(() => {
333
- var c;
334
- return (c = t == null ? void 0 : t.findIndex((S) => S === h)) != null ? c : null;
335
- }, [
336
- t,
337
- h
338
- ]), F = t && t.length > 0 && (o || o === 0) && !Number.isNaN(o) && t[o] === h || !t, w = r.useMemo(() => {
339
- const c = b ? {
340
- width: b.getBoundingClientRect().width,
341
- height: b.getBoundingClientRect().height
342
- } : typeof window < "u" ? {
343
- width: window.innerWidth,
344
- height: window.innerHeight
345
- } : {
346
- width: 0,
347
- height: 0
348
- };
349
- var S;
350
- return (S = t == null ? void 0 : t.map((y) => {
351
- const I = typeof y == "string";
352
- let M = 0;
353
- if (I && (M = parseInt(y, 10)), C(u)) {
354
- const l = I ? M : p ? y * c.height : 0;
355
- return p ? u === "bottom" ? c.height - l : -c.height + l : l;
356
- }
357
- const j = I ? M : p ? y * c.width : 0;
358
- return p ? u === "right" ? c.width - j : -c.width + j : j;
359
- })) != null ? S : [];
360
- }, [
361
- t,
362
- p,
363
- b
364
- ]), N = r.useMemo(() => E !== null ? w == null ? void 0 : w[E] : null, [
365
- w,
366
- E
367
- ]), A = r.useCallback((c) => {
368
- var S;
369
- const y = (S = w == null ? void 0 : w.findIndex((I) => I === c)) != null ? S : null;
370
- g(y), $(a.current, {
371
- transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
372
- transform: C(u) ? `translate3d(0, ${c}px, 0)` : `translate3d(${c}px, 0, 0)`
373
- }), w && y !== w.length - 1 && o !== void 0 && y !== o && y < o ? $(i.current, {
374
- transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
375
- opacity: "0"
376
- }) : $(i.current, {
377
- transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
378
- opacity: "1"
379
- }), m(t == null ? void 0 : t[Math.max(y, 0)]);
380
- }, [
381
- a.current,
382
- t,
383
- w,
384
- o,
385
- i,
386
- m
387
- ]);
388
- r.useEffect(() => {
389
- if (h || e) {
390
- var c;
391
- const S = (c = t == null ? void 0 : t.findIndex((y) => y === e || y === h)) != null ? c : -1;
392
- w && S !== -1 && typeof w[S] == "number" && A(w[S]);
393
- }
394
- }, [
395
- h,
396
- e,
397
- t,
398
- w,
399
- A
400
- ]);
401
- function d({ draggedDistance: c, closeDrawer: S, velocity: y, dismissible: I }) {
402
- if (o === void 0) return;
403
- const M = u === "bottom" || u === "right" ? (N ?? 0) - c : (N ?? 0) + c, j = E === o - 1, l = E === 0, U = c > 0;
404
- if (j && $(i.current, {
405
- transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`
406
- }), !T && y > 2 && !U) {
407
- I ? S() : A(w[0]);
408
- return;
409
- }
410
- if (!T && y > 2 && U && w && t) {
411
- A(w[t.length - 1]);
412
- return;
413
- }
414
- const _ = w == null ? void 0 : w.reduce((P, K) => typeof P != "number" || typeof K != "number" ? P : Math.abs(K - M) < Math.abs(P - M) ? K : P), W = C(u) ? window.innerHeight : window.innerWidth;
415
- if (y > Qe && Math.abs(c) < W * 0.4) {
416
- const P = U ? 1 : -1;
417
- if (P > 0 && k && t) {
418
- A(w[t.length - 1]);
419
- return;
420
- }
421
- if (l && P < 0 && I && S(), E === null) return;
422
- A(w[E + P]);
423
- return;
424
- }
425
- A(_);
426
- }
427
- function Y({ draggedDistance: c }) {
428
- if (N === null) return;
429
- const S = u === "bottom" || u === "right" ? N - c : N + c;
430
- (u === "bottom" || u === "right") && S < w[w.length - 1] || (u === "top" || u === "left") && S > w[w.length - 1] || $(a.current, {
431
- transform: C(u) ? `translate3d(0, ${S}px, 0)` : `translate3d(${S}px, 0, 0)`
432
- });
433
- }
434
- function ee(c, S) {
435
- if (!t || typeof E != "number" || !w || o === void 0) return null;
436
- const y = E === o - 1;
437
- if (E >= o && S)
438
- return 0;
439
- if (y && !S) return 1;
440
- if (!F && !y) return null;
441
- const M = y ? E + 1 : E - 1, j = y ? w[M] - w[M - 1] : w[M + 1] - w[M], l = c / Math.abs(j);
442
- return y ? 1 - l : l;
443
- }
444
- return {
445
- isLastSnapPoint: k,
446
- activeSnapPoint: h,
447
- shouldFade: F,
448
- getPercentageDragged: ee,
449
- setActiveSnapPoint: m,
450
- activeSnapPointIndex: E,
451
- onRelease: d,
452
- onDrag: Y,
453
- snapPointsOffset: w
454
- };
455
- }
456
- const zt = () => () => {
457
- };
458
- function Vt() {
459
- const { direction: e, isOpen: n, shouldScaleBackground: t, setBackgroundColorOnScale: a, noBodyStyles: i } = ie(), o = r.useRef(null), g = St(() => document.body.style.backgroundColor, []);
460
- function u() {
461
- return (window.innerWidth - Ne) / window.innerWidth;
462
- }
463
- r.useEffect(() => {
464
- if (n && t) {
465
- o.current && clearTimeout(o.current);
466
- const b = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
467
- if (!b) return;
468
- Bt(a && !i ? Ce(document.body, {
469
- background: "black"
470
- }) : zt, Ce(b, {
471
- transformOrigin: C(e) ? "top" : "left",
472
- transitionProperty: "transform, border-radius",
473
- transitionDuration: `${x.DURATION}s`,
474
- transitionTimingFunction: `cubic-bezier(${x.EASE.join(",")})`
475
- }));
476
- const T = Ce(b, {
477
- borderRadius: `${Ze}px`,
478
- overflow: "hidden",
479
- ...C(e) ? {
480
- transform: `scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
481
- } : {
482
- transform: `scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
483
- }
484
- });
485
- return () => {
486
- T(), o.current = window.setTimeout(() => {
487
- g ? document.body.style.background = g : document.body.style.removeProperty("background");
488
- }, x.DURATION * 1e3);
489
- };
490
- }
491
- }, [
492
- n,
493
- t,
494
- g
495
- ]);
496
- }
497
- let me = null;
498
- function Yt({ isOpen: e, modal: n, nested: t, hasBeenOpened: a, preventScrollRestoration: i, noBodyStyles: o }) {
499
- const [g, u] = r.useState(() => typeof window < "u" ? window.location.href : ""), b = r.useRef(0), T = r.useCallback(() => {
500
- if (We() && me === null && e && !o) {
501
- me = {
502
- position: document.body.style.position,
503
- top: document.body.style.top,
504
- left: document.body.style.left,
505
- height: document.body.style.height,
506
- right: "unset"
507
- };
508
- const { scrollX: m, innerHeight: p } = window;
509
- document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
510
- top: `${-b.current}px`,
511
- left: `${-m}px`,
512
- right: "0px",
513
- height: "auto"
514
- }), window.setTimeout(() => window.requestAnimationFrame(() => {
515
- const B = p - window.innerHeight;
516
- B && b.current >= p && (document.body.style.top = `${-(b.current + B)}px`);
517
- }), 300);
518
- }
519
- }, [
520
- e
521
- ]), h = r.useCallback(() => {
522
- if (We() && me !== null && !o) {
523
- const m = -parseInt(document.body.style.top, 10), p = -parseInt(document.body.style.left, 10);
524
- Object.assign(document.body.style, me), window.requestAnimationFrame(() => {
525
- if (i && g !== window.location.href) {
526
- u(window.location.href);
527
- return;
528
- }
529
- window.scrollTo(p, m);
530
- }), me = null;
531
- }
532
- }, [
533
- g
534
- ]);
535
- return r.useEffect(() => {
536
- function m() {
537
- b.current = window.scrollY;
538
- }
539
- return m(), window.addEventListener("scroll", m), () => {
540
- window.removeEventListener("scroll", m);
541
- };
542
- }, []), r.useEffect(() => {
543
- if (n)
544
- return () => {
545
- typeof document > "u" || document.querySelector("[data-vaul-drawer]") || h();
546
- };
547
- }, [
548
- n,
549
- h
550
- ]), r.useEffect(() => {
551
- t || !a || (e ? (!window.matchMedia("(display-mode: standalone)").matches && T(), n || window.setTimeout(() => {
552
- h();
553
- }, 500)) : h());
554
- }, [
555
- e,
556
- a,
557
- g,
558
- n,
559
- t,
560
- T,
561
- h
562
- ]), {
563
- restorePositionSetting: h
564
- };
565
- }
566
- function nt({ open: e, onOpenChange: n, children: t, onDrag: a, onRelease: i, snapPoints: o, shouldScaleBackground: g = !1, setBackgroundColorOnScale: u = !0, closeThreshold: b = Ft, scrollLockTimeout: T = Ut, dismissible: h = !0, handleOnly: m = !1, fadeFromIndex: p = o && o.length - 1, activeSnapPoint: B, setActiveSnapPoint: k, fixed: E, modal: F = !0, onClose: w, nested: N, noBodyStyles: A = !1, direction: d = "bottom", defaultOpen: Y = !1, disablePreventScroll: ee = !0, snapToSequentialPoint: c = !1, preventScrollRestoration: S = !1, repositionInputs: y = !0, onAnimationEnd: I, container: M, autoFocus: j = !1 }) {
567
- var l, U;
568
- const [_ = !1, W] = tt({
569
- defaultProp: Y,
570
- prop: e,
571
- onChange: (s) => {
572
- n == null || n(s), !s && !N && mt(), setTimeout(() => {
573
- I == null || I(s);
574
- }, x.DURATION * 1e3), s && !F && typeof window < "u" && window.requestAnimationFrame(() => {
575
- document.body.style.pointerEvents = "auto";
576
- }), s || (document.body.style.pointerEvents = "auto");
577
- }
578
- }), [P, K] = r.useState(!1), [G, se] = r.useState(!1), [st, Pe] = r.useState(!1), ne = r.useRef(null), we = r.useRef(null), Se = r.useRef(null), Re = r.useRef(null), le = r.useRef(null), ue = r.useRef(!1), De = r.useRef(null), Te = r.useRef(0), re = r.useRef(!1), Ie = r.useRef(!Y), _e = r.useRef(0), f = r.useRef(null), He = r.useRef(((l = f.current) == null ? void 0 : l.getBoundingClientRect().height) || 0), ke = r.useRef(((U = f.current) == null ? void 0 : U.getBoundingClientRect().width) || 0), Ee = r.useRef(0), lt = r.useCallback((s) => {
579
- o && s === ce.length - 1 && (we.current = /* @__PURE__ */ new Date());
580
- }, []), { activeSnapPoint: ut, activeSnapPointIndex: ae, setActiveSnapPoint: Le, onRelease: ct, snapPointsOffset: ce, onDrag: dt, shouldFade: Be, getPercentageDragged: ft } = Wt({
581
- snapPoints: o,
582
- activeSnapPointProp: B,
583
- setActiveSnapPointProp: k,
584
- drawerRef: f,
585
- fadeFromIndex: p,
586
- overlayRef: ne,
587
- onSnapPointChange: lt,
588
- direction: d,
589
- container: M,
590
- snapToSequentialPoint: c
591
- });
592
- Mt({
593
- isDisabled: !_ || G || !F || st || !P || !y || !ee
594
- });
595
- const { restorePositionSetting: mt } = Yt({
596
- isOpen: _,
597
- modal: F,
598
- nested: N ?? !1,
599
- hasBeenOpened: P,
600
- preventScrollRestoration: S,
601
- noBodyStyles: A
602
- });
603
- function he() {
604
- return (window.innerWidth - Ne) / window.innerWidth;
605
- }
606
- function pt(s) {
607
- var R, D;
608
- !h && !o || f.current && !f.current.contains(s.target) || (He.current = ((R = f.current) == null ? void 0 : R.getBoundingClientRect().height) || 0, ke.current = ((D = f.current) == null ? void 0 : D.getBoundingClientRect().width) || 0, se(!0), Se.current = /* @__PURE__ */ new Date(), Xe() && window.addEventListener("touchend", () => ue.current = !1, {
609
- once: !0
610
- }), s.target.setPointerCapture(s.pointerId), Te.current = C(d) ? s.pageY : s.pageX);
611
- }
612
- function Fe(s, R) {
613
- var D;
614
- let v = s;
615
- const O = (D = window.getSelection()) == null ? void 0 : D.toString(), L = f.current ? ye(f.current, d) : null, H = /* @__PURE__ */ new Date();
616
- if (v.tagName === "SELECT" || v.hasAttribute("data-vaul-no-drag") || v.closest("[data-vaul-no-drag]"))
617
- return !1;
618
- if (d === "right" || d === "left")
619
- return !0;
620
- if (we.current && H.getTime() - we.current.getTime() < 500)
621
- return !1;
622
- if (L !== null && (d === "bottom" ? L > 0 : L < 0))
623
- return !0;
624
- if (O && O.length > 0)
625
- return !1;
626
- if (le.current && H.getTime() - le.current.getTime() < T && L === 0 || R)
627
- return le.current = H, !1;
628
- for (; v; ) {
629
- if (v.scrollHeight > v.clientHeight) {
630
- if (v.scrollTop !== 0)
631
- return le.current = /* @__PURE__ */ new Date(), !1;
632
- if (v.getAttribute("role") === "dialog")
633
- return !0;
634
- }
635
- v = v.parentNode;
636
- }
637
- return !0;
638
- }
639
- function wt(s) {
640
- if (f.current && G) {
641
- const R = d === "bottom" || d === "right" ? 1 : -1, D = (Te.current - (C(d) ? s.pageY : s.pageX)) * R, v = D > 0, O = o && !h && !v;
642
- if (O && ae === 0) return;
643
- const L = Math.abs(D), H = document.querySelector("[data-vaul-drawer-wrapper]"), J = d === "bottom" || d === "top" ? He.current : ke.current;
644
- let z = L / J;
645
- const te = ft(L, v);
646
- if (te !== null && (z = te), O && z >= 1 || !ue.current && !Fe(s.target, v)) return;
647
- if (f.current.classList.add($e), ue.current = !0, $(f.current, {
648
- transition: "none"
649
- }), $(ne.current, {
650
- transition: "none"
651
- }), o && dt({
652
- draggedDistance: D
653
- }), v && !o) {
654
- const q = Lt(D), ge = Math.min(q * -1, 0) * R;
655
- $(f.current, {
656
- transform: C(d) ? `translate3d(0, ${ge}px, 0)` : `translate3d(${ge}px, 0, 0)`
657
- });
658
- return;
659
- }
660
- const Q = 1 - z;
661
- if ((Be || p && ae === p - 1) && (a == null || a(s, z), $(ne.current, {
662
- opacity: `${Q}`,
663
- transition: "none"
664
- }, !0)), H && ne.current && g) {
665
- const q = Math.min(he() + z * (1 - he()), 1), ge = 8 - z * 8, je = Math.max(0, 14 - z * 14);
666
- $(H, {
667
- borderRadius: `${ge}px`,
668
- transform: C(d) ? `scale(${q}) translate3d(0, ${je}px, 0)` : `scale(${q}) translate3d(${je}px, 0, 0)`,
669
- transition: "none"
670
- }, !0);
671
- }
672
- if (!o) {
673
- const q = L * R;
674
- $(f.current, {
675
- transform: C(d) ? `translate3d(0, ${q}px, 0)` : `translate3d(${q}px, 0, 0)`
676
- });
677
- }
678
- }
679
- }
680
- r.useEffect(() => {
681
- window.requestAnimationFrame(() => {
682
- Ie.current = !0;
683
- });
684
- }, []), r.useEffect(() => {
685
- var s;
686
- function R() {
687
- if (!f.current || !y) return;
688
- const D = document.activeElement;
689
- if (Ae(D) || re.current) {
690
- var v;
691
- const O = ((v = window.visualViewport) == null ? void 0 : v.height) || 0, L = window.innerHeight;
692
- let H = L - O;
693
- const J = f.current.getBoundingClientRect().height || 0, z = J > L * 0.8;
694
- Ee.current || (Ee.current = J);
695
- const te = f.current.getBoundingClientRect().top;
696
- if (Math.abs(_e.current - H) > 60 && (re.current = !re.current), o && o.length > 0 && ce && ae) {
697
- const Q = ce[ae] || 0;
698
- H += Q;
699
- }
700
- if (_e.current = H, J > O || re.current) {
701
- const Q = f.current.getBoundingClientRect().height;
702
- let q = Q;
703
- Q > O && (q = O - (z ? te : Ne)), E ? f.current.style.height = `${Q - Math.max(H, 0)}px` : f.current.style.height = `${Math.max(q, O - te)}px`;
704
- } else Et() || (f.current.style.height = `${Ee.current}px`);
705
- o && o.length > 0 && !re.current ? f.current.style.bottom = "0px" : f.current.style.bottom = `${Math.max(H, 0)}px`;
706
- }
707
- }
708
- return (s = window.visualViewport) == null || s.addEventListener("resize", R), () => {
709
- var D;
710
- return (D = window.visualViewport) == null ? void 0 : D.removeEventListener("resize", R);
711
- };
712
- }, [
713
- ae,
714
- o,
715
- ce
716
- ]);
717
- function de(s) {
718
- ht(), w == null || w(), s || W(!1), setTimeout(() => {
719
- o && Le(o[0]);
720
- }, x.DURATION * 1e3);
721
- }
722
- function Ue() {
723
- if (!f.current) return;
724
- const s = document.querySelector("[data-vaul-drawer-wrapper]"), R = ye(f.current, d);
725
- $(f.current, {
726
- transform: "translate3d(0, 0, 0)",
727
- transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`
728
- }), $(ne.current, {
729
- transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
730
- opacity: "1"
731
- }), g && R && R > 0 && _ && $(s, {
732
- borderRadius: `${Ze}px`,
733
- overflow: "hidden",
734
- ...C(d) ? {
735
- transform: `scale(${he()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
736
- transformOrigin: "top"
737
- } : {
738
- transform: `scale(${he()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
739
- transformOrigin: "left"
740
- },
741
- transitionProperty: "transform, border-radius",
742
- transitionDuration: `${x.DURATION}s`,
743
- transitionTimingFunction: `cubic-bezier(${x.EASE.join(",")})`
744
- }, !0);
745
- }
746
- function ht() {
747
- !G || !f.current || (f.current.classList.remove($e), ue.current = !1, se(!1), Re.current = /* @__PURE__ */ new Date());
748
- }
749
- function gt(s) {
750
- if (!G || !f.current) return;
751
- f.current.classList.remove($e), ue.current = !1, se(!1), Re.current = /* @__PURE__ */ new Date();
752
- const R = ye(f.current, d);
753
- if (!s || !Fe(s.target, !1) || !R || Number.isNaN(R) || Se.current === null) return;
754
- const D = Re.current.getTime() - Se.current.getTime(), v = Te.current - (C(d) ? s.pageY : s.pageX), O = Math.abs(v) / D;
755
- if (O > 0.05 && (Pe(!0), setTimeout(() => {
756
- Pe(!1);
757
- }, 200)), o) {
758
- ct({
759
- draggedDistance: v * (d === "bottom" || d === "right" ? 1 : -1),
760
- closeDrawer: de,
761
- velocity: O,
762
- dismissible: h
763
- }), i == null || i(s, !0);
764
- return;
765
- }
766
- if (d === "bottom" || d === "right" ? v > 0 : v < 0) {
767
- Ue(), i == null || i(s, !0);
768
- return;
769
- }
770
- if (O > Qe) {
771
- de(), i == null || i(s, !1);
772
- return;
773
- }
774
- var L;
775
- const H = Math.min((L = f.current.getBoundingClientRect().height) != null ? L : 0, window.innerHeight);
776
- var J;
777
- const z = Math.min((J = f.current.getBoundingClientRect().width) != null ? J : 0, window.innerWidth), te = d === "left" || d === "right";
778
- if (Math.abs(R) >= (te ? z : H) * b) {
779
- de(), i == null || i(s, !1);
780
- return;
781
- }
782
- i == null || i(s, !0), Ue();
783
- }
784
- r.useEffect(() => (_ && ($(document.documentElement, {
785
- scrollBehavior: "auto"
786
- }), we.current = /* @__PURE__ */ new Date()), () => {
787
- kt(document.documentElement, "scrollBehavior");
788
- }), [
789
- _
790
- ]);
791
- function vt(s) {
792
- const R = s ? (window.innerWidth - be) / window.innerWidth : 1, D = s ? -16 : 0;
793
- De.current && window.clearTimeout(De.current), $(f.current, {
794
- transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
795
- transform: C(d) ? `scale(${R}) translate3d(0, ${D}px, 0)` : `scale(${R}) translate3d(${D}px, 0, 0)`
796
- }), !s && f.current && (De.current = setTimeout(() => {
797
- const v = ye(f.current, d);
798
- $(f.current, {
799
- transition: "none",
800
- transform: C(d) ? `translate3d(0, ${v}px, 0)` : `translate3d(${v}px, 0, 0)`
801
- });
802
- }, 500));
803
- }
804
- function yt(s, R) {
805
- if (R < 0) return;
806
- const D = (window.innerWidth - be) / window.innerWidth, v = D + R * (1 - D), O = -16 + R * be;
807
- $(f.current, {
808
- transform: C(d) ? `scale(${v}) translate3d(0, ${O}px, 0)` : `scale(${v}) translate3d(${O}px, 0, 0)`,
809
- transition: "none"
810
- });
811
- }
812
- function bt(s, R) {
813
- const D = C(d) ? window.innerHeight : window.innerWidth, v = R ? (D - be) / D : 1, O = R ? -16 : 0;
814
- R && $(f.current, {
815
- transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
816
- transform: C(d) ? `scale(${v}) translate3d(0, ${O}px, 0)` : `scale(${v}) translate3d(${O}px, 0, 0)`
817
- });
818
- }
819
- return r.useEffect(() => {
820
- F || window.requestAnimationFrame(() => {
821
- document.body.style.pointerEvents = "auto";
822
- });
823
- }, [
824
- F
825
- ]), /* @__PURE__ */ r.createElement(Z.Root, {
826
- defaultOpen: Y,
827
- onOpenChange: (s) => {
828
- !h && !s || (s ? K(!0) : de(!0), W(s));
829
- },
830
- open: _
831
- }, /* @__PURE__ */ r.createElement(qe.Provider, {
832
- value: {
833
- activeSnapPoint: ut,
834
- snapPoints: o,
835
- setActiveSnapPoint: Le,
836
- drawerRef: f,
837
- overlayRef: ne,
838
- onOpenChange: n,
839
- onPress: pt,
840
- onRelease: gt,
841
- onDrag: wt,
842
- dismissible: h,
843
- shouldAnimate: Ie,
844
- handleOnly: m,
845
- isOpen: _,
846
- isDragging: G,
847
- shouldFade: Be,
848
- closeDrawer: de,
849
- onNestedDrag: yt,
850
- onNestedOpenChange: vt,
851
- onNestedRelease: bt,
852
- keyboardIsOpen: re,
853
- modal: F,
854
- snapPointsOffset: ce,
855
- activeSnapPointIndex: ae,
856
- direction: d,
857
- shouldScaleBackground: g,
858
- setBackgroundColorOnScale: u,
859
- noBodyStyles: A,
860
- container: M,
861
- autoFocus: j
862
- }
863
- }, t));
864
- }
865
- const rt = /* @__PURE__ */ r.forwardRef(function({ ...e }, n) {
866
- const { overlayRef: t, snapPoints: a, onRelease: i, shouldFade: o, isOpen: g, modal: u, shouldAnimate: b } = ie(), T = Ge(n, t), h = a && a.length > 0;
867
- if (!u)
868
- return null;
869
- const m = r.useCallback((p) => i(p), [
870
- i
871
- ]);
872
- return /* @__PURE__ */ r.createElement(Z.Overlay, {
873
- onMouseUp: m,
874
- ref: T,
875
- "data-vaul-overlay": "",
876
- "data-vaul-snap-points": g && h ? "true" : "false",
877
- "data-vaul-snap-points-overlay": g && o ? "true" : "false",
878
- "data-vaul-animate": b != null && b.current ? "true" : "false",
879
- ...e
880
- });
881
- });
882
- rt.displayName = "Drawer.Overlay";
883
- const at = /* @__PURE__ */ r.forwardRef(function({ onPointerDownOutside: e, style: n, onOpenAutoFocus: t, ...a }, i) {
884
- const { drawerRef: o, onPress: g, onRelease: u, onDrag: b, keyboardIsOpen: T, snapPointsOffset: h, activeSnapPointIndex: m, modal: p, isOpen: B, direction: k, snapPoints: E, container: F, handleOnly: w, shouldAnimate: N, autoFocus: A } = ie(), [d, Y] = r.useState(!1), ee = Ge(i, o), c = r.useRef(null), S = r.useRef(null), y = r.useRef(!1), I = E && E.length > 0;
885
- Vt();
886
- const M = (l, U, _ = 0) => {
887
- if (y.current) return !0;
888
- const W = Math.abs(l.y), P = Math.abs(l.x), K = P > W, G = [
889
- "bottom",
890
- "right"
891
- ].includes(U) ? 1 : -1;
892
- if (U === "left" || U === "right") {
893
- if (!(l.x * G < 0) && P >= 0 && P <= _)
894
- return K;
895
- } else if (!(l.y * G < 0) && W >= 0 && W <= _)
896
- return !K;
897
- return y.current = !0, !0;
898
- };
899
- r.useEffect(() => {
900
- I && window.requestAnimationFrame(() => {
901
- Y(!0);
902
- });
903
- }, []);
904
- function j(l) {
905
- c.current = null, y.current = !1, u(l);
906
- }
907
- return /* @__PURE__ */ r.createElement(Z.Content, {
908
- "data-vaul-drawer-direction": k,
909
- "data-vaul-drawer": "",
910
- "data-vaul-delayed-snap-points": d ? "true" : "false",
911
- "data-vaul-snap-points": B && I ? "true" : "false",
912
- "data-vaul-custom-container": F ? "true" : "false",
913
- "data-vaul-animate": N != null && N.current ? "true" : "false",
914
- ...a,
915
- ref: ee,
916
- style: h && h.length > 0 ? {
917
- "--snap-point-height": `${h[m ?? 0]}px`,
918
- ...n
919
- } : n,
920
- onPointerDown: (l) => {
921
- w || (a.onPointerDown == null || a.onPointerDown.call(a, l), c.current = {
922
- x: l.pageX,
923
- y: l.pageY
924
- }, g(l));
925
- },
926
- onOpenAutoFocus: (l) => {
927
- t == null || t(l), A || l.preventDefault();
928
- },
929
- onPointerDownOutside: (l) => {
930
- if (e == null || e(l), !p || l.defaultPrevented) {
931
- l.preventDefault();
932
- return;
933
- }
934
- T.current && (T.current = !1);
935
- },
936
- onFocusOutside: (l) => {
937
- if (!p) {
938
- l.preventDefault();
939
- return;
940
- }
941
- },
942
- onPointerMove: (l) => {
943
- if (S.current = l, w || (a.onPointerMove == null || a.onPointerMove.call(a, l), !c.current)) return;
944
- const U = l.pageY - c.current.y, _ = l.pageX - c.current.x, W = l.pointerType === "touch" ? 10 : 2;
945
- M({
946
- x: _,
947
- y: U
948
- }, k, W) ? b(l) : (Math.abs(_) > W || Math.abs(U) > W) && (c.current = null);
949
- },
950
- onPointerUp: (l) => {
951
- a.onPointerUp == null || a.onPointerUp.call(a, l), c.current = null, y.current = !1, u(l);
952
- },
953
- onPointerOut: (l) => {
954
- a.onPointerOut == null || a.onPointerOut.call(a, l), j(S.current);
955
- },
956
- onContextMenu: (l) => {
957
- a.onContextMenu == null || a.onContextMenu.call(a, l), S.current && j(S.current);
958
- }
959
- });
960
- });
961
- at.displayName = "Drawer.Content";
962
- const qt = 250, Xt = 120, ot = /* @__PURE__ */ r.forwardRef(function({ preventCycle: e = !1, children: n, ...t }, a) {
963
- const { closeDrawer: i, isDragging: o, snapPoints: g, activeSnapPoint: u, setActiveSnapPoint: b, dismissible: T, handleOnly: h, isOpen: m, onPress: p, onDrag: B } = ie(), k = r.useRef(null), E = r.useRef(!1);
964
- function F() {
965
- if (E.current) {
966
- A();
967
- return;
968
- }
969
- window.setTimeout(() => {
970
- w();
971
- }, Xt);
972
- }
973
- function w() {
974
- if (o || e || E.current) {
975
- A();
976
- return;
977
- }
978
- if (A(), !g || g.length === 0) {
979
- T || i();
980
- return;
981
- }
982
- if (u === g[g.length - 1] && T) {
983
- i();
984
- return;
985
- }
986
- const Y = g.findIndex((c) => c === u);
987
- if (Y === -1) return;
988
- const ee = g[Y + 1];
989
- b(ee);
990
- }
991
- function N() {
992
- k.current = window.setTimeout(() => {
993
- E.current = !0;
994
- }, qt);
995
- }
996
- function A() {
997
- k.current && window.clearTimeout(k.current), E.current = !1;
998
- }
999
- return /* @__PURE__ */ r.createElement("div", {
1000
- onClick: F,
1001
- onPointerCancel: A,
1002
- onPointerDown: (d) => {
1003
- h && p(d), N();
1004
- },
1005
- onPointerMove: (d) => {
1006
- h && B(d);
1007
- },
1008
- // onPointerUp is already handled by the content component
1009
- ref: a,
1010
- "data-vaul-drawer-visible": m ? "true" : "false",
1011
- "data-vaul-handle": "",
1012
- "aria-hidden": "true",
1013
- ...t
1014
- }, /* @__PURE__ */ r.createElement("span", {
1015
- "data-vaul-handle-hitarea": "",
1016
- "aria-hidden": "true"
1017
- }, n));
1018
- });
1019
- ot.displayName = "Drawer.Handle";
1020
- function Kt({ onDrag: e, onOpenChange: n, open: t, ...a }) {
1021
- const { onNestedDrag: i, onNestedOpenChange: o, onNestedRelease: g } = ie();
1022
- if (!i)
1023
- throw new Error("Drawer.NestedRoot must be placed in another drawer");
1024
- return /* @__PURE__ */ r.createElement(nt, {
1025
- nested: !0,
1026
- open: t,
1027
- onClose: () => {
1028
- o(!1);
1029
- },
1030
- onDrag: (u, b) => {
1031
- i(u, b), e == null || e(u, b);
1032
- },
1033
- onOpenChange: (u) => {
1034
- u && o(u), n == null || n(u);
1035
- },
1036
- onRelease: g,
1037
- ...a
1038
- });
1039
- }
1040
- function Gt(e) {
1041
- const n = ie(), { container: t = n.container, ...a } = e;
1042
- return /* @__PURE__ */ r.createElement(Z.Portal, {
1043
- container: t,
1044
- ...a
1045
- });
1046
- }
1047
- const V = {
1048
- Root: nt,
1049
- NestedRoot: Kt,
1050
- Content: at,
1051
- Overlay: rt,
1052
- Trigger: Z.Trigger,
1053
- Portal: Gt,
1054
- Handle: ot,
1055
- Close: Z.Close,
1056
- Title: Z.Title,
1057
- Description: Z.Description
1058
- }, Jt = ({
1059
- shouldScaleBackground: e = !0,
1060
- ...n
1061
- }) => /* @__PURE__ */ X.jsx(
1062
- V.Root,
1063
- {
1064
- shouldScaleBackground: e,
1065
- ...n
1066
- }
1067
- );
1068
- Jt.displayName = "Drawer";
1069
- const ln = V.Trigger, Qt = V.Portal, un = V.Close, it = pe.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ X.jsx(
1070
- V.Overlay,
1071
- {
1072
- ref: t,
1073
- className: oe("fixed inset-0 z-50 bg-black/80", e),
1074
- ...n
1075
- }
1076
- ));
1077
- it.displayName = V.Overlay.displayName;
1078
- const Zt = pe.forwardRef(
1079
- ({ className: e, children: n, hideBar: t = !0, ...a }, i) => /* @__PURE__ */ X.jsxs(Qt, { children: [
1080
- /* @__PURE__ */ X.jsx(it, {}),
1081
- /* @__PURE__ */ X.jsxs(
1082
- V.Content,
1083
- {
1084
- ref: i,
1085
- className: oe(
1086
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
1087
- e
1088
- ),
1089
- ...a,
1090
- children: [
1091
- !t && /* @__PURE__ */ X.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
1092
- n
1093
- ]
1094
- }
1095
- )
1096
- ] })
1097
- );
1098
- Zt.displayName = "DrawerContent";
1099
- const en = ({
1100
- className: e,
1101
- ...n
1102
- }) => /* @__PURE__ */ X.jsx(
1103
- "div",
1104
- {
1105
- className: oe("grid gap-1.5 p-4 text-center sm:text-left", e),
1106
- ...n
1107
- }
1108
- );
1109
- en.displayName = "DrawerHeader";
1110
- const tn = ({
1111
- className: e,
1112
- ...n
1113
- }) => /* @__PURE__ */ X.jsx(
1114
- "div",
1115
- {
1116
- className: oe("mt-auto flex flex-col gap-2 p-4", e),
1117
- ...n
1118
- }
1119
- );
1120
- tn.displayName = "DrawerFooter";
1121
- const nn = pe.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ X.jsx(
1122
- V.Title,
1123
- {
1124
- ref: t,
1125
- className: oe(
1126
- "text-lg font-semibold leading-none tracking-tight",
1127
- e
1128
- ),
1129
- ...n
1130
- }
1131
- ));
1132
- nn.displayName = V.Title.displayName;
1133
- const rn = pe.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ X.jsx(
1134
- V.Description,
1135
- {
1136
- ref: t,
1137
- className: oe("text-sm text-muted-foreground", e),
1138
- ...n
1139
- }
1140
- ));
1141
- rn.displayName = V.Description.displayName;
1
+ import "../jsx-runtime-CYK1ROHF.js";
2
+ import "react";
3
+ import { D as o, e as t, b as w, f as i, g as p, h as l, i as m, j as g, c as n, a as c } from "../Drawer-kDAfOq_2.js";
4
+ import "../cn-qaFjX9_3.js";
1142
5
  export {
1143
- Jt as Drawer,
1144
- un as DrawerClose,
1145
- Zt as DrawerContent,
1146
- rn as DrawerDescription,
1147
- tn as DrawerFooter,
1148
- en as DrawerHeader,
1149
- it as DrawerOverlay,
1150
- Qt as DrawerPortal,
1151
- nn as DrawerTitle,
1152
- ln as DrawerTrigger
6
+ o as Drawer,
7
+ t as DrawerClose,
8
+ w as DrawerContent,
9
+ i as DrawerDescription,
10
+ p as DrawerFooter,
11
+ l as DrawerHeader,
12
+ m as DrawerOverlay,
13
+ g as DrawerPortal,
14
+ n as DrawerTitle,
15
+ c as DrawerTrigger
1153
16
  };
1154
17
  //# sourceMappingURL=Drawer.js.map