@vnejs/uis.react.backdrop 0.1.2
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/Backdrop.d.ts +21 -0
- package/dist/Backdrop.d.ts.map +1 -0
- package/dist/Backdrop.js +24 -0
- package/dist/Backdrop.js.map +1 -0
- package/dist/Backdrop.styl +39 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "./Backdrop.styl";
|
|
2
|
+
export declare const Backdrop: {
|
|
3
|
+
({ zIndex, transition, type, size, opacity, color1, color2, className, children }: {
|
|
4
|
+
zIndex?: any;
|
|
5
|
+
transition?: any;
|
|
6
|
+
type?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
opacity?: number;
|
|
9
|
+
color1: any;
|
|
10
|
+
color2: any;
|
|
11
|
+
className: any;
|
|
12
|
+
children: any;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
TYPE: {
|
|
15
|
+
TOP: string;
|
|
16
|
+
RIGHT: string;
|
|
17
|
+
BOTTOM: string;
|
|
18
|
+
LEFT: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Backdrop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Backdrop.d.ts","sourceRoot":"","sources":["../src/Backdrop.tsx"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,CAAC;AAIzB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;CAwBpB,CAAC"}
|
package/dist/Backdrop.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { cn, getVneLength } from "@vnejs/uis.utils";
|
|
4
|
+
import "./Backdrop.styl";
|
|
5
|
+
const b = cn("Backdrop");
|
|
6
|
+
export const Backdrop = ({ zIndex = null, transition = null, type = "", size = 360, opacity = 1, color1, color2, className, children }) => {
|
|
7
|
+
const style = useMemo(() => {
|
|
8
|
+
const TYPE_TO_DEGREE = { [Backdrop.TYPE.BOTTOM]: 0, [Backdrop.TYPE.LEFT]: 90, [Backdrop.TYPE.TOP]: 180, [Backdrop.TYPE.RIGHT]: 270 };
|
|
9
|
+
const result = { ["--vne-backdrop-degree"]: `${TYPE_TO_DEGREE[type || Backdrop.TYPE.TOP]}deg`, opacity };
|
|
10
|
+
result["--vne-backdrop-length"] = getVneLength(size);
|
|
11
|
+
if (color1)
|
|
12
|
+
result["--vne-backdrop-color-1"] = color1;
|
|
13
|
+
if (color2)
|
|
14
|
+
result["--vne-backdrop-color-2"] = color2;
|
|
15
|
+
if (zIndex !== null)
|
|
16
|
+
result.zIndex = zIndex;
|
|
17
|
+
if (transition !== null)
|
|
18
|
+
result.transition = transition === 0 ? "none" : `${transition}ms`;
|
|
19
|
+
return result;
|
|
20
|
+
}, [zIndex, size, type, color1, color2, opacity]);
|
|
21
|
+
return (_jsx("div", { className: b({ type }, [className]), style: style, children: children }));
|
|
22
|
+
};
|
|
23
|
+
Backdrop.TYPE = { TOP: "top", RIGHT: "right", BOTTOM: "bottom", LEFT: "left" };
|
|
24
|
+
//# sourceMappingURL=Backdrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Backdrop.js","sourceRoot":"","sources":["../src/Backdrop.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;AAEzB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,MAAM,GAAG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ACE,SAAS,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EACnC,KAAK,EAAE,KAAK,YAEX,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.Backdrop
|
|
2
|
+
--vne-backdrop-color-1: rgba(0, 0, 0, 85%);
|
|
3
|
+
--vne-backdrop-color-2: rgba(0, 0, 0, 0%);
|
|
4
|
+
|
|
5
|
+
--vne-backdrop-degree: 0deg
|
|
6
|
+
|
|
7
|
+
display: block
|
|
8
|
+
position: absolute
|
|
9
|
+
|
|
10
|
+
background: linear-gradient(var(--vne-backdrop-degree), var(--vne-backdrop-color-1) 0%, var(--vne-backdrop-color-2) 100%)
|
|
11
|
+
|
|
12
|
+
&_type_top,
|
|
13
|
+
&_type_right,
|
|
14
|
+
&_type_left
|
|
15
|
+
top: 0
|
|
16
|
+
|
|
17
|
+
&_type_top,
|
|
18
|
+
&_type_right,
|
|
19
|
+
&_type_bottom
|
|
20
|
+
right: 0
|
|
21
|
+
|
|
22
|
+
&_type_right,
|
|
23
|
+
&_type_bottom,
|
|
24
|
+
&_type_left
|
|
25
|
+
bottom: 0
|
|
26
|
+
|
|
27
|
+
&_type_top,
|
|
28
|
+
&_type_bottom,
|
|
29
|
+
&_type_left
|
|
30
|
+
left: 0
|
|
31
|
+
|
|
32
|
+
&_type_top,
|
|
33
|
+
&_type_bottom
|
|
34
|
+
height: var(--vne-backdrop-length)
|
|
35
|
+
|
|
36
|
+
&_type_right,
|
|
37
|
+
&_type_left
|
|
38
|
+
width: var(--vne-backdrop-length)
|
|
39
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/uis.react.backdrop",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "node ../../scripts/build-package.mjs",
|
|
8
|
+
"publish:major:plugin": "npm run publish:major",
|
|
9
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
10
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
11
|
+
"publish:major": "npm run build && npm version major && npm publish --access public",
|
|
12
|
+
"publish:minor": "npm run build && npm version minor && npm publish --access public",
|
|
13
|
+
"publish:patch": "npm run build && npm version patch && npm publish --access public"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@bem-react/classname": "1.5.12",
|
|
17
|
+
"@vnejs/uis.utils": "~0.1.0",
|
|
18
|
+
"react": "19.2.4",
|
|
19
|
+
"react-dom": "19.2.4"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@vnejs/uis.react": "~0.1.0",
|
|
23
|
+
"typescript": "^5.7.3",
|
|
24
|
+
"@types/react": "^19.0.10",
|
|
25
|
+
"@types/react-dom": "^19.0.4"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"package.json"
|
|
30
|
+
]
|
|
31
|
+
}
|