@tenancy.nz/feature-ui 1.4.10 → 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.
@@ -1,139 +0,0 @@
1
- import React from 'react';
2
- import { Box, Text } from '@tenancy.nz/ui';
3
- import { Chart } from 'primereact/chart.js';
4
-
5
- function EnquiriesDoughnutChart(_ref) {
6
- var _ref$tradeMeEnquiries = _ref.tradeMeEnquiriesCount,
7
- tradeMeEnquiriesCount = _ref$tradeMeEnquiries === void 0 ? 0 : _ref$tradeMeEnquiries,
8
- _ref$bookMeEnquiriesC = _ref.bookMeEnquiriesCount,
9
- bookMeEnquiriesCount = _ref$bookMeEnquiriesC === void 0 ? 0 : _ref$bookMeEnquiriesC,
10
- _ref$manualEnquiryCou = _ref.manualEnquiryCount,
11
- manualEnquiryCount = _ref$manualEnquiryCou === void 0 ? 0 : _ref$manualEnquiryCou;
12
- var colors = {
13
- tradeMe: "#6FD3C0",
14
- bookMe: "#00C0F3",
15
- manual: "#394869"
16
- };
17
- var chartColors = [colors.tradeMe, colors.bookMe, colors.manual];
18
- return /* @__PURE__ */React.createElement(Box, {
19
- position: "relative",
20
- display: "flex",
21
- height: "100%",
22
- align: "center"
23
- }, /* @__PURE__ */React.createElement(Text, {
24
- transform: "uppercase",
25
- sx: {
26
- position: "absolute",
27
- left: 20,
28
- top: -10
29
- },
30
- fontSize: 13,
31
- color: "textPrimary",
32
- weight: "700"
33
- }, "Number of enquiries"), /* @__PURE__ */React.createElement(Box, {
34
- width: "100%",
35
- overflow: "hidden"
36
- }, /* @__PURE__ */React.createElement(Chart, {
37
- type: "doughnut",
38
- data: {
39
- labels: ["TradeMe", "BookMe", "Manual"],
40
- datasets: [{
41
- data: [Math.max(tradeMeEnquiriesCount, 1e-3), Math.max(bookMeEnquiriesCount, 1e-3), Math.max(manualEnquiryCount, 1e-3)],
42
- backgroundColor: chartColors,
43
- hoverBackgroundColor: chartColors
44
- }]
45
- },
46
- options: {
47
- legend: {
48
- display: false
49
- },
50
- animation: {
51
- duration: 0
52
- }
53
- },
54
- style: {
55
- width: "100%",
56
- position: "absolute",
57
- top: "18%",
58
- left: "-75px"
59
- }
60
- })), /* @__PURE__ */React.createElement(Box, {
61
- maxWidth: {
62
- xs: "160px",
63
- xl: "180px"
64
- },
65
- width: "100%",
66
- padding: "10px 20px",
67
- mt: -4
68
- }, /* @__PURE__ */React.createElement(Box, {
69
- width: "100%"
70
- }, /* @__PURE__ */React.createElement(Box, {
71
- height: "10px",
72
- backgroundColor: colors.tradeMe,
73
- width: "100%"
74
- }), /* @__PURE__ */React.createElement(Box, {
75
- display: "flex",
76
- justify: "space-between",
77
- width: "100%",
78
- align: "flex-start",
79
- mt: 2
80
- }, /* @__PURE__ */React.createElement(Text, {
81
- transform: "uppercase",
82
- fontSize: 12,
83
- weight: "600"
84
- }, "TradeMe"), /* @__PURE__ */React.createElement(Text, {
85
- transform: "uppercase",
86
- fontSize: 32,
87
- weight: "700",
88
- mt: -3,
89
- color: "textPrimary"
90
- }, tradeMeEnquiriesCount))), /* @__PURE__ */React.createElement(Box, {
91
- width: "100%",
92
- mt: "30px"
93
- }, /* @__PURE__ */React.createElement(Box, {
94
- height: "10px",
95
- backgroundColor: colors.bookMe,
96
- width: "100%"
97
- }), /* @__PURE__ */React.createElement(Box, {
98
- display: "flex",
99
- justify: "space-between",
100
- width: "100%",
101
- align: "flex-start",
102
- mt: 2
103
- }, /* @__PURE__ */React.createElement(Text, {
104
- transform: "uppercase",
105
- fontSize: 12,
106
- weight: "600"
107
- }, "Bookme"), /* @__PURE__ */React.createElement(Text, {
108
- transform: "uppercase",
109
- fontSize: 32,
110
- weight: "700",
111
- mt: -3,
112
- color: "textPrimary"
113
- }, bookMeEnquiriesCount))), /* @__PURE__ */React.createElement(Box, {
114
- width: "100%",
115
- mt: "30px"
116
- }, /* @__PURE__ */React.createElement(Box, {
117
- height: "10px",
118
- backgroundColor: colors.manual,
119
- width: "100%"
120
- }), /* @__PURE__ */React.createElement(Box, {
121
- display: "flex",
122
- justify: "space-between",
123
- width: "100%",
124
- align: "flex-start",
125
- mt: 2
126
- }, /* @__PURE__ */React.createElement(Text, {
127
- transform: "uppercase",
128
- fontSize: 12,
129
- weight: "600"
130
- }, "Manually", /* @__PURE__ */React.createElement("br", null), "Generated"), /* @__PURE__ */React.createElement(Text, {
131
- transform: "uppercase",
132
- fontSize: 32,
133
- weight: "700",
134
- color: "textPrimary",
135
- mt: -3
136
- }, manualEnquiryCount)))));
137
- }
138
-
139
- export { EnquiriesDoughnutChart as default };