Add ARCHITECTURE.md (layers, flows, folder map, glossary), CONTRIBUTING.md (setup and step-by-step recipes) and a README in each main folder, with an index of docs/. Convert the 511 JavaScript headers from "// Rôle :" lines to JSDoc @file blocks, define a three-level header template in website/AGENTS.md and check the header in tests/file-headers.test.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
901 B
JavaScript
28 lines
901 B
JavaScript
/**
|
|
* @file Fournit un contrôle d'onglets réutilisable avec rôles ARIA.
|
|
*/
|
|
|
|
export function Tabs({ tabs, activeTab, onChange, className = "", iconOnly = false, size = "sm" }) {
|
|
return (
|
|
<div className={`tabs nds-radio-button-group ${className}`.trim()} data-size={size} role="tablist">
|
|
{tabs.map((tab) => {
|
|
const active = tab.id === activeTab;
|
|
return (
|
|
<button
|
|
key={tab.id}
|
|
className={active ? "active" : ""}
|
|
type="button"
|
|
role="tab"
|
|
aria-selected={active}
|
|
aria-label={tab.label}
|
|
title={tab.label}
|
|
onClick={() => onChange(tab.id)}
|
|
>
|
|
{tab.icon && <span className={`module-icon-svg module-icon-${tab.icon}`} aria-hidden="true" />}
|
|
{!iconOnly && <span>{tab.label}</span>}
|
|
</button>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|