@xylabs/react-portal 7.1.17 → 7.1.20

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 CHANGED
@@ -1,67 +1,27 @@
1
- [![logo][]](https://xylabs.com)
2
-
3
1
  # @xylabs/react-portal
4
2
 
5
- [![npm-badge][]][npm-link]
6
- [![npm-downloads-badge][]][npm-link]
7
- [![jsdelivr-badge][]][jsdelivr-link]
8
- [![npm-license-badge][]](LICENSE)
9
-
10
- > XY Labs generalized React library
11
-
12
- ## Table of Contents
3
+ [![npm][npm-badge]][npm-link]
13
4
 
14
- - [Description](#description)
15
- - [Install](#install)
16
- - [Maintainers](#maintainers)
17
- - [License](#license)
18
- - [Credits](#credits)
19
-
20
- ## Description
21
-
22
- Common React code that is used throughout XYO projects that use React.
5
+ > Common React library for all XY Labs projects that use React
23
6
 
24
7
  ## Install
25
8
 
26
- Using npm:
27
-
28
9
  ```sh
29
- npm i --save @xylabs/react-portal
10
+ npm install {{name}}
30
11
  ```
31
12
 
32
- Using yarn:
13
+ or
33
14
 
34
15
  ```sh
35
- yarn add @xylabs/react-portal
16
+ yarn add {{name}}
36
17
  ```
37
18
 
38
- ## Documentation
39
- [Developer Reference](https://xylabs.github.io/sdk-react)
40
-
41
- [Storybook](https://xylabs.github.io/sdk-react/storybook)
42
-
43
- ## Maintainers
44
-
45
- - [Arie Trouw](https://github.com/arietrouw) ([arietrouw.com](https://arietrouw.com))
46
- - [Matt Jones](https://github.com/jonesmac)
47
- - [Joel Carter](https://github.com/JoelBCarter)
48
- - [Jordan Trouw](https://github.com/jordantrouw)
49
19
 
50
20
  ## License
51
21
 
52
- See the [LICENSE](LICENSE) file for license details
22
+ See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
53
23
 
54
- ## Credits
55
24
 
56
- [Made with 🔥and ❄️ by XY Labs](https://xylabs.com)
57
-
58
- [logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg
59
25
 
60
26
  [npm-badge]: https://img.shields.io/npm/v/@xylabs/react-portal.svg
61
27
  [npm-link]: https://www.npmjs.com/package/@xylabs/react-portal
62
-
63
- [npm-downloads-badge]: https://img.shields.io/npm/dw/@xylabs/react-portal
64
- [npm-license-badge]: https://img.shields.io/npm/l/@xylabs/react-portal
65
-
66
- [jsdelivr-badge]: https://data.jsdelivr.com/v1/package/npm/@xylabs/react-portal/badge
67
- [jsdelivr-link]: https://www.jsdelivr.com/package/npm/@xylabs/react-portal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/react-portal",
3
- "version": "7.1.17",
3
+ "version": "7.1.20",
4
4
  "description": "Common React library for all XY Labs projects that use React",
5
5
  "keywords": [
6
6
  "utility",
@@ -27,15 +27,15 @@
27
27
  "exports": {
28
28
  ".": {
29
29
  "types": "./dist/browser/index.d.ts",
30
+ "import": "./dist/browser/index.mjs",
30
31
  "default": "./dist/browser/index.mjs"
31
32
  },
32
33
  "./package.json": "./package.json"
33
34
  },
34
- "module": "./dist/browser/index.mjs",
35
35
  "types": "dist/browser/index.d.ts",
36
36
  "files": [
37
37
  "dist",
38
- "src"
38
+ "README.md"
39
39
  ],
40
40
  "workspaces": [
41
41
  "packages/*"
@@ -43,19 +43,20 @@
43
43
  "devDependencies": {
44
44
  "@types/react": "^19.2.14",
45
45
  "@types/react-dom": "~19.2.3",
46
- "@xylabs/ts-scripts-yarn3": "~7.4.9",
47
- "@xylabs/tsconfig": "~7.4.9",
48
- "@xylabs/tsconfig-dom": "~7.4.9",
49
- "@xylabs/tsconfig-react": "~7.4.9",
46
+ "@xylabs/ts-scripts-common": "~7.8.5",
47
+ "@xylabs/ts-scripts-pnpm": "~7.8.5",
48
+ "@xylabs/tsconfig": "~7.8",
49
+ "@xylabs/tsconfig-dom": "~7.8.5",
50
+ "@xylabs/tsconfig-react": "~7.8.5",
50
51
  "react": "^19.2.4",
51
- "react-dom": "^19.2.4",
52
+ "react-dom": "~19.2.4",
52
53
  "typescript": "^5.9.3"
53
54
  },
54
55
  "peerDependencies": {
55
56
  "react": "^19",
56
- "react-dom": "^19"
57
+ "react-dom": "~19.2.4"
57
58
  },
58
59
  "publishConfig": {
59
60
  "access": "public"
60
61
  }
61
- }
62
+ }
@@ -1,25 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
- import { createPortal } from 'react-dom'
3
-
4
- import type { PortalProps } from './PortalProps.ts'
5
-
6
- export const Portal: React.FC<PortalProps> = ({
7
- children, className, el = 'div', target = 'body',
8
- }: PortalProps) => {
9
- const [container] = useState(document.createElement(el))
10
- if (className) {
11
- container.classList.add(className)
12
- }
13
- useEffect(() => {
14
- const targetElement = document.querySelector(target)
15
- if (!targetElement) {
16
- console.warn(`Unable to find target element: ${target}`)
17
- }
18
- targetElement?.append(container)
19
- return () => {
20
- container.remove()
21
- }
22
- }, [container, target])
23
-
24
- return createPortal(children, container)
25
- }
@@ -1,6 +0,0 @@
1
- export interface PortalProps {
2
- children: React.ReactNode
3
- className?: string
4
- el?: string
5
- target?: string
6
- }
@@ -1,2 +0,0 @@
1
- export * from './Portal.tsx'
2
- export * from './PortalProps.ts'
@@ -1 +0,0 @@
1
- export * from './Portal/index.ts'
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/index.ts'
@@ -1,5 +0,0 @@
1
- declare module '*.png'
2
- declare module '*.jpg'
3
- declare module '*.svg'
4
- declare module '*.gif'
5
- declare module '*.webp'