@learncard/react 2.10.3 → 2.10.4
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-2d3cbb2c.js} +13 -1189
- package/dist/cjs/SchoolIDCard-2d3cbb2c.js.map +1 -0
- package/dist/cjs/{VCCard-deabc204.js → VCCard-5bb95d29.js} +3 -3
- package/dist/cjs/{VCCard-deabc204.js.map → VCCard-5bb95d29.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-f3f5c6c4.js} +28 -22
- package/dist/cjs/VCDisplayCard2-f3f5c6c4.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-47efbf5b.js +1186 -0
- package/dist/cjs/index-47efbf5b.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 +18 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index14.js +18 -17
- package/dist/cjs/index14.js.map +1 -1
- 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 +2 -1
- package/dist/cjs/index31.js.map +1 -1
- package/dist/cjs/index39.js +12 -11
- package/dist/cjs/index39.js.map +1 -1
- 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 +8 -7
- package/dist/cjs/index42.js.map +1 -1
- 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-fbd1cf6c.js} +12 -1188
- package/dist/esm/SchoolIDCard-fbd1cf6c.js.map +1 -0
- package/dist/esm/{VCCard-94dbe6bf.js → VCCard-ce4b451d.js} +3 -3
- package/dist/esm/{VCCard-94dbe6bf.js.map → VCCard-ce4b451d.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-db880bbb.js} +28 -22
- package/dist/esm/VCDisplayCard2-db880bbb.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-cbd2e9db.js +1184 -0
- package/dist/esm/index-cbd2e9db.js.map +1 -0
- package/dist/esm/index.js +18 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index14.js +18 -17
- package/dist/esm/index14.js.map +1 -1
- 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 +2 -1
- package/dist/esm/index31.js.map +1 -1
- package/dist/esm/index39.js +12 -11
- package/dist/esm/index39.js.map +1 -1
- 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 +8 -7
- package/dist/esm/index42.js.map +1 -1
- 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,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type BadgeThumbnailImgProps = {
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Tailwind color class for the placeholder glyph. Defaults to a neutral
|
|
9
|
+
* gray that reads well on light backgrounds; pass e.g. `text-white` when
|
|
10
|
+
* the thumbnail sits on a colored badge circle.
|
|
11
|
+
*/
|
|
12
|
+
placeholderClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Credential/badge thumbnail image with a graceful broken-image fallback.
|
|
17
|
+
*
|
|
18
|
+
* When `src` is empty or the image fails to load (404 / decode error), a
|
|
19
|
+
* neutral medal/badge glyph placeholder is rendered instead of the browser's
|
|
20
|
+
* broken-image icon. A white backing is applied to the image so transparent
|
|
21
|
+
* logos don't pick up whatever sits behind the thumbnail.
|
|
22
|
+
*
|
|
23
|
+
* This is the react-learn-card-local equivalent of learn-card-base's
|
|
24
|
+
* BadgeThumbnailImg (react-learn-card cannot depend on learn-card-base).
|
|
25
|
+
*/
|
|
26
|
+
const BadgeThumbnailImg: React.FC<BadgeThumbnailImgProps> = ({
|
|
27
|
+
src,
|
|
28
|
+
alt = 'badge thumbnail',
|
|
29
|
+
className = '',
|
|
30
|
+
placeholderClassName = 'text-grayscale-400',
|
|
31
|
+
}) => {
|
|
32
|
+
const [errored, setErrored] = React.useState(false);
|
|
33
|
+
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
setErrored(false);
|
|
36
|
+
}, [src]);
|
|
37
|
+
|
|
38
|
+
if (!src || errored) {
|
|
39
|
+
return (
|
|
40
|
+
<div className="flex h-full w-full items-center justify-center">
|
|
41
|
+
<svg
|
|
42
|
+
viewBox="0 0 24 24"
|
|
43
|
+
fill="none"
|
|
44
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
+
className={`w-1/2 h-1/2 ${placeholderClassName}`}
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
data-testid="badge-thumbnail-placeholder"
|
|
48
|
+
>
|
|
49
|
+
<circle cx="12" cy="9" r="6" stroke="currentColor" strokeWidth="1.75" />
|
|
50
|
+
<path
|
|
51
|
+
d="M8.5 14.5 7 22l5-3 5 3-1.5-7.5"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
strokeWidth="1.75"
|
|
54
|
+
strokeLinecap="round"
|
|
55
|
+
strokeLinejoin="round"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<img
|
|
64
|
+
src={src}
|
|
65
|
+
alt={alt}
|
|
66
|
+
className={`bg-white ${className}`}
|
|
67
|
+
onError={() => setErrored(true)}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default BadgeThumbnailImg;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PuzzlePiece from '../svgs/PuzzlePiece';
|
|
3
|
+
import { VC } from '@learncard/types';
|
|
4
|
+
import { categorizeSkills } from '../../helpers/credential.helpers';
|
|
5
|
+
|
|
6
|
+
type AlignmentSkillsCountProps = {
|
|
7
|
+
credential?: VC;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const AlignmentSkillsCount: React.FC<AlignmentSkillsCountProps> = ({
|
|
13
|
+
credential,
|
|
14
|
+
onClick,
|
|
15
|
+
className = '',
|
|
16
|
+
}) => {
|
|
17
|
+
if (!credential) return <></>;
|
|
18
|
+
|
|
19
|
+
const achievement = (credential?.credentialSubject as any)?.achievement;
|
|
20
|
+
let alignmentCount = achievement?.alignment?.length || 0;
|
|
21
|
+
|
|
22
|
+
if (alignmentCount === 0 && credential.skills?.length > 0) {
|
|
23
|
+
// fallback to legacy skills field if present and no alignments
|
|
24
|
+
const skillsMap = categorizeSkills(credential.skills ?? []);
|
|
25
|
+
|
|
26
|
+
// Calculate total count of skills and subskills
|
|
27
|
+
const totalSkills: any = Object.values(skillsMap).reduce(
|
|
28
|
+
(total: any, category: any) => total + category?.length,
|
|
29
|
+
0
|
|
30
|
+
);
|
|
31
|
+
const totalSubskills: any = Object.values(skillsMap).reduce(
|
|
32
|
+
(total: any, category: any) => total + (category?.totalSubskillsCount || 0),
|
|
33
|
+
0
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const total: any = totalSkills + totalSubskills;
|
|
37
|
+
alignmentCount = total;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
role={onClick ? ('button' as const) : undefined}
|
|
43
|
+
onClick={onClick}
|
|
44
|
+
className={`px-[10px] py-[2px] flex gap-[3px] items-center rounded-[5px] overflow-hidden bg-violet-100 ${className}`}
|
|
45
|
+
>
|
|
46
|
+
<PuzzlePiece className="w-[20px] h-[20px] text-grayscale-800" version="filled" />
|
|
47
|
+
<p className="text-[12px] text-grayscale-800 font-poppins font-[600]">
|
|
48
|
+
{`${alignmentCount} Skill${alignmentCount !== 1 ? 's' : ''}`}
|
|
49
|
+
</p>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default AlignmentSkillsCount;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Story, Meta } from '@storybook/react';
|
|
3
|
+
import BoostGenericCard from './BoostGenericCard';
|
|
4
|
+
import { BoostGenericCardProps, WalletCategoryTypes } from '../../types';
|
|
5
|
+
import { AllFieldsCredential } from '../../helpers/test.helpers';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Boost Generic Card',
|
|
9
|
+
component: BoostGenericCard,
|
|
10
|
+
argTypes: {},
|
|
11
|
+
} as Meta<typeof BoostGenericCard>;
|
|
12
|
+
|
|
13
|
+
const Template: Story<BoostGenericCardProps> = args => <BoostGenericCard {...args} />;
|
|
14
|
+
|
|
15
|
+
export const BoostGenericCardTest = Template.bind({});
|
|
16
|
+
BoostGenericCardTest.args = {
|
|
17
|
+
title: 'Title Title Title',
|
|
18
|
+
type: WalletCategoryTypes.skills,
|
|
19
|
+
thumbImgSrc: '',
|
|
20
|
+
bgImgSrc: 'https://picsum.photos/200',
|
|
21
|
+
dateDisplay: 'May 21, 2022',
|
|
22
|
+
issuerName: 'Beau Bobby Bruce',
|
|
23
|
+
innerOnClick: () => console.log('innerOnClick'),
|
|
24
|
+
optionsTriggerOnClick: () => console.log('//options trigger click'),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const InSkillsModal = Template.bind({});
|
|
28
|
+
InSkillsModal.args = {
|
|
29
|
+
title: 'Title Title Title',
|
|
30
|
+
type: WalletCategoryTypes.skills,
|
|
31
|
+
thumbImgSrc: '',
|
|
32
|
+
bgImgSrc: 'https://picsum.photos/200',
|
|
33
|
+
dateDisplay: 'May 21, 2022',
|
|
34
|
+
issuerName: 'Beau Bobby Bruce',
|
|
35
|
+
innerOnClick: () => console.log('innerOnClick'),
|
|
36
|
+
optionsTriggerOnClick: () => console.log('//options trigger click'),
|
|
37
|
+
isInSkillsModal: true,
|
|
38
|
+
credential: AllFieldsCredential,
|
|
39
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoostGenericCardProps, WalletCategoryTypes } from '../../types';
|
|
3
|
+
import { TYPE_TO_IMG_SRC, TYPE_TO_WALLET_DARK_COLOR } from '../../constants';
|
|
4
|
+
import { DisplayTypeEnum, getDisplayIcon } from '../../helpers/display.helpers';
|
|
5
|
+
import AlignmentSkillsCount from './AlignmentSkillsCount';
|
|
6
|
+
import ThreeDotVertical from '../svgs/ThreeDotVertical';
|
|
7
|
+
import { CircleCheckButton } from '../CircleCheckButton';
|
|
8
|
+
import BadgeThumbnailImg from '../BadgeThumbnailImg/BadgeThumbnailImg';
|
|
9
|
+
|
|
10
|
+
export const BoostGenericCard: React.FC<BoostGenericCardProps> = ({
|
|
11
|
+
title,
|
|
12
|
+
customTitle,
|
|
13
|
+
thumbImgSrc,
|
|
14
|
+
customThumbClass = '',
|
|
15
|
+
customHeaderClass = '',
|
|
16
|
+
type = WalletCategoryTypes.achievements,
|
|
17
|
+
className,
|
|
18
|
+
onCheckClick,
|
|
19
|
+
showChecked,
|
|
20
|
+
checkStatus,
|
|
21
|
+
customThumbComponent,
|
|
22
|
+
innerOnClick,
|
|
23
|
+
bgImgSrc,
|
|
24
|
+
issuerName,
|
|
25
|
+
customIssuerName,
|
|
26
|
+
dateDisplay,
|
|
27
|
+
customDateDisplay,
|
|
28
|
+
optionsTriggerOnClick,
|
|
29
|
+
verifierBadge,
|
|
30
|
+
credential,
|
|
31
|
+
isInSkillsModal,
|
|
32
|
+
displayType,
|
|
33
|
+
linkedCredentialsCount = 0,
|
|
34
|
+
linkedCredentialsClassName = '',
|
|
35
|
+
checkBtnClass = '',
|
|
36
|
+
}) => {
|
|
37
|
+
const thumbClass = TYPE_TO_WALLET_DARK_COLOR[type]
|
|
38
|
+
? `bg-${TYPE_TO_WALLET_DARK_COLOR[type]}`
|
|
39
|
+
: 'bg-grayscale-50';
|
|
40
|
+
const defaultThumbClass = `small-boost-card-thumb flex h-[110px] w-[110px] my-[10px] mx-auto ${thumbClass} overflow-hidden flex-col justify-center items-center rounded-full ${customThumbClass}`;
|
|
41
|
+
const imgSrc = thumbImgSrc?.trim() !== '' ? thumbImgSrc : TYPE_TO_IMG_SRC[type];
|
|
42
|
+
|
|
43
|
+
const handleInnerClick = () => innerOnClick?.();
|
|
44
|
+
const handleOptionsClick = () => optionsTriggerOnClick?.();
|
|
45
|
+
|
|
46
|
+
const DisplayIcon = getDisplayIcon(displayType as DisplayTypeEnum);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
className={`flex bg-white flex-col shadow-bottom relative p-0 w-[160px] h-[285px] rounded-[20px] overflow-hidden ${className}`}
|
|
51
|
+
>
|
|
52
|
+
{optionsTriggerOnClick && (
|
|
53
|
+
<section
|
|
54
|
+
className="absolute cursor-pointer h-[30px] w-[30px] top-[5px] right-[5px] rounded-full bg-white/70 flex items-center justify-center z-20"
|
|
55
|
+
onClick={handleOptionsClick}
|
|
56
|
+
>
|
|
57
|
+
<ThreeDotVertical className="h-[20px] w-[20px] text-grayscale-900" />
|
|
58
|
+
</section>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
{bgImgSrc && (
|
|
62
|
+
<section className="absolute top-[-50px] left-0 rounded-b-full overflow-hidden z-0">
|
|
63
|
+
<img className="h-full w-full object-cover" src={bgImgSrc} />
|
|
64
|
+
</section>
|
|
65
|
+
)}
|
|
66
|
+
|
|
67
|
+
<button
|
|
68
|
+
type="button"
|
|
69
|
+
className="z-10 flex flex-col flex-grow"
|
|
70
|
+
onClick={handleInnerClick}
|
|
71
|
+
>
|
|
72
|
+
{/* Thumbnail */}
|
|
73
|
+
{customThumbComponent || (
|
|
74
|
+
<section className={defaultThumbClass}>
|
|
75
|
+
{thumbImgSrc?.trim() ? (
|
|
76
|
+
<BadgeThumbnailImg
|
|
77
|
+
className="w-full h-full rounded-full object-cover"
|
|
78
|
+
src={thumbImgSrc}
|
|
79
|
+
alt="Credential Achievement"
|
|
80
|
+
/>
|
|
81
|
+
) : (
|
|
82
|
+
<img
|
|
83
|
+
className="max-w-full p-0 object-cover rounded-full"
|
|
84
|
+
src={imgSrc}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
</section>
|
|
88
|
+
)}
|
|
89
|
+
|
|
90
|
+
{/* Details Section: grows to fill available space */}
|
|
91
|
+
<section
|
|
92
|
+
className={`flex flex-col flex-grow items-center justify-end pt-1 w-full ${
|
|
93
|
+
linkedCredentialsCount === 0 ? 'pb-[20px]' : ''
|
|
94
|
+
}`}
|
|
95
|
+
>
|
|
96
|
+
<div className="px-1 flex flex-col items-center justify-center w-full">
|
|
97
|
+
{/* Title - dynamically size based on length */}
|
|
98
|
+
{!customTitle ? (
|
|
99
|
+
<p
|
|
100
|
+
className={`
|
|
101
|
+
${customHeaderClass}
|
|
102
|
+
font-medium text-center text-grayscale-900 line-clamp-2
|
|
103
|
+
h-[50px] flex items-center justify-center
|
|
104
|
+
${
|
|
105
|
+
(title?.length ?? 0) > 35
|
|
106
|
+
? 'text-[13px] leading-tight'
|
|
107
|
+
: 'text-[16px]'
|
|
108
|
+
}
|
|
109
|
+
`}
|
|
110
|
+
title={title}
|
|
111
|
+
>
|
|
112
|
+
{title}
|
|
113
|
+
</p>
|
|
114
|
+
) : (
|
|
115
|
+
customTitle
|
|
116
|
+
)}
|
|
117
|
+
|
|
118
|
+
{/* Verifier & Issuer */}
|
|
119
|
+
<div className="mt-1 w-full px-4 text-center">
|
|
120
|
+
<span className="line-clamp-2 break-words text-[12px] leading-snug text-grayscale-700">
|
|
121
|
+
{verifierBadge && (
|
|
122
|
+
<span className="mr-1 inline-block align-middle">
|
|
123
|
+
{verifierBadge}
|
|
124
|
+
</span>
|
|
125
|
+
)}
|
|
126
|
+
{customIssuerName || (
|
|
127
|
+
<span className="font-bold">{issuerName}</span>
|
|
128
|
+
)}
|
|
129
|
+
</span>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
{/* Date */}
|
|
133
|
+
{customDateDisplay || (
|
|
134
|
+
<span className="text-[11px] text-grayscale-700 mt-1">
|
|
135
|
+
{dateDisplay}
|
|
136
|
+
</span>
|
|
137
|
+
)}
|
|
138
|
+
|
|
139
|
+
{/* Skills count if in modal */}
|
|
140
|
+
{isInSkillsModal && credential && (
|
|
141
|
+
<AlignmentSkillsCount
|
|
142
|
+
credential={credential}
|
|
143
|
+
onClick={handleInnerClick}
|
|
144
|
+
className="mt-[16px]"
|
|
145
|
+
/>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
{/* Linked Credentials moved inside details */}
|
|
150
|
+
{linkedCredentialsCount > 0 && (
|
|
151
|
+
<div
|
|
152
|
+
className={`mt-auto flex items-center justify-center py-1 w-full ${linkedCredentialsClassName}`}
|
|
153
|
+
>
|
|
154
|
+
<DisplayIcon className="h-[20px] w-[20px] text-grayscale-900" />
|
|
155
|
+
<span className="ml-1 text-sm font-semibold text-grayscale-900">
|
|
156
|
+
+{linkedCredentialsCount} Linked
|
|
157
|
+
</span>
|
|
158
|
+
</div>
|
|
159
|
+
)}
|
|
160
|
+
</section>
|
|
161
|
+
</button>
|
|
162
|
+
|
|
163
|
+
{/* Optional Check Button overlay */}
|
|
164
|
+
{showChecked && (
|
|
165
|
+
<div className="absolute top-[5px] left-[5px] z-20">
|
|
166
|
+
<CircleCheckButton
|
|
167
|
+
checked={checkStatus}
|
|
168
|
+
onClick={onCheckClick}
|
|
169
|
+
className={checkBtnClass}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
)}
|
|
173
|
+
</div>
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export default BoostGenericCard;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Story, Meta } from '@storybook/react';
|
|
3
|
+
import BoostSmallCard from './BoostSmallCard';
|
|
4
|
+
import { BoostSmallCardProps, WalletCategoryTypes } from '../../types';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Boost Small Card',
|
|
8
|
+
component: BoostSmallCard,
|
|
9
|
+
argTypes: {},
|
|
10
|
+
} as Meta<typeof BoostSmallCard>;
|
|
11
|
+
|
|
12
|
+
const Template: Story<BoostSmallCardProps> = args => <BoostSmallCard {...args} />;
|
|
13
|
+
|
|
14
|
+
const issueHistoryDummyData = [
|
|
15
|
+
{
|
|
16
|
+
id: '1',
|
|
17
|
+
name: 'John Doe',
|
|
18
|
+
thumb: 'https://picsum.photos/200',
|
|
19
|
+
date: '2020-01-01',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: '2',
|
|
23
|
+
name: 'Jane Doe',
|
|
24
|
+
thumb: 'https://picsum.photos/200',
|
|
25
|
+
date: '2020-01-01',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: '3',
|
|
29
|
+
name: 'John Doe',
|
|
30
|
+
// thumb: 'https://picsum.photos/200',
|
|
31
|
+
date: '2020-01-01',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: '4',
|
|
35
|
+
name: 'John Doe',
|
|
36
|
+
thumb: 'https://picsum.photos/200',
|
|
37
|
+
date: '2020-01-01',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: '5',
|
|
41
|
+
name: 'John Doe',
|
|
42
|
+
thumb: 'https://picsum.photos/200',
|
|
43
|
+
date: '2020-01-01',
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export const BoostSmallCardTest = Template.bind({});
|
|
48
|
+
BoostSmallCardTest.args = {
|
|
49
|
+
title: 'Title Title Title',
|
|
50
|
+
issueHistory: issueHistoryDummyData,
|
|
51
|
+
type: WalletCategoryTypes.skills,
|
|
52
|
+
thumbImgSrc: '',
|
|
53
|
+
bgImgSrc: 'https://picsum.photos/200',
|
|
54
|
+
innerOnClick: () => console.log('innerOnClick'),
|
|
55
|
+
buttonOnClick: () => console.log('buttonOnClick'),
|
|
56
|
+
optionsTriggerOnClick: () => console.log('//options trigger click'),
|
|
57
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import CaretRightFilled from '../../assets/images/CaretRightFilled.svg';
|
|
4
|
+
import AddAwardLight from '../../assets/images/addawardlight.svg';
|
|
5
|
+
import ThreeDotVertical from '../svgs/ThreeDotVertical';
|
|
6
|
+
import UserProfilePicture from '../UserProfilePicture/UserProfilePicture';
|
|
7
|
+
import { CircleCheckButton } from '../CircleCheckButton';
|
|
8
|
+
import BadgeThumbnailImg from '../BadgeThumbnailImg/BadgeThumbnailImg';
|
|
9
|
+
|
|
10
|
+
import { BoostSmallCardProps, WalletCategoryTypes } from '../../types';
|
|
11
|
+
import { TYPE_TO_IMG_SRC, TYPE_TO_WALLET_DARK_COLOR } from '../../constants';
|
|
12
|
+
import { getDarkBGColor } from '../../helpers/color.helpers';
|
|
13
|
+
|
|
14
|
+
export const BoostSmallCard: React.FC<BoostSmallCardProps> = ({
|
|
15
|
+
title = 'Title Lorem Ipsum',
|
|
16
|
+
customTitle,
|
|
17
|
+
thumbImgSrc,
|
|
18
|
+
customThumbClass = '',
|
|
19
|
+
customHeaderClass = '',
|
|
20
|
+
type = WalletCategoryTypes.achievements,
|
|
21
|
+
className,
|
|
22
|
+
onCheckClick,
|
|
23
|
+
showChecked,
|
|
24
|
+
checkStatus,
|
|
25
|
+
arrowOnClick,
|
|
26
|
+
buttonOnClick,
|
|
27
|
+
customButtonComponent,
|
|
28
|
+
customBodyClass,
|
|
29
|
+
customBodyComponent,
|
|
30
|
+
customThumbComponent,
|
|
31
|
+
customDraftComponent,
|
|
32
|
+
innerOnClick,
|
|
33
|
+
issueHistory,
|
|
34
|
+
bgImgSrc,
|
|
35
|
+
optionsTriggerOnClick,
|
|
36
|
+
}) => {
|
|
37
|
+
const thumbClass = TYPE_TO_WALLET_DARK_COLOR[type]
|
|
38
|
+
? `bg-${TYPE_TO_WALLET_DARK_COLOR[type]}`
|
|
39
|
+
: 'bg-grayscale-50';
|
|
40
|
+
const defaultThumbClass = `small-boost-card-thumb flex h-[110px] w-[110px] my-[10px] mx-auto ${thumbClass} overflow-hidden flex-col justify-center items-center rounded-full ${customThumbClass}`;
|
|
41
|
+
const imgSrc = thumbImgSrc?.trim() !== '' ? thumbImgSrc : TYPE_TO_IMG_SRC[type];
|
|
42
|
+
const headerBgColor = getDarkBGColor(type);
|
|
43
|
+
const checkBtnClass = checkStatus ? 'generic-vc-card checked' : 'generic-vc-card unchecked';
|
|
44
|
+
const defaultHeaderClass = `flex generic-card-title w-full justify-center ${customHeaderClass}`;
|
|
45
|
+
const defaultBodyClass = ` boost-small-card-body flex justify-center items-center text-center text-[14px] overflow-hidden text-grayscale-500 py-[5px] px-[10px] ${customBodyClass}`;
|
|
46
|
+
const defaultButtonClass = `cursor-pointer small-boost-boost-btn flex boost-btn-click rounded-[40px] w-[140px] h-[48px] text-white flex justify-center items-center ${headerBgColor}`;
|
|
47
|
+
const innerClickContainerClass = `relative cursor-pointer boost-small-card inner-click-container z-10`;
|
|
48
|
+
|
|
49
|
+
const issueHistoryDisplay =
|
|
50
|
+
issueHistory && issueHistory?.length > 3 ? issueHistory?.slice(0, 3) : issueHistory;
|
|
51
|
+
const renderIssueHistory = issueHistoryDisplay?.map(issueItem => {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
key={issueItem?.id}
|
|
55
|
+
className="profile-thumb-img border-[1px] border-white border-solid vc-issuee-image h-[35px] w-[35px] rounded-full overflow-hidden mx-[-5px]"
|
|
56
|
+
>
|
|
57
|
+
<UserProfilePicture
|
|
58
|
+
customContainerClass={`h-full w-full object-cover ${
|
|
59
|
+
!issueItem?.thumb ? 'pt-[8px]' : ''
|
|
60
|
+
}`}
|
|
61
|
+
user={{ image: issueItem?.thumb, name: issueItem?.name }}
|
|
62
|
+
alt="profile"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const handleInnerClick = () => {
|
|
69
|
+
innerOnClick?.();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const handleOptionsClick = () => {
|
|
73
|
+
optionsTriggerOnClick?.();
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={`flex generic-display-card-simple bg-white flex-col shadow-bottom relative $ py-[0px] px-[0px] w-[160px] h-[280px] rounded-[20px] overflow-hidden ${className}`}
|
|
79
|
+
>
|
|
80
|
+
{optionsTriggerOnClick && (
|
|
81
|
+
<section
|
|
82
|
+
className="absolute cursor-pointer shadow-bottom h-[30px] w-[30px] top-[5px] right-[5px] rounded-full overflow-hidden z-20 bg-white/70 flex items-center justify-center"
|
|
83
|
+
onClick={handleOptionsClick}
|
|
84
|
+
>
|
|
85
|
+
<ThreeDotVertical className="h-[20px] w-[20px] z-50 text-grayscale-900" />
|
|
86
|
+
</section>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{bgImgSrc && (
|
|
90
|
+
<section className="absolute top-[-50px] shadow-bottom left-[0px] rounded-b-full overflow-hidden z-0 mt-3">
|
|
91
|
+
<img className="h-full w-full object-cover overflow-hidden" src={bgImgSrc} />
|
|
92
|
+
</section>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
<div className={innerClickContainerClass} onClick={handleInnerClick}>
|
|
96
|
+
{customThumbComponent}
|
|
97
|
+
{!customThumbComponent && (
|
|
98
|
+
<section className={defaultThumbClass}>
|
|
99
|
+
{thumbImgSrc && thumbImgSrc?.trim() !== '' && (
|
|
100
|
+
<BadgeThumbnailImg
|
|
101
|
+
className="generic-display-card-img h-full w-full w-[110px] h-[110px] rounded-full object-cover overflow-hidden"
|
|
102
|
+
src={thumbImgSrc ?? ''}
|
|
103
|
+
alt="Credential Achievement Image"
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
{(!thumbImgSrc || thumbImgSrc?.trim() === '') && (
|
|
107
|
+
<img
|
|
108
|
+
className="max-w-[110px] w-full h-full p-[0px] object-cover rounded-full"
|
|
109
|
+
src={imgSrc}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
</section>
|
|
113
|
+
)}
|
|
114
|
+
|
|
115
|
+
{customTitle && customTitle}
|
|
116
|
+
{!customTitle && (
|
|
117
|
+
<section className={defaultHeaderClass}>
|
|
118
|
+
<p className="relative z-[100] small-boost-title text-[16px] leading-[130%] p-[0px] font-medium text-center line-clamp-2">
|
|
119
|
+
{title}
|
|
120
|
+
</p>
|
|
121
|
+
</section>
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
<section className={defaultBodyClass}>
|
|
125
|
+
{customBodyComponent && customBodyComponent}
|
|
126
|
+
{!customBodyComponent &&
|
|
127
|
+
issueHistory &&
|
|
128
|
+
issueHistory?.length > 0 &&
|
|
129
|
+
renderIssueHistory}
|
|
130
|
+
{!customBodyComponent && issueHistory && issueHistory?.length > 3 && (
|
|
131
|
+
<span className="small-boost-issue-count ml-[10px] font-semibold">
|
|
132
|
+
+{issueHistory?.length - 3}
|
|
133
|
+
</span>
|
|
134
|
+
)}
|
|
135
|
+
</section>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<section className="small-boost-card-footer flex justify-center items-center absolute bottom-[15px] w-full">
|
|
139
|
+
{customButtonComponent && customButtonComponent}
|
|
140
|
+
|
|
141
|
+
{!customButtonComponent && (
|
|
142
|
+
<div className="flex w-full flex-col items-center justify-center">
|
|
143
|
+
{customDraftComponent && customDraftComponent}
|
|
144
|
+
<div onClick={buttonOnClick} className={defaultButtonClass}>
|
|
145
|
+
<img className="h-[25px] mr-[7px] text-" src={AddAwardLight} />
|
|
146
|
+
<span className="font-mouse text-[25px] tracking-wider">BOOST</span>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
)}
|
|
150
|
+
</section>
|
|
151
|
+
{showChecked && (
|
|
152
|
+
<div className="check-btn-overlay absolute top-[5px] left-[5px]">
|
|
153
|
+
<CircleCheckButton
|
|
154
|
+
checked={checkStatus}
|
|
155
|
+
onClick={onCheckClick}
|
|
156
|
+
className={checkBtnClass}
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
)}
|
|
160
|
+
|
|
161
|
+
{arrowOnClick && (
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
onClick={arrowOnClick}
|
|
165
|
+
className="arrow-btn-overlay absolute top-[52px] right-[2px]"
|
|
166
|
+
>
|
|
167
|
+
<img
|
|
168
|
+
className="h-full w-full object-contai"
|
|
169
|
+
src={CaretRightFilled ?? ''}
|
|
170
|
+
alt="Right Caret"
|
|
171
|
+
/>
|
|
172
|
+
</button>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export default BoostSmallCard;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Story, Meta } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import Button, { ButtonProps } from './Button';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Button',
|
|
8
|
+
component: Button,
|
|
9
|
+
argTypes: {},
|
|
10
|
+
} as Meta<typeof Button>;
|
|
11
|
+
|
|
12
|
+
const Template: Story<ButtonProps> = args => <Button {...args} />;
|
|
13
|
+
|
|
14
|
+
export const ButtonTest = Template.bind({});
|
|
15
|
+
ButtonTest.args = {
|
|
16
|
+
onClick: () => {
|
|
17
|
+
console.log('Nice');
|
|
18
|
+
},
|
|
19
|
+
text: 'HELLO!',
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '@testing-library/jest-dom';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
|
|
5
|
+
import Button from './Button';
|
|
6
|
+
|
|
7
|
+
describe('Running Test for Mr. Button', () => {
|
|
8
|
+
test('Check Button Render', () => {
|
|
9
|
+
render(<Button text="Button" />);
|
|
10
|
+
expect(screen.getByRole('button', { name: 'Button' })).toBeInTheDocument();
|
|
11
|
+
expect(
|
|
12
|
+
screen.queryByRole('button', { name: 'Not In The Document' })
|
|
13
|
+
).not.toBeInTheDocument();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { MouseEventHandler } from 'react';
|
|
2
|
+
|
|
3
|
+
export type ButtonProps = {
|
|
4
|
+
text?: string;
|
|
5
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Button: React.FC<ButtonProps> = ({ text, onClick, className = '' }) => {
|
|
10
|
+
return (
|
|
11
|
+
<button
|
|
12
|
+
type="button"
|
|
13
|
+
onClick={onClick}
|
|
14
|
+
className={`p-4 border rounded text-gray-700 ${className}`}
|
|
15
|
+
>
|
|
16
|
+
{text}
|
|
17
|
+
</button>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default Button;
|