zudoku 0.64.2 → 0.65.1

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 (279) hide show
  1. package/dist/app/main.d.ts +91 -1
  2. package/dist/app/main.js +5 -1
  3. package/dist/app/main.js.map +1 -1
  4. package/dist/config/validators/InputNavigationSchema.d.ts +16 -16
  5. package/dist/config/validators/NavigationSchema.js +2 -4
  6. package/dist/config/validators/NavigationSchema.js.map +1 -1
  7. package/dist/config/validators/validate.d.ts +53 -1
  8. package/dist/config/validators/validate.js +7 -0
  9. package/dist/config/validators/validate.js.map +1 -1
  10. package/dist/config/validators/validate.test.js +43 -0
  11. package/dist/config/validators/validate.test.js.map +1 -1
  12. package/dist/flat-config.d.ts +6 -0
  13. package/dist/lib/authentication/providers/auth0.js +6 -1
  14. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  15. package/dist/lib/components/Autocomplete.d.ts +3 -1
  16. package/dist/lib/components/Autocomplete.js +6 -2
  17. package/dist/lib/components/Autocomplete.js.map +1 -1
  18. package/dist/lib/components/Layout.js +3 -2
  19. package/dist/lib/components/Layout.js.map +1 -1
  20. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  21. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  22. package/dist/lib/errors/ErrorAlert.js +1 -1
  23. package/dist/lib/errors/RouterError.d.ts +3 -1
  24. package/dist/lib/errors/RouterError.js +3 -2
  25. package/dist/lib/errors/RouterError.js.map +1 -1
  26. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +1 -1
  27. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -1
  28. package/dist/lib/plugins/openapi/OperationList.js +2 -1
  29. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  30. package/dist/lib/plugins/openapi/OperationListItem.js +2 -1
  31. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  32. package/dist/lib/plugins/openapi/ParameterList.js +7 -4
  33. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  34. package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
  35. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  36. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +4 -1
  37. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  38. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +1 -2
  39. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +15 -6
  40. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  41. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -2
  42. package/dist/lib/plugins/openapi/Sidecar.js +39 -15
  43. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  44. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  45. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  46. package/dist/lib/plugins/openapi/SidecarExamples.js +15 -16
  47. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  48. package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
  49. package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
  50. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  51. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  52. package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
  53. package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
  54. package/dist/lib/plugins/openapi/interfaces.d.ts +13 -0
  55. package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
  56. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  57. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
  58. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
  59. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
  60. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  61. package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
  62. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  63. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +8 -0
  64. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
  65. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  66. package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
  67. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  68. package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
  69. package/dist/lib/plugins/openapi/playground/Playground.js +56 -28
  70. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  71. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
  72. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  73. package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
  74. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  75. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
  76. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
  77. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
  78. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
  79. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
  80. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
  81. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
  82. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
  83. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
  84. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
  85. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
  86. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +2 -2
  87. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  88. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
  89. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  90. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -7
  91. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  92. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  93. package/dist/lib/plugins/openapi/schema/SchemaView.js +20 -9
  94. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  95. package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
  96. package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
  97. package/dist/lib/ui/Badge.d.ts +3 -3
  98. package/dist/lib/ui/Badge.js +9 -7
  99. package/dist/lib/ui/Badge.js.map +1 -1
  100. package/dist/lib/ui/Button.d.ts +1 -1
  101. package/dist/lib/ui/Button.js +1 -0
  102. package/dist/lib/ui/Button.js.map +1 -1
  103. package/dist/lib/ui/Checkbox.d.ts +2 -2
  104. package/dist/lib/ui/Checkbox.js +4 -4
  105. package/dist/lib/ui/Checkbox.js.map +1 -1
  106. package/dist/lib/ui/CodeBlock.js +1 -1
  107. package/dist/lib/ui/CodeBlock.js.map +1 -1
  108. package/dist/lib/ui/Collapsible.d.ts +4 -4
  109. package/dist/lib/ui/Collapsible.js +11 -4
  110. package/dist/lib/ui/Collapsible.js.map +1 -1
  111. package/dist/lib/ui/EmbeddedCodeBlock.js +3 -2
  112. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  113. package/dist/lib/ui/Frame.d.ts +8 -0
  114. package/dist/lib/ui/Frame.js +22 -0
  115. package/dist/lib/ui/Frame.js.map +1 -0
  116. package/dist/lib/ui/Item.d.ts +23 -0
  117. package/dist/lib/ui/Item.js +67 -0
  118. package/dist/lib/ui/Item.js.map +1 -0
  119. package/dist/lib/ui/NativeSelect.d.ts +5 -0
  120. package/dist/lib/ui/NativeSelect.js +14 -0
  121. package/dist/lib/ui/NativeSelect.js.map +1 -0
  122. package/dist/lib/ui/Select.d.ts +13 -11
  123. package/dist/lib/ui/Select.js +34 -23
  124. package/dist/lib/ui/Select.js.map +1 -1
  125. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  126. package/dist/lib/util/readFrontmatter.js +12 -0
  127. package/dist/lib/util/readFrontmatter.js.map +1 -0
  128. package/dist/vite/mdx/remark-last-modified.js +57 -3
  129. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  130. package/dist/vite/plugin-api.js +2 -2
  131. package/dist/vite/plugin-api.js.map +1 -1
  132. package/dist/vite/plugin-frontmatter.js +3 -5
  133. package/dist/vite/plugin-frontmatter.js.map +1 -1
  134. package/dist/vite/plugin-markdown-export.js +3 -4
  135. package/dist/vite/plugin-markdown-export.js.map +1 -1
  136. package/lib/{Button-DmS4u8Lj.js → Button-B3ucvvQw.js} +7 -6
  137. package/lib/Button-B3ucvvQw.js.map +1 -0
  138. package/lib/{ErrorAlert--3alJ_-b.js → ErrorAlert-D5LKLFOd.js} +1100 -1112
  139. package/lib/ErrorAlert-D5LKLFOd.js.map +1 -0
  140. package/lib/{MdxPage-Bpa9tL63.js → MdxPage-hOCN-u-L.js} +6 -6
  141. package/lib/{MdxPage-Bpa9tL63.js.map → MdxPage-hOCN-u-L.js.map} +1 -1
  142. package/lib/{OAuthErrorPage-B79J86Fo.js → OAuthErrorPage-oXnxcJg4.js} +4 -4
  143. package/lib/{OAuthErrorPage-B79J86Fo.js.map → OAuthErrorPage-oXnxcJg4.js.map} +1 -1
  144. package/lib/{OasProvider-jr0oDSFy.js → OasProvider-BuBeRIHB.js} +2 -2
  145. package/lib/{OasProvider-jr0oDSFy.js.map → OasProvider-BuBeRIHB.js.map} +1 -1
  146. package/lib/{OperationList-DLEAg4qw.js → OperationList-Cx8TGKhB.js} +2053 -1830
  147. package/lib/OperationList-Cx8TGKhB.js.map +1 -0
  148. package/lib/{Pagination-H2HW9-Er.js → Pagination-lLSoHnxa.js} +2 -2
  149. package/lib/{Pagination-H2HW9-Er.js.map → Pagination-lLSoHnxa.js.map} +1 -1
  150. package/lib/{RouteGuard-CjzxosTf.js → RouteGuard-Brz95MSt.js} +2 -2
  151. package/lib/{RouteGuard-CjzxosTf.js.map → RouteGuard-Brz95MSt.js.map} +1 -1
  152. package/lib/RouterError-VGZB_wg4.js +42 -0
  153. package/lib/RouterError-VGZB_wg4.js.map +1 -0
  154. package/lib/{SchemaList-CSDSazqV.js → SchemaList-rBWXYJEb.js} +7 -7
  155. package/lib/{SchemaList-CSDSazqV.js.map → SchemaList-rBWXYJEb.js.map} +1 -1
  156. package/lib/SchemaView-jouS_xvc.js +586 -0
  157. package/lib/SchemaView-jouS_xvc.js.map +1 -0
  158. package/lib/Select-DFRCS31-.js +399 -0
  159. package/lib/Select-DFRCS31-.js.map +1 -0
  160. package/lib/{SignUp-Fycafbyg.js → SignUp-D2mmQOkg.js} +2 -2
  161. package/lib/{SignUp-Fycafbyg.js.map → SignUp-D2mmQOkg.js.map} +1 -1
  162. package/lib/{Toc-ChkOg2UU.js → Toc-CBWfFCVf.js} +2 -2
  163. package/lib/{Toc-ChkOg2UU.js.map → Toc-CBWfFCVf.js.map} +1 -1
  164. package/lib/{circular-DGfd8SGc.js → circular-CGkbVs2O.js} +6360 -5953
  165. package/lib/circular-CGkbVs2O.js.map +1 -0
  166. package/lib/{createServer-DGD8hEzT.js → createServer-CcV_75PW.js} +770 -735
  167. package/lib/createServer-CcV_75PW.js.map +1 -0
  168. package/lib/{errors-BTpjwHS6.js → errors-D7xzOd8X.js} +2 -2
  169. package/lib/{errors-BTpjwHS6.js.map → errors-D7xzOd8X.js.map} +1 -1
  170. package/lib/{index-Bvas0H4x.js → index-CF7_erXq.js} +2 -2
  171. package/lib/{index-Bvas0H4x.js.map → index-CF7_erXq.js.map} +1 -1
  172. package/lib/{index-FNRZUtwo.js → index-CPws05Tb.js} +3 -3
  173. package/lib/{index-FNRZUtwo.js.map → index-CPws05Tb.js.map} +1 -1
  174. package/lib/index-I4zC7Yht.js +3680 -0
  175. package/lib/index-I4zC7Yht.js.map +1 -0
  176. package/lib/ui/ActionButton.js +1 -1
  177. package/lib/ui/Badge.js +27 -13
  178. package/lib/ui/Badge.js.map +1 -1
  179. package/lib/ui/Button.js +6 -5
  180. package/lib/ui/Button.js.map +1 -1
  181. package/lib/ui/Checkbox.js +29 -26
  182. package/lib/ui/Checkbox.js.map +1 -1
  183. package/lib/ui/CodeBlock.js +7 -7
  184. package/lib/ui/CodeBlock.js.map +1 -1
  185. package/lib/ui/Collapsible.js +32 -5
  186. package/lib/ui/Collapsible.js.map +1 -1
  187. package/lib/ui/EmbeddedCodeBlock.js +19 -18
  188. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  189. package/lib/ui/Frame.js +81 -0
  190. package/lib/ui/Frame.js.map +1 -0
  191. package/lib/ui/Item.js +188 -0
  192. package/lib/ui/Item.js.map +1 -0
  193. package/lib/ui/NativeSelect.js +57 -0
  194. package/lib/ui/NativeSelect.js.map +1 -0
  195. package/lib/ui/Select.js +166 -116
  196. package/lib/ui/Select.js.map +1 -1
  197. package/lib/ui/Tabs.js +10 -10
  198. package/lib/zudoku.__internal.js +345 -345
  199. package/lib/zudoku.__internal.js.map +1 -1
  200. package/lib/zudoku.auth-auth0.js +7 -7
  201. package/lib/zudoku.auth-auth0.js.map +1 -1
  202. package/lib/zudoku.auth-azureb2c.js +3 -3
  203. package/lib/zudoku.auth-clerk.js +1 -1
  204. package/lib/zudoku.auth-openid.js +3 -3
  205. package/lib/zudoku.auth-supabase.js +3 -3
  206. package/lib/zudoku.components.js +2 -2
  207. package/lib/zudoku.plugin-api-catalog.js +3 -3
  208. package/lib/zudoku.plugin-api-keys.js +4 -4
  209. package/lib/zudoku.plugin-markdown.js +1 -1
  210. package/lib/zudoku.plugin-openapi.js +1 -1
  211. package/lib/zudoku.plugin-search-pagefind.js +2 -2
  212. package/package.json +4 -4
  213. package/src/app/main.tsx +5 -1
  214. package/src/lib/authentication/providers/auth0.tsx +6 -1
  215. package/src/lib/components/Autocomplete.tsx +11 -2
  216. package/src/lib/components/Layout.tsx +3 -2
  217. package/src/lib/components/navigation/NavigationItem.tsx +7 -20
  218. package/src/lib/errors/ErrorAlert.tsx +1 -1
  219. package/src/lib/errors/RouterError.tsx +7 -2
  220. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +2 -2
  221. package/src/lib/plugins/openapi/OperationList.tsx +3 -1
  222. package/src/lib/plugins/openapi/OperationListItem.tsx +7 -7
  223. package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
  224. package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
  225. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +36 -13
  226. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +67 -44
  227. package/src/lib/plugins/openapi/Sidecar.tsx +84 -41
  228. package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
  229. package/src/lib/plugins/openapi/SidecarExamples.tsx +59 -37
  230. package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
  231. package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
  232. package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
  233. package/src/lib/plugins/openapi/interfaces.ts +12 -0
  234. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
  235. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
  236. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
  237. package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
  238. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
  239. package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
  240. package/src/lib/plugins/openapi/playground/Playground.tsx +73 -35
  241. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +9 -30
  242. package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
  243. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
  244. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
  245. package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
  246. package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
  247. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +2 -6
  248. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
  249. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -52
  250. package/src/lib/plugins/openapi/schema/SchemaView.tsx +82 -48
  251. package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
  252. package/src/lib/ui/Badge.tsx +21 -12
  253. package/src/lib/ui/Button.tsx +1 -0
  254. package/src/lib/ui/Checkbox.tsx +23 -24
  255. package/src/lib/ui/CodeBlock.tsx +3 -3
  256. package/src/lib/ui/Collapsible.tsx +26 -4
  257. package/src/lib/ui/EmbeddedCodeBlock.tsx +21 -18
  258. package/src/lib/ui/Frame.tsx +81 -0
  259. package/src/lib/ui/Item.tsx +192 -0
  260. package/src/lib/ui/NativeSelect.tsx +47 -0
  261. package/src/lib/ui/Select.tsx +153 -126
  262. package/src/lib/util/readFrontmatter.ts +13 -0
  263. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
  264. package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
  265. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
  266. package/lib/Button-DmS4u8Lj.js.map +0 -1
  267. package/lib/ErrorAlert--3alJ_-b.js.map +0 -1
  268. package/lib/OperationList-DLEAg4qw.js.map +0 -1
  269. package/lib/RouterError-DZS2d6Sc.js +0 -41
  270. package/lib/RouterError-DZS2d6Sc.js.map +0 -1
  271. package/lib/SchemaView-DJiBd0_5.js +0 -397
  272. package/lib/SchemaView-DJiBd0_5.js.map +0 -1
  273. package/lib/Select-C1DeCqKv.js +0 -372
  274. package/lib/Select-C1DeCqKv.js.map +0 -1
  275. package/lib/circular-DGfd8SGc.js.map +0 -1
  276. package/lib/createServer-DGD8hEzT.js.map +0 -1
  277. package/lib/index-DP1xZgfJ.js +0 -3364
  278. package/lib/index-DP1xZgfJ.js.map +0 -1
  279. package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
@@ -1,7 +1,15 @@
1
1
  import { InfoIcon } from "lucide-react";
2
+ import { Fragment } from "react";
3
+ import {
4
+ Frame,
5
+ FrameDescription,
6
+ FrameFooter,
7
+ FrameHeader,
8
+ FramePanel,
9
+ } from "zudoku/ui/Frame.js";
10
+ import { ItemGroup, ItemSeparator } from "zudoku/ui/Item.js";
2
11
  import { Markdown } from "../../../components/Markdown.js";
3
12
  import type { SchemaObject } from "../../../oas/parser/index.js";
4
- import { Card } from "../../../ui/Card.js";
5
13
  import { groupBy } from "../../../util/groupBy.js";
6
14
  import { ConstValue } from "../components/ConstValue.js";
7
15
  import { EnumValues } from "../components/EnumValues.js";
@@ -22,19 +30,30 @@ const renderMarkdown = (content?: string) =>
22
30
  const renderBasicSchema = (
23
31
  schema: SchemaObject,
24
32
  cardHeader?: React.ReactNode,
25
- ) => (
26
- <Card className="overflow-hidden">
27
- {cardHeader}
28
- <div className="p-4 space-y-2">
33
+ embedded?: boolean,
34
+ ) => {
35
+ const content = (
36
+ <>
29
37
  <span className="text-sm text-muted-foreground">
30
38
  <ParamInfos schema={schema} />
31
39
  </span>
32
40
  {schema.enum && <EnumValues values={schema.enum} />}
33
41
  {renderMarkdown(schema.description)}
34
42
  <SchemaExampleAndDefault schema={schema} />
35
- </div>
36
- </Card>
37
- );
43
+ </>
44
+ );
45
+
46
+ if (embedded) {
47
+ return <div className="space-y-2 p-4">{content}</div>;
48
+ }
49
+
50
+ return (
51
+ <Frame>
52
+ {cardHeader}
53
+ <FramePanel className="space-y-2">{content}</FramePanel>
54
+ </Frame>
55
+ );
56
+ };
38
57
 
39
58
  export const SchemaView = ({
40
59
  schema,
@@ -49,12 +68,14 @@ export const SchemaView = ({
49
68
  }) => {
50
69
  if (!schema || Object.keys(schema).length === 0) {
51
70
  return (
52
- <Card className="overflow-hidden">
71
+ <Frame>
53
72
  {cardHeader}
54
- <div className="text-sm text-muted-foreground italic p-4">
55
- No data returned
56
- </div>
57
- </Card>
73
+ <FramePanel>
74
+ <div className="text-sm text-muted-foreground italic">
75
+ No data returned
76
+ </div>
77
+ </FramePanel>
78
+ </Frame>
58
79
  );
59
80
  }
60
81
 
@@ -67,7 +88,7 @@ export const SchemaView = ({
67
88
  }
68
89
 
69
90
  if (isBasicType(schema.type)) {
70
- return renderBasicSchema(schema, cardHeader);
91
+ return renderBasicSchema(schema, cardHeader, embedded);
71
92
  }
72
93
 
73
94
  if (schema.type === "array" && typeof schema.items === "object") {
@@ -87,48 +108,61 @@ export const SchemaView = ({
87
108
  );
88
109
  const groupNames = ["required", "optional", "deprecated"] as const;
89
110
 
90
- const additionalProperties =
91
- typeof schema.additionalProperties === "object" ? (
92
- <SchemaView schema={schema.additionalProperties} embedded />
93
- ) : schema.additionalProperties === true ? (
94
- <div className="text-sm p-4 bg-border/20 hover:bg-border/30 flex items-center gap-1">
95
- <span>Additional properties are allowed</span>
96
- <a
97
- className="p-0.5 -m-0.5"
98
- href="https://swagger.io/docs/specification/v3_0/data-models/dictionaries/"
99
- rel="noopener noreferrer"
100
- target="_blank"
101
- >
102
- <InfoIcon size={14} />
103
- </a>
104
- </div>
105
- ) : null;
111
+ const additionalObjectProperties = typeof schema.additionalProperties ===
112
+ "object" && <SchemaView schema={schema.additionalProperties} embedded />;
106
113
 
107
- const Component = embedded ? "div" : Card;
108
-
109
- return (
110
- <Component className="divide-y overflow-hidden">
111
- {cardHeader}
112
- {groupNames.map(
113
- (group) =>
114
- groupedProperties[group] && (
115
- <ul key={group} className="divide-y">
116
- {groupedProperties[group].map(([name, schema]) => (
114
+ const itemsList = groupNames.map(
115
+ (group, index) =>
116
+ groupedProperties[group] && (
117
+ <Fragment key={group}>
118
+ {index > 0 && <ItemSeparator />}
119
+ <ItemGroup className="overflow-clip">
120
+ {groupedProperties[group].map(([name, schema], index) => (
121
+ <Fragment key={name}>
122
+ {index > 0 && <ItemSeparator />}
117
123
  <SchemaPropertyItem
118
- key={name}
119
124
  name={name}
120
125
  schema={schema}
121
126
  group={group}
122
127
  defaultOpen={defaultOpen}
123
128
  />
124
- ))}
125
- </ul>
126
- ),
129
+ </Fragment>
130
+ ))}
131
+ </ItemGroup>
132
+ </Fragment>
133
+ ),
134
+ );
135
+
136
+ if (embedded) {
137
+ return itemsList;
138
+ }
139
+
140
+ return (
141
+ <Frame>
142
+ {cardHeader}
143
+ {schema.description && (
144
+ <FrameHeader>
145
+ <FrameDescription>{schema.description}</FrameDescription>
146
+ </FrameHeader>
127
147
  )}
128
- {additionalProperties}
129
- </Component>
148
+ <FramePanel className="p-0!">
149
+ {itemsList}
150
+ {additionalObjectProperties}
151
+ </FramePanel>
152
+ {schema.additionalProperties === true && (
153
+ <FrameFooter>
154
+ <a
155
+ className="text-sm flex items-center gap-1 hover:underline"
156
+ href="https://swagger.io/docs/specification/v3_0/data-models/dictionaries/"
157
+ rel="noopener noreferrer"
158
+ target="_blank"
159
+ >
160
+ Additional properties are allowed
161
+ <InfoIcon size={14} />
162
+ </a>
163
+ </FrameFooter>
164
+ )}
165
+ </Frame>
130
166
  );
131
167
  }
132
-
133
- return null;
134
168
  };
@@ -1,7 +1,7 @@
1
1
  import { useState } from "react";
2
2
  import type { SchemaObject } from "../../../oas/parser/index.js";
3
3
  import { Badge } from "../../../ui/Badge.js";
4
- import { Card } from "../../../ui/Card.js";
4
+ import { Frame, FramePanel } from "../../../ui/Frame.js";
5
5
  import { cn } from "../../../util/cn.js";
6
6
  import { SchemaView } from "./SchemaView.js";
7
7
  import {
@@ -67,17 +67,6 @@ const DecisionTable = ({
67
67
  );
68
68
  };
69
69
 
70
- const VariantPanel = ({ variant }: { variant: SchemaObject }) => {
71
- return (
72
- <div className="space-y-2">
73
- {variant.description && (
74
- <p className="text-sm text-muted-foreground">{variant.description}</p>
75
- )}
76
- <SchemaView schema={variant} />
77
- </div>
78
- );
79
- };
80
-
81
70
  export const UnionView = ({
82
71
  schema,
83
72
  cardHeader,
@@ -119,9 +108,9 @@ export const UnionView = ({
119
108
  currentVariantIndex >= 0 ? variants[currentVariantIndex] : null;
120
109
 
121
110
  return (
122
- <Card className="overflow-hidden text-sm">
111
+ <Frame>
123
112
  {cardHeader}
124
- <div className="flex flex-col gap-4 p-4">
113
+ <FramePanel className="text-sm flex flex-col gap-4">
125
114
  <div className="flex items-center gap-2">
126
115
  <Badge variant="outline">{mode}</Badge>
127
116
  <div className="flex-1 p-2">
@@ -136,8 +125,8 @@ export const UnionView = ({
136
125
  onSelectVariant={setSelectedVariant}
137
126
  />
138
127
  <strong>Properties for {selectedVariant}:</strong>
139
- {currentVariant && <VariantPanel variant={currentVariant} />}
140
- </div>
141
- </Card>
128
+ {currentVariant && <SchemaView schema={currentVariant} />}
129
+ </FramePanel>
130
+ </Frame>
142
131
  );
143
132
  };
@@ -1,21 +1,22 @@
1
+ import { Slot } from "@radix-ui/react-slot";
1
2
  import { cva, type VariantProps } from "class-variance-authority";
2
3
  import type * as React from "react";
3
-
4
4
  import { cn } from "../util/cn.js";
5
5
 
6
6
  const badgeVariants = cva(
7
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
7
+ "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
8
8
  {
9
9
  variants: {
10
10
  variant: {
11
11
  default:
12
- "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
12
+ "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
13
13
  secondary:
14
- "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15
- muted: "bg-muted text-muted-foreground ",
14
+ "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
16
15
  destructive:
17
- "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
18
- outline: "text-foreground",
16
+ "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
17
+ outline:
18
+ "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
19
+ muted: "bg-muted text-muted-foreground ",
19
20
  },
20
21
  },
21
22
  defaultVariants: {
@@ -24,13 +25,21 @@ const badgeVariants = cva(
24
25
  },
25
26
  );
26
27
 
27
- export interface BadgeProps
28
- extends React.HTMLAttributes<HTMLDivElement>,
29
- VariantProps<typeof badgeVariants> {}
28
+ function Badge({
29
+ className,
30
+ variant,
31
+ asChild = false,
32
+ ...props
33
+ }: React.ComponentProps<"span"> &
34
+ VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35
+ const Comp = asChild ? Slot : "span";
30
36
 
31
- function Badge({ className, variant, ...props }: BadgeProps) {
32
37
  return (
33
- <div className={cn(badgeVariants({ variant }), className)} {...props} />
38
+ <Comp
39
+ data-slot="badge"
40
+ className={cn(badgeVariants({ variant }), className)}
41
+ {...props}
42
+ />
34
43
  );
35
44
  }
36
45
 
@@ -30,6 +30,7 @@ export const buttonVariants = cva(
30
30
  xl: "h-14 rounded-lg px-10 text-lg",
31
31
  icon: "size-9",
32
32
  "icon-xs": "size-7",
33
+ "icon-xxs": "size-5",
33
34
  },
34
35
  },
35
36
  defaultVariants: {
@@ -1,29 +1,28 @@
1
1
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
2
- import { Check } from "lucide-react";
3
- import * as React from "react";
4
-
2
+ import { CheckIcon } from "lucide-react";
3
+ import type * as React from "react";
5
4
  import { cn } from "../util/cn.js";
6
5
 
7
- const Checkbox = React.forwardRef<
8
- React.ElementRef<typeof CheckboxPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
10
- >(({ className, ...props }, ref) => (
11
- <CheckboxPrimitive.Root
12
- ref={ref}
13
- className={cn(
14
- "peer h-4 w-4 shrink-0 rounded-[min(6px,var(--radius)-4px)] ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary",
15
- "border border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary",
16
- className,
17
- )}
18
- {...props}
19
- >
20
- <CheckboxPrimitive.Indicator
21
- className={cn("flex items-center justify-center text-current")}
6
+ function Checkbox({
7
+ className,
8
+ ...props
9
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
10
+ return (
11
+ <CheckboxPrimitive.Root
12
+ data-slot="checkbox"
13
+ className={cn(
14
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
15
+ className,
16
+ )}
17
+ {...props}
22
18
  >
23
- <Check className="h-4 w-4" />
24
- </CheckboxPrimitive.Indicator>
25
- </CheckboxPrimitive.Root>
26
- ));
27
- Checkbox.displayName = CheckboxPrimitive.Root.displayName;
28
-
19
+ <CheckboxPrimitive.Indicator
20
+ data-slot="checkbox-indicator"
21
+ className="grid place-content-center text-current transition-none"
22
+ >
23
+ <CheckIcon className="size-3.5" />
24
+ </CheckboxPrimitive.Indicator>
25
+ </CheckboxPrimitive.Root>
26
+ );
27
+ }
29
28
  export { Checkbox };
@@ -34,12 +34,12 @@ export const CodeBlock = ({
34
34
  return (
35
35
  <div
36
36
  className={cn(
37
- "border code-block-wrapper relative group rounded-md overflow-hidden",
37
+ "border code-block-wrapper relative group rounded-xl overflow-hidden",
38
38
  showLineNumbers && "line-numbers",
39
39
  props.className,
40
40
  )}
41
41
  >
42
- <div className="border-b flex items-center h-10 font-sans bg-black/2">
42
+ <div className="border-b flex items-center py-1 font-sans bg-black/2">
43
43
  <div className="flex items-center gap-1.5 flex-1 text-sm w-full px-3">
44
44
  <LanguageIcon language={language} />
45
45
  {title}
@@ -50,7 +50,7 @@ export const CodeBlock = ({
50
50
  aria-label="Copy code"
51
51
  title="Copy code"
52
52
  className={cn(
53
- "transition px-2 py-2 mx-1 rounded-sm",
53
+ "transition p-1.5 mx-1 rounded-lg",
54
54
  !isCopied && "hover:bg-accent hover:brightness-95",
55
55
  )}
56
56
  disabled={isCopied}
@@ -1,9 +1,31 @@
1
1
  import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
2
2
 
3
- const Collapsible = CollapsiblePrimitive.Root;
3
+ function Collapsible({
4
+ ...props
5
+ }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
6
+ return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
7
+ }
4
8
 
5
- const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
9
+ function CollapsibleTrigger({
10
+ ...props
11
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
12
+ return (
13
+ <CollapsiblePrimitive.CollapsibleTrigger
14
+ data-slot="collapsible-trigger"
15
+ {...props}
16
+ />
17
+ );
18
+ }
6
19
 
7
- const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
20
+ function CollapsibleContent({
21
+ ...props
22
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
23
+ return (
24
+ <CollapsiblePrimitive.CollapsibleContent
25
+ data-slot="collapsible-content"
26
+ {...props}
27
+ />
28
+ );
29
+ }
8
30
 
9
- export { Collapsible, CollapsibleContent, CollapsibleTrigger };
31
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -2,6 +2,7 @@ import { CheckIcon, CopyIcon } from "lucide-react";
2
2
  import type { ReactNode } from "react";
3
3
  import { useRef, useState } from "react";
4
4
  import { cn } from "../util/cn.js";
5
+ import { Button } from "./Button.js";
5
6
 
6
7
  export type CodeBlockProps = {
7
8
  className?: string;
@@ -39,20 +40,22 @@ export const EmbeddedCodeBlock = ({
39
40
  fullHeight && "h-full",
40
41
  )}
41
42
  >
42
- <div
43
- className={cn(
44
- "code-block text-sm not-prose scrollbar [&>pre]:overflow-x-auto [&_code]:p-2",
45
- fullHeight && "h-full [&>pre]:h-full",
46
- props.className,
47
- )}
48
- ref={ref}
49
- >
50
- {children}
43
+ <div className="relative overflow-auto">
44
+ <div
45
+ className={cn(
46
+ "code-block text-sm not-prose scrollbar [&>pre]:overflow-x-auto [&_code]:p-2",
47
+ fullHeight && "h-full [&>pre]:h-full",
48
+ props.className,
49
+ )}
50
+ ref={ref}
51
+ >
52
+ {children}
53
+ </div>
51
54
  </div>
52
55
  {showLanguageIndicator && (
53
56
  <span
54
57
  className={cn(
55
- "absolute top-1.5 end-3 text-[11px]! font-mono text-muted-foreground transition group-hover:opacity-0",
58
+ "absolute top-1.5 end-3 text-[11px]! font-mono text-muted-foreground transition group-hover:opacity-0 pointer-events-none",
56
59
  showCopy === "always" && "hidden",
57
60
  )}
58
61
  >
@@ -60,12 +63,12 @@ export const EmbeddedCodeBlock = ({
60
63
  </span>
61
64
  )}
62
65
  {showCopy !== "never" && (
63
- <button
66
+ <Button
64
67
  type="button"
65
- aria-label="Copy code"
66
- title="Copy code"
68
+ variant="outline"
69
+ size="icon-xs"
67
70
  className={cn(
68
- "absolute top-2 end-2 p-2 transition hover:shadow-xs active:shadow-none active:inset-shadow-xs hover:outline outline-border rounded-md text-sm text-muted-foreground",
71
+ "absolute top-2 end-2 p-2",
69
72
  showCopy === "hover" && "opacity-0 group-hover:opacity-100",
70
73
  showCopyText && "flex gap-2 items-center font-medium",
71
74
  )}
@@ -80,16 +83,16 @@ export const EmbeddedCodeBlock = ({
80
83
  >
81
84
  {isCopied ? (
82
85
  <CheckIcon
83
- className="text-emerald-600"
84
- size={16}
86
+ className="shrink-0 text-emerald-600 dark:text-emerald-300"
87
+ size={13}
85
88
  strokeWidth={2.5}
86
89
  absoluteStrokeWidth
87
90
  />
88
91
  ) : (
89
- <CopyIcon size={16} />
92
+ <CopyIcon className="shrink-0" size={13} />
90
93
  )}
91
94
  {showCopyText && "Copy"}
92
- </button>
95
+ </Button>
93
96
  )}
94
97
  </div>
95
98
  );
@@ -0,0 +1,81 @@
1
+ import type * as React from "react";
2
+ import { cn } from "../util/cn.js";
3
+
4
+ function Frame({ className, ...props }: React.ComponentProps<"div">) {
5
+ return (
6
+ <div
7
+ data-slot="frame"
8
+ className={cn(
9
+ "relative flex flex-col rounded-2xl bg-muted p-1",
10
+ className,
11
+ )}
12
+ {...props}
13
+ />
14
+ );
15
+ }
16
+
17
+ function FramePanel({ className, ...props }: React.ComponentProps<"div">) {
18
+ return (
19
+ <div
20
+ data-slot="frame-panel"
21
+ className={cn(
22
+ "relative bg-clip-padding rounded-xl border bg-card p-5 shadow-xs",
23
+ "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
24
+ className,
25
+ )}
26
+ {...props}
27
+ />
28
+ );
29
+ }
30
+
31
+ function FrameHeader({ className, ...props }: React.ComponentProps<"header">) {
32
+ return (
33
+ <header
34
+ data-slot="frame-panel-header"
35
+ className={cn("flex flex-col p-4", className)}
36
+ {...props}
37
+ />
38
+ );
39
+ }
40
+
41
+ function FrameTitle({ className, ...props }: React.ComponentProps<"div">) {
42
+ return (
43
+ <div
44
+ data-slot="frame-panel-title"
45
+ className={cn("text-sm font-semibold", className)}
46
+ {...props}
47
+ />
48
+ );
49
+ }
50
+
51
+ function FrameDescription({
52
+ className,
53
+ ...props
54
+ }: React.ComponentProps<"div">) {
55
+ return (
56
+ <div
57
+ data-slot="frame-panel-description"
58
+ className={cn("text-sm text-muted-foreground", className)}
59
+ {...props}
60
+ />
61
+ );
62
+ }
63
+
64
+ function FrameFooter({ className, ...props }: React.ComponentProps<"footer">) {
65
+ return (
66
+ <footer
67
+ data-slot="frame-panel-footer"
68
+ className={cn("flex flex-col gap-1 px-5 py-4", className)}
69
+ {...props}
70
+ />
71
+ );
72
+ }
73
+
74
+ export {
75
+ Frame,
76
+ FramePanel,
77
+ FrameHeader,
78
+ FrameTitle,
79
+ FrameDescription,
80
+ FrameFooter,
81
+ };