UNPKG

@amsterdam/design-system-react

Version:

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

15 lines (14 loc) 1.03 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { clsx } from 'clsx'; import { forwardRef } from 'react'; import { GridCell } from './GridCell'; import { paddingClasses } from './paddingClasses'; export const gridGaps = ['none', 'large', '2x-large']; export const gridPaddings = ['large', 'x-large', '2x-large']; export const gridTags = ['article', 'aside', 'div', 'footer', 'header', 'main', 'nav', 'section']; const GridRoot = forwardRef(({ as: Tag = 'div', children, className, gapVertical, paddingBottom, paddingTop, paddingVertical, ...restProps }, ref) => (_jsx(Tag, { ...restProps, className: clsx('ams-grid', gapVertical && `ams-grid--gap-vertical--${gapVertical}`, paddingClasses('grid', paddingBottom, paddingTop, paddingVertical), className), ref: ref, children: children }))); GridRoot.displayName = 'Grid'; /** * @see {@link https://designsystem.amsterdam/?path=/docs/components-layout-grid--docs Grid docs at Amsterdam Design System} */ export const Grid = Object.assign(GridRoot, { Cell: GridCell });