feat: integration page (PART 3/3)

This commit is contained in:
fsylvain committed 2026-10-05 02:03:24 +02:00
1 parent 514a082c96
commit acd392c29d
20 files changed
+3115 -409

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import type { HttpMethod } from '@/data/apiCatalogue'
const CHIP_BASE = 'h-5 gap-1 rounded-none px-1.5 py-0 text-xs whitespace-nowrap ring-0 border'
export const CHIP_CLASS = {
neutral: `${CHIP_BASE} border-accented bg-transparent font-normal text-toned`,
strong: `${CHIP_BASE} border-accented bg-elevated font-medium text-highlighted`,
success: `${CHIP_BASE} border-transparent bg-(--rc-success-soft) font-medium text-success`,
dashed: `${CHIP_BASE} border-dashed border-accented bg-transparent font-normal text-muted`,
}
const METHOD_BASE =
'h-5.5 w-14 shrink-0 justify-center rounded-none px-0 py-0 font-mono text-xs font-medium ring-0 border'
export const METHOD_CLASS: Record<HttpMethod, string> = {
GET: `${METHOD_BASE} border-inverted bg-inverted text-inverted`,
POST: `${METHOD_BASE} border-success bg-(--rc-success-soft) text-success`,
PATCH: `${METHOD_BASE} border-warning bg-(--rc-warning-soft) text-warning`,
DELETE: `${METHOD_BASE} border-error bg-(--rc-error-soft) text-error`,
}
export function splitInlineCode(text: string) {
return text.split('`').map((value, index) => ({ value, code: index % 2 === 1 }))
}
export function endpointAnchor(id: string) {
return `ep-${id}`
}