@ttoss/components 2.4.0 → 2.4.1
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/README.md +1 -1
- package/dist/FileUploader/index.d.ts +16 -9
- package/dist/esm/Accordion/index.js +11 -15
- package/dist/esm/Drawer/index.js +14 -18
- package/dist/esm/FileUploader/index.js +185 -191
- package/dist/esm/InstallPwa/index.js +27 -32
- package/dist/esm/JsonEditor/index.js +1 -0
- package/dist/esm/JsonView/index.js +1 -0
- package/dist/esm/List/index.js +9 -12
- package/dist/esm/Markdown/index.js +10 -12
- package/dist/esm/Menu/index.js +75 -87
- package/dist/esm/Modal/index.js +8 -10
- package/dist/esm/NotificationCard/index.js +3 -2
- package/dist/esm/NotificationsMenu/index.js +137 -149
- package/dist/esm/Search/index.js +6 -6
- package/dist/esm/Table/index.js +25 -25
- package/dist/esm/Tabs/index.js +10 -14
- package/dist/esm/Toast/index.js +10 -11
- package/dist/esm/{chunk-JOSQSCZQ.js → chunk-AZTAV4VC.js} +132 -39
- package/dist/esm/chunk-GOISZ4AR.js +156 -0
- package/dist/esm/chunk-V4MHYKRI.js +7 -0
- package/package.json +6 -4
- package/dist/esm/chunk-E6CBXO5W.js +0 -170
|
@@ -1,66 +1,61 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { __name } from "../chunk-V4MHYKRI.js";
|
|
2
3
|
|
|
3
4
|
// src/components/InstallPwa/InstallPwa.tsx
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import { Button, Flex, Text } from "@ttoss/ui";
|
|
6
|
-
|
|
7
|
-
var InstallPwaUi = ({
|
|
7
|
+
var InstallPwaUi = /* @__PURE__ */__name(({
|
|
8
8
|
onInstall
|
|
9
9
|
}) => {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */React.createElement(Flex, {
|
|
11
11
|
sx: {
|
|
12
12
|
position: "absolute",
|
|
13
13
|
bottom: 4,
|
|
14
14
|
width: "100%",
|
|
15
15
|
justifyContent: "center"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})]
|
|
35
|
-
})
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
var InstallPwa = () => {
|
|
16
|
+
}
|
|
17
|
+
}, /* @__PURE__ */React.createElement(Flex, {
|
|
18
|
+
sx: {
|
|
19
|
+
backgroundColor: "background",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
gap: 3,
|
|
23
|
+
width: "auto",
|
|
24
|
+
border: "1px solid",
|
|
25
|
+
borderColor: "muted",
|
|
26
|
+
borderRadius: 1,
|
|
27
|
+
padding: 4
|
|
28
|
+
}
|
|
29
|
+
}, /* @__PURE__ */React.createElement(Text, null, "Deseja instalar o nosso aplicativo?"), /* @__PURE__ */React.createElement(Button, {
|
|
30
|
+
onClick: onInstall
|
|
31
|
+
}, "Instalar")));
|
|
32
|
+
}, "InstallPwaUi");
|
|
33
|
+
var InstallPwa = /* @__PURE__ */__name(() => {
|
|
39
34
|
const [supportsPwa, setSupportsPwa] = React.useState(false);
|
|
40
35
|
const [promptInstall, setPromptInstall] = React.useState(null);
|
|
41
36
|
React.useEffect(() => {
|
|
42
|
-
const handler = e => {
|
|
37
|
+
const handler = /* @__PURE__ */__name(e => {
|
|
43
38
|
e.preventDefault();
|
|
44
39
|
setSupportsPwa(true);
|
|
45
40
|
setPromptInstall(e);
|
|
46
|
-
};
|
|
41
|
+
}, "handler");
|
|
47
42
|
window.addEventListener("beforeinstallprompt", handler);
|
|
48
43
|
return () => {
|
|
49
44
|
return window.removeEventListener("transitionend", handler);
|
|
50
45
|
};
|
|
51
46
|
}, []);
|
|
52
|
-
const onInstall = e => {
|
|
47
|
+
const onInstall = /* @__PURE__ */__name(e => {
|
|
53
48
|
e.preventDefault();
|
|
54
49
|
if (!promptInstall) {
|
|
55
50
|
return;
|
|
56
51
|
}
|
|
57
52
|
promptInstall.prompt();
|
|
58
|
-
};
|
|
53
|
+
}, "onInstall");
|
|
59
54
|
if (!supportsPwa) {
|
|
60
55
|
return null;
|
|
61
56
|
}
|
|
62
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */React.createElement(InstallPwaUi, {
|
|
63
58
|
onInstall
|
|
64
59
|
});
|
|
65
|
-
};
|
|
60
|
+
}, "InstallPwa");
|
|
66
61
|
export { InstallPwa, InstallPwaUi };
|
package/dist/esm/List/index.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import "../chunk-V4MHYKRI.js";
|
|
2
3
|
|
|
3
4
|
// src/components/List/List.tsx
|
|
4
5
|
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
var List = React.forwardRef(({
|
|
6
|
+
var List = /* @__PURE__ */React.forwardRef(({
|
|
7
7
|
children,
|
|
8
8
|
...props
|
|
9
9
|
}, ref) => {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */React.createElement("ul", {
|
|
11
11
|
...props,
|
|
12
|
-
ref
|
|
13
|
-
|
|
14
|
-
});
|
|
12
|
+
ref
|
|
13
|
+
}, children);
|
|
15
14
|
});
|
|
16
15
|
List.displayName = "List";
|
|
17
16
|
|
|
18
17
|
// src/components/List/ListItem.tsx
|
|
19
18
|
import * as React2 from "react";
|
|
20
|
-
|
|
21
|
-
var ListItem = React2.forwardRef((props, ref) => {
|
|
19
|
+
var ListItem = /* @__PURE__ */React2.forwardRef((props, ref) => {
|
|
22
20
|
const {
|
|
23
21
|
children,
|
|
24
22
|
...rest
|
|
25
23
|
} = props;
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */React2.createElement("li", {
|
|
27
25
|
...rest,
|
|
28
|
-
ref
|
|
29
|
-
|
|
30
|
-
});
|
|
26
|
+
ref
|
|
27
|
+
}, children);
|
|
31
28
|
});
|
|
32
29
|
ListItem.displayName = "ListItem";
|
|
33
30
|
export { List, ListItem };
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { __name } from "../chunk-V4MHYKRI.js";
|
|
2
3
|
|
|
3
4
|
// src/components/Markdown/Markdown.tsx
|
|
4
5
|
import { BaseStyles } from "@ttoss/ui";
|
|
5
6
|
import ReactMarkdown from "react-markdown";
|
|
6
7
|
import rehypeRaw from "rehype-raw";
|
|
7
8
|
import remarkGfm from "remark-gfm";
|
|
8
|
-
|
|
9
|
-
var Markdown = ({
|
|
9
|
+
var Markdown = /* @__PURE__ */__name(({
|
|
10
10
|
children,
|
|
11
11
|
sx,
|
|
12
12
|
...props
|
|
13
13
|
}) => {
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
sx
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
};
|
|
14
|
+
return /* @__PURE__ */React.createElement(BaseStyles, {
|
|
15
|
+
sx
|
|
16
|
+
}, /* @__PURE__ */React.createElement(ReactMarkdown, {
|
|
17
|
+
rehypePlugins: [rehypeRaw],
|
|
18
|
+
remarkPlugins: [remarkGfm],
|
|
19
|
+
...props
|
|
20
|
+
}, children));
|
|
21
|
+
}, "Markdown");
|
|
24
22
|
export { Markdown };
|
package/dist/esm/Menu/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { Icon } from "../chunk-
|
|
2
|
+
import { Icon } from "../chunk-AZTAV4VC.js";
|
|
3
|
+
import { __name } from "../chunk-V4MHYKRI.js";
|
|
3
4
|
|
|
4
5
|
// src/components/Menu/Menu.tsx
|
|
5
6
|
import { Box as Box2, Flex, Image, Text, useResponsiveValue } from "@ttoss/ui";
|
|
7
|
+
import * as React2 from "react";
|
|
6
8
|
|
|
7
9
|
// src/components/Drawer/Drawer.tsx
|
|
8
10
|
import { Box } from "@ttoss/ui";
|
|
11
|
+
import * as React from "react";
|
|
9
12
|
import DrawerUi from "react-modern-drawer";
|
|
10
|
-
|
|
11
|
-
var Drawer = ({
|
|
13
|
+
var Drawer = /* @__PURE__ */__name(({
|
|
12
14
|
children,
|
|
13
15
|
sx,
|
|
14
16
|
...props
|
|
15
17
|
}) => {
|
|
16
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
17
19
|
"data-testid": "drawer-container",
|
|
18
20
|
sx: {
|
|
19
21
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
* https://github.com/Farzin-Firoozi/react-modern-drawer/blob/master/src/styles.css
|
|
23
|
+
*/
|
|
22
24
|
zIndex: "overlay",
|
|
23
25
|
width: "100%",
|
|
24
26
|
height: "100%",
|
|
@@ -51,23 +53,17 @@ var Drawer = ({
|
|
|
51
53
|
overflowY: "auto"
|
|
52
54
|
},
|
|
53
55
|
...sx
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
children
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
};
|
|
56
|
+
}
|
|
57
|
+
}, /* @__PURE__ */React.createElement(DrawerUi, props, /* @__PURE__ */React.createElement(Box, {
|
|
58
|
+
sx: {
|
|
59
|
+
width: "100%",
|
|
60
|
+
height: "100%"
|
|
61
|
+
}
|
|
62
|
+
}, children)));
|
|
63
|
+
}, "Drawer");
|
|
67
64
|
|
|
68
65
|
// src/components/Menu/Menu.tsx
|
|
69
|
-
|
|
70
|
-
var Menu = ({
|
|
66
|
+
var Menu = /* @__PURE__ */__name(({
|
|
71
67
|
children,
|
|
72
68
|
srcLogo,
|
|
73
69
|
onClose,
|
|
@@ -80,70 +76,62 @@ var Menu = ({
|
|
|
80
76
|
menuIcon = "menu-open"
|
|
81
77
|
}) => {
|
|
82
78
|
const responsiveSize = useResponsiveValue([sizeOnMobile, sizeOnDesktop]);
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
as: "nav",
|
|
143
|
-
children
|
|
144
|
-
})]
|
|
145
|
-
})
|
|
146
|
-
})]
|
|
147
|
-
});
|
|
148
|
-
};
|
|
79
|
+
return /* @__PURE__ */React2.createElement(React2.Fragment, null, /* @__PURE__ */React2.createElement(Text, {
|
|
80
|
+
sx: {
|
|
81
|
+
cursor: "pointer"
|
|
82
|
+
},
|
|
83
|
+
onClick: onOpen
|
|
84
|
+
}, /* @__PURE__ */React2.createElement(Icon, {
|
|
85
|
+
icon: menuIcon
|
|
86
|
+
})), /* @__PURE__ */React2.createElement(Drawer, {
|
|
87
|
+
size: responsiveSize,
|
|
88
|
+
direction,
|
|
89
|
+
open: isOpen
|
|
90
|
+
}, /* @__PURE__ */React2.createElement(Box2, {
|
|
91
|
+
sx: {
|
|
92
|
+
position: "fixed",
|
|
93
|
+
height: "100%",
|
|
94
|
+
backgroundColor: "background",
|
|
95
|
+
width: "100%",
|
|
96
|
+
maxWidth: "2",
|
|
97
|
+
right: 0,
|
|
98
|
+
boxShadow: "4",
|
|
99
|
+
paddingX: "5",
|
|
100
|
+
paddingTop: "4",
|
|
101
|
+
paddingBottom: "6",
|
|
102
|
+
...sx
|
|
103
|
+
}
|
|
104
|
+
}, /* @__PURE__ */React2.createElement(Flex, {
|
|
105
|
+
sx: {
|
|
106
|
+
justifyContent: "space-between"
|
|
107
|
+
}
|
|
108
|
+
}, /* @__PURE__ */React2.createElement(Image, {
|
|
109
|
+
src: srcLogo,
|
|
110
|
+
sx: {
|
|
111
|
+
maxWidth: "200px",
|
|
112
|
+
height: "44px",
|
|
113
|
+
objectFit: "cover"
|
|
114
|
+
},
|
|
115
|
+
"data-testid": "img"
|
|
116
|
+
}), /* @__PURE__ */React2.createElement(Text, {
|
|
117
|
+
"data-testid": "button",
|
|
118
|
+
sx: {
|
|
119
|
+
marginLeft: "auto",
|
|
120
|
+
fontSize: "2xl",
|
|
121
|
+
alignSelf: "center",
|
|
122
|
+
flexShrink: 0,
|
|
123
|
+
cursor: "pointer",
|
|
124
|
+
lineHeight: 0
|
|
125
|
+
},
|
|
126
|
+
role: "button",
|
|
127
|
+
onClick: onClose
|
|
128
|
+
}, /* @__PURE__ */React2.createElement(Icon, {
|
|
129
|
+
icon: "close"
|
|
130
|
+
}))), /* @__PURE__ */React2.createElement(Box2, {
|
|
131
|
+
sx: {
|
|
132
|
+
paddingTop: "6"
|
|
133
|
+
},
|
|
134
|
+
as: "nav"
|
|
135
|
+
}, children))));
|
|
136
|
+
}, "Menu");
|
|
149
137
|
export { Menu };
|
package/dist/esm/Modal/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { __name } from "../chunk-V4MHYKRI.js";
|
|
2
3
|
|
|
3
4
|
// src/components/Modal/Modal.tsx
|
|
4
5
|
import { css as transformStyleObject } from "@theme-ui/css";
|
|
5
6
|
import { useResponsiveValue, useTheme } from "@ttoss/ui";
|
|
6
7
|
import ReactModal from "react-modal";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
ReactModal.defaultStyles = {
|
|
9
9
|
overlay: {},
|
|
10
10
|
content: {}
|
|
11
11
|
};
|
|
12
|
-
var Modal = props => {
|
|
12
|
+
var Modal = /* @__PURE__ */__name(props => {
|
|
13
13
|
const {
|
|
14
14
|
theme
|
|
15
15
|
} = useTheme();
|
|
@@ -28,20 +28,19 @@ var Modal = props => {
|
|
|
28
28
|
alignItems: "center",
|
|
29
29
|
zIndex: "modal",
|
|
30
30
|
...props.style?.overlay
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
31
|
})(theme),
|
|
33
32
|
content: transformStyleObject({
|
|
34
33
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
* Theme
|
|
35
|
+
*/
|
|
37
36
|
backgroundColor: "surface",
|
|
38
37
|
padding,
|
|
39
38
|
border: "default",
|
|
40
39
|
borderColor: "surface",
|
|
41
40
|
borderRadius: "default",
|
|
42
41
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
* General
|
|
43
|
+
*/
|
|
45
44
|
WebkitOverflowScrolling: "touch",
|
|
46
45
|
overflow: "auto",
|
|
47
46
|
position: "relative",
|
|
@@ -52,13 +51,12 @@ var Modal = props => {
|
|
|
52
51
|
maxHeight: "90%",
|
|
53
52
|
maxWidth: "90%",
|
|
54
53
|
...props.style?.content
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
54
|
})(theme)
|
|
57
55
|
};
|
|
58
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */React.createElement(ReactModal, {
|
|
59
57
|
...props,
|
|
60
58
|
style
|
|
61
59
|
});
|
|
62
|
-
};
|
|
60
|
+
}, "Modal");
|
|
63
61
|
Modal.setAppElement = ReactModal.setAppElement;
|
|
64
62
|
export { Modal };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { NotificationCard } from "../chunk-
|
|
3
|
-
import "../chunk-
|
|
2
|
+
import { NotificationCard } from "../chunk-GOISZ4AR.js";
|
|
3
|
+
import "../chunk-AZTAV4VC.js";
|
|
4
|
+
import "../chunk-V4MHYKRI.js";
|
|
4
5
|
export { NotificationCard };
|