feat(site): extract api reference from components (#464)

This commit is contained in:
Darius Cepulis
2026-02-05 19:57:54 -06:00
committed by GitHub
parent 48364f17fd
commit 0991a899b2
80 changed files with 3425 additions and 1562 deletions
@@ -0,0 +1,26 @@
import type { PropDef } from './types.js';
export function kebabToPascal(str: string): string {
return str
.split('-')
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join('');
}
export function sortProps(props: Record<string, PropDef>): Record<string, PropDef> {
const entries = Object.entries(props);
entries.sort((a, b) => {
// Required first
const aRequired = a[1].required ?? false;
const bRequired = b[1].required ?? false;
if (aRequired && !bRequired) return -1;
if (!aRequired && bRequired) return 1;
// Then alphabetical
return a[0].localeCompare(b[0]);
});
return Object.fromEntries(entries);
}