zudoku 0.0.0-f1a6fd4 → 0.0.0-f2fd45c
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.
- package/cli.js +2 -2
- package/dist/app/entry.client.js +2 -2
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.js +3 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.d.ts +1 -0
- package/dist/app/main.js +9 -26
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/cli/cli.js +1 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/machine-id/lib.js.map +1 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/cli/common/utils/box.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +21 -6
- package/dist/config/validators/InputSidebarSchema.js +7 -28
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/SidebarSchema.d.ts +24 -1
- package/dist/config/validators/SidebarSchema.js +80 -44
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +408 -262
- package/dist/config/validators/validate.js +23 -7
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/authentication/components/CallbackHandler.js +21 -31
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -1
- package/dist/lib/authentication/hook.js +1 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/auth0.js +1 -0
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/components/Header.js +6 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/MobileTopNavigation.js +4 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +2 -1
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +4 -1
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +3 -0
- package/dist/lib/components/TopNavigation.js +38 -5
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +6 -10
- package/dist/lib/components/context/ZudokuContext.js +26 -20
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +17 -8
- package/dist/lib/components/index.js +10 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/Sidebar.js +3 -3
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js +18 -9
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +12 -7
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +10 -14
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +3 -6
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/errors/ErrorAlert.d.ts +1 -1
- package/dist/lib/errors/ErrorAlert.js +8 -3
- package/dist/lib/errors/ErrorAlert.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.js +2 -2
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +5 -6
- package/dist/lib/plugins/markdown/index.js +31 -3
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.d.ts +38 -0
- package/dist/lib/plugins/markdown/resolver.js +75 -0
- package/dist/lib/plugins/markdown/resolver.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +2 -2
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +2 -1
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +2 -5
- package/dist/lib/plugins/redirect/index.js +1 -1
- package/dist/lib/plugins/redirect/index.js.map +1 -1
- package/dist/lib/ui/Accordion.d.ts +7 -0
- package/dist/lib/ui/Accordion.js +14 -0
- package/dist/lib/ui/Accordion.js.map +1 -0
- package/dist/lib/ui/Alert.d.ts +8 -0
- package/dist/lib/ui/Alert.js +23 -0
- package/dist/lib/ui/Alert.js.map +1 -0
- package/dist/lib/ui/AlertDialog.d.ts +20 -0
- package/dist/lib/ui/AlertDialog.js +27 -0
- package/dist/lib/ui/AlertDialog.js.map +1 -0
- package/dist/lib/ui/AspectRatio.d.ts +3 -0
- package/dist/lib/ui/AspectRatio.js +4 -0
- package/dist/lib/ui/AspectRatio.js.map +1 -0
- package/dist/lib/ui/Badge.d.ts +9 -0
- package/dist/lib/ui/Badge.js +21 -0
- package/dist/lib/ui/Badge.js.map +1 -0
- package/dist/lib/ui/Breadcrumb.d.ts +19 -0
- package/dist/lib/ui/Breadcrumb.js +24 -0
- package/dist/lib/ui/Breadcrumb.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +2 -3
- package/dist/lib/ui/Button.js +1 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/ui/Carousel.d.ts +18 -0
- package/dist/lib/ui/Carousel.js +99 -0
- package/dist/lib/ui/Carousel.js.map +1 -0
- package/dist/lib/ui/Checkbox.d.ts +4 -0
- package/dist/lib/ui/Checkbox.js +9 -0
- package/dist/lib/ui/Checkbox.js.map +1 -0
- package/dist/lib/ui/Collapsible.d.ts +5 -0
- package/dist/lib/ui/Collapsible.js +6 -0
- package/dist/lib/ui/Collapsible.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +80 -0
- package/dist/lib/ui/Command.js +31 -0
- package/dist/lib/ui/Command.js.map +1 -0
- package/dist/lib/{components → ui}/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -0
- package/dist/lib/ui/Form.d.ts +23 -0
- package/dist/lib/ui/Form.js +63 -0
- package/dist/lib/ui/Form.js.map +1 -0
- package/dist/lib/ui/HoverCard.d.ts +6 -0
- package/dist/lib/ui/HoverCard.js +10 -0
- package/dist/lib/ui/HoverCard.js.map +1 -0
- package/dist/lib/ui/Label.d.ts +5 -0
- package/dist/lib/ui/Label.js +10 -0
- package/dist/lib/ui/Label.js.map +1 -0
- package/dist/lib/ui/Pagination.d.ts +28 -0
- package/dist/lib/ui/Pagination.js +24 -0
- package/dist/lib/ui/Pagination.js.map +1 -0
- package/dist/lib/ui/Popover.d.ts +6 -0
- package/dist/lib/ui/Popover.js +10 -0
- package/dist/lib/ui/Popover.js.map +1 -0
- package/dist/lib/ui/Progress.d.ts +4 -0
- package/dist/lib/ui/Progress.js +8 -0
- package/dist/lib/ui/Progress.js.map +1 -0
- package/dist/lib/ui/RadioGroup.d.ts +5 -0
- package/dist/lib/ui/RadioGroup.js +15 -0
- package/dist/lib/ui/RadioGroup.js.map +1 -0
- package/dist/lib/ui/ScrollArea.d.ts +5 -0
- package/dist/lib/ui/ScrollArea.js +12 -0
- package/dist/lib/ui/ScrollArea.js.map +1 -0
- package/dist/lib/ui/Select.js.map +1 -0
- package/dist/lib/ui/Skeleton.d.ts +2 -0
- package/dist/lib/ui/Skeleton.js +7 -0
- package/dist/lib/ui/Skeleton.js.map +1 -0
- package/dist/lib/ui/Slider.d.ts +4 -0
- package/dist/lib/ui/Slider.js +8 -0
- package/dist/lib/ui/Slider.js.map +1 -0
- package/dist/lib/ui/Switch.d.ts +4 -0
- package/dist/lib/ui/Switch.js +8 -0
- package/dist/lib/ui/Switch.js.map +1 -0
- package/dist/lib/ui/Textarea.d.ts +4 -0
- package/dist/lib/ui/Textarea.js +9 -0
- package/dist/lib/ui/Textarea.js.map +1 -0
- package/dist/lib/ui/Toggle.d.ts +12 -0
- package/dist/lib/ui/Toggle.js +26 -0
- package/dist/lib/ui/Toggle.js.map +1 -0
- package/dist/lib/ui/ToggleGroup.d.ts +12 -0
- package/dist/lib/ui/ToggleGroup.js +21 -0
- package/dist/lib/ui/ToggleGroup.js.map +1 -0
- package/dist/lib/ui/Tooltip.d.ts +7 -0
- package/dist/lib/ui/Tooltip.js +11 -0
- package/dist/lib/ui/Tooltip.js.map +1 -0
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/invariant.d.ts +9 -0
- package/dist/lib/util/invariant.js +7 -3
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/lib/util/useExposedProps.js +3 -2
- package/dist/lib/util/useExposedProps.js.map +1 -1
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +12 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +2 -8
- package/dist/vite/config.js +24 -59
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/debug.d.ts +1 -0
- package/dist/vite/debug.js +10 -0
- package/dist/vite/debug.js.map +1 -0
- package/dist/vite/dev-server.js +1 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +101 -0
- package/dist/vite/output.js +30 -0
- package/dist/vite/output.js.map +1 -0
- package/dist/vite/plugin-component.js +17 -7
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.js +0 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +2 -3
- package/dist/vite/plugin-config.js +2 -3
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.js +37 -26
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-frontmatter.d.ts +2 -1
- package/dist/vite/plugin-frontmatter.js +27 -24
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/dist/vite/plugin-mdx.js +14 -0
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +3 -0
- package/dist/vite/plugin-search.js +26 -0
- package/dist/vite/plugin-search.js.map +1 -0
- package/dist/vite/plugin-sidebar.js +7 -6
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/dist/vite/plugin.js +4 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +5 -1
- package/dist/vite/prerender.js +6 -5
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{utils-Chi3p5nE.js → AnchorLink-BbB2q-jx.js} +231 -275
- package/lib/AnchorLink-BbB2q-jx.js.map +1 -0
- package/lib/{AuthenticationPlugin-CbgJ5SAh.js → AuthenticationPlugin-C9BHGXlE.js} +3 -3
- package/lib/{AuthenticationPlugin-CbgJ5SAh.js.map → AuthenticationPlugin-C9BHGXlE.js.map} +1 -1
- package/lib/{CategoryHeading-3Qtp2yZ8.js → CategoryHeading-Bb9dqxD3.js} +4 -4
- package/lib/{CategoryHeading-3Qtp2yZ8.js.map → CategoryHeading-Bb9dqxD3.js.map} +1 -1
- package/lib/ClientOnly-CVN6leDu.js +11 -0
- package/lib/ClientOnly-CVN6leDu.js.map +1 -0
- package/lib/{DeveloperHint-BE9DzNhv.js → DeveloperHint-DHdLXGHA.js} +2 -2
- package/lib/{DeveloperHint-BE9DzNhv.js.map → DeveloperHint-DHdLXGHA.js.map} +1 -1
- package/lib/Dialog-k70Qfukb.js +67 -0
- package/lib/Dialog-k70Qfukb.js.map +1 -0
- package/lib/{Markdown-CWI6lU11.js → Markdown-BDcCAWwm.js} +4268 -6650
- package/lib/Markdown-BDcCAWwm.js.map +1 -0
- package/lib/{MdxPage-C3tlrV4j.js → MdxPage-DKMH_t0f.js} +33 -31
- package/lib/MdxPage-DKMH_t0f.js.map +1 -0
- package/lib/{OperationList-BO-ES1C5.js → OperationList-Tj7ubW_t.js} +131 -128
- package/lib/OperationList-Tj7ubW_t.js.map +1 -0
- package/lib/{Route-Dq6zv0Pi.js → Route-C3DGB6OS.js} +3 -3
- package/lib/{Route-Dq6zv0Pi.js.map → Route-C3DGB6OS.js.map} +1 -1
- package/lib/Select-Bagt3Bme.js +223 -0
- package/lib/Select-Bagt3Bme.js.map +1 -0
- package/lib/SlotletProvider-Da7eFgd2.js +241 -0
- package/lib/SlotletProvider-Da7eFgd2.js.map +1 -0
- package/lib/Spinner-C6zroowC.js +40 -0
- package/lib/Spinner-C6zroowC.js.map +1 -0
- package/lib/StaggeredRender-DDHSzQKE.js +17 -0
- package/lib/StaggeredRender-DDHSzQKE.js.map +1 -0
- package/lib/{ZudokuContext-BEmsYQoq.js → ZudokuContext-BKXGJTmu.js} +460 -411
- package/lib/ZudokuContext-BKXGJTmu.js.map +1 -0
- package/lib/__vite-browser-external-BYRIRx8p.js +9 -0
- package/lib/__vite-browser-external-BYRIRx8p.js.map +1 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js +29 -0
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +1 -0
- package/lib/assets/worker-Bf8vjASY.js.map +1 -1
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/hook-sn0zMTkE.js +229 -0
- package/lib/hook-sn0zMTkE.js.map +1 -0
- package/lib/{index-DNfiZTPV.js → index-AjWCJNGC.js} +1332 -1606
- package/lib/index-AjWCJNGC.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/{index-DJqnphbT.js.map → index-Bn6Lc9tq.js.map} +1 -1
- package/lib/index-BuAyrJe3.js +46 -0
- package/lib/index-BuAyrJe3.js.map +1 -0
- package/lib/{index-BRCiYFaL.js → index-CRo94sKK.js} +6 -4
- package/lib/{index-BRCiYFaL.js.map → index-CRo94sKK.js.map} +1 -1
- package/lib/{index-D06ATMgg.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-D06ATMgg.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/index.esm-C5mr_sKO.js +1193 -0
- package/lib/index.esm-C5mr_sKO.js.map +1 -0
- package/lib/invariant-Caa8-XvF.js +26 -0
- package/lib/invariant-Caa8-XvF.js.map +1 -0
- package/lib/{router-Oe6YmY6B.js → router-BsfSoK2j.js} +3 -3
- package/lib/{router-Oe6YmY6B.js.map → router-BsfSoK2j.js.map} +1 -1
- package/lib/ui/Accordion.js +47 -0
- package/lib/ui/Accordion.js.map +1 -0
- package/lib/ui/Alert.js +51 -0
- package/lib/ui/Alert.js.map +1 -0
- package/lib/ui/AlertDialog.js +114 -0
- package/lib/ui/AlertDialog.js.map +1 -0
- package/lib/ui/AspectRatio.js +6 -0
- package/lib/ui/AspectRatio.js.map +1 -0
- package/lib/ui/Badge.js +27 -0
- package/lib/ui/Badge.js.map +1 -0
- package/lib/ui/Breadcrumb.js +94 -0
- package/lib/ui/Breadcrumb.js.map +1 -0
- package/lib/ui/Button.js +49 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/Callout.js +77 -0
- package/lib/ui/Callout.js.map +1 -0
- package/lib/ui/Card.js +62 -0
- package/lib/ui/Card.js.map +1 -0
- package/lib/ui/Carousel.js +1410 -0
- package/lib/ui/Carousel.js.map +1 -0
- package/lib/ui/Checkbox.js +28 -0
- package/lib/ui/Checkbox.js.map +1 -0
- package/lib/ui/Collapsible.js +8 -0
- package/lib/ui/Collapsible.js.map +1 -0
- package/lib/ui/Command.js +550 -0
- package/lib/ui/Command.js.map +1 -0
- package/lib/ui/Dialog.js +101 -0
- package/lib/ui/Dialog.js.map +1 -0
- package/lib/ui/Drawer.js +1153 -0
- package/lib/ui/Drawer.js.map +1 -0
- package/lib/ui/DropdownMenu.js +145 -0
- package/lib/ui/DropdownMenu.js.map +1 -0
- package/lib/ui/Form.js +95 -0
- package/lib/ui/Form.js.map +1 -0
- package/lib/ui/HoverCard.js +24 -0
- package/lib/ui/HoverCard.js.map +1 -0
- package/lib/ui/Input.js +22 -0
- package/lib/ui/Input.js.map +1 -0
- package/lib/ui/Label.js +20 -0
- package/lib/ui/Label.js.map +1 -0
- package/lib/ui/Pagination.js +106 -0
- package/lib/ui/Pagination.js.map +1 -0
- package/lib/ui/Popover.js +24 -0
- package/lib/ui/Popover.js.map +1 -0
- package/lib/ui/Progress.js +27 -0
- package/lib/ui/Progress.js.map +1 -0
- package/lib/ui/RadioGroup.js +32 -0
- package/lib/ui/RadioGroup.js.map +1 -0
- package/lib/ui/ScrollArea.js +39 -0
- package/lib/ui/ScrollArea.js.map +1 -0
- package/lib/ui/Select.js +122 -0
- package/lib/ui/Select.js.map +1 -0
- package/lib/ui/Skeleton.js +18 -0
- package/lib/ui/Skeleton.js.map +1 -0
- package/lib/ui/Slider.js +24 -0
- package/lib/ui/Slider.js.map +1 -0
- package/lib/ui/Switch.js +28 -0
- package/lib/ui/Switch.js.map +1 -0
- package/lib/ui/Tabs.js +47 -0
- package/lib/ui/Tabs.js.map +1 -0
- package/lib/ui/Textarea.js +21 -0
- package/lib/ui/Textarea.js.map +1 -0
- package/lib/ui/Toggle.js +38 -0
- package/lib/ui/Toggle.js.map +1 -0
- package/lib/ui/ToggleGroup.js +42 -0
- package/lib/ui/ToggleGroup.js.map +1 -0
- package/lib/ui/Tooltip.js +24 -0
- package/lib/ui/Tooltip.js.map +1 -0
- package/lib/urql-core-KJnLL26g.js.map +1 -1
- package/lib/useExposedProps-ChOIUaS4.js +9 -0
- package/lib/useExposedProps-ChOIUaS4.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +4 -4
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +477 -483
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +920 -2889
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +69 -76
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +9 -8
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +93 -27
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -9
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +2 -2
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +9 -13
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +32 -9
- package/src/app/entry.client.tsx +4 -2
- package/src/app/entry.server.tsx +4 -0
- package/src/app/main.css +4 -1
- package/src/app/main.tsx +12 -30
- package/src/app/standalone.tsx +1 -1
- package/src/lib/authentication/components/CallbackHandler.tsx +20 -51
- package/src/lib/authentication/hook.ts +1 -1
- package/src/lib/authentication/providers/auth0.tsx +1 -0
- package/src/lib/components/Header.tsx +17 -2
- package/src/lib/components/MobileTopNavigation.tsx +6 -2
- package/src/lib/components/SlotletProvider.tsx +2 -0
- package/src/lib/components/SyntaxHighlight.tsx +5 -1
- package/src/lib/components/TopNavigation.tsx +70 -23
- package/src/lib/components/context/ZudokuContext.ts +28 -20
- package/src/lib/components/index.ts +13 -4
- package/src/lib/components/navigation/Sidebar.tsx +6 -6
- package/src/lib/components/navigation/SidebarCategory.tsx +35 -29
- package/src/lib/components/navigation/SidebarItem.tsx +17 -20
- package/src/lib/components/navigation/utils.ts +11 -16
- package/src/lib/core/DevPortalContext.ts +3 -2
- package/src/lib/core/plugins.ts +2 -0
- package/src/lib/errors/ErrorAlert.tsx +18 -5
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/custom-pages/CustomPage.tsx +2 -2
- package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
- package/src/lib/plugins/markdown/index.tsx +49 -12
- package/src/lib/plugins/markdown/resolver.ts +92 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +2 -2
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +3 -3
- package/src/lib/plugins/openapi/client/worker.ts +2 -2
- package/src/lib/plugins/openapi/index.tsx +1 -1
- package/src/lib/plugins/openapi/playground/Playground.tsx +4 -3
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/redirect/index.tsx +3 -7
- package/src/lib/ui/Accordion.tsx +56 -0
- package/src/lib/ui/{Note.tsx → Alert.tsx} +11 -10
- package/src/lib/ui/AlertDialog.tsx +139 -0
- package/src/lib/ui/AspectRatio.tsx +5 -0
- package/src/lib/ui/Badge.tsx +36 -0
- package/src/lib/ui/Breadcrumb.tsx +115 -0
- package/src/lib/ui/Button.tsx +1 -1
- package/src/lib/ui/Carousel.tsx +260 -0
- package/src/lib/ui/Checkbox.tsx +28 -0
- package/src/lib/ui/Collapsible.tsx +9 -0
- package/src/lib/ui/Command.tsx +151 -0
- package/src/lib/{components → ui}/Dialog.tsx +4 -3
- package/src/lib/ui/Form.tsx +177 -0
- package/src/lib/ui/HoverCard.tsx +27 -0
- package/src/lib/ui/Label.tsx +24 -0
- package/src/lib/ui/Pagination.tsx +117 -0
- package/src/lib/ui/Popover.tsx +29 -0
- package/src/lib/ui/Progress.tsx +26 -0
- package/src/lib/ui/RadioGroup.tsx +42 -0
- package/src/lib/ui/ScrollArea.tsx +46 -0
- package/src/lib/ui/Skeleton.tsx +15 -0
- package/src/lib/ui/Slider.tsx +26 -0
- package/src/lib/ui/Switch.tsx +27 -0
- package/src/lib/ui/Textarea.tsx +23 -0
- package/src/lib/ui/Toggle.tsx +43 -0
- package/src/lib/ui/ToggleGroup.tsx +59 -0
- package/src/lib/ui/Tooltip.tsx +28 -0
- package/src/lib/util/MdxComponents.tsx +0 -1
- package/src/lib/util/invariant.ts +15 -3
- package/src/lib/util/useExposedProps.tsx +8 -2
- package/src/lib/util/useScrollToAnchor.ts +1 -1
- package/dist/internal.d.ts +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/lib/components/Dialog.js.map +0 -1
- package/dist/lib/components/Select.js.map +0 -1
- package/dist/lib/plugins/markdown/generateRoutes.d.ts +0 -3
- package/dist/lib/plugins/markdown/generateRoutes.js +0 -21
- package/dist/lib/plugins/markdown/generateRoutes.js.map +0 -1
- package/dist/lib/ui/Note.d.ts +0 -8
- package/dist/lib/ui/Note.js +0 -23
- package/dist/lib/ui/Note.js.map +0 -1
- package/lib/ErrorPage-B0COs372.js +0 -16
- package/lib/ErrorPage-B0COs372.js.map +0 -1
- package/lib/Input-CHfE_2Qk.js +0 -2229
- package/lib/Input-CHfE_2Qk.js.map +0 -1
- package/lib/Markdown-CWI6lU11.js.map +0 -1
- package/lib/MdxPage-C3tlrV4j.js.map +0 -1
- package/lib/OperationList-BO-ES1C5.js.map +0 -1
- package/lib/SidebarBadge-DmI5hT04.js +0 -503
- package/lib/SidebarBadge-DmI5hT04.js.map +0 -1
- package/lib/SlotletProvider-RvaeLR6z.js +0 -239
- package/lib/SlotletProvider-RvaeLR6z.js.map +0 -1
- package/lib/Spinner-3cQDBVGr.js +0 -7
- package/lib/Spinner-3cQDBVGr.js.map +0 -1
- package/lib/ZudokuContext-BEmsYQoq.js.map +0 -1
- package/lib/index-DJqnphbT.js +0 -35
- package/lib/index-DNfiZTPV.js.map +0 -1
- package/lib/index-Do_BBSIs.js +0 -2867
- package/lib/index-Do_BBSIs.js.map +0 -1
- package/lib/index-Dvh1BL_e.js +0 -124
- package/lib/index-Dvh1BL_e.js.map +0 -1
- package/lib/joinPath-B7kNnUX4.js +0 -8
- package/lib/joinPath-B7kNnUX4.js.map +0 -1
- package/lib/useExposedProps-Csw8oAlt.js +0 -9
- package/lib/useExposedProps-Csw8oAlt.js.map +0 -1
- package/lib/utils-Chi3p5nE.js.map +0 -1
- package/src/lib/plugins/markdown/generateRoutes.tsx +0 -38
- /package/dist/lib/{components → ui}/Dialog.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.d.ts +0 -0
- /package/dist/lib/{components → ui}/Select.js +0 -0
- /package/src/lib/{components → ui}/Select.tsx +0 -0
|
@@ -68,14 +68,16 @@ export const MdxPage = ({
|
|
|
68
68
|
"max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]",
|
|
69
69
|
)}
|
|
70
70
|
>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{title}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
{(category || title) && (
|
|
72
|
+
<header>
|
|
73
|
+
{category && <CategoryHeading>{category}</CategoryHeading>}
|
|
74
|
+
{title && (
|
|
75
|
+
<Heading level={1} id={slugify(title)}>
|
|
76
|
+
{title}
|
|
77
|
+
</Heading>
|
|
78
|
+
)}
|
|
79
|
+
</header>
|
|
80
|
+
)}
|
|
79
81
|
<MdxComponent
|
|
80
82
|
components={{ ...useMDXComponents(), ...MarkdownHeadings }}
|
|
81
83
|
/>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Toc } from "@stefanprobst/rehype-extract-toc";
|
|
2
2
|
import type { MDXProps } from "mdx/types.js";
|
|
3
|
+
import { RouteObject } from "react-router-dom";
|
|
4
|
+
import { ZudokuDocsConfig } from "../../../config/validators/validate.js";
|
|
3
5
|
import type { DevPortalPlugin } from "../../core/plugins.js";
|
|
4
|
-
import {
|
|
6
|
+
import { DocResolver } from "./resolver.js";
|
|
5
7
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
filesPath: string;
|
|
10
|
-
};
|
|
8
|
+
export interface MarkdownPluginOptions extends ZudokuDocsConfig {
|
|
9
|
+
fileImports: Record<string, () => Promise<MDXImport>>;
|
|
10
|
+
}
|
|
11
11
|
export type MarkdownPluginDefaultOptions = Pick<
|
|
12
12
|
Frontmatter,
|
|
13
13
|
"toc" | "disablePager"
|
|
@@ -27,10 +27,47 @@ export type MDXImport = {
|
|
|
27
27
|
default: (props: MDXProps) => JSX.Element;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export const markdownPlugin = (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
export const markdownPlugin = (
|
|
31
|
+
options: MarkdownPluginOptions[],
|
|
32
|
+
): DevPortalPlugin => ({
|
|
33
|
+
getRoutes: () => {
|
|
34
|
+
const routeMap = new Map<string, RouteObject>();
|
|
35
|
+
options.forEach(({ fileImports, files, defaultOptions }) =>
|
|
36
|
+
Object.entries(fileImports).flatMap(([file, importPromise]) => {
|
|
37
|
+
const routePath = DocResolver.resolveRoutePath({
|
|
38
|
+
filesGlob: files,
|
|
39
|
+
fsPath: file,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
if (!routePath) return [];
|
|
43
|
+
|
|
44
|
+
if (routeMap.has(routePath)) {
|
|
45
|
+
// eslint-disable-next-line no-console
|
|
46
|
+
console.warn(
|
|
47
|
+
`Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,
|
|
48
|
+
);
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const route: RouteObject = {
|
|
53
|
+
path: routePath,
|
|
54
|
+
lazy: async () => {
|
|
55
|
+
const { MdxPage } = await import("./MdxPage.js");
|
|
56
|
+
const { default: Component, ...props } = await importPromise();
|
|
57
|
+
return {
|
|
58
|
+
element: (
|
|
59
|
+
<MdxPage
|
|
60
|
+
mdxComponent={Component}
|
|
61
|
+
{...props}
|
|
62
|
+
defaultOptions={defaultOptions}
|
|
63
|
+
/>
|
|
64
|
+
),
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
routeMap.set(routePath, route);
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
return [...routeMap.values()];
|
|
72
|
+
},
|
|
36
73
|
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import {
|
|
4
|
+
ZudokuConfig,
|
|
5
|
+
ZudokuDocsConfig,
|
|
6
|
+
} from "../../../config/validators/validate.js";
|
|
7
|
+
|
|
8
|
+
const DEFAULT_DOCS_FILES = "/pages/**/*.{md,mdx}";
|
|
9
|
+
|
|
10
|
+
// TODO: This should be dynamic based on the glob selector
|
|
11
|
+
const SUPPORTED_EXTENSIONS = [".md", ".mdx"];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Utilities for resolving markdown file paths and routes
|
|
15
|
+
*/
|
|
16
|
+
export class DocResolver {
|
|
17
|
+
constructor(private config: ZudokuConfig) {}
|
|
18
|
+
|
|
19
|
+
fileMap = new Map<string, string>();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Gets the default docs config from the zudoku config
|
|
23
|
+
*/
|
|
24
|
+
getDocsConfigs() {
|
|
25
|
+
const docsConfigs: ZudokuDocsConfig[] = this.config.docs
|
|
26
|
+
? Array.isArray(this.config.docs)
|
|
27
|
+
? this.config.docs
|
|
28
|
+
: [this.config.docs]
|
|
29
|
+
: [{ files: DEFAULT_DOCS_FILES }];
|
|
30
|
+
|
|
31
|
+
return docsConfigs;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Resolves the first matching file system path for a given docId
|
|
36
|
+
* @param docId - The docId to resolve
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
resolveFilePath(docId: string) {
|
|
40
|
+
const docsConfigs = this.getDocsConfigs();
|
|
41
|
+
let fsPath: string | undefined;
|
|
42
|
+
|
|
43
|
+
docsConfigs.forEach(({ files: fileGlob }) => {
|
|
44
|
+
if (fsPath) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const rootDir = DocResolver.getRootDir(fileGlob);
|
|
48
|
+
for (const ext of SUPPORTED_EXTENSIONS) {
|
|
49
|
+
if (fsPath) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const checkPath = path.join(rootDir, `${docId}${ext}`);
|
|
53
|
+
if (fs.existsSync(checkPath)) {
|
|
54
|
+
fsPath = checkPath;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return fsPath;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Gets the root directory from a files glob
|
|
64
|
+
*/
|
|
65
|
+
private static getRootDir(filesGlob: string) {
|
|
66
|
+
let rootDir = filesGlob.split("**")[0];
|
|
67
|
+
if (!rootDir) {
|
|
68
|
+
throw new Error("Invalid files glob. Must have '**' in the path.");
|
|
69
|
+
}
|
|
70
|
+
rootDir = rootDir.replace("/**", "/");
|
|
71
|
+
return rootDir;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Resolves the route path for a given file system path
|
|
76
|
+
* @param options - The options to resolve the route path
|
|
77
|
+
* @returns The string route path
|
|
78
|
+
*/
|
|
79
|
+
static resolveRoutePath({
|
|
80
|
+
filesGlob,
|
|
81
|
+
fsPath,
|
|
82
|
+
}: {
|
|
83
|
+
filesGlob: string;
|
|
84
|
+
fsPath: string;
|
|
85
|
+
}) {
|
|
86
|
+
const rootDir = this.getRootDir(filesGlob);
|
|
87
|
+
const re = new RegExp(`^${rootDir}(.*).mdx?`);
|
|
88
|
+
const match = fsPath.match(re);
|
|
89
|
+
const routePath = match?.at(1);
|
|
90
|
+
return routePath;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -62,9 +62,9 @@ export const Endpoint = () => {
|
|
|
62
62
|
<div className="flex items-center gap-2">
|
|
63
63
|
<span className="font-medium text-sm">Endpoint:</span>
|
|
64
64
|
<InlineCode className="text-xs px-2 py-1.5" selectOnClick>
|
|
65
|
-
{servers[0]
|
|
65
|
+
{servers[0]!.url}
|
|
66
66
|
</InlineCode>
|
|
67
|
-
<CopyButton url={servers[0]
|
|
67
|
+
<CopyButton url={servers[0]!.url} />
|
|
68
68
|
</div>
|
|
69
69
|
);
|
|
70
70
|
}
|
|
@@ -26,7 +26,7 @@ export const RequestBodySidecarBox = ({ content }: { content: Content }) => {
|
|
|
26
26
|
className="text-xs max-h-[450px] p-2"
|
|
27
27
|
code={JSON.stringify(
|
|
28
28
|
content.at(0)?.schema
|
|
29
|
-
? generateSchemaExample(content[0]
|
|
29
|
+
? generateSchemaExample(content[0]!.schema as SchemaObject)
|
|
30
30
|
: "",
|
|
31
31
|
null,
|
|
32
32
|
2,
|
|
@@ -198,7 +198,7 @@ export const Sidecar = ({
|
|
|
198
198
|
language={selectedLang}
|
|
199
199
|
noBackground
|
|
200
200
|
className="text-xs p-2"
|
|
201
|
-
code={code}
|
|
201
|
+
code={code!}
|
|
202
202
|
/>
|
|
203
203
|
</SidecarBox.Body>
|
|
204
204
|
<SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-1">
|
|
@@ -216,13 +216,13 @@ export const Sidecar = ({
|
|
|
216
216
|
}}
|
|
217
217
|
options={[
|
|
218
218
|
{ value: "shell", label: "cURL" },
|
|
219
|
-
{ value: "js", label: "
|
|
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
|
|
225
|
+
{ value: "objc", label: "Objective-C" },
|
|
226
226
|
{ value: "php", label: "PHP" },
|
|
227
227
|
{ value: "ruby", label: "Ruby" },
|
|
228
228
|
{ value: "swift", label: "Swift" },
|
|
@@ -10,7 +10,7 @@ worker.addEventListener(
|
|
|
10
10
|
function (event: MessageEvent<{ id: string; body: string }>) {
|
|
11
11
|
const port = event.ports[0];
|
|
12
12
|
|
|
13
|
-
port
|
|
13
|
+
port!.onmessage = async function (e) {
|
|
14
14
|
const response = await localServer.fetch(
|
|
15
15
|
new Request("/__z/graphql", {
|
|
16
16
|
method: "POST",
|
|
@@ -21,7 +21,7 @@ worker.addEventListener(
|
|
|
21
21
|
}),
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
port
|
|
24
|
+
port!.postMessage({
|
|
25
25
|
id: e.data.id,
|
|
26
26
|
body: await response.text(),
|
|
27
27
|
} satisfies WorkerGraphQLMessage);
|
|
@@ -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 "
|
|
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";
|
|
@@ -129,6 +129,7 @@ export const Playground = ({
|
|
|
129
129
|
.filter((h) => h.name)
|
|
130
130
|
.map((header) => [header.name, header.value]),
|
|
131
131
|
),
|
|
132
|
+
body: data.body ? data.body : undefined,
|
|
132
133
|
});
|
|
133
134
|
|
|
134
135
|
if (data.identity !== NO_IDENTITY) {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
DialogContent,
|
|
6
6
|
DialogTitle,
|
|
7
7
|
DialogTrigger,
|
|
8
|
-
} from "
|
|
8
|
+
} from "zudoku/ui/Dialog.js";
|
|
9
9
|
import { Playground, type PlaygroundContentProps } from "./Playground.js";
|
|
10
10
|
|
|
11
11
|
export type PlaygroundDialogProps = PropsWithChildren<PlaygroundContentProps>;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { redirect } from "react-router-dom";
|
|
2
|
+
import { ZudokuRedirect } from "../../../config/validators/validate.js";
|
|
2
3
|
import type { DevPortalPlugin } from "../../core/plugins.js";
|
|
3
4
|
|
|
4
|
-
export type Redirect = {
|
|
5
|
-
from: string;
|
|
6
|
-
to: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
5
|
export const redirectPlugin = (options: {
|
|
10
|
-
redirects:
|
|
6
|
+
redirects: ZudokuRedirect[];
|
|
11
7
|
}): DevPortalPlugin => {
|
|
12
8
|
return {
|
|
13
9
|
getRoutes: () =>
|
|
14
10
|
options.redirects.map(({ from, to }) => ({
|
|
15
11
|
path: from,
|
|
16
|
-
loader: () => redirect(to),
|
|
12
|
+
loader: () => redirect(to, 301),
|
|
17
13
|
})),
|
|
18
14
|
};
|
|
19
15
|
};
|
|
@@ -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 };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
|
|
3
4
|
import { cn } from "../util/cn.js";
|
|
4
5
|
|
|
5
|
-
const
|
|
6
|
+
const alertVariants = cva(
|
|
6
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",
|
|
7
8
|
{
|
|
8
9
|
variants: {
|
|
@@ -18,20 +19,20 @@ const noteVariants = cva(
|
|
|
18
19
|
},
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
+
const Alert = React.forwardRef<
|
|
22
23
|
HTMLDivElement,
|
|
23
|
-
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof
|
|
24
|
+
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
24
25
|
>(({ className, variant, ...props }, ref) => (
|
|
25
26
|
<div
|
|
26
27
|
ref={ref}
|
|
27
28
|
role="alert"
|
|
28
|
-
className={cn(
|
|
29
|
+
className={cn(alertVariants({ variant }), className)}
|
|
29
30
|
{...props}
|
|
30
31
|
/>
|
|
31
32
|
));
|
|
32
|
-
|
|
33
|
+
Alert.displayName = "Alert";
|
|
33
34
|
|
|
34
|
-
const
|
|
35
|
+
const AlertTitle = React.forwardRef<
|
|
35
36
|
HTMLParagraphElement,
|
|
36
37
|
React.HTMLAttributes<HTMLHeadingElement>
|
|
37
38
|
>(({ className, ...props }, ref) => (
|
|
@@ -41,9 +42,9 @@ const NoteTitle = React.forwardRef<
|
|
|
41
42
|
{...props}
|
|
42
43
|
/>
|
|
43
44
|
));
|
|
44
|
-
|
|
45
|
+
AlertTitle.displayName = "AlertTitle";
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
+
const AlertDescription = React.forwardRef<
|
|
47
48
|
HTMLParagraphElement,
|
|
48
49
|
React.HTMLAttributes<HTMLParagraphElement>
|
|
49
50
|
>(({ className, ...props }, ref) => (
|
|
@@ -53,6 +54,6 @@ const NoteDescription = React.forwardRef<
|
|
|
53
54
|
{...props}
|
|
54
55
|
/>
|
|
55
56
|
));
|
|
56
|
-
|
|
57
|
+
AlertDescription.displayName = "AlertDescription";
|
|
57
58
|
|
|
58
|
-
export {
|
|
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,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 };
|