@metropolle/design-system 1.0.0-beta.2026.1.24.924.ea29e2a → 1.0.0-beta.2026.1.25.110.a191d53
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/dist/css/components.css +586 -25
- package/dist/react/components/react/ProfileCard/ProfileCard.d.ts +9 -0
- package/dist/react/components/react/ProfileCard/ProfileCard.d.ts.map +1 -1
- package/dist/react/components/react/VerificationScore/VerificationScore.d.ts +43 -0
- package/dist/react/components/react/VerificationScore/VerificationScore.d.ts.map +1 -0
- package/dist/react/components/react/VerificationScore/index.d.ts +3 -0
- package/dist/react/components/react/VerificationScore/index.d.ts.map +1 -0
- package/dist/react/components/react/index.d.ts +2 -0
- package/dist/react/components/react/index.d.ts.map +1 -1
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.esm.js +55 -6
- package/dist/react/index.esm.js.map +1 -1
- package/dist/react/index.js +55 -5
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1470,6 +1470,34 @@ const GlassCard = require$$0.forwardRef(({ glassStyle = 'liquid', intensity = 'm
|
|
|
1470
1470
|
});
|
|
1471
1471
|
GlassCard.displayName = 'GlassCard';
|
|
1472
1472
|
|
|
1473
|
+
// =============================================================================
|
|
1474
|
+
// Icons
|
|
1475
|
+
// =============================================================================
|
|
1476
|
+
const Icons$1 = {
|
|
1477
|
+
shield: (jsxRuntimeExports.jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: jsxRuntimeExports.jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) })),
|
|
1478
|
+
checkCircle: (jsxRuntimeExports.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [jsxRuntimeExports.jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), jsxRuntimeExports.jsx("polyline", { points: "22 4 12 14.01 9 11.01" })] })),
|
|
1479
|
+
circle: (jsxRuntimeExports.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10" }) })),
|
|
1480
|
+
};
|
|
1481
|
+
function VerificationCheckItem({ check, action, variant }) {
|
|
1482
|
+
if (variant === 'compact') {
|
|
1483
|
+
// Compact version for popup - just icon + text
|
|
1484
|
+
return (jsxRuntimeExports.jsxs("div", { className: "mds-verification-check-item mds-verification-check-item--compact", children: [jsxRuntimeExports.jsx("span", { className: `mds-verification-check-icon ${check.passed ? 'mds-verification-check-icon--passed' : ''}`, children: check.passed ? '\u2713' : '\u2717' }), jsxRuntimeExports.jsx("span", { className: "mds-verification-check-label", children: check.description })] }));
|
|
1485
|
+
}
|
|
1486
|
+
// Card version - with points and optional action
|
|
1487
|
+
return (jsxRuntimeExports.jsxs("div", { className: `mds-verification-check-item ${check.passed ? 'mds-verification-check-item--passed' : ''}`, children: [jsxRuntimeExports.jsx("div", { className: "mds-verification-check-status", children: check.passed ? Icons$1.checkCircle : Icons$1.circle }), jsxRuntimeExports.jsxs("div", { className: "mds-verification-check-content", children: [jsxRuntimeExports.jsx("span", { className: "mds-verification-check-description", children: check.description }), jsxRuntimeExports.jsx("span", { className: "mds-verification-check-points", children: check.passed ? '1 point' : '0 points' })] }), action && !check.passed && (jsxRuntimeExports.jsx("button", { type: "button", className: "mds-btn mds-btn--secondary mds-btn--sm", onClick: action.onClick, disabled: action.disabled, children: action.label }))] }));
|
|
1488
|
+
}
|
|
1489
|
+
// =============================================================================
|
|
1490
|
+
// Main Component
|
|
1491
|
+
// =============================================================================
|
|
1492
|
+
function VerificationScoreCard({ score, maxScore = 5, checks, loading = false, error = null, variant = 'card', getCheckAction, showInfoText = true, className = '', registrationSequence, memberSince, }) {
|
|
1493
|
+
if (variant === 'compact') {
|
|
1494
|
+
// Compact popup version (used in ProfileCard)
|
|
1495
|
+
return (jsxRuntimeExports.jsxs("div", { className: `mds-verification-popup ${className}`, children: [jsxRuntimeExports.jsxs("div", { className: "mds-verification-popup__header", children: ["Verification Level ", loading ? '...' : score] }), jsxRuntimeExports.jsx("div", { className: "mds-verification-popup__checks", children: checks.map((check) => (jsxRuntimeExports.jsx(VerificationCheckItem, { check: check, variant: "compact" }, check.name))) }), (registrationSequence || memberSince) && (jsxRuntimeExports.jsxs("div", { className: "mds-verification-popup__footer", children: [registrationSequence && (jsxRuntimeExports.jsxs("span", { className: "mds-verification-popup__sequence", children: ["User #", registrationSequence.toLocaleString()] })), memberSince && (jsxRuntimeExports.jsxs("span", { className: "mds-verification-popup__date", children: ["since ", memberSince] }))] }))] }));
|
|
1496
|
+
}
|
|
1497
|
+
// Full card version (used in settings pages)
|
|
1498
|
+
return (jsxRuntimeExports.jsxs("div", { className: `mds-verification-card ${className}`, children: [jsxRuntimeExports.jsxs("div", { className: "mds-verification-card__header", children: [jsxRuntimeExports.jsxs("div", { className: "mds-verification-card__badge", children: [jsxRuntimeExports.jsx("span", { className: "mds-verification-card__badge-label", children: "Verification Level" }), jsxRuntimeExports.jsx("span", { className: "mds-verification-card__badge-score", children: loading ? '...' : score })] }), jsxRuntimeExports.jsxs("div", { className: "mds-verification-card__title", children: [jsxRuntimeExports.jsx("h4", { className: "mds-verification-card__heading", children: "Verification Score" }), jsxRuntimeExports.jsx("p", { className: "mds-verification-card__subtitle", children: "Each completed criterion adds 1 point to your verification score." })] })] }), error && (jsxRuntimeExports.jsx("div", { className: "mds-verification-card__error", children: error })), jsxRuntimeExports.jsx("div", { className: "mds-verification-card__checks", children: checks.map((check) => (jsxRuntimeExports.jsx(VerificationCheckItem, { check: check, action: getCheckAction?.(check), variant: "card" }, check.name))) }), showInfoText && (jsxRuntimeExports.jsx("p", { className: "mds-verification-card__info", children: "The Verification Score indicates your account's trustworthiness. Users with higher scores have more credibility on the platform." }))] }));
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1473
1501
|
// Default placeholder avatar - adapts to theme with high transparency
|
|
1474
1502
|
const getPlaceholderAvatar = (isDark) => {
|
|
1475
1503
|
const bgColor = isDark ? 'rgba(26, 26, 46, 0.15)' : 'rgba(255, 255, 255, 0.1)';
|
|
@@ -1541,14 +1569,23 @@ function ProfileCard({ user, variant = 'full', photoWidth, showSocial = false, s
|
|
|
1541
1569
|
return () => observer.disconnect();
|
|
1542
1570
|
}, []);
|
|
1543
1571
|
// Dynamic info texts for rotating display
|
|
1544
|
-
|
|
1572
|
+
// FEAT-090: Use verification_score checks when available, fallback to legacy
|
|
1573
|
+
const infoTexts = user.verification_score ? [
|
|
1574
|
+
`Verification Level ${user.verification_score.score}`,
|
|
1575
|
+
`User #${user.registration_sequence?.toLocaleString() || '—'}`,
|
|
1576
|
+
`Member since ${new Date(user.created_at).getFullYear()}`,
|
|
1577
|
+
// Show passed verification checks
|
|
1578
|
+
...user.verification_score.checks
|
|
1579
|
+
.filter(check => check.passed)
|
|
1580
|
+
.map(check => check.description),
|
|
1581
|
+
] : [
|
|
1545
1582
|
`Member since ${new Date(user.created_at).getFullYear()}`,
|
|
1546
1583
|
...(user.registration_sequence ? [`User #${user.registration_sequence.toLocaleString()}`] : []),
|
|
1547
1584
|
...(user.verified >= 1 ? ['Email Verified'] : []),
|
|
1548
1585
|
...(user.verified >= 2 ? ['Identity Verified'] : []),
|
|
1549
1586
|
...(user.verified >= 3 ? ['Area Verified'] : []),
|
|
1550
1587
|
// PROC-013: Show MFA status when enabled (highlight security-conscious users)
|
|
1551
|
-
...(user.mfa_enabled === true ? ['2FA
|
|
1588
|
+
...(user.mfa_enabled === true ? ['2FA Enabled'] : []),
|
|
1552
1589
|
];
|
|
1553
1590
|
// Rotate info text
|
|
1554
1591
|
require$$0.useEffect(() => {
|
|
@@ -1590,10 +1627,18 @@ function ProfileCard({ user, variant = 'full', photoWidth, showSocial = false, s
|
|
|
1590
1627
|
// Full size photo for modal (prioritize full, then medium)
|
|
1591
1628
|
const photoUrlFull = user.photo_url_full || user.photo_url_medium;
|
|
1592
1629
|
const hasRealPhoto = !!(user.photo_url_medium || user.photo_url_full);
|
|
1593
|
-
return (jsxRuntimeExports.jsxs("article", { className: `mds-profile-card ${className}`, style: { '--mds-profile-card-photo-width': `${computedPhotoWidth}px` }, children: [jsxRuntimeExports.jsx("div", { className: "mds-profile-card__grain" }), jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo", children: photoSlot ? (jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo-slot", children: photoSlot })) : (jsxRuntimeExports.jsx("img", { src: photoUrl, alt: displayName, className: `mds-profile-card__avatar ${hasRealPhoto ? 'mds-profile-card__avatar--clickable' : ''}`, onClick: hasRealPhoto ? () => setShowPhotoModal(true) : undefined, role: hasRealPhoto ? 'button' : undefined, tabIndex: hasRealPhoto ? 0 : undefined, onKeyDown: hasRealPhoto ? (e) => e.key === 'Enter' && setShowPhotoModal(true) : undefined })) }), showPhotoModal && photoUrlFull && (jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__photo-modal", onClick: () => setShowPhotoModal(false), role: "dialog", "aria-modal": "true", "aria-label": "Enlarged photo - click anywhere to close", children: [jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo-modal-backdrop" }), jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo-modal-content", children: jsxRuntimeExports.jsx("img", { src: photoUrlFull, alt: displayName, className: "mds-profile-card__photo-modal-image" }) })] })), jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__content", children: [jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__identity", children: [jsxRuntimeExports.jsx("h1", { className: "mds-profile-card__name", children: displayName.toUpperCase() }), variant === 'full' && profession && (jsxRuntimeExports.jsx("p", { className: "mds-profile-card__profession", children: profession.toUpperCase() })), variant === 'compact' && (jsxRuntimeExports.jsx(UsernameLinks, { username: user.username, className: "mds-profile-card__username" }))] }), jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__details", children: [variant === 'full' && getLocation() && (jsxRuntimeExports.jsx("p", { className: "mds-profile-card__location", children: getLocation() })), variant === 'full' && (jsxRuntimeExports.jsx(UsernameLinks, { username: user.username, className: "mds-profile-card__username-detail" })), variant === 'compact' && user.email && (jsxRuntimeExports.jsx("p", { className: "mds-profile-card__email", children: user.email })), variant === 'compact' && (jsxRuntimeExports.jsxs("span", { className: "mds-profile-card__member", children: ["Member since ", memberSince] }))] }), variant === 'compact' && (jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__verification", children: [jsxRuntimeExports.jsxs("button", { className: "mds-profile-card__verified-badge", title:
|
|
1630
|
+
return (jsxRuntimeExports.jsxs("article", { className: `mds-profile-card ${className}`, style: { '--mds-profile-card-photo-width': `${computedPhotoWidth}px` }, children: [jsxRuntimeExports.jsx("div", { className: "mds-profile-card__grain" }), jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo", children: photoSlot ? (jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo-slot", children: photoSlot })) : (jsxRuntimeExports.jsx("img", { src: photoUrl, alt: displayName, className: `mds-profile-card__avatar ${hasRealPhoto ? 'mds-profile-card__avatar--clickable' : ''}`, onClick: hasRealPhoto ? () => setShowPhotoModal(true) : undefined, role: hasRealPhoto ? 'button' : undefined, tabIndex: hasRealPhoto ? 0 : undefined, onKeyDown: hasRealPhoto ? (e) => e.key === 'Enter' && setShowPhotoModal(true) : undefined })) }), showPhotoModal && photoUrlFull && typeof document !== 'undefined' && reactDom.createPortal(jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__photo-modal", onClick: () => setShowPhotoModal(false), role: "dialog", "aria-modal": "true", "aria-label": "Enlarged photo - click anywhere to close", children: [jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo-modal-backdrop" }), jsxRuntimeExports.jsx("div", { className: "mds-profile-card__photo-modal-content", children: jsxRuntimeExports.jsx("img", { src: photoUrlFull, alt: displayName, className: "mds-profile-card__photo-modal-image" }) })] }), document.body), jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__content", children: [jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__identity", children: [jsxRuntimeExports.jsx("h1", { className: "mds-profile-card__name", children: displayName.toUpperCase() }), variant === 'full' && profession && (jsxRuntimeExports.jsx("p", { className: "mds-profile-card__profession", children: profession.toUpperCase() })), variant === 'compact' && (jsxRuntimeExports.jsx(UsernameLinks, { username: user.username, className: "mds-profile-card__username" }))] }), jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__details", children: [variant === 'full' && getLocation() && (jsxRuntimeExports.jsx("p", { className: "mds-profile-card__location", children: getLocation() })), variant === 'full' && (jsxRuntimeExports.jsx(UsernameLinks, { username: user.username, className: "mds-profile-card__username-detail" })), variant === 'compact' && user.email && (jsxRuntimeExports.jsx("p", { className: "mds-profile-card__email", children: user.email })), variant === 'compact' && (jsxRuntimeExports.jsxs("span", { className: "mds-profile-card__member", children: ["Member since ", memberSince] }))] }), variant === 'compact' && (jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__verification", children: [jsxRuntimeExports.jsxs("button", { className: "mds-profile-card__verified-badge", title: user.verification_score
|
|
1631
|
+
? `Verification Score: ${user.verification_score.score}`
|
|
1632
|
+
: `Verification Level ${user.verified}`, onClick: (e) => {
|
|
1594
1633
|
e.stopPropagation();
|
|
1595
1634
|
setShowVerifiedPopup(!showVerifiedPopup);
|
|
1596
|
-
}, children: [Icons.shield, jsxRuntimeExports.
|
|
1635
|
+
}, children: [Icons.shield, jsxRuntimeExports.jsx("span", { children: user.verification_score
|
|
1636
|
+
? user.verification_score.score
|
|
1637
|
+
: `Level ${user.verified}` })] }), jsxRuntimeExports.jsx("div", { className: "mds-profile-card__dots", children: user.verification_score ? (
|
|
1638
|
+
// FEAT-090: Show 6 dots for verification score
|
|
1639
|
+
jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: user.verification_score.checks.slice(0, 6).map((check, index) => (jsxRuntimeExports.jsx("span", { className: `mds-profile-card__dot ${check.passed ? 'active' : ''}`, title: check.description }, check.name))) })) : (
|
|
1640
|
+
// Legacy: Show 3 dots for old verification levels
|
|
1641
|
+
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: `mds-profile-card__dot ${user.verified >= 1 ? 'active' : ''}`, title: "Email Verified" }), jsxRuntimeExports.jsx("span", { className: `mds-profile-card__dot ${user.verified >= 2 ? 'active' : ''}`, title: "Identity Verified" }), jsxRuntimeExports.jsx("span", { className: `mds-profile-card__dot ${user.verified >= 3 ? 'active' : ''}`, title: "Area Verified" })] })) })] })), showSocial && (jsxRuntimeExports.jsxs("div", { ref: socialRef, className: "mds-profile-card__social", children: [jsxRuntimeExports.jsx("button", { className: "mds-profile-card__social-trigger", onClick: (e) => {
|
|
1597
1642
|
e.stopPropagation();
|
|
1598
1643
|
setShowSocialPopup(!showSocialPopup);
|
|
1599
1644
|
setShowVerifiedPopup(false);
|
|
@@ -1602,7 +1647,11 @@ function ProfileCard({ user, variant = 'full', photoWidth, showSocial = false, s
|
|
|
1602
1647
|
e.stopPropagation();
|
|
1603
1648
|
setShowVerifiedPopup(!showVerifiedPopup);
|
|
1604
1649
|
setShowSocialPopup(false);
|
|
1605
|
-
}, title: "Verification Status", children: Icons.shield }), showVerifiedPopup && (jsxRuntimeExports.
|
|
1650
|
+
}, title: "Verification Status", children: Icons.shield }), showVerifiedPopup && (jsxRuntimeExports.jsx("div", { className: "mds-profile-card__verified-popup", children: user.verification_score ? (
|
|
1651
|
+
// FEAT-090: Use VerificationScoreCard component
|
|
1652
|
+
jsxRuntimeExports.jsx(VerificationScoreCard, { score: user.verification_score.score, maxScore: user.verification_score.max_score, checks: user.verification_score.checks, variant: "compact", registrationSequence: user.registration_sequence, memberSince: memberSince })) : (
|
|
1653
|
+
// Legacy: Old verification levels
|
|
1654
|
+
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__verified-header", children: ["Verification Level ", user.verified] }), jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__verified-stats", children: [jsxRuntimeExports.jsx(StatItem, { label: "Email", verified: user.verified >= 1 }), jsxRuntimeExports.jsx(StatItem, { label: "Identity", verified: user.verified >= 2 }), jsxRuntimeExports.jsx(StatItem, { label: "Area", verified: user.verified >= 3 })] }), jsxRuntimeExports.jsxs("div", { className: "mds-profile-card__verified-footer", children: [user.registration_sequence && (jsxRuntimeExports.jsxs("span", { className: "mds-profile-card__verified-sequence", children: ["User #", user.registration_sequence.toLocaleString()] })), jsxRuntimeExports.jsxs("span", { className: "mds-profile-card__verified-date", children: ["since ", memberSince] })] })] })) }))] }), showRotatingInfo && (jsxRuntimeExports.jsx("div", { className: "mds-profile-card__info-dots", children: infoTexts.map((_, index) => (jsxRuntimeExports.jsx("span", { className: `mds-profile-card__info-dot ${index === currentInfoIndex ? 'active' : ''}` }, index))) }))] }))] })] }));
|
|
1606
1655
|
}
|
|
1607
1656
|
|
|
1608
1657
|
const variantElementMap = {
|
|
@@ -3102,6 +3151,7 @@ exports.TableHeader = TableHeader;
|
|
|
3102
3151
|
exports.TableRow = TableRow;
|
|
3103
3152
|
exports.ThemeToggle = ThemeToggle;
|
|
3104
3153
|
exports.Typography = Typography;
|
|
3154
|
+
exports.VerificationScoreCard = VerificationScoreCard;
|
|
3105
3155
|
exports.auditLogTableConfig = auditLogTableConfig;
|
|
3106
3156
|
exports.citiesTableConfig = citiesTableConfig;
|
|
3107
3157
|
exports.cn = cn;
|