@tenancy.nz/ui 1.0.4 → 1.0.6

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 (161) hide show
  1. package/dist/cjs/components/Alert.cjs +6 -11
  2. package/dist/cjs/components/Autocomplete.cjs +32 -34
  3. package/dist/cjs/components/Avatar.cjs +2 -5
  4. package/dist/cjs/components/AvatarCropDialog.cjs +40 -48
  5. package/dist/cjs/components/AvatarInput.cjs +86 -110
  6. package/dist/cjs/components/Badge.cjs +2 -5
  7. package/dist/cjs/components/BankAccountInput.cjs +74 -81
  8. package/dist/cjs/components/Bar.cjs +4 -6
  9. package/dist/cjs/components/BaseModal.cjs +3 -5
  10. package/dist/cjs/components/BooleanInput.cjs +37 -44
  11. package/dist/cjs/components/BorderedGrid.cjs +7 -9
  12. package/dist/cjs/components/Box.cjs +2 -5
  13. package/dist/cjs/components/Button.cjs +2 -5
  14. package/dist/cjs/components/Card.cjs +12 -21
  15. package/dist/cjs/components/CardContent.cjs +2 -5
  16. package/dist/cjs/components/Checkbox.cjs +14 -19
  17. package/dist/cjs/components/CircularProgress.cjs +2 -3
  18. package/dist/cjs/components/CollapsedText.cjs +29 -38
  19. package/dist/cjs/components/Confirmation.cjs +19 -26
  20. package/dist/cjs/components/Container.cjs +2 -5
  21. package/dist/cjs/components/CroppedImageInput.cjs +145 -167
  22. package/dist/cjs/components/CroppedImageInputActions.cjs +30 -39
  23. package/dist/cjs/components/DateInput.cjs +71 -79
  24. package/dist/cjs/components/DateNumberInput.cjs +49 -51
  25. package/dist/cjs/components/DateSelect.cjs +100 -111
  26. package/dist/cjs/components/Divider.cjs +2 -3
  27. package/dist/cjs/components/DropZone.cjs +96 -112
  28. package/dist/cjs/components/Embed.cjs +11 -15
  29. package/dist/cjs/components/FileUpload.cjs +105 -126
  30. package/dist/cjs/components/FileUploadButton.cjs +9 -14
  31. package/dist/cjs/components/FileUploadButtonLoader.cjs +4 -5
  32. package/dist/cjs/components/FileViewer.cjs +50 -69
  33. package/dist/cjs/components/FlashMessage.cjs +7 -11
  34. package/dist/cjs/components/FormControl.cjs +45 -52
  35. package/dist/cjs/components/FormFocus.cjs +2 -3
  36. package/dist/cjs/components/FormLabel.cjs +1 -4
  37. package/dist/cjs/components/Grid.cjs +8 -14
  38. package/dist/cjs/components/Heading.cjs +3 -5
  39. package/dist/cjs/components/IconButton.cjs +2 -5
  40. package/dist/cjs/components/Icons.cjs +22 -41
  41. package/dist/cjs/components/LinearProgress.cjs +2 -3
  42. package/dist/cjs/components/Link.cjs +2 -5
  43. package/dist/cjs/components/Media.cjs +7 -10
  44. package/dist/cjs/components/Modal.cjs +23 -30
  45. package/dist/cjs/components/ModalActions.cjs +3 -5
  46. package/dist/cjs/components/ModalContent.cjs +3 -5
  47. package/dist/cjs/components/ModalHeader.cjs +10 -17
  48. package/dist/cjs/components/Nameplate.cjs +39 -64
  49. package/dist/cjs/components/Pagination.cjs +12 -17
  50. package/dist/cjs/components/Paper.cjs +3 -5
  51. package/dist/cjs/components/Popper.cjs +13 -17
  52. package/dist/cjs/components/PropertyCard.cjs +62 -90
  53. package/dist/cjs/components/Radio.cjs +14 -19
  54. package/dist/cjs/components/Rating.cjs +2 -3
  55. package/dist/cjs/components/Select.cjs +17 -24
  56. package/dist/cjs/components/Skeleton.cjs +3 -5
  57. package/dist/cjs/components/StatusMessage.cjs +3 -5
  58. package/dist/cjs/components/StepIcon.cjs +13 -20
  59. package/dist/cjs/components/Stepper.cjs +29 -35
  60. package/dist/cjs/components/SuccessModal.cjs +7 -16
  61. package/dist/cjs/components/Switch.cjs +17 -21
  62. package/dist/cjs/components/Tab.cjs +2 -3
  63. package/dist/cjs/components/TabPanel.cjs +4 -6
  64. package/dist/cjs/components/Table.cjs +2 -5
  65. package/dist/cjs/components/TableBody.cjs +2 -5
  66. package/dist/cjs/components/TableCell.cjs +2 -5
  67. package/dist/cjs/components/TableContainer.cjs +2 -5
  68. package/dist/cjs/components/TableFooter.cjs +2 -5
  69. package/dist/cjs/components/TableHead.cjs +2 -5
  70. package/dist/cjs/components/TableRow.cjs +2 -5
  71. package/dist/cjs/components/Tabs.cjs +4 -6
  72. package/dist/cjs/components/Tag.cjs +8 -16
  73. package/dist/cjs/components/Text.cjs +3 -5
  74. package/dist/cjs/components/TextInput.cjs +39 -47
  75. package/dist/cjs/components/ThemeProvider.cjs +8 -15
  76. package/dist/cjs/components/TimeInput.cjs +63 -71
  77. package/dist/cjs/components/Tooltip.cjs +5 -9
  78. package/dist/cjs/index.cjs +0 -2
  79. package/dist/esm/components/Alert.js +6 -11
  80. package/dist/esm/components/Autocomplete.js +33 -35
  81. package/dist/esm/components/Avatar.js +2 -5
  82. package/dist/esm/components/AvatarCropDialog.js +41 -49
  83. package/dist/esm/components/AvatarInput.js +87 -111
  84. package/dist/esm/components/Badge.js +2 -5
  85. package/dist/esm/components/BankAccountInput.js +75 -82
  86. package/dist/esm/components/Bar.js +4 -6
  87. package/dist/esm/components/BaseModal.js +3 -5
  88. package/dist/esm/components/BooleanInput.js +38 -45
  89. package/dist/esm/components/BorderedGrid.js +7 -9
  90. package/dist/esm/components/Box.js +3 -6
  91. package/dist/esm/components/Button.js +2 -5
  92. package/dist/esm/components/Card.js +12 -21
  93. package/dist/esm/components/CardContent.js +2 -5
  94. package/dist/esm/components/Checkbox.js +14 -19
  95. package/dist/esm/components/CircularProgress.js +2 -3
  96. package/dist/esm/components/CollapsedText.js +30 -39
  97. package/dist/esm/components/Confirmation.js +19 -26
  98. package/dist/esm/components/Container.js +2 -5
  99. package/dist/esm/components/CroppedImageInput.js +146 -168
  100. package/dist/esm/components/CroppedImageInputActions.js +30 -39
  101. package/dist/esm/components/DateInput.js +72 -80
  102. package/dist/esm/components/DateNumberInput.js +50 -52
  103. package/dist/esm/components/DateSelect.js +95 -106
  104. package/dist/esm/components/Divider.js +2 -3
  105. package/dist/esm/components/DropZone.js +96 -112
  106. package/dist/esm/components/Embed.js +11 -15
  107. package/dist/esm/components/FileUpload.js +106 -127
  108. package/dist/esm/components/FileUploadButton.js +10 -15
  109. package/dist/esm/components/FileUploadButtonLoader.js +4 -5
  110. package/dist/esm/components/FileViewer.js +50 -69
  111. package/dist/esm/components/FlashMessage.js +7 -11
  112. package/dist/esm/components/FormControl.js +43 -50
  113. package/dist/esm/components/FormFocus.js +2 -3
  114. package/dist/esm/components/FormLabel.js +1 -4
  115. package/dist/esm/components/Grid.js +8 -14
  116. package/dist/esm/components/Heading.js +3 -5
  117. package/dist/esm/components/IconButton.js +2 -5
  118. package/dist/esm/components/Icons.js +22 -41
  119. package/dist/esm/components/LinearProgress.js +2 -3
  120. package/dist/esm/components/Link.js +2 -5
  121. package/dist/esm/components/Media.js +7 -10
  122. package/dist/esm/components/Modal.js +23 -30
  123. package/dist/esm/components/ModalActions.js +3 -5
  124. package/dist/esm/components/ModalContent.js +3 -5
  125. package/dist/esm/components/ModalHeader.js +10 -17
  126. package/dist/esm/components/Nameplate.js +39 -64
  127. package/dist/esm/components/Pagination.js +12 -17
  128. package/dist/esm/components/Paper.js +3 -5
  129. package/dist/esm/components/Popper.js +14 -18
  130. package/dist/esm/components/PropertyCard.js +62 -90
  131. package/dist/esm/components/Radio.js +14 -19
  132. package/dist/esm/components/Rating.js +2 -3
  133. package/dist/esm/components/Select.js +17 -24
  134. package/dist/esm/components/Skeleton.js +3 -5
  135. package/dist/esm/components/StatusMessage.js +3 -5
  136. package/dist/esm/components/StepIcon.js +13 -20
  137. package/dist/esm/components/Stepper.js +29 -35
  138. package/dist/esm/components/SuccessModal.js +8 -17
  139. package/dist/esm/components/Switch.js +17 -21
  140. package/dist/esm/components/Tab.js +2 -3
  141. package/dist/esm/components/TabPanel.js +4 -6
  142. package/dist/esm/components/Table.js +2 -5
  143. package/dist/esm/components/TableBody.js +2 -5
  144. package/dist/esm/components/TableCell.js +2 -5
  145. package/dist/esm/components/TableContainer.js +2 -5
  146. package/dist/esm/components/TableFooter.js +2 -5
  147. package/dist/esm/components/TableHead.js +2 -5
  148. package/dist/esm/components/TableRow.js +2 -5
  149. package/dist/esm/components/Tabs.js +4 -6
  150. package/dist/esm/components/Tag.js +8 -16
  151. package/dist/esm/components/Text.js +3 -5
  152. package/dist/esm/components/TextInput.js +36 -44
  153. package/dist/esm/components/ThemeProvider.js +8 -15
  154. package/dist/esm/components/TimeInput.js +64 -72
  155. package/dist/esm/components/Tooltip.js +5 -9
  156. package/dist/esm/index.js +0 -1
  157. package/package.json +1 -1
  158. package/dist/cjs/components/DatePicker.cjs +0 -167
  159. package/dist/cjs/components/DatePicker.styled.cjs +0 -22
  160. package/dist/esm/components/DatePicker.js +0 -163
  161. package/dist/esm/components/DatePicker.styled.js +0 -20
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
3
- import { jsxs, jsx } from 'react/jsx-runtime';
4
- import 'react';
3
+ import React from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import CardContent from './CardContent.js';
7
6
  import Media from './Media.js';
@@ -25,27 +24,19 @@ function Card(_ref) {
25
24
  var rest = _objectSpread2({
26
25
  elevate: elevate
27
26
  }, others);
28
- return /* @__PURE__ */jsxs(Paper, _objectSpread2(_objectSpread2({
27
+ return /* @__PURE__ */React.createElement(Paper, _objectSpread2({
29
28
  elevate: false,
30
29
  outlined: true
31
- }, rest), {}, {
32
- children: [onClick &&
33
- // <ActionArea onClick={onClick}>
34
- /* @__PURE__ */
35
- jsxs(StyledCardMedia, {
36
- children: [imgContent, !imgContent && /* @__PURE__ */jsx(Media, {
37
- src: imgSrc,
38
- title: title
39
- })]
40
- }), !onClick && /* @__PURE__ */jsx(StyledCardMedia, {
41
- children: /* @__PURE__ */jsx(Media, {
42
- src: imgSrc,
43
- title: title
44
- })
45
- }), /* @__PURE__ */jsx(CardContent, {
46
- children: children
47
- })]
48
- }));
30
+ }, rest), onClick &&
31
+ // <ActionArea onClick={onClick}>
32
+ /* @__PURE__ */
33
+ React.createElement(StyledCardMedia, null, imgContent, !imgContent && /* @__PURE__ */React.createElement(Media, {
34
+ src: imgSrc,
35
+ title: title
36
+ })), !onClick && /* @__PURE__ */React.createElement(StyledCardMedia, null, /* @__PURE__ */React.createElement(Media, {
37
+ src: imgSrc,
38
+ title: title
39
+ })), /* @__PURE__ */React.createElement(CardContent, null, children));
49
40
  }
50
41
  Card.propTypes = {
51
42
  /**
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
- import { jsx } from 'react/jsx-runtime';
3
- import 'react';
2
+ import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import { StyledCardContent } from './CardContent.styled.js';
6
5
 
7
6
  function CardContent(_ref) {
8
7
  var children = _ref.children;
9
- return /* @__PURE__ */jsx(StyledCardContent, {
10
- children: children
11
- });
8
+ return /* @__PURE__ */React.createElement(StyledCardContent, null, children);
12
9
  }
13
10
  CardContent.propTypes = {
14
11
  /**
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
3
- import { jsxs, jsx } from 'react/jsx-runtime';
4
3
  import Stack from '@mui/material/Stack';
5
4
  import Box from './Box.js';
6
5
  import FormLabel from './FormLabel.js';
@@ -32,26 +31,22 @@ function Checkbox(_ref) {
32
31
  size: size,
33
32
  name: name
34
33
  }, rest);
35
- return /* @__PURE__ */jsxs(Stack, {
34
+ return /* @__PURE__ */React.createElement(Stack, {
36
35
  direction: "row",
37
36
  gap: "10px",
38
- alignItems: "flex-start",
39
- children: [/* @__PURE__ */jsx(Box, {
40
- children: /* @__PURE__ */jsx(StyledCheckbox, _objectSpread2(_objectSpread2({}, props), {}, {
41
- disableRipple: true
42
- }))
43
- }), /* @__PURE__ */jsx(FormLabel, {
44
- htmlFor: id,
45
- size: size,
46
- disabled: disabled,
47
- margin: "none",
48
- sx: {
49
- mt: "2px",
50
- fontWeight: "500"
51
- },
52
- children: label
53
- })]
54
- });
37
+ alignItems: "flex-start"
38
+ }, /* @__PURE__ */React.createElement(Box, null, /* @__PURE__ */React.createElement(StyledCheckbox, _objectSpread2(_objectSpread2({}, props), {}, {
39
+ disableRipple: true
40
+ }))), /* @__PURE__ */React.createElement(FormLabel, {
41
+ htmlFor: id,
42
+ size: size,
43
+ disabled: disabled,
44
+ margin: "none",
45
+ sx: {
46
+ mt: "2px",
47
+ fontWeight: "500"
48
+ }
49
+ }, label));
55
50
  }
56
51
 
57
52
  export { Checkbox as default };
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  import { extends as _extends, objectDestructuringEmpty as _objectDestructuringEmpty, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
3
- import { jsx } from 'react/jsx-runtime';
4
- import 'react';
3
+ import React from 'react';
5
4
  import CircularProgress$1 from '@mui/material/CircularProgress';
6
5
 
7
6
  function CircularProgress(_ref) {
8
7
  var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
9
- return /* @__PURE__ */jsx(CircularProgress$1, _objectSpread2({}, rest));
8
+ return /* @__PURE__ */React.createElement(CircularProgress$1, _objectSpread2({}, rest));
10
9
  }
11
10
 
12
11
  export { CircularProgress as default };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';
3
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
- import { useState, useEffect } from 'react';
3
+ import React, { useState, useEffect } from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import Grid from '@mui/material/Grid';
7
6
  import { StyledCollapse, StyledButtonWrapper, StyledArrowDownIcon } from './CollapsedText.styled.js';
@@ -32,43 +31,35 @@ function CollapsedText(_ref) {
32
31
  setCollapsedSize(collapsedLines * lineHeight);
33
32
  }
34
33
  }, [collapsedLines, lineHeight]);
35
- return /* @__PURE__ */jsxs(Fragment, {
36
- children: [/* @__PURE__ */jsx(StyledCollapse, {
37
- backgroundColor: backgroundColor,
38
- collapsedSize: collapsedSize,
39
- in: open,
40
- lineHeight: lineHeight,
41
- children: children
42
- }), /* @__PURE__ */jsx(Grid, {
43
- container: true,
44
- justify: buttonJustify,
45
- children: /* @__PURE__ */jsx(Grid, {
46
- item: true,
47
- children: /* @__PURE__ */jsx(StyledButtonWrapper, {
48
- children: /* @__PURE__ */jsx(Button, {
49
- color: "primaryAlt",
50
- variant: "outlined",
51
- size: "small",
52
- onClick: function onClick() {
53
- return setOpen(!open);
54
- },
55
- endIcon: buttonJustify === "flex-end" ? /* @__PURE__ */jsx(StyledArrowDownIcon, {
56
- open: open
57
- }) : null,
58
- startIcon: buttonJustify !== "flex-end" ? /* @__PURE__ */jsx(StyledArrowDownIcon, {
59
- open: open
60
- }) : null,
61
- children: function () {
62
- if (buttonLabel && buttonLabel.open && buttonLabel.closed) {
63
- return open ? buttonLabel.open : buttonLabel.closed;
64
- }
65
- return open ? "Less" : "More";
66
- }()
67
- })
68
- })
69
- })
70
- })]
71
- });
34
+ return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(StyledCollapse, {
35
+ backgroundColor: backgroundColor,
36
+ collapsedSize: collapsedSize,
37
+ in: open,
38
+ lineHeight: lineHeight
39
+ }, children), /* @__PURE__ */React.createElement(Grid, {
40
+ container: true,
41
+ justify: buttonJustify
42
+ }, /* @__PURE__ */React.createElement(Grid, {
43
+ item: true
44
+ }, /* @__PURE__ */React.createElement(StyledButtonWrapper, null, /* @__PURE__ */React.createElement(Button, {
45
+ color: "primaryAlt",
46
+ variant: "outlined",
47
+ size: "small",
48
+ onClick: function onClick() {
49
+ return setOpen(!open);
50
+ },
51
+ endIcon: buttonJustify === "flex-end" ? /* @__PURE__ */React.createElement(StyledArrowDownIcon, {
52
+ open: open
53
+ }) : null,
54
+ startIcon: buttonJustify !== "flex-end" ? /* @__PURE__ */React.createElement(StyledArrowDownIcon, {
55
+ open: open
56
+ }) : null
57
+ }, function () {
58
+ if (buttonLabel && buttonLabel.open && buttonLabel.closed) {
59
+ return open ? buttonLabel.open : buttonLabel.closed;
60
+ }
61
+ return open ? "Less" : "More";
62
+ }())))));
72
63
  }
73
64
  CollapsedText.propTypes = {
74
65
  /**
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
2
  import React from 'react';
4
3
  import Button from './Button.js';
5
4
  import Heading from './Heading.js';
@@ -25,36 +24,30 @@ function Confirmation(_ref) {
25
24
  severity = _ref$severity === void 0 ? "default" : _ref$severity,
26
25
  _ref$title = _ref.title,
27
26
  title = _ref$title === void 0 ? "Are you sure?" : _ref$title;
28
- var actions = /* @__PURE__ */jsxs(React.Fragment, {
29
- children: [onCancel && cancelBtnText && /* @__PURE__ */jsx(Button, {
30
- onClick: onCancel,
31
- color: "primaryAlt",
32
- variant: "outlined",
33
- size: "small",
34
- loading: cancelling,
35
- children: cancelBtnText
36
- }), onConfirm && confirmBtnText && /* @__PURE__ */jsx(Button, {
37
- onClick: onConfirm,
38
- color: severity === "default" ? "primary" : severity,
39
- size: "small",
40
- loading: confirming,
41
- children: confirmBtnText
42
- })]
43
- });
44
- return /* @__PURE__ */jsx(Modal, {
27
+ var actions = /* @__PURE__ */React.createElement(React.Fragment, null, onCancel && cancelBtnText && /* @__PURE__ */React.createElement(Button, {
28
+ onClick: onCancel,
29
+ color: "primaryAlt",
30
+ variant: "outlined",
31
+ size: "small",
32
+ loading: cancelling
33
+ }, cancelBtnText), onConfirm && confirmBtnText && /* @__PURE__ */React.createElement(Button, {
34
+ onClick: onConfirm,
35
+ color: severity === "default" ? "primary" : severity,
36
+ size: "small",
37
+ loading: confirming
38
+ }, confirmBtnText));
39
+ return /* @__PURE__ */React.createElement(Modal, {
45
40
  maxWidth: "xs",
46
41
  open: open,
47
- heading: /* @__PURE__ */jsx(Heading, {
42
+ heading: /* @__PURE__ */React.createElement(Heading, {
48
43
  as: "h5",
49
- gutterBottom: false,
50
- children: title
51
- }),
44
+ gutterBottom: false
45
+ }, title),
52
46
  actions: actions,
53
- content: /* @__PURE__ */jsx(Text, {
47
+ content: /* @__PURE__ */React.createElement(Text, {
54
48
  as: "div",
55
- variant: "body2",
56
- children: message
57
- })
49
+ variant: "body2"
50
+ }, message)
58
51
  });
59
52
  }
60
53
 
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
3
- import { jsx } from 'react/jsx-runtime';
4
- import 'react';
3
+ import React from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import MuiContainer from '@mui/material/Container';
7
6
 
@@ -9,9 +8,7 @@ var _excluded = ["children"];
9
8
  function Container(_ref) {
10
9
  var children = _ref.children,
11
10
  rest = _objectWithoutProperties(_ref, _excluded);
12
- return /* @__PURE__ */jsx(MuiContainer, _objectSpread2(_objectSpread2({}, rest), {}, {
13
- children: children
14
- }));
11
+ return /* @__PURE__ */React.createElement(MuiContainer, _objectSpread2({}, rest), children);
15
12
  }
16
13
  Container.propTypes = {
17
14
  /**
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  import { slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
3
- import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
- import { useState, useRef, useEffect, useCallback, createElement } from 'react';
3
+ import React, { useState, useRef, useEffect, useCallback } from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import useMediaQuery from '@mui/material/useMediaQuery';
7
6
  import { AnimatePresence, motion } from 'framer-motion';
@@ -278,172 +277,151 @@ function CroppedImageInput(_ref) {
278
277
  }
279
278
  return false;
280
279
  };
281
- return /* @__PURE__ */jsxs(Fragment, {
282
- children: [/* @__PURE__ */jsx(FileViewer, _objectSpread2(_objectSpread2({}, fileViewerProps), {}, {
283
- file: {
284
- url: documentFile,
285
- filetype: filetype
286
- },
287
- open: viewDocument,
288
- onClose: function onClose() {
289
- return setViewDocument(false);
290
- }
291
- })), /* @__PURE__ */jsx(FormControl, {
292
- name: name,
293
- fullWidth: true,
294
- label: label,
295
- helperText: helperText,
296
- helperTextPlacement: helperTextPlacement,
297
- disabled: disabled,
298
- required: required,
299
- showError: showError,
300
- errorMessage: errorMessage,
301
- edges: edges,
302
- children: /* @__PURE__ */jsxs("div", {
303
- children: [/* @__PURE__ */createElement("input", _objectSpread2(_objectSpread2({
304
- type: "hidden",
305
- ref: input
306
- }, inputProps), {}, {
307
- key: "hidden-input"
308
- })), saving || cancelling && /* @__PURE__ */jsx(StyledCircularProgress, {}, "loading"), /* @__PURE__ */jsxs(AnimatePresence, {
309
- exitBeforeEnter: true,
310
- children: [(croppedImage || documentFile) && !showError && /* @__PURE__ */createElement(StyledSavedImage, _objectSpread2(_objectSpread2({}, fade), {}, {
311
- key: "saved-image",
312
- edges: edges
313
- }), /* @__PURE__ */jsxs(Grid, {
314
- container: true,
315
- alignItems: "center",
316
- spacing: 5,
317
- children: [/* @__PURE__ */jsxs(Grid, {
318
- item: true,
319
- xs: 12,
320
- md: 11,
321
- children: [croppedImage && /* @__PURE__ */jsx("img", {
322
- src: croppedImage,
323
- alt: ""
324
- }), documentFile && /* @__PURE__ */jsx(Grid, {
325
- item: true,
326
- xs: 12,
327
- md: 1,
328
- style: {
329
- justifyContent: "center",
330
- alignItems: "center"
331
- },
332
- children: /* @__PURE__ */jsx(IconButton, {
333
- onClick: function onClick() {
334
- return setViewDocument(true);
335
- },
336
- children: /* @__PURE__ */jsx(StyledFileIcon, {})
337
- })
338
- })]
339
- }), /* @__PURE__ */jsx(Grid, {
340
- item: true,
341
- xs: 12,
342
- md: 1,
343
- children: /* @__PURE__ */jsx(StyledDeleteIcon, {
344
- children: /* @__PURE__ */jsx(DeleteIcon, {})
345
- })
346
- })]
347
- })), !src && !documentFile && !croppedImage && (openInDialog ? /* @__PURE__ */createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
348
- key: "upload-button"
349
- }), /* @__PURE__ */jsx(FileUploadButton, {
350
- onUpload: onDrop,
351
- fullWidth: !isNotMobile,
352
- children: dropzoneLabel
353
- })) : /* @__PURE__ */createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
354
- key: "dropzone"
355
- }), /* @__PURE__ */jsx(DropZone, {
356
- loading: loading,
357
- disabled: disabled,
358
- onDrop: onDrop,
359
- edges: edges,
360
- dropzoneLabel: dropzoneLabel,
361
- dropzoneDescription: dropzoneDescription,
362
- dropzoneProps: _objectSpread2(_objectSpread2({
363
- accept: ["image/*"]
364
- }, dropzoneProps), {}, {
365
- maxFiles: 1
366
- })
367
- }))), src !== null && documentFile === null && (!croppedImage || showError) && (openInDialog ? /* @__PURE__ */jsxs(Modal, {
368
- open: true,
369
- fullWidth: true,
370
- fullScreen: true,
371
- children: [/* @__PURE__ */jsx(ModalHeader, {
372
- onClose: handleCancel,
373
- children: /* @__PURE__ */jsx(Heading, {
374
- as: "h4",
375
- children: "Crop Image"
376
- })
377
- }), /* @__PURE__ */jsx(ModalContent, {
378
- children: /* @__PURE__ */jsxs(Box, {
379
- pl: 2.5,
380
- pr: 2.5,
381
- pb: 2.5,
382
- children: [/* @__PURE__ */jsx(StyledEditor, {
383
- edges: edges,
384
- showError: showError,
385
- children: /* @__PURE__ */jsx(ReactCrop, {
386
- crop: crop,
387
- style: {
388
- width: "100%"
389
- },
390
- onChange: handleCropChange,
391
- onImageLoaded: handleImageLoaded,
392
- renderSelectionAddon: cropGuide,
393
- children: /* @__PURE__ */jsx("img", {
394
- src: src,
395
- alt: ""
396
- })
397
- })
398
- }), /* @__PURE__ */jsx(CroppedImageInputActions, {
399
- handleCancel: handleCancel,
400
- cancelling: cancelling,
401
- cancelButtonProps: cancelButtonProps,
402
- handleImageSave: handleImageSave,
403
- saving: saving,
404
- saveButtonProps: saveButtonProps,
405
- disabled: disabled
406
- })]
407
- })
408
- })]
409
- }) : /* @__PURE__ */createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
410
- key: "editor"
411
- }), /* @__PURE__ */jsx(StyledEditor, {
412
- edges: edges,
413
- showError: showError,
414
- children: /* @__PURE__ */jsx(ReactCrop, {
415
- crop: crop,
416
- style: {
417
- width: "100%"
418
- },
419
- onChange: handleCropChange,
420
- renderSelectionAddon: cropGuide,
421
- children: /* @__PURE__ */jsx("img", {
422
- src: src,
423
- alt: "",
424
- onLoad: handleImageLoaded
425
- })
426
- })
427
- })))]
428
- })]
429
- })
430
- }, "form-control"), (!openInDialog && src !== null && (!croppedImage || showError) || !openInDialog && showActions) && /* @__PURE__ */jsx(CroppedImageInputActions, {
431
- handleCancel: handleCancel,
432
- cancelling: cancelling,
433
- cancelButtonProps: cancelButtonProps,
434
- handleImageSave: handleImageSave,
435
- saving: saving,
436
- saveButtonProps: saveButtonProps,
437
- disabled: disabled
438
- }), /* @__PURE__ */jsx(Confirmation, {
439
- open: confirmDelete,
440
- onCancel: function onCancel() {
441
- return setConfirmDelete(false);
442
- },
443
- onConfirm: handleDelete,
444
- message: "Are you sure you want to remove the attached image?"
445
- })]
446
- });
280
+ return /* @__PURE__ */React.createElement(React.Fragment, null, /* @__PURE__ */React.createElement(FileViewer, _objectSpread2(_objectSpread2({}, fileViewerProps), {}, {
281
+ file: {
282
+ url: documentFile,
283
+ filetype: filetype
284
+ },
285
+ open: viewDocument,
286
+ onClose: function onClose() {
287
+ return setViewDocument(false);
288
+ }
289
+ })), /* @__PURE__ */React.createElement(FormControl, {
290
+ key: "form-control",
291
+ name: name,
292
+ fullWidth: true,
293
+ label: label,
294
+ helperText: helperText,
295
+ helperTextPlacement: helperTextPlacement,
296
+ disabled: disabled,
297
+ required: required,
298
+ showError: showError,
299
+ errorMessage: errorMessage,
300
+ edges: edges
301
+ }, /* @__PURE__ */React.createElement("div", null, /* @__PURE__ */React.createElement("input", _objectSpread2(_objectSpread2({
302
+ type: "hidden",
303
+ ref: input
304
+ }, inputProps), {}, {
305
+ key: "hidden-input"
306
+ })), saving || cancelling && /* @__PURE__ */React.createElement(StyledCircularProgress, {
307
+ key: "loading"
308
+ }), /* @__PURE__ */React.createElement(AnimatePresence, {
309
+ exitBeforeEnter: true
310
+ }, (croppedImage || documentFile) && !showError && /* @__PURE__ */React.createElement(StyledSavedImage, _objectSpread2(_objectSpread2({}, fade), {}, {
311
+ key: "saved-image",
312
+ edges: edges
313
+ }), /* @__PURE__ */React.createElement(Grid, {
314
+ container: true,
315
+ alignItems: "center",
316
+ spacing: 5
317
+ }, /* @__PURE__ */React.createElement(Grid, {
318
+ item: true,
319
+ xs: 12,
320
+ md: 11
321
+ }, croppedImage && /* @__PURE__ */React.createElement("img", {
322
+ src: croppedImage,
323
+ alt: ""
324
+ }), documentFile && /* @__PURE__ */React.createElement(Grid, {
325
+ item: true,
326
+ xs: 12,
327
+ md: 1,
328
+ style: {
329
+ justifyContent: "center",
330
+ alignItems: "center"
331
+ }
332
+ }, /* @__PURE__ */React.createElement(IconButton, {
333
+ onClick: function onClick() {
334
+ return setViewDocument(true);
335
+ }
336
+ }, /* @__PURE__ */React.createElement(StyledFileIcon, null)))), /* @__PURE__ */React.createElement(Grid, {
337
+ item: true,
338
+ xs: 12,
339
+ md: 1
340
+ }, /* @__PURE__ */React.createElement(StyledDeleteIcon, null, /* @__PURE__ */React.createElement(DeleteIcon, null))))), !src && !documentFile && !croppedImage && (openInDialog ? /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
341
+ key: "upload-button"
342
+ }), /* @__PURE__ */React.createElement(FileUploadButton, {
343
+ onUpload: onDrop,
344
+ fullWidth: !isNotMobile
345
+ }, dropzoneLabel)) : /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
346
+ key: "dropzone"
347
+ }), /* @__PURE__ */React.createElement(DropZone, {
348
+ loading: loading,
349
+ disabled: disabled,
350
+ onDrop: onDrop,
351
+ edges: edges,
352
+ dropzoneLabel: dropzoneLabel,
353
+ dropzoneDescription: dropzoneDescription,
354
+ dropzoneProps: _objectSpread2(_objectSpread2({
355
+ accept: ["image/*"]
356
+ }, dropzoneProps), {}, {
357
+ maxFiles: 1
358
+ })
359
+ }))), src !== null && documentFile === null && (!croppedImage || showError) && (openInDialog ? /* @__PURE__ */React.createElement(Modal, {
360
+ open: true,
361
+ fullWidth: true,
362
+ fullScreen: true
363
+ }, /* @__PURE__ */React.createElement(ModalHeader, {
364
+ onClose: handleCancel
365
+ }, /* @__PURE__ */React.createElement(Heading, {
366
+ as: "h4"
367
+ }, "Crop Image")), /* @__PURE__ */React.createElement(ModalContent, null, /* @__PURE__ */React.createElement(Box, {
368
+ pl: 2.5,
369
+ pr: 2.5,
370
+ pb: 2.5
371
+ }, /* @__PURE__ */React.createElement(StyledEditor, {
372
+ edges: edges,
373
+ showError: showError
374
+ }, /* @__PURE__ */React.createElement(ReactCrop, {
375
+ crop: crop,
376
+ style: {
377
+ width: "100%"
378
+ },
379
+ onChange: handleCropChange,
380
+ onImageLoaded: handleImageLoaded,
381
+ renderSelectionAddon: cropGuide
382
+ }, /* @__PURE__ */React.createElement("img", {
383
+ src: src,
384
+ alt: ""
385
+ }))), /* @__PURE__ */React.createElement(CroppedImageInputActions, {
386
+ handleCancel: handleCancel,
387
+ cancelling: cancelling,
388
+ cancelButtonProps: cancelButtonProps,
389
+ handleImageSave: handleImageSave,
390
+ saving: saving,
391
+ saveButtonProps: saveButtonProps,
392
+ disabled: disabled
393
+ })))) : /* @__PURE__ */React.createElement(motion.div, _objectSpread2(_objectSpread2({}, fade), {}, {
394
+ key: "editor"
395
+ }), /* @__PURE__ */React.createElement(StyledEditor, {
396
+ edges: edges,
397
+ showError: showError
398
+ }, /* @__PURE__ */React.createElement(ReactCrop, {
399
+ crop: crop,
400
+ style: {
401
+ width: "100%"
402
+ },
403
+ onChange: handleCropChange,
404
+ renderSelectionAddon: cropGuide
405
+ }, /* @__PURE__ */React.createElement("img", {
406
+ src: src,
407
+ alt: "",
408
+ onLoad: handleImageLoaded
409
+ })))))))), (!openInDialog && src !== null && (!croppedImage || showError) || !openInDialog && showActions) && /* @__PURE__ */React.createElement(CroppedImageInputActions, {
410
+ handleCancel: handleCancel,
411
+ cancelling: cancelling,
412
+ cancelButtonProps: cancelButtonProps,
413
+ handleImageSave: handleImageSave,
414
+ saving: saving,
415
+ saveButtonProps: saveButtonProps,
416
+ disabled: disabled
417
+ }), /* @__PURE__ */React.createElement(Confirmation, {
418
+ open: confirmDelete,
419
+ onCancel: function onCancel() {
420
+ return setConfirmDelete(false);
421
+ },
422
+ onConfirm: handleDelete,
423
+ message: "Are you sure you want to remove the attached image?"
424
+ }));
447
425
  }
448
426
  CroppedImageInput.propTypes = {
449
427
  /**