@sudobility/monitoring-components 1.1.0 → 2.0.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/dist/index.d.ts +3 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +163 -170
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +3 -4
- package/dist/portal.d.ts +0 -29
- package/dist/portal.d.ts.map +0 -1
- package/src/portal.tsx +0 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/monitoring-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Monitoring and tracking utilities for timers, trackers, and system monitoring",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"type-check": "tsc --noEmit"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@sudobility/components": "^
|
|
25
|
+
"@sudobility/components": "^4.0.0",
|
|
26
26
|
"react": "^18.0.0 || ^19.0.0",
|
|
27
27
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
28
28
|
},
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from './gas-tracker';
|
|
2
|
+
export * from './sleep-tracker';
|
|
3
|
+
export * from './water-intake';
|
|
1
4
|
/**
|
|
2
5
|
* monitoring-components
|
|
3
6
|
*
|
|
@@ -9,11 +12,7 @@
|
|
|
9
12
|
export * from './break-timer';
|
|
10
13
|
export * from './copy-button';
|
|
11
14
|
export * from './cursor-tracker';
|
|
12
|
-
export * from './gas-tracker';
|
|
13
15
|
export * from './overtime-tracker';
|
|
14
|
-
export * from './portal';
|
|
15
16
|
export * from './recycling-tracker';
|
|
16
17
|
export * from './show';
|
|
17
|
-
export * from './sleep-tracker';
|
|
18
18
|
export * from './time-tracker';
|
|
19
|
-
export * from './water-intake';
|
package/dist/portal.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface PortalProps {
|
|
3
|
-
/** Content to portal */
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
/** Target container (defaults to document.body) */
|
|
6
|
-
container?: Element | null;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Portal Component
|
|
10
|
-
*
|
|
11
|
-
* Renders children into a DOM node outside the parent component's hierarchy.
|
|
12
|
-
* Useful for modals, tooltips, and overlays that need to break out of z-index stacking.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* <Portal>
|
|
17
|
-
* <Modal>Content</Modal>
|
|
18
|
-
* </Portal>
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* <Portal container={customElement}>
|
|
24
|
-
* <Tooltip>Tooltip content</Tooltip>
|
|
25
|
-
* </Portal>
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare const Portal: React.FC<PortalProps>;
|
|
29
|
-
//# sourceMappingURL=portal.d.ts.map
|
package/dist/portal.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../src/portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAaxC,CAAC"}
|
package/src/portal.tsx
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { createPortal } from 'react-dom';
|
|
3
|
-
|
|
4
|
-
export interface PortalProps {
|
|
5
|
-
/** Content to portal */
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
/** Target container (defaults to document.body) */
|
|
8
|
-
container?: Element | null;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Portal Component
|
|
13
|
-
*
|
|
14
|
-
* Renders children into a DOM node outside the parent component's hierarchy.
|
|
15
|
-
* Useful for modals, tooltips, and overlays that need to break out of z-index stacking.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* <Portal>
|
|
20
|
-
* <Modal>Content</Modal>
|
|
21
|
-
* </Portal>
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```tsx
|
|
26
|
-
* <Portal container={customElement}>
|
|
27
|
-
* <Tooltip>Tooltip content</Tooltip>
|
|
28
|
-
* </Portal>
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export const Portal: React.FC<PortalProps> = ({ children, container }) => {
|
|
32
|
-
const [mounted, setMounted] = useState(false);
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
setMounted(true);
|
|
36
|
-
return () => setMounted(false);
|
|
37
|
-
}, []);
|
|
38
|
-
|
|
39
|
-
if (!mounted) return null;
|
|
40
|
-
|
|
41
|
-
const target = container || document.body;
|
|
42
|
-
|
|
43
|
-
return createPortal(children, target);
|
|
44
|
-
};
|