UNPKG

@amsterdam/design-system-react

Version:

All React components from the Amsterdam Design System. Use it to compose pages in your website or application.

17 lines (16 loc) 666 B
import { jsx as _jsx } from "react/jsx-runtime"; /** * @license EUPL-1.2+ * Copyright Gemeente Amsterdam */ import clsx from 'clsx'; import { forwardRef, useContext } from 'react'; import { TabsContext } from './TabsContext'; export const TabsPanel = forwardRef(({ children, className, id, ...restProps }, ref) => { const { activeTabId } = useContext(TabsContext); if (id !== activeTabId) { return null; } return (_jsx("div", { ...restProps, "aria-labelledby": `button-${id}`, className: clsx('ams-tabs__panel', className), id: id, ref: ref, role: "tabpanel", tabIndex: 0, children: children })); }); TabsPanel.displayName = 'Tabs.Panel';