@wordpress/components
Version:
UI components for WordPress.
59 lines (56 loc) • 1.29 kB
JavaScript
import { createElement } from "@wordpress/element";
/**
* Internal dependencies
*/
import { Grid } from '../grid';
import { Surface } from '../surface';
import { Text } from '../../text';
import { View } from '../view';
import { VStack } from '../v-stack';
const Container = ({
children
}) => createElement("div", {
style: {
maxWidth: 1280,
width: '100%',
marginLeft: 'auto',
marginRight: 'auto'
}
}, children);
export const ExampleGrid = ({
children
}) => createElement(Container, null, createElement(Grid, {
columns: [2, 2, 4],
gap: "1px"
}, children));
export const ExampleGridItem = ({
children
}) => createElement(Surface, {
variant: "secondary",
style: {
padding: 20
}
}, createElement(VStack, {
alignment: "center"
}, children));
export const ExampleMetaContent = ({
title,
items = []
}) => {
return createElement(Grid, {
templateColumns: "60px 1fr"
}, createElement(View, null, createElement(Text, {
size: "caption",
weight: "bold",
align: "right",
isBlock: true
}, title)), createElement(VStack, {
spacing: 1
}, items.map((item, index) => createElement(View, {
key: index
}, createElement(Text, {
size: "caption",
isBlock: true
}, item)))));
};
//# sourceMappingURL=example-grid.js.map