@industry-theme/github-panels 0.1.49 → 0.1.50

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.
@@ -130,7 +130,7 @@ const createLucideIcon = (iconName, iconNode) => {
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
132
  */
133
- const __iconNode$D = [
133
+ const __iconNode$E = [
134
134
  ["path", { d: "M12 7v14", key: "1akyts" }],
135
135
  [
136
136
  "path",
@@ -140,14 +140,14 @@ const __iconNode$D = [
140
140
  }
141
141
  ]
142
142
  ];
143
- const BookOpen = createLucideIcon("book-open", __iconNode$D);
143
+ const BookOpen = createLucideIcon("book-open", __iconNode$E);
144
144
  /**
145
145
  * @license lucide-react v0.552.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
149
  */
150
- const __iconNode$C = [
150
+ const __iconNode$D = [
151
151
  ["path", { d: "M10 12h4", key: "a56b0p" }],
152
152
  ["path", { d: "M10 8h4", key: "1sr2af" }],
153
153
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -160,97 +160,97 @@ const __iconNode$C = [
160
160
  ],
161
161
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
162
162
  ];
163
- const Building2 = createLucideIcon("building-2", __iconNode$C);
163
+ const Building2 = createLucideIcon("building-2", __iconNode$D);
164
164
  /**
165
165
  * @license lucide-react v0.552.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
169
  */
170
- const __iconNode$B = [
170
+ const __iconNode$C = [
171
171
  ["path", { d: "M8 2v4", key: "1cmpym" }],
172
172
  ["path", { d: "M16 2v4", key: "4m81vk" }],
173
173
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
174
174
  ["path", { d: "M3 10h18", key: "8toen8" }]
175
175
  ];
176
- const Calendar = createLucideIcon("calendar", __iconNode$B);
176
+ const Calendar = createLucideIcon("calendar", __iconNode$C);
177
177
  /**
178
178
  * @license lucide-react v0.552.0 - ISC
179
179
  *
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
182
  */
183
- const __iconNode$A = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
- const Check = createLucideIcon("check", __iconNode$A);
183
+ const __iconNode$B = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
+ const Check = createLucideIcon("check", __iconNode$B);
185
185
  /**
186
186
  * @license lucide-react v0.552.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
190
  */
191
- const __iconNode$z = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$z);
191
+ const __iconNode$A = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$A);
193
193
  /**
194
194
  * @license lucide-react v0.552.0 - ISC
195
195
  *
196
196
  * This source code is licensed under the ISC license.
197
197
  * See the LICENSE file in the root directory of this source tree.
198
198
  */
199
- const __iconNode$y = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$y);
199
+ const __iconNode$z = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$z);
201
201
  /**
202
202
  * @license lucide-react v0.552.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
206
  */
207
- const __iconNode$x = [
207
+ const __iconNode$y = [
208
208
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
209
209
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
210
210
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
211
211
  ];
212
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$x);
212
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$y);
213
213
  /**
214
214
  * @license lucide-react v0.552.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const __iconNode$w = [
219
+ const __iconNode$x = [
220
220
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
221
221
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
222
222
  ];
223
- const CircleDot = createLucideIcon("circle-dot", __iconNode$w);
223
+ const CircleDot = createLucideIcon("circle-dot", __iconNode$x);
224
224
  /**
225
225
  * @license lucide-react v0.552.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const __iconNode$v = [
230
+ const __iconNode$w = [
231
231
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
232
232
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
233
233
  ];
234
- const Copy = createLucideIcon("copy", __iconNode$v);
234
+ const Copy = createLucideIcon("copy", __iconNode$w);
235
235
  /**
236
236
  * @license lucide-react v0.552.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
240
  */
241
- const __iconNode$u = [
241
+ const __iconNode$v = [
242
242
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
243
243
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
244
244
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
245
245
  ];
246
- const Download = createLucideIcon("download", __iconNode$u);
246
+ const Download = createLucideIcon("download", __iconNode$v);
247
247
  /**
248
248
  * @license lucide-react v0.552.0 - ISC
249
249
  *
250
250
  * This source code is licensed under the ISC license.
251
251
  * See the LICENSE file in the root directory of this source tree.
252
252
  */
253
- const __iconNode$t = [
253
+ const __iconNode$u = [
254
254
  ["path", { d: "m15 15 6 6", key: "1s409w" }],
255
255
  ["path", { d: "m15 9 6-6", key: "ko1vev" }],
256
256
  ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
@@ -260,26 +260,26 @@ const __iconNode$t = [
260
260
  ["path", { d: "M3 8V3h5", key: "1ln10m" }],
261
261
  ["path", { d: "M9 9 3 3", key: "v551iv" }]
262
262
  ];
263
- const Expand = createLucideIcon("expand", __iconNode$t);
263
+ const Expand = createLucideIcon("expand", __iconNode$u);
264
264
  /**
265
265
  * @license lucide-react v0.552.0 - ISC
266
266
  *
267
267
  * This source code is licensed under the ISC license.
268
268
  * See the LICENSE file in the root directory of this source tree.
269
269
  */
270
- const __iconNode$s = [
270
+ const __iconNode$t = [
271
271
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
272
272
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
273
273
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
274
274
  ];
275
- const ExternalLink = createLucideIcon("external-link", __iconNode$s);
275
+ const ExternalLink = createLucideIcon("external-link", __iconNode$t);
276
276
  /**
277
277
  * @license lucide-react v0.552.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
281
  */
282
- const __iconNode$r = [
282
+ const __iconNode$s = [
283
283
  [
284
284
  "path",
285
285
  {
@@ -289,14 +289,14 @@ const __iconNode$r = [
289
289
  ],
290
290
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
291
291
  ];
292
- const Eye = createLucideIcon("eye", __iconNode$r);
292
+ const Eye = createLucideIcon("eye", __iconNode$s);
293
293
  /**
294
294
  * @license lucide-react v0.552.0 - ISC
295
295
  *
296
296
  * This source code is licensed under the ISC license.
297
297
  * See the LICENSE file in the root directory of this source tree.
298
298
  */
299
- const __iconNode$q = [
299
+ const __iconNode$r = [
300
300
  [
301
301
  "path",
302
302
  {
@@ -309,14 +309,14 @@ const __iconNode$q = [
309
309
  ["path", { d: "M16 13H8", key: "t4e002" }],
310
310
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
311
311
  ];
312
- const FileText = createLucideIcon("file-text", __iconNode$q);
312
+ const FileText = createLucideIcon("file-text", __iconNode$r);
313
313
  /**
314
314
  * @license lucide-react v0.552.0 - ISC
315
315
  *
316
316
  * This source code is licensed under the ISC license.
317
317
  * See the LICENSE file in the root directory of this source tree.
318
318
  */
319
- const __iconNode$p = [
319
+ const __iconNode$q = [
320
320
  [
321
321
  "path",
322
322
  {
@@ -325,14 +325,14 @@ const __iconNode$p = [
325
325
  }
326
326
  ]
327
327
  ];
328
- const FolderOpen = createLucideIcon("folder-open", __iconNode$p);
328
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$q);
329
329
  /**
330
330
  * @license lucide-react v0.552.0 - ISC
331
331
  *
332
332
  * This source code is licensed under the ISC license.
333
333
  * See the LICENSE file in the root directory of this source tree.
334
334
  */
335
- const __iconNode$o = [
335
+ const __iconNode$p = [
336
336
  ["path", { d: "M12 10v6", key: "1bos4e" }],
337
337
  ["path", { d: "M9 13h6", key: "1uhe8q" }],
338
338
  [
@@ -343,14 +343,14 @@ const __iconNode$o = [
343
343
  }
344
344
  ]
345
345
  ];
346
- const FolderPlus = createLucideIcon("folder-plus", __iconNode$o);
346
+ const FolderPlus = createLucideIcon("folder-plus", __iconNode$p);
347
347
  /**
348
348
  * @license lucide-react v0.552.0 - ISC
349
349
  *
350
350
  * This source code is licensed under the ISC license.
351
351
  * See the LICENSE file in the root directory of this source tree.
352
352
  */
353
- const __iconNode$n = [
353
+ const __iconNode$o = [
354
354
  [
355
355
  "path",
356
356
  {
@@ -359,52 +359,52 @@ const __iconNode$n = [
359
359
  }
360
360
  ]
361
361
  ];
362
- const Folder = createLucideIcon("folder", __iconNode$n);
362
+ const Folder = createLucideIcon("folder", __iconNode$o);
363
363
  /**
364
364
  * @license lucide-react v0.552.0 - ISC
365
365
  *
366
366
  * This source code is licensed under the ISC license.
367
367
  * See the LICENSE file in the root directory of this source tree.
368
368
  */
369
- const __iconNode$m = [
369
+ const __iconNode$n = [
370
370
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
371
371
  ["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
372
372
  ["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
373
373
  ];
374
- const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$m);
374
+ const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$n);
375
375
  /**
376
376
  * @license lucide-react v0.552.0 - ISC
377
377
  *
378
378
  * This source code is licensed under the ISC license.
379
379
  * See the LICENSE file in the root directory of this source tree.
380
380
  */
381
- const __iconNode$l = [
381
+ const __iconNode$m = [
382
382
  ["circle", { cx: "12", cy: "18", r: "3", key: "1mpf1b" }],
383
383
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
384
384
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
385
385
  ["path", { d: "M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9", key: "1uq4wg" }],
386
386
  ["path", { d: "M12 12v3", key: "158kv8" }]
387
387
  ];
388
- const GitFork = createLucideIcon("git-fork", __iconNode$l);
388
+ const GitFork = createLucideIcon("git-fork", __iconNode$m);
389
389
  /**
390
390
  * @license lucide-react v0.552.0 - ISC
391
391
  *
392
392
  * This source code is licensed under the ISC license.
393
393
  * See the LICENSE file in the root directory of this source tree.
394
394
  */
395
- const __iconNode$k = [
395
+ const __iconNode$l = [
396
396
  ["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
397
397
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
398
398
  ["path", { d: "M6 21V9a9 9 0 0 0 9 9", key: "7kw0sc" }]
399
399
  ];
400
- const GitMerge = createLucideIcon("git-merge", __iconNode$k);
400
+ const GitMerge = createLucideIcon("git-merge", __iconNode$l);
401
401
  /**
402
402
  * @license lucide-react v0.552.0 - ISC
403
403
  *
404
404
  * This source code is licensed under the ISC license.
405
405
  * See the LICENSE file in the root directory of this source tree.
406
406
  */
407
- const __iconNode$j = [
407
+ const __iconNode$k = [
408
408
  [
409
409
  "path",
410
410
  {
@@ -414,57 +414,57 @@ const __iconNode$j = [
414
414
  ],
415
415
  ["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
416
416
  ];
417
- const Github = createLucideIcon("github", __iconNode$j);
417
+ const Github = createLucideIcon("github", __iconNode$k);
418
418
  /**
419
419
  * @license lucide-react v0.552.0 - ISC
420
420
  *
421
421
  * This source code is licensed under the ISC license.
422
422
  * See the LICENSE file in the root directory of this source tree.
423
423
  */
424
- const __iconNode$i = [
424
+ const __iconNode$j = [
425
425
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
426
426
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
427
427
  ["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
428
428
  ];
429
- const History = createLucideIcon("history", __iconNode$i);
429
+ const History = createLucideIcon("history", __iconNode$j);
430
430
  /**
431
431
  * @license lucide-react v0.552.0 - ISC
432
432
  *
433
433
  * This source code is licensed under the ISC license.
434
434
  * See the LICENSE file in the root directory of this source tree.
435
435
  */
436
- const __iconNode$h = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
437
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$h);
436
+ const __iconNode$i = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
437
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$i);
438
438
  /**
439
439
  * @license lucide-react v0.552.0 - ISC
440
440
  *
441
441
  * This source code is licensed under the ISC license.
442
442
  * See the LICENSE file in the root directory of this source tree.
443
443
  */
444
- const __iconNode$g = [
444
+ const __iconNode$h = [
445
445
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
446
446
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
447
447
  ];
448
- const Lock = createLucideIcon("lock", __iconNode$g);
448
+ const Lock = createLucideIcon("lock", __iconNode$h);
449
449
  /**
450
450
  * @license lucide-react v0.552.0 - ISC
451
451
  *
452
452
  * This source code is licensed under the ISC license.
453
453
  * See the LICENSE file in the root directory of this source tree.
454
454
  */
455
- const __iconNode$f = [
455
+ const __iconNode$g = [
456
456
  ["path", { d: "m10 17 5-5-5-5", key: "1bsop3" }],
457
457
  ["path", { d: "M15 12H3", key: "6jk70r" }],
458
458
  ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }]
459
459
  ];
460
- const LogIn = createLucideIcon("log-in", __iconNode$f);
460
+ const LogIn = createLucideIcon("log-in", __iconNode$g);
461
461
  /**
462
462
  * @license lucide-react v0.552.0 - ISC
463
463
  *
464
464
  * This source code is licensed under the ISC license.
465
465
  * See the LICENSE file in the root directory of this source tree.
466
466
  */
467
- const __iconNode$e = [
467
+ const __iconNode$f = [
468
468
  [
469
469
  "path",
470
470
  {
@@ -473,37 +473,37 @@ const __iconNode$e = [
473
473
  }
474
474
  ]
475
475
  ];
476
- const MessageSquare = createLucideIcon("message-square", __iconNode$e);
476
+ const MessageSquare = createLucideIcon("message-square", __iconNode$f);
477
477
  /**
478
478
  * @license lucide-react v0.552.0 - ISC
479
479
  *
480
480
  * This source code is licensed under the ISC license.
481
481
  * See the LICENSE file in the root directory of this source tree.
482
482
  */
483
- const __iconNode$d = [
483
+ const __iconNode$e = [
484
484
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
485
485
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
486
486
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
487
487
  ];
488
- const Monitor = createLucideIcon("monitor", __iconNode$d);
488
+ const Monitor = createLucideIcon("monitor", __iconNode$e);
489
489
  /**
490
490
  * @license lucide-react v0.552.0 - ISC
491
491
  *
492
492
  * This source code is licensed under the ISC license.
493
493
  * See the LICENSE file in the root directory of this source tree.
494
494
  */
495
- const __iconNode$c = [
495
+ const __iconNode$d = [
496
496
  ["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
497
497
  ["path", { d: "M2 12H22", key: "1m8cig" }]
498
498
  ];
499
- const MoveRight = createLucideIcon("move-right", __iconNode$c);
499
+ const MoveRight = createLucideIcon("move-right", __iconNode$d);
500
500
  /**
501
501
  * @license lucide-react v0.552.0 - ISC
502
502
  *
503
503
  * This source code is licensed under the ISC license.
504
504
  * See the LICENSE file in the root directory of this source tree.
505
505
  */
506
- const __iconNode$b = [
506
+ const __iconNode$c = [
507
507
  [
508
508
  "path",
509
509
  {
@@ -512,7 +512,18 @@ const __iconNode$b = [
512
512
  }
513
513
  ]
514
514
  ];
515
- const Play = createLucideIcon("play", __iconNode$b);
515
+ const Play = createLucideIcon("play", __iconNode$c);
516
+ /**
517
+ * @license lucide-react v0.552.0 - ISC
518
+ *
519
+ * This source code is licensed under the ISC license.
520
+ * See the LICENSE file in the root directory of this source tree.
521
+ */
522
+ const __iconNode$b = [
523
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
524
+ ["path", { d: "M12 5v14", key: "s699le" }]
525
+ ];
526
+ const Plus = createLucideIcon("plus", __iconNode$b);
516
527
  /**
517
528
  * @license lucide-react v0.552.0 - ISC
518
529
  *
@@ -2149,6 +2160,432 @@ const GitHubSearchPanelMetadata = {
2149
2160
  slices: ["workspace", "workspaceRepositories"],
2150
2161
  surfaces: ["panel"]
2151
2162
  };
2163
+ const CreateIssueModal = ({
2164
+ isOpen,
2165
+ onClose,
2166
+ owner,
2167
+ repo,
2168
+ onIssueCreated,
2169
+ apiBaseUrl
2170
+ }) => {
2171
+ const { theme: theme2 } = useTheme();
2172
+ const [title, setTitle] = useState("");
2173
+ const [body, setBody] = useState("");
2174
+ const [isSubmitting, setIsSubmitting] = useState(false);
2175
+ const [error, setError] = useState(null);
2176
+ const titleInputRef = useRef(null);
2177
+ useEffect(() => {
2178
+ if (isOpen && titleInputRef.current) {
2179
+ titleInputRef.current.focus();
2180
+ }
2181
+ }, [isOpen]);
2182
+ useEffect(() => {
2183
+ const handleKeyDown = (e) => {
2184
+ if (e.key === "Escape" && isOpen && !isSubmitting) {
2185
+ onClose();
2186
+ }
2187
+ };
2188
+ if (isOpen) {
2189
+ window.addEventListener("keydown", handleKeyDown);
2190
+ return () => window.removeEventListener("keydown", handleKeyDown);
2191
+ }
2192
+ }, [isOpen, isSubmitting, onClose]);
2193
+ const handleSubmit = async (e) => {
2194
+ e.preventDefault();
2195
+ setError(null);
2196
+ if (!title.trim()) {
2197
+ setError("Title is required");
2198
+ return;
2199
+ }
2200
+ setIsSubmitting(true);
2201
+ try {
2202
+ const response = await fetch(
2203
+ `${apiBaseUrl}/api/github/repo/${owner}/${repo}/issues`,
2204
+ {
2205
+ method: "POST",
2206
+ headers: {
2207
+ "Content-Type": "application/json"
2208
+ },
2209
+ credentials: "include",
2210
+ // Important: Send cookies for auth
2211
+ body: JSON.stringify({
2212
+ title: title.trim(),
2213
+ body: body.trim() || void 0
2214
+ })
2215
+ }
2216
+ );
2217
+ if (!response.ok) {
2218
+ const errorData = await response.json().catch(() => ({}));
2219
+ if (response.status === 401) {
2220
+ throw new Error("Authentication required to create issues");
2221
+ } else if (response.status === 403) {
2222
+ throw new Error("You don't have permission to create issues in this repository");
2223
+ } else {
2224
+ throw new Error(errorData.error || `Failed to create issue: ${response.status}`);
2225
+ }
2226
+ }
2227
+ setTitle("");
2228
+ setBody("");
2229
+ setError(null);
2230
+ onIssueCreated();
2231
+ onClose();
2232
+ } catch (err) {
2233
+ setError(err instanceof Error ? err.message : "Failed to create issue. Please check your connection.");
2234
+ } finally {
2235
+ setIsSubmitting(false);
2236
+ }
2237
+ };
2238
+ if (!isOpen) return null;
2239
+ return /* @__PURE__ */ jsxs(
2240
+ "div",
2241
+ {
2242
+ style: {
2243
+ position: "fixed",
2244
+ inset: 0,
2245
+ zIndex: 1e3,
2246
+ display: "flex",
2247
+ alignItems: "center",
2248
+ justifyContent: "center",
2249
+ backgroundColor: `${theme2.colors.background}cc`,
2250
+ backdropFilter: "blur(4px)"
2251
+ },
2252
+ onClick: (e) => {
2253
+ if (e.target === e.currentTarget && !isSubmitting) {
2254
+ onClose();
2255
+ }
2256
+ },
2257
+ children: [
2258
+ /* @__PURE__ */ jsxs(
2259
+ "div",
2260
+ {
2261
+ style: {
2262
+ maxWidth: "500px",
2263
+ width: "100%",
2264
+ margin: "0 16px",
2265
+ backgroundColor: theme2.colors.surface,
2266
+ border: `1px solid ${theme2.colors.border}`,
2267
+ borderRadius: "12px",
2268
+ boxShadow: "0 4px 12px rgba(0,0,0,0.15)"
2269
+ },
2270
+ children: [
2271
+ /* @__PURE__ */ jsxs(
2272
+ "div",
2273
+ {
2274
+ style: {
2275
+ display: "flex",
2276
+ alignItems: "center",
2277
+ justifyContent: "space-between",
2278
+ padding: "16px 24px",
2279
+ borderBottom: `1px solid ${theme2.colors.border}`
2280
+ },
2281
+ children: [
2282
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
2283
+ /* @__PURE__ */ jsx(Plus, { size: 20, style: { color: theme2.colors.primary } }),
2284
+ /* @__PURE__ */ jsx(
2285
+ "h2",
2286
+ {
2287
+ style: {
2288
+ margin: 0,
2289
+ fontSize: `${theme2.fontSizes[3]}px`,
2290
+ fontWeight: theme2.fontWeights.semibold,
2291
+ color: theme2.colors.text
2292
+ },
2293
+ children: "Create Issue"
2294
+ }
2295
+ )
2296
+ ] }),
2297
+ /* @__PURE__ */ jsx(
2298
+ "button",
2299
+ {
2300
+ type: "button",
2301
+ onClick: onClose,
2302
+ disabled: isSubmitting,
2303
+ style: {
2304
+ display: "flex",
2305
+ alignItems: "center",
2306
+ justifyContent: "center",
2307
+ width: "32px",
2308
+ height: "32px",
2309
+ borderRadius: "6px",
2310
+ border: "none",
2311
+ backgroundColor: theme2.colors.secondary,
2312
+ color: theme2.colors.text,
2313
+ cursor: isSubmitting ? "not-allowed" : "pointer",
2314
+ opacity: isSubmitting ? 0.5 : 1,
2315
+ transition: "opacity 0.15s ease"
2316
+ },
2317
+ title: "Close",
2318
+ children: /* @__PURE__ */ jsx(X, { size: 16 })
2319
+ }
2320
+ )
2321
+ ]
2322
+ }
2323
+ ),
2324
+ /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, children: [
2325
+ /* @__PURE__ */ jsxs("div", { style: { padding: "24px" }, children: [
2326
+ /* @__PURE__ */ jsxs(
2327
+ "p",
2328
+ {
2329
+ style: {
2330
+ margin: "0 0 16px 0",
2331
+ fontSize: `${theme2.fontSizes[1]}px`,
2332
+ color: theme2.colors.textSecondary
2333
+ },
2334
+ children: [
2335
+ "Creating issue for",
2336
+ " ",
2337
+ /* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.text, fontWeight: theme2.fontWeights.medium }, children: [
2338
+ owner,
2339
+ "/",
2340
+ repo
2341
+ ] })
2342
+ ]
2343
+ }
2344
+ ),
2345
+ error && /* @__PURE__ */ jsxs(
2346
+ "div",
2347
+ {
2348
+ style: {
2349
+ display: "flex",
2350
+ alignItems: "flex-start",
2351
+ gap: "8px",
2352
+ padding: "12px",
2353
+ marginBottom: "16px",
2354
+ backgroundColor: `${theme2.colors.error}20`,
2355
+ borderRadius: "8px",
2356
+ border: `1px solid ${theme2.colors.error}40`
2357
+ },
2358
+ children: [
2359
+ /* @__PURE__ */ jsx(
2360
+ CircleAlert,
2361
+ {
2362
+ size: 16,
2363
+ style: {
2364
+ color: theme2.colors.error,
2365
+ flexShrink: 0,
2366
+ marginTop: "2px"
2367
+ }
2368
+ }
2369
+ ),
2370
+ /* @__PURE__ */ jsx(
2371
+ "span",
2372
+ {
2373
+ style: {
2374
+ color: theme2.colors.error,
2375
+ fontSize: `${theme2.fontSizes[1]}px`,
2376
+ lineHeight: 1.5
2377
+ },
2378
+ children: error
2379
+ }
2380
+ )
2381
+ ]
2382
+ }
2383
+ ),
2384
+ /* @__PURE__ */ jsxs("div", { style: { marginBottom: "16px" }, children: [
2385
+ /* @__PURE__ */ jsxs(
2386
+ "label",
2387
+ {
2388
+ htmlFor: "issue-title",
2389
+ style: {
2390
+ display: "block",
2391
+ marginBottom: "8px",
2392
+ fontSize: `${theme2.fontSizes[1]}px`,
2393
+ fontWeight: theme2.fontWeights.medium,
2394
+ color: theme2.colors.text
2395
+ },
2396
+ children: [
2397
+ "Title ",
2398
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.error }, children: "*" })
2399
+ ]
2400
+ }
2401
+ ),
2402
+ /* @__PURE__ */ jsx(
2403
+ "input",
2404
+ {
2405
+ ref: titleInputRef,
2406
+ id: "issue-title",
2407
+ type: "text",
2408
+ value: title,
2409
+ onChange: (e) => setTitle(e.target.value),
2410
+ placeholder: "Issue title...",
2411
+ disabled: isSubmitting,
2412
+ required: true,
2413
+ style: {
2414
+ width: "100%",
2415
+ padding: "10px 12px",
2416
+ fontSize: `${theme2.fontSizes[2]}px`,
2417
+ backgroundColor: theme2.colors.background,
2418
+ color: theme2.colors.text,
2419
+ border: `1px solid ${theme2.colors.border}`,
2420
+ borderRadius: "6px",
2421
+ outline: "none",
2422
+ transition: "border-color 0.15s ease",
2423
+ opacity: isSubmitting ? 0.5 : 1,
2424
+ cursor: isSubmitting ? "not-allowed" : "text",
2425
+ boxSizing: "border-box"
2426
+ },
2427
+ onFocus: (e) => {
2428
+ e.target.style.borderColor = theme2.colors.primary;
2429
+ },
2430
+ onBlur: (e) => {
2431
+ e.target.style.borderColor = theme2.colors.border;
2432
+ }
2433
+ }
2434
+ )
2435
+ ] }),
2436
+ /* @__PURE__ */ jsxs("div", { children: [
2437
+ /* @__PURE__ */ jsxs(
2438
+ "label",
2439
+ {
2440
+ htmlFor: "issue-body",
2441
+ style: {
2442
+ display: "block",
2443
+ marginBottom: "8px",
2444
+ fontSize: `${theme2.fontSizes[1]}px`,
2445
+ fontWeight: theme2.fontWeights.medium,
2446
+ color: theme2.colors.text
2447
+ },
2448
+ children: [
2449
+ "Description",
2450
+ " ",
2451
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary, fontWeight: "normal" }, children: "(optional)" })
2452
+ ]
2453
+ }
2454
+ ),
2455
+ /* @__PURE__ */ jsx(
2456
+ "textarea",
2457
+ {
2458
+ id: "issue-body",
2459
+ value: body,
2460
+ onChange: (e) => setBody(e.target.value),
2461
+ placeholder: "Describe the issue...",
2462
+ disabled: isSubmitting,
2463
+ rows: 5,
2464
+ style: {
2465
+ width: "100%",
2466
+ padding: "10px 12px",
2467
+ fontSize: `${theme2.fontSizes[2]}px`,
2468
+ backgroundColor: theme2.colors.background,
2469
+ color: theme2.colors.text,
2470
+ border: `1px solid ${theme2.colors.border}`,
2471
+ borderRadius: "6px",
2472
+ outline: "none",
2473
+ transition: "border-color 0.15s ease",
2474
+ resize: "vertical",
2475
+ opacity: isSubmitting ? 0.5 : 1,
2476
+ cursor: isSubmitting ? "not-allowed" : "text",
2477
+ fontFamily: theme2.fonts.body,
2478
+ lineHeight: 1.5,
2479
+ boxSizing: "border-box"
2480
+ },
2481
+ onFocus: (e) => {
2482
+ e.target.style.borderColor = theme2.colors.primary;
2483
+ },
2484
+ onBlur: (e) => {
2485
+ e.target.style.borderColor = theme2.colors.border;
2486
+ }
2487
+ }
2488
+ )
2489
+ ] })
2490
+ ] }),
2491
+ /* @__PURE__ */ jsxs(
2492
+ "div",
2493
+ {
2494
+ style: {
2495
+ display: "flex",
2496
+ justifyContent: "flex-end",
2497
+ gap: "12px",
2498
+ padding: "16px 24px",
2499
+ borderTop: `1px solid ${theme2.colors.border}`
2500
+ },
2501
+ children: [
2502
+ /* @__PURE__ */ jsx(
2503
+ "button",
2504
+ {
2505
+ type: "button",
2506
+ onClick: onClose,
2507
+ disabled: isSubmitting,
2508
+ style: {
2509
+ padding: "10px 18px",
2510
+ fontSize: `${theme2.fontSizes[2]}px`,
2511
+ fontWeight: theme2.fontWeights.medium,
2512
+ color: theme2.colors.text,
2513
+ backgroundColor: "transparent",
2514
+ border: `1px solid ${theme2.colors.border}`,
2515
+ borderRadius: "6px",
2516
+ cursor: isSubmitting ? "not-allowed" : "pointer",
2517
+ opacity: isSubmitting ? 0.5 : 1,
2518
+ transition: "all 0.15s ease"
2519
+ },
2520
+ onMouseEnter: (e) => {
2521
+ if (!isSubmitting) {
2522
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundLight;
2523
+ }
2524
+ },
2525
+ onMouseLeave: (e) => {
2526
+ e.currentTarget.style.backgroundColor = "transparent";
2527
+ },
2528
+ children: "Cancel"
2529
+ }
2530
+ ),
2531
+ /* @__PURE__ */ jsx(
2532
+ "button",
2533
+ {
2534
+ type: "submit",
2535
+ disabled: isSubmitting || !title.trim(),
2536
+ style: {
2537
+ display: "inline-flex",
2538
+ alignItems: "center",
2539
+ gap: "8px",
2540
+ padding: "10px 18px",
2541
+ fontSize: `${theme2.fontSizes[2]}px`,
2542
+ fontWeight: theme2.fontWeights.semibold,
2543
+ color: theme2.colors.textOnPrimary || theme2.colors.background,
2544
+ backgroundColor: theme2.colors.primary,
2545
+ border: "none",
2546
+ borderRadius: "6px",
2547
+ cursor: isSubmitting || !title.trim() ? "not-allowed" : "pointer",
2548
+ opacity: isSubmitting || !title.trim() ? 0.5 : 1,
2549
+ transition: "all 0.15s ease"
2550
+ },
2551
+ onMouseEnter: (e) => {
2552
+ if (!isSubmitting && title.trim()) {
2553
+ e.currentTarget.style.opacity = "0.9";
2554
+ }
2555
+ },
2556
+ onMouseLeave: (e) => {
2557
+ if (!isSubmitting && title.trim()) {
2558
+ e.currentTarget.style.opacity = "1";
2559
+ }
2560
+ },
2561
+ children: isSubmitting ? /* @__PURE__ */ jsxs(Fragment, { children: [
2562
+ /* @__PURE__ */ jsx(LoaderCircle, { size: 16, className: "animate-spin" }),
2563
+ "Creating..."
2564
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2565
+ /* @__PURE__ */ jsx(Plus, { size: 16 }),
2566
+ "Create Issue"
2567
+ ] })
2568
+ }
2569
+ )
2570
+ ]
2571
+ }
2572
+ )
2573
+ ] })
2574
+ ]
2575
+ }
2576
+ ),
2577
+ /* @__PURE__ */ jsx("style", { children: `
2578
+ @keyframes spin {
2579
+ to { transform: rotate(360deg); }
2580
+ }
2581
+ .animate-spin {
2582
+ animation: spin 1s linear infinite;
2583
+ }
2584
+ ` })
2585
+ ]
2586
+ }
2587
+ );
2588
+ };
2152
2589
  const formatDate$2 = (dateString) => {
2153
2590
  const date = new Date(dateString);
2154
2591
  const now = /* @__PURE__ */ new Date();
@@ -2181,6 +2618,7 @@ const GitHubIssuesPanelContent = ({
2181
2618
  const [selectedLabel, setSelectedLabel] = useState("");
2182
2619
  const [isDropdownOpen, setIsDropdownOpen] = useState(false);
2183
2620
  const [selectedIssueId, setSelectedIssueId] = useState(null);
2621
+ const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
2184
2622
  const uniqueLabels = useMemo(() => {
2185
2623
  const labelMap = /* @__PURE__ */ new Map();
2186
2624
  issues.forEach((issue) => {
@@ -2228,6 +2666,9 @@ const GitHubIssuesPanelContent = ({
2228
2666
  payload: {}
2229
2667
  });
2230
2668
  };
2669
+ const handleIssueCreated = () => {
2670
+ handleRefresh();
2671
+ };
2231
2672
  const handleLogin = () => {
2232
2673
  events.emit({
2233
2674
  type: "github:login-requested",
@@ -2546,6 +2987,37 @@ const GitHubIssuesPanelContent = ({
2546
2987
  }
2547
2988
  )
2548
2989
  ] }),
2990
+ /* @__PURE__ */ jsxs(
2991
+ "button",
2992
+ {
2993
+ type: "button",
2994
+ onClick: () => setIsCreateModalOpen(true),
2995
+ style: {
2996
+ display: "flex",
2997
+ alignItems: "center",
2998
+ gap: "4px",
2999
+ padding: "4px 8px",
3000
+ borderRadius: "4px",
3001
+ border: "none",
3002
+ backgroundColor: theme2.colors.primary,
3003
+ color: theme2.colors.textOnPrimary || theme2.colors.background,
3004
+ fontSize: `${theme2.fontSizes[0]}px`,
3005
+ fontWeight: theme2.fontWeights.medium,
3006
+ cursor: "pointer",
3007
+ transition: "opacity 0.15s ease"
3008
+ },
3009
+ onMouseEnter: (e) => {
3010
+ e.currentTarget.style.opacity = "0.9";
3011
+ },
3012
+ onMouseLeave: (e) => {
3013
+ e.currentTarget.style.opacity = "1";
3014
+ },
3015
+ children: [
3016
+ /* @__PURE__ */ jsx(Plus, { size: 12 }),
3017
+ "New"
3018
+ ]
3019
+ }
3020
+ ),
2549
3021
  /* @__PURE__ */ jsx(
2550
3022
  "button",
2551
3023
  {
@@ -2597,7 +3069,39 @@ const GitHubIssuesPanelContent = ({
2597
3069
  children: "No Open Issues"
2598
3070
  }
2599
3071
  ),
2600
- /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: `${theme2.fontSizes[2]}px` }, children: "There are no open issues in this repository." })
3072
+ /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: `${theme2.fontSizes[2]}px` }, children: "There are no open issues in this repository." }),
3073
+ /* @__PURE__ */ jsxs(
3074
+ "button",
3075
+ {
3076
+ type: "button",
3077
+ onClick: () => setIsCreateModalOpen(true),
3078
+ style: {
3079
+ marginTop: "16px",
3080
+ display: "inline-flex",
3081
+ alignItems: "center",
3082
+ gap: "8px",
3083
+ padding: "10px 18px",
3084
+ borderRadius: "8px",
3085
+ border: "none",
3086
+ backgroundColor: theme2.colors.primary,
3087
+ color: theme2.colors.textOnPrimary || theme2.colors.background,
3088
+ fontSize: `${theme2.fontSizes[2]}px`,
3089
+ fontWeight: theme2.fontWeights.semibold,
3090
+ cursor: "pointer",
3091
+ transition: "opacity 0.15s ease"
3092
+ },
3093
+ onMouseEnter: (e) => {
3094
+ e.currentTarget.style.opacity = "0.9";
3095
+ },
3096
+ onMouseLeave: (e) => {
3097
+ e.currentTarget.style.opacity = "1";
3098
+ },
3099
+ children: [
3100
+ /* @__PURE__ */ jsx(Plus, { size: 16 }),
3101
+ "Create Issue"
3102
+ ]
3103
+ }
3104
+ )
2601
3105
  ] })
2602
3106
  ]
2603
3107
  }
@@ -2693,7 +3197,18 @@ const GitHubIssuesPanelContent = ({
2693
3197
  .animate-spin {
2694
3198
  animation: spin 1s linear infinite;
2695
3199
  }
2696
- ` })
3200
+ ` }),
3201
+ /* @__PURE__ */ jsx(
3202
+ CreateIssueModal,
3203
+ {
3204
+ isOpen: isCreateModalOpen,
3205
+ onClose: () => setIsCreateModalOpen(false),
3206
+ owner,
3207
+ repo,
3208
+ onIssueCreated: handleIssueCreated,
3209
+ apiBaseUrl: typeof window !== "undefined" ? window.location.origin : ""
3210
+ }
3211
+ )
2697
3212
  ]
2698
3213
  }
2699
3214
  );