radiant-docs 0.1.34 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/astro.config.mjs +27 -0
- package/template/package-lock.json +1027 -513
- package/template/package.json +3 -2
- package/template/scripts/generate-proxy-allowed-origins.mjs +217 -0
- package/template/scripts/generate-robots-txt.mjs +19 -0
- package/template/scripts/stamp-image-versions.mjs +63 -11
- package/template/src/components/Footer.astro +1 -1
- package/template/src/components/Header.astro +9 -9
- package/template/src/components/LogoLink.astro +2 -1
- package/template/src/components/OpenApiPage.astro +18 -18
- package/template/src/components/Search.astro +18 -18
- package/template/src/components/Sidebar.astro +4 -2
- package/template/src/components/SidebarDropdown.astro +82 -79
- package/template/src/components/SidebarGroup.astro +3 -0
- package/template/src/components/SidebarMenu.astro +14 -1
- package/template/src/components/SidebarSegmented.astro +5 -5
- package/template/src/components/SidebarSubgroup.astro +35 -12
- package/template/src/components/TableOfContents.astro +24 -15
- package/template/src/components/ThemeSwitcher.astro +15 -8
- package/template/src/components/chat/AskAiWidget.tsx +10 -5
- package/template/src/components/endpoint/PlaygroundBar.astro +3 -3
- package/template/src/components/endpoint/PlaygroundButton.astro +3 -3
- package/template/src/components/endpoint/PlaygroundField.astro +53 -53
- package/template/src/components/endpoint/PlaygroundForm.astro +51 -37
- package/template/src/components/endpoint/RequestSnippets.astro +54 -21
- package/template/src/components/endpoint/ResponseDisplay.astro +24 -24
- package/template/src/components/endpoint/ResponseFieldTree.astro +12 -12
- package/template/src/components/endpoint/ResponseFields.astro +19 -19
- package/template/src/components/endpoint/ResponseSnippets.astro +66 -29
- package/template/src/components/sidebar/SidebarEndpointLink.astro +18 -15
- package/template/src/components/sidebar/SidebarOpenApiPageLink.astro +56 -0
- package/template/src/components/ui/CodeTabEdge.astro +6 -4
- package/template/src/components/ui/Field.astro +7 -7
- package/template/src/components/ui/Icon.astro +2 -1
- package/template/src/components/ui/demo/Demo.astro +1 -1
- package/template/src/components/user/Accordion.astro +3 -3
- package/template/src/components/user/Callout.astro +8 -8
- package/template/src/components/user/CodeBlock.astro +57 -22
- package/template/src/components/user/CodeGroup.astro +14 -10
- package/template/src/components/user/ComponentPreviewBlock.astro +38 -12
- package/template/src/components/user/Image.astro +6 -2
- package/template/src/components/user/Step.astro +4 -4
- package/template/src/components/user/Tab.astro +1 -1
- package/template/src/components/user/Tabs.astro +15 -20
- package/template/src/layouts/Layout.astro +9 -4
- package/template/src/lib/code/code-block.ts +150 -15
- package/template/src/lib/mdx/remark-resolve-internal-links.ts +639 -0
- package/template/src/lib/pagefind.ts +2 -1
- package/template/src/lib/routes.ts +134 -58
- package/template/src/lib/static-asset-url.ts +62 -0
- package/template/src/lib/utils.ts +48 -0
- package/template/src/lib/validation.ts +115 -27
- package/template/src/pages/404.astro +44 -0
- package/template/src/styles/global.css +28 -19
- package/template/scripts/rewrite-static-asset-host.mjs +0 -408
|
@@ -1496,8 +1496,12 @@ export default function AskAiWidget({
|
|
|
1496
1496
|
</form>
|
|
1497
1497
|
</>
|
|
1498
1498
|
) : (
|
|
1499
|
-
<div className=
|
|
1500
|
-
<p className="text-sm text-neutral-600 dark:text-neutral-300">
|
|
1499
|
+
<div className="flex-1 px-4 py-4 flex items-center justify-center">
|
|
1500
|
+
<p className="text-sm text-neutral-600 dark:text-neutral-300 flex justify-center gap-1.5">
|
|
1501
|
+
<Icon
|
|
1502
|
+
icon="lucide:circle-alert"
|
|
1503
|
+
className="size-5 shrink-0 self-start justify-self-start mt-0.5 block"
|
|
1504
|
+
/>
|
|
1501
1505
|
{unavailableMessage}
|
|
1502
1506
|
</p>
|
|
1503
1507
|
</div>
|
|
@@ -1703,10 +1707,10 @@ export default function AskAiWidget({
|
|
|
1703
1707
|
}
|
|
1704
1708
|
`}</style>
|
|
1705
1709
|
{!isOpen ? (
|
|
1706
|
-
<div className="fixed bottom-5 right-
|
|
1710
|
+
<div className="fixed bottom-5 right-5 size-12 z-40 bg-background rounded-full hover:scale-105 transition duration-300 ease-in-out">
|
|
1707
1711
|
<button
|
|
1708
1712
|
type="button"
|
|
1709
|
-
className="w-full h-full inline-flex items-center justify-center gap-2 rounded-full bg-linear-to-b from-neutral-900/85 to-neutral-900 shadow-xl dark:
|
|
1713
|
+
className="w-full h-full inline-flex items-center justify-center gap-2 rounded-full bg-linear-to-b from-neutral-900/85 to-neutral-900 dark:from-neutral-100 dark:to-neutral-200 shadow-xl dark:shadow-white/5 cursor-pointer"
|
|
1710
1714
|
onClick={() => handleOpenChange(true)}
|
|
1711
1715
|
data-pagefind-ignore
|
|
1712
1716
|
>
|
|
@@ -1725,6 +1729,7 @@ export default function AskAiWidget({
|
|
|
1725
1729
|
open={isOpen}
|
|
1726
1730
|
onOpenChange={handleOpenChange}
|
|
1727
1731
|
disablePreventScroll={true}
|
|
1732
|
+
repositionInputs={false}
|
|
1728
1733
|
>
|
|
1729
1734
|
<Drawer.Portal>
|
|
1730
1735
|
<Drawer.Overlay className="fixed inset-0 z-50 bg-black/40" />
|
|
@@ -1739,7 +1744,7 @@ export default function AskAiWidget({
|
|
|
1739
1744
|
</Drawer.Root>
|
|
1740
1745
|
) : isOpen ? (
|
|
1741
1746
|
<div
|
|
1742
|
-
className="fixed bottom-4 right-
|
|
1747
|
+
className="fixed bottom-4 right-4 z-50"
|
|
1743
1748
|
data-pagefind-ignore
|
|
1744
1749
|
onWheelCapture={handleDesktopWheelCapture}
|
|
1745
1750
|
>
|
|
@@ -12,7 +12,7 @@ const { route, serverUrl } = Astro.props;
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
<div
|
|
15
|
-
class="min-w-0 flex-1 flex items-center p-1 border bg-white rounded-xl shadow-xs overflow-hidden"
|
|
15
|
+
class="min-w-0 flex-1 flex items-center p-1 border border-neutral-200 bg-white rounded-xl shadow-xs overflow-hidden dark:border-neutral-800 dark:bg-(--rd-code-surface)"
|
|
16
16
|
>
|
|
17
17
|
<span
|
|
18
18
|
class:list={[
|
|
@@ -23,7 +23,7 @@ const { route, serverUrl } = Astro.props;
|
|
|
23
23
|
{route.openApiMethod}
|
|
24
24
|
</span>
|
|
25
25
|
<code
|
|
26
|
-
class="group flex-1 mx-2 h-[30px] flex items-center text-[13px] text-neutral-600 min-w-0 relative cursor-pointer"
|
|
26
|
+
class="group flex-1 mx-2 h-[30px] flex items-center text-[13px] text-neutral-600 dark:text-neutral-300 min-w-0 relative cursor-pointer"
|
|
27
27
|
@click="copyPath()"
|
|
28
28
|
x-data=`{
|
|
29
29
|
copied: false,
|
|
@@ -45,7 +45,7 @@ const { route, serverUrl } = Astro.props;
|
|
|
45
45
|
{route.openApiPath}
|
|
46
46
|
</span>
|
|
47
47
|
<div
|
|
48
|
-
class="absolute right-0 top-1/2 -translate-y-1/2 flex items-center gap-1 text-[12px] px-1.5 py-px bg-white border border-neutral-200 rounded-md duration-200 opacity-0 scale-75 group-hover:scale-100 group-hover:opacity-100 group-hover:duration-200 group-hover:ease-out group-hover:delay-75"
|
|
48
|
+
class="absolute right-0 top-1/2 -translate-y-1/2 flex items-center gap-1 text-[12px] px-1.5 py-px bg-white border border-neutral-200 rounded-md duration-200 opacity-0 scale-75 group-hover:scale-100 group-hover:opacity-100 group-hover:duration-200 group-hover:ease-out group-hover:delay-75 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-300"
|
|
49
49
|
>
|
|
50
50
|
<Icon
|
|
51
51
|
name="lucide:copy"
|
|
@@ -38,10 +38,10 @@ import { Icon } from "astro-icon/components";
|
|
|
38
38
|
>
|
|
39
39
|
<button
|
|
40
40
|
x-on:click="open = true"
|
|
41
|
-
class="
|
|
41
|
+
class="font-[350] dark:font-[450] flex h-8 items-center gap-2 rounded-lg [corner-shape:superellipse(1.2)] bg-linear-to-b from-neutral-900/85 to-neutral-900 dark:from-neutral-100 dark:to-neutral-200 px-3 text-[13px] text-white dark:text-neutral-950 shadow-sm transition-all duration-200 whitespace-nowrap cursor-pointer"
|
|
42
42
|
>
|
|
43
|
+
<Icon class="-ml-px size-3.5" name="lucide:square-mouse-pointer" />
|
|
43
44
|
Try it
|
|
44
|
-
<Icon class="ml-2" name="lucide:square-mouse-pointer" />
|
|
45
45
|
</button>
|
|
46
46
|
<div
|
|
47
47
|
x-show="open"
|
|
@@ -71,7 +71,7 @@ import { Icon } from "astro-icon/components";
|
|
|
71
71
|
x-on:click.stop
|
|
72
72
|
x-on:pointerdown.stop="backdropInteractionStarted = false"
|
|
73
73
|
x-trap.noscroll.inert="open"
|
|
74
|
-
class="relative flex max-h-[calc(100dvh-4rem)] max-w-7xl w-full overflow-hidden rounded-xl bg-white p-4 sm:p-6 pb-0! shadow-lg"
|
|
74
|
+
class="relative flex max-h-[calc(100dvh-4rem)] max-w-7xl w-full overflow-hidden rounded-xl bg-white p-4 sm:p-6 pb-0! shadow-lg dark:bg-neutral-900"
|
|
75
75
|
>
|
|
76
76
|
<slot />
|
|
77
77
|
</div>
|
|
@@ -644,19 +644,19 @@ const layoutClass = isObjectLikeField
|
|
|
644
644
|
x-for={`(mapKey, mapIndex) in getMapEntryKeys()`}
|
|
645
645
|
:key={`${fieldNameKey} + '-map-' + mapKey + '-' + mapIndex`}
|
|
646
646
|
>
|
|
647
|
-
<div class="rounded-lg border border-neutral-200 bg-neutral-50/50 p-2.5">
|
|
647
|
+
<div class="rounded-lg border border-neutral-200 bg-neutral-50/50 p-2.5 dark:border-neutral-800 dark:bg-neutral-900/50">
|
|
648
648
|
<div class="mb-2 flex items-center gap-2">
|
|
649
649
|
<input
|
|
650
650
|
type="text"
|
|
651
651
|
:value="mapKey"
|
|
652
652
|
@change="renameMapKey(mapKey, $event.target.value)"
|
|
653
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white"
|
|
653
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:border-neutral-600"
|
|
654
654
|
placeholder="Property key"
|
|
655
655
|
/>
|
|
656
656
|
<button
|
|
657
657
|
type="button"
|
|
658
658
|
@click="removeMapEntry(mapKey)"
|
|
659
|
-
class="h-[31px] px-2 rounded-md border border-neutral-200 text-neutral-500 hover:text-neutral-700 hover:border-neutral-300 hover:bg-white transition-colors duration-200 cursor-pointer"
|
|
659
|
+
class="h-[31px] px-2 rounded-md border border-neutral-200 text-neutral-500 hover:text-neutral-700 hover:border-neutral-300 hover:bg-white transition-colors duration-200 cursor-pointer dark:border-neutral-700 dark:text-neutral-400 dark:hover:border-neutral-600 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-200"
|
|
660
660
|
aria-label={`Remove ${field.name} key`}
|
|
661
661
|
>
|
|
662
662
|
<Icon class="size-4" name="lucide:x" />
|
|
@@ -668,7 +668,7 @@ const layoutClass = isObjectLikeField
|
|
|
668
668
|
rows="3"
|
|
669
669
|
:value="getMapJsonValue(mapKey)"
|
|
670
670
|
@input="setMapJsonValue(mapKey, $event.target.value)"
|
|
671
|
-
class="w-full px-3 py-2 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white font-mono"
|
|
671
|
+
class="w-full px-3 py-2 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white font-mono dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:border-neutral-600"
|
|
672
672
|
placeholder="JSON value"
|
|
673
673
|
/>
|
|
674
674
|
) : field.enum && field.enum.length > 0 ? (
|
|
@@ -676,8 +676,8 @@ const layoutClass = isObjectLikeField
|
|
|
676
676
|
<select
|
|
677
677
|
:value="getMapValue(mapKey)"
|
|
678
678
|
@change="setMapValue(mapKey, $event.target.value, $event.target)"
|
|
679
|
-
:class="getMapValue(mapKey) ? 'text-neutral-700' : 'text-neutral-400'"
|
|
680
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none"
|
|
679
|
+
:class="getMapValue(mapKey) ? 'text-neutral-700 dark:text-neutral-200' : 'text-neutral-400 dark:text-neutral-500'"
|
|
680
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none dark:border-neutral-700 dark:bg-neutral-900 dark:focus:border-neutral-600"
|
|
681
681
|
>
|
|
682
682
|
<option value="" disabled hidden>Select value</option>
|
|
683
683
|
<option value="__clear__">Clear selection</option>
|
|
@@ -695,8 +695,8 @@ const layoutClass = isObjectLikeField
|
|
|
695
695
|
<select
|
|
696
696
|
:value="getMapBooleanValue(mapKey)"
|
|
697
697
|
@change="setMapBooleanValue(mapKey, $event.target.value)"
|
|
698
|
-
:class="getMapBooleanValue(mapKey) ? 'text-neutral-700' : 'text-neutral-400'"
|
|
699
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none"
|
|
698
|
+
:class="getMapBooleanValue(mapKey) ? 'text-neutral-700 dark:text-neutral-200' : 'text-neutral-400 dark:text-neutral-500'"
|
|
699
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none dark:border-neutral-700 dark:bg-neutral-900 dark:focus:border-neutral-600"
|
|
700
700
|
>
|
|
701
701
|
<option value="" disabled hidden>Select value</option>
|
|
702
702
|
<option value="__clear__">Clear selection</option>
|
|
@@ -719,7 +719,7 @@ const layoutClass = isObjectLikeField
|
|
|
719
719
|
step={numericInputStep}
|
|
720
720
|
minlength={textInputMinLength}
|
|
721
721
|
maxlength={textInputMaxLength}
|
|
722
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white"
|
|
722
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:border-neutral-600"
|
|
723
723
|
placeholder="Property value"
|
|
724
724
|
/>
|
|
725
725
|
)
|
|
@@ -729,7 +729,7 @@ const layoutClass = isObjectLikeField
|
|
|
729
729
|
<button
|
|
730
730
|
type="button"
|
|
731
731
|
@click="addMapEntry()"
|
|
732
|
-
class="inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-900 cursor-pointer transition-colors duration-200"
|
|
732
|
+
class="inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-900 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:text-neutral-100"
|
|
733
733
|
>
|
|
734
734
|
<Icon class="size-3.5" name="lucide:plus" />
|
|
735
735
|
Add property
|
|
@@ -743,17 +743,17 @@ const layoutClass = isObjectLikeField
|
|
|
743
743
|
:key={`${fieldNameKey} + '-item-' + index`}
|
|
744
744
|
>
|
|
745
745
|
<div
|
|
746
|
-
class="rounded-lg border border-neutral-200 bg-neutral-50/50 p-2.5"
|
|
746
|
+
class="rounded-lg border border-neutral-200 bg-neutral-50/50 p-2.5 dark:border-neutral-800 dark:bg-neutral-900/50"
|
|
747
747
|
x-init="ensureArrayObjectItem(index)"
|
|
748
748
|
>
|
|
749
749
|
<div class="mb-2 flex items-center justify-between">
|
|
750
|
-
<span class="text-xs font-medium text-neutral-600">
|
|
750
|
+
<span class="text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
751
751
|
Item <span x-text="index + 1" />
|
|
752
752
|
</span>
|
|
753
753
|
<button
|
|
754
754
|
type="button"
|
|
755
755
|
@click="removeArrayObjectValue(index)"
|
|
756
|
-
class="inline-flex h-6 items-center rounded-md border border-neutral-200 px-2 text-[11px] font-medium text-neutral-600 hover:border-neutral-300 hover:bg-white hover:text-neutral-700 transition-colors duration-200 cursor-pointer"
|
|
756
|
+
class="inline-flex h-6 items-center rounded-md border border-neutral-200 px-2 text-[11px] font-medium text-neutral-600 hover:border-neutral-300 hover:bg-white hover:text-neutral-700 transition-colors duration-200 cursor-pointer dark:border-neutral-700 dark:text-neutral-400 dark:hover:border-neutral-600 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-200"
|
|
757
757
|
aria-label={`Remove ${field.name} item`}
|
|
758
758
|
>
|
|
759
759
|
Remove
|
|
@@ -761,7 +761,7 @@ const layoutClass = isObjectLikeField
|
|
|
761
761
|
</div>
|
|
762
762
|
<div class="space-y-3">
|
|
763
763
|
{field.nested?.map((nestedField) => (
|
|
764
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
764
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
765
765
|
<Astro.self
|
|
766
766
|
field={nestedField}
|
|
767
767
|
requestPart={requestPart}
|
|
@@ -774,19 +774,19 @@ const layoutClass = isObjectLikeField
|
|
|
774
774
|
<div class:list={["space-y-2", hasNestedFields && "pt-1"]}>
|
|
775
775
|
{hasOneOfVariants ? (
|
|
776
776
|
<>
|
|
777
|
-
<p class="text-xs text-neutral-500">
|
|
777
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
778
778
|
Select one variant.
|
|
779
779
|
</p>
|
|
780
|
-
<div class="inline-flex max-w-full flex-wrap items-center gap-1 rounded-lg bg-neutral-100 p-1">
|
|
780
|
+
<div class="inline-flex max-w-full flex-wrap items-center gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-900/60">
|
|
781
781
|
{field.variants.map((variant, variantIndex) => (
|
|
782
782
|
<button
|
|
783
783
|
type="button"
|
|
784
784
|
@click={`selectArrayItemVariant(index, ${variantIndex})`}
|
|
785
785
|
:class={`{
|
|
786
|
-
'bg-white text-neutral-900 shadow-xs ring-1 ring-neutral-200': getSelectedArrayItemVariant(index) === ${variantIndex},
|
|
787
|
-
'text-neutral-600 hover:bg-neutral-50 hover:text-neutral-800': getSelectedArrayItemVariant(index) !== ${variantIndex}
|
|
786
|
+
'bg-white text-neutral-900 shadow-xs ring-1 ring-neutral-200 dark:bg-(--rd-code-surface) dark:text-neutral-100 dark:ring-neutral-700/70': getSelectedArrayItemVariant(index) === ${variantIndex},
|
|
787
|
+
'text-neutral-600 hover:bg-neutral-50 hover:text-neutral-800 dark:text-neutral-400 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-200': getSelectedArrayItemVariant(index) !== ${variantIndex}
|
|
788
788
|
}`}
|
|
789
|
-
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md px-2.5 text-[11px] font-medium transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-300"
|
|
789
|
+
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md px-2.5 text-[11px] font-medium transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-300 dark:focus-visible:ring-neutral-700"
|
|
790
790
|
>
|
|
791
791
|
{variant.label}
|
|
792
792
|
</button>
|
|
@@ -797,13 +797,13 @@ const layoutClass = isObjectLikeField
|
|
|
797
797
|
x-show={`getSelectedArrayItemVariant(index) === ${variantIndex}`}
|
|
798
798
|
x-cloak
|
|
799
799
|
>
|
|
800
|
-
<div class="rounded-md border border-neutral-200 bg-white p-2.5">
|
|
801
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
800
|
+
<div class="rounded-md border border-neutral-200 bg-white p-2.5 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
801
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
802
802
|
{variant.label}
|
|
803
803
|
</div>
|
|
804
804
|
<div class="space-y-3">
|
|
805
805
|
{variant.fields.map((variantField) => (
|
|
806
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
806
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
807
807
|
<Astro.self
|
|
808
808
|
field={variantField}
|
|
809
809
|
requestPart={requestPart}
|
|
@@ -819,17 +819,17 @@ const layoutClass = isObjectLikeField
|
|
|
819
819
|
</>
|
|
820
820
|
) : (
|
|
821
821
|
<>
|
|
822
|
-
<p class="text-xs text-neutral-500">
|
|
822
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
823
823
|
One or more variants may apply.
|
|
824
824
|
</p>
|
|
825
825
|
{field.variants.map((variant) => (
|
|
826
|
-
<div class="rounded-md border border-neutral-200 bg-white p-2.5">
|
|
827
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
826
|
+
<div class="rounded-md border border-neutral-200 bg-white p-2.5 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
827
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
828
828
|
{variant.label}
|
|
829
829
|
</div>
|
|
830
830
|
<div class="space-y-3">
|
|
831
831
|
{variant.fields.map((variantField) => (
|
|
832
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
832
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
833
833
|
<Astro.self
|
|
834
834
|
field={variantField}
|
|
835
835
|
requestPart={requestPart}
|
|
@@ -851,7 +851,7 @@ const layoutClass = isObjectLikeField
|
|
|
851
851
|
<button
|
|
852
852
|
type="button"
|
|
853
853
|
@click="addArrayObjectValue()"
|
|
854
|
-
class="inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-900 cursor-pointer transition-colors duration-200"
|
|
854
|
+
class="inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-900 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:text-neutral-100"
|
|
855
855
|
>
|
|
856
856
|
<Icon class="size-3.5" name="lucide:plus" />
|
|
857
857
|
Add item
|
|
@@ -869,8 +869,8 @@ const layoutClass = isObjectLikeField
|
|
|
869
869
|
:value="value"
|
|
870
870
|
@change={`setArrayValue(index, $event.target.value, $event.target)`}
|
|
871
871
|
:required={`index === 0 && ${isRequiredField ? "true" : "false"}`}
|
|
872
|
-
:class="value ? 'text-neutral-700' : 'text-neutral-400'"
|
|
873
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none"
|
|
872
|
+
:class="value ? 'text-neutral-700 dark:text-neutral-200' : 'text-neutral-400 dark:text-neutral-500'"
|
|
873
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none dark:border-neutral-700 dark:bg-neutral-900 dark:focus:border-neutral-600"
|
|
874
874
|
>
|
|
875
875
|
<option value="" disabled hidden>Select value</option>
|
|
876
876
|
<option value="__clear__">Clear selection</option>
|
|
@@ -891,8 +891,8 @@ const layoutClass = isObjectLikeField
|
|
|
891
891
|
:value="getArrayBooleanValue(index)"
|
|
892
892
|
@change={`setArrayBooleanValue(index, $event.target.value)`}
|
|
893
893
|
:required={`index === 0 && ${isRequiredField ? "true" : "false"}`}
|
|
894
|
-
:class="getArrayBooleanValue(index) ? 'text-neutral-700' : 'text-neutral-400'"
|
|
895
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none"
|
|
894
|
+
:class="getArrayBooleanValue(index) ? 'text-neutral-700 dark:text-neutral-200' : 'text-neutral-400 dark:text-neutral-500'"
|
|
895
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none dark:border-neutral-700 dark:bg-neutral-900 dark:focus:border-neutral-600"
|
|
896
896
|
>
|
|
897
897
|
<option value="" disabled hidden>Select value</option>
|
|
898
898
|
<option value="__clear__">Clear selection</option>
|
|
@@ -918,7 +918,7 @@ const layoutClass = isObjectLikeField
|
|
|
918
918
|
step={numericInputStep}
|
|
919
919
|
minlength={textInputMinLength}
|
|
920
920
|
maxlength={textInputMaxLength}
|
|
921
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200"
|
|
921
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:border-neutral-600"
|
|
922
922
|
/>
|
|
923
923
|
)
|
|
924
924
|
)
|
|
@@ -926,7 +926,7 @@ const layoutClass = isObjectLikeField
|
|
|
926
926
|
<button
|
|
927
927
|
type="button"
|
|
928
928
|
@click="removeArrayValue(index)"
|
|
929
|
-
class="h-[31px] px-2 rounded-md border border-neutral-200 text-neutral-500 hover:text-neutral-700 hover:border-neutral-300 hover:bg-neutral-50 transition-colors duration-200 cursor-pointer"
|
|
929
|
+
class="h-[31px] px-2 rounded-md border border-neutral-200 text-neutral-500 hover:text-neutral-700 hover:border-neutral-300 hover:bg-neutral-50 transition-colors duration-200 cursor-pointer dark:border-neutral-700 dark:text-neutral-400 dark:hover:border-neutral-600 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-200"
|
|
930
930
|
aria-label={`Remove ${field.name} value`}
|
|
931
931
|
>
|
|
932
932
|
<Icon class="size-4" name="lucide:x" />
|
|
@@ -936,7 +936,7 @@ const layoutClass = isObjectLikeField
|
|
|
936
936
|
<button
|
|
937
937
|
type="button"
|
|
938
938
|
@click="addArrayValue()"
|
|
939
|
-
class="inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-900 cursor-pointer transition-colors duration-200"
|
|
939
|
+
class="inline-flex items-center gap-1 text-xs font-medium text-neutral-700 hover:text-neutral-900 cursor-pointer transition-colors duration-200 dark:text-neutral-300 dark:hover:text-neutral-100"
|
|
940
940
|
>
|
|
941
941
|
<Icon class="size-3.5" name="lucide:plus" />
|
|
942
942
|
Add value
|
|
@@ -944,10 +944,10 @@ const layoutClass = isObjectLikeField
|
|
|
944
944
|
</div>
|
|
945
945
|
)
|
|
946
946
|
) : hasNestedFields || hasFieldVariants ? (
|
|
947
|
-
<div class="rounded-lg border border-neutral-200 bg-neutral-50/50 p-2.5">
|
|
947
|
+
<div class="rounded-lg border border-neutral-200 bg-neutral-50/50 p-2.5 dark:border-neutral-800 dark:bg-neutral-900/50">
|
|
948
948
|
<div class="space-y-3">
|
|
949
949
|
{field.nested?.map((nestedField) => (
|
|
950
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
950
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
951
951
|
<Astro.self
|
|
952
952
|
field={nestedField}
|
|
953
953
|
requestPart={requestPart}
|
|
@@ -960,19 +960,19 @@ const layoutClass = isObjectLikeField
|
|
|
960
960
|
<div class:list={["space-y-2", hasNestedFields && "pt-1"]}>
|
|
961
961
|
{hasOneOfVariants ? (
|
|
962
962
|
<>
|
|
963
|
-
<p class="text-xs text-neutral-500">
|
|
963
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
964
964
|
Select one variant.
|
|
965
965
|
</p>
|
|
966
|
-
<div class="inline-flex max-w-full flex-wrap items-center gap-1 rounded-lg bg-neutral-100 p-1">
|
|
966
|
+
<div class="inline-flex max-w-full flex-wrap items-center gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-900/60">
|
|
967
967
|
{field.variants.map((variant, variantIndex) => (
|
|
968
968
|
<button
|
|
969
969
|
type="button"
|
|
970
970
|
@click={`selectOneOfVariant(${variantIndex})`}
|
|
971
971
|
:class={`{
|
|
972
|
-
'bg-white text-neutral-900 shadow-xs ring-1 ring-neutral-200': getSelectedOneOfVariant() === ${variantIndex},
|
|
973
|
-
'text-neutral-600 hover:bg-neutral-50 hover:text-neutral-800': getSelectedOneOfVariant() !== ${variantIndex}
|
|
972
|
+
'bg-white text-neutral-900 shadow-xs ring-1 ring-neutral-200 dark:bg-(--rd-code-surface) dark:text-neutral-100 dark:ring-neutral-700/70': getSelectedOneOfVariant() === ${variantIndex},
|
|
973
|
+
'text-neutral-600 hover:bg-neutral-50 hover:text-neutral-800 dark:text-neutral-400 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-200': getSelectedOneOfVariant() !== ${variantIndex}
|
|
974
974
|
}`}
|
|
975
|
-
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md px-2.5 text-[11px] font-medium transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-300"
|
|
975
|
+
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md px-2.5 text-[11px] font-medium transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-300 dark:focus-visible:ring-neutral-700"
|
|
976
976
|
>
|
|
977
977
|
{variant.label}
|
|
978
978
|
</button>
|
|
@@ -983,13 +983,13 @@ const layoutClass = isObjectLikeField
|
|
|
983
983
|
x-show={`getSelectedOneOfVariant() === ${variantIndex}`}
|
|
984
984
|
x-cloak
|
|
985
985
|
>
|
|
986
|
-
<div class="rounded-md border border-neutral-200 bg-white p-2.5">
|
|
987
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
986
|
+
<div class="rounded-md border border-neutral-200 bg-white p-2.5 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
987
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
988
988
|
{variant.label}
|
|
989
989
|
</div>
|
|
990
990
|
<div class="space-y-3">
|
|
991
991
|
{variant.fields.map((variantField) => (
|
|
992
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
992
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
993
993
|
<Astro.self
|
|
994
994
|
field={variantField}
|
|
995
995
|
requestPart={requestPart}
|
|
@@ -1005,17 +1005,17 @@ const layoutClass = isObjectLikeField
|
|
|
1005
1005
|
</>
|
|
1006
1006
|
) : (
|
|
1007
1007
|
<>
|
|
1008
|
-
<p class="text-xs text-neutral-500">
|
|
1008
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
1009
1009
|
One or more variants may apply.
|
|
1010
1010
|
</p>
|
|
1011
1011
|
{field.variants.map((variant) => (
|
|
1012
|
-
<div class="rounded-md border border-neutral-200 bg-white p-2.5">
|
|
1013
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
1012
|
+
<div class="rounded-md border border-neutral-200 bg-white p-2.5 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
1013
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
1014
1014
|
{variant.label}
|
|
1015
1015
|
</div>
|
|
1016
1016
|
<div class="space-y-3">
|
|
1017
1017
|
{variant.fields.map((variantField) => (
|
|
1018
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
1018
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
1019
1019
|
<Astro.self
|
|
1020
1020
|
field={variantField}
|
|
1021
1021
|
requestPart={requestPart}
|
|
@@ -1042,8 +1042,8 @@ const layoutClass = isObjectLikeField
|
|
|
1042
1042
|
:value="getFieldValue()"
|
|
1043
1043
|
@change="setFieldValue($event.target.value, $event.target)"
|
|
1044
1044
|
required={isRequiredField}
|
|
1045
|
-
:class="getFieldValue() ? 'text-neutral-700' : 'text-neutral-400'"
|
|
1046
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none"
|
|
1045
|
+
:class="getFieldValue() ? 'text-neutral-700 dark:text-neutral-200' : 'text-neutral-400 dark:text-neutral-500'"
|
|
1046
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none dark:border-neutral-700 dark:bg-neutral-900 dark:focus:border-neutral-600"
|
|
1047
1047
|
>
|
|
1048
1048
|
<option value="" disabled hidden>Select value</option>
|
|
1049
1049
|
<option value="__clear__">Clear selection</option>
|
|
@@ -1063,8 +1063,8 @@ const layoutClass = isObjectLikeField
|
|
|
1063
1063
|
:value="getBooleanFieldValue()"
|
|
1064
1064
|
@change="setBooleanFieldValue($event.target.value)"
|
|
1065
1065
|
required={isRequiredField}
|
|
1066
|
-
:class="getBooleanFieldValue() ? 'text-neutral-700' : 'text-neutral-400'"
|
|
1067
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none"
|
|
1066
|
+
:class="getBooleanFieldValue() ? 'text-neutral-700 dark:text-neutral-200' : 'text-neutral-400 dark:text-neutral-500'"
|
|
1067
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow transition-all duration-200 bg-white appearance-none dark:border-neutral-700 dark:bg-neutral-900 dark:focus:border-neutral-600"
|
|
1068
1068
|
>
|
|
1069
1069
|
<option value="" disabled hidden>Select value</option>
|
|
1070
1070
|
<option value="__clear__">Clear selection</option>
|
|
@@ -1090,7 +1090,7 @@ const layoutClass = isObjectLikeField
|
|
|
1090
1090
|
step={numericInputStep}
|
|
1091
1091
|
minlength={textInputMinLength}
|
|
1092
1092
|
maxlength={textInputMaxLength}
|
|
1093
|
-
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200"
|
|
1093
|
+
class="w-full px-3 py-1.5 text-sm border border-neutral-200 focus:border-neutral-300 outline-none rounded-md shadow-xs focus:shadow placeholder:text-neutral-400 transition-all duration-200 bg-white dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:placeholder:text-neutral-500 dark:focus:border-neutral-600"
|
|
1094
1094
|
/>
|
|
1095
1095
|
)}
|
|
1096
1096
|
</>
|
|
@@ -37,11 +37,7 @@ const configuredProxyUrl =
|
|
|
37
37
|
typeof import.meta.env.PUBLIC_PROXY_URL === "string"
|
|
38
38
|
? import.meta.env.PUBLIC_PROXY_URL.trim()
|
|
39
39
|
: "";
|
|
40
|
-
const proxyUrl =
|
|
41
|
-
configuredProxyUrl ||
|
|
42
|
-
(import.meta.env.DEV
|
|
43
|
-
? "https://docs-proxy-dev.stefanjoseph-dev.workers.dev"
|
|
44
|
-
: "");
|
|
40
|
+
const proxyUrl = configuredProxyUrl || "/_platform/proxy";
|
|
45
41
|
const proxyEnabled = config.playground?.proxy !== false && proxyUrl.length > 0;
|
|
46
42
|
const formattedBodyDescription = bodyDescription
|
|
47
43
|
? await renderMarkdown(bodyDescription)
|
|
@@ -544,20 +540,22 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
544
540
|
<button
|
|
545
541
|
@click="sendRequest($event)"
|
|
546
542
|
:disabled="loading"
|
|
547
|
-
class="
|
|
543
|
+
class="font-[350] dark:font-[450] relative flex h-8 items-center gap-2 rounded-lg [corner-shape:superellipse(1.2)] bg-linear-to-b from-neutral-900/85 to-neutral-900 dark:from-neutral-100 dark:to-neutral-200 px-3 text-[13px] text-white dark:text-neutral-950 shadow-sm transition-all duration-200 whitespace-nowrap cursor-pointer disabled:opacity-70 disabled:cursor-not-allowed"
|
|
548
544
|
>
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
545
|
+
<span class="flex items-center gap-2">
|
|
546
|
+
<Icon
|
|
547
|
+
x-show="!loading"
|
|
548
|
+
class="size-3.5 -ml-px"
|
|
549
|
+
name="lucide:square-arrow-up-right"
|
|
550
|
+
/>
|
|
551
|
+
<Icon
|
|
552
|
+
x-show="loading"
|
|
553
|
+
x-cloak
|
|
554
|
+
class="size-3.5 animate-spin -ml-px"
|
|
555
|
+
name="lucide:loader"
|
|
556
|
+
/>
|
|
553
557
|
Send <span class="hidden xs:inline">Request</span>
|
|
554
|
-
<Icon class="size-4" name="lucide:square-arrow-up-right" />
|
|
555
558
|
</span>
|
|
556
|
-
<Icon
|
|
557
|
-
x-show="loading"
|
|
558
|
-
class="size-4 absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2 animate-spin **:stroke-3"
|
|
559
|
-
name="lucide:loader"
|
|
560
|
-
/>
|
|
561
559
|
</button>
|
|
562
560
|
</PlaygroundBar>
|
|
563
561
|
|
|
@@ -567,8 +565,8 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
567
565
|
<ResponseDisplay />
|
|
568
566
|
</div>
|
|
569
567
|
<div class="lg:flex-1 relative">
|
|
570
|
-
<div class="flex-3 min-h-0 max-h-[calc(60dvh-2rem-23px-12px)] lg:max-h-[calc(100dvh-4rem-46px-24px)] overflow-y-auto overscroll-contain [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">
|
|
571
|
-
<div class="pointer-events-none sticky top-0 z-10 -mb-4 h-4 bg-linear-to-b from-background via-white/60 to-transparent"></div>
|
|
568
|
+
<div class="flex-3 min-h-0 max-h-[calc(60dvh-2rem-23px-12px)] lg:max-h-[calc(100dvh-4rem-46px-24px)] overflow-y-auto overscroll-contain [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">
|
|
569
|
+
<div class="pointer-events-none sticky top-0 z-10 -mb-4 h-4 bg-linear-to-b from-background via-white/60 to-transparent dark:via-neutral-900/70"></div>
|
|
572
570
|
<div class="space-y-4 lg:pr-4 pt-4 pb-6">
|
|
573
571
|
{
|
|
574
572
|
Object.keys(requestFields).map(
|
|
@@ -584,16 +582,16 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
584
582
|
}
|
|
585
583
|
|
|
586
584
|
return (
|
|
587
|
-
<div class="border border-neutral-200 shadow-xs rounded-xl p-4">
|
|
585
|
+
<div class="border border-neutral-200 bg-white shadow-xs rounded-xl p-4 pb-0 dark:border-neutral-800 dark:bg-(--rd-code-surface) [&_[role='region']]:border-b-0">
|
|
588
586
|
<Accordion title={headers[key]} defaultOpen titleSize="xl">
|
|
589
587
|
{key === "body" && formattedBodyDescription && (
|
|
590
588
|
<div
|
|
591
|
-
class="mb-4 prose-rules prose-sm! text-neutral-500 **:text-neutral-500"
|
|
589
|
+
class="mb-4 prose-rules prose-sm! text-neutral-500 **:text-neutral-500 dark:text-neutral-400 dark:**:text-neutral-400"
|
|
592
590
|
set:html={formattedBodyDescription}
|
|
593
591
|
/>
|
|
594
592
|
)}
|
|
595
593
|
{sectionFields.map((field) => (
|
|
596
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-4 mb-4 last:pb-0 last:mb-0 first:pt-2">
|
|
594
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-4 mb-4 last:pb-0 last:mb-0 first:pt-2">
|
|
597
595
|
<PlaygroundField field={field} requestPart={key} />
|
|
598
596
|
</div>
|
|
599
597
|
))}
|
|
@@ -601,19 +599,19 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
601
599
|
<div class:list={["space-y-2", sectionFields.length > 0 && "pt-1"]}>
|
|
602
600
|
{sectionVariantData?.variantType === "oneOf" ? (
|
|
603
601
|
<>
|
|
604
|
-
<p class="text-xs text-neutral-500">
|
|
602
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
605
603
|
Select one variant.
|
|
606
604
|
</p>
|
|
607
|
-
<div class="inline-flex max-w-full flex-wrap items-center gap-1 rounded-lg bg-neutral-100 p-1">
|
|
605
|
+
<div class="inline-flex max-w-full flex-wrap items-center gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-900/60">
|
|
608
606
|
{sectionVariants.map((variant, variantIndex) => (
|
|
609
607
|
<button
|
|
610
608
|
type="button"
|
|
611
609
|
@click={`selectSectionVariant(${keyLiteral}, ${variantIndex})`}
|
|
612
610
|
:class={`{
|
|
613
|
-
'bg-white text-neutral-900 shadow-xs ring-1 ring-neutral-200': getSelectedSectionVariant(${keyLiteral}) === ${variantIndex},
|
|
614
|
-
'text-neutral-600 hover:bg-neutral-50 hover:text-neutral-800': getSelectedSectionVariant(${keyLiteral}) !== ${variantIndex}
|
|
611
|
+
'bg-white text-neutral-900 shadow-xs ring-1 ring-neutral-200 dark:bg-(--rd-code-surface) dark:text-neutral-100 dark:ring-neutral-700/70': getSelectedSectionVariant(${keyLiteral}) === ${variantIndex},
|
|
612
|
+
'text-neutral-600 hover:bg-neutral-50 hover:text-neutral-800 dark:text-neutral-400 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-200': getSelectedSectionVariant(${keyLiteral}) !== ${variantIndex}
|
|
615
613
|
}`}
|
|
616
|
-
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md px-2.5 text-[11px] font-medium transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-300"
|
|
614
|
+
class="inline-flex h-7 items-center justify-center whitespace-nowrap rounded-md px-2.5 text-[11px] font-medium transition-all duration-200 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-300 dark:focus-visible:ring-neutral-700"
|
|
617
615
|
>
|
|
618
616
|
{variant.label}
|
|
619
617
|
</button>
|
|
@@ -624,13 +622,13 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
624
622
|
x-show={`getSelectedSectionVariant(${keyLiteral}) === ${variantIndex}`}
|
|
625
623
|
x-cloak
|
|
626
624
|
>
|
|
627
|
-
<div class="rounded-md border border-neutral-200 bg-white p-2.5">
|
|
628
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
625
|
+
<div class="rounded-md border border-neutral-200 bg-white p-2.5 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
626
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
629
627
|
{variant.label}
|
|
630
628
|
</div>
|
|
631
629
|
<div class="space-y-3">
|
|
632
630
|
{variant.fields.map((field) => (
|
|
633
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
631
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
634
632
|
<PlaygroundField
|
|
635
633
|
field={field}
|
|
636
634
|
requestPart={key}
|
|
@@ -645,17 +643,17 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
645
643
|
</>
|
|
646
644
|
) : (
|
|
647
645
|
<>
|
|
648
|
-
<p class="text-xs text-neutral-500">
|
|
646
|
+
<p class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
649
647
|
One or more variants may apply.
|
|
650
648
|
</p>
|
|
651
649
|
{sectionVariants.map((variant) => (
|
|
652
|
-
<div class="rounded-md border border-neutral-200 bg-white p-2.5">
|
|
653
|
-
<div class="mb-2 text-xs font-medium text-neutral-600">
|
|
650
|
+
<div class="rounded-md border border-neutral-200 bg-white p-2.5 dark:border-neutral-800 dark:bg-neutral-900/60">
|
|
651
|
+
<div class="mb-2 text-xs font-medium text-neutral-600 dark:text-neutral-400">
|
|
654
652
|
{variant.label}
|
|
655
653
|
</div>
|
|
656
654
|
<div class="space-y-3">
|
|
657
655
|
{variant.fields.map((field) => (
|
|
658
|
-
<div class="border-b border-b-neutral-100 last:border-none pb-3 last:pb-0">
|
|
656
|
+
<div class="border-b border-b-neutral-100 dark:border-b-neutral-800 last:border-none pb-3 last:pb-0">
|
|
659
657
|
<PlaygroundField field={field} requestPart={key} />
|
|
660
658
|
</div>
|
|
661
659
|
))}
|
|
@@ -691,17 +689,33 @@ const sectionVariantFieldNames = Object.fromEntries(
|
|
|
691
689
|
@reference "../../styles/global.css";
|
|
692
690
|
|
|
693
691
|
:global(pre code span.token.punctuation) {
|
|
694
|
-
|
|
692
|
+
color: #24292e;
|
|
695
693
|
}
|
|
696
694
|
|
|
697
695
|
:global(pre code span.token.operator) {
|
|
698
|
-
|
|
696
|
+
color: #24292e;
|
|
699
697
|
}
|
|
700
698
|
|
|
701
699
|
:global(pre code span.token.property) {
|
|
702
|
-
|
|
700
|
+
color: #c62c2c;
|
|
703
701
|
}
|
|
704
702
|
:global(pre code span.token.string) {
|
|
705
|
-
|
|
703
|
+
color: #1e7734;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
:global(.dark pre code span.token.punctuation) {
|
|
707
|
+
color: #c9d1d9;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
:global(.dark pre code span.token.operator) {
|
|
711
|
+
color: #c9d1d9;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
:global(.dark pre code span.token.property) {
|
|
715
|
+
color: #ff7b72;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
:global(.dark pre code span.token.string) {
|
|
719
|
+
color: #a5d6ff;
|
|
706
720
|
}
|
|
707
721
|
</style>
|