@perspective-ai/sdk-react 1.0.0-alpha.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/README.md +316 -0
- package/dist/index.cjs +529 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +96 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.js +521 -0
- package/dist/index.js.map +1 -0
- package/package.json +70 -0
- package/src/FloatBubble.test.tsx +173 -0
- package/src/FloatBubble.tsx +83 -0
- package/src/Fullpage.test.tsx +164 -0
- package/src/Fullpage.tsx +83 -0
- package/src/PopupButton.test.tsx +273 -0
- package/src/PopupButton.tsx +208 -0
- package/src/SliderButton.test.tsx +279 -0
- package/src/SliderButton.tsx +208 -0
- package/src/Widget.test.tsx +308 -0
- package/src/Widget.tsx +100 -0
- package/src/hooks/useStableCallback.test.ts +83 -0
- package/src/hooks/useStableCallback.ts +20 -0
- package/src/hooks/useThemeSync.test.ts +127 -0
- package/src/hooks/useThemeSync.ts +36 -0
- package/src/index.ts +52 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Perspective Embed SDK - React Components
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* import { Widget, PopupButton, SliderButton, FloatBubble } from '@perspective-ai/sdk-react';
|
|
8
|
+
*
|
|
9
|
+
* // Inline widget
|
|
10
|
+
* <Widget researchId="xxx" onReady={() => {}} />
|
|
11
|
+
*
|
|
12
|
+
* // Popup button
|
|
13
|
+
* <PopupButton researchId="xxx">Take the interview</PopupButton>
|
|
14
|
+
*
|
|
15
|
+
* // Slider button
|
|
16
|
+
* <SliderButton researchId="xxx">Open Interview</SliderButton>
|
|
17
|
+
*
|
|
18
|
+
* // Floating bubble
|
|
19
|
+
* <FloatBubble researchId="xxx" />
|
|
20
|
+
*
|
|
21
|
+
* // Full page
|
|
22
|
+
* <Fullpage researchId="xxx" />
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// Components
|
|
26
|
+
export { Widget, type WidgetProps } from "./Widget";
|
|
27
|
+
export {
|
|
28
|
+
PopupButton,
|
|
29
|
+
type PopupButtonProps,
|
|
30
|
+
type PopupButtonHandle,
|
|
31
|
+
} from "./PopupButton";
|
|
32
|
+
export {
|
|
33
|
+
SliderButton,
|
|
34
|
+
type SliderButtonProps,
|
|
35
|
+
type SliderButtonHandle,
|
|
36
|
+
} from "./SliderButton";
|
|
37
|
+
export { FloatBubble, type FloatBubbleProps } from "./FloatBubble";
|
|
38
|
+
export { Fullpage, type FullpageProps } from "./Fullpage";
|
|
39
|
+
|
|
40
|
+
// Hooks
|
|
41
|
+
export { useThemeSync } from "./hooks/useThemeSync";
|
|
42
|
+
export { useStableCallback } from "./hooks/useStableCallback";
|
|
43
|
+
|
|
44
|
+
// Re-export types from core package for convenience
|
|
45
|
+
export type {
|
|
46
|
+
EmbedConfig,
|
|
47
|
+
EmbedHandle,
|
|
48
|
+
FloatHandle,
|
|
49
|
+
BrandColors,
|
|
50
|
+
ThemeValue,
|
|
51
|
+
EmbedError,
|
|
52
|
+
} from "@perspective-ai/sdk";
|