@geenius/tools 0.1.0 → 0.3.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.
- package/package.json +62 -3
- package/packages/convex/shared/README.md +1 -1
- package/packages/devtools/dist/index.d.ts +204 -0
- package/packages/devtools/dist/index.js +186 -0
- package/packages/devtools/dist/index.js.map +1 -0
- package/packages/devtools/react/README.md +1 -1
- package/packages/devtools/solidjs/README.md +1 -1
- package/packages/devtools/solidjs/dist/index.js +1830 -0
- package/packages/devtools/solidjs/dist/index.js.map +1 -0
- package/packages/env/dist/index.d.ts +151 -0
- package/packages/env/dist/index.js +93 -0
- package/packages/env/dist/index.js.map +1 -0
- package/packages/errors/dist/index.d.ts +177 -0
- package/packages/errors/dist/index.js +187 -0
- package/packages/errors/dist/index.js.map +1 -0
- package/packages/errors/react/README.md +1 -1
- package/packages/errors/solidjs/README.md +1 -1
- package/packages/logger/dist/index.d.ts +171 -0
- package/packages/logger/dist/index.js +216 -0
- package/packages/logger/dist/index.js.map +1 -0
- package/packages/logger/react/README.md +1 -1
- package/packages/logger/solidjs/README.md +1 -1
- package/packages/perf/dist/index.d.ts +168 -0
- package/packages/perf/dist/index.js +265 -0
- package/packages/perf/dist/index.js.map +1 -0
- package/packages/perf/react/README.md +1 -1
- package/packages/perf/solidjs/README.md +1 -1
- package/packages/shared/dist/index.d.ts +253 -0
- package/packages/shared/dist/index.js +278 -0
- package/packages/shared/dist/index.js.map +1 -0
- package/.changeset/config.json +0 -11
- package/.env.example +0 -2
- package/.github/CODEOWNERS +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -16
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -11
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -10
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -23
- package/.github/workflows/release.yml +0 -29
- package/.node-version +0 -1
- package/.nvmrc +0 -1
- package/.prettierrc +0 -7
- package/.project/ACCOUNT.yaml +0 -4
- package/.project/IDEAS.yaml +0 -7
- package/.project/PROJECT.yaml +0 -11
- package/.project/ROADMAP.yaml +0 -15
- package/CODE_OF_CONDUCT.md +0 -26
- package/CONTRIBUTING.md +0 -69
- package/SECURITY.md +0 -18
- package/SUPPORT.md +0 -14
- package/packages/convex/shared/package.json +0 -42
- package/packages/convex/shared/src/audit/index.ts +0 -5
- package/packages/convex/shared/src/audit/presets.ts +0 -165
- package/packages/convex/shared/src/audit/schema.ts +0 -85
- package/packages/convex/shared/src/audit/write.ts +0 -102
- package/packages/convex/shared/src/extract.ts +0 -75
- package/packages/convex/shared/src/index.ts +0 -41
- package/packages/convex/shared/src/messages.ts +0 -45
- package/packages/convex/shared/src/security.ts +0 -112
- package/packages/convex/shared/src/throw.ts +0 -184
- package/packages/convex/shared/src/types.ts +0 -57
- package/packages/convex/shared/src/utils.ts +0 -58
- package/packages/convex/shared/tsconfig.json +0 -28
- package/packages/convex/shared/tsup.config.ts +0 -12
- package/packages/devtools/package.json +0 -27
- package/packages/devtools/react/package.json +0 -53
- package/packages/devtools/react/src/components/DesignPreview.tsx +0 -59
- package/packages/devtools/react/src/components/DesignSwitcherDropdown.tsx +0 -99
- package/packages/devtools/react/src/components/DevSidebar.tsx +0 -247
- package/packages/devtools/react/src/components/DevToolbar.tsx +0 -242
- package/packages/devtools/react/src/components/GitHubIssueDialog.tsx +0 -402
- package/packages/devtools/react/src/components/InspectorOverlay.tsx +0 -312
- package/packages/devtools/react/src/components/PageLoadWaterfall.tsx +0 -144
- package/packages/devtools/react/src/components/PerformancePanel.tsx +0 -330
- package/packages/devtools/react/src/context/DevModeContext.tsx +0 -226
- package/packages/devtools/react/src/context/PerformanceContext.tsx +0 -143
- package/packages/devtools/react/src/data/designs.ts +0 -13
- package/packages/devtools/react/src/hooks/useGitHubLabels.ts +0 -47
- package/packages/devtools/react/src/hooks/useVirtualList.ts +0 -124
- package/packages/devtools/react/src/index.ts +0 -77
- package/packages/devtools/react/src/panels/ConvexSpy.tsx +0 -130
- package/packages/devtools/react/src/panels/DatabaseSeeder.tsx +0 -116
- package/packages/devtools/react/src/panels/DevModePhase2.tsx +0 -191
- package/packages/devtools/react/src/panels/DevModePhase3.tsx +0 -234
- package/packages/devtools/react/src/panels/FeatureFlagsToggle.tsx +0 -104
- package/packages/devtools/react/src/panels/QuickRouteJump.tsx +0 -152
- package/packages/devtools/react/src/services/github-service.ts +0 -247
- package/packages/devtools/react/tsconfig.json +0 -31
- package/packages/devtools/react/tsup.config.ts +0 -18
- package/packages/devtools/solidjs/package.json +0 -49
- package/packages/devtools/solidjs/src/components/DesignPreview.tsx +0 -51
- package/packages/devtools/solidjs/src/components/DesignSwitcherDropdown.tsx +0 -95
- package/packages/devtools/solidjs/src/components/DevSidebar.tsx +0 -247
- package/packages/devtools/solidjs/src/components/DevToolbar.tsx +0 -242
- package/packages/devtools/solidjs/src/components/GitHubIssueDialog.tsx +0 -400
- package/packages/devtools/solidjs/src/components/InspectorOverlay.tsx +0 -311
- package/packages/devtools/solidjs/src/components/PageLoadWaterfall.tsx +0 -144
- package/packages/devtools/solidjs/src/components/PerformancePanel.tsx +0 -330
- package/packages/devtools/solidjs/src/context/DevModeContext.tsx +0 -216
- package/packages/devtools/solidjs/src/context/PerformanceContext.tsx +0 -135
- package/packages/devtools/solidjs/src/data/designs.ts +0 -13
- package/packages/devtools/solidjs/src/hooks/createGitHubLabels.ts +0 -47
- package/packages/devtools/solidjs/src/index.ts +0 -64
- package/packages/devtools/solidjs/src/services/github-service.ts +0 -247
- package/packages/devtools/solidjs/tsconfig.json +0 -21
- package/packages/devtools/src/index.ts +0 -377
- package/packages/devtools/tsup.config.ts +0 -12
- package/packages/env/package.json +0 -30
- package/packages/env/src/index.ts +0 -264
- package/packages/env/tsup.config.ts +0 -12
- package/packages/errors/package.json +0 -27
- package/packages/errors/react/package.json +0 -72
- package/packages/errors/react/src/analytics.ts +0 -16
- package/packages/errors/react/src/components/ErrorBoundary.tsx +0 -248
- package/packages/errors/react/src/components/ErrorDisplay.tsx +0 -328
- package/packages/errors/react/src/components/ValidationErrors.tsx +0 -102
- package/packages/errors/react/src/config.ts +0 -199
- package/packages/errors/react/src/constants.ts +0 -74
- package/packages/errors/react/src/hooks/useErrorBoundary.ts +0 -92
- package/packages/errors/react/src/hooks/useErrorHandler.ts +0 -87
- package/packages/errors/react/src/index.ts +0 -96
- package/packages/errors/react/src/types.ts +0 -102
- package/packages/errors/react/src/utils/errorMessages.ts +0 -35
- package/packages/errors/react/src/utils/errorPolicy.ts +0 -139
- package/packages/errors/react/src/utils/extractAppError.ts +0 -174
- package/packages/errors/react/src/utils/formatError.ts +0 -112
- package/packages/errors/react/tsconfig.json +0 -25
- package/packages/errors/react/tsup.config.ts +0 -24
- package/packages/errors/solidjs/package.json +0 -46
- package/packages/errors/solidjs/src/components/ErrorDisplay.tsx +0 -179
- package/packages/errors/solidjs/src/config.ts +0 -98
- package/packages/errors/solidjs/src/hooks/createErrorHandler.ts +0 -107
- package/packages/errors/solidjs/src/index.ts +0 -61
- package/packages/errors/solidjs/src/types.ts +0 -34
- package/packages/errors/solidjs/src/utils/errorPolicy.ts +0 -56
- package/packages/errors/solidjs/src/utils/extractAppError.ts +0 -94
- package/packages/errors/solidjs/src/utils/formatError.ts +0 -33
- package/packages/errors/solidjs/tsconfig.json +0 -26
- package/packages/errors/solidjs/tsup.config.ts +0 -21
- package/packages/errors/src/index.ts +0 -320
- package/packages/errors/tsup.config.ts +0 -12
- package/packages/logger/package.json +0 -27
- package/packages/logger/react/package.json +0 -46
- package/packages/logger/react/src/index.ts +0 -4
- package/packages/logger/react/src/useMetrics.ts +0 -42
- package/packages/logger/react/src/usePerformanceLog.ts +0 -61
- package/packages/logger/react/tsconfig.json +0 -31
- package/packages/logger/react/tsup.config.ts +0 -12
- package/packages/logger/solidjs/package.json +0 -45
- package/packages/logger/solidjs/src/createMetrics.ts +0 -37
- package/packages/logger/solidjs/src/createPerformanceLog.ts +0 -58
- package/packages/logger/solidjs/src/index.ts +0 -4
- package/packages/logger/solidjs/tsconfig.json +0 -32
- package/packages/logger/solidjs/tsup.config.ts +0 -12
- package/packages/logger/src/index.ts +0 -363
- package/packages/logger/tsup.config.ts +0 -12
- package/packages/perf/package.json +0 -27
- package/packages/perf/react/package.json +0 -59
- package/packages/perf/react/src/components/PerformanceDashboard.tsx +0 -257
- package/packages/perf/react/src/hooks/useMonitoredQuery.ts +0 -89
- package/packages/perf/react/src/hooks/usePerformanceMetrics.ts +0 -78
- package/packages/perf/react/src/index.ts +0 -33
- package/packages/perf/react/src/services/PerformanceMonitor.ts +0 -313
- package/packages/perf/react/src/types.ts +0 -77
- package/packages/perf/react/tsconfig.json +0 -25
- package/packages/perf/react/tsup.config.ts +0 -19
- package/packages/perf/solidjs/package.json +0 -41
- package/packages/perf/solidjs/src/components/PerformanceDashboard.tsx +0 -207
- package/packages/perf/solidjs/src/hooks/createPerformanceMetrics.ts +0 -73
- package/packages/perf/solidjs/src/index.ts +0 -31
- package/packages/perf/solidjs/src/services/PerformanceMonitor.ts +0 -134
- package/packages/perf/solidjs/src/types.ts +0 -78
- package/packages/perf/solidjs/tsconfig.json +0 -26
- package/packages/perf/solidjs/tsup.config.ts +0 -14
- package/packages/perf/src/index.ts +0 -410
- package/packages/perf/tsup.config.ts +0 -12
- package/pnpm-workspace.yaml +0 -2
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
// @geenius-tools/devtools-solidjs — src/components/GitHubIssueDialog.tsx
|
|
2
|
-
|
|
3
|
-
import { createSignal, createEffect } from 'solid-js'
|
|
4
|
-
import { cn } from '@geenius-ui/solid'
|
|
5
|
-
import {
|
|
6
|
-
Bug,
|
|
7
|
-
Lightbulb,
|
|
8
|
-
ExternalLink,
|
|
9
|
-
AlertCircle,
|
|
10
|
-
CheckCircle2,
|
|
11
|
-
Github,
|
|
12
|
-
Component,
|
|
13
|
-
} from 'lucide-solid'
|
|
14
|
-
import type { ComponentDetails } from '../context/DevModeContext'
|
|
15
|
-
import { createGitHubLabels } from '../hooks/createGitHubLabels'
|
|
16
|
-
import {
|
|
17
|
-
createGitHubIssue,
|
|
18
|
-
isGitHubConfigured,
|
|
19
|
-
type CreateIssueResponse,
|
|
20
|
-
} from '../services/github-service'
|
|
21
|
-
|
|
22
|
-
type IssueType = 'bug' | 'feature'
|
|
23
|
-
|
|
24
|
-
interface FormState {
|
|
25
|
-
type: IssueType
|
|
26
|
-
title: string
|
|
27
|
-
description: string
|
|
28
|
-
selectedLabel: string
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const initialFormState: FormState = {
|
|
32
|
-
type: 'feature',
|
|
33
|
-
title: '',
|
|
34
|
-
description: '',
|
|
35
|
-
selectedLabel: '',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface GitHubIssueDialogProps {
|
|
39
|
-
open: boolean
|
|
40
|
-
onOpenChange: (open: boolean) => void
|
|
41
|
-
initialType?: IssueType
|
|
42
|
-
initialDescription?: string
|
|
43
|
-
componentDetails?: ComponentDetails[]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const GitHubIssueDialog = memo(function GitHubIssueDialog({
|
|
47
|
-
open,
|
|
48
|
-
onOpenChange,
|
|
49
|
-
initialType = 'feature',
|
|
50
|
-
initialDescription = '',
|
|
51
|
-
componentDetails,
|
|
52
|
-
}: GitHubIssueDialogProps) {
|
|
53
|
-
const [form, setForm] = createSignal<FormState>({
|
|
54
|
-
...initialFormState,
|
|
55
|
-
type: initialType,
|
|
56
|
-
description: initialDescription,
|
|
57
|
-
})
|
|
58
|
-
const [loading, setLoading] = createSignal(false)
|
|
59
|
-
const [success, setSuccess] = createSignal<CreateIssueResponse | null>(null)
|
|
60
|
-
const [error, setError] = createSignal<string | null>(null)
|
|
61
|
-
const { data: labels } = createGitHubLabels()
|
|
62
|
-
const configured = isGitHubConfigured()
|
|
63
|
-
let dialogRef: HTMLDivElement | undefined
|
|
64
|
-
|
|
65
|
-
createEffect(() => {
|
|
66
|
-
if (open) {
|
|
67
|
-
setForm({
|
|
68
|
-
...initialFormState,
|
|
69
|
-
type: initialType,
|
|
70
|
-
description: initialDescription,
|
|
71
|
-
})
|
|
72
|
-
setError(null)
|
|
73
|
-
setSuccess(null)
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
// Close on Escape
|
|
78
|
-
createEffect(() => {
|
|
79
|
-
if (!open) return
|
|
80
|
-
const handleKeyDown = (e: KeyboardEvent) => {
|
|
81
|
-
if (e.key === 'Escape') onOpenChange(false)
|
|
82
|
-
}
|
|
83
|
-
window.addEventListener('keydown', handleKeyDown)
|
|
84
|
-
return () => window.removeEventListener('keydown', handleKeyDown)
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
const handleSubmit = async () => {
|
|
88
|
-
if (!form.title.trim()) {
|
|
89
|
-
setError('Please provide a title for the issue.')
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
setLoading(true)
|
|
94
|
-
setError(null)
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
const typePrefix =
|
|
98
|
-
form.type === 'bug' ? '🐛 Bug Report' : '✨ Feature Request'
|
|
99
|
-
|
|
100
|
-
let componentSection = ''
|
|
101
|
-
if (componentDetails && componentDetails.length > 0) {
|
|
102
|
-
componentSection = `\n### Components\n${componentDetails
|
|
103
|
-
.map((detail, index) => {
|
|
104
|
-
let propsBlock = ''
|
|
105
|
-
if (detail.props) {
|
|
106
|
-
try {
|
|
107
|
-
propsBlock = `\n- **Props:**\n\`\`\`json\n${JSON.stringify(detail.props, null, 2)}\n\`\`\``
|
|
108
|
-
} catch {
|
|
109
|
-
propsBlock = '\n- **Props:** (Complex Object)'
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return `
|
|
113
|
-
**Component ${index + 1}**
|
|
114
|
-
- **Name:** \`${detail.name}\`
|
|
115
|
-
${detail.key ? `- **Key:** \`${detail.key}\`` : ''}
|
|
116
|
-
${detail.file ? `- **File:** \`${detail.file}\`` : ''}
|
|
117
|
-
- **Selector:** \`${detail.selector}\`${propsBlock}
|
|
118
|
-
`
|
|
119
|
-
})
|
|
120
|
-
.join('\n')}`
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const descriptionSection = form.description
|
|
124
|
-
? `## Description\n${form.description}`
|
|
125
|
-
: ''
|
|
126
|
-
|
|
127
|
-
const timestamp = new Date().toISOString()
|
|
128
|
-
const theme =
|
|
129
|
-
typeof document !== 'undefined' &&
|
|
130
|
-
document.documentElement.classList.contains('dark')
|
|
131
|
-
? 'dark'
|
|
132
|
-
: 'light'
|
|
133
|
-
const viewport =
|
|
134
|
-
typeof window !== 'undefined'
|
|
135
|
-
? `${window.innerWidth}x${window.innerHeight}`
|
|
136
|
-
: 'unknown'
|
|
137
|
-
const userAgent =
|
|
138
|
-
typeof navigator !== 'undefined' ? navigator.userAgent : 'unknown'
|
|
139
|
-
const url =
|
|
140
|
-
typeof window !== 'undefined' ? window.location.href : 'unknown'
|
|
141
|
-
|
|
142
|
-
const contextSection = `
|
|
143
|
-
-----
|
|
144
|
-
**Context Information**
|
|
145
|
-
- **URL:** ${url}
|
|
146
|
-
- **Time:** ${timestamp}
|
|
147
|
-
- **Theme:** ${theme}
|
|
148
|
-
- **Viewport:** ${viewport}
|
|
149
|
-
- **User Agent:** ${userAgent}
|
|
150
|
-
`.trim()
|
|
151
|
-
|
|
152
|
-
const body = [
|
|
153
|
-
`# ${typePrefix}`,
|
|
154
|
-
'',
|
|
155
|
-
descriptionSection,
|
|
156
|
-
componentSection,
|
|
157
|
-
'',
|
|
158
|
-
contextSection,
|
|
159
|
-
]
|
|
160
|
-
.filter(Boolean)
|
|
161
|
-
.join('\n')
|
|
162
|
-
|
|
163
|
-
const issueLabels: string[] = []
|
|
164
|
-
if (form.type === 'bug') issueLabels.push('bug')
|
|
165
|
-
if (form.type === 'feature') issueLabels.push('enhancement')
|
|
166
|
-
if (form.selectedLabel) issueLabels.push(form.selectedLabel)
|
|
167
|
-
|
|
168
|
-
const result = await createGitHubIssue({
|
|
169
|
-
title: `[${form.type === 'bug' ? 'Bug' : 'Feature'}] ${form.title}`,
|
|
170
|
-
body,
|
|
171
|
-
labels: issueLabels,
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
setSuccess(result)
|
|
175
|
-
} catch (err) {
|
|
176
|
-
setError(err instanceof Error ? err.message : 'An error occurred')
|
|
177
|
-
} finally {
|
|
178
|
-
setLoading(false)
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const handleFieldChange = <K extends keyof FormState>(field: K, value: FormState[K]) => {
|
|
183
|
-
setForm((prev) => ({ ...prev, [field]: value }))
|
|
184
|
-
setError(null)
|
|
185
|
-
},
|
|
186
|
-
[]
|
|
187
|
-
|
|
188
|
-
if (!open) return null
|
|
189
|
-
|
|
190
|
-
return (
|
|
191
|
-
<div class="fixed inset-0 z-[10000] flex items-center justify-center" data-dev-tool="true">
|
|
192
|
-
{/* Backdrop */}
|
|
193
|
-
<div
|
|
194
|
-
class="absolute inset-0 bg-black/60 backdrop-blur-sm"
|
|
195
|
-
onClick={() => onOpenChange(false)}
|
|
196
|
-
/>
|
|
197
|
-
|
|
198
|
-
{/* Dialog */}
|
|
199
|
-
<div
|
|
200
|
-
ref={dialogRef}
|
|
201
|
-
class={cn(
|
|
202
|
-
'relative z-10 w-full max-w-[500px] mx-4',
|
|
203
|
-
'bg-gradient-to-br from-slate-900 to-slate-800',
|
|
204
|
-
'border border-white/10 rounded-2xl shadow-2xl',
|
|
205
|
-
'max-h-[90vh] overflow-y-auto',
|
|
206
|
-
'animate-in fade-in zoom-in-95 duration-200',
|
|
207
|
-
)}
|
|
208
|
-
>
|
|
209
|
-
{/* Header */}
|
|
210
|
-
<div class="flex items-center gap-2 px-6 py-4 border-b border-white/10">
|
|
211
|
-
<Github class="h-5 w-5 text-primary" />
|
|
212
|
-
<h2 class="text-lg font-bold text-white">Create GitHub Issue</h2>
|
|
213
|
-
</div>
|
|
214
|
-
|
|
215
|
-
<div class="px-6 py-4">
|
|
216
|
-
{!configured ? (
|
|
217
|
-
<div class="py-6">
|
|
218
|
-
<div class="text-center space-y-3">
|
|
219
|
-
<div class="mx-auto w-12 h-12 rounded-full bg-yellow-500/10 flex items-center justify-center">
|
|
220
|
-
<AlertCircle class="h-6 w-6 text-yellow-500" />
|
|
221
|
-
</div>
|
|
222
|
-
<p class="text-sm text-white/60">
|
|
223
|
-
GitHub integration is not configured. Call{' '}
|
|
224
|
-
<code class="text-xs bg-white/10 px-1.5 py-0.5 rounded">
|
|
225
|
-
configureGitHub()
|
|
226
|
-
</code>{' '}
|
|
227
|
-
or set VITE_GITHUB_TOKEN to enable issue creation.
|
|
228
|
-
</p>
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
) : success ? (
|
|
232
|
-
<div class="py-6">
|
|
233
|
-
<div class="text-center space-y-4">
|
|
234
|
-
<CheckCircle2 class="mx-auto h-12 w-12 text-green-500" />
|
|
235
|
-
<div>
|
|
236
|
-
<p class="font-medium text-white">Issue Created!</p>
|
|
237
|
-
<p class="text-sm text-white/60 mt-1">{success.title}</p>
|
|
238
|
-
</div>
|
|
239
|
-
<a
|
|
240
|
-
href={success.html_url}
|
|
241
|
-
target="_blank"
|
|
242
|
-
rel="noopener noreferrer"
|
|
243
|
-
class="inline-flex items-center gap-2 px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/80 transition-colors"
|
|
244
|
-
>
|
|
245
|
-
<ExternalLink class="h-4 w-4" />
|
|
246
|
-
View on GitHub
|
|
247
|
-
</a>
|
|
248
|
-
</div>
|
|
249
|
-
</div>
|
|
250
|
-
) : (
|
|
251
|
-
<div class="space-y-4 py-2">
|
|
252
|
-
{/* Issue Type Selector */}
|
|
253
|
-
<div class="grid grid-cols-2 gap-2">
|
|
254
|
-
<button
|
|
255
|
-
type="button"
|
|
256
|
-
onClick={() => handleFieldChange('type', 'feature')}
|
|
257
|
-
class={cn(
|
|
258
|
-
'flex items-center gap-2 p-3 rounded-lg border-2 transition-all',
|
|
259
|
-
form.type === 'feature'
|
|
260
|
-
? 'border-emerald-500 bg-emerald-500/10 text-emerald-400'
|
|
261
|
-
: 'border-white/10 text-white/60 hover:border-white/20',
|
|
262
|
-
)}
|
|
263
|
-
>
|
|
264
|
-
<Lightbulb class="h-4 w-4" />
|
|
265
|
-
<span class="font-medium text-sm">Feature</span>
|
|
266
|
-
</button>
|
|
267
|
-
<button
|
|
268
|
-
type="button"
|
|
269
|
-
onClick={() => handleFieldChange('type', 'bug')}
|
|
270
|
-
class={cn(
|
|
271
|
-
'flex items-center gap-2 p-3 rounded-lg border-2 transition-all',
|
|
272
|
-
form.type === 'bug'
|
|
273
|
-
? 'border-red-500 bg-red-500/10 text-red-400'
|
|
274
|
-
: 'border-white/10 text-white/60 hover:border-white/20',
|
|
275
|
-
)}
|
|
276
|
-
>
|
|
277
|
-
<Bug class="h-4 w-4" />
|
|
278
|
-
<span class="font-medium text-sm">Bug Report</span>
|
|
279
|
-
</button>
|
|
280
|
-
</div>
|
|
281
|
-
|
|
282
|
-
{/* Component Details */}
|
|
283
|
-
{componentDetails && componentDetails.length > 0 && (
|
|
284
|
-
<div class="p-3 rounded-lg bg-white/5 border border-white/10">
|
|
285
|
-
<div class="flex items-center gap-1.5 text-xs text-white/50 mb-2">
|
|
286
|
-
<Component class="h-3 w-3" />
|
|
287
|
-
<span>
|
|
288
|
-
{componentDetails.length} component
|
|
289
|
-
{componentDetails.length > 1 ? 's' : ''} attached
|
|
290
|
-
</span>
|
|
291
|
-
</div>
|
|
292
|
-
<div class="space-y-1">
|
|
293
|
-
{componentDetails.map((c, i) => (
|
|
294
|
-
<div key={i} class="text-xs font-mono text-white/80">
|
|
295
|
-
{c.name}
|
|
296
|
-
{c.key && (
|
|
297
|
-
<span class="text-white/40 ml-1">
|
|
298
|
-
key={c.key}
|
|
299
|
-
</span>
|
|
300
|
-
)}
|
|
301
|
-
</div>
|
|
302
|
-
))}
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
305
|
-
)}
|
|
306
|
-
|
|
307
|
-
{/* Title */}
|
|
308
|
-
<div>
|
|
309
|
-
<label class="block text-xs font-medium text-white/60 mb-1">
|
|
310
|
-
Title
|
|
311
|
-
</label>
|
|
312
|
-
<input
|
|
313
|
-
type="text"
|
|
314
|
-
value={form.title}
|
|
315
|
-
onChange={(e) => handleFieldChange('title', e.target.value)}
|
|
316
|
-
placeholder={
|
|
317
|
-
form.type === 'bug'
|
|
318
|
-
? 'Describe the bug...'
|
|
319
|
-
: 'Feature idea...'
|
|
320
|
-
}
|
|
321
|
-
class="w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm text-white placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
322
|
-
autoFocus
|
|
323
|
-
/>
|
|
324
|
-
</div>
|
|
325
|
-
|
|
326
|
-
{/* Description */}
|
|
327
|
-
<div>
|
|
328
|
-
<label class="block text-xs font-medium text-white/60 mb-1">
|
|
329
|
-
Description
|
|
330
|
-
</label>
|
|
331
|
-
<textarea
|
|
332
|
-
value={form.description}
|
|
333
|
-
onChange={(e) =>
|
|
334
|
-
handleFieldChange('description', e.target.value)
|
|
335
|
-
}
|
|
336
|
-
placeholder="Provide more details..."
|
|
337
|
-
rows={4}
|
|
338
|
-
class="w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm text-white placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-primary/50 resize-none"
|
|
339
|
-
/>
|
|
340
|
-
</div>
|
|
341
|
-
|
|
342
|
-
{/* Label Selector */}
|
|
343
|
-
{labels && labels.length > 0 && (
|
|
344
|
-
<div>
|
|
345
|
-
<label class="block text-xs font-medium text-white/60 mb-1">
|
|
346
|
-
Label
|
|
347
|
-
</label>
|
|
348
|
-
<select
|
|
349
|
-
value={form.selectedLabel}
|
|
350
|
-
onChange={(e) =>
|
|
351
|
-
handleFieldChange('selectedLabel', e.target.value)
|
|
352
|
-
}
|
|
353
|
-
class="w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-sm text-white focus:outline-none focus:ring-2 focus:ring-primary/50"
|
|
354
|
-
>
|
|
355
|
-
<option value="">No label</option>
|
|
356
|
-
{labels.map((label) => (
|
|
357
|
-
<option key={label.id} value={label.name}>
|
|
358
|
-
{label.name}
|
|
359
|
-
</option>
|
|
360
|
-
))}
|
|
361
|
-
</select>
|
|
362
|
-
</div>
|
|
363
|
-
)}
|
|
364
|
-
|
|
365
|
-
{/* Error */}
|
|
366
|
-
{error && (
|
|
367
|
-
<div class="flex items-center gap-2 p-3 bg-red-500/10 border border-red-500/20 rounded-lg">
|
|
368
|
-
<AlertCircle class="h-4 w-4 text-red-400 flex-shrink-0" />
|
|
369
|
-
<p class="text-xs text-red-300">{error}</p>
|
|
370
|
-
</div>
|
|
371
|
-
)}
|
|
372
|
-
|
|
373
|
-
{/* Actions */}
|
|
374
|
-
<div class="flex justify-end gap-2 pt-2">
|
|
375
|
-
<button
|
|
376
|
-
onClick={() => onOpenChange(false)}
|
|
377
|
-
class="px-4 py-2 text-sm text-white/60 hover:text-white transition-colors"
|
|
378
|
-
>
|
|
379
|
-
Cancel
|
|
380
|
-
</button>
|
|
381
|
-
<button
|
|
382
|
-
onClick={handleSubmit}
|
|
383
|
-
disabled={loading || !form.title.trim()}
|
|
384
|
-
class={cn(
|
|
385
|
-
'px-4 py-2 text-sm font-medium rounded-lg transition-all',
|
|
386
|
-
loading || !form.title.trim()
|
|
387
|
-
? 'bg-white/10 text-white/30 cursor-not-allowed'
|
|
388
|
-
: 'bg-primary text-white hover:bg-primary/80',
|
|
389
|
-
)}
|
|
390
|
-
>
|
|
391
|
-
{loading ? 'Creating...' : 'Create Issue'}
|
|
392
|
-
</button>
|
|
393
|
-
</div>
|
|
394
|
-
</div>
|
|
395
|
-
)}
|
|
396
|
-
</div>
|
|
397
|
-
</div>
|
|
398
|
-
</div>
|
|
399
|
-
)
|
|
400
|
-
})
|