feat(site): generated multipart component api reference (#468)

This commit is contained in:
Darius Cepulis
2026-02-09 12:20:45 +11:00
committed by GitHub
parent 3c4152fb58
commit 4b1e863883
31 changed files with 1413 additions and 327 deletions
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { kebabToPascal, sortProps } from '../utils.js';
import { kebabToPascal, partKebabFromSource, sortProps } from '../utils.js';
describe('kebabToPascal', () => {
it("converts 'play-button' to 'PlayButton'", () => {
@@ -15,6 +15,24 @@ describe('kebabToPascal', () => {
});
});
describe('partKebabFromSource', () => {
it("derives 'value' from './time-value' with component 'time'", () => {
expect(partKebabFromSource('./time-value', 'time')).toBe('value');
});
it("derives 'group' from './time-group' with component 'time'", () => {
expect(partKebabFromSource('./time-group', 'time')).toBe('group');
});
it("derives 'separator' from './time-separator' with component 'time'", () => {
expect(partKebabFromSource('./time-separator', 'time')).toBe('separator');
});
it("handles multi-segment component names like 'play-button'", () => {
expect(partKebabFromSource('./play-button-icon', 'play-button')).toBe('icon');
});
});
describe('sortProps', () => {
it('sorts required props before optional props', () => {
const props = {