@ssgoi/react 2.0.0 → 2.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.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("@ssgoi/core"),s=require("./context.cjs"),r=({children:i,id:t})=>{const e=s.useSsgoi();return n.jsx("div",{ref:o.transition(e(t)),"data-ssgoi-transition":t,children:i})};exports.SsgoiTransition=r;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),a=require("@ssgoi/core"),u=require("./context.cjs"),g=({children:n,id:t,as:o,className:e,...i})=>{const s=u.useSsgoi(),r=o||"div";return c.jsx(r,{ref:a.transition(s(t)),"data-ssgoi-transition":t,className:e,...i,children:n})};exports.SsgoiTransition=g;
@@ -1,5 +1,9 @@
1
- import { ReactNode } from 'react';
2
- export declare const SsgoiTransition: ({ children, id, }: {
1
+ import { ReactNode, ElementType } from 'react';
2
+ type SsgoiTransitionProps<T extends ElementType = "div"> = {
3
3
  children: ReactNode;
4
4
  id: string;
5
- }) => import("react/jsx-runtime").JSX.Element;
5
+ as?: T;
6
+ className?: string;
7
+ };
8
+ export declare const SsgoiTransition: <T extends ElementType = "div">({ children, id, as, className, ...rest }: SsgoiTransitionProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,14 +1,26 @@
1
1
  "use client";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { transition as s } from "@ssgoi/core";
4
- import { useSsgoi as n } from "./context.js";
5
- const f = ({
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { transition as e } from "@ssgoi/core";
4
+ import { useSsgoi as a } from "./context.js";
5
+ const u = ({
6
6
  children: t,
7
- id: o
7
+ id: o,
8
+ as: n,
9
+ className: i,
10
+ ...r
8
11
  }) => {
9
- const i = n();
10
- return /* @__PURE__ */ r("div", { ref: s(i(o)), "data-ssgoi-transition": o, children: t });
12
+ const s = a();
13
+ return /* @__PURE__ */ m(
14
+ n || "div",
15
+ {
16
+ ref: e(s(o)),
17
+ "data-ssgoi-transition": o,
18
+ className: i,
19
+ ...r,
20
+ children: t
21
+ }
22
+ );
11
23
  };
12
24
  export {
13
- f as SsgoiTransition
25
+ u as SsgoiTransition
14
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/react",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "React bindings for SSGOI - Native app-like page transitions for React applications",
5
5
  "private": false,
6
6
  "type": "module",
@@ -44,8 +44,17 @@
44
44
  "default": "./dist/presets/index.js"
45
45
  }
46
46
  },
47
+ "scripts": {
48
+ "dev": "vite build --watch",
49
+ "build": "tsc -b && vite build",
50
+ "watch": "vite build --watch",
51
+ "lint": "eslint .",
52
+ "preview": "vite preview",
53
+ "package": "vite build",
54
+ "prepare": "pnpm run build"
55
+ },
47
56
  "dependencies": {
48
- "@ssgoi/core": "2.0.0"
57
+ "@ssgoi/core": "workspace:*"
49
58
  },
50
59
  "peerDependencies": {
51
60
  "react": "^19.0.0",
@@ -89,13 +98,5 @@
89
98
  },
90
99
  "engines": {
91
100
  "node": ">=18.0.0"
92
- },
93
- "scripts": {
94
- "dev": "vite build --watch",
95
- "build": "tsc -b && vite build",
96
- "watch": "vite build --watch",
97
- "lint": "eslint .",
98
- "preview": "vite preview",
99
- "package": "vite build"
100
101
  }
101
- }
102
+ }