@tenancy.nz/feature-ui 1.10.5 → 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.
- package/dist/cjs/_virtual/_rollupPluginBabelHelpers.cjs +14 -0
- package/dist/cjs/components/BackButton.cjs +18 -0
- package/dist/cjs/components/ConfirmButton.cjs +91 -0
- package/dist/cjs/components/ContactCard.cjs +73 -0
- package/dist/cjs/components/ContactCardHeader.cjs +59 -0
- package/dist/cjs/components/ContactMethod.cjs +111 -0
- package/dist/cjs/components/DeleteIconButton.cjs +17 -0
- package/dist/cjs/components/DownloadIconButton.cjs +17 -0
- package/dist/cjs/components/EditIconButton.cjs +17 -0
- package/dist/cjs/components/LogoutButton.cjs +17 -0
- package/dist/cjs/components/OpenInNewIconButton.cjs +17 -0
- package/dist/cjs/components/ScrollTopButton.cjs +194 -0
- package/dist/cjs/index.cjs +22 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +13 -1
- package/dist/esm/components/BackButton.js +14 -0
- package/dist/esm/components/ConfirmButton.js +87 -0
- package/dist/esm/components/ContactCard.js +69 -0
- package/dist/esm/components/ContactCardHeader.js +55 -0
- package/dist/esm/components/ContactMethod.js +107 -0
- package/dist/esm/components/DeleteIconButton.js +13 -0
- package/dist/esm/components/DownloadIconButton.js +13 -0
- package/dist/esm/components/EditIconButton.js +13 -0
- package/dist/esm/components/LogoutButton.js +13 -0
- package/dist/esm/components/OpenInNewIconButton.js +13 -0
- package/dist/esm/components/ScrollTopButton.js +190 -0
- package/dist/esm/index.js +11 -0
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -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,10 +25,13 @@ 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');
|
|
34
|
+
var ScrollTopButton = require('./components/ScrollTopButton.cjs');
|
|
24
35
|
var StatusButton = require('./components/StatusButton.cjs');
|
|
25
36
|
var TenantAvatarGroup = require('./components/TenantAvatarGroup.cjs');
|
|
26
37
|
|
|
@@ -29,11 +40,19 @@ var TenantAvatarGroup = require('./components/TenantAvatarGroup.cjs');
|
|
|
29
40
|
exports.AgentDetailsCard = AgentDetailsCard.default;
|
|
30
41
|
exports.AnalyticsBox = AnalyticsBox.default;
|
|
31
42
|
exports.AnalyticsSection = AnalyticsSection.default;
|
|
43
|
+
exports.BackButton = BackButton.default;
|
|
32
44
|
exports.BookingChart = BookingChart.default;
|
|
33
45
|
exports.BookingTable = BookingTable.default;
|
|
34
46
|
exports.BookingTableRow = BookingTableRow.default;
|
|
35
47
|
exports.BookingTableRowHeader = BookingTableRowHeader.default;
|
|
36
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;
|
|
37
56
|
exports.IntegrationTag = IntegrationTag.default;
|
|
38
57
|
exports.CheckedIcon = CheckedIcon.default;
|
|
39
58
|
exports.DoughnutChart = doughnutChart.default;
|
|
@@ -43,9 +62,12 @@ exports.PartnerLogo = partnerLogo.default;
|
|
|
43
62
|
exports.GridList = GridList.default;
|
|
44
63
|
exports.Hidden = Hidden.default;
|
|
45
64
|
exports.IconLabel = IconLabel.default;
|
|
65
|
+
exports.LogoutButton = LogoutButton.default;
|
|
46
66
|
exports.NotesCard = NotesCard.default;
|
|
67
|
+
exports.OpenInNewIconButton = OpenInNewIconButton.default;
|
|
47
68
|
exports.PersonCard = PersonCard.default;
|
|
48
69
|
exports.PersonDetailHeader = PersonDetailHeader.default;
|
|
49
70
|
exports.PropertyCard = PropertyCard.default;
|
|
71
|
+
exports.ScrollTopButton = ScrollTopButton.default;
|
|
50
72
|
exports.StatusButton = StatusButton.default;
|
|
51
73
|
exports.TenantAvatarGroup = TenantAvatarGroup.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 };
|
|
@@ -0,0 +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';
|
|
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 };
|
|
@@ -0,0 +1,55 @@
|
|
|
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 ProfileOutlinedIcon from '@tenancy.nz/icons/ProfileOutlined';
|
|
5
|
+
import { Avatar, Heading, Text } from '@tenancy.nz/ui';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["avatarColor", "avatarUrl", "firstName", "lastName", "role", "sx"];
|
|
8
|
+
var styles = {
|
|
9
|
+
role: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
gap: 1
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
function ContactCardHeader(_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$firstName = _ref.firstName,
|
|
21
|
+
firstName = _ref$firstName === void 0 ? void 0 : _ref$firstName,
|
|
22
|
+
_ref$lastName = _ref.lastName,
|
|
23
|
+
lastName = _ref$lastName === void 0 ? void 0 : _ref$lastName,
|
|
24
|
+
_ref$role = _ref.role,
|
|
25
|
+
role = _ref$role === void 0 ? void 0 : _ref$role,
|
|
26
|
+
_ref$sx = _ref.sx,
|
|
27
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
28
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var name = [firstName, lastName].filter(Boolean).join(" ");
|
|
30
|
+
return /* @__PURE__ */React.createElement(Stack, _objectSpread2(_objectSpread2({
|
|
31
|
+
direction: "row",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
gap: 4
|
|
34
|
+
}, rest), {}, {
|
|
35
|
+
sx: sx
|
|
36
|
+
}), /* @__PURE__ */React.createElement(Avatar, {
|
|
37
|
+
color: avatarColor,
|
|
38
|
+
src: avatarUrl,
|
|
39
|
+
alt: name,
|
|
40
|
+
size: 64
|
|
41
|
+
}), /* @__PURE__ */React.createElement(Stack, {
|
|
42
|
+
gap: 2
|
|
43
|
+
}, name && /* @__PURE__ */React.createElement(Heading, {
|
|
44
|
+
as: "h5",
|
|
45
|
+
color: "inherit"
|
|
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))));
|
|
53
|
+
}
|
|
54
|
+
|
|
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 };
|