Skip to content

Commit 07a5ea7

Browse files
authored
Merge pull request #716 from hirosystems/feat/api-playground
Add API Playground
2 parents 4b075d4 + 4eb95ab commit 07a5ea7

File tree

133 files changed

+8454
-4153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+8454
-4153
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ node_modules
44
bun.lockb
55
openapi
66
.DS_Store
7-
**/.DS_Store
7+
**/.DS_Store
8+
tmp

app/(docs)/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const layoutOptions: Omit<DocsLayoutProps, "children"> = {
1010
tree: utils.pageTree,
1111
nav: {
1212
transparentMode: "top",
13-
title: <DocsLogo className="size-28" />,
13+
title: <DocsLogo className="size-28 hidden sm:block" />,
1414
children: <NavChildren />,
1515
links: [
1616
{

app/global.css

+39-7
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ h1, h2, h3, h4, h5, h6, code, button, .step {
131131
font-family: var(--font-aeonikFono), sans-serif;
132132
}
133133

134-
a, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
134+
a, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, option {
135135
font-family: var(--font-aeonikFono), sans-serif;
136136
}
137137

@@ -290,10 +290,41 @@ div.not-prose, div.prose-no-margin, div[role="tablist"] {
290290
background: hsl(var(--background));
291291
}
292292

293+
/* Target the form tag with specific classes */
294+
form.not-prose.flex.flex-col.gap-4.rounded-lg.border.bg-card.p-4 {
295+
background-color: hsl(var(--background));
296+
}
297+
298+
/* Target the specific div with the given classes */
299+
.divide-y.divide-border.overflow-hidden.rounded-lg.bg-card.-m-4.mt-2.border-0.text-sm {
300+
background-color: hsl(var(--background));
301+
}
302+
303+
/* overrides the background of APIInfo and adjusts sticky header on scroll */
304+
div.prose-no-margin .sticky.top-24.z-\[2\].flex.flex-row.items-center.gap-2.rounded-lg.border.bg-card.p-3.md\:top-10 {
305+
background: hsl(var(--background));
306+
top: 4.5rem;
307+
}
308+
309+
/* For long endpoint names this will truncate the ending and add an ellipsis */
310+
div.prose-no-margin .sticky.top-24.z-\[2\].flex.flex-row.items-center.gap-2.rounded-lg.border.bg-card.p-3.md\:top-10 span:nth-child(n+12) {
311+
display: none;
312+
}
313+
314+
/* And add an ellipsis */
315+
div.prose-no-margin .sticky.top-24.z-\[2\].flex.flex-row.items-center.gap-2.rounded-lg.border.bg-card.p-3.md\:top-10 span:nth-child(11)::after {
316+
content: '...';
317+
display: inline;
318+
}
319+
293320
div.prose div.footer.not-prose {
294321
background: hsl(var(--accent));
295322
}
296323

324+
#radix-\:r3\: > div > div > div:nth-child(2) > select option {
325+
font-family: var(--font-aeonikFono), sans-serif !important;
326+
}
327+
297328
.steps > div:nth-child(2) > figure:nth-child(3) > div.flex.flex-row.items-center.gap-2.border-b.bg-muted.px-4.py-1\.5 {
298329
background: hsl(var(--background)) !important;
299330
}
@@ -333,14 +364,15 @@ div.api-example div.max-xl\:hidden > div:nth-child(1) {
333364

334365
/* Add a deprecated strike through to sidebar links */
335366
a[href="/stacks/api/accounts/nft-events"],
336-
a[href="/stacks/api/blocks/recent-blocks"],
337-
a[href="/stacks/api/blocks/block-by-hash"],
338-
a[href="/stacks/api/blocks/block-by-height"],
339-
a[href="/stacks/api/blocks/block-by-burn-block-hash"],
340-
a[href="/stacks/api/blocks/block-by-burn-block-height"],
367+
a[href="/stacks/api/accounts/transaction-with-transfers"],
341368
a[href="/stacks/api/accounts/transactions"],
342369
a[href="/stacks/api/accounts/transactions-with-transfers"],
343-
a[href="/stacks/api/accounts/transaction-with-transfers"] {
370+
a[href="/stacks/api/blocks/block-by-burn-block-hash"],
371+
a[href="/stacks/api/blocks/block-by-burn-block-height"],
372+
a[href="/stacks/api/blocks/block-by-hash"],
373+
a[href="/stacks/api/blocks/block-by-height"],
374+
a[href="/stacks/api/blocks/recent-blocks"],
375+
a[href="/stacks/api/fees/fee-rate"] {
344376
text-decoration: line-through;
345377
color: hsl(var(--muted-foreground) / var(--tw-text-opacity));
346378
}

components/card.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ export function SmallCard({
108108
<Link
109109
{...props}
110110
className={cn(
111-
"not-prose block text-sm text-card-foreground transition-colors",
111+
"not-prose block text-sm text-card-foreground transition-colors space-y-3",
112112
props.className
113113
)}
114114
>
115115
<div className="group flex space-x-4 px-3 py-4 rounded-lg hover:bg-accent">
116116
{icon && (
117-
<div className="h-fit w-fit rounded-md border bg-card group-hover:bg-background p-2 text-muted-foreground [&_svg]:size-4">
117+
<div className="h-fit w-fit rounded-md border bg-card group-hover:bg-background group-hover:text-primary transition-colors duration-500 ease-in-out p-2 text-muted-foreground [&_svg]:size-4">
118118
{icon}
119119
</div>
120120
)}

components/ui/icon.tsx

+2-21
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,8 @@ export function Ordinals(): JSX.Element {
7878
fill="none"
7979
xmlns="http://www.w3.org/2000/svg"
8080
>
81-
<circle
82-
cx="7.58228"
83-
cy="7.05255"
84-
r="6.36257"
85-
stroke="currentColor"
86-
style={{
87-
stroke: "currentColor",
88-
strokeOpacity: 1,
89-
strokeWidth: "1.2651",
90-
}}
91-
/>
92-
<circle
93-
cx="7.53107"
94-
cy="7.04505"
95-
r="3.76642"
96-
fill="currentColor"
97-
style={{
98-
fill: "currentColor",
99-
fillOpacity: 1,
100-
}}
101-
/>
81+
<circle cx="7.58228" cy="7.05255" r="6.36257" stroke="currentColor" />
82+
<circle cx="7.53107" cy="7.04505" r="3.76642" fill="currentColor" />
10283
</svg>
10384
);
10485
}

content/docs/bitcoin/get-started.mdx

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ import { API, Container, Chainhook, BitcoinIcon } from '@/components/ui/icon';
4848

4949
<Cards>
5050
<SmallCard
51-
className="group"
52-
icon={<BitcoinIcon className='transition-colors duration-500 ease-in-out group-hover:text-primary' />}
51+
icon={<BitcoinIcon />}
5352
href="/guides/sync-a-bitcoin-node"
5453
title="Sync a Bitcoin node"
5554
description="Set up and run a Bitcoin node to use tools like Ordhook."

content/docs/bitcoin/index.mdx

+7-11
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,19 @@ import heroImage from '@/public/bitcoin-hero.svg';
5757

5858
<Cards>
5959
<SmallCard
60-
className='group space-y-3'
61-
icon={<Ordinals className='transition-colors duration-500 ease-in-out group-hover:text-primary' />}
62-
href="/bitcoin/ordinals/ordhook"
63-
title="Ordhook"
64-
description="Create custom event streams for real-time data and analytics with Ordhook."
60+
icon={<Ordinals />}
61+
href="/bitcoin/ordinals/api"
62+
title="Ordinals API"
63+
description="Fetch on-chain data for Ordinals and meta-protocols with our hosted API."
6564
/>
6665
<SmallCard
67-
className='group space-y-3'
68-
icon={<API className='transition-colors duration-500 ease-in-out group-hover:text-primary' />}
66+
icon={<API />}
6967
href="/bitcoin/ordinals/api"
7068
title="Ordinals API"
7169
description="Fetch on-chain data for Ordinals and meta-protocols with our hosted API."
7270
/>
7371
<SmallCard
74-
className='group space-y-3'
75-
icon={<Play className='transition-colors duration-500 ease-in-out group-hover:text-primary' />}
72+
icon={<Play />}
7673
href="/ordinals/explorer"
7774
title="Explorer"
7875
description="View on-chain data for Ordinals and meta-protocols with our explorer."
@@ -91,8 +88,7 @@ import heroImage from '@/public/bitcoin-hero.svg';
9188

9289
<Cards>
9390
<SmallCard
94-
className='group space-y-3'
95-
icon={<API className='transition-colors duration-500 ease-in-out group-hover:text-primary' />}
91+
icon={<API />}
9692
href="/bitcoin/runes/api"
9793
title="Runes API"
9894
description="Interact with the Runes protocol from your backend via our hosted API."

0 commit comments

Comments
 (0)