@tenancy.nz/feature-ui 1.0.1 → 1.0.7

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