phx-react
Version:
PHX REACT
26 lines • 862 B
JavaScript
'use client';
import React from 'react';
import { spacingMap } from '../Box';
import { getResponsiveClass } from '../../helpers/helpers';
export const PHXInlineGrid = ({ children, columns = 1, gap = 'none', alignItems = 'stretch', fullWidth = false, }) => {
const columnMap = {
1: 'cols-1',
2: 'cols-2',
3: 'cols-3',
};
const alignMap = {
start: 'items-start',
center: 'items-center',
end: 'items-end',
stretch: 'items-stretch',
};
const classes = [
'grid',
getResponsiveClass('grid', columns, columnMap),
getResponsiveClass('gap', gap, spacingMap),
alignMap[alignItems],
fullWidth ? 'w-full' : '',
];
return React.createElement("div", { className: classes.filter(Boolean).join(' ') }, children);
};
//# sourceMappingURL=InlineGrid.js.map