blodemd 0.1.0 → 0.2.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 (289) hide show
  1. package/dist/cli.mjs +50 -174
  2. package/dist/cli.mjs.map +1 -1
  3. package/package.json +3 -36
  4. package/dev-server/app/[[...slug]]/page.tsx +0 -140
  5. package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
  6. package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
  7. package/dev-server/app/blodemd-dev/version/route.ts +0 -14
  8. package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
  9. package/dev-server/app/error.tsx +0 -24
  10. package/dev-server/app/favicon.ico +0 -0
  11. package/dev-server/app/globals.css +0 -4
  12. package/dev-server/app/layout.tsx +0 -38
  13. package/dev-server/app/not-found.tsx +0 -18
  14. package/dev-server/app/search/route.ts +0 -17
  15. package/dev-server/components/dev-reload-script.tsx +0 -86
  16. package/dev-server/components/providers.tsx +0 -15
  17. package/dev-server/lib/dev-state.ts +0 -8
  18. package/dev-server/lib/local-content-source.ts +0 -103
  19. package/dev-server/lib/local-runtime.tsx +0 -555
  20. package/dev-server/next-env.d.ts +0 -5
  21. package/dev-server/next.config.js +0 -54
  22. package/dev-server/package.json +0 -61
  23. package/dev-server/postcss.config.mjs +0 -7
  24. package/dev-server/public/glide-variable.woff2 +0 -0
  25. package/dev-server/tsconfig.json +0 -50
  26. package/docs/app/globals.css +0 -471
  27. package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
  28. package/docs/components/api/api-playground.tsx +0 -467
  29. package/docs/components/api/api-reference.tsx +0 -157
  30. package/docs/components/content/collection-index.tsx +0 -114
  31. package/docs/components/docs/contextual-menu.tsx +0 -495
  32. package/docs/components/docs/copy-page-menu.tsx +0 -364
  33. package/docs/components/docs/doc-header.tsx +0 -223
  34. package/docs/components/docs/doc-shell.tsx +0 -355
  35. package/docs/components/docs/doc-sidebar.tsx +0 -256
  36. package/docs/components/docs/doc-toc.tsx +0 -46
  37. package/docs/components/docs/mobile-nav.tsx +0 -195
  38. package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
  39. package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
  40. package/docs/components/git/repo-picker.tsx +0 -529
  41. package/docs/components/icons/doc-icon.tsx +0 -96
  42. package/docs/components/mdx/accordion.tsx +0 -83
  43. package/docs/components/mdx/agent-instructions.tsx +0 -17
  44. package/docs/components/mdx/badge.tsx +0 -79
  45. package/docs/components/mdx/callout.tsx +0 -88
  46. package/docs/components/mdx/card.tsx +0 -110
  47. package/docs/components/mdx/code-block.tsx +0 -80
  48. package/docs/components/mdx/code-group.tsx +0 -203
  49. package/docs/components/mdx/color.tsx +0 -87
  50. package/docs/components/mdx/columns.tsx +0 -25
  51. package/docs/components/mdx/expandable.tsx +0 -45
  52. package/docs/components/mdx/field-layout.tsx +0 -77
  53. package/docs/components/mdx/frame.tsx +0 -23
  54. package/docs/components/mdx/get-text-content.ts +0 -18
  55. package/docs/components/mdx/icon.tsx +0 -12
  56. package/docs/components/mdx/iframe.tsx +0 -62
  57. package/docs/components/mdx/index.tsx +0 -121
  58. package/docs/components/mdx/installer.tsx +0 -20
  59. package/docs/components/mdx/panel.tsx +0 -11
  60. package/docs/components/mdx/param-field.tsx +0 -56
  61. package/docs/components/mdx/preview.tsx +0 -36
  62. package/docs/components/mdx/prompt.tsx +0 -63
  63. package/docs/components/mdx/request-example.tsx +0 -27
  64. package/docs/components/mdx/response-field.tsx +0 -42
  65. package/docs/components/mdx/steps.tsx +0 -92
  66. package/docs/components/mdx/tabs.tsx +0 -193
  67. package/docs/components/mdx/tile.tsx +0 -43
  68. package/docs/components/mdx/tooltip.tsx +0 -71
  69. package/docs/components/mdx/tree.tsx +0 -120
  70. package/docs/components/mdx/type-table.tsx +0 -71
  71. package/docs/components/mdx/update.tsx +0 -44
  72. package/docs/components/mdx/video.tsx +0 -45
  73. package/docs/components/mdx/view.tsx +0 -66
  74. package/docs/components/posthog-provider.tsx +0 -42
  75. package/docs/components/providers.tsx +0 -15
  76. package/docs/components/tenant-analytics.tsx +0 -49
  77. package/docs/components/third-parties.tsx +0 -32
  78. package/docs/components/ui/badge.tsx +0 -61
  79. package/docs/components/ui/breadcrumb.tsx +0 -112
  80. package/docs/components/ui/button-group.tsx +0 -83
  81. package/docs/components/ui/button.tsx +0 -65
  82. package/docs/components/ui/card.tsx +0 -92
  83. package/docs/components/ui/command.tsx +0 -167
  84. package/docs/components/ui/copy-button.tsx +0 -129
  85. package/docs/components/ui/dialog.tsx +0 -146
  86. package/docs/components/ui/field.tsx +0 -237
  87. package/docs/components/ui/input.tsx +0 -23
  88. package/docs/components/ui/kbd.tsx +0 -98
  89. package/docs/components/ui/label.tsx +0 -22
  90. package/docs/components/ui/morph-icon.tsx +0 -79
  91. package/docs/components/ui/popover.tsx +0 -267
  92. package/docs/components/ui/search-dialog.tsx +0 -431
  93. package/docs/components/ui/search.tsx +0 -101
  94. package/docs/components/ui/separator.tsx +0 -26
  95. package/docs/components/ui/sheet.tsx +0 -133
  96. package/docs/components/ui/sidebar.tsx +0 -758
  97. package/docs/components/ui/skeleton.tsx +0 -11
  98. package/docs/components/ui/switch.tsx +0 -32
  99. package/docs/components/ui/tabs.tsx +0 -138
  100. package/docs/components/ui/theme-toggle.tsx +0 -62
  101. package/docs/components/ui/tooltip.tsx +0 -53
  102. package/docs/components/web-mcp.tsx +0 -115
  103. package/docs/lib/agent-skills.ts +0 -48
  104. package/docs/lib/api-client.ts +0 -72
  105. package/docs/lib/config.ts +0 -6
  106. package/docs/lib/content-root.ts +0 -33
  107. package/docs/lib/content-source.ts +0 -70
  108. package/docs/lib/contextual-options.ts +0 -222
  109. package/docs/lib/dashboard-session.ts +0 -167
  110. package/docs/lib/db.ts +0 -13
  111. package/docs/lib/docs-collection.ts +0 -7
  112. package/docs/lib/docs-runtime.tsx +0 -745
  113. package/docs/lib/edge-config.ts +0 -95
  114. package/docs/lib/env.ts +0 -23
  115. package/docs/lib/etag.ts +0 -22
  116. package/docs/lib/github-install.ts +0 -33
  117. package/docs/lib/llms-full.ts +0 -82
  118. package/docs/lib/marketing-markdown.ts +0 -79
  119. package/docs/lib/marketing-site.ts +0 -31
  120. package/docs/lib/mdx.ts +0 -98
  121. package/docs/lib/navigation.ts +0 -288
  122. package/docs/lib/openapi-proxy.ts +0 -88
  123. package/docs/lib/openapi.ts +0 -158
  124. package/docs/lib/platform-config.ts +0 -6
  125. package/docs/lib/project-authz.ts +0 -46
  126. package/docs/lib/routes.ts +0 -103
  127. package/docs/lib/server-cache.ts +0 -83
  128. package/docs/lib/shiki.ts +0 -44
  129. package/docs/lib/supabase.ts +0 -37
  130. package/docs/lib/tenancy.ts +0 -364
  131. package/docs/lib/tenant-headers.ts +0 -43
  132. package/docs/lib/tenant-static.ts +0 -705
  133. package/docs/lib/tenant-utility-context.ts +0 -62
  134. package/docs/lib/tenants.ts +0 -72
  135. package/docs/lib/theme.ts +0 -29
  136. package/docs/lib/time-ago.ts +0 -24
  137. package/docs/lib/toc.ts +0 -2
  138. package/docs/lib/use-mobile.ts +0 -19
  139. package/docs/lib/use-tab-observer.ts +0 -71
  140. package/docs/lib/utils.ts +0 -5
  141. package/packages/@repo/common/dist/index.d.ts +0 -16
  142. package/packages/@repo/common/dist/index.d.ts.map +0 -1
  143. package/packages/@repo/common/dist/index.js +0 -84
  144. package/packages/@repo/common/package.json +0 -34
  145. package/packages/@repo/common/src/index.ts +0 -101
  146. package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
  147. package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
  148. package/packages/@repo/contracts/dist/analytics.js +0 -18
  149. package/packages/@repo/contracts/dist/api-key.d.ts +0 -27
  150. package/packages/@repo/contracts/dist/api-key.d.ts.map +0 -1
  151. package/packages/@repo/contracts/dist/api-key.js +0 -20
  152. package/packages/@repo/contracts/dist/dates.d.ts +0 -4
  153. package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
  154. package/packages/@repo/contracts/dist/dates.js +0 -2
  155. package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
  156. package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
  157. package/packages/@repo/contracts/dist/deployment.js +0 -46
  158. package/packages/@repo/contracts/dist/domain.d.ts +0 -94
  159. package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
  160. package/packages/@repo/contracts/dist/domain.js +0 -36
  161. package/packages/@repo/contracts/dist/git.d.ts +0 -28
  162. package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
  163. package/packages/@repo/contracts/dist/git.js +0 -24
  164. package/packages/@repo/contracts/dist/ids.d.ts +0 -14
  165. package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
  166. package/packages/@repo/contracts/dist/ids.js +0 -11
  167. package/packages/@repo/contracts/dist/index.d.ts +0 -12
  168. package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
  169. package/packages/@repo/contracts/dist/index.js +0 -13
  170. package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
  171. package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
  172. package/packages/@repo/contracts/dist/pagination.js +0 -15
  173. package/packages/@repo/contracts/dist/project.d.ts +0 -42
  174. package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
  175. package/packages/@repo/contracts/dist/project.js +0 -25
  176. package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
  177. package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
  178. package/packages/@repo/contracts/dist/tenant.js +0 -58
  179. package/packages/@repo/contracts/dist/user.d.ts +0 -9
  180. package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
  181. package/packages/@repo/contracts/dist/user.js +0 -9
  182. package/packages/@repo/contracts/package.json +0 -37
  183. package/packages/@repo/contracts/src/analytics.ts +0 -33
  184. package/packages/@repo/contracts/src/api-key.ts +0 -27
  185. package/packages/@repo/contracts/src/dates.ts +0 -4
  186. package/packages/@repo/contracts/src/deployment.ts +0 -73
  187. package/packages/@repo/contracts/src/domain.ts +0 -51
  188. package/packages/@repo/contracts/src/git.ts +0 -31
  189. package/packages/@repo/contracts/src/ids.ts +0 -23
  190. package/packages/@repo/contracts/src/index.ts +0 -13
  191. package/packages/@repo/contracts/src/pagination.ts +0 -21
  192. package/packages/@repo/contracts/src/project.ts +0 -32
  193. package/packages/@repo/contracts/src/tenant.ts +0 -94
  194. package/packages/@repo/contracts/src/user.ts +0 -12
  195. package/packages/@repo/models/dist/docs-config.d.ts +0 -961
  196. package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
  197. package/packages/@repo/models/dist/docs-config.js +0 -531
  198. package/packages/@repo/models/dist/index.d.ts +0 -3
  199. package/packages/@repo/models/dist/index.d.ts.map +0 -1
  200. package/packages/@repo/models/dist/index.js +0 -3
  201. package/packages/@repo/models/dist/tenant.d.ts +0 -37
  202. package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
  203. package/packages/@repo/models/dist/tenant.js +0 -1
  204. package/packages/@repo/models/package.json +0 -37
  205. package/packages/@repo/models/src/docs-config.ts +0 -629
  206. package/packages/@repo/models/src/index.ts +0 -3
  207. package/packages/@repo/models/src/tenant.ts +0 -44
  208. package/packages/@repo/prebuild/dist/index.d.ts +0 -2
  209. package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
  210. package/packages/@repo/prebuild/dist/index.js +0 -2
  211. package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
  212. package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
  213. package/packages/@repo/prebuild/dist/openapi.js +0 -86
  214. package/packages/@repo/prebuild/package.json +0 -39
  215. package/packages/@repo/prebuild/src/index.ts +0 -2
  216. package/packages/@repo/prebuild/src/openapi.ts +0 -154
  217. package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
  218. package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
  219. package/packages/@repo/previewing/dist/blob-source.js +0 -128
  220. package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
  221. package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
  222. package/packages/@repo/previewing/dist/config-loader.js +0 -231
  223. package/packages/@repo/previewing/dist/constants.d.ts +0 -15
  224. package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
  225. package/packages/@repo/previewing/dist/constants.js +0 -14
  226. package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
  227. package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
  228. package/packages/@repo/previewing/dist/content-index.js +0 -291
  229. package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
  230. package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
  231. package/packages/@repo/previewing/dist/content-source.js +0 -1
  232. package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
  233. package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
  234. package/packages/@repo/previewing/dist/fs-source.js +0 -71
  235. package/packages/@repo/previewing/dist/index.d.ts +0 -16
  236. package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
  237. package/packages/@repo/previewing/dist/index.js +0 -13
  238. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
  239. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
  240. package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
  241. package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
  242. package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
  243. package/packages/@repo/previewing/dist/markdown/format.js +0 -43
  244. package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
  245. package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
  246. package/packages/@repo/previewing/dist/markdown/links.js +0 -31
  247. package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
  248. package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
  249. package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
  250. package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
  251. package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
  252. package/packages/@repo/previewing/dist/search-index.js +0 -23
  253. package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
  254. package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
  255. package/packages/@repo/previewing/dist/serialization.js +0 -108
  256. package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
  257. package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
  258. package/packages/@repo/previewing/dist/toc-index.js +0 -53
  259. package/packages/@repo/previewing/dist/types.d.ts +0 -92
  260. package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
  261. package/packages/@repo/previewing/dist/types.js +0 -1
  262. package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
  263. package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
  264. package/packages/@repo/previewing/dist/utility-index.js +0 -201
  265. package/packages/@repo/previewing/package.json +0 -41
  266. package/packages/@repo/previewing/src/blob-source.ts +0 -185
  267. package/packages/@repo/previewing/src/config-loader.ts +0 -316
  268. package/packages/@repo/previewing/src/constants.ts +0 -16
  269. package/packages/@repo/previewing/src/content-index.ts +0 -384
  270. package/packages/@repo/previewing/src/content-source.ts +0 -12
  271. package/packages/@repo/previewing/src/fs-source.ts +0 -103
  272. package/packages/@repo/previewing/src/index.ts +0 -71
  273. package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
  274. package/packages/@repo/previewing/src/markdown/format.ts +0 -63
  275. package/packages/@repo/previewing/src/markdown/links.ts +0 -46
  276. package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
  277. package/packages/@repo/previewing/src/search-index.ts +0 -38
  278. package/packages/@repo/previewing/src/serialization.ts +0 -191
  279. package/packages/@repo/previewing/src/toc-index.ts +0 -72
  280. package/packages/@repo/previewing/src/types.ts +0 -105
  281. package/packages/@repo/previewing/src/utility-index.ts +0 -304
  282. package/packages/@repo/validation/dist/index.d.ts +0 -12
  283. package/packages/@repo/validation/dist/index.d.ts.map +0 -1
  284. package/packages/@repo/validation/dist/index.js +0 -30
  285. package/packages/@repo/validation/package.json +0 -38
  286. package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
  287. package/packages/@repo/validation/src/index.ts +0 -59
  288. package/scripts/prepare-package.mjs +0 -53
  289. package/scripts/repo-packages.mjs +0 -8
@@ -1,17 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- interface AgentInstructionsProps {
4
- children: ReactNode;
5
- }
6
-
7
- /**
8
- * Content inside <AgentInstructions> is hidden from human readers in the
9
- * rendered HTML but preserved in the raw MDX source. When pages are exported
10
- * as Markdown (via /{page}.md or llms-full.txt), the content is included so
11
- * AI agents receive it as context.
12
- */
13
- export const AgentInstructions = ({ children }: AgentInstructionsProps) => (
14
- <div hidden data-agent-instructions="">
15
- {children}
16
- </div>
17
- );
@@ -1,79 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- const colorStyles: Record<string, string> = {
6
- blue: "bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300",
7
- gray: "bg-muted text-muted-foreground",
8
- green: "bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300",
9
- orange:
10
- "bg-orange-100 text-orange-800 dark:bg-orange-900/40 dark:text-orange-300",
11
- purple:
12
- "bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300",
13
- red: "bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300",
14
- surface: "bg-card text-card-foreground",
15
- white: "bg-white text-foreground dark:bg-white dark:text-black",
16
- yellow:
17
- "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/40 dark:text-yellow-300",
18
- };
19
-
20
- const strokeStyles: Record<string, string> = {
21
- blue: "border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300",
22
- gray: "border-border text-muted-foreground",
23
- green:
24
- "border-green-300 text-green-700 dark:border-green-700 dark:text-green-300",
25
- orange:
26
- "border-orange-300 text-orange-700 dark:border-orange-700 dark:text-orange-300",
27
- purple:
28
- "border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-300",
29
- red: "border-red-300 text-red-700 dark:border-red-700 dark:text-red-300",
30
- surface: "border-border text-card-foreground",
31
- white: "border-border text-foreground",
32
- yellow:
33
- "border-yellow-300 text-yellow-700 dark:border-yellow-700 dark:text-yellow-300",
34
- };
35
-
36
- const sizeStyles: Record<string, string> = {
37
- lg: "px-3 py-1.5 text-sm",
38
- md: "px-2.5 py-1 text-xs",
39
- sm: "px-2 py-0.5 text-xs",
40
- xs: "px-1.5 py-0.5 text-[10px]",
41
- };
42
-
43
- interface BadgeProps {
44
- color?: string;
45
- size?: "xs" | "sm" | "md" | "lg";
46
- shape?: "rounded" | "pill";
47
- icon?: ReactNode;
48
- stroke?: boolean;
49
- disabled?: boolean;
50
- className?: string;
51
- children: ReactNode;
52
- }
53
-
54
- export const Badge = ({
55
- color = "gray",
56
- size = "md",
57
- shape = "rounded",
58
- icon,
59
- stroke = false,
60
- disabled = false,
61
- className,
62
- children,
63
- }: BadgeProps) => (
64
- <span
65
- className={cn(
66
- "inline-flex items-center gap-1 font-medium",
67
- shape === "pill" ? "rounded-full" : "rounded-md",
68
- stroke
69
- ? cn("border bg-transparent", strokeStyles[color] ?? strokeStyles.gray)
70
- : (colorStyles[color] ?? colorStyles.gray),
71
- sizeStyles[size] ?? sizeStyles.md,
72
- disabled && "opacity-50",
73
- className
74
- )}
75
- >
76
- {icon ? <span className="shrink-0">{icon}</span> : null}
77
- {children}
78
- </span>
79
- );
@@ -1,88 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- const variantStyles: Record<string, string> = {
6
- check:
7
- "border-emerald-600 bg-emerald-100 dark:border-emerald-400 dark:bg-emerald-900",
8
- danger: "border-red-600 bg-red-100 dark:border-red-400 dark:bg-red-900",
9
- info: "bg-card border-border",
10
- note: "bg-card border-border",
11
- success:
12
- "border-emerald-600 bg-emerald-100 dark:border-emerald-400 dark:bg-emerald-900",
13
- tip: "border-blue-600 bg-blue-100 dark:border-blue-400 dark:bg-blue-900",
14
- warning:
15
- "border-amber-600 bg-amber-100 dark:border-amber-400 dark:bg-amber-900",
16
- };
17
-
18
- interface CalloutProps {
19
- type?: "info" | "success" | "warning" | "danger" | "note" | "tip" | "check";
20
- title?: string;
21
- icon?: ReactNode;
22
- color?: string;
23
- children: ReactNode;
24
- }
25
-
26
- export const Callout = ({
27
- type = "info",
28
- title,
29
- icon,
30
- color,
31
- children,
32
- }: CalloutProps) => (
33
- <div
34
- data-slot="alert"
35
- role="alert"
36
- data-variant="default"
37
- className={cn(
38
- "relative grid grid-cols-[0_1fr] items-start gap-y-0.5 rounded-xl border px-4 py-3 text-sm text-surface-foreground",
39
- "has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3",
40
- "[&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
41
- "**:[code]:border md:-mx-1",
42
- variantStyles[type]
43
- )}
44
- style={
45
- color
46
- ? {
47
- backgroundColor: `${color}10`,
48
- borderColor: color,
49
- }
50
- : undefined
51
- }
52
- >
53
- {icon}
54
- <div
55
- data-slot="alert-description"
56
- className="col-start-2 grid justify-items-start gap-1 text-sm text-foreground [&_p]:leading-relaxed"
57
- >
58
- {title ? <strong className="font-medium">{title}</strong> : null}
59
- <div className="text-sm [&>p:first-child]:mt-0 [&>p:last-child]:mb-0 [&_p]:leading-relaxed [&_p:not(:first-child)]:mt-6">
60
- {children}
61
- </div>
62
- </div>
63
- </div>
64
- );
65
-
66
- export const Note = ({ children }: { children: ReactNode }) => (
67
- <Callout type="note">{children}</Callout>
68
- );
69
-
70
- export const Warning = ({ children }: { children: ReactNode }) => (
71
- <Callout type="warning">{children}</Callout>
72
- );
73
-
74
- export const Info = ({ children }: { children: ReactNode }) => (
75
- <Callout type="info">{children}</Callout>
76
- );
77
-
78
- export const Tip = ({ children }: { children: ReactNode }) => (
79
- <Callout type="tip">{children}</Callout>
80
- );
81
-
82
- export const Check = ({ children }: { children: ReactNode }) => (
83
- <Callout type="check">{children}</Callout>
84
- );
85
-
86
- export const Danger = ({ children }: { children: ReactNode }) => (
87
- <Callout type="danger">{children}</Callout>
88
- );
@@ -1,110 +0,0 @@
1
- import Image from "next/image";
2
- import Link from "next/link";
3
- import type { ReactNode } from "react";
4
-
5
- import { DocIcon } from "@/components/icons/doc-icon";
6
- import { cn } from "@/lib/utils";
7
-
8
- interface CardProps {
9
- title?: string;
10
- icon?: ReactNode;
11
- color?: string;
12
- href?: string;
13
- horizontal?: boolean;
14
- img?: string;
15
- cta?: string;
16
- children?: ReactNode;
17
- }
18
-
19
- const CardInner = ({
20
- title,
21
- icon,
22
- color,
23
- horizontal,
24
- img,
25
- cta,
26
- href,
27
- children,
28
- }: CardProps) => {
29
- const resolvedIcon =
30
- typeof icon === "string" ? <DocIcon icon={icon} size={18} /> : icon;
31
-
32
- return (
33
- <div
34
- className={cn(
35
- "group/card rounded-xl border border-border bg-card p-4 transition-colors",
36
- href && "hover:border-primary/30 hover:bg-accent/50",
37
- horizontal && "flex items-start gap-4"
38
- )}
39
- >
40
- {img && !horizontal ? (
41
- <div className="relative mb-3 aspect-video overflow-hidden rounded-lg">
42
- <Image
43
- alt={title ?? ""}
44
- className="object-cover"
45
- fill
46
- sizes="(max-width: 768px) 100vw, 50vw"
47
- src={img}
48
- unoptimized
49
- />
50
- </div>
51
- ) : null}
52
- {resolvedIcon ? (
53
- <div
54
- className="mb-3 flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground"
55
- style={color ? { color } : undefined}
56
- >
57
- {resolvedIcon}
58
- </div>
59
- ) : null}
60
- <div className="min-w-0 flex-1">
61
- {title ? (
62
- <div className="mb-1 font-medium text-foreground">{title}</div>
63
- ) : null}
64
- {children ? (
65
- <div className="text-sm text-muted-foreground [&>p:first-child]:mt-0 [&>p:last-child]:mb-0">
66
- {children}
67
- </div>
68
- ) : null}
69
- {cta ? (
70
- <div className="mt-2 text-sm font-medium text-primary">{cta}</div>
71
- ) : null}
72
- </div>
73
- {href ? (
74
- <svg
75
- aria-hidden
76
- className="mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform group-hover/card:translate-x-0.5"
77
- fill="none"
78
- stroke="currentColor"
79
- strokeWidth={2}
80
- viewBox="0 0 24 24"
81
- >
82
- <path
83
- d="M5 12h14M12 5l7 7-7 7"
84
- strokeLinecap="round"
85
- strokeLinejoin="round"
86
- />
87
- </svg>
88
- ) : null}
89
- </div>
90
- );
91
- };
92
-
93
- export const Card = (props: CardProps) => {
94
- if (props.href) {
95
- const isExternal = props.href.startsWith("http");
96
- if (isExternal) {
97
- return (
98
- <a href={props.href} rel="noopener noreferrer" target="_blank">
99
- <CardInner {...props} />
100
- </a>
101
- );
102
- }
103
- return (
104
- <Link href={props.href}>
105
- <CardInner {...props} />
106
- </Link>
107
- );
108
- }
109
- return <CardInner {...props} />;
110
- };
@@ -1,80 +0,0 @@
1
- "use client";
2
-
3
- import { CheckIcon, ClipboardIcon } from "blode-icons-react";
4
- import { useCallback, useEffect, useMemo, useState } from "react";
5
- import type { ComponentPropsWithoutRef, ReactNode } from "react";
6
-
7
- import { Button } from "@/components/ui/button";
8
- import { cn } from "@/lib/utils";
9
-
10
- import { getTextContent } from "./get-text-content";
11
-
12
- export const CodeBlock = ({
13
- children,
14
- className,
15
- style,
16
- tabIndex,
17
- ...props
18
- }: ComponentPropsWithoutRef<"pre"> & {
19
- children: ReactNode;
20
- }) => {
21
- const [copied, setCopied] = useState(false);
22
- const code = useMemo(() => getTextContent(children), [children]);
23
-
24
- useEffect(() => {
25
- if (copied) {
26
- const timer = setTimeout(() => setCopied(false), 2000);
27
- return () => clearTimeout(timer);
28
- }
29
- }, [copied]);
30
-
31
- const handleCopy = useCallback(async () => {
32
- if (!code) {
33
- return;
34
- }
35
- await navigator.clipboard.writeText(code);
36
- setCopied(true);
37
- }, [code]);
38
-
39
- const preStyle = style ? { ...style } : undefined;
40
- if (preStyle) {
41
- delete preStyle.backgroundColor;
42
- }
43
-
44
- return (
45
- <figure data-rehype-pretty-code-figure="">
46
- <pre
47
- className={cn(
48
- "no-scrollbar min-w-0 overflow-x-auto overflow-y-auto overscroll-y-auto overscroll-x-contain pl-4 pr-14 py-3.5 outline-none has-[[data-slot=tabs]]:p-0 has-[[data-highlighted-line]]:pl-0 has-[[data-line-numbers]]:pl-0",
49
- className
50
- )}
51
- style={preStyle}
52
- tabIndex={tabIndex ?? 0}
53
- {...props}
54
- >
55
- <div
56
- aria-hidden="true"
57
- className="pointer-events-none absolute top-0 right-0 bottom-0 z-[9] w-16 bg-gradient-to-r from-transparent to-code print:hidden"
58
- data-slot="fade-overlay"
59
- />
60
- <Button
61
- className="absolute top-3 right-2 z-10 size-7 bg-code hover:opacity-100 focus-visible:opacity-100"
62
- data-copied={copied}
63
- data-slot="copy-button"
64
- onClick={handleCopy}
65
- size="icon"
66
- type="button"
67
- variant="ghost"
68
- >
69
- <span className="sr-only">{copied ? "Copied" : "Copy"}</span>
70
- {copied ? (
71
- <CheckIcon aria-hidden="true" />
72
- ) : (
73
- <ClipboardIcon aria-hidden="true" />
74
- )}
75
- </Button>
76
- {children}
77
- </pre>
78
- </figure>
79
- );
80
- };
@@ -1,203 +0,0 @@
1
- "use client";
2
-
3
- import { isValidElement, useCallback, useId, useMemo, useState } from "react";
4
- import type { KeyboardEvent, MouseEvent, ReactElement, ReactNode } from "react";
5
-
6
- import { cn } from "@/lib/utils";
7
-
8
- interface CodeGroupProps {
9
- children: ReactNode;
10
- }
11
-
12
- interface CodeGroupItemProps {
13
- "data-rehype-pretty-code-title"?: string;
14
- children?: ReactNode;
15
- }
16
-
17
- interface ResolvedCodeItem {
18
- element: ReactElement<CodeGroupItemProps>;
19
- key: string;
20
- label: string;
21
- }
22
-
23
- const clampTabIndex = (index: number, total: number) => {
24
- if (total <= 0) {
25
- return 0;
26
- }
27
-
28
- return Math.min(Math.max(index, 0), total - 1);
29
- };
30
-
31
- const sanitizeDomId = (value: string) =>
32
- value.replaceAll(/[^a-zA-Z0-9_-]/g, "-");
33
-
34
- const toNodeArray = (children: ReactNode): ReactNode[] =>
35
- Array.isArray(children) ? children.flatMap(toNodeArray) : [children];
36
-
37
- const getCodeLabel = (
38
- element: ReactElement<CodeGroupItemProps>,
39
- index: number
40
- ) => {
41
- const title = element.props["data-rehype-pretty-code-title"];
42
- if (title) {
43
- return title;
44
- }
45
-
46
- const pre = toNodeArray(element.props.children).find(
47
- (child) => isValidElement(child) && child.type === "pre"
48
- );
49
- if (isValidElement<{ className?: string }>(pre)) {
50
- const languageClass = pre.props.className
51
- ?.split(" ")
52
- .find((className: string) => className.startsWith("language-"));
53
- if (languageClass) {
54
- return languageClass.replace("language-", "");
55
- }
56
- }
57
-
58
- return `Tab ${index + 1}`;
59
- };
60
-
61
- const resolveCodeItems = (children: ReactNode): ResolvedCodeItem[] =>
62
- toNodeArray(children)
63
- .filter((child): child is ReactElement<CodeGroupItemProps> =>
64
- isValidElement<CodeGroupItemProps>(child)
65
- )
66
- .map((element, index) => {
67
- const label = getCodeLabel(element, index);
68
- const key = sanitizeDomId(
69
- String(
70
- element.key ??
71
- element.props["data-rehype-pretty-code-title"] ??
72
- `code-${index + 1}`
73
- )
74
- );
75
-
76
- return {
77
- element,
78
- key,
79
- label,
80
- };
81
- });
82
-
83
- export const CodeGroup = ({ children }: CodeGroupProps) => {
84
- const items = useMemo(() => resolveCodeItems(children), [children]);
85
- const [active, setActive] = useState(0);
86
- const activeIndex = clampTabIndex(active, items.length);
87
- const activeItem = items[activeIndex];
88
- const tabsId = useId();
89
-
90
- const getTabId = useCallback(
91
- (index: number) => `${tabsId}-${items[index]?.key ?? index}-tab`,
92
- [items, tabsId]
93
- );
94
- const getPanelId = useCallback(
95
- (index: number) => `${tabsId}-${items[index]?.key ?? index}-panel`,
96
- [items, tabsId]
97
- );
98
- const focusTab = useCallback(
99
- (index: number) => {
100
- document.querySelector<HTMLElement>(`[id="${getTabId(index)}"]`)?.focus();
101
- },
102
- [getTabId]
103
- );
104
-
105
- const handleTabClick = useCallback((event: MouseEvent<HTMLButtonElement>) => {
106
- const index = Number(event.currentTarget.dataset.index ?? "0");
107
- setActive(index);
108
- }, []);
109
-
110
- const handleTabKeyDown = useCallback(
111
- (event: KeyboardEvent<HTMLButtonElement>) => {
112
- if (!items.length) {
113
- return;
114
- }
115
-
116
- const index = Number(event.currentTarget.dataset.index ?? activeIndex);
117
- const lastIndex = items.length - 1;
118
- let nextIndex: number | null = null;
119
-
120
- switch (event.key) {
121
- case "ArrowDown":
122
- case "ArrowRight": {
123
- nextIndex = index === lastIndex ? 0 : index + 1;
124
- break;
125
- }
126
- case "ArrowLeft":
127
- case "ArrowUp": {
128
- nextIndex = index === 0 ? lastIndex : index - 1;
129
- break;
130
- }
131
- case "End": {
132
- nextIndex = lastIndex;
133
- break;
134
- }
135
- case "Home": {
136
- nextIndex = 0;
137
- break;
138
- }
139
- default: {
140
- return;
141
- }
142
- }
143
-
144
- event.preventDefault();
145
- setActive(nextIndex);
146
- focusTab(nextIndex);
147
- },
148
- [activeIndex, focusTab, items.length]
149
- );
150
-
151
- if (!activeItem) {
152
- return children as ReactElement;
153
- }
154
-
155
- if (items.length === 1) {
156
- return activeItem.element;
157
- }
158
-
159
- return (
160
- <div className="my-4 overflow-hidden rounded-xl bg-code">
161
- <div
162
- aria-orientation="horizontal"
163
- className="flex gap-1 border-b border-border bg-muted/50 px-2 pt-2"
164
- role="tablist"
165
- >
166
- {items.map((item, index) => {
167
- const isSelected = index === activeIndex;
168
-
169
- return (
170
- <button
171
- aria-controls={getPanelId(index)}
172
- aria-selected={isSelected}
173
- className={cn(
174
- "rounded-t-md border-b-2 px-3 py-1.5 font-mono text-xs transition-colors",
175
- isSelected
176
- ? "border-primary text-foreground"
177
- : "border-transparent text-muted-foreground hover:text-foreground"
178
- )}
179
- data-index={index}
180
- id={getTabId(index)}
181
- key={item.key}
182
- onClick={handleTabClick}
183
- onKeyDown={handleTabKeyDown}
184
- role="tab"
185
- tabIndex={isSelected ? 0 : -1}
186
- type="button"
187
- >
188
- {item.label}
189
- </button>
190
- );
191
- })}
192
- </div>
193
- <div
194
- aria-labelledby={getTabId(activeIndex)}
195
- id={getPanelId(activeIndex)}
196
- role="tabpanel"
197
- tabIndex={0}
198
- >
199
- {activeItem.element}
200
- </div>
201
- </div>
202
- );
203
- };
@@ -1,87 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- interface ColorItemProps {
6
- name?: string;
7
- value: string | { light: string; dark: string };
8
- }
9
-
10
- const ColorItem = ({ name, value }: ColorItemProps) => {
11
- const lightValue = typeof value === "string" ? value : value.light;
12
- const darkValue = typeof value === "string" ? value : value.dark;
13
-
14
- return (
15
- <div className="flex items-center gap-3">
16
- <div
17
- className="size-8 shrink-0 rounded-md border border-border"
18
- style={{ backgroundColor: lightValue }}
19
- >
20
- {typeof value === "string" ? null : (
21
- <div
22
- className="hidden size-full rounded-md dark:block"
23
- style={{ backgroundColor: darkValue }}
24
- />
25
- )}
26
- </div>
27
- <div className="min-w-0">
28
- {name ? (
29
- <div className="text-sm font-medium text-foreground">{name}</div>
30
- ) : null}
31
- <div className="font-mono text-xs text-muted-foreground">
32
- {lightValue}
33
- </div>
34
- </div>
35
- </div>
36
- );
37
- };
38
-
39
- interface ColorRowProps {
40
- title?: string;
41
- children: ReactNode;
42
- }
43
-
44
- const ColorRow = ({ title, children }: ColorRowProps) => (
45
- <>
46
- {title ? (
47
- <tr>
48
- <td
49
- className="border-b border-border bg-muted/50 px-4 py-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground"
50
- colSpan={2}
51
- >
52
- {title}
53
- </td>
54
- </tr>
55
- ) : null}
56
- {children}
57
- </>
58
- );
59
-
60
- interface ColorProps {
61
- variant?: "compact" | "table";
62
- children: ReactNode;
63
- }
64
-
65
- const Color = ({ variant = "compact", children }: ColorProps) => (
66
- <div
67
- className={cn(
68
- "my-4",
69
- variant === "compact" &&
70
- "grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",
71
- variant === "table" && "overflow-hidden rounded-xl border border-border"
72
- )}
73
- >
74
- {variant === "table" ? (
75
- <table className="w-full text-sm">
76
- <tbody>{children}</tbody>
77
- </table>
78
- ) : (
79
- children
80
- )}
81
- </div>
82
- );
83
-
84
- Color.Item = ColorItem;
85
- Color.Row = ColorRow;
86
-
87
- export { Color };
@@ -1,25 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- interface ColumnsProps {
6
- cols?: 1 | 2 | 3 | 4;
7
- children: ReactNode;
8
- }
9
-
10
- const colStyles: Record<number, string> = {
11
- 1: "grid-cols-1",
12
- 2: "grid-cols-1 sm:grid-cols-2",
13
- 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
14
- 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
15
- };
16
-
17
- export const Columns = ({ cols = 2, children }: ColumnsProps) => (
18
- <div className={cn("my-4 grid gap-4", colStyles[cols] ?? colStyles[2])}>
19
- {children}
20
- </div>
21
- );
22
-
23
- export const Column = ({ children }: { children: ReactNode }) => (
24
- <div className="min-w-0">{children}</div>
25
- );