UNPKG

@amsterdam/design-system-react

Version:

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

14 lines (13 loc) 834 B
import { jsx as _jsx } from "react/jsx-runtime"; /** * @license EUPL-1.2+ * Copyright Gemeente Amsterdam */ import clsx from 'clsx'; import { forwardRef } from 'react'; import { GridCell } from './GridCell'; import { paddingClasses } from './paddingClasses'; 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'; export const Grid = Object.assign(GridRoot, { Cell: GridCell });