kyd-shared-badge 0.1.17 → 0.1.20
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 +1 -1
- package/src/SharedBadgeDisplay.tsx +14 -11
- package/src/colors.ts +4 -25
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import AppendixTables from './components/AppendixTables';
|
|
|
10
10
|
import ProviderInsights from './components/ProviderInsights';
|
|
11
11
|
import IpRiskAnalysisDisplay from './components/IpRiskAnalysisDisplay';
|
|
12
12
|
import Image from 'next/image';
|
|
13
|
+
import { red, yellow, green } from './colors';
|
|
13
14
|
|
|
14
15
|
// Icon images from this package's public folder (will be bundled as assets)
|
|
15
16
|
import RiskGreen from './public/riskgreen.png';
|
|
@@ -23,9 +24,9 @@ import AiYellow from './public/aiyellow.png';
|
|
|
23
24
|
import AiRed from './public/aired.png';
|
|
24
25
|
|
|
25
26
|
const getScoreColor = (score: number) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
if (score >= 80) return green;
|
|
28
|
+
if (score >= 65) return yellow;
|
|
29
|
+
return red;
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
const getRiskText = (risk: number) => {
|
|
@@ -72,7 +73,9 @@ interface ScoreCardProps {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
const ScoreCard = ({ title, score, description, descriptor, icon: Icon, scoreType, isRecruiter = false, iconImageSrc }: ScoreCardProps) => {
|
|
75
|
-
const
|
|
76
|
+
const isDescriptor = scoreType === 'descriptor';
|
|
77
|
+
const scoreHex = isDescriptor ? undefined : getScoreColor(score);
|
|
78
|
+
const scoreClass = isDescriptor ? 'text-neutral-400' : '';
|
|
76
79
|
let displayScore;
|
|
77
80
|
|
|
78
81
|
if (scoreType === 'risk') {
|
|
@@ -92,7 +95,7 @@ const ScoreCard = ({ title, score, description, descriptor, icon: Icon, scoreTyp
|
|
|
92
95
|
}
|
|
93
96
|
style={isRecruiter ? { backgroundColor: 'var(--content-card-background)', borderColor: 'var(--icon-button-secondary)' } : undefined}
|
|
94
97
|
>
|
|
95
|
-
<div className={`text-3xl mb-4 ${
|
|
98
|
+
<div className={`text-3xl mb-4 ${scoreClass}`} style={scoreHex ? { color: scoreHex } : undefined}>
|
|
96
99
|
{iconImageSrc ? (
|
|
97
100
|
// eslint-disable-next-line @next/next/no-img-element
|
|
98
101
|
<Image src={iconImageSrc} alt="icon" className="h-8 w-8 object-contain" />
|
|
@@ -100,8 +103,8 @@ const ScoreCard = ({ title, score, description, descriptor, icon: Icon, scoreTyp
|
|
|
100
103
|
<Icon />
|
|
101
104
|
)}
|
|
102
105
|
</div>
|
|
103
|
-
<h3 className={`font-semibold text-xl ${
|
|
104
|
-
<p className={`text-4xl font-bold ${
|
|
106
|
+
<h3 className={`font-semibold text-xl ${isDescriptor ? 'text-neutral-400' : ''}`} style={isRecruiter ? { color: 'var(--text-main)' } : undefined}>{title}</h3>
|
|
107
|
+
<p className={`text-4xl font-bold ${scoreClass}`} style={scoreHex ? { color: scoreHex } : undefined}>{displayScore}</p>
|
|
105
108
|
<p className={isRecruiter ? 'text-sm mt-4' : 'text-sm text-neutral-600 dark:text-neutral-400 mt-4'} style={isRecruiter ? { color: 'var(--text-secondary)' } : undefined}>{description}</p>
|
|
106
109
|
</div>
|
|
107
110
|
);
|
|
@@ -217,14 +220,14 @@ const SharedBadgeDisplay = ({ badgeData, type = 'individual' }: { badgeData: Pub
|
|
|
217
220
|
<div className="pt-8">
|
|
218
221
|
<h3 className={isRecruiter ? 'text-xl font-bold mb-3' : 'text-xl font-bold text-neutral-900 dark:text-white mb-3'} style={isRecruiter ? { color: 'var(--text-main)' } : undefined}>3. KYD Risk™ Signals</h3>
|
|
219
222
|
{badgeData.optOutScreening ? (
|
|
220
|
-
<div className={isRecruiter ? 'mb-4 p-4 rounded-lg border' : 'mb-4 p-4
|
|
223
|
+
<div className={isRecruiter ? 'mb-4 p-4 rounded-lg border' : 'mb-4 p-4 rounded-lg border'} style={isRecruiter ? { backgroundColor: 'var(--icon-button-secondary)', borderColor: 'var(--icon-button-secondary)' } : { backgroundColor: '#FFF7E6', borderColor: yellow }}>
|
|
221
224
|
<div className="flex items-start">
|
|
222
|
-
<span className="h-5 w-5
|
|
225
|
+
<span className="h-5 w-5 mr-3 mt-0.5 flex-shrink-0" style={{ color: yellow }}>
|
|
223
226
|
<FiAlertTriangle size={20} />
|
|
224
227
|
</span>
|
|
225
228
|
<div>
|
|
226
|
-
<h4 className={
|
|
227
|
-
<p className={
|
|
229
|
+
<h4 className={'font-bold'} style={isRecruiter ? { color: 'var(--text-main)' } : { color: yellow }}>User Opted Out of Screening</h4>
|
|
230
|
+
<p className={'text-sm mt-1'} style={isRecruiter ? { color: 'var(--text-secondary)' } : { color: yellow }}>
|
|
228
231
|
The user chose not to participate in the automated sanctions and risk screening process. The risk score reflects this decision and is for informational purposes only.
|
|
229
232
|
</p>
|
|
230
233
|
</div>
|
package/src/colors.ts
CHANGED
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
'#F5B7B3',
|
|
5
|
-
'#FADBDA',
|
|
6
|
-
'#FDF0EF',
|
|
7
|
-
]
|
|
1
|
+
const red = '#EC6662'
|
|
2
|
+
const yellow = '#ffbb54'
|
|
3
|
+
const green = '#49a08a'
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
const yellowColors = [
|
|
11
|
-
'#FADBDA',
|
|
12
|
-
'#F2CA8C',
|
|
13
|
-
'#F9DFB6',
|
|
14
|
-
'#FDEFDB',
|
|
15
|
-
'#FEF9F0',
|
|
16
|
-
]
|
|
17
|
-
|
|
18
|
-
const greenColors = [
|
|
19
|
-
'#48A08A',
|
|
20
|
-
'#7BB9AA',
|
|
21
|
-
'#A5CCC2',
|
|
22
|
-
'#D5E8E2',
|
|
23
|
-
'#EEF6F4',
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
export { redColors, yellowColors, greenColors }
|
|
5
|
+
export { red, yellow, green }
|