Inline view examples

This commit is contained in:
Exidex 2025-01-28 21:44:05 +01:00
parent 90957f214a
commit d721bda736
No known key found for this signature in database
GPG key ID: AC63AA86DD4F2D45
50 changed files with 459 additions and 25 deletions

View file

@ -0,0 +1,2 @@
dist
node_modules

View file

@ -0,0 +1,16 @@
[gauntlet]
name = 'Docs Inline'
description = ''
# docs-code-segment:start main
[[entrypoint]]
id = 'main'
name = 'Main'
path = 'src/main.tsx'
type = 'inline-view'
description = ''
# docs-code-segment:end
[permissions]
main_search_bar = ["read"]

View file

@ -0,0 +1,17 @@
{
"name": "@project-gauntlet/docs-inline-code-block",
"private": true,
"scripts": {
"build": "gauntlet build",
"dev": "gauntlet dev"
},
"dependencies": {
"@project-gauntlet/api": "file:../../js/api"
},
"devDependencies": {
"@types/react": "*",
"@types/deno": "*",
"@project-gauntlet/tools": "*",
"typescript": "*"
}
}

View file

@ -0,0 +1,19 @@
import { ReactElement } from "react";
import { Inline } from "@project-gauntlet/api/components";
export default function Main({ text }: { text: string }): ReactElement | null {
if (text != "example") {
return null
}
return (
<Inline>
<Inline.Center>
<Inline.Center.CodeBlock>
{"() => void"}
</Inline.Center.CodeBlock>
</Inline.Center>
</Inline>
)
}

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"strict": true,
"module": "ES2022",
"esModuleInterop": true,
"target": "ES2022",
"moduleResolution": "bundler",
"jsx": "react-jsx"
},
"lib": ["ES2020"]
}