@tenancy.nz/feature-ui 1.4.11 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ var react = require('@emotion/react');
5
5
  var styled = require('@emotion/styled');
6
6
 
7
7
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
8
- var StyledPropertyImage = styled.figure(_templateObject || (_templateObject = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding: 0;\n margin: 0;\n width: 120px;\n height: 95px;\n flex: 0 0 95px;\n overflow: hidden;\n\n ", "\n"])), function (_ref) {
8
+ var StyledPropertyImage = styled.div(_templateObject || (_templateObject = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding: 0;\n margin: 0;\n width: 120px;\n height: 95px;\n flex: 0 0 95px;\n overflow: hidden;\n\n ", "\n"])), function (_ref) {
9
9
  var theme = _ref.theme;
10
10
  return react.css(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n ", " {\n display: none;\n }\n\n ", " {\n width: 150px;\n height: 135px;\n flex: 0 0 150px;\n }\n\n @media print {\n width: 150px;\n height: 135px;\n flex: 0 0 150px;\n display: block;\n }\n "])), theme.breakpoints.down("sm"), theme.breakpoints.up("sm"));
11
11
  });
@@ -13,7 +13,7 @@ var StyledPropertyDetailsBox = styled.div(_templateObject3 || (_templateObject3
13
13
  var theme = _ref2.theme;
14
14
  return react.css(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n ", " {\n flex-direction: row;\n align-items: center;\n }\n "])), theme.breakpoints.up("sm"));
15
15
  });
16
- var StyledPropertyAmenitiesBox = styled.div(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding-right: 25px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n\n gap: 18px;\n min-width: 170px;\n height: 100%;\n justify-content: space-between;\n\n ", "\n @media print {\n align-items: flex-end;\n }\n"])), function (_ref3) {
16
+ var StyledPropertyAmenitiesBox = styled.div(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n padding-right: 25px;\n display: flex;\n flex-direction: column;\n margin-top: 5px;\n gap: 8px;\n min-width: 170px;\n height: 100%;\n justify-content: space-between;\n\n ", "\n @media print {\n align-items: flex-end;\n }\n"])), function (_ref3) {
17
17
  var theme = _ref3.theme;
18
18
  return "\n @media (min-width: ".concat(theme.breakpoints.values.md, "px) {\n align-items: flex-end;\n }\n ");
19
19
  });
@@ -0,0 +1,61 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var doughnutChart = require('./doughnut-chart.cjs');
7
+ var general = require('../utils/helpers/general.cjs');
8
+
9
+ function AnalyticsDoughnutChart(_ref) {
10
+ var _ref$allhouseCount = _ref.allhouseCount,
11
+ allhouseCount = _ref$allhouseCount === void 0 ? 0 : _ref$allhouseCount,
12
+ _ref$bookMeCount = _ref.bookMeCount,
13
+ bookMeCount = _ref$bookMeCount === void 0 ? 0 : _ref$bookMeCount,
14
+ _ref$oneRoofCount = _ref.oneRoofCount,
15
+ oneRoofCount = _ref$oneRoofCount === void 0 ? 0 : _ref$oneRoofCount,
16
+ _ref$realEstateCount = _ref.realEstateCount,
17
+ realEstateCount = _ref$realEstateCount === void 0 ? 0 : _ref$realEstateCount,
18
+ _ref$tradeMeCount = _ref.tradeMeCount,
19
+ tradeMeCount = _ref$tradeMeCount === void 0 ? 0 : _ref$tradeMeCount,
20
+ _ref$manualCount = _ref.manualCount,
21
+ manualCount = _ref$manualCount === void 0 ? 0 : _ref$manualCount,
22
+ _ref$heading = _ref.heading,
23
+ heading = _ref$heading === void 0 ? void 0 : _ref$heading;
24
+ var data = [{
25
+ color: "#0CC1A3",
26
+ count: general.parseChartCount(bookMeCount),
27
+ slug: "bookme",
28
+ title: "Tenant Portal"
29
+ }, {
30
+ color: "#000000",
31
+ count: general.parseChartCount(allhouseCount),
32
+ slug: "allhouse",
33
+ title: "Allhouse"
34
+ }, {
35
+ color: "#FF8500",
36
+ count: general.parseChartCount(oneRoofCount),
37
+ slug: "oneroof",
38
+ title: "OneRoof"
39
+ }, {
40
+ color: "#0098FF",
41
+ count: general.parseChartCount(realEstateCount),
42
+ slug: "realestate",
43
+ title: "realestate.co.nz"
44
+ }, {
45
+ color: "#4854D3",
46
+ count: general.parseChartCount(tradeMeCount),
47
+ slug: "trademe",
48
+ title: "Trade Me"
49
+ }, {
50
+ color: "#D9D9D9",
51
+ count: general.parseChartCount(manualCount),
52
+ slug: "manual",
53
+ title: "Manually Generated"
54
+ }];
55
+ return /* @__PURE__ */React.createElement(doughnutChart.default, {
56
+ data: data,
57
+ heading: heading
58
+ });
59
+ }
60
+
61
+ exports.default = AnalyticsDoughnutChart;
@@ -0,0 +1,124 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var reactUid = require('react-uid');
8
+ var Stack = require('@mui/material/Stack');
9
+ var ui = require('@tenancy.nz/ui');
10
+ var chart_js = require('primereact/chart.js');
11
+ var ChartLegend = require('./ChartLegend.cjs');
12
+
13
+ function DoughnutChart(_ref) {
14
+ var data = _ref.data,
15
+ _ref$heading = _ref.heading,
16
+ heading = _ref$heading === void 0 ? void 0 : _ref$heading,
17
+ _ref$chartProps = _ref.chartProps,
18
+ chartProps = _ref$chartProps === void 0 ? {} : _ref$chartProps,
19
+ _ref$size = _ref.size,
20
+ size = _ref$size === void 0 ? "164px" : _ref$size;
21
+ if (!Array.isArray(data) || data.length === 0) {
22
+ return null;
23
+ }
24
+ var chartLabels = data.map(function (d) {
25
+ return d.title;
26
+ });
27
+ var chartValues = data.map(function (d) {
28
+ return d.count;
29
+ });
30
+ var chartColors = data.map(function (d) {
31
+ return d.color;
32
+ });
33
+ return /* @__PURE__ */React.createElement(Stack, {
34
+ sx: {
35
+ position: "relative"
36
+ },
37
+ alignItems: "center",
38
+ gap: 4
39
+ }, heading && /* @__PURE__ */React.createElement(ui.Heading, {
40
+ as: "h4",
41
+ color: "primary"
42
+ }, heading), /* @__PURE__ */React.createElement(Stack, {
43
+ flexDirection: {
44
+ sm: "row"
45
+ },
46
+ gap: 12,
47
+ alignItems: "center"
48
+ }, /* @__PURE__ */React.createElement(ui.Box, {
49
+ width: size,
50
+ height: size,
51
+ overflow: "hidden",
52
+ position: "relative",
53
+ maxWidth: "100%",
54
+ sx: {
55
+ "&& > canvas": {
56
+ width: "100%",
57
+ height: "100%"
58
+ }
59
+ }
60
+ }, /* @__PURE__ */React.createElement(chart_js.Chart, _rollupPluginBabelHelpers.objectSpread2({
61
+ type: "doughnut",
62
+ data: {
63
+ labels: chartLabels,
64
+ datasets: [{
65
+ data: chartValues,
66
+ backgroundColor: chartColors,
67
+ hoverBackgroundColor: chartColors,
68
+ borderWidth: 0
69
+ }]
70
+ },
71
+ options: {
72
+ responsive: true,
73
+ maintainAspectRatio: false,
74
+ cutoutPercentage: 64,
75
+ legend: {
76
+ display: false
77
+ },
78
+ animation: {
79
+ duration: 0
80
+ },
81
+ tooltips: {
82
+ backgroundColor: "#0E0044",
83
+ titleFontColor: "#fff",
84
+ bodyFontColor: "#fff",
85
+ xPadding: 8,
86
+ yPadding: 8,
87
+ bodyFontFamily: "Montserrat, sans-serif",
88
+ bodyFontStyle: "semibold",
89
+ bodyFontSize: 14,
90
+ borderColor: "transparent",
91
+ callbacks: {
92
+ labelColor: function labelColor(tooltipItem, chart) {
93
+ var dataset = chart.config.data.datasets[tooltipItem.datasetIndex];
94
+ var color = dataset.backgroundColor[tooltipItem.index];
95
+ return {
96
+ borderColor: color,
97
+ backgroundColor: color,
98
+ borderWidth: 0,
99
+ borderRadius: 5
100
+ };
101
+ }
102
+ }
103
+ }
104
+ },
105
+ style: {
106
+ width: "100%",
107
+ height: "100%"
108
+ }
109
+ }, chartProps))), /* @__PURE__ */React.createElement(Stack, {
110
+ gap: 2
111
+ }, data.map(function (item) {
112
+ var color = item.color,
113
+ count = item.count,
114
+ title = item.title;
115
+ return /* @__PURE__ */React.createElement(ChartLegend.default, {
116
+ key: reactUid.uid(item),
117
+ color: color,
118
+ count: count,
119
+ label: title
120
+ });
121
+ }))));
122
+ }
123
+
124
+ exports.default = DoughnutChart;
@@ -9,7 +9,8 @@ var BookingTableRow = require('./components/BookingTableRow.cjs');
9
9
  var BookingTableRowHeader = require('./components/BookingTableRowHeader.cjs');
10
10
  var BookingTableRowSkeleton = require('./components/BookingTableRowSkeleton.cjs');
11
11
  var CheckedIcon = require('./components/CheckedIcon.cjs');
12
- var EnquiriesDoughnutChart = require('./components/EnquiriesDoughnutChart.cjs');
12
+ var doughnutChart = require('./components/doughnut-chart.cjs');
13
+ var analyticsDoughnutChart = require('./components/analytics-doughnut-chart.cjs');
13
14
  var GridList = require('./components/GridList.cjs');
14
15
  var Hidden = require('./components/Hidden.cjs');
15
16
  var IconLabel = require('./components/IconLabel.cjs');
@@ -27,7 +28,8 @@ exports.BookingTableRow = BookingTableRow.default;
27
28
  exports.BookingTableRowHeader = BookingTableRowHeader.default;
28
29
  exports.BookingTableRowSkeleton = BookingTableRowSkeleton.default;
29
30
  exports.CheckedIcon = CheckedIcon.default;
30
- exports.EnquiriesDoughnutChart = EnquiriesDoughnutChart.default;
31
+ exports.DoughnutChart = doughnutChart.default;
32
+ exports.AnalyticsDoughnutChart = analyticsDoughnutChart.default;
31
33
  exports.GridList = GridList.default;
32
34
  exports.Hidden = Hidden.default;
33
35
  exports.IconLabel = IconLabel.default;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var parseChartCount = function parseChartCount(value) {
4
+ if (Number.isNaN(Number.parseInt(String(value), 10))) {
5
+ return 0;
6
+ }
7
+ if (value === 0) {
8
+ return 0;
9
+ }
10
+ return Math.max(Number(value), 1e-3);
11
+ };
12
+
13
+ exports.parseChartCount = parseChartCount;
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Box, Skeleton, Heading, Text } from '@tenancy.nz/ui';
3
- import { UserIcon, PhoneIcon, EnvelopeIcon } from '@tenancy.nz/icons';
3
+ import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
4
+ import PhoneRoundedIcon from '@mui/icons-material/PhoneRounded';
5
+ import PersonRoundedIcon from '@mui/icons-material/PersonRounded';
4
6
  import IconLabel from './IconLabel.js';
5
7
 
6
8
  function AgentDetailsCard(_ref) {
@@ -29,8 +31,8 @@ function AgentDetailsCard(_ref) {
29
31
  variant: "text"
30
32
  }) : /* @__PURE__ */React.createElement(IconLabel, {
31
33
  color: "tertiary.main",
32
- startIcon: /* @__PURE__ */React.createElement(UserIcon, {
33
- size: "24px"
34
+ startIcon: /* @__PURE__ */React.createElement(PersonRoundedIcon, {
35
+ fontSize: "small"
34
36
  })
35
37
  }, /* @__PURE__ */React.createElement(Heading, {
36
38
  as: "h5",
@@ -41,8 +43,8 @@ function AgentDetailsCard(_ref) {
41
43
  variant: "text"
42
44
  }) : /* @__PURE__ */React.createElement(IconLabel, {
43
45
  color: "tertiary.main",
44
- startIcon: /* @__PURE__ */React.createElement(PhoneIcon, {
45
- size: "24px"
46
+ startIcon: /* @__PURE__ */React.createElement(PhoneRoundedIcon, {
47
+ fontSize: "small"
46
48
  })
47
49
  }, /* @__PURE__ */React.createElement(Text, {
48
50
  as: "span",
@@ -55,8 +57,8 @@ function AgentDetailsCard(_ref) {
55
57
  variant: "text"
56
58
  }) : /* @__PURE__ */React.createElement(IconLabel, {
57
59
  color: "tertiary.main",
58
- startIcon: /* @__PURE__ */React.createElement(EnvelopeIcon, {
59
- size: "24px"
60
+ startIcon: /* @__PURE__ */React.createElement(EmailRoundedIcon, {
61
+ fontSize: "small"
60
62
  })
61
63
  }, /* @__PURE__ */React.createElement(Text, {
62
64
  as: "span",
@@ -1,8 +1,9 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React from 'react';
3
- import { Paper, Box, Heading, Text } from '@tenancy.nz/ui';
3
+ import Stack from '@mui/material/Stack';
4
+ import { Paper, Heading, Text } from '@tenancy.nz/ui';
4
5
 
5
- var _excluded = ["width", "minWidth", "maxWidth", "height", "border", "label", "amount", "text"];
6
+ var _excluded = ["width", "minWidth", "maxWidth", "height", "border", "label", "amount", "text", "sx"];
6
7
  function AnalyticsBox(_ref) {
7
8
  var width = _ref.width,
8
9
  minWidth = _ref.minWidth,
@@ -12,40 +13,48 @@ function AnalyticsBox(_ref) {
12
13
  label = _ref.label,
13
14
  amount = _ref.amount,
14
15
  text = _ref.text,
16
+ _ref$sx = _ref.sx,
17
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
15
18
  rest = _objectWithoutProperties(_ref, _excluded);
16
19
  return /* @__PURE__ */React.createElement(Paper, _objectSpread2(_objectSpread2({}, rest), {}, {
17
- sx: {
20
+ inset: "medium",
21
+ sx: _objectSpread2(_objectSpread2({
18
22
  maxWidth: maxWidth,
19
23
  width: width,
20
24
  minWidth: minWidth,
21
- border: border,
22
- height: height || "100%",
25
+ border: border || "1px solid",
26
+ height: height,
23
27
  display: "flex",
24
28
  alignItems: "center",
25
- justifyContent: "center",
26
- padding: "16px"
27
- }
28
- }), /* @__PURE__ */React.createElement(Box, null, /* @__PURE__ */React.createElement(Heading, {
29
+ justifyContent: "center"
30
+ }, border ? {} : {
31
+ borderColor: "grey.300"
32
+ }), sx)
33
+ }), /* @__PURE__ */React.createElement(Stack, {
34
+ color: "text.primary"
35
+ }, /* @__PURE__ */React.createElement(Heading, {
29
36
  align: "center",
30
37
  weight: "700",
31
38
  as: "h3",
39
+ color: "primary",
32
40
  gutterBottom: true
33
41
  }, amount), /* @__PURE__ */React.createElement(Text, {
34
42
  align: "center",
35
- weight: "400",
36
- variant: "body2"
43
+ weight: "500",
44
+ variant: "body2",
45
+ color: "primary"
37
46
  }, label), text && /* @__PURE__ */React.createElement(Text, {
38
47
  align: "center",
39
48
  weight: "400",
49
+ color: "primary",
40
50
  sx: {
41
51
  fontSize: {
42
52
  xs: 8,
43
- sm: 10,
44
- xl: 14
53
+ sm: 10
45
54
  },
46
- lineHeight: "15.6px",
55
+ lineHeight: "13px",
47
56
  maxWidth: "366px",
48
- mt: "8px"
57
+ mt: 1
49
58
  }
50
59
  }, text)));
51
60
  }
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
- import { useMediaQuery, Box, Paper, Text } from '@tenancy.nz/ui';
2
+ import { uid } from 'react-uid';
3
+ import Stack from '@mui/material/Stack';
4
+ import useMediaQuery from '@mui/material/useMediaQuery';
5
+ import { Paper, Text, Grid } from '@tenancy.nz/ui';
3
6
  import AnalyticsBox from './AnalyticsBox.js';
4
- import EnquiriesDoughnutChart from './EnquiriesDoughnutChart.js';
7
+ import AnalyticsDoughnutChart from './analytics-doughnut-chart.js';
5
8
 
6
9
  function AnalyticsSection(_ref) {
7
10
  var viewingsCount = _ref.viewingsCount,
@@ -11,158 +14,163 @@ function AnalyticsSection(_ref) {
11
14
  applicationsCount = _ref.applicationsCount,
12
15
  averageRent = _ref.averageRent,
13
16
  textUsage = _ref.textUsage,
14
- tradeMeEnquiriesCount = _ref.tradeMeEnquiriesCount,
15
- bookMeEnquiriesCount = _ref.bookMeEnquiriesCount,
16
- manualEnquiryCount = _ref.manualEnquiryCount,
17
17
  agreementsCount = _ref.agreementsCount,
18
18
  agreementsFinalisedCount = _ref.agreementsFinalisedCount,
19
- filterDaysCount = _ref.filterDaysCount;
19
+ filterDaysCount = _ref.filterDaysCount,
20
+ allHouseEnquiriesCount = _ref.allHouseEnquiriesCount,
21
+ bookMeEnquiriesCount = _ref.bookMeEnquiriesCount,
22
+ oneRoofEnquiriesCount = _ref.oneRoofEnquiriesCount,
23
+ realestateEnquiriesCount = _ref.realestateEnquiriesCount,
24
+ tradeMeEnquiriesCount = _ref.tradeMeEnquiriesCount,
25
+ manualEnquiryCount = _ref.manualEnquiryCount,
26
+ allHouseBookingsCount = _ref.allHouseBookingsCount,
27
+ bookMeBookingsCount = _ref.bookMeBookingsCount,
28
+ oneRoofBookingsCount = _ref.oneRoofBookingsCount,
29
+ realestateBookingsCount = _ref.realestateBookingsCount,
30
+ tradeMeBookingsCount = _ref.tradeMeBookingsCount,
31
+ manualBookingsCount = _ref.manualBookingsCount;
20
32
  var isXlUp = useMediaQuery(function (theme) {
21
33
  return theme.breakpoints.up("xl");
22
34
  });
23
- return /* @__PURE__ */React.createElement(Box, {
24
- display: "flex",
25
- align: "stretch",
26
- direction: {
27
- xs: "column-reverse",
28
- mlg: "row"
29
- },
30
- gap: "27px"
31
- }, /* @__PURE__ */React.createElement(Box, {
32
- width: "100%",
33
- sx: {
34
- maxWidth: {
35
- xs: "100%",
36
- mob: "340px",
37
- xl: "463px"
38
- }
39
- }
35
+ var stats = [{
36
+ label: "Viewings",
37
+ value: viewingsCount
38
+ }, {
39
+ label: "Bookings",
40
+ value: bookingsCount
41
+ }, {
42
+ label: "Attendees",
43
+ value: attendeesCount
44
+ }, {
45
+ label: "Cancellations",
46
+ value: cancellationsCount
47
+ }, {
48
+ label: "Applications",
49
+ value: applicationsCount
50
+ }, {
51
+ label: "Average Rent",
52
+ value: "$".concat(averageRent)
53
+ }, {
54
+ label: "Text Usage Total",
55
+ value: textUsage
56
+ }];
57
+ return /* @__PURE__ */React.createElement(Stack, {
58
+ gap: 6
59
+ }, /* @__PURE__ */React.createElement(Stack, {
60
+ flexDirection: "row",
61
+ gap: 6,
62
+ flexWrap: "wrap",
63
+ alignItems: "stretch"
40
64
  }, /* @__PURE__ */React.createElement(Paper, {
41
65
  outlined: true,
66
+ inset: "medium",
67
+ overflow: false,
42
68
  sx: {
43
69
  width: "100%",
44
- position: "relative",
45
- height: "100%"
70
+ minWidth: {
71
+ sm: "456px"
72
+ },
73
+ flex: {
74
+ xs: "0 0 100%",
75
+ sm: 1
76
+ },
77
+ alignItems: "center",
78
+ justifyContent: "center",
79
+ display: "flex"
46
80
  }
47
- }, /* @__PURE__ */React.createElement(Box, {
48
- mt: "20px",
49
- height: "100%"
50
- }, /* @__PURE__ */React.createElement(EnquiriesDoughnutChart, {
51
- tradeMeEnquiriesCount: tradeMeEnquiriesCount,
52
- bookMeEnquiriesCount: bookMeEnquiriesCount,
53
- manualEnquiryCount: manualEnquiryCount
54
- })))), /* @__PURE__ */React.createElement(Box, {
55
- width: "100%"
56
- }, /* @__PURE__ */React.createElement(Box, {
57
- display: "flex",
58
- direction: "row",
59
- width: "100%",
60
- gap: 6
61
- }, /* @__PURE__ */React.createElement(Box, {
62
- flex: 3
63
- }, /* @__PURE__ */React.createElement(Box, {
64
- display: "flex",
65
- gap: 6
66
- }, /* @__PURE__ */React.createElement(AnalyticsBox, {
67
- outlined: true,
68
- label: "Viewings",
69
- amount: viewingsCount,
70
- width: "100%",
71
- height: isXlUp ? "157px" : "125px"
72
- }), /* @__PURE__ */React.createElement(AnalyticsBox, {
73
- outlined: true,
74
- label: "Bookings",
75
- amount: bookingsCount,
76
- width: "100%",
77
- height: isXlUp ? "157px" : "125px"
78
- }), /* @__PURE__ */React.createElement(AnalyticsBox, {
81
+ }, /* @__PURE__ */React.createElement(AnalyticsDoughnutChart, {
82
+ tradeMeCount: tradeMeEnquiriesCount,
83
+ bookMeCount: bookMeEnquiriesCount,
84
+ manualCount: manualEnquiryCount,
85
+ allhouseCount: allHouseEnquiriesCount,
86
+ oneRoofCount: oneRoofEnquiriesCount,
87
+ realEstateCount: realestateEnquiriesCount,
88
+ heading: "Number of enquiries"
89
+ })), /* @__PURE__ */React.createElement(Paper, {
79
90
  outlined: true,
80
- label: "Attendees",
81
- amount: attendeesCount,
82
- width: "100%",
83
- border: "3px solid #6FD3C0",
84
- height: isXlUp ? "157px" : "125px"
85
- })), /* @__PURE__ */React.createElement(Box, {
86
- display: "flex",
87
- width: "100%",
88
- gap: 6,
89
- mt: 6
91
+ inset: "medium",
92
+ overflow: false,
93
+ sx: {
94
+ width: "100%",
95
+ minWidth: {
96
+ sm: "456px"
97
+ },
98
+ flex: {
99
+ xs: "0 0 100%",
100
+ sm: 1
101
+ },
102
+ alignItems: "center",
103
+ justifyContent: "center",
104
+ display: "flex"
105
+ }
106
+ }, /* @__PURE__ */React.createElement(AnalyticsDoughnutChart, {
107
+ tradeMeCount: tradeMeBookingsCount,
108
+ bookMeCount: bookMeBookingsCount,
109
+ manualCount: manualBookingsCount,
110
+ allhouseCount: allHouseBookingsCount,
111
+ oneRoofCount: oneRoofBookingsCount,
112
+ realEstateCount: realestateBookingsCount,
113
+ heading: "Number of bookings"
114
+ })), /* @__PURE__ */React.createElement(Stack, {
115
+ gap: {
116
+ xs: 3,
117
+ md: 6
118
+ },
119
+ justifyContent: "space-between",
120
+ sx: {
121
+ flexDirection: {
122
+ xs: "row",
123
+ lg: "column"
124
+ },
125
+ flex: {
126
+ sm: "0 0 100%",
127
+ lg: "0 0 284px"
128
+ }
129
+ }
90
130
  }, /* @__PURE__ */React.createElement(AnalyticsBox, {
91
131
  outlined: true,
92
- label: "Converted Properties",
132
+ label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
93
133
  amount: agreementsCount,
94
134
  width: "100%",
95
- height: isXlUp ? "157px" : "125px",
96
- text: /* @__PURE__ */React.createElement(Box, {
97
- as: "span",
98
- maxWidth: "276px"
99
- }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement(Text, {
135
+ height: isXlUp ? "157px" : "auto",
136
+ text: /* @__PURE__ */React.createElement(Text, {
100
137
  as: "span",
101
- display: "inline",
102
- weight: "700",
103
- fontSize: "inherit"
104
- }, filterDaysCount), " ", "days where an agreement has been", " ", /* @__PURE__ */React.createElement(Text, {
105
- as: "span",
106
- display: "inline",
107
- weight: "700",
108
- fontSize: "inherit"
109
- }, "created"))
138
+ variant: "inherit"
139
+ }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "created"))
110
140
  }), /* @__PURE__ */React.createElement(AnalyticsBox, {
111
141
  outlined: true,
112
- label: "Converted Properties",
142
+ label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
113
143
  amount: agreementsFinalisedCount,
114
144
  width: "100%",
115
- height: isXlUp ? "157px" : "125px",
116
- text: /* @__PURE__ */React.createElement(Box, {
117
- as: "span",
118
- maxWidth: "276px"
119
- }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement(Text, {
145
+ height: isXlUp ? "157px" : "auto",
146
+ text: /* @__PURE__ */React.createElement(Text, {
120
147
  as: "span",
121
- display: "inline",
122
- weight: "700",
123
- fontSize: "inherit"
124
- }, filterDaysCount), " ", "days where an agreement has been", " ", /* @__PURE__ */React.createElement(Text, {
125
- as: "span",
126
- display: "inline",
127
- weight: "700",
128
- fontSize: "inherit"
129
- }, "finalised"))
130
- }))), /* @__PURE__ */React.createElement(Box, {
131
- flex: 2
132
- }, /* @__PURE__ */React.createElement(Box, {
133
- display: "flex",
134
- gap: 6
135
- }, /* @__PURE__ */React.createElement(AnalyticsBox, {
136
- outlined: true,
137
- label: "Cancellations",
138
- amount: cancellationsCount,
139
- width: "100%",
140
- border: "3px solid #ED0D8D",
141
- height: isXlUp ? "157px" : "125px"
142
- }), /* @__PURE__ */React.createElement(AnalyticsBox, {
143
- outlined: true,
144
- label: "Applications",
145
- amount: applicationsCount,
146
- width: "100%",
147
- border: "3px solid #F5C440",
148
- height: isXlUp ? "157px" : "125px"
149
- })), /* @__PURE__ */React.createElement(Box, {
150
- display: "flex",
151
- gap: 6,
152
- mt: 6
153
- }, /* @__PURE__ */React.createElement(AnalyticsBox, {
154
- outlined: true,
155
- label: /* @__PURE__ */React.createElement("span", null, "Average", /* @__PURE__ */React.createElement("br", null), " Rent"),
156
- amount: averageRent,
157
- width: "100%",
158
- height: isXlUp ? "157px" : "125px"
159
- }), /* @__PURE__ */React.createElement(AnalyticsBox, {
160
- outlined: true,
161
- label: /* @__PURE__ */React.createElement("span", null, "Text Usage", /* @__PURE__ */React.createElement("br", null), " Total"),
162
- amount: textUsage,
163
- width: "100%",
164
- height: isXlUp ? "157px" : "125px"
165
- }))))));
148
+ variant: "inherit"
149
+ }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, " ", filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "finalised"))
150
+ })), /* @__PURE__ */React.createElement(Grid, {
151
+ container: true,
152
+ spacing: {
153
+ xs: 3,
154
+ md: 6
155
+ }
156
+ }, stats.map(function (stat, i) {
157
+ return /* @__PURE__ */React.createElement(Grid, {
158
+ item: true,
159
+ key: uid(stat, i),
160
+ flex: {
161
+ lg: 1
162
+ },
163
+ xs: 6,
164
+ sm: 3,
165
+ md: 2
166
+ }, /* @__PURE__ */React.createElement(AnalyticsBox, {
167
+ outlined: true,
168
+ label: stat.label,
169
+ amount: stat.value,
170
+ width: "100%",
171
+ height: isXlUp ? "157px" : "124px"
172
+ }));
173
+ }))));
166
174
  }
167
175
 
168
176
  export { AnalyticsSection as default };