@tenancy.nz/feature-ui 1.0.1 → 1.0.2

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.
Files changed (39) hide show
  1. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.cjs +134 -0
  2. package/dist/cjs/components/AgentDetailsCard.cjs +80 -42
  3. package/dist/cjs/components/AnalyticsBox.cjs +46 -46
  4. package/dist/cjs/components/AnalyticsSection.cjs +148 -196
  5. package/dist/cjs/components/BookingChart.cjs +96 -94
  6. package/dist/cjs/components/BookingChart.styled.cjs +32 -86
  7. package/dist/cjs/components/BookingTable.cjs +39 -30
  8. package/dist/cjs/components/BookingTableRow.cjs +90 -46
  9. package/dist/cjs/components/BookingTableRow.styled.cjs +13 -34
  10. package/dist/cjs/components/BookingTableRowHeader.cjs +54 -15
  11. package/dist/cjs/components/BookingTableRowSkeleton.cjs +85 -18
  12. package/dist/cjs/components/CheckedIcon.cjs +11 -5
  13. package/dist/cjs/components/EnquiriesDoughnutChart.cjs +128 -151
  14. package/dist/cjs/components/GridList.cjs +59 -66
  15. package/dist/cjs/components/Hidden.cjs +4 -1
  16. package/dist/cjs/components/IconLabel.cjs +34 -26
  17. package/dist/cjs/components/NotesCard.cjs +48 -20
  18. package/dist/cjs/components/PropertyCard.cjs +130 -122
  19. package/dist/cjs/components/PropertyCard.styled.cjs +14 -66
  20. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +120 -0
  21. package/dist/esm/components/AgentDetailsCard.js +80 -42
  22. package/dist/esm/components/AnalyticsBox.js +46 -46
  23. package/dist/esm/components/AnalyticsSection.js +148 -196
  24. package/dist/esm/components/BookingChart.js +97 -95
  25. package/dist/esm/components/BookingChart.styled.js +32 -86
  26. package/dist/esm/components/BookingTable.js +39 -30
  27. package/dist/esm/components/BookingTableRow.js +90 -46
  28. package/dist/esm/components/BookingTableRow.styled.js +13 -34
  29. package/dist/esm/components/BookingTableRowHeader.js +54 -15
  30. package/dist/esm/components/BookingTableRowSkeleton.js +85 -18
  31. package/dist/esm/components/CheckedIcon.js +11 -5
  32. package/dist/esm/components/EnquiriesDoughnutChart.js +128 -151
  33. package/dist/esm/components/GridList.js +59 -66
  34. package/dist/esm/components/Hidden.js +4 -1
  35. package/dist/esm/components/IconLabel.js +34 -26
  36. package/dist/esm/components/NotesCard.js +48 -20
  37. package/dist/esm/components/PropertyCard.js +130 -122
  38. package/dist/esm/components/PropertyCard.styled.js +14 -66
  39. package/package.json +5 -5
@@ -3,207 +3,159 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var jsxRuntime = require('react/jsx-runtime');
7
- require('react');
6
+ var React = require('react');
8
7
  var ui = require('@tenancy.nz/ui');
9
8
  var AnalyticsBox = require('./AnalyticsBox.cjs');
10
9
  var EnquiriesDoughnutChart = require('./EnquiriesDoughnutChart.cjs');
11
10
 
12
- function AnalyticsSection({
13
- viewingsCount,
14
- bookingsCount,
15
- attendeesCount,
16
- cancellationsCount,
17
- applicationsCount,
18
- averageRent,
19
- textUsage,
20
- tradeMeEnquiriesCount,
21
- bookMeEnquiriesCount,
22
- manualEnquiryCount,
23
- agreementsCount,
24
- agreementsFinalisedCount,
25
- filterDaysCount
26
- }) {
27
- const isXlUp = ui.useMediaQuery((theme) => theme.breakpoints.up("xl"));
28
- return /* @__PURE__ */ jsxRuntime.jsxs(
29
- ui.Box,
30
- {
31
- display: "flex",
32
- align: "stretch",
33
- direction: { xs: "column-reverse", mlg: "row" },
34
- gap: "27px",
35
- children: [
36
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { width: "100%", maxWidth: { xs: "100%", mob: "340px", xl: "463px" }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Paper, { style: { width: "100%", position: "relative", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mt: "20px", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
37
- EnquiriesDoughnutChart.default,
38
- {
39
- tradeMeEnquiriesCount,
40
- bookMeEnquiriesCount,
41
- manualEnquiryCount
42
- }
43
- ) }) }) }),
44
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", direction: "row", width: "100%", gap: 6, children: [
45
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { flex: 3, children: [
46
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", gap: 6, children: [
47
- /* @__PURE__ */ jsxRuntime.jsx(
48
- AnalyticsBox.default,
49
- {
50
- label: "Viewings",
51
- amount: viewingsCount,
52
- width: "100%",
53
- height: isXlUp ? "157px" : "125px"
54
- }
55
- ),
56
- /* @__PURE__ */ jsxRuntime.jsx(
57
- AnalyticsBox.default,
58
- {
59
- label: "Bookings",
60
- amount: bookingsCount,
61
- width: "100%",
62
- height: isXlUp ? "157px" : "125px"
63
- }
64
- ),
65
- /* @__PURE__ */ jsxRuntime.jsx(
66
- AnalyticsBox.default,
67
- {
68
- label: "Attendees",
69
- amount: attendeesCount,
70
- width: "100%",
71
- border: "3px solid #6FD3C0",
72
- height: isXlUp ? "157px" : "125px"
73
- }
74
- )
75
- ] }),
76
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", width: "100%", gap: 6, mt: 6, children: [
77
- /* @__PURE__ */ jsxRuntime.jsx(
78
- AnalyticsBox.default,
79
- {
80
- label: "Converted Properties",
81
- amount: agreementsCount,
82
- width: "100%",
83
- height: isXlUp ? "157px" : "125px",
84
- text: /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { as: "span", maxWidth: "276px", children: [
85
- "Properties that have had a viewing in the last",
86
- " ",
87
- /* @__PURE__ */ jsxRuntime.jsx(
88
- ui.Text,
89
- {
90
- as: "span",
91
- display: "inline",
92
- weight: "700",
93
- fontSize: "inherit",
94
- children: filterDaysCount
95
- }
96
- ),
97
- " ",
98
- "days where an agreement has been",
99
- " ",
100
- /* @__PURE__ */ jsxRuntime.jsx(
101
- ui.Text,
102
- {
103
- as: "span",
104
- display: "inline",
105
- weight: "700",
106
- fontSize: "inherit",
107
- children: "created"
108
- }
109
- )
110
- ] })
111
- }
112
- ),
113
- /* @__PURE__ */ jsxRuntime.jsx(
114
- AnalyticsBox.default,
115
- {
116
- label: "Converted Properties",
117
- amount: agreementsFinalisedCount,
118
- width: "100%",
119
- height: isXlUp ? "157px" : "125px",
120
- text: /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { as: "span", maxWidth: "276px", children: [
121
- "Properties that have had a viewing in the last",
122
- " ",
123
- /* @__PURE__ */ jsxRuntime.jsx(
124
- ui.Text,
125
- {
126
- as: "span",
127
- display: "inline",
128
- weight: "700",
129
- fontSize: "inherit",
130
- children: filterDaysCount
131
- }
132
- ),
133
- " ",
134
- "days where an agreement has been",
135
- " ",
136
- /* @__PURE__ */ jsxRuntime.jsx(
137
- ui.Text,
138
- {
139
- as: "span",
140
- display: "inline",
141
- weight: "700",
142
- fontSize: "inherit",
143
- children: "finalised"
144
- }
145
- )
146
- ] })
147
- }
148
- )
149
- ] })
150
- ] }),
151
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { flex: 2, children: [
152
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", gap: 6, children: [
153
- /* @__PURE__ */ jsxRuntime.jsx(
154
- AnalyticsBox.default,
155
- {
156
- label: "Cancellations",
157
- amount: cancellationsCount,
158
- width: "100%",
159
- border: "3px solid #ED0D8D",
160
- height: isXlUp ? "157px" : "125px"
161
- }
162
- ),
163
- /* @__PURE__ */ jsxRuntime.jsx(
164
- AnalyticsBox.default,
165
- {
166
- label: "Applications",
167
- amount: applicationsCount,
168
- width: "100%",
169
- border: "3px solid #F5C440",
170
- height: isXlUp ? "157px" : "125px"
171
- }
172
- )
173
- ] }),
174
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", gap: 6, mt: 6, children: [
175
- /* @__PURE__ */ jsxRuntime.jsx(
176
- AnalyticsBox.default,
177
- {
178
- label: /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
179
- "Average",
180
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
181
- " Rent"
182
- ] }),
183
- amount: averageRent,
184
- width: "100%",
185
- height: isXlUp ? "157px" : "125px"
186
- }
187
- ),
188
- /* @__PURE__ */ jsxRuntime.jsx(
189
- AnalyticsBox.default,
190
- {
191
- label: /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
192
- "Text Usage",
193
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
194
- " Total"
195
- ] }),
196
- amount: textUsage,
197
- width: "100%",
198
- height: isXlUp ? "157px" : "125px"
199
- }
200
- )
201
- ] })
202
- ] })
203
- ] }) })
204
- ]
11
+ function AnalyticsSection(_ref) {
12
+ var viewingsCount = _ref.viewingsCount,
13
+ bookingsCount = _ref.bookingsCount,
14
+ attendeesCount = _ref.attendeesCount,
15
+ cancellationsCount = _ref.cancellationsCount,
16
+ applicationsCount = _ref.applicationsCount,
17
+ averageRent = _ref.averageRent,
18
+ textUsage = _ref.textUsage,
19
+ tradeMeEnquiriesCount = _ref.tradeMeEnquiriesCount,
20
+ bookMeEnquiriesCount = _ref.bookMeEnquiriesCount,
21
+ manualEnquiryCount = _ref.manualEnquiryCount,
22
+ agreementsCount = _ref.agreementsCount,
23
+ agreementsFinalisedCount = _ref.agreementsFinalisedCount,
24
+ filterDaysCount = _ref.filterDaysCount;
25
+ var isXlUp = ui.useMediaQuery(function (theme) {
26
+ return theme.breakpoints.up("xl");
27
+ });
28
+ return /* @__PURE__ */React.createElement(ui.Box, {
29
+ display: "flex",
30
+ align: "stretch",
31
+ direction: {
32
+ xs: "column-reverse",
33
+ mlg: "row"
34
+ },
35
+ gap: "27px"
36
+ }, /* @__PURE__ */React.createElement(ui.Box, {
37
+ width: "100%",
38
+ maxWidth: {
39
+ xs: "100%",
40
+ mob: "340px",
41
+ xl: "463px"
205
42
  }
206
- );
43
+ }, /* @__PURE__ */React.createElement(ui.Paper, {
44
+ style: {
45
+ width: "100%",
46
+ position: "relative",
47
+ height: "100%"
48
+ }
49
+ }, /* @__PURE__ */React.createElement(ui.Box, {
50
+ mt: "20px",
51
+ height: "100%"
52
+ }, /* @__PURE__ */React.createElement(EnquiriesDoughnutChart.default, {
53
+ tradeMeEnquiriesCount: tradeMeEnquiriesCount,
54
+ bookMeEnquiriesCount: bookMeEnquiriesCount,
55
+ manualEnquiryCount: manualEnquiryCount
56
+ })))), /* @__PURE__ */React.createElement(ui.Box, {
57
+ width: "100%"
58
+ }, /* @__PURE__ */React.createElement(ui.Box, {
59
+ display: "flex",
60
+ direction: "row",
61
+ width: "100%",
62
+ gap: 6
63
+ }, /* @__PURE__ */React.createElement(ui.Box, {
64
+ flex: 3
65
+ }, /* @__PURE__ */React.createElement(ui.Box, {
66
+ display: "flex",
67
+ gap: 6
68
+ }, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
69
+ label: "Viewings",
70
+ amount: viewingsCount,
71
+ width: "100%",
72
+ height: isXlUp ? "157px" : "125px"
73
+ }), /* @__PURE__ */React.createElement(AnalyticsBox.default, {
74
+ label: "Bookings",
75
+ amount: bookingsCount,
76
+ width: "100%",
77
+ height: isXlUp ? "157px" : "125px"
78
+ }), /* @__PURE__ */React.createElement(AnalyticsBox.default, {
79
+ label: "Attendees",
80
+ amount: attendeesCount,
81
+ width: "100%",
82
+ border: "3px solid #6FD3C0",
83
+ height: isXlUp ? "157px" : "125px"
84
+ })), /* @__PURE__ */React.createElement(ui.Box, {
85
+ display: "flex",
86
+ width: "100%",
87
+ gap: 6,
88
+ mt: 6
89
+ }, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
90
+ label: "Converted Properties",
91
+ amount: agreementsCount,
92
+ width: "100%",
93
+ height: isXlUp ? "157px" : "125px",
94
+ text: /* @__PURE__ */React.createElement(ui.Box, {
95
+ as: "span",
96
+ maxWidth: "276px"
97
+ }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement(ui.Text, {
98
+ as: "span",
99
+ display: "inline",
100
+ weight: "700",
101
+ fontSize: "inherit"
102
+ }, filterDaysCount), " ", "days where an agreement has been", " ", /* @__PURE__ */React.createElement(ui.Text, {
103
+ as: "span",
104
+ display: "inline",
105
+ weight: "700",
106
+ fontSize: "inherit"
107
+ }, "created"))
108
+ }), /* @__PURE__ */React.createElement(AnalyticsBox.default, {
109
+ label: "Converted Properties",
110
+ amount: agreementsFinalisedCount,
111
+ width: "100%",
112
+ height: isXlUp ? "157px" : "125px",
113
+ text: /* @__PURE__ */React.createElement(ui.Box, {
114
+ as: "span",
115
+ maxWidth: "276px"
116
+ }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement(ui.Text, {
117
+ as: "span",
118
+ display: "inline",
119
+ weight: "700",
120
+ fontSize: "inherit"
121
+ }, filterDaysCount), " ", "days where an agreement has been", " ", /* @__PURE__ */React.createElement(ui.Text, {
122
+ as: "span",
123
+ display: "inline",
124
+ weight: "700",
125
+ fontSize: "inherit"
126
+ }, "finalised"))
127
+ }))), /* @__PURE__ */React.createElement(ui.Box, {
128
+ flex: 2
129
+ }, /* @__PURE__ */React.createElement(ui.Box, {
130
+ display: "flex",
131
+ gap: 6
132
+ }, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
133
+ label: "Cancellations",
134
+ amount: cancellationsCount,
135
+ width: "100%",
136
+ border: "3px solid #ED0D8D",
137
+ height: isXlUp ? "157px" : "125px"
138
+ }), /* @__PURE__ */React.createElement(AnalyticsBox.default, {
139
+ label: "Applications",
140
+ amount: applicationsCount,
141
+ width: "100%",
142
+ border: "3px solid #F5C440",
143
+ height: isXlUp ? "157px" : "125px"
144
+ })), /* @__PURE__ */React.createElement(ui.Box, {
145
+ display: "flex",
146
+ gap: 6,
147
+ mt: 6
148
+ }, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
149
+ label: /* @__PURE__ */React.createElement("span", null, "Average", /* @__PURE__ */React.createElement("br", null), " Rent"),
150
+ amount: averageRent,
151
+ width: "100%",
152
+ height: isXlUp ? "157px" : "125px"
153
+ }), /* @__PURE__ */React.createElement(AnalyticsBox.default, {
154
+ label: /* @__PURE__ */React.createElement("span", null, "Text Usage", /* @__PURE__ */React.createElement("br", null), " Total"),
155
+ amount: textUsage,
156
+ width: "100%",
157
+ height: isXlUp ? "157px" : "125px"
158
+ }))))));
207
159
  }
208
160
 
209
161
  exports.default = AnalyticsSection;
@@ -3,13 +3,13 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var jsxRuntime = require('react/jsx-runtime');
6
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
7
7
  var React = require('react');
8
8
  var ui = require('@tenancy.nz/ui');
9
9
  var chart = require('primereact/chart');
10
10
  var BookingChart_styled = require('./BookingChart.styled.cjs');
11
11
 
12
- const defaultOptions = {
12
+ var defaultOptions = {
13
13
  scaleFontColor: "black",
14
14
  legend: {
15
15
  display: false
@@ -22,103 +22,105 @@ const defaultOptions = {
22
22
  size: 12,
23
23
  family: "Montserrat, sans-serif"
24
24
  },
25
- display: (ctx) => ctx.dataset.data[ctx.dataIndex] > 0
25
+ display: function display(ctx) {
26
+ return ctx.dataset.data[ctx.dataIndex] > 0;
27
+ }
26
28
  }
27
29
  },
28
30
  scales: {
29
- xAxes: [
30
- {
31
- gridLines: {
32
- labelString: "Date",
33
- display: false
34
- },
35
- ticks: {
36
- fontSize: 13,
37
- family: "Montserrat, sans-serif",
38
- fontWeight: "bold"
39
- },
40
- stacked: true
41
- }
42
- ],
43
- yAxes: [
44
- {
45
- scaleLabel: {
46
- display: true,
47
- labelString: "Total bookings",
48
- fontFamily: "Montserrat, sans-serif",
49
- fontSize: 13,
50
- fontStyle: "600"
51
- },
52
- ticks: {
53
- min: 0,
54
- stepSize: 5,
55
- fontSize: 13,
56
- fontWeight: 500
57
- },
58
- gridLines: {
59
- display: false
60
- },
61
- stacked: true
62
- }
63
- ]
31
+ xAxes: [{
32
+ gridLines: {
33
+ labelString: "Date",
34
+ display: false
35
+ },
36
+ ticks: {
37
+ fontSize: 13,
38
+ family: "Montserrat, sans-serif",
39
+ fontWeight: "bold"
40
+ },
41
+ stacked: true
42
+ }],
43
+ yAxes: [{
44
+ scaleLabel: {
45
+ display: true,
46
+ labelString: "Total bookings",
47
+ fontFamily: "Montserrat, sans-serif",
48
+ fontSize: 13,
49
+ fontStyle: "600"
50
+ },
51
+ ticks: {
52
+ min: 0,
53
+ stepSize: 5,
54
+ fontSize: 13,
55
+ fontWeight: 500
56
+ },
57
+ gridLines: {
58
+ display: false
59
+ },
60
+ stacked: true
61
+ }]
64
62
  }
65
63
  };
66
- function BookingChart({
67
- data,
68
- labels,
69
- mode = "day",
70
- options = {},
71
- onModeChange = void 0
72
- }) {
73
- const legends = React.useMemo(
74
- () => data.map(({ label, backgroundColor }) => [label, backgroundColor]).filter(
75
- ([label], i, items) => items.findIndex(([l]) => l === label) === i
76
- ),
77
- [data]
78
- );
79
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { display: "flex", direction: "column", gap: "16px", width: "100%", children: [
80
- legends.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(BookingChart_styled.StyledBookingChartStack, { children: legends.map(([label, backgroundColor]) => /* @__PURE__ */ jsxRuntime.jsx(BookingChart_styled.StyledBookingChartLegend, { color: backgroundColor, children: label }, label)) }),
81
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { width: "100%", overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
82
- chart.Chart,
83
- {
84
- type: "bar",
85
- data: {
86
- labels,
87
- datasets: data
88
- },
89
- options: { ...defaultOptions, ...options }
90
- }
91
- ) }),
92
- onModeChange && /* @__PURE__ */ jsxRuntime.jsxs(BookingChart_styled.StyledBookingChartStack, { children: [
93
- /* @__PURE__ */ jsxRuntime.jsx(
94
- BookingChart_styled.StyledBookingChartButton,
95
- {
96
- onClick: onModeChange,
97
- active: mode === "day",
98
- value: "day",
99
- children: "Day"
100
- }
101
- ),
102
- /* @__PURE__ */ jsxRuntime.jsx(
103
- BookingChart_styled.StyledBookingChartButton,
104
- {
105
- onClick: onModeChange,
106
- active: mode === "week",
107
- value: "week",
108
- children: "Week"
109
- }
110
- ),
111
- /* @__PURE__ */ jsxRuntime.jsx(
112
- BookingChart_styled.StyledBookingChartButton,
113
- {
114
- onClick: onModeChange,
115
- active: mode === "month",
116
- value: "month",
117
- children: "Month"
118
- }
119
- )
120
- ] })
121
- ] });
64
+ function BookingChart(_ref) {
65
+ var data = _ref.data,
66
+ labels = _ref.labels,
67
+ _ref$mode = _ref.mode,
68
+ mode = _ref$mode === void 0 ? "day" : _ref$mode,
69
+ _ref$options = _ref.options,
70
+ options = _ref$options === void 0 ? {} : _ref$options,
71
+ _ref$onModeChange = _ref.onModeChange,
72
+ onModeChange = _ref$onModeChange === void 0 ? void 0 : _ref$onModeChange;
73
+ var legends = React.useMemo(function () {
74
+ return data.map(function (_ref2) {
75
+ var label = _ref2.label,
76
+ backgroundColor = _ref2.backgroundColor;
77
+ return [label, backgroundColor];
78
+ }).filter(function (_ref3, i, items) {
79
+ var _ref4 = _rollupPluginBabelHelpers.slicedToArray(_ref3, 1),
80
+ label = _ref4[0];
81
+ return items.findIndex(function (_ref5) {
82
+ var _ref6 = _rollupPluginBabelHelpers.slicedToArray(_ref5, 1),
83
+ l = _ref6[0];
84
+ return l === label;
85
+ }) === i;
86
+ });
87
+ }, [data]);
88
+ return /* @__PURE__ */React.createElement(ui.Box, {
89
+ display: "flex",
90
+ direction: "column",
91
+ gap: "16px",
92
+ width: "100%"
93
+ }, legends.length > 0 && /* @__PURE__ */React.createElement(BookingChart_styled.StyledBookingChartStack, null, legends.map(function (_ref7) {
94
+ var _ref8 = _rollupPluginBabelHelpers.slicedToArray(_ref7, 2),
95
+ label = _ref8[0],
96
+ backgroundColor = _ref8[1];
97
+ return /* @__PURE__ */React.createElement(BookingChart_styled.StyledBookingChartLegend, {
98
+ key: label,
99
+ color: backgroundColor
100
+ }, label);
101
+ })), /* @__PURE__ */React.createElement(ui.Box, {
102
+ width: "100%",
103
+ overflow: "hidden"
104
+ }, /* @__PURE__ */React.createElement(chart.Chart, {
105
+ type: "bar",
106
+ data: {
107
+ labels: labels,
108
+ datasets: data
109
+ },
110
+ options: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, defaultOptions), options)
111
+ })), onModeChange && /* @__PURE__ */React.createElement(BookingChart_styled.StyledBookingChartStack, null, /* @__PURE__ */React.createElement(BookingChart_styled.StyledBookingChartButton, {
112
+ onClick: onModeChange,
113
+ active: mode === "day",
114
+ value: "day"
115
+ }, "Day"), /* @__PURE__ */React.createElement(BookingChart_styled.StyledBookingChartButton, {
116
+ onClick: onModeChange,
117
+ active: mode === "week",
118
+ value: "week"
119
+ }, "Week"), /* @__PURE__ */React.createElement(BookingChart_styled.StyledBookingChartButton, {
120
+ onClick: onModeChange,
121
+ active: mode === "month",
122
+ value: "month"
123
+ }, "Month")));
122
124
  }
123
125
 
124
126
  exports.default = BookingChart;