version-pill-react 1.1.1 → 1.2.1

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/dist/index.d.mts CHANGED
@@ -13,6 +13,22 @@ interface Version {
13
13
  type: string;
14
14
  }[];
15
15
  }
16
+ interface RoadmapTask {
17
+ id: string;
18
+ title: string;
19
+ type: string;
20
+ priority: string;
21
+ column: string;
22
+ isPublic?: boolean;
23
+ }
24
+ interface Idea {
25
+ id: string;
26
+ title: string;
27
+ description?: string;
28
+ status: string;
29
+ votes: number;
30
+ hasVoted?: boolean;
31
+ }
16
32
  interface ProjectInfo {
17
33
  name: string;
18
34
  slug: string;
@@ -23,110 +39,70 @@ interface ChangelogAPIResponse {
23
39
  project: ProjectInfo;
24
40
  changelog: Version[];
25
41
  }
42
+ interface RoadmapAPIResponse {
43
+ project: ProjectInfo;
44
+ tasks: RoadmapTask[];
45
+ }
26
46
  interface BadgeAPIResponse {
27
47
  version: string | null;
28
48
  name: string;
29
49
  slug: string;
30
50
  }
31
51
  interface VersionPillConfig {
32
- /** Your project slug from Version Pill dashboard */
33
52
  projectId: string;
34
- /** Version Pill API base URL (default: https://versionpill.com) */
35
53
  baseUrl?: string;
36
54
  }
37
55
  type BadgeStyle = "dot" | "pill" | "minimal" | "glass" | "gradient";
38
56
  type BadgeSize = "sm" | "md" | "lg";
57
+ type ModalTab = "changelog" | "roadmap" | "ideas";
39
58
  interface VersionPillProps extends VersionPillConfig {
40
- /** Position of the pill */
41
59
  position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "inline";
42
- /** Custom class name */
43
60
  className?: string;
44
- /** Theme */
45
61
  theme?: "light" | "dark" | "auto";
46
- /** Badge style variant */
47
62
  style?: BadgeStyle;
48
- /** Badge size */
49
63
  size?: BadgeSize;
50
- /** Show "Powered by Version Pill" branding */
51
64
  showBranding?: boolean;
52
- /** Accent color */
53
65
  accent?: "green" | "blue" | "purple" | "orange" | "neutral";
54
- /** Callback when a new version is detected */
55
66
  onNewVersion?: (version: Version) => void;
56
- /** Callback when badge is clicked */
57
67
  onClick?: () => void;
58
68
  }
59
69
  interface ChangelogProps extends VersionPillConfig {
60
- /** Max height in pixels */
61
70
  maxHeight?: number;
62
- /** Theme */
63
71
  theme?: "light" | "dark" | "auto";
64
- /** Custom class name */
65
72
  className?: string;
66
73
  }
67
74
  interface RoadmapProps extends VersionPillConfig {
68
- /** Max height in pixels */
69
75
  maxHeight?: number;
70
- /** Theme */
71
76
  theme?: "light" | "dark" | "auto";
72
- /** Custom class name */
73
77
  className?: string;
74
78
  }
75
79
  declare function VersionPill({ projectId, baseUrl, position, className, theme, style, size, showBranding, accent, onNewVersion, onClick, }: VersionPillProps): react_jsx_runtime.JSX.Element | null;
76
80
  interface VersionBadgeProps {
77
- /** Your project slug from Version Pill dashboard */
78
81
  projectId: string;
79
- /** Version Pill API base URL (default: https://versionpill.com) */
80
82
  baseUrl?: string;
81
- /** Theme */
82
83
  theme?: "light" | "dark" | "auto";
83
- /** Badge style variant */
84
84
  style?: BadgeStyle;
85
- /** Badge size */
86
85
  size?: BadgeSize;
87
- /** Accent color */
88
86
  accent?: "green" | "blue" | "purple" | "orange" | "neutral";
89
- /** Custom class name */
90
87
  className?: string;
91
- /** Link to changelog (if provided, badge becomes a link) */
92
88
  href?: string;
93
89
  }
94
90
  declare function VersionBadge({ projectId, baseUrl, theme, style, size, accent, className, href, }: VersionBadgeProps): react_jsx_runtime.JSX.Element | null;
95
- declare function Changelog({ projectId, baseUrl, maxHeight, theme, className, }: ChangelogProps): react_jsx_runtime.JSX.Element;
96
- declare function Roadmap({ projectId, baseUrl, maxHeight, theme, className, }: RoadmapProps): react_jsx_runtime.JSX.Element;
97
91
  interface UseVersionOptions {
98
- /** Your project slug from Version Pill dashboard */
99
92
  projectId: string;
100
- /** Version Pill API base URL (default: https://versionpill.com) */
101
93
  baseUrl?: string;
102
- /** Refetch interval in ms (0 = no refetch) */
103
94
  refetchInterval?: number;
104
95
  }
105
96
  interface UseVersionResult {
106
- /** Current version string (e.g., "1.2.3") */
107
97
  version: string | null;
108
- /** Project name */
109
98
  name: string | null;
110
- /** Project slug */
111
99
  slug: string | null;
112
- /** Loading state */
113
100
  loading: boolean;
114
- /** Error message if fetch failed */
115
101
  error: string | null;
116
- /** Manually refetch the version */
117
102
  refetch: () => Promise<void>;
118
103
  }
119
- /**
120
- * Hook to fetch the current version for a project.
121
- * Use this when you need the version data without the UI components.
122
- *
123
- * @example
124
- * ```tsx
125
- * const { version, loading } = useVersion({ projectId: "my-app" });
126
- * if (loading) return <Skeleton />;
127
- * return <span>v{version}</span>;
128
- * ```
129
- */
130
104
  declare function useVersion({ projectId, baseUrl, refetchInterval, }: UseVersionOptions): UseVersionResult;
105
+ declare function Changelog({ projectId, baseUrl, maxHeight, theme, className, }: ChangelogProps): react_jsx_runtime.JSX.Element;
106
+ declare function Roadmap({ projectId, baseUrl, maxHeight, theme, className, }: RoadmapProps): react_jsx_runtime.JSX.Element;
131
107
 
132
- export { type BadgeAPIResponse, type BadgeSize, type BadgeStyle, Changelog, type ChangelogAPIResponse, type ChangelogProps, type ProjectInfo, Roadmap, type RoadmapProps, type UseVersionOptions, type UseVersionResult, type Version, VersionBadge, type VersionBadgeProps, VersionPill, type VersionPillConfig, type VersionPillProps, VersionPill as default, useVersion };
108
+ export { type BadgeAPIResponse, type BadgeSize, type BadgeStyle, Changelog, type ChangelogAPIResponse, type ChangelogProps, type Idea, type ModalTab, type ProjectInfo, Roadmap, type RoadmapAPIResponse, type RoadmapProps, type RoadmapTask, type UseVersionOptions, type UseVersionResult, type Version, VersionBadge, type VersionBadgeProps, VersionPill, type VersionPillConfig, type VersionPillProps, VersionPill as default, useVersion };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,22 @@ interface Version {
13
13
  type: string;
14
14
  }[];
15
15
  }
16
+ interface RoadmapTask {
17
+ id: string;
18
+ title: string;
19
+ type: string;
20
+ priority: string;
21
+ column: string;
22
+ isPublic?: boolean;
23
+ }
24
+ interface Idea {
25
+ id: string;
26
+ title: string;
27
+ description?: string;
28
+ status: string;
29
+ votes: number;
30
+ hasVoted?: boolean;
31
+ }
16
32
  interface ProjectInfo {
17
33
  name: string;
18
34
  slug: string;
@@ -23,110 +39,70 @@ interface ChangelogAPIResponse {
23
39
  project: ProjectInfo;
24
40
  changelog: Version[];
25
41
  }
42
+ interface RoadmapAPIResponse {
43
+ project: ProjectInfo;
44
+ tasks: RoadmapTask[];
45
+ }
26
46
  interface BadgeAPIResponse {
27
47
  version: string | null;
28
48
  name: string;
29
49
  slug: string;
30
50
  }
31
51
  interface VersionPillConfig {
32
- /** Your project slug from Version Pill dashboard */
33
52
  projectId: string;
34
- /** Version Pill API base URL (default: https://versionpill.com) */
35
53
  baseUrl?: string;
36
54
  }
37
55
  type BadgeStyle = "dot" | "pill" | "minimal" | "glass" | "gradient";
38
56
  type BadgeSize = "sm" | "md" | "lg";
57
+ type ModalTab = "changelog" | "roadmap" | "ideas";
39
58
  interface VersionPillProps extends VersionPillConfig {
40
- /** Position of the pill */
41
59
  position?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | "inline";
42
- /** Custom class name */
43
60
  className?: string;
44
- /** Theme */
45
61
  theme?: "light" | "dark" | "auto";
46
- /** Badge style variant */
47
62
  style?: BadgeStyle;
48
- /** Badge size */
49
63
  size?: BadgeSize;
50
- /** Show "Powered by Version Pill" branding */
51
64
  showBranding?: boolean;
52
- /** Accent color */
53
65
  accent?: "green" | "blue" | "purple" | "orange" | "neutral";
54
- /** Callback when a new version is detected */
55
66
  onNewVersion?: (version: Version) => void;
56
- /** Callback when badge is clicked */
57
67
  onClick?: () => void;
58
68
  }
59
69
  interface ChangelogProps extends VersionPillConfig {
60
- /** Max height in pixels */
61
70
  maxHeight?: number;
62
- /** Theme */
63
71
  theme?: "light" | "dark" | "auto";
64
- /** Custom class name */
65
72
  className?: string;
66
73
  }
67
74
  interface RoadmapProps extends VersionPillConfig {
68
- /** Max height in pixels */
69
75
  maxHeight?: number;
70
- /** Theme */
71
76
  theme?: "light" | "dark" | "auto";
72
- /** Custom class name */
73
77
  className?: string;
74
78
  }
75
79
  declare function VersionPill({ projectId, baseUrl, position, className, theme, style, size, showBranding, accent, onNewVersion, onClick, }: VersionPillProps): react_jsx_runtime.JSX.Element | null;
76
80
  interface VersionBadgeProps {
77
- /** Your project slug from Version Pill dashboard */
78
81
  projectId: string;
79
- /** Version Pill API base URL (default: https://versionpill.com) */
80
82
  baseUrl?: string;
81
- /** Theme */
82
83
  theme?: "light" | "dark" | "auto";
83
- /** Badge style variant */
84
84
  style?: BadgeStyle;
85
- /** Badge size */
86
85
  size?: BadgeSize;
87
- /** Accent color */
88
86
  accent?: "green" | "blue" | "purple" | "orange" | "neutral";
89
- /** Custom class name */
90
87
  className?: string;
91
- /** Link to changelog (if provided, badge becomes a link) */
92
88
  href?: string;
93
89
  }
94
90
  declare function VersionBadge({ projectId, baseUrl, theme, style, size, accent, className, href, }: VersionBadgeProps): react_jsx_runtime.JSX.Element | null;
95
- declare function Changelog({ projectId, baseUrl, maxHeight, theme, className, }: ChangelogProps): react_jsx_runtime.JSX.Element;
96
- declare function Roadmap({ projectId, baseUrl, maxHeight, theme, className, }: RoadmapProps): react_jsx_runtime.JSX.Element;
97
91
  interface UseVersionOptions {
98
- /** Your project slug from Version Pill dashboard */
99
92
  projectId: string;
100
- /** Version Pill API base URL (default: https://versionpill.com) */
101
93
  baseUrl?: string;
102
- /** Refetch interval in ms (0 = no refetch) */
103
94
  refetchInterval?: number;
104
95
  }
105
96
  interface UseVersionResult {
106
- /** Current version string (e.g., "1.2.3") */
107
97
  version: string | null;
108
- /** Project name */
109
98
  name: string | null;
110
- /** Project slug */
111
99
  slug: string | null;
112
- /** Loading state */
113
100
  loading: boolean;
114
- /** Error message if fetch failed */
115
101
  error: string | null;
116
- /** Manually refetch the version */
117
102
  refetch: () => Promise<void>;
118
103
  }
119
- /**
120
- * Hook to fetch the current version for a project.
121
- * Use this when you need the version data without the UI components.
122
- *
123
- * @example
124
- * ```tsx
125
- * const { version, loading } = useVersion({ projectId: "my-app" });
126
- * if (loading) return <Skeleton />;
127
- * return <span>v{version}</span>;
128
- * ```
129
- */
130
104
  declare function useVersion({ projectId, baseUrl, refetchInterval, }: UseVersionOptions): UseVersionResult;
105
+ declare function Changelog({ projectId, baseUrl, maxHeight, theme, className, }: ChangelogProps): react_jsx_runtime.JSX.Element;
106
+ declare function Roadmap({ projectId, baseUrl, maxHeight, theme, className, }: RoadmapProps): react_jsx_runtime.JSX.Element;
131
107
 
132
- export { type BadgeAPIResponse, type BadgeSize, type BadgeStyle, Changelog, type ChangelogAPIResponse, type ChangelogProps, type ProjectInfo, Roadmap, type RoadmapProps, type UseVersionOptions, type UseVersionResult, type Version, VersionBadge, type VersionBadgeProps, VersionPill, type VersionPillConfig, type VersionPillProps, VersionPill as default, useVersion };
108
+ export { type BadgeAPIResponse, type BadgeSize, type BadgeStyle, Changelog, type ChangelogAPIResponse, type ChangelogProps, type Idea, type ModalTab, type ProjectInfo, Roadmap, type RoadmapAPIResponse, type RoadmapProps, type RoadmapTask, type UseVersionOptions, type UseVersionResult, type Version, VersionBadge, type VersionBadgeProps, VersionPill, type VersionPillConfig, type VersionPillProps, VersionPill as default, useVersion };