@ttoss/components 2.0.8 → 2.0.9
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/dist/Accordion/index.d.ts +16 -0
- package/dist/Drawer/index.d.ts +12 -0
- package/dist/InstallPwa/index.d.ts +10 -0
- package/dist/List/index.d.ts +13 -0
- package/dist/Markdown/index.d.ts +11 -0
- package/dist/Menu/index.d.ts +32 -0
- package/dist/Modal/index.d.ts +10 -0
- package/dist/Search/index.d.ts +11 -0
- package/dist/Table/index.d.ts +14 -0
- package/dist/Toast/index.d.ts +7 -0
- package/dist/esm/Accordion/index.js +53 -0
- package/dist/esm/Drawer/index.js +53 -0
- package/dist/esm/InstallPwa/index.js +66 -0
- package/dist/esm/List/index.js +33 -0
- package/dist/esm/Markdown/index.js +24 -0
- package/dist/esm/Menu/index.js +2298 -0
- package/dist/esm/Modal/index.js +65 -0
- package/dist/esm/Search/index.js +30 -0
- package/dist/esm/Table/index.js +84 -0
- package/dist/esm/Toast/index.js +35 -0
- package/dist/esm/chunk-XEYGFSK5.js +29 -0
- package/package.json +8 -8
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import "../chunk-XEYGFSK5.js";
|
|
3
|
+
|
|
4
|
+
// src/components/Modal/Modal.tsx
|
|
5
|
+
import { css as transformStyleObject } from "@theme-ui/css";
|
|
6
|
+
import { useResponsiveValue, useTheme } from "@ttoss/ui";
|
|
7
|
+
import ReactModal from "react-modal";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
ReactModal.defaultStyles = {
|
|
10
|
+
overlay: {},
|
|
11
|
+
content: {}
|
|
12
|
+
};
|
|
13
|
+
var Modal = props => {
|
|
14
|
+
const {
|
|
15
|
+
theme
|
|
16
|
+
} = useTheme();
|
|
17
|
+
const space = theme.space;
|
|
18
|
+
const padding = useResponsiveValue([space?.["lg"], space?.["xl"], space?.["xl"]]) || 0;
|
|
19
|
+
const style = {
|
|
20
|
+
overlay: transformStyleObject({
|
|
21
|
+
position: "fixed",
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
right: 0,
|
|
25
|
+
bottom: 0,
|
|
26
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
27
|
+
display: "flex",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
zIndex: "modal",
|
|
31
|
+
...props.style?.overlay
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
})(theme),
|
|
34
|
+
content: transformStyleObject({
|
|
35
|
+
/**
|
|
36
|
+
* Theme
|
|
37
|
+
*/
|
|
38
|
+
backgroundColor: "surface",
|
|
39
|
+
padding,
|
|
40
|
+
border: "default",
|
|
41
|
+
borderColor: "surface",
|
|
42
|
+
borderRadius: "default",
|
|
43
|
+
/**
|
|
44
|
+
* General
|
|
45
|
+
*/
|
|
46
|
+
WebkitOverflowScrolling: "touch",
|
|
47
|
+
overflow: "auto",
|
|
48
|
+
position: "relative",
|
|
49
|
+
top: "0px",
|
|
50
|
+
left: "0px",
|
|
51
|
+
right: "0px",
|
|
52
|
+
bottom: "0px",
|
|
53
|
+
maxHeight: "90%",
|
|
54
|
+
maxWidth: "90%",
|
|
55
|
+
...props.style?.content
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
})(theme)
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */jsx(ReactModal, {
|
|
60
|
+
...props,
|
|
61
|
+
style
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
Modal.setAppElement = ReactModal.setAppElement;
|
|
65
|
+
export { Modal };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import "../chunk-XEYGFSK5.js";
|
|
3
|
+
|
|
4
|
+
// src/components/Search/Search.tsx
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Input } from "@ttoss/ui";
|
|
7
|
+
import { useDebounce } from "@ttoss/react-hooks";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Search = ({
|
|
10
|
+
value,
|
|
11
|
+
defaultValue,
|
|
12
|
+
loading,
|
|
13
|
+
onChange,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const [text, setText] = React.useState(value ?? defaultValue);
|
|
17
|
+
const debouncedValue = useDebounce(text, 500);
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
onChange(debouncedValue);
|
|
20
|
+
}, [debouncedValue, onChange]);
|
|
21
|
+
return /* @__PURE__ */jsx(Input, {
|
|
22
|
+
leadingIcon: loading ? "loading" : "search",
|
|
23
|
+
defaultValue: text,
|
|
24
|
+
onChange: e => {
|
|
25
|
+
return setText(e.target.value);
|
|
26
|
+
},
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export { Search };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { __export, __reExport } from "../chunk-XEYGFSK5.js";
|
|
3
|
+
|
|
4
|
+
// src/components/Table/index.ts
|
|
5
|
+
var Table_exports2 = {};
|
|
6
|
+
__export(Table_exports2, {
|
|
7
|
+
Table: () => Table,
|
|
8
|
+
TableBody: () => TableBody,
|
|
9
|
+
TableCaption: () => TableCaption,
|
|
10
|
+
TableCell: () => TableCell,
|
|
11
|
+
TableFooter: () => TableFooter,
|
|
12
|
+
TableHead: () => TableHead,
|
|
13
|
+
TableHeader: () => TableHeader,
|
|
14
|
+
TableRow: () => TableRow
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// src/components/Table/Table.tsx
|
|
18
|
+
var Table_exports = {};
|
|
19
|
+
__export(Table_exports, {
|
|
20
|
+
Table: () => Table,
|
|
21
|
+
TableBody: () => TableBody,
|
|
22
|
+
TableCaption: () => TableCaption,
|
|
23
|
+
TableCell: () => TableCell,
|
|
24
|
+
TableFooter: () => TableFooter,
|
|
25
|
+
TableHead: () => TableHead,
|
|
26
|
+
TableHeader: () => TableHeader,
|
|
27
|
+
TableRow: () => TableRow
|
|
28
|
+
});
|
|
29
|
+
__reExport(Table_exports, react_table_star);
|
|
30
|
+
import { Box } from "@ttoss/ui";
|
|
31
|
+
import * as react_table_star from "@tanstack/react-table";
|
|
32
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
|
+
var Table = props => {
|
|
34
|
+
return /* @__PURE__ */jsx(Box, {
|
|
35
|
+
as: "table",
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var TableHead = props => {
|
|
40
|
+
return /* @__PURE__ */jsx(Box, {
|
|
41
|
+
as: "thead",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var TableBody = props => {
|
|
46
|
+
return /* @__PURE__ */jsx(Box, {
|
|
47
|
+
as: "tbody",
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var TableRow = props => {
|
|
52
|
+
return /* @__PURE__ */jsx(Box, {
|
|
53
|
+
as: "tr",
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
var TableCell = props => {
|
|
58
|
+
return /* @__PURE__ */jsx(Box, {
|
|
59
|
+
as: "td",
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
var TableHeader = props => {
|
|
64
|
+
return /* @__PURE__ */jsx(Box, {
|
|
65
|
+
as: "th",
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
var TableCaption = props => {
|
|
70
|
+
return /* @__PURE__ */jsx(Box, {
|
|
71
|
+
as: "caption",
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var TableFooter = props => {
|
|
76
|
+
return /* @__PURE__ */jsx(Box, {
|
|
77
|
+
as: "tfoot",
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// src/components/Table/index.ts
|
|
83
|
+
__reExport(Table_exports2, Table_exports);
|
|
84
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import "../chunk-XEYGFSK5.js";
|
|
3
|
+
|
|
4
|
+
// src/components/Toast/Toast.tsx
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { Box } from "@ttoss/ui";
|
|
7
|
+
import { ToastContainer as ReactToastifyToastContainer, toast } from "react-toastify";
|
|
8
|
+
import { injectStyle } from "react-toastify/dist/inject-style";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var ToastContainer = props => {
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
injectStyle();
|
|
13
|
+
}, []);
|
|
14
|
+
return /* @__PURE__ */jsx(Box, {
|
|
15
|
+
sx: ({
|
|
16
|
+
colors,
|
|
17
|
+
fonts
|
|
18
|
+
}) => {
|
|
19
|
+
return {
|
|
20
|
+
"--toastify-color-light": "#fff",
|
|
21
|
+
"--toastify-color-dark": "#121212",
|
|
22
|
+
"--toastify-color-info": colors?.info || "#3498db",
|
|
23
|
+
"--toastify-color-success": colors?.success || "#07bc0c",
|
|
24
|
+
"--toastify-color-warning": "#f1c40f",
|
|
25
|
+
"--toastify-color-error": "#e74c3c",
|
|
26
|
+
"--toastify-color-progress-light": `linear-gradient(to right, ${colors?.primary}, ${colors?.secondary})`,
|
|
27
|
+
"--toastify-font-family": fonts.body
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
children: /* @__PURE__ */jsx(ReactToastifyToastContainer, {
|
|
31
|
+
...props
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export { ToastContainer, toast };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value
|
|
11
|
+
}) : obj[key] = value;
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all) __defProp(target, name, {
|
|
14
|
+
get: all[name],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: () => from[key],
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
28
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
29
|
+
export { __export, __reExport, __publicField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "React components for ttoss ecosystem.",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"react": ">=16.8.0",
|
|
77
|
-
"@ttoss/react-hooks": "^2.0.
|
|
78
|
-
"@ttoss/ui": "^5.0.
|
|
77
|
+
"@ttoss/react-hooks": "^2.0.3",
|
|
78
|
+
"@ttoss/ui": "^5.0.7"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/jest": "^29.5.13",
|
|
@@ -84,11 +84,11 @@
|
|
|
84
84
|
"react": "^18.3.1",
|
|
85
85
|
"tsup": "^8.3.0",
|
|
86
86
|
"tsx": "^4.6.2",
|
|
87
|
-
"@ttoss/config": "^1.
|
|
88
|
-
"@ttoss/react-
|
|
89
|
-
"@ttoss/react-
|
|
90
|
-
"@ttoss/test-utils": "^2.1.
|
|
91
|
-
"@ttoss/ui": "^5.0.
|
|
87
|
+
"@ttoss/config": "^1.34.0",
|
|
88
|
+
"@ttoss/react-hooks": "^2.0.3",
|
|
89
|
+
"@ttoss/react-icons": "^0.4.3",
|
|
90
|
+
"@ttoss/test-utils": "^2.1.16",
|
|
91
|
+
"@ttoss/ui": "^5.0.7"
|
|
92
92
|
},
|
|
93
93
|
"keywords": [
|
|
94
94
|
"React",
|