@githat/nextjs 0.2.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.
@@ -0,0 +1,334 @@
1
+ /* GitHat SDK Styles — self-contained, no external dependencies */
2
+
3
+ /* Form Container */
4
+ .githat-form-container {
5
+ max-width: 400px;
6
+ margin: 0 auto;
7
+ padding: 2rem;
8
+ background: #0f0f14;
9
+ border: 1px solid #1e1e2e;
10
+ border-radius: 12px;
11
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
12
+ color: #e4e4e7;
13
+ }
14
+
15
+ .githat-form-header {
16
+ text-align: center;
17
+ margin-bottom: 1.5rem;
18
+ }
19
+
20
+ .githat-form-title {
21
+ font-size: 1.5rem;
22
+ font-weight: 600;
23
+ margin: 0 0 0.5rem;
24
+ color: #fafafa;
25
+ }
26
+
27
+ .githat-form-subtitle {
28
+ font-size: 0.875rem;
29
+ color: #a1a1aa;
30
+ margin: 0;
31
+ }
32
+
33
+ /* Form */
34
+ .githat-form {
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 1rem;
38
+ }
39
+
40
+ .githat-field {
41
+ display: flex;
42
+ flex-direction: column;
43
+ gap: 0.375rem;
44
+ }
45
+
46
+ .githat-label {
47
+ font-size: 0.875rem;
48
+ font-weight: 500;
49
+ color: #d4d4d8;
50
+ }
51
+
52
+ .githat-input {
53
+ padding: 0.625rem 0.75rem;
54
+ background: #18181b;
55
+ border: 1px solid #27272a;
56
+ border-radius: 8px;
57
+ color: #fafafa;
58
+ font-size: 0.875rem;
59
+ outline: none;
60
+ transition: border-color 0.15s;
61
+ }
62
+
63
+ .githat-input:focus {
64
+ border-color: #6366f1;
65
+ box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
66
+ }
67
+
68
+ .githat-input::placeholder {
69
+ color: #52525b;
70
+ }
71
+
72
+ .githat-field-error {
73
+ font-size: 0.75rem;
74
+ color: #ef4444;
75
+ margin: 0;
76
+ }
77
+
78
+ /* Alerts */
79
+ .githat-alert {
80
+ padding: 0.75rem 1rem;
81
+ border-radius: 8px;
82
+ font-size: 0.875rem;
83
+ margin-bottom: 1rem;
84
+ }
85
+
86
+ .githat-alert-error {
87
+ background: rgba(239, 68, 68, 0.1);
88
+ border: 1px solid rgba(239, 68, 68, 0.3);
89
+ color: #fca5a5;
90
+ }
91
+
92
+ /* Buttons */
93
+ .githat-button {
94
+ display: inline-flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ padding: 0.625rem 1.25rem;
98
+ border-radius: 8px;
99
+ font-size: 0.875rem;
100
+ font-weight: 500;
101
+ cursor: pointer;
102
+ transition: all 0.15s;
103
+ border: none;
104
+ text-decoration: none;
105
+ text-align: center;
106
+ }
107
+
108
+ .githat-button-primary {
109
+ background: #6366f1;
110
+ color: #fff;
111
+ }
112
+
113
+ .githat-button-primary:hover:not(:disabled) {
114
+ background: #4f46e5;
115
+ }
116
+
117
+ .githat-button-primary:disabled {
118
+ opacity: 0.5;
119
+ cursor: not-allowed;
120
+ }
121
+
122
+ .githat-button-outline {
123
+ background: transparent;
124
+ color: #e4e4e7;
125
+ border: 1px solid #27272a;
126
+ }
127
+
128
+ .githat-button-outline:hover {
129
+ background: #18181b;
130
+ border-color: #3f3f46;
131
+ }
132
+
133
+ /* Links */
134
+ .githat-link {
135
+ color: #6366f1;
136
+ text-decoration: none;
137
+ font-size: 0.875rem;
138
+ }
139
+
140
+ .githat-link:hover {
141
+ text-decoration: underline;
142
+ }
143
+
144
+ .githat-forgot-link {
145
+ text-align: right;
146
+ margin-top: -0.25rem;
147
+ }
148
+
149
+ .githat-form-footer {
150
+ text-align: center;
151
+ font-size: 0.875rem;
152
+ color: #a1a1aa;
153
+ margin: 1rem 0 0;
154
+ }
155
+
156
+ .githat-powered-by {
157
+ text-align: center;
158
+ font-size: 0.75rem;
159
+ color: #52525b;
160
+ margin: 1.5rem 0 0;
161
+ }
162
+
163
+ /* User Button */
164
+ .githat-user-button {
165
+ position: relative;
166
+ display: inline-block;
167
+ }
168
+
169
+ .githat-avatar-trigger {
170
+ width: 36px;
171
+ height: 36px;
172
+ border-radius: 50%;
173
+ border: 2px solid #27272a;
174
+ cursor: pointer;
175
+ overflow: hidden;
176
+ padding: 0;
177
+ background: #6366f1;
178
+ display: flex;
179
+ align-items: center;
180
+ justify-content: center;
181
+ transition: border-color 0.15s;
182
+ }
183
+
184
+ .githat-avatar-trigger:hover {
185
+ border-color: #6366f1;
186
+ }
187
+
188
+ .githat-avatar-img {
189
+ width: 100%;
190
+ height: 100%;
191
+ object-fit: cover;
192
+ }
193
+
194
+ .githat-avatar-initials {
195
+ font-size: 0.75rem;
196
+ font-weight: 600;
197
+ color: #fff;
198
+ }
199
+
200
+ /* Dropdown */
201
+ .githat-dropdown {
202
+ position: absolute;
203
+ top: calc(100% + 8px);
204
+ right: 0;
205
+ min-width: 200px;
206
+ background: #18181b;
207
+ border: 1px solid #27272a;
208
+ border-radius: 8px;
209
+ padding: 0.25rem 0;
210
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
211
+ z-index: 50;
212
+ }
213
+
214
+ .githat-dropdown-header {
215
+ padding: 0.75rem 1rem;
216
+ }
217
+
218
+ .githat-dropdown-name {
219
+ font-size: 0.875rem;
220
+ font-weight: 500;
221
+ color: #fafafa;
222
+ margin: 0;
223
+ }
224
+
225
+ .githat-dropdown-email {
226
+ font-size: 0.75rem;
227
+ color: #a1a1aa;
228
+ margin: 0.125rem 0 0;
229
+ }
230
+
231
+ .githat-dropdown-org {
232
+ font-size: 0.75rem;
233
+ color: #6366f1;
234
+ margin: 0.25rem 0 0;
235
+ }
236
+
237
+ .githat-dropdown-divider {
238
+ height: 1px;
239
+ background: #27272a;
240
+ margin: 0.25rem 0;
241
+ }
242
+
243
+ .githat-dropdown-item {
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: space-between;
247
+ width: 100%;
248
+ padding: 0.5rem 1rem;
249
+ background: none;
250
+ border: none;
251
+ color: #d4d4d8;
252
+ font-size: 0.875rem;
253
+ cursor: pointer;
254
+ text-align: left;
255
+ transition: background 0.1s;
256
+ }
257
+
258
+ .githat-dropdown-item:hover {
259
+ background: #27272a;
260
+ }
261
+
262
+ .githat-dropdown-item-active {
263
+ color: #6366f1;
264
+ }
265
+
266
+ .githat-check {
267
+ color: #6366f1;
268
+ }
269
+
270
+ /* Org Switcher */
271
+ .githat-org-switcher {
272
+ position: relative;
273
+ display: inline-block;
274
+ }
275
+
276
+ .githat-org-trigger {
277
+ display: flex;
278
+ align-items: center;
279
+ gap: 0.5rem;
280
+ padding: 0.5rem 0.75rem;
281
+ background: #18181b;
282
+ border: 1px solid #27272a;
283
+ border-radius: 8px;
284
+ color: #e4e4e7;
285
+ cursor: pointer;
286
+ font-size: 0.875rem;
287
+ transition: border-color 0.15s;
288
+ }
289
+
290
+ .githat-org-trigger:hover {
291
+ border-color: #3f3f46;
292
+ }
293
+
294
+ .githat-org-name {
295
+ font-weight: 500;
296
+ }
297
+
298
+ .githat-chevron {
299
+ font-size: 0.625rem;
300
+ color: #71717a;
301
+ }
302
+
303
+ /* Badge */
304
+ .githat-badge {
305
+ display: inline-flex;
306
+ align-items: center;
307
+ gap: 0.25rem;
308
+ padding: 0.25rem 0.625rem;
309
+ border-radius: 999px;
310
+ font-size: 0.75rem;
311
+ font-weight: 500;
312
+ }
313
+
314
+ .githat-badge-verified {
315
+ background: rgba(16, 185, 129, 0.1);
316
+ color: #34d399;
317
+ border: 1px solid rgba(16, 185, 129, 0.3);
318
+ }
319
+
320
+ .githat-badge-unverified {
321
+ background: rgba(239, 68, 68, 0.1);
322
+ color: #fca5a5;
323
+ border: 1px solid rgba(239, 68, 68, 0.3);
324
+ }
325
+
326
+ /* Loading */
327
+ .githat-loading {
328
+ display: flex;
329
+ align-items: center;
330
+ justify-content: center;
331
+ padding: 2rem;
332
+ color: #a1a1aa;
333
+ font-size: 0.875rem;
334
+ }
@@ -0,0 +1,120 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+
4
+ interface GitHatUser {
5
+ id: string;
6
+ email: string;
7
+ name: string;
8
+ avatarUrl: string | null;
9
+ emailVerified: boolean;
10
+ }
11
+ interface GitHatOrg {
12
+ id: string;
13
+ name: string;
14
+ slug: string;
15
+ role: string;
16
+ tier: string;
17
+ }
18
+ interface GitHatConfig {
19
+ publishableKey: string;
20
+ apiUrl?: string;
21
+ signInUrl?: string;
22
+ signUpUrl?: string;
23
+ afterSignInUrl?: string;
24
+ afterSignOutUrl?: string;
25
+ }
26
+ interface AuthState {
27
+ user: GitHatUser | null;
28
+ org: GitHatOrg | null;
29
+ isSignedIn: boolean;
30
+ isLoading: boolean;
31
+ authError: string | null;
32
+ }
33
+ interface AuthActions {
34
+ signIn: (email: string, password: string) => Promise<void>;
35
+ signUp: (data: SignUpData) => Promise<SignUpResult>;
36
+ signOut: () => Promise<void>;
37
+ switchOrg: (orgId: string) => Promise<void>;
38
+ }
39
+ interface SignUpData {
40
+ email: string;
41
+ password: string;
42
+ name: string;
43
+ acceptMarketing?: boolean;
44
+ }
45
+ interface SignUpResult {
46
+ requiresVerification: boolean;
47
+ email: string;
48
+ }
49
+ interface GitHatContextValue extends AuthState, AuthActions {
50
+ config: GitHatConfig;
51
+ }
52
+
53
+ interface GitHatProviderProps {
54
+ config: GitHatConfig;
55
+ children: React.ReactNode;
56
+ }
57
+ declare function GitHatProvider({ config: rawConfig, children }: GitHatProviderProps): react_jsx_runtime.JSX.Element;
58
+
59
+ declare function useAuth(): GitHatContextValue;
60
+ declare function useGitHat(): {
61
+ fetch: <T = any>(endpoint: string, options?: RequestInit) => Promise<T>;
62
+ getUserOrgs: () => Promise<{
63
+ orgs: GitHatOrg[];
64
+ }>;
65
+ verifyMCP: (domain: string) => Promise<{
66
+ verified: boolean;
67
+ }>;
68
+ verifyAgent: (wallet: string) => Promise<{
69
+ verified: boolean;
70
+ }>;
71
+ };
72
+
73
+ interface SignInFormProps {
74
+ onSuccess?: () => void;
75
+ signUpUrl?: string;
76
+ forgotPasswordUrl?: string;
77
+ }
78
+ declare function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }: SignInFormProps): react_jsx_runtime.JSX.Element;
79
+
80
+ interface SignUpFormProps {
81
+ onSuccess?: (result: {
82
+ requiresVerification: boolean;
83
+ email: string;
84
+ }) => void;
85
+ signInUrl?: string;
86
+ }
87
+ declare function SignUpForm({ onSuccess, signInUrl }: SignUpFormProps): react_jsx_runtime.JSX.Element;
88
+
89
+ interface SignInButtonProps {
90
+ className?: string;
91
+ children?: React.ReactNode;
92
+ href?: string;
93
+ }
94
+ declare function SignInButton({ className, children, href }: SignInButtonProps): react_jsx_runtime.JSX.Element;
95
+
96
+ interface SignUpButtonProps {
97
+ className?: string;
98
+ children?: React.ReactNode;
99
+ href?: string;
100
+ }
101
+ declare function SignUpButton({ className, children, href }: SignUpButtonProps): react_jsx_runtime.JSX.Element;
102
+
103
+ declare function UserButton(): react_jsx_runtime.JSX.Element | null;
104
+
105
+ declare function OrgSwitcher(): react_jsx_runtime.JSX.Element | null;
106
+
107
+ interface VerifiedBadgeProps {
108
+ type: 'mcp' | 'agent';
109
+ identifier: string;
110
+ label?: string;
111
+ }
112
+ declare function VerifiedBadge({ type, identifier, label }: VerifiedBadgeProps): react_jsx_runtime.JSX.Element | null;
113
+
114
+ interface ProtectedRouteProps {
115
+ children: React.ReactNode;
116
+ fallback?: React.ReactNode;
117
+ }
118
+ declare function ProtectedRoute({ children, fallback }: ProtectedRouteProps): react_jsx_runtime.JSX.Element | null;
119
+
120
+ export { type AuthActions, type AuthState, type GitHatConfig, type GitHatContextValue, type GitHatOrg, GitHatProvider, type GitHatUser, OrgSwitcher, ProtectedRoute, SignInButton, SignInForm, SignUpButton, type SignUpData, SignUpForm, type SignUpResult, UserButton, VerifiedBadge, useAuth, useGitHat };
@@ -0,0 +1,120 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+
4
+ interface GitHatUser {
5
+ id: string;
6
+ email: string;
7
+ name: string;
8
+ avatarUrl: string | null;
9
+ emailVerified: boolean;
10
+ }
11
+ interface GitHatOrg {
12
+ id: string;
13
+ name: string;
14
+ slug: string;
15
+ role: string;
16
+ tier: string;
17
+ }
18
+ interface GitHatConfig {
19
+ publishableKey: string;
20
+ apiUrl?: string;
21
+ signInUrl?: string;
22
+ signUpUrl?: string;
23
+ afterSignInUrl?: string;
24
+ afterSignOutUrl?: string;
25
+ }
26
+ interface AuthState {
27
+ user: GitHatUser | null;
28
+ org: GitHatOrg | null;
29
+ isSignedIn: boolean;
30
+ isLoading: boolean;
31
+ authError: string | null;
32
+ }
33
+ interface AuthActions {
34
+ signIn: (email: string, password: string) => Promise<void>;
35
+ signUp: (data: SignUpData) => Promise<SignUpResult>;
36
+ signOut: () => Promise<void>;
37
+ switchOrg: (orgId: string) => Promise<void>;
38
+ }
39
+ interface SignUpData {
40
+ email: string;
41
+ password: string;
42
+ name: string;
43
+ acceptMarketing?: boolean;
44
+ }
45
+ interface SignUpResult {
46
+ requiresVerification: boolean;
47
+ email: string;
48
+ }
49
+ interface GitHatContextValue extends AuthState, AuthActions {
50
+ config: GitHatConfig;
51
+ }
52
+
53
+ interface GitHatProviderProps {
54
+ config: GitHatConfig;
55
+ children: React.ReactNode;
56
+ }
57
+ declare function GitHatProvider({ config: rawConfig, children }: GitHatProviderProps): react_jsx_runtime.JSX.Element;
58
+
59
+ declare function useAuth(): GitHatContextValue;
60
+ declare function useGitHat(): {
61
+ fetch: <T = any>(endpoint: string, options?: RequestInit) => Promise<T>;
62
+ getUserOrgs: () => Promise<{
63
+ orgs: GitHatOrg[];
64
+ }>;
65
+ verifyMCP: (domain: string) => Promise<{
66
+ verified: boolean;
67
+ }>;
68
+ verifyAgent: (wallet: string) => Promise<{
69
+ verified: boolean;
70
+ }>;
71
+ };
72
+
73
+ interface SignInFormProps {
74
+ onSuccess?: () => void;
75
+ signUpUrl?: string;
76
+ forgotPasswordUrl?: string;
77
+ }
78
+ declare function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }: SignInFormProps): react_jsx_runtime.JSX.Element;
79
+
80
+ interface SignUpFormProps {
81
+ onSuccess?: (result: {
82
+ requiresVerification: boolean;
83
+ email: string;
84
+ }) => void;
85
+ signInUrl?: string;
86
+ }
87
+ declare function SignUpForm({ onSuccess, signInUrl }: SignUpFormProps): react_jsx_runtime.JSX.Element;
88
+
89
+ interface SignInButtonProps {
90
+ className?: string;
91
+ children?: React.ReactNode;
92
+ href?: string;
93
+ }
94
+ declare function SignInButton({ className, children, href }: SignInButtonProps): react_jsx_runtime.JSX.Element;
95
+
96
+ interface SignUpButtonProps {
97
+ className?: string;
98
+ children?: React.ReactNode;
99
+ href?: string;
100
+ }
101
+ declare function SignUpButton({ className, children, href }: SignUpButtonProps): react_jsx_runtime.JSX.Element;
102
+
103
+ declare function UserButton(): react_jsx_runtime.JSX.Element | null;
104
+
105
+ declare function OrgSwitcher(): react_jsx_runtime.JSX.Element | null;
106
+
107
+ interface VerifiedBadgeProps {
108
+ type: 'mcp' | 'agent';
109
+ identifier: string;
110
+ label?: string;
111
+ }
112
+ declare function VerifiedBadge({ type, identifier, label }: VerifiedBadgeProps): react_jsx_runtime.JSX.Element | null;
113
+
114
+ interface ProtectedRouteProps {
115
+ children: React.ReactNode;
116
+ fallback?: React.ReactNode;
117
+ }
118
+ declare function ProtectedRoute({ children, fallback }: ProtectedRouteProps): react_jsx_runtime.JSX.Element | null;
119
+
120
+ export { type AuthActions, type AuthState, type GitHatConfig, type GitHatContextValue, type GitHatOrg, GitHatProvider, type GitHatUser, OrgSwitcher, ProtectedRoute, SignInButton, SignInForm, SignUpButton, type SignUpData, SignUpForm, type SignUpResult, UserButton, VerifiedBadge, useAuth, useGitHat };