kyd-shared-badge 0.3.97 → 0.3.98

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kyd-shared-badge",
3
- "version": "0.3.97",
3
+ "version": "0.3.98",
4
4
  "private": false,
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -21,7 +21,7 @@
21
21
  "@aws-sdk/lib-dynamodb": "^3.893.0",
22
22
  "@chatscope/chat-ui-kit-react": "^2.1.1",
23
23
  "@chatscope/chat-ui-kit-styles": "^1.4.0",
24
- "@knowyourdeveloper/react-bubble-chart": "^1.0.5",
24
+ "@knowyourdeveloper/react-bubble-chart": "^1.0.6",
25
25
  "@knowyourdeveloper/react-gauge-component": "^1.1.30",
26
26
  "@radix-ui/react-slot": "^1.2.3",
27
27
  "@radix-ui/react-tooltip": "^1.2.8",
@@ -291,10 +291,11 @@ const SharedBadgeDisplay = ({ badgeData, chatProps, headless }: { badgeData: Pub
291
291
  <SkillsBubble skillsCategoryRadar={graphInsights?.skillsCategoryRadar} headless={isHeadless} skillsByCategory={assessmentResult?.graph_insights?.skillsByCategory} skillsMeta={assessmentResult?.graph_insights?.skillsMeta} />
292
292
  </div>
293
293
  </Reveal>
294
- <div className={'pt-6 text-sm text-center'} style={{ color: 'var(--text-secondary)' }}>
294
+
295
+ </div>
296
+ <div className={'pt-6 text-sm text-center'} style={{ color: 'var(--text-secondary)' }}>
295
297
  Report Completed: {formatLocalDateTime(updatedAt)}
296
298
  </div>
297
- </div>
298
299
  </div>
299
300
  );
300
301
 
@@ -57,6 +57,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
57
57
  const legendRef = useRef<HTMLDivElement>(null);
58
58
  const [legendTooltip, setLegendTooltip] = useState<HoverTooltipState>(null);
59
59
  const [activeCategory, setActiveCategory] = useState<string | null>(null);
60
+ const [legendHovered, setLegendHovered] = useState<boolean>(false);
60
61
  useEffect(() => {
61
62
  if (typeof window !== 'undefined') {
62
63
  const id = window.setTimeout(() => {
@@ -114,9 +115,10 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
114
115
  _id: String(b.label || ''),
115
116
  value: Number(b.value || 0),
116
117
  displayText: String(b.label || ''),
117
- colorValue: Number(b.data?.experience || 0)
118
+ colorValue: Number(b.data?.experience || 0),
119
+ selected: legendHovered && !!activeCategory && String(b.label || '') === String(activeCategory)
118
120
  }));
119
- }, [bubbles]);
121
+ }, [bubbles, legendHovered, activeCategory]);
120
122
 
121
123
  const colorLegend = useMemo(() => {
122
124
  return [green5, green4, green3, green2, green1];
@@ -215,7 +217,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
215
217
  <div className="flex flex-col min-w-0 justify-center">
216
218
  <div className="flex items-center gap-2 min-w-0 text-lg text-[var(--text-main)]">
217
219
  <span className={'inline-block h-2 w-2 rounded-full'} style={{ backgroundColor: entry ? 'var(--icon-button-secondary)' : 'transparent', flexShrink: 0 }} />
218
- <span className="shrink-0 opacity-70">{idx + (isLeft ? 1 : 6)}.</span>
220
+ <span className="shrink-0 opacity-70 ">{idx + (isLeft ? 1 : 6)}.</span>
219
221
  {entry && typeof entry !== 'string' ? (
220
222
  <span className="truncate" title={entry.label}>{entry.label}</span>
221
223
  ) : (
@@ -254,7 +256,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
254
256
  </div>
255
257
  {entry && typeof entry !== 'string' ? (
256
258
  <div className="flex flex-col items-end leading-tight h-full justify-between text-base">
257
- {entry.years ? <span className="whitespace-nowrap text-[var(--text-main)]">{`${entry.years} Years`}</span> : <span className="opacity-0 whitespace-nowrap text-[var(--text-main)]">0 Years</span>}
259
+ {entry.years ? <span className="whitespace-nowrap text-[var(--text-secondary)]">{`${entry.years} Years`}</span> : <span className="opacity-0 whitespace-nowrap text-[var(--text-secondary)]">0 Years</span>}
258
260
  {entry.presence ? (
259
261
  <div className="flex items-center gap-1">
260
262
  <span className="inline-block h-2 w-2 rounded-full text-sm" style={{ background: presenceColor(entry.presence) }} />
@@ -340,7 +342,13 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
340
342
  />
341
343
  </div>
342
344
  <div className='mt-8'>
343
- <div ref={legendRef} className={'kyd-avoid-break'} style={{ position: 'relative', breakInside: 'avoid', pageBreakInside: 'avoid' as unknown as undefined }}>
345
+ <div
346
+ ref={legendRef}
347
+ className={'kyd-avoid-break'}
348
+ style={{ position: 'relative', breakInside: 'avoid', pageBreakInside: 'avoid' as unknown as undefined }}
349
+ onMouseEnter={() => setLegendHovered(true)}
350
+ onMouseLeave={() => setLegendHovered(false)}
351
+ >
344
352
  <div className="mb-2 text-xs font-medium" style={{ color: 'var(--text-main)' }}>
345
353
 
346
354
  {activeCategory ? (