sokko-g/website/src/components/Tabs.jsx
Shinuwa 22b397ebfa Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks
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>
2026-12-01 09:42:13 +01:00

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>
);
}