@tenancy.nz/feature-ui 1.8.6 → 1.9.3

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.
@@ -8,6 +8,9 @@ function _arrayLikeToArray(r, a) {
8
8
  function _arrayWithHoles(r) {
9
9
  if (Array.isArray(r)) return r;
10
10
  }
11
+ function _arrayWithoutHoles(r) {
12
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
13
+ }
11
14
  function _defineProperty(e, r, t) {
12
15
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
13
16
  value: t,
@@ -16,6 +19,9 @@ function _defineProperty(e, r, t) {
16
19
  writable: true
17
20
  }) : e[r] = t, e;
18
21
  }
22
+ function _iterableToArray(r) {
23
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
24
+ }
19
25
  function _iterableToArrayLimit(r, l) {
20
26
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
21
27
  if (null != t) {
@@ -46,6 +52,9 @@ function _iterableToArrayLimit(r, l) {
46
52
  function _nonIterableRest() {
47
53
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
48
54
  }
55
+ function _nonIterableSpread() {
56
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
57
+ }
49
58
  function ownKeys(e, r) {
50
59
  var t = Object.keys(e);
51
60
  if (Object.getOwnPropertySymbols) {
@@ -97,6 +106,9 @@ function _taggedTemplateLiteral(e, t) {
97
106
  }
98
107
  }));
99
108
  }
109
+ function _toConsumableArray(r) {
110
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
111
+ }
100
112
  function _toPrimitive(t, r) {
101
113
  if ("object" != typeof t || !t) return t;
102
114
  var e = t[Symbol.toPrimitive];
@@ -121,14 +133,18 @@ function _unsupportedIterableToArray(r, a) {
121
133
 
122
134
  exports.arrayLikeToArray = _arrayLikeToArray;
123
135
  exports.arrayWithHoles = _arrayWithHoles;
136
+ exports.arrayWithoutHoles = _arrayWithoutHoles;
124
137
  exports.defineProperty = _defineProperty;
138
+ exports.iterableToArray = _iterableToArray;
125
139
  exports.iterableToArrayLimit = _iterableToArrayLimit;
126
140
  exports.nonIterableRest = _nonIterableRest;
141
+ exports.nonIterableSpread = _nonIterableSpread;
127
142
  exports.objectSpread2 = _objectSpread2;
128
143
  exports.objectWithoutProperties = _objectWithoutProperties;
129
144
  exports.objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
130
145
  exports.slicedToArray = _slicedToArray;
131
146
  exports.taggedTemplateLiteral = _taggedTemplateLiteral;
147
+ exports.toConsumableArray = _toConsumableArray;
132
148
  exports.toPrimitive = _toPrimitive;
133
149
  exports.toPropertyKey = _toPropertyKey;
134
150
  exports.unsupportedIterableToArray = _unsupportedIterableToArray;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var ui = require('@tenancy.nz/ui');
7
- var EmailRoundedIcon = require('@mui/icons-material/EmailRounded');
8
- var CallIcon = require('@mui/icons-material/Call');
9
- var PersonRoundedIcon = require('@mui/icons-material/PersonRounded');
7
+ var EmailIcon = require('@tenancy.nz/icons/Email');
8
+ var PhoneIcon = require('@tenancy.nz/icons/Phone');
9
+ var ProfileIcon = require('@tenancy.nz/icons/Profile');
10
10
  var IconLabel = require('./IconLabel.cjs');
11
11
 
12
12
  function AgentDetailsCard(_ref) {
@@ -35,8 +35,8 @@ function AgentDetailsCard(_ref) {
35
35
  variant: "text"
36
36
  }) : /* @__PURE__ */React.createElement(IconLabel.default, {
37
37
  color: "tertiary.main",
38
- startIcon: /* @__PURE__ */React.createElement(PersonRoundedIcon, {
39
- fontSize: "small"
38
+ startIcon: /* @__PURE__ */React.createElement(ProfileIcon, {
39
+ size: 22
40
40
  })
41
41
  }, /* @__PURE__ */React.createElement(ui.Heading, {
42
42
  as: "h5",
@@ -47,8 +47,8 @@ function AgentDetailsCard(_ref) {
47
47
  variant: "text"
48
48
  }) : /* @__PURE__ */React.createElement(IconLabel.default, {
49
49
  color: "tertiary.main",
50
- startIcon: /* @__PURE__ */React.createElement(CallIcon, {
51
- fontSize: "small"
50
+ startIcon: /* @__PURE__ */React.createElement(PhoneIcon, {
51
+ size: 22
52
52
  })
53
53
  }, /* @__PURE__ */React.createElement(ui.Text, {
54
54
  as: "span",
@@ -61,8 +61,8 @@ function AgentDetailsCard(_ref) {
61
61
  variant: "text"
62
62
  }) : /* @__PURE__ */React.createElement(IconLabel.default, {
63
63
  color: "tertiary.main",
64
- startIcon: /* @__PURE__ */React.createElement(EmailRoundedIcon, {
65
- fontSize: "small"
64
+ startIcon: /* @__PURE__ */React.createElement(EmailIcon, {
65
+ size: 22
66
66
  })
67
67
  }, /* @__PURE__ */React.createElement(ui.Text, {
68
68
  as: "span",
@@ -3,26 +3,22 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var CheckCircleOutlineRoundedIcon = require('@mui/icons-material/CheckCircleOutlineRounded');
7
- var HighlightOffRoundedIcon = require('@mui/icons-material/HighlightOffRounded');
6
+ var CircleCheckOutlinedIcon = require('@tenancy.nz/icons/CircleCheckOutlined');
7
+ var CloseCircleOutlinedIcon = require('@tenancy.nz/icons/CloseCircleOutlined');
8
8
  var ui = require('@tenancy.nz/ui');
9
9
 
10
10
  function CheckedIcon(_ref) {
11
11
  var value = _ref.value;
12
12
  if (value === true) {
13
- return /* @__PURE__ */React.createElement(CheckCircleOutlineRoundedIcon, {
14
- sx: {
15
- color: "success.main"
16
- },
17
- fontSize: "small"
13
+ return /* @__PURE__ */React.createElement(CircleCheckOutlinedIcon, {
14
+ size: 22,
15
+ color: ui.token("palette.semantic.icons.successColor")
18
16
  });
19
17
  }
20
18
  if (value === false) {
21
- return /* @__PURE__ */React.createElement(HighlightOffRoundedIcon, {
22
- sx: {
23
- color: "error.main"
24
- },
25
- fontSize: "small"
19
+ return /* @__PURE__ */React.createElement(CloseCircleOutlinedIcon, {
20
+ size: 22,
21
+ color: ui.token("palette.semantic.icons.errorColor")
26
22
  });
27
23
  }
28
24
  return /* @__PURE__ */React.createElement(ui.Text, {
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var styled = require('@emotion/styled');
8
+ var ui = require('@tenancy.nz/ui');
9
+
10
+ var _excluded = ["name", "label"];
11
+ var _templateObject;
12
+ var borders = {
13
+ average: ui.token("palette.component.creditscore.tagBorderAverage"),
14
+ excellent: ui.token("palette.component.creditscore.tagBorderExcellent"),
15
+ fair: ui.token("palette.component.creditscore.tagBorderFair"),
16
+ good: ui.token("palette.component.creditscore.tagBorderGood"),
17
+ poor: ui.token("palette.component.creditscore.tagBorderPoor")
18
+ };
19
+ var icons = {
20
+ average: ui.token("palette.component.creditscore.tagIconAverage"),
21
+ excellent: ui.token("palette.component.creditscore.tagIconExcellent"),
22
+ fair: ui.token("palette.component.creditscore.tagIconFair"),
23
+ good: ui.token("palette.component.creditscore.tagIconGood"),
24
+ poor: ui.token("palette.component.creditscore.tagIconPoor")
25
+ };
26
+ var names = {
27
+ average: "Average",
28
+ excellent: "Excellent",
29
+ fair: "Fair",
30
+ good: "Good",
31
+ poor: "Poor"
32
+ };
33
+ var StyledCreditRatingTag = styled(ui.Tag, {
34
+ shouldForwardProp: function shouldForwardProp(prop) {
35
+ return prop !== "overrideColor";
36
+ }
37
+ })(_templateObject || (_templateObject = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n && {\n border-color: ", ";\n }\n"])), function (_ref) {
38
+ var overrideColor = _ref.overrideColor;
39
+ return overrideColor;
40
+ });
41
+ function CreditRatingTag(_ref2) {
42
+ var name = _ref2.name,
43
+ _ref2$label = _ref2.label,
44
+ label = _ref2$label === void 0 ? void 0 : _ref2$label,
45
+ others = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded);
46
+ return /* @__PURE__ */React.createElement(StyledCreditRatingTag, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, others), {}, {
47
+ overrideColor: borders[name],
48
+ color: "primary",
49
+ variant: "outlined",
50
+ label: label !== null && label !== void 0 ? label : names[name],
51
+ startIcon: /* @__PURE__ */React.createElement(ui.Dot, {
52
+ color: icons[name],
53
+ size: "3px",
54
+ edges: "2px"
55
+ })
56
+ }));
57
+ }
58
+
59
+ exports.default = CreditRatingTag;
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var styled = require('@emotion/styled');
8
+ var ui = require('@tenancy.nz/ui');
9
+
10
+ var _excluded = ["name", "label"];
11
+ var _templateObject;
12
+ var borders = {
13
+ allhouse: ui.token("palette.component.partnerTag.borderAllhouse"),
14
+ officeWebsite: ui.token("palette.component.partnerTag.borderOfficeWebsite"),
15
+ oneroof: ui.token("palette.component.partnerTag.borderOneroof"),
16
+ realestate: ui.token("palette.component.partnerTag.borderRealestate"),
17
+ tenantPortal: ui.token("palette.component.partnerTag.borderTenantPortal"),
18
+ trademe: ui.token("palette.component.partnerTag.borderTrademe")
19
+ };
20
+ var names = {
21
+ allhouse: "AllHouse",
22
+ officeWebsite: "Office website",
23
+ oneroof: "OneRoof",
24
+ realestate: "realestate.co.nz",
25
+ tenantPortal: "Tenant portal",
26
+ trademe: "Trade Me"
27
+ };
28
+ var StyledIntegrationTag = styled(ui.Tag, {
29
+ shouldForwardProp: function shouldForwardProp(prop) {
30
+ return prop !== "overrideColor";
31
+ }
32
+ })(_templateObject || (_templateObject = _rollupPluginBabelHelpers.taggedTemplateLiteral(["\n && {\n border-color: ", ";\n }\n"])), function (_ref) {
33
+ var overrideColor = _ref.overrideColor;
34
+ return overrideColor;
35
+ });
36
+ function IntegrationTag(_ref2) {
37
+ var name = _ref2.name,
38
+ _ref2$label = _ref2.label,
39
+ label = _ref2$label === void 0 ? void 0 : _ref2$label,
40
+ others = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded);
41
+ return /* @__PURE__ */React.createElement(StyledIntegrationTag, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, others), {}, {
42
+ overrideColor: borders[name],
43
+ color: "primary",
44
+ variant: "outlined",
45
+ label: label !== null && label !== void 0 ? label : names[name],
46
+ startIcon: /* @__PURE__ */React.createElement(ui.Dot, {
47
+ color: borders[name],
48
+ size: "3px",
49
+ edges: "2px"
50
+ })
51
+ }));
52
+ }
53
+
54
+ exports.default = IntegrationTag;
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var ui = require('@tenancy.nz/ui');
8
+
9
+ var _excluded = ["children", "disabled", "selected", "slots", "slotProps", "tagColor", "tagLabel", "sx"];
10
+ function PersonCard(_ref) {
11
+ var _ref$children = _ref.children,
12
+ children = _ref$children === void 0 ? void 0 : _ref$children,
13
+ _ref$disabled = _ref.disabled,
14
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
15
+ _ref$selected = _ref.selected,
16
+ selected = _ref$selected === void 0 ? false : _ref$selected,
17
+ _ref$slots = _ref.slots,
18
+ slots = _ref$slots === void 0 ? {} : _ref$slots,
19
+ _ref$slotProps = _ref.slotProps,
20
+ slotProps = _ref$slotProps === void 0 ? {} : _ref$slotProps,
21
+ _ref$tagColor = _ref.tagColor,
22
+ tagColor = _ref$tagColor === void 0 ? "tertiary" : _ref$tagColor,
23
+ _ref$tagLabel = _ref.tagLabel,
24
+ tagLabel = _ref$tagLabel === void 0 ? void 0 : _ref$tagLabel,
25
+ _ref$sx = _ref.sx,
26
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
27
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
28
+ var Footer = slots.footer;
29
+ var Header = slots.header;
30
+ var tag = {
31
+ color: tagColor,
32
+ label: selected && !tagLabel ? "Selected" : tagLabel
33
+ };
34
+ return /* @__PURE__ */React.createElement(ui.BaseSelectableCard, _rollupPluginBabelHelpers.objectSpread2({
35
+ color: tagColor,
36
+ disabled: disabled,
37
+ orientation: "vertical",
38
+ gap: 4,
39
+ selected: selected,
40
+ sx: sx
41
+ }, rest), tag.color && tag.label && /* @__PURE__ */React.createElement(ui.AbsBox, {
42
+ top: "-11px",
43
+ right: "-9px"
44
+ }, /* @__PURE__ */React.createElement(ui.Tag, {
45
+ label: tag.label,
46
+ color: tag.color,
47
+ variant: "contained",
48
+ disableIcon: true
49
+ })), Header && /* @__PURE__ */React.createElement(Header, _rollupPluginBabelHelpers.objectSpread2({
50
+ disabled: disabled
51
+ }, slotProps.header)), children, Footer && /* @__PURE__ */React.createElement(Footer, _rollupPluginBabelHelpers.objectSpread2({}, slotProps.footer)));
52
+ }
53
+
54
+ exports.default = PersonCard;
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var Stack = require('@mui/material/Stack');
8
+ var ui = require('@tenancy.nz/ui');
9
+
10
+ var _excluded = ["avatarColor", "avatarUrl", "badgeCount", "disabled", "email", "firstName", "lastName", "mobile", "sx"];
11
+ var Badge = ui.Badge;
12
+ var badgeSlotProps = {
13
+ badge: {
14
+ sx: {
15
+ "&&": {
16
+ position: "relative",
17
+ top: "auto",
18
+ right: "auto",
19
+ transform: "none",
20
+ fontSize: "10px",
21
+ border: "none",
22
+ width: "16px",
23
+ height: "16px"
24
+ }
25
+ }
26
+ }
27
+ };
28
+ var CONTACT_TEXT = {
29
+ default: ui.token("palette.semantic.text.secondaryColor"),
30
+ disabled: ui.token("palette.semantic.text.disabledColor")
31
+ };
32
+ function isMultiple(badgeCount) {
33
+ var count = Number(badgeCount);
34
+ return Number.isFinite(count) && count > 1;
35
+ }
36
+ function PersonDetailHeader(_ref) {
37
+ var _ref$avatarColor = _ref.avatarColor,
38
+ avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
39
+ _ref$avatarUrl = _ref.avatarUrl,
40
+ avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
41
+ _ref$badgeCount = _ref.badgeCount,
42
+ badgeCount = _ref$badgeCount === void 0 ? void 0 : _ref$badgeCount,
43
+ _ref$disabled = _ref.disabled,
44
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
45
+ _ref$email = _ref.email,
46
+ email = _ref$email === void 0 ? void 0 : _ref$email,
47
+ _ref$firstName = _ref.firstName,
48
+ firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
49
+ _ref$lastName = _ref.lastName,
50
+ lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
51
+ _ref$mobile = _ref.mobile,
52
+ mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
53
+ _ref$sx = _ref.sx,
54
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
55
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
56
+ var name = [firstName, lastName].filter(Boolean).join(" ");
57
+ var showBadge = isMultiple(badgeCount);
58
+ return /* @__PURE__ */React.createElement(Stack, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
59
+ direction: "row",
60
+ alignItems: "center",
61
+ gap: 4
62
+ }, rest), {}, {
63
+ sx: sx
64
+ }), /* @__PURE__ */React.createElement(ui.Avatar, {
65
+ color: avatarColor,
66
+ src: avatarUrl,
67
+ alt: name,
68
+ size: 64
69
+ }), /* @__PURE__ */React.createElement(Stack, {
70
+ gap: 2
71
+ }, (name || showBadge) && /* @__PURE__ */React.createElement(Stack, {
72
+ direction: "row",
73
+ gap: 2,
74
+ alignItems: "center"
75
+ }, name && /* @__PURE__ */React.createElement(ui.Heading, {
76
+ as: "h5",
77
+ color: "inherit"
78
+ }, name), showBadge && /* @__PURE__ */React.createElement(Badge, {
79
+ badgeContent: badgeCount,
80
+ color: "primary",
81
+ slotProps: badgeSlotProps
82
+ })), (email || mobile) && /* @__PURE__ */React.createElement(Stack, {
83
+ sx: {
84
+ color: disabled ? CONTACT_TEXT.disabled : CONTACT_TEXT.default,
85
+ fontSize: "12px"
86
+ }
87
+ }, email && /* @__PURE__ */React.createElement(ui.Text, {
88
+ variant: "inherit",
89
+ weight: "500"
90
+ }, email), mobile && /* @__PURE__ */React.createElement(ui.Text, {
91
+ variant: "inherit",
92
+ weight: "500"
93
+ }, mobile))));
94
+ }
95
+
96
+ exports.default = PersonDetailHeader;
@@ -6,9 +6,9 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.c
6
6
  var React = require('react');
7
7
  var ui = require('@tenancy.nz/ui');
8
8
  var Stack = require('@mui/material/Stack');
9
- var BedRoundedIcon = require('@mui/icons-material/BedRounded');
10
- var BathtubRoundedIcon = require('@mui/icons-material/BathtubRounded');
11
- var DirectionsCarRoundedIcon = require('@mui/icons-material/DirectionsCarRounded');
9
+ var BathIcon = require('@tenancy.nz/icons/Bath');
10
+ var BedIcon = require('@tenancy.nz/icons/Bed');
11
+ var CarParkedIcon = require('@tenancy.nz/icons/CarParked');
12
12
  var IconLabel = require('./IconLabel.cjs');
13
13
  var PropertyCard_styled = require('./PropertyCard.styled.cjs');
14
14
 
@@ -76,33 +76,27 @@ function PropertyCard(_ref) {
76
76
  alignItems: "center"
77
77
  }, (noOfBedrooms || String(noOfBedrooms) === "0") && /* @__PURE__ */React.createElement(IconLabel.default, {
78
78
  color: "text.primary",
79
- startIcon: /* @__PURE__ */React.createElement(BedRoundedIcon, {
80
- sx: {
81
- color: "tertiary.main"
82
- },
83
- fontSize: "small"
79
+ startIcon: /* @__PURE__ */React.createElement(BedIcon, {
80
+ color: ui.token("palette.semantic.icons.accentColor"),
81
+ size: 22
84
82
  })
85
83
  }, /* @__PURE__ */React.createElement(ui.Text, {
86
84
  as: "span",
87
85
  variant: "inherit"
88
86
  }, noOfBedrooms)), (noOfBathrooms || String(noOfBathrooms) === "0") && /* @__PURE__ */React.createElement(IconLabel.default, {
89
87
  color: "text.primary",
90
- startIcon: /* @__PURE__ */React.createElement(BathtubRoundedIcon, {
91
- sx: {
92
- color: "tertiary.main"
93
- },
94
- fontSize: "small"
88
+ startIcon: /* @__PURE__ */React.createElement(BathIcon, {
89
+ color: ui.token("palette.semantic.icons.accentColor"),
90
+ size: 22
95
91
  })
96
92
  }, /* @__PURE__ */React.createElement(ui.Text, {
97
93
  as: "span",
98
94
  variant: "inherit"
99
95
  }, noOfBathrooms)), (noOfCarparks || String(noOfCarparks) === "0") && /* @__PURE__ */React.createElement(IconLabel.default, {
100
96
  color: "text.primary",
101
- startIcon: /* @__PURE__ */React.createElement(DirectionsCarRoundedIcon, {
102
- sx: {
103
- color: "tertiary.main"
104
- },
105
- fontSize: "small"
97
+ startIcon: /* @__PURE__ */React.createElement(CarParkedIcon, {
98
+ color: ui.token("palette.semantic.icons.accentColor"),
99
+ size: 22
106
100
  })
107
101
  }, /* @__PURE__ */React.createElement(ui.Text, {
108
102
  as: "span",
@@ -0,0 +1,38 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var ui = require('@tenancy.nz/ui');
8
+
9
+ var _excluded = ["children", "selected", "sx", "tagColor", "tagLabel"];
10
+ function SelectableCard(_ref) {
11
+ var children = _ref.children,
12
+ _ref$selected = _ref.selected,
13
+ selected = _ref$selected === void 0 ? false : _ref$selected,
14
+ _ref$sx = _ref.sx,
15
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
16
+ _ref$tagColor = _ref.tagColor,
17
+ tagColor = _ref$tagColor === void 0 ? void 0 : _ref$tagColor,
18
+ _ref$tagLabel = _ref.tagLabel,
19
+ tagLabel = _ref$tagLabel === void 0 ? void 0 : _ref$tagLabel,
20
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
21
+ var styles = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, sx), selected && tagColor && {
22
+ outlineColor: tagColor
23
+ });
24
+ return /* @__PURE__ */React.createElement(ui.BaseSelectableCard, _rollupPluginBabelHelpers.objectSpread2({
25
+ sx: styles
26
+ }, rest), (tagLabel || selected) && /* @__PURE__ */React.createElement(ui.AbsBox, {
27
+ top: -12,
28
+ right: -6
29
+ }, selected && !tagLabel ? /* @__PURE__ */React.createElement(ui.Tag, {
30
+ color: "green",
31
+ label: "Selected"
32
+ }) : /* @__PURE__ */React.createElement(ui.Tag, {
33
+ color: tagColor,
34
+ label: tagLabel
35
+ })), children);
36
+ }
37
+
38
+ exports.default = SelectableCard;
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
+ var React = require('react');
7
+ var ButtonBase = require('@mui/material/ButtonBase');
8
+ var Stack = require('@mui/material/Stack');
9
+ var ui = require('@tenancy.nz/ui');
10
+
11
+ var _excluded = ["disabled", "label", "sx", "tagColor", "tagLabel"];
12
+ var DEFAULT_TAG_COLOR = "default";
13
+ var styles = function styles(_ref) {
14
+ var disabled = _ref.disabled;
15
+ return {
16
+ fontFamily: function fontFamily(_ref2) {
17
+ var typography = _ref2.typography;
18
+ return typography.fontFamily;
19
+ },
20
+ fontSize: "12px",
21
+ p: 2,
22
+ "&&,&&:hover": {
23
+ color: disabled ? "grey.600" : "primary.main"
24
+ },
25
+ "&:hover": {
26
+ backgroundColor: ui.token("palette.component.interactiveSurface.primary.backgroundHover")
27
+ },
28
+ "&:active": {
29
+ backgroundColor: "transparent",
30
+ borderRadius: "8px",
31
+ outline: "2px solid",
32
+ outlineColor: "primary.main"
33
+ },
34
+ "&:focus": {
35
+ backgroundColor: ui.token("palette.component.interactiveSurface.primary.backgroundPressed")
36
+ }
37
+ };
38
+ };
39
+ function StatusButton(_ref3) {
40
+ var _ref3$disabled = _ref3.disabled,
41
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
42
+ label = _ref3.label,
43
+ _ref3$sx = _ref3.sx,
44
+ sx = _ref3$sx === void 0 ? {} : _ref3$sx,
45
+ _ref3$tagColor = _ref3.tagColor,
46
+ tagColor = _ref3$tagColor === void 0 ? DEFAULT_TAG_COLOR : _ref3$tagColor,
47
+ _ref3$tagLabel = _ref3.tagLabel,
48
+ tagLabel = _ref3$tagLabel === void 0 ? void 0 : _ref3$tagLabel,
49
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref3, _excluded);
50
+ return /* @__PURE__ */React.createElement(Stack, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
51
+ component: ButtonBase,
52
+ disabled: disabled,
53
+ direction: "row",
54
+ alignItems: "center",
55
+ justifyContent: "space-between",
56
+ flexWrap: "wrap",
57
+ gap: 2
58
+ }, rest), {}, {
59
+ sx: [].concat(_rollupPluginBabelHelpers.toConsumableArray(Array.isArray(sx) ? sx : [sx]), [styles({
60
+ disabled: disabled
61
+ })])
62
+ }), /* @__PURE__ */React.createElement(ui.Text, {
63
+ as: "span",
64
+ weight: "600",
65
+ variant: "inherit"
66
+ }, label), tagLabel && /* @__PURE__ */React.createElement(ui.Tag, {
67
+ color: tagColor || DEFAULT_TAG_COLOR,
68
+ label: tagLabel
69
+ }));
70
+ }
71
+
72
+ exports.default = StatusButton;
@@ -8,10 +8,9 @@ var doughnutChart = require('./doughnut-chart.cjs');
8
8
  var partnerLogo = require('./partner-logo.cjs');
9
9
  var general = require('../utils/helpers/general.cjs');
10
10
 
11
- var _excluded = ["allhouseCount", "bookMeCount", "oneRoofCount", "realEstateCount", "tradeMeCount", "manualCount", "websiteCount", "heading"];
11
+ var _excluded = ["bookMeCount", "oneRoofCount", "realEstateCount", "tradeMeCount", "manualCount", "websiteCount", "heading"];
12
12
  function AnalyticsDoughnutChart(_ref) {
13
- _ref.allhouseCount;
14
- var _ref$bookMeCount = _ref.bookMeCount,
13
+ var _ref$bookMeCount = _ref.bookMeCount,
15
14
  bookMeCount = _ref$bookMeCount === void 0 ? 0 : _ref$bookMeCount,
16
15
  _ref$oneRoofCount = _ref.oneRoofCount,
17
16
  oneRoofCount = _ref$oneRoofCount === void 0 ? 0 : _ref$oneRoofCount,
@@ -8,6 +8,7 @@ var BookingTable = require('./components/BookingTable.cjs');
8
8
  var BookingTableRow = require('./components/BookingTableRow.cjs');
9
9
  var BookingTableRowHeader = require('./components/BookingTableRowHeader.cjs');
10
10
  var BookingTableRowSkeleton = require('./components/BookingTableRowSkeleton.cjs');
11
+ var IntegrationTag = require('./components/IntegrationTag.cjs');
11
12
  var CheckedIcon = require('./components/CheckedIcon.cjs');
12
13
  var doughnutChart = require('./components/doughnut-chart.cjs');
13
14
  var analyticsDoughnutChart = require('./components/analytics-doughnut-chart.cjs');
@@ -17,7 +18,10 @@ var GridList = require('./components/GridList.cjs');
17
18
  var Hidden = require('./components/Hidden.cjs');
18
19
  var IconLabel = require('./components/IconLabel.cjs');
19
20
  var NotesCard = require('./components/NotesCard.cjs');
21
+ var PersonCard = require('./components/PersonCard.cjs');
22
+ var PersonDetailHeader = require('./components/PersonDetailHeader.cjs');
20
23
  var PropertyCard = require('./components/PropertyCard.cjs');
24
+ var StatusButton = require('./components/StatusButton.cjs');
21
25
 
22
26
 
23
27
 
@@ -29,6 +33,7 @@ exports.BookingTable = BookingTable.default;
29
33
  exports.BookingTableRow = BookingTableRow.default;
30
34
  exports.BookingTableRowHeader = BookingTableRowHeader.default;
31
35
  exports.BookingTableRowSkeleton = BookingTableRowSkeleton.default;
36
+ exports.IntegrationTag = IntegrationTag.default;
32
37
  exports.CheckedIcon = CheckedIcon.default;
33
38
  exports.DoughnutChart = doughnutChart.default;
34
39
  exports.AnalyticsDoughnutChart = analyticsDoughnutChart.default;
@@ -38,4 +43,7 @@ exports.GridList = GridList.default;
38
43
  exports.Hidden = Hidden.default;
39
44
  exports.IconLabel = IconLabel.default;
40
45
  exports.NotesCard = NotesCard.default;
46
+ exports.PersonCard = PersonCard.default;
47
+ exports.PersonDetailHeader = PersonDetailHeader.default;
41
48
  exports.PropertyCard = PropertyCard.default;
49
+ exports.StatusButton = StatusButton.default;
@@ -6,6 +6,9 @@ function _arrayLikeToArray(r, a) {
6
6
  function _arrayWithHoles(r) {
7
7
  if (Array.isArray(r)) return r;
8
8
  }
9
+ function _arrayWithoutHoles(r) {
10
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
11
+ }
9
12
  function _defineProperty(e, r, t) {
10
13
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
11
14
  value: t,
@@ -14,6 +17,9 @@ function _defineProperty(e, r, t) {
14
17
  writable: true
15
18
  }) : e[r] = t, e;
16
19
  }
20
+ function _iterableToArray(r) {
21
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
22
+ }
17
23
  function _iterableToArrayLimit(r, l) {
18
24
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
19
25
  if (null != t) {
@@ -44,6 +50,9 @@ function _iterableToArrayLimit(r, l) {
44
50
  function _nonIterableRest() {
45
51
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
46
52
  }
53
+ function _nonIterableSpread() {
54
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
55
+ }
47
56
  function ownKeys(e, r) {
48
57
  var t = Object.keys(e);
49
58
  if (Object.getOwnPropertySymbols) {
@@ -95,6 +104,9 @@ function _taggedTemplateLiteral(e, t) {
95
104
  }
96
105
  }));
97
106
  }
107
+ function _toConsumableArray(r) {
108
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
109
+ }
98
110
  function _toPrimitive(t, r) {
99
111
  if ("object" != typeof t || !t) return t;
100
112
  var e = t[Symbol.toPrimitive];
@@ -117,4 +129,4 @@ function _unsupportedIterableToArray(r, a) {
117
129
  }
118
130
  }
119
131
 
120
- export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _defineProperty as defineProperty, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _taggedTemplateLiteral as taggedTemplateLiteral, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
132
+ export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _taggedTemplateLiteral as taggedTemplateLiteral, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _unsupportedIterableToArray as unsupportedIterableToArray };
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Box, Skeleton, Heading, Text } from '@tenancy.nz/ui';
3
- import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
4
- import CallIcon from '@mui/icons-material/Call';
5
- import PersonRoundedIcon from '@mui/icons-material/PersonRounded';
3
+ import EmailIcon from '@tenancy.nz/icons/Email';
4
+ import PhoneIcon from '@tenancy.nz/icons/Phone';
5
+ import ProfileIcon from '@tenancy.nz/icons/Profile';
6
6
  import IconLabel from './IconLabel.js';
7
7
 
8
8
  function AgentDetailsCard(_ref) {
@@ -31,8 +31,8 @@ function AgentDetailsCard(_ref) {
31
31
  variant: "text"
32
32
  }) : /* @__PURE__ */React.createElement(IconLabel, {
33
33
  color: "tertiary.main",
34
- startIcon: /* @__PURE__ */React.createElement(PersonRoundedIcon, {
35
- fontSize: "small"
34
+ startIcon: /* @__PURE__ */React.createElement(ProfileIcon, {
35
+ size: 22
36
36
  })
37
37
  }, /* @__PURE__ */React.createElement(Heading, {
38
38
  as: "h5",
@@ -43,8 +43,8 @@ function AgentDetailsCard(_ref) {
43
43
  variant: "text"
44
44
  }) : /* @__PURE__ */React.createElement(IconLabel, {
45
45
  color: "tertiary.main",
46
- startIcon: /* @__PURE__ */React.createElement(CallIcon, {
47
- fontSize: "small"
46
+ startIcon: /* @__PURE__ */React.createElement(PhoneIcon, {
47
+ size: 22
48
48
  })
49
49
  }, /* @__PURE__ */React.createElement(Text, {
50
50
  as: "span",
@@ -57,8 +57,8 @@ function AgentDetailsCard(_ref) {
57
57
  variant: "text"
58
58
  }) : /* @__PURE__ */React.createElement(IconLabel, {
59
59
  color: "tertiary.main",
60
- startIcon: /* @__PURE__ */React.createElement(EmailRoundedIcon, {
61
- fontSize: "small"
60
+ startIcon: /* @__PURE__ */React.createElement(EmailIcon, {
61
+ size: 22
62
62
  })
63
63
  }, /* @__PURE__ */React.createElement(Text, {
64
64
  as: "span",
@@ -1,24 +1,20 @@
1
1
  import React from 'react';
2
- import CheckCircleOutlineRoundedIcon from '@mui/icons-material/CheckCircleOutlineRounded';
3
- import HighlightOffRoundedIcon from '@mui/icons-material/HighlightOffRounded';
4
- import { Text } from '@tenancy.nz/ui';
2
+ import CircleCheckOutlinedIcon from '@tenancy.nz/icons/CircleCheckOutlined';
3
+ import CloseCircleOutlinedIcon from '@tenancy.nz/icons/CloseCircleOutlined';
4
+ import { token, Text } from '@tenancy.nz/ui';
5
5
 
6
6
  function CheckedIcon(_ref) {
7
7
  var value = _ref.value;
8
8
  if (value === true) {
9
- return /* @__PURE__ */React.createElement(CheckCircleOutlineRoundedIcon, {
10
- sx: {
11
- color: "success.main"
12
- },
13
- fontSize: "small"
9
+ return /* @__PURE__ */React.createElement(CircleCheckOutlinedIcon, {
10
+ size: 22,
11
+ color: token("palette.semantic.icons.successColor")
14
12
  });
15
13
  }
16
14
  if (value === false) {
17
- return /* @__PURE__ */React.createElement(HighlightOffRoundedIcon, {
18
- sx: {
19
- color: "error.main"
20
- },
21
- fontSize: "small"
15
+ return /* @__PURE__ */React.createElement(CloseCircleOutlinedIcon, {
16
+ size: 22,
17
+ color: token("palette.semantic.icons.errorColor")
22
18
  });
23
19
  }
24
20
  return /* @__PURE__ */React.createElement(Text, {
@@ -0,0 +1,55 @@
1
+ import { taggedTemplateLiteral as _taggedTemplateLiteral, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import styled from '@emotion/styled';
4
+ import { token, Tag, Dot } from '@tenancy.nz/ui';
5
+
6
+ var _excluded = ["name", "label"];
7
+ var _templateObject;
8
+ var borders = {
9
+ average: token("palette.component.creditscore.tagBorderAverage"),
10
+ excellent: token("palette.component.creditscore.tagBorderExcellent"),
11
+ fair: token("palette.component.creditscore.tagBorderFair"),
12
+ good: token("palette.component.creditscore.tagBorderGood"),
13
+ poor: token("palette.component.creditscore.tagBorderPoor")
14
+ };
15
+ var icons = {
16
+ average: token("palette.component.creditscore.tagIconAverage"),
17
+ excellent: token("palette.component.creditscore.tagIconExcellent"),
18
+ fair: token("palette.component.creditscore.tagIconFair"),
19
+ good: token("palette.component.creditscore.tagIconGood"),
20
+ poor: token("palette.component.creditscore.tagIconPoor")
21
+ };
22
+ var names = {
23
+ average: "Average",
24
+ excellent: "Excellent",
25
+ fair: "Fair",
26
+ good: "Good",
27
+ poor: "Poor"
28
+ };
29
+ var StyledCreditRatingTag = styled(Tag, {
30
+ shouldForwardProp: function shouldForwardProp(prop) {
31
+ return prop !== "overrideColor";
32
+ }
33
+ })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n border-color: ", ";\n }\n"])), function (_ref) {
34
+ var overrideColor = _ref.overrideColor;
35
+ return overrideColor;
36
+ });
37
+ function CreditRatingTag(_ref2) {
38
+ var name = _ref2.name,
39
+ _ref2$label = _ref2.label,
40
+ label = _ref2$label === void 0 ? void 0 : _ref2$label,
41
+ others = _objectWithoutProperties(_ref2, _excluded);
42
+ return /* @__PURE__ */React.createElement(StyledCreditRatingTag, _objectSpread2(_objectSpread2({}, others), {}, {
43
+ overrideColor: borders[name],
44
+ color: "primary",
45
+ variant: "outlined",
46
+ label: label !== null && label !== void 0 ? label : names[name],
47
+ startIcon: /* @__PURE__ */React.createElement(Dot, {
48
+ color: icons[name],
49
+ size: "3px",
50
+ edges: "2px"
51
+ })
52
+ }));
53
+ }
54
+
55
+ export { CreditRatingTag as default };
@@ -0,0 +1,50 @@
1
+ import { taggedTemplateLiteral as _taggedTemplateLiteral, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import styled from '@emotion/styled';
4
+ import { token, Tag, Dot } from '@tenancy.nz/ui';
5
+
6
+ var _excluded = ["name", "label"];
7
+ var _templateObject;
8
+ var borders = {
9
+ allhouse: token("palette.component.partnerTag.borderAllhouse"),
10
+ officeWebsite: token("palette.component.partnerTag.borderOfficeWebsite"),
11
+ oneroof: token("palette.component.partnerTag.borderOneroof"),
12
+ realestate: token("palette.component.partnerTag.borderRealestate"),
13
+ tenantPortal: token("palette.component.partnerTag.borderTenantPortal"),
14
+ trademe: token("palette.component.partnerTag.borderTrademe")
15
+ };
16
+ var names = {
17
+ allhouse: "AllHouse",
18
+ officeWebsite: "Office website",
19
+ oneroof: "OneRoof",
20
+ realestate: "realestate.co.nz",
21
+ tenantPortal: "Tenant portal",
22
+ trademe: "Trade Me"
23
+ };
24
+ var StyledIntegrationTag = styled(Tag, {
25
+ shouldForwardProp: function shouldForwardProp(prop) {
26
+ return prop !== "overrideColor";
27
+ }
28
+ })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && {\n border-color: ", ";\n }\n"])), function (_ref) {
29
+ var overrideColor = _ref.overrideColor;
30
+ return overrideColor;
31
+ });
32
+ function IntegrationTag(_ref2) {
33
+ var name = _ref2.name,
34
+ _ref2$label = _ref2.label,
35
+ label = _ref2$label === void 0 ? void 0 : _ref2$label,
36
+ others = _objectWithoutProperties(_ref2, _excluded);
37
+ return /* @__PURE__ */React.createElement(StyledIntegrationTag, _objectSpread2(_objectSpread2({}, others), {}, {
38
+ overrideColor: borders[name],
39
+ color: "primary",
40
+ variant: "outlined",
41
+ label: label !== null && label !== void 0 ? label : names[name],
42
+ startIcon: /* @__PURE__ */React.createElement(Dot, {
43
+ color: borders[name],
44
+ size: "3px",
45
+ edges: "2px"
46
+ })
47
+ }));
48
+ }
49
+
50
+ export { IntegrationTag as default };
@@ -0,0 +1,50 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import { BaseSelectableCard, AbsBox, Tag } from '@tenancy.nz/ui';
4
+
5
+ var _excluded = ["children", "disabled", "selected", "slots", "slotProps", "tagColor", "tagLabel", "sx"];
6
+ function PersonCard(_ref) {
7
+ var _ref$children = _ref.children,
8
+ children = _ref$children === void 0 ? void 0 : _ref$children,
9
+ _ref$disabled = _ref.disabled,
10
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
11
+ _ref$selected = _ref.selected,
12
+ selected = _ref$selected === void 0 ? false : _ref$selected,
13
+ _ref$slots = _ref.slots,
14
+ slots = _ref$slots === void 0 ? {} : _ref$slots,
15
+ _ref$slotProps = _ref.slotProps,
16
+ slotProps = _ref$slotProps === void 0 ? {} : _ref$slotProps,
17
+ _ref$tagColor = _ref.tagColor,
18
+ tagColor = _ref$tagColor === void 0 ? "tertiary" : _ref$tagColor,
19
+ _ref$tagLabel = _ref.tagLabel,
20
+ tagLabel = _ref$tagLabel === void 0 ? void 0 : _ref$tagLabel,
21
+ _ref$sx = _ref.sx,
22
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
23
+ rest = _objectWithoutProperties(_ref, _excluded);
24
+ var Footer = slots.footer;
25
+ var Header = slots.header;
26
+ var tag = {
27
+ color: tagColor,
28
+ label: selected && !tagLabel ? "Selected" : tagLabel
29
+ };
30
+ return /* @__PURE__ */React.createElement(BaseSelectableCard, _objectSpread2({
31
+ color: tagColor,
32
+ disabled: disabled,
33
+ orientation: "vertical",
34
+ gap: 4,
35
+ selected: selected,
36
+ sx: sx
37
+ }, rest), tag.color && tag.label && /* @__PURE__ */React.createElement(AbsBox, {
38
+ top: "-11px",
39
+ right: "-9px"
40
+ }, /* @__PURE__ */React.createElement(Tag, {
41
+ label: tag.label,
42
+ color: tag.color,
43
+ variant: "contained",
44
+ disableIcon: true
45
+ })), Header && /* @__PURE__ */React.createElement(Header, _objectSpread2({
46
+ disabled: disabled
47
+ }, slotProps.header)), children, Footer && /* @__PURE__ */React.createElement(Footer, _objectSpread2({}, slotProps.footer)));
48
+ }
49
+
50
+ export { PersonCard as default };
@@ -0,0 +1,92 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import Stack from '@mui/material/Stack';
4
+ import { token, Avatar, Heading, Badge as Badge$1, Text } from '@tenancy.nz/ui';
5
+
6
+ var _excluded = ["avatarColor", "avatarUrl", "badgeCount", "disabled", "email", "firstName", "lastName", "mobile", "sx"];
7
+ var Badge = Badge$1;
8
+ var badgeSlotProps = {
9
+ badge: {
10
+ sx: {
11
+ "&&": {
12
+ position: "relative",
13
+ top: "auto",
14
+ right: "auto",
15
+ transform: "none",
16
+ fontSize: "10px",
17
+ border: "none",
18
+ width: "16px",
19
+ height: "16px"
20
+ }
21
+ }
22
+ }
23
+ };
24
+ var CONTACT_TEXT = {
25
+ default: token("palette.semantic.text.secondaryColor"),
26
+ disabled: token("palette.semantic.text.disabledColor")
27
+ };
28
+ function isMultiple(badgeCount) {
29
+ var count = Number(badgeCount);
30
+ return Number.isFinite(count) && count > 1;
31
+ }
32
+ function PersonDetailHeader(_ref) {
33
+ var _ref$avatarColor = _ref.avatarColor,
34
+ avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
35
+ _ref$avatarUrl = _ref.avatarUrl,
36
+ avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
37
+ _ref$badgeCount = _ref.badgeCount,
38
+ badgeCount = _ref$badgeCount === void 0 ? void 0 : _ref$badgeCount,
39
+ _ref$disabled = _ref.disabled,
40
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
41
+ _ref$email = _ref.email,
42
+ email = _ref$email === void 0 ? void 0 : _ref$email,
43
+ _ref$firstName = _ref.firstName,
44
+ firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
45
+ _ref$lastName = _ref.lastName,
46
+ lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
47
+ _ref$mobile = _ref.mobile,
48
+ mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
49
+ _ref$sx = _ref.sx,
50
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
51
+ rest = _objectWithoutProperties(_ref, _excluded);
52
+ var name = [firstName, lastName].filter(Boolean).join(" ");
53
+ var showBadge = isMultiple(badgeCount);
54
+ return /* @__PURE__ */React.createElement(Stack, _objectSpread2(_objectSpread2({
55
+ direction: "row",
56
+ alignItems: "center",
57
+ gap: 4
58
+ }, rest), {}, {
59
+ sx: sx
60
+ }), /* @__PURE__ */React.createElement(Avatar, {
61
+ color: avatarColor,
62
+ src: avatarUrl,
63
+ alt: name,
64
+ size: 64
65
+ }), /* @__PURE__ */React.createElement(Stack, {
66
+ gap: 2
67
+ }, (name || showBadge) && /* @__PURE__ */React.createElement(Stack, {
68
+ direction: "row",
69
+ gap: 2,
70
+ alignItems: "center"
71
+ }, name && /* @__PURE__ */React.createElement(Heading, {
72
+ as: "h5",
73
+ color: "inherit"
74
+ }, name), showBadge && /* @__PURE__ */React.createElement(Badge, {
75
+ badgeContent: badgeCount,
76
+ color: "primary",
77
+ slotProps: badgeSlotProps
78
+ })), (email || mobile) && /* @__PURE__ */React.createElement(Stack, {
79
+ sx: {
80
+ color: disabled ? CONTACT_TEXT.disabled : CONTACT_TEXT.default,
81
+ fontSize: "12px"
82
+ }
83
+ }, email && /* @__PURE__ */React.createElement(Text, {
84
+ variant: "inherit",
85
+ weight: "500"
86
+ }, email), mobile && /* @__PURE__ */React.createElement(Text, {
87
+ variant: "inherit",
88
+ weight: "500"
89
+ }, mobile))));
90
+ }
91
+
92
+ export { PersonDetailHeader as default };
@@ -1,10 +1,10 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React from 'react';
3
- import { Paper, Media, Box, Heading, Text } from '@tenancy.nz/ui';
3
+ import { Paper, Media, Box, Heading, token, Text } from '@tenancy.nz/ui';
4
4
  import Stack from '@mui/material/Stack';
5
- import BedRoundedIcon from '@mui/icons-material/BedRounded';
6
- import BathtubRoundedIcon from '@mui/icons-material/BathtubRounded';
7
- import DirectionsCarRoundedIcon from '@mui/icons-material/DirectionsCarRounded';
5
+ import BathIcon from '@tenancy.nz/icons/Bath';
6
+ import BedIcon from '@tenancy.nz/icons/Bed';
7
+ import CarParkedIcon from '@tenancy.nz/icons/CarParked';
8
8
  import IconLabel from './IconLabel.js';
9
9
  import { StyledPropertyImage, StyledPropertyDetailsBox, StyledPropertyAmenitiesBox } from './PropertyCard.styled.js';
10
10
 
@@ -72,33 +72,27 @@ function PropertyCard(_ref) {
72
72
  alignItems: "center"
73
73
  }, (noOfBedrooms || String(noOfBedrooms) === "0") && /* @__PURE__ */React.createElement(IconLabel, {
74
74
  color: "text.primary",
75
- startIcon: /* @__PURE__ */React.createElement(BedRoundedIcon, {
76
- sx: {
77
- color: "tertiary.main"
78
- },
79
- fontSize: "small"
75
+ startIcon: /* @__PURE__ */React.createElement(BedIcon, {
76
+ color: token("palette.semantic.icons.accentColor"),
77
+ size: 22
80
78
  })
81
79
  }, /* @__PURE__ */React.createElement(Text, {
82
80
  as: "span",
83
81
  variant: "inherit"
84
82
  }, noOfBedrooms)), (noOfBathrooms || String(noOfBathrooms) === "0") && /* @__PURE__ */React.createElement(IconLabel, {
85
83
  color: "text.primary",
86
- startIcon: /* @__PURE__ */React.createElement(BathtubRoundedIcon, {
87
- sx: {
88
- color: "tertiary.main"
89
- },
90
- fontSize: "small"
84
+ startIcon: /* @__PURE__ */React.createElement(BathIcon, {
85
+ color: token("palette.semantic.icons.accentColor"),
86
+ size: 22
91
87
  })
92
88
  }, /* @__PURE__ */React.createElement(Text, {
93
89
  as: "span",
94
90
  variant: "inherit"
95
91
  }, noOfBathrooms)), (noOfCarparks || String(noOfCarparks) === "0") && /* @__PURE__ */React.createElement(IconLabel, {
96
92
  color: "text.primary",
97
- startIcon: /* @__PURE__ */React.createElement(DirectionsCarRoundedIcon, {
98
- sx: {
99
- color: "tertiary.main"
100
- },
101
- fontSize: "small"
93
+ startIcon: /* @__PURE__ */React.createElement(CarParkedIcon, {
94
+ color: token("palette.semantic.icons.accentColor"),
95
+ size: 22
102
96
  })
103
97
  }, /* @__PURE__ */React.createElement(Text, {
104
98
  as: "span",
@@ -0,0 +1,34 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import { BaseSelectableCard, AbsBox, Tag } from '@tenancy.nz/ui';
4
+
5
+ var _excluded = ["children", "selected", "sx", "tagColor", "tagLabel"];
6
+ function SelectableCard(_ref) {
7
+ var children = _ref.children,
8
+ _ref$selected = _ref.selected,
9
+ selected = _ref$selected === void 0 ? false : _ref$selected,
10
+ _ref$sx = _ref.sx,
11
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
12
+ _ref$tagColor = _ref.tagColor,
13
+ tagColor = _ref$tagColor === void 0 ? void 0 : _ref$tagColor,
14
+ _ref$tagLabel = _ref.tagLabel,
15
+ tagLabel = _ref$tagLabel === void 0 ? void 0 : _ref$tagLabel,
16
+ rest = _objectWithoutProperties(_ref, _excluded);
17
+ var styles = _objectSpread2(_objectSpread2({}, sx), selected && tagColor && {
18
+ outlineColor: tagColor
19
+ });
20
+ return /* @__PURE__ */React.createElement(BaseSelectableCard, _objectSpread2({
21
+ sx: styles
22
+ }, rest), (tagLabel || selected) && /* @__PURE__ */React.createElement(AbsBox, {
23
+ top: -12,
24
+ right: -6
25
+ }, selected && !tagLabel ? /* @__PURE__ */React.createElement(Tag, {
26
+ color: "green",
27
+ label: "Selected"
28
+ }) : /* @__PURE__ */React.createElement(Tag, {
29
+ color: tagColor,
30
+ label: tagLabel
31
+ })), children);
32
+ }
33
+
34
+ export { SelectableCard as default };
@@ -0,0 +1,68 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import ButtonBase from '@mui/material/ButtonBase';
4
+ import Stack from '@mui/material/Stack';
5
+ import { Text, Tag, token } from '@tenancy.nz/ui';
6
+
7
+ var _excluded = ["disabled", "label", "sx", "tagColor", "tagLabel"];
8
+ var DEFAULT_TAG_COLOR = "default";
9
+ var styles = function styles(_ref) {
10
+ var disabled = _ref.disabled;
11
+ return {
12
+ fontFamily: function fontFamily(_ref2) {
13
+ var typography = _ref2.typography;
14
+ return typography.fontFamily;
15
+ },
16
+ fontSize: "12px",
17
+ p: 2,
18
+ "&&,&&:hover": {
19
+ color: disabled ? "grey.600" : "primary.main"
20
+ },
21
+ "&:hover": {
22
+ backgroundColor: token("palette.component.interactiveSurface.primary.backgroundHover")
23
+ },
24
+ "&:active": {
25
+ backgroundColor: "transparent",
26
+ borderRadius: "8px",
27
+ outline: "2px solid",
28
+ outlineColor: "primary.main"
29
+ },
30
+ "&:focus": {
31
+ backgroundColor: token("palette.component.interactiveSurface.primary.backgroundPressed")
32
+ }
33
+ };
34
+ };
35
+ function StatusButton(_ref3) {
36
+ var _ref3$disabled = _ref3.disabled,
37
+ disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
38
+ label = _ref3.label,
39
+ _ref3$sx = _ref3.sx,
40
+ sx = _ref3$sx === void 0 ? {} : _ref3$sx,
41
+ _ref3$tagColor = _ref3.tagColor,
42
+ tagColor = _ref3$tagColor === void 0 ? DEFAULT_TAG_COLOR : _ref3$tagColor,
43
+ _ref3$tagLabel = _ref3.tagLabel,
44
+ tagLabel = _ref3$tagLabel === void 0 ? void 0 : _ref3$tagLabel,
45
+ rest = _objectWithoutProperties(_ref3, _excluded);
46
+ return /* @__PURE__ */React.createElement(Stack, _objectSpread2(_objectSpread2({
47
+ component: ButtonBase,
48
+ disabled: disabled,
49
+ direction: "row",
50
+ alignItems: "center",
51
+ justifyContent: "space-between",
52
+ flexWrap: "wrap",
53
+ gap: 2
54
+ }, rest), {}, {
55
+ sx: [].concat(_toConsumableArray(Array.isArray(sx) ? sx : [sx]), [styles({
56
+ disabled: disabled
57
+ })])
58
+ }), /* @__PURE__ */React.createElement(Text, {
59
+ as: "span",
60
+ weight: "600",
61
+ variant: "inherit"
62
+ }, label), tagLabel && /* @__PURE__ */React.createElement(Tag, {
63
+ color: tagColor || DEFAULT_TAG_COLOR,
64
+ label: tagLabel
65
+ }));
66
+ }
67
+
68
+ export { StatusButton as default };
@@ -4,10 +4,9 @@ import DoughnutChart from './doughnut-chart.js';
4
4
  import PartnerLogo from './partner-logo.js';
5
5
  import { parseChartCount } from '../utils/helpers/general.js';
6
6
 
7
- var _excluded = ["allhouseCount", "bookMeCount", "oneRoofCount", "realEstateCount", "tradeMeCount", "manualCount", "websiteCount", "heading"];
7
+ var _excluded = ["bookMeCount", "oneRoofCount", "realEstateCount", "tradeMeCount", "manualCount", "websiteCount", "heading"];
8
8
  function AnalyticsDoughnutChart(_ref) {
9
- _ref.allhouseCount;
10
- var _ref$bookMeCount = _ref.bookMeCount,
9
+ var _ref$bookMeCount = _ref.bookMeCount,
11
10
  bookMeCount = _ref$bookMeCount === void 0 ? 0 : _ref$bookMeCount,
12
11
  _ref$oneRoofCount = _ref.oneRoofCount,
13
12
  oneRoofCount = _ref$oneRoofCount === void 0 ? 0 : _ref$oneRoofCount,
package/dist/esm/index.js CHANGED
@@ -6,6 +6,7 @@ export { default as BookingTable } from './components/BookingTable.js';
6
6
  export { default as BookingTableRow } from './components/BookingTableRow.js';
7
7
  export { default as BookingTableRowHeader } from './components/BookingTableRowHeader.js';
8
8
  export { default as BookingTableRowSkeleton } from './components/BookingTableRowSkeleton.js';
9
+ export { default as IntegrationTag } from './components/IntegrationTag.js';
9
10
  export { default as CheckedIcon } from './components/CheckedIcon.js';
10
11
  export { default as DoughnutChart } from './components/doughnut-chart.js';
11
12
  export { default as AnalyticsDoughnutChart } from './components/analytics-doughnut-chart.js';
@@ -15,4 +16,7 @@ export { default as GridList } from './components/GridList.js';
15
16
  export { default as Hidden } from './components/Hidden.js';
16
17
  export { default as IconLabel } from './components/IconLabel.js';
17
18
  export { default as NotesCard } from './components/NotesCard.js';
19
+ export { default as PersonCard } from './components/PersonCard.js';
20
+ export { default as PersonDetailHeader } from './components/PersonDetailHeader.js';
18
21
  export { default as PropertyCard } from './components/PropertyCard.js';
22
+ export { default as StatusButton } from './components/StatusButton.js';
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.8.6",
4
+ "version": "1.9.3",
5
5
  "author": "TPS <https://www.tenancy.co.nz>",
6
6
  "type": "module",
7
7
  "main": "dist/cjs/index.cjs",
@@ -13,21 +13,21 @@
13
13
  "peerDependencies": {
14
14
  "@emotion/react": "^11.14.0",
15
15
  "@emotion/styled": "^11.14.1",
16
- "@mui/icons-material": "^7.2.0",
17
16
  "@mui/material": "^7.3.1",
18
17
  "chart.js": "2.7.3",
19
18
  "classnames": "^2.2.6",
20
19
  "primereact": "3.1.3",
21
20
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
22
21
  "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
23
- "@tenancy.nz/ui": "1.8.6"
22
+ "@tenancy.nz/icons": "1.9.3",
23
+ "@tenancy.nz/ui": "1.9.3"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@emotion/react": "^11.14.0",
27
27
  "@emotion/styled": "^11.14.1",
28
- "@mui/icons-material": "^7.2.0",
29
28
  "@mui/material": "^7.3.1",
30
- "@tenancy.nz/ui": "1.8.6"
29
+ "@tenancy.nz/icons": "1.9.3",
30
+ "@tenancy.nz/ui": "1.9.3"
31
31
  },
32
32
  "dependencies": {
33
33
  "react-uid": "^2.4.0"