@ozen-ui/kit
Version:
React component library
21 lines (20 loc) • 1.41 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormGroup = exports.cnFormGroup = void 0;
var tslib_1 = require("tslib");
require("./FormGroup.css");
var react_1 = tslib_1.__importDefault(require("react"));
var useThemeProps_1 = require("../../hooks/useThemeProps");
var classname_1 = require("../../utils/classname");
var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef");
var constants_1 = require("./constants");
exports.cnFormGroup = (0, classname_1.cn)('FormGroup');
exports.FormGroup = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
var props = (0, useThemeProps_1.useThemeProps)({
props: inProps,
name: 'FormGroup',
});
var _a = props.direction, direction = _a === void 0 ? constants_1.FORM_GROUP_DEFAULT_DIRECTION : _a, _b = props.as, Tag = _b === void 0 ? constants_1.FORM_GROUP_DEFAULT_AS : _b, _c = props.size, size = _c === void 0 ? constants_1.FORM_GROUP_DEFAULT_SIZE : _c, children = props.children, className = props.className, other = tslib_1.__rest(props, ["direction", "as", "size", "children", "className"]);
return (react_1.default.createElement(Tag, tslib_1.__assign({ className: (0, exports.cnFormGroup)({ direction: direction, size: size }, [className]) }, other, { ref: ref }), children));
});
exports.FormGroup.displayName = 'FormGroup';
;