radiant-docs 0.1.37 → 0.1.39

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 (38) hide show
  1. package/package.json +1 -1
  2. package/template/astro.config.mjs +2 -0
  3. package/template/src/components/Footer.astro +1 -1
  4. package/template/src/components/Header.astro +8 -8
  5. package/template/src/components/OpenApiPage.astro +18 -18
  6. package/template/src/components/Search.astro +18 -18
  7. package/template/src/components/Sidebar.astro +4 -2
  8. package/template/src/components/SidebarDropdown.astro +82 -79
  9. package/template/src/components/SidebarSegmented.astro +5 -5
  10. package/template/src/components/TableOfContents.astro +24 -15
  11. package/template/src/components/ThemeSwitcher.astro +15 -8
  12. package/template/src/components/chat/AskAiWidget.tsx +4 -3
  13. package/template/src/components/endpoint/PlaygroundBar.astro +3 -3
  14. package/template/src/components/endpoint/PlaygroundButton.astro +2 -2
  15. package/template/src/components/endpoint/PlaygroundField.astro +53 -53
  16. package/template/src/components/endpoint/PlaygroundForm.astro +38 -22
  17. package/template/src/components/endpoint/RequestSnippets.astro +54 -21
  18. package/template/src/components/endpoint/ResponseDisplay.astro +24 -24
  19. package/template/src/components/endpoint/ResponseFieldTree.astro +12 -12
  20. package/template/src/components/endpoint/ResponseFields.astro +19 -19
  21. package/template/src/components/endpoint/ResponseSnippets.astro +66 -29
  22. package/template/src/components/ui/CodeTabEdge.astro +6 -4
  23. package/template/src/components/ui/Field.astro +7 -7
  24. package/template/src/components/ui/demo/Demo.astro +1 -1
  25. package/template/src/components/user/Accordion.astro +3 -3
  26. package/template/src/components/user/Callout.astro +8 -8
  27. package/template/src/components/user/CodeBlock.astro +63 -25
  28. package/template/src/components/user/CodeGroup.astro +259 -22
  29. package/template/src/components/user/ComponentPreviewBlock.astro +36 -10
  30. package/template/src/components/user/Image.astro +2 -2
  31. package/template/src/components/user/Step.astro +4 -4
  32. package/template/src/components/user/Tab.astro +1 -1
  33. package/template/src/components/user/Tabs.astro +142 -42
  34. package/template/src/layouts/Layout.astro +1 -1
  35. package/template/src/lib/code/code-block.ts +150 -15
  36. package/template/src/lib/mdx/remark-resolve-internal-links.ts +639 -0
  37. package/template/src/pages/404.astro +44 -0
  38. package/template/src/styles/global.css +51 -19
@@ -761,7 +761,7 @@ Object.entries(responses)
761
761
  </h5>
762
762
  </div>
763
763
  {response.description && (
764
- <span class="mt-1 text-sm text-neutral-500">
764
+ <span class="mt-1 text-sm text-neutral-500 dark:text-neutral-400">
765
765
  {response.description}
766
766
  </span>
767
767
  )}
@@ -769,21 +769,21 @@ Object.entries(responses)
769
769
  {response.fields.length > 0 && (
770
770
  <>
771
771
  {response.variants && response.variants.length > 0 && (
772
- <p class="mb-2 text-xs text-neutral-500">Common fields</p>
772
+ <p class="mb-2 text-xs text-neutral-500 dark:text-neutral-400">Common fields</p>
773
773
  )}
774
774
  <div x-data="{ expanded: false }">
775
775
  <div
776
- class="w-full overflow-hidden rounded-xl border border-neutral-200 bg-white transition-colors duration-200"
777
- x-bind:class="expanded ? 'border-neutral-300' : 'border-neutral-200'"
776
+ class="w-full overflow-hidden rounded-xl border border-neutral-200 bg-white transition-colors duration-200 dark:border-neutral-800 dark:bg-(--rd-code-surface)"
777
+ x-bind:class="expanded ? 'border-neutral-300 dark:border-neutral-700' : 'border-neutral-200 dark:border-neutral-800'"
778
778
  >
779
779
  <button
780
780
  type="button"
781
781
  x-on:click="expanded = !expanded"
782
782
  x-bind:aria-expanded="expanded"
783
- class="group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200"
783
+ class="group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:bg-neutral-800/60"
784
784
  >
785
785
  <span class="inline-flex items-center gap-2">
786
- <ListChevronsToggle class="size-4 shrink-0 text-neutral-500 group-hover:text-neutral-600 transition duration-200" />
786
+ <ListChevronsToggle class="size-4 shrink-0 text-neutral-500 group-hover:text-neutral-600 transition duration-200 dark:text-neutral-500 dark:group-hover:text-neutral-300" />
787
787
  <span>
788
788
  {response.fields.length}{" "}
789
789
  {response.fields.length === 1
@@ -793,7 +793,7 @@ Object.entries(responses)
793
793
  </span>
794
794
  </button>
795
795
  <div x-show="expanded" x-collapse x-cloak>
796
- <div class="border-t border-neutral-100 p-3">
796
+ <div class="border-t border-neutral-100 p-3 dark:border-neutral-800">
797
797
  <ResponseFieldTree fields={response.fields} />
798
798
  </div>
799
799
  </div>
@@ -803,30 +803,30 @@ Object.entries(responses)
803
803
  )}
804
804
  {response.variants && response.variants.length > 0 && (
805
805
  <div class="mt-3 space-y-2">
806
- <p class="text-xs text-neutral-500">
806
+ <p class="text-xs text-neutral-500 dark:text-neutral-400">
807
807
  {response.variantType === "anyOf"
808
808
  ? "One or more response variants may apply."
809
809
  : "Returns one of these response variants."}
810
810
  </p>
811
811
  {response.variants.map((variant, index) => (
812
812
  <>
813
- <div class="rounded-xl border border-neutral-200 bg-white p-3">
814
- <div class="mb-2 text-xs font-medium text-neutral-600">
813
+ <div class="rounded-xl border border-neutral-200 bg-white p-3 dark:border-neutral-800 dark:bg-neutral-900/60">
814
+ <div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
815
815
  {variant.label}
816
816
  </div>
817
817
  <div x-data="{ expanded: false }">
818
818
  <div
819
- class="w-full overflow-hidden rounded-lg border border-neutral-200 bg-white transition-colors duration-200"
820
- x-bind:class="expanded ? 'border-neutral-300' : 'border-neutral-200'"
819
+ class="w-full overflow-hidden rounded-lg border border-neutral-200 bg-white transition-colors duration-200 dark:border-neutral-800 dark:bg-(--rd-code-surface)"
820
+ x-bind:class="expanded ? 'border-neutral-300 dark:border-neutral-700' : 'border-neutral-200 dark:border-neutral-800'"
821
821
  >
822
822
  <button
823
823
  type="button"
824
824
  x-on:click="expanded = !expanded"
825
825
  x-bind:aria-expanded="expanded"
826
- class="group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-xs font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200"
826
+ class="group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-xs font-medium text-neutral-700 hover:bg-neutral-50 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:bg-neutral-800/60"
827
827
  >
828
828
  <span class="inline-flex items-center gap-2">
829
- <ListChevronsToggle class="size-4 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200" />
829
+ <ListChevronsToggle class="size-4 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200 dark:text-neutral-500 dark:group-hover:text-neutral-300" />
830
830
  <span>
831
831
  {variant.fields.length}{" "}
832
832
  {variant.fields.length === 1
@@ -836,7 +836,7 @@ Object.entries(responses)
836
836
  </span>
837
837
  </button>
838
838
  <div x-show="expanded" x-collapse x-cloak>
839
- <div class="border-t border-neutral-100 px-3 py-3">
839
+ <div class="border-t border-neutral-100 px-3 py-3 dark:border-neutral-800">
840
840
  <ResponseFieldTree fields={variant.fields} />
841
841
  </div>
842
842
  </div>
@@ -846,11 +846,11 @@ Object.entries(responses)
846
846
  {response.variantType === "oneOf" &&
847
847
  index < response.variants.length - 1 && (
848
848
  <div class="flex items-center gap-2 py-0">
849
- <div class="h-px flex-1 bg-neutral-200" />
850
- <span class="px-1 text-[10px] uppercase tracking-wide text-neutral-500">
849
+ <div class="h-px flex-1 bg-neutral-200 dark:bg-neutral-800" />
850
+ <span class="px-1 text-[10px] uppercase tracking-wide text-neutral-500 dark:text-neutral-400">
851
851
  OR
852
852
  </span>
853
- <div class="h-px flex-1 bg-neutral-200" />
853
+ <div class="h-px flex-1 bg-neutral-200 dark:bg-neutral-800" />
854
854
  </div>
855
855
  )}
856
856
  </>
@@ -859,7 +859,7 @@ Object.entries(responses)
859
859
  )}
860
860
  {response.fields.length === 0 &&
861
861
  (!response.variants || response.variants.length === 0) ? (
862
- <p class="text-sm text-neutral-500 ml-2">No response body fields</p>
862
+ <p class="text-sm text-neutral-500 ml-2 dark:text-neutral-400">No response body fields</p>
863
863
  ) : null}
864
864
  </div>
865
865
  ))
@@ -52,20 +52,24 @@ Object.entries(responses).forEach(([statusCode, response]: [string, any]) => {
52
52
 
53
53
  const statusCodeStyles = {
54
54
  "2": {
55
- badge: "bg-green-50 text-green-700/70 border-green-700/10",
56
- dot: "bg-green-700/70",
55
+ badge:
56
+ "bg-green-50 text-green-700/70 border-green-700/10 dark:bg-green-900/30 dark:text-green-300 dark:border-green-300/20",
57
+ dot: "bg-green-700/70 dark:bg-green-400/80",
57
58
  },
58
59
  "3": {
59
- badge: "bg-blue-50 text-blue-700/70 border-blue-700/10",
60
- dot: "bg-blue-700/70",
60
+ badge:
61
+ "bg-blue-50 text-blue-700/70 border-blue-700/10 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-300/20",
62
+ dot: "bg-blue-700/70 dark:bg-blue-400/80",
61
63
  },
62
64
  "4": {
63
- badge: "bg-yellow-50 text-yellow-600/80 border-yellow-600/10",
64
- dot: "bg-yellow-500/80",
65
+ badge:
66
+ "bg-yellow-50 text-yellow-600/80 border-yellow-600/10 dark:bg-yellow-900/30 dark:text-yellow-300 dark:border-yellow-300/20",
67
+ dot: "bg-yellow-500/80 dark:bg-yellow-400/90",
65
68
  },
66
69
  "5": {
67
- badge: "bg-red-50 text-red-700/70 border-red-700/10",
68
- dot: "bg-red-700/70",
70
+ badge:
71
+ "bg-red-50 text-red-700/70 border-red-700/10 dark:bg-red-900/30 dark:text-red-300 dark:border-red-300/20",
72
+ dot: "bg-red-700/70 dark:bg-red-400/80",
69
73
  },
70
74
  } as const;
71
75
 
@@ -76,25 +80,58 @@ function getStatusCodeClass(statusCode: string, key: "badge" | "dot"): string {
76
80
 
77
81
  function buildTokenStyle(token: {
78
82
  color?: string;
83
+ darkColor?: string;
79
84
  bgColor?: string;
85
+ darkBgColor?: string;
80
86
  fontStyle?: number;
81
87
  htmlStyle?: Record<string, string>;
88
+ darkHtmlStyle?: Record<string, string>;
82
89
  }): string | undefined {
83
90
  const styleSegments: string[] = [];
84
91
 
85
- if (token.color) styleSegments.push(`color:${token.color}`);
86
- if (token.bgColor) styleSegments.push(`background-color:${token.bgColor}`);
92
+ const pushStyleVariable = (property: string, value?: string) => {
93
+ if (value) styleSegments.push(`${property}:${value}`);
94
+ };
95
+
96
+ pushStyleVariable("--rd-token-color", token.color);
97
+ pushStyleVariable("--rd-token-color-dark", token.darkColor);
98
+ pushStyleVariable("--rd-token-bg", token.bgColor);
99
+ pushStyleVariable("--rd-token-bg-dark", token.darkBgColor);
87
100
 
88
101
  const fontStyle = typeof token.fontStyle === "number" ? token.fontStyle : 0;
89
102
  if ((fontStyle & 1) === 1) styleSegments.push("font-style:italic");
90
103
  if ((fontStyle & 2) === 2) styleSegments.push("font-weight:600");
91
104
  if ((fontStyle & 4) === 4) styleSegments.push("text-decoration:underline");
92
105
 
93
- if (token.htmlStyle && typeof token.htmlStyle === "object") {
94
- for (const [property, value] of Object.entries(token.htmlStyle)) {
106
+ const pushHtmlStyle = (
107
+ styleObject: Record<string, string> | undefined,
108
+ isDarkStyle: boolean,
109
+ ) => {
110
+ if (!styleObject || typeof styleObject !== "object") return;
111
+
112
+ for (const [property, value] of Object.entries(styleObject)) {
113
+ const normalizedProperty = property.trim().toLowerCase();
114
+ if (normalizedProperty === "color") {
115
+ pushStyleVariable(
116
+ isDarkStyle ? "--rd-token-color-dark" : "--rd-token-color",
117
+ value,
118
+ );
119
+ continue;
120
+ }
121
+ if (normalizedProperty === "background-color") {
122
+ pushStyleVariable(
123
+ isDarkStyle ? "--rd-token-bg-dark" : "--rd-token-bg",
124
+ value,
125
+ );
126
+ continue;
127
+ }
128
+
95
129
  styleSegments.push(`${property}:${value}`);
96
130
  }
97
- }
131
+ };
132
+
133
+ pushHtmlStyle(token.htmlStyle, false);
134
+ pushHtmlStyle(token.darkHtmlStyle, true);
98
135
 
99
136
  if (!styleSegments.length) return undefined;
100
137
  return styleSegments.join(";");
@@ -139,7 +176,7 @@ async function renderCodeLinesHtml(
139
176
  const tokenStyleAttribute = tokenStyle
140
177
  ? ` style="${escapeAttribute(tokenStyle)}"`
141
178
  : "";
142
- return `<span${tokenStyleAttribute}>${escapeHtml(token.content)}</span>`;
179
+ return `<span data-rd-token${tokenStyleAttribute}>${escapeHtml(token.content)}</span>`;
143
180
  })
144
181
  .join("")
145
182
  : fallbackLineContent.length > 0
@@ -269,10 +306,10 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
269
306
  >
270
307
  <div class="group/prose-code not-prose relative h-full min-h-0 w-full max-w-full min-w-0">
271
308
  <div
272
- class="flex h-full min-h-0 w-full max-w-full min-w-0 flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-xs"
309
+ class="flex h-full min-h-0 w-full max-w-full min-w-0 flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-xs dark:border-neutral-800 dark:bg-(--rd-code-surface)"
273
310
  >
274
311
  <div
275
- class="flex items-center justify-between gap-2 border-b border-neutral-200 rounded-t-xl bg-neutral-50 inset-shadow-sm inset-shadow-neutral-100/80"
312
+ class="flex items-center justify-between gap-2 border-b border-neutral-200 rounded-t-xl bg-neutral-50 inset-shadow-sm inset-shadow-neutral-100/80 dark:border-neutral-800 dark:bg-neutral-900/60 dark:inset-shadow-neutral-900/80"
276
313
  >
277
314
  {
278
315
  hasMultipleResponses ? (
@@ -283,7 +320,7 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
283
320
  >
284
321
  <div
285
322
  aria-hidden="true"
286
- class="pointer-events-none absolute top-1/2 z-0 h-[28px] -translate-y-1/2 rounded-lg border-[0.5px] border-neutral-200 bg-white shadow-xs transition-[left,width,opacity] duration-200 ease-out"
323
+ class="pointer-events-none absolute top-1/2 z-0 h-[28px] -translate-y-1/2 rounded-lg border-[0.5px] border-neutral-200 bg-white shadow-xs transition-[left,width,opacity] duration-200 ease-out dark:border-neutral-700/70 dark:bg-(--rd-code-surface)"
287
324
  x-bind:class="pillVisible ? 'opacity-100' : 'opacity-0'"
288
325
  x-bind:style="'left:' + pillLeft + 'px;width:' + pillWidth + 'px;'"
289
326
  />
@@ -297,7 +334,7 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
297
334
  x-bind:data-rd-snippet-tab="index"
298
335
  x-on:click="select(index)"
299
336
  class="relative z-10 inline-flex h-9 items-center gap-2 border-0 bg-transparent px-3 py-1.5 text-xs font-medium transition-colors duration-150 focus:outline-none focus-visible:outline-none cursor-pointer"
300
- x-bind:class="selected === index ? 'text-neutral-900' : 'text-neutral-600'"
337
+ x-bind:class="selected === index ? 'text-foreground' : 'text-muted-foreground'"
301
338
  >
302
339
  <span
303
340
  class="size-[7px] shrink-0 rounded-full transition-opacity duration-150"
@@ -309,13 +346,13 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
309
346
  </div>
310
347
  ) : (
311
348
  <div class="min-w-0 flex-1">
312
- <div class="relative h-9 w-fit max-w-full rounded-tl-xl bg-white">
313
- <div class="absolute inset-x-0 -bottom-px h-px bg-white"></div>
349
+ <div class="relative h-9 w-fit max-w-full rounded-tl-xl bg-white dark:bg-(--rd-code-surface)">
350
+ <div class="absolute inset-x-0 -bottom-px h-px bg-white dark:bg-(--rd-code-surface)"></div>
314
351
  <CodeTabEdge
315
352
  className="pointer-events-none absolute -top-px left-full z-10 h-[calc(100%+2px)]"
316
353
  />
317
354
 
318
- <div class="relative z-20 inline-flex h-9 max-w-full items-center gap-2 pl-5 pr-3 py-1.5 text-xs font-medium text-neutral-700">
355
+ <div class="relative z-20 inline-flex h-9 max-w-full items-center gap-2 pl-5 pr-3 py-1.5 text-xs font-medium text-neutral-700 dark:text-neutral-300">
319
356
  <span
320
357
  class="size-[7px] shrink-0 rounded-full"
321
358
  class:list={[firstResponse.dotClass]}></span>
@@ -326,15 +363,15 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
326
363
  )
327
364
  }
328
365
 
329
- <div class="relative h-9 w-5 shrink-0 rounded-tr-xl bg-white">
330
- <div class="absolute inset-x-0 -bottom-px h-px bg-white"></div>
366
+ <div class="relative h-9 w-5 shrink-0 rounded-tr-xl bg-white dark:bg-(--rd-code-surface)">
367
+ <div class="absolute inset-x-0 -bottom-px h-px bg-white dark:bg-(--rd-code-surface)"></div>
331
368
  <CodeTabEdge
332
369
  className="pointer-events-none absolute -top-px right-full z-10 h-[calc(100%+2px)] rotate-y-180"
333
370
  />
334
371
  <button
335
372
  x-on:click="copySelected()"
336
373
  type="button"
337
- class="absolute right-2 top-1/2 z-20 inline-flex size-7 -translate-y-1/2 appearance-none items-center justify-center rounded-md border-0 bg-transparent text-neutral-500/80 shadow-none outline-none ring-0 transition-colors duration-150 hover:bg-neutral-50 hover:text-neutral-600 focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 cursor-pointer"
374
+ class="absolute right-2 top-1/2 z-20 inline-flex size-7 -translate-y-1/2 appearance-none items-center justify-center rounded-md border-0 bg-transparent text-neutral-500/80 shadow-none outline-none ring-0 transition-colors duration-150 hover:bg-neutral-50 hover:text-neutral-600 focus:outline-none focus-visible:outline-none focus:ring-0 focus-visible:ring-0 cursor-pointer dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-200"
338
375
  aria-label="Copy code"
339
376
  >
340
377
  <Icon
@@ -345,7 +382,7 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
345
382
  />
346
383
  <Icon
347
384
  name="lucide:check"
348
- class="absolute size-3.5 stroke-3 origin-center text-green-700/80 transition-all duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform motion-reduce:transition-none"
385
+ class="absolute size-3.5 stroke-3 origin-center text-green-700/80 transition-all duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform motion-reduce:transition-none dark:text-green-400/90"
349
386
  x-bind:class="copied ? 'scale-110 opacity-100 rotate-0' : 'scale-25 opacity-0 rotate-6'"
350
387
  aria-hidden="true"
351
388
  />
@@ -354,16 +391,16 @@ const hasMultipleResponses = responseSnippetItems.length > 1;
354
391
  </div>
355
392
 
356
393
  <div class="relative min-h-0 min-w-0 flex-1 overflow-hidden rounded-b-xl">
357
- <div class="relative h-full overflow-auto [scrollbar-width:thin] [scrollbar-color:var(--color-neutral-300)_transparent] [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-neutral-300/70 hover:[&::-webkit-scrollbar-thumb]:bg-neutral-300/90">
358
- <div class="pointer-events-none sticky top-0 z-10 -mb-4 h-4 w-full bg-linear-to-b from-white to-transparent"></div>
394
+ <div class="relative h-full overflow-auto [scrollbar-width:thin] [scrollbar-color:var(--color-neutral-300)_transparent] [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-neutral-300/70 hover:[&::-webkit-scrollbar-thumb]:bg-neutral-300/90 dark:[scrollbar-color:var(--color-neutral-700)_transparent] dark:[&::-webkit-scrollbar-thumb]:bg-neutral-700/70 dark:hover:[&::-webkit-scrollbar-thumb]:bg-neutral-700/90">
395
+ <div class="pointer-events-none sticky top-0 z-10 -mb-4 h-4 w-full bg-linear-to-b from-white to-transparent dark:from-(--rd-code-surface)"></div>
359
396
  {
360
397
  responseSnippetItems.map((snippet, index) => (
361
398
  <pre
362
- class="relative m-0 min-w-full bg-white p-0 text-[13px] leading-6"
399
+ class="relative m-0 min-w-full bg-white p-0 text-[13px] leading-6 dark:bg-(--rd-code-surface)"
363
400
  x-show={`selected === ${index}`}
364
401
  {...(index !== 0 ? { "x-cloak": true } : {})}
365
402
  data-snippet-index={index}
366
- ><code class="block min-w-full py-2.5 font-mono text-neutral-800"><Fragment set:html={snippet.renderedCodeLinesHtml} /></code></pre>
403
+ ><code data-rd-code-theme class="block min-w-full py-2.5 font-mono text-neutral-800 dark:text-neutral-200"><Fragment set:html={snippet.renderedCodeLinesHtml} /></code></pre>
367
404
  ))
368
405
  }
369
406
  </div>
@@ -9,6 +9,8 @@ const idPrefix = `code_group_tab_edge_${Math.random().toString(36).slice(2, 9)}`
9
9
  const mask0Id = `code_group_tab_edge_mask0_${idPrefix}`;
10
10
  const path1OutsideMaskId = `code_group_tab_edge_path_1_outside_1_${idPrefix}`;
11
11
  const path3OutsideMaskId = `code_group_tab_edge_path_3_outside_2_${idPrefix}`;
12
+ const edgeBackgroundColor = "var(--rd-code-tab-edge-bg, #ffffff)";
13
+ const edgeBorderColor = "var(--rd-code-tab-edge-border, #e5e5e5)";
12
14
  ---
13
15
 
14
16
  <svg
@@ -47,10 +49,10 @@ const path3OutsideMaskId = `code_group_tab_edge_path_3_outside_2_${idPrefix}`;
47
49
  </mask>
48
50
  <path
49
51
  d="M1 0L8.0783 0C15.772 0 22.7836 4.41324 26.111 11.3501L34.8889 29.6498C38.2164 36.5868 45.228 41 52.9217 41H60H1L1 0Z"
50
- fill="white"></path>
52
+ fill={edgeBackgroundColor}></path>
51
53
  <path
52
54
  d="M1 0V-1H0V0L1 0ZM1 41H0V42H1V41ZM34.8889 29.6498L33.9873 30.0823L34.8889 29.6498ZM26.111 11.3501L27.0127 10.9177L26.111 11.3501ZM1 1H8.0783V-1H1V1ZM60 40H1V42H60V40ZM2 41V0L0 0L0 41H2ZM25.2094 11.7826L33.9873 30.0823L35.7906 29.2174L27.0127 10.9177L25.2094 11.7826ZM52.9217 42H60V40H52.9217V42ZM33.9873 30.0823C37.4811 37.3661 44.8433 42 52.9217 42V40C45.6127 40 38.9517 35.8074 35.7906 29.2174L33.9873 30.0823ZM8.0783 1C15.3873 1 22.0483 5.19257 25.2094 11.7826L27.0127 10.9177C23.5188 3.6339 16.1567 -1 8.0783 -1V1Z"
53
- fill="black"
55
+ fill={edgeBorderColor}
54
56
  mask={`url(#${path1OutsideMaskId})`}></path>
55
57
  </mask>
56
58
  <g mask={`url(#${mask0Id})`}>
@@ -70,10 +72,10 @@ const path3OutsideMaskId = `code_group_tab_edge_path_3_outside_2_${idPrefix}`;
70
72
  </mask>
71
73
  <path
72
74
  d="M0 1.02441H7.0783C14.772 1.02441 21.7836 5.43765 25.111 12.3746L33.8889 30.6743C37.2164 37.6112 44.228 42.0244 51.9217 42.0244H59H0L0 1.02441Z"
73
- fill="#ffffff"></path>
75
+ fill={edgeBackgroundColor}></path>
74
76
  <path
75
77
  d="M0 1.02441L0 0.0244141H-1V1.02441H0ZM0 42.0244H-1V43.0244H0L0 42.0244ZM33.8889 30.6743L32.9873 31.1068L33.8889 30.6743ZM25.111 12.3746L26.0127 11.9421L25.111 12.3746ZM0 2.02441H7.0783V0.0244141H0L0 2.02441ZM59 41.0244H0L0 43.0244H59V41.0244ZM1 42.0244L1 1.02441H-1L-1 42.0244H1ZM24.2094 12.8071L32.9873 31.1068L34.7906 30.2418L26.0127 11.9421L24.2094 12.8071ZM51.9217 43.0244H59V41.0244H51.9217V43.0244ZM32.9873 31.1068C36.4811 38.3905 43.8433 43.0244 51.9217 43.0244V41.0244C44.6127 41.0244 37.9517 36.8318 34.7906 30.2418L32.9873 31.1068ZM7.0783 2.02441C14.3873 2.02441 21.0483 6.21699 24.2094 12.8071L26.0127 11.9421C22.5188 4.65831 15.1567 0.0244141 7.0783 0.0244141V2.02441Z"
76
- fill="#e5e5e5"
78
+ fill={edgeBorderColor}
77
79
  mask={`url(#${path3OutsideMaskId})`}></path>
78
80
  </g>
79
81
  </svg>
@@ -81,19 +81,19 @@ if (hasMinLength && hasMaxLength) {
81
81
  {name}
82
82
  </h5>
83
83
  <code
84
- class="text-[10px] font-medium text-neutral-500 border border-neutral-200/80 bg-neutral-50 px-1 rounded-sm"
84
+ class="text-[10px] font-medium text-neutral-500 border border-neutral-200/80 bg-neutral-50 px-1 rounded-sm dark:text-neutral-300 dark:border-neutral-700/70 dark:bg-neutral-900/70"
85
85
  >{type}</code
86
86
  >
87
87
  {
88
88
  required && (
89
- <div class="text-red-700/70 bg-red-50 border border-red-700/10 rounded-full px-1.5 text-[10px] font-mono leading-none py-0.5 pb-0.5 font-[450] h-fit">
89
+ <div class="text-red-700/70 bg-red-50 border border-red-700/10 rounded-full px-1.5 text-[10px] font-mono leading-none py-0.5 pb-0.5 font-[450] h-fit dark:text-red-300 dark:bg-red-950/40 dark:border-red-900/40">
90
90
  required
91
91
  </div>
92
92
  )
93
93
  }
94
94
  {
95
95
  optional && (
96
- <div class="text-blue-700/70 bg-blue-50 border border-blue-700/10 rounded-full px-1.5 font-mono text-[10px] leading-none py-0.5 pb-0.5 font-[450] h-fit">
96
+ <div class="text-blue-700/70 bg-blue-50 border border-blue-700/10 rounded-full px-1.5 font-mono text-[10px] leading-none py-0.5 pb-0.5 font-[450] h-fit dark:text-blue-300 dark:bg-blue-950/40 dark:border-blue-900/40">
97
97
  optional
98
98
  </div>
99
99
  )
@@ -103,7 +103,7 @@ if (hasMinLength && hasMaxLength) {
103
103
  {
104
104
  formattedDescription && (
105
105
  <div
106
- class="prose-rules prose-sm! leading-5! text-neutral-500 **:text-neutral-500"
106
+ class="prose-rules prose-sm! leading-5! text-neutral-500 **:text-neutral-500 dark:text-neutral-400 dark:**:text-neutral-400"
107
107
  set:html={formattedDescription}
108
108
  />
109
109
  )
@@ -115,7 +115,7 @@ if (hasMinLength && hasMaxLength) {
115
115
  {enumValues.map((v, i, a) => {
116
116
  return (
117
117
  <div class="flex">
118
- <span class="text-[11px] font-medium text-neutral-600 border border-neutral-200 bg-neutral-50 px-1 py-px rounded-md">
118
+ <span class="text-[11px] font-medium text-neutral-600 border border-neutral-200 bg-neutral-50 px-1 py-px rounded-md dark:text-neutral-300 dark:border-neutral-700 dark:bg-neutral-900/70">
119
119
  <code>{v}</code>
120
120
  </span>
121
121
  {a.length - 2 === i ? (
@@ -133,7 +133,7 @@ if (hasMinLength && hasMaxLength) {
133
133
  numericRangeLabel && (
134
134
  <div class="text-sm">
135
135
  <span class="font-medium text-xs">Range:</span>
136
- <code class="text-[11px] font-medium text-neutral-600 border border-neutral-200 bg-neutral-50 px-1 py-px rounded-md">
136
+ <code class="text-[11px] font-medium text-neutral-600 border border-neutral-200 bg-neutral-50 px-1 py-px rounded-md dark:text-neutral-300 dark:border-neutral-700 dark:bg-neutral-900/70">
137
137
  {numericRangeLabel}
138
138
  </code>
139
139
  </div>
@@ -143,7 +143,7 @@ if (hasMinLength && hasMaxLength) {
143
143
  stringLengthLabel && (
144
144
  <div class="text-sm">
145
145
  <span class="font-medium text-xs">Length:</span>
146
- <code class="text-[11px] font-medium text-neutral-600 border border-neutral-200 bg-neutral-50 px-1 py-px rounded-md">
146
+ <code class="text-[11px] font-medium text-neutral-600 border border-neutral-200 bg-neutral-50 px-1 py-px rounded-md dark:text-neutral-300 dark:border-neutral-700 dark:bg-neutral-900/70">
147
147
  {stringLengthLabel}
148
148
  </code>
149
149
  </div>
@@ -1,3 +1,3 @@
1
- <div class="border border-neutral-200 rounded-xl shadow-xs my-5!">
1
+ <div class="border rounded-xl shadow-xs my-5!">
2
2
  <slot />
3
3
  </div>
@@ -50,14 +50,14 @@ validateProps(
50
50
  }`
51
51
  x-init="id = (typeof register === 'function') ? register() : Math.random()"
52
52
  role="region"
53
- class="block border-b border-neutral-800/10 last:border-b-0. [&:first-child>h4>button]:pt-0 [&:last-child>div>div]:pb-0"
53
+ class="block border-b border-neutral-800/10 dark:border-neutral-700/50 last:border-b-0. [&:first-child>h4>button]:pt-0 [&:last-child>div>div]:pb-0"
54
54
  >
55
55
  <h4 class="not-prose">
56
56
  <button
57
57
  type="button"
58
58
  x-on:click="expanded = !expanded"
59
59
  :aria-expanded="expanded"
60
- class="pb-4 pt-4 group flex w-full items-center justify-between gap-2.5 text-left font-medium text-neutral-800"
60
+ class="pb-4 pt-4 group flex w-full items-center justify-between gap-2.5 text-left font-medium text-neutral-800 dark:text-neutral-200"
61
61
  >
62
62
  {icon && <Icon name={icon} />}
63
63
  <span class:list={["flex-1", titleSize && TITLE_SIZE_CLASS[titleSize]]}
@@ -65,7 +65,7 @@ validateProps(
65
65
  >
66
66
  <Icon
67
67
  name="lucide:chevron-down"
68
- class="size-5 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200"
68
+ class="size-5 shrink-0 text-neutral-400 group-hover:text-neutral-600 transition duration-200 dark:text-neutral-500 dark:group-hover:text-neutral-300"
69
69
  x-bind:class="expanded && 'rotate-180'"
70
70
  />
71
71
  </button>
@@ -23,31 +23,31 @@ const typeDefaults: Record<
23
23
  warning: {
24
24
  icon: warningIcon,
25
25
  color: "bg-amber-500",
26
- iconColor: "text-amber-500",
26
+ iconColor: "text-amber-500 dark:text-amber-400",
27
27
  title: "Warning",
28
28
  },
29
29
  info: {
30
30
  icon: infoIcon,
31
31
  color: "bg-sky-600/80",
32
- iconColor: "text-sky-600/80",
32
+ iconColor: "text-sky-600/80 dark:text-sky-400",
33
33
  title: "Info",
34
34
  },
35
35
  tip: {
36
36
  icon: lightbulbIcon,
37
37
  color: "bg-yellow-500",
38
- iconColor: "text-yellow-500",
38
+ iconColor: "text-yellow-500 dark:text-yellow-400",
39
39
  title: "Tip",
40
40
  },
41
41
  danger: {
42
42
  icon: dangerIcon,
43
43
  color: "bg-red-600",
44
- iconColor: "text-red-600",
44
+ iconColor: "text-red-600 dark:text-red-400",
45
45
  title: "Danger",
46
46
  },
47
47
  success: {
48
48
  icon: successIcon,
49
49
  color: "bg-green-600",
50
- iconColor: "text-green-600",
50
+ iconColor: "text-green-600 dark:text-green-400",
51
51
  title: "Success",
52
52
  },
53
53
  };
@@ -72,7 +72,7 @@ const resolvedTitle = title ?? defaults.title;
72
72
 
73
73
  <aside
74
74
  class:list={[
75
- "my-5 space-y-1 rounded-lg border border-neutral-200/80 shadow-xs px-4 py-3.5 pl-6 relative",
75
+ "my-5 space-y-1 rounded-lg border border-neutral-200 bg-white/80 shadow-xs px-4 py-3.5 pl-6 relative dark:border-neutral-800 dark:bg-(--rd-code-surface)",
76
76
  ]}
77
77
  role="note"
78
78
  >
@@ -96,11 +96,11 @@ const resolvedTitle = title ?? defaults.title;
96
96
  <img src={defaults.icon} alt="" width="16" height="16" class="" />
97
97
  )
98
98
  }
99
- <h6 class:list={["font-semibold text-sm"]}>
99
+ <h6 class:list={["font-semibold text-sm text-neutral-900 dark:text-neutral-100"]}>
100
100
  {resolvedTitle}
101
101
  </h6>
102
102
  </div>
103
- <div class="**:first:mt-0! **:last:mb-0! text-sm">
103
+ <div class="**:first:mt-0! **:last:mb-0! text-sm text-neutral-700 dark:text-neutral-300">
104
104
  <slot />
105
105
  </div>
106
106
  </aside>