@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
10 lines (9 loc) • 911 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { clsx } from 'clsx';
import { forwardRef } from 'react';
import { Icon } from '../Icon';
export const TabNavigationLink = forwardRef(({ children, className, icon, linkComponent, ...restProps }, ref) => {
const Link = linkComponent || 'a';
return (_jsx("li", { className: "ams-tab-navigation__item", children: _jsxs(Link, { ...restProps, className: clsx('ams-tab-navigation__link', className), ...(!linkComponent && { ref }), children: [icon && _jsx(Icon, { svg: icon }), _jsxs("span", { className: "ams-tab-navigation__link-label-wrapper", children: [_jsx("span", { "aria-hidden": "true", className: "ams-tab-navigation__link-label-hidden", hidden: true, children: children }), _jsx("span", { className: "ams-tab-navigation__link-label", children: children })] })] }) }));
});
TabNavigationLink.displayName = 'TabNavigation.Link';