@openfeed-ink/widget 0.1.3

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 (43) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +141 -0
  3. package/dist/npm/AnnouncementBanner-BPo8Jmax.js +75 -0
  4. package/dist/npm/App.d.ts +5 -0
  5. package/dist/npm/ChangelogTab-DBQ5Ip6K.js +18 -0
  6. package/dist/npm/DrawerType-D9YHimv7.js +1184 -0
  7. package/dist/npm/FeatureDialog-BU1c2n3F.js +31 -0
  8. package/dist/npm/FeedbackTab-V7VCrze1.js +71 -0
  9. package/dist/npm/Main.d.ts +5 -0
  10. package/dist/npm/PopoverType-DlyRog2q.js +1863 -0
  11. package/dist/npm/RoadmapTab-DOYJBpgd.js +18 -0
  12. package/dist/npm/WidgetContent-Bs4eY5OF.js +507 -0
  13. package/dist/npm/button-Q2Dh1yK6.js +3086 -0
  14. package/dist/npm/components/AnnouncementBanner.d.ts +4 -0
  15. package/dist/npm/components/ChangelogTab.d.ts +6 -0
  16. package/dist/npm/components/FeatureDialog.d.ts +5 -0
  17. package/dist/npm/components/FeedbackTab.d.ts +8 -0
  18. package/dist/npm/components/NewFeedback.d.ts +9 -0
  19. package/dist/npm/components/RoadmapTab.d.ts +6 -0
  20. package/dist/npm/components/WidgetContent.d.ts +8 -0
  21. package/dist/npm/components/theme-provider.d.ts +8 -0
  22. package/dist/npm/components/triggerType/DrawerType.d.ts +11 -0
  23. package/dist/npm/components/triggerType/PopoverType.d.ts +11 -0
  24. package/dist/npm/components/ui/button.d.ts +10 -0
  25. package/dist/npm/components/ui/dialog.d.ts +11 -0
  26. package/dist/npm/components/ui/drawer.d.ts +10 -0
  27. package/dist/npm/components/ui/popover.d.ts +7 -0
  28. package/dist/npm/components/ui/tabs.d.ts +11 -0
  29. package/dist/npm/context/outsideEvent.d.ts +17 -0
  30. package/dist/npm/context/shadow-root.d.ts +5 -0
  31. package/dist/npm/dialog-5J_RZfbt.js +107 -0
  32. package/dist/npm/hooks/use-local-storage.d.ts +1 -0
  33. package/dist/npm/index-BaBFRQOq.js +1043 -0
  34. package/dist/npm/index-BkmaVINv.js +334 -0
  35. package/dist/npm/index-MTTUickr.js +237 -0
  36. package/dist/npm/index.d.ts +2 -0
  37. package/dist/npm/index.js +6 -0
  38. package/dist/npm/lib/utils.d.ts +2 -0
  39. package/dist/npm/mount.d.ts +7 -0
  40. package/dist/npm/react/OpenFeed.d.ts +7 -0
  41. package/dist/npm/types/index.d.ts +31 -0
  42. package/dist/npm/x-BkA0RvhX.js +9 -0
  43. package/package.json +95 -0
@@ -0,0 +1,4 @@
1
+ import { AnnouncementConfig } from '../types';
2
+ export default function AnnouncementBanner({ announcement, }: {
3
+ announcement: AnnouncementConfig;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ export default function ChangelogTab(config: {
2
+ apiUrl: string;
3
+ projectId: string;
4
+ isDrawer: boolean;
5
+ theme: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { WidgetConfig } from '../types';
2
+ export default function FeatureDialog({ widgetConfig, theme, }: {
3
+ theme: string;
4
+ widgetConfig: WidgetConfig;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export default function FeedbackTab(config: {
2
+ apiUrl: string;
3
+ projectId: string;
4
+ isDrawer: boolean;
5
+ theme: string;
6
+ textColor: string;
7
+ bgColor: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare function NewFeatureDialog({ widgetConfig, color, backgroundColor, theme, }: {
2
+ theme: string;
3
+ backgroundColor: string;
4
+ color: string;
5
+ widgetConfig: {
6
+ apiUrl: string;
7
+ projectId: string;
8
+ };
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export default function RoadmapTab(config: {
2
+ apiUrl: string;
3
+ projectId: string;
4
+ isDrawer: boolean;
5
+ theme: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Config, WidgetConfig } from '../types';
2
+ interface WidgetContentProps {
3
+ config: Config;
4
+ widgetConfig: WidgetConfig;
5
+ isDrawer: boolean;
6
+ }
7
+ export default function WidgetContent({ config, widgetConfig, isDrawer, }: WidgetContentProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ type Theme = "dark" | "light" | "system";
3
+ interface ThemeProviderProps {
4
+ children: React.ReactNode;
5
+ theme: Theme;
6
+ }
7
+ export declare function ThemeProvider({ children, theme }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Config, WidgetConfig } from '../../types';
2
+ import { LucideProps } from 'lucide-react';
3
+ interface DrawerTyping {
4
+ config: Config;
5
+ IconComponent: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>> | null;
6
+ }
7
+ interface DrawerExtra extends DrawerTyping {
8
+ widgetConfig: WidgetConfig;
9
+ }
10
+ export default function DrawerType({ config, IconComponent, widgetConfig }: DrawerExtra): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Config, WidgetConfig } from '../../types';
2
+ import { LucideProps } from 'lucide-react';
3
+ interface PopoverTyping {
4
+ config: Config;
5
+ IconComponent: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>> | null;
6
+ }
7
+ interface PopoverExtra extends PopoverTyping {
8
+ widgetConfig: WidgetConfig;
9
+ }
10
+ export default function PopoverType({ config, widgetConfig, IconComponent }: PopoverExtra): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,10 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { ClassProp } from 'class-variance-authority/types';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,11 @@
1
+ import { Dialog as DialogPrimitive } from 'radix-ui';
2
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
7
+ showCloseButton?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
10
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
11
+ export { Dialog, DialogContent, DialogOverlay, DialogPortal, DialogTitle, DialogDescription, DialogTrigger, };
@@ -0,0 +1,10 @@
1
+ import { Drawer as DrawerPrimitive } from 'vaul';
2
+ declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
9
+ declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
10
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, };
@@ -0,0 +1,7 @@
1
+ import { Popover as PopoverPrimitive } from 'radix-ui';
2
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
6
+ declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
7
+ export { Popover, PopoverAnchor, PopoverContent, PopoverHeader, PopoverTrigger, };
@@ -0,0 +1,11 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { Tabs as TabsPrimitive } from 'radix-ui';
3
+ import { ClassProp } from 'class-variance-authority/types';
4
+ declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare const tabsListVariants: (props?: ({
6
+ variant?: "default" | "line" | null | undefined;
7
+ } & ClassProp) | undefined) => string;
8
+ declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): import("react/jsx-runtime").JSX.Element;
9
+ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
10
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
11
+ export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -0,0 +1,17 @@
1
+ import { WidgetConfig } from '../types';
2
+ import { Dispatch, SetStateAction } from 'react';
3
+ type OutsideEventType = {
4
+ featureId: string | null;
5
+ setFeatureId: Dispatch<SetStateAction<string | null>>;
6
+ newFeatureOpen: boolean;
7
+ setNewFeatureOpen: Dispatch<SetStateAction<boolean>>;
8
+ iframeKey: number;
9
+ setReady: (ready: boolean) => void;
10
+ ready: boolean;
11
+ };
12
+ export declare function OutsideEventProvider({ config, children, }: {
13
+ children: React.ReactNode;
14
+ config: WidgetConfig;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export declare function useOutsideEvent(): OutsideEventType;
17
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare function ShadowRootProvider({ shadowRoot, children, }: {
2
+ shadowRoot: ShadowRoot;
3
+ children: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function useShadowRoot(): ShadowRoot | null;
@@ -0,0 +1,107 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { B as l, c as e } from "./button-Q2Dh1yK6.js";
4
+ import { a as d } from "./index-BkmaVINv.js";
5
+ import { X as c } from "./x-BkA0RvhX.js";
6
+ import { R as u, T as g, C as m, b as f, a as p, D as x, P as b, O as D } from "./index-MTTUickr.js";
7
+ function k({
8
+ ...a
9
+ }) {
10
+ return /* @__PURE__ */ t(u, { "data-slot": "dialog", ...a });
11
+ }
12
+ function v({
13
+ ...a
14
+ }) {
15
+ return /* @__PURE__ */ t(g, { "data-slot": "dialog-trigger", ...a });
16
+ }
17
+ function h({
18
+ ...a
19
+ }) {
20
+ return /* @__PURE__ */ t(b, { "data-slot": "dialog-portal", ...a });
21
+ }
22
+ function C({
23
+ className: a,
24
+ ...o
25
+ }) {
26
+ return /* @__PURE__ */ t(
27
+ D,
28
+ {
29
+ "data-slot": "dialog-overlay",
30
+ className: e(
31
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
32
+ a
33
+ ),
34
+ ...o
35
+ }
36
+ );
37
+ }
38
+ function R({
39
+ className: a,
40
+ children: o,
41
+ showCloseButton: s = !0,
42
+ ...i
43
+ }) {
44
+ const r = d();
45
+ return /* @__PURE__ */ n(h, { container: r, children: [
46
+ /* @__PURE__ */ t(C, {}),
47
+ /* @__PURE__ */ n(
48
+ m,
49
+ {
50
+ "data-slot": "dialog-content",
51
+ className: e(
52
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
53
+ a
54
+ ),
55
+ ...i,
56
+ children: [
57
+ o,
58
+ s && /* @__PURE__ */ t(f, { "data-slot": "dialog-close", asChild: !0, children: /* @__PURE__ */ n(
59
+ l,
60
+ {
61
+ variant: "ghost",
62
+ className: "absolute top-2 right-2",
63
+ size: "icon-sm",
64
+ children: [
65
+ /* @__PURE__ */ t(c, {}),
66
+ /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
67
+ ]
68
+ }
69
+ ) })
70
+ ]
71
+ }
72
+ )
73
+ ] });
74
+ }
75
+ function O({
76
+ className: a,
77
+ ...o
78
+ }) {
79
+ return /* @__PURE__ */ t(
80
+ p,
81
+ {
82
+ "data-slot": "dialog-title",
83
+ className: e("text-base font-medium text-foreground", a),
84
+ ...o
85
+ }
86
+ );
87
+ }
88
+ function P({
89
+ className: a,
90
+ ...o
91
+ }) {
92
+ return /* @__PURE__ */ t(
93
+ x,
94
+ {
95
+ "data-slot": "dialog-description",
96
+ className: e("text-sm text-muted-foreground", a),
97
+ ...o
98
+ }
99
+ );
100
+ }
101
+ export {
102
+ k as D,
103
+ R as a,
104
+ O as b,
105
+ P as c,
106
+ v as d
107
+ };
@@ -0,0 +1 @@
1
+ export declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T) => void];