@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.
@@ -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
- import { jsx, jsxs } from "react/jsx-runtime";
7
- var InstallPwaUi = ({
7
+ var InstallPwaUi = /* @__PURE__ */__name(({
8
8
  onInstall
9
9
  }) => {
10
- return /* @__PURE__ */jsx(Flex, {
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
- children: /* @__PURE__ */jsxs(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
- children: [/* @__PURE__ */jsx(Text, {
30
- children: "Deseja instalar o nosso aplicativo?"
31
- }), /* @__PURE__ */jsx(Button, {
32
- onClick: onInstall,
33
- children: "Instalar"
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__ */jsx(InstallPwaUi, {
57
+ return /* @__PURE__ */React.createElement(InstallPwaUi, {
63
58
  onInstall
64
59
  });
65
- };
60
+ }, "InstallPwa");
66
61
  export { InstallPwa, InstallPwaUi };
@@ -1,4 +1,5 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ import "../chunk-V4MHYKRI.js";
2
3
 
3
4
  // src/components/JsonEditor/index.ts
4
5
  import { JsonEditor } from "json-edit-react";
@@ -1,4 +1,5 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ import "../chunk-V4MHYKRI.js";
2
3
 
3
4
  // src/components/JsonView/index.ts
4
5
  import { JsonView } from "react-json-view-lite";
@@ -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
- import { jsx } from "react/jsx-runtime";
6
- var List = React.forwardRef(({
6
+ var List = /* @__PURE__ */React.forwardRef(({
7
7
  children,
8
8
  ...props
9
9
  }, ref) => {
10
- return /* @__PURE__ */jsx("ul", {
10
+ return /* @__PURE__ */React.createElement("ul", {
11
11
  ...props,
12
- ref,
13
- children
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
- import { jsx as jsx2 } from "react/jsx-runtime";
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__ */jsx2("li", {
24
+ return /* @__PURE__ */React2.createElement("li", {
27
25
  ...rest,
28
- ref,
29
- children
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
- import { jsx } from "react/jsx-runtime";
9
- var Markdown = ({
9
+ var Markdown = /* @__PURE__ */__name(({
10
10
  children,
11
11
  sx,
12
12
  ...props
13
13
  }) => {
14
- return /* @__PURE__ */jsx(BaseStyles, {
15
- sx,
16
- children: /* @__PURE__ */jsx(ReactMarkdown, {
17
- rehypePlugins: [rehypeRaw],
18
- remarkPlugins: [remarkGfm],
19
- ...props,
20
- children
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 };
@@ -1,24 +1,26 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import { Icon } from "../chunk-JOSQSCZQ.js";
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
- import { jsx } from "react/jsx-runtime";
11
- var Drawer = ({
13
+ var Drawer = /* @__PURE__ */__name(({
12
14
  children,
13
15
  sx,
14
16
  ...props
15
17
  }) => {
16
- return /* @__PURE__ */jsx(Box, {
18
+ return /* @__PURE__ */React.createElement(Box, {
17
19
  "data-testid": "drawer-container",
18
20
  sx: {
19
21
  /**
20
- * https://github.com/Farzin-Firoozi/react-modern-drawer/blob/master/src/styles.css
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
- children: /* @__PURE__ */jsx(DrawerUi, {
56
- ...props,
57
- children: /* @__PURE__ */jsx(Box, {
58
- sx: {
59
- width: "100%",
60
- height: "100%"
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
- import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
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__ */jsxs(Fragment, {
84
- children: [/* @__PURE__ */jsx2(Text, {
85
- sx: {
86
- cursor: "pointer"
87
- },
88
- onClick: onOpen,
89
- children: /* @__PURE__ */jsx2(Icon, {
90
- icon: menuIcon
91
- })
92
- }), /* @__PURE__ */jsx2(Drawer, {
93
- size: responsiveSize,
94
- direction,
95
- open: isOpen,
96
- children: /* @__PURE__ */jsxs(Box2, {
97
- sx: {
98
- position: "fixed",
99
- height: "100%",
100
- backgroundColor: "background",
101
- width: "100%",
102
- maxWidth: "2",
103
- right: 0,
104
- boxShadow: "4",
105
- paddingX: "5",
106
- paddingTop: "4",
107
- paddingBottom: "6",
108
- ...sx
109
- },
110
- children: [/* @__PURE__ */jsxs(Flex, {
111
- sx: {
112
- justifyContent: "space-between"
113
- },
114
- children: [/* @__PURE__ */jsx2(Image, {
115
- src: srcLogo,
116
- sx: {
117
- maxWidth: "200px",
118
- height: "44px",
119
- objectFit: "cover"
120
- },
121
- "data-testid": "img"
122
- }), /* @__PURE__ */jsx2(Text, {
123
- "data-testid": "button",
124
- sx: {
125
- marginLeft: "auto",
126
- fontSize: "2xl",
127
- alignSelf: "center",
128
- flexShrink: 0,
129
- cursor: "pointer",
130
- lineHeight: 0
131
- },
132
- role: "button",
133
- onClick: onClose,
134
- children: /* @__PURE__ */jsx2(Icon, {
135
- icon: "close"
136
- })
137
- })]
138
- }), /* @__PURE__ */jsx2(Box2, {
139
- sx: {
140
- paddingTop: "6"
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 };
@@ -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
- * Theme
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
- * General
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__ */jsx(ReactModal, {
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-E6CBXO5W.js";
3
- import "../chunk-JOSQSCZQ.js";
2
+ import { NotificationCard } from "../chunk-GOISZ4AR.js";
3
+ import "../chunk-AZTAV4VC.js";
4
+ import "../chunk-V4MHYKRI.js";
4
5
  export { NotificationCard };