@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
@@ -1,133 +1,141 @@
1
1
  "use strict";
2
- import { jsxs, jsx } 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, Media, Box, Heading, Text } from '@tenancy.nz/ui';
5
5
  import { Icon } from '@tenancy.nz/icons';
6
6
  import IconLabel from './IconLabel.js';
7
7
  import { StyledPropertyImage, StyledPropertyDetailsBox, StyledPropertyAmenitiesBox } from './PropertyCard.styled.js';
8
8
 
9
- function PropertyCard({
10
- address = void 0,
11
- compact = false,
12
- enquiriesCount = void 0,
13
- imgSrc,
14
- noOfBedrooms = void 0,
15
- noOfBathrooms = void 0,
16
- noOfCarparks = void 0,
17
- rent = void 0,
18
- viewingsCount = void 0,
19
- ...rest
20
- }) {
21
- return /* @__PURE__ */ jsxs(
22
- Paper,
23
- {
24
- overflow: false,
25
- sx: {
26
- display: "flex",
27
- alignItems: "center"
9
+ var _excluded = ["address", "compact", "enquiriesCount", "imgSrc", "noOfBedrooms", "noOfBathrooms", "noOfCarparks", "rent", "viewingsCount"];
10
+ function PropertyCard(_ref) {
11
+ var _ref$address = _ref.address,
12
+ address = _ref$address === void 0 ? void 0 : _ref$address,
13
+ _ref$compact = _ref.compact,
14
+ compact = _ref$compact === void 0 ? false : _ref$compact,
15
+ _ref$enquiriesCount = _ref.enquiriesCount,
16
+ enquiriesCount = _ref$enquiriesCount === void 0 ? void 0 : _ref$enquiriesCount,
17
+ imgSrc = _ref.imgSrc,
18
+ _ref$noOfBedrooms = _ref.noOfBedrooms,
19
+ noOfBedrooms = _ref$noOfBedrooms === void 0 ? void 0 : _ref$noOfBedrooms,
20
+ _ref$noOfBathrooms = _ref.noOfBathrooms,
21
+ noOfBathrooms = _ref$noOfBathrooms === void 0 ? void 0 : _ref$noOfBathrooms,
22
+ _ref$noOfCarparks = _ref.noOfCarparks,
23
+ noOfCarparks = _ref$noOfCarparks === void 0 ? void 0 : _ref$noOfCarparks,
24
+ _ref$rent = _ref.rent,
25
+ rent = _ref$rent === void 0 ? void 0 : _ref$rent,
26
+ _ref$viewingsCount = _ref.viewingsCount,
27
+ viewingsCount = _ref$viewingsCount === void 0 ? void 0 : _ref$viewingsCount,
28
+ rest = _objectWithoutProperties(_ref, _excluded);
29
+ return /* @__PURE__ */React.createElement(Paper, _objectSpread2({
30
+ overflow: false,
31
+ sx: {
32
+ display: "flex",
33
+ alignItems: "center"
34
+ }
35
+ }, rest), /* @__PURE__ */React.createElement(StyledPropertyImage, null, /* @__PURE__ */React.createElement(Media, {
36
+ as: "img",
37
+ title: address,
38
+ src: imgSrc
39
+ })), /* @__PURE__ */React.createElement(StyledPropertyDetailsBox, null, /* @__PURE__ */React.createElement(Box, null, /* @__PURE__ */React.createElement(Heading, {
40
+ as: "h4",
41
+ weight: "700"
42
+ }, address)), /* @__PURE__ */React.createElement(Box, {
43
+ sx: {
44
+ display: "flex",
45
+ alignItems: "center",
46
+ ml: {
47
+ sm: "auto"
48
+ },
49
+ mt: {
50
+ xs: "10px",
51
+ sm: 0
52
+ },
53
+ "@media print": {
54
+ ml: "auto"
55
+ }
56
+ }
57
+ }, /* @__PURE__ */React.createElement(StyledPropertyAmenitiesBox, null, rent && /* @__PURE__ */React.createElement(Heading, {
58
+ as: "h4",
59
+ weight: "700"
60
+ }, rent), /* @__PURE__ */React.createElement(Box, {
61
+ fontSize: "16px"
62
+ }, noOfBedrooms && /* @__PURE__ */React.createElement(IconLabel, {
63
+ color: "text.primary",
64
+ startIcon: /* @__PURE__ */React.createElement(Icon, {
65
+ size: 21,
66
+ color: "inherit",
67
+ name: "bed"
68
+ })
69
+ }, /* @__PURE__ */React.createElement(Text, {
70
+ as: "span",
71
+ variant: "inherit"
72
+ }, noOfBedrooms)), noOfBathrooms && /* @__PURE__ */React.createElement(IconLabel, {
73
+ color: "text.primary",
74
+ startIcon: /* @__PURE__ */React.createElement(Icon, {
75
+ size: 21,
76
+ color: "inherit",
77
+ name: "bath"
78
+ }),
79
+ marginLeft: 3
80
+ }, /* @__PURE__ */React.createElement(Text, {
81
+ as: "span",
82
+ variant: "inherit"
83
+ }, noOfBathrooms)), noOfCarparks && /* @__PURE__ */React.createElement(IconLabel, {
84
+ color: "text.primary",
85
+ startIcon: /* @__PURE__ */React.createElement(Icon, {
86
+ size: 21,
87
+ color: "inherit",
88
+ name: "car"
89
+ }),
90
+ marginLeft: 3
91
+ }, /* @__PURE__ */React.createElement(Text, {
92
+ as: "span",
93
+ variant: "inherit"
94
+ }, noOfCarparks)))), !compact && /* @__PURE__ */React.createElement(Box, {
95
+ paddingLeft: "25px",
96
+ borderLeft: "1px solid #00000040",
97
+ display: "flex",
98
+ direction: "column",
99
+ sx: {
100
+ gap: {
101
+ xs: "18px",
102
+ lg: "10px",
103
+ xl: 0
28
104
  },
29
- ...rest,
30
- children: [
31
- /* @__PURE__ */ jsx(StyledPropertyImage, { children: /* @__PURE__ */ jsx(Media, { as: "img", title: address, src: imgSrc }) }),
32
- /* @__PURE__ */ jsxs(StyledPropertyDetailsBox, { children: [
33
- /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Heading, { as: "h4", weight: "700", children: address }) }),
34
- /* @__PURE__ */ jsxs(
35
- Box,
36
- {
37
- sx: {
38
- display: "flex",
39
- alignItems: "center",
40
- ml: { sm: "auto" },
41
- mt: { xs: "10px", sm: 0 },
42
- "@media print": {
43
- ml: "auto"
44
- }
45
- },
46
- children: [
47
- /* @__PURE__ */ jsxs(StyledPropertyAmenitiesBox, { children: [
48
- rent && /* @__PURE__ */ jsx(Heading, { as: "h4", weight: "700", children: rent }),
49
- /* @__PURE__ */ jsxs(Box, { fontSize: "16px", children: [
50
- noOfBedrooms && /* @__PURE__ */ jsx(
51
- IconLabel,
52
- {
53
- color: "text.primary",
54
- startIcon: /* @__PURE__ */ jsx(Icon, { size: 21, color: "inherit", name: "bed" }),
55
- children: /* @__PURE__ */ jsx(Text, { as: "span", variant: "inherit", children: noOfBedrooms })
56
- }
57
- ),
58
- noOfBathrooms && /* @__PURE__ */ jsx(
59
- IconLabel,
60
- {
61
- color: "text.primary",
62
- startIcon: /* @__PURE__ */ jsx(Icon, { size: 21, color: "inherit", name: "bath" }),
63
- marginLeft: 3,
64
- children: /* @__PURE__ */ jsx(Text, { as: "span", variant: "inherit", children: noOfBathrooms })
65
- }
66
- ),
67
- noOfCarparks && /* @__PURE__ */ jsx(
68
- IconLabel,
69
- {
70
- color: "text.primary",
71
- startIcon: /* @__PURE__ */ jsx(Icon, { size: 21, color: "inherit", name: "car" }),
72
- marginLeft: 3,
73
- children: /* @__PURE__ */ jsx(Text, { as: "span", variant: "inherit", children: noOfCarparks })
74
- }
75
- )
76
- ] })
77
- ] }),
78
- !compact && /* @__PURE__ */ jsxs(
79
- Box,
80
- {
81
- paddingLeft: "25px",
82
- borderLeft: "1px solid #00000040",
83
- display: "flex",
84
- direction: "column",
85
- sx: {
86
- gap: { xs: "18px", lg: "10px", xl: 0 },
87
- justifyContent: "space-between"
88
- },
89
- children: [
90
- viewingsCount && /* @__PURE__ */ jsxs(Box, { display: "flex", align: "center", gap: "12px", children: [
91
- /* @__PURE__ */ jsx(Box, { minWidth: "87px", children: /* @__PURE__ */ jsx(
92
- Text,
93
- {
94
- transform: "uppercase",
95
- color: "textPrimary",
96
- as: "span",
97
- weight: "600",
98
- align: "right",
99
- lineHeight: "15px",
100
- children: "Viewings"
101
- }
102
- ) }),
103
- /* @__PURE__ */ jsx(Heading, { as: "h2", children: viewingsCount })
104
- ] }),
105
- enquiriesCount && /* @__PURE__ */ jsxs(Box, { display: "flex", align: "center", gap: "12px", children: [
106
- /* @__PURE__ */ jsx(Box, { minWidth: "87px", children: /* @__PURE__ */ jsx(
107
- Text,
108
- {
109
- transform: "uppercase",
110
- color: "textPrimary",
111
- as: "span",
112
- weight: "600",
113
- minWidth: "87px",
114
- align: "right",
115
- lineHeight: "15px",
116
- children: "Enquiries"
117
- }
118
- ) }),
119
- /* @__PURE__ */ jsx(Heading, { as: "h2", children: enquiriesCount })
120
- ] })
121
- ]
122
- }
123
- )
124
- ]
125
- }
126
- )
127
- ] })
128
- ]
105
+ justifyContent: "space-between"
129
106
  }
130
- );
107
+ }, viewingsCount && /* @__PURE__ */React.createElement(Box, {
108
+ display: "flex",
109
+ align: "center",
110
+ gap: "12px"
111
+ }, /* @__PURE__ */React.createElement(Box, {
112
+ minWidth: "87px"
113
+ }, /* @__PURE__ */React.createElement(Text, {
114
+ transform: "uppercase",
115
+ color: "textPrimary",
116
+ as: "span",
117
+ weight: "600",
118
+ align: "right",
119
+ lineHeight: "15px"
120
+ }, "Viewings")), /* @__PURE__ */React.createElement(Heading, {
121
+ as: "h2"
122
+ }, viewingsCount)), enquiriesCount && /* @__PURE__ */React.createElement(Box, {
123
+ display: "flex",
124
+ align: "center",
125
+ gap: "12px"
126
+ }, /* @__PURE__ */React.createElement(Box, {
127
+ minWidth: "87px"
128
+ }, /* @__PURE__ */React.createElement(Text, {
129
+ transform: "uppercase",
130
+ color: "textPrimary",
131
+ as: "span",
132
+ weight: "600",
133
+ minWidth: "87px",
134
+ align: "right",
135
+ lineHeight: "15px"
136
+ }, "Enquiries")), /* @__PURE__ */React.createElement(Heading, {
137
+ as: "h2"
138
+ }, enquiriesCount))))));
131
139
  }
132
140
 
133
141
  export { PropertyCard as default };
@@ -1,72 +1,20 @@
1
1
  "use strict";
2
+ import { taggedTemplateLiteral as _taggedTemplateLiteral } from '../_virtual/_rollupPluginBabelHelpers.js';
2
3
  import { css } from '@emotion/react';
3
4
  import styled from '@emotion/styled';
4
5
 
5
- const StyledPropertyImage = styled.figure`
6
- padding: 0;
7
- margin: 0;
8
- width: 120px;
9
- height: 95px;
10
- flex: 0 0 95px;
11
- overflow: hidden;
12
-
13
- ${({ theme }) => css`
14
- ${theme.breakpoints.down("sm")} {
15
- display: none;
16
- }
17
-
18
- ${theme.breakpoints.up("sm")} {
19
- width: 150px;
20
- height: 135px;
21
- flex: 0 0 150px;
22
- }
23
-
24
- @media print {
25
- width: 150px;
26
- height: 135px;
27
- flex: 0 0 150px;
28
- display: block;
29
- }
30
- `}
31
- `;
32
- const StyledPropertyDetailsBox = styled.div`
33
- display: flex;
34
- width: 100%;
35
- align-items: flex-start;
36
- padding: 16px 24px 16px 20px;
37
- flex-direction: column;
38
-
39
- ${({ theme }) => css`
40
- ${theme.breakpoints.up("sm")} {
41
- flex-direction: row;
42
- align-items: center;
43
- }
44
- `}
45
-
46
- @media print {
47
- flex-direction: row;
48
- align-items: center;
49
- }
50
- `;
51
- const StyledPropertyAmenitiesBox = styled.div`
52
- padding-right: 25px;
53
- display: flex;
54
- flex-direction: column;
55
- margin-top: 5px;
56
-
57
- gap: 18px;
58
- min-width: 170px;
59
- height: 100%;
60
- justify-content: space-between;
61
-
62
- ${({ theme }) => `
63
- @media (min-width: ${theme.breakpoints.values.md}px) {
64
- align-items: flex-end;
65
- }
66
- `}
67
- @media print {
68
- align-items: flex-end;
69
- }
70
- `;
6
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
7
+ var StyledPropertyImage = styled.figure(_templateObject || (_templateObject = _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 theme = _ref.theme;
9
+ return css(_templateObject2 || (_templateObject2 = _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"));
10
+ });
11
+ var StyledPropertyDetailsBox = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n align-items: flex-start;\n padding: 16px 24px 16px 20px;\n flex-direction: column;\n\n ", "\n\n @media print {\n flex-direction: row;\n align-items: center;\n }\n"])), function (_ref2) {
12
+ var theme = _ref2.theme;
13
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", " {\n flex-direction: row;\n align-items: center;\n }\n "])), theme.breakpoints.up("sm"));
14
+ });
15
+ var StyledPropertyAmenitiesBox = styled.div(_templateObject5 || (_templateObject5 = _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 theme = _ref3.theme;
17
+ return "\n @media (min-width: ".concat(theme.breakpoints.values.md, "px) {\n align-items: flex-end;\n }\n ");
18
+ });
71
19
 
72
20
  export { StyledPropertyAmenitiesBox, StyledPropertyDetailsBox, StyledPropertyImage };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tenancy.nz/feature-ui",
3
3
  "description": "React UI feature components.",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "author": "TPS <https://www.tenancy.co.nz>",
6
6
  "type": "module",
7
7
  "main": "dist/cjs/index.cjs",
@@ -18,14 +18,14 @@
18
18
  "primereact": "^3.1.3",
19
19
  "react": ">= 16.0.0 <= 18.3.1",
20
20
  "react-dom": ">= 16.0.0 <= 18.3.1",
21
- "@tenancy.nz/icons": "1.0.1",
22
- "@tenancy.nz/ui": "1.0.1"
21
+ "@tenancy.nz/icons": "1.0.2",
22
+ "@tenancy.nz/ui": "1.0.5"
23
23
  },
24
24
  "devDependencies": {
25
25
  "react": "^19.1.0",
26
26
  "react-dom": "^19.1.0",
27
- "@tenancy.nz/icons": "1.0.1",
28
- "@tenancy.nz/ui": "1.0.1"
27
+ "@tenancy.nz/icons": "1.0.2",
28
+ "@tenancy.nz/ui": "1.0.5"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-uid": "^2.4.0"