@tenancy.nz/feature-ui 1.10.6 → 1.10.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.
@@ -19,6 +19,15 @@ function _defineProperty(e, r, t) {
19
19
  writable: true
20
20
  }) : e[r] = t, e;
21
21
  }
22
+ function _extends() {
23
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
24
+ for (var e = 1; e < arguments.length; e++) {
25
+ var t = arguments[e];
26
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
27
+ }
28
+ return n;
29
+ }, _extends.apply(null, arguments);
30
+ }
22
31
  function _iterableToArray(r) {
23
32
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
24
33
  }
@@ -55,6 +64,9 @@ function _nonIterableRest() {
55
64
  function _nonIterableSpread() {
56
65
  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
66
  }
67
+ function _objectDestructuringEmpty(t) {
68
+ if (null == t) throw new TypeError("Cannot destructure " + t);
69
+ }
58
70
  function ownKeys(e, r) {
59
71
  var t = Object.keys(e);
60
72
  if (Object.getOwnPropertySymbols) {
@@ -135,10 +147,12 @@ exports.arrayLikeToArray = _arrayLikeToArray;
135
147
  exports.arrayWithHoles = _arrayWithHoles;
136
148
  exports.arrayWithoutHoles = _arrayWithoutHoles;
137
149
  exports.defineProperty = _defineProperty;
150
+ exports.extends = _extends;
138
151
  exports.iterableToArray = _iterableToArray;
139
152
  exports.iterableToArrayLimit = _iterableToArrayLimit;
140
153
  exports.nonIterableRest = _nonIterableRest;
141
154
  exports.nonIterableSpread = _nonIterableSpread;
155
+ exports.objectDestructuringEmpty = _objectDestructuringEmpty;
142
156
  exports.objectSpread2 = _objectSpread2;
143
157
  exports.objectWithoutProperties = _objectWithoutProperties;
144
158
  exports.objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var ArrowLeftOutlinedIcon = require('@tenancy.nz/icons/ArrowLeftOutlined');
7
+ var ui = require('@tenancy.nz/ui');
8
+
9
+ function BackButton(_ref) {
10
+ var onClick = _ref.onClick;
11
+ return /* @__PURE__ */React.createElement(ui.Button, {
12
+ startIcon: /* @__PURE__ */React.createElement(ArrowLeftOutlinedIcon, null),
13
+ variant: "outlined",
14
+ onClick: onClick
15
+ }, "Back");
16
+ }
17
+
18
+ exports.default = BackButton;
@@ -0,0 +1,91 @@
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 = ["Component", "children", "color", "confirmMessage", "label", "onClick", "title", "confirmProps"];
10
+ var errorConfirmProps = {
11
+ severity: "error",
12
+ cancelBtnText: "Don't delete",
13
+ confirmBtnText: "Delete"
14
+ };
15
+ function ConfirmButton(_ref) {
16
+ var _ref$Component = _ref.Component,
17
+ Component = _ref$Component === void 0 ? null : _ref$Component,
18
+ children = _ref.children,
19
+ _ref$color = _ref.color,
20
+ color = _ref$color === void 0 ? "inherit" : _ref$color,
21
+ _ref$confirmMessage = _ref.confirmMessage,
22
+ confirmMessage = _ref$confirmMessage === void 0 ? void 0 : _ref$confirmMessage,
23
+ _ref$label = _ref.label,
24
+ label = _ref$label === void 0 ? "" : _ref$label,
25
+ onClick = _ref.onClick,
26
+ _ref$title = _ref.title,
27
+ title = _ref$title === void 0 ? "" : _ref$title,
28
+ _ref$confirmProps = _ref.confirmProps,
29
+ confirmProps = _ref$confirmProps === void 0 ? {} : _ref$confirmProps,
30
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
31
+ var _useState = React.useState(false),
32
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
33
+ showConfirm = _useState2[0],
34
+ setShowConfirm = _useState2[1];
35
+ var _useState3 = React.useState(void 0),
36
+ _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
37
+ value = _useState4[0],
38
+ setValue = _useState4[1];
39
+ var handleCancel = function handleCancel(e) {
40
+ e.stopPropagation();
41
+ setShowConfirm(false);
42
+ setValue(void 0);
43
+ };
44
+ var handleClick = function handleClick(e) {
45
+ e.stopPropagation();
46
+ if (!confirmMessage) {
47
+ onClick(e);
48
+ } else {
49
+ setShowConfirm(true);
50
+ setValue(e);
51
+ }
52
+ };
53
+ var handleConfirm = function handleConfirm() {
54
+ if (value) {
55
+ onClick(value);
56
+ }
57
+ setShowConfirm(false);
58
+ setValue(void 0);
59
+ };
60
+ return /* @__PURE__ */React.createElement(React.Fragment, null, Component ? /* @__PURE__ */React.createElement(Component, _rollupPluginBabelHelpers.objectSpread2({
61
+ color: color,
62
+ onClick: handleClick
63
+ }, rest), children) : /* @__PURE__ */React.createElement(ui.Tooltip, {
64
+ title: title,
65
+ placement: "top"
66
+ }, /* @__PURE__ */React.createElement(ui.Box, {
67
+ display: "inline-flex",
68
+ color: color.indexOf(".") === -1 ? "".concat(color, ".main") : color,
69
+ align: "center",
70
+ direction: "column"
71
+ }, /* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
72
+ color: color === "error" ? "error" : "inherit",
73
+ onClick: handleClick
74
+ }, rest), children), !!label && /* @__PURE__ */React.createElement(ui.Box, {
75
+ color: "#617391",
76
+ display: "inline-flex",
77
+ fontSize: "11px",
78
+ onClick: handleClick,
79
+ sx: {
80
+ cursor: "pointer"
81
+ }
82
+ }, label))), !!confirmMessage && /* @__PURE__ */React.createElement(ui.Confirmation, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
83
+ open: showConfirm,
84
+ message: confirmMessage,
85
+ title: "Please confirm",
86
+ onCancel: handleCancel,
87
+ onConfirm: handleConfirm
88
+ }, color === "error" && errorConfirmProps), confirmProps)));
89
+ }
90
+
91
+ exports.default = ConfirmButton;
@@ -1,2 +1,73 @@
1
1
  'use strict';
2
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 EmailOutlinedIcon = require('@tenancy.nz/icons/EmailOutlined');
9
+ var PhoneOutlinedIcon = require('@tenancy.nz/icons/PhoneOutlined');
10
+ var ui = require('@tenancy.nz/ui');
11
+ var ContactCardHeader = require('./ContactCardHeader.cjs');
12
+ var ContactMethod = require('./ContactMethod.cjs');
13
+
14
+ var _excluded = ["avatarColor", "avatarUrl", "email", "firstName", "lastName", "mobile", "phone", "role", "sx"];
15
+ function ContactCard(_ref) {
16
+ var _ref$avatarColor = _ref.avatarColor,
17
+ avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
18
+ _ref$avatarUrl = _ref.avatarUrl,
19
+ avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
20
+ _ref$email = _ref.email,
21
+ email = _ref$email === void 0 ? void 0 : _ref$email,
22
+ _ref$firstName = _ref.firstName,
23
+ firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
24
+ _ref$lastName = _ref.lastName,
25
+ lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
26
+ _ref$mobile = _ref.mobile,
27
+ mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
28
+ _ref$phone = _ref.phone,
29
+ phone = _ref$phone === void 0 ? void 0 : _ref$phone,
30
+ _ref$role = _ref.role,
31
+ role = _ref$role === void 0 ? void 0 : _ref$role,
32
+ _ref$sx = _ref.sx,
33
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
34
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
35
+ return /* @__PURE__ */React.createElement(ui.Paper, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
36
+ inset: "large"
37
+ }, rest), {}, {
38
+ sx: sx,
39
+ outlined: true
40
+ }), /* @__PURE__ */React.createElement(Stack, {
41
+ gap: 4
42
+ }, /* @__PURE__ */React.createElement(ContactCardHeader.default, {
43
+ avatarColor: avatarColor,
44
+ avatarUrl: avatarUrl,
45
+ firstName: firstName,
46
+ lastName: lastName,
47
+ role: role
48
+ }), /* @__PURE__ */React.createElement(Stack, {
49
+ divider: /* @__PURE__ */React.createElement(ui.Divider, {
50
+ disableGutter: true
51
+ })
52
+ }, email && /* @__PURE__ */React.createElement(ContactMethod.default, {
53
+ label: "Email",
54
+ type: "email",
55
+ value: email,
56
+ Icon: EmailOutlinedIcon,
57
+ tooltip: "Email"
58
+ }), mobile && /* @__PURE__ */React.createElement(ContactMethod.default, {
59
+ label: "Mobile",
60
+ type: "phone",
61
+ value: mobile,
62
+ Icon: PhoneOutlinedIcon,
63
+ tooltip: "Call"
64
+ }), phone && /* @__PURE__ */React.createElement(ContactMethod.default, {
65
+ label: "Office",
66
+ type: "phone",
67
+ value: phone,
68
+ Icon: PhoneOutlinedIcon,
69
+ tooltip: "Call"
70
+ }))));
71
+ }
72
+
73
+ exports.default = ContactCard;
@@ -5,28 +5,28 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.cjs');
6
6
  var React = require('react');
7
7
  var Stack = require('@mui/material/Stack');
8
+ var ProfileOutlinedIcon = require('@tenancy.nz/icons/ProfileOutlined');
8
9
  var ui = require('@tenancy.nz/ui');
9
10
 
10
- var _excluded = ["avatarColor", "avatarUrl", "disabled", "email", "firstName", "lastName", "mobile", "sx"];
11
- var CONTACT_TEXT = {
12
- default: ui.token("palette.semantic.text.secondaryColor"),
13
- disabled: ui.token("palette.semantic.text.disabledColor")
11
+ var _excluded = ["avatarColor", "avatarUrl", "firstName", "lastName", "role", "sx"];
12
+ var styles = {
13
+ role: {
14
+ display: "flex",
15
+ alignItems: "center",
16
+ gap: 1
17
+ }
14
18
  };
15
19
  function ContactCardHeader(_ref) {
16
20
  var _ref$avatarColor = _ref.avatarColor,
17
21
  avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
18
22
  _ref$avatarUrl = _ref.avatarUrl,
19
23
  avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
20
- _ref$disabled = _ref.disabled,
21
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
22
- _ref$email = _ref.email,
23
- email = _ref$email === void 0 ? void 0 : _ref$email,
24
24
  _ref$firstName = _ref.firstName,
25
25
  firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
26
26
  _ref$lastName = _ref.lastName,
27
27
  lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
28
- _ref$mobile = _ref.mobile,
29
- mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
28
+ _ref$role = _ref.role,
29
+ role = _ref$role === void 0 ? void 0 : _ref$role,
30
30
  _ref$sx = _ref.sx,
31
31
  sx = _ref$sx === void 0 ? {} : _ref$sx,
32
32
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
@@ -47,18 +47,13 @@ function ContactCardHeader(_ref) {
47
47
  }, name && /* @__PURE__ */React.createElement(ui.Heading, {
48
48
  as: "h5",
49
49
  color: "inherit"
50
- }, name), (email || mobile) && /* @__PURE__ */React.createElement(Stack, {
51
- sx: {
52
- color: disabled ? CONTACT_TEXT.disabled : CONTACT_TEXT.default,
53
- fontSize: "12px"
54
- }
55
- }, email && /* @__PURE__ */React.createElement(ui.Text, {
56
- variant: "inherit",
57
- weight: "500"
58
- }, email), mobile && /* @__PURE__ */React.createElement(ui.Text, {
59
- variant: "inherit",
60
- weight: "500"
61
- }, mobile))));
50
+ }, name), role && /* @__PURE__ */React.createElement(ui.Text, {
51
+ variant: "small",
52
+ color: "textPrimary",
53
+ sx: styles.role
54
+ }, /* @__PURE__ */React.createElement(ProfileOutlinedIcon, {
55
+ size: 16
56
+ }), /* @__PURE__ */React.createElement("span", null, role))));
62
57
  }
63
58
 
64
59
  exports.default = ContactCardHeader;
@@ -0,0 +1,111 @@
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 CopyOutlinedIcon = require('@tenancy.nz/icons/CopyOutlined');
9
+ var ui = require('@tenancy.nz/ui');
10
+
11
+ var _excluded = ["Icon", "label", "sx", "type", "value", "tooltip"];
12
+ var ActionButton = ui.IconButton;
13
+ var wide = "@420/contact-method";
14
+ var styles = {
15
+ container: {
16
+ containerType: "inline-size",
17
+ containerName: "contact-method"
18
+ },
19
+ details: {
20
+ flexDirection: _rollupPluginBabelHelpers.defineProperty({}, wide, "row"),
21
+ alignItems: _rollupPluginBabelHelpers.defineProperty({}, wide, "center"),
22
+ gap: _rollupPluginBabelHelpers.defineProperty({
23
+ xs: 1
24
+ }, wide, 4)
25
+ },
26
+ copyButton: {
27
+ display: _rollupPluginBabelHelpers.defineProperty({
28
+ xs: "none"
29
+ }, wide, "inline-flex")
30
+ }
31
+ };
32
+ var makeHref = function makeHref(type, value) {
33
+ if (!type) {
34
+ return "";
35
+ }
36
+ if (type === "email") {
37
+ return "mailto:".concat(value);
38
+ }
39
+ if (type === "phone") {
40
+ return "tel:".concat(value);
41
+ }
42
+ return "";
43
+ };
44
+ function ContactMethod(_ref) {
45
+ var _ref$Icon = _ref.Icon,
46
+ Icon = _ref$Icon === void 0 ? void 0 : _ref$Icon,
47
+ _ref$label = _ref.label,
48
+ label = _ref$label === void 0 ? void 0 : _ref$label,
49
+ _ref$sx = _ref.sx,
50
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
51
+ _ref$type = _ref.type,
52
+ type = _ref$type === void 0 ? "" : _ref$type,
53
+ _ref$value = _ref.value,
54
+ value = _ref$value === void 0 ? void 0 : _ref$value,
55
+ _ref$tooltip = _ref.tooltip,
56
+ tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip,
57
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
58
+ if (!value) {
59
+ return null;
60
+ }
61
+ var handleCopy = function handleCopy() {
62
+ var _navigator$clipboard;
63
+ (_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 || _navigator$clipboard.writeText(value);
64
+ };
65
+ var href = makeHref(type, value);
66
+ return /* @__PURE__ */React.createElement(Stack, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
67
+ direction: "row",
68
+ alignItems: "center",
69
+ gap: 4,
70
+ py: 3
71
+ }, rest), {}, {
72
+ sx: [styles.container].concat(_rollupPluginBabelHelpers.toConsumableArray(Array.isArray(sx) ? sx : [sx]))
73
+ }), /* @__PURE__ */React.createElement(Stack, {
74
+ sx: styles.details
75
+ }, label && /* @__PURE__ */React.createElement(ui.Text, {
76
+ variant: "body2",
77
+ weight: "600",
78
+ color: "textPrimary",
79
+ sx: {
80
+ width: "64px"
81
+ }
82
+ }, label), /* @__PURE__ */React.createElement(ui.Text, {
83
+ color: "textPrimary"
84
+ }, value)), /* @__PURE__ */React.createElement(Stack, {
85
+ direction: "row",
86
+ ml: "auto",
87
+ flexShrink: 0
88
+ }, /* @__PURE__ */React.createElement(ui.Tooltip, {
89
+ title: "Copy",
90
+ placement: "top"
91
+ }, /* @__PURE__ */React.createElement(ActionButton, {
92
+ "aria-label": "Copy ".concat(label !== null && label !== void 0 ? label : value),
93
+ color: "primary",
94
+ onClick: handleCopy,
95
+ sx: styles.copyButton
96
+ }, /* @__PURE__ */React.createElement(CopyOutlinedIcon, {
97
+ size: 20
98
+ }))), Icon && href && /* @__PURE__ */React.createElement(ui.Tooltip, {
99
+ title: tooltip,
100
+ placement: "top"
101
+ }, /* @__PURE__ */React.createElement(ActionButton, {
102
+ component: "a",
103
+ color: "primary",
104
+ href: href,
105
+ "aria-label": label
106
+ }, /* @__PURE__ */React.createElement(Icon, {
107
+ size: 20
108
+ })))));
109
+ }
110
+
111
+ exports.default = ContactMethod;
@@ -0,0 +1,17 @@
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 DeleteOutlinedIcon = require('@tenancy.nz/icons/DeleteOutlined');
8
+ var ConfirmButton = require('./ConfirmButton.cjs');
9
+
10
+ function DeleteIconButton(_ref) {
11
+ var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
12
+ return /* @__PURE__ */React.createElement(ConfirmButton.default, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rest), {}, {
13
+ color: "error"
14
+ }), /* @__PURE__ */React.createElement(DeleteOutlinedIcon, null));
15
+ }
16
+
17
+ exports.default = DeleteIconButton;
@@ -0,0 +1,17 @@
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 DownloadOutlinedIcon = require('@tenancy.nz/icons/DownloadOutlined');
8
+ var ui = require('@tenancy.nz/ui');
9
+
10
+ function DownloadIconButton(_ref) {
11
+ var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
12
+ return /* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
13
+ color: "primary"
14
+ }, rest), /* @__PURE__ */React.createElement(DownloadOutlinedIcon, null));
15
+ }
16
+
17
+ exports.default = DownloadIconButton;
@@ -0,0 +1,17 @@
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 EditOutlinedIcon = require('@tenancy.nz/icons/EditOutlined');
8
+ var ConfirmButton = require('./ConfirmButton.cjs');
9
+
10
+ function EditIconButton(_ref) {
11
+ var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
12
+ return /* @__PURE__ */React.createElement(ConfirmButton.default, _rollupPluginBabelHelpers.objectSpread2({
13
+ color: "primary"
14
+ }, rest), /* @__PURE__ */React.createElement(EditOutlinedIcon, null));
15
+ }
16
+
17
+ exports.default = EditIconButton;
@@ -0,0 +1,17 @@
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 LogoutOutlinedIcon = require('@tenancy.nz/icons/LogoutOutlined');
8
+ var ui = require('@tenancy.nz/ui');
9
+
10
+ function LogoutButton(_ref) {
11
+ var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
12
+ return /* @__PURE__ */React.createElement(ui.Button, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, rest), {}, {
13
+ startIcon: /* @__PURE__ */React.createElement(LogoutOutlinedIcon, null)
14
+ }), "Logout");
15
+ }
16
+
17
+ exports.default = LogoutButton;
@@ -0,0 +1,17 @@
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 ExternalLinkOutlinedIcon = require('@tenancy.nz/icons/ExternalLinkOutlined');
8
+ var ui = require('@tenancy.nz/ui');
9
+
10
+ function OpenInNewIconButton(_ref) {
11
+ var rest = _rollupPluginBabelHelpers.extends({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
12
+ return /* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
13
+ color: "primary"
14
+ }, rest), /* @__PURE__ */React.createElement(ExternalLinkOutlinedIcon, null));
15
+ }
16
+
17
+ exports.default = OpenInNewIconButton;
@@ -179,7 +179,8 @@ function ScrollTopButton(_ref2) {
179
179
  return withPortal(withPlacement(/* @__PURE__ */React.createElement(ui.IconButton, _rollupPluginBabelHelpers.objectSpread2({
180
180
  variant: "outlined",
181
181
  size: "large",
182
- onClick: handleClick
182
+ onClick: handleClick,
183
+ color: "primary"
183
184
  }, rest), icon)));
184
185
  }
185
186
  return withPortal(withPlacement(/* @__PURE__ */React.createElement(ui.Button, _rollupPluginBabelHelpers.objectSpread2({
@@ -3,11 +3,19 @@
3
3
  var AgentDetailsCard = require('./components/AgentDetailsCard.cjs');
4
4
  var AnalyticsBox = require('./components/AnalyticsBox.cjs');
5
5
  var AnalyticsSection = require('./components/AnalyticsSection.cjs');
6
+ var BackButton = require('./components/BackButton.cjs');
6
7
  var BookingChart = require('./components/BookingChart.cjs');
7
8
  var BookingTable = require('./components/BookingTable.cjs');
8
9
  var BookingTableRow = require('./components/BookingTableRow.cjs');
9
10
  var BookingTableRowHeader = require('./components/BookingTableRowHeader.cjs');
10
11
  var BookingTableRowSkeleton = require('./components/BookingTableRowSkeleton.cjs');
12
+ var ConfirmButton = require('./components/ConfirmButton.cjs');
13
+ var ContactCard = require('./components/ContactCard.cjs');
14
+ var ContactCardHeader = require('./components/ContactCardHeader.cjs');
15
+ var ContactMethod = require('./components/ContactMethod.cjs');
16
+ var DeleteIconButton = require('./components/DeleteIconButton.cjs');
17
+ var DownloadIconButton = require('./components/DownloadIconButton.cjs');
18
+ var EditIconButton = require('./components/EditIconButton.cjs');
11
19
  var IntegrationTag = require('./components/IntegrationTag.cjs');
12
20
  var CheckedIcon = require('./components/CheckedIcon.cjs');
13
21
  var doughnutChart = require('./components/doughnut-chart.cjs');
@@ -17,7 +25,9 @@ var partnerLogo = require('./components/partner-logo.cjs');
17
25
  var GridList = require('./components/GridList.cjs');
18
26
  var Hidden = require('./components/Hidden.cjs');
19
27
  var IconLabel = require('./components/IconLabel.cjs');
28
+ var LogoutButton = require('./components/LogoutButton.cjs');
20
29
  var NotesCard = require('./components/NotesCard.cjs');
30
+ var OpenInNewIconButton = require('./components/OpenInNewIconButton.cjs');
21
31
  var PersonCard = require('./components/PersonCard.cjs');
22
32
  var PersonDetailHeader = require('./components/PersonDetailHeader.cjs');
23
33
  var PropertyCard = require('./components/PropertyCard.cjs');
@@ -30,11 +40,19 @@ var TenantAvatarGroup = require('./components/TenantAvatarGroup.cjs');
30
40
  exports.AgentDetailsCard = AgentDetailsCard.default;
31
41
  exports.AnalyticsBox = AnalyticsBox.default;
32
42
  exports.AnalyticsSection = AnalyticsSection.default;
43
+ exports.BackButton = BackButton.default;
33
44
  exports.BookingChart = BookingChart.default;
34
45
  exports.BookingTable = BookingTable.default;
35
46
  exports.BookingTableRow = BookingTableRow.default;
36
47
  exports.BookingTableRowHeader = BookingTableRowHeader.default;
37
48
  exports.BookingTableRowSkeleton = BookingTableRowSkeleton.default;
49
+ exports.ConfirmButton = ConfirmButton.default;
50
+ exports.ContactCard = ContactCard.default;
51
+ exports.ContactCardHeader = ContactCardHeader.default;
52
+ exports.ContactMethod = ContactMethod.default;
53
+ exports.DeleteIconButton = DeleteIconButton.default;
54
+ exports.DownloadIconButton = DownloadIconButton.default;
55
+ exports.EditIconButton = EditIconButton.default;
38
56
  exports.IntegrationTag = IntegrationTag.default;
39
57
  exports.CheckedIcon = CheckedIcon.default;
40
58
  exports.DoughnutChart = doughnutChart.default;
@@ -44,7 +62,9 @@ exports.PartnerLogo = partnerLogo.default;
44
62
  exports.GridList = GridList.default;
45
63
  exports.Hidden = Hidden.default;
46
64
  exports.IconLabel = IconLabel.default;
65
+ exports.LogoutButton = LogoutButton.default;
47
66
  exports.NotesCard = NotesCard.default;
67
+ exports.OpenInNewIconButton = OpenInNewIconButton.default;
48
68
  exports.PersonCard = PersonCard.default;
49
69
  exports.PersonDetailHeader = PersonDetailHeader.default;
50
70
  exports.PropertyCard = PropertyCard.default;
@@ -17,6 +17,15 @@ function _defineProperty(e, r, t) {
17
17
  writable: true
18
18
  }) : e[r] = t, e;
19
19
  }
20
+ function _extends() {
21
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
22
+ for (var e = 1; e < arguments.length; e++) {
23
+ var t = arguments[e];
24
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
25
+ }
26
+ return n;
27
+ }, _extends.apply(null, arguments);
28
+ }
20
29
  function _iterableToArray(r) {
21
30
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
22
31
  }
@@ -53,6 +62,9 @@ function _nonIterableRest() {
53
62
  function _nonIterableSpread() {
54
63
  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
64
  }
65
+ function _objectDestructuringEmpty(t) {
66
+ if (null == t) throw new TypeError("Cannot destructure " + t);
67
+ }
56
68
  function ownKeys(e, r) {
57
69
  var t = Object.keys(e);
58
70
  if (Object.getOwnPropertySymbols) {
@@ -129,4 +141,4 @@ function _unsupportedIterableToArray(r, a) {
129
141
  }
130
142
  }
131
143
 
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 };
144
+ export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _defineProperty as defineProperty, _extends as extends, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectDestructuringEmpty as objectDestructuringEmpty, _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 };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import ArrowLeftOutlinedIcon from '@tenancy.nz/icons/ArrowLeftOutlined';
3
+ import { Button } from '@tenancy.nz/ui';
4
+
5
+ function BackButton(_ref) {
6
+ var onClick = _ref.onClick;
7
+ return /* @__PURE__ */React.createElement(Button, {
8
+ startIcon: /* @__PURE__ */React.createElement(ArrowLeftOutlinedIcon, null),
9
+ variant: "outlined",
10
+ onClick: onClick
11
+ }, "Back");
12
+ }
13
+
14
+ export { BackButton as default };
@@ -0,0 +1,87 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React, { useState } from 'react';
3
+ import { Tooltip, Box, IconButton, Confirmation } from '@tenancy.nz/ui';
4
+
5
+ var _excluded = ["Component", "children", "color", "confirmMessage", "label", "onClick", "title", "confirmProps"];
6
+ var errorConfirmProps = {
7
+ severity: "error",
8
+ cancelBtnText: "Don't delete",
9
+ confirmBtnText: "Delete"
10
+ };
11
+ function ConfirmButton(_ref) {
12
+ var _ref$Component = _ref.Component,
13
+ Component = _ref$Component === void 0 ? null : _ref$Component,
14
+ children = _ref.children,
15
+ _ref$color = _ref.color,
16
+ color = _ref$color === void 0 ? "inherit" : _ref$color,
17
+ _ref$confirmMessage = _ref.confirmMessage,
18
+ confirmMessage = _ref$confirmMessage === void 0 ? void 0 : _ref$confirmMessage,
19
+ _ref$label = _ref.label,
20
+ label = _ref$label === void 0 ? "" : _ref$label,
21
+ onClick = _ref.onClick,
22
+ _ref$title = _ref.title,
23
+ title = _ref$title === void 0 ? "" : _ref$title,
24
+ _ref$confirmProps = _ref.confirmProps,
25
+ confirmProps = _ref$confirmProps === void 0 ? {} : _ref$confirmProps,
26
+ rest = _objectWithoutProperties(_ref, _excluded);
27
+ var _useState = useState(false),
28
+ _useState2 = _slicedToArray(_useState, 2),
29
+ showConfirm = _useState2[0],
30
+ setShowConfirm = _useState2[1];
31
+ var _useState3 = useState(void 0),
32
+ _useState4 = _slicedToArray(_useState3, 2),
33
+ value = _useState4[0],
34
+ setValue = _useState4[1];
35
+ var handleCancel = function handleCancel(e) {
36
+ e.stopPropagation();
37
+ setShowConfirm(false);
38
+ setValue(void 0);
39
+ };
40
+ var handleClick = function handleClick(e) {
41
+ e.stopPropagation();
42
+ if (!confirmMessage) {
43
+ onClick(e);
44
+ } else {
45
+ setShowConfirm(true);
46
+ setValue(e);
47
+ }
48
+ };
49
+ var handleConfirm = function handleConfirm() {
50
+ if (value) {
51
+ onClick(value);
52
+ }
53
+ setShowConfirm(false);
54
+ setValue(void 0);
55
+ };
56
+ return /* @__PURE__ */React.createElement(React.Fragment, null, Component ? /* @__PURE__ */React.createElement(Component, _objectSpread2({
57
+ color: color,
58
+ onClick: handleClick
59
+ }, rest), children) : /* @__PURE__ */React.createElement(Tooltip, {
60
+ title: title,
61
+ placement: "top"
62
+ }, /* @__PURE__ */React.createElement(Box, {
63
+ display: "inline-flex",
64
+ color: color.indexOf(".") === -1 ? "".concat(color, ".main") : color,
65
+ align: "center",
66
+ direction: "column"
67
+ }, /* @__PURE__ */React.createElement(IconButton, _objectSpread2({
68
+ color: color === "error" ? "error" : "inherit",
69
+ onClick: handleClick
70
+ }, rest), children), !!label && /* @__PURE__ */React.createElement(Box, {
71
+ color: "#617391",
72
+ display: "inline-flex",
73
+ fontSize: "11px",
74
+ onClick: handleClick,
75
+ sx: {
76
+ cursor: "pointer"
77
+ }
78
+ }, label))), !!confirmMessage && /* @__PURE__ */React.createElement(Confirmation, _objectSpread2(_objectSpread2({
79
+ open: showConfirm,
80
+ message: confirmMessage,
81
+ title: "Please confirm",
82
+ onCancel: handleCancel,
83
+ onConfirm: handleConfirm
84
+ }, color === "error" && errorConfirmProps), confirmProps)));
85
+ }
86
+
87
+ export { ConfirmButton as default };
@@ -1 +1,69 @@
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 EmailOutlinedIcon from '@tenancy.nz/icons/EmailOutlined';
5
+ import PhoneOutlinedIcon from '@tenancy.nz/icons/PhoneOutlined';
6
+ import { Paper, Divider } from '@tenancy.nz/ui';
7
+ import ContactCardHeader from './ContactCardHeader.js';
8
+ import ContactMethod from './ContactMethod.js';
1
9
 
10
+ var _excluded = ["avatarColor", "avatarUrl", "email", "firstName", "lastName", "mobile", "phone", "role", "sx"];
11
+ function ContactCard(_ref) {
12
+ var _ref$avatarColor = _ref.avatarColor,
13
+ avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
14
+ _ref$avatarUrl = _ref.avatarUrl,
15
+ avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
16
+ _ref$email = _ref.email,
17
+ email = _ref$email === void 0 ? void 0 : _ref$email,
18
+ _ref$firstName = _ref.firstName,
19
+ firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
20
+ _ref$lastName = _ref.lastName,
21
+ lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
22
+ _ref$mobile = _ref.mobile,
23
+ mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
24
+ _ref$phone = _ref.phone,
25
+ phone = _ref$phone === void 0 ? void 0 : _ref$phone,
26
+ _ref$role = _ref.role,
27
+ role = _ref$role === void 0 ? void 0 : _ref$role,
28
+ _ref$sx = _ref.sx,
29
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
30
+ rest = _objectWithoutProperties(_ref, _excluded);
31
+ return /* @__PURE__ */React.createElement(Paper, _objectSpread2(_objectSpread2({
32
+ inset: "large"
33
+ }, rest), {}, {
34
+ sx: sx,
35
+ outlined: true
36
+ }), /* @__PURE__ */React.createElement(Stack, {
37
+ gap: 4
38
+ }, /* @__PURE__ */React.createElement(ContactCardHeader, {
39
+ avatarColor: avatarColor,
40
+ avatarUrl: avatarUrl,
41
+ firstName: firstName,
42
+ lastName: lastName,
43
+ role: role
44
+ }), /* @__PURE__ */React.createElement(Stack, {
45
+ divider: /* @__PURE__ */React.createElement(Divider, {
46
+ disableGutter: true
47
+ })
48
+ }, email && /* @__PURE__ */React.createElement(ContactMethod, {
49
+ label: "Email",
50
+ type: "email",
51
+ value: email,
52
+ Icon: EmailOutlinedIcon,
53
+ tooltip: "Email"
54
+ }), mobile && /* @__PURE__ */React.createElement(ContactMethod, {
55
+ label: "Mobile",
56
+ type: "phone",
57
+ value: mobile,
58
+ Icon: PhoneOutlinedIcon,
59
+ tooltip: "Call"
60
+ }), phone && /* @__PURE__ */React.createElement(ContactMethod, {
61
+ label: "Office",
62
+ type: "phone",
63
+ value: phone,
64
+ Icon: PhoneOutlinedIcon,
65
+ tooltip: "Call"
66
+ }))));
67
+ }
68
+
69
+ export { ContactCard as default };
@@ -1,28 +1,28 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React from 'react';
3
3
  import Stack from '@mui/material/Stack';
4
- import { token, Avatar, Heading, Text } from '@tenancy.nz/ui';
4
+ import ProfileOutlinedIcon from '@tenancy.nz/icons/ProfileOutlined';
5
+ import { Avatar, Heading, Text } from '@tenancy.nz/ui';
5
6
 
6
- var _excluded = ["avatarColor", "avatarUrl", "disabled", "email", "firstName", "lastName", "mobile", "sx"];
7
- var CONTACT_TEXT = {
8
- default: token("palette.semantic.text.secondaryColor"),
9
- disabled: token("palette.semantic.text.disabledColor")
7
+ var _excluded = ["avatarColor", "avatarUrl", "firstName", "lastName", "role", "sx"];
8
+ var styles = {
9
+ role: {
10
+ display: "flex",
11
+ alignItems: "center",
12
+ gap: 1
13
+ }
10
14
  };
11
15
  function ContactCardHeader(_ref) {
12
16
  var _ref$avatarColor = _ref.avatarColor,
13
17
  avatarColor = _ref$avatarColor === void 0 ? "grey" : _ref$avatarColor,
14
18
  _ref$avatarUrl = _ref.avatarUrl,
15
19
  avatarUrl = _ref$avatarUrl === void 0 ? void 0 : _ref$avatarUrl,
16
- _ref$disabled = _ref.disabled,
17
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
18
- _ref$email = _ref.email,
19
- email = _ref$email === void 0 ? void 0 : _ref$email,
20
20
  _ref$firstName = _ref.firstName,
21
21
  firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
22
22
  _ref$lastName = _ref.lastName,
23
23
  lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
24
- _ref$mobile = _ref.mobile,
25
- mobile = _ref$mobile === void 0 ? void 0 : _ref$mobile,
24
+ _ref$role = _ref.role,
25
+ role = _ref$role === void 0 ? void 0 : _ref$role,
26
26
  _ref$sx = _ref.sx,
27
27
  sx = _ref$sx === void 0 ? {} : _ref$sx,
28
28
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -43,18 +43,13 @@ function ContactCardHeader(_ref) {
43
43
  }, name && /* @__PURE__ */React.createElement(Heading, {
44
44
  as: "h5",
45
45
  color: "inherit"
46
- }, name), (email || mobile) && /* @__PURE__ */React.createElement(Stack, {
47
- sx: {
48
- color: disabled ? CONTACT_TEXT.disabled : CONTACT_TEXT.default,
49
- fontSize: "12px"
50
- }
51
- }, email && /* @__PURE__ */React.createElement(Text, {
52
- variant: "inherit",
53
- weight: "500"
54
- }, email), mobile && /* @__PURE__ */React.createElement(Text, {
55
- variant: "inherit",
56
- weight: "500"
57
- }, mobile))));
46
+ }, name), role && /* @__PURE__ */React.createElement(Text, {
47
+ variant: "small",
48
+ color: "textPrimary",
49
+ sx: styles.role
50
+ }, /* @__PURE__ */React.createElement(ProfileOutlinedIcon, {
51
+ size: 16
52
+ }), /* @__PURE__ */React.createElement("span", null, role))));
58
53
  }
59
54
 
60
55
  export { ContactCardHeader as default };
@@ -0,0 +1,107 @@
1
+ import { defineProperty as _defineProperty, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import Stack from '@mui/material/Stack';
4
+ import CopyOutlinedIcon from '@tenancy.nz/icons/CopyOutlined';
5
+ import { Text, Tooltip, IconButton } from '@tenancy.nz/ui';
6
+
7
+ var _excluded = ["Icon", "label", "sx", "type", "value", "tooltip"];
8
+ var ActionButton = IconButton;
9
+ var wide = "@420/contact-method";
10
+ var styles = {
11
+ container: {
12
+ containerType: "inline-size",
13
+ containerName: "contact-method"
14
+ },
15
+ details: {
16
+ flexDirection: _defineProperty({}, wide, "row"),
17
+ alignItems: _defineProperty({}, wide, "center"),
18
+ gap: _defineProperty({
19
+ xs: 1
20
+ }, wide, 4)
21
+ },
22
+ copyButton: {
23
+ display: _defineProperty({
24
+ xs: "none"
25
+ }, wide, "inline-flex")
26
+ }
27
+ };
28
+ var makeHref = function makeHref(type, value) {
29
+ if (!type) {
30
+ return "";
31
+ }
32
+ if (type === "email") {
33
+ return "mailto:".concat(value);
34
+ }
35
+ if (type === "phone") {
36
+ return "tel:".concat(value);
37
+ }
38
+ return "";
39
+ };
40
+ function ContactMethod(_ref) {
41
+ var _ref$Icon = _ref.Icon,
42
+ Icon = _ref$Icon === void 0 ? void 0 : _ref$Icon,
43
+ _ref$label = _ref.label,
44
+ label = _ref$label === void 0 ? void 0 : _ref$label,
45
+ _ref$sx = _ref.sx,
46
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
47
+ _ref$type = _ref.type,
48
+ type = _ref$type === void 0 ? "" : _ref$type,
49
+ _ref$value = _ref.value,
50
+ value = _ref$value === void 0 ? void 0 : _ref$value,
51
+ _ref$tooltip = _ref.tooltip,
52
+ tooltip = _ref$tooltip === void 0 ? "" : _ref$tooltip,
53
+ rest = _objectWithoutProperties(_ref, _excluded);
54
+ if (!value) {
55
+ return null;
56
+ }
57
+ var handleCopy = function handleCopy() {
58
+ var _navigator$clipboard;
59
+ (_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 || _navigator$clipboard.writeText(value);
60
+ };
61
+ var href = makeHref(type, value);
62
+ return /* @__PURE__ */React.createElement(Stack, _objectSpread2(_objectSpread2({
63
+ direction: "row",
64
+ alignItems: "center",
65
+ gap: 4,
66
+ py: 3
67
+ }, rest), {}, {
68
+ sx: [styles.container].concat(_toConsumableArray(Array.isArray(sx) ? sx : [sx]))
69
+ }), /* @__PURE__ */React.createElement(Stack, {
70
+ sx: styles.details
71
+ }, label && /* @__PURE__ */React.createElement(Text, {
72
+ variant: "body2",
73
+ weight: "600",
74
+ color: "textPrimary",
75
+ sx: {
76
+ width: "64px"
77
+ }
78
+ }, label), /* @__PURE__ */React.createElement(Text, {
79
+ color: "textPrimary"
80
+ }, value)), /* @__PURE__ */React.createElement(Stack, {
81
+ direction: "row",
82
+ ml: "auto",
83
+ flexShrink: 0
84
+ }, /* @__PURE__ */React.createElement(Tooltip, {
85
+ title: "Copy",
86
+ placement: "top"
87
+ }, /* @__PURE__ */React.createElement(ActionButton, {
88
+ "aria-label": "Copy ".concat(label !== null && label !== void 0 ? label : value),
89
+ color: "primary",
90
+ onClick: handleCopy,
91
+ sx: styles.copyButton
92
+ }, /* @__PURE__ */React.createElement(CopyOutlinedIcon, {
93
+ size: 20
94
+ }))), Icon && href && /* @__PURE__ */React.createElement(Tooltip, {
95
+ title: tooltip,
96
+ placement: "top"
97
+ }, /* @__PURE__ */React.createElement(ActionButton, {
98
+ component: "a",
99
+ color: "primary",
100
+ href: href,
101
+ "aria-label": label
102
+ }, /* @__PURE__ */React.createElement(Icon, {
103
+ size: 20
104
+ })))));
105
+ }
106
+
107
+ export { ContactMethod as default };
@@ -0,0 +1,13 @@
1
+ import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import DeleteOutlinedIcon from '@tenancy.nz/icons/DeleteOutlined';
4
+ import ConfirmButton from './ConfirmButton.js';
5
+
6
+ function DeleteIconButton(_ref) {
7
+ var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
8
+ return /* @__PURE__ */React.createElement(ConfirmButton, _objectSpread2(_objectSpread2({}, rest), {}, {
9
+ color: "error"
10
+ }), /* @__PURE__ */React.createElement(DeleteOutlinedIcon, null));
11
+ }
12
+
13
+ export { DeleteIconButton as default };
@@ -0,0 +1,13 @@
1
+ import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import DownloadOutlinedIcon from '@tenancy.nz/icons/DownloadOutlined';
4
+ import { IconButton } from '@tenancy.nz/ui';
5
+
6
+ function DownloadIconButton(_ref) {
7
+ var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
8
+ return /* @__PURE__ */React.createElement(IconButton, _objectSpread2({
9
+ color: "primary"
10
+ }, rest), /* @__PURE__ */React.createElement(DownloadOutlinedIcon, null));
11
+ }
12
+
13
+ export { DownloadIconButton as default };
@@ -0,0 +1,13 @@
1
+ import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import EditOutlinedIcon from '@tenancy.nz/icons/EditOutlined';
4
+ import ConfirmButton from './ConfirmButton.js';
5
+
6
+ function EditIconButton(_ref) {
7
+ var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
8
+ return /* @__PURE__ */React.createElement(ConfirmButton, _objectSpread2({
9
+ color: "primary"
10
+ }, rest), /* @__PURE__ */React.createElement(EditOutlinedIcon, null));
11
+ }
12
+
13
+ export { EditIconButton as default };
@@ -0,0 +1,13 @@
1
+ import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import LogoutOutlinedIcon from '@tenancy.nz/icons/LogoutOutlined';
4
+ import { Button } from '@tenancy.nz/ui';
5
+
6
+ function LogoutButton(_ref) {
7
+ var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
8
+ return /* @__PURE__ */React.createElement(Button, _objectSpread2(_objectSpread2({}, rest), {}, {
9
+ startIcon: /* @__PURE__ */React.createElement(LogoutOutlinedIcon, null)
10
+ }), "Logout");
11
+ }
12
+
13
+ export { LogoutButton as default };
@@ -0,0 +1,13 @@
1
+ import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import ExternalLinkOutlinedIcon from '@tenancy.nz/icons/ExternalLinkOutlined';
4
+ import { IconButton } from '@tenancy.nz/ui';
5
+
6
+ function OpenInNewIconButton(_ref) {
7
+ var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
8
+ return /* @__PURE__ */React.createElement(IconButton, _objectSpread2({
9
+ color: "primary"
10
+ }, rest), /* @__PURE__ */React.createElement(ExternalLinkOutlinedIcon, null));
11
+ }
12
+
13
+ export { OpenInNewIconButton as default };
@@ -175,7 +175,8 @@ function ScrollTopButton(_ref2) {
175
175
  return withPortal(withPlacement(/* @__PURE__ */React.createElement(IconButton, _objectSpread2({
176
176
  variant: "outlined",
177
177
  size: "large",
178
- onClick: handleClick
178
+ onClick: handleClick,
179
+ color: "primary"
179
180
  }, rest), icon)));
180
181
  }
181
182
  return withPortal(withPlacement(/* @__PURE__ */React.createElement(Button, _objectSpread2({
package/dist/esm/index.js CHANGED
@@ -1,11 +1,19 @@
1
1
  export { default as AgentDetailsCard } from './components/AgentDetailsCard.js';
2
2
  export { default as AnalyticsBox } from './components/AnalyticsBox.js';
3
3
  export { default as AnalyticsSection } from './components/AnalyticsSection.js';
4
+ export { default as BackButton } from './components/BackButton.js';
4
5
  export { default as BookingChart } from './components/BookingChart.js';
5
6
  export { default as BookingTable } from './components/BookingTable.js';
6
7
  export { default as BookingTableRow } from './components/BookingTableRow.js';
7
8
  export { default as BookingTableRowHeader } from './components/BookingTableRowHeader.js';
8
9
  export { default as BookingTableRowSkeleton } from './components/BookingTableRowSkeleton.js';
10
+ export { default as ConfirmButton } from './components/ConfirmButton.js';
11
+ export { default as ContactCard } from './components/ContactCard.js';
12
+ export { default as ContactCardHeader } from './components/ContactCardHeader.js';
13
+ export { default as ContactMethod } from './components/ContactMethod.js';
14
+ export { default as DeleteIconButton } from './components/DeleteIconButton.js';
15
+ export { default as DownloadIconButton } from './components/DownloadIconButton.js';
16
+ export { default as EditIconButton } from './components/EditIconButton.js';
9
17
  export { default as IntegrationTag } from './components/IntegrationTag.js';
10
18
  export { default as CheckedIcon } from './components/CheckedIcon.js';
11
19
  export { default as DoughnutChart } from './components/doughnut-chart.js';
@@ -15,7 +23,9 @@ export { default as PartnerLogo } from './components/partner-logo.js';
15
23
  export { default as GridList } from './components/GridList.js';
16
24
  export { default as Hidden } from './components/Hidden.js';
17
25
  export { default as IconLabel } from './components/IconLabel.js';
26
+ export { default as LogoutButton } from './components/LogoutButton.js';
18
27
  export { default as NotesCard } from './components/NotesCard.js';
28
+ export { default as OpenInNewIconButton } from './components/OpenInNewIconButton.js';
19
29
  export { default as PersonCard } from './components/PersonCard.js';
20
30
  export { default as PersonDetailHeader } from './components/PersonDetailHeader.js';
21
31
  export { default as PropertyCard } from './components/PropertyCard.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.10.6",
4
+ "version": "1.10.7",
5
5
  "author": "TPS <https://www.tenancy.co.nz>",
6
6
  "type": "module",
7
7
  "main": "dist/cjs/index.cjs",
@@ -19,15 +19,15 @@
19
19
  "primereact": "3.1.3",
20
20
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
21
21
  "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
22
- "@tenancy.nz/ui": "1.10.6",
23
- "@tenancy.nz/icons": "1.10.6"
22
+ "@tenancy.nz/icons": "1.10.7",
23
+ "@tenancy.nz/ui": "1.10.7"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@emotion/react": "^11.14.0",
27
27
  "@emotion/styled": "^11.14.1",
28
28
  "@mui/material": "^7.3.1",
29
- "@tenancy.nz/icons": "1.10.6",
30
- "@tenancy.nz/ui": "1.10.6"
29
+ "@tenancy.nz/icons": "1.10.7",
30
+ "@tenancy.nz/ui": "1.10.7"
31
31
  },
32
32
  "dependencies": {
33
33
  "react-uid": "^2.4.0"