@helsenorge/designsystem-react 6.0.0-beta.9 → 6.0.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/CHANGELOG.md +249 -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.js +1 -1
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeadCell.js","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icon';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell = ({ sortable, onClick, className, children, sortDir, mode = ModeType.normal }: Props): React.JSX.Element => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable) {\n return (\n <th scope=\"col\" className={tableHeadCellDefaultClass}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(
|
|
1
|
+
{"version":3,"file":"TableHeadCell.js","sources":["../../../../src/components/Table/TableHeadCell/TableHeadCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport Icon, { IconSize } from '../../Icon';\nimport ArrowDown from '../../Icons/ArrowDown';\nimport ArrowUp from '../../Icons/ArrowUp';\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum SortDirection {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport interface Props {\n /** Sets if column for head cell should be sortable*/\n sortable?: boolean;\n /** Sort direction */\n sortDir?: SortDirection;\n /** Function that is called when clicked */\n onClick?: () => void;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the td element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableHeadCell = ({ sortable, onClick, className, children, sortDir, mode = ModeType.normal }: Props): React.JSX.Element => {\n const tableHeadCellDefaultClass = classNames(tableStyles['table__head-cell'], className, {\n [tableStyles['table__head-cell--compact']]: mode === ModeType.compact,\n });\n\n if (!sortable && !children) {\n return <td className={tableHeadCellDefaultClass}></td>;\n }\n\n if (!sortable) {\n return (\n <th scope=\"col\" className={tableHeadCellDefaultClass}>\n {children}\n </th>\n );\n }\n\n const sortableClasses = classNames(tableHeadCellDefaultClass, tableStyles['table__head-cell--sortable'], className);\n\n const renderSortIcon = (): React.JSX.Element | undefined =>\n sortDir && (\n <div className={tableStyles['table__head-cell-sort-icon-wrapper']}>\n <Icon svgIcon={sortDir == SortDirection.asc ? ArrowDown : ArrowUp} size={IconSize.XXSmall} />\n </div>\n );\n\n const getSortDirection = (): React.AriaAttributes['aria-sort'] => {\n switch (sortDir) {\n case SortDirection.asc:\n return 'ascending';\n case SortDirection.desc:\n return 'descending';\n }\n };\n\n return (\n <th scope=\"col\" className={sortableClasses} aria-sort={getSortDirection()}>\n <button type=\"button\" onClick={onClick} className={tableStyles['table__sort-button']} aria-pressed={sortDir ? !!sortDir : undefined}>\n {renderSortIcon()}\n {children}\n </button>\n </th>\n );\n};\n\nexport default TableHeadCell;\n"],"names":["SortDirection","TableHeadCell","sortable","onClick","className","children","sortDir","mode","ModeType","tableHeadCellDefaultClass","classNames","tableStyles","React","sortableClasses","renderSortIcon","Icon","ArrowDown","ArrowUp","IconSize","getSortDirection","TableHeadCell$1"],"mappings":";;;;;;;;AAUY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA;AAoBC,MAAAC,IAAgB,CAAC,EAAE,UAAAC,GAAU,SAAAC,GAAS,WAAAC,GAAW,UAAAC,GAAU,SAAAC,GAAS,MAAAC,IAAOC,EAAS,aAAuC;AACtI,QAAMC,IAA4BC,EAAWC,EAAY,kBAAkB,GAAGP,GAAW;AAAA,IACvF,CAACO,EAAY,2BAA2B,CAAC,GAAGJ,MAASC,EAAS;AAAA,EAAA,CAC/D;AAEG,MAAA,CAACN,KAAY,CAACG;AACT,WAAAO,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,EAA2B,CAAA;AAGnD,MAAI,CAACP;AACH,2CACG,MAAG,EAAA,OAAM,OAAM,WAAWO,KACxBJ,CACH;AAIJ,QAAMQ,IAAkBH,EAAWD,GAA2BE,EAAY,4BAA4B,GAAGP,CAAS,GAE5GU,IAAiB,MACrBR,qCACG,OAAI,EAAA,WAAWK,EAAY,oCAAoC,EAAA,mCAC7DI,GAAK,EAAA,SAAST,KAAW,QAAoBU,IAAYC,GAAS,MAAMC,EAAS,SAAS,CAC7F,GAGEC,IAAmB,MAAyC;AAChE,YAAQb,GAAS;AAAA,MACf,KAAK;AACI,eAAA;AAAA,MACT,KAAK;AACI,eAAA;AAAA,IACX;AAAA,EAAA;AAIA,SAAAM,gBAAAA,EAAA,cAAC,MAAG,EAAA,OAAM,OAAM,WAAWC,GAAiB,aAAWM,EAAiB,EAAA,GACrEP,gBAAAA,EAAA,cAAA,UAAA,EAAO,MAAK,UAAS,SAAAT,GAAkB,WAAWQ,EAAY,oBAAoB,GAAG,gBAAcL,IAAU,CAAC,CAACA,IAAU,OACvH,GAAAQ,EAAA,GACAT,CACH,CACF;AAEJ,GAEAe,IAAenB;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "react";
|
|
2
|
-
import
|
|
2
|
+
import i from "classnames";
|
|
3
3
|
import t from "../styles.module.scss";
|
|
4
4
|
import { ModeType as w } from "../Table.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import _ from "../TableExpanderCell/TableExpanderCellMobile.js";
|
|
6
|
+
const E = ({
|
|
7
7
|
rowKey: s,
|
|
8
8
|
hideDetailsText: n,
|
|
9
9
|
showDetailsText: b,
|
|
@@ -14,7 +14,7 @@ const R = ({
|
|
|
14
14
|
children: c,
|
|
15
15
|
mode: r = w.normal
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
17
|
+
const f = i(
|
|
18
18
|
t["table-row"],
|
|
19
19
|
{
|
|
20
20
|
[t["table__row--expandable"]]: a,
|
|
@@ -22,8 +22,8 @@ const R = ({
|
|
|
22
22
|
},
|
|
23
23
|
p
|
|
24
24
|
);
|
|
25
|
-
return /* @__PURE__ */ e.createElement("tr", { className:
|
|
26
|
-
|
|
25
|
+
return /* @__PURE__ */ e.createElement("tr", { className: f, onClick: o, key: s }, e.Children.map(c, (m) => e.isValidElement(m) && e.cloneElement(m, { mode: r })), a && /* @__PURE__ */ e.createElement(
|
|
26
|
+
_,
|
|
27
27
|
{
|
|
28
28
|
expanded: l,
|
|
29
29
|
onClick: o,
|
|
@@ -32,9 +32,9 @@ const R = ({
|
|
|
32
32
|
mode: r
|
|
33
33
|
}
|
|
34
34
|
));
|
|
35
|
-
}, x =
|
|
35
|
+
}, x = E;
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
E as TableRow,
|
|
38
38
|
x as default
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=TableRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.js","sources":["../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\nimport TableExpanderCellMobile from '../TableExpanderCell/TableExpanderCellMobile';\n\nexport interface Props {\n /** Sets if expanded row can be expanded */\n expandable?: boolean;\n /** Sets if expanded row is expanded */\n expanded?: boolean;\n /** When hide/show button for expanded row is clicked. */\n onClick?: () => void;\n /** Text for expanded row hide button. */\n hideDetailsText?: string;\n /** Text for expanded row show button. */\n showDetailsText?: string;\n /** Key attribute for row */\n rowKey?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the cells of the table row element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableRow: React.FC<Props> = ({\n rowKey,\n hideDetailsText,\n showDetailsText,\n expandable,\n expanded,\n onClick,\n className,\n children,\n mode = ModeType.normal,\n}) => {\n const tableRowClass = classNames(\n tableStyles['table-row'],\n {\n [tableStyles['table__row--expandable']]: expandable,\n [tableStyles['table__row--expanded']]: expanded,\n },\n className\n );\n\n return (\n <tr className={tableRowClass} onClick={onClick} key={rowKey}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n {expandable && (\n <TableExpanderCellMobile\n expanded={expanded}\n onClick={onClick}\n hideDetailsText={hideDetailsText}\n showDetailsText={showDetailsText}\n mode={mode}\n />\n )}\n </tr>\n );\n};\n\nexport default TableRow;\n"],"names":["TableRow","rowKey","hideDetailsText","showDetailsText","expandable","expanded","onClick","className","children","mode","ModeType","tableRowClass","classNames","tableStyles","React","child","TableExpanderCellMobile","TableRow$1"],"mappings":";;;;;AA6BO,MAAMA,IAA4B,CAAC;AAAA,EACxC,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAClB,MAAM;AACJ,QAAMC,IAAgBC;AAAA,IACpBC,EAAY,WAAW;AAAA,IACvB;AAAA,MACE,CAACA,EAAY,wBAAwB,CAAC,GAAGT;AAAA,MACzC,CAACS,EAAY,sBAAsB,CAAC,GAAGR;AAAA,IACzC;AAAA,IACAE;AAAA,EAAA;AAIA,
|
|
1
|
+
{"version":3,"file":"TableRow.js","sources":["../../../../src/components/Table/TableRow/TableRow.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\nimport TableExpanderCellMobile from '../TableExpanderCell/TableExpanderCellMobile';\n\nexport interface Props {\n /** Sets if expanded row can be expanded */\n expandable?: boolean;\n /** Sets if expanded row is expanded */\n expanded?: boolean;\n /** When hide/show button for expanded row is clicked. */\n onClick?: () => void;\n /** Text for expanded row hide button. */\n hideDetailsText?: string;\n /** Text for expanded row show button. */\n showDetailsText?: string;\n /** Key attribute for row */\n rowKey?: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the cells of the table row element. */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableRow: React.FC<Props> = ({\n rowKey,\n hideDetailsText,\n showDetailsText,\n expandable,\n expanded,\n onClick,\n className,\n children,\n mode = ModeType.normal,\n}) => {\n const tableRowClass = classNames(\n tableStyles['table-row'],\n {\n [tableStyles['table__row--expandable']]: expandable,\n [tableStyles['table__row--expanded']]: expanded,\n },\n className\n );\n\n return (\n <tr className={tableRowClass} onClick={onClick} key={rowKey}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n {expandable && (\n <TableExpanderCellMobile\n expanded={expanded}\n onClick={onClick}\n hideDetailsText={hideDetailsText}\n showDetailsText={showDetailsText}\n mode={mode}\n />\n )}\n </tr>\n );\n};\n\nexport default TableRow;\n"],"names":["TableRow","rowKey","hideDetailsText","showDetailsText","expandable","expanded","onClick","className","children","mode","ModeType","tableRowClass","classNames","tableStyles","React","child","TableExpanderCellMobile","TableRow$1"],"mappings":";;;;;AA6BO,MAAMA,IAA4B,CAAC;AAAA,EACxC,QAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAClB,MAAM;AACJ,QAAMC,IAAgBC;AAAA,IACpBC,EAAY,WAAW;AAAA,IACvB;AAAA,MACE,CAACA,EAAY,wBAAwB,CAAC,GAAGT;AAAA,MACzC,CAACS,EAAY,sBAAsB,CAAC,GAAGR;AAAA,IACzC;AAAA,IACAE;AAAA,EAAA;AAIA,SAAAO,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,GAAe,SAAAL,GAAkB,KAAKL,EAClD,GAAAa,EAAM,SAAS,IAAIN,GAAU,CAAAO,MAASD,EAAM,eAAoCC,CAAK,KAAKD,EAAM,aAAaC,GAAO,EAAE,MAAAN,EAAM,CAAA,CAAC,GAC7HL,KACCU,gBAAAA,EAAA;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAX;AAAA,MACA,SAAAC;AAAA,MACA,iBAAAJ;AAAA,MACA,iBAAAC;AAAA,MACA,MAAAM;AAAA,IAAA;AAAA,EAAA,CAGN;AAEJ,GAEAQ,IAAejB;"}
|
|
@@ -43,12 +43,6 @@ table .table-body .table-row {
|
|
|
43
43
|
max-width: 100%;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.table__head-cell:focus {
|
|
47
|
-
outline: none;
|
|
48
|
-
background-color: $blueberry800;
|
|
49
|
-
text-decoration: underline;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
46
|
.table__cell {
|
|
53
47
|
position: relative;
|
|
54
48
|
padding: 0.75rem 0 0.75rem 40%;
|
|
@@ -212,12 +206,6 @@ table .table-body .table-row {
|
|
|
212
206
|
outline-offset: -3px;
|
|
213
207
|
}
|
|
214
208
|
|
|
215
|
-
&--sorted {
|
|
216
|
-
text-decoration: underline;
|
|
217
|
-
text-decoration-thickness: 1px;
|
|
218
|
-
text-underline-offset: 0.3125rem;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
209
|
@media (min-width: map.get($grid-breakpoints, lg)) {
|
|
222
210
|
padding: 1rem;
|
|
223
211
|
height: 5.5rem;
|
|
@@ -21,7 +21,6 @@ export type Styles = {
|
|
|
21
21
|
'table__head-cell': string;
|
|
22
22
|
'table__head-cell--compact': string;
|
|
23
23
|
'table__head-cell--sortable': string;
|
|
24
|
-
'table__head-cell--sorted': string;
|
|
25
24
|
'table__head-cell-sort-icon-wrapper': string;
|
|
26
25
|
'table__row--expandable': string;
|
|
27
26
|
'table__row--expandable--selected': string;
|
package/components/Tag/Tag.js
CHANGED
|
@@ -9,8 +9,8 @@ import X from "../Icons/X.js";
|
|
|
9
9
|
import b from "../LazyIcon/LazyIcon.js";
|
|
10
10
|
import t from "./styles.module.scss";
|
|
11
11
|
var z = /* @__PURE__ */ ((e) => (e.medium = "medium", e.large = "large", e))(z || {}), E = /* @__PURE__ */ ((e) => (e.remove = "remove", e.undo = "undo", e))(E || {}), N = /* @__PURE__ */ ((e) => (e.normal = "normal", e.oncolor = "oncolor", e.emphasised = "emphasised", e))(N || {});
|
|
12
|
-
const
|
|
13
|
-
const { children: s, size: c, color: o, variant: a, action: r, onClick: m, testId:
|
|
12
|
+
const _ = (e) => {
|
|
13
|
+
const { children: s, size: c, color: o, variant: a, action: r, onClick: m, testId: l } = e, { hoverRef: i, isHovered: d } = I(), $ = p(
|
|
14
14
|
t.tag,
|
|
15
15
|
t[`tag--${c}`],
|
|
16
16
|
t[`tag--${r}`],
|
|
@@ -24,7 +24,7 @@ const C = (e) => {
|
|
|
24
24
|
return h;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */ n.createElement("button", { className: $, onClick: m, ref:
|
|
27
|
+
return /* @__PURE__ */ n.createElement("button", { className: $, onClick: m, ref: i, type: "button", "data-testid": l, "data-analyticsid": f.Tag }, s, /* @__PURE__ */ n.createElement(
|
|
28
28
|
v,
|
|
29
29
|
{
|
|
30
30
|
svgIcon: y(),
|
|
@@ -33,12 +33,12 @@ const C = (e) => {
|
|
|
33
33
|
isHovered: d
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
|
-
},
|
|
37
|
-
const { children: s, size: c = "medium", color: o = "blueberry", svgIcon: a, variant: r = "normal", action: m, onClick:
|
|
36
|
+
}, C = (e) => {
|
|
37
|
+
const { children: s, size: c = "medium", color: o = "blueberry", svgIcon: a, variant: r = "normal", action: m, onClick: l, testId: i } = e, d = p(t.tag, t[`tag--${c}`], t[`tag--${o}`], t[`tag--${r}`], {
|
|
38
38
|
[t["tag--has-icon"]]: a
|
|
39
39
|
});
|
|
40
|
-
return m &&
|
|
41
|
-
}, j =
|
|
40
|
+
return m && l ? /* @__PURE__ */ n.createElement(_, { size: c, color: o, variant: r, action: m, onClick: l, testId: i }, s) : /* @__PURE__ */ n.createElement("span", { className: d, "data-testid": i, "data-analyticsid": f.Tag }, a && (typeof a == "string" ? /* @__PURE__ */ n.createElement(b, { iconName: a, size: g.XXSmall, color: u[`${o}800`], className: t.tag__icon }) : /* @__PURE__ */ n.createElement(v, { svgIcon: a, size: g.XXSmall, color: u[`${o}800`], className: t.tag__icon })), s);
|
|
41
|
+
}, j = C;
|
|
42
42
|
export {
|
|
43
43
|
E as TagAction,
|
|
44
44
|
z as TagSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sources":["../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { palette, PaletteNames } from '../../theme/palette';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport Undo from '../Icons/Undo';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport enum TagSize {\n medium = 'medium',\n large = 'large',\n}\n\nexport enum TagAction {\n remove = 'remove',\n undo = 'undo',\n}\n\nexport enum TagVariant {\n normal = 'normal',\n oncolor = 'oncolor',\n emphasised = 'emphasised',\n}\n\nexport type TagColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'cherry' | 'banana' | 'kiwi' | 'plum'>;\n\ninterface TagProps {\n /** Sets the text of the tag */\n children: string;\n /** Sets the size of the tag. Default: small */\n size?: keyof typeof TagSize;\n /** Sets the background of the tag. Not used if action is \"undo\". Default: blueberry */\n color?: TagColors;\n /** Adds an icon to the tag. Not shown if action is set. */\n svgIcon?: SvgIcon | IconName;\n /* Changes the appearance of the tag. Not used if action is \"undo\". Default: normal */\n variant?: keyof typeof TagVariant;\n /* Makes the tag a clickable button that performs an action. onClick must also be set. */\n action?: keyof typeof TagAction;\n /* Called when action is set and the tag is clicked on. action must also be set. */\n onClick?: () => void;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\ntype ActionTagProps = Required<Pick<TagProps, 'children' | 'size' | 'color' | 'variant' | 'action' | 'onClick'>> & Pick<TagProps, 'testId'>;\n\nconst ActionTag: React.FC<ActionTagProps> = props => {\n const { children, size, color, variant, action, onClick, testId } = props;\n\n const { hoverRef, isHovered } = useHover<HTMLButtonElement>();\n\n const tagClasses = cn(\n styles.tag,\n styles[`tag--${size}`],\n styles[`tag--${action}`],\n styles['tag--has-action'],\n action === 'remove' && [styles[`tag--${color}`], styles[`tag--${variant}`]]\n );\n\n const getActionIcon = (): SvgIcon => {\n switch (action) {\n case 'remove':\n return X;\n case 'undo':\n return Undo;\n }\n };\n\n return (\n <button className={tagClasses} onClick={onClick} ref={hoverRef} type=\"button\" data-testid={testId} data-analyticsid={AnalyticsId.Tag}>\n {children}\n <Icon\n svgIcon={getActionIcon()}\n size={IconSize.XXSmall}\n color={palette[`${action === 'undo' ? 'blueberry' : color}800`]}\n isHovered={isHovered}\n />\n </button>\n );\n};\n\nconst Tag: React.FC<TagProps> = props => {\n const { children, size = TagSize.medium, color = 'blueberry', svgIcon, variant = 'normal', action, onClick, testId } = props;\n\n const tagClasses = cn(styles.tag, styles[`tag--${size}`], styles[`tag--${color}`], styles[`tag--${variant}`], {\n [styles['tag--has-icon']]: svgIcon,\n });\n\n if (action && onClick) {\n return (\n <ActionTag size={size} color={color} variant={variant} action={action} onClick={onClick} testId={testId}>\n {children}\n </ActionTag>\n );\n }\n\n return (\n <span className={tagClasses} data-testid={testId} data-analyticsid={AnalyticsId.Tag}>\n {svgIcon &&\n (typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ) : (\n <Icon svgIcon={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ))}\n {children}\n </span>\n );\n};\n\nexport default Tag;\n"],"names":["TagSize","TagAction","TagVariant","ActionTag","props","children","size","color","variant","action","onClick","testId","hoverRef","isHovered","useHover","tagClasses","cn","styles","getActionIcon","Undo","React","AnalyticsId","Icon","IconSize","palette","Tag","svgIcon","LazyIcon","Tag$1"],"mappings":";;;;;;;;;;AAeY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;AA6BZ,MAAMC,IAAsC,CAASC,MAAA;AAC7C,QAAA,EAAE,UAAAC,GAAU,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,QAAAC,GAAQ,SAAAC,GAAS,QAAAC,EAAW,IAAAP,GAE9D,EAAE,UAAAQ,GAAU,WAAAC,EAAU,IAAIC,EAA4B,GAEtDC,IAAaC;AAAAA,IACjBC,EAAO;AAAA,IACPA,EAAO,QAAQX,CAAI,EAAE;AAAA,IACrBW,EAAO,QAAQR,CAAM,EAAE;AAAA,IACvBQ,EAAO,iBAAiB;AAAA,IACxBR,MAAW,YAAY,CAACQ,EAAO,QAAQV,CAAK,EAAE,GAAGU,EAAO,QAAQT,CAAO,EAAE,CAAC;AAAA,EAAA,GAGtEU,IAAgB,MAAe;AACnC,YAAQT,GAAQ;AAAA,MACd,KAAK;AACI,eAAA;AAAA,MACT,KAAK;AACI,eAAAU;AAAA,IACX;AAAA,EAAA;AAGF,
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../src/components/Tag/Tag.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { palette, PaletteNames } from '../../theme/palette';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport Undo from '../Icons/Undo';\nimport X from '../Icons/X';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport enum TagSize {\n medium = 'medium',\n large = 'large',\n}\n\nexport enum TagAction {\n remove = 'remove',\n undo = 'undo',\n}\n\nexport enum TagVariant {\n normal = 'normal',\n oncolor = 'oncolor',\n emphasised = 'emphasised',\n}\n\nexport type TagColors = Extract<PaletteNames, 'blueberry' | 'neutral' | 'cherry' | 'banana' | 'kiwi' | 'plum'>;\n\ninterface TagProps {\n /** Sets the text of the tag */\n children: string;\n /** Sets the size of the tag. Default: small */\n size?: keyof typeof TagSize;\n /** Sets the background of the tag. Not used if action is \"undo\". Default: blueberry */\n color?: TagColors;\n /** Adds an icon to the tag. Not shown if action is set. */\n svgIcon?: SvgIcon | IconName;\n /* Changes the appearance of the tag. Not used if action is \"undo\". Default: normal */\n variant?: keyof typeof TagVariant;\n /* Makes the tag a clickable button that performs an action. onClick must also be set. */\n action?: keyof typeof TagAction;\n /* Called when action is set and the tag is clicked on. action must also be set. */\n onClick?: () => void;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\ntype ActionTagProps = Required<Pick<TagProps, 'children' | 'size' | 'color' | 'variant' | 'action' | 'onClick'>> & Pick<TagProps, 'testId'>;\n\nconst ActionTag: React.FC<ActionTagProps> = props => {\n const { children, size, color, variant, action, onClick, testId } = props;\n\n const { hoverRef, isHovered } = useHover<HTMLButtonElement>();\n\n const tagClasses = cn(\n styles.tag,\n styles[`tag--${size}`],\n styles[`tag--${action}`],\n styles['tag--has-action'],\n action === 'remove' && [styles[`tag--${color}`], styles[`tag--${variant}`]]\n );\n\n const getActionIcon = (): SvgIcon => {\n switch (action) {\n case 'remove':\n return X;\n case 'undo':\n return Undo;\n }\n };\n\n return (\n <button className={tagClasses} onClick={onClick} ref={hoverRef} type=\"button\" data-testid={testId} data-analyticsid={AnalyticsId.Tag}>\n {children}\n <Icon\n svgIcon={getActionIcon()}\n size={IconSize.XXSmall}\n color={palette[`${action === 'undo' ? 'blueberry' : color}800`]}\n isHovered={isHovered}\n />\n </button>\n );\n};\n\nconst Tag: React.FC<TagProps> = props => {\n const { children, size = TagSize.medium, color = 'blueberry', svgIcon, variant = 'normal', action, onClick, testId } = props;\n\n const tagClasses = cn(styles.tag, styles[`tag--${size}`], styles[`tag--${color}`], styles[`tag--${variant}`], {\n [styles['tag--has-icon']]: svgIcon,\n });\n\n if (action && onClick) {\n return (\n <ActionTag size={size} color={color} variant={variant} action={action} onClick={onClick} testId={testId}>\n {children}\n </ActionTag>\n );\n }\n\n return (\n <span className={tagClasses} data-testid={testId} data-analyticsid={AnalyticsId.Tag}>\n {svgIcon &&\n (typeof svgIcon === 'string' ? (\n <LazyIcon iconName={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ) : (\n <Icon svgIcon={svgIcon} size={IconSize.XXSmall} color={palette[`${color}800`]} className={styles.tag__icon} />\n ))}\n {children}\n </span>\n );\n};\n\nexport default Tag;\n"],"names":["TagSize","TagAction","TagVariant","ActionTag","props","children","size","color","variant","action","onClick","testId","hoverRef","isHovered","useHover","tagClasses","cn","styles","getActionIcon","Undo","React","AnalyticsId","Icon","IconSize","palette","Tag","svgIcon","LazyIcon","Tag$1"],"mappings":";;;;;;;;;;AAeY,IAAAA,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,OAAO,QAFGA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;AA6BZ,MAAMC,IAAsC,CAASC,MAAA;AAC7C,QAAA,EAAE,UAAAC,GAAU,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,QAAAC,GAAQ,SAAAC,GAAS,QAAAC,EAAW,IAAAP,GAE9D,EAAE,UAAAQ,GAAU,WAAAC,EAAU,IAAIC,EAA4B,GAEtDC,IAAaC;AAAAA,IACjBC,EAAO;AAAA,IACPA,EAAO,QAAQX,CAAI,EAAE;AAAA,IACrBW,EAAO,QAAQR,CAAM,EAAE;AAAA,IACvBQ,EAAO,iBAAiB;AAAA,IACxBR,MAAW,YAAY,CAACQ,EAAO,QAAQV,CAAK,EAAE,GAAGU,EAAO,QAAQT,CAAO,EAAE,CAAC;AAAA,EAAA,GAGtEU,IAAgB,MAAe;AACnC,YAAQT,GAAQ;AAAA,MACd,KAAK;AACI,eAAA;AAAA,MACT,K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AQ,GAAGjB,CAAK,KAAK,GAAG,WAAWU,EAAO,UAAW,CAAA,IAE/GZ,CACH;AAEJ,GAEAuB,IAAeH;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import { AnalyticsId as l } from "../../constants.js";
|
|
3
3
|
import a from "./styles.module.scss";
|
|
4
|
-
const m = ({ children: e, testId: s }) => /* @__PURE__ */ t.createElement("ul", { className: a["tag-list"], "data-testid": s, "data-analyticsid": l.TagList }, t.Children.map(e, (i) => /* @__PURE__ */ t.createElement("li", { className: a["tag-list__item"] }, i))),
|
|
4
|
+
const m = ({ children: e, testId: s }) => /* @__PURE__ */ t.createElement("ul", { className: a["tag-list"], "data-testid": s, "data-analyticsid": l.TagList }, t.Children.map(e, (i) => /* @__PURE__ */ t.createElement("li", { className: a["tag-list__item"] }, i))), d = m;
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
d as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=TagList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagList.js","sources":["../../../src/components/TagList/TagList.tsx"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\n\nimport styles from './styles.module.scss';\n\ninterface TagListPropsProps {\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\nconst TagList: React.FC<TagListPropsProps> = ({ children, testId }) => {\n return (\n <ul className={styles['tag-list']} data-testid={testId} data-analyticsid={AnalyticsId.TagList}>\n {React.Children.map(children, child => (\n <li className={styles['tag-list__item']}>{child}</li>\n ))}\n </ul>\n );\n};\n\nexport default TagList;\n"],"names":["TagList","children","testId","React","styles","AnalyticsId","child","TagList$1"],"mappings":";;;AAWA,MAAMA,IAAuC,CAAC,EAAE,UAAAC,GAAU,QAAAC,
|
|
1
|
+
{"version":3,"file":"TagList.js","sources":["../../../src/components/TagList/TagList.tsx"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\n\nimport styles from './styles.module.scss';\n\ninterface TagListPropsProps {\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n}\n\nconst TagList: React.FC<TagListPropsProps> = ({ children, testId }) => {\n return (\n <ul className={styles['tag-list']} data-testid={testId} data-analyticsid={AnalyticsId.TagList}>\n {React.Children.map(children, child => (\n <li className={styles['tag-list__item']}>{child}</li>\n ))}\n </ul>\n );\n};\n\nexport default TagList;\n"],"names":["TagList","children","testId","React","styles","AnalyticsId","child","TagList$1"],"mappings":";;;AAWA,MAAMA,IAAuC,CAAC,EAAE,UAAAC,GAAU,QAAAC,QAEtDC,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWC,EAAO,UAAU,GAAG,eAAaF,GAAQ,oBAAkBG,EAAY,QACnF,GAAAF,EAAM,SAAS,IAAIF,GAAU,CAC5BK,MAAAH,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWC,EAAO,gBAAgB,EAAA,GAAIE,CAAM,CACjD,CACH,GAIJC,IAAeP;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAA2C,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQpF,UAAU,aACR,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,EAC5C,kBAAkB,GAClB,WAAW,GACX,UAAU,GACV,MAAM,GACN,cAAc,GACd,aAAa,GACb,UAAU,GACV,UAAU,GACV,cAAc,GACd,UAAU,CACb;IACD,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,yBAAyB;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAA2C,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQpF,UAAU,aACR,SAAQ,IAAI,CACV,KAAK,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,EAC5C,kBAAkB,GAClB,WAAW,GACX,UAAU,GACV,MAAM,GACN,cAAc,GACd,aAAa,GACb,UAAU,GACV,UAAU,GACV,cAAc,GACd,UAAU,CACb;IACD,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IAC7B,yBAAyB;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD,QAAA,MAAM,QAAQ,2FA4IZ,CAAC;AAIH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,100 +1,104 @@
|
|
|
1
|
-
import o, { useState as
|
|
2
|
-
import
|
|
3
|
-
import { FormMode as
|
|
1
|
+
import o, { useState as A, useRef as Y, useEffect as N } from "react";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import { FormMode as m, AnalyticsId as Z, AVERAGE_CHARACTER_WIDTH_PX as ee } from "../../constants.js";
|
|
4
4
|
import { uuid as te } from "../../utils/uuid.js";
|
|
5
5
|
import re from "../ErrorWrapper/ErrorWrapper.js";
|
|
6
6
|
import { renderLabel as ae } from "../Label/Label.js";
|
|
7
7
|
import ne from "../MaxCharacters/MaxCharacters.js";
|
|
8
8
|
import t from "./styles.module.scss";
|
|
9
9
|
const oe = (a) => {
|
|
10
|
-
const
|
|
11
|
-
return `calc(${a * ee}px + ${
|
|
12
|
-
},
|
|
10
|
+
const u = "2rem", n = "16px", p = "4px";
|
|
11
|
+
return `calc(${a * ee}px + ${u} + ${n} + ${p})`;
|
|
12
|
+
}, $ = o.forwardRef((a, u) => {
|
|
13
13
|
const {
|
|
14
14
|
maxCharacters: n,
|
|
15
|
-
maxText:
|
|
16
|
-
width:
|
|
17
|
-
testId:
|
|
18
|
-
defaultValue:
|
|
19
|
-
marginBottom:
|
|
20
|
-
transparent:
|
|
21
|
-
mode: i =
|
|
22
|
-
label:
|
|
15
|
+
maxText: p,
|
|
16
|
+
width: f,
|
|
17
|
+
testId: B,
|
|
18
|
+
defaultValue: s,
|
|
19
|
+
marginBottom: M,
|
|
20
|
+
transparent: k,
|
|
21
|
+
mode: i = m.onwhite,
|
|
22
|
+
label: L,
|
|
23
23
|
textareaId: b = te(),
|
|
24
24
|
minRows: g = 3,
|
|
25
|
-
maxRows:
|
|
25
|
+
maxRows: c = 10,
|
|
26
26
|
grow: w,
|
|
27
27
|
errorText: C,
|
|
28
|
-
autoFocus:
|
|
28
|
+
autoFocus: S,
|
|
29
29
|
disabled: E,
|
|
30
|
-
name:
|
|
30
|
+
name: D,
|
|
31
31
|
autoComplete: y,
|
|
32
|
-
placeholder:
|
|
33
|
-
readOnly:
|
|
34
|
-
required:
|
|
32
|
+
placeholder: F,
|
|
33
|
+
readOnly: V,
|
|
34
|
+
required: q,
|
|
35
35
|
onChange: R,
|
|
36
|
-
...
|
|
37
|
-
} = a, [
|
|
38
|
-
|
|
36
|
+
...z
|
|
37
|
+
} = a, [G, T] = A(g), [v, W] = A(s || ""), l = Y(null);
|
|
38
|
+
N(() => {
|
|
39
|
+
W(s || "");
|
|
40
|
+
}, [s]);
|
|
41
|
+
const _ = (e) => {
|
|
42
|
+
const d = e.rows;
|
|
39
43
|
e.rows = g;
|
|
40
44
|
const r = Math.floor((e.scrollHeight - 16) / 28);
|
|
41
|
-
r ===
|
|
42
|
-
},
|
|
43
|
-
[t["textarea--gutterBottom"]]:
|
|
44
|
-
}),
|
|
45
|
-
[t["input-container--transparent"]]:
|
|
46
|
-
[t["input-container--on-blueberry"]]:
|
|
47
|
-
[t["input-container--on-dark"]]:
|
|
45
|
+
r === d && (e.rows = r), r >= c && (e.rows = c, e.scrollTop = e.scrollHeight), r < c ? T(r) : T(c);
|
|
46
|
+
}, O = i === m.ondark, P = i === m.onblueberry, X = !!n && v.toString().length > n, H = i === m.oninvalid || !!C || X, j = h(t.textarea, {
|
|
47
|
+
[t["textarea--gutterBottom"]]: M
|
|
48
|
+
}), J = h(t["input-container"], {
|
|
49
|
+
[t["input-container--transparent"]]: k,
|
|
50
|
+
[t["input-container--on-blueberry"]]: P,
|
|
51
|
+
[t["input-container--on-dark"]]: O,
|
|
48
52
|
[t["input-container--invalid"]]: H,
|
|
49
53
|
[t["input-container--disabled"]]: a.disabled
|
|
50
|
-
}),
|
|
54
|
+
}), K = h(t["input-container__input"], {
|
|
51
55
|
[t["input-container__input--disabled"]]: a.disabled
|
|
52
56
|
});
|
|
53
|
-
|
|
54
|
-
var e,
|
|
55
|
-
if (w && ((e =
|
|
56
|
-
const r = (
|
|
57
|
-
|
|
57
|
+
N(() => {
|
|
58
|
+
var e, x, d;
|
|
59
|
+
if (w && ((e = l.current) != null && e.children) && ((x = l.current) != null && x.children[0])) {
|
|
60
|
+
const r = (d = l.current) == null ? void 0 : d.children[0];
|
|
61
|
+
_(r);
|
|
58
62
|
}
|
|
59
63
|
}, []);
|
|
60
|
-
const
|
|
61
|
-
w &&
|
|
62
|
-
},
|
|
63
|
-
R && R(e),
|
|
64
|
-
},
|
|
65
|
-
return /* @__PURE__ */ o.createElement(re, { errorText: C }, /* @__PURE__ */ o.createElement("div", { "data-testid":
|
|
64
|
+
const Q = (e) => {
|
|
65
|
+
w && _(e.target), W(e.target.value);
|
|
66
|
+
}, U = (e) => {
|
|
67
|
+
R && R(e), Q(e);
|
|
68
|
+
}, I = f ? oe(f) : void 0;
|
|
69
|
+
return /* @__PURE__ */ o.createElement(re, { errorText: C }, /* @__PURE__ */ o.createElement("div", { "data-testid": B, "data-analyticsid": Z.Textarea, className: j }, ae(L, b, i, E), /* @__PURE__ */ o.createElement("div", { className: J, ref: l, style: { maxWidth: I } }, /* @__PURE__ */ o.createElement(
|
|
66
70
|
"textarea",
|
|
67
71
|
{
|
|
68
|
-
rows:
|
|
69
|
-
defaultValue:
|
|
72
|
+
rows: G,
|
|
73
|
+
defaultValue: s,
|
|
70
74
|
id: b,
|
|
71
|
-
className:
|
|
72
|
-
ref:
|
|
75
|
+
className: K,
|
|
76
|
+
ref: u,
|
|
73
77
|
"aria-describedby": a["aria-describedby"] ?? void 0,
|
|
74
78
|
"aria-invalid": !!H,
|
|
75
|
-
autoFocus:
|
|
79
|
+
autoFocus: S,
|
|
76
80
|
disabled: E,
|
|
77
|
-
name:
|
|
81
|
+
name: D,
|
|
78
82
|
autoComplete: y || void 0,
|
|
79
|
-
placeholder:
|
|
80
|
-
readOnly:
|
|
81
|
-
required:
|
|
82
|
-
onChange:
|
|
83
|
-
...
|
|
83
|
+
placeholder: F,
|
|
84
|
+
readOnly: V,
|
|
85
|
+
required: q,
|
|
86
|
+
onChange: U,
|
|
87
|
+
...z
|
|
84
88
|
}
|
|
85
89
|
)), n && /* @__PURE__ */ o.createElement(
|
|
86
90
|
ne,
|
|
87
91
|
{
|
|
88
92
|
maxCharacters: n,
|
|
89
93
|
length: v.toString().length,
|
|
90
|
-
maxText:
|
|
94
|
+
maxText: p,
|
|
91
95
|
mode: i,
|
|
92
|
-
maxWidth:
|
|
96
|
+
maxWidth: I
|
|
93
97
|
}
|
|
94
98
|
)));
|
|
95
99
|
});
|
|
96
|
-
|
|
97
|
-
const xe =
|
|
100
|
+
$.displayName = "Textarea";
|
|
101
|
+
const xe = $;
|
|
98
102
|
export {
|
|
99
103
|
xe as default
|
|
100
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX, FormMode } from '../../constants';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { renderLabel } from '../Label';\nimport MaxCharacters from '../MaxCharacters/MaxCharacters';\n\nimport styles from './styles.module.scss';\n\ninterface TextareaProps\n extends Pick<\n React.InputHTMLAttributes<HTMLTextAreaElement>,\n | 'aria-describedby'\n | 'autoFocus'\n | 'disabled'\n | 'name'\n | 'autoComplete'\n | 'placeholder'\n | 'readOnly'\n | 'required'\n | 'defaultValue'\n | 'onChange'\n > {\n /** max character limit in textarea */\n maxCharacters?: number;\n /** The text is displayed in the end of the text-counter */\n maxText?: string;\n /** Width of textarea in characters (approximate) */\n width?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** If true, the component will have a bottom margin. */\n marginBottom?: boolean;\n /** If true, the component will be transparent. */\n transparent?: boolean;\n /** Changes the visuals of the textarea */\n mode?: keyof typeof FormMode;\n /** Label of the input */\n label?: React.ReactNode;\n /** id of the textarea */\n textareaId?: string;\n /** max rows */\n maxRows?: number;\n /** min rows */\n minRows?: number;\n /** auto-grows until maxRows */\n grow?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n}\n\nconst getTextareaMaxWidth = (characters: number): string => {\n const paddingWidth = '2rem';\n const scrollbarWidth = '16px';\n const borderWidth = '4px';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth} + ${scrollbarWidth} + ${borderWidth})`;\n};\n\nconst Textarea = React.forwardRef((props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>) => {\n const {\n maxCharacters,\n maxText,\n width,\n testId,\n defaultValue,\n marginBottom: gutterBottom,\n transparent,\n mode = FormMode.onwhite,\n label,\n textareaId = uuid(),\n minRows = 3,\n maxRows = 10,\n grow,\n errorText,\n autoFocus,\n disabled,\n name,\n autoComplete,\n placeholder,\n readOnly,\n required,\n onChange,\n ...rest\n } = props;\n\n const [rows, setRows] = useState(minRows);\n const [textareaInput, setTextareaInput] = useState(defaultValue || '');\n const referanse = useRef<HTMLDivElement>(null);\n\n const resizeHeight = (target: HTMLTextAreaElement): void => {\n const textareaLineHeight = 28;\n\n const previousRows = target.rows;\n target.rows = minRows; // reset number of rows in textarea\n\n const currentRows = Math.floor((target.scrollHeight - 16) / textareaLineHeight); // scrollHeight - 16px of padding to calculate the rows\n\n if (currentRows === previousRows) {\n target.rows = currentRows;\n }\n\n if (currentRows >= maxRows) {\n target.rows = maxRows;\n target.scrollTop = target.scrollHeight;\n }\n\n if (currentRows < maxRows) {\n setRows(currentRows);\n } else {\n setRows(maxRows);\n }\n };\n\n const onDark = mode === FormMode.ondark;\n const onBlueberry = mode === FormMode.onblueberry;\n const maxCharactersExceeded = !!maxCharacters && textareaInput.toString().length > maxCharacters;\n const onError = mode === FormMode.oninvalid || !!errorText || maxCharactersExceeded;\n\n const textareaWrapperClass = cn(styles.textarea, {\n [styles['textarea--gutterBottom']]: gutterBottom,\n });\n\n const contentWrapperClass = cn(styles['input-container'], {\n [styles['input-container--transparent']]: transparent,\n [styles['input-container--on-blueberry']]: onBlueberry,\n [styles['input-container--on-dark']]: onDark,\n [styles['input-container--invalid']]: onError,\n [styles['input-container--disabled']]: props.disabled,\n });\n\n const textareaClass = cn(styles['input-container__input'], {\n [styles[`input-container__input--disabled`]]: props.disabled,\n });\n\n useEffect(() => {\n if (grow && referanse.current?.children && referanse.current?.children[0]) {\n const textarea = referanse.current?.children[0] as HTMLTextAreaElement;\n resizeHeight(textarea);\n }\n }, []);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n if (grow) {\n resizeHeight(e.target);\n }\n setTextareaInput(e.target.value);\n };\n\n const onChangeHandler = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n if (onChange) {\n onChange(e);\n }\n handleChange(e);\n };\n\n const maxWidth = width ? getTextareaMaxWidth(width) : undefined;\n\n return (\n <ErrorWrapper errorText={errorText}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Textarea} className={textareaWrapperClass}>\n {renderLabel(label, textareaId, mode as FormMode, disabled)}\n <div className={contentWrapperClass} ref={referanse} style={{ maxWidth }}>\n <textarea\n rows={rows}\n defaultValue={defaultValue}\n id={textareaId}\n className={textareaClass}\n ref={ref}\n aria-describedby={props['aria-describedby'] ?? undefined}\n aria-invalid={!!onError}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n disabled={disabled}\n name={name}\n autoComplete={autoComplete ? autoComplete : undefined}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n onChange={onChangeHandler}\n {...rest}\n />\n </div>\n {maxCharacters && (\n <MaxCharacters\n maxCharacters={maxCharacters}\n length={textareaInput.toString().length}\n maxText={maxText}\n mode={mode}\n maxWidth={maxWidth}\n />\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nTextarea.displayName = 'Textarea';\n\nexport default Textarea;\n"],"names":["getTextareaMaxWidth","characters","paddingWidth","scrollbarWidth","borderWidth","AVERAGE_CHARACTER_WIDTH_PX","Textarea","React","props","ref","maxCharacters","maxText","width","testId","defaultValue","gutterBottom","transparent","mode","FormMode","label","textareaId","uuid","minRows","maxRows","grow","errorText","autoFocus","disabled","name","autoComplete","placeholder","readOnly","required","onChange","rest","rows","setRows","useState","textareaInput","setTextareaInput","referanse","useRef","resizeHeight","target","previousRows","currentRows","onDark","onBlueberry","maxCharactersExceeded","onError","textareaWrapperClass","cn","styles","contentWrapperClass","textareaClass","useEffect","_a","_b","textarea","_c","handleChange","onChangeHandler","maxWidth","ErrorWrapper","AnalyticsId","renderLabel","MaxCharacters","Textarea$1"],"mappings":";;;;;;;;AAsDA,MAAMA,KAAsB,CAACC,MAA+B;AAC1D,QAAMC,IAAe,QACfC,IAAiB,QACjBC,IAAc;AAEb,SAAA,QAAQH,IAAaI,EAA0B,QAAQH,CAAY,MAAMC,CAAc,MAAMC,CAAW;AACjH,GAEME,IAAWC,EAAM,WAAW,CAACC,GAAsBC,MAAwC;AACzF,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAcC;AAAA,IACd,aAAAC;AAAA,IACA,MAAAC,IAAOC,EAAS;AAAA,IAChB,OAAAC;AAAA,IACA,YAAAC,IAAaC,GAAK;AAAA,IAClB,SAAAC,IAAU;AAAA,IACV,SAAAC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AAC;AAAA,MACA,cAAcC,KAA8B;AAAA,MAC5C,aAAAC;AAAA,MACA,UAAAC;AAAA,MACA,UAAAC;AAAA,MACA,UAAU6B;AAAA,MACT,GAAG3B;AAAA,IAAA;AAAA,EAAA,CAER,GACCxB,KACC,gBAAAH,EAAA;AAAA,IAAC2D;AAAA,IAAA;AAAA,MACC,eAAAxD;AAAA,MACA,QAAQ4B,EAAc,SAAA,EAAW;AAAA,MACjC,SAAA3B;AAAA,MACA,MAAAM;AAAA,MACA,UAAA6C;AAAA,IAAA;AAAA,EAGN,CAAA,CACF;AAEJ,CAAC;AAEDxD,EAAS,cAAc;AAEvB,MAAA6D,KAAe7D;"}
|
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\n\nimport cn from 'classnames';\n\nimport { AnalyticsId, AVERAGE_CHARACTER_WIDTH_PX, FormMode } from '../../constants';\nimport { uuid } from '../../utils/uuid';\nimport ErrorWrapper from '../ErrorWrapper';\nimport { renderLabel } from '../Label';\nimport MaxCharacters from '../MaxCharacters/MaxCharacters';\n\nimport styles from './styles.module.scss';\n\ninterface TextareaProps\n extends Pick<\n React.InputHTMLAttributes<HTMLTextAreaElement>,\n | 'aria-describedby'\n | 'autoFocus'\n | 'disabled'\n | 'name'\n | 'autoComplete'\n | 'placeholder'\n | 'readOnly'\n | 'required'\n | 'defaultValue'\n | 'onChange'\n > {\n /** max character limit in textarea */\n maxCharacters?: number;\n /** The text is displayed in the end of the text-counter */\n maxText?: string;\n /** Width of textarea in characters (approximate) */\n width?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** If true, the component will have a bottom margin. */\n marginBottom?: boolean;\n /** If true, the component will be transparent. */\n transparent?: boolean;\n /** Changes the visuals of the textarea */\n mode?: keyof typeof FormMode;\n /** Label of the input */\n label?: React.ReactNode;\n /** id of the textarea */\n textareaId?: string;\n /** max rows */\n maxRows?: number;\n /** min rows */\n minRows?: number;\n /** auto-grows until maxRows */\n grow?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n}\n\nconst getTextareaMaxWidth = (characters: number): string => {\n const paddingWidth = '2rem';\n const scrollbarWidth = '16px';\n const borderWidth = '4px';\n\n return `calc(${characters * AVERAGE_CHARACTER_WIDTH_PX}px + ${paddingWidth} + ${scrollbarWidth} + ${borderWidth})`;\n};\n\nconst Textarea = React.forwardRef((props: TextareaProps, ref: React.Ref<HTMLTextAreaElement>) => {\n const {\n maxCharacters,\n maxText,\n width,\n testId,\n defaultValue,\n marginBottom: gutterBottom,\n transparent,\n mode = FormMode.onwhite,\n label,\n textareaId = uuid(),\n minRows = 3,\n maxRows = 10,\n grow,\n errorText,\n autoFocus,\n disabled,\n name,\n autoComplete,\n placeholder,\n readOnly,\n required,\n onChange,\n ...rest\n } = props;\n\n const [rows, setRows] = useState(minRows);\n const [textareaInput, setTextareaInput] = useState(defaultValue || '');\n const referanse = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n setTextareaInput(defaultValue || '');\n }, [defaultValue]);\n\n const resizeHeight = (target: HTMLTextAreaElement): void => {\n const textareaLineHeight = 28;\n\n const previousRows = target.rows;\n target.rows = minRows; // reset number of rows in textarea\n\n const currentRows = Math.floor((target.scrollHeight - 16) / textareaLineHeight); // scrollHeight - 16px of padding to calculate the rows\n\n if (currentRows === previousRows) {\n target.rows = currentRows;\n }\n\n if (currentRows >= maxRows) {\n target.rows = maxRows;\n target.scrollTop = target.scrollHeight;\n }\n\n if (currentRows < maxRows) {\n setRows(currentRows);\n } else {\n setRows(maxRows);\n }\n };\n\n const onDark = mode === FormMode.ondark;\n const onBlueberry = mode === FormMode.onblueberry;\n const maxCharactersExceeded = !!maxCharacters && textareaInput.toString().length > maxCharacters;\n const onError = mode === FormMode.oninvalid || !!errorText || maxCharactersExceeded;\n\n const textareaWrapperClass = cn(styles.textarea, {\n [styles['textarea--gutterBottom']]: gutterBottom,\n });\n\n const contentWrapperClass = cn(styles['input-container'], {\n [styles['input-container--transparent']]: transparent,\n [styles['input-container--on-blueberry']]: onBlueberry,\n [styles['input-container--on-dark']]: onDark,\n [styles['input-container--invalid']]: onError,\n [styles['input-container--disabled']]: props.disabled,\n });\n\n const textareaClass = cn(styles['input-container__input'], {\n [styles[`input-container__input--disabled`]]: props.disabled,\n });\n\n useEffect(() => {\n if (grow && referanse.current?.children && referanse.current?.children[0]) {\n const textarea = referanse.current?.children[0] as HTMLTextAreaElement;\n resizeHeight(textarea);\n }\n }, []);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n if (grow) {\n resizeHeight(e.target);\n }\n setTextareaInput(e.target.value);\n };\n\n const onChangeHandler = (e: React.ChangeEvent<HTMLTextAreaElement>): void => {\n if (onChange) {\n onChange(e);\n }\n handleChange(e);\n };\n\n const maxWidth = width ? getTextareaMaxWidth(width) : undefined;\n\n return (\n <ErrorWrapper errorText={errorText}>\n <div data-testid={testId} data-analyticsid={AnalyticsId.Textarea} className={textareaWrapperClass}>\n {renderLabel(label, textareaId, mode as FormMode, disabled)}\n <div className={contentWrapperClass} ref={referanse} style={{ maxWidth }}>\n <textarea\n rows={rows}\n defaultValue={defaultValue}\n id={textareaId}\n className={textareaClass}\n ref={ref}\n aria-describedby={props['aria-describedby'] ?? undefined}\n aria-invalid={!!onError}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n disabled={disabled}\n name={name}\n autoComplete={autoComplete ? autoComplete : undefined}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n onChange={onChangeHandler}\n {...rest}\n />\n </div>\n {maxCharacters && (\n <MaxCharacters\n maxCharacters={maxCharacters}\n length={textareaInput.toString().length}\n maxText={maxText}\n mode={mode}\n maxWidth={maxWidth}\n />\n )}\n </div>\n </ErrorWrapper>\n );\n});\n\nTextarea.displayName = 'Textarea';\n\nexport default Textarea;\n"],"names":["getTextareaMaxWidth","characters","paddingWidth","scrollbarWidth","borderWidth","AVERAGE_CHARACTER_WIDTH_PX","Textarea","React","props","ref","maxCharacters","maxText","width","testId","defaultValue","gutterBottom","transparent","mode","FormMode","label","textareaId","uuid","minRows","maxRows","grow","errorText","autoFocus","disabled","name","autoComplete","placeholder","readOnly","required","onChange","rest","rows","setRows","useState","textareaInput","setTextareaInput","referanse","useRef","useEffect","resizeHeight","target","previousRows","currentRows","onDark","onBlueberry","maxCharactersExceeded","onError","textareaWrapperClass","cn","styles","contentWrapperClass","textareaClass","_a","_b","textarea","_c","handleChange","onChangeHandler","maxWidth","ErrorWrapper","AnalyticsId","renderLabel","MaxCharacters","Textarea$1"],"mappings":";;;;;;;;AAsDA,MAAMA,KAAsB,CAACC,MAA+B;AAC1D,QAAMC,IAAe,QACfC,IAAiB,QACjBC,IAAc;AAEb,SAAA,QAAQH,IAAaI,EAA0B,QAAQH,CAAY,MAAMC,CAAc,MAAMC,CAAW;AACjH,GAEME,IAAWC,EAAM,WAAW,CAACC,GAAsBC,MAAwC;AACzF,QAAA;AAAA,IACJ,eAAAC;AAAA,IACA,SAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAcC;AAAA,IACd,aAAAC;AAAA,IACA,MAAAC,IAAOC,EAAS;AAAA,IAChB,OAAAC;AAAA,IACA,YAAAC,IAAaC,GAAK;AAAA,IAClB,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,MAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EACD,IAAA1B,GAEE,CAAC2B,GAAMC,CAAO,IAAIC,EAASf,CAAO,GAClC,CAACgB,GAAeC,CAAgB,IAAIF,EAASvB,KAAgB,EAAE,GAC/D0B,IAAYC,EAAuB,IAAI;AAE7C,EA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SAAA,EAAW;AAAA,MACjC,SAAA3B;AAAA,MACA,MAAAM;AAAA,MACA,UAAA6C;AAAA,IAAA;AAAA,EAGN,CAAA,CACF;AAEJ,CAAC;AAEDxD,EAAS,cAAc;AAEvB,MAAA6D,KAAe7D;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TitleTags } from './../Title/Title';
|
|
3
3
|
interface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {
|
|
4
|
+
children?: React.ReactNode;
|
|
4
5
|
/** Adds custom classes to the element. */
|
|
5
6
|
className?: string;
|
|
6
7
|
/** Sets the icon to be displayed inside the tile. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../src/components/Tile/Tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAQ7C,UAAU,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;IACpH,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,sDAAsD;IACtD,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,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UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,yBAAyB,CAAC,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACvH,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;CAClG;AAuBD,eAAO,MAAM,IAAI,cAiDC,CAAC;AAKnB,eAAe,IAAI,CAAC"}
|
package/components/Tile/Tile.js
CHANGED
|
@@ -1,54 +1,68 @@
|
|
|
1
1
|
import t from "react";
|
|
2
|
-
import
|
|
2
|
+
import p from "classnames";
|
|
3
3
|
import { AnalyticsId as C, IconSize as R } from "../../constants.js";
|
|
4
4
|
import { useHover as k } from "../../hooks/useHover.js";
|
|
5
|
-
import { mergeRefs as
|
|
5
|
+
import { mergeRefs as x } from "../../utils/refs.js";
|
|
6
6
|
import e from "./styles.module.scss";
|
|
7
|
-
const
|
|
8
|
-
const { children:
|
|
7
|
+
const _ = t.forwardRef((s, r) => {
|
|
8
|
+
const { children: a, className: c, htmlMarkup: o = "span", highlighted: m, compact: l } = s, n = p(
|
|
9
9
|
e.tile__title,
|
|
10
10
|
{
|
|
11
|
-
[e["tile__title--highlighted"]]:
|
|
12
|
-
[e["tile__title--compact"]]:
|
|
11
|
+
[e["tile__title--highlighted"]]: m,
|
|
12
|
+
[e["tile__title--compact"]]: l
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
),
|
|
16
|
-
return /* @__PURE__ */ t.createElement(
|
|
14
|
+
c
|
|
15
|
+
), i = o;
|
|
16
|
+
return /* @__PURE__ */ t.createElement(i, { className: n, ref: r }, a);
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
const f = t.forwardRef((
|
|
20
|
-
const {
|
|
18
|
+
_.displayName = "Title";
|
|
19
|
+
const f = t.forwardRef((s, r) => {
|
|
20
|
+
const {
|
|
21
|
+
children: a,
|
|
22
|
+
icon: c,
|
|
23
|
+
title: o,
|
|
24
|
+
className: m = "",
|
|
25
|
+
description: l,
|
|
26
|
+
fixed: n = !1,
|
|
27
|
+
highlighted: i = !1,
|
|
28
|
+
testId: g,
|
|
29
|
+
target: h,
|
|
30
|
+
rel: N,
|
|
31
|
+
href: T,
|
|
32
|
+
onClick: u
|
|
33
|
+
} = s, { hoverRef: E, isHovered: v } = k(), d = !l, w = p(
|
|
21
34
|
e.tile,
|
|
22
35
|
{
|
|
23
|
-
[e["tile--fixed"]]:
|
|
24
|
-
[e["tile--compact"]]:
|
|
36
|
+
[e["tile--fixed"]]: n,
|
|
37
|
+
[e["tile--compact"]]: d,
|
|
25
38
|
[e["tile--highlighted"]]: i
|
|
26
39
|
},
|
|
27
|
-
|
|
28
|
-
), y =
|
|
29
|
-
[e["title-wrapper--compact"]]:
|
|
40
|
+
m
|
|
41
|
+
), y = p(e["title-wrapper"], {
|
|
42
|
+
[e["title-wrapper--compact"]]: d
|
|
30
43
|
});
|
|
31
44
|
return /* @__PURE__ */ t.createElement(
|
|
32
45
|
"a",
|
|
33
46
|
{
|
|
34
|
-
ref:
|
|
47
|
+
ref: x([r, E]),
|
|
35
48
|
href: T,
|
|
36
49
|
target: h,
|
|
37
50
|
rel: h === "_blank" ? "noopener noreferrer" : N,
|
|
38
51
|
className: w,
|
|
39
|
-
"data-testid":
|
|
52
|
+
"data-testid": g,
|
|
40
53
|
"data-analyticsid": C.Tile,
|
|
41
|
-
onClick:
|
|
54
|
+
onClick: u
|
|
42
55
|
},
|
|
43
|
-
/* @__PURE__ */ t.createElement("div", { className: y }, t.cloneElement(
|
|
44
|
-
l && /* @__PURE__ */ t.createElement("p", { className: e.tile__description }, l)
|
|
56
|
+
/* @__PURE__ */ t.createElement("div", { className: y }, t.cloneElement(c, { size: R.Medium, isHovered: v, color: i ? "white" : "black" }), t.cloneElement(o, { highlighted: i, compact: d })),
|
|
57
|
+
l && /* @__PURE__ */ t.createElement("p", { className: e.tile__description }, l),
|
|
58
|
+
a && /* @__PURE__ */ t.createElement("div", { className: e.tile__children }, a)
|
|
45
59
|
);
|
|
46
60
|
});
|
|
47
61
|
f.displayName = "Tile";
|
|
48
|
-
f.Title =
|
|
49
|
-
const
|
|
62
|
+
f.Title = _;
|
|
63
|
+
const A = f;
|
|
50
64
|
export {
|
|
51
65
|
f as Tile,
|
|
52
|
-
|
|
66
|
+
A as default
|
|
53
67
|
};
|
|
54
68
|
//# sourceMappingURL=Tile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.js","sources":["../../../src/components/Tile/Tile.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { TitleTags } from './../Title/Title';\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { mergeRefs } from '../../utils/refs';\nimport { IconSize } from '../Icon';\n\nimport tileStyles from './styles.module.scss';\n\ninterface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {\n /** Adds custom classes to the element. */\n className?: string;\n /**\tSets the icon to be displayed inside the tile. */\n icon: React.ReactElement;\n /**\tSets the title to be displayed inside the tile. */\n title: React.ReactElement;\n /** Toggles the highlighted style of the tile. */\n highlighted?: boolean;\n /** Sets the description to be displayed inside the tile. */\n description?: string;\n /** Sets a fixed max and min width for the tile. */\n fixed?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface TileTitleProps {\n children: React.ReactNode;\n className?: string;\n htmlMarkup?: TitleTags;\n highlighted?: boolean;\n compact?: boolean;\n}\n\nexport interface TileCompound extends React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLAnchorElement>> {\n Title: React.ForwardRefExoticComponent<TileTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n}\n\nconst Title = React.forwardRef<HTMLHeadingElement, TileTitleProps>((props, ref) => {\n const { children, className, htmlMarkup = 'span', highlighted, compact } = props;\n const titleClasses = classNames(\n tileStyles['tile__title'],\n {\n [tileStyles['tile__title--highlighted']]: highlighted,\n [tileStyles['tile__title--compact']]: compact,\n },\n className\n );\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={titleClasses} ref={ref}>\n {children}\n </CustomTag>\n );\n});\n\nTitle.displayName = 'Title';\n\nexport const Tile = React.forwardRef<HTMLAnchorElement, TileProps>((props, ref) => {\n const {
|
|
1
|
+
{"version":3,"file":"Tile.js","sources":["../../../src/components/Tile/Tile.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { TitleTags } from './../Title/Title';\nimport { AnalyticsId } from '../../constants';\nimport { useHover } from '../../hooks/useHover';\nimport { mergeRefs } from '../../utils/refs';\nimport { IconSize } from '../Icon';\n\nimport tileStyles from './styles.module.scss';\n\ninterface TileProps extends Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'target' | 'onClick' | 'rel'> {\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /**\tSets the icon to be displayed inside the tile. */\n icon: React.ReactElement;\n /**\tSets the title to be displayed inside the tile. */\n title: React.ReactElement;\n /** Toggles the highlighted style of the tile. */\n highlighted?: boolean;\n /** Sets the description to be displayed inside the tile. */\n description?: string;\n /** Sets a fixed max and min width for the tile. */\n fixed?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\ninterface TileTitleProps {\n children: React.ReactNode;\n className?: string;\n htmlMarkup?: TitleTags;\n highlighted?: boolean;\n compact?: boolean;\n}\n\nexport interface TileCompound extends React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLAnchorElement>> {\n Title: React.ForwardRefExoticComponent<TileTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n}\n\nconst Title = React.forwardRef<HTMLHeadingElement, TileTitleProps>((props, ref) => {\n const { children, className, htmlMarkup = 'span', highlighted, compact } = props;\n const titleClasses = classNames(\n tileStyles['tile__title'],\n {\n [tileStyles['tile__title--highlighted']]: highlighted,\n [tileStyles['tile__title--compact']]: compact,\n },\n className\n );\n const CustomTag = htmlMarkup;\n\n return (\n <CustomTag className={titleClasses} ref={ref}>\n {children}\n </CustomTag>\n );\n});\n\nTitle.displayName = 'Title';\n\nexport const Tile = React.forwardRef<HTMLAnchorElement, TileProps>((props, ref) => {\n const {\n children,\n icon,\n title,\n className = '',\n description,\n fixed = false,\n highlighted = false,\n testId,\n target,\n rel,\n href,\n onClick,\n } = props;\n const { hoverRef, isHovered } = useHover<HTMLAnchorElement>();\n const compact = !description;\n const tileClasses = classNames(\n tileStyles.tile,\n {\n [tileStyles['tile--fixed']]: fixed,\n [tileStyles['tile--compact']]: compact,\n [tileStyles['tile--highlighted']]: highlighted,\n },\n className\n );\n const tileTitleWrapperClasses = classNames(tileStyles['title-wrapper'], {\n [tileStyles['title-wrapper--compact']]: compact,\n });\n\n return (\n <a\n ref={mergeRefs([ref, hoverRef])}\n href={href}\n target={target}\n rel={target === '_blank' ? 'noopener noreferrer' : rel}\n className={tileClasses}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Tile}\n onClick={onClick}\n >\n <div className={tileTitleWrapperClasses}>\n {React.cloneElement(icon, { size: IconSize.Medium, isHovered, color: highlighted ? 'white' : 'black' })}\n {React.cloneElement(title, { highlighted: highlighted, compact: compact })}\n </div>\n {description && <p className={tileStyles.tile__description}>{description}</p>}\n {children && <div className={tileStyles.tile__children}>{children}</div>}\n </a>\n );\n}) as TileCompound;\n\nTile.displayName = 'Tile';\nTile.Title = Title;\n\nexport default Tile;\n"],"names":["Title","React","props","ref","children","className","htmlMarkup","highlighted","compact","titleClasses","classNames","tileStyles","CustomTag","Tile","icon","title","description","fixed","testId","target","rel","href","onClick","hoverRef","isHovered","useHover","tileClasses","tileTitleWrapperClasses","mergeRefs","AnalyticsId","IconSize","Tile$1"],"mappings":";;;;;;AA0CA,MAAM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