UNPKG

@amsterdam/design-system-react

Version:

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

16 lines (15 loc) 875 B
import { jsx as _jsx } from "react/jsx-runtime"; import { clsx } from 'clsx'; import { forwardRef } from 'react'; const wrapChildren = (size, children) => { if (size === 'large') return _jsx("b", { className: "ams-paragraph__b", children: children }); if (size === 'small') return _jsx("small", { className: "ams-paragraph__small", children: children }); return children; }; /** * @see {@link https://designsystem.amsterdam/?path=/docs/components-text-paragraph--docs Paragraph docs at Amsterdam Design System} */ export const Paragraph = forwardRef(({ children, className, color, size, ...restProps }, ref) => (_jsx("p", { className: clsx('ams-paragraph', color && `ams-paragraph--${color}`, size && `ams-paragraph--${size}`, className), ref: ref, ...restProps, children: wrapChildren(size, children) }))); Paragraph.displayName = 'Paragraph';