@homefile/components-v2 2.28.1 → 2.28.2
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.
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Stack, Image, Text } from '@chakra-ui/react';
|
|
3
3
|
import { MoreHorizontal, IconMenu, NewBadge } from '..';
|
|
4
4
|
export const MinimizedTile = ({ _id, menu, title, icon, isNew, onMaximize, }) => {
|
|
5
|
-
return (_jsxs(
|
|
5
|
+
return (_jsxs(Stack, { bg: "neutral.white", boxShadow: "md", flex: "1", h: "full", justify: "center", position: "relative", transition: "background 0.2s", _hover: {
|
|
6
6
|
bg: 'lightGreen.7',
|
|
7
|
-
}, children: [isNew && (_jsx(Box, { position: "absolute", top: "-5px", left: "-2px", children: _jsx(NewBadge, { bg: "violet.1", color: "neutral.white" }) })), _jsx(Box, {
|
|
7
|
+
}, children: [isNew && (_jsx(Box, { position: "absolute", top: "-5px", left: "-2px", children: _jsx(NewBadge, { bg: "violet.1", color: "neutral.white" }) })), _jsx(Box, { position: "absolute", top: "5px", right: "5px", children: _jsx(IconMenu, { icon: _jsx(MoreHorizontal, { size: 26 }), itemForm: _id, menuItems: menu, disabled: menu.length === 0 }) }), _jsxs(Stack, { px: "base", align: "center", cursor: "pointer", pos: "relative", justify: "center", children: [_jsx(Box, { onClick: () => onMaximize(_id), pos: "absolute", top: "0", right: "0", bottom: "0", left: "0" }), icon && (_jsx(Image, { src: icon, alt: "not-found", boxSize: "50%", objectFit: "contain" })), title && (_jsx(Text, { textAlign: "center", noOfLines: 1, textOverflow: "ellipsis", fontSize: "xs", children: title }))] })] }));
|
|
8
8
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Box, SimpleGrid } from '@chakra-ui/react';
|
|
4
4
|
import { MinimizedTile } from './MinimizedTile';
|
|
5
5
|
import { Billing, Calendar, EstValue, GuestBedroom, IA, Inbox, Lighting, Warranty, YellowFolder, } from '../../assets/images';
|
|
6
6
|
export const MinimizedTiles = ({ tiles, menu, onMaximize, }) => {
|
|
7
7
|
const onlyMinimizedTiles = tiles.filter((tile) => !tile.isMaximized);
|
|
8
|
-
return (_jsx(
|
|
8
|
+
return (_jsx(Box, { h: "full", children: _jsx(SimpleGrid, { columns: 3, spacing: "base", h: "full", children: onlyMinimizedTiles.map((tile) => (_createElement(MinimizedTile, Object.assign({}, tile, { key: tile._id, menu: menu, icon: IconById[tile._id], onMaximize: onMaximize })))) }) }));
|
|
9
9
|
};
|
|
10
10
|
const IconById = {
|
|
11
11
|
folders: YellowFolder,
|
package/package.json
CHANGED
|
@@ -11,10 +11,12 @@ export const MinimizedTile = ({
|
|
|
11
11
|
onMaximize,
|
|
12
12
|
}: MinimizedTileI) => {
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<Stack
|
|
15
15
|
bg="neutral.white"
|
|
16
16
|
boxShadow="md"
|
|
17
|
-
|
|
17
|
+
flex="1"
|
|
18
|
+
h="full"
|
|
19
|
+
justify="center"
|
|
18
20
|
position="relative"
|
|
19
21
|
transition="background 0.2s"
|
|
20
22
|
_hover={{
|
|
@@ -26,7 +28,7 @@ export const MinimizedTile = ({
|
|
|
26
28
|
<NewBadge bg="violet.1" color="neutral.white" />
|
|
27
29
|
</Box>
|
|
28
30
|
)}
|
|
29
|
-
<Box
|
|
31
|
+
<Box position="absolute" top="5px" right="5px">
|
|
30
32
|
<IconMenu
|
|
31
33
|
icon={<MoreHorizontal size={26} />}
|
|
32
34
|
itemForm={_id}
|
|
@@ -34,7 +36,13 @@ export const MinimizedTile = ({
|
|
|
34
36
|
disabled={menu.length === 0}
|
|
35
37
|
/>
|
|
36
38
|
</Box>
|
|
37
|
-
<Stack
|
|
39
|
+
<Stack
|
|
40
|
+
px="base"
|
|
41
|
+
align="center"
|
|
42
|
+
cursor="pointer"
|
|
43
|
+
pos="relative"
|
|
44
|
+
justify="center"
|
|
45
|
+
>
|
|
38
46
|
<Box
|
|
39
47
|
onClick={() => onMaximize(_id)}
|
|
40
48
|
pos="absolute"
|
|
@@ -44,12 +52,7 @@ export const MinimizedTile = ({
|
|
|
44
52
|
left="0"
|
|
45
53
|
/>
|
|
46
54
|
{icon && (
|
|
47
|
-
<Image
|
|
48
|
-
src={icon}
|
|
49
|
-
alt="not-found"
|
|
50
|
-
boxSize="34px"
|
|
51
|
-
objectFit="contain"
|
|
52
|
-
/>
|
|
55
|
+
<Image src={icon} alt="not-found" boxSize="50%" objectFit="contain" />
|
|
53
56
|
)}
|
|
54
57
|
{title && (
|
|
55
58
|
<Text
|
|
@@ -62,6 +65,6 @@ export const MinimizedTile = ({
|
|
|
62
65
|
</Text>
|
|
63
66
|
)}
|
|
64
67
|
</Stack>
|
|
65
|
-
</
|
|
68
|
+
</Stack>
|
|
66
69
|
)
|
|
67
70
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box,
|
|
1
|
+
import { Box, SimpleGrid } from '@chakra-ui/react'
|
|
2
2
|
import { MinimizedTile } from './MinimizedTile'
|
|
3
3
|
import {
|
|
4
4
|
Billing,
|
|
@@ -20,8 +20,8 @@ export const MinimizedTiles = ({
|
|
|
20
20
|
}: MinimizedTilesI) => {
|
|
21
21
|
const onlyMinimizedTiles = tiles.filter((tile) => !tile.isMaximized)
|
|
22
22
|
return (
|
|
23
|
-
<
|
|
24
|
-
<SimpleGrid columns={3} spacing="base">
|
|
23
|
+
<Box h="full">
|
|
24
|
+
<SimpleGrid columns={3} spacing="base" h="full">
|
|
25
25
|
{onlyMinimizedTiles.map((tile) => (
|
|
26
26
|
<MinimizedTile
|
|
27
27
|
{...tile}
|
|
@@ -32,7 +32,7 @@ export const MinimizedTiles = ({
|
|
|
32
32
|
/>
|
|
33
33
|
))}
|
|
34
34
|
</SimpleGrid>
|
|
35
|
-
</
|
|
35
|
+
</Box>
|
|
36
36
|
)
|
|
37
37
|
}
|
|
38
38
|
|