kyd-shared-badge 0.3.101 → 0.3.102

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.101",
3
+ "version": "0.3.102",
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.6",
24
+ "@knowyourdeveloper/react-bubble-chart": "^1.0.7",
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",
@@ -224,6 +224,7 @@ const SharedBadgeDisplay = ({ badgeData, chatProps, headless }: { badgeData: Pub
224
224
  countries={(assessmentResult?.screening_sources?.ip_risk_analysis?.raw_data?.countries) || []}
225
225
  accountAuthenticity={assessmentResult?.account_authenticity}
226
226
  companyName={badgeData.companyName}
227
+ sourcesProviders={(badgeData?.connectedAccounts || []).map(a => (a?.name || '').toLowerCase())}
227
228
  />
228
229
  </div>
229
230
  {/* Top-right: Role match section */}
@@ -97,8 +97,11 @@ export default function GaugeCard({
97
97
  labels={{
98
98
  valueLabel: {
99
99
  // Hide center text; show tier labels around the arc instead
100
- formatTextValue: () => '',
100
+ formatTextValue: () => displayLabel,
101
101
  matchColorWithArc: true,
102
+ style: {
103
+ textShadow: 'none'
104
+ }
102
105
  },
103
106
  tickLabels: tickLabels,
104
107
  }}
@@ -5,6 +5,7 @@ import { formatLocalDate } from '../utils/date';
5
5
  import countriesLib from 'i18n-iso-countries';
6
6
  import enLocale from 'i18n-iso-countries/langs/en.json';
7
7
  import { FiInfo, FiAlertTriangle } from 'react-icons/fi';
8
+ import { ProviderIcon } from '../utils/provider';
8
9
 
9
10
  // Register English locale once at module import time
10
11
  countriesLib.registerLocale(enLocale);
@@ -41,13 +42,28 @@ interface ReportHeaderProps {
41
42
  countries?: string[];
42
43
  accountAuthenticity?: { label?: string; description?: string };
43
44
  companyName?: string;
45
+ sourcesProviders?: string[];
44
46
  }
45
47
 
46
- const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImageUrl, summary, enterpriseMatch, countries = [], accountAuthenticity, companyName }: ReportHeaderProps) => {
48
+ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImageUrl, summary, enterpriseMatch, countries = [], accountAuthenticity, companyName, sourcesProviders = [] }: ReportHeaderProps) => {
47
49
  // Use the dynamic image if available, otherwise fall back to the score-based one.
48
50
  const finalBadgeImageUrl = badgeImageUrl || getBadgeImageUrl(score || 0);
49
51
  const tint = hexToRgba(pickTint(score || 0), 0.06);
50
52
  const matchLabel = enterpriseMatch?.label;
53
+ const sources = (() => {
54
+ const primary = Array.isArray(sourcesProviders) ? sourcesProviders : [];
55
+ // Fallback to authenticity oauth list if no explicit sources provided
56
+ const fallback = (accountAuthenticity as any)?.oauth_connected as string[] | undefined;
57
+ const combined = (primary && primary.length ? primary : (fallback || [])).filter(Boolean);
58
+ // Deduplicate while preserving order
59
+ const seen: Record<string, boolean> = {};
60
+ return combined.filter((n) => {
61
+ const key = (n || '').toLowerCase();
62
+ if (seen[key]) return false;
63
+ seen[key] = true;
64
+ return true;
65
+ });
66
+ })();
51
67
 
52
68
  return (
53
69
  <div
@@ -111,6 +127,20 @@ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImage
111
127
  );
112
128
  })()
113
129
  )}
130
+ {sources.length > 0 && (
131
+ <p className={'flex items-center gap-2 mt-2'}>
132
+ <a href="#appendix-connected" className={'inline-flex items-center gap-2 group'} style={{ color: 'var(--text-secondary)' }}>
133
+ <span className={'font-semibold'}>Sources:</span>
134
+ <span className={'flex items-center gap-2'}>
135
+ {sources.map((provider, idx) => (
136
+ <span key={`${provider}-${idx}`} className={'text-sm'} style={{ color: 'var(--text-main)' }}>
137
+ <ProviderIcon name={provider} className={'inline-block align-middle'} />
138
+ </span>
139
+ ))}
140
+ </span>
141
+ </a>
142
+ </p>
143
+ )}
114
144
  </div>
115
145
  {(enterpriseMatch?.description || matchLabel) ? (
116
146
  <div className={'hidden md:block text-sm space-y-2 pt-4'} style={{ borderTop: '1px solid var(--icon-button-secondary)' }}>
@@ -45,7 +45,7 @@ export default function RoleOverviewCard({
45
45
  }
46
46
  },
47
47
  ticks: [
48
- { value: 0, valueConfig: { formatTextValue: () => 'Incompatible' } },
48
+ { value: 0, valueConfig: { formatTextValue: () => 'Very Weak' } }, // Incompatible is too long, gets cut off
49
49
  { value: 25, valueConfig: { formatTextValue: () => 'Weak' } },
50
50
  { value: 50, valueConfig: { formatTextValue: () => 'Partial' } },
51
51
  { value: 75, valueConfig: { formatTextValue: () => 'Strong' } },
@@ -55,14 +55,14 @@ export default function RoleOverviewCard({
55
55
 
56
56
  return (
57
57
  <div
58
- className={'rounded-md p-5 border flex flex-col h-full'}
58
+ className={'rounded-md border flex flex-col h-full'}
59
59
  style={{
60
60
  backgroundColor: 'var(--content-card-background)',
61
61
  borderColor: 'var(--icon-button-secondary)',
62
62
  backgroundImage: `linear-gradient(${headerTint}, ${headerTint})`,
63
63
  }}
64
64
  >
65
- <div className="mb-3 flex items-start justify-between gap-2">
65
+ <div className="mb-3 px-5 pt-5 flex items-start justify-between gap-2">
66
66
  <div>
67
67
  <div className={'font-semibold'} style={{ color: 'var(--text-main)' }}>{title}</div>
68
68
  <div className={'text-xs mt-1'} style={{ color: 'var(--text-secondary)' }}>How well the candidate aligns with the target role based on KYD evidence.</div>
@@ -77,8 +77,8 @@ export default function RoleOverviewCard({
77
77
  </div>
78
78
  </span>
79
79
  </div>
80
- <div className="flex-grow flex flex-col items-center justify-center" style={{ minHeight: 200 }}>
81
- <div className="relative" style={{ width: '100%', aspectRatio: '2 / 1', maxWidth: 360 }}>
80
+ <div className="flex-grow flex flex-col items-center justify-center pb-5" style={{ minHeight: 200 }}>
81
+ <div className="relative group" style={{ width: '100%', aspectRatio: '2 / 1', maxWidth: 390 }}>
82
82
  <GaugeComponent
83
83
  type="semicircle"
84
84
  style={{ width: 'calc(100% - 16px)', height: '100%', marginLeft: 8, marginRight: 8 }}
@@ -90,6 +90,9 @@ export default function RoleOverviewCard({
90
90
  valueLabel: {
91
91
  formatTextValue: () => displayLabel,
92
92
  matchColorWithArc: true,
93
+ style: {
94
+ textShadow: 'none'
95
+ }
93
96
  },
94
97
  tickLabels: tickLabels,
95
98
  }}