uilint-react 0.1.23 → 0.1.25

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,745 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ useUILintContext
5
+ } from "./chunk-45MPASAN.js";
6
+
7
+ // src/components/ui-lint/ElementBadges.tsx
8
+ import React, { useState, useEffect, useCallback, useMemo } from "react";
9
+ import { createPortal } from "react-dom";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ var STYLES = {
12
+ bg: "rgba(17, 24, 39, 0.95)",
13
+ success: "#10B981",
14
+ warning: "#F59E0B",
15
+ error: "#EF4444",
16
+ text: "#FFFFFF",
17
+ border: "rgba(255, 255, 255, 0.2)",
18
+ highlight: "#3B82F6",
19
+ font: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
20
+ shadow: "0 2px 8px rgba(0, 0, 0, 0.3)"
21
+ };
22
+ var NEAR_DISTANCE = 0;
23
+ var FAR_DISTANCE = 150;
24
+ var MIN_SCALE = 0.5;
25
+ var MAX_SCALE = 1;
26
+ function getScaleFromDistance(distance) {
27
+ if (distance <= NEAR_DISTANCE) return MAX_SCALE;
28
+ if (distance >= FAR_DISTANCE) return MIN_SCALE;
29
+ const t = (distance - NEAR_DISTANCE) / (FAR_DISTANCE - NEAR_DISTANCE);
30
+ return MAX_SCALE - t * (MAX_SCALE - MIN_SCALE);
31
+ }
32
+ var CLUSTER_THRESHOLD = 24;
33
+ function getBadgeColor(issueCount) {
34
+ if (issueCount === 0) return STYLES.success;
35
+ if (issueCount <= 2) return STYLES.warning;
36
+ return STYLES.error;
37
+ }
38
+ function ElementBadge({
39
+ element,
40
+ issue,
41
+ distance,
42
+ onSelect
43
+ }) {
44
+ const [rect, setRect] = useState(null);
45
+ const [isHovered, setIsHovered] = useState(false);
46
+ useEffect(() => {
47
+ const updateRect = () => {
48
+ if (element.element && document.contains(element.element)) {
49
+ setRect(element.element.getBoundingClientRect());
50
+ } else {
51
+ setRect(null);
52
+ }
53
+ };
54
+ updateRect();
55
+ let rafId;
56
+ const handleUpdate = () => {
57
+ updateRect();
58
+ rafId = requestAnimationFrame(handleUpdate);
59
+ };
60
+ rafId = requestAnimationFrame(handleUpdate);
61
+ return () => {
62
+ cancelAnimationFrame(rafId);
63
+ };
64
+ }, [element.element]);
65
+ const handleClick = useCallback(
66
+ (e) => {
67
+ e.preventDefault();
68
+ e.stopPropagation();
69
+ onSelect(element, issue);
70
+ },
71
+ [element, issue, onSelect]
72
+ );
73
+ if (!rect) return null;
74
+ if (rect.top < -50 || rect.top > window.innerHeight + 50) return null;
75
+ if (rect.left < -50 || rect.left > window.innerWidth + 50) return null;
76
+ const scale = isHovered ? 1.1 : getScaleFromDistance(distance);
77
+ const badgeStyle = {
78
+ position: "fixed",
79
+ top: rect.top - 8,
80
+ left: rect.right - 8,
81
+ zIndex: isHovered ? 99999 : 99995,
82
+ cursor: "pointer",
83
+ transition: "transform 0.1s ease-out",
84
+ transform: `scale(${scale})`,
85
+ transformOrigin: "center center"
86
+ };
87
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
88
+ isHovered && /* @__PURE__ */ jsx(
89
+ "div",
90
+ {
91
+ style: {
92
+ position: "fixed",
93
+ top: rect.top - 2,
94
+ left: rect.left - 2,
95
+ width: rect.width + 4,
96
+ height: rect.height + 4,
97
+ border: `2px solid ${STYLES.highlight}`,
98
+ borderRadius: "4px",
99
+ pointerEvents: "none",
100
+ zIndex: 99994,
101
+ boxShadow: `0 0 0 1px rgba(59, 130, 246, 0.3)`
102
+ },
103
+ "data-ui-lint": true
104
+ }
105
+ ),
106
+ /* @__PURE__ */ jsxs(
107
+ "div",
108
+ {
109
+ style: badgeStyle,
110
+ "data-ui-lint": true,
111
+ onMouseEnter: () => setIsHovered(true),
112
+ onMouseLeave: () => setIsHovered(false),
113
+ onClick: handleClick,
114
+ children: [
115
+ issue.status === "scanning" && /* @__PURE__ */ jsx(ScanningBadge, {}),
116
+ issue.status === "complete" && /* @__PURE__ */ jsx(IssueBadge, { count: issue.issues.length }),
117
+ issue.status === "error" && /* @__PURE__ */ jsx(ErrorBadge, {}),
118
+ issue.status === "pending" && /* @__PURE__ */ jsx(PendingBadge, {})
119
+ ]
120
+ }
121
+ )
122
+ ] });
123
+ }
124
+ function IssueBadge({ count }) {
125
+ const color = getBadgeColor(count);
126
+ if (count === 0) {
127
+ return /* @__PURE__ */ jsx(
128
+ "div",
129
+ {
130
+ style: {
131
+ display: "flex",
132
+ alignItems: "center",
133
+ justifyContent: "center",
134
+ width: "18px",
135
+ height: "18px",
136
+ borderRadius: "50%",
137
+ backgroundColor: color,
138
+ boxShadow: STYLES.shadow,
139
+ border: `1px solid ${STYLES.border}`
140
+ },
141
+ children: /* @__PURE__ */ jsx(CheckIcon, {})
142
+ }
143
+ );
144
+ }
145
+ return /* @__PURE__ */ jsx(
146
+ "div",
147
+ {
148
+ style: {
149
+ display: "flex",
150
+ alignItems: "center",
151
+ justifyContent: "center",
152
+ minWidth: "18px",
153
+ height: "18px",
154
+ padding: "0 5px",
155
+ borderRadius: "9px",
156
+ backgroundColor: color,
157
+ color: STYLES.text,
158
+ fontSize: "10px",
159
+ fontWeight: 700,
160
+ fontFamily: STYLES.font,
161
+ boxShadow: STYLES.shadow,
162
+ border: `1px solid ${STYLES.border}`
163
+ },
164
+ children: count > 9 ? "9+" : count
165
+ }
166
+ );
167
+ }
168
+ function ScanningBadge() {
169
+ return /* @__PURE__ */ jsxs(
170
+ "div",
171
+ {
172
+ style: {
173
+ display: "flex",
174
+ alignItems: "center",
175
+ justifyContent: "center",
176
+ width: "18px",
177
+ height: "18px",
178
+ borderRadius: "50%",
179
+ backgroundColor: STYLES.bg,
180
+ boxShadow: STYLES.shadow,
181
+ border: `1px solid ${STYLES.border}`
182
+ },
183
+ children: [
184
+ /* @__PURE__ */ jsx("style", { children: `
185
+ @keyframes uilint-badge-spin {
186
+ from { transform: rotate(0deg); }
187
+ to { transform: rotate(360deg); }
188
+ }
189
+ ` }),
190
+ /* @__PURE__ */ jsx(
191
+ "div",
192
+ {
193
+ style: {
194
+ width: "10px",
195
+ height: "10px",
196
+ border: "2px solid rgba(59, 130, 246, 0.3)",
197
+ borderTopColor: "#3B82F6",
198
+ borderRadius: "50%",
199
+ animation: "uilint-badge-spin 0.8s linear infinite"
200
+ }
201
+ }
202
+ )
203
+ ]
204
+ }
205
+ );
206
+ }
207
+ function PendingBadge() {
208
+ return /* @__PURE__ */ jsx(
209
+ "div",
210
+ {
211
+ style: {
212
+ width: "10px",
213
+ height: "10px",
214
+ borderRadius: "50%",
215
+ backgroundColor: "rgba(156, 163, 175, 0.5)",
216
+ boxShadow: STYLES.shadow
217
+ }
218
+ }
219
+ );
220
+ }
221
+ function ErrorBadge() {
222
+ return /* @__PURE__ */ jsx(
223
+ "div",
224
+ {
225
+ style: {
226
+ display: "flex",
227
+ alignItems: "center",
228
+ justifyContent: "center",
229
+ width: "18px",
230
+ height: "18px",
231
+ borderRadius: "50%",
232
+ backgroundColor: STYLES.error,
233
+ boxShadow: STYLES.shadow,
234
+ border: `1px solid ${STYLES.border}`
235
+ },
236
+ children: /* @__PURE__ */ jsx(ExclamationIcon, {})
237
+ }
238
+ );
239
+ }
240
+ var UnionFind = class {
241
+ parent = /* @__PURE__ */ new Map();
242
+ find(x) {
243
+ if (!this.parent.has(x)) {
244
+ this.parent.set(x, x);
245
+ }
246
+ if (this.parent.get(x) !== x) {
247
+ this.parent.set(x, this.find(this.parent.get(x)));
248
+ }
249
+ return this.parent.get(x);
250
+ }
251
+ union(x, y) {
252
+ const px = this.find(x);
253
+ const py = this.find(y);
254
+ if (px !== py) {
255
+ this.parent.set(px, py);
256
+ }
257
+ }
258
+ };
259
+ function clusterBadges(positions, threshold) {
260
+ if (positions.length === 0) return [];
261
+ const uf = new UnionFind();
262
+ for (let i = 0; i < positions.length; i++) {
263
+ for (let j = i + 1; j < positions.length; j++) {
264
+ const dist = Math.hypot(
265
+ positions[i].x - positions[j].x,
266
+ positions[i].y - positions[j].y
267
+ );
268
+ if (dist <= threshold) {
269
+ uf.union(positions[i].element.id, positions[j].element.id);
270
+ }
271
+ }
272
+ }
273
+ const clusters = /* @__PURE__ */ new Map();
274
+ for (const pos of positions) {
275
+ const root = uf.find(pos.element.id);
276
+ if (!clusters.has(root)) {
277
+ clusters.set(root, []);
278
+ }
279
+ clusters.get(root).push(pos);
280
+ }
281
+ return Array.from(clusters.entries()).map(([id, badges]) => {
282
+ const centroidX = badges.reduce((sum, b) => sum + b.x, 0) / badges.length;
283
+ const centroidY = badges.reduce((sum, b) => sum + b.y, 0) / badges.length;
284
+ return { id, badges, centroidX, centroidY };
285
+ });
286
+ }
287
+ function ElementBadges() {
288
+ const { autoScanState, elementIssuesCache, setInspectedElement } = useUILintContext();
289
+ const [mounted, setMounted] = useState(false);
290
+ const [cursorPos, setCursorPos] = useState({ x: 0, y: 0 });
291
+ const [badgePositions, setBadgePositions] = useState([]);
292
+ useEffect(() => {
293
+ setMounted(true);
294
+ }, []);
295
+ useEffect(() => {
296
+ const handleMouseMove = (e) => {
297
+ setCursorPos({ x: e.clientX, y: e.clientY });
298
+ };
299
+ window.addEventListener("mousemove", handleMouseMove);
300
+ return () => window.removeEventListener("mousemove", handleMouseMove);
301
+ }, []);
302
+ useEffect(() => {
303
+ if (autoScanState.status === "idle") {
304
+ setBadgePositions([]);
305
+ return;
306
+ }
307
+ const updatePositions = () => {
308
+ const positions = [];
309
+ for (const element of autoScanState.elements) {
310
+ const issue = elementIssuesCache.get(element.id);
311
+ if (!issue) continue;
312
+ if (!element.element || !document.contains(element.element)) continue;
313
+ const rect = element.element.getBoundingClientRect();
314
+ const x = rect.right - 8;
315
+ const y = rect.top - 8;
316
+ if (rect.top < -50 || rect.top > window.innerHeight + 50) continue;
317
+ if (rect.left < -50 || rect.left > window.innerWidth + 50) continue;
318
+ positions.push({ element, issue, x, y, rect });
319
+ }
320
+ setBadgePositions(positions);
321
+ };
322
+ updatePositions();
323
+ let rafId;
324
+ const loop = () => {
325
+ updatePositions();
326
+ rafId = requestAnimationFrame(loop);
327
+ };
328
+ rafId = requestAnimationFrame(loop);
329
+ return () => cancelAnimationFrame(rafId);
330
+ }, [autoScanState, elementIssuesCache]);
331
+ const handleSelect = useCallback(
332
+ (element, issue) => {
333
+ const inspected = {
334
+ element: element.element,
335
+ source: element.source,
336
+ componentStack: element.componentStack,
337
+ rect: element.element.getBoundingClientRect(),
338
+ scannedElementId: element.id
339
+ };
340
+ setInspectedElement(inspected);
341
+ },
342
+ [setInspectedElement]
343
+ );
344
+ const clusters = useMemo(
345
+ () => clusterBadges(badgePositions, CLUSTER_THRESHOLD),
346
+ [badgePositions]
347
+ );
348
+ if (!mounted) return null;
349
+ if (autoScanState.status === "idle") return null;
350
+ const content = /* @__PURE__ */ jsx("div", { "data-ui-lint": true, children: clusters.map((cluster) => {
351
+ if (cluster.badges.length === 1) {
352
+ const { element, issue, x, y } = cluster.badges[0];
353
+ const distance = Math.hypot(x - cursorPos.x, y - cursorPos.y);
354
+ return /* @__PURE__ */ jsx(
355
+ ElementBadge,
356
+ {
357
+ element,
358
+ issue,
359
+ distance,
360
+ onSelect: handleSelect
361
+ },
362
+ element.id
363
+ );
364
+ } else {
365
+ const distance = Math.hypot(
366
+ cluster.centroidX - cursorPos.x,
367
+ cluster.centroidY - cursorPos.y
368
+ );
369
+ return /* @__PURE__ */ jsx(
370
+ ClusteredBadge,
371
+ {
372
+ cluster,
373
+ distance,
374
+ onSelect: handleSelect
375
+ },
376
+ cluster.id
377
+ );
378
+ }
379
+ }) });
380
+ return createPortal(content, document.body);
381
+ }
382
+ function ClusteredBadge({ cluster, distance, onSelect }) {
383
+ const [isExpanded, setIsExpanded] = useState(false);
384
+ const [hoveredIndex, setHoveredIndex] = useState(null);
385
+ const closeTimeoutRef = React.useRef(null);
386
+ const badgeSegments = useMemo(() => {
387
+ return cluster.badges.map(({ issue }) => {
388
+ if (issue.status === "complete") {
389
+ const count = issue.issues.length;
390
+ return {
391
+ type: "count",
392
+ count,
393
+ color: getBadgeColor(count)
394
+ };
395
+ } else if (issue.status === "error") {
396
+ return { type: "error", color: STYLES.error };
397
+ } else if (issue.status === "scanning") {
398
+ return { type: "scanning", color: STYLES.highlight };
399
+ } else {
400
+ return { type: "pending", color: "rgba(156, 163, 175, 0.5)" };
401
+ }
402
+ });
403
+ }, [cluster.badges]);
404
+ const handleMouseEnter = useCallback(() => {
405
+ if (closeTimeoutRef.current) {
406
+ clearTimeout(closeTimeoutRef.current);
407
+ closeTimeoutRef.current = null;
408
+ }
409
+ setIsExpanded(true);
410
+ }, []);
411
+ const handleMouseLeave = useCallback(() => {
412
+ closeTimeoutRef.current = setTimeout(() => {
413
+ setIsExpanded(false);
414
+ setHoveredIndex(null);
415
+ }, 150);
416
+ }, []);
417
+ const hoveredBadge = hoveredIndex !== null ? cluster.badges[hoveredIndex] : null;
418
+ const dropdownStyle = useMemo(() => {
419
+ const preferRight = cluster.centroidX < window.innerWidth - 200;
420
+ const preferBelow = cluster.centroidY < window.innerHeight - 200;
421
+ return {
422
+ position: "fixed",
423
+ top: preferBelow ? cluster.centroidY + 12 : void 0,
424
+ bottom: preferBelow ? void 0 : window.innerHeight - cluster.centroidY + 12,
425
+ left: preferRight ? cluster.centroidX - 8 : void 0,
426
+ right: preferRight ? void 0 : window.innerWidth - cluster.centroidX - 8,
427
+ zIndex: 1e5,
428
+ backgroundColor: STYLES.bg,
429
+ borderRadius: "8px",
430
+ border: `1px solid ${STYLES.border}`,
431
+ boxShadow: "0 4px 20px rgba(0, 0, 0, 0.4)",
432
+ padding: "4px 0",
433
+ minWidth: "180px",
434
+ fontFamily: STYLES.font
435
+ };
436
+ }, [cluster.centroidX, cluster.centroidY]);
437
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
438
+ hoveredBadge && /* @__PURE__ */ jsx(
439
+ "div",
440
+ {
441
+ style: {
442
+ position: "fixed",
443
+ top: hoveredBadge.rect.top - 2,
444
+ left: hoveredBadge.rect.left - 2,
445
+ width: hoveredBadge.rect.width + 4,
446
+ height: hoveredBadge.rect.height + 4,
447
+ border: `2px solid ${STYLES.highlight}`,
448
+ borderRadius: "4px",
449
+ pointerEvents: "none",
450
+ zIndex: 99994,
451
+ boxShadow: `0 0 0 1px rgba(59, 130, 246, 0.3)`
452
+ },
453
+ "data-ui-lint": true
454
+ }
455
+ ),
456
+ /* @__PURE__ */ jsx(
457
+ "div",
458
+ {
459
+ style: {
460
+ position: "fixed",
461
+ top: cluster.centroidY - 9,
462
+ left: cluster.centroidX - 9,
463
+ zIndex: isExpanded ? 99999 : 99995,
464
+ cursor: "pointer",
465
+ transition: "transform 0.1s ease-out",
466
+ transform: `scale(${isExpanded ? 1.1 : getScaleFromDistance(distance)})`,
467
+ transformOrigin: "center center"
468
+ },
469
+ "data-ui-lint": true,
470
+ onMouseEnter: handleMouseEnter,
471
+ onMouseLeave: handleMouseLeave,
472
+ children: /* @__PURE__ */ jsx(
473
+ "div",
474
+ {
475
+ style: {
476
+ display: "flex",
477
+ alignItems: "center",
478
+ height: "20px",
479
+ borderRadius: "10px",
480
+ backgroundColor: STYLES.bg,
481
+ boxShadow: STYLES.shadow,
482
+ border: `1px solid ${STYLES.border}`,
483
+ overflow: "hidden"
484
+ },
485
+ children: badgeSegments.map((segment, index) => /* @__PURE__ */ jsxs(
486
+ "div",
487
+ {
488
+ style: {
489
+ display: "flex",
490
+ alignItems: "center",
491
+ justifyContent: "center",
492
+ minWidth: "18px",
493
+ height: "100%",
494
+ padding: "0 4px",
495
+ backgroundColor: segment.color,
496
+ borderRight: index < badgeSegments.length - 1 ? `1px solid rgba(0, 0, 0, 0.2)` : void 0
497
+ },
498
+ children: [
499
+ segment.type === "count" && (segment.count === 0 ? /* @__PURE__ */ jsx(CheckIconTiny, {}) : /* @__PURE__ */ jsx(
500
+ "span",
501
+ {
502
+ style: {
503
+ color: STYLES.text,
504
+ fontSize: "10px",
505
+ fontWeight: 700,
506
+ fontFamily: STYLES.font
507
+ },
508
+ children: segment.count > 9 ? "9+" : segment.count
509
+ }
510
+ )),
511
+ segment.type === "error" && /* @__PURE__ */ jsx(ExclamationIconTiny, {}),
512
+ segment.type === "scanning" && /* @__PURE__ */ jsx(
513
+ "div",
514
+ {
515
+ style: {
516
+ width: "8px",
517
+ height: "8px",
518
+ border: "1.5px solid rgba(255, 255, 255, 0.3)",
519
+ borderTopColor: "#FFFFFF",
520
+ borderRadius: "50%",
521
+ animation: "uilint-badge-spin 0.8s linear infinite"
522
+ }
523
+ }
524
+ ),
525
+ segment.type === "pending" && /* @__PURE__ */ jsx(
526
+ "div",
527
+ {
528
+ style: {
529
+ width: "6px",
530
+ height: "6px",
531
+ borderRadius: "50%",
532
+ backgroundColor: "rgba(255, 255, 255, 0.4)"
533
+ }
534
+ }
535
+ )
536
+ ]
537
+ },
538
+ index
539
+ ))
540
+ }
541
+ )
542
+ }
543
+ ),
544
+ isExpanded && /* @__PURE__ */ jsx(
545
+ "div",
546
+ {
547
+ style: dropdownStyle,
548
+ "data-ui-lint": true,
549
+ onMouseEnter: handleMouseEnter,
550
+ onMouseLeave: handleMouseLeave,
551
+ children: cluster.badges.map((badge, index) => /* @__PURE__ */ jsx(
552
+ ClusterDropdownItem,
553
+ {
554
+ badge,
555
+ isHovered: hoveredIndex === index,
556
+ onMouseEnter: () => setHoveredIndex(index),
557
+ onMouseLeave: () => setHoveredIndex(null),
558
+ onClick: () => onSelect(badge.element, badge.issue)
559
+ },
560
+ badge.element.id
561
+ ))
562
+ }
563
+ )
564
+ ] });
565
+ }
566
+ function ClusterDropdownItem({
567
+ badge,
568
+ isHovered,
569
+ onMouseEnter,
570
+ onMouseLeave,
571
+ onClick
572
+ }) {
573
+ const componentName = badge.element.componentStack[0]?.name || badge.element.tagName.toLowerCase();
574
+ const issueCount = badge.issue.status === "complete" ? badge.issue.issues.length : 0;
575
+ const color = getBadgeColor(issueCount);
576
+ return /* @__PURE__ */ jsxs(
577
+ "div",
578
+ {
579
+ style: {
580
+ display: "flex",
581
+ alignItems: "center",
582
+ justifyContent: "space-between",
583
+ padding: "8px 12px",
584
+ cursor: "pointer",
585
+ backgroundColor: isHovered ? "rgba(59, 130, 246, 0.15)" : "transparent",
586
+ transition: "background-color 0.1s"
587
+ },
588
+ onMouseEnter,
589
+ onMouseLeave,
590
+ onClick,
591
+ children: [
592
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
593
+ /* @__PURE__ */ jsx(
594
+ "div",
595
+ {
596
+ style: {
597
+ width: "6px",
598
+ height: "6px",
599
+ borderRadius: "50%",
600
+ backgroundColor: color
601
+ }
602
+ }
603
+ ),
604
+ /* @__PURE__ */ jsx(
605
+ "span",
606
+ {
607
+ style: {
608
+ fontSize: "12px",
609
+ color: STYLES.text,
610
+ maxWidth: "120px",
611
+ overflow: "hidden",
612
+ textOverflow: "ellipsis",
613
+ whiteSpace: "nowrap"
614
+ },
615
+ children: componentName
616
+ }
617
+ )
618
+ ] }),
619
+ badge.issue.status === "complete" && (issueCount === 0 ? /* @__PURE__ */ jsx(
620
+ "div",
621
+ {
622
+ style: {
623
+ width: "14px",
624
+ height: "14px",
625
+ borderRadius: "50%",
626
+ backgroundColor: color,
627
+ display: "flex",
628
+ alignItems: "center",
629
+ justifyContent: "center"
630
+ },
631
+ children: /* @__PURE__ */ jsx(CheckIcon, {})
632
+ }
633
+ ) : /* @__PURE__ */ jsx(
634
+ "div",
635
+ {
636
+ style: {
637
+ minWidth: "16px",
638
+ height: "16px",
639
+ padding: "0 4px",
640
+ borderRadius: "8px",
641
+ backgroundColor: color,
642
+ color: STYLES.text,
643
+ fontSize: "10px",
644
+ fontWeight: 700,
645
+ display: "flex",
646
+ alignItems: "center",
647
+ justifyContent: "center"
648
+ },
649
+ children: issueCount > 9 ? "9+" : issueCount
650
+ }
651
+ )),
652
+ badge.issue.status === "scanning" && /* @__PURE__ */ jsx(
653
+ "div",
654
+ {
655
+ style: {
656
+ width: "12px",
657
+ height: "12px",
658
+ border: "2px solid rgba(59, 130, 246, 0.3)",
659
+ borderTopColor: STYLES.highlight,
660
+ borderRadius: "50%",
661
+ animation: "uilint-badge-spin 0.8s linear infinite"
662
+ }
663
+ }
664
+ ),
665
+ badge.issue.status === "error" && /* @__PURE__ */ jsx(
666
+ "div",
667
+ {
668
+ style: {
669
+ width: "14px",
670
+ height: "14px",
671
+ borderRadius: "50%",
672
+ backgroundColor: STYLES.error,
673
+ display: "flex",
674
+ alignItems: "center",
675
+ justifyContent: "center"
676
+ },
677
+ children: /* @__PURE__ */ jsx(ExclamationIcon, {})
678
+ }
679
+ ),
680
+ badge.issue.status === "pending" && /* @__PURE__ */ jsx(
681
+ "div",
682
+ {
683
+ style: {
684
+ width: "8px",
685
+ height: "8px",
686
+ borderRadius: "50%",
687
+ backgroundColor: "rgba(156, 163, 175, 0.5)"
688
+ }
689
+ }
690
+ )
691
+ ]
692
+ }
693
+ );
694
+ }
695
+ function CheckIcon() {
696
+ return /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
697
+ "path",
698
+ {
699
+ d: "M20 6L9 17l-5-5",
700
+ stroke: STYLES.text,
701
+ strokeWidth: "3",
702
+ strokeLinecap: "round",
703
+ strokeLinejoin: "round"
704
+ }
705
+ ) });
706
+ }
707
+ function CheckIconTiny() {
708
+ return /* @__PURE__ */ jsx("svg", { width: "8", height: "8", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
709
+ "path",
710
+ {
711
+ d: "M20 6L9 17l-5-5",
712
+ stroke: STYLES.text,
713
+ strokeWidth: "4",
714
+ strokeLinecap: "round",
715
+ strokeLinejoin: "round"
716
+ }
717
+ ) });
718
+ }
719
+ function ExclamationIconTiny() {
720
+ return /* @__PURE__ */ jsx("svg", { width: "8", height: "8", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
721
+ "path",
722
+ {
723
+ d: "M12 8v4M12 16h.01",
724
+ stroke: STYLES.text,
725
+ strokeWidth: "4",
726
+ strokeLinecap: "round",
727
+ strokeLinejoin: "round"
728
+ }
729
+ ) });
730
+ }
731
+ function ExclamationIcon() {
732
+ return /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ jsx(
733
+ "path",
734
+ {
735
+ d: "M12 8v4M12 16h.01",
736
+ stroke: STYLES.text,
737
+ strokeWidth: "3",
738
+ strokeLinecap: "round",
739
+ strokeLinejoin: "round"
740
+ }
741
+ ) });
742
+ }
743
+ export {
744
+ ElementBadges
745
+ };