@ttoss/components 2.0.2 → 2.0.3

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.
Files changed (41) hide show
  1. package/dist/Accordion/index.d.ts +16 -0
  2. package/dist/Drawer/index.d.ts +12 -0
  3. package/dist/InstallPwa/index.d.ts +10 -0
  4. package/dist/Markdown/index.d.ts +11 -0
  5. package/dist/Menu/index.d.ts +32 -0
  6. package/dist/Modal/index.d.ts +10 -0
  7. package/dist/Search/index.d.ts +11 -0
  8. package/dist/esm/Accordion/index.js +53 -0
  9. package/dist/esm/Drawer/index.js +53 -0
  10. package/dist/esm/InstallPwa/index.js +66 -0
  11. package/dist/esm/{components/List → List}/index.js +3 -3
  12. package/dist/esm/Markdown/index.js +25 -0
  13. package/dist/esm/Menu/index.js +2298 -0
  14. package/dist/esm/Modal/index.js +65 -0
  15. package/dist/esm/Search/index.js +30 -0
  16. package/dist/esm/{components/Table.js → Table/index.js} +31 -3
  17. package/dist/esm/chunk-ESDEGKXL.js +22 -0
  18. package/dist/esm/index.js +7 -2531
  19. package/dist/index.d.ts +1 -354
  20. package/package.json +47 -16
  21. package/src/components/{Accordion.tsx → Accordion/Accordion.tsx} +6 -4
  22. package/src/components/Accordion/index.ts +1 -0
  23. package/src/components/Drawer/index.ts +1 -0
  24. package/src/components/{InstallPwa.tsx → InstallPwa/InstallPwa.tsx} +1 -0
  25. package/src/components/InstallPwa/index.ts +1 -0
  26. package/src/components/Markdown/index.ts +1 -0
  27. package/src/components/{Menu.tsx → Menu/Menu.tsx} +1 -1
  28. package/src/components/Menu/index.ts +1 -0
  29. package/src/components/{Modal.tsx → Modal/Modal.tsx} +2 -0
  30. package/src/components/Modal/index.ts +1 -0
  31. package/src/components/Search/index.ts +1 -0
  32. package/src/components/Table/index.ts +1 -0
  33. package/src/components/Toast/index.ts +1 -0
  34. package/src/index.ts +0 -8
  35. /package/dist/{components/List → List}/index.d.ts +0 -0
  36. /package/dist/{components/Table.d.ts → Table/index.d.ts} +0 -0
  37. /package/src/components/{Drawer.tsx → Drawer/Drawer.tsx} +0 -0
  38. /package/src/components/{Markdown.tsx → Markdown/Markdown.tsx} +0 -0
  39. /package/src/components/{Search.tsx → Search/Search.tsx} +0 -0
  40. /package/src/components/{Table.tsx → Table/Table.tsx} +0 -0
  41. /package/src/components/{Toast.tsx → Toast/Toast.tsx} +0 -0
@@ -0,0 +1,65 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ import "../chunk-ESDEGKXL.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-ESDEGKXL.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 };
@@ -1,9 +1,34 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import "../chunk-LZE3LOYR.js";
2
+ import { __export, __reExport } from "../chunk-ESDEGKXL.js";
3
3
 
4
- // src/components/Table.tsx
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);
5
30
  import { Box } from "@ttoss/ui";
6
- export * from "@tanstack/react-table";
31
+ import * as react_table_star from "@tanstack/react-table";
7
32
  import { jsx } from "react/jsx-runtime";
8
33
  var Table = props => {
9
34
  return /* @__PURE__ */jsx(Box, {
@@ -53,4 +78,7 @@ var TableFooter = props => {
53
78
  ...props
54
79
  });
55
80
  };
81
+
82
+ // src/components/Table/index.ts
83
+ __reExport(Table_exports2, Table_exports);
56
84
  export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
@@ -0,0 +1,22 @@
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 __export = (target, all) => {
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
22
+ export { __export, __reExport };