@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,15 +3,21 @@
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 icons = require('@tenancy.nz/icons');
9
8
 
10
- function CheckedIcon({ value }) {
9
+ function CheckedIcon(_ref) {
10
+ var value = _ref.value;
11
11
  if (value === true) {
12
- return /* @__PURE__ */ jsxRuntime.jsx(icons.CircleCheckIcon, { color: "success.main", size: "20px" });
12
+ return /* @__PURE__ */React.createElement(icons.CircleCheckIcon, {
13
+ color: "success.main",
14
+ size: "20px"
15
+ });
13
16
  }
14
- return /* @__PURE__ */ jsxRuntime.jsx(icons.CircleTimesIcon, { color: "error.main", size: "20px" });
17
+ return /* @__PURE__ */React.createElement(icons.CircleTimesIcon, {
18
+ color: "error.main",
19
+ size: "20px"
20
+ });
15
21
  }
16
22
 
17
23
  exports.default = CheckedIcon;
@@ -3,165 +3,142 @@
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 chart = require('primereact/chart');
10
9
 
11
- function EnquiriesDoughnutChart({
12
- tradeMeEnquiriesCount = 0,
13
- bookMeEnquiriesCount = 0,
14
- manualEnquiryCount = 0
15
- }) {
16
- const colors = {
10
+ function EnquiriesDoughnutChart(_ref) {
11
+ var _ref$tradeMeEnquiries = _ref.tradeMeEnquiriesCount,
12
+ tradeMeEnquiriesCount = _ref$tradeMeEnquiries === void 0 ? 0 : _ref$tradeMeEnquiries,
13
+ _ref$bookMeEnquiriesC = _ref.bookMeEnquiriesCount,
14
+ bookMeEnquiriesCount = _ref$bookMeEnquiriesC === void 0 ? 0 : _ref$bookMeEnquiriesC,
15
+ _ref$manualEnquiryCou = _ref.manualEnquiryCount,
16
+ manualEnquiryCount = _ref$manualEnquiryCou === void 0 ? 0 : _ref$manualEnquiryCou;
17
+ var colors = {
17
18
  tradeMe: "#6FD3C0",
18
19
  bookMe: "#00C0F3",
19
20
  manual: "#394869"
20
21
  };
21
- const chartColors = [colors.tradeMe, colors.bookMe, colors.manual];
22
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { position: "relative", display: "flex", height: "100%", align: "center", children: [
23
- /* @__PURE__ */ jsxRuntime.jsx(
24
- ui.Text,
25
- {
26
- transform: "uppercase",
27
- sx: { position: "absolute", left: 20, top: -10 },
28
- fontSize: 13,
29
- color: "textPrimary",
30
- weight: "700",
31
- children: "Number of enquiries"
22
+ var chartColors = [colors.tradeMe, colors.bookMe, colors.manual];
23
+ return /* @__PURE__ */React.createElement(ui.Box, {
24
+ position: "relative",
25
+ display: "flex",
26
+ height: "100%",
27
+ align: "center"
28
+ }, /* @__PURE__ */React.createElement(ui.Text, {
29
+ transform: "uppercase",
30
+ sx: {
31
+ position: "absolute",
32
+ left: 20,
33
+ top: -10
34
+ },
35
+ fontSize: 13,
36
+ color: "textPrimary",
37
+ weight: "700"
38
+ }, "Number of enquiries"), /* @__PURE__ */React.createElement(ui.Box, {
39
+ width: "100%",
40
+ overflow: "hidden"
41
+ }, /* @__PURE__ */React.createElement(chart.Chart, {
42
+ type: "doughnut",
43
+ data: {
44
+ labels: ["TradeMe", "BookMe", "Manual"],
45
+ datasets: [{
46
+ data: [Math.max(tradeMeEnquiriesCount, 1e-3), Math.max(bookMeEnquiriesCount, 1e-3), Math.max(manualEnquiryCount, 1e-3)],
47
+ backgroundColor: chartColors,
48
+ hoverBackgroundColor: chartColors
49
+ }]
50
+ },
51
+ options: {
52
+ legend: {
53
+ display: false
54
+ },
55
+ animation: {
56
+ duration: 0
32
57
  }
33
- ),
34
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { width: "100%", overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
35
- chart.Chart,
36
- {
37
- type: "doughnut",
38
- data: {
39
- labels: ["TradeMe", "BookMe", "Manual"],
40
- datasets: [
41
- {
42
- data: [
43
- Math.max(tradeMeEnquiriesCount, 1e-3),
44
- Math.max(bookMeEnquiriesCount, 1e-3),
45
- Math.max(manualEnquiryCount, 1e-3)
46
- ],
47
- backgroundColor: chartColors,
48
- hoverBackgroundColor: chartColors
49
- }
50
- ]
51
- },
52
- options: {
53
- legend: {
54
- display: false
55
- },
56
- animation: {
57
- duration: 0
58
- }
59
- },
60
- style: {
61
- width: "100%",
62
- position: "absolute",
63
- top: "18%",
64
- left: "-75px"
65
- }
66
- }
67
- ) }),
68
- /* @__PURE__ */ jsxRuntime.jsxs(
69
- ui.Box,
70
- {
71
- maxWidth: { xs: "160px", xl: "180px" },
72
- width: "100%",
73
- padding: "10px 20px",
74
- mt: -4,
75
- children: [
76
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { width: "100%", children: [
77
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { height: "10px", backgroundColor: colors.tradeMe, width: "100%" }),
78
- /* @__PURE__ */ jsxRuntime.jsxs(
79
- ui.Box,
80
- {
81
- display: "flex",
82
- justify: "space-between",
83
- width: "100%",
84
- align: "flex-start",
85
- mt: 2,
86
- children: [
87
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { transform: "uppercase", fontSize: 12, weight: "600", children: "TradeMe" }),
88
- /* @__PURE__ */ jsxRuntime.jsx(
89
- ui.Text,
90
- {
91
- transform: "uppercase",
92
- fontSize: 32,
93
- weight: "700",
94
- mt: -3,
95
- color: "textPrimary",
96
- children: tradeMeEnquiriesCount
97
- }
98
- )
99
- ]
100
- }
101
- )
102
- ] }),
103
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { width: "100%", mt: "30px", children: [
104
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { height: "10px", backgroundColor: colors.bookMe, width: "100%" }),
105
- /* @__PURE__ */ jsxRuntime.jsxs(
106
- ui.Box,
107
- {
108
- display: "flex",
109
- justify: "space-between",
110
- width: "100%",
111
- align: "flex-start",
112
- mt: 2,
113
- children: [
114
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { transform: "uppercase", fontSize: 12, weight: "600", children: "Bookme" }),
115
- /* @__PURE__ */ jsxRuntime.jsx(
116
- ui.Text,
117
- {
118
- transform: "uppercase",
119
- fontSize: 32,
120
- weight: "700",
121
- mt: -3,
122
- color: "textPrimary",
123
- children: bookMeEnquiriesCount
124
- }
125
- )
126
- ]
127
- }
128
- )
129
- ] }),
130
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { width: "100%", mt: "30px", children: [
131
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { height: "10px", backgroundColor: colors.manual, width: "100%" }),
132
- /* @__PURE__ */ jsxRuntime.jsxs(
133
- ui.Box,
134
- {
135
- display: "flex",
136
- justify: "space-between",
137
- width: "100%",
138
- align: "flex-start",
139
- mt: 2,
140
- children: [
141
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Text, { transform: "uppercase", fontSize: 12, weight: "600", children: [
142
- "Manually",
143
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
144
- "Generated"
145
- ] }),
146
- /* @__PURE__ */ jsxRuntime.jsx(
147
- ui.Text,
148
- {
149
- transform: "uppercase",
150
- fontSize: 32,
151
- weight: "700",
152
- color: "textPrimary",
153
- mt: -3,
154
- children: manualEnquiryCount
155
- }
156
- )
157
- ]
158
- }
159
- )
160
- ] })
161
- ]
162
- }
163
- )
164
- ] });
58
+ },
59
+ style: {
60
+ width: "100%",
61
+ position: "absolute",
62
+ top: "18%",
63
+ left: "-75px"
64
+ }
65
+ })), /* @__PURE__ */React.createElement(ui.Box, {
66
+ maxWidth: {
67
+ xs: "160px",
68
+ xl: "180px"
69
+ },
70
+ width: "100%",
71
+ padding: "10px 20px",
72
+ mt: -4
73
+ }, /* @__PURE__ */React.createElement(ui.Box, {
74
+ width: "100%"
75
+ }, /* @__PURE__ */React.createElement(ui.Box, {
76
+ height: "10px",
77
+ backgroundColor: colors.tradeMe,
78
+ width: "100%"
79
+ }), /* @__PURE__ */React.createElement(ui.Box, {
80
+ display: "flex",
81
+ justify: "space-between",
82
+ width: "100%",
83
+ align: "flex-start",
84
+ mt: 2
85
+ }, /* @__PURE__ */React.createElement(ui.Text, {
86
+ transform: "uppercase",
87
+ fontSize: 12,
88
+ weight: "600"
89
+ }, "TradeMe"), /* @__PURE__ */React.createElement(ui.Text, {
90
+ transform: "uppercase",
91
+ fontSize: 32,
92
+ weight: "700",
93
+ mt: -3,
94
+ color: "textPrimary"
95
+ }, tradeMeEnquiriesCount))), /* @__PURE__ */React.createElement(ui.Box, {
96
+ width: "100%",
97
+ mt: "30px"
98
+ }, /* @__PURE__ */React.createElement(ui.Box, {
99
+ height: "10px",
100
+ backgroundColor: colors.bookMe,
101
+ width: "100%"
102
+ }), /* @__PURE__ */React.createElement(ui.Box, {
103
+ display: "flex",
104
+ justify: "space-between",
105
+ width: "100%",
106
+ align: "flex-start",
107
+ mt: 2
108
+ }, /* @__PURE__ */React.createElement(ui.Text, {
109
+ transform: "uppercase",
110
+ fontSize: 12,
111
+ weight: "600"
112
+ }, "Bookme"), /* @__PURE__ */React.createElement(ui.Text, {
113
+ transform: "uppercase",
114
+ fontSize: 32,
115
+ weight: "700",
116
+ mt: -3,
117
+ color: "textPrimary"
118
+ }, bookMeEnquiriesCount))), /* @__PURE__ */React.createElement(ui.Box, {
119
+ width: "100%",
120
+ mt: "30px"
121
+ }, /* @__PURE__ */React.createElement(ui.Box, {
122
+ height: "10px",
123
+ backgroundColor: colors.manual,
124
+ width: "100%"
125
+ }), /* @__PURE__ */React.createElement(ui.Box, {
126
+ display: "flex",
127
+ justify: "space-between",
128
+ width: "100%",
129
+ align: "flex-start",
130
+ mt: 2
131
+ }, /* @__PURE__ */React.createElement(ui.Text, {
132
+ transform: "uppercase",
133
+ fontSize: 12,
134
+ weight: "600"
135
+ }, "Manually", /* @__PURE__ */React.createElement("br", null), "Generated"), /* @__PURE__ */React.createElement(ui.Text, {
136
+ transform: "uppercase",
137
+ fontSize: 32,
138
+ weight: "700",
139
+ color: "textPrimary",
140
+ mt: -3
141
+ }, manualEnquiryCount)))));
165
142
  }
166
143
 
167
144
  exports.default = EnquiriesDoughnutChart;
@@ -3,85 +3,78 @@
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 Hidden = require('./Hidden.cjs');
10
10
 
11
- function GridList({
12
- items,
13
- children,
14
- renderItem,
15
- headerComponent,
16
- footerComponent,
17
- spacing,
18
- loading,
19
- loadingComponent,
20
- emptyComponent,
21
- currentPage,
22
- totalPages,
23
- onChangePage,
24
- showHeaderComponent,
25
- resultsPerPage,
26
- onChangeResultsPerPage,
27
- perPage,
28
- scrollTopOnChangePage,
29
- ...rest
30
- }) {
31
- const gridContainerRef = React.useRef(null);
32
- const childLen = React.Children.count(children);
33
- const isChildren = childLen > 0;
34
- let listLength = 0;
11
+ var _excluded = ["items", "children", "renderItem", "headerComponent", "footerComponent", "spacing", "loading", "loadingComponent", "emptyComponent", "currentPage", "totalPages", "onChangePage", "showHeaderComponent", "resultsPerPage", "onChangeResultsPerPage", "perPage", "scrollTopOnChangePage"];
12
+ function GridList(_ref) {
13
+ var items = _ref.items,
14
+ children = _ref.children,
15
+ renderItem = _ref.renderItem,
16
+ headerComponent = _ref.headerComponent,
17
+ footerComponent = _ref.footerComponent,
18
+ spacing = _ref.spacing,
19
+ loading = _ref.loading,
20
+ loadingComponent = _ref.loadingComponent,
21
+ emptyComponent = _ref.emptyComponent,
22
+ currentPage = _ref.currentPage,
23
+ totalPages = _ref.totalPages,
24
+ onChangePage = _ref.onChangePage,
25
+ showHeaderComponent = _ref.showHeaderComponent,
26
+ resultsPerPage = _ref.resultsPerPage,
27
+ onChangeResultsPerPage = _ref.onChangeResultsPerPage,
28
+ perPage = _ref.perPage,
29
+ scrollTopOnChangePage = _ref.scrollTopOnChangePage,
30
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
31
+ var gridContainerRef = React.useRef(null);
32
+ var childLen = React.Children.count(children);
33
+ var isChildren = childLen > 0;
34
+ var listLength = 0;
35
35
  if (!isChildren) {
36
36
  listLength = Array.isArray(items) ? items.length : 0;
37
37
  } else {
38
38
  listLength = childLen;
39
39
  }
40
- const isEmpty = listLength === 0;
41
- React.useEffect(() => {
40
+ var isEmpty = listLength === 0;
41
+ React.useEffect(function () {
42
42
  if (scrollTopOnChangePage && currentPage > 1 && !loading && gridContainerRef && gridContainerRef.current) {
43
43
  gridContainerRef.current.scrollIntoView();
44
44
  }
45
45
  }, [currentPage, loading, gridContainerRef, scrollTopOnChangePage]);
46
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
47
- showHeaderComponent && headerComponent,
48
- loading && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingComponent }),
49
- !loading && isEmpty && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: emptyComponent }),
50
- !loading && !isEmpty && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: gridContainerRef, style: { width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Grid, { container: true, ...rest, spacing, children: isChildren ? children : items.map(renderItem) }) }),
51
- typeof onChangePage === "function" && /* @__PURE__ */ jsxRuntime.jsx(Hidden.default, { hide: isEmpty, children: /* @__PURE__ */ jsxRuntime.jsxs(
52
- ui.Box,
53
- {
54
- display: "flex",
55
- justify: "center",
56
- align: "center",
57
- direction: "column",
58
- marginTop: 12,
59
- children: [
60
- /* @__PURE__ */ jsxRuntime.jsx(
61
- ui.Pagination,
62
- {
63
- page: currentPage,
64
- count: totalPages,
65
- color: "textPrimary",
66
- shape: "round",
67
- size: "large",
68
- onChange: onChangePage
69
- }
70
- ),
71
- typeof onChangeResultsPerPage === "function" && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mt: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
72
- ui.Select,
73
- {
74
- name: "gridListSelect",
75
- value: perPage,
76
- options: resultsPerPage,
77
- onChange: onChangeResultsPerPage
78
- }
79
- ) })
80
- ]
81
- }
82
- ) }),
83
- footerComponent
84
- ] });
46
+ return /* @__PURE__ */React.createElement(React.Fragment, null, showHeaderComponent && headerComponent, loading && /* @__PURE__ */React.createElement(React.Fragment, null, loadingComponent), !loading && isEmpty && /* @__PURE__ */React.createElement(React.Fragment, null, emptyComponent), !loading && !isEmpty && /* @__PURE__ */React.createElement("div", {
47
+ ref: gridContainerRef,
48
+ style: {
49
+ width: "100%"
50
+ }
51
+ }, /* @__PURE__ */React.createElement(ui.Grid, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
52
+ container: true
53
+ }, rest), {}, {
54
+ spacing: spacing
55
+ }), isChildren ? children : items.map(renderItem))), typeof onChangePage === "function" && /* @__PURE__ */React.createElement(Hidden.default, {
56
+ hide: isEmpty
57
+ }, /* @__PURE__ */React.createElement(ui.Box, {
58
+ display: "flex",
59
+ justify: "center",
60
+ align: "center",
61
+ direction: "column",
62
+ marginTop: 12
63
+ }, /* @__PURE__ */React.createElement(ui.Pagination, {
64
+ page: currentPage,
65
+ count: totalPages,
66
+ color: "textPrimary",
67
+ shape: "round",
68
+ size: "large",
69
+ onChange: onChangePage
70
+ }), typeof onChangeResultsPerPage === "function" && /* @__PURE__ */React.createElement(ui.Box, {
71
+ mt: 4
72
+ }, /* @__PURE__ */React.createElement(ui.Select, {
73
+ name: "gridListSelect",
74
+ value: perPage,
75
+ options: resultsPerPage,
76
+ onChange: onChangeResultsPerPage
77
+ })))), footerComponent);
85
78
  }
86
79
 
87
80
  exports.default = GridList;
@@ -5,7 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  require('react');
7
7
 
8
- function Hidden({ hide = false, children }) {
8
+ function Hidden(_ref) {
9
+ var _ref$hide = _ref.hide,
10
+ hide = _ref$hide === void 0 ? false : _ref$hide,
11
+ children = _ref.children;
9
12
  if (hide) {
10
13
  return null;
11
14
  }
@@ -3,34 +3,42 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var jsxRuntime = require('react/jsx-runtime');
7
- require('react');
6
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
7
+ var React = require('react');
8
8
  var ui = require('@tenancy.nz/ui');
9
9
 
10
- function IconLabel({
11
- children,
12
- endIcon = void 0,
13
- startIcon = void 0,
14
- onClick = void 0,
15
- ...rest
16
- }) {
17
- const iconLabel = /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { align: "center", display: "inline-flex", ...rest, children: [
18
- startIcon && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { display: "inline-flex", color: "inherit", fontSize: "inherit", children: startIcon }),
19
- children && /* @__PURE__ */ jsxRuntime.jsx(
20
- ui.Box,
21
- {
22
- display: "inline-flex",
23
- color: "inherit",
24
- fontSize: "inherit",
25
- marginLeft: startIcon ? 1 : 0,
26
- marginRight: endIcon ? 1 : 0,
27
- fontWeight: "inherit",
28
- children
29
- }
30
- ),
31
- endIcon && /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { display: "inline-flex", color: "text.muted", marginLeft: 1, children: endIcon })
32
- ] });
33
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: typeof onClick === "function" ? /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { onClick, children: iconLabel }) : iconLabel });
10
+ var _excluded = ["children", "endIcon", "startIcon", "onClick"];
11
+ function IconLabel(_ref) {
12
+ var children = _ref.children,
13
+ _ref$endIcon = _ref.endIcon,
14
+ endIcon = _ref$endIcon === void 0 ? void 0 : _ref$endIcon,
15
+ _ref$startIcon = _ref.startIcon,
16
+ startIcon = _ref$startIcon === void 0 ? void 0 : _ref$startIcon,
17
+ _ref$onClick = _ref.onClick,
18
+ onClick = _ref$onClick === void 0 ? void 0 : _ref$onClick,
19
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
20
+ var iconLabel = /* @__PURE__ */React.createElement(ui.Box, _rollupPluginBabelHelpers.objectSpread2({
21
+ align: "center",
22
+ display: "inline-flex"
23
+ }, rest), startIcon && /* @__PURE__ */React.createElement(ui.Box, {
24
+ display: "inline-flex",
25
+ color: "inherit",
26
+ fontSize: "inherit"
27
+ }, startIcon), children && /* @__PURE__ */React.createElement(ui.Box, {
28
+ display: "inline-flex",
29
+ color: "inherit",
30
+ fontSize: "inherit",
31
+ marginLeft: startIcon ? 1 : 0,
32
+ marginRight: endIcon ? 1 : 0,
33
+ fontWeight: "inherit"
34
+ }, children), endIcon && /* @__PURE__ */React.createElement(ui.Box, {
35
+ display: "inline-flex",
36
+ color: "text.muted",
37
+ marginLeft: 1
38
+ }, endIcon));
39
+ return /* @__PURE__ */React.createElement(React.Fragment, null, typeof onClick === "function" ? /* @__PURE__ */React.createElement(ui.Box, {
40
+ onClick: onClick
41
+ }, iconLabel) : iconLabel);
34
42
  }
35
43
 
36
44
  exports.default = IconLabel;
@@ -3,37 +3,65 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var jsxRuntime = require('react/jsx-runtime');
7
- require('react');
6
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
7
+ var React = require('react');
8
8
  var ui = require('@tenancy.nz/ui');
9
9
 
10
- const tagMap = (name) => {
10
+ var _excluded = ["loading", "tag", "text"];
11
+ var tagMap = function tagMap(name) {
11
12
  if (typeof name !== "string") {
12
13
  return name;
13
14
  }
14
15
  if (name === "feedback") {
15
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Tag, { color: "info", label: "Feedback" });
16
+ return /* @__PURE__ */React.createElement(ui.Tag, {
17
+ color: "info",
18
+ label: "Feedback"
19
+ });
16
20
  }
17
21
  if (name === "maintenance") {
18
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Tag, { color: "orange", label: "Maintenance" });
22
+ return /* @__PURE__ */React.createElement(ui.Tag, {
23
+ color: "orange",
24
+ label: "Maintenance"
25
+ });
19
26
  }
20
27
  return name;
21
28
  };
22
- function NotesCard({
23
- loading = false,
24
- tag = void 0,
25
- text = void 0,
26
- ...rest
27
- }) {
28
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Paper, { inset: "medium", sx: { minHeight: "100%" }, ...rest, children: [
29
- /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { mb: "8px", mt: loading ? "-5px" : "0px", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "114px", height: "30px", variant: "text" }) : tagMap(tag) }),
30
- loading && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
31
- /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "90%", height: "20px", variant: "text" }),
32
- /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "80%", height: "20px", variant: "text" }),
33
- /* @__PURE__ */ jsxRuntime.jsx(ui.Skeleton, { width: "70%", height: "20px", variant: "text" })
34
- ] }),
35
- !loading && /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { variant: "body2", weight: "400", children: text })
36
- ] });
29
+ function NotesCard(_ref) {
30
+ var _ref$loading = _ref.loading,
31
+ loading = _ref$loading === void 0 ? false : _ref$loading,
32
+ _ref$tag = _ref.tag,
33
+ tag = _ref$tag === void 0 ? void 0 : _ref$tag,
34
+ _ref$text = _ref.text,
35
+ text = _ref$text === void 0 ? void 0 : _ref$text,
36
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
37
+ return /* @__PURE__ */React.createElement(ui.Paper, _rollupPluginBabelHelpers.objectSpread2({
38
+ inset: "medium",
39
+ sx: {
40
+ minHeight: "100%"
41
+ }
42
+ }, rest), /* @__PURE__ */React.createElement(ui.Box, {
43
+ mb: "8px",
44
+ mt: loading ? "-5px" : "0px"
45
+ }, loading ? /* @__PURE__ */React.createElement(ui.Skeleton, {
46
+ width: "114px",
47
+ height: "30px",
48
+ variant: "text"
49
+ }) : tagMap(tag)), loading && /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(ui.Skeleton, {
50
+ width: "90%",
51
+ height: "20px",
52
+ variant: "text"
53
+ }), /* @__PURE__ */React.createElement(ui.Skeleton, {
54
+ width: "80%",
55
+ height: "20px",
56
+ variant: "text"
57
+ }), /* @__PURE__ */React.createElement(ui.Skeleton, {
58
+ width: "70%",
59
+ height: "20px",
60
+ variant: "text"
61
+ })), !loading && /* @__PURE__ */React.createElement(ui.Text, {
62
+ variant: "body2",
63
+ weight: "400"
64
+ }, text));
37
65
  }
38
66
 
39
67
  exports.default = NotesCard;