UNPKG

@actinc/dls

Version:

Design Language System (DLS) for ACT & Encoura front-end projects.

46 lines 2.41 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; /** * Copyright (c) ACT, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @prettier */ import Button from '@mui/material/Button'; import { isString } from 'lodash'; import { styled } from "../../helpers/styled"; import { StyledContainer, StyledGridContainer, StyledGridItem, StyledTypographyDescription, StyledTypographyTitle, } from './styles'; export var EmptyState = function (_a) { var buttonProps = _a.buttonProps, description = _a.description, descriptionTypographyProps = _a.descriptionTypographyProps, Icon = _a.Icon, iconProps = _a.iconProps, style = _a.style, title = _a.title, titleTypographyProps = _a.titleTypographyProps; var StyledIcon = Icon ? styled(Icon)({ height: 50, width: 50, }) : undefined; return (_jsxs(StyledContainer, { style: style, children: [StyledIcon && (_jsx(StyledIcon, __assign({ color: "disabled", titleAccess: isString(title) ? title : undefined }, iconProps))), title && (_jsx(StyledGridContainer, { alignItems: "center", container: true, justifyContent: "center", children: _jsx(StyledGridItem, { item: true, children: _jsx(StyledTypographyTitle, __assign({ align: "center", component: "h6", variant: "body1" }, titleTypographyProps, { children: title })) }) })), description && (_jsx(StyledTypographyDescription, __assign({ "$withoutTitle": !title, align: "center", color: "textSecondary", variant: "body1" }, descriptionTypographyProps, { children: description }))), buttonProps && _jsx(Button, __assign({}, buttonProps))] })); }; EmptyState.defaultProps = { buttonProps: undefined, description: undefined, descriptionTypographyProps: undefined, Icon: undefined, iconProps: undefined, style: undefined, title: undefined, titleTypographyProps: undefined, }; export default EmptyState; //# sourceMappingURL=index.js.map