UNPKG

@wulperstudio/cms

Version:
72 lines 2.99 kB
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["width", "height"], _excluded2 = ["variant", "fontWeight", "textTransform"], _excluded3 = ["variant", "fontWeight"]; import React from 'react'; import { v4 } from 'uuid'; import { Icon } from '@iconify/react'; import { Box, Stack, Typography } from '@mui/material'; import { GridCards } from '../../GridCards'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export var 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 = _objectWithoutProperties(_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 = _objectWithoutProperties(_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 = _objectWithoutProperties(_ref4, _excluded3); return /*#__PURE__*/_jsx(GridCards, Object.assign({}, gridCardsProps, { children: list.map(function (_ref5) { var label = _ref5.label, value = _ref5.value, icon = _ref5.icon; return /*#__PURE__*/_jsxs(Stack, Object.assign({ alignItems: "center", columnGap: 2, component: "article", direction: "row" }, stackProps, { children: [icon && /*#__PURE__*/_jsx(Box, { children: /*#__PURE__*/_jsx(Icon, Object.assign({ icon: icon, width: width, height: height }, restIconProps)) }), /*#__PURE__*/_jsxs(Box, { children: [/*#__PURE__*/_jsx(Typography, Object.assign({ variant: variant, fontWeight: fontWeight, textTransform: textTransform }, restTitleProps, { children: label })), /*#__PURE__*/_jsx(Typography, Object.assign({ variant: variantDescription, fontWeight: fontWeightDescription }, restDescriptionProps, { children: value }))] })] }), v4()); }) })); };