zudoku 0.64.1 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) 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/config.d.ts +15 -46
  5. package/dist/config/validators/InputNavigationSchema.d.ts +61 -61
  6. package/dist/config/validators/NavigationSchema.js +2 -4
  7. package/dist/config/validators/NavigationSchema.js.map +1 -1
  8. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  9. package/dist/config/validators/validate.d.ts +158 -2
  10. package/dist/config/validators/validate.js +37 -0
  11. package/dist/config/validators/validate.js.map +1 -1
  12. package/dist/config/validators/validate.test.js +43 -0
  13. package/dist/config/validators/validate.test.js.map +1 -1
  14. package/dist/flat-config.d.ts +22 -0
  15. package/dist/lib/auth/issuer.js +3 -0
  16. package/dist/lib/auth/issuer.js.map +1 -1
  17. package/dist/lib/authentication/authentication.d.ts +1 -1
  18. package/dist/lib/authentication/providers/auth0.js +6 -1
  19. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  20. package/dist/lib/authentication/providers/firebase.d.ts +4 -0
  21. package/dist/lib/authentication/providers/firebase.js +215 -0
  22. package/dist/lib/authentication/providers/firebase.js.map +1 -0
  23. package/dist/lib/authentication/providers/supabase.js +1 -6
  24. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  25. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +24 -0
  26. package/dist/lib/authentication/ui/ZudokuAuthUi.js +124 -0
  27. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -0
  28. package/dist/lib/authentication/ui/icons/Apple.d.ts +3 -0
  29. package/dist/lib/authentication/ui/icons/Apple.js +4 -0
  30. package/dist/lib/authentication/ui/icons/Apple.js.map +1 -0
  31. package/dist/lib/authentication/ui/icons/Facebook.d.ts +3 -0
  32. package/dist/lib/authentication/ui/icons/Facebook.js +4 -0
  33. package/dist/lib/authentication/ui/icons/Facebook.js.map +1 -0
  34. package/dist/lib/authentication/ui/icons/Github.d.ts +3 -0
  35. package/dist/lib/authentication/ui/icons/Github.js +4 -0
  36. package/dist/lib/authentication/ui/icons/Github.js.map +1 -0
  37. package/dist/lib/authentication/ui/icons/Google.d.ts +3 -0
  38. package/dist/lib/authentication/ui/icons/Google.js +4 -0
  39. package/dist/lib/authentication/ui/icons/Google.js.map +1 -0
  40. package/dist/lib/authentication/ui/icons/Microsoft.d.ts +3 -0
  41. package/dist/lib/authentication/ui/icons/Microsoft.js +4 -0
  42. package/dist/lib/authentication/ui/icons/Microsoft.js.map +1 -0
  43. package/dist/lib/authentication/ui/icons/X.d.ts +3 -0
  44. package/dist/lib/authentication/ui/icons/X.js +4 -0
  45. package/dist/lib/authentication/ui/icons/X.js.map +1 -0
  46. package/dist/lib/components/Autocomplete.d.ts +3 -1
  47. package/dist/lib/components/Autocomplete.js +6 -2
  48. package/dist/lib/components/Autocomplete.js.map +1 -1
  49. package/dist/lib/components/Heading.d.ts +1 -1
  50. package/dist/lib/components/Layout.js +3 -2
  51. package/dist/lib/components/Layout.js.map +1 -1
  52. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  53. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  54. package/dist/lib/core/RouteGuard.js +6 -6
  55. package/dist/lib/core/RouteGuard.js.map +1 -1
  56. package/dist/lib/errors/ErrorAlert.js +1 -1
  57. package/dist/lib/errors/RouterError.d.ts +3 -1
  58. package/dist/lib/errors/RouterError.js +3 -2
  59. package/dist/lib/errors/RouterError.js.map +1 -1
  60. package/dist/lib/oas/parser/index.js +7 -3
  61. package/dist/lib/oas/parser/index.js.map +1 -1
  62. package/dist/lib/plugins/api-keys/ProtectedRoute.js +4 -1
  63. package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -1
  64. package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +1 -0
  65. package/dist/lib/plugins/openapi/CollapsibleCode.js +2 -1
  66. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -1
  67. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +5 -0
  68. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js +10 -0
  69. package/dist/lib/plugins/openapi/GeneratedExampleSidecarBox.js.map +1 -0
  70. package/dist/lib/plugins/openapi/OperationList.js +5 -1
  71. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  72. package/dist/lib/plugins/openapi/OperationListItem.d.ts +2 -1
  73. package/dist/lib/plugins/openapi/OperationListItem.js +3 -2
  74. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  75. package/dist/lib/plugins/openapi/ParameterList.js +7 -4
  76. package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
  77. package/dist/lib/plugins/openapi/ParameterListItem.js +17 -6
  78. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  79. package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +9 -2
  80. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +5 -2
  81. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  82. package/dist/lib/plugins/openapi/ResponsesSidecarBox.d.ts +3 -2
  83. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +25 -4
  84. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  85. package/dist/lib/plugins/openapi/Sidecar.d.ts +2 -2
  86. package/dist/lib/plugins/openapi/Sidecar.js +53 -26
  87. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  88. package/dist/lib/plugins/openapi/SidecarBox.js +4 -4
  89. package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
  90. package/dist/lib/plugins/openapi/SidecarExamples.d.ts +9 -2
  91. package/dist/lib/plugins/openapi/SidecarExamples.js +24 -43
  92. package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
  93. package/dist/lib/plugins/openapi/components/ConstValue.js +1 -1
  94. package/dist/lib/plugins/openapi/components/ConstValue.js.map +1 -1
  95. package/dist/lib/plugins/openapi/components/EnumValues.js +1 -1
  96. package/dist/lib/plugins/openapi/components/EnumValues.js.map +1 -1
  97. package/dist/lib/plugins/openapi/components/NonHighlightedCode.d.ts +4 -0
  98. package/dist/lib/plugins/openapi/components/NonHighlightedCode.js +5 -0
  99. package/dist/lib/plugins/openapi/components/NonHighlightedCode.js.map +1 -0
  100. package/dist/lib/plugins/openapi/components/ResponseContent.js +5 -6
  101. package/dist/lib/plugins/openapi/components/ResponseContent.js.map +1 -1
  102. package/dist/lib/plugins/openapi/interfaces.d.ts +13 -0
  103. package/dist/lib/plugins/openapi/playground/BodyPanel.js +67 -15
  104. package/dist/lib/plugins/openapi/playground/BodyPanel.js.map +1 -1
  105. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js +2 -2
  106. package/dist/lib/plugins/openapi/playground/CollapsibleHeader.js.map +1 -1
  107. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -1
  108. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  109. package/dist/lib/plugins/openapi/playground/Headers.js +23 -83
  110. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  111. package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +10 -2
  112. package/dist/lib/plugins/openapi/playground/ParamsGrid.js +8 -1
  113. package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -1
  114. package/dist/lib/plugins/openapi/playground/PathParams.js +2 -3
  115. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
  116. package/dist/lib/plugins/openapi/playground/Playground.d.ts +7 -0
  117. package/dist/lib/plugins/openapi/playground/Playground.js +56 -28
  118. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  119. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -2
  120. package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
  121. package/dist/lib/plugins/openapi/playground/QueryParams.js +16 -40
  122. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  123. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.d.ts +8 -0
  124. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js +19 -0
  125. package/dist/lib/plugins/openapi/playground/request-panel/MultipartField.js.map +1 -0
  126. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js +1 -1
  127. package/dist/lib/plugins/openapi/playground/request-panel/UrlQueryParams.js.map +1 -1
  128. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.d.ts +1 -0
  129. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js +540 -0
  130. package/dist/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.js.map +1 -0
  131. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.d.ts +40 -0
  132. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js +205 -0
  133. package/dist/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.js.map +1 -0
  134. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +2 -2
  135. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  136. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js +1 -1
  137. package/dist/lib/plugins/openapi/schema/SchemaExampleAndDefault.js.map +1 -1
  138. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js +17 -8
  139. package/dist/lib/plugins/openapi/schema/SchemaPropertyItem.js.map +1 -1
  140. package/dist/lib/plugins/openapi/schema/SchemaView.d.ts +1 -1
  141. package/dist/lib/plugins/openapi/schema/SchemaView.js +20 -13
  142. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  143. package/dist/lib/plugins/openapi/schema/UnionView.js +2 -5
  144. package/dist/lib/plugins/openapi/schema/UnionView.js.map +1 -1
  145. package/dist/lib/plugins/openapi/schema/union-helpers.js +0 -1
  146. package/dist/lib/plugins/openapi/schema/union-helpers.js.map +1 -1
  147. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +5 -14
  148. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  149. package/dist/lib/ui/Badge.d.ts +3 -3
  150. package/dist/lib/ui/Badge.js +9 -7
  151. package/dist/lib/ui/Badge.js.map +1 -1
  152. package/dist/lib/ui/Button.d.ts +1 -1
  153. package/dist/lib/ui/Button.js +1 -0
  154. package/dist/lib/ui/Button.js.map +1 -1
  155. package/dist/lib/ui/Checkbox.d.ts +2 -2
  156. package/dist/lib/ui/Checkbox.js +4 -4
  157. package/dist/lib/ui/Checkbox.js.map +1 -1
  158. package/dist/lib/ui/CodeBlock.d.ts +0 -1
  159. package/dist/lib/ui/CodeBlock.js +1 -1
  160. package/dist/lib/ui/CodeBlock.js.map +1 -1
  161. package/dist/lib/ui/Collapsible.d.ts +4 -4
  162. package/dist/lib/ui/Collapsible.js +11 -4
  163. package/dist/lib/ui/Collapsible.js.map +1 -1
  164. package/dist/lib/ui/Command.d.ts +3 -3
  165. package/dist/lib/ui/EmbeddedCodeBlock.d.ts +0 -1
  166. package/dist/lib/ui/EmbeddedCodeBlock.js +3 -2
  167. package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  168. package/dist/lib/ui/Frame.d.ts +8 -0
  169. package/dist/lib/ui/Frame.js +22 -0
  170. package/dist/lib/ui/Frame.js.map +1 -0
  171. package/dist/lib/ui/Item.d.ts +23 -0
  172. package/dist/lib/ui/Item.js +67 -0
  173. package/dist/lib/ui/Item.js.map +1 -0
  174. package/dist/lib/ui/NativeSelect.d.ts +5 -0
  175. package/dist/lib/ui/NativeSelect.js +14 -0
  176. package/dist/lib/ui/NativeSelect.js.map +1 -0
  177. package/dist/lib/ui/Select.d.ts +13 -11
  178. package/dist/lib/ui/Select.js +34 -23
  179. package/dist/lib/ui/Select.js.map +1 -1
  180. package/dist/lib/ui/Separator.d.ts +4 -0
  181. package/dist/lib/ui/Separator.js +8 -0
  182. package/dist/lib/ui/Separator.js.map +1 -0
  183. package/dist/lib/ui/Tooltip.d.ts +7 -7
  184. package/dist/lib/ui/Tooltip.js +16 -10
  185. package/dist/lib/ui/Tooltip.js.map +1 -1
  186. package/dist/lib/util/createVariantComponent.d.ts +5 -2
  187. package/dist/lib/util/createVariantComponent.js +5 -2
  188. package/dist/lib/util/createVariantComponent.js.map +1 -1
  189. package/dist/lib/util/flattenAllOf.d.ts +4 -0
  190. package/dist/lib/util/flattenAllOf.js +65 -0
  191. package/dist/lib/util/flattenAllOf.js.map +1 -0
  192. package/dist/lib/util/flattenAllOf.test.d.ts +1 -0
  193. package/dist/lib/util/flattenAllOf.test.js +532 -0
  194. package/dist/lib/util/flattenAllOf.test.js.map +1 -0
  195. package/dist/lib/util/readFrontmatter.d.ts +6 -0
  196. package/dist/lib/util/readFrontmatter.js +12 -0
  197. package/dist/lib/util/readFrontmatter.js.map +1 -0
  198. package/dist/vite/api/SchemaManager.js +6 -18
  199. package/dist/vite/api/SchemaManager.js.map +1 -1
  200. package/dist/vite/mdx/remark-last-modified.js +57 -3
  201. package/dist/vite/mdx/remark-last-modified.js.map +1 -1
  202. package/dist/vite/plugin-api.js +2 -2
  203. package/dist/vite/plugin-api.js.map +1 -1
  204. package/dist/vite/plugin-frontmatter.js +3 -5
  205. package/dist/vite/plugin-frontmatter.js.map +1 -1
  206. package/dist/vite/plugin-markdown-export.js +3 -4
  207. package/dist/vite/plugin-markdown-export.js.map +1 -1
  208. package/dist/vite/plugin-theme.js +10 -1
  209. package/dist/vite/plugin-theme.js.map +1 -1
  210. package/lib/{Button-DmS4u8Lj.js → Button-B3ucvvQw.js} +7 -6
  211. package/lib/Button-B3ucvvQw.js.map +1 -0
  212. package/lib/{ErrorAlert-DE3Sf66a.js → ErrorAlert-BOVgwTRP.js} +2832 -2857
  213. package/lib/ErrorAlert-BOVgwTRP.js.map +1 -0
  214. package/lib/{MdxPage-DZfeC0QY.js → MdxPage-CBYFyqUs.js} +6 -6
  215. package/lib/{MdxPage-DZfeC0QY.js.map → MdxPage-CBYFyqUs.js.map} +1 -1
  216. package/lib/{OAuthErrorPage-BycMozgn.js → OAuthErrorPage-DlTYnbLO.js} +4 -4
  217. package/lib/{OAuthErrorPage-BycMozgn.js.map → OAuthErrorPage-DlTYnbLO.js.map} +1 -1
  218. package/lib/{OasProvider-1XEOsIiW.js → OasProvider-DIPAQ79S.js} +2 -2
  219. package/lib/{OasProvider-1XEOsIiW.js.map → OasProvider-DIPAQ79S.js.map} +1 -1
  220. package/lib/OperationList-BOTFIfda.js +5688 -0
  221. package/lib/OperationList-BOTFIfda.js.map +1 -0
  222. package/lib/{Pagination-CJszmeSA.js → Pagination-BOZ9Pxcw.js} +2 -2
  223. package/lib/{Pagination-CJszmeSA.js.map → Pagination-BOZ9Pxcw.js.map} +1 -1
  224. package/lib/RouteGuard-Brz95MSt.js +77 -0
  225. package/lib/RouteGuard-Brz95MSt.js.map +1 -0
  226. package/lib/RouterError-DQS_bMwf.js +42 -0
  227. package/lib/RouterError-DQS_bMwf.js.map +1 -0
  228. package/lib/{SchemaList-qOHkDzSz.js → SchemaList-Bu95q_q2.js} +7 -7
  229. package/lib/{SchemaList-qOHkDzSz.js.map → SchemaList-Bu95q_q2.js.map} +1 -1
  230. package/lib/SchemaView-CaxK_HV4.js +586 -0
  231. package/lib/SchemaView-CaxK_HV4.js.map +1 -0
  232. package/lib/Select-DFRCS31-.js +399 -0
  233. package/lib/Select-DFRCS31-.js.map +1 -0
  234. package/lib/{SignUp-6SGx9Yyq.js → SignUp-CfB278ao.js} +2 -2
  235. package/lib/{SignUp-6SGx9Yyq.js.map → SignUp-CfB278ao.js.map} +1 -1
  236. package/lib/{SyntaxHighlight-zvlnSnHB.js → SyntaxHighlight-C19vH0V_.js} +525 -509
  237. package/lib/SyntaxHighlight-C19vH0V_.js.map +1 -0
  238. package/lib/{Toc-Da9yp7lo.js → Toc-DQIqdghO.js} +2 -2
  239. package/lib/{Toc-Da9yp7lo.js.map → Toc-DQIqdghO.js.map} +1 -1
  240. package/lib/{circular-CSSuz-LS.js → circular-B-_VyILZ.js} +6360 -5953
  241. package/lib/circular-B-_VyILZ.js.map +1 -0
  242. package/lib/{createServer-CLbcVLbK.js → createServer-C5lXk4ba.js} +4732 -4273
  243. package/lib/createServer-C5lXk4ba.js.map +1 -0
  244. package/lib/{errors-CuGgh3hf.js → errors-DqoyOKev.js} +2 -2
  245. package/lib/{errors-CuGgh3hf.js.map → errors-DqoyOKev.js.map} +1 -1
  246. package/lib/index-B7yD7ZUk.js +3680 -0
  247. package/lib/index-B7yD7ZUk.js.map +1 -0
  248. package/lib/{index-rYHsvtTo.js → index-BG79m3lF.js} +2 -2
  249. package/lib/{index-rYHsvtTo.js.map → index-BG79m3lF.js.map} +1 -1
  250. package/lib/{index-B1rmok4X.js → index-DHDtI9H5.js} +3 -3
  251. package/lib/{index-B1rmok4X.js.map → index-DHDtI9H5.js.map} +1 -1
  252. package/lib/ui/ActionButton.js +1 -1
  253. package/lib/ui/Badge.js +27 -13
  254. package/lib/ui/Badge.js.map +1 -1
  255. package/lib/ui/Button.js +6 -5
  256. package/lib/ui/Button.js.map +1 -1
  257. package/lib/ui/Checkbox.js +29 -26
  258. package/lib/ui/Checkbox.js.map +1 -1
  259. package/lib/ui/CodeBlock.js +7 -7
  260. package/lib/ui/CodeBlock.js.map +1 -1
  261. package/lib/ui/Collapsible.js +32 -5
  262. package/lib/ui/Collapsible.js.map +1 -1
  263. package/lib/ui/EmbeddedCodeBlock.js +26 -25
  264. package/lib/ui/EmbeddedCodeBlock.js.map +1 -1
  265. package/lib/ui/Frame.js +81 -0
  266. package/lib/ui/Frame.js.map +1 -0
  267. package/lib/ui/Item.js +188 -0
  268. package/lib/ui/Item.js.map +1 -0
  269. package/lib/ui/NativeSelect.js +57 -0
  270. package/lib/ui/NativeSelect.js.map +1 -0
  271. package/lib/ui/Select.js +166 -116
  272. package/lib/ui/Select.js.map +1 -1
  273. package/lib/ui/Separator.js +27 -0
  274. package/lib/ui/Separator.js.map +1 -0
  275. package/lib/ui/SyntaxHighlight.js +1 -1
  276. package/lib/ui/Tabs.js +10 -10
  277. package/lib/ui/Tooltip.js +55 -28
  278. package/lib/ui/Tooltip.js.map +1 -1
  279. package/lib/zudoku.__internal.js +345 -345
  280. package/lib/zudoku.__internal.js.map +1 -1
  281. package/lib/zudoku.auth-auth0.js +7 -7
  282. package/lib/zudoku.auth-auth0.js.map +1 -1
  283. package/lib/zudoku.auth-azureb2c.js +3 -3
  284. package/lib/zudoku.auth-clerk.js +1 -1
  285. package/lib/zudoku.auth-openid.js +3 -3
  286. package/lib/zudoku.auth-supabase.js +30 -33
  287. package/lib/zudoku.auth-supabase.js.map +1 -1
  288. package/lib/zudoku.components.js +2 -2
  289. package/lib/zudoku.plugin-api-catalog.js +3 -3
  290. package/lib/zudoku.plugin-api-keys.js +5 -5
  291. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  292. package/lib/zudoku.plugin-markdown.js +1 -1
  293. package/lib/zudoku.plugin-openapi.js +1 -1
  294. package/lib/zudoku.plugin-search-pagefind.js +2 -2
  295. package/package.json +18 -13
  296. package/src/app/main.css +1 -1
  297. package/src/app/main.tsx +5 -1
  298. package/src/lib/auth/issuer.ts +3 -0
  299. package/src/lib/authentication/authentication.ts +1 -1
  300. package/src/lib/authentication/providers/auth0.tsx +6 -1
  301. package/src/lib/authentication/providers/firebase.tsx +284 -0
  302. package/src/lib/authentication/providers/supabase.tsx +2 -7
  303. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +335 -0
  304. package/src/lib/authentication/ui/icons/Apple.tsx +10 -0
  305. package/src/lib/authentication/ui/icons/Facebook.tsx +15 -0
  306. package/src/lib/authentication/ui/icons/Github.tsx +16 -0
  307. package/src/lib/authentication/ui/icons/Google.tsx +16 -0
  308. package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -0
  309. package/src/lib/authentication/ui/icons/X.tsx +10 -0
  310. package/src/lib/components/Autocomplete.tsx +11 -2
  311. package/src/lib/components/Layout.tsx +3 -2
  312. package/src/lib/components/navigation/NavigationItem.tsx +7 -20
  313. package/src/lib/core/RouteGuard.tsx +8 -8
  314. package/src/lib/errors/ErrorAlert.tsx +1 -1
  315. package/src/lib/errors/RouterError.tsx +7 -2
  316. package/src/lib/oas/parser/index.ts +8 -3
  317. package/src/lib/plugins/api-keys/ProtectedRoute.tsx +11 -7
  318. package/src/lib/plugins/openapi/CollapsibleCode.tsx +5 -3
  319. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -0
  320. package/src/lib/plugins/openapi/OperationList.tsx +7 -0
  321. package/src/lib/plugins/openapi/OperationListItem.tsx +10 -7
  322. package/src/lib/plugins/openapi/ParameterList.tsx +37 -23
  323. package/src/lib/plugins/openapi/ParameterListItem.tsx +105 -54
  324. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +48 -7
  325. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +81 -33
  326. package/src/lib/plugins/openapi/Sidecar.tsx +129 -65
  327. package/src/lib/plugins/openapi/SidecarBox.tsx +26 -4
  328. package/src/lib/plugins/openapi/SidecarExamples.tsx +91 -79
  329. package/src/lib/plugins/openapi/components/ConstValue.tsx +1 -1
  330. package/src/lib/plugins/openapi/components/EnumValues.tsx +2 -2
  331. package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -0
  332. package/src/lib/plugins/openapi/components/ResponseContent.tsx +63 -53
  333. package/src/lib/plugins/openapi/interfaces.ts +12 -0
  334. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +246 -30
  335. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +10 -6
  336. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +3 -2
  337. package/src/lib/plugins/openapi/playground/Headers.tsx +103 -219
  338. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +33 -1
  339. package/src/lib/plugins/openapi/playground/PathParams.tsx +26 -34
  340. package/src/lib/plugins/openapi/playground/Playground.tsx +73 -35
  341. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +9 -30
  342. package/src/lib/plugins/openapi/playground/QueryParams.tsx +82 -136
  343. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -0
  344. package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +1 -1
  345. package/src/lib/plugins/openapi/playground/request-panel/fieldManager/useKeyValueFieldManager.test.tsx +872 -0
  346. package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +349 -0
  347. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +2 -6
  348. package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +1 -1
  349. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +89 -55
  350. package/src/lib/plugins/openapi/schema/SchemaView.tsx +82 -53
  351. package/src/lib/plugins/openapi/schema/UnionView.tsx +6 -17
  352. package/src/lib/plugins/openapi/schema/union-helpers.ts +0 -1
  353. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +5 -15
  354. package/src/lib/ui/Badge.tsx +21 -12
  355. package/src/lib/ui/Button.tsx +1 -0
  356. package/src/lib/ui/Checkbox.tsx +23 -24
  357. package/src/lib/ui/CodeBlock.tsx +3 -4
  358. package/src/lib/ui/Collapsible.tsx +26 -4
  359. package/src/lib/ui/EmbeddedCodeBlock.tsx +21 -19
  360. package/src/lib/ui/Frame.tsx +81 -0
  361. package/src/lib/ui/Item.tsx +192 -0
  362. package/src/lib/ui/NativeSelect.tsx +47 -0
  363. package/src/lib/ui/Select.tsx +153 -126
  364. package/src/lib/ui/Separator.tsx +25 -0
  365. package/src/lib/ui/Tooltip.tsx +54 -32
  366. package/src/lib/util/createVariantComponent.tsx +31 -5
  367. package/src/lib/util/flattenAllOf.test.ts +637 -0
  368. package/src/lib/util/flattenAllOf.ts +101 -0
  369. package/src/lib/util/readFrontmatter.ts +13 -0
  370. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +0 -4
  371. package/dist/lib/plugins/openapi/playground/InlineInput.js +0 -3
  372. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +0 -1
  373. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.d.ts +0 -5
  374. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js +0 -7
  375. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.js.map +0 -1
  376. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.d.ts +0 -4
  377. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js +0 -10
  378. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.js.map +0 -1
  379. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.d.ts +0 -5
  380. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js +0 -16
  381. package/dist/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.js.map +0 -1
  382. package/lib/Button-DmS4u8Lj.js.map +0 -1
  383. package/lib/ErrorAlert-DE3Sf66a.js.map +0 -1
  384. package/lib/OperationList-DCJw6wXL.js +0 -5450
  385. package/lib/OperationList-DCJw6wXL.js.map +0 -1
  386. package/lib/RouteGuard-DhU3LRr1.js +0 -81
  387. package/lib/RouteGuard-DhU3LRr1.js.map +0 -1
  388. package/lib/RouterError-VDLnrFqF.js +0 -41
  389. package/lib/RouterError-VDLnrFqF.js.map +0 -1
  390. package/lib/SchemaView-D3hm65cc.js +0 -458
  391. package/lib/SchemaView-D3hm65cc.js.map +0 -1
  392. package/lib/Select-C1DeCqKv.js +0 -372
  393. package/lib/Select-C1DeCqKv.js.map +0 -1
  394. package/lib/SyntaxHighlight-zvlnSnHB.js.map +0 -1
  395. package/lib/circular-CSSuz-LS.js.map +0 -1
  396. package/lib/createServer-CLbcVLbK.js.map +0 -1
  397. package/lib/index-RNAxx6IF.js +0 -3364
  398. package/lib/index-RNAxx6IF.js.map +0 -1
  399. package/src/lib/plugins/openapi/playground/InlineInput.tsx +0 -6
  400. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupConnector.tsx +0 -36
  401. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupItem.tsx +0 -25
  402. package/src/lib/plugins/openapi/schema/AllOfGroup/AllOfGroupView.tsx +0 -42
@@ -1,12 +1,19 @@
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";
8
16
  import { ParamInfos } from "../ParamInfos.js";
9
- import { AllOfGroupView } from "./AllOfGroup/AllOfGroupView.js";
10
17
  import { SchemaExampleAndDefault } from "./SchemaExampleAndDefault.js";
11
18
  import { SchemaPropertyItem } from "./SchemaPropertyItem.js";
12
19
  import { UnionView } from "./UnionView.js";
@@ -23,19 +30,30 @@ const renderMarkdown = (content?: string) =>
23
30
  const renderBasicSchema = (
24
31
  schema: SchemaObject,
25
32
  cardHeader?: React.ReactNode,
26
- ) => (
27
- <Card className="overflow-hidden">
28
- {cardHeader}
29
- <div className="p-4 space-y-2">
33
+ embedded?: boolean,
34
+ ) => {
35
+ const content = (
36
+ <>
30
37
  <span className="text-sm text-muted-foreground">
31
38
  <ParamInfos schema={schema} />
32
39
  </span>
33
40
  {schema.enum && <EnumValues values={schema.enum} />}
34
41
  {renderMarkdown(schema.description)}
35
42
  <SchemaExampleAndDefault schema={schema} />
36
- </div>
37
- </Card>
38
- );
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
+ };
39
57
 
40
58
  export const SchemaView = ({
41
59
  schema,
@@ -50,12 +68,14 @@ export const SchemaView = ({
50
68
  }) => {
51
69
  if (!schema || Object.keys(schema).length === 0) {
52
70
  return (
53
- <Card className="overflow-hidden">
71
+ <Frame>
54
72
  {cardHeader}
55
- <div className="text-sm text-muted-foreground italic p-4">
56
- No data returned
57
- </div>
58
- </Card>
73
+ <FramePanel>
74
+ <div className="text-sm text-muted-foreground italic">
75
+ No data returned
76
+ </div>
77
+ </FramePanel>
78
+ </Frame>
59
79
  );
60
80
  }
61
81
 
@@ -67,12 +87,8 @@ export const SchemaView = ({
67
87
  return <UnionView schema={schema} cardHeader={cardHeader} />;
68
88
  }
69
89
 
70
- if (Array.isArray(schema.allOf)) {
71
- return <AllOfGroupView schema={schema} cardHeader={cardHeader} />;
72
- }
73
-
74
90
  if (isBasicType(schema.type)) {
75
- return renderBasicSchema(schema, cardHeader);
91
+ return renderBasicSchema(schema, cardHeader, embedded);
76
92
  }
77
93
 
78
94
  if (schema.type === "array" && typeof schema.items === "object") {
@@ -92,48 +108,61 @@ export const SchemaView = ({
92
108
  );
93
109
  const groupNames = ["required", "optional", "deprecated"] as const;
94
110
 
95
- const additionalProperties =
96
- typeof schema.additionalProperties === "object" ? (
97
- <SchemaView schema={schema.additionalProperties} embedded />
98
- ) : schema.additionalProperties === true ? (
99
- <div className="text-sm p-4 bg-border/20 hover:bg-border/30 flex items-center gap-1">
100
- <span>Additional properties are allowed</span>
101
- <a
102
- className="p-0.5 -m-0.5"
103
- href="https://swagger.io/docs/specification/v3_0/data-models/dictionaries/"
104
- rel="noopener noreferrer"
105
- target="_blank"
106
- >
107
- <InfoIcon size={14} />
108
- </a>
109
- </div>
110
- ) : null;
111
-
112
- const Component = embedded ? "div" : Card;
111
+ const additionalObjectProperties = typeof schema.additionalProperties ===
112
+ "object" && <SchemaView schema={schema.additionalProperties} embedded />;
113
113
 
114
- return (
115
- <Component className="divide-y overflow-hidden">
116
- {cardHeader}
117
- {groupNames.map(
118
- (group) =>
119
- groupedProperties[group] && (
120
- <ul key={group} className="divide-y">
121
- {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 />}
122
123
  <SchemaPropertyItem
123
- key={name}
124
124
  name={name}
125
125
  schema={schema}
126
126
  group={group}
127
127
  defaultOpen={defaultOpen}
128
128
  />
129
- ))}
130
- </ul>
131
- ),
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>
132
147
  )}
133
- {additionalProperties}
134
- </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>
135
166
  );
136
167
  }
137
-
138
- return null;
139
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
  };
@@ -36,7 +36,6 @@ export const unionVariants = (schema: SchemaObject): SchemaObject[] => {
36
36
  const shouldInherit =
37
37
  !variant.properties &&
38
38
  !variant.type &&
39
- !variant.allOf &&
40
39
  !variant.oneOf &&
41
40
  !variant.anyOf;
42
41
 
@@ -85,23 +85,14 @@ export const generateSchemaExample = (
85
85
  return schema.enum[0];
86
86
  }
87
87
 
88
- if (schema.oneOf) {
89
- const randomIndex = Math.floor(Math.random() * schema.oneOf.length);
90
- return generateSchemaExample(schema.oneOf[randomIndex] as SchemaObject);
88
+ if (schema.oneOf && schema.oneOf.length > 0) {
89
+ return generateSchemaExample(schema.oneOf[0]);
91
90
  }
92
91
 
93
- if (schema.anyOf) {
92
+ if (schema.anyOf && schema.anyOf.length > 0) {
94
93
  // Should likely be expanded to return a partial set of values, but it would require
95
94
  // detection if being used within an array or a string type.
96
- const randomIndex = Math.floor(Math.random() * schema.anyOf.length);
97
- return generateSchemaExample(schema.anyOf[randomIndex] as SchemaObject);
98
- }
99
-
100
- if (schema.allOf) {
101
- // https://swagger.io/docs/specification/v3_0/data-models/oneof-anyof-allof-not/#allof
102
- return schema.allOf.reduce((acc, allOfSchema) => {
103
- return { ...acc, ...generateSchemaExample(allOfSchema as SchemaObject) };
104
- }, {});
95
+ return generateSchemaExample(schema.anyOf[0]);
105
96
  }
106
97
 
107
98
  // Check for property-level examples
@@ -110,8 +101,7 @@ export const generateSchemaExample = (
110
101
  Array.isArray(schema.examples) &&
111
102
  schema.examples.length > 0
112
103
  ) {
113
- const randomIndex = Math.floor(Math.random() * schema.examples.length);
114
- return schema.examples[randomIndex];
104
+ return schema.examples[0];
115
105
  }
116
106
 
117
107
  switch (schema.type) {
@@ -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 };
@@ -6,7 +6,6 @@ import { useCopyToClipboard } from "../util/useCopyToClipboard.js";
6
6
 
7
7
  export type CodeBlockProps = {
8
8
  className?: string;
9
- noBackground?: boolean;
10
9
  wrapLines?: boolean;
11
10
  showLanguageIndicator?: boolean;
12
11
  language?: string;
@@ -35,12 +34,12 @@ export const CodeBlock = ({
35
34
  return (
36
35
  <div
37
36
  className={cn(
38
- "border code-block-wrapper relative group rounded-md overflow-hidden",
37
+ "border code-block-wrapper relative group rounded-xl overflow-hidden",
39
38
  showLineNumbers && "line-numbers",
40
39
  props.className,
41
40
  )}
42
41
  >
43
- <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">
44
43
  <div className="flex items-center gap-1.5 flex-1 text-sm w-full px-3">
45
44
  <LanguageIcon language={language} />
46
45
  {title}
@@ -51,7 +50,7 @@ export const CodeBlock = ({
51
50
  aria-label="Copy code"
52
51
  title="Copy code"
53
52
  className={cn(
54
- "transition px-2 py-2 mx-1 rounded-sm",
53
+ "transition p-1.5 mx-1 rounded-lg",
55
54
  !isCopied && "hover:bg-accent hover:brightness-95",
56
55
  )}
57
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,10 +2,10 @@ 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;
8
- noBackground?: boolean;
9
9
  wrapLines?: boolean;
10
10
  showLanguageIndicator?: boolean;
11
11
  language?: string;
@@ -40,20 +40,22 @@ export const EmbeddedCodeBlock = ({
40
40
  fullHeight && "h-full",
41
41
  )}
42
42
  >
43
- <div
44
- className={cn(
45
- "code-block text-sm not-prose scrollbar [&>pre]:overflow-x-auto [&>pre]:p-2",
46
- fullHeight && "h-full [&>pre]:h-full",
47
- props.className,
48
- )}
49
- ref={ref}
50
- >
51
- {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>
52
54
  </div>
53
55
  {showLanguageIndicator && (
54
56
  <span
55
57
  className={cn(
56
- "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",
57
59
  showCopy === "always" && "hidden",
58
60
  )}
59
61
  >
@@ -61,12 +63,12 @@ export const EmbeddedCodeBlock = ({
61
63
  </span>
62
64
  )}
63
65
  {showCopy !== "never" && (
64
- <button
66
+ <Button
65
67
  type="button"
66
- aria-label="Copy code"
67
- title="Copy code"
68
+ variant="outline"
69
+ size="icon-xs"
68
70
  className={cn(
69
- "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",
70
72
  showCopy === "hover" && "opacity-0 group-hover:opacity-100",
71
73
  showCopyText && "flex gap-2 items-center font-medium",
72
74
  )}
@@ -81,16 +83,16 @@ export const EmbeddedCodeBlock = ({
81
83
  >
82
84
  {isCopied ? (
83
85
  <CheckIcon
84
- className="text-emerald-600"
85
- size={16}
86
+ className="shrink-0 text-emerald-600 dark:text-emerald-300"
87
+ size={13}
86
88
  strokeWidth={2.5}
87
89
  absoluteStrokeWidth
88
90
  />
89
91
  ) : (
90
- <CopyIcon size={16} />
92
+ <CopyIcon className="shrink-0" size={13} />
91
93
  )}
92
94
  {showCopyText && "Copy"}
93
- </button>
95
+ </Button>
94
96
  )}
95
97
  </div>
96
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
+ };