@learncard/react 2.10.7 → 2.10.8

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.
Files changed (46) hide show
  1. package/dist/cjs/{MeritBadgeDisplayCard-1de23221.js → MeritBadgeDisplayCard-15b85a79.js} +2 -2
  2. package/dist/cjs/{MeritBadgeDisplayCard-1de23221.js.map → MeritBadgeDisplayCard-15b85a79.js.map} +1 -1
  3. package/dist/cjs/{VCCard-b5d1ecb3.js → VCCard-4f02e2f4.js} +2 -2
  4. package/dist/cjs/{VCCard-b5d1ecb3.js.map → VCCard-4f02e2f4.js.map} +1 -1
  5. package/dist/cjs/{VCDisplayCard2-ede5a360.js → VCDisplayCard2-8517f419.js} +28 -13
  6. package/dist/cjs/VCDisplayCard2-8517f419.js.map +1 -0
  7. package/dist/cjs/i18n-cc7e34ec.js +55 -0
  8. package/dist/cjs/i18n-cc7e34ec.js.map +1 -0
  9. package/dist/cjs/index.js +7 -3
  10. package/dist/cjs/index.js.map +1 -1
  11. package/dist/cjs/index14.js +4 -3
  12. package/dist/cjs/index14.js.map +1 -1
  13. package/dist/cjs/index22.js +2 -1
  14. package/dist/cjs/index22.js.map +1 -1
  15. package/dist/cjs/index39.js +4 -3
  16. package/dist/cjs/index39.js.map +1 -1
  17. package/dist/cjs/index42.js +3 -2
  18. package/dist/cjs/index42.js.map +1 -1
  19. package/dist/esm/{MeritBadgeDisplayCard-a7a504e0.js → MeritBadgeDisplayCard-2029a552.js} +2 -2
  20. package/dist/esm/{MeritBadgeDisplayCard-a7a504e0.js.map → MeritBadgeDisplayCard-2029a552.js.map} +1 -1
  21. package/dist/esm/{VCCard-f017f1ee.js → VCCard-c0f6dff3.js} +2 -2
  22. package/dist/esm/{VCCard-f017f1ee.js.map → VCCard-c0f6dff3.js.map} +1 -1
  23. package/dist/esm/{VCDisplayCard2-72bed598.js → VCDisplayCard2-fc5c4225.js} +28 -13
  24. package/dist/esm/VCDisplayCard2-fc5c4225.js.map +1 -0
  25. package/dist/esm/i18n-8454d6ea.js +47 -0
  26. package/dist/esm/i18n-8454d6ea.js.map +1 -0
  27. package/dist/esm/index.js +4 -3
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/index14.js +4 -3
  30. package/dist/esm/index14.js.map +1 -1
  31. package/dist/esm/index22.js +2 -1
  32. package/dist/esm/index22.js.map +1 -1
  33. package/dist/esm/index39.js +4 -3
  34. package/dist/esm/index39.js.map +1 -1
  35. package/dist/esm/index42.js +3 -2
  36. package/dist/esm/index42.js.map +1 -1
  37. package/dist/index.d.ts +37 -1
  38. package/package.json +2 -2
  39. package/src/components/MeritBadgeDisplayCard/MeritBadgeFrontFace.tsx +1 -1
  40. package/src/components/MeritBadgeDisplayCard/VerifierStateBadgeAndText.tsx +7 -5
  41. package/src/components/VCDisplayCard2/VerificationRow.tsx +27 -4
  42. package/src/components/VCDisplayCard2/VerificationsBox.tsx +4 -5
  43. package/src/i18n/index.tsx +87 -0
  44. package/src/index.ts +3 -0
  45. package/dist/cjs/VCDisplayCard2-ede5a360.js.map +0 -1
  46. package/dist/esm/VCDisplayCard2-72bed598.js.map +0 -1
@@ -6,12 +6,13 @@ import { d as getBaseUrl, e as VideoIcon, C as Camera, G as GenericDocumentIcon,
6
6
  import './index-cb3a593b.js';
7
7
  import { L as Lightbox, X } from './Lightbox-f0338a0c.js';
8
8
  import { V as VerificationStatusEnum } from './types.esm-d6b48609.js';
9
+ import { u as useT } from './i18n-8454d6ea.js';
9
10
  import { A as AlignmentsBox, b as CertificateDisplayCard } from './CertificateDisplayCard-4e9254e0.js';
10
11
  import { I as IDIcon, Q as QRCodeIcon, A as AwardRibbon } from './QRCodeIcon-8eef4f7c.js';
11
12
  import { a as LCCategoryEnum } from './index-28917993.js';
12
13
  import { P as PuzzlePiece } from './PuzzlePiece-a3d9cc62.js';
13
14
  import IDSleeve from './id-sleeve.png';
14
- import { a as MeritBadgeDisplayCard } from './MeritBadgeDisplayCard-a7a504e0.js';
15
+ import { a as MeritBadgeDisplayCard } from './MeritBadgeDisplayCard-2029a552.js';
15
16
 
16
17
  const RoundedX = ({ className = "" }) => {
17
18
  return /* @__PURE__ */ React.createElement(
@@ -677,9 +678,21 @@ var e=function(t){return "number"==typeof t},i=function(t){return "function"==ty
677
678
 
678
679
  function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e},s.apply(this,arguments)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function d(e,t){if(null==e)return {};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}var f=/*#__PURE__*/createContext({}),u=/*#__PURE__*/createContext("portal"),h=/*#__PURE__*/function(r){var n,o;function p(){for(var e,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return (e=r.call.apply(r,[this].concat(n))||this).inProgressAnimations={},e.flipCallbacks={},e.el=void 0,e}o=r,(n=p).prototype=Object.create(o.prototype),n.prototype.constructor=n,c(n,o);var l=p.prototype;return l.getSnapshotBeforeUpdate=function(t){return t.flipKey!==this.props.flipKey&&this.el?q({element:this.el,flipCallbacks:this.flipCallbacks,inProgressAnimations:this.inProgressAnimations,portalKey:this.props.portalKey}):null},l.componentDidUpdate=function(e,r,n){this.props.flipKey!==e.flipKey&&this.el&&L({flippedElementPositionsBeforeUpdate:n.flippedElementPositions,cachedOrderedFlipIds:n.cachedOrderedFlipIds,containerEl:this.el,inProgressAnimations:this.inProgressAnimations,flipCallbacks:this.flipCallbacks,applyTransformOrigin:this.props.applyTransformOrigin,spring:this.props.spring,debug:this.props.debug,portalKey:this.props.portalKey,staggerConfig:this.props.staggerConfig,handleEnterUpdateDelete:this.props.handleEnterUpdateDelete,decisionData:{previous:e.decisionData,current:this.props.decisionData},onComplete:this.props.onComplete,onStart:this.props.onStart});},l.render=function(){var e=this,t=this.props,r=t.portalKey,n=/*#__PURE__*/React.createElement(f.Provider,{value:this.flipCallbacks},/*#__PURE__*/React.createElement(t.element,{className:t.className,ref:function(t){return e.el=t}},this.props.children));return r&&(n=/*#__PURE__*/React.createElement(u.Provider,{value:r},n)),n},p}(Component);h.defaultProps={applyTransformOrigin:!0,element:"div"};var m=["children","flipId","inverseFlipId","portalKey"],y=["children","flipId","shouldFlip","shouldInvert","onAppear","onStart","onStartImmediate","onComplete","onExit","onSpringUpdate"],g=function(e){var t,i=e.children,o=e.flipId,p$1=e.inverseFlipId,s=e.portalKey,c=d(e,m),f=i,u=function(e){return "function"==typeof e}(f);if(!u)try{f=Children.only(i);}catch(e){throw new Error("Each Flipped component must wrap a single child")}c.scale||c.translate||c.opacity||p.assign(c,{translate:!0,scale:!0,opacity:!0});var h=((t={})[h$1.DATA_FLIP_CONFIG]=JSON.stringify(c),t);return void 0!==o?h[h$1.DATA_FLIP_ID]=String(o):p$1&&(h[h$1.DATA_INVERSE_FLIP_ID]=String(p$1)),void 0!==s&&(h[h$1.DATA_PORTAL_KEY]=s),u?f(h):/*#__PURE__*/cloneElement(f,h)},v=function(e){var t=e.children,n=e.flipId,o=e.shouldFlip,p$1=e.shouldInvert,l=e.onAppear,a=e.onStart,c=e.onStartImmediate,h=e.onComplete,m=e.onExit,v=e.onSpringUpdate,I=d(e,y);return t?I.inverseFlipId?/*#__PURE__*/React.createElement(g,s({},I),t):/*#__PURE__*/React.createElement(u.Consumer,null,function(e){return React.createElement(f.Consumer,null,function(d){return p.isObject(d)&&n&&(d[n]={shouldFlip:o,shouldInvert:p$1,onAppear:l,onStart:a,onStartImmediate:c,onComplete:h,onExit:m,onSpringUpdate:v}),/*#__PURE__*/React.createElement(g,s({flipId:n},I,{portalKey:e}),t)})}):null};v.displayName="Flipped";
679
680
 
681
+ const MESSAGE_KEYS = {
682
+ Valid: "valid",
683
+ Invalid: "invalid",
684
+ "Not Revoked": "notRevoked",
685
+ Revoked: "revoked",
686
+ "Does Not Expire": "doesNotExpire",
687
+ Expired: "expired",
688
+ Active: "active",
689
+ "Boost Credential could not be verified.": "couldNotVerify",
690
+ "Boost Credential could not be verified": "couldNotVerify"
691
+ };
680
692
  const VerificationRow = ({ verification }) => {
681
693
  var _a, _b;
682
694
  const [showInfo, setShowInfo] = useState(false);
695
+ const t = useT();
683
696
  const statusColor = getColorForVerificationStatus(verification.status);
684
697
  const getIcon = () => {
685
698
  switch (verification.status) {
@@ -691,9 +704,16 @@ const VerificationRow = ({ verification }) => {
691
704
  return /* @__PURE__ */ React.createElement(X, { className: "w-[15px] h-[15px]" });
692
705
  }
693
706
  };
694
- let primaryText = verification.check ? `${verification.check}: ${verification.message}` : verification.message;
707
+ const statusText = t(`verification.status.${String(verification.status).toLowerCase()}`);
708
+ const translateMessage = (msg) => {
709
+ if (!msg) return "";
710
+ const key = MESSAGE_KEYS[msg];
711
+ return key ? t(`verification.message.${key}`) : msg;
712
+ };
713
+ const checkLabel = verification.check ? t(`verification.check.${verification.check}`) : "";
714
+ let primaryText = verification.check ? `${checkLabel}: ${translateMessage(verification.message)}` : translateMessage(verification.message);
695
715
  if (verification.status === VerificationStatusEnum.Failed) {
696
- primaryText = (_b = (_a = verification.message) != null ? _a : verification.details) != null ? _b : "";
716
+ primaryText = translateMessage((_b = (_a = verification.message) != null ? _a : verification.details) != null ? _b : "");
697
717
  }
698
718
  primaryText = capitalize(primaryText);
699
719
  const infoText = "";
@@ -704,7 +724,7 @@ const VerificationRow = ({ verification }) => {
704
724
  style: { color: statusColor }
705
725
  },
706
726
  getIcon(),
707
- verification.status,
727
+ statusText,
708
728
  infoText
709
729
  ), showInfo && infoText && /* @__PURE__ */ React.createElement(
710
730
  InfoBox,
@@ -718,7 +738,8 @@ const VerificationRow = ({ verification }) => {
718
738
 
719
739
  const VerificationsBox = ({ verificationItems }) => {
720
740
  const [showInfo, setShowInfo] = useState(false);
721
- return /* @__PURE__ */ React.createElement("div", { className: "verifications-box bg-white flex flex-col items-start gap-[10px] rounded-[20px] shadow-bottom px-[15px] py-[20px] w-full relative" }, /* @__PURE__ */ React.createElement("h3", { className: "text-[20px] leading-[20px] text-grayscale-900" }, "Credential Verifications"), /* @__PURE__ */ React.createElement(
741
+ const t = useT();
742
+ return /* @__PURE__ */ React.createElement("div", { className: "verifications-box bg-white flex flex-col items-start gap-[10px] rounded-[20px] shadow-bottom px-[15px] py-[20px] w-full relative" }, /* @__PURE__ */ React.createElement("h3", { className: "text-[20px] leading-[20px] text-grayscale-900" }, t("verification.title")), /* @__PURE__ */ React.createElement(
722
743
  "button",
723
744
  {
724
745
  className: "absolute top-[17px] right-[17px]",
@@ -728,13 +749,7 @@ const VerificationsBox = ({ verificationItems }) => {
728
749
  }
729
750
  },
730
751
  /* @__PURE__ */ React.createElement(InfoIcon, { color: showInfo ? "#6366F1" : void 0 })
731
- ), showInfo && /* @__PURE__ */ React.createElement(
732
- InfoBox,
733
- {
734
- text: "Credential verifications check the cryptographic proof of digital credentials to ensure their authenticity and accuracy.",
735
- handleClose: () => setShowInfo(false)
736
- }
737
- ), verificationItems.map((verification, index) => /* @__PURE__ */ React.createElement(VerificationRow, { key: index, verification })));
752
+ ), showInfo && /* @__PURE__ */ React.createElement(InfoBox, { text: t("verification.infoText"), handleClose: () => setShowInfo(false) }), verificationItems.map((verification, index) => /* @__PURE__ */ React.createElement(VerificationRow, { key: index, verification })));
738
753
  };
739
754
 
740
755
  const Flipped$4 = v;
@@ -1523,4 +1538,4 @@ const VCDisplayCard2 = ({
1523
1538
  };
1524
1539
 
1525
1540
  export { VCDisplayCard2 as V, VCDisplayCardSkillsCount as a, VCIDDisplayCard as b };
1526
- //# sourceMappingURL=VCDisplayCard2-72bed598.js.map
1541
+ //# sourceMappingURL=VCDisplayCard2-fc5c4225.js.map