UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

38 lines (37 loc) 1.42 kB
"use client"; import { useProps } from "../../../core/MantineProvider/use-props/use-props.mjs"; import { useRandomClassName } from "../../../core/Box/use-random-classname/use-random-classname.mjs"; import { factory } from "../../../core/factory/factory.mjs"; import { Box } from "../../../core/Box/Box.mjs"; import { useGridContext } from "../Grid.context.mjs"; import { GridColVariables } from "./GridColVariables.mjs"; import Grid_module_default from "../Grid.module.mjs"; import cx from "clsx"; import { Fragment, jsx, jsxs } from "react/jsx-runtime"; //#region packages/@mantine/core/src/components/Grid/GridCol/GridCol.tsx const defaultProps = { span: 12 }; const GridCol = factory((_props) => { const { classNames, className, style, styles, vars, span, order, offset, align, ...others } = useProps("GridCol", defaultProps, _props); const ctx = useGridContext(); const responsiveClassName = useRandomClassName(); return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(GridColVariables, { selector: `.${responsiveClassName}`, span, order, offset, align }), /* @__PURE__ */ jsx(Box, { ...ctx.getStyles("col", { className: cx(className, responsiveClassName), style, classNames, styles }), ...others })] }); }); GridCol.classes = Grid_module_default; GridCol.displayName = "@mantine/core/GridCol"; //#endregion export { GridCol }; //# sourceMappingURL=GridCol.mjs.map