UNPKG

@ozen-ui/kit

Version:

React component library

28 lines (27 loc) 1.35 kB
import { __assign, __rest } from "tslib"; import './Grid.css'; import React from 'react'; import { classnames } from '@bem-react/classnames'; import { useThemeProps } from '../../hooks/useThemeProps'; import { cn } from '../../utils/classname'; import { polymorphicComponentWithRef, } from '../../utils/polymorphicComponentWithRef'; import { useGenerateGridModsCn } from './useGrid'; export var gridItemColVariant = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ]; export var gridItemRowVariant = [1, 2, 3, 4, 5, 6]; export var cnGridItem = cn('GridItem'); export var GridItem = polymorphicComponentWithRef(function (inProps, ref) { var props = useThemeProps({ props: inProps, name: 'GridItem', }); var children = props.children, className = props.className, col = props.col, colStart = props.colStart, row = props.row, rowStart = props.rowStart, _a = props.as, Tag = _a === void 0 ? 'div' : _a, other = __rest(props, ["children", "className", "col", "colStart", "row", "rowStart", "as"]); return (React.createElement(Tag, __assign({ className: classnames(cnGridItem({}), useGenerateGridModsCn(cnGridItem, { col: col, colStart: colStart, row: row, rowStart: rowStart, }), className) }, other, { ref: ref }), children)); }); GridItem.displayName = 'GridItem';