zudoku 0.78.2 → 0.79.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 (46) hide show
  1. package/dist/cli/cli.js +3 -266
  2. package/dist/declarations/lib/components/Bootstrap.d.ts +5 -4
  3. package/dist/declarations/lib/components/Meta.d.ts +1 -1
  4. package/dist/declarations/lib/components/PluginHeads.d.ts +1 -1
  5. package/dist/declarations/lib/components/index.d.ts +1 -1
  6. package/dist/declarations/lib/components/navigation/Navigation.d.ts +2 -1
  7. package/dist/declarations/lib/plugins/openapi/playground/GraphiQL.d.ts +14 -0
  8. package/dist/declarations/lib/plugins/openapi/playground/GraphiQLDialog.d.ts +11 -0
  9. package/dist/declarations/lib/plugins/openapi/util/graphqlEndpoint.d.ts +5 -0
  10. package/dist/declarations/lib/ui/Callout.d.ts +32 -28
  11. package/dist/declarations/lib/util/MdxComponents.d.ts +8 -2
  12. package/docs/components/callout.mdx +126 -8
  13. package/docs/components/head.mdx +2 -12
  14. package/docs/customization/colors-theme.mdx +19 -0
  15. package/docs/markdown/admonitions.md +79 -0
  16. package/package.json +15 -12
  17. package/src/app/defaultTheme.css +22 -0
  18. package/src/app/demo.tsx +4 -1
  19. package/src/app/entry.client.tsx +4 -2
  20. package/src/app/entry.server.tsx +6 -14
  21. package/src/app/main.css +12 -0
  22. package/src/app/standalone.tsx +4 -1
  23. package/src/lib/components/Bootstrap.tsx +10 -7
  24. package/src/lib/components/Header.tsx +3 -3
  25. package/src/lib/components/Main.tsx +2 -1
  26. package/src/lib/components/Meta.tsx +51 -45
  27. package/src/lib/components/PluginHeads.tsx +16 -8
  28. package/src/lib/components/index.ts +1 -1
  29. package/src/lib/components/navigation/Navigation.tsx +6 -1
  30. package/src/lib/core/RouteGuard.tsx +3 -3
  31. package/src/lib/plugins/api-catalog/Catalog.tsx +3 -3
  32. package/src/lib/plugins/markdown/MdxPage.tsx +3 -3
  33. package/src/lib/plugins/openapi/OperationList.tsx +3 -3
  34. package/src/lib/plugins/openapi/OperationListItem.tsx +149 -118
  35. package/src/lib/plugins/openapi/SchemaInfo.tsx +3 -3
  36. package/src/lib/plugins/openapi/SchemaList.tsx +5 -5
  37. package/src/lib/plugins/openapi/Sidecar.tsx +131 -55
  38. package/src/lib/plugins/openapi/playground/GraphiQL.tsx +47 -0
  39. package/src/lib/plugins/openapi/playground/GraphiQLDialog.tsx +64 -0
  40. package/src/lib/plugins/openapi/playground/graphiql-theme.css +83 -0
  41. package/src/lib/plugins/openapi/util/graphqlEndpoint.ts +23 -0
  42. package/src/lib/testing/index.tsx +4 -3
  43. package/src/lib/ui/Callout.tsx +68 -68
  44. package/src/lib/util/MdxComponents.tsx +6 -0
  45. package/src/vite/config.ts +7 -3
  46. package/src/vite/html.ts +0 -2
package/dist/cli/cli.js CHANGED
@@ -3849,269 +3849,6 @@ import {
3849
3849
  loadConfigFromFile,
3850
3850
  mergeConfig as mergeConfig2
3851
3851
  } from "vite";
3852
-
3853
- // package.json
3854
- var package_default = {
3855
- name: "zudoku",
3856
- version: "0.78.1",
3857
- type: "module",
3858
- sideEffects: [
3859
- "**/*.css",
3860
- "**/polyfills.ts"
3861
- ],
3862
- homepage: "https://zudoku.dev",
3863
- repository: {
3864
- type: "git",
3865
- url: "git+https://github.com/zuplo/zudoku.git"
3866
- },
3867
- bugs: {
3868
- url: "https://github.com/zuplo/zudoku/issues"
3869
- },
3870
- description: "Framework for building high quality, interactive API documentation.",
3871
- files: [
3872
- "dist",
3873
- "cli.js",
3874
- "src",
3875
- "client.d.ts",
3876
- "docs"
3877
- ],
3878
- bin: {
3879
- zudoku: "./cli.js"
3880
- },
3881
- exports: {
3882
- ".": "./src/index.ts",
3883
- "./package.json": "./package.json",
3884
- "./ui/*": {
3885
- types: "./src/lib/ui/*.tsx",
3886
- default: "./src/lib/ui/*.tsx"
3887
- },
3888
- "./ui/*.js": {
3889
- types: "./src/lib/ui/*.tsx",
3890
- default: "./src/lib/ui/*.tsx"
3891
- },
3892
- "./client": {
3893
- types: "./client.d.ts"
3894
- },
3895
- "./auth/clerk": "./src/lib/authentication/providers/clerk.tsx",
3896
- "./auth/auth0": "./src/lib/authentication/providers/auth0.tsx",
3897
- "./auth/openid": "./src/lib/authentication/providers/openid.tsx",
3898
- "./auth/supabase": "./src/lib/authentication/providers/supabase.tsx",
3899
- "./auth/azureb2c": "./src/lib/authentication/providers/azureb2c.tsx",
3900
- "./auth/firebase": "./src/lib/authentication/providers/firebase.tsx",
3901
- "./plugins": "./src/lib/core/plugins.ts",
3902
- "./plugins/api-keys": "./src/lib/plugins/api-keys/index.tsx",
3903
- "./plugins/markdown": "./src/lib/plugins/markdown/index.tsx",
3904
- "./plugins/openapi": "./src/lib/plugins/openapi/index.tsx",
3905
- "./plugins/custom-pages": "./src/lib/plugins/custom-pages/index.tsx",
3906
- "./plugins/search-inkeep": "./src/lib/plugins/search-inkeep/index.tsx",
3907
- "./plugins/search-pagefind": "./src/lib/plugins/search-pagefind/index.tsx",
3908
- "./plugins/api-catalog": "./src/lib/plugins/api-catalog/index.tsx",
3909
- "./components": "./src/lib/components/index.ts",
3910
- "./mermaid": "./src/lib/components/Mermaid.tsx",
3911
- "./router": "./src/lib/core/router.ts",
3912
- "./react-query": "./src/lib/core/react-query.ts",
3913
- "./icons": "./src/lib/icons.ts",
3914
- "./vite": "./src/vite/index.ts",
3915
- "./server": "./src/app/entry.server.tsx",
3916
- "./server/adapters/lambda": "./src/app/adapters/lambda.ts",
3917
- "./server/adapters/node": "./src/app/adapters/node.ts",
3918
- "./server/adapters/vercel": "./src/app/adapters/vercel.ts",
3919
- "./server/adapters/cloudflare": "./src/app/adapters/cloudflare.ts",
3920
- "./app/*": "./src/app/*",
3921
- "./hooks": "./src/lib/hooks/index.ts",
3922
- "./processors/*": "./src/lib/plugins/openapi/processors/*.ts",
3923
- "./with-zuplo": "./src/zuplo/with-zuplo.ts",
3924
- "./testing": "./src/lib/testing/index.tsx"
3925
- },
3926
- scripts: {
3927
- build: "esbuild src/cli/cli.ts src/vite/prerender/worker.ts --outdir=dist/cli --entry-names=[name] --bundle --format=esm --packages=external --target=node20 --platform=node --log-level=error",
3928
- postbuild: "tsx scripts/check-external-deps.ts",
3929
- typecheck: "tsc --project tsconfig.app.json --noEmit",
3930
- "generate:types": "tsx scripts/generate-types.js && tsx scripts/generate-flat-config.js",
3931
- "build:standalone": "vite build --mode standalone --config vite.standalone.config.ts --log-level=error",
3932
- prepublishOnly: "tsx scripts/generate-publish-exports.ts && publint .",
3933
- postpublish: "git checkout -- package.json",
3934
- clean: "rm -rf dist",
3935
- codegen: "graphql-codegen --config ./src/codegen.ts"
3936
- },
3937
- dependencies: {
3938
- "@apidevtools/json-schema-ref-parser": "15.3.5",
3939
- "@base-ui/react": "^1.4.1",
3940
- "@envelop/core": "5.5.1",
3941
- "@graphql-typed-document-node/core": "3.2.0",
3942
- "@hono/node-server": "2.0.2",
3943
- "@lekoarts/rehype-meta-as-attributes": "3.0.3",
3944
- "@mdx-js/react": "3.1.1",
3945
- "@mdx-js/rollup": "3.1.1",
3946
- "@pothos/core": "4.12.0",
3947
- "@radix-ui/react-accordion": "1.2.12",
3948
- "@radix-ui/react-alert-dialog": "1.1.15",
3949
- "@radix-ui/react-aspect-ratio": "1.1.8",
3950
- "@radix-ui/react-checkbox": "1.3.3",
3951
- "@radix-ui/react-collapsible": "1.1.12",
3952
- "@radix-ui/react-dialog": "1.1.15",
3953
- "@radix-ui/react-dropdown-menu": "2.1.16",
3954
- "@radix-ui/react-hover-card": "1.1.15",
3955
- "@radix-ui/react-label": "2.1.8",
3956
- "@radix-ui/react-navigation-menu": "1.2.14",
3957
- "@radix-ui/react-popover": "1.1.15",
3958
- "@radix-ui/react-progress": "1.1.8",
3959
- "@radix-ui/react-radio-group": "1.3.8",
3960
- "@radix-ui/react-scroll-area": "1.2.10",
3961
- "@radix-ui/react-select": "2.2.6",
3962
- "@radix-ui/react-separator": "^1.1.8",
3963
- "@radix-ui/react-slider": "1.3.6",
3964
- "@radix-ui/react-slot": "1.2.4",
3965
- "@radix-ui/react-switch": "1.2.6",
3966
- "@radix-ui/react-tabs": "1.1.13",
3967
- "@radix-ui/react-toggle": "1.1.10",
3968
- "@radix-ui/react-toggle-group": "1.1.11",
3969
- "@radix-ui/react-tooltip": "1.2.8",
3970
- "@radix-ui/react-visually-hidden": "1.2.4",
3971
- "@scalar/openapi-parser": "0.23.13",
3972
- "@scalar/snippetz": "0.9.6",
3973
- "@sentry/node": "10.52.0",
3974
- "@shikijs/langs": "4.0.2",
3975
- "@shikijs/rehype": "4.0.2",
3976
- "@shikijs/themes": "4.0.2",
3977
- "@shikijs/transformers": "4.0.2",
3978
- "@tailwindcss/typography": "0.5.19",
3979
- "@tailwindcss/vite": "4.2.2",
3980
- "@tanem/react-nprogress": "6.0.3",
3981
- "@tanstack/react-query": "5.97.0",
3982
- "@types/react": "catalog:",
3983
- "@types/react-dom": "catalog:",
3984
- "@vitejs/plugin-react": "6.0.1",
3985
- "@x0k/json-schema-merge": "1.0.2",
3986
- "@zudoku/react-helmet-async": "2.0.5",
3987
- "@zuplo/mcp": "0.0.32",
3988
- bs58: "6.0.0",
3989
- "class-variance-authority": "0.7.1",
3990
- clsx: "2.1.1",
3991
- cmdk: "1.1.1",
3992
- dotenv: "17.3.1",
3993
- "embla-carousel-react": "8.6.0",
3994
- esbuild: "^0.28.0",
3995
- "estree-util-is-identifier-name": "3.0.0",
3996
- "estree-util-value-to-estree": "3.5.0",
3997
- "fast-equals": "6.0.0",
3998
- glob: "13.0.6",
3999
- "glob-parent": "6.0.2",
4000
- graphql: "16.14.0",
4001
- "graphql-type-json": "0.3.2",
4002
- "graphql-yoga": "5.18.0",
4003
- "gray-matter": "4.0.3",
4004
- "hast-util-heading-rank": "3.0.0",
4005
- "hast-util-to-jsx-runtime": "2.3.6",
4006
- "hast-util-to-string": "3.0.1",
4007
- hono: "4.12.18",
4008
- "http-terminator": "3.2.0",
4009
- "javascript-stringify": "2.1.0",
4010
- jose: "6.2.2",
4011
- "json-schema-to-typescript-lite": "15.0.0",
4012
- loglevel: "1.9.2",
4013
- "lucide-react": "1.16.0",
4014
- "mdast-util-from-markdown": "2.0.2",
4015
- "mdast-util-mdx": "3.0.0",
4016
- "mdast-util-mdx-jsx": "3.2.0",
4017
- "micromark-extension-mdxjs": "3.0.0",
4018
- motion: "12.38.0",
4019
- nanoevents: "9.1.0",
4020
- "next-themes": "0.4.6",
4021
- oauth4webapi: "3.8.5",
4022
- "openapi-types": "12.1.3",
4023
- pagefind: "1.5.2",
4024
- picocolors: "1.1.1",
4025
- piscina: "5.1.4",
4026
- "posthog-node": "5.33.4",
4027
- "quick-lru": "7.3.0",
4028
- "react-error-boundary": "6.1.1",
4029
- "react-hook-form": "7.75.0",
4030
- "react-is": "catalog:",
4031
- "react-markdown": "10.1.0",
4032
- "react-router": "7.14.1",
4033
- "rehype-mdx-import-media": "1.4.0",
4034
- "rehype-raw": "7.0.0",
4035
- "rehype-slug": "6.0.0",
4036
- "remark-comment": "1.0.0",
4037
- "remark-directive": "3.0.1",
4038
- "remark-directive-rehype": "1.0.0",
4039
- "remark-frontmatter": "5.0.0",
4040
- "remark-gfm": "4.0.1",
4041
- "remark-mdx-frontmatter": "5.2.0",
4042
- semver: "7.8.0",
4043
- shiki: "4.0.2",
4044
- sitemap: "9.0.1",
4045
- "strip-ansi": "7.2.0",
4046
- "tailwind-merge": "3.6.0",
4047
- tailwindcss: "4.3.0",
4048
- "tw-animate-css": "1.4.0",
4049
- unified: "11.0.5",
4050
- "unist-util-visit": "5.1.0",
4051
- vaul: "1.1.2",
4052
- vfile: "6.0.3",
4053
- vite: "8.0.13",
4054
- yaml: "2.8.4",
4055
- yargs: "18.0.0",
4056
- zod: "4.3.6",
4057
- zustand: "5.0.13"
4058
- },
4059
- devDependencies: {
4060
- "@graphql-codegen/cli": "7.0.0",
4061
- "@inkeep/cxkit-types": "0.5.117",
4062
- "@testing-library/dom": "catalog:",
4063
- "@testing-library/jest-dom": "catalog:",
4064
- "@testing-library/react": "catalog:",
4065
- "@testing-library/user-event": "catalog:",
4066
- "@types/estree": "1.0.9",
4067
- "@types/glob-parent": "5.1.3",
4068
- "@types/har-format": "^1.2.16",
4069
- "@types/hast": "3.0.4",
4070
- "@types/json-schema": "7.0.15",
4071
- "@types/mdast": "4.0.4",
4072
- "@types/mdx": "2.0.13",
4073
- "@types/node": "catalog:",
4074
- "@types/react-is": "catalog:",
4075
- "@types/semver": "7.7.1",
4076
- "@types/unist": "3.0.3",
4077
- "@types/yargs": "17.0.35",
4078
- "@vitest/coverage-v8": "4.0.18",
4079
- "happy-dom": "catalog:",
4080
- "oxc-parser": "^0.126.0",
4081
- react: "catalog:",
4082
- "react-dom": "catalog:",
4083
- tsx: "4.21.0",
4084
- typescript: "catalog:"
4085
- },
4086
- peerDependencies: {
4087
- "@azure/msal-browser": "^4.13.0",
4088
- "@sentry/react": "^10.0.0",
4089
- "@supabase/supabase-js": "^2.49.4",
4090
- firebase: "^12.6.0",
4091
- mermaid: "^11.0.0",
4092
- react: ">=19.2.0",
4093
- "react-dom": ">=19.2.0"
4094
- },
4095
- peerDependenciesMeta: {
4096
- "@azure/msal-browser": {
4097
- optional: true
4098
- },
4099
- "@sentry/react": {
4100
- optional: true
4101
- },
4102
- "@supabase/supabase-js": {
4103
- optional: true
4104
- },
4105
- firebase: {
4106
- optional: true
4107
- },
4108
- mermaid: {
4109
- optional: true
4110
- }
4111
- }
4112
- };
4113
-
4114
- // src/vite/config.ts
4115
3852
  init_logger();
4116
3853
  init_package_json();
4117
3854
  init_loader();
@@ -7783,7 +7520,9 @@ async function getViteConfig(dir, configEnv, options = {}) {
7783
7520
  }
7784
7521
  },
7785
7522
  define: {
7786
- "process.env.ZUDOKU_VERSION": JSON.stringify(package_default.version),
7523
+ "process.env.ZUDOKU_VERSION": JSON.stringify(
7524
+ getZudokuPackageJson().version
7525
+ ),
7787
7526
  "process.env.IS_ZUPLO": ZuploEnv.isZuplo,
7788
7527
  "import.meta.env.IS_ZUPLO": ZuploEnv.isZuplo,
7789
7528
  "import.meta.env.ZUDOKU_HAS_SERVER": JSON.stringify(options.ssr === true),
@@ -7935,7 +7674,6 @@ function getDevHtml({
7935
7674
  <head>
7936
7675
  <meta charset="UTF-8" />
7937
7676
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
7938
- <!--app-helmet-->
7939
7677
  <link rel="preconnect" href="https://cdn.zudoku.dev/">
7940
7678
  </head>
7941
7679
  <body>
@@ -7959,7 +7697,6 @@ function getBuildHtml({
7959
7697
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
7960
7698
  <script type="module" crossorigin src="${jsEntry}"></script>
7961
7699
  ${cssLinks}
7962
- <!--app-helmet-->
7963
7700
  <link rel="preconnect" href="https://cdn.zudoku.dev/">
7964
7701
  </head>
7965
7702
  <body>
@@ -1,13 +1,14 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
- import { type HelmetData } from "@zudoku/react-helmet-async";
2
+ import { type Unhead } from "@unhead/react/client";
3
3
  import { type createBrowserRouter, type createStaticRouter, type StaticHandlerContext } from "react-router";
4
4
  import { type RenderContextValue } from "./context/RenderContext.js";
5
- export declare const BootstrapClient: ({ router, hydrate, }: {
5
+ export declare const BootstrapClient: ({ router, head, hydrate, }: {
6
6
  hydrate?: boolean;
7
+ head: Unhead;
7
8
  router: ReturnType<typeof createBrowserRouter>;
8
9
  }) => import("react/jsx-runtime").JSX.Element;
9
- declare const BootstrapStatic: ({ router, context, queryClient, helmetContext, bypassProtection, renderContext, }: {
10
- helmetContext: HelmetData["context"];
10
+ declare const BootstrapStatic: ({ router, context, queryClient, head, bypassProtection, renderContext, }: {
11
+ head: Unhead;
11
12
  context: StaticHandlerContext;
12
13
  queryClient: QueryClient;
13
14
  router: ReturnType<typeof createStaticRouter>;
@@ -1,2 +1,2 @@
1
1
  import type { PropsWithChildren } from "react";
2
- export declare const Meta: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Meta: ({ children }: PropsWithChildren) => import("react").ReactNode;
@@ -3,4 +3,4 @@ import { type ZudokuPlugin } from "../core/plugins.js";
3
3
  export declare const PluginHeads: ({ plugins, location, }: {
4
4
  plugins: ZudokuPlugin[];
5
5
  location: Location;
6
- }) => import("react/jsx-runtime").JSX.Element[];
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- export { Helmet as Head } from "@zudoku/react-helmet-async";
1
+ export { Head } from "@unhead/react";
2
2
  export { Link } from "react-router";
3
3
  export { Button } from "../ui/Button.js";
4
4
  export { Callout } from "../ui/Callout.js";
@@ -1,5 +1,6 @@
1
1
  import type { NavigationItem as NavigationItemType } from "../../../config/validators/NavigationSchema.js";
2
- export declare const Navigation: ({ onRequestClose, navigation, }: {
2
+ export declare const Navigation: ({ onRequestClose, navigation, topNavItem, }: {
3
3
  onRequestClose?: () => void;
4
4
  navigation: NavigationItemType[];
5
+ topNavItem?: NavigationItemType;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import "graphiql/style.css";
2
+ import "./graphiql-theme.css";
3
+ export type GraphiQLTab = {
4
+ query: string;
5
+ variables?: string;
6
+ headers?: string;
7
+ };
8
+ export type GraphiQLPanelProps = {
9
+ endpoint: string;
10
+ defaultHeaders?: string;
11
+ defaultTabs?: GraphiQLTab[];
12
+ };
13
+ export declare const GraphiQLPanel: ({ endpoint, defaultHeaders, defaultTabs, }: GraphiQLPanelProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default GraphiQLPanel;
@@ -0,0 +1,11 @@
1
+ export type GraphiQLTab = {
2
+ query: string;
3
+ variables?: string;
4
+ headers?: string;
5
+ };
6
+ export type GraphiQLDialogProps = {
7
+ endpoint: string;
8
+ defaultHeaders?: string;
9
+ defaultTabs?: GraphiQLTab[];
10
+ };
11
+ export declare const GraphiQLDialog: ({ endpoint, defaultHeaders, defaultTabs, }: GraphiQLDialogProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { OperationsFragmentFragment } from "../graphql/graphql.js";
2
+ export type GraphQLEndpointConfig = {
3
+ endpoint?: string;
4
+ };
5
+ export declare const getGraphQLEndpoint: (operation: OperationsFragmentFragment) => GraphQLEndpointConfig | undefined;
@@ -1,53 +1,57 @@
1
1
  import { type LucideIcon } from "lucide-react";
2
2
  import { type ReactNode } from "react";
3
- declare const stylesMap: {
3
+ declare const typeMap: {
4
4
  readonly note: {
5
- readonly border: "border-gray-300 dark:border-zinc-800";
6
- readonly bg: "bg-gray-100 dark:bg-zinc-800/50";
7
- readonly iconColor: "text-gray-600 dark:text-zinc-300";
8
- readonly titleColor: "text-gray-600 dark:text-zinc-300";
9
- readonly textColor: "text-gray-600 dark:text-zinc-300 [&_a]:hover:text-gray-700 [&_a]:dark:hover:text-zinc-400";
5
+ readonly color: "var(--callout-note)";
10
6
  readonly Icon: LucideIcon;
11
7
  };
12
8
  readonly tip: {
13
- readonly border: "border-green-500 dark:border-green-800";
14
- readonly bg: "bg-green-200/25 dark:bg-green-950/70";
15
- readonly iconColor: "text-green-600 dark:text-green-200";
16
- readonly titleColor: "text-green-700 dark:text-green-200";
17
- readonly textColor: "text-green-600 dark:text-green-50 [&_a]:hover:text-green-700 [&_a]:dark:hover:text-green-300";
9
+ readonly color: "var(--callout-tip)";
18
10
  readonly Icon: LucideIcon;
19
11
  };
20
12
  readonly info: {
21
- readonly border: "border-blue-400 dark:border-blue-900/60";
22
- readonly bg: "bg-blue-50 dark:bg-blue-950/40";
23
- readonly iconColor: "text-blue-400 dark:text-blue-200";
24
- readonly titleColor: "text-blue-700 dark:text-blue-200";
25
- readonly textColor: "text-blue-600 dark:text-blue-100 [&_a]:hover:text-blue-800 [&_a]:dark:hover:text-blue-300";
13
+ readonly color: "var(--callout-info)";
26
14
  readonly Icon: LucideIcon;
27
15
  };
28
16
  readonly caution: {
29
- readonly border: "border-yellow-500 dark:border-yellow-400/25";
30
- readonly bg: "bg-yellow-100/60 dark:bg-yellow-400/10";
31
- readonly iconColor: "text-yellow-700 dark:text-yellow-300";
32
- readonly titleColor: "text-yellow-800 dark:text-yellow-300";
33
- readonly textColor: "text-amber-800 dark:text-yellow-200 [&_a]:hover:text-amber-900 [&_a]:dark:hover:text-yellow-300";
17
+ readonly color: "var(--callout-caution)";
34
18
  readonly Icon: LucideIcon;
35
19
  };
36
20
  readonly danger: {
37
- readonly border: "border-rose-400 dark:border-rose-800";
38
- readonly bg: "bg-rose-50 dark:bg-rose-950/40";
39
- readonly iconColor: "text-rose-400 dark:text-rose-300";
40
- readonly titleColor: "text-rose-800 dark:text-rose-300";
41
- readonly textColor: "text-rose-700 dark:text-rose-100 [&_a]:hover:text-rose-800 [&_a]:dark:hover:text-rose-300";
21
+ readonly color: "var(--callout-danger)";
22
+ readonly Icon: LucideIcon;
23
+ };
24
+ readonly sparkles: {
25
+ readonly color: "var(--callout-sparkles)";
26
+ readonly Icon: LucideIcon;
27
+ };
28
+ readonly rocket: {
29
+ readonly color: "var(--callout-rocket)";
30
+ readonly Icon: LucideIcon;
31
+ };
32
+ readonly settings: {
33
+ readonly color: "var(--callout-settings)";
34
+ readonly Icon: LucideIcon;
35
+ };
36
+ readonly zap: {
37
+ readonly color: "var(--callout-zap)";
38
+ readonly Icon: LucideIcon;
39
+ };
40
+ readonly lock: {
41
+ readonly color: "var(--callout-lock)";
42
+ readonly Icon: LucideIcon;
43
+ };
44
+ readonly megaphone: {
45
+ readonly color: "var(--callout-megaphone)";
42
46
  readonly Icon: LucideIcon;
43
47
  };
44
48
  };
45
49
  type CalloutProps = {
46
- type: keyof typeof stylesMap;
50
+ type: keyof typeof typeMap;
47
51
  title?: string;
48
52
  children: ReactNode;
49
53
  className?: string;
50
- icon?: boolean;
54
+ icon?: boolean | ReactNode;
51
55
  };
52
56
  export declare const Callout: ({ type, children, title, className, icon, }: CalloutProps) => import("react/jsx-runtime").JSX.Element;
53
57
  export {};
@@ -22,11 +22,11 @@ export declare const MdxComponents: {
22
22
  Badge: typeof Badge;
23
23
  Button: import("react").ForwardRefExoticComponent<import("../ui/Button.js").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
24
24
  Callout: ({ type, children, title, className, icon, }: {
25
- type: "info" | "note" | "tip" | "caution" | "danger";
25
+ type: "info" | "lock" | "megaphone" | "rocket" | "settings" | "sparkles" | "zap" | "note" | "tip" | "caution" | "danger";
26
26
  title?: string;
27
27
  children: import("react").ReactNode;
28
28
  className?: string;
29
- icon?: boolean;
29
+ icon?: boolean | import("react").ReactNode;
30
30
  }) => import("react/jsx-runtime").JSX.Element;
31
31
  Stepper: ({ children }: import("react").PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
32
32
  Mermaid: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
@@ -37,6 +37,12 @@ export declare const MdxComponents: {
37
37
  caution: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
38
38
  warning: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
39
39
  danger: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
40
+ sparkles: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
41
+ rocket: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
42
+ settings: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
43
+ zap: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
44
+ lock: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
45
+ megaphone: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
40
46
  CodeTabs: (props: JSX.IntrinsicElements) => import("react/jsx-runtime").JSX.Element;
41
47
  CodeTabPanel: {
42
48
  (_props: import("../ui/CodeTabPanel.js").CodeTabPanelProps): null;
@@ -5,8 +5,12 @@ sidebar_icon: circle-alert
5
5
 
6
6
  import { Callout } from "zudoku/ui/Callout";
7
7
  import { ReactComponentDoc } from "zudoku/ui/ReactComponentDoc";
8
+ import { FileHeartIcon } from "zudoku/icons";
8
9
 
9
- This is a callout component that can be used to draw attention to important information.
10
+ A callout component to draw attention to important information.
11
+
12
+ Writing Markdown? Use the [admonitions](../markdown/admonitions) shorthand (`:::tip`) instead of the
13
+ component directly.
10
14
 
11
15
  ## Import
12
16
 
@@ -16,13 +20,6 @@ import { Callout } from "zudoku/ui/Callout";
16
20
 
17
21
  <ReactComponentDoc component={Callout} />
18
22
 
19
- :::tip{title="Hot tip"}
20
-
21
- There's a shortcut to use callout components in Markdown files:
22
- [Admonitions](../markdown/admonitions).
23
-
24
- :::
25
-
26
23
  ## Note
27
24
 
28
25
  <Callout type="note" title="Hey, listen!">
@@ -83,6 +80,78 @@ There's a shortcut to use callout components in Markdown files:
83
80
  </Callout>
84
81
  ```
85
82
 
83
+ ## Sparkles
84
+
85
+ <Callout type="sparkles" title="What's new">
86
+ Highlight new features or AI-powered functionality.
87
+ </Callout>
88
+
89
+ ```tsx
90
+ <Callout type="sparkles" title="What's new">
91
+ Highlight new features or AI-powered functionality.
92
+ </Callout>
93
+ ```
94
+
95
+ ## Rocket
96
+
97
+ <Callout type="rocket" title="Getting started">
98
+ Spin up your first project in minutes.
99
+ </Callout>
100
+
101
+ ```tsx
102
+ <Callout type="rocket" title="Getting started">
103
+ Spin up your first project in minutes.
104
+ </Callout>
105
+ ```
106
+
107
+ ## Settings
108
+
109
+ <Callout type="settings" title="Configuration">
110
+ Tweak these options to match your workflow.
111
+ </Callout>
112
+
113
+ ```tsx
114
+ <Callout type="settings" title="Configuration">
115
+ Tweak these options to match your workflow.
116
+ </Callout>
117
+ ```
118
+
119
+ ## Zap
120
+
121
+ <Callout type="zap" title="Performance">
122
+ Use this pattern when latency matters.
123
+ </Callout>
124
+
125
+ ```tsx
126
+ <Callout type="zap" title="Performance">
127
+ Use this pattern when latency matters.
128
+ </Callout>
129
+ ```
130
+
131
+ ## Lock
132
+
133
+ <Callout type="lock" title="Authentication required">
134
+ This endpoint needs a valid API key.
135
+ </Callout>
136
+
137
+ ```tsx
138
+ <Callout type="lock" title="Authentication required">
139
+ This endpoint needs a valid API key.
140
+ </Callout>
141
+ ```
142
+
143
+ ## Megaphone
144
+
145
+ <Callout type="megaphone" title="Announcement">
146
+ We've just shipped a breaking change to the v2 API.
147
+ </Callout>
148
+
149
+ ```tsx
150
+ <Callout type="megaphone" title="Announcement">
151
+ We've just shipped a breaking change to the v2 API.
152
+ </Callout>
153
+ ```
154
+
86
155
  ## Variations
87
156
 
88
157
  Callouts can be customized by omitting the title or icon:
@@ -97,6 +166,12 @@ Callouts can be customized by omitting the title or icon:
97
166
  Or have neither title nor icon
98
167
  </Callout>
99
168
 
169
+ Or pass any React node as the `icon` to override the default for the chosen `type`:
170
+
171
+ <Callout type="tip" icon={<FileHeartIcon />} title="Made with love">
172
+ The icon inherits the type's accent color.
173
+ </Callout>
174
+
100
175
  ```tsx
101
176
  <Callout type="note">
102
177
  Without a title
@@ -109,4 +184,47 @@ Callouts can be customized by omitting the title or icon:
109
184
  <Callout type="note" icon={false}>
110
185
  Or have neither title nor icon
111
186
  </Callout>
187
+
188
+ <Callout type="tip" icon={<FileHeartIcon />} title="Made with love">
189
+ The icon inherits the type's accent color.
190
+ </Callout>
191
+ ```
192
+
193
+ ## Customize colors
194
+
195
+ Each callout type is driven by a single CSS variable that determines the icon, border tint, and
196
+ background tint via `color-mix`. Override any of them in your theme's `customCss` to recolor a type
197
+ globally:
198
+
199
+ ```ts title="zudoku.config.ts"
200
+ export default {
201
+ theme: {
202
+ customCss: `
203
+ :root {
204
+ --callout-tip: oklch(0.65 0.18 160);
205
+ --callout-sparkles: oklch(0.6 0.22 320);
206
+ }
207
+ .dark {
208
+ --callout-tip: oklch(0.78 0.18 160);
209
+ --callout-sparkles: oklch(0.75 0.2 320);
210
+ }
211
+ `,
212
+ },
213
+ };
214
+ ```
215
+
216
+ All available variables:
217
+
218
+ ```css
219
+ --callout-note
220
+ --callout-tip
221
+ --callout-info
222
+ --callout-caution
223
+ --callout-danger
224
+ --callout-sparkles
225
+ --callout-rocket
226
+ --callout-settings
227
+ --callout-zap
228
+ --callout-lock
229
+ --callout-megaphone
112
230
  ```