@coveord/plasma-mantine
Version:
A Plasma flavoured Mantine theme
52 lines (51 loc) • 1.89 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Collapse, Paper, polymorphicFactory, Stack, Text, Title, useProps, useStyles } from '@mantine/core';
import classes from './ChildForm.module.css';
const defaultProps = {};
export const ChildForm = polymorphicFactory((props, ref)=>{
const { className, children, style, classNames, styles, unstyled, vars, title, description, ...others } = useProps('ChildForm', defaultProps, props);
const hasDescription = description !== null && description !== undefined && description !== '' && typeof description !== 'boolean';
const getStyles = useStyles({
name: 'ChildForm',
classes,
props,
className,
style,
classNames,
styles,
unstyled,
vars
});
return /*#__PURE__*/ _jsx(Collapse, {
ref: ref,
...others,
...getStyles('root'),
children: /*#__PURE__*/ _jsxs(Paper, {
p: "md",
...getStyles('paper'),
children: [
(title || hasDescription) && /*#__PURE__*/ _jsxs(Stack, {
gap: 0,
mb: "md",
children: [
title && /*#__PURE__*/ _jsx(Title, {
order: 5,
children: title
}),
hasDescription && /*#__PURE__*/ _jsx(Text, {
component: "div",
c: "gray.7",
children: description
})
]
}),
/*#__PURE__*/ _jsx(Stack, {
gap: "md",
children: children
})
]
})
});
});
ChildForm.displayName = 'ChildForm';
//# sourceMappingURL=ChildForm.js.map