kyd-shared-badge 0.3.104 → 0.3.106

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.104",
3
+ "version": "0.3.106",
4
4
  "private": false,
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -34,7 +34,7 @@ export default function GaugeCard({
34
34
  // Technical evidence tiers from backend thresholds
35
35
  const tickLabels = useMemo(() => ({
36
36
  type: 'outer' as const,
37
- hideMinMax: false,
37
+ hideMinMax: true,
38
38
  defaultTickLineConfig: {
39
39
  length: 7,
40
40
  width: 1,
@@ -48,11 +48,9 @@ export default function GaugeCard({
48
48
  }
49
49
  },
50
50
  ticks: [
51
- { value: 0, valueConfig: { formatTextValue: () => 'Very Low' } },
52
- { value: 25, valueConfig: { formatTextValue: () => 'Low' } },
51
+ { value: 16, valueConfig: { formatTextValue: () => 'Low' } },
53
52
  { value: 50, valueConfig: { formatTextValue: () => 'Moderate' } },
54
- { value: 75, valueConfig: { formatTextValue: () => 'High' } },
55
- { value: 100, valueConfig: { formatTextValue: () => 'Very High' } },
53
+ { value: 83, valueConfig: { formatTextValue: () => 'High' } },
56
54
  ]
57
55
  }), []);
58
56
 
@@ -4,7 +4,7 @@ import React, { useMemo, useRef, useState, useEffect } from 'react';
4
4
  import { BubbleChart } from '@knowyourdeveloper/react-bubble-chart';
5
5
  import '@knowyourdeveloper/react-bubble-chart/style.css';
6
6
  import { green1, green2, green3, green4, green5 } from '../colors';
7
- import { ProviderIcon } from '../utils/provider';
7
+ import { ProviderIcon, getProviderDisplayName } from '../utils/provider';
8
8
  import { providers } from '../types';
9
9
 
10
10
  type SkillsRadarPoint = {
@@ -21,7 +21,7 @@ type HoverTooltipState = {
21
21
  visible: boolean;
22
22
  x: number;
23
23
  y: number;
24
- title: string;
24
+ title?: string;
25
25
  body?: React.ReactNode;
26
26
  } | null;
27
27
 
@@ -43,7 +43,7 @@ const TooltipBox = ({ state }: { state: HoverTooltipState }) => {
43
43
  maxWidth: 320,
44
44
  }}
45
45
  >
46
- <div className="font-medium" style={{ color: 'var(--text-main)' }}>{state.title}</div>
46
+ {state.title ? <div className="font-medium mb-1" style={{ color: 'var(--text-main)' }}>{state.title}</div> : null}
47
47
  {state.body ? (
48
48
  <div style={{ color: 'var(--text-secondary)' }}>{state.body}</div>
49
49
  ) : null}
@@ -80,7 +80,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
80
80
  const y = rect.bottom - hostRect.top + 6;
81
81
  return { x, y };
82
82
  };
83
- const showLegendTooltipAt = (target: EventTarget | null, title: string, body?: React.ReactNode) => {
83
+ const showLegendTooltipAt = (target: EventTarget | null, title?: string, body?: React.ReactNode) => {
84
84
  if (!(target instanceof HTMLElement)) return;
85
85
  const { x, y } = computeTooltipPosition(target);
86
86
  setLegendTooltip({ visible: true, x, y, title, body });
@@ -213,7 +213,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
213
213
  return 'var(--icon-button-secondary)';
214
214
  };
215
215
 
216
- const presenceLegendTooltip = (): { title: string; body: React.ReactNode } => {
216
+ const presenceLegendTooltip = (): { body: React.ReactNode } => {
217
217
  const Row = ({ color, label }: { color: string; label: string }) => (
218
218
  <div className="flex items-center gap-2">
219
219
  <span className="inline-block h-2 w-2 rounded-full" style={{ background: color }} />
@@ -221,7 +221,6 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
221
221
  </div>
222
222
  );
223
223
  return {
224
- title: 'Presence types',
225
224
  body: (
226
225
  <div className="grid gap-1">
227
226
  <Row color={presenceColor('certified')} label="Certified — Verified by credential issuers." />
@@ -255,8 +254,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
255
254
  <div key={idx} className="flex items-stretch justify-between gap-3 min-w-0">
256
255
  <div className="flex flex-col min-w-0 justify-center">
257
256
  <div className="flex items-center gap-2 min-w-0 text-lg text-[var(--text-main)]">
258
- <span className={'inline-block h-2 w-2 rounded-full'} style={{ backgroundColor: entry ? 'var(--icon-button-secondary)' : 'transparent', flexShrink: 0 }} />
259
- <span className="shrink-0 opacity-70 ">{idx + (isLeft ? 1 : 6)}.</span>
257
+ {entry ? <span className="shrink-0 opacity-70 ">{idx + (isLeft ? 1 : 6)}.</span> : <span className="opacity-0 whitespace-nowrap">\u00A0</span>}
260
258
  {entry && typeof entry !== 'string' ? (
261
259
  <span className="truncate" title={entry.label}>
262
260
  {entry.label}
@@ -292,12 +290,12 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
292
290
  {entry && typeof entry !== 'string' ? (
293
291
  <>
294
292
  <span
295
- className="underline decoration-dotted underline-offset-2 cursor-help"
293
+ className="cursor-help"
296
294
  onMouseEnter={(e) => showLegendTooltipAt(e.currentTarget, 'Sources', 'The source where we observed this skill.')}
297
295
  onMouseLeave={hideLegendTooltip}
298
296
  >
299
- Sources
300
- </span>:
297
+ Sources:
298
+ </span>
301
299
  {Array.isArray((entry as any).sources) && (entry as any).sources.length > 0 ? (
302
300
  (() => {
303
301
  const sourceProviders: string[] = ((entry as any).sources as string[]).map((src: string) => {
@@ -314,7 +312,20 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
314
312
  providers.includes(provider.toLowerCase())
315
313
  );
316
314
  return filteredProviders.map((provider) => (
317
- <ProviderIcon key={provider} name={provider} />
315
+ <span
316
+ key={provider}
317
+ onMouseEnter={(e) =>
318
+ showLegendTooltipAt(
319
+ e.currentTarget,
320
+ undefined,
321
+ getProviderDisplayName(provider)
322
+ )
323
+ }
324
+ onMouseLeave={hideLegendTooltip}
325
+ className="inline-flex items-center"
326
+ >
327
+ <ProviderIcon name={provider} />
328
+ </span>
318
329
  ));
319
330
  })()
320
331
  ) : null}
@@ -331,7 +342,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
331
342
  <div className="pb-1">
332
343
  {entry.years ? (
333
344
  <span
334
- className="whitespace-nowrap text-[var(--text-secondary)] underline decoration-dotted underline-offset-2 cursor-help"
345
+ className="whitespace-nowrap text-[var(--text-secondary)] cursor-help"
335
346
  onMouseEnter={(e) => {
336
347
  const copy = experienceLegendTooltip();
337
348
  showLegendTooltipAt(e.currentTarget, copy.title, copy.body);
@@ -347,12 +358,12 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
347
358
  <div
348
359
  onMouseEnter={(e) => {
349
360
  const copy = presenceLegendTooltip();
350
- showLegendTooltipAt(e.currentTarget, copy.title, copy.body);
361
+ showLegendTooltipAt(e.currentTarget, undefined, copy.body);
351
362
  }}
352
363
  onMouseLeave={hideLegendTooltip}
353
364
  className="pt-1"
354
365
  >
355
- {(() => {
366
+ {(() => {
356
367
  const types = Array.isArray(entry.presenceTypes) ? entry.presenceTypes : (entry.presence ? [String(entry.presence) as any] : []);
357
368
  const hasAny = types.length > 0;
358
369
  return hasAny ? (
@@ -366,6 +377,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
366
377
  </div>
367
378
  ) : <span className="opacity-0 whitespace-nowrap">.</span>;
368
379
  })()}
380
+
369
381
  </div>
370
382
  </div>
371
383
  ) : null}
@@ -448,7 +460,7 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
448
460
 
449
461
  {activeCategory ? (
450
462
  <span
451
- className="ml-1 underline decoration-dotted underline-offset-2 cursor-help"
463
+ className="ml-1 cursor-help"
452
464
  onMouseEnter={(e) =>
453
465
  showLegendTooltipAt(
454
466
  e.currentTarget,
@@ -462,13 +474,13 @@ export default function SkillsBubble({ skillsCategoryRadar, skillsByCategory, sk
462
474
  </span>
463
475
  ) : null}
464
476
  </div>
465
- <div className="grid grid-cols-2 gap-x-4 text-xs" style={{ color: 'var(--text-secondary)', minHeight: 250 }}>
466
- <div className="grid gap-2">
477
+ <div className="grid grid-cols-2 gap-x-8 text-xs" style={{ color: 'var(--text-secondary)', minHeight: 250 }}>
478
+ <div className="grid gap-3">
467
479
  {leftColumnGrid.map((entry, idx) => (
468
480
  columnComponent(entry, idx, true)
469
481
  ))}
470
482
  </div>
471
- <div className="grid gap-2">
483
+ <div className="grid gap-3">
472
484
  {rightColumnGrid.map((entry, idx) => (
473
485
  columnComponent(entry, idx, false)
474
486
  ))}