@stackvibe-studio/three 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 StackVibe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ export interface FloatingSphereProps {
2
+ color?: string;
3
+ scale?: number;
4
+ speed?: number;
5
+ }
6
+ export declare function FloatingSphere({ color, scale, speed }: FloatingSphereProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface Glass3DCardProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ depth?: number;
6
+ blur?: number;
7
+ glow?: boolean;
8
+ tilt?: boolean;
9
+ interactive?: boolean;
10
+ }
11
+ export declare function Glass3DCard({ children, className, depth, blur, glow, tilt, interactive, }: Glass3DCardProps): import("react").JSX.Element;
package/dist/index.cjs ADDED
@@ -0,0 +1,99 @@
1
+ "use strict";
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)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ FloatingSphere: () => FloatingSphere,
24
+ Glass3DCard: () => Glass3DCard
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+
28
+ // src/components/floating-sphere.tsx
29
+ var import_drei = require("@react-three/drei");
30
+ var import_fiber = require("@react-three/fiber");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ function FloatingSphere({ color = "#8b5cf6", scale = 1, speed = 1.2 }) {
33
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-64 w-64 rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_fiber.Canvas, { camera: { position: [0, 0, 3] }, children: [
34
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ambientLight", { intensity: 1.2 }),
35
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("directionalLight", { position: [2, 2, 2], intensity: 1.5 }),
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drei.Float, { speed, rotationIntensity: 1.5, floatIntensity: 2, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_drei.Sphere, { args: [1, 64, 64], scale, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
+ import_drei.MeshDistortMaterial,
38
+ {
39
+ color,
40
+ roughness: 0.2,
41
+ metalness: 0.4,
42
+ distort: 0.35,
43
+ speed: 2
44
+ }
45
+ ) }) })
46
+ ] }) });
47
+ }
48
+
49
+ // src/components/glass-3d-card.tsx
50
+ var import_drei2 = require("@react-three/drei");
51
+ var import_fiber2 = require("@react-three/fiber");
52
+ var import_jsx_runtime2 = require("react/jsx-runtime");
53
+ function Glass3DCard({
54
+ children,
55
+ className = "",
56
+ depth = 40,
57
+ blur = 18,
58
+ glow = true,
59
+ tilt = true,
60
+ interactive = true
61
+ }) {
62
+ const style = {
63
+ position: "relative",
64
+ overflow: "hidden",
65
+ borderRadius: "1.5rem",
66
+ background: "linear-gradient(135deg, rgba(15, 23, 42, 0.66), rgba(30, 41, 59, 0.3))",
67
+ border: "1px solid rgba(255, 255, 255, 0.12)",
68
+ backdropFilter: `blur(${blur}px)`,
69
+ boxShadow: glow ? "0 0 30px rgba(139, 92, 246, 0.2)" : void 0,
70
+ transform: tilt ? "perspective(1200px) rotateX(4deg) rotateY(-8deg)" : void 0,
71
+ minHeight: "300px"
72
+ };
73
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: ["relative", className].join(" "), style, children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "absolute inset-0 opacity-80", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_fiber2.Canvas, { dpr: [1, 2], camera: { position: [0, 0, 5], fov: 50 }, children: [
75
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ambientLight", { intensity: 0.8 }),
76
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("directionalLight", { position: [3, 3, 3], intensity: 1.2 }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_drei2.Float, { speed: 1.5, floatIntensity: 1.2, rotationIntensity: tilt ? 0.6 : 0.1, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_drei2.RoundedBox, { args: [2.6, 2.8, 0.5], radius: 0.18, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
78
+ "meshPhysicalMaterial",
79
+ {
80
+ color: glow ? "#8b5cf6" : "#dbeafe",
81
+ roughness: 0.08,
82
+ metalness: 0.45,
83
+ transmission: 0.8,
84
+ thickness: depth,
85
+ transparent: true,
86
+ opacity: 0.55
87
+ }
88
+ ) }) }),
89
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_drei2.Environment, { preset: "city" })
90
+ ] }) }),
91
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "relative z-10 h-full w-full p-5", children }),
92
+ !interactive ? null : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_55%)]" })
93
+ ] });
94
+ }
95
+ // Annotate the CommonJS export names for ESM import in node:
96
+ 0 && (module.exports = {
97
+ FloatingSphere,
98
+ Glass3DCard
99
+ });
@@ -0,0 +1,2 @@
1
+ export * from './components/floating-sphere';
2
+ export * from './components/glass-3d-card';
package/dist/index.js ADDED
@@ -0,0 +1,71 @@
1
+ // src/components/floating-sphere.tsx
2
+ import { Float, MeshDistortMaterial, Sphere } from "@react-three/drei";
3
+ import { Canvas } from "@react-three/fiber";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function FloatingSphere({ color = "#8b5cf6", scale = 1, speed = 1.2 }) {
6
+ return /* @__PURE__ */ jsx("div", { className: "h-64 w-64 rounded-full", children: /* @__PURE__ */ jsxs(Canvas, { camera: { position: [0, 0, 3] }, children: [
7
+ /* @__PURE__ */ jsx("ambientLight", { intensity: 1.2 }),
8
+ /* @__PURE__ */ jsx("directionalLight", { position: [2, 2, 2], intensity: 1.5 }),
9
+ /* @__PURE__ */ jsx(Float, { speed, rotationIntensity: 1.5, floatIntensity: 2, children: /* @__PURE__ */ jsx(Sphere, { args: [1, 64, 64], scale, children: /* @__PURE__ */ jsx(
10
+ MeshDistortMaterial,
11
+ {
12
+ color,
13
+ roughness: 0.2,
14
+ metalness: 0.4,
15
+ distort: 0.35,
16
+ speed: 2
17
+ }
18
+ ) }) })
19
+ ] }) });
20
+ }
21
+
22
+ // src/components/glass-3d-card.tsx
23
+ import { Environment, Float as Float2, RoundedBox } from "@react-three/drei";
24
+ import { Canvas as Canvas2 } from "@react-three/fiber";
25
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
26
+ function Glass3DCard({
27
+ children,
28
+ className = "",
29
+ depth = 40,
30
+ blur = 18,
31
+ glow = true,
32
+ tilt = true,
33
+ interactive = true
34
+ }) {
35
+ const style = {
36
+ position: "relative",
37
+ overflow: "hidden",
38
+ borderRadius: "1.5rem",
39
+ background: "linear-gradient(135deg, rgba(15, 23, 42, 0.66), rgba(30, 41, 59, 0.3))",
40
+ border: "1px solid rgba(255, 255, 255, 0.12)",
41
+ backdropFilter: `blur(${blur}px)`,
42
+ boxShadow: glow ? "0 0 30px rgba(139, 92, 246, 0.2)" : void 0,
43
+ transform: tilt ? "perspective(1200px) rotateX(4deg) rotateY(-8deg)" : void 0,
44
+ minHeight: "300px"
45
+ };
46
+ return /* @__PURE__ */ jsxs2("div", { className: ["relative", className].join(" "), style, children: [
47
+ /* @__PURE__ */ jsx2("div", { className: "absolute inset-0 opacity-80", children: /* @__PURE__ */ jsxs2(Canvas2, { dpr: [1, 2], camera: { position: [0, 0, 5], fov: 50 }, children: [
48
+ /* @__PURE__ */ jsx2("ambientLight", { intensity: 0.8 }),
49
+ /* @__PURE__ */ jsx2("directionalLight", { position: [3, 3, 3], intensity: 1.2 }),
50
+ /* @__PURE__ */ jsx2(Float2, { speed: 1.5, floatIntensity: 1.2, rotationIntensity: tilt ? 0.6 : 0.1, children: /* @__PURE__ */ jsx2(RoundedBox, { args: [2.6, 2.8, 0.5], radius: 0.18, children: /* @__PURE__ */ jsx2(
51
+ "meshPhysicalMaterial",
52
+ {
53
+ color: glow ? "#8b5cf6" : "#dbeafe",
54
+ roughness: 0.08,
55
+ metalness: 0.45,
56
+ transmission: 0.8,
57
+ thickness: depth,
58
+ transparent: true,
59
+ opacity: 0.55
60
+ }
61
+ ) }) }),
62
+ /* @__PURE__ */ jsx2(Environment, { preset: "city" })
63
+ ] }) }),
64
+ /* @__PURE__ */ jsx2("div", { className: "relative z-10 h-full w-full p-5", children }),
65
+ !interactive ? null : /* @__PURE__ */ jsx2("div", { className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_55%)]" })
66
+ ] });
67
+ }
68
+ export {
69
+ FloatingSphere,
70
+ Glass3DCard
71
+ };
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@stackvibe-studio/three",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "3D component layer for StackVibe UI.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/StackVibe-Studio/stackvibe-ui.git"
9
+ },
10
+ "homepage": "https://stackvibe-studio.github.io/stackvibe-ui/",
11
+ "bugs": {
12
+ "url": "https://github.com/StackVibe-Studio/stackvibe-ui/issues"
13
+ },
14
+ "license": "MIT",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.cjs"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "sideEffects": false,
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "registry": "https://registry.npmjs.org/"
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "peerDependencies": {
34
+ "react": ">=18.0.0",
35
+ "react-dom": ">=18.0.0"
36
+ },
37
+ "dependencies": {
38
+ "@react-three/drei": "^10.0.0",
39
+ "@react-three/fiber": "^9.0.0",
40
+ "three": "^0.180.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/react": "^19.0.0",
44
+ "@types/react-dom": "^19.0.0",
45
+ "@types/three": "^0.180.0",
46
+ "tsup": "^8.1.0",
47
+ "typescript": "^5.7.0"
48
+ },
49
+ "scripts": {
50
+ "build": "tsup src/index.ts --format esm,cjs --clean && tsc --project tsconfig.json --emitDeclarationOnly",
51
+ "typecheck": "tsc --noEmit"
52
+ }
6
53
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.