@jarvinbyintromatic/nextjs 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.
Files changed (2) hide show
  1. package/package.json +17 -0
  2. package/src/index.tsx +20 -0
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@jarvinbyintromatic/nextjs",
3
+ "version": "1.0.0",
4
+ "description": "Jarvin chat widget — Next.js component (SSR-safe)",
5
+ "type": "module",
6
+ "main": "src/index.tsx",
7
+ "types": "src/index.tsx",
8
+ "license": "MIT",
9
+ "dependencies": {
10
+ "@jarvinbyintromatic/react": "^1.0.0",
11
+ "jarvin-widget": "^1.0.0"
12
+ },
13
+ "peerDependencies": {
14
+ "react": ">=18",
15
+ "next": ">=13"
16
+ }
17
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+
3
+ import dynamic from 'next/dynamic';
4
+ import type { WidgetOptions } from 'jarvin-widget';
5
+
6
+ interface JarvinWidgetProps extends WidgetOptions {
7
+ defaultOpen?: boolean;
8
+ }
9
+
10
+ // Dynamic import with SSR disabled — the widget needs DOM APIs
11
+ const JarvinChatWidgetInner = dynamic(
12
+ () => import('@jarvinbyintromatic/react').then(m => ({ default: m.JarvinChatWidget })),
13
+ { ssr: false },
14
+ );
15
+
16
+ export function JarvinChatWidget(props: JarvinWidgetProps) {
17
+ return <JarvinChatWidgetInner {...props} />;
18
+ }
19
+
20
+ export type { WidgetOptions } from 'jarvin-widget';