@elyndra/react-effects 1.0.0

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 ADDED
@@ -0,0 +1,5 @@
1
+ # AEGIS
2
+
3
+ Futuristic Sci-Fi UI Web Framework.
4
+
5
+ Check out [github.com/aegis/aegis](https://github.com/aegis/aegis).
@@ -0,0 +1,8 @@
1
+ import { type CreateEffectIlluminatorProps } from '@elyndra/effects';
2
+ import React, { type ForwardedRef, type HTMLProps } from 'react';
3
+ interface IlluminatorProps extends Omit<CreateEffectIlluminatorProps, 'container' | 'className' | 'style'>, HTMLProps<HTMLDivElement> {
4
+ elementRef?: ForwardedRef<HTMLDivElement>;
5
+ }
6
+ declare const Illuminator: React.ComponentType<IlluminatorProps>;
7
+ export { Illuminator };
8
+ export type { IlluminatorProps };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Illuminator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const effects_1 = require("@elyndra/effects");
6
+ const react_tools_1 = require("@elyndra/react-tools");
7
+ const tools_1 = require("@elyndra/tools");
8
+ const react_1 = tslib_1.__importStar(require("react"));
9
+ const Illuminator = (0, react_tools_1.memo)((props) => {
10
+ const { elementRef, color, size, ...otherProps } = props;
11
+ const containerRef = (0, react_1.useRef)(null);
12
+ (0, react_1.useEffect)(() => {
13
+ const container = containerRef.current;
14
+ if (!container) {
15
+ return;
16
+ }
17
+ const illuminator = (0, effects_1.createEffectIlluminator)({ container, color, size });
18
+ return () => illuminator.cancel();
19
+ }, [color, size]);
20
+ return (react_1.default.createElement("div", { ref: (0, react_tools_1.mergeRefs)(containerRef, elementRef), role: 'presentation', ...otherProps, className: (0, tools_1.cx)('aegis-frames-illuminator', otherProps.className), style: {
21
+ position: 'absolute',
22
+ inset: 0,
23
+ overflow: 'hidden',
24
+ width: '100%',
25
+ height: '100%',
26
+ ...otherProps.style,
27
+ } }));
28
+ });
29
+ exports.Illuminator = Illuminator;
@@ -0,0 +1 @@
1
+ export * from './Illuminator.js';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./Illuminator.js"), exports);
@@ -0,0 +1,11 @@
1
+ import { type CreateEffectIlluminatorSVGProps } from '@elyndra/effects';
2
+ import React, { type ForwardedRef, type RefObject, type SVGProps } from 'react';
3
+ interface IlluminatorSVGProps extends SVGProps<SVGGElement>, Omit<CreateEffectIlluminatorSVGProps, 'svg' | 'container' | 'className' | 'style'> {
4
+ elementRef?: ForwardedRef<SVGGElement>;
5
+ svgRef: RefObject<SVGSVGElement | null>;
6
+ color?: string;
7
+ size?: number;
8
+ }
9
+ declare const IlluminatorSVG: React.ComponentType<IlluminatorSVGProps>;
10
+ export { IlluminatorSVG };
11
+ export type { IlluminatorSVGProps };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IlluminatorSVG = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const effects_1 = require("@elyndra/effects");
6
+ const react_tools_1 = require("@elyndra/react-tools");
7
+ const tools_1 = require("@elyndra/tools");
8
+ const react_1 = tslib_1.__importStar(require("react"));
9
+ const IlluminatorSVG = (0, react_tools_1.memo)((props) => {
10
+ const { elementRef, svgRef, color, size, ...otherProps } = props;
11
+ const containerRef = (0, react_1.useRef)(null);
12
+ (0, react_1.useEffect)(() => {
13
+ const svg = svgRef.current;
14
+ const container = containerRef.current;
15
+ if (!svg || !container) {
16
+ return;
17
+ }
18
+ const effect = (0, effects_1.createEffectIlluminatorSVG)({ svg, container, size, color });
19
+ return () => effect.cancel();
20
+ }, [size, color]);
21
+ return (react_1.default.createElement("g", { ref: (0, react_tools_1.mergeRefs)(containerRef, elementRef), ...otherProps, className: (0, tools_1.cx)('aegis-frames-illuminatorsvg', otherProps.className), style: {
22
+ pointerEvents: 'none',
23
+ ...otherProps.style,
24
+ } }));
25
+ });
26
+ exports.IlluminatorSVG = IlluminatorSVG;
@@ -0,0 +1 @@
1
+ export * from './IlluminatorSVG.js';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./IlluminatorSVG.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './Illuminator/index.js';
2
+ export * from './IlluminatorSVG/index.js';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./Illuminator/index.js"), exports);
6
+ tslib_1.__exportStar(require("./IlluminatorSVG/index.js"), exports);
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,8 @@
1
+ import { type CreateEffectIlluminatorProps } from '@elyndra/effects';
2
+ import React, { type ForwardedRef, type HTMLProps } from 'react';
3
+ interface IlluminatorProps extends Omit<CreateEffectIlluminatorProps, 'container' | 'className' | 'style'>, HTMLProps<HTMLDivElement> {
4
+ elementRef?: ForwardedRef<HTMLDivElement>;
5
+ }
6
+ declare const Illuminator: React.ComponentType<IlluminatorProps>;
7
+ export { Illuminator };
8
+ export type { IlluminatorProps };
@@ -0,0 +1,25 @@
1
+ import { createEffectIlluminator } from '@elyndra/effects';
2
+ import { memo, mergeRefs } from '@elyndra/react-tools';
3
+ import { cx } from '@elyndra/tools';
4
+ import React, { useEffect, useRef } from 'react';
5
+ const Illuminator = memo((props) => {
6
+ const { elementRef, color, size, ...otherProps } = props;
7
+ const containerRef = useRef(null);
8
+ useEffect(() => {
9
+ const container = containerRef.current;
10
+ if (!container) {
11
+ return;
12
+ }
13
+ const illuminator = createEffectIlluminator({ container, color, size });
14
+ return () => illuminator.cancel();
15
+ }, [color, size]);
16
+ return (React.createElement("div", { ref: mergeRefs(containerRef, elementRef), role: 'presentation', ...otherProps, className: cx('aegis-frames-illuminator', otherProps.className), style: {
17
+ position: 'absolute',
18
+ inset: 0,
19
+ overflow: 'hidden',
20
+ width: '100%',
21
+ height: '100%',
22
+ ...otherProps.style,
23
+ } }));
24
+ });
25
+ export { Illuminator };
@@ -0,0 +1 @@
1
+ export * from './Illuminator.js';
@@ -0,0 +1 @@
1
+ export * from './Illuminator.js';
@@ -0,0 +1,11 @@
1
+ import { type CreateEffectIlluminatorSVGProps } from '@elyndra/effects';
2
+ import React, { type ForwardedRef, type RefObject, type SVGProps } from 'react';
3
+ interface IlluminatorSVGProps extends SVGProps<SVGGElement>, Omit<CreateEffectIlluminatorSVGProps, 'svg' | 'container' | 'className' | 'style'> {
4
+ elementRef?: ForwardedRef<SVGGElement>;
5
+ svgRef: RefObject<SVGSVGElement | null>;
6
+ color?: string;
7
+ size?: number;
8
+ }
9
+ declare const IlluminatorSVG: React.ComponentType<IlluminatorSVGProps>;
10
+ export { IlluminatorSVG };
11
+ export type { IlluminatorSVGProps };
@@ -0,0 +1,22 @@
1
+ import { createEffectIlluminatorSVG } from '@elyndra/effects';
2
+ import { memo, mergeRefs } from '@elyndra/react-tools';
3
+ import { cx } from '@elyndra/tools';
4
+ import React, { useEffect, useRef } from 'react';
5
+ const IlluminatorSVG = memo((props) => {
6
+ const { elementRef, svgRef, color, size, ...otherProps } = props;
7
+ const containerRef = useRef(null);
8
+ useEffect(() => {
9
+ const svg = svgRef.current;
10
+ const container = containerRef.current;
11
+ if (!svg || !container) {
12
+ return;
13
+ }
14
+ const effect = createEffectIlluminatorSVG({ svg, container, size, color });
15
+ return () => effect.cancel();
16
+ }, [size, color]);
17
+ return (React.createElement("g", { ref: mergeRefs(containerRef, elementRef), ...otherProps, className: cx('aegis-frames-illuminatorsvg', otherProps.className), style: {
18
+ pointerEvents: 'none',
19
+ ...otherProps.style,
20
+ } }));
21
+ });
22
+ export { IlluminatorSVG };
@@ -0,0 +1 @@
1
+ export * from './IlluminatorSVG.js';
@@ -0,0 +1 @@
1
+ export * from './IlluminatorSVG.js';
@@ -0,0 +1,2 @@
1
+ export * from './Illuminator/index.js';
2
+ export * from './IlluminatorSVG/index.js';
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+ export * from './Illuminator/index.js';
3
+ export * from './IlluminatorSVG/index.js';
@@ -0,0 +1 @@
1
+ {"type":"module"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@elyndra/react-effects",
3
+ "version": "1.0.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "Futuristic Sci-Fi UI Web Framework",
8
+ "keywords": [
9
+ "aegis",
10
+ "ui",
11
+ "front-end",
12
+ "framework",
13
+ "scifi",
14
+ "sci-fi",
15
+ "science-fiction"
16
+ ],
17
+ "homepage": "https://aegis.dev",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/aegis/aegis.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/aegis/aegis/issues"
24
+ },
25
+ "funding": "https://github.com/sponsors/romelperez",
26
+ "license": "MIT",
27
+ "files": [
28
+ "build"
29
+ ],
30
+ "exports": {
31
+ ".": {
32
+ "import": "./build/esm/index.js",
33
+ "require": "./build/cjs/index.js"
34
+ },
35
+ "./build/": {
36
+ "default": "./build/"
37
+ }
38
+ },
39
+ "types": "./build/esm/index.d.ts",
40
+ "module": "./build/esm/index.js",
41
+ "main": "./build/cjs/index.js",
42
+ "peerDependencies": {
43
+ "react": "19"
44
+ },
45
+ "dependencies": {
46
+ "@elyndra/effects": "^1.0.0",
47
+ "@elyndra/react-tools": "^1.0.0",
48
+ "@elyndra/tools": "^1.0.0",
49
+ "tslib": "2.8.1"
50
+ },
51
+ "devDependencies": {
52
+ "@elyndra/frames": "^1.0.0"
53
+ },
54
+ "scripts": {
55
+ "build": "npm run build-esm && npm run build-cjs",
56
+ "build-esm": "node ../../scripts/pkg-build.mjs esm",
57
+ "build-cjs": "node ../../scripts/pkg-build.mjs cjs",
58
+ "dev": "node ../../scripts/pkg-build.mjs esm --watch"
59
+ }
60
+ }