UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

75 lines (74 loc) 3.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ChildForm", { enumerable: true, get: function() { return ChildForm; } }); var _interop_require_default = require("@swc/helpers/_/_interop_require_default"); var _object_spread = require("@swc/helpers/_/_object_spread"); var _object_spread_props = require("@swc/helpers/_/_object_spread_props"); var _object_without_properties = require("@swc/helpers/_/_object_without_properties"); var _jsxruntime = require("react/jsx-runtime"); var _core = require("@mantine/core"); var _ChildFormmodulecss = /*#__PURE__*/ _interop_require_default._(require("./ChildForm.module.css")); var defaultProps = {}; var ChildForm = (0, _core.polymorphicFactory)(function(props, ref) { var _useProps = (0, _core.useProps)('ChildForm', defaultProps, props), className = _useProps.className, children = _useProps.children, style = _useProps.style, classNames = _useProps.classNames, styles = _useProps.styles, unstyled = _useProps.unstyled, vars = _useProps.vars, title = _useProps.title, description = _useProps.description, others = _object_without_properties._(_useProps, [ "className", "children", "style", "classNames", "styles", "unstyled", "vars", "title", "description" ]); var hasDescription = description !== null && description !== undefined && description !== '' && typeof description !== 'boolean'; var getStyles = (0, _core.useStyles)({ name: 'ChildForm', classes: _ChildFormmodulecss.default, props: props, className: className, style: style, classNames: classNames, styles: styles, unstyled: unstyled, vars: vars }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Collapse, _object_spread_props._(_object_spread._({ ref: ref }, others, getStyles('root')), { children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_core.Paper, _object_spread_props._(_object_spread._({ p: "md" }, getStyles('paper')), { children: [ (title || hasDescription) && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_core.Stack, { gap: 0, mb: "md", children: [ title && /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Title, { order: 5, children: title }), hasDescription && /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Text, { component: "div", c: "gray.7", children: description }) ] }), /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Stack, { gap: "md", children: children }) ] })) })); }); ChildForm.displayName = 'ChildForm'; //# sourceMappingURL=ChildForm.js.map