@learncard/react 2.10.3 → 2.10.5
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/README.md +10 -10
- package/dist/base.css +1 -1
- package/dist/base.js +1 -1
- package/dist/cjs/{BoostGenericCard-0f68947f.js → BoostGenericCard-5a07339f.js} +2 -2
- package/dist/cjs/{BoostGenericCard-0f68947f.js.map → BoostGenericCard-5a07339f.js.map} +1 -1
- package/dist/cjs/{CertificateDisplayCard-6c30f6e6.js → CertificateDisplayCard-a7940558.js} +4 -4
- package/dist/cjs/{CertificateDisplayCard-6c30f6e6.js.map → CertificateDisplayCard-a7940558.js.map} +1 -1
- package/dist/cjs/CircleIcon-f0fa68c7.js.map +1 -1
- package/dist/cjs/{LearnCardCreditCardFrontFace-aca1b7bc.js → LearnCardCreditCardFrontFace-75fb4e44.js} +2 -2
- package/dist/cjs/{LearnCardCreditCardFrontFace-aca1b7bc.js.map → LearnCardCreditCardFrontFace-75fb4e44.js.map} +1 -1
- package/dist/cjs/{MeritBadgeDisplayCard-535853f5.js → MeritBadgeDisplayCard-1c614da9.js} +4 -4
- package/dist/cjs/{MeritBadgeDisplayCard-535853f5.js.map → MeritBadgeDisplayCard-1c614da9.js.map} +1 -1
- package/dist/cjs/{MeritBadgeSkillsCount-5cc7d16e.js → MeritBadgeSkillsCount-4dabf982.js} +2 -2
- package/dist/cjs/{MeritBadgeSkillsCount-5cc7d16e.js.map → MeritBadgeSkillsCount-4dabf982.js.map} +1 -1
- package/dist/cjs/{QRCodeCard-f0079bd9.js → QRCodeCard-2378411e.js} +2 -2
- package/dist/cjs/{QRCodeCard-f0079bd9.js.map → QRCodeCard-2378411e.js.map} +1 -1
- package/dist/cjs/{SchoolIDCard-e22d0d80.js → SchoolIDCard-10796199.js} +11 -6
- package/dist/cjs/SchoolIDCard-10796199.js.map +1 -0
- package/dist/cjs/{VCCard-deabc204.js → VCCard-bf6dc47f.js} +3 -3
- package/dist/cjs/{VCCard-deabc204.js.map → VCCard-bf6dc47f.js.map} +1 -1
- package/dist/cjs/{VCDisplayBackFace-a15d5252.js → VCDisplayBackFace-864c35d5.js} +3 -3
- package/dist/cjs/{VCDisplayBackFace-a15d5252.js.map → VCDisplayBackFace-864c35d5.js.map} +1 -1
- package/dist/cjs/{VCDisplayCard-a64fa405.js → VCDisplayCard-15af27c6.js} +3 -3
- package/dist/cjs/{VCDisplayCard-a64fa405.js.map → VCDisplayCard-15af27c6.js.map} +1 -1
- package/dist/cjs/{VCDisplayCard2-6c87eade.js → VCDisplayCard2-a55da96b.js} +27 -22
- package/dist/cjs/VCDisplayCard2-a55da96b.js.map +1 -0
- package/dist/cjs/{VCVerificationPill-e1cc6be2.js → VCVerificationPill-20ed4d3c.js} +2 -2
- package/dist/cjs/{VCVerificationPill-e1cc6be2.js.map → VCVerificationPill-20ed4d3c.js.map} +1 -1
- package/dist/cjs/{VerifierStateBadgeAndText-5229da1a.js → VerifierStateBadgeAndText-de5bd85f.js} +9 -11
- package/dist/cjs/VerifierStateBadgeAndText-de5bd85f.js.map +1 -0
- package/dist/cjs/{credential.helpers-473e89c5.js → credential.helpers-b4d27c8a.js} +3 -3
- package/dist/cjs/credential.helpers-b4d27c8a.js.map +1 -0
- package/dist/cjs/{index-ec1d26f1.js → index-330dcb9c.js} +1 -1
- package/dist/cjs/index-330dcb9c.js.map +1 -0
- package/dist/cjs/{index-0cac2c5b.js → index-da255c9a.js} +1 -1
- package/dist/cjs/index-da255c9a.js.map +1 -0
- package/dist/cjs/index.js +17 -17
- package/dist/cjs/index14.js +17 -17
- package/dist/cjs/index18.js +2 -2
- package/dist/cjs/index22.js +6 -6
- package/dist/cjs/index28.js +2 -2
- package/dist/cjs/index31.js +1 -1
- package/dist/cjs/index39.js +11 -11
- package/dist/cjs/index4.js +4 -4
- package/dist/cjs/index40.js +5 -5
- package/dist/cjs/index41.js +6 -6
- package/dist/cjs/index42.js +7 -7
- package/dist/cjs/index43.js +2 -2
- package/dist/cjs/index46.js +2 -2
- package/dist/cjs/index7.js +5 -5
- package/dist/cjs/{types.esm-12bb5eed.js → types.esm-40b77196.js} +3 -2
- package/dist/cjs/types.esm-40b77196.js.map +1 -0
- package/dist/esm/{BoostGenericCard-b332a829.js → BoostGenericCard-997af0f5.js} +2 -2
- package/dist/esm/{BoostGenericCard-b332a829.js.map → BoostGenericCard-997af0f5.js.map} +1 -1
- package/dist/esm/{CertificateDisplayCard-fc148ca0.js → CertificateDisplayCard-d764151e.js} +4 -4
- package/dist/esm/{CertificateDisplayCard-fc148ca0.js.map → CertificateDisplayCard-d764151e.js.map} +1 -1
- package/dist/esm/CircleIcon-abd5ff06.js.map +1 -1
- package/dist/esm/{LearnCardCreditCardFrontFace-b7c917f5.js → LearnCardCreditCardFrontFace-13d29504.js} +2 -2
- package/dist/esm/{LearnCardCreditCardFrontFace-b7c917f5.js.map → LearnCardCreditCardFrontFace-13d29504.js.map} +1 -1
- package/dist/esm/{MeritBadgeDisplayCard-da9de0b8.js → MeritBadgeDisplayCard-907627ed.js} +4 -4
- package/dist/esm/{MeritBadgeDisplayCard-da9de0b8.js.map → MeritBadgeDisplayCard-907627ed.js.map} +1 -1
- package/dist/esm/{MeritBadgeSkillsCount-01e2756e.js → MeritBadgeSkillsCount-9474bd51.js} +2 -2
- package/dist/esm/{MeritBadgeSkillsCount-01e2756e.js.map → MeritBadgeSkillsCount-9474bd51.js.map} +1 -1
- package/dist/esm/{QRCodeCard-8f29c3c7.js → QRCodeCard-3abf9f33.js} +2 -2
- package/dist/esm/{QRCodeCard-8f29c3c7.js.map → QRCodeCard-3abf9f33.js.map} +1 -1
- package/dist/esm/{SchoolIDCard-8b151cd3.js → SchoolIDCard-f82e40bc.js} +11 -6
- package/dist/esm/SchoolIDCard-f82e40bc.js.map +1 -0
- package/dist/esm/{VCCard-94dbe6bf.js → VCCard-2f075558.js} +3 -3
- package/dist/esm/{VCCard-94dbe6bf.js.map → VCCard-2f075558.js.map} +1 -1
- package/dist/esm/{VCDisplayBackFace-9c5b383f.js → VCDisplayBackFace-e347145c.js} +3 -3
- package/dist/esm/{VCDisplayBackFace-9c5b383f.js.map → VCDisplayBackFace-e347145c.js.map} +1 -1
- package/dist/esm/{VCDisplayCard-bd4d15e1.js → VCDisplayCard-3002776b.js} +3 -3
- package/dist/esm/{VCDisplayCard-bd4d15e1.js.map → VCDisplayCard-3002776b.js.map} +1 -1
- package/dist/esm/{VCDisplayCard2-c6a81e42.js → VCDisplayCard2-758f3307.js} +27 -22
- package/dist/esm/VCDisplayCard2-758f3307.js.map +1 -0
- package/dist/esm/{VCVerificationPill-d073557c.js → VCVerificationPill-5a05423b.js} +2 -2
- package/dist/esm/{VCVerificationPill-d073557c.js.map → VCVerificationPill-5a05423b.js.map} +1 -1
- package/dist/esm/{VerifierStateBadgeAndText-6946e820.js → VerifierStateBadgeAndText-bd1b0131.js} +9 -11
- package/dist/esm/VerifierStateBadgeAndText-bd1b0131.js.map +1 -0
- package/dist/esm/{credential.helpers-ff461699.js → credential.helpers-26e1a359.js} +3 -3
- package/dist/esm/credential.helpers-26e1a359.js.map +1 -0
- package/dist/esm/{index-2ef835bd.js → index-bc6b8b0b.js} +1 -1
- package/dist/{cjs/index-ec1d26f1.js.map → esm/index-bc6b8b0b.js.map} +1 -1
- package/dist/esm/{index-eae3ca64.js → index-cb3a593b.js} +1 -1
- package/dist/esm/index-cb3a593b.js.map +1 -0
- package/dist/esm/index.js +17 -17
- package/dist/esm/index14.js +17 -17
- package/dist/esm/index18.js +2 -2
- package/dist/esm/index22.js +6 -6
- package/dist/esm/index28.js +2 -2
- package/dist/esm/index31.js +1 -1
- package/dist/esm/index39.js +11 -11
- package/dist/esm/index4.js +4 -4
- package/dist/esm/index40.js +5 -5
- package/dist/esm/index41.js +6 -6
- package/dist/esm/index42.js +7 -7
- package/dist/esm/index43.js +2 -2
- package/dist/esm/index46.js +2 -2
- package/dist/esm/index7.js +5 -5
- package/dist/esm/{types.esm-f32fc00a.js → types.esm-13bb929b.js} +3 -2
- package/dist/esm/types.esm-13bb929b.js.map +1 -0
- package/dist/main.css +1 -1
- package/dist/main.js +1 -1
- package/package.json +102 -87
- package/src/assets/icons/accommodationsIcon.svg +5 -0
- package/src/assets/icons/accomplishmentsIcon.svg +4 -0
- package/src/assets/icons/achievementsIcon.svg +7 -0
- package/src/assets/icons/coursesIcon.svg +5 -0
- package/src/assets/icons/eventsIcon.svg +6 -0
- package/src/assets/icons/experiencesIcon.svg +4 -0
- package/src/assets/icons/goalsIcon.svg +5 -0
- package/src/assets/icons/idIcon.svg +4 -0
- package/src/assets/icons/membershipsIcon.svg +4 -0
- package/src/assets/icons/relationshipsIcon.svg +6 -0
- package/src/assets/icons/skillsIcon.svg +3 -0
- package/src/assets/icons/socialBadgesIcon.svg +7 -0
- package/src/assets/images/Accommodation-Hands.png +0 -0
- package/src/assets/images/ArrowArcLeft.svg +4 -0
- package/src/assets/images/ArrowArcRight.svg +4 -0
- package/src/assets/images/CaretRight.svg +3 -0
- package/src/assets/images/CaretRightFilled.svg +3 -0
- package/src/assets/images/DotsThreeOutline.svg +5 -0
- package/src/assets/images/GreenCheckCircle.svg +4 -0
- package/src/assets/images/RedXCircle.svg +5 -0
- package/src/assets/images/X.svg +4 -0
- package/src/assets/images/YellowWarningCircle.svg +4 -0
- package/src/assets/images/addawardlight.svg +8 -0
- package/src/assets/images/agriculture.png +0 -0
- package/src/assets/images/apple.png +0 -0
- package/src/assets/images/athletics.png +0 -0
- package/src/assets/images/award.svg +3 -0
- package/src/assets/images/backpack.png +0 -0
- package/src/assets/images/badge.png +0 -0
- package/src/assets/images/briefcase.svg +6 -0
- package/src/assets/images/business.png +0 -0
- package/src/assets/images/card-chip.svg +26 -0
- package/src/assets/images/check.svg +17 -0
- package/src/assets/images/coins.svg +3 -0
- package/src/assets/images/contactless-symbol.svg +3 -0
- package/src/assets/images/creative.png +0 -0
- package/src/assets/images/digital.png +0 -0
- package/src/assets/images/durable.png +0 -0
- package/src/assets/images/emptystate-death.png +0 -0
- package/src/assets/images/emptystate-dinocandle.png +0 -0
- package/src/assets/images/emptystate-ghost1.png +0 -0
- package/src/assets/images/eventsGraphic.png +0 -0
- package/src/assets/images/experience-mountain.png +0 -0
- package/src/assets/images/goals-target.png +0 -0
- package/src/assets/images/gradcaplight.svg +3 -0
- package/src/assets/images/graduation.svg +3 -0
- package/src/assets/images/icon.green.fat-arrow.png +0 -0
- package/src/assets/images/id-purple.png +0 -0
- package/src/assets/images/id-sleeve.png +0 -0
- package/src/assets/images/key-icon.svg +4 -0
- package/src/assets/images/lhplaceholder.png +0 -0
- package/src/assets/images/lightbulb.svg +3 -0
- package/src/assets/images/loveyou-icon.svg +5 -0
- package/src/assets/images/master-card-logo.svg +20 -0
- package/src/assets/images/medical.png +0 -0
- package/src/assets/images/membership-graphic.png +0 -0
- package/src/assets/images/membership-key.svg +9 -0
- package/src/assets/images/minigradcapcolored.svg +3 -0
- package/src/assets/images/minijob.svg +5 -0
- package/src/assets/images/minipuzzle.svg +3 -0
- package/src/assets/images/minipuzzlecolored.svg +3 -0
- package/src/assets/images/minitrophy.svg +3 -0
- package/src/assets/images/minitrophycolored.svg +3 -0
- package/src/assets/images/motlow-buckcard-bg.svg +32 -0
- package/src/assets/images/mountains-icon.svg +4 -0
- package/src/assets/images/photoplaceholder.png +0 -0
- package/src/assets/images/puzzle-icon.svg +3 -0
- package/src/assets/images/relationships-cats.png +0 -0
- package/src/assets/images/sample-badge.png +0 -0
- package/src/assets/images/skillgraph.svg +29 -0
- package/src/assets/images/skillplaceholder.png +0 -0
- package/src/assets/images/social-badge-2.png +0 -0
- package/src/assets/images/social-badge.png +0 -0
- package/src/assets/images/social-icon.svg +7 -0
- package/src/assets/images/social.png +0 -0
- package/src/assets/images/stem.png +0 -0
- package/src/assets/images/target-icon.svg +5 -0
- package/src/assets/images/trade.png +0 -0
- package/src/assets/images/trophy.svg +3 -0
- package/src/assets/images/user.svg +4 -0
- package/src/assets/images/users-icon.svg +6 -0
- package/src/assets/images/vc.check.svg +10 -0
- package/src/assets/images/verified-check.png +0 -0
- package/src/assets/images/walletTrophy.png +0 -0
- package/src/assets/images/walletcurrency.webp +0 -0
- package/src/assets/images/walletids.webp +0 -0
- package/src/assets/images/walletjobhistory.webp +0 -0
- package/src/assets/images/walletskills.webp +0 -0
- package/src/assets/styles/base.css +2 -0
- package/src/assets/styles/main.css +475 -0
- package/src/components/AchievementCard/AchievementCard.stories.tsx +31 -0
- package/src/components/AchievementCard/AchievementCard.tsx +88 -0
- package/src/components/AchievementCard/index.ts +5 -0
- package/src/components/BadgeThumbnailImg/BadgeThumbnailImg.test.tsx +47 -0
- package/src/components/BadgeThumbnailImg/BadgeThumbnailImg.tsx +72 -0
- package/src/components/BadgeThumbnailImg/index.ts +5 -0
- package/src/components/BoostGenericCard/AlignmentSkillsCount.tsx +54 -0
- package/src/components/BoostGenericCard/BoostGenericCard.stories.tsx +39 -0
- package/src/components/BoostGenericCard/BoostGenericCard.tsx +177 -0
- package/src/components/BoostGenericCard/index.ts +6 -0
- package/src/components/BoostSmallCard/BoostSmallCard.stories.tsx +57 -0
- package/src/components/BoostSmallCard/BoostSmallCard.tsx +178 -0
- package/src/components/BoostSmallCard/index.ts +5 -0
- package/src/components/Button/Button.stories.tsx +20 -0
- package/src/components/Button/Button.test.tsx +15 -0
- package/src/components/Button/Button.tsx +21 -0
- package/src/components/Button/index.ts +5 -0
- package/src/components/CertificateDisplayCard/AlignmentRow.tsx +26 -0
- package/src/components/CertificateDisplayCard/AlignmentsBox.tsx +70 -0
- package/src/components/CertificateDisplayCard/CertDisplayCardSkillsCount.tsx +66 -0
- package/src/components/CertificateDisplayCard/CertificateBackFace.tsx +130 -0
- package/src/components/CertificateDisplayCard/CertificateCornerIcon.tsx +48 -0
- package/src/components/CertificateDisplayCard/CertificateDisplayCard.stories.tsx +21 -0
- package/src/components/CertificateDisplayCard/CertificateDisplayCard.tsx +180 -0
- package/src/components/CertificateDisplayCard/CertificateFrontFace.tsx +308 -0
- package/src/components/CertificateDisplayCard/CertificateImageDisplay.test.tsx +43 -0
- package/src/components/CertificateDisplayCard/CertificateImageDisplay.tsx +68 -0
- package/src/components/CertificateDisplayCard/CertificateProfileImageDisplay.test.tsx +66 -0
- package/src/components/CertificateDisplayCard/CertificateProfileImageDisplay.tsx +64 -0
- package/src/components/CertificateDisplayCard/CertificateRibbon.tsx +43 -0
- package/src/components/CertificateDisplayCard/InfoBox.tsx +30 -0
- package/src/components/CertificateDisplayCard/MediaAttachmentsBox.tsx +347 -0
- package/src/components/CertificateDisplayCard/TruncateTextBox.tsx +73 -0
- package/src/components/CertificateDisplayCard/VerificationRow.tsx +67 -0
- package/src/components/CertificateDisplayCard/VerificationsBox.tsx +44 -0
- package/src/components/CertificateDisplayCard/VerifierStateBadgeAndText.tsx +100 -0
- package/src/components/CertificateDisplayCard/index.ts +20 -0
- package/src/components/CircleCheckButton/CircleCheckButton.stories.tsx +21 -0
- package/src/components/CircleCheckButton/CircleCheckButton.tsx +28 -0
- package/src/components/CircleCheckButton/index.ts +5 -0
- package/src/components/CircleIcon/CircleIcon.tsx +90 -0
- package/src/components/CircleIcon/__tests__/CircleIcon.test.tsx +38 -0
- package/src/components/CircleIcon/ci new +0 -0
- package/src/components/CircleIcon/index.ts +5 -0
- package/src/components/CourseCard/CourseCard.stories.tsx +23 -0
- package/src/components/CourseCard/CourseCard.tsx +94 -0
- package/src/components/CourseCard/index.ts +5 -0
- package/src/components/CourseVerticalCard/CourseVerticalCard.stories.tsx +31 -0
- package/src/components/CourseVerticalCard/CourseVerticalCard.tsx +118 -0
- package/src/components/CourseVerticalCard/index.ts +5 -0
- package/src/components/FlippyCard/FlippyCard.tsx +34 -0
- package/src/components/FlippyCard/__tests__/FlippyCard.test.tsx +41 -0
- package/src/components/FlippyCard/index.ts +5 -0
- package/src/components/GenericCard/GenericCard.stories.tsx +22 -0
- package/src/components/GenericCard/GenericCard.tsx +72 -0
- package/src/components/GenericCard/index.ts +5 -0
- package/src/components/JobHistoryCard/JobHistoryCard.stories.tsx +26 -0
- package/src/components/JobHistoryCard/JobHistoryCard.tsx +44 -0
- package/src/components/JobHistoryCard/index.ts +5 -0
- package/src/components/JobListCard/JobListCard.stories.tsx +54 -0
- package/src/components/JobListCard/JobListCard.tsx +162 -0
- package/src/components/JobListCard/index.ts +5 -0
- package/src/components/LearnCardCreditCardBackFace/LearnCardCreditCardBackFace.stories.tsx +31 -0
- package/src/components/LearnCardCreditCardBackFace/LearnCardCreditCardBackFace.tsx +104 -0
- package/src/components/LearnCardCreditCardBackFace/__tests__/LearnCardCreditCardBackFace.test.tsx +64 -0
- package/src/components/LearnCardCreditCardBackFace/index.ts +6 -0
- package/src/components/LearnCardCreditCardBackFace/types.ts +45 -0
- package/src/components/LearnCardCreditCardFrontFace/LearnCardCreditCardFrontFace.stories.tsx +28 -0
- package/src/components/LearnCardCreditCardFrontFace/LearnCardCreditCardFrontFace.tsx +102 -0
- package/src/components/LearnCardCreditCardFrontFace/__tests__/LearnCardCreditCardFrontFace.test.tsx +48 -0
- package/src/components/LearnCardCreditCardFrontFace/index.ts +6 -0
- package/src/components/LearnCardCreditCardFrontFace/types.ts +42 -0
- package/src/components/LearnPill/LearnPill.stories.tsx +20 -0
- package/src/components/LearnPill/LearnPill.tsx +35 -0
- package/src/components/LearnPill/index.ts +5 -0
- package/src/components/Lightbox/Lightbox.tsx +133 -0
- package/src/components/Lightbox/index.ts +5 -0
- package/src/components/Loading/CircleSpinner.tsx +52 -0
- package/src/components/Loading/index.ts +5 -0
- package/src/components/MeritBadgeDisplayCard/AlignmentRow.tsx +26 -0
- package/src/components/MeritBadgeDisplayCard/AlignmentsBox.tsx +70 -0
- package/src/components/MeritBadgeDisplayCard/InfoBox.tsx +30 -0
- package/src/components/MeritBadgeDisplayCard/MediaAttachmentsBox.tsx +347 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeBackFace.tsx +130 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeCornerIcon.tsx +46 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeDisplayCard.tsx +177 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeFrontFace.tsx +292 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeImageDisplay.tsx +22 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeProfileImageDisplay.test.tsx +70 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeProfileImageDisplay.tsx +66 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeRibbon.tsx +185 -0
- package/src/components/MeritBadgeDisplayCard/MeritBadgeSkillsCount.tsx +47 -0
- package/src/components/MeritBadgeDisplayCard/TruncateTextBox.tsx +73 -0
- package/src/components/MeritBadgeDisplayCard/VerificationRow.tsx +67 -0
- package/src/components/MeritBadgeDisplayCard/VerificationsBox.tsx +44 -0
- package/src/components/MeritBadgeDisplayCard/VerifierStateBadgeAndText.tsx +57 -0
- package/src/components/MeritBadgeDisplayCard/index.ts +20 -0
- package/src/components/MiniVCThumbnail/ MiniVCThumbnail.css +18 -0
- package/src/components/MiniVCThumbnail/ MiniVCThumbnail.stories.tsx +24 -0
- package/src/components/MiniVCThumbnail/MiniVCThumbnail.tsx +83 -0
- package/src/components/MiniVCThumbnail/__tests__/MiniVCThumbnail.test.tsx +59 -0
- package/src/components/MiniVCThumbnail/index.ts +6 -0
- package/src/components/MiniVCThumbnail/types.ts +32 -0
- package/src/components/Notification/Notification.stories.tsx +25 -0
- package/src/components/Notification/Notification.tsx +115 -0
- package/src/components/Notification/__tests__/Notification.test.tsx +111 -0
- package/src/components/Notification/index.ts +6 -0
- package/src/components/Notification/types.ts +97 -0
- package/src/components/NotificationBoostCard/NotificationBoostCard.stories.tsx +54 -0
- package/src/components/NotificationBoostCard/NotificationBoostCard.tsx +153 -0
- package/src/components/NotificationBoostCard/index.ts +6 -0
- package/src/components/NotificationBoostCard/types.ts +25 -0
- package/src/components/NotificationUserAcceptedBoostCard/NotificationUserAcceptedBoostCard.stories.tsx +28 -0
- package/src/components/NotificationUserAcceptedBoostCard/NotificationUserAcceptedBoostCard.tsx +96 -0
- package/src/components/NotificationUserAcceptedBoostCard/index.ts +6 -0
- package/src/components/NotificationUserAcceptedBoostCard/types.ts +13 -0
- package/src/components/NotificationUserCard/NotificationUserCard.stories.tsx +26 -0
- package/src/components/NotificationUserCard/NotificationUserCard.tsx +121 -0
- package/src/components/NotificationUserCard/index.ts +6 -0
- package/src/components/NotificationUserCard/types.ts +43 -0
- package/src/components/QRCodeCard/QRCodeCard.stories.tsx +26 -0
- package/src/components/QRCodeCard/QRCodeCard.tsx +54 -0
- package/src/components/QRCodeCard/__tests__/QRCodeCard.test.tsx +31 -0
- package/src/components/QRCodeCard/index.ts +6 -0
- package/src/components/QRCodeCard/types.ts +22 -0
- package/src/components/RoundedPill/RoundedPill.stories.tsx +21 -0
- package/src/components/RoundedPill/RoundedPill.tsx +137 -0
- package/src/components/RoundedPill/index.ts +5 -0
- package/src/components/RoundedSquare/RoundedSquare.stories.tsx +28 -0
- package/src/components/RoundedSquare/RoundedSquare.tsx +69 -0
- package/src/components/RoundedSquare/__tests__/RoundedSquare.test.tsx +35 -0
- package/src/components/RoundedSquare/constants.ts +63 -0
- package/src/components/RoundedSquare/index.ts +6 -0
- package/src/components/RoundedSquare/roudnedquarenew +0 -0
- package/src/components/SchoolIdCard/SchoolIDCard.stories.tsx +30 -0
- package/src/components/SchoolIdCard/SchoolIDCard.tsx +81 -0
- package/src/components/SchoolIdCard/index.ts +6 -0
- package/src/components/SchoolIdCard/types.ts +42 -0
- package/src/components/SkillTabCard/SkillTabCard.stories.tsx +25 -0
- package/src/components/SkillTabCard/SkillTabCard.tsx +44 -0
- package/src/components/SkillTabCard/index.ts +5 -0
- package/src/components/SkillVerticalCard/SkillVerticalCard.stories.tsx +20 -0
- package/src/components/SkillVerticalCard/SkillVerticalCard.tsx +32 -0
- package/src/components/SkillVerticalCard/index.ts +5 -0
- package/src/components/SkillsCard/SkillsCard.stories.tsx +24 -0
- package/src/components/SkillsCard/SkillsCard.tsx +68 -0
- package/src/components/SkillsCard/index.ts +5 -0
- package/src/components/SkillsStatsCard/SkillsStatsCard.stories.tsx +63 -0
- package/src/components/SkillsStatsCard/SkillsStatsCard.tsx +92 -0
- package/src/components/SkillsStatsCard/index.ts +5 -0
- package/src/components/SmallAchievementCard/SmallAchievementCard.stories.tsx +23 -0
- package/src/components/SmallAchievementCard/SmallAchievementCard.tsx +50 -0
- package/src/components/SmallAchievementCard/index.ts +5 -0
- package/src/components/UserProfilePicture/UserProfilePicture.test.tsx +44 -0
- package/src/components/UserProfilePicture/UserProfilePicture.tsx +119 -0
- package/src/components/UserProfilePicture/index.ts +5 -0
- package/src/components/VCCard/VCCard.stories.tsx +64 -0
- package/src/components/VCCard/VCCard.tsx +84 -0
- package/src/components/VCCard/index.ts +5 -0
- package/src/components/VCDisplayBackFace/VCDisplayBackFace.tsx +112 -0
- package/src/components/VCDisplayBackFace/index.ts +5 -0
- package/src/components/VCDisplayCard/VCDisplayCard.stories.tsx +167 -0
- package/src/components/VCDisplayCard/VCDisplayCard.tsx +98 -0
- package/src/components/VCDisplayCard/index.ts +5 -0
- package/src/components/VCDisplayCard2/FitText.tsx +85 -0
- package/src/components/VCDisplayCard2/InfoBox.tsx +30 -0
- package/src/components/VCDisplayCard2/IssueHistoryBox.tsx +50 -0
- package/src/components/VCDisplayCard2/MediaAttachmentsBox.tsx +306 -0
- package/src/components/VCDisplayCard2/RibbonEnd.tsx +67 -0
- package/src/components/VCDisplayCard2/SelectedSkills.tsx +70 -0
- package/src/components/VCDisplayCard2/SkillsBox.tsx +53 -0
- package/src/components/VCDisplayCard2/Subskill.tsx +50 -0
- package/src/components/VCDisplayCard2/TopLevelSkill.tsx +63 -0
- package/src/components/VCDisplayCard2/TruncateTextBox.tsx +89 -0
- package/src/components/VCDisplayCard2/VC2BackFace.tsx +185 -0
- package/src/components/VCDisplayCard2/VC2FrontFaceInfo.tsx +279 -0
- package/src/components/VCDisplayCard2/VCDisplayCard2.stories.tsx +191 -0
- package/src/components/VCDisplayCard2/VCDisplayCard2.tsx +526 -0
- package/src/components/VCDisplayCard2/VCDisplayCard2AvatarFallbacks.stories.tsx +312 -0
- package/src/components/VCDisplayCard2/VCDisplayCardCategoryType.tsx +19 -0
- package/src/components/VCDisplayCard2/VCDisplayCardSkillsCount.tsx +46 -0
- package/src/components/VCDisplayCard2/VCIDDIsplayCard.tsx +159 -0
- package/src/components/VCDisplayCard2/VCIDDisplayFrontFace.tsx +213 -0
- package/src/components/VCDisplayCard2/VerificationRow.tsx +69 -0
- package/src/components/VCDisplayCard2/VerificationsBox.tsx +44 -0
- package/src/components/VCDisplayCard2/__tests__/VC2FrontFaceInfo.test.tsx +134 -0
- package/src/components/VCDisplayCard2/index.ts +23 -0
- package/src/components/VCDisplayFrontFace/VCDisplayFrontFace.tsx +143 -0
- package/src/components/VCDisplayFrontFace/index.ts +5 -0
- package/src/components/VCThumbnail/VCThumbnail.stories.tsx +32 -0
- package/src/components/VCThumbnail/VCThumbnail.tsx +182 -0
- package/src/components/VCThumbnail/__tests__/VCThumbnail.test.tsx +114 -0
- package/src/components/VCThumbnail/index.ts +6 -0
- package/src/components/VCThumbnail/types.ts +46 -0
- package/src/components/VCVerificationCheck/VCVerificationCheck.tsx +89 -0
- package/src/components/VCVerificationCheck/index.ts +5 -0
- package/src/components/VCVerificationPill/VCVerificationPill.tsx +85 -0
- package/src/components/VCVerificationPill/index.ts +5 -0
- package/src/components/index.ts +48 -0
- package/src/components/svgs/AccommodationsIcon.tsx +38 -0
- package/src/components/svgs/AccomplishmentsIcon.tsx +34 -0
- package/src/components/svgs/AchievementWithTitle.tsx +137 -0
- package/src/components/svgs/AcuteCheckmark.tsx +25 -0
- package/src/components/svgs/AwardDisplayIcon.tsx +37 -0
- package/src/components/svgs/AwardRibbon.tsx +29 -0
- package/src/components/svgs/BadgeDisplayIcon.tsx +31 -0
- package/src/components/svgs/Briefcase.tsx +48 -0
- package/src/components/svgs/Camera.tsx +25 -0
- package/src/components/svgs/CertificateDisplayIcon.tsx +56 -0
- package/src/components/svgs/Checkmark.tsx +59 -0
- package/src/components/svgs/CircleWithText.tsx +36 -0
- package/src/components/svgs/Coins.tsx +14 -0
- package/src/components/svgs/CourseDisplayIcon.tsx +43 -0
- package/src/components/svgs/DownRightArrow.tsx +29 -0
- package/src/components/svgs/ExclamationPoint.tsx +25 -0
- package/src/components/svgs/ExperienceIcon.tsx +34 -0
- package/src/components/svgs/FatArrow.tsx +44 -0
- package/src/components/svgs/GenericArrow.tsx +29 -0
- package/src/components/svgs/GenericDocumentIcon.tsx +26 -0
- package/src/components/svgs/Graduation.tsx +24 -0
- package/src/components/svgs/IDDisplayIcon.tsx +63 -0
- package/src/components/svgs/IDIcon.tsx +59 -0
- package/src/components/svgs/IDSleeve.tsx +21 -0
- package/src/components/svgs/InfoIcon.tsx +26 -0
- package/src/components/svgs/IssuerSeal.tsx +26 -0
- package/src/components/svgs/KeyIcon.tsx +31 -0
- package/src/components/svgs/LeftArrow.tsx +27 -0
- package/src/components/svgs/Lightbulb.tsx +14 -0
- package/src/components/svgs/Line.tsx +22 -0
- package/src/components/svgs/LinkIcon.tsx +35 -0
- package/src/components/svgs/PdfIcon.tsx +38 -0
- package/src/components/svgs/PersonBadge.tsx +55 -0
- package/src/components/svgs/PuzzlePiece.tsx +89 -0
- package/src/components/svgs/QRCodeIcon.tsx +21 -0
- package/src/components/svgs/RedFlag.tsx +41 -0
- package/src/components/svgs/RoundedCorner.tsx +28 -0
- package/src/components/svgs/RoundedX.tsx +35 -0
- package/src/components/svgs/ScoutsLogo.tsx +41 -0
- package/src/components/svgs/ScoutsPledge.tsx +33 -0
- package/src/components/svgs/ShieldChevron.tsx +24 -0
- package/src/components/svgs/Smiley.tsx +43 -0
- package/src/components/svgs/SocialBadgesIcon.tsx +43 -0
- package/src/components/svgs/ThreeDotVertical.tsx +41 -0
- package/src/components/svgs/Trophy.tsx +25 -0
- package/src/components/svgs/UnknownVerifierBadge.tsx +25 -0
- package/src/components/svgs/User.tsx +34 -0
- package/src/components/svgs/VerifiedBadge.tsx +37 -0
- package/src/components/svgs/VideoIcon.tsx +28 -0
- package/src/components/svgs/X.tsx +35 -0
- package/src/components/svgs/index.ts +54 -0
- package/src/constants/icons.ts +87 -0
- package/src/constants/index.ts +109 -0
- package/src/constants/notifications.ts +14 -0
- package/src/constants/skills.ts +2202 -0
- package/src/declaration.d.ts +21 -0
- package/src/helpers/__tests__/credentialFormat.helpers.test.ts +100 -0
- package/src/helpers/color.helpers.ts +35 -0
- package/src/helpers/credential.helpers.test.ts +108 -0
- package/src/helpers/credential.helpers.tsx +249 -0
- package/src/helpers/credentialFormat.helpers.ts +68 -0
- package/src/helpers/did-display.helpers.ts +230 -0
- package/src/helpers/display.helpers.ts +53 -0
- package/src/helpers/string.helpers.ts +7 -0
- package/src/helpers/test.helpers.ts +680 -0
- package/src/helpers/url.helpers.ts +3 -0
- package/src/helpers/useHorizontalPages.ts +130 -0
- package/src/helpers/useOnMomentumScrollEnd.ts +28 -0
- package/src/helpers/useScrollBorders.ts +59 -0
- package/src/helpers/video.helpers.ts +125 -0
- package/src/hooks/useCredentialFormat.tsx +23 -0
- package/src/hooks/useParsedSdJwtVc.tsx +64 -0
- package/src/index.ts +16 -0
- package/src/types/index.ts +390 -0
- package/LICENSE +0 -21
- package/dist/cjs/SchoolIDCard-e22d0d80.js.map +0 -1
- package/dist/cjs/VCDisplayCard2-6c87eade.js.map +0 -1
- package/dist/cjs/VerifierStateBadgeAndText-5229da1a.js.map +0 -1
- package/dist/cjs/credential.helpers-473e89c5.js.map +0 -1
- package/dist/cjs/index-0cac2c5b.js.map +0 -1
- package/dist/cjs/types.esm-12bb5eed.js.map +0 -1
- package/dist/esm/SchoolIDCard-8b151cd3.js.map +0 -1
- package/dist/esm/VCDisplayCard2-c6a81e42.js.map +0 -1
- package/dist/esm/VerifierStateBadgeAndText-6946e820.js.map +0 -1
- package/dist/esm/credential.helpers-ff461699.js.map +0 -1
- package/dist/esm/index-2ef835bd.js.map +0 -1
- package/dist/esm/index-eae3ca64.js.map +0 -1
- package/dist/esm/types.esm-f32fc00a.js.map +0 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
type TruncateTextBoxProps = {
|
|
4
|
+
headerText?: string;
|
|
5
|
+
headerClassName?: string;
|
|
6
|
+
|
|
7
|
+
// the text to be truncated if it's too long
|
|
8
|
+
text: string;
|
|
9
|
+
|
|
10
|
+
truncateThreshold?: number;
|
|
11
|
+
|
|
12
|
+
// extra things to put at the bottom of the box
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
|
|
16
|
+
// container styles
|
|
17
|
+
containerClassName?: string;
|
|
18
|
+
// text styles
|
|
19
|
+
textClassName?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const TruncateTextBox: React.FC<TruncateTextBoxProps> = ({
|
|
23
|
+
headerText = '',
|
|
24
|
+
headerClassName = '',
|
|
25
|
+
text,
|
|
26
|
+
truncateThreshold = 132,
|
|
27
|
+
children,
|
|
28
|
+
className = 'truncate-text-box',
|
|
29
|
+
containerClassName = '',
|
|
30
|
+
textClassName = '',
|
|
31
|
+
}) => {
|
|
32
|
+
const needsTruncate = text?.length > truncateThreshold;
|
|
33
|
+
const [showFullText, setShowFullText] = useState(false);
|
|
34
|
+
const truncated = needsTruncate && !showFullText;
|
|
35
|
+
|
|
36
|
+
const displayText = truncated ? text.substring(0, truncateThreshold) : text;
|
|
37
|
+
|
|
38
|
+
const defaultStyles = 'shadow-bottom px-[15px] py-[20px]';
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
className={`${className} ${defaultStyles} bg-white flex flex-col items-start gap-[10px] rounded-[20px] w-full ${containerClassName}`}
|
|
43
|
+
>
|
|
44
|
+
{headerText && (
|
|
45
|
+
<h3 className={`${headerClassName} text-[20px] leading-[20px] text-grayscale-900`}>
|
|
46
|
+
{headerText}
|
|
47
|
+
</h3>
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
<p
|
|
51
|
+
className={`text-[12px] text-grayscale-700 leading-[18px] font-poppins font-[400] mb-0 ${textClassName}`}
|
|
52
|
+
>
|
|
53
|
+
{displayText}
|
|
54
|
+
{truncated && (
|
|
55
|
+
<>
|
|
56
|
+
...{' '}
|
|
57
|
+
<button
|
|
58
|
+
className="text-indigo-500 font-[700]"
|
|
59
|
+
onClick={e => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
setShowFullText(true);
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
More
|
|
65
|
+
</button>
|
|
66
|
+
</>
|
|
67
|
+
)}
|
|
68
|
+
{needsTruncate && showFullText && (
|
|
69
|
+
<>
|
|
70
|
+
{' '}
|
|
71
|
+
<button
|
|
72
|
+
className="text-indigo-500 font-[700]"
|
|
73
|
+
onClick={e => {
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
setShowFullText(false);
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
Close
|
|
79
|
+
</button>
|
|
80
|
+
</>
|
|
81
|
+
)}
|
|
82
|
+
</p>
|
|
83
|
+
|
|
84
|
+
{children}
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default TruncateTextBox;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import { Flipped as UntypedFlipped } from 'react-flip-toolkit';
|
|
4
|
+
|
|
5
|
+
import MediaAttachmentsBox from './MediaAttachmentsBox';
|
|
6
|
+
import TruncateTextBox from './TruncateTextBox';
|
|
7
|
+
import SkillsBox from './SkillsBox';
|
|
8
|
+
import IssueHistoryBox from './IssueHistoryBox';
|
|
9
|
+
import { VC, VerificationItem } from '@learncard/types';
|
|
10
|
+
import VerificationsBox from './VerificationsBox';
|
|
11
|
+
import AlignmentsBox from '../CertificateDisplayCard/AlignmentsBox';
|
|
12
|
+
import {
|
|
13
|
+
BoostAchievementCredential,
|
|
14
|
+
IssueHistory,
|
|
15
|
+
MediaMetadata,
|
|
16
|
+
VideoMetadata,
|
|
17
|
+
} from '../../types';
|
|
18
|
+
import LeftArrow from '../svgs/LeftArrow';
|
|
19
|
+
|
|
20
|
+
type FlippedComponentProps = React.PropsWithChildren<{
|
|
21
|
+
flipId?: string;
|
|
22
|
+
inverseFlipId?: string;
|
|
23
|
+
scale?: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
const Flipped = UntypedFlipped as unknown as React.FC<FlippedComponentProps>;
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
const defaultTagsToSkills = (tags: string[]) => {
|
|
30
|
+
const skillsObj: { [skill: string]: string[] } = {};
|
|
31
|
+
tags.forEach(tag => {
|
|
32
|
+
skillsObj[tag] = [];
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
type VC2BackFaceProps = {
|
|
38
|
+
credential: VC | BoostAchievementCredential;
|
|
39
|
+
verificationItems: VerificationItem[];
|
|
40
|
+
// convertTagsToSkills?: (tags: string[]) => { [skill: string]: string[] };
|
|
41
|
+
getFileMetadata?: (url: string) => MediaMetadata;
|
|
42
|
+
getVideoMetadata?: (url: string) => VideoMetadata;
|
|
43
|
+
onMediaAttachmentClick?: (url: string, type: 'photo' | 'document' | 'video' | 'link') => void;
|
|
44
|
+
issueHistory?: IssueHistory[];
|
|
45
|
+
showBackButton?: boolean;
|
|
46
|
+
showFrontFace: () => void;
|
|
47
|
+
customDescription?: React.ReactNode;
|
|
48
|
+
customCriteria?: React.ReactNode;
|
|
49
|
+
customSkillsComponent?: React.ReactNode;
|
|
50
|
+
customIssueHistoryComponent?: React.ReactNode;
|
|
51
|
+
enableLightbox?: boolean;
|
|
52
|
+
customLinkedCredentialsComponent?: React.ReactNode;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const VC2BackFace: React.FC<VC2BackFaceProps> = ({
|
|
56
|
+
credential,
|
|
57
|
+
verificationItems,
|
|
58
|
+
// convertTagsToSkills = defaultTagsToSkills,
|
|
59
|
+
getFileMetadata,
|
|
60
|
+
getVideoMetadata,
|
|
61
|
+
onMediaAttachmentClick,
|
|
62
|
+
issueHistory,
|
|
63
|
+
showBackButton,
|
|
64
|
+
showFrontFace,
|
|
65
|
+
customDescription,
|
|
66
|
+
customCriteria,
|
|
67
|
+
customSkillsComponent,
|
|
68
|
+
customIssueHistoryComponent,
|
|
69
|
+
enableLightbox,
|
|
70
|
+
customLinkedCredentialsComponent,
|
|
71
|
+
}) => {
|
|
72
|
+
const expiration = credential.expirationDate
|
|
73
|
+
? format(new Date(credential.expirationDate), 'MMM dd, yyyy')
|
|
74
|
+
: undefined;
|
|
75
|
+
|
|
76
|
+
const isExpired =
|
|
77
|
+
credential.expirationDate &&
|
|
78
|
+
Number(new Date(credential.expirationDate)) < Number(new Date());
|
|
79
|
+
|
|
80
|
+
const achievement =
|
|
81
|
+
'achievement' in credential.credentialSubject
|
|
82
|
+
? credential.credentialSubject.achievement
|
|
83
|
+
: undefined;
|
|
84
|
+
const criteria = achievement?.criteria?.narrative;
|
|
85
|
+
const description = achievement?.description;
|
|
86
|
+
const alignment = achievement?.alignment;
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
const tags = credential.credentialSubject.achievement?.tag;
|
|
90
|
+
const skillsObject = tags && tags.length > 0 ? convertTagsToSkills(tags) : undefined;
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Flipped inverseFlipId="card">
|
|
95
|
+
<section className="vc-back-face flex flex-col gap-[20px] w-full px-[15px] pb-[25px]">
|
|
96
|
+
{showBackButton && (
|
|
97
|
+
<div className="w-full">
|
|
98
|
+
<button
|
|
99
|
+
className="vc-card-back-button rounded-full h-[50px] px-[15px] flex items-center justify-center gap-[5px] z-50 text-[30px] text-white select-none"
|
|
100
|
+
onClick={showFrontFace}
|
|
101
|
+
>
|
|
102
|
+
<LeftArrow className="text-white" size="25" />
|
|
103
|
+
Details
|
|
104
|
+
</button>
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
107
|
+
|
|
108
|
+
{customDescription && (
|
|
109
|
+
<TruncateTextBox
|
|
110
|
+
headerText="About"
|
|
111
|
+
text={description}
|
|
112
|
+
className="description-box"
|
|
113
|
+
>
|
|
114
|
+
{customDescription}
|
|
115
|
+
</TruncateTextBox>
|
|
116
|
+
)}
|
|
117
|
+
{!customDescription && (description || expiration) && (
|
|
118
|
+
<TruncateTextBox
|
|
119
|
+
headerText="About"
|
|
120
|
+
text={description}
|
|
121
|
+
className="description-box"
|
|
122
|
+
>
|
|
123
|
+
{expiration && (
|
|
124
|
+
<p className="text-grayscale-800 font-poppins font-[600] text-[12px] leading-[18px] mb-0">
|
|
125
|
+
Expire{isExpired ? 'd' : 's'} on {expiration}
|
|
126
|
+
</p>
|
|
127
|
+
)}
|
|
128
|
+
</TruncateTextBox>
|
|
129
|
+
)}
|
|
130
|
+
|
|
131
|
+
{customCriteria && (
|
|
132
|
+
<TruncateTextBox
|
|
133
|
+
headerText="Criteria"
|
|
134
|
+
text={description}
|
|
135
|
+
className="description-box"
|
|
136
|
+
>
|
|
137
|
+
{customCriteria}
|
|
138
|
+
</TruncateTextBox>
|
|
139
|
+
)}
|
|
140
|
+
{!customCriteria && criteria && (
|
|
141
|
+
<TruncateTextBox
|
|
142
|
+
headerText="Criteria"
|
|
143
|
+
text={criteria}
|
|
144
|
+
className="criteria-box"
|
|
145
|
+
/>
|
|
146
|
+
)}
|
|
147
|
+
|
|
148
|
+
{customLinkedCredentialsComponent && customLinkedCredentialsComponent}
|
|
149
|
+
|
|
150
|
+
{(credential.skills?.length ?? 0) > 0 &&
|
|
151
|
+
(customSkillsComponent ? (
|
|
152
|
+
customSkillsComponent
|
|
153
|
+
) : (
|
|
154
|
+
<SkillsBox skills={credential.skills ?? []} />
|
|
155
|
+
))}
|
|
156
|
+
|
|
157
|
+
{issueHistory && issueHistory?.length > 0 && (
|
|
158
|
+
<IssueHistoryBox
|
|
159
|
+
issueHistory={issueHistory}
|
|
160
|
+
customIssueHistoryComponent={customIssueHistoryComponent}
|
|
161
|
+
/>
|
|
162
|
+
)}
|
|
163
|
+
|
|
164
|
+
{credential.attachments && credential.attachments.length > 0 && (
|
|
165
|
+
<MediaAttachmentsBox
|
|
166
|
+
attachments={credential.attachments}
|
|
167
|
+
getFileMetadata={getFileMetadata}
|
|
168
|
+
getVideoMetadata={getVideoMetadata}
|
|
169
|
+
onMediaAttachmentClick={onMediaAttachmentClick}
|
|
170
|
+
enableLightbox={enableLightbox}
|
|
171
|
+
/>
|
|
172
|
+
)}
|
|
173
|
+
{/* {credential.notes && <TruncateTextBox headerText="Notes" text={credential.notes} />} */}
|
|
174
|
+
|
|
175
|
+
{alignment && <AlignmentsBox alignment={alignment} style="boost" />}
|
|
176
|
+
|
|
177
|
+
{verificationItems && verificationItems.length > 0 && (
|
|
178
|
+
<VerificationsBox verificationItems={verificationItems} />
|
|
179
|
+
)}
|
|
180
|
+
</section>
|
|
181
|
+
</Flipped>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export default VC2BackFace;
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Flipped as UntypedFlipped } from 'react-flip-toolkit';
|
|
3
|
+
|
|
4
|
+
import UserProfilePicture from '../UserProfilePicture/UserProfilePicture';
|
|
5
|
+
|
|
6
|
+
import { getImageFromProfile, getInfoFromCredential } from '../../helpers/credential.helpers';
|
|
7
|
+
import { resolveProfileDisplay } from '../../helpers/did-display.helpers';
|
|
8
|
+
import { isAppDidWeb } from '@learncard/helpers';
|
|
9
|
+
import { Profile, VC } from '@learncard/types';
|
|
10
|
+
import VerifierStateBadgeAndText, {
|
|
11
|
+
VerifierState,
|
|
12
|
+
VERIFIER_STATES,
|
|
13
|
+
} from '../CertificateDisplayCard/VerifierStateBadgeAndText';
|
|
14
|
+
import { BoostAchievementCredential } from '../../types';
|
|
15
|
+
import { KnownDIDRegistryType } from '../../types';
|
|
16
|
+
|
|
17
|
+
type FlippedComponentProps = React.PropsWithChildren<{
|
|
18
|
+
flipId?: string;
|
|
19
|
+
inverseFlipId?: string;
|
|
20
|
+
scale?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
const Flipped = UntypedFlipped as unknown as React.FC<FlippedComponentProps>;
|
|
24
|
+
|
|
25
|
+
type VC2FrontFaceInfoProps = {
|
|
26
|
+
credential: VC | BoostAchievementCredential;
|
|
27
|
+
issuee: Profile | string;
|
|
28
|
+
issuer: Profile | string;
|
|
29
|
+
title: string;
|
|
30
|
+
subjectDID?: string | undefined;
|
|
31
|
+
subjectImageComponent?: React.ReactNode;
|
|
32
|
+
issuerImageComponent?: React.ReactNode;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
imageUrl?: string;
|
|
35
|
+
customBodyCardComponent?: React.ReactNode;
|
|
36
|
+
customThumbComponent?: React.ReactNode;
|
|
37
|
+
knownDIDRegistry?: KnownDIDRegistryType;
|
|
38
|
+
customBodyContentSlot?: React.ReactNode;
|
|
39
|
+
unknownVerifierTitle?: string;
|
|
40
|
+
onVerifierClick?: (
|
|
41
|
+
event: React.MouseEvent<HTMLButtonElement>,
|
|
42
|
+
verifierState: VerifierState
|
|
43
|
+
) => void;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const BadgeThumbnailPlaceholder: React.FC = () => (
|
|
47
|
+
<svg
|
|
48
|
+
viewBox="0 0 24 24"
|
|
49
|
+
fill="none"
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
className="w-1/2 h-1/2 text-grayscale-400"
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
>
|
|
54
|
+
<circle cx="12" cy="9" r="6" stroke="currentColor" strokeWidth="1.75" />
|
|
55
|
+
<path
|
|
56
|
+
d="M8.5 14.5 7 22l5-3 5 3-1.5-7.5"
|
|
57
|
+
stroke="currentColor"
|
|
58
|
+
strokeWidth="1.75"
|
|
59
|
+
strokeLinecap="round"
|
|
60
|
+
strokeLinejoin="round"
|
|
61
|
+
/>
|
|
62
|
+
<path
|
|
63
|
+
d="M12 6.5 13 8.3l2 .3-1.4 1.4.3 2L12 11l-1.9.9.3-2L9 8.6l2-.3L12 6.5Z"
|
|
64
|
+
fill="currentColor"
|
|
65
|
+
/>
|
|
66
|
+
</svg>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
const VC2FrontFaceInfo: React.FC<VC2FrontFaceInfoProps> = ({
|
|
70
|
+
credential,
|
|
71
|
+
issuee,
|
|
72
|
+
issuer,
|
|
73
|
+
subjectDID,
|
|
74
|
+
subjectImageComponent,
|
|
75
|
+
issuerImageComponent,
|
|
76
|
+
customBodyCardComponent,
|
|
77
|
+
createdAt,
|
|
78
|
+
imageUrl,
|
|
79
|
+
customThumbComponent,
|
|
80
|
+
knownDIDRegistry,
|
|
81
|
+
customBodyContentSlot,
|
|
82
|
+
unknownVerifierTitle,
|
|
83
|
+
onVerifierClick,
|
|
84
|
+
}) => {
|
|
85
|
+
const issuerImage = getImageFromProfile(issuer ?? '');
|
|
86
|
+
const issueeImage = getImageFromProfile(issuee ?? '');
|
|
87
|
+
|
|
88
|
+
const [thumbErrored, setThumbErrored] = React.useState(false);
|
|
89
|
+
|
|
90
|
+
// Reset the broken-image flag whenever the thumbnail source changes.
|
|
91
|
+
React.useEffect(() => {
|
|
92
|
+
setThumbErrored(false);
|
|
93
|
+
}, [imageUrl]);
|
|
94
|
+
|
|
95
|
+
const issueeDisplay = resolveProfileDisplay(issuee, '');
|
|
96
|
+
const issuerDisplay = resolveProfileDisplay(issuer, '');
|
|
97
|
+
|
|
98
|
+
const { credentialSubject } = getInfoFromCredential(credential, 'MMM dd, yyyy', {
|
|
99
|
+
uppercaseDate: false,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const getImageElement = (
|
|
103
|
+
imageUrl: string,
|
|
104
|
+
alt: string,
|
|
105
|
+
overrideComponent: React.ReactNode | undefined,
|
|
106
|
+
avatarName: string,
|
|
107
|
+
avatarColor: string,
|
|
108
|
+
avatarFingerprintColor: string,
|
|
109
|
+
avatarTextClassName: string,
|
|
110
|
+
avatarSilhouetteClassName: string,
|
|
111
|
+
avatarFallbackVariant: 'initial' | 'fingerprint',
|
|
112
|
+
bigText?: boolean
|
|
113
|
+
) => {
|
|
114
|
+
if (overrideComponent) return overrideComponent;
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<UserProfilePicture
|
|
118
|
+
user={{ image: imageUrl, name: avatarName }}
|
|
119
|
+
alt={alt}
|
|
120
|
+
avatarColor={avatarColor}
|
|
121
|
+
avatarFingerprintColor={avatarFingerprintColor}
|
|
122
|
+
avatarTextClassName={avatarTextClassName}
|
|
123
|
+
avatarIconClassName={avatarSilhouetteClassName}
|
|
124
|
+
avatarSilhouetteClassName={avatarSilhouetteClassName}
|
|
125
|
+
avatarFallbackVariant={avatarFallbackVariant}
|
|
126
|
+
customContainerClass={`h-full w-full ${bigText ? '!text-4xl' : ''}`}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const issueeImageEl: React.ReactNode = getImageElement(
|
|
132
|
+
issueeImage,
|
|
133
|
+
'Issuee image',
|
|
134
|
+
subjectImageComponent,
|
|
135
|
+
issueeDisplay.avatarLetter,
|
|
136
|
+
issueeDisplay.avatarColor,
|
|
137
|
+
issueeDisplay.avatarFingerprintColor,
|
|
138
|
+
'text-3xl leading-normal',
|
|
139
|
+
'h-[43px] w-[43px]',
|
|
140
|
+
issueeDisplay.isDidValue ? 'fingerprint' : 'initial',
|
|
141
|
+
true
|
|
142
|
+
);
|
|
143
|
+
const issuerImageEl: React.ReactNode = getImageElement(
|
|
144
|
+
issuerImage,
|
|
145
|
+
'Issuer image',
|
|
146
|
+
issuerImageComponent,
|
|
147
|
+
issuerDisplay.avatarLetter,
|
|
148
|
+
issuerDisplay.avatarColor,
|
|
149
|
+
issuerDisplay.avatarFingerprintColor,
|
|
150
|
+
'text-xl leading-normal',
|
|
151
|
+
'h-[22px] w-[22px]',
|
|
152
|
+
issuerDisplay.isDidValue ? 'fingerprint' : 'initial'
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
const issuerDid =
|
|
156
|
+
typeof credential.issuer === 'string' ? credential.issuer : credential.issuer.id;
|
|
157
|
+
const isAppIssuerDid = isAppDidWeb(issuerDid);
|
|
158
|
+
|
|
159
|
+
let verifierState: VerifierState;
|
|
160
|
+
if (credentialSubject?.id === issuerDid && issuerDid && issuerDid !== 'did:example:123') {
|
|
161
|
+
// the extra "&& issuerDid" is so that the credential preview doesn't say "Self Verified"
|
|
162
|
+
// the did:example:123 condition is so that we don't show this status from the Manage Boosts tab
|
|
163
|
+
verifierState = VERIFIER_STATES.selfVerified;
|
|
164
|
+
} else if (unknownVerifierTitle) {
|
|
165
|
+
verifierState = VERIFIER_STATES.trustedVerifier;
|
|
166
|
+
} else {
|
|
167
|
+
if (knownDIDRegistry?.source === 'trusted') {
|
|
168
|
+
verifierState = VERIFIER_STATES.trustedVerifier;
|
|
169
|
+
} else if (knownDIDRegistry?.source === 'untrusted') {
|
|
170
|
+
verifierState = VERIFIER_STATES.untrustedVerifier;
|
|
171
|
+
} else if (knownDIDRegistry?.source === 'unknown') {
|
|
172
|
+
verifierState = isAppIssuerDid
|
|
173
|
+
? VERIFIER_STATES.appIssuer
|
|
174
|
+
: VERIFIER_STATES.unknownVerifier;
|
|
175
|
+
} else {
|
|
176
|
+
verifierState = isAppIssuerDid
|
|
177
|
+
? VERIFIER_STATES.appIssuer
|
|
178
|
+
: VERIFIER_STATES.unknownVerifier;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<Flipped inverseFlipId="card">
|
|
184
|
+
<section className="vc-front-face w-full px-[15px] flex flex-col items-center gap-[15px]">
|
|
185
|
+
{imageUrl &&
|
|
186
|
+
!customThumbComponent &&
|
|
187
|
+
(thumbErrored ? (
|
|
188
|
+
<div className="vc-front-image h-[130px] w-[130px] rounded-[10px] bg-grayscale-100 flex items-center justify-center">
|
|
189
|
+
<BadgeThumbnailPlaceholder />
|
|
190
|
+
</div>
|
|
191
|
+
) : (
|
|
192
|
+
<img
|
|
193
|
+
className="vc-front-image h-[130px] w-[130px] rounded-[10px] bg-white object-cover"
|
|
194
|
+
src={imageUrl}
|
|
195
|
+
alt="credential thumbnail"
|
|
196
|
+
onError={() => setThumbErrored(true)}
|
|
197
|
+
/>
|
|
198
|
+
))}
|
|
199
|
+
|
|
200
|
+
{customThumbComponent && customThumbComponent}
|
|
201
|
+
<div className="vc-issue-info-box bg-white flex flex-col items-center gap-[5px] rounded-[20px] shadow-bottom px-[15px] py-[20px] w-full">
|
|
202
|
+
{customBodyCardComponent && customBodyCardComponent}
|
|
203
|
+
|
|
204
|
+
{!customBodyCardComponent && (
|
|
205
|
+
<>
|
|
206
|
+
<h3 className="flex flex-col text-center leading-[130%] w-full">
|
|
207
|
+
{!issueeDisplay.isMissing && issueeDisplay.isDidValue && (
|
|
208
|
+
<span className="flex flex-wrap items-baseline justify-center gap-x-1 text-[17px] leading-normal font-[600] font-poppins max-w-full break-words">
|
|
209
|
+
<span className="text-grayscale-900">Digital ID:</span>
|
|
210
|
+
<span className="text-grayscale-500 underline">
|
|
211
|
+
{issueeDisplay.displayName}
|
|
212
|
+
</span>
|
|
213
|
+
</span>
|
|
214
|
+
)}
|
|
215
|
+
{!issueeDisplay.isMissing && !issueeDisplay.isDidValue && (
|
|
216
|
+
<span className="font-poppins font-semibold text-[20px] leading-[130%] max-w-full line-clamp-2 break-words text-grayscale-900">
|
|
217
|
+
{issueeDisplay.displayName}
|
|
218
|
+
</span>
|
|
219
|
+
)}
|
|
220
|
+
{subjectDID &&
|
|
221
|
+
!issueeDisplay.isDidValue &&
|
|
222
|
+
!issueeDisplay.isLCNetwork && (
|
|
223
|
+
<span className="text-[12px] text-grayscale-500 leading-[18px] font-poppins font-normal m-0 p-0">
|
|
224
|
+
{subjectDID}
|
|
225
|
+
</span>
|
|
226
|
+
)}
|
|
227
|
+
</h3>
|
|
228
|
+
<div className="relative">
|
|
229
|
+
<div className="vc-issuee-image h-[60px] w-[60px] rounded-full overflow-hidden bg-white">
|
|
230
|
+
{issueeImageEl}
|
|
231
|
+
</div>
|
|
232
|
+
<div className="vc-issuer-image h-[30px] w-[30px] rounded-full overflow-hidden absolute bottom-[-12px] right-[-12px] bg-white">
|
|
233
|
+
{issuerImageEl}
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
<div className="flex flex-col gap-[13px]">
|
|
237
|
+
<div className="vc-issue-details mt-[10px] flex flex-col items-center font-poppins text-[14px] leading-[20px]">
|
|
238
|
+
<span className="created-at text-grayscale-700">
|
|
239
|
+
{createdAt}
|
|
240
|
+
</span>
|
|
241
|
+
{!issuerDisplay.isMissing && (
|
|
242
|
+
<span className="issued-by max-w-full break-words text-center line-clamp-2 text-[14px]">
|
|
243
|
+
<span className="font-medium text-grayscale-900">
|
|
244
|
+
By
|
|
245
|
+
</span>{' '}
|
|
246
|
+
{issuerDisplay.isDidValue ? (
|
|
247
|
+
<span className="font-[600] font-poppins break-words">
|
|
248
|
+
<span className="text-grayscale-900">
|
|
249
|
+
Digital ID:
|
|
250
|
+
</span>{' '}
|
|
251
|
+
<span className="text-grayscale-500 underline">
|
|
252
|
+
{issuerDisplay.displayName}
|
|
253
|
+
</span>
|
|
254
|
+
</span>
|
|
255
|
+
) : (
|
|
256
|
+
<strong className="font-bold text-grayscale-900 break-words">
|
|
257
|
+
{issuerDisplay.displayName}
|
|
258
|
+
</strong>
|
|
259
|
+
)}
|
|
260
|
+
</span>
|
|
261
|
+
)}
|
|
262
|
+
</div>
|
|
263
|
+
<VerifierStateBadgeAndText
|
|
264
|
+
verifierState={verifierState}
|
|
265
|
+
unknownVerifierTitle={unknownVerifierTitle}
|
|
266
|
+
onClick={event => onVerifierClick?.(event, verifierState)}
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
</>
|
|
270
|
+
)}
|
|
271
|
+
|
|
272
|
+
{customBodyContentSlot && customBodyContentSlot}
|
|
273
|
+
</div>
|
|
274
|
+
</section>
|
|
275
|
+
</Flipped>
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export default VC2FrontFaceInfo;
|