zudoku 0.13.5 → 0.13.7

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 (286) hide show
  1. package/dist/app/main.js +1 -1
  2. package/dist/app/main.js.map +1 -1
  3. package/dist/lib/authentication/components/CallbackHandler.js +21 -31
  4. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  5. package/dist/lib/errors/ErrorAlert.d.ts +1 -1
  6. package/dist/lib/errors/ErrorAlert.js +8 -3
  7. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  8. package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
  9. package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
  10. package/dist/lib/plugins/openapi/Sidecar.js +2 -2
  11. package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
  12. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  13. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
  14. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  15. package/dist/lib/ui/Accordion.d.ts +7 -0
  16. package/dist/lib/ui/Accordion.js +14 -0
  17. package/dist/lib/ui/Accordion.js.map +1 -0
  18. package/dist/lib/ui/Alert.d.ts +8 -0
  19. package/dist/lib/ui/Alert.js +23 -0
  20. package/dist/lib/ui/Alert.js.map +1 -0
  21. package/dist/lib/ui/AlertDialog.d.ts +20 -0
  22. package/dist/lib/ui/AlertDialog.js +27 -0
  23. package/dist/lib/ui/AlertDialog.js.map +1 -0
  24. package/dist/lib/ui/AspectRatio.d.ts +3 -0
  25. package/dist/lib/ui/AspectRatio.js +4 -0
  26. package/dist/lib/ui/AspectRatio.js.map +1 -0
  27. package/dist/lib/ui/Badge.d.ts +9 -0
  28. package/dist/lib/ui/Badge.js +21 -0
  29. package/dist/lib/ui/Badge.js.map +1 -0
  30. package/dist/lib/ui/Breadcrumb.d.ts +19 -0
  31. package/dist/lib/ui/Breadcrumb.js +24 -0
  32. package/dist/lib/ui/Breadcrumb.js.map +1 -0
  33. package/dist/lib/ui/Button.d.ts +1 -2
  34. package/dist/lib/ui/Button.js +1 -1
  35. package/dist/lib/ui/Button.js.map +1 -1
  36. package/dist/lib/ui/Carousel.d.ts +18 -0
  37. package/dist/lib/ui/Carousel.js +99 -0
  38. package/dist/lib/ui/Carousel.js.map +1 -0
  39. package/dist/lib/ui/Checkbox.d.ts +4 -0
  40. package/dist/lib/ui/Checkbox.js +9 -0
  41. package/dist/lib/ui/Checkbox.js.map +1 -0
  42. package/dist/lib/ui/Collapsible.d.ts +5 -0
  43. package/dist/lib/ui/Collapsible.js +6 -0
  44. package/dist/lib/ui/Collapsible.js.map +1 -0
  45. package/dist/lib/{components → ui}/Dialog.js +2 -2
  46. package/dist/lib/ui/Dialog.js.map +1 -0
  47. package/dist/lib/ui/Form.d.ts +23 -0
  48. package/dist/lib/ui/Form.js +63 -0
  49. package/dist/lib/ui/Form.js.map +1 -0
  50. package/dist/lib/ui/HoverCard.d.ts +6 -0
  51. package/dist/lib/ui/HoverCard.js +10 -0
  52. package/dist/lib/ui/HoverCard.js.map +1 -0
  53. package/dist/lib/ui/Label.d.ts +5 -0
  54. package/dist/lib/ui/Label.js +10 -0
  55. package/dist/lib/ui/Label.js.map +1 -0
  56. package/dist/lib/ui/Pagination.d.ts +28 -0
  57. package/dist/lib/ui/Pagination.js +24 -0
  58. package/dist/lib/ui/Pagination.js.map +1 -0
  59. package/dist/lib/ui/Popover.d.ts +6 -0
  60. package/dist/lib/ui/Popover.js +10 -0
  61. package/dist/lib/ui/Popover.js.map +1 -0
  62. package/dist/lib/ui/Progress.d.ts +4 -0
  63. package/dist/lib/ui/Progress.js +8 -0
  64. package/dist/lib/ui/Progress.js.map +1 -0
  65. package/dist/lib/ui/RadioGroup.d.ts +5 -0
  66. package/dist/lib/ui/RadioGroup.js +15 -0
  67. package/dist/lib/ui/RadioGroup.js.map +1 -0
  68. package/dist/lib/ui/ScrollArea.d.ts +5 -0
  69. package/dist/lib/ui/ScrollArea.js +12 -0
  70. package/dist/lib/ui/ScrollArea.js.map +1 -0
  71. package/dist/lib/ui/Select.js.map +1 -0
  72. package/dist/lib/ui/Skeleton.d.ts +2 -0
  73. package/dist/lib/ui/Skeleton.js +7 -0
  74. package/dist/lib/ui/Skeleton.js.map +1 -0
  75. package/dist/lib/ui/Slider.d.ts +4 -0
  76. package/dist/lib/ui/Slider.js +8 -0
  77. package/dist/lib/ui/Slider.js.map +1 -0
  78. package/dist/lib/ui/Switch.d.ts +4 -0
  79. package/dist/lib/ui/Switch.js +8 -0
  80. package/dist/lib/ui/Switch.js.map +1 -0
  81. package/dist/lib/ui/Textarea.d.ts +4 -0
  82. package/dist/lib/ui/Textarea.js +9 -0
  83. package/dist/lib/ui/Textarea.js.map +1 -0
  84. package/dist/lib/ui/Toggle.d.ts +12 -0
  85. package/dist/lib/ui/Toggle.js +26 -0
  86. package/dist/lib/ui/Toggle.js.map +1 -0
  87. package/dist/lib/ui/ToggleGroup.d.ts +12 -0
  88. package/dist/lib/ui/ToggleGroup.js +21 -0
  89. package/dist/lib/ui/ToggleGroup.js.map +1 -0
  90. package/dist/lib/ui/Tooltip.d.ts +7 -0
  91. package/dist/lib/ui/Tooltip.js +11 -0
  92. package/dist/lib/ui/Tooltip.js.map +1 -0
  93. package/dist/lib/util/invariant.d.ts +9 -0
  94. package/dist/lib/util/invariant.js +7 -3
  95. package/dist/lib/util/invariant.js.map +1 -1
  96. package/dist/vite/plugin-component.js +17 -7
  97. package/dist/vite/plugin-component.js.map +1 -1
  98. package/lib/{AuthenticationPlugin-D1nhROkO.js → AuthenticationPlugin-Bpdes0cJ.js} +3 -3
  99. package/lib/{AuthenticationPlugin-D1nhROkO.js.map → AuthenticationPlugin-Bpdes0cJ.js.map} +1 -1
  100. package/lib/{CategoryHeading-B7TlPvuN.js → CategoryHeading-Bb9dqxD3.js} +4 -4
  101. package/lib/{CategoryHeading-B7TlPvuN.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
  102. package/lib/{DeveloperHint-B_QCCafl.js → DeveloperHint-DHdLXGHA.js} +2 -2
  103. package/lib/{DeveloperHint-B_QCCafl.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
  104. package/lib/{Markdown-Y__eLG0x.js → Markdown-1BO9EA_X.js} +4265 -6649
  105. package/lib/Markdown-1BO9EA_X.js.map +1 -0
  106. package/lib/{MdxPage-B4FcPIi5.js → MdxPage-BEOcOICU.js} +28 -27
  107. package/lib/{MdxPage-B4FcPIi5.js.map → MdxPage-BEOcOICU.js.map} +1 -1
  108. package/lib/{OperationList-C2jKCTwZ.js → OperationList-Cea2Yt8e.js} +131 -128
  109. package/lib/{OperationList-C2jKCTwZ.js.map → OperationList-Cea2Yt8e.js.map} +1 -1
  110. package/lib/{Route-DWXcQzRK.js → Route-BHT-onwf.js} +3 -3
  111. package/lib/{Route-DWXcQzRK.js.map → Route-BHT-onwf.js.map} +1 -1
  112. package/lib/Select-m1aXZGAP.js +223 -0
  113. package/lib/Select-m1aXZGAP.js.map +1 -0
  114. package/lib/SlotletProvider-CPfsBw39.js +241 -0
  115. package/lib/SlotletProvider-CPfsBw39.js.map +1 -0
  116. package/lib/Spinner-C6zroowC.js +40 -0
  117. package/lib/Spinner-C6zroowC.js.map +1 -0
  118. package/lib/StaggeredRender-DDHSzQKE.js +17 -0
  119. package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
  120. package/lib/{ZudokuContext-MRoel6bS.js → ZudokuContext-D1D8Anlj.js} +20 -20
  121. package/lib/{ZudokuContext-MRoel6bS.js.map → ZudokuContext-D1D8Anlj.js.map} +1 -1
  122. package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
  123. package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
  124. package/lib/cn-BmFQLtkS.js +2279 -0
  125. package/lib/cn-BmFQLtkS.js.map +1 -0
  126. package/lib/hook-JSRuxV1P.js +229 -0
  127. package/lib/hook-JSRuxV1P.js.map +1 -0
  128. package/lib/index-Bn6Lc9tq.js +9 -0
  129. package/lib/{index-DJqnphbT.js.map → index-Bn6Lc9tq.js.map} +1 -1
  130. package/lib/index-BuAyrJe3.js +46 -0
  131. package/lib/index-BuAyrJe3.js.map +1 -0
  132. package/lib/{index-DFN92YJN.js → index-CRo94sKK.js} +5 -4
  133. package/lib/{index-DFN92YJN.js.map → index-CRo94sKK.js.map} +1 -1
  134. package/lib/{index-Dso_b0di.js → index-Cj-F-4ME.js} +1207 -1424
  135. package/lib/index-Cj-F-4ME.js.map +1 -0
  136. package/lib/{index-D06ATMgg.js → index-LNp6rxyU.js} +2 -2
  137. package/lib/{index-D06ATMgg.js.map → index-LNp6rxyU.js.map} +1 -1
  138. package/lib/index.esm-C5mr_sKO.js +1193 -0
  139. package/lib/index.esm-C5mr_sKO.js.map +1 -0
  140. package/lib/invariant-Caa8-XvF.js +26 -0
  141. package/lib/invariant-Caa8-XvF.js.map +1 -0
  142. package/lib/ui/Accordion.js +47 -0
  143. package/lib/ui/Accordion.js.map +1 -0
  144. package/lib/ui/Alert.js +51 -0
  145. package/lib/ui/Alert.js.map +1 -0
  146. package/lib/ui/AlertDialog.js +114 -0
  147. package/lib/ui/AlertDialog.js.map +1 -0
  148. package/lib/ui/AspectRatio.js +6 -0
  149. package/lib/ui/AspectRatio.js.map +1 -0
  150. package/lib/ui/Badge.js +27 -0
  151. package/lib/ui/Badge.js.map +1 -0
  152. package/lib/ui/Breadcrumb.js +94 -0
  153. package/lib/ui/Breadcrumb.js.map +1 -0
  154. package/lib/ui/Button.js +49 -0
  155. package/lib/ui/Button.js.map +1 -0
  156. package/lib/ui/Callout.js +77 -0
  157. package/lib/ui/Callout.js.map +1 -0
  158. package/lib/ui/Card.js +62 -0
  159. package/lib/ui/Card.js.map +1 -0
  160. package/lib/ui/Carousel.js +1410 -0
  161. package/lib/ui/Carousel.js.map +1 -0
  162. package/lib/ui/Checkbox.js +28 -0
  163. package/lib/ui/Checkbox.js.map +1 -0
  164. package/lib/ui/Collapsible.js +8 -0
  165. package/lib/ui/Collapsible.js.map +1 -0
  166. package/lib/ui/Dialog.js +101 -0
  167. package/lib/ui/Dialog.js.map +1 -0
  168. package/lib/ui/Drawer.js +1153 -0
  169. package/lib/ui/Drawer.js.map +1 -0
  170. package/lib/ui/DropdownMenu.js +145 -0
  171. package/lib/ui/DropdownMenu.js.map +1 -0
  172. package/lib/ui/Form.js +95 -0
  173. package/lib/ui/Form.js.map +1 -0
  174. package/lib/ui/HoverCard.js +24 -0
  175. package/lib/ui/HoverCard.js.map +1 -0
  176. package/lib/ui/Input.js +22 -0
  177. package/lib/ui/Input.js.map +1 -0
  178. package/lib/ui/Label.js +20 -0
  179. package/lib/ui/Label.js.map +1 -0
  180. package/lib/ui/Note.js +51 -0
  181. package/lib/ui/Note.js.map +1 -0
  182. package/lib/ui/Pagination.js +106 -0
  183. package/lib/ui/Pagination.js.map +1 -0
  184. package/lib/ui/Popover.js +24 -0
  185. package/lib/ui/Popover.js.map +1 -0
  186. package/lib/ui/Progress.js +27 -0
  187. package/lib/ui/Progress.js.map +1 -0
  188. package/lib/ui/RadioGroup.js +32 -0
  189. package/lib/ui/RadioGroup.js.map +1 -0
  190. package/lib/ui/ScrollArea.js +39 -0
  191. package/lib/ui/ScrollArea.js.map +1 -0
  192. package/lib/ui/Select.js +122 -0
  193. package/lib/ui/Select.js.map +1 -0
  194. package/lib/ui/Skeleton.js +18 -0
  195. package/lib/ui/Skeleton.js.map +1 -0
  196. package/lib/ui/Slider.js +24 -0
  197. package/lib/ui/Slider.js.map +1 -0
  198. package/lib/ui/Switch.js +28 -0
  199. package/lib/ui/Switch.js.map +1 -0
  200. package/lib/ui/Tabs.js +47 -0
  201. package/lib/ui/Tabs.js.map +1 -0
  202. package/lib/ui/Textarea.js +21 -0
  203. package/lib/ui/Textarea.js.map +1 -0
  204. package/lib/ui/Toggle.js +38 -0
  205. package/lib/ui/Toggle.js.map +1 -0
  206. package/lib/ui/ToggleGroup.js +42 -0
  207. package/lib/ui/ToggleGroup.js.map +1 -0
  208. package/lib/ui/Tooltip.js +24 -0
  209. package/lib/ui/Tooltip.js.map +1 -0
  210. package/lib/{useExposedProps-BWwxa-Hg.js → useExposedProps-B9K-9GTc.js} +2 -2
  211. package/lib/{useExposedProps-BWwxa-Hg.js.map → useExposedProps-B9K-9GTc.js.map} +1 -1
  212. package/lib/{utils-C8S3st2k.js → utils-B2yoT99j.js} +63 -63
  213. package/lib/{utils-C8S3st2k.js.map → utils-B2yoT99j.js.map} +1 -1
  214. package/lib/zudoku.auth-clerk.js +1 -1
  215. package/lib/zudoku.auth-openid.js +477 -483
  216. package/lib/zudoku.auth-openid.js.map +1 -1
  217. package/lib/zudoku.components.js +847 -2845
  218. package/lib/zudoku.components.js.map +1 -1
  219. package/lib/zudoku.openapi-worker.js +2 -2
  220. package/lib/zudoku.plugin-api-keys.js +68 -75
  221. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  222. package/lib/zudoku.plugin-custom-pages.js +14 -13
  223. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  224. package/lib/zudoku.plugin-markdown.js +1 -1
  225. package/lib/zudoku.plugin-openapi.js +6 -6
  226. package/package.json +28 -6
  227. package/src/app/main.tsx +1 -1
  228. package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
  229. package/src/lib/errors/ErrorAlert.tsx +18 -5
  230. package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
  231. package/src/lib/plugins/openapi/Sidecar.tsx +2 -2
  232. package/src/lib/plugins/openapi/playground/Playground.tsx +3 -3
  233. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
  234. package/src/lib/ui/Accordion.tsx +56 -0
  235. package/src/lib/ui/Alert.tsx +59 -0
  236. package/src/lib/ui/AlertDialog.tsx +139 -0
  237. package/src/lib/ui/AspectRatio.tsx +5 -0
  238. package/src/lib/ui/Badge.tsx +36 -0
  239. package/src/lib/ui/Breadcrumb.tsx +115 -0
  240. package/src/lib/ui/Button.tsx +1 -1
  241. package/src/lib/ui/Carousel.tsx +260 -0
  242. package/src/lib/ui/Checkbox.tsx +28 -0
  243. package/src/lib/ui/Collapsible.tsx +9 -0
  244. package/src/lib/{components → ui}/Dialog.tsx +4 -3
  245. package/src/lib/ui/Form.tsx +177 -0
  246. package/src/lib/ui/HoverCard.tsx +27 -0
  247. package/src/lib/ui/Label.tsx +24 -0
  248. package/src/lib/ui/Pagination.tsx +117 -0
  249. package/src/lib/ui/Popover.tsx +29 -0
  250. package/src/lib/ui/Progress.tsx +26 -0
  251. package/src/lib/ui/RadioGroup.tsx +42 -0
  252. package/src/lib/ui/ScrollArea.tsx +46 -0
  253. package/src/lib/ui/Skeleton.tsx +15 -0
  254. package/src/lib/ui/Slider.tsx +26 -0
  255. package/src/lib/ui/Switch.tsx +27 -0
  256. package/src/lib/ui/Textarea.tsx +23 -0
  257. package/src/lib/ui/Toggle.tsx +43 -0
  258. package/src/lib/ui/ToggleGroup.tsx +59 -0
  259. package/src/lib/ui/Tooltip.tsx +28 -0
  260. package/src/lib/util/invariant.ts +15 -3
  261. package/dist/internal.d.ts +0 -1
  262. package/dist/internal.js +0 -2
  263. package/dist/internal.js.map +0 -1
  264. package/dist/lib/components/Dialog.js.map +0 -1
  265. package/dist/lib/components/Select.js.map +0 -1
  266. package/lib/ErrorPage-DqqAV1dr.js +0 -16
  267. package/lib/ErrorPage-DqqAV1dr.js.map +0 -1
  268. package/lib/Input-DrR6P3mq.js +0 -2229
  269. package/lib/Input-DrR6P3mq.js.map +0 -1
  270. package/lib/Markdown-Y__eLG0x.js.map +0 -1
  271. package/lib/SidebarBadge-C0iWtji9.js +0 -503
  272. package/lib/SidebarBadge-C0iWtji9.js.map +0 -1
  273. package/lib/SlotletProvider-DmqWiVFt.js +0 -239
  274. package/lib/SlotletProvider-DmqWiVFt.js.map +0 -1
  275. package/lib/Spinner-3cQDBVGr.js +0 -7
  276. package/lib/Spinner-3cQDBVGr.js.map +0 -1
  277. package/lib/index-Ch8VO_uX.js +0 -2867
  278. package/lib/index-Ch8VO_uX.js.map +0 -1
  279. package/lib/index-DJqnphbT.js +0 -35
  280. package/lib/index-Dso_b0di.js.map +0 -1
  281. package/lib/index-bYAqbdYl.js +0 -124
  282. package/lib/index-bYAqbdYl.js.map +0 -1
  283. /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
  284. /package/dist/lib/{components → ui}/Select.d.ts +0 -0
  285. /package/dist/lib/{components → ui}/Select.js +0 -0
  286. /package/src/lib/{components → ui}/Select.tsx +0 -0
package/src/app/main.tsx CHANGED
@@ -9,10 +9,10 @@ import { configuredSearchPlugin } from "virtual:zudoku-search-plugin";
9
9
  import { configuredSidebar } from "virtual:zudoku-sidebar";
10
10
  import "virtual:zudoku-theme.css";
11
11
  import { DevPortal, Layout, RouterError } from "zudoku/components";
12
- import { isNavigationPlugin } from "zudoku/internal";
13
12
  import type { ZudokuConfig } from "../config/config.js";
14
13
  import { traverseSidebar } from "../lib/components/navigation/utils.js";
15
14
  import type { ZudokuContextOptions } from "../lib/core/DevPortalContext.js";
15
+ import { isNavigationPlugin } from "../lib/core/plugins.js";
16
16
  import { joinPath } from "../lib/util/joinPath.js";
17
17
 
18
18
  export const convertZudokuConfigToOptions = (
@@ -1,59 +1,28 @@
1
- import logger from "loglevel";
2
- import { useEffect, useRef, useState } from "react";
3
- import { useNavigate } from "react-router-dom";
4
- import { DeveloperHint } from "../../components/DeveloperHint.js";
5
- import { ErrorPage } from "../../components/ErrorPage.js";
6
- import { Spinner } from "../../components/Spinner.js";
7
- import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
1
+ import { useSuspenseQuery } from "@tanstack/react-query";
2
+ import { Navigate } from "react-router-dom";
3
+ import { ZudokuError } from "../../util/invariant.js";
8
4
 
9
5
  export function CallbackHandler({
10
6
  handleCallback,
11
7
  }: {
12
8
  handleCallback: () => Promise<string>;
13
9
  }) {
14
- const [error, setError] = useState<Error | null>(null);
15
- const navigate = useNavigate();
16
- // Deal with double mount in dev mode which will break
17
- // the OAuth flow because you can only use the code once
18
- const didInitialize = useRef(false);
10
+ const executeCallback = useSuspenseQuery({
11
+ retry: false,
12
+ queryKey: ["oauth-callback"],
13
+ queryFn: async () => {
14
+ try {
15
+ return await handleCallback();
16
+ } catch (error) {
17
+ throw new ZudokuError("Could not validate user", {
18
+ cause: error,
19
+ title: "Authentication Error",
20
+ developerHint:
21
+ "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly.",
22
+ });
23
+ }
24
+ },
25
+ });
19
26
 
20
- useEffect(() => {
21
- if (didInitialize.current) {
22
- return;
23
- }
24
- didInitialize.current = true;
25
- handleCallback()
26
- .then((redirect) => {
27
- navigate(redirect);
28
- })
29
- .catch((err) => {
30
- logger.error(err);
31
- setError(err);
32
- });
33
- }, [navigate, handleCallback]);
34
-
35
- if (error) {
36
- return (
37
- <ErrorPage
38
- category="Error"
39
- title="Authentication Error"
40
- message={
41
- <>
42
- <DeveloperHint className="mb-4">
43
- Check the configuration of your authorization provider and ensure
44
- all settings such as the callback URL are configured correctly.
45
- </DeveloperHint>
46
- An error occurred while authorizing the user.
47
- <SyntaxHighlight code={error.toString()} language="plain" />
48
- </>
49
- }
50
- />
51
- );
52
- }
53
-
54
- return (
55
- <div className="grid h-full place-items-center">
56
- <Spinner />
57
- </div>
58
- );
27
+ return <Navigate to={executeCallback.data} />;
59
28
  }
@@ -1,16 +1,29 @@
1
1
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
- export function ErrorAlert({ error }: { error: any }) {
3
- const message = error?.message ?? "Something went wrong";
4
- const stack = error?.stack;
2
+ import { DeveloperHint } from "../components/DeveloperHint.js";
3
+ import { ZudokuError } from "../util/invariant.js";
4
+
5
+ export function ErrorAlert({ error }: { error: unknown }) {
6
+ const message =
7
+ error instanceof Error ? error.message : "Something went wrong";
8
+ const hint = error instanceof ZudokuError ? error.developerHint : undefined;
9
+ const title =
10
+ error instanceof ZudokuError ? error.title : "Something went wrong";
11
+ const stack = error instanceof Error ? error.stack : undefined;
12
+ const cause = error instanceof Error ? error.cause : undefined;
5
13
 
6
14
  return (
7
15
  <div className="flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8">
8
16
  <div className="mx-auto max-w-[85%] sm:max-w-[50%]">
9
17
  <h1 className="text-4xl font-bold tracking-tight text-h1-text sm:text-5xl">
10
- Something went wrong
18
+ {title}
11
19
  </h1>
12
20
  <p className="mt-5 text-h1-text">{message}</p>
13
- {stack ? (
21
+ {hint && <DeveloperHint className="mb-4">{hint}</DeveloperHint>}
22
+ {cause instanceof Error ? (
23
+ <pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
24
+ {cause.stack}
25
+ </pre>
26
+ ) : stack ? (
14
27
  <pre className="mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700">
15
28
  {stack}
16
29
  </pre>
@@ -1,7 +1,6 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { useForm } from "react-hook-form";
3
3
  import { Link, useNavigate } from "react-router-dom";
4
- import { useZudoku } from "../../components/context/ZudokuContext.js";
5
4
  import {
6
5
  Select,
7
6
  SelectContent,
@@ -9,7 +8,8 @@ import {
9
8
  SelectItem,
10
9
  SelectTrigger,
11
10
  SelectValue,
12
- } from "../../components/Select.js";
11
+ } from "zudoku/ui/Select.js";
12
+ import { useZudoku } from "../../components/context/ZudokuContext.js";
13
13
  import { Button } from "../../ui/Button.js";
14
14
  import { Input } from "../../ui/Input.js";
15
15
  import { ApiKeyService } from "./index.js";
@@ -216,13 +216,13 @@ export const Sidecar = ({
216
216
  }}
217
217
  options={[
218
218
  { value: "shell", label: "cURL" },
219
- { value: "js", label: "Javascript" },
219
+ { value: "js", label: "JavaScript" },
220
220
  { value: "python", label: "Python" },
221
221
  { value: "java", label: "Java" },
222
222
  { value: "go", label: "Go" },
223
223
  { value: "csharp", label: "C#" },
224
224
  { value: "kotlin", label: "Kotlin" },
225
- { value: "objc", label: "Objective C" },
225
+ { value: "objc", label: "Objective-C" },
226
226
  { value: "php", label: "PHP" },
227
227
  { value: "ruby", label: "Ruby" },
228
228
  { value: "swift", label: "Swift" },
@@ -1,15 +1,15 @@
1
1
  import { useMutation } from "@tanstack/react-query";
2
2
  import { Fragment, useEffect, useRef, useTransition } from "react";
3
3
  import { FormProvider, useForm } from "react-hook-form";
4
- import { useSelectedServerStore } from "../../../authentication/state.js";
5
- import { useApiIdentities } from "../../../components/context/ZudokuContext.js";
6
4
  import {
7
5
  Select,
8
6
  SelectContent,
9
7
  SelectItem,
10
8
  SelectTrigger,
11
9
  SelectValue,
12
- } from "../../../components/Select.js";
10
+ } from "zudoku/ui/Select.js";
11
+ import { useSelectedServerStore } from "../../../authentication/state.js";
12
+ import { useApiIdentities } from "../../../components/context/ZudokuContext.js";
13
13
  import { Spinner } from "../../../components/Spinner.js";
14
14
  import { Button } from "../../../ui/Button.js";
15
15
  import { Callout } from "../../../ui/Callout.js";
@@ -5,7 +5,7 @@ import {
5
5
  DialogContent,
6
6
  DialogTitle,
7
7
  DialogTrigger,
8
- } from "../../../components/Dialog.js";
8
+ } from "zudoku/ui/Dialog.js";
9
9
  import { Playground, type PlaygroundContentProps } from "./Playground.js";
10
10
 
11
11
  export type PlaygroundDialogProps = PropsWithChildren<PlaygroundContentProps>;
@@ -0,0 +1,56 @@
1
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
2
+ import { ChevronDown } from "lucide-react";
3
+ import * as React from "react";
4
+
5
+ import { cn } from "../util/cn.js";
6
+
7
+ const Accordion = AccordionPrimitive.Root;
8
+
9
+ const AccordionItem = React.forwardRef<
10
+ React.ElementRef<typeof AccordionPrimitive.Item>,
11
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
12
+ >(({ className, ...props }, ref) => (
13
+ <AccordionPrimitive.Item
14
+ ref={ref}
15
+ className={cn("border-b", className)}
16
+ {...props}
17
+ />
18
+ ));
19
+ AccordionItem.displayName = "AccordionItem";
20
+
21
+ const AccordionTrigger = React.forwardRef<
22
+ React.ElementRef<typeof AccordionPrimitive.Trigger>,
23
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
24
+ >(({ className, children, ...props }, ref) => (
25
+ <AccordionPrimitive.Header className="flex">
26
+ <AccordionPrimitive.Trigger
27
+ ref={ref}
28
+ className={cn(
29
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
30
+ className,
31
+ )}
32
+ {...props}
33
+ >
34
+ {children}
35
+ <ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
36
+ </AccordionPrimitive.Trigger>
37
+ </AccordionPrimitive.Header>
38
+ ));
39
+ AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
40
+
41
+ const AccordionContent = React.forwardRef<
42
+ React.ElementRef<typeof AccordionPrimitive.Content>,
43
+ React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
44
+ >(({ className, children, ...props }, ref) => (
45
+ <AccordionPrimitive.Content
46
+ ref={ref}
47
+ className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
48
+ {...props}
49
+ >
50
+ <div className={cn("pb-4 pt-0", className)}>{children}</div>
51
+ </AccordionPrimitive.Content>
52
+ ));
53
+
54
+ AccordionContent.displayName = AccordionPrimitive.Content.displayName;
55
+
56
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
@@ -0,0 +1,59 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+
4
+ import { cn } from "../util/cn.js";
5
+
6
+ const alertVariants = cva(
7
+ "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-background text-foreground",
12
+ destructive:
13
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ },
20
+ );
21
+
22
+ const Alert = React.forwardRef<
23
+ HTMLDivElement,
24
+ React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
25
+ >(({ className, variant, ...props }, ref) => (
26
+ <div
27
+ ref={ref}
28
+ role="alert"
29
+ className={cn(alertVariants({ variant }), className)}
30
+ {...props}
31
+ />
32
+ ));
33
+ Alert.displayName = "Alert";
34
+
35
+ const AlertTitle = React.forwardRef<
36
+ HTMLParagraphElement,
37
+ React.HTMLAttributes<HTMLHeadingElement>
38
+ >(({ className, ...props }, ref) => (
39
+ <h5
40
+ ref={ref}
41
+ className={cn("mb-1 font-medium leading-none tracking-tight", className)}
42
+ {...props}
43
+ />
44
+ ));
45
+ AlertTitle.displayName = "AlertTitle";
46
+
47
+ const AlertDescription = React.forwardRef<
48
+ HTMLParagraphElement,
49
+ React.HTMLAttributes<HTMLParagraphElement>
50
+ >(({ className, ...props }, ref) => (
51
+ <div
52
+ ref={ref}
53
+ className={cn("text-sm [&_p]:leading-relaxed", className)}
54
+ {...props}
55
+ />
56
+ ));
57
+ AlertDescription.displayName = "AlertDescription";
58
+
59
+ export { Alert, AlertDescription, AlertTitle };
@@ -0,0 +1,139 @@
1
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
2
+ import * as React from "react";
3
+
4
+ import { cn } from "../util/cn.js";
5
+ import { buttonVariants } from "./Button.js";
6
+
7
+ const AlertDialog = AlertDialogPrimitive.Root;
8
+
9
+ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
10
+
11
+ const AlertDialogPortal = AlertDialogPrimitive.Portal;
12
+
13
+ const AlertDialogOverlay = React.forwardRef<
14
+ React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
15
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
16
+ >(({ className, ...props }, ref) => (
17
+ <AlertDialogPrimitive.Overlay
18
+ className={cn(
19
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
20
+ className,
21
+ )}
22
+ {...props}
23
+ ref={ref}
24
+ />
25
+ ));
26
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
27
+
28
+ const AlertDialogContent = React.forwardRef<
29
+ React.ElementRef<typeof AlertDialogPrimitive.Content>,
30
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
31
+ >(({ className, ...props }, ref) => (
32
+ <AlertDialogPortal>
33
+ <AlertDialogOverlay />
34
+ <AlertDialogPrimitive.Content
35
+ ref={ref}
36
+ className={cn(
37
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
38
+ className,
39
+ )}
40
+ {...props}
41
+ />
42
+ </AlertDialogPortal>
43
+ ));
44
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
45
+
46
+ const AlertDialogHeader = ({
47
+ className,
48
+ ...props
49
+ }: React.HTMLAttributes<HTMLDivElement>) => (
50
+ <div
51
+ className={cn(
52
+ "flex flex-col space-y-2 text-center sm:text-left",
53
+ className,
54
+ )}
55
+ {...props}
56
+ />
57
+ );
58
+ AlertDialogHeader.displayName = "AlertDialogHeader";
59
+
60
+ const AlertDialogFooter = ({
61
+ className,
62
+ ...props
63
+ }: React.HTMLAttributes<HTMLDivElement>) => (
64
+ <div
65
+ className={cn(
66
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
67
+ className,
68
+ )}
69
+ {...props}
70
+ />
71
+ );
72
+ AlertDialogFooter.displayName = "AlertDialogFooter";
73
+
74
+ const AlertDialogTitle = React.forwardRef<
75
+ React.ElementRef<typeof AlertDialogPrimitive.Title>,
76
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
77
+ >(({ className, ...props }, ref) => (
78
+ <AlertDialogPrimitive.Title
79
+ ref={ref}
80
+ className={cn("text-lg font-semibold", className)}
81
+ {...props}
82
+ />
83
+ ));
84
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
85
+
86
+ const AlertDialogDescription = React.forwardRef<
87
+ React.ElementRef<typeof AlertDialogPrimitive.Description>,
88
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
89
+ >(({ className, ...props }, ref) => (
90
+ <AlertDialogPrimitive.Description
91
+ ref={ref}
92
+ className={cn("text-sm text-muted-foreground", className)}
93
+ {...props}
94
+ />
95
+ ));
96
+ AlertDialogDescription.displayName =
97
+ AlertDialogPrimitive.Description.displayName;
98
+
99
+ const AlertDialogAction = React.forwardRef<
100
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
101
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
102
+ >(({ className, ...props }, ref) => (
103
+ <AlertDialogPrimitive.Action
104
+ ref={ref}
105
+ className={cn(buttonVariants(), className)}
106
+ {...props}
107
+ />
108
+ ));
109
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
110
+
111
+ const AlertDialogCancel = React.forwardRef<
112
+ React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
113
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
114
+ >(({ className, ...props }, ref) => (
115
+ <AlertDialogPrimitive.Cancel
116
+ ref={ref}
117
+ className={cn(
118
+ buttonVariants({ variant: "outline" }),
119
+ "mt-2 sm:mt-0",
120
+ className,
121
+ )}
122
+ {...props}
123
+ />
124
+ ));
125
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
126
+
127
+ export {
128
+ AlertDialog,
129
+ AlertDialogAction,
130
+ AlertDialogCancel,
131
+ AlertDialogContent,
132
+ AlertDialogDescription,
133
+ AlertDialogFooter,
134
+ AlertDialogHeader,
135
+ AlertDialogOverlay,
136
+ AlertDialogPortal,
137
+ AlertDialogTitle,
138
+ AlertDialogTrigger,
139
+ };
@@ -0,0 +1,5 @@
1
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
2
+
3
+ const AspectRatio = AspectRatioPrimitive.Root;
4
+
5
+ export { AspectRatio };
@@ -0,0 +1,36 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+
4
+ import { cn } from "../util/cn.js";
5
+
6
+ const badgeVariants = cva(
7
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default:
12
+ "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13
+ secondary:
14
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
+ destructive:
16
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17
+ outline: "text-foreground",
18
+ },
19
+ },
20
+ defaultVariants: {
21
+ variant: "default",
22
+ },
23
+ },
24
+ );
25
+
26
+ export interface BadgeProps
27
+ extends React.HTMLAttributes<HTMLDivElement>,
28
+ VariantProps<typeof badgeVariants> {}
29
+
30
+ function Badge({ className, variant, ...props }: BadgeProps) {
31
+ return (
32
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
33
+ );
34
+ }
35
+
36
+ export { Badge, badgeVariants };
@@ -0,0 +1,115 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
3
+ import * as React from "react";
4
+
5
+ import { cn } from "../util/cn.js";
6
+
7
+ const Breadcrumb = React.forwardRef<
8
+ HTMLElement,
9
+ React.ComponentPropsWithoutRef<"nav"> & {
10
+ separator?: React.ReactNode;
11
+ }
12
+ >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
13
+ Breadcrumb.displayName = "Breadcrumb";
14
+
15
+ const BreadcrumbList = React.forwardRef<
16
+ HTMLOListElement,
17
+ React.ComponentPropsWithoutRef<"ol">
18
+ >(({ className, ...props }, ref) => (
19
+ <ol
20
+ ref={ref}
21
+ className={cn(
22
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
23
+ className,
24
+ )}
25
+ {...props}
26
+ />
27
+ ));
28
+ BreadcrumbList.displayName = "BreadcrumbList";
29
+
30
+ const BreadcrumbItem = React.forwardRef<
31
+ HTMLLIElement,
32
+ React.ComponentPropsWithoutRef<"li">
33
+ >(({ className, ...props }, ref) => (
34
+ <li
35
+ ref={ref}
36
+ className={cn("inline-flex items-center gap-1.5", className)}
37
+ {...props}
38
+ />
39
+ ));
40
+ BreadcrumbItem.displayName = "BreadcrumbItem";
41
+
42
+ const BreadcrumbLink = React.forwardRef<
43
+ HTMLAnchorElement,
44
+ React.ComponentPropsWithoutRef<"a"> & {
45
+ asChild?: boolean;
46
+ }
47
+ >(({ asChild, className, ...props }, ref) => {
48
+ const Comp = asChild ? Slot : "a";
49
+
50
+ return (
51
+ <Comp
52
+ ref={ref}
53
+ className={cn("transition-colors hover:text-foreground", className)}
54
+ {...props}
55
+ />
56
+ );
57
+ });
58
+ BreadcrumbLink.displayName = "BreadcrumbLink";
59
+
60
+ const BreadcrumbPage = React.forwardRef<
61
+ HTMLSpanElement,
62
+ React.ComponentPropsWithoutRef<"span">
63
+ >(({ className, ...props }, ref) => (
64
+ <span
65
+ ref={ref}
66
+ role="link"
67
+ aria-disabled="true"
68
+ aria-current="page"
69
+ className={cn("font-normal text-foreground", className)}
70
+ {...props}
71
+ />
72
+ ));
73
+ BreadcrumbPage.displayName = "BreadcrumbPage";
74
+
75
+ const BreadcrumbSeparator = ({
76
+ children,
77
+ className,
78
+ ...props
79
+ }: React.ComponentProps<"li">) => (
80
+ <li
81
+ role="presentation"
82
+ aria-hidden="true"
83
+ className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
84
+ {...props}
85
+ >
86
+ {children ?? <ChevronRight />}
87
+ </li>
88
+ );
89
+ BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
90
+
91
+ const BreadcrumbEllipsis = ({
92
+ className,
93
+ ...props
94
+ }: React.ComponentProps<"span">) => (
95
+ <span
96
+ role="presentation"
97
+ aria-hidden="true"
98
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
99
+ {...props}
100
+ >
101
+ <MoreHorizontal className="h-4 w-4" />
102
+ <span className="sr-only">More</span>
103
+ </span>
104
+ );
105
+ BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
106
+
107
+ export {
108
+ Breadcrumb,
109
+ BreadcrumbEllipsis,
110
+ BreadcrumbItem,
111
+ BreadcrumbLink,
112
+ BreadcrumbList,
113
+ BreadcrumbPage,
114
+ BreadcrumbSeparator,
115
+ };
@@ -3,7 +3,7 @@ import { cva, VariantProps } from "class-variance-authority";
3
3
  import * as React from "react";
4
4
  import { cn } from "../util/cn.js";
5
5
 
6
- const buttonVariants = cva(
6
+ export const buttonVariants = cva(
7
7
  "not-prose inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
8
8
  {
9
9
  variants: {