@tenancy.nz/tenant-ui 1.6.2 → 1.6.4
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.
|
@@ -6,27 +6,50 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.c
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var Stack = require('@mui/material/Stack');
|
|
8
8
|
var ui = require('@tenancy.nz/ui');
|
|
9
|
+
var useMediaQuery = require('@mui/material/useMediaQuery');
|
|
9
10
|
|
|
10
11
|
function PropertyCardSkeleton(_ref) {
|
|
11
12
|
var _ref$fullHeight = _ref.fullHeight,
|
|
12
|
-
fullHeight = _ref$fullHeight === void 0 ? true : _ref$fullHeight
|
|
13
|
+
fullHeight = _ref$fullHeight === void 0 ? true : _ref$fullHeight,
|
|
14
|
+
_ref$orientation = _ref.orientation,
|
|
15
|
+
orientation = _ref$orientation === void 0 ? "vertical" : _ref$orientation;
|
|
16
|
+
var isMobile = useMediaQuery(function (theme) {
|
|
17
|
+
return theme.breakpoints.down("md");
|
|
18
|
+
});
|
|
13
19
|
return /* @__PURE__ */React.createElement(Stack, {
|
|
14
20
|
sx: _rollupPluginBabelHelpers.objectSpread2({}, fullHeight && {
|
|
15
21
|
height: "100%"
|
|
16
22
|
})
|
|
17
23
|
}, /* @__PURE__ */React.createElement(ui.Paper, {
|
|
18
24
|
overflow: false,
|
|
19
|
-
sx: _rollupPluginBabelHelpers.objectSpread2({
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
sx: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({
|
|
26
|
+
display: "flex"
|
|
27
|
+
}, orientation === "vertical" && {
|
|
22
28
|
flexDirection: "column"
|
|
29
|
+
}), orientation === "horizontal" && {
|
|
30
|
+
flexDirection: {
|
|
31
|
+
xs: "column",
|
|
32
|
+
md: "row"
|
|
33
|
+
}
|
|
34
|
+
}), fullHeight && {
|
|
35
|
+
height: "100%"
|
|
23
36
|
})
|
|
37
|
+
}, (orientation === "vertical" || isMobile) && /* @__PURE__ */React.createElement(ui.Skeleton, {
|
|
38
|
+
width: "100%",
|
|
39
|
+
height: "220px",
|
|
40
|
+
variant: "rectangular"
|
|
41
|
+
}), orientation === "horizontal" && !isMobile && /* @__PURE__ */React.createElement(ui.Box, {
|
|
42
|
+
width: "360px",
|
|
43
|
+
maxWidth: "100%"
|
|
24
44
|
}, /* @__PURE__ */React.createElement(ui.Skeleton, {
|
|
25
45
|
width: "100%",
|
|
26
|
-
height: "
|
|
46
|
+
height: "220px",
|
|
27
47
|
variant: "rectangular"
|
|
28
|
-
}), /* @__PURE__ */React.createElement(Stack, {
|
|
29
|
-
p: 4
|
|
48
|
+
})), /* @__PURE__ */React.createElement(Stack, {
|
|
49
|
+
p: orientation === "vertical" ? 4 : {
|
|
50
|
+
xs: 4,
|
|
51
|
+
md: 8
|
|
52
|
+
},
|
|
30
53
|
position: "relative",
|
|
31
54
|
gap: 2,
|
|
32
55
|
flex: 1
|
|
@@ -1,28 +1,51 @@
|
|
|
1
1
|
import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Stack from '@mui/material/Stack';
|
|
4
|
-
import { Paper, Skeleton } from '@tenancy.nz/ui';
|
|
4
|
+
import { Paper, Skeleton, Box } from '@tenancy.nz/ui';
|
|
5
|
+
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
5
6
|
|
|
6
7
|
function PropertyCardSkeleton(_ref) {
|
|
7
8
|
var _ref$fullHeight = _ref.fullHeight,
|
|
8
|
-
fullHeight = _ref$fullHeight === void 0 ? true : _ref$fullHeight
|
|
9
|
+
fullHeight = _ref$fullHeight === void 0 ? true : _ref$fullHeight,
|
|
10
|
+
_ref$orientation = _ref.orientation,
|
|
11
|
+
orientation = _ref$orientation === void 0 ? "vertical" : _ref$orientation;
|
|
12
|
+
var isMobile = useMediaQuery(function (theme) {
|
|
13
|
+
return theme.breakpoints.down("md");
|
|
14
|
+
});
|
|
9
15
|
return /* @__PURE__ */React.createElement(Stack, {
|
|
10
16
|
sx: _objectSpread2({}, fullHeight && {
|
|
11
17
|
height: "100%"
|
|
12
18
|
})
|
|
13
19
|
}, /* @__PURE__ */React.createElement(Paper, {
|
|
14
20
|
overflow: false,
|
|
15
|
-
sx: _objectSpread2({
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
sx: _objectSpread2(_objectSpread2(_objectSpread2({
|
|
22
|
+
display: "flex"
|
|
23
|
+
}, orientation === "vertical" && {
|
|
18
24
|
flexDirection: "column"
|
|
25
|
+
}), orientation === "horizontal" && {
|
|
26
|
+
flexDirection: {
|
|
27
|
+
xs: "column",
|
|
28
|
+
md: "row"
|
|
29
|
+
}
|
|
30
|
+
}), fullHeight && {
|
|
31
|
+
height: "100%"
|
|
19
32
|
})
|
|
33
|
+
}, (orientation === "vertical" || isMobile) && /* @__PURE__ */React.createElement(Skeleton, {
|
|
34
|
+
width: "100%",
|
|
35
|
+
height: "220px",
|
|
36
|
+
variant: "rectangular"
|
|
37
|
+
}), orientation === "horizontal" && !isMobile && /* @__PURE__ */React.createElement(Box, {
|
|
38
|
+
width: "360px",
|
|
39
|
+
maxWidth: "100%"
|
|
20
40
|
}, /* @__PURE__ */React.createElement(Skeleton, {
|
|
21
41
|
width: "100%",
|
|
22
|
-
height: "
|
|
42
|
+
height: "220px",
|
|
23
43
|
variant: "rectangular"
|
|
24
|
-
}), /* @__PURE__ */React.createElement(Stack, {
|
|
25
|
-
p: 4
|
|
44
|
+
})), /* @__PURE__ */React.createElement(Stack, {
|
|
45
|
+
p: orientation === "vertical" ? 4 : {
|
|
46
|
+
xs: 4,
|
|
47
|
+
md: 8
|
|
48
|
+
},
|
|
26
49
|
position: "relative",
|
|
27
50
|
gap: 2,
|
|
28
51
|
flex: 1
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenancy.nz/tenant-ui",
|
|
3
3
|
"description": "React UI tenant components.",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.4",
|
|
5
5
|
"author": "TPS <https://www.tenancy.co.nz>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/cjs/index.cjs",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"@mui/material": "^7.3.1",
|
|
18
18
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
19
19
|
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
20
|
-
"@tenancy.nz/ui": "1.6.
|
|
20
|
+
"@tenancy.nz/ui": "1.6.4"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@emotion/react": "^11.14.0",
|
|
24
24
|
"@emotion/styled": "^11.14.1",
|
|
25
25
|
"@mui/icons-material": "^7.2.0",
|
|
26
26
|
"@mui/material": "^7.3.1",
|
|
27
|
-
"@tenancy.nz/ui": "1.6.
|
|
27
|
+
"@tenancy.nz/ui": "1.6.4"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"react-uid": "^2.4.0"
|