@helsenorge/designsystem-react 12.0.0-beta.2 → 12.1.0
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/AnchorLink.js +1 -0
- package/AnchorLink.js.map +1 -1
- package/Avatar.js.map +1 -1
- package/Badge.js.map +1 -1
- package/Button.js +1 -1
- package/Button.js.map +1 -1
- package/CHANGELOG.md +1793 -969
- package/Checkbox.js.map +1 -1
- package/Close.js.map +1 -1
- package/DictionaryTrigger.js.map +1 -1
- package/Drawer.js +3 -3
- package/Drawer.js.map +1 -1
- package/Duolist.js.map +1 -1
- package/ElementHeader.js +10 -10
- package/ElementHeader.js.map +1 -1
- package/ElementHeaderText.js.map +1 -1
- package/ErrorBoundary.js.map +1 -1
- package/ErrorWrapper.js +3 -2
- package/ErrorWrapper.js.map +1 -1
- package/Expander.js +3 -0
- package/Expander.js.map +1 -1
- package/FormGroup.js +16 -4
- package/FormGroup.js.map +1 -1
- package/FormLayout.js.map +1 -1
- package/HelpDetails.js.map +1 -1
- package/HelpTriggerIcon.js.map +1 -1
- package/HelpTriggerStandalone.js +4 -4
- package/HelpTriggerStandalone.js.map +1 -1
- package/HighlightPanel.js.map +1 -1
- package/Highlighter.js.map +1 -1
- package/HorizontalScroll.js.map +1 -1
- package/Icon.js.map +1 -1
- package/Illustration.js.map +1 -1
- package/InfoTeaser.js.map +1 -1
- package/Input.js +2 -2
- package/Input.js.map +1 -1
- package/Label.js.map +1 -1
- package/LazyIcon.js.map +1 -1
- package/LazyIllustration.js.map +1 -1
- package/LinkList.js +4 -2
- package/LinkList.js.map +1 -1
- package/List.js.map +1 -1
- package/MaxCharacters.js.map +1 -1
- package/NotificationBadge.js.map +1 -1
- package/Panel.js +7 -2
- package/Panel.js.map +1 -1
- package/PanelOld.js.map +1 -1
- package/PanelTitle.js.map +1 -1
- package/PopOver.js.map +1 -1
- package/RadioButton.js +1 -1
- package/RadioButton.js.map +1 -1
- package/Select.js.map +1 -1
- package/Slider.js.map +1 -1
- package/Spacer.js.map +1 -1
- package/StatusDot.js.map +1 -1
- package/{StatusDotMultiComposition.js → StatusDotList.js} +7 -7
- package/StatusDotList.js.map +1 -0
- package/StepButtons.js.map +1 -1
- package/TabList.js +5 -6
- package/TabList.js.map +1 -1
- package/TabPanel.js.map +1 -1
- package/Table.js.map +1 -1
- package/TableBody.js.map +1 -1
- package/TableCell.js.map +1 -1
- package/TableExpandedRow.js.map +1 -1
- package/TableExpanderCell.js.map +1 -1
- package/TableHead.js.map +1 -1
- package/TableHeadCell.js.map +1 -1
- package/TableRow.js.map +1 -1
- package/Textarea.js +1 -1
- package/Textarea.js.map +1 -1
- package/Title.js.map +1 -1
- package/__mocks__/IntersectionObserver.js.map +1 -1
- package/__mocks__/MutationObserver.js.map +1 -1
- package/__mocks__/ResizeObserver.js.map +1 -1
- package/__mocks__/matchMedia.js.map +1 -1
- package/__mocks__/useHover.js.map +1 -1
- package/__mocks__/useLayoutEvent.js.map +1 -1
- package/__mocks__/useOutsideEvent.js.map +1 -1
- package/__mocks__/usePseudoClasses.js.map +1 -1
- package/__mocks__/useSize.js.map +1 -1
- package/__mocks__/uuid.js.map +1 -1
- package/components/AnchorLink/AnchorLink.d.ts +1 -1
- package/components/AnchorLink/styles.module.scss +1 -1
- package/components/ArticleTeaser/index.js.map +1 -1
- package/components/Button/Button.d.ts +1 -1
- package/components/Chip/index.js.map +1 -1
- package/components/Drawer/styles.module.scss +4 -4
- package/components/Dropdown/index.js +26 -35
- package/components/Dropdown/index.js.map +1 -1
- package/components/ElementHeader/ElementHeader.d.ts +4 -4
- package/components/ElementHeader/{StatusDotMultiComposition/StatusDotMultiComposition.d.ts → StatusDotList/StatusDotList.d.ts} +4 -4
- package/components/ElementHeader/StatusDotList/index.d.ts +3 -0
- package/components/ElementHeader/StatusDotList/index.js +6 -0
- package/components/ElementHeader/{StatusDotMultiComposition → StatusDotList}/styles.module.scss +1 -1
- package/components/ElementHeader/StatusDotList/styles.module.scss.d.ts +11 -0
- package/components/ElementHeader/styles.module.scss +29 -19
- package/components/ElementHeader/styles.module.scss.d.ts +1 -0
- package/components/EmptyState/index.js.map +1 -1
- package/components/ErrorWrapper/ErrorWrapper.d.ts +4 -0
- package/components/Expander/Expander.d.ts +1 -0
- package/components/ExpanderHierarchy/index.js.map +1 -1
- package/components/ExpanderList/index.js.map +1 -1
- package/components/ExpanderList/styles.module.scss +2 -2
- package/components/EyebrowHeader/index.js +1 -1
- package/components/EyebrowHeader/index.js.map +1 -1
- package/components/FormGroup/FormGroup.d.ts +2 -0
- package/components/HelpBubble/index.js +1 -1
- package/components/HelpBubble/index.js.map +1 -1
- package/components/HelpDetails/styles.module.scss +0 -2
- package/components/HelpDrawer/index.js.map +1 -1
- package/components/HelpExpanderInline/index.js.map +1 -1
- package/components/HelpExpanderStandalone/index.js.map +1 -1
- package/components/HelpExpanderStandalone/styles.module.scss +5 -0
- package/components/HelpPanel/index.js.map +1 -1
- package/components/HelpTeaser/index.js.map +1 -1
- package/components/HelpTooltip/index.js.map +1 -1
- package/components/HelpTriggerInline/index.js.map +1 -1
- package/components/HelpTriggerStandalone/styles.module.scss +28 -35
- package/components/HelpTriggerStandalone/styles.module.scss.d.ts +0 -1
- package/components/Icons/ActiveMonitoring.js.map +1 -1
- package/components/Icons/AcupunctureBack.js.map +1 -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.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.map +1 -1
- 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.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.map +1 -1
- package/components/Icons/Bike.js.map +1 -1
- package/components/Icons/BirthControl.js.map +1 -1
- 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.js.map +1 -1
- package/components/Icons/Brain.js.map +1 -1
- package/components/Icons/BreastReconstruction.js.map +1 -1
- package/components/Icons/BreastRemoval.js.map +1 -1
- package/components/Icons/Breasts.js.map +1 -1
- package/components/Icons/BrokenHeart.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/CalendarSave.js.map +1 -1
- package/components/Icons/Cancer.js.map +1 -1
- package/components/Icons/Candle.js.map +1 -1
- package/components/Icons/Car.js.map +1 -1
- package/components/Icons/Carton.js.map +1 -1
- package/components/Icons/Change.js.map +1 -1
- package/components/Icons/Check.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/ChevronRight.js.map +1 -1
- package/components/Icons/ChevronUp.js.map +1 -1
- package/components/Icons/ChevronsDown.js.map +1 -1
- package/components/Icons/ChevronsUp.js.map +1 -1
- package/components/Icons/ChildPlaying.js.map +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.map +1 -1
- package/components/Icons/CreditCard.js.map +1 -1
- package/components/Icons/CriticalHealthInfo.js.map +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.map +1 -1
- package/components/Icons/Dog.js.map +1 -1
- package/components/Icons/DonorCard.js.map +1 -1
- package/components/Icons/DotActive.js.map +1 -1
- package/components/Icons/DotAlert.js.map +1 -1
- package/components/Icons/DotCancelled.js.map +1 -1
- package/components/Icons/DotHalfDisc.js.map +1 -1
- package/components/Icons/DotInactive.js.map +1 -1
- package/components/Icons/DotInfo.js.map +1 -1
- package/components/Icons/DotLookingGlass.js.map +1 -1
- package/components/Icons/DotPending.js.map +1 -1
- package/components/Icons/DotQuestionMark.js.map +1 -1
- package/components/Icons/DotSuccess.js.map +1 -1
- package/components/Icons/DotTransparent.js.map +1 -1
- package/components/Icons/DotWarningTriangle.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.js.map +1 -1
- package/components/Icons/EarDeaf.js.map +1 -1
- package/components/Icons/EarHearingAid.js.map +1 -1
- package/components/Icons/EarNoseThroat.js.map +1 -1
- package/components/Icons/EarVolume.js.map +1 -1
- package/components/Icons/ElderlyPerson.js.map +1 -1
- package/components/Icons/Embolization.js.map +1 -1
- package/components/Icons/EmergencyCall.js.map +1 -1
- package/components/Icons/EmoticonAnnoyed.js.map +1 -1
- package/components/Icons/EmoticonDelighted.js.map +1 -1
- package/components/Icons/EmoticonDisappointed.js.map +1 -1
- package/components/Icons/EmoticonHappy.js.map +1 -1
- package/components/Icons/EmoticonMeh.js.map +1 -1
- package/components/Icons/EmptyBox.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.map +1 -1
- package/components/Icons/Eraser.js.map +1 -1
- package/components/Icons/ErrorSignFill.js.map +1 -1
- 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.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/Filter.js.map +1 -1
- package/components/Icons/FingerBleed.js.map +1 -1
- package/components/Icons/FirstAidKit.js.map +1 -1
- package/components/Icons/Fish.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.map +1 -1
- package/components/Icons/Forward.js.map +1 -1
- package/components/Icons/Gallery.js.map +1 -1
- package/components/Icons/Garden.js.map +1 -1
- package/components/Icons/GasCan.js.map +1 -1
- package/components/Icons/GenderIdentity.js.map +1 -1
- package/components/Icons/GlassWater.js.map +1 -1
- package/components/Icons/Glasses.js.map +1 -1
- package/components/Icons/Globe.js.map +1 -1
- package/components/Icons/Grain.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.map +1 -1
- package/components/Icons/HTMLFile.js.map +1 -1
- package/components/Icons/HandWaving.js.map +1 -1
- package/components/Icons/HandWithDisease.js.map +1 -1
- package/components/Icons/HandsAndHeart.js.map +1 -1
- package/components/Icons/HealthClinic.js.map +1 -1
- package/components/Icons/HealthMeasurements.js.map +1 -1
- package/components/Icons/HealthWarning.js.map +1 -1
- package/components/Icons/HealthcarePerson.js.map +1 -1
- package/components/Icons/HealthcarePersonell.js.map +1 -1
- package/components/Icons/HearingProtection.js.map +1 -1
- package/components/Icons/Heart.js.map +1 -1
- package/components/Icons/HeartHands.js.map +1 -1
- package/components/Icons/HelpSign.js.map +1 -1
- package/components/Icons/HelpingHand.js.map +1 -1
- package/components/Icons/Hemodialysis.js.map +1 -1
- package/components/Icons/Hiker.js.map +1 -1
- package/components/Icons/Hipprosthesis.js.map +1 -1
- package/components/Icons/History.js.map +1 -1
- package/components/Icons/HivAndAids.js.map +1 -1
- package/components/Icons/Home.js.map +1 -1
- package/components/Icons/HomeFill.js.map +1 -1
- 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/ImgFile.js.map +1 -1
- package/components/Icons/Inbox.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/Journal.js.map +1 -1
- package/components/Icons/JpgFile.js.map +1 -1
- package/components/Icons/Kidney.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/LegalDocument.js.map +1 -1
- package/components/Icons/LightBulb.js.map +1 -1
- package/components/Icons/List.js.map +1 -1
- package/components/Icons/Location.js.map +1 -1
- package/components/Icons/LocationFill.js.map +1 -1
- package/components/Icons/Lock.js.map +1 -1
- package/components/Icons/Login.js.map +1 -1
- package/components/Icons/Logout.js.map +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/MaleDoctorCompact.js.map +1 -1
- package/components/Icons/MaleDoctorCompactFill.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.map +1 -1
- package/components/Icons/Microscope.js.map +1 -1
- package/components/Icons/Minus.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/Music.js.map +1 -1
- package/components/Icons/MusselsAndSalt.js.map +1 -1
- package/components/Icons/NoAccess.js.map +1 -1
- 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.map +1 -1
- 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.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.map +1 -1
- package/components/Icons/Plane.js.map +1 -1
- package/components/Icons/Plant.js.map +1 -1
- package/components/Icons/PlateKnifeFork.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.map +1 -1
- 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.map +1 -1
- 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.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/Reminder.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.map +1 -1
- 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.js.map +1 -1
- package/components/Icons/Search.js.map +1 -1
- package/components/Icons/SectionSign.js.map +1 -1
- package/components/Icons/Settings.js.map +1 -1
- package/components/Icons/SettingsFill.js.map +1 -1
- 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/SharedHealthData.js.map +1 -1
- package/components/Icons/SharedHealthMeasurements.js.map +1 -1
- 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.map +1 -1
- package/components/Icons/Snapchat.js.map +1 -1
- package/components/Icons/SortDown.js.map +1 -1
- package/components/Icons/SortUp.js.map +1 -1
- package/components/Icons/SpeechBubble.js.map +1 -1
- package/components/Icons/Spray.js.map +1 -1
- package/components/Icons/StickyNote.js.map +1 -1
- package/components/Icons/StickyNotes.js.map +1 -1
- package/components/Icons/Stopwatch.js.map +1 -1
- package/components/Icons/Sun.js.map +1 -1
- package/components/Icons/SupportingPerson.js.map +1 -1
- package/components/Icons/Surgery.js.map +1 -1
- package/components/Icons/Sweets.js.map +1 -1
- package/components/Icons/Syringe.js.map +1 -1
- package/components/Icons/Taxi.js.map +1 -1
- package/components/Icons/TeddyBear.js.map +1 -1
- package/components/Icons/Teenagers.js.map +1 -1
- 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/Toddler.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/TreatmentAids.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.map +1 -1
- 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.map +1 -1
- package/components/Icons/WheelchairActive.js.map +1 -1
- package/components/Icons/Window.js.map +1 -1
- package/components/Icons/WordDocument.js.map +1 -1
- package/components/Icons/WorkSuitcase.js.map +1 -1
- package/components/Icons/X.js.map +1 -1
- package/components/Icons/XOutline.js.map +1 -1
- package/components/Icons/XmlFile.js.map +1 -1
- package/components/Icons/YouTube.js.map +1 -1
- package/components/Icons/Zoom.js.map +1 -1
- package/components/Illustrations/BabyMobile.js.map +1 -1
- package/components/Illustrations/BabyMobileMedium.js.map +1 -1
- package/components/Illustrations/Child.js.map +1 -1
- package/components/Illustrations/ChildMedium.js.map +1 -1
- package/components/Illustrations/Doctor.js.map +1 -1
- package/components/Illustrations/DoctorMedium.js.map +1 -1
- package/components/Illustrations/DoctorSmall.js.map +1 -1
- package/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
- package/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
- package/components/Illustrations/GiveBabyFood.js.map +1 -1
- package/components/Illustrations/GiveBabyFoodMedium.js.map +1 -1
- package/components/Illustrations/HealthcarePersonnel.js.map +1 -1
- package/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
- package/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
- package/components/Illustrations/IllustrationNames.js.map +1 -1
- package/components/Illustrations/ReadLetters.js.map +1 -1
- package/components/Illustrations/ReadLettersMedium.js.map +1 -1
- package/components/Illustrations/Stroller.js.map +1 -1
- package/components/Illustrations/StrollerMedium.js.map +1 -1
- package/components/Illustrations/Support2.js.map +1 -1
- package/components/Illustrations/Support2Medium.js.map +1 -1
- package/components/LinkList/LinkList.d.ts +2 -0
- package/components/LinkList/styles.module.scss +23 -6
- package/components/LinkList/styles.module.scss.d.ts +1 -0
- package/components/Loader/index.js.map +1 -1
- package/components/Logo/index.js.map +1 -1
- package/components/Modal/index.js.map +1 -1
- package/components/NotificationPanel/NotificationPanel.d.ts +1 -1
- package/components/NotificationPanel/index.js +2 -3
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/NotificationPanel/styles.module.scss +0 -6
- package/components/NotificationPanel/styles.module.scss.d.ts +0 -3
- package/components/Panel/Panel.d.ts +2 -0
- package/components/PanelList/index.js.map +1 -1
- package/components/PanelListOld/index.js.map +1 -1
- package/components/PopMenu/index.js +2 -2
- package/components/PopMenu/index.js.map +1 -1
- package/components/PopOver/styles.module.scss +1 -1
- package/components/Portal/index.js.map +1 -1
- package/components/Progressbar/index.js.map +1 -1
- package/components/PromoPanel/index.js.map +1 -1
- package/components/RadioButton/styles.module.scss +6 -1
- package/components/ServiceMessage/index.js +1 -1
- package/components/ServiceMessage/index.js.map +1 -1
- package/components/SharingStatus/index.js.map +1 -1
- package/components/Step/index.js.map +1 -1
- package/components/Stepper/index.js.map +1 -1
- package/components/StickyNote/index.js +2 -2
- package/components/StickyNote/index.js.map +1 -1
- package/components/Tabs/TabList/styles.module.scss +14 -4
- package/components/Tabs/TabList/styles.module.scss.d.ts +1 -0
- package/components/Tabs/index.js.map +1 -1
- package/components/Tabs/styles.module.scss +4 -2
- package/components/Tag/index.js.map +1 -1
- package/components/TagList/index.js.map +1 -1
- package/components/Tile/index.js.map +1 -1
- package/components/Tile/styles.module.scss +1 -2
- package/components/Toggle/index.js.map +1 -1
- package/components/Validation/index.js +1 -1
- package/components/Validation/index.js.map +1 -1
- package/constants.js.map +1 -1
- package/floating-ui.react.js +142 -88
- package/floating-ui.react.js.map +1 -1
- package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
- package/hooks/useBreakpoint.js +4 -3
- package/hooks/useBreakpoint.js.map +1 -1
- package/hooks/useElementList.js.map +1 -1
- package/hooks/useEventListenerState.js.map +1 -1
- package/hooks/useExpand.js.map +1 -1
- package/hooks/useFocusToggle.js.map +1 -1
- package/hooks/useFocusTrap.js.map +1 -1
- package/hooks/useFocusableElements.js.map +1 -1
- package/hooks/useHover.js.map +1 -1
- package/hooks/useIcons.js.map +1 -1
- package/hooks/useIntersectionObserver.js.map +1 -1
- package/hooks/useInterval.js.map +1 -1
- package/hooks/useIsMobileBreakpoint.js.map +1 -1
- package/hooks/useIsServerSide.js.map +1 -1
- package/hooks/useIsVisible.js.map +1 -1
- package/hooks/useKeyboardEvent.js.map +1 -1
- package/hooks/useLayoutEvent.js.map +1 -1
- package/hooks/useOutsideEvent.js.map +1 -1
- package/hooks/usePrevious.js.map +1 -1
- package/hooks/usePseudoClasses.js +2 -1
- package/hooks/usePseudoClasses.js.map +1 -1
- package/hooks/useResizeObserver.js.map +1 -1
- package/hooks/useReturnFocusOnUnmount.js.map +1 -1
- package/hooks/useRovingFocus.js.map +1 -1
- package/hooks/useSize.js +1 -1
- package/hooks/useSize.js.map +1 -1
- package/hooks/useToggle.js.map +1 -1
- package/hooks/useUuid.js.map +1 -1
- package/hooks/usestopPropagation.js.map +1 -1
- package/package.json +1 -1
- package/scss/bootstrap/scss/_variables.scss +1 -1
- package/scss/typography.module.scss +1 -1
- package/scss/typography.stories.tsx +2 -4
- package/theme/currys/color.js.map +1 -1
- package/theme/currys/spacing.js.map +1 -1
- package/use-animate.js +1 -1
- package/use-animate.js.map +1 -1
- package/utils/accessibility.js.map +1 -1
- package/utils/component.d.ts +2 -2
- package/utils/component.js.map +1 -1
- package/utils/debounce.js +1 -1
- package/utils/debounce.js.map +1 -1
- package/utils/device.js.map +1 -1
- package/utils/environment.js.map +1 -1
- package/utils/focus.js.map +1 -1
- package/utils/language.js.map +1 -1
- package/utils/mobile.js.map +1 -1
- package/utils/refs.js.map +1 -1
- package/utils/scroll.js.map +1 -1
- package/utils/viewport.js.map +1 -1
- package/utils.js.map +1 -1
- package/uuid.js.map +1 -1
- package/StatusDotMultiComposition.js.map +0 -1
- package/components/ElementHeader/StatusDotMultiComposition/index.d.ts +0 -3
- package/components/ElementHeader/StatusDotMultiComposition/index.js +0 -6
- package/components/ElementHeader/StatusDotMultiComposition/styles.module.scss.d.ts +0 -11
- /package/components/ElementHeader/{StatusDotMultiComposition → StatusDotList}/index.js.map +0 -0
package/AnchorLink.js
CHANGED
package/AnchorLink.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorLink.js","sources":["../src/components/AnchorLink/AnchorLink.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { getColor } from '../../theme/currys';\nimport Icon, { IconSize } from '../Icon';\nimport ArrowUpRight from '../Icons/ArrowUpRight';\n\nimport AnchorLinkStyles from './styles.module.scss';\n\nexport type AnchorLinkTargets = '_self' | '_blank' | '_parent';\n\nexport type AnchorLinkTags = 'a' | 'button';\n\nexport type AnchorLinkOnClickEvent =\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.FormEvent<
|
|
1
|
+
{"version":3,"file":"AnchorLink.js","sources":["../src/components/AnchorLink/AnchorLink.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { getColor } from '../../theme/currys';\nimport Icon, { IconSize } from '../Icon';\nimport ArrowUpRight from '../Icons/ArrowUpRight';\n\nimport AnchorLinkStyles from './styles.module.scss';\n\nexport type AnchorLinkTargets = '_self' | '_blank' | '_parent';\n\nexport type AnchorLinkTags = 'a' | 'button';\n\nexport type AnchorLinkOnClickEvent =\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.FormEvent<unknown>\n | React.KeyboardEvent<HTMLUListElement>\n | null;\n\nexport interface AnchorLinkProps {\n /** Sets the content of the <a> tag */\n children: React.ReactNode;\n /** URL to link to */\n href?: string;\n /** Gives a unique id to the anchor-link :) */\n id?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the target type of the <a> tag. _blank adds an arrow icon at the end of the link */\n target?: AnchorLinkTargets;\n /** HTML markup for anchor link. Default: a */\n htmlMarkup?: AnchorLinkTags;\n /** Function that is called when clicked */\n onClick?: (e?: AnchorLinkOnClickEvent) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst AnchorLink = React.forwardRef<HTMLAnchorElement | HTMLButtonElement, AnchorLinkProps>((props, ref) => {\n const { id, href, children, className, target = '_self', htmlMarkup = 'a', onClick, testId } = props;\n const external = target === '_blank';\n const { hoverRef, isHovered } = useHover<HTMLButtonElement | HTMLAnchorElement>(\n ref as React.RefObject<HTMLButtonElement | HTMLAnchorElement>\n );\n const anchorClasses = classNames(AnchorLinkStyles.anchorlink, className);\n\n const commonProps = {\n id,\n ['data-testid']: testId,\n ['data-analyticsid']: AnalyticsId.AnchorLink,\n onClick,\n };\n\n const renderContent = (): React.ReactElement => (\n <>\n {children}\n {external && (\n <Icon\n className={AnchorLinkStyles.anchorlink__icon}\n svgIcon={ArrowUpRight}\n color={getColor('blueberry', 600)}\n hoverColor={getColor('blueberry', 700)}\n size={IconSize.XSmall}\n isHovered={isHovered}\n />\n )}\n </>\n );\n\n return (\n <>\n {htmlMarkup === 'a' && (\n <a\n href={href}\n target={target}\n className={anchorClasses}\n rel={external ? 'noopener noreferrer' : undefined}\n ref={hoverRef as React.RefObject<HTMLAnchorElement>}\n {...commonProps}\n >\n {renderContent()}\n </a>\n )}\n {htmlMarkup === 'button' && (\n <button\n type=\"button\"\n className={AnchorLinkStyles['anchorlink-wrapper']}\n ref={hoverRef as React.RefObject<HTMLButtonElement>}\n {...commonProps}\n >\n <span className={anchorClasses}>{renderContent()}</span>\n </button>\n )}\n </>\n );\n});\n\nAnchorLink.displayName = 'AnchorLink';\n\nexport default AnchorLink;\n"],"names":["React"],"mappings":";;;;;;;;;AAyCA,MAAM,aAAaA,eAAM,WAAmE,CAAC,OAAO,QAAQ;AAC1G,QAAM,EAAE,IAAI,MAAM,UAAU,WAAW,SAAS,SAAS,aAAa,KAAK,SAAS,OAAA,IAAW;AAC/F,QAAM,WAAW,WAAW;AAC5B,QAAM,EAAE,UAAU,UAAA,IAAc;AAAA,IAC9B;AAAA,EAAA;AAEF,QAAM,gBAAgB,WAAW,iBAAiB,YAAY,SAAS;AAEvE,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,CAAC,aAAa,GAAG;AAAA,IACjB,CAAC,kBAAkB,GAAG,YAAY;AAAA,IAClC;AAAA,EAAA;AAGF,QAAM,gBAAgB,MACpB,qBAAA,UAAA,EACG,UAAA;AAAA,IAAA;AAAA,IACA,YACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,iBAAiB;AAAA,QAC5B,SAAS;AAAA,QACT,OAAO,SAAS,aAAa,GAAG;AAAA,QAChC,YAAY,SAAS,aAAa,GAAG;AAAA,QACrC,MAAM,SAAS;AAAA,QACf;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAGF,SACE,qBAAA,UAAA,EACG,UAAA;AAAA,IAAA,eAAe,OACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,WAAW;AAAA,QACX,KAAK,WAAW,wBAAwB;AAAA,QACxC,KAAK;AAAA,QACJ,GAAG;AAAA,QAEH,UAAA,cAAA;AAAA,MAAc;AAAA,IAAA;AAAA,IAGlB,eAAe,YACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAW,iBAAiB,oBAAoB;AAAA,QAChD,KAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,UAAA,oBAAC,QAAA,EAAK,WAAW,eAAgB,0BAAc,CAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EACnD,GAEJ;AAEJ,CAAC;AAED,WAAW,cAAc;"}
|
package/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { palette } from '../../theme/palette';\nimport Icon, { IconSize } from '../Icon';\nimport Check from '../Icons/Check';\n\nimport styles from './styles.module.scss';\n\nexport enum AvatarSize {\n xsmall = 'xsmall',\n small = 'small',\n}\n\nexport interface AvatarProps {\n /** Name to display in the avatar. Will be truncated to the first two characters. */\n children: string;\n /** Displays a check icon to indicated the selected state. */\n selected?: boolean;\n /** Sets blue or black color on avatar. */\n color?: 'blueberry' | 'black';\n /** Square or circle variant of avatar. The circle should only be used for representation of someone else. NB: This is temporary and will be renamed in v10 */\n variant?: 'square' | 'circle';\n /** Avatar size. Default: small */\n size?: keyof typeof AvatarSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\nexport type AvatarType = React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLElement>>;\nconst Avatar: AvatarType = React.forwardRef(function AvatarForwardedRef(props: AvatarProps, ref: React.ForwardedRef<HTMLElement>) {\n const { children, className = '', selected = false, color = 'blueberry', variant = 'square', size = AvatarSize.small, testId } = props;\n const truncatedName = children.charAt(0).toLocaleUpperCase() + children.substring(1, 2);\n return (\n <span\n className={cn(\n styles.avatar,\n selected && styles['avatar--selected'],\n color === 'black' && styles['avatar--black'],\n variant === 'circle' && styles['avatar--circle'],\n size === AvatarSize.xsmall && styles['avatar--xsmall'],\n size === AvatarSize.small && styles['avatar--small'],\n className\n )}\n ref={ref}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Avatar}\n >\n {selected ? (\n <Icon svgIcon={Check} size={IconSize.Small} color={color === 'black' ? palette.neutral900 : palette.blueberry600} />\n ) : (\n truncatedName\n )}\n </span>\n );\n});\n\nexport default Avatar;\n"],"names":["AvatarSize","React","cn"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../src/components/Avatar/Avatar.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { palette } from '../../theme/palette';\nimport Icon, { IconSize } from '../Icon';\nimport Check from '../Icons/Check';\n\nimport styles from './styles.module.scss';\n\nexport enum AvatarSize {\n xsmall = 'xsmall',\n small = 'small',\n}\n\nexport interface AvatarProps {\n /** Name to display in the avatar. Will be truncated to the first two characters. */\n children: string;\n /** Displays a check icon to indicated the selected state. */\n selected?: boolean;\n /** Sets blue or black color on avatar. */\n color?: 'blueberry' | 'black';\n /** Square or circle variant of avatar. The circle should only be used for representation of someone else. NB: This is temporary and will be renamed in v10 */\n variant?: 'square' | 'circle';\n /** Avatar size. Default: small */\n size?: keyof typeof AvatarSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\nexport type AvatarType = React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLElement>>;\nconst Avatar: AvatarType = React.forwardRef(function AvatarForwardedRef(props: AvatarProps, ref: React.ForwardedRef<HTMLElement>) {\n const { children, className = '', selected = false, color = 'blueberry', variant = 'square', size = AvatarSize.small, testId } = props;\n const truncatedName = children.charAt(0).toLocaleUpperCase() + children.substring(1, 2);\n return (\n <span\n className={cn(\n styles.avatar,\n selected && styles['avatar--selected'],\n color === 'black' && styles['avatar--black'],\n variant === 'circle' && styles['avatar--circle'],\n size === AvatarSize.xsmall && styles['avatar--xsmall'],\n size === AvatarSize.small && styles['avatar--small'],\n className\n )}\n ref={ref}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Avatar}\n >\n {selected ? (\n <Icon svgIcon={Check} size={IconSize.Small} color={color === 'black' ? palette.neutral900 : palette.blueberry600} />\n ) : (\n truncatedName\n )}\n </span>\n );\n});\n\nexport default Avatar;\n"],"names":["AvatarSize","React","cn"],"mappings":";;;;;;;;AAWO,IAAK,+BAAAA,gBAAL;AACLA,cAAA,QAAA,IAAS;AACTA,cAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,cAAA,CAAA,CAAA;AAsBZ,MAAM,SAAqBC,eAAM,WAAW,SAAS,mBAAmB,OAAoB,KAAsC;AAChI,QAAM,EAAE,UAAU,YAAY,IAAI,WAAW,OAAO,QAAQ,aAAa,UAAU,UAAU,OAAO,SAAkB,WAAW;AACjI,QAAM,gBAAgB,SAAS,OAAO,CAAC,EAAE,sBAAsB,SAAS,UAAU,GAAG,CAAC;AACtF,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAAA,QACT,OAAO;AAAA,QACP,YAAY,OAAO,kBAAkB;AAAA,QACrC,UAAU,WAAW,OAAO,eAAe;AAAA,QAC3C,YAAY,YAAY,OAAO,gBAAgB;AAAA,QAC/C,SAAS,YAAqB,OAAO,gBAAgB;AAAA,QACrD,SAAS,WAAoB,OAAO,eAAe;AAAA,QACnD;AAAA,MAAA;AAAA,MAEF;AAAA,MACA,eAAa;AAAA,MACb,oBAAkB,YAAY;AAAA,MAE7B,UAAA,WACC,oBAAC,MAAA,EAAK,SAAS,OAAO,MAAM,SAAS,OAAO,OAAO,UAAU,UAAU,QAAQ,aAAa,QAAQ,cAAc,IAElH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
|
package/Badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport NotificationBadge, { BadgeNotificationVariant } from './NotificationBadge';\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\n\nimport badgeStyles from './styles.module.scss';\n\nexport type BadgeColors = Extract<PaletteNames, 'blueberry' | 'cherry' | 'neutral'>;\nexport type BadgeChildren = string | number;\nexport type BadgeVariant = 'string' | 'notification';\n\nexport interface BadgeProps {\n /** Sets the content of the badge. */\n children?: BadgeChildren;\n /** Adds custom classes to the element. */\n className?: string;\n /** Changes the badge background color. */\n color?: BadgeColors;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Changes the type of the badge. Default: string */\n type?: BadgeVariant;\n /** Type of notification badge. Only works if type is 'notification'. */\n notificationVariant?: BadgeNotificationVariant;\n}\n\nexport type BadgeType = React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLElement>>;\nconst Badge: BadgeType = React.forwardRef(function BadgeForwardedRef(props: BadgeProps, ref: React.ForwardedRef<HTMLElement>) {\n const { children, className = '', color = 'blueberry', testId, type = 'string', notificationVariant = 'info' } = props;\n const badgeClasses = classNames(\n badgeStyles.badge,\n {\n [badgeStyles['badge--blueberry']]: color === 'blueberry',\n [badgeStyles['badge--cherry']]: color === 'cherry',\n [badgeStyles['badge--neutral']]: color === 'neutral',\n },\n className\n );\n\n if (type === 'notification' && notificationVariant !== undefined) {\n return (\n <NotificationBadge\n variant={notificationVariant}\n size={IconSize.XSmall}\n className={className}\n testId={testId}\n data-analyticsid={AnalyticsId.Badge}\n />\n );\n }\n\n return (\n <span className={badgeClasses} ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.Badge}>\n {children}\n </span>\n );\n});\n\nexport default Badge;\n"],"names":["React"],"mappings":";;;;;;AA8BA,MAAM,QAAmBA,eAAM,WAAW,SAAS,kBAAkB,OAAmB,KAAsC;
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport NotificationBadge, { BadgeNotificationVariant } from './NotificationBadge';\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\n\nimport badgeStyles from './styles.module.scss';\n\nexport type BadgeColors = Extract<PaletteNames, 'blueberry' | 'cherry' | 'neutral'>;\nexport type BadgeChildren = string | number;\nexport type BadgeVariant = 'string' | 'notification';\n\nexport interface BadgeProps {\n /** Sets the content of the badge. */\n children?: BadgeChildren;\n /** Adds custom classes to the element. */\n className?: string;\n /** Changes the badge background color. */\n color?: BadgeColors;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Changes the type of the badge. Default: string */\n type?: BadgeVariant;\n /** Type of notification badge. Only works if type is 'notification'. */\n notificationVariant?: BadgeNotificationVariant;\n}\n\nexport type BadgeType = React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLElement>>;\nconst Badge: BadgeType = React.forwardRef(function BadgeForwardedRef(props: BadgeProps, ref: React.ForwardedRef<HTMLElement>) {\n const { children, className = '', color = 'blueberry', testId, type = 'string', notificationVariant = 'info' } = props;\n const badgeClasses = classNames(\n badgeStyles.badge,\n {\n [badgeStyles['badge--blueberry']]: color === 'blueberry',\n [badgeStyles['badge--cherry']]: color === 'cherry',\n [badgeStyles['badge--neutral']]: color === 'neutral',\n },\n className\n );\n\n if (type === 'notification' && notificationVariant !== undefined) {\n return (\n <NotificationBadge\n variant={notificationVariant}\n size={IconSize.XSmall}\n className={className}\n testId={testId}\n data-analyticsid={AnalyticsId.Badge}\n />\n );\n }\n\n return (\n <span className={badgeClasses} ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.Badge}>\n {children}\n </span>\n );\n});\n\nexport default Badge;\n"],"names":["React"],"mappings":";;;;;;AA8BA,MAAM,QAAmBA,eAAM,WAAW,SAAS,kBAAkB,OAAmB,KAAsC;AAC5H,QAAM,EAAE,UAAU,YAAY,IAAI,QAAQ,aAAa,QAAQ,OAAO,UAAU,sBAAsB,OAAA,IAAW;AACjH,QAAM,eAAe;AAAA,IACnB,YAAY;AAAA,IACZ;AAAA,MACE,CAAC,YAAY,kBAAkB,CAAC,GAAG,UAAU;AAAA,MAC7C,CAAC,YAAY,eAAe,CAAC,GAAG,UAAU;AAAA,MAC1C,CAAC,YAAY,gBAAgB,CAAC,GAAG,UAAU;AAAA,IAAA;AAAA,IAE7C;AAAA,EAAA;AAGF,MAAI,SAAS,kBAAkB,wBAAwB,QAAW;AAChE,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,MAAM,SAAS;AAAA,QACf;AAAA,QACA;AAAA,QACA,oBAAkB,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAGpC;AAEA,SACE,oBAAC,QAAA,EAAK,WAAW,cAAc,KAAU,eAAa,QAAQ,oBAAkB,YAAY,OACzF,SAAA,CACH;AAEJ,CAAC;"}
|
package/Button.js
CHANGED
|
@@ -60,7 +60,7 @@ const Button = React__default.forwardRef(function ButtonForwardedRef(props, ref)
|
|
|
60
60
|
...restProps
|
|
61
61
|
} = props;
|
|
62
62
|
const [leftIcon, rightIcon, restChildren] = useIcons(React__default.Children.toArray(children));
|
|
63
|
-
const { hoverRef, isHovered } =
|
|
63
|
+
const { hoverRef, isHovered } = useHover(ref);
|
|
64
64
|
const buttonContentRef = useRef(null);
|
|
65
65
|
const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;
|
|
66
66
|
const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;
|
package/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { AriaAttributes, useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from './../Icon';\nimport { HTMLButtonProps, HTMLAnchorProps, AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { BaseIconElement, useIcons } from '../../hooks/useIcons';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { getColor } from '../../theme/currys/color';\nimport { isTest, isProd } from '../../utils/environment';\nimport ArrowRight from '../Icons/ArrowRight';\n\nimport buttonStyles from './styles.module.scss';\n\nexport type ButtonConcept = 'normal' | 'destructive';\nexport type ButtonVariant = 'fill' | 'outline' | 'borderless';\nexport type ButtonSize = 'medium' | 'large';\nexport type ButtonOnColor = 'onlight' | 'ondark';\nexport type ButtonTags = 'button' | 'a';\nexport type ButtonArrows = 'icon' | 'accessibility-character';\nexport type ButtonTextPosition = 'left' | 'centered';\n\nexport interface ButtonProps extends HTMLButtonProps, HTMLAnchorProps, AriaAttributes {\n /** Sets the aria-label of the button, use when the button only includes an icon */\n ariaLabel?: string;\n /** Gives a unique id to the button */\n id?: string;\n /** Sets the content of the button. */\n children: React.ReactNode;\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Enables an arrow icon to the right inside the button (Not available in borderless variant) */\n arrow?: ButtonArrows;\n /** Changes the intent of the button. Mostly changes the color profile. */\n concept?: ButtonConcept;\n /** Disables text wrapping and enables ellipsis. */\n ellipsis?: boolean;\n /** Makes the button scale to full width of its parent element. */\n fluid?: boolean;\n /** Changes the underlying element of the button. */\n htmlMarkup?: ButtonTags;\n /** Changes the button colors for different backgrounds. */\n onColor?: ButtonOnColor;\n /** Function that is called when the Button loses focus */\n onBlur?: () => void;\n /** Function that is called when clicked */\n onClick?: (e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null) => void;\n /** Changes the button colors for different backgrounds. (Large not available in borderless variant) */\n size?: ButtonSize;\n /** Changes the visual representation of the button. */\n variant?: ButtonVariant;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Adds custom classes to the text */\n textClassName?: string;\n /** Sets the position of the text in the button - only applies when button is fluid */\n textPosition?: ButtonTextPosition;\n /** Button type. Default: button */\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n}\n\nconst getIconColor = (\n fill: boolean,\n borderless: boolean,\n disabled: boolean,\n concept: ButtonConcept,\n ondark: boolean,\n mobile: boolean\n): string => {\n if (mobile && disabled) {\n return !ondark || fill ? getColor('neutral', !borderless ? 700 : 500) : getColor('white');\n }\n if (disabled) {\n return !ondark || fill ? getColor('neutral', 500) : `${getColor('white')}b3`;\n }\n if ((fill && !ondark) || (!fill && ondark)) {\n return 'white';\n }\n\n return concept === 'normal' ? getColor('blueberry', 600) : getColor('cherry', 500);\n};\nconst getLargeIconSize = (large: boolean, mobile: boolean): IconSize => {\n if (mobile && large) return IconSize.Small;\n if (large) return IconSize.Medium;\n return IconSize.XSmall;\n};\n\nconst checkOnlyIconAria = (onlyIcon: boolean, ariaLabel: string | undefined, devEnv: boolean): void => {\n if (devEnv && onlyIcon && (ariaLabel === undefined || ariaLabel === '')) {\n throw new Error('Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav');\n }\n};\n\nconst Button = React.forwardRef(function ButtonForwardedRef(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>\n) {\n const {\n ariaLabel,\n id,\n children,\n wrapperClassName,\n className,\n arrow,\n concept = 'normal',\n disabled = false,\n ellipsis = false,\n fluid = false,\n htmlMarkup = 'button',\n onColor = 'onlight',\n onBlur,\n onClick,\n size = 'medium',\n variant = 'fill',\n href,\n tabIndex,\n testId,\n target,\n type = 'button',\n textClassName,\n textPosition = 'left',\n ...restProps\n } = props;\n\n const [leftIcon, rightIcon, restChildren] = useIcons(React.Children.toArray(children));\n const { hoverRef, isHovered } =\n htmlMarkup === 'button'\n ? useHover<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>)\n : useHover<HTMLAnchorElement>(ref as React.RefObject<HTMLAnchorElement>);\n const buttonContentRef = useRef<HTMLDivElement>(null);\n const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;\n const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;\n const onDark = onColor === 'ondark';\n const isMobile = useIsMobileBreakpoint();\n const destructive = concept === 'destructive' && !disabled;\n const outlineVariant = variant === 'outline';\n const borderlessVariant = variant === 'borderless';\n const iconColor = getIconColor(variant === 'fill', borderlessVariant, disabled, concept, onDark, isMobile);\n const hasArrow = arrow === 'icon' && !borderlessVariant;\n const large = size === 'large' && !destructive && !borderlessVariant;\n const hasUURightArrow = arrow === 'accessibility-character' && !fluid && !leftIcon && !rightIcon && !hasArrow && borderlessVariant;\n const rest = { ...restProps };\n\n const buttonWrapperClasses = classNames(\n buttonStyles['button-wrapper'],\n { [buttonStyles['button-wrapper--fluid']]: fluid || ellipsis },\n wrapperClassName\n );\n const buttonClasses = classNames(\n buttonStyles.button,\n {\n [buttonStyles['button--destructive']]: destructive,\n [buttonStyles['button--normal']]: !large,\n [buttonStyles['button--large']]: large,\n [buttonStyles['button--outline']]: outlineVariant,\n [buttonStyles['button--borderless']]: borderlessVariant,\n [buttonStyles['button--left-icon']]: leftIcon && !onlyIcon,\n [buttonStyles['button--right-icon']]: rightIcon && !onlyIcon,\n [buttonStyles['button--both-icons']]: bothIcons,\n [buttonStyles['button--only-icon']]: onlyIcon,\n [buttonStyles['button--arrow']]: hasArrow,\n [buttonStyles['button--on-dark']]: onDark,\n },\n className\n );\n const buttonTextClasses = classNames(\n buttonStyles['button__text'],\n {\n [buttonStyles['button__text--ellipsis']]: ellipsis,\n [buttonStyles['button__text--centered']]: fluid && textPosition === 'centered',\n },\n textClassName\n );\n const diagonalClasses = classNames(buttonStyles['diagonal'], {\n [buttonStyles['diagonal--on-dark']]: onDark,\n });\n\n useEffect(() => {\n checkOnlyIconAria(onlyIcon, ariaLabel, !isTest() && !isProd());\n }, []);\n\n const renderIcon = (iconElement: BaseIconElement | null, iconSize: number, iconClassName?: string): BaseIconElement | null => {\n return iconElement\n ? React.cloneElement(iconElement, {\n size: iconSize,\n color: iconElement?.props.color && !disabled ? iconElement.props.color : iconColor,\n isHovered: iconElement.props.isHovered === undefined ? !disabled && isHovered : iconElement.props.isHovered,\n className: iconClassName,\n })\n : null;\n };\n\n const renderButtonContent = (): JSX.Element => {\n return (\n <span className={buttonTextClasses} ref={buttonContentRef}>\n {disabled && borderlessVariant && (\n <span className={diagonalClasses}>\n <span className={buttonStyles['diagonal__line']} />\n </span>\n )}\n <span>{onlyIcon ? ariaLabel : restChildren}</span>\n </span>\n );\n };\n\n const renderbuttonContentWrapper = (): JSX.Element => (\n <span className={buttonClasses}>\n {renderIcon(leftIcon, getLargeIconSize(large, isMobile), !onlyIcon ? buttonStyles['button__left-icon'] : undefined)}\n {renderButtonContent()}\n {hasArrow\n ? renderIcon(\n <Icon svgIcon={ArrowRight} />,\n getLargeIconSize(large, isMobile),\n classNames(buttonStyles['button__arrow'], { [buttonStyles['button__arrow--both-icons']]: bothIcons })\n )\n : renderIcon(rightIcon, getLargeIconSize(large, isMobile), buttonStyles['button__right-icon'])}\n {hasUURightArrow && (\n <span style={{ color: iconColor }} className={buttonStyles['button__right-unicode-arrow']} aria-hidden>\n {' →'}\n </span>\n )}\n </span>\n );\n\n return (\n <>\n {htmlMarkup === 'button' && (\n <button\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n disabled={disabled}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n ref={hoverRef as React.ForwardedRef<HTMLButtonElement>}\n tabIndex={tabIndex}\n type={type}\n {...rest}\n >\n {renderbuttonContentWrapper()}\n </button>\n )}\n {htmlMarkup === 'a' && (\n <a\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : props.rel}\n ref={hoverRef as React.ForwardedRef<HTMLAnchorElement>}\n tabIndex={tabIndex}\n {...restProps}\n >\n {renderbuttonContentWrapper()}\n </a>\n )}\n </>\n );\n});\n\nexport default Button;\n"],"names":["React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AAW,aAAa,mBAAmB,IAAI,MAAS;AAAA,IACjH,oBAAoB;AAAA,IACpB,WACG;AAAA,MACE,oBAAC,MAAK,EAAA,SAAS,WAAY,CAAA;AAAA,MAC3B,iBAAiB,OAAO,QAAQ;AAAA,MAChC,WAAW,aAAa,eAAe,GAAG,EAAE,CAAC,aAAa,2BAA2B,CAAC,GAAG,UAAW,CAAA;AAAA,IAAA,IAEtG,WAAW,WAAW,iBAAiB,OAAO,QAAQ,GAAG,aAAa,oBAAoB,CAAC;AAAA,IAC9F,mBACC,oBAAC,QAAK,EAAA,OAAO,EAAE,OAAO,UAAA,GAAa,WAAW,aAAa,6BAA6B,GAAG,eAAW,MACnG,UACH,MAAA,CAAA;AAAA,EAAA,GAEJ;AAGF,SAEK,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA,eAAe,YACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,oBAAkB,YAAY;AAAA,QAC9B,WAAW;AAAA,QACX,KAAK;AAAA,QACL;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QAEH,UAA2B,2BAAA;AAAA,MAAA;AAAA,IAC9B;AAAA,IAED,eAAe,OACd;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,oBAAkB,YAAY;AAAA,QAC9B,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA,KAAK,WAAW,WAAW,wBAAwB,MAAM;AAAA,QACzD,KAAK;AAAA,QACL;AAAA,QACC,GAAG;AAAA,QAEH,UAA2B,2BAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAC9B,GAEJ;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../src/components/Button/Button.tsx"],"sourcesContent":["import React, { AriaAttributes, useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from './../Icon';\nimport { HTMLButtonProps, HTMLAnchorProps, AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { BaseIconElement, useIcons } from '../../hooks/useIcons';\nimport { useIsMobileBreakpoint } from '../../hooks/useIsMobileBreakpoint';\nimport { getColor } from '../../theme/currys/color';\nimport { isTest, isProd } from '../../utils/environment';\nimport ArrowRight from '../Icons/ArrowRight';\n\nimport buttonStyles from './styles.module.scss';\n\nexport type ButtonConcept = 'normal' | 'destructive';\nexport type ButtonVariant = 'fill' | 'outline' | 'borderless';\nexport type ButtonSize = 'medium' | 'large';\nexport type ButtonOnColor = 'onlight' | 'ondark';\nexport type ButtonTags = 'button' | 'a';\nexport type ButtonArrows = 'icon' | 'accessibility-character';\nexport type ButtonTextPosition = 'left' | 'centered';\n\nexport interface ButtonProps extends HTMLButtonProps, HTMLAnchorProps, AriaAttributes {\n /** Sets the aria-label of the button, use when the button only includes an icon */\n ariaLabel?: string;\n /** Gives a unique id to the button */\n id?: string;\n /** Sets the content of the button. */\n children: React.ReactNode;\n /** Adds custom classes to the wrapper element. */\n wrapperClassName?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Enables an arrow icon to the right inside the button (Not available in borderless variant) */\n arrow?: ButtonArrows;\n /** Changes the intent of the button. Mostly changes the color profile. */\n concept?: ButtonConcept;\n /** Disables text wrapping and enables ellipsis. */\n ellipsis?: boolean;\n /** Makes the button scale to full width of its parent element. */\n fluid?: boolean;\n /** Changes the underlying element of the button. */\n htmlMarkup?: ButtonTags;\n /** Changes the button colors for different backgrounds. */\n onColor?: ButtonOnColor;\n /** Function that is called when the Button loses focus */\n onBlur?: () => void;\n /** Function that is called when clicked */\n onClick?: (\n e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<unknown> | React.KeyboardEvent<HTMLUListElement> | null\n ) => void;\n /** Changes the button colors for different backgrounds. (Large not available in borderless variant) */\n size?: ButtonSize;\n /** Changes the visual representation of the button. */\n variant?: ButtonVariant;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Adds custom classes to the text */\n textClassName?: string;\n /** Sets the position of the text in the button - only applies when button is fluid */\n textPosition?: ButtonTextPosition;\n /** Button type. Default: button */\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n}\n\nconst getIconColor = (\n fill: boolean,\n borderless: boolean,\n disabled: boolean,\n concept: ButtonConcept,\n ondark: boolean,\n mobile: boolean\n): string => {\n if (mobile && disabled) {\n return !ondark || fill ? getColor('neutral', !borderless ? 700 : 500) : getColor('white');\n }\n if (disabled) {\n return !ondark || fill ? getColor('neutral', 500) : `${getColor('white')}b3`;\n }\n if ((fill && !ondark) || (!fill && ondark)) {\n return 'white';\n }\n\n return concept === 'normal' ? getColor('blueberry', 600) : getColor('cherry', 500);\n};\nconst getLargeIconSize = (large: boolean, mobile: boolean): IconSize => {\n if (mobile && large) return IconSize.Small;\n if (large) return IconSize.Medium;\n return IconSize.XSmall;\n};\n\nconst checkOnlyIconAria = (onlyIcon: boolean, ariaLabel: string | undefined, devEnv: boolean): void => {\n if (devEnv && onlyIcon && (ariaLabel === undefined || ariaLabel === '')) {\n throw new Error('Fyll inn ariaLabel prop på Button uten tekst for å opprettholde UU krav');\n }\n};\n\nconst Button = React.forwardRef(function ButtonForwardedRef(\n props: ButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>\n) {\n const {\n ariaLabel,\n id,\n children,\n wrapperClassName,\n className,\n arrow,\n concept = 'normal',\n disabled = false,\n ellipsis = false,\n fluid = false,\n htmlMarkup = 'button',\n onColor = 'onlight',\n onBlur,\n onClick,\n size = 'medium',\n variant = 'fill',\n href,\n tabIndex,\n testId,\n target,\n type = 'button',\n textClassName,\n textPosition = 'left',\n ...restProps\n } = props;\n\n const [leftIcon, rightIcon, restChildren] = useIcons(React.Children.toArray(children));\n const { hoverRef, isHovered } = useHover<HTMLElement>(ref as React.RefObject<HTMLElement>);\n const buttonContentRef = useRef<HTMLDivElement>(null);\n const onlyIcon = !!(leftIcon || rightIcon) && !restChildren;\n const bothIcons = leftIcon && (rightIcon || arrow) && !onlyIcon;\n const onDark = onColor === 'ondark';\n const isMobile = useIsMobileBreakpoint();\n const destructive = concept === 'destructive' && !disabled;\n const outlineVariant = variant === 'outline';\n const borderlessVariant = variant === 'borderless';\n const iconColor = getIconColor(variant === 'fill', borderlessVariant, disabled, concept, onDark, isMobile);\n const hasArrow = arrow === 'icon' && !borderlessVariant;\n const large = size === 'large' && !destructive && !borderlessVariant;\n const hasUURightArrow = arrow === 'accessibility-character' && !fluid && !leftIcon && !rightIcon && !hasArrow && borderlessVariant;\n const rest = { ...restProps };\n\n const buttonWrapperClasses = classNames(\n buttonStyles['button-wrapper'],\n { [buttonStyles['button-wrapper--fluid']]: fluid || ellipsis },\n wrapperClassName\n );\n const buttonClasses = classNames(\n buttonStyles.button,\n {\n [buttonStyles['button--destructive']]: destructive,\n [buttonStyles['button--normal']]: !large,\n [buttonStyles['button--large']]: large,\n [buttonStyles['button--outline']]: outlineVariant,\n [buttonStyles['button--borderless']]: borderlessVariant,\n [buttonStyles['button--left-icon']]: leftIcon && !onlyIcon,\n [buttonStyles['button--right-icon']]: rightIcon && !onlyIcon,\n [buttonStyles['button--both-icons']]: bothIcons,\n [buttonStyles['button--only-icon']]: onlyIcon,\n [buttonStyles['button--arrow']]: hasArrow,\n [buttonStyles['button--on-dark']]: onDark,\n },\n className\n );\n const buttonTextClasses = classNames(\n buttonStyles['button__text'],\n {\n [buttonStyles['button__text--ellipsis']]: ellipsis,\n [buttonStyles['button__text--centered']]: fluid && textPosition === 'centered',\n },\n textClassName\n );\n const diagonalClasses = classNames(buttonStyles['diagonal'], {\n [buttonStyles['diagonal--on-dark']]: onDark,\n });\n\n useEffect(() => {\n checkOnlyIconAria(onlyIcon, ariaLabel, !isTest() && !isProd());\n }, []);\n\n const renderIcon = (iconElement: BaseIconElement | null, iconSize: number, iconClassName?: string): BaseIconElement | null => {\n return iconElement\n ? React.cloneElement(iconElement, {\n size: iconSize,\n color: iconElement?.props.color && !disabled ? iconElement.props.color : iconColor,\n isHovered: iconElement.props.isHovered === undefined ? !disabled && isHovered : iconElement.props.isHovered,\n className: iconClassName,\n })\n : null;\n };\n\n const renderButtonContent = (): JSX.Element => {\n return (\n <span className={buttonTextClasses} ref={buttonContentRef}>\n {disabled && borderlessVariant && (\n <span className={diagonalClasses}>\n <span className={buttonStyles['diagonal__line']} />\n </span>\n )}\n <span>{onlyIcon ? ariaLabel : restChildren}</span>\n </span>\n );\n };\n\n const renderbuttonContentWrapper = (): JSX.Element => (\n <span className={buttonClasses}>\n {renderIcon(leftIcon, getLargeIconSize(large, isMobile), !onlyIcon ? buttonStyles['button__left-icon'] : undefined)}\n {renderButtonContent()}\n {hasArrow\n ? renderIcon(\n <Icon svgIcon={ArrowRight} />,\n getLargeIconSize(large, isMobile),\n classNames(buttonStyles['button__arrow'], { [buttonStyles['button__arrow--both-icons']]: bothIcons })\n )\n : renderIcon(rightIcon, getLargeIconSize(large, isMobile), buttonStyles['button__right-icon'])}\n {hasUURightArrow && (\n <span style={{ color: iconColor }} className={buttonStyles['button__right-unicode-arrow']} aria-hidden>\n {' →'}\n </span>\n )}\n </span>\n );\n\n return (\n <>\n {htmlMarkup === 'button' && (\n <button\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n disabled={disabled}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n ref={hoverRef as React.ForwardedRef<HTMLButtonElement>}\n tabIndex={tabIndex}\n type={type}\n {...rest}\n >\n {renderbuttonContentWrapper()}\n </button>\n )}\n {htmlMarkup === 'a' && (\n <a\n id={id}\n onBlur={onBlur}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Button}\n className={buttonWrapperClasses}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : props.rel}\n ref={hoverRef as React.ForwardedRef<HTMLAnchorElement>}\n tabIndex={tabIndex}\n {...restProps}\n >\n {renderbuttonContentWrapper()}\n </a>\n )}\n </>\n );\n});\n\nexport default Button;\n"],"names":["React"],"mappings":";;;;;;;;;;;;AAoEA,MAAM,eAAe,CACnB,MACA,YACA,UACA,SACA,QACA,WACW;AACX,MAAI,UAAU,UAAU;AACtB,WAAO,CAAC,UAAU,OAAO,SAAS,WAAW,CAAC,aAAa,MAAM,GAAG,IAAI,SAAS,OAAO;AAAA,EAC1F;AACA,MAAI,UAAU;AACZ,WAAO,CAAC,UAAU,OAAO,SAAS,WAAW,GAAG,IAAI,GAAG,SAAS,OAAO,CAAC;AAAA,EAC1E;AACA,MAAK,QAAQ,CAAC,UAAY,CAAC,QAAQ,QAAS;AAC1C,WAAO;AAAA,EACT;AAEA,SAAO,YAAY,WAAW,SAAS,aAAa,GAAG,IAAI,SAAS,UAAU,GAAG;AACnF;AACA,MAAM,mBAAmB,CAAC,OAAgB,WAA8B;AACtE,MAAI,UAAU,MAAO,QAAO,SAAS;AACrC,MAAI,cAAc,SAAS;AAC3B,SAAO,SAAS;AAClB;AAEA,MAAM,oBAAoB,CAAC,UAAmB,WAA+B,WAA0B;AACrG,MAAI,UAAU,aAAa,cAAc,UAAa,cAAc,KAAK;AACvE,UAAM,IAAI,MAAM,yEAAyE;AAAA,EAC3F;AACF;AAEA,MAAM,SAASA,eAAM,WAAW,SAAS,mBACvC,OACA,KACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,eAAe;AAAA,IACf,GAAG;AAAA,EAAA,IACD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