@helsenorge/designsystem-react 6.0.0-beta.9 → 6.0.1
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/CHANGELOG.md +251 -0
- package/components/AnchorLink/AnchorLink.js +7 -7
- package/components/AnchorLink/AnchorLink.js.map +1 -1
- package/components/AnchorLink/styles.module.scss +0 -11
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Badge/Badge.js +5 -5
- package/components/Badge/Badge.js.map +1 -1
- package/components/Button/Button.d.ts +2 -0
- package/components/Button/Button.d.ts.map +1 -1
- package/components/Button/Button.js +78 -72
- package/components/Button/Button.js.map +1 -1
- package/components/Button/styles.module.scss +30 -24
- package/components/Button/styles.module.scss.d.ts +2 -0
- package/components/ButtonWithModal/ButtonWithModal.js +6 -6
- package/components/ButtonWithModal/ButtonWithModal.js.map +1 -1
- package/components/Checkbox/Checkbox.js +9 -9
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Close/Close.d.ts +1 -1
- package/components/Close/Close.d.ts.map +1 -1
- package/components/Close/Close.js +9 -9
- package/components/Close/Close.js.map +1 -1
- package/components/DictionaryTrigger/DictionaryTrigger.js +12 -12
- package/components/DictionaryTrigger/DictionaryTrigger.js.map +1 -1
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/styles.module.scss +2 -2
- package/components/Duolist/Duolist.js +7 -7
- package/components/Duolist/Duolist.js.map +1 -1
- package/components/EmptyState/EmptyState.d.ts +13 -0
- package/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/components/EmptyState/EmptyState.js +10 -0
- package/components/EmptyState/EmptyState.js.map +1 -0
- package/components/EmptyState/NobodyHome.d.ts +4 -0
- package/components/EmptyState/NobodyHome.d.ts.map +1 -0
- package/components/EmptyState/NobodyHome.js +155 -0
- package/components/EmptyState/NobodyHome.js.map +1 -0
- package/components/EmptyState/index.d.ts +4 -0
- package/components/EmptyState/index.d.ts.map +1 -0
- package/components/EmptyState/index.js +5 -0
- package/components/EmptyState/index.js.map +1 -0
- package/components/EmptyState/styles.module.scss +26 -0
- package/components/EmptyState/styles.module.scss.d.ts +10 -0
- package/components/ErrorWrapper/ErrorWrapper.js +4 -4
- package/components/ErrorWrapper/ErrorWrapper.js.map +1 -1
- package/components/Expander/Expander.js +10 -10
- package/components/Expander/Expander.js.map +1 -1
- package/components/ExpanderHierarchy/Expander.js +8 -8
- package/components/ExpanderHierarchy/Expander.js.map +1 -1
- package/components/ExpanderHierarchy/ExpanderButton.js +7 -7
- package/components/ExpanderHierarchy/ExpanderButton.js.map +1 -1
- package/components/ExpanderHierarchy/ExpanderHierarchy.js +5 -5
- package/components/ExpanderHierarchy/ExpanderHierarchy.js.map +1 -1
- package/components/ExpanderList/ExpanderList.d.ts +0 -7
- package/components/ExpanderList/ExpanderList.d.ts.map +1 -1
- package/components/ExpanderList/ExpanderList.js +102 -115
- package/components/ExpanderList/ExpanderList.js.map +1 -1
- package/components/FormExample/FormExample.js +5 -5
- package/components/FormExample/FormExample.js.map +1 -1
- package/components/FormGroup/FormGroup.js +4 -4
- package/components/FormGroup/FormGroup.js.map +1 -1
- package/components/FormGroup/styles.module.scss +3 -3
- package/components/FormLayout/FormLayout.js +4 -4
- package/components/FormLayout/FormLayout.js.map +1 -1
- package/components/GridExample/GridExample.js.map +1 -1
- package/components/HelpBubble/HelpBubble.js +14 -14
- package/components/HelpBubble/HelpBubble.js.map +1 -1
- package/components/HelpBubbleExample/HelpBubbleExample.js.map +1 -1
- package/components/HelpPanel/HelpPanel.js +2 -2
- package/components/HelpPanel/HelpPanel.js.map +1 -1
- package/components/HelpQuestion/HelpQuestion.js +8 -8
- package/components/HelpQuestion/HelpQuestion.js.map +1 -1
- package/components/HighlightBox/HighlightBox.js +3 -3
- package/components/HighlightBox/HighlightBox.js.map +1 -1
- package/components/HorizontalScroll/HorizontalScroll.d.ts +2 -1
- package/components/HorizontalScroll/HorizontalScroll.d.ts.map +1 -1
- package/components/HorizontalScroll/HorizontalScroll.js +39 -25
- package/components/HorizontalScroll/HorizontalScroll.js.map +1 -1
- package/components/HorizontalScroll/styles.module.scss +1 -2
- package/components/Icon/Icon.js +10 -10
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icons/ActiveMonitoring.js +3 -3
- package/components/Icons/ActiveMonitoring.js.map +1 -1
- package/components/Icons/AcupunctureBack.js +2 -2
- package/components/Icons/AcupunctureBack.js.map +1 -1
- package/components/Icons/AdditionalIconInformation.d.ts +44 -0
- package/components/Icons/AdditionalIconInformation.d.ts.map +1 -1
- package/components/Icons/AdditionalIconInformation.js +12 -1
- package/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/components/Icons/AlarmClock.js.map +1 -1
- package/components/Icons/AlertSignFill.js.map +1 -1
- package/components/Icons/AlertSignStroke.js +2 -2
- package/components/Icons/AlertSignStroke.js.map +1 -1
- package/components/Icons/Amputation.js.map +1 -1
- package/components/Icons/Anxiety.js.map +1 -1
- package/components/Icons/Apple.js.map +1 -1
- package/components/Icons/Archive.js.map +1 -1
- package/components/Icons/ArmFlexing.js +3 -3
- package/components/Icons/ArmFlexing.js.map +1 -1
- package/components/Icons/ArrowDown.js +2 -2
- package/components/Icons/ArrowDown.js.map +1 -1
- package/components/Icons/ArrowLeft.js.map +1 -1
- package/components/Icons/ArrowRight.js.map +1 -1
- package/components/Icons/ArrowUp.js +3 -3
- package/components/Icons/ArrowUp.js.map +1 -1
- package/components/Icons/ArrowUpRight.js.map +1 -1
- package/components/Icons/Attachment.js.map +1 -1
- package/components/Icons/Atv.js.map +1 -1
- package/components/Icons/Avatar.js.map +1 -1
- package/components/Icons/AwakePersonOnPillow.js.map +1 -1
- package/components/Icons/Baby.js.map +1 -1
- package/components/Icons/BandAid.js.map +1 -1
- package/components/Icons/BeerAndPills.js.map +1 -1
- package/components/Icons/Bell.js +2 -2
- package/components/Icons/Bell.js.map +1 -1
- package/components/Icons/Bike.js.map +1 -1
- package/components/Icons/BirthControl.js.map +1 -1
- package/components/Icons/BirthdayCake.js +2 -2
- package/components/Icons/BirthdayCake.js.map +1 -1
- package/components/Icons/Boat.js.map +1 -1
- package/components/Icons/Body.js.map +1 -1
- package/components/Icons/Braille.d.ts +5 -0
- package/components/Icons/Braille.d.ts.map +1 -0
- package/components/Icons/Braille.js +7 -0
- package/components/Icons/Braille.js.map +1 -0
- package/components/Icons/Brain.js +2 -2
- package/components/Icons/Brain.js.map +1 -1
- package/components/Icons/BreastReconstruction.js.map +1 -1
- package/components/Icons/BreastRemoval.js +2 -2
- package/components/Icons/BreastRemoval.js.map +1 -1
- package/components/Icons/Breasts.js.map +1 -1
- package/components/Icons/BrokenHeart.js +1 -1
- package/components/Icons/BrokenHeart.js.map +1 -1
- package/components/Icons/BrokenPuzzle.js +2 -2
- package/components/Icons/BrokenPuzzle.js.map +1 -1
- package/components/Icons/Bus.js.map +1 -1
- package/components/Icons/Calendar.js.map +1 -1
- package/components/Icons/CalendarChange.js.map +1 -1
- package/components/Icons/CalendarCheck.js.map +1 -1
- package/components/Icons/CalendarEvent.js +2 -2
- package/components/Icons/CalendarEvent.js.map +1 -1
- package/components/Icons/CalendarSave.js.map +1 -1
- package/components/Icons/Cancer.js.map +1 -1
- package/components/Icons/Candle.js +2 -2
- package/components/Icons/Candle.js.map +1 -1
- package/components/Icons/Car.js.map +1 -1
- package/components/Icons/Change.js.map +1 -1
- package/components/Icons/Check.js +2 -2
- package/components/Icons/Check.js.map +1 -1
- package/components/Icons/CheckFill.js +2 -2
- package/components/Icons/CheckFill.js.map +1 -1
- package/components/Icons/CheckOutline.js.map +1 -1
- package/components/Icons/Chest.js.map +1 -1
- package/components/Icons/ChevronDown.js.map +1 -1
- package/components/Icons/ChevronLeft.js +2 -2
- package/components/Icons/ChevronLeft.js.map +1 -1
- package/components/Icons/ChevronRight.js +2 -2
- package/components/Icons/ChevronRight.js.map +1 -1
- package/components/Icons/ChevronUp.js +2 -2
- package/components/Icons/ChevronUp.js.map +1 -1
- package/components/Icons/ChevronsDown.js.map +1 -1
- package/components/Icons/ChevronsUp.js +2 -2
- package/components/Icons/ChevronsUp.js.map +1 -1
- package/components/Icons/ChildPlaying.js.map +1 -1
- package/components/Icons/Cigarette.js +1 -1
- package/components/Icons/Cigarette.js.map +1 -1
- package/components/Icons/Coins.js.map +1 -1
- package/components/Icons/Contacts.js.map +1 -1
- package/components/Icons/Copy.js.map +1 -1
- package/components/Icons/CoronaCertificate.js.map +1 -1
- package/components/Icons/Coronavirus.js.map +1 -1
- package/components/Icons/Cough.js +2 -2
- package/components/Icons/Cough.js.map +1 -1
- package/components/Icons/CriticalHealthInfo.js.map +1 -1
- package/components/Icons/Cross.d.ts.map +1 -1
- package/components/Icons/Cross.js +1 -1
- package/components/Icons/Cross.js.map +1 -1
- package/components/Icons/DataExchange.js.map +1 -1
- package/components/Icons/DataReceived.js.map +1 -1
- package/components/Icons/DataSent.js.map +1 -1
- package/components/Icons/Depression.js.map +1 -1
- package/components/Icons/DigestiveSystem.js.map +1 -1
- package/components/Icons/Dizzy.js.map +1 -1
- package/components/Icons/Documents.js +2 -2
- package/components/Icons/Documents.js.map +1 -1
- package/components/Icons/Dog.js.map +1 -1
- package/components/Icons/DonorCard.js +2 -2
- package/components/Icons/DonorCard.js.map +1 -1
- package/components/Icons/Download.js.map +1 -1
- package/components/Icons/Draft.js.map +1 -1
- package/components/Icons/EChat.js.map +1 -1
- package/components/Icons/Ear.d.ts +5 -0
- package/components/Icons/Ear.d.ts.map +1 -0
- package/components/Icons/Ear.js +10 -0
- package/components/Icons/Ear.js.map +1 -0
- package/components/Icons/EarDeaf.d.ts +5 -0
- package/components/Icons/EarDeaf.d.ts.map +1 -0
- package/components/Icons/EarDeaf.js +7 -0
- package/components/Icons/EarDeaf.js.map +1 -0
- package/components/Icons/EarHearingAid.d.ts +5 -0
- package/components/Icons/EarHearingAid.d.ts.map +1 -0
- package/components/Icons/EarHearingAid.js +10 -0
- package/components/Icons/EarHearingAid.js.map +1 -0
- package/components/Icons/EarNoseThroat.js.map +1 -1
- package/components/Icons/EarVolume.d.ts +5 -0
- package/components/Icons/EarVolume.d.ts.map +1 -0
- package/components/Icons/EarVolume.js +17 -0
- package/components/Icons/EarVolume.js.map +1 -0
- package/components/Icons/ElderlyPerson.js.map +1 -1
- package/components/Icons/Embolization.js.map +1 -1
- package/components/Icons/EmergencyCall.d.ts +5 -0
- package/components/Icons/EmergencyCall.d.ts.map +1 -0
- package/components/Icons/EmergencyCall.js +21 -0
- package/components/Icons/EmergencyCall.js.map +1 -0
- package/components/Icons/EmoticonAnnoyed.js.map +1 -1
- package/components/Icons/EmoticonDelighted.js.map +1 -1
- package/components/Icons/EmoticonDisappointed.js +2 -2
- package/components/Icons/EmoticonDisappointed.js.map +1 -1
- package/components/Icons/EmoticonHappy.js +2 -2
- package/components/Icons/EmoticonHappy.js.map +1 -1
- package/components/Icons/EmoticonMeh.js +2 -2
- package/components/Icons/EmoticonMeh.js.map +1 -1
- package/components/Icons/EnterFullScreen.js.map +1 -1
- package/components/Icons/Envelope.js.map +1 -1
- package/components/Icons/Epilepsy.js +2 -2
- package/components/Icons/Epilepsy.js.map +1 -1
- package/components/Icons/Eraser.js.map +1 -1
- package/components/Icons/ErrorSignFill.js.map +1 -1
- package/components/Icons/ErrorSignStroke.js +2 -2
- package/components/Icons/ErrorSignStroke.js.map +1 -1
- package/components/Icons/EuropeanHealthCard.js.map +1 -1
- package/components/Icons/ExitFullScreen.js.map +1 -1
- package/components/Icons/Eye.d.ts.map +1 -1
- package/components/Icons/Eye.js +17 -3
- package/components/Icons/Eye.js.map +1 -1
- package/components/Icons/Facebook.js +2 -2
- package/components/Icons/Facebook.js.map +1 -1
- package/components/Icons/FallingLeaf.js.map +1 -1
- package/components/Icons/Female.js.map +1 -1
- package/components/Icons/FemaleDoctor.js.map +1 -1
- package/components/Icons/Ferry.js.map +1 -1
- package/components/Icons/File.js +2 -2
- package/components/Icons/File.js.map +1 -1
- package/components/Icons/Filter.js +2 -2
- package/components/Icons/Filter.js.map +1 -1
- package/components/Icons/FingerBleed.js +2 -2
- package/components/Icons/FingerBleed.js.map +1 -1
- package/components/Icons/FirstAidKit.js.map +1 -1
- package/components/Icons/FloppyDisk.js.map +1 -1
- package/components/Icons/Football.js.map +1 -1
- package/components/Icons/Form.js +2 -2
- package/components/Icons/Form.js.map +1 -1
- package/components/Icons/Forward.js +2 -2
- package/components/Icons/Forward.js.map +1 -1
- package/components/Icons/Gallery.js.map +1 -1
- package/components/Icons/Garden.js +2 -2
- package/components/Icons/Garden.js.map +1 -1
- package/components/Icons/GasCan.js.map +1 -1
- package/components/Icons/GenderIdentity.js +2 -2
- package/components/Icons/GenderIdentity.js.map +1 -1
- package/components/Icons/Glasses.d.ts +5 -0
- package/components/Icons/Glasses.d.ts.map +1 -0
- package/components/Icons/Glasses.js +21 -0
- package/components/Icons/Glasses.js.map +1 -0
- package/components/Icons/Globe.js +2 -2
- package/components/Icons/Globe.js.map +1 -1
- package/components/Icons/Graph.js.map +1 -1
- package/components/Icons/Group.js.map +1 -1
- package/components/Icons/GroupTwins.js +2 -2
- package/components/Icons/GroupTwins.js.map +1 -1
- package/components/Icons/HTMLFile.d.ts +5 -0
- package/components/Icons/HTMLFile.d.ts.map +1 -0
- package/components/Icons/HTMLFile.js +10 -0
- package/components/Icons/HTMLFile.js.map +1 -0
- package/components/Icons/HandWaving.js.map +1 -1
- package/components/Icons/HandWithDisease.js.map +1 -1
- package/components/Icons/HandsAndHeart.js +2 -2
- package/components/Icons/HandsAndHeart.js.map +1 -1
- package/components/Icons/HealthClinic.js.map +1 -1
- package/components/Icons/HealthWarning.js.map +1 -1
- package/components/Icons/HealthcarePerson.js +4 -4
- package/components/Icons/HealthcarePerson.js.map +1 -1
- package/components/Icons/HealthcarePersonell.js.map +1 -1
- package/components/Icons/HearingProtection.d.ts +5 -0
- package/components/Icons/HearingProtection.d.ts.map +1 -0
- package/components/Icons/HearingProtection.js +24 -0
- package/components/Icons/HearingProtection.js.map +1 -0
- package/components/Icons/Heart.js +2 -2
- package/components/Icons/Heart.js.map +1 -1
- package/components/Icons/HeartHands.js.map +1 -1
- package/components/Icons/HelpSign.js +2 -2
- package/components/Icons/HelpSign.js.map +1 -1
- package/components/Icons/HelpingHand.js +2 -2
- package/components/Icons/HelpingHand.js.map +1 -1
- package/components/Icons/Hemodialysis.js.map +1 -1
- package/components/Icons/Hiker.js +2 -2
- package/components/Icons/Hiker.js.map +1 -1
- package/components/Icons/Hipprosthesis.js +2 -2
- package/components/Icons/Hipprosthesis.js.map +1 -1
- package/components/Icons/History.js.map +1 -1
- package/components/Icons/HivAndAids.js +2 -2
- package/components/Icons/HivAndAids.js.map +1 -1
- package/components/Icons/Home.js.map +1 -1
- package/components/Icons/Hormone.js +2 -2
- package/components/Icons/Hormone.js.map +1 -1
- package/components/Icons/Hospital.js.map +1 -1
- package/components/Icons/Hourglass.js.map +1 -1
- package/components/Icons/IconNames.d.ts +1 -1
- package/components/Icons/IconNames.d.ts.map +1 -1
- package/components/Icons/IconNames.js +11 -0
- package/components/Icons/IconNames.js.map +1 -1
- package/components/Icons/ImgFile.js +2 -2
- package/components/Icons/ImgFile.js.map +1 -1
- package/components/Icons/Inbox.js.map +1 -1
- package/components/Icons/InfoSignFill.js +2 -2
- package/components/Icons/InfoSignFill.js.map +1 -1
- package/components/Icons/InfoSignStroke.js.map +1 -1
- package/components/Icons/Instagram.js.map +1 -1
- package/components/Icons/Intravenous.js.map +1 -1
- package/components/Icons/JointPain.js +1 -1
- package/components/Icons/JointPain.js.map +1 -1
- package/components/Icons/Journal.js.map +1 -1
- package/components/Icons/JpgFile.js +2 -2
- package/components/Icons/JpgFile.js.map +1 -1
- package/components/Icons/Kidney.js.map +1 -1
- package/components/Icons/KitchenScale.js +2 -2
- package/components/Icons/KitchenScale.js.map +1 -1
- package/components/Icons/Kjernejournal.js.map +1 -1
- package/components/Icons/Laboratory.js.map +1 -1
- package/components/Icons/LaptopBlog.js.map +1 -1
- package/components/Icons/LawBook.js +1 -1
- package/components/Icons/LawBook.js.map +1 -1
- package/components/Icons/LegalDocument.js.map +1 -1
- package/components/Icons/LightBulb.js.map +1 -1
- package/components/Icons/List.js +2 -2
- package/components/Icons/List.js.map +1 -1
- package/components/Icons/Location.js.map +1 -1
- package/components/Icons/Lock.js +1 -1
- package/components/Icons/Lock.js.map +1 -1
- package/components/Icons/Login.js.map +1 -1
- package/components/Icons/Logout.js +2 -2
- package/components/Icons/Logout.js.map +1 -1
- package/components/Icons/Lungs.js +1 -1
- package/components/Icons/Lungs.js.map +1 -1
- package/components/Icons/Makeup.js.map +1 -1
- package/components/Icons/MaleDoctor.js.map +1 -1
- package/components/Icons/MaleDoctorAndPerson.js.map +1 -1
- package/components/Icons/MaleGenitalia.js.map +1 -1
- package/components/Icons/Medicine.js.map +1 -1
- package/components/Icons/MedicineWarning.js.map +1 -1
- package/components/Icons/MentalHealthAdult.js.map +1 -1
- package/components/Icons/MentalHealthChild.js.map +1 -1
- package/components/Icons/Menu.js +2 -2
- package/components/Icons/Menu.js.map +1 -1
- package/components/Icons/Microscope.js +1 -1
- package/components/Icons/Microscope.js.map +1 -1
- package/components/Icons/Minus.js.map +1 -1
- package/components/Icons/Mirror.js +2 -2
- package/components/Icons/Mirror.js.map +1 -1
- package/components/Icons/MobilePhone.js.map +1 -1
- package/components/Icons/MotherHoldingBaby.js.map +1 -1
- package/components/Icons/MuscleBack.js.map +1 -1
- package/components/Icons/MuscleLeg.js.map +1 -1
- package/components/Icons/Mushroom.js +2 -2
- package/components/Icons/Mushroom.js.map +1 -1
- package/components/Icons/Music.js.map +1 -1
- package/components/Icons/MusselsAndSalt.js.map +1 -1
- package/components/Icons/NoAccess.js +4 -4
- package/components/Icons/NoAccess.js.map +1 -1
- package/components/Icons/NoEye.d.ts.map +1 -1
- package/components/Icons/NoEye.js +17 -3
- package/components/Icons/NoEye.js.map +1 -1
- package/components/Icons/NoFilter.js.map +1 -1
- package/components/Icons/Notepad.js.map +1 -1
- package/components/Icons/Osteotomy.js +1 -1
- package/components/Icons/Osteotomy.js.map +1 -1
- package/components/Icons/PaintRoller.js +2 -2
- package/components/Icons/PaintRoller.js.map +1 -1
- package/components/Icons/PaperPlane.js.map +1 -1
- package/components/Icons/PatientAndPerson.js.map +1 -1
- package/components/Icons/Pause.js.map +1 -1
- package/components/Icons/PdfFile.js.map +1 -1
- package/components/Icons/Pencil.js.map +1 -1
- package/components/Icons/PeopleTalking.js.map +1 -1
- package/components/Icons/Peritonealdialysis.js.map +1 -1
- package/components/Icons/Person.js.map +1 -1
- package/components/Icons/PersonAndPatient.js.map +1 -1
- package/components/Icons/PersonCancel.js.map +1 -1
- package/components/Icons/PersonInXRayMachine.js.map +1 -1
- package/components/Icons/PersonOverweight.js.map +1 -1
- package/components/Icons/PersonRelaxing.js.map +1 -1
- package/components/Icons/PersonWithBrain.js.map +1 -1
- package/components/Icons/PersonWithBrokenArm.js.map +1 -1
- package/components/Icons/PersonWithCrutches.js.map +1 -1
- package/components/Icons/PersonWithJaw.js.map +1 -1
- package/components/Icons/PersonWithMagnifyingGlass.js +1 -1
- package/components/Icons/PersonWithMagnifyingGlass.js.map +1 -1
- package/components/Icons/PersonWithSenses.js.map +1 -1
- package/components/Icons/PersonWorking.js.map +1 -1
- package/components/Icons/PersonalPlan.js.map +1 -1
- package/components/Icons/PizzaSlice.js +1 -1
- package/components/Icons/PizzaSlice.js.map +1 -1
- package/components/Icons/Plane.js.map +1 -1
- package/components/Icons/Plant.js.map +1 -1
- package/components/Icons/Play.js.map +1 -1
- package/components/Icons/PlusLarge.js.map +1 -1
- package/components/Icons/PlusSmall.js.map +1 -1
- package/components/Icons/PngFile.js +2 -2
- package/components/Icons/PngFile.js.map +1 -1
- package/components/Icons/Podcast.js +2 -2
- package/components/Icons/Podcast.js.map +1 -1
- package/components/Icons/PoisonInformation.js.map +1 -1
- package/components/Icons/Pregnant.js.map +1 -1
- package/components/Icons/Printer.js.map +1 -1
- package/components/Icons/Psychosis.js.map +1 -1
- package/components/Icons/Publication.js.map +1 -1
- package/components/Icons/Puzzle.js.map +1 -1
- package/components/Icons/QrCode.js.map +1 -1
- package/components/Icons/Quarrel.js +2 -2
- package/components/Icons/Quarrel.js.map +1 -1
- package/components/Icons/RadioTherapy.js +2 -2
- package/components/Icons/RadioTherapy.js.map +1 -1
- package/components/Icons/RadioactiveTreatment.js.map +1 -1
- package/components/Icons/Radioiodine.js.map +1 -1
- package/components/Icons/Receipt.js.map +1 -1
- package/components/Icons/Receptionist.js.map +1 -1
- package/components/Icons/Recovery.js +2 -2
- package/components/Icons/Recovery.js.map +1 -1
- package/components/Icons/Referral.js.map +1 -1
- package/components/Icons/Refresh.js.map +1 -1
- package/components/Icons/Refund.js.map +1 -1
- package/components/Icons/Reply.js.map +1 -1
- package/components/Icons/Rocket.js.map +1 -1
- package/components/Icons/RtfFile.js +2 -2
- package/components/Icons/RtfFile.js.map +1 -1
- package/components/Icons/STDs.js +2 -2
- package/components/Icons/STDs.js.map +1 -1
- package/components/Icons/Save.js.map +1 -1
- package/components/Icons/Scale.js.map +1 -1
- package/components/Icons/ScreenReader.d.ts +5 -0
- package/components/Icons/ScreenReader.d.ts.map +1 -0
- package/components/Icons/ScreenReader.js +38 -0
- package/components/Icons/ScreenReader.js.map +1 -0
- package/components/Icons/Search.js.map +1 -1
- package/components/Icons/SectionSign.js +1 -1
- package/components/Icons/SectionSign.js.map +1 -1
- package/components/Icons/Settings.js.map +1 -1
- package/components/Icons/Sexualorientation.js +2 -2
- package/components/Icons/Sexualorientation.js.map +1 -1
- package/components/Icons/ShakingHand.js.map +1 -1
- package/components/Icons/Share.js.map +1 -1
- package/components/Icons/Shield.js +2 -2
- package/components/Icons/Shield.js.map +1 -1
- package/components/Icons/ShuntOperation.js.map +1 -1
- package/components/Icons/Skeleton.js.map +1 -1
- package/components/Icons/Skin.js.map +1 -1
- package/components/Icons/Snake.js +2 -2
- package/components/Icons/Snake.js.map +1 -1
- package/components/Icons/Snapchat.js.map +1 -1
- package/components/Icons/SortDown.js +2 -2
- package/components/Icons/SortDown.js.map +1 -1
- package/components/Icons/SortUp.js +2 -2
- package/components/Icons/SortUp.js.map +1 -1
- package/components/Icons/SpeechBubble.js.map +1 -1
- package/components/Icons/Spray.js +2 -2
- package/components/Icons/Spray.js.map +1 -1
- package/components/Icons/Stopwatch.js +2 -2
- package/components/Icons/Stopwatch.js.map +1 -1
- package/components/Icons/Sun.d.ts +5 -0
- package/components/Icons/Sun.d.ts.map +1 -0
- package/components/Icons/Sun.js +24 -0
- package/components/Icons/Sun.js.map +1 -0
- package/components/Icons/SupportingPerson.js.map +1 -1
- package/components/Icons/Surgery.js +1 -1
- package/components/Icons/Surgery.js.map +1 -1
- package/components/Icons/Syringe.js +3 -3
- package/components/Icons/Syringe.js.map +1 -1
- package/components/Icons/Taxi.js.map +1 -1
- package/components/Icons/TeddyBear.js +2 -2
- package/components/Icons/TeddyBear.js.map +1 -1
- package/components/Icons/Teenagers.js.map +1 -1
- package/components/Icons/ThinkingAboutBaby.js +2 -2
- package/components/Icons/ThinkingAboutBaby.js.map +1 -1
- package/components/Icons/Ticket.js.map +1 -1
- package/components/Icons/TimePassing.js.map +1 -1
- package/components/Icons/Tombstone.js.map +1 -1
- package/components/Icons/Toolbox.js.map +1 -1
- package/components/Icons/Tooth.js.map +1 -1
- package/components/Icons/TotalKneeProsthesis.js.map +1 -1
- package/components/Icons/Train.js.map +1 -1
- package/components/Icons/Transplantation.js.map +1 -1
- package/components/Icons/TrashCan.js.map +1 -1
- package/components/Icons/TravelRoute.js.map +1 -1
- package/components/Icons/TriangleX.js.map +1 -1
- package/components/Icons/Twitter.js.map +1 -1
- package/components/Icons/Undo.js +2 -2
- package/components/Icons/Undo.js.map +1 -1
- package/components/Icons/UniProsthesis.js +2 -2
- package/components/Icons/UniProsthesis.js.map +1 -1
- package/components/Icons/Upload.js.map +1 -1
- package/components/Icons/UserOrganization.js.map +1 -1
- package/components/Icons/Vaccine.js.map +1 -1
- package/components/Icons/VerticalDots.js.map +1 -1
- package/components/Icons/VideoCamera.js.map +1 -1
- package/components/Icons/VideoChat.js.map +1 -1
- package/components/Icons/Wallet.js.map +1 -1
- package/components/Icons/Watch.js.map +1 -1
- package/components/Icons/Website.js.map +1 -1
- package/components/Icons/Wheelchair.js +2 -2
- package/components/Icons/Wheelchair.js.map +1 -1
- package/components/Icons/WheelchairActive.js.map +1 -1
- package/components/Icons/Window.js +2 -2
- package/components/Icons/Window.js.map +1 -1
- package/components/Icons/WordDocument.js.map +1 -1
- package/components/Icons/WorkSuitcase.js +2 -2
- package/components/Icons/WorkSuitcase.js.map +1 -1
- package/components/Icons/X.js +2 -2
- package/components/Icons/X.js.map +1 -1
- package/components/Icons/XOutline.js +2 -2
- package/components/Icons/XOutline.js.map +1 -1
- package/components/Icons/XmlFile.js +2 -2
- package/components/Icons/XmlFile.js.map +1 -1
- package/components/Icons/YouTube.js +1 -1
- package/components/Icons/YouTube.js.map +1 -1
- package/components/Icons/Zoom.js.map +1 -1
- package/components/Illustration/Illustration.d.ts +6 -0
- package/components/Illustration/Illustration.d.ts.map +1 -0
- package/components/Illustration/index.d.ts +2 -0
- package/components/Illustration/index.d.ts.map +1 -0
- package/components/Illustration/index.js +2 -0
- package/components/Illustration/index.js.map +1 -0
- package/components/Input/Input.d.ts.map +1 -1
- package/components/Input/Input.js +65 -61
- package/components/Input/Input.js.map +1 -1
- package/components/Input/index.d.ts.map +1 -1
- package/components/Label/Label.js +36 -36
- package/components/Label/Label.js.map +1 -1
- package/components/Label/SubLabel.js +5 -5
- package/components/Label/SubLabel.js.map +1 -1
- package/components/Label/styles.module.scss +5 -0
- package/components/Label/styles.module.scss.d.ts +1 -0
- package/components/LazyIcon/LazyIcon.d.ts.map +1 -1
- package/components/LazyIcon/LazyIcon.js +16 -15
- package/components/LazyIcon/LazyIcon.js.map +1 -1
- package/components/LinkList/LinkList.d.ts +0 -4
- package/components/LinkList/LinkList.d.ts.map +1 -1
- package/components/LinkList/LinkList.js +8 -8
- package/components/LinkList/LinkList.js.map +1 -1
- package/components/List/List.js +2 -2
- package/components/List/List.js.map +1 -1
- package/components/ListHeader/ListHeader.js +12 -12
- package/components/ListHeader/ListHeader.js.map +1 -1
- package/components/ListHeader/ListHeaderText/ListHeaderText.js +6 -6
- package/components/ListHeader/ListHeaderText/ListHeaderText.js.map +1 -1
- package/components/Loader/Loader.js.map +1 -1
- package/components/Logo/Logo.js +2 -2
- package/components/Logo/Logo.js.map +1 -1
- package/components/MaxCharacters/MaxCharacters.js +6 -6
- package/components/MaxCharacters/MaxCharacters.js.map +1 -1
- package/components/Modal/Modal.js.map +1 -1
- package/components/NotificationPanel/DetailButton/DetailButton.js +5 -5
- package/components/NotificationPanel/DetailButton/DetailButton.js.map +1 -1
- package/components/NotificationPanel/NotificationPanel.d.ts.map +1 -1
- package/components/NotificationPanel/NotificationPanel.js +32 -31
- package/components/NotificationPanel/NotificationPanel.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +8 -0
- package/components/NotificationPanel/styles.module.scss.d.ts +1 -0
- package/components/Panel/Panel.d.ts +40 -40
- package/components/Panel/Panel.d.ts.map +1 -1
- package/components/Panel/Panel.js +167 -122
- package/components/Panel/Panel.js.map +1 -1
- package/components/Panel/styles.module.scss +137 -191
- package/components/Panel/styles.module.scss.d.ts +24 -31
- package/components/PanelList/PanelList.js +4 -4
- package/components/PanelList/PanelList.js.map +1 -1
- package/components/PopMenu/PopMenu.d.ts.map +1 -1
- package/components/PopMenu/PopMenu.js +58 -56
- package/components/PopMenu/PopMenu.js.map +1 -1
- package/components/PopOver/PopOver.js +8 -8
- package/components/PopOver/PopOver.js.map +1 -1
- package/components/Portal/index.js +3 -3
- package/components/PromoPanel/PromoPanel.d.ts +33 -0
- package/components/PromoPanel/PromoPanel.d.ts.map +1 -0
- package/components/PromoPanel/PromoPanel.js +42 -0
- package/components/PromoPanel/PromoPanel.js.map +1 -0
- package/components/PromoPanel/index.d.ts +4 -0
- package/components/PromoPanel/index.d.ts.map +1 -0
- package/components/PromoPanel/index.js +5 -0
- package/components/PromoPanel/index.js.map +1 -0
- package/components/PromoPanel/styles.module.scss +115 -0
- package/components/PromoPanel/styles.module.scss.d.ts +16 -0
- package/components/RadioButton/RadioButton.js +13 -13
- package/components/RadioButton/RadioButton.js.map +1 -1
- package/components/RadioButton/styles.module.scss +2 -2
- package/components/Select/Select.js +10 -10
- package/components/Select/Select.js.map +1 -1
- package/components/ServiceMessage/ServiceMessage.d.ts +0 -5
- package/components/ServiceMessage/ServiceMessage.d.ts.map +1 -1
- package/components/ServiceMessage/ServiceMessage.js +12 -12
- package/components/ServiceMessage/ServiceMessage.js.map +1 -1
- package/components/SharingStatus/SharingStatus.d.ts +21 -0
- package/components/SharingStatus/SharingStatus.d.ts.map +1 -0
- package/components/SharingStatus/SharingStatus.js +16 -0
- package/components/SharingStatus/SharingStatus.js.map +1 -0
- package/components/SharingStatus/index.d.ts +4 -0
- package/components/SharingStatus/index.d.ts.map +1 -0
- package/components/SharingStatus/index.js +5 -0
- package/components/SharingStatus/index.js.map +1 -0
- package/components/SharingStatus/styles.module.scss +74 -0
- package/components/SharingStatus/styles.module.scss.d.ts +22 -0
- package/components/Slider/Slider.d.ts +12 -0
- package/components/Slider/Slider.d.ts.map +1 -1
- package/components/Slider/Slider.js +124 -84
- package/components/Slider/Slider.js.map +1 -1
- package/components/Slider/styles.module.scss +51 -8
- package/components/Slider/styles.module.scss.d.ts +7 -0
- package/components/Spacer/Spacer.js.map +1 -1
- package/components/StatusDot/StatusDot.js.map +1 -1
- package/components/StatusDot/styles.module.scss +12 -3
- package/components/Step/Step.js +7 -7
- package/components/Step/Step.js.map +1 -1
- package/components/StepButtons/StepButtons.js.map +1 -1
- package/components/Stepper/Dot.js +8 -8
- package/components/Stepper/DotList.js +1 -1
- package/components/Stepper/DotList.js.map +1 -1
- package/components/Stepper/Stepper.js +8 -8
- package/components/Stepper/Stepper.js.map +1 -1
- package/components/Table/Table.d.ts +4 -0
- package/components/Table/Table.d.ts.map +1 -1
- package/components/Table/Table.js +30 -28
- package/components/Table/Table.js.map +1 -1
- package/components/Table/TableBody/TableBody.js +5 -5
- package/components/Table/TableBody/TableBody.js.map +1 -1
- package/components/Table/TableCell/TableCell.js +5 -5
- package/components/Table/TableCell/TableCell.js.map +1 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.js +8 -8
- package/components/Table/TableExpandedRow/TableExpandedRow.js.map +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCell.js +17 -17
- package/components/Table/TableExpanderCell/TableExpanderCell.js.map +1 -1
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +5 -5
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js.map +1 -1
- package/components/Table/TableHead/TableHead.js +2 -2
- package/components/Table/TableHead/TableHead.js.map +1 -1
- package/components/Table/TableHeadCell/TableHeadCell.d.ts.map +1 -1
- package/components/Table/TableHeadCell/TableHeadCell.js +21 -24
- package/components/Table/TableHeadCell/TableHeadCell.js.map +1 -1
- package/components/Table/TableRow/TableRow.js +8 -8
- package/components/Table/TableRow/TableRow.js.map +1 -1
- package/components/Table/styles.module.scss +0 -12
- package/components/Table/styles.module.scss.d.ts +0 -1
- package/components/Tag/Tag.js +7 -7
- package/components/Tag/Tag.js.map +1 -1
- package/components/TagList/TagList.js +2 -2
- package/components/TagList/TagList.js.map +1 -1
- package/components/Textarea/Textarea.d.ts.map +1 -1
- package/components/Textarea/Textarea.js +61 -57
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Tile/Tile.d.ts +1 -0
- package/components/Tile/Tile.d.ts.map +1 -1
- package/components/Tile/Tile.js +39 -25
- package/components/Tile/Tile.js.map +1 -1
- package/components/Tile/styles.module.scss +4 -0
- package/components/Tile/styles.module.scss.d.ts +1 -0
- package/components/Title/Title.js +7 -7
- package/components/Title/Title.js.map +1 -1
- package/components/Tooltip/Tooltip.js +17 -17
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/TooltipWord/TooltipWord.js +5 -5
- package/components/Tooltip/TooltipWord/TooltipWord.js.map +1 -1
- package/components/TooltipExample/TooltipExample.js.map +1 -1
- package/components/Trigger/HelpSign.js.map +1 -1
- package/components/Trigger/Trigger.js +2 -2
- package/components/Trigger/Trigger.js.map +1 -1
- package/components/Validation/Validation.js.map +1 -1
- package/constants.d.ts +3 -0
- package/constants.d.ts.map +1 -1
- package/constants.js +5 -5
- package/constants.js.map +1 -1
- package/hoc/withBreakpoint/withBreakpoint.js +6 -6
- package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
- package/hooks/usePseudoClasses.d.ts.map +1 -1
- package/hooks/usePseudoClasses.js +11 -11
- package/hooks/usePseudoClasses.js.map +1 -1
- package/package.json +1 -1
- package/scss/_font-settings.scss +2 -0
- package/scss/_palette.scss +2 -1
- package/scss/_title.scss +13 -0
- package/scss/typography.module.scss +1 -8
- package/utils/component.js +2 -2
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t, { useRef as s, useState as g } from "react";
|
|
2
2
|
import a from "classnames";
|
|
3
|
-
import { IconSize as
|
|
4
|
-
import { useBreakpoint as
|
|
5
|
-
import { useHover as
|
|
6
|
-
import { useOutsideEvent as
|
|
7
|
-
import { getColor as
|
|
8
|
-
import { breakpoints as
|
|
9
|
-
import { isComponent as
|
|
10
|
-
import
|
|
11
|
-
import { Icon as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
-
const l = s(null), m = s(null), p = s(null), [
|
|
19
|
-
children:
|
|
20
|
-
popOverClassName:
|
|
21
|
-
popMenuClassName:
|
|
22
|
-
openButtonTestId:
|
|
23
|
-
closeButtonTestId:
|
|
24
|
-
popOverTestId:
|
|
25
|
-
popMenuVariant:
|
|
26
|
-
openButtonAriaLabel:
|
|
27
|
-
closeButtonAriaLabel:
|
|
28
|
-
} = e,
|
|
29
|
-
[
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
const { isHovered:
|
|
33
|
-
if (
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
3
|
+
import { IconSize as I, AnalyticsId as w } from "../../constants.js";
|
|
4
|
+
import { useBreakpoint as H } from "../../hooks/useBreakpoint.js";
|
|
5
|
+
import { useHover as z } from "../../hooks/useHover.js";
|
|
6
|
+
import { useOutsideEvent as A } from "../../hooks/useOutsideEvent.js";
|
|
7
|
+
import { getColor as M } from "../../theme/currys/color.js";
|
|
8
|
+
import { breakpoints as P } from "../../theme/grid.js";
|
|
9
|
+
import { isComponent as T } from "../../utils/component.js";
|
|
10
|
+
import $ from "../Close/Close.js";
|
|
11
|
+
import { Icon as x } from "../Icon/Icon.js";
|
|
12
|
+
import D from "../Icons/VerticalDots.js";
|
|
13
|
+
import G from "../LinkList/LinkList.js";
|
|
14
|
+
import W from "../PopOver/PopOver.js";
|
|
15
|
+
import r from "./styles.module.scss";
|
|
16
|
+
var X = /* @__PURE__ */ ((e) => (e.onWhite = "on-white", e.onGray = "on-gray", e.onBlueberry = "on-blueberry", e))(X || {});
|
|
17
|
+
const j = (e) => {
|
|
18
|
+
const l = s(null), m = s(null), p = s(null), [n, i] = g(!1), {
|
|
19
|
+
children: c,
|
|
20
|
+
popOverClassName: C,
|
|
21
|
+
popMenuClassName: k,
|
|
22
|
+
openButtonTestId: B,
|
|
23
|
+
closeButtonTestId: N,
|
|
24
|
+
popOverTestId: y,
|
|
25
|
+
popMenuVariant: u = "on-white",
|
|
26
|
+
openButtonAriaLabel: O,
|
|
27
|
+
closeButtonAriaLabel: h
|
|
28
|
+
} = e, f = a(r["pop-menu-button"], {
|
|
29
|
+
[r[`pop-menu-button--${u}`]]: u
|
|
30
|
+
}), d = H() < P.md;
|
|
31
|
+
A(p, () => i(!n));
|
|
32
|
+
const { isHovered: E } = z(m), R = d ? I.XSmall : I.Small, S = () => {
|
|
33
|
+
if (T(c, G))
|
|
34
|
+
return /* @__PURE__ */ t.createElement(
|
|
35
|
+
W,
|
|
36
36
|
{
|
|
37
|
-
testId:
|
|
38
|
-
className: a(
|
|
39
|
-
arrowClassName:
|
|
37
|
+
testId: y,
|
|
38
|
+
className: a(r["pop-menu__pop-over"], C),
|
|
39
|
+
arrowClassName: r["pop-menu__pop-over-arrow"],
|
|
40
40
|
controllerRef: l,
|
|
41
41
|
popOverRef: p
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
c
|
|
44
44
|
);
|
|
45
|
-
},
|
|
45
|
+
}, b = (o, v) => {
|
|
46
|
+
v && v.stopPropagation(), i(o);
|
|
47
|
+
}, _ = /* @__PURE__ */ t.createElement(
|
|
46
48
|
"button",
|
|
47
49
|
{
|
|
48
50
|
ref: m,
|
|
49
|
-
"data-testid":
|
|
50
|
-
className:
|
|
51
|
-
"aria-label":
|
|
52
|
-
onClick: () =>
|
|
51
|
+
"data-testid": B,
|
|
52
|
+
className: f,
|
|
53
|
+
"aria-label": O || "Se mer",
|
|
54
|
+
onClick: (o) => b(!0, o),
|
|
53
55
|
type: "button"
|
|
54
56
|
},
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
),
|
|
57
|
-
|
|
57
|
+
/* @__PURE__ */ t.createElement(x, { svgIcon: D, className: "test", color: M("black"), size: R, isHovered: E })
|
|
58
|
+
), L = /* @__PURE__ */ t.createElement(
|
|
59
|
+
$,
|
|
58
60
|
{
|
|
59
|
-
ariaLabel:
|
|
61
|
+
ariaLabel: h,
|
|
60
62
|
color: "black",
|
|
61
|
-
className:
|
|
62
|
-
testId:
|
|
63
|
+
className: f,
|
|
64
|
+
testId: N,
|
|
63
65
|
ref: l,
|
|
64
|
-
onClick: () =>
|
|
65
|
-
small:
|
|
66
|
+
onClick: (o) => b(!1, o),
|
|
67
|
+
small: d
|
|
66
68
|
}
|
|
67
69
|
);
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
},
|
|
70
|
+
return /* @__PURE__ */ t.createElement("div", { className: a(r["pop-menu-button"], k), "data-analyticsid": w.PopMenu }, n ? L : _, n && S());
|
|
71
|
+
}, le = j;
|
|
70
72
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
j as PopMenu,
|
|
74
|
+
X as PopMenuVariant,
|
|
75
|
+
le as default
|
|
74
76
|
};
|
|
75
77
|
//# sourceMappingURL=PopMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopMenu.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { isComponent } from '../../utils/component';\nimport Close from '../Close';\nimport Icon from '../Icon';\nimport VerticalDots from '../Icons/VerticalDots';\nimport LinkList, { LinkListProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const closeRef = useRef<HTMLButtonElement>(null);\n const openRef = useRef<HTMLButtonElement>(null);\n const popOverRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n useOutsideEvent(popOverRef, () => setIsOpen(!isOpen));\n const { isHovered: openButtonIsHovered } = useHover(openRef);\n const mobileIconSize = mobile ? IconSize.XSmall : IconSize.Small;\n\n const renderChildren = () => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n arrowClassName={styles['pop-menu__pop-over-arrow']}\n controllerRef={closeRef}\n popOverRef={popOverRef}\n >\n {children}\n </PopOver>\n );\n }\n };\n\n const openButton = (\n <button\n ref={openRef}\n data-testid={openButtonTestId}\n className={buttonClasses}\n aria-label={openButtonAriaLabel || 'Se mer'}\n onClick={()
|
|
1
|
+
{"version":3,"file":"PopMenu.js","sources":["../../../src/components/PopMenu/PopMenu.tsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { getColor } from '../../theme/currys';\nimport { breakpoints } from '../../theme/grid';\nimport { isComponent } from '../../utils/component';\nimport Close from '../Close';\nimport Icon from '../Icon';\nimport VerticalDots from '../Icons/VerticalDots';\nimport LinkList, { LinkListProps } from '../LinkList';\nimport PopOver from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport enum PopMenuVariant {\n onWhite = 'on-white',\n onGray = 'on-gray',\n onBlueberry = 'on-blueberry',\n}\n\nexport interface PopMenuProps {\n /** Content shown inside PopOver. Can only be a LinkList */\n children: React.ReactElement<LinkListProps>;\n /** Adds custom classes to the popover element. */\n popOverClassName?: string;\n /** Adds custom classes to the element. */\n popMenuClassName?: string;\n /** Changes responsive design for the trigger buttons. */\n popMenuVariant?: PopMenuVariant;\n /** Sets the data-testid attribute for the button that opens. */\n openButtonTestId?: string;\n /** Sets the data-testid attribute for the button that closes. */\n closeButtonTestId?: string;\n /** Sets the data-testid attribute for the popover. */\n popOverTestId?: string;\n /** Sets the arial-label attribute for the openButton. */\n openButtonAriaLabel?: string;\n /** Sets the arial-label attribute for the closeButton. */\n closeButtonAriaLabel?: string;\n}\n\nexport const PopMenu: React.FC<PopMenuProps> = (props: PopMenuProps) => {\n const closeRef = useRef<HTMLButtonElement>(null);\n const openRef = useRef<HTMLButtonElement>(null);\n const popOverRef = useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const {\n children,\n popOverClassName,\n popMenuClassName,\n openButtonTestId,\n closeButtonTestId,\n popOverTestId,\n popMenuVariant = PopMenuVariant.onWhite,\n openButtonAriaLabel,\n closeButtonAriaLabel,\n } = props;\n const buttonClasses = classNames(styles['pop-menu-button'], {\n [styles[`pop-menu-button--${popMenuVariant}`]]: popMenuVariant,\n });\n const breakpoint = useBreakpoint();\n const mobile = breakpoint < breakpoints.md;\n useOutsideEvent(popOverRef, () => setIsOpen(!isOpen));\n const { isHovered: openButtonIsHovered } = useHover(openRef);\n const mobileIconSize = mobile ? IconSize.XSmall : IconSize.Small;\n\n const renderChildren = () => {\n if (isComponent<LinkListProps>(children, LinkList)) {\n return (\n <PopOver\n testId={popOverTestId}\n className={classNames(styles['pop-menu__pop-over'], popOverClassName)}\n arrowClassName={styles['pop-menu__pop-over-arrow']}\n controllerRef={closeRef}\n popOverRef={popOverRef}\n >\n {children}\n </PopOver>\n );\n }\n };\n\n const handleOnClick = (isOpen: boolean, e?: React.MouseEvent<HTMLElement, MouseEvent>): void => {\n e && e.stopPropagation();\n setIsOpen(isOpen);\n };\n\n const openButton = (\n <button\n ref={openRef}\n data-testid={openButtonTestId}\n className={buttonClasses}\n aria-label={openButtonAriaLabel || 'Se mer'}\n onClick={(e?: React.MouseEvent<HTMLElement, MouseEvent>) => handleOnClick(true, e)}\n type=\"button\"\n >\n <Icon svgIcon={VerticalDots} className=\"test\" color={getColor('black')} size={mobileIconSize} isHovered={openButtonIsHovered} />\n </button>\n );\n\n const closeButton = (\n <Close\n ariaLabel={closeButtonAriaLabel}\n color=\"black\"\n className={buttonClasses}\n testId={closeButtonTestId}\n ref={closeRef}\n onClick={(e?: React.MouseEvent<HTMLElement, MouseEvent>) => handleOnClick(false, e)}\n small={mobile}\n />\n );\n\n return (\n <div className={classNames(styles['pop-menu-button'], popMenuClassName)} data-analyticsid={AnalyticsId.PopMenu}>\n {!isOpen ? openButton : closeButton}\n {isOpen && renderChildren()}\n </div>\n );\n};\n\nexport default PopMenu;\n"],"names":["PopMenuVariant","PopMenu","props","closeRef","useRef","openRef","popOverRef","isOpen","setIsOpen","useState","children","popOverClassName","popMenuClassName","openButtonTestId","closeButtonTestId","popOverTestId","popMenuVariant","openButtonAriaLabel","closeButtonAriaLabel","buttonClasses","classNames","styles","mobile","useBreakpoint","breakpoints","useOutsideEvent","openButtonIsHovered","useHover","mobileIconSize","IconSize","renderChildren","isComponent","LinkList","React","PopOver","handleOnClick","e","openButton","Icon","VerticalDots","getColor","closeButton","Close","AnalyticsId","PopMenu$1"],"mappings":";;;;;;;;;;;;;;;AAmBY,IAAAA,sBAAAA,OACVA,EAAA,UAAU,YACVA,EAAA,SAAS,WACTA,EAAA,cAAc,gBAHJA,IAAAA,KAAA,CAAA,CAAA;AA2BC,MAAAC,IAAkC,CAACC,MAAwB;AAChE,QAAAC,IAAWC,EAA0B,IAAI,GACzCC,IAAUD,EAA0B,IAAI,GACxCE,IAAaF,EAAuB,IAAI,GACxC,CAACG,GAAQC,CAAS,IAAIC,EAAS,EAAK,GACpC;AAAA,IACJ,UAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,qBAAAC;AAAA,IACA,sBAAAC;AAAA,EACE,IAAAhB,GACEiB,IAAgBC,EAAWC,EAAO,iBAAiB,GAAG;AAAA,IAC1D,CAACA,EAAO,oBAAoBL,CAAc,EAAE,CAAC,GAAGA;AAAA,EAAA,CACjD,GAEKM,IADaC,MACSC,EAAY;AACxC,EAAAC,EAAgBnB,GAAY,MAAME,EAAU,CAACD,CAAM,CAAC;AACpD,QAAM,EAAE,WAAWmB,EAAoB,IAAIC,EAAStB,CAAO,GACrDuB,IAAiBN,IAASO,EAAS,SAASA,EAAS,OAErDC,IAAiB,MAAM;AACvB,QAAAC,EAA2BrB,GAAUsB,CAAQ;AAE7C,aAAAC,gBAAAA,EAAA;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,QAAQnB;AAAA,UACR,WAAWK,EAAWC,EAAO,oBAAoB,GAAGV,CAAgB;AAAA,UACpE,gBAAgBU,EAAO,0BAA0B;AAAA,UACjD,eAAelB;AAAA,UACf,YAAAG;AAAA,QAAA;AAAA,QAECI;AAAA,MAAA;AAAA,EAGP,GAGIyB,IAAgB,CAAC5B,GAAiB6B,MAAwD;AAC9F,IAAAA,KAAKA,EAAE,mBACP5B,EAAUD,CAAM;AAAA,EAAA,GAGZ8B,IACJJ,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK5B;AAAA,MACL,eAAaQ;AAAA,MACb,WAAWM;AAAA,MACX,cAAYF,KAAuB;AAAA,MACnC,SAAS,CAACmB,MAAkDD,EAAc,IAAMC,CAAC;AAAA,MACjF,MAAK;AAAA,IAAA;AAAA,IAEJH,gBAAAA,EAAA,cAAAK,GAAA,EAAK,SAASC,GAAc,WAAU,QAAO,OAAOC,EAAS,OAAO,GAAG,MAAMZ,GAAgB,WAAWF,GAAqB;AAAA,EAAA,GAI5He,IACJR,gBAAAA,EAAA;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,WAAWxB;AAAA,MACX,OAAM;AAAA,MACN,WAAWC;AAAA,MACX,QAAQL;AAAA,MACR,KAAKX;AAAA,MACL,SAAS,CAACiC,MAAkDD,EAAc,IAAOC,CAAC;AAAA,MAClF,OAAOd;AAAA,IAAA;AAAA,EAAA;AAIX,yCACG,OAAI,EAAA,WAAWF,EAAWC,EAAO,iBAAiB,GAAGT,CAAgB,GAAG,oBAAkB+B,EAAY,WACnGpC,IAAsBkC,IAAbJ,GACV9B,KAAUuB,GACb;AAEJ,GAEAc,KAAe3C;"}
|
|
@@ -16,19 +16,19 @@ const b = t.forwardRef((o, d) => {
|
|
|
16
16
|
controllerRef: n,
|
|
17
17
|
popOverRef: S,
|
|
18
18
|
show: R = !1,
|
|
19
|
-
className:
|
|
19
|
+
className: _ = "",
|
|
20
20
|
variant: p = "positionautomatic",
|
|
21
21
|
role: c,
|
|
22
|
-
testId:
|
|
23
|
-
arrowClassName:
|
|
24
|
-
} = o, m = S || f(null),
|
|
22
|
+
testId: g,
|
|
23
|
+
arrowClassName: z
|
|
24
|
+
} = o, m = S || f(null), C = f(null), s = k(m), [e, N] = A(), E = $(n, 0), l = () => {
|
|
25
25
|
var u;
|
|
26
|
-
|
|
26
|
+
N((u = n.current) == null ? void 0 : u.getBoundingClientRect());
|
|
27
27
|
};
|
|
28
28
|
V(l, 500), j(l, ["scroll", "resize"], 10), B(() => {
|
|
29
29
|
l();
|
|
30
30
|
}, []);
|
|
31
|
-
const I = c === "tooltip", O = v(r.popover, { [r["popover--visible"]]: I ? R : E },
|
|
31
|
+
const I = c === "tooltip", O = v(r.popover, { [r["popover--visible"]]: I ? R : E }, _), i = e && s && x(e, s, p), P = v(r.popover__arrow, z, {
|
|
32
32
|
[r["popover__arrow--over"]]: i === "positionbelow",
|
|
33
33
|
[r["popover__arrow--under"]]: i === "positionabove"
|
|
34
34
|
/* positionabove */
|
|
@@ -40,12 +40,12 @@ const b = t.forwardRef((o, d) => {
|
|
|
40
40
|
ref: q([d, m]),
|
|
41
41
|
className: O,
|
|
42
42
|
style: a,
|
|
43
|
-
"data-testid":
|
|
43
|
+
"data-testid": g,
|
|
44
44
|
"data-analyticsid": T.PopOver,
|
|
45
45
|
role: c
|
|
46
46
|
},
|
|
47
47
|
y
|
|
48
|
-
), /* @__PURE__ */ t.createElement("div", { ref:
|
|
48
|
+
), /* @__PURE__ */ t.createElement("div", { ref: C, className: P, style: h }));
|
|
49
49
|
});
|
|
50
50
|
b.displayName = "PopOver";
|
|
51
51
|
const Z = b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopOver.js","sources":["../../../src/components/PopOver/PopOver.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getArrowStyle, getBubbleStyle, getVerticalPosition } from './utils';\nimport { AnalyticsId } from '../../constants';\nimport { useInterval } from '../../hooks/useInterval';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useLayoutEvent } from '../../hooks/useLayoutEvent';\nimport { useSize } from '../../hooks/useSize';\nimport { mergeRefs } from '../../utils/refs';\n\nimport styles from './styles.module.scss';\n\nexport enum PopOverVariant {\n positionautomatic = 'positionautomatic',\n positionbelow = 'positionbelow',\n positionabove = 'positionabove',\n}\n\nexport type PopOverRole = 'tooltip';\n\nexport interface PopOverProps {\n /** Id of the PopOver */\n id?: string;\n /** Content shown inside PopOver. Note that if role=\"tooltip\", you must not include interactive/focusable elements. */\n children: React.ReactNode;\n /** Ref for the element the PopOver is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Ref for the element the PopOver is placed upon */\n popOverRef?: React.RefObject<HTMLDivElement>;\n /** Show the popover. Only applies when role=tooltip. Default: false. */\n show?: boolean;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the arrow element. */\n arrowClassName?: string;\n /** Determines the placement of the popover. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\n /** Sets role of the PopOver element */\n role?: PopOverRole;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst PopOver = React.forwardRef<HTMLDivElement | SVGSVGElement, PopOverProps>((props, ref) => {\n const {\n id,\n children,\n controllerRef,\n popOverRef,\n show = false,\n className = '',\n variant = PopOverVariant.positionautomatic,\n role,\n testId,\n arrowClassName,\n } = props;\n\n const bubbleRef = popOverRef || useRef<HTMLDivElement>(null);\n const arrowRef = useRef<HTMLDivElement>(null);\n const bubbleSize = useSize(bubbleRef);\n const [controllerSize, setControllerSize] = useState<DOMRect>();\n const controllerisVisible = useIsVisible(controllerRef, 0);\n\n const updateControllerSize = (): void => {\n setControllerSize(controllerRef.current?.getBoundingClientRect());\n };\n\n useInterval(updateControllerSize, 500);\n useLayoutEvent(updateControllerSize, ['scroll', 'resize'], 10);\n\n useEffect(() => {\n updateControllerSize();\n }, []);\n\n const isTooltip = role === 'tooltip';\n\n const popOverClasses = classNames(styles.popover, { [styles['popover--visible']]: isTooltip ? show : controllerisVisible }, className);\n const verticalPosition = controllerSize && bubbleSize && getVerticalPosition(controllerSize, bubbleSize, variant);\n const arrowClasses = classNames(styles.popover__arrow, arrowClassName, {\n [styles['popover__arrow--over']]: verticalPosition === PopOverVariant.positionbelow,\n [styles['popover__arrow--under']]: verticalPosition === PopOverVariant.positionabove,\n });\n\n const bubbleStyle = controllerSize && bubbleSize && getBubbleStyle(controllerSize, bubbleSize, variant);\n const arrowStyle = bubbleStyle && controllerSize && verticalPosition && getArrowStyle(bubbleStyle, controllerSize, verticalPosition);\n\n return (\n <>\n <div\n id={id}\n ref={mergeRefs([ref, bubbleRef])}\n className={popOverClasses}\n style={bubbleStyle}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PopOver}\n role={role}\n >\n {children}\n </div>\n <div ref={arrowRef} className={arrowClasses} style={arrowStyle} />\n </>\n );\n});\n\nPopOver.displayName = 'PopOver';\n\nexport default PopOver;\n"],"names":["PopOverVariant","PopOver","React","props","ref","id","children","controllerRef","popOverRef","show","className","variant","role","testId","arrowClassName","bubbleRef","useRef","arrowRef","bubbleSize","useSize","controllerSize","setControllerSize","useState","controllerisVisible","useIsVisible","updateControllerSize","_a","useInterval","useLayoutEvent","useEffect","isTooltip","popOverClasses","classNames","styles","verticalPosition","getVerticalPosition","arrowClasses","bubbleStyle","getBubbleStyle","arrowStyle","getArrowStyle","mergeRefs","AnalyticsId","PopOver$1"],"mappings":";;;;;;;;;;AAcY,IAAAA,sBAAAA,OACVA,EAAA,oBAAoB,qBACpBA,EAAA,gBAAgB,iBAChBA,EAAA,gBAAgB,iBAHNA,IAAAA,KAAA,CAAA,CAAA;AA+BZ,MAAMC,IAAUC,EAAM,WAAyD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,gBAAAC;AAAA,EACE,IAAAX,GAEEY,IAAYP,KAAcQ,EAAuB,IAAI,GACrDC,IAAWD,EAAuB,IAAI,GACtCE,IAAaC,EAAQJ,CAAS,GAC9B,CAACK,GAAgBC,CAAiB,IAAIC,EAAkB,GACxDC,IAAsBC,EAAajB,GAAe,CAAC,GAEnDkB,IAAuB,MAAY;;AACrB,IAAAJ,GAAAK,IAAAnB,EAAc,YAAd,gBAAAmB,EAAuB,uBAAuB;AAAA,EAAA;AAGlE,EAAAC,EAAYF,GAAsB,GAAG,GACrCG,EAAeH,GAAsB,CAAC,UAAU,QAAQ,GAAG,EAAE,GAE7DI,EAAU,MAAM;AACO,IAAAJ;EACvB,GAAG,CAAE,CAAA;AAEL,QAAMK,IAAYlB,MAAS,WAErBmB,IAAiBC,EAAWC,EAAO,SAAS,EAAE,CAACA,EAAO,kBAAkB,CAAC,GAAGH,IAAYrB,IAAOc,KAAuBb,CAAS,GAC/HwB,IAAmBd,KAAkBF,KAAciB,EAAoBf,GAAgBF,GAAYP,CAAO,GAC1GyB,IAAeJ,EAAWC,EAAO,gBAAgBnB,GAAgB;AAAA,IACrE,CAACmB,EAAO,sBAAsB,CAAC,GAAGC,MAAqB;AAAA,IACvD,CAACD,EAAO,uBAAuB,CAAC,GAAGC,MAAqB;AAAA;AAAA,EAAA,CACzD,GAEKG,IAAcjB,KAAkBF,KAAcoB,EAAelB,GAAgBF,GAAYP,CAAO,GAChG4B,IAAaF,KAAejB,KAAkBc,KAAoBM,EAAcH,GAAajB,GAAgBc,CAAgB;AAEnI,
|
|
1
|
+
{"version":3,"file":"PopOver.js","sources":["../../../src/components/PopOver/PopOver.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getArrowStyle, getBubbleStyle, getVerticalPosition } from './utils';\nimport { AnalyticsId } from '../../constants';\nimport { useInterval } from '../../hooks/useInterval';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useLayoutEvent } from '../../hooks/useLayoutEvent';\nimport { useSize } from '../../hooks/useSize';\nimport { mergeRefs } from '../../utils/refs';\n\nimport styles from './styles.module.scss';\n\nexport enum PopOverVariant {\n positionautomatic = 'positionautomatic',\n positionbelow = 'positionbelow',\n positionabove = 'positionabove',\n}\n\nexport type PopOverRole = 'tooltip';\n\nexport interface PopOverProps {\n /** Id of the PopOver */\n id?: string;\n /** Content shown inside PopOver. Note that if role=\"tooltip\", you must not include interactive/focusable elements. */\n children: React.ReactNode;\n /** Ref for the element the PopOver is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Ref for the element the PopOver is placed upon */\n popOverRef?: React.RefObject<HTMLDivElement>;\n /** Show the popover. Only applies when role=tooltip. Default: false. */\n show?: boolean;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the arrow element. */\n arrowClassName?: string;\n /** Determines the placement of the popover. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\n /** Sets role of the PopOver element */\n role?: PopOverRole;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst PopOver = React.forwardRef<HTMLDivElement | SVGSVGElement, PopOverProps>((props, ref) => {\n const {\n id,\n children,\n controllerRef,\n popOverRef,\n show = false,\n className = '',\n variant = PopOverVariant.positionautomatic,\n role,\n testId,\n arrowClassName,\n } = props;\n\n const bubbleRef = popOverRef || useRef<HTMLDivElement>(null);\n const arrowRef = useRef<HTMLDivElement>(null);\n const bubbleSize = useSize(bubbleRef);\n const [controllerSize, setControllerSize] = useState<DOMRect>();\n const controllerisVisible = useIsVisible(controllerRef, 0);\n\n const updateControllerSize = (): void => {\n setControllerSize(controllerRef.current?.getBoundingClientRect());\n };\n\n useInterval(updateControllerSize, 500);\n useLayoutEvent(updateControllerSize, ['scroll', 'resize'], 10);\n\n useEffect(() => {\n updateControllerSize();\n }, []);\n\n const isTooltip = role === 'tooltip';\n\n const popOverClasses = classNames(styles.popover, { [styles['popover--visible']]: isTooltip ? show : controllerisVisible }, className);\n const verticalPosition = controllerSize && bubbleSize && getVerticalPosition(controllerSize, bubbleSize, variant);\n const arrowClasses = classNames(styles.popover__arrow, arrowClassName, {\n [styles['popover__arrow--over']]: verticalPosition === PopOverVariant.positionbelow,\n [styles['popover__arrow--under']]: verticalPosition === PopOverVariant.positionabove,\n });\n\n const bubbleStyle = controllerSize && bubbleSize && getBubbleStyle(controllerSize, bubbleSize, variant);\n const arrowStyle = bubbleStyle && controllerSize && verticalPosition && getArrowStyle(bubbleStyle, controllerSize, verticalPosition);\n\n return (\n <>\n <div\n id={id}\n ref={mergeRefs([ref, bubbleRef])}\n className={popOverClasses}\n style={bubbleStyle}\n data-testid={testId}\n data-analyticsid={AnalyticsId.PopOver}\n role={role}\n >\n {children}\n </div>\n <div ref={arrowRef} className={arrowClasses} style={arrowStyle} />\n </>\n );\n});\n\nPopOver.displayName = 'PopOver';\n\nexport default PopOver;\n"],"names":["PopOverVariant","PopOver","React","props","ref","id","children","controllerRef","popOverRef","show","className","variant","role","testId","arrowClassName","bubbleRef","useRef","arrowRef","bubbleSize","useSize","controllerSize","setControllerSize","useState","controllerisVisible","useIsVisible","updateControllerSize","_a","useInterval","useLayoutEvent","useEffect","isTooltip","popOverClasses","classNames","styles","verticalPosition","getVerticalPosition","arrowClasses","bubbleStyle","getBubbleStyle","arrowStyle","getArrowStyle","mergeRefs","AnalyticsId","PopOver$1"],"mappings":";;;;;;;;;;AAcY,IAAAA,sBAAAA,OACVA,EAAA,oBAAoB,qBACpBA,EAAA,gBAAgB,iBAChBA,EAAA,gBAAgB,iBAHNA,IAAAA,KAAA,CAAA,CAAA;AA+BZ,MAAMC,IAAUC,EAAM,WAAyD,CAACC,GAAOC,MAAQ;AACvF,QAAA;AAAA,IACJ,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC,IAAY;AAAA,IACZ,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,gBAAAC;AAAA,EACE,IAAAX,GAEEY,IAAYP,KAAcQ,EAAuB,IAAI,GACrDC,IAAWD,EAAuB,IAAI,GACtCE,IAAaC,EAAQJ,CAAS,GAC9B,CAACK,GAAgBC,CAAiB,IAAIC,EAAkB,GACxDC,IAAsBC,EAAajB,GAAe,CAAC,GAEnDkB,IAAuB,MAAY;;AACrB,IAAAJ,GAAAK,IAAAnB,EAAc,YAAd,gBAAAmB,EAAuB,uBAAuB;AAAA,EAAA;AAGlE,EAAAC,EAAYF,GAAsB,GAAG,GACrCG,EAAeH,GAAsB,CAAC,UAAU,QAAQ,GAAG,EAAE,GAE7DI,EAAU,MAAM;AACO,IAAAJ;EACvB,GAAG,CAAE,CAAA;AAEL,QAAMK,IAAYlB,MAAS,WAErBmB,IAAiBC,EAAWC,EAAO,SAAS,EAAE,CAACA,EAAO,kBAAkB,CAAC,GAAGH,IAAYrB,IAAOc,KAAuBb,CAAS,GAC/HwB,IAAmBd,KAAkBF,KAAciB,EAAoBf,GAAgBF,GAAYP,CAAO,GAC1GyB,IAAeJ,EAAWC,EAAO,gBAAgBnB,GAAgB;AAAA,IACrE,CAACmB,EAAO,sBAAsB,CAAC,GAAGC,MAAqB;AAAA,IACvD,CAACD,EAAO,uBAAuB,CAAC,GAAGC,MAAqB;AAAA;AAAA,EAAA,CACzD,GAEKG,IAAcjB,KAAkBF,KAAcoB,EAAelB,GAAgBF,GAAYP,CAAO,GAChG4B,IAAaF,KAAejB,KAAkBc,KAAoBM,EAAcH,GAAajB,GAAgBc,CAAgB;AAEnI,SAEIhC,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAAA,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAAG;AAAA,MACA,KAAKoC,EAAU,CAACrC,GAAKW,CAAS,CAAC;AAAA,MAC/B,WAAWgB;AAAA,MACX,OAAOM;AAAA,MACP,eAAaxB;AAAA,MACb,oBAAkB6B,EAAY;AAAA,MAC9B,MAAA9B;AAAA,IAAA;AAAA,IAECN;AAAA,EACH,mCACC,OAAI,EAAA,KAAKW,GAAU,WAAWmB,GAAc,OAAOG,EAAA,CAAY,CAClE;AAEJ,CAAC;AAEDtC,EAAQ,cAAc;AAEtB,MAAA0C,IAAe1C;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import c from "react";
|
|
2
|
-
import { createPortal as
|
|
2
|
+
import { createPortal as s } from "react-dom";
|
|
3
3
|
import { AnalyticsId as n } from "../../constants.js";
|
|
4
|
-
function p({ children:
|
|
4
|
+
function p({ children: l, parent: e, className: o, testId: i }) {
|
|
5
5
|
const t = c.useMemo(() => document.createElement("div"), []);
|
|
6
6
|
return t.setAttribute("data-analyticsid", n.Portal), i && t.setAttribute("data-testid", i), c.useEffect(() => {
|
|
7
7
|
const a = e && e.appendChild ? e : document.body, d = ["portal-container"];
|
|
8
8
|
return o && o.split(" ").forEach((r) => d.push(r)), d.forEach((r) => t.classList.add(r)), a.appendChild(t), () => {
|
|
9
9
|
a.removeChild(t);
|
|
10
10
|
};
|
|
11
|
-
}, [t, e, o]), l
|
|
11
|
+
}, [t, e, o]), s(l, t);
|
|
12
12
|
}
|
|
13
13
|
export {
|
|
14
14
|
p as default
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PaletteNames } from '../../theme/palette';
|
|
3
|
+
import { AnchorLinkTags, AnchorLinkTargets } from '../AnchorLink';
|
|
4
|
+
import { IllustrationProps } from '../Illustration/Illustration';
|
|
5
|
+
import { TitleTags } from '../Title';
|
|
6
|
+
export type PromoPanelColors = Extract<PaletteNames, 'neutral' | 'blueberry' | 'cherry'>;
|
|
7
|
+
interface PromoPanelProps {
|
|
8
|
+
/** Used as the link text if set. title or children must be set for the link to have accessible text. */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** Used as the link text if title is not set. */
|
|
11
|
+
children?: string;
|
|
12
|
+
/** Illustration element */
|
|
13
|
+
illustration?: React.FC<IllustrationProps>;
|
|
14
|
+
/** Changes the underlying element of the title. */
|
|
15
|
+
titleHtmlMarkup?: TitleTags;
|
|
16
|
+
/** Changes the background color. Default: white */
|
|
17
|
+
color?: PromoPanelColors;
|
|
18
|
+
/** Not used if linkComponent is set */
|
|
19
|
+
href?: string;
|
|
20
|
+
/** Anchor link target. If linkComponent is set, this prop is only used to display the right icon for external links. */
|
|
21
|
+
target?: AnchorLinkTargets;
|
|
22
|
+
/** HTML markup for anchor link. Not used if linkComponent is set. Default: a */
|
|
23
|
+
linkHtmlMarkup?: AnchorLinkTags;
|
|
24
|
+
/** Function that is called when clicked. Not used if linkComponent is set. */
|
|
25
|
+
linkOnClick?: () => void;
|
|
26
|
+
/** Custom link component. Must be "a" a or "button" element with no styling. */
|
|
27
|
+
linkComponent?: React.ReactElement;
|
|
28
|
+
/** Sets the data-testid attribute. */
|
|
29
|
+
testId?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const PromoPanel: React.FC<PromoPanelProps>;
|
|
32
|
+
export default PromoPanel;
|
|
33
|
+
//# sourceMappingURL=PromoPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromoPanel.d.ts","sourceRoot":"","sources":["../../../src/components/PromoPanel/PromoPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC,CAAC;AAEzF,UAAU,eAAe;IACvB,wGAAwG;IACxG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;IAC3C,mDAAmD;IACnD,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,mDAAmD;IACnD,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wHAAwH;IACxH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,gFAAgF;IAChF,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,gFAAgF;IAChF,aAAa,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IACnC,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8BD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgDzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import t from "react";
|
|
2
|
+
import d from "classnames";
|
|
3
|
+
import { AnalyticsId as s, IconSize as o } from "../../constants.js";
|
|
4
|
+
import { useBreakpoint as h, Breakpoint as C } from "../../hooks/useBreakpoint.js";
|
|
5
|
+
import { useHover as E } from "../../hooks/useHover.js";
|
|
6
|
+
import { getColor as r } from "../../theme/currys/color.js";
|
|
7
|
+
import { Icon as P } from "../Icon/Icon.js";
|
|
8
|
+
import b from "../Icons/ArrowRight.js";
|
|
9
|
+
import g from "../Icons/ArrowUpRight.js";
|
|
10
|
+
import _ from "../Title/Title.js";
|
|
11
|
+
import n from "./styles.module.scss";
|
|
12
|
+
const v = (e) => e.linkComponent ? t.cloneElement(e.linkComponent, { children: e.children }) : e.linkHtmlMarkup === "button" ? /* @__PURE__ */ t.createElement("button", { type: "button", onClick: e.linkOnClick }, e.children) : /* @__PURE__ */ t.createElement("a", { href: e.href, target: e.target, onClick: e.linkOnClick }, e.children), y = (e) => {
|
|
13
|
+
const { isHovered: i, hoverRef: a } = E(), { color: m = "neutral", titleHtmlMarkup: c = "h2", linkHtmlMarkup: k = "a" } = e, u = h(), f = d(
|
|
14
|
+
n.promopanel,
|
|
15
|
+
n[`promopanel--${m}`],
|
|
16
|
+
!e.illustration && n["promopanel--no-illustration"]
|
|
17
|
+
), l = /* @__PURE__ */ t.createElement(
|
|
18
|
+
v,
|
|
19
|
+
{
|
|
20
|
+
href: e.href,
|
|
21
|
+
target: e.target,
|
|
22
|
+
linkComponent: e.linkComponent,
|
|
23
|
+
linkHtmlMarkup: k,
|
|
24
|
+
linkOnClick: e.linkOnClick
|
|
25
|
+
},
|
|
26
|
+
e.title || e.children
|
|
27
|
+
);
|
|
28
|
+
return /* @__PURE__ */ t.createElement("div", { className: f, "data-testid": e.testId, "data-analyticsid": s.PromoPanel, ref: a }, t.isValidElement(e.illustration) && t.cloneElement(e.illustration, { className: n.promopanel__illustration }), /* @__PURE__ */ t.createElement("div", { className: n.promopanel__content }, e.title && /* @__PURE__ */ t.createElement(_, { htmlMarkup: c, appearance: "title3" }, l), e.title ? e.children : l), /* @__PURE__ */ t.createElement("div", { className: n.promopanel__icon }, /* @__PURE__ */ t.createElement(
|
|
29
|
+
P,
|
|
30
|
+
{
|
|
31
|
+
svgIcon: e.target === "_blank" ? g : b,
|
|
32
|
+
size: u >= C.md ? o.Small : o.XSmall,
|
|
33
|
+
isHovered: i,
|
|
34
|
+
color: r("blueberry", 500),
|
|
35
|
+
hoverColor: r("blueberry", 600)
|
|
36
|
+
}
|
|
37
|
+
)));
|
|
38
|
+
}, L = y;
|
|
39
|
+
export {
|
|
40
|
+
L as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=PromoPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromoPanel.js","sources":["../../../src/components/PromoPanel/PromoPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useHover } from '../../hooks/useHover';\nimport { getColor } from '../../theme/currys/color';\nimport { PaletteNames } from '../../theme/palette';\nimport { AnchorLinkTags, AnchorLinkTargets } from '../AnchorLink';\nimport Icon from '../Icon';\nimport ArrowRight from '../Icons/ArrowRight';\nimport ArrowUpRight from '../Icons/ArrowUpRight';\nimport { IllustrationProps } from '../Illustration/Illustration';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type PromoPanelColors = Extract<PaletteNames, 'neutral' | 'blueberry' | 'cherry'>;\n\ninterface PromoPanelProps {\n /** Used as the link text if set. title or children must be set for the link to have accessible text. */\n title?: string;\n /** Used as the link text if title is not set. */\n children?: string;\n /** Illustration element */\n illustration?: React.FC<IllustrationProps>;\n /** Changes the underlying element of the title. */\n titleHtmlMarkup?: TitleTags;\n /** Changes the background color. Default: white */\n color?: PromoPanelColors;\n /** Not used if linkComponent is set */\n href?: string;\n /** Anchor link target. If linkComponent is set, this prop is only used to display the right icon for external links. */\n target?: AnchorLinkTargets;\n /** HTML markup for anchor link. Not used if linkComponent is set. Default: a */\n linkHtmlMarkup?: AnchorLinkTags;\n /** Function that is called when clicked. Not used if linkComponent is set. */\n linkOnClick?: () => void;\n /** Custom link component. Must be \"a\" a or \"button\" element with no styling. */\n linkComponent?: React.ReactElement;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface PromoPanelLinkProps {\n children?: string;\n href?: string;\n target?: AnchorLinkTargets;\n linkComponent?: React.ReactElement;\n linkHtmlMarkup?: AnchorLinkTags;\n linkOnClick?: () => void;\n}\n\nconst PromoPanelLink: React.FC<PromoPanelLinkProps> = props => {\n if (props.linkComponent) {\n return React.cloneElement(props.linkComponent, { children: props.children });\n }\n\n if (props.linkHtmlMarkup === 'button') {\n return (\n <button type={'button'} onClick={props.linkOnClick}>\n {props.children}\n </button>\n );\n }\n return (\n <a href={props.href} target={props.target} onClick={props.linkOnClick}>\n {props.children}\n </a>\n );\n};\n\nconst PromoPanel: React.FC<PromoPanelProps> = props => {\n const { isHovered, hoverRef } = useHover<HTMLDivElement>();\n\n const { color = 'neutral', titleHtmlMarkup = 'h2', linkHtmlMarkup = 'a' } = props;\n\n const breakpoint = useBreakpoint();\n\n const promoPanelClasses = classNames(\n styles.promopanel,\n styles[`promopanel--${color}`],\n !props.illustration && styles['promopanel--no-illustration']\n );\n\n const promoPanelLink = (\n <PromoPanelLink\n href={props.href}\n target={props.target}\n linkComponent={props.linkComponent}\n linkHtmlMarkup={linkHtmlMarkup}\n linkOnClick={props.linkOnClick}\n >\n {props.title || props.children}\n </PromoPanelLink>\n );\n\n return (\n <div className={promoPanelClasses} data-testid={props.testId} data-analyticsid={AnalyticsId.PromoPanel} ref={hoverRef}>\n {React.isValidElement<IllustrationProps>(props.illustration) &&\n React.cloneElement(props.illustration, { className: styles.promopanel__illustration })}\n <div className={styles.promopanel__content}>\n {props.title && (\n <Title htmlMarkup={titleHtmlMarkup} appearance={'title3'}>\n {promoPanelLink}\n </Title>\n )}\n {!props.title ? promoPanelLink : props.children}\n </div>\n <div className={styles.promopanel__icon}>\n <Icon\n svgIcon={props.target === '_blank' ? ArrowUpRight : ArrowRight}\n size={breakpoint >= Breakpoint.md ? IconSize.Small : IconSize.XSmall}\n isHovered={isHovered}\n color={getColor('blueberry', 500)}\n hoverColor={getColor('blueberry', 600)}\n />\n </div>\n </div>\n );\n};\n\nexport default PromoPanel;\n"],"names":["PromoPanelLink","props","React","PromoPanel","isHovered","hoverRef","useHover","color","titleHtmlMarkup","linkHtmlMarkup","breakpoint","useBreakpoint","promoPanelClasses","classNames","styles","promoPanelLink","AnalyticsId","Title","Icon","ArrowUpRight","ArrowRight","Breakpoint","IconSize","getColor","PromoPanel$1"],"mappings":";;;;;;;;;;;AAsDA,MAAMA,IAAgD,CAASC,MACzDA,EAAM,gBACDC,EAAM,aAAaD,EAAM,eAAe,EAAE,UAAUA,EAAM,UAAU,IAGzEA,EAAM,mBAAmB,WAEzBC,gBAAAA,EAAA,cAAC,YAAO,MAAM,UAAU,SAASD,EAAM,YAAA,GACpCA,EAAM,QACT,IAIDC,gBAAAA,EAAA,cAAA,KAAA,EAAE,MAAMD,EAAM,MAAM,QAAQA,EAAM,QAAQ,SAASA,EAAM,YACvD,GAAAA,EAAM,QACT,GAIEE,IAAwC,CAASF,MAAA;AACrD,QAAM,EAAE,WAAAG,GAAW,UAAAC,EAAS,IAAIC,EAAyB,GAEnD,EAAE,OAAAC,IAAQ,WAAW,iBAAAC,IAAkB,MAAM,gBAAAC,IAAiB,IAAQ,IAAAR,GAEtES,IAAaC,KAEbC,IAAoBC;AAAA,IACxBC,EAAO;AAAA,IACPA,EAAO,eAAeP,CAAK,EAAE;AAAA,IAC7B,CAACN,EAAM,gBAAgBa,EAAO,6BAA6B;AAAA,EAAA,GAGvDC,IACJb,gBAAAA,EAAA;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,MAAMC,EAAM;AAAA,MACZ,QAAQA,EAAM;AAAA,MACd,eAAeA,EAAM;AAAA,MACrB,gBAAAQ;AAAA,MACA,aAAaR,EAAM;AAAA,IAAA;AAAA,IAElBA,EAAM,SAASA,EAAM;AAAA,EAAA;AAKxB,SAAAC,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWU,GAAmB,eAAaX,EAAM,QAAQ,oBAAkBe,EAAY,YAAY,KAAKX,EAAA,GAC1GH,EAAM,eAAkCD,EAAM,YAAY,KACzDC,EAAM,aAAaD,EAAM,cAAc,EAAE,WAAWa,EAAO,yBAA0B,CAAA,GACtFZ,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWY,EAAO,oBACpB,GAAAb,EAAM,SACJC,gBAAAA,EAAA,cAAAe,GAAA,EAAM,YAAYT,GAAiB,YAAY,SAAA,GAC7CO,CACH,GAEAd,EAAM,QAAyBA,EAAM,WAAvBc,CAClB,GACCb,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWY,EAAO,iBACrB,GAAAZ,gBAAAA,EAAA;AAAA,IAACgB;AAAA,IAAA;AAAA,MACC,SAASjB,EAAM,WAAW,WAAWkB,IAAeC;AAAA,MACpD,MAAMV,KAAcW,EAAW,KAAKC,EAAS,QAAQA,EAAS;AAAA,MAC9D,WAAAlB;AAAA,MACA,OAAOmB,EAAS,aAAa,GAAG;AAAA,MAChC,YAAYA,EAAS,aAAa,GAAG;AAAA,IAAA;AAAA,EAEzC,CAAA,CACF;AAEJ,GAEAC,IAAerB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PromoPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import '../../scss/palette';
|
|
3
|
+
@import '../../scss/spacers';
|
|
4
|
+
@import '../../scss/breakpoints';
|
|
5
|
+
|
|
6
|
+
$colors: 'neutral', 'blueberry', 'cherry';
|
|
7
|
+
|
|
8
|
+
.promopanel {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
padding-left: getSpacer(s);
|
|
15
|
+
padding-right: getSpacer(s);
|
|
16
|
+
transition: background-color 0.15s ease-in-out;
|
|
17
|
+
|
|
18
|
+
&:focus-within {
|
|
19
|
+
box-shadow: 0 0 0 2px $black, inset 0 0 0 2px $black;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (min-width: map.get($grid-breakpoints, xs)) {
|
|
23
|
+
padding-left: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
27
|
+
padding-right: getSpacer(l);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--no-illustration {
|
|
31
|
+
padding-left: getSpacer(s);
|
|
32
|
+
|
|
33
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
34
|
+
padding-left: getSpacer(l);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@each $color in $colors {
|
|
39
|
+
&--#{$color} {
|
|
40
|
+
background-color: map.get($palette-map, #{$color}50);
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: map.get($palette-map, #{$color}100);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__illustration {
|
|
49
|
+
display: none;
|
|
50
|
+
flex-shrink: 0;
|
|
51
|
+
|
|
52
|
+
@media (min-width: map.get($grid-breakpoints, xs)) {
|
|
53
|
+
display: inline;
|
|
54
|
+
width: 120px;
|
|
55
|
+
height: auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
59
|
+
width: 156px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
63
|
+
width: 180px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&__content {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: getSpacer(3xs);
|
|
71
|
+
max-width: 696px;
|
|
72
|
+
padding-top: getSpacer(m);
|
|
73
|
+
padding-bottom: getSpacer(m);
|
|
74
|
+
|
|
75
|
+
@media (min-width: map.get($grid-breakpoints, md)) {
|
|
76
|
+
gap: getSpacer(2xs);
|
|
77
|
+
padding-top: getSpacer(l);
|
|
78
|
+
padding-bottom: getSpacer(l);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
82
|
+
padding-top: getSpacer(xl);
|
|
83
|
+
padding-bottom: getSpacer(xl);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
a,
|
|
87
|
+
button {
|
|
88
|
+
all: unset;
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
|
|
91
|
+
&::after {
|
|
92
|
+
inset: 0;
|
|
93
|
+
content: '';
|
|
94
|
+
position: absolute;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&__icon {
|
|
100
|
+
margin-left: auto;
|
|
101
|
+
padding-left: getSpacer(s);
|
|
102
|
+
|
|
103
|
+
@media (min-width: map.get($grid-breakpoints, xs)) {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@media (min-width: map.get($grid-breakpoints, sm)) {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
112
|
+
padding-left: getSpacer(l);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Styles = {
|
|
2
|
+
promopanel: string;
|
|
3
|
+
promopanel__content: string;
|
|
4
|
+
promopanel__icon: string;
|
|
5
|
+
promopanel__illustration: string;
|
|
6
|
+
'promopanel--blueberry': string;
|
|
7
|
+
'promopanel--cherry': string;
|
|
8
|
+
'promopanel--neutral': string;
|
|
9
|
+
'promopanel--no-illustration': string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ClassNames = keyof Styles;
|
|
13
|
+
|
|
14
|
+
declare const styles: Styles;
|
|
15
|
+
|
|
16
|
+
export default styles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import p, { useState as q } from "react";
|
|
2
|
-
import
|
|
3
|
-
import { FormMode as
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import { FormMode as l, FormSize as D, AnalyticsId as W } from "../../constants.js";
|
|
4
4
|
import { usePseudoClasses as $ } from "../../hooks/usePseudoClasses.js";
|
|
5
5
|
import { isMutableRefObject as G, mergeRefs as H } from "../../utils/refs.js";
|
|
6
6
|
import { uuid as J } from "../../utils/uuid.js";
|
|
@@ -8,7 +8,7 @@ import { getLabelText as K, renderLabelAsParent as Q } from "../Label/Label.js";
|
|
|
8
8
|
import e from "./styles.module.scss";
|
|
9
9
|
const oe = (s, o, r, b) => {
|
|
10
10
|
const n = o === "oninvalid", a = s === b;
|
|
11
|
-
return
|
|
11
|
+
return i({
|
|
12
12
|
[e["radio-button-label__large--on-grey"]]: r && o === "ongrey" && !a,
|
|
13
13
|
[e["radio-button-label__large--on-blueberry"]]: o === "onblueberry" && !a && r,
|
|
14
14
|
[e["radio-button-label__large--selected"]]: r && a && !n,
|
|
@@ -20,39 +20,39 @@ const oe = (s, o, r, b) => {
|
|
|
20
20
|
defaultChecked: b = !1,
|
|
21
21
|
onChange: n,
|
|
22
22
|
disabled: a,
|
|
23
|
-
label:
|
|
23
|
+
label: f,
|
|
24
24
|
inputId: _ = J(),
|
|
25
|
-
mode: d =
|
|
25
|
+
mode: d = l.onwhite,
|
|
26
26
|
name: C = _,
|
|
27
27
|
size: w,
|
|
28
28
|
errorText: u,
|
|
29
29
|
error: R = !!u,
|
|
30
|
-
value: k = K(
|
|
30
|
+
value: k = K(f),
|
|
31
31
|
testId: B,
|
|
32
32
|
required: N,
|
|
33
33
|
labelClassNames: L,
|
|
34
34
|
...S
|
|
35
|
-
} = s, g = R || d ===
|
|
35
|
+
} = s, g = R || d === l.oninvalid, y = d === l.ondark, h = d === l.onblueberry, x = d === l.oninvalid, t = w === D.large, [E, F] = q(b), { refObject: I, isFocused: c } = $(G(o) ? o : null), j = H([o, I]), z = i(e["radio-button-wrapper"], {
|
|
36
36
|
[e["radio-button-wrapper--with-error"]]: u,
|
|
37
37
|
[e["radio-button-wrapper__large"]]: t,
|
|
38
38
|
[e["radio-button-wrapper__large--focused"]]: t && c,
|
|
39
39
|
[e["radio-button-wrapper__large--selected"]]: t && E && c,
|
|
40
40
|
[e["radio-button-wrapper__large--invalid"]]: t && x && c,
|
|
41
41
|
[e["radio-button-wrapper__large--on-blueberry"]]: t && h && c
|
|
42
|
-
}), A =
|
|
42
|
+
}), A = i(
|
|
43
43
|
e["radio-button-label"],
|
|
44
44
|
{
|
|
45
45
|
[e["radio-button-label--disabled"]]: a,
|
|
46
|
-
[e["radio-button-label--on-dark"]]:
|
|
46
|
+
[e["radio-button-label--on-dark"]]: y,
|
|
47
47
|
[e["radio-button-label--invalid"]]: g,
|
|
48
48
|
[e["radio-button-label__large"]]: t,
|
|
49
49
|
[e["radio-button-label__large--disabled"]]: t && a
|
|
50
50
|
},
|
|
51
51
|
L
|
|
52
|
-
), M =
|
|
52
|
+
), M = i(
|
|
53
53
|
e["radio-button"],
|
|
54
54
|
{
|
|
55
|
-
[e["radio-button--on-dark"]]:
|
|
55
|
+
[e["radio-button--on-dark"]]: y,
|
|
56
56
|
[e["radio-button--disabled"]]: a,
|
|
57
57
|
[e["radio-button--on-blueberry"]]: h,
|
|
58
58
|
[e["radio-button--invalid"]]: g,
|
|
@@ -61,7 +61,7 @@ const oe = (s, o, r, b) => {
|
|
|
61
61
|
[e["radio-button__large--invalid"]]: t && g
|
|
62
62
|
},
|
|
63
63
|
r
|
|
64
|
-
), O =
|
|
64
|
+
), O = i(e["radio-button-errors"]), P = (m) => {
|
|
65
65
|
F(m.target.checked), n && n(m);
|
|
66
66
|
}, T = () => /* @__PURE__ */ p.createElement(
|
|
67
67
|
"input",
|
|
@@ -81,7 +81,7 @@ const oe = (s, o, r, b) => {
|
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
return /* @__PURE__ */ p.createElement("div", { "data-testid": B, "data-analyticsid": W.RadioButton, className: z }, u && /* @__PURE__ */ p.createElement("p", { className: O }, u), Q(
|
|
84
|
-
|
|
84
|
+
f,
|
|
85
85
|
T(),
|
|
86
86
|
_,
|
|
87
87
|
d,
|