@gechiui/components
Version:
UI components for GeChiUI.
46 lines (42 loc) • 1.15 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createElement } from "@gechiui/element";
/**
* Internal dependencies
*/
import { contextConnect } from '../ui/context';
import { View } from '../view';
import useGrid from './hook';
/**
* @param {import('../ui/context').GeChiUIComponentProps<import('./types').Props, 'div'>} props
* @param {import('react').Ref<any>} forwardedRef
*/
function Grid(props, forwardedRef) {
const gridProps = useGrid(props);
return createElement(View, _extends({}, gridProps, {
ref: forwardedRef
}));
}
/**
* `Grid` is a primitive layout component that can arrange content in a grid configuration.
*
* @example
* ```jsx
* import {
* __experimentalGrid as Grid,
* __experimentalText as Text
* } from `@gechiui/components`;
*
* function Example() {
* return (
* <Grid columns={ 3 }>
* <Text>Code</Text>
* <Text>is</Text>
* <Text>Poetry</Text>
* </Grid>
* );
* }
* ```
*/
const ConnectedGrid = contextConnect(Grid, 'Grid');
export default ConnectedGrid;
//# sourceMappingURL=component.js.map