kyd-shared-badge 0.3.125 → 0.3.127

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.125",
3
+ "version": "0.3.127",
4
4
  "private": false,
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -217,7 +217,7 @@ const SharedBadgeDisplay = ({ badgeData, chatProps, headless, selfCheck = false,
217
217
  {/* Quadrant layout */}
218
218
  <div className={'grid grid-cols-1 md:grid-cols-2 gap-6'}>
219
219
  {/* Top-left: Name, countries, badge image handled by ReportHeader */}
220
- <div className={`${hasEnterpriseMatch ? '' : 'md:col-span-2'}`}>
220
+ <div className={`${hasEnterpriseMatch ? 'h-full' : 'md:col-span-2'}`}>
221
221
  <ReportHeader
222
222
  badgeId={badgeId}
223
223
  developerName={badgeData.developerName}
@@ -77,7 +77,7 @@ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImage
77
77
 
78
78
  return (
79
79
  <div
80
- className={'p-6 rounded-md border'}
80
+ className={'p-6 rounded-md border h-full'}
81
81
  style={{ backgroundColor: 'var(--content-card-background)', borderColor: 'var(--icon-button-secondary)', backgroundImage: `linear-gradient(${tint}, ${tint})` }}
82
82
  >
83
83
  {(() => {
@@ -99,7 +99,7 @@ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImage
99
99
  </div>
100
100
  );
101
101
  })()}
102
- <div className={`flex gap-3 ${rightBadgeLayout ? 'flex-row items-center justify-between' : 'flex-col'}`}>
102
+ <div className={`flex gap-3 ${rightBadgeLayout ? 'flex-row items-center justify-between' : 'flex-col h-full'}`}>
103
103
  {/* Info section: Title, Candidate, Details and Summary */}
104
104
  <div className={`w-full ${rightBadgeLayout ? 'md:flex-1' : ''}`}>
105
105
  <div className='space-y-1'>
@@ -139,7 +139,7 @@ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImage
139
139
  {sources.length > 0 && (
140
140
  <p className='flex items-center gap-2 mt-2 text-sm'>
141
141
  <a href="#appendix-connected" className={'inline-flex items-center gap-2 group'} style={{ color: 'var(--text-secondary)' }}>
142
- <span className={'font-semibold'}>Sources:</span>
142
+ <span className={'font-semibold'}>Sources Shared:</span>
143
143
  <span className={'flex items-center gap-2'}>
144
144
  {sources.map((provider, idx) => (
145
145
  <span key={`${provider}-${idx}`} className={'text-sm'} style={{ color: 'var(--text-main)' }}>
@@ -187,8 +187,8 @@ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImage
187
187
  </div>
188
188
 
189
189
  {/* Badge Image with robust centered overlay */}
190
- <div className={`flex items-center ${rightBadgeLayout ? 'md:justify-end h-20' : 'justify-center w-full mt-4'} `}>
191
- <div className={`relative w-full ${rightBadgeLayout ? 'max-w-[85px]' : 'px-28'} select-none`}>
190
+ <div className={`flex items-center ${rightBadgeLayout ? 'md:justify-end h-20' : 'justify-center w-full h-full mt-4'} `}>
191
+ <div className={`relative w-full ${rightBadgeLayout ? 'max-w-[85px]' : 'px-24 sm:px-6 lg:px-12 xl:px-28'} select-none`}>
192
192
  <Image
193
193
  src={finalBadgeImageUrl}
194
194
  alt="KYD Badge"
@@ -198,7 +198,7 @@ const ReportHeader = ({ badgeId, developerName, updatedAt, score = 0, badgeImage
198
198
  className='w-full h-auto pointer-events-none'
199
199
  />
200
200
  <div className={`pointer-events-none absolute left-1/2 -translate-x-1/2 -translate-y-1/2 ${rightBadgeLayout ? 'top-[72%]' : 'top-[69%]'}`}>
201
- <div className={`font-extrabold text-black ${rightBadgeLayout ? 'text-xs' : 'text-3xl'}`}>
201
+ <div className={`font-extrabold text-black ${rightBadgeLayout ? 'text-xs' : 'text-base sm:text-2xl md:text-2xl lg:text-3xl'}`}>
202
202
  {Math.round(score || 0)}%
203
203
  </div>
204
204
  </div>
@@ -56,7 +56,13 @@ const SkillsAppendixTable = ({ skillsAll }: { skillsAll?: SkillsAll }) => {
56
56
  <div key={cat}>
57
57
  <h5 id={`appendix-skills-cat-${slugify(cat)}`} className={'text-base font-semibold mb-2'} style={{ color: 'var(--text-main)' }}>{cat}</h5>
58
58
  <div className={'overflow-auto rounded-lg border'} style={{ borderColor: 'var(--icon-button-secondary)' }}>
59
- <table className="min-w-full text-sm">
59
+ <table className="min-w-full text-sm" style={{ tableLayout: 'fixed', width: '100%' }}>
60
+ <colgroup>
61
+ <col style={{ width: '40%' }} />
62
+ <col style={{ width: '20%' }} />
63
+ <col style={{ width: '20%' }} />
64
+ <col style={{ width: '20%' }} />
65
+ </colgroup>
60
66
  <thead>
61
67
  <tr style={{ backgroundColor: 'var(--content-card-background)' }}>
62
68
  <th className="text-left p-3" style={{ color: 'var(--text-secondary)' }}>Skill</th>
@@ -57,10 +57,18 @@ export function ConnectAccounts(props: ConnectAccountsProps) {
57
57
  const [previewAction, setPreviewAction] = useState<'connect' | 'disconnect' | null>(null);
58
58
 
59
59
  const apiBase = apiGatewayUrl || (typeof process !== 'undefined' ? (process.env.NEXT_PUBLIC_API_GATEWAY_URL as string) : '');
60
- const connectedIds = useMemo(
61
- () => new Set((connected || []).map(c => (c.id ? c.id.toLowerCase() : c.name.toLowerCase()))),
62
- [connected]
63
- );
60
+ const connectedIds = useMemo(() => {
61
+ const set = new Set((connected || []).map(c => (c.id ? c.id.toLowerCase() : c.name.toLowerCase())));
62
+ // Include virtual provider 'githubapp' when the GitHub App is installed
63
+ try {
64
+ const gh = (connected || []).find(c => (c?.name || '').toLowerCase() === 'github');
65
+ const setupAction = gh?.app_installation_info?.setupAction;
66
+ if (setupAction === 'install' || setupAction === 'created') {
67
+ set.add('githubapp');
68
+ }
69
+ } catch {}
70
+ return set;
71
+ }, [connected]);
64
72
  const reconnectIds = useMemo(() => new Set((needsReconnectIds || []).map(id => id.toLowerCase())), [needsReconnectIds]);
65
73
 
66
74
  // React to upstream changes to initialProviderId (e.g., after oauth success)
@@ -570,6 +578,8 @@ export function ConnectAccounts(props: ConnectAccountsProps) {
570
578
  <div className="absolute right-0 opacity-0 transition-opacity group-hover:opacity-100">
571
579
  <button
572
580
  onClick={() => { window.location.href = 'https://github.com/settings/installations'; }}
581
+ onMouseEnter={() => setPreview('githubapp', 'disconnect')}
582
+ onMouseLeave={clearPreview}
573
583
  className="inline-flex items-center gap-1.5 py-1.5 text-sm text-red-600 hover:text-red-700 hover:underline"
574
584
  >
575
585
  <Unlink className="size-3 sm:size-4" />
@@ -108,18 +108,7 @@ export function ConnectProgress(props: ConnectProgressProps) {
108
108
  gain = 10
109
109
  }
110
110
  const to = Math.max(0, Math.min(100, progressPercent + gain))
111
- if (process.env.NODE_ENV !== 'production') {
112
- try {
113
- // eslint-disable-next-line no-console
114
- console.log('[ConnectProgress] selectedPulse', {
115
- sid,
116
- progressPercent,
117
- gain,
118
- to,
119
- othersAlready: otherConnectedCount,
120
- })
121
- } catch {}
122
- }
111
+
123
112
  return { from: progressPercent, to }
124
113
  }, [selectedProviderId, normalizedIds, progressPercent, otherConnectedCount])
125
114
 
@@ -104,7 +104,13 @@ export function ProgressCircle(props: ProgressCircleProps) {
104
104
  </svg>
105
105
  {centerIndicator ? (
106
106
  <div className={`absolute inset-0 flex items-center justify-center`} aria-hidden>
107
- <ArrowUpIcon className="w-4 h-4 text-[var(--icon-accent)]" />
107
+ <ArrowUpIcon
108
+ className={`w-4 h-4`}
109
+ style={{
110
+ color: centerIndicator === 'up' ? greenHex : redHex,
111
+ transform: centerIndicator === 'up' ? undefined : 'rotate(180deg)',
112
+ }}
113
+ />
108
114
  </div>
109
115
  ) : null}
110
116
  </div>