@tenancy.nz/feature-ui 1.10.6 → 1.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/_virtual/_rollupPluginBabelHelpers.cjs +15 -4
  2. package/dist/cjs/components/BackButton.cjs +18 -0
  3. package/dist/cjs/components/ConfirmButton.cjs +91 -0
  4. package/dist/cjs/components/ContactCard.cjs +71 -0
  5. package/dist/cjs/components/ContactCardHeader.cjs +17 -22
  6. package/dist/cjs/components/ContactMethod.cjs +111 -0
  7. package/dist/cjs/components/DeleteIconButton.cjs +17 -0
  8. package/dist/cjs/components/DownloadIconButton.cjs +17 -0
  9. package/dist/cjs/components/EditIconButton.cjs +17 -0
  10. package/dist/cjs/components/LogoutButton.cjs +17 -0
  11. package/dist/cjs/components/OpenInNewIconButton.cjs +17 -0
  12. package/dist/cjs/components/ScrollTopButton.cjs +2 -1
  13. package/dist/cjs/index.cjs +20 -10
  14. package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +14 -5
  15. package/dist/esm/components/BackButton.js +14 -0
  16. package/dist/esm/components/ConfirmButton.js +87 -0
  17. package/dist/esm/components/ContactCard.js +68 -0
  18. package/dist/esm/components/ContactCardHeader.js +18 -23
  19. package/dist/esm/components/ContactMethod.js +107 -0
  20. package/dist/esm/components/DeleteIconButton.js +13 -0
  21. package/dist/esm/components/DownloadIconButton.js +13 -0
  22. package/dist/esm/components/EditIconButton.js +13 -0
  23. package/dist/esm/components/LogoutButton.js +13 -0
  24. package/dist/esm/components/OpenInNewIconButton.js +13 -0
  25. package/dist/esm/components/ScrollTopButton.js +2 -1
  26. package/dist/esm/index.js +10 -5
  27. package/package.json +5 -7
  28. package/dist/cjs/components/AnalyticsSection.cjs +0 -186
  29. package/dist/cjs/components/BookingChart.cjs +0 -128
  30. package/dist/cjs/components/BookingChart.styled.cjs +0 -48
  31. package/dist/cjs/components/ChartLegend.cjs +0 -63
  32. package/dist/cjs/components/analytics-doughnut-chart.cjs +0 -116
  33. package/dist/cjs/components/doughnut-chart.cjs +0 -130
  34. package/dist/cjs/components/pdf-analytics-section.cjs +0 -173
  35. package/dist/cjs/utils/helpers/general.cjs +0 -10
  36. package/dist/esm/components/AnalyticsSection.js +0 -182
  37. package/dist/esm/components/BookingChart.js +0 -124
  38. package/dist/esm/components/BookingChart.styled.js +0 -42
  39. package/dist/esm/components/ChartLegend.js +0 -59
  40. package/dist/esm/components/analytics-doughnut-chart.js +0 -112
  41. package/dist/esm/components/doughnut-chart.js +0 -126
  42. package/dist/esm/components/pdf-analytics-section.js +0 -169
  43. package/dist/esm/utils/helpers/general.js +0 -8
@@ -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,21 +1,26 @@
1
1
  export { default as AgentDetailsCard } from './components/AgentDetailsCard.js';
2
2
  export { default as AnalyticsBox } from './components/AnalyticsBox.js';
3
- export { default as AnalyticsSection } from './components/AnalyticsSection.js';
4
- export { default as BookingChart } from './components/BookingChart.js';
3
+ export { default as BackButton } from './components/BackButton.js';
5
4
  export { default as BookingTable } from './components/BookingTable.js';
6
5
  export { default as BookingTableRow } from './components/BookingTableRow.js';
7
6
  export { default as BookingTableRowHeader } from './components/BookingTableRowHeader.js';
8
7
  export { default as BookingTableRowSkeleton } from './components/BookingTableRowSkeleton.js';
8
+ export { default as ConfirmButton } from './components/ConfirmButton.js';
9
+ export { default as ContactCard } from './components/ContactCard.js';
10
+ export { default as ContactCardHeader } from './components/ContactCardHeader.js';
11
+ export { default as ContactMethod } from './components/ContactMethod.js';
12
+ export { default as DeleteIconButton } from './components/DeleteIconButton.js';
13
+ export { default as DownloadIconButton } from './components/DownloadIconButton.js';
14
+ export { default as EditIconButton } from './components/EditIconButton.js';
9
15
  export { default as IntegrationTag } from './components/IntegrationTag.js';
10
16
  export { default as CheckedIcon } from './components/CheckedIcon.js';
11
- export { default as DoughnutChart } from './components/doughnut-chart.js';
12
- export { default as AnalyticsDoughnutChart } from './components/analytics-doughnut-chart.js';
13
- export { default as PDFAnalyticsSection } from './components/pdf-analytics-section.js';
14
17
  export { default as PartnerLogo } from './components/partner-logo.js';
15
18
  export { default as GridList } from './components/GridList.js';
16
19
  export { default as Hidden } from './components/Hidden.js';
17
20
  export { default as IconLabel } from './components/IconLabel.js';
21
+ export { default as LogoutButton } from './components/LogoutButton.js';
18
22
  export { default as NotesCard } from './components/NotesCard.js';
23
+ export { default as OpenInNewIconButton } from './components/OpenInNewIconButton.js';
19
24
  export { default as PersonCard } from './components/PersonCard.js';
20
25
  export { default as PersonDetailHeader } from './components/PersonDetailHeader.js';
21
26
  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.8",
5
5
  "author": "TPS <https://www.tenancy.co.nz>",
6
6
  "type": "module",
7
7
  "main": "dist/cjs/index.cjs",
@@ -14,20 +14,18 @@
14
14
  "@emotion/react": "^11.14.0",
15
15
  "@emotion/styled": "^11.14.1",
16
16
  "@mui/material": "^7.3.1",
17
- "chart.js": "2.7.3",
18
17
  "classnames": "^2.2.6",
19
- "primereact": "3.1.3",
20
18
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
21
19
  "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"
20
+ "@tenancy.nz/ui": "1.10.8",
21
+ "@tenancy.nz/icons": "1.10.8"
24
22
  },
25
23
  "devDependencies": {
26
24
  "@emotion/react": "^11.14.0",
27
25
  "@emotion/styled": "^11.14.1",
28
26
  "@mui/material": "^7.3.1",
29
- "@tenancy.nz/icons": "1.10.6",
30
- "@tenancy.nz/ui": "1.10.6"
27
+ "@tenancy.nz/icons": "1.10.8",
28
+ "@tenancy.nz/ui": "1.10.8"
31
29
  },
32
30
  "dependencies": {
33
31
  "react-uid": "^2.4.0"
@@ -1,186 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var React = require('react');
6
- var reactUid = require('react-uid');
7
- var Stack = require('@mui/material/Stack');
8
- var useMediaQuery = require('@mui/material/useMediaQuery');
9
- var ui = require('@tenancy.nz/ui');
10
- var AnalyticsBox = require('./AnalyticsBox.cjs');
11
- var analyticsDoughnutChart = require('./analytics-doughnut-chart.cjs');
12
-
13
- function AnalyticsSection(_ref) {
14
- var viewingsCount = _ref.viewingsCount,
15
- bookingsCount = _ref.bookingsCount,
16
- attendeesCount = _ref.attendeesCount,
17
- cancellationsCount = _ref.cancellationsCount,
18
- applicationsCount = _ref.applicationsCount,
19
- averageRent = _ref.averageRent,
20
- textUsage = _ref.textUsage,
21
- agreementsCount = _ref.agreementsCount,
22
- agreementsFinalisedCount = _ref.agreementsFinalisedCount,
23
- filterDaysCount = _ref.filterDaysCount,
24
- allHouseEnquiriesCount = _ref.allHouseEnquiriesCount,
25
- bookMeEnquiriesCount = _ref.bookMeEnquiriesCount,
26
- oneRoofEnquiriesCount = _ref.oneRoofEnquiriesCount,
27
- realestateEnquiriesCount = _ref.realestateEnquiriesCount,
28
- tradeMeEnquiriesCount = _ref.tradeMeEnquiriesCount,
29
- manualEnquiryCount = _ref.manualEnquiryCount,
30
- websiteEnquiriesCount = _ref.websiteEnquiriesCount,
31
- allHouseBookingsCount = _ref.allHouseBookingsCount,
32
- bookMeBookingsCount = _ref.bookMeBookingsCount,
33
- oneRoofBookingsCount = _ref.oneRoofBookingsCount,
34
- realestateBookingsCount = _ref.realestateBookingsCount,
35
- tradeMeBookingsCount = _ref.tradeMeBookingsCount,
36
- manualBookingsCount = _ref.manualBookingsCount,
37
- websiteBookingsCount = _ref.websiteBookingsCount,
38
- _ref$outlinedItems = _ref.outlinedItems,
39
- outlinedItems = _ref$outlinedItems === void 0 ? false : _ref$outlinedItems;
40
- var isXlUp = useMediaQuery(function (theme) {
41
- return theme.breakpoints.up("xl");
42
- });
43
- var stats = [{
44
- label: "Viewings",
45
- value: viewingsCount
46
- }, {
47
- label: "Bookings",
48
- value: bookingsCount
49
- }, {
50
- label: "Attendees",
51
- value: attendeesCount
52
- }, {
53
- label: "Cancellations",
54
- value: cancellationsCount
55
- }, {
56
- label: "Applications",
57
- value: applicationsCount
58
- }, {
59
- label: "Average Rent",
60
- value: "$".concat(averageRent)
61
- }, {
62
- label: "Text Usage Total",
63
- value: textUsage
64
- }];
65
- return /* @__PURE__ */React.createElement(Stack, {
66
- gap: 6
67
- }, /* @__PURE__ */React.createElement(Stack, {
68
- flexDirection: "row",
69
- gap: 6,
70
- flexWrap: "wrap",
71
- alignItems: "stretch"
72
- }, /* @__PURE__ */React.createElement(ui.Paper, {
73
- outlined: outlinedItems,
74
- inset: "medium",
75
- overflow: false,
76
- sx: {
77
- width: "100%",
78
- minWidth: {
79
- lg: "456px"
80
- },
81
- flex: {
82
- xs: "0 0 100%",
83
- md: 1
84
- },
85
- alignItems: "center",
86
- justifyContent: "center",
87
- display: "flex"
88
- }
89
- }, /* @__PURE__ */React.createElement(analyticsDoughnutChart.default, {
90
- tradeMeCount: tradeMeEnquiriesCount,
91
- bookMeCount: bookMeEnquiriesCount,
92
- manualCount: manualEnquiryCount,
93
- allhouseCount: allHouseEnquiriesCount,
94
- oneRoofCount: oneRoofEnquiriesCount,
95
- realEstateCount: realestateEnquiriesCount,
96
- websiteCount: websiteEnquiriesCount,
97
- heading: "Number of enquiries"
98
- })), /* @__PURE__ */React.createElement(ui.Paper, {
99
- outlined: outlinedItems,
100
- inset: "medium",
101
- overflow: false,
102
- sx: {
103
- width: "100%",
104
- minWidth: {
105
- lg: "456px"
106
- },
107
- flex: {
108
- xs: "0 0 100%",
109
- md: 1
110
- },
111
- alignItems: "center",
112
- justifyContent: "center",
113
- display: "flex"
114
- }
115
- }, /* @__PURE__ */React.createElement(analyticsDoughnutChart.default, {
116
- tradeMeCount: tradeMeBookingsCount,
117
- bookMeCount: bookMeBookingsCount,
118
- manualCount: manualBookingsCount,
119
- allhouseCount: allHouseBookingsCount,
120
- oneRoofCount: oneRoofBookingsCount,
121
- realEstateCount: realestateBookingsCount,
122
- websiteCount: websiteBookingsCount,
123
- heading: "Number of bookings"
124
- })), /* @__PURE__ */React.createElement(Stack, {
125
- gap: {
126
- xs: 3,
127
- md: 6
128
- },
129
- justifyContent: "space-between",
130
- sx: {
131
- flexDirection: {
132
- xs: "row",
133
- lg: "column"
134
- },
135
- flex: {
136
- sm: "0 0 100%",
137
- lg: "0 0 284px"
138
- }
139
- }
140
- }, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
141
- outlined: outlinedItems,
142
- label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
143
- amount: agreementsCount,
144
- width: "100%",
145
- height: isXlUp ? "157px" : "auto",
146
- text: /* @__PURE__ */React.createElement(ui.Text, {
147
- as: "span",
148
- variant: "inherit"
149
- }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "created"))
150
- }), /* @__PURE__ */React.createElement(AnalyticsBox.default, {
151
- outlined: outlinedItems,
152
- label: /* @__PURE__ */React.createElement("strong", null, "Converted Properties"),
153
- amount: agreementsFinalisedCount,
154
- width: "100%",
155
- height: isXlUp ? "157px" : "auto",
156
- text: /* @__PURE__ */React.createElement(ui.Text, {
157
- as: "span",
158
- variant: "inherit"
159
- }, "Properties that have had a viewing in the last", " ", /* @__PURE__ */React.createElement("strong", null, " ", filterDaysCount), " days where an agreement has been ", /* @__PURE__ */React.createElement("strong", null, "finalised"))
160
- })), /* @__PURE__ */React.createElement(ui.Grid, {
161
- container: true,
162
- spacing: {
163
- xs: 3,
164
- md: 6
165
- }
166
- }, stats.map(function (stat, i) {
167
- return /* @__PURE__ */React.createElement(ui.Grid, {
168
- item: true,
169
- key: reactUid.uid(stat, i),
170
- flex: {
171
- lg: 1
172
- },
173
- xs: 6,
174
- sm: 3,
175
- md: 2
176
- }, /* @__PURE__ */React.createElement(AnalyticsBox.default, {
177
- outlined: outlinedItems,
178
- label: stat.label,
179
- amount: stat.value,
180
- width: "100%",
181
- height: isXlUp ? "157px" : "124px"
182
- }));
183
- }))));
184
- }
185
-
186
- exports.default = AnalyticsSection;