Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/scripts/reportBrokenLinks.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ async function main() {
ignoredPaths: [],
// CSS selectors for content to ignore during link checking
ignoredContent: [],
htmlValidate: {
extends: ['mui:recommended'],
rules: {
// Portaled elements (Menu, Select, Autocomplete listbox) and Base UI
// components render aria-controls/aria-labelledby targets only after
// client hydration, so they're missing from the static HTML.
'no-missing-references': 'off',
},
},
});

process.exit(issues.length);
Expand Down
10 changes: 7 additions & 3 deletions docs/src/components/CodeBlock/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { CheckIcon } from '../../icons/CheckIcon';
import { GhostButton } from '../GhostButton';
import './CodeBlock.css';

const CodeBlockContext = React.createContext({ codeId: '', titleId: '' });
const CodeBlockContext = React.createContext<{
codeId: string | undefined;
titleId: string | undefined;
}>({ codeId: undefined, titleId: undefined });

export function Root(props: React.ComponentPropsWithoutRef<'div'>) {
const titleId = React.useId();
Expand Down Expand Up @@ -56,12 +59,13 @@ export function Panel({ className, title, children, ...other }: CodeBlockPanelPr
<GhostButton
aria-label="Copy code"
onClick={async () => {
const codeRoot = document.getElementById(codeId);
const codeRoot = codeId ? document.getElementById(codeId) : null;
const code = codeRoot?.querySelector('pre code')?.textContent ?? codeRoot?.textContent;

if (code) {
await copy(code);
const titleText = document.getElementById(titleId)?.textContent ?? undefined;
const titleText =
(titleId ? document.getElementById(titleId)?.textContent : undefined) ?? undefined;
const codeBlockId = titleText ? `${pathname}#${titleText}` : pathname;
ga?.trackEvent({
category: 'code_block',
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/ReferenceTable/AdditionalTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function AdditionalTypes({
additionalType.slug && show?.includes(additionalType.slug) ? 'true' : undefined
}
>
<h4 className="ReferenceSectionHeading AdditionalTypeHeading">
<h3 className="ReferenceSectionHeading AdditionalTypeHeading">
{additionalType.name}
<a
href="#"
Expand All @@ -53,7 +53,7 @@ export function AdditionalTypes({
>
{hydrated && canGoBack ? 'Back' : 'Hide'}
</a>
</h4>
</h3>
{additionalType.data.reExportOf ? (
<p className="AdditionalTypeReExport">
Re-Export of{' '}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/ReferenceTable/ReferenceTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AdditionalTypes } from './AdditionalTypes';
import * as CodeBlock from '../CodeBlock';

function SectionHeading({ children }: { children: React.ReactNode }) {
return <h4 className="ReferenceSectionHeading">{children}</h4>;
return <h3 className="ReferenceSectionHeading">{children}</h3>;
}

type UseTypesResult = ReturnType<typeof useTypes>;
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/Search/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export function SearchBar({
<React.Fragment>
<Button onClick={handleOpenDialog} aria-label="Search" className={`SearchTrigger`}>
<Search className="SearchTriggerIcon" />
<div className="SearchTriggerKbd">
<span className="SearchTriggerKbd">
{showCmdSymbol ? (
<kbd className="SearchTriggerCmd">⌘</kbd>
) : (
Expand All @@ -382,7 +382,7 @@ export function SearchBar({
</React.Fragment>
)}
<kbd className="SearchTriggerK">K</kbd>
</div>
</span>
</Button>
<Dialog.Root open={dialogOpen} onOpenChange={handleCloseDialog}>
<Dialog.Portal>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ColumnHeader({
}: Omit<React.ComponentProps<'th'>, 'scope'>) {
return (
<th scope="col" className={clsx('TableColumnHeader', className)} {...other}>
<span className="TableCellInner">{children}</span>
<div className="TableCellInner">{children}</div>
</th>
);
}
Expand All @@ -47,15 +47,15 @@ export function RowHeader({
className={clsx('TableCell', className)}
{...other}
>
<span className="TableCellInner">{children}</span>
<div className="TableCellInner">{children}</div>
</th>
);
}

export function Cell({ children, className, ...other }: React.ComponentProps<'td'>) {
return (
<td ref={observeScrollableInner} className={clsx('TableCell', className)} {...other}>
<span className="TableCellInner">{children}</span>
<div className="TableCellInner">{children}</div>
</td>
);
}
Loading