UNPKG

@wulperstudio/cms

Version:
79 lines (78 loc) 3.48 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.IconDescription = void 0; var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); var _react = _interopRequireDefault(require("react")); var _uuid = require("uuid"); var _react2 = require("@iconify/react"); var _material = require("@mui/material"); var _GridCards = require("../../GridCards"); var _jsxRuntime = require("react/jsx-runtime"); var _excluded = ["width", "height"], _excluded2 = ["variant", "fontWeight", "textTransform"], _excluded3 = ["variant", "fontWeight"]; var IconDescription = exports.IconDescription = function IconDescription(_ref) { var descriptionProps = _ref.descriptionProps, gridCardsProps = _ref.gridCardsProps, iconProps = _ref.iconProps, list = _ref.list, stackProps = _ref.stackProps, titleProps = _ref.titleProps; var _ref2 = iconProps || {}, _ref2$width = _ref2.width, width = _ref2$width === void 0 ? '25' : _ref2$width, _ref2$height = _ref2.height, height = _ref2$height === void 0 ? '25' : _ref2$height, restIconProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded); var _ref3 = titleProps || {}, _ref3$variant = _ref3.variant, variant = _ref3$variant === void 0 ? 'subtitle1' : _ref3$variant, _ref3$fontWeight = _ref3.fontWeight, fontWeight = _ref3$fontWeight === void 0 ? '400' : _ref3$fontWeight, _ref3$textTransform = _ref3.textTransform, textTransform = _ref3$textTransform === void 0 ? 'capitalize' : _ref3$textTransform, restTitleProps = (0, _objectWithoutProperties2["default"])(_ref3, _excluded2); var _ref4 = descriptionProps || {}, _ref4$variant = _ref4.variant, variantDescription = _ref4$variant === void 0 ? 'body1' : _ref4$variant, _ref4$fontWeight = _ref4.fontWeight, fontWeightDescription = _ref4$fontWeight === void 0 ? '600' : _ref4$fontWeight, restDescriptionProps = (0, _objectWithoutProperties2["default"])(_ref4, _excluded3); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridCards.GridCards, Object.assign({}, gridCardsProps, { children: list.map(function (_ref5) { var label = _ref5.label, value = _ref5.value, icon = _ref5.icon; return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Stack, Object.assign({ alignItems: "center", columnGap: 2, component: "article", direction: "row" }, stackProps, { children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, { children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.Icon, Object.assign({ icon: icon, width: width, height: height }, restIconProps)) }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, { children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, Object.assign({ variant: variant, fontWeight: fontWeight, textTransform: textTransform }, restTitleProps, { children: label })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, Object.assign({ variant: variantDescription, fontWeight: fontWeightDescription }, restDescriptionProps, { children: value }))] })] }), (0, _uuid.v4)()); }) })); };