@helsenorge/designsystem-react 8.4.0 → 8.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnchorLink.js +60 -0
- package/AnchorLink.js.map +1 -0
- package/Avatar.js +34 -0
- package/Avatar.js.map +1 -0
- package/Badge.js +31 -0
- package/Badge.js.map +1 -0
- package/Button.js +130 -0
- package/Button.js.map +1 -0
- package/CHANGELOG.md +28 -3
- package/Checkbox.js +113 -0
- package/Checkbox.js.map +1 -0
- package/Close.js +31 -0
- package/Close.js.map +1 -0
- package/ErrorBoundary.js +35 -0
- package/ErrorBoundary.js.map +1 -0
- package/ErrorWrapper.js +14 -0
- package/ErrorWrapper.js.map +1 -0
- package/Expander.js +108 -0
- package/Expander.js.map +1 -0
- package/FormGroup.js +113 -0
- package/FormGroup.js.map +1 -0
- package/FormLayout.js +38 -0
- package/FormLayout.js.map +1 -0
- package/HelpBubble.js +68 -0
- package/HelpBubble.js.map +1 -0
- package/HighlightPanel.js +71 -0
- package/HighlightPanel.js.map +1 -0
- package/HorizontalScroll.js +49 -0
- package/HorizontalScroll.js.map +1 -0
- package/Icon.js +62 -0
- package/Icon.js.map +1 -0
- package/Illustration.js +41 -0
- package/Illustration.js.map +1 -0
- package/Input.js +140 -0
- package/Input.js.map +1 -0
- package/Label.js +108 -0
- package/Label.js.map +1 -0
- package/LazyIcon.js +30 -0
- package/LazyIcon.js.map +1 -0
- package/LazyIllustration.js +34 -0
- package/LazyIllustration.js.map +1 -0
- package/LinkList.js +63 -0
- package/LinkList.js.map +1 -0
- package/List.js +13 -0
- package/List.js.map +1 -0
- package/ListHeader.js +94 -0
- package/ListHeader.js.map +1 -0
- package/ListHeaderText.js +35 -0
- package/ListHeaderText.js.map +1 -0
- package/MaxCharacters.js +15 -0
- package/MaxCharacters.js.map +1 -0
- package/NotificationBadge.js +68 -0
- package/NotificationBadge.js.map +1 -0
- package/Panel.js +255 -0
- package/Panel.js.map +1 -0
- package/PopOver.js +85 -0
- package/PopOver.js.map +1 -0
- package/RadioButton.js +104 -0
- package/RadioButton.js.map +1 -0
- package/Select.js +76 -0
- package/Select.js.map +1 -0
- package/{components/Spacer/Spacer.js → Spacer.js} +10 -9
- package/Spacer.js.map +1 -0
- package/StatusDot.js +33 -0
- package/StatusDot.js.map +1 -0
- package/StepButtons.js +28 -0
- package/StepButtons.js.map +1 -0
- package/TabList.js +68 -0
- package/TabList.js.map +1 -0
- package/TabPanel.js +18 -0
- package/TabPanel.js.map +1 -0
- package/Table.js +98 -0
- package/Table.js.map +1 -0
- package/TableBody.js +13 -0
- package/TableBody.js.map +1 -0
- package/{components/Table/TableCell/TableCell.js → TableCell.js} +12 -13
- package/TableCell.js.map +1 -0
- package/TableExpandedRow.js +37 -0
- package/TableExpandedRow.js.map +1 -0
- package/TableExpanderCell.js +34 -0
- package/TableExpanderCell.js.map +1 -0
- package/TableHead.js +24 -0
- package/TableHead.js.map +1 -0
- package/TableHeadCell.js +44 -0
- package/TableHeadCell.js.map +1 -0
- package/TableRow.js +62 -0
- package/TableRow.js.map +1 -0
- package/Textarea.js +110 -0
- package/Textarea.js.map +1 -0
- package/Title.js +25 -0
- package/Title.js.map +1 -0
- package/TooltipWord.js +28 -0
- package/TooltipWord.js.map +1 -0
- package/Trigger.js +73 -0
- package/Trigger.js.map +1 -0
- package/__mocks__/matchMedia.js +1 -0
- package/__mocks__/matchMedia.js.map +1 -1
- package/__mocks__/uuid.js +1 -1
- package/components/AnchorLink/index.js +1 -1
- package/components/Avatar/index.js +3 -3
- package/components/Badge/index.js +1 -1
- package/components/Button/index.js +1 -1
- package/components/Checkbox/index.js +3 -3
- package/components/Chip/index.js +30 -6
- package/components/Chip/index.js.map +1 -1
- package/components/Close/index.js +2 -2
- package/components/DictionaryTrigger/index.js +25 -2
- package/components/DictionaryTrigger/index.js.map +1 -1
- package/components/Dropdown/index.js +124 -4
- package/components/Dropdown/index.js.map +1 -1
- package/components/Duolist/index.js +70 -5
- package/components/Duolist/index.js.map +1 -1
- package/components/EmptyState/index.js +159 -2
- package/components/EmptyState/index.js.map +1 -1
- package/components/ErrorWrapper/index.js +3 -3
- package/components/Expander/index.js +4 -4
- package/components/ExpanderHierarchy/index.js +102 -2
- package/components/ExpanderHierarchy/index.js.map +1 -1
- package/components/ExpanderList/index.js +139 -3
- package/components/ExpanderList/index.js.map +1 -1
- package/components/EyebrowHeader/index.js +9 -2
- package/components/EyebrowHeader/index.js.map +1 -1
- package/components/FormGroup/index.js +1 -1
- package/components/FormLayout/index.js +5 -5
- package/components/HelpBubble/index.js +4 -4
- package/components/HelpPanel/index.js +21 -2
- package/components/HelpPanel/index.js.map +1 -1
- package/components/HelpQuestion/index.js +31 -2
- package/components/HelpQuestion/index.js.map +1 -1
- package/components/HighlightPanel/index.js +4 -4
- package/components/HorizontalScroll/index.js +1 -1
- package/components/Icon/index.js +5 -5
- package/components/Icons/ActiveMonitoring.js +4 -4
- package/components/Icons/ActiveMonitoring.js.map +1 -1
- package/components/Icons/AcupunctureBack.js +6 -6
- package/components/Icons/AcupunctureBack.js.map +1 -1
- package/components/Icons/AlarmClock.js +15 -5
- package/components/Icons/AlarmClock.js.map +1 -1
- package/components/Icons/AlertSignFill.js +4 -4
- package/components/Icons/AlertSignFill.js.map +1 -1
- package/components/Icons/AlertSignStroke.js +4 -4
- package/components/Icons/AlertSignStroke.js.map +1 -1
- package/components/Icons/Amputation.js +3 -3
- package/components/Icons/Amputation.js.map +1 -1
- package/components/Icons/Anxiety.js +3 -3
- package/components/Icons/Anxiety.js.map +1 -1
- package/components/Icons/Apple.js +3 -3
- package/components/Icons/Apple.js.map +1 -1
- package/components/Icons/Archive.js +7 -7
- 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 +7 -7
- package/components/Icons/ArrowDown.js.map +1 -1
- package/components/Icons/ArrowLeft.js +3 -3
- package/components/Icons/ArrowLeft.js.map +1 -1
- package/components/Icons/ArrowRight.js +3 -3
- package/components/Icons/ArrowRight.js.map +1 -1
- package/components/Icons/ArrowUp.js +7 -7
- package/components/Icons/ArrowUp.js.map +1 -1
- package/components/Icons/ArrowUpRight.js +4 -4
- package/components/Icons/ArrowUpRight.js.map +1 -1
- package/components/Icons/Attachment.js +4 -4
- package/components/Icons/Attachment.js.map +1 -1
- package/components/Icons/Atv.js +3 -3
- package/components/Icons/Atv.js.map +1 -1
- package/components/Icons/Avatar.js +4 -4
- package/components/Icons/Avatar.js.map +1 -1
- package/components/Icons/AwakePersonOnPillow.js +2 -2
- package/components/Icons/AwakePersonOnPillow.js.map +1 -1
- package/components/Icons/Baby.js +3 -3
- package/components/Icons/Baby.js.map +1 -1
- package/components/Icons/BandAid.js +3 -3
- package/components/Icons/BandAid.js.map +1 -1
- package/components/Icons/BeerAndPills.js +3 -3
- package/components/Icons/BeerAndPills.js.map +1 -1
- package/components/Icons/Bell.js +3 -3
- package/components/Icons/Bell.js.map +1 -1
- package/components/Icons/Bike.js +3 -3
- package/components/Icons/Bike.js.map +1 -1
- package/components/Icons/BirthControl.js +4 -4
- 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 +3 -3
- package/components/Icons/Boat.js.map +1 -1
- package/components/Icons/Body.js +4 -4
- package/components/Icons/Body.js.map +1 -1
- package/components/Icons/Braille.js +4 -4
- package/components/Icons/Braille.js.map +1 -1
- package/components/Icons/Brain.js +3 -3
- package/components/Icons/Brain.js.map +1 -1
- package/components/Icons/BreastReconstruction.js +4 -4
- package/components/Icons/BreastReconstruction.js.map +1 -1
- package/components/Icons/BreastRemoval.js +4 -4
- package/components/Icons/BreastRemoval.js.map +1 -1
- package/components/Icons/Breasts.js +2 -2
- package/components/Icons/Breasts.js.map +1 -1
- package/components/Icons/BrokenHeart.js +3 -3
- package/components/Icons/BrokenHeart.js.map +1 -1
- package/components/Icons/BrokenPuzzle.js +3 -3
- package/components/Icons/BrokenPuzzle.js.map +1 -1
- package/components/Icons/Bus.js +13 -6
- package/components/Icons/Bus.js.map +1 -1
- package/components/Icons/Calendar.js +6 -6
- package/components/Icons/Calendar.js.map +1 -1
- package/components/Icons/CalendarChange.js +7 -7
- package/components/Icons/CalendarChange.js.map +1 -1
- package/components/Icons/CalendarCheck.js +7 -7
- package/components/Icons/CalendarCheck.js.map +1 -1
- package/components/Icons/CalendarEvent.js +3 -3
- package/components/Icons/CalendarEvent.js.map +1 -1
- package/components/Icons/CalendarSave.js +4 -4
- package/components/Icons/CalendarSave.js.map +1 -1
- package/components/Icons/Cancer.js +17 -3
- package/components/Icons/Cancer.js.map +1 -1
- package/components/Icons/Candle.js +5 -5
- package/components/Icons/Candle.js.map +1 -1
- package/components/Icons/Car.js +2 -2
- package/components/Icons/Car.js.map +1 -1
- package/components/Icons/Carton.js +19 -14
- package/components/Icons/Carton.js.map +1 -1
- package/components/Icons/Change.js +14 -8
- package/components/Icons/Change.js.map +1 -1
- package/components/Icons/Check.js +4 -4
- package/components/Icons/Check.js.map +1 -1
- package/components/Icons/CheckFill.js +7 -7
- package/components/Icons/CheckFill.js.map +1 -1
- package/components/Icons/CheckOutline.js +4 -4
- package/components/Icons/CheckOutline.js.map +1 -1
- package/components/Icons/Chest.js +2 -2
- package/components/Icons/Chest.js.map +1 -1
- package/components/Icons/ChevronDown.js +3 -3
- package/components/Icons/ChevronDown.js.map +1 -1
- package/components/Icons/ChevronLeft.js +3 -3
- package/components/Icons/ChevronLeft.js.map +1 -1
- package/components/Icons/ChevronRight.js +3 -3
- package/components/Icons/ChevronRight.js.map +1 -1
- package/components/Icons/ChevronUp.js +3 -3
- package/components/Icons/ChevronUp.js.map +1 -1
- package/components/Icons/ChevronsDown.js +6 -6
- package/components/Icons/ChevronsDown.js.map +1 -1
- package/components/Icons/ChevronsUp.js +7 -7
- package/components/Icons/ChevronsUp.js.map +1 -1
- package/components/Icons/ChildPlaying.js +9 -3
- package/components/Icons/ChildPlaying.js.map +1 -1
- package/components/Icons/Cigarette.js +3 -3
- package/components/Icons/Cigarette.js.map +1 -1
- package/components/Icons/Coins.js +4 -4
- package/components/Icons/Coins.js.map +1 -1
- package/components/Icons/Contacts.js +4 -4
- package/components/Icons/Contacts.js.map +1 -1
- package/components/Icons/Copy.js +15 -4
- package/components/Icons/Copy.js.map +1 -1
- package/components/Icons/CoronaCertificate.js +3 -3
- package/components/Icons/CoronaCertificate.js.map +1 -1
- package/components/Icons/Coronavirus.js +3 -3
- package/components/Icons/Coronavirus.js.map +1 -1
- package/components/Icons/Cough.js +3 -3
- package/components/Icons/Cough.js.map +1 -1
- package/components/Icons/CreditCard.js +33 -10
- package/components/Icons/CreditCard.js.map +1 -1
- package/components/Icons/CriticalHealthInfo.js +3 -3
- package/components/Icons/CriticalHealthInfo.js.map +1 -1
- package/components/Icons/Cross.js +3 -3
- package/components/Icons/Cross.js.map +1 -1
- package/components/Icons/DataExchange.js +4 -4
- package/components/Icons/DataExchange.js.map +1 -1
- package/components/Icons/DataReceived.js +4 -4
- package/components/Icons/DataReceived.js.map +1 -1
- package/components/Icons/DataSent.js +4 -4
- package/components/Icons/DataSent.js.map +1 -1
- package/components/Icons/Depression.js +3 -3
- package/components/Icons/Depression.js.map +1 -1
- package/components/Icons/DigestiveSystem.js +9 -3
- package/components/Icons/DigestiveSystem.js.map +1 -1
- package/components/Icons/Dizzy.js +3 -3
- package/components/Icons/Dizzy.js.map +1 -1
- package/components/Icons/Documents.js +3 -3
- package/components/Icons/Documents.js.map +1 -1
- package/components/Icons/Dog.js +3 -3
- package/components/Icons/Dog.js.map +1 -1
- package/components/Icons/DonorCard.js +3 -3
- package/components/Icons/DonorCard.js.map +1 -1
- package/components/Icons/Download.js +7 -7
- package/components/Icons/Download.js.map +1 -1
- package/components/Icons/Draft.js +3 -3
- package/components/Icons/Draft.js.map +1 -1
- package/components/Icons/EChat.js +4 -4
- package/components/Icons/EChat.js.map +1 -1
- package/components/Icons/Ear.js +10 -7
- package/components/Icons/Ear.js.map +1 -1
- package/components/Icons/EarDeaf.js +4 -4
- package/components/Icons/EarDeaf.js.map +1 -1
- package/components/Icons/EarHearingAid.js +7 -7
- package/components/Icons/EarHearingAid.js.map +1 -1
- package/components/Icons/EarNoseThroat.js +11 -3
- package/components/Icons/EarNoseThroat.js.map +1 -1
- package/components/Icons/EarVolume.js +13 -8
- package/components/Icons/EarVolume.js.map +1 -1
- package/components/Icons/ElderlyPerson.js +2 -2
- package/components/Icons/ElderlyPerson.js.map +1 -1
- package/components/Icons/Embolization.js +4 -4
- package/components/Icons/Embolization.js.map +1 -1
- package/components/Icons/EmergencyCall.js +5 -5
- package/components/Icons/EmergencyCall.js.map +1 -1
- package/components/Icons/EmoticonAnnoyed.js +12 -8
- package/components/Icons/EmoticonAnnoyed.js.map +1 -1
- package/components/Icons/EmoticonDelighted.js +10 -7
- package/components/Icons/EmoticonDelighted.js.map +1 -1
- package/components/Icons/EmoticonDisappointed.js +10 -7
- package/components/Icons/EmoticonDisappointed.js.map +1 -1
- package/components/Icons/EmoticonHappy.js +10 -7
- package/components/Icons/EmoticonHappy.js.map +1 -1
- package/components/Icons/EmoticonMeh.js +10 -7
- package/components/Icons/EmoticonMeh.js.map +1 -1
- package/components/Icons/EnterFullScreen.js +13 -4
- package/components/Icons/EnterFullScreen.js.map +1 -1
- package/components/Icons/Envelope.js +4 -4
- package/components/Icons/Envelope.js.map +1 -1
- package/components/Icons/Epilepsy.js +3 -3
- package/components/Icons/Epilepsy.js.map +1 -1
- package/components/Icons/Eraser.js +10 -4
- package/components/Icons/Eraser.js.map +1 -1
- package/components/Icons/ErrorSignFill.js +4 -4
- package/components/Icons/ErrorSignFill.js.map +1 -1
- package/components/Icons/ErrorSignStroke.js +4 -4
- package/components/Icons/ErrorSignStroke.js.map +1 -1
- package/components/Icons/EuropeanHealthCard.js +6 -3
- package/components/Icons/EuropeanHealthCard.js.map +1 -1
- package/components/Icons/ExitFullScreen.js +13 -4
- package/components/Icons/ExitFullScreen.js.map +1 -1
- package/components/Icons/Eye.js +12 -4
- package/components/Icons/Eye.js.map +1 -1
- package/components/Icons/Facebook.js +3 -3
- package/components/Icons/Facebook.js.map +1 -1
- package/components/Icons/FallingLeaf.js +14 -9
- package/components/Icons/FallingLeaf.js.map +1 -1
- package/components/Icons/Female.js +3 -3
- package/components/Icons/Female.js.map +1 -1
- package/components/Icons/FemaleDoctor.js +2 -2
- package/components/Icons/FemaleDoctor.js.map +1 -1
- package/components/Icons/Ferry.js +3 -3
- package/components/Icons/Ferry.js.map +1 -1
- package/components/Icons/File.js +6 -6
- package/components/Icons/File.js.map +1 -1
- package/components/Icons/Filter.js +5 -5
- package/components/Icons/Filter.js.map +1 -1
- package/components/Icons/FingerBleed.js +3 -3
- package/components/Icons/FingerBleed.js.map +1 -1
- package/components/Icons/FirstAidKit.js +3 -3
- package/components/Icons/FirstAidKit.js.map +1 -1
- package/components/Icons/Fish.js +21 -14
- package/components/Icons/Fish.js.map +1 -1
- package/components/Icons/FloppyDisk.js +4 -4
- package/components/Icons/FloppyDisk.js.map +1 -1
- package/components/Icons/Football.js +3 -3
- package/components/Icons/Football.js.map +1 -1
- package/components/Icons/Form.js +4 -4
- package/components/Icons/Form.js.map +1 -1
- package/components/Icons/Forward.js +10 -4
- package/components/Icons/Forward.js.map +1 -1
- package/components/Icons/Gallery.js +7 -7
- package/components/Icons/Gallery.js.map +1 -1
- package/components/Icons/Garden.js +3 -3
- package/components/Icons/Garden.js.map +1 -1
- package/components/Icons/GasCan.js +3 -3
- package/components/Icons/GasCan.js.map +1 -1
- package/components/Icons/GenderIdentity.js +4 -4
- package/components/Icons/GenderIdentity.js.map +1 -1
- package/components/Icons/GlassWater.js +3 -3
- package/components/Icons/GlassWater.js.map +1 -1
- package/components/Icons/Glasses.js +4 -4
- package/components/Icons/Glasses.js.map +1 -1
- package/components/Icons/Globe.js +4 -4
- package/components/Icons/Globe.js.map +1 -1
- package/components/Icons/Grain.js +3 -3
- package/components/Icons/Grain.js.map +1 -1
- package/components/Icons/Graph.js +12 -9
- package/components/Icons/Graph.js.map +1 -1
- package/components/Icons/Group.js +8 -8
- package/components/Icons/Group.js.map +1 -1
- package/components/Icons/GroupTwins.js +35 -21
- package/components/Icons/GroupTwins.js.map +1 -1
- package/components/Icons/HTMLFile.js +10 -7
- package/components/Icons/HTMLFile.js.map +1 -1
- package/components/Icons/HandWaving.js +3 -3
- package/components/Icons/HandWaving.js.map +1 -1
- package/components/Icons/HandWithDisease.js +3 -3
- package/components/Icons/HandWithDisease.js.map +1 -1
- package/components/Icons/HandsAndHeart.js +5 -5
- package/components/Icons/HandsAndHeart.js.map +1 -1
- package/components/Icons/HealthClinic.js +4 -4
- package/components/Icons/HealthClinic.js.map +1 -1
- package/components/Icons/HealthWarning.js +4 -4
- package/components/Icons/HealthWarning.js.map +1 -1
- package/components/Icons/HealthcarePerson.js +27 -14
- package/components/Icons/HealthcarePerson.js.map +1 -1
- package/components/Icons/HealthcarePersonell.js +36 -18
- package/components/Icons/HealthcarePersonell.js.map +1 -1
- package/components/Icons/HearingProtection.js +12 -9
- package/components/Icons/HearingProtection.js.map +1 -1
- package/components/Icons/Heart.js +4 -4
- package/components/Icons/Heart.js.map +1 -1
- package/components/Icons/HeartHands.js +29 -22
- package/components/Icons/HeartHands.js.map +1 -1
- package/components/Icons/HelpSign.js +4 -4
- package/components/Icons/HelpSign.js.map +1 -1
- package/components/Icons/HelpingHand.js +3 -3
- package/components/Icons/HelpingHand.js.map +1 -1
- package/components/Icons/Hemodialysis.js +3 -3
- 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 +4 -4
- package/components/Icons/Hipprosthesis.js.map +1 -1
- package/components/Icons/History.js +4 -4
- package/components/Icons/History.js.map +1 -1
- package/components/Icons/HivAndAids.js +3 -3
- package/components/Icons/HivAndAids.js.map +1 -1
- package/components/Icons/Home.js +7 -7
- package/components/Icons/Home.js.map +1 -1
- package/components/Icons/Hormone.js +3 -3
- package/components/Icons/Hormone.js.map +1 -1
- package/components/Icons/Hospital.js +7 -7
- package/components/Icons/Hospital.js.map +1 -1
- package/components/Icons/Hourglass.js +7 -7
- package/components/Icons/Hourglass.js.map +1 -1
- package/components/Icons/ImgFile.js +4 -4
- package/components/Icons/ImgFile.js.map +1 -1
- package/components/Icons/Inbox.js +6 -3
- package/components/Icons/Inbox.js.map +1 -1
- package/components/Icons/InfoSignFill.js +4 -4
- package/components/Icons/InfoSignFill.js.map +1 -1
- package/components/Icons/InfoSignStroke.js +4 -4
- package/components/Icons/InfoSignStroke.js.map +1 -1
- package/components/Icons/Instagram.js +9 -2
- package/components/Icons/Instagram.js.map +1 -1
- package/components/Icons/Intravenous.js +4 -4
- package/components/Icons/Intravenous.js.map +1 -1
- package/components/Icons/JointPain.js +3 -3
- package/components/Icons/JointPain.js.map +1 -1
- package/components/Icons/Journal.js +4 -4
- package/components/Icons/Journal.js.map +1 -1
- package/components/Icons/JpgFile.js +4 -4
- package/components/Icons/JpgFile.js.map +1 -1
- package/components/Icons/Kidney.js +3 -3
- package/components/Icons/Kidney.js.map +1 -1
- package/components/Icons/KitchenScale.js +4 -4
- package/components/Icons/KitchenScale.js.map +1 -1
- package/components/Icons/Kjernejournal.js +3 -3
- package/components/Icons/Kjernejournal.js.map +1 -1
- package/components/Icons/Laboratory.js +4 -4
- package/components/Icons/Laboratory.js.map +1 -1
- package/components/Icons/LaptopBlog.js +3 -3
- package/components/Icons/LaptopBlog.js.map +1 -1
- package/components/Icons/LawBook.js +6 -3
- package/components/Icons/LawBook.js.map +1 -1
- package/components/Icons/LegalDocument.js +13 -10
- package/components/Icons/LegalDocument.js.map +1 -1
- package/components/Icons/LightBulb.js +2 -2
- package/components/Icons/LightBulb.js.map +1 -1
- package/components/Icons/List.js +7 -7
- package/components/Icons/List.js.map +1 -1
- package/components/Icons/Location.js +6 -3
- package/components/Icons/Location.js.map +1 -1
- package/components/Icons/Lock.js +4 -4
- package/components/Icons/Lock.js.map +1 -1
- package/components/Icons/Login.js +20 -11
- package/components/Icons/Login.js.map +1 -1
- package/components/Icons/Logout.js +20 -11
- package/components/Icons/Logout.js.map +1 -1
- package/components/Icons/Lungs.js +3 -3
- package/components/Icons/Lungs.js.map +1 -1
- package/components/Icons/Makeup.js +2 -2
- package/components/Icons/Makeup.js.map +1 -1
- package/components/Icons/MaleDoctor.js +2 -2
- package/components/Icons/MaleDoctor.js.map +1 -1
- package/components/Icons/MaleDoctorAndPerson.js +11 -3
- package/components/Icons/MaleDoctorAndPerson.js.map +1 -1
- package/components/Icons/MaleGenitalia.js +2 -2
- package/components/Icons/MaleGenitalia.js.map +1 -1
- package/components/Icons/Medicine.js +6 -6
- package/components/Icons/Medicine.js.map +1 -1
- package/components/Icons/MedicineWarning.js +4 -4
- package/components/Icons/MedicineWarning.js.map +1 -1
- package/components/Icons/MentalHealthAdult.js +9 -3
- package/components/Icons/MentalHealthAdult.js.map +1 -1
- package/components/Icons/MentalHealthChild.js +9 -3
- package/components/Icons/MentalHealthChild.js.map +1 -1
- package/components/Icons/Menu.js +4 -4
- package/components/Icons/Menu.js.map +1 -1
- package/components/Icons/Microscope.js +4 -4
- package/components/Icons/Microscope.js.map +1 -1
- package/components/Icons/Minus.js +3 -3
- package/components/Icons/Minus.js.map +1 -1
- package/components/Icons/Mirror.js +3 -3
- package/components/Icons/Mirror.js.map +1 -1
- package/components/Icons/MobilePhone.js +4 -4
- package/components/Icons/MobilePhone.js.map +1 -1
- package/components/Icons/MotherHoldingBaby.js +2 -2
- package/components/Icons/MotherHoldingBaby.js.map +1 -1
- package/components/Icons/MuscleBack.js +11 -3
- package/components/Icons/MuscleBack.js.map +1 -1
- package/components/Icons/MuscleLeg.js +9 -3
- package/components/Icons/MuscleLeg.js.map +1 -1
- package/components/Icons/Mushroom.js +3 -3
- package/components/Icons/Mushroom.js.map +1 -1
- package/components/Icons/Music.js +3 -3
- package/components/Icons/Music.js.map +1 -1
- package/components/Icons/MusselsAndSalt.js +2 -2
- package/components/Icons/MusselsAndSalt.js.map +1 -1
- package/components/Icons/NoAccess.js +20 -17
- package/components/Icons/NoAccess.js.map +1 -1
- package/components/Icons/NoEye.js +9 -9
- package/components/Icons/NoEye.js.map +1 -1
- package/components/Icons/NoFilter.js +10 -4
- package/components/Icons/NoFilter.js.map +1 -1
- package/components/Icons/Notepad.js +2 -2
- package/components/Icons/Notepad.js.map +1 -1
- package/components/Icons/Osteotomy.js +4 -4
- package/components/Icons/Osteotomy.js.map +1 -1
- package/components/Icons/PaintRoller.js +3 -3
- package/components/Icons/PaintRoller.js.map +1 -1
- package/components/Icons/PaperPlane.js +4 -4
- package/components/Icons/PaperPlane.js.map +1 -1
- package/components/Icons/PatientAndPerson.js +2 -2
- package/components/Icons/PatientAndPerson.js.map +1 -1
- package/components/Icons/Pause.js +4 -4
- package/components/Icons/Pause.js.map +1 -1
- package/components/Icons/PdfFile.js +4 -4
- package/components/Icons/PdfFile.js.map +1 -1
- package/components/Icons/Pencil.js +4 -4
- package/components/Icons/Pencil.js.map +1 -1
- package/components/Icons/PeopleTalking.js +3 -3
- package/components/Icons/PeopleTalking.js.map +1 -1
- package/components/Icons/Peritonealdialysis.js +4 -4
- package/components/Icons/Peritonealdialysis.js.map +1 -1
- package/components/Icons/Person.js +2 -2
- package/components/Icons/Person.js.map +1 -1
- package/components/Icons/PersonAndPatient.js +2 -2
- package/components/Icons/PersonAndPatient.js.map +1 -1
- package/components/Icons/PersonCancel.js +28 -19
- package/components/Icons/PersonCancel.js.map +1 -1
- package/components/Icons/PersonInXRayMachine.js +4 -4
- package/components/Icons/PersonInXRayMachine.js.map +1 -1
- package/components/Icons/PersonOverweight.js +3 -3
- package/components/Icons/PersonOverweight.js.map +1 -1
- package/components/Icons/PersonRelaxing.js +9 -3
- package/components/Icons/PersonRelaxing.js.map +1 -1
- package/components/Icons/PersonWithBrain.js +6 -3
- package/components/Icons/PersonWithBrain.js.map +1 -1
- package/components/Icons/PersonWithBrokenArm.js +3 -3
- package/components/Icons/PersonWithBrokenArm.js.map +1 -1
- package/components/Icons/PersonWithCrutches.js +3 -3
- package/components/Icons/PersonWithCrutches.js.map +1 -1
- package/components/Icons/PersonWithJaw.js +9 -3
- package/components/Icons/PersonWithJaw.js.map +1 -1
- package/components/Icons/PersonWithMagnifyingGlass.js +8 -2
- package/components/Icons/PersonWithMagnifyingGlass.js.map +1 -1
- package/components/Icons/PersonWithSenses.js +15 -3
- package/components/Icons/PersonWithSenses.js.map +1 -1
- package/components/Icons/PersonWorking.js +9 -3
- package/components/Icons/PersonWorking.js.map +1 -1
- package/components/Icons/PersonalPlan.js +14 -11
- package/components/Icons/PersonalPlan.js.map +1 -1
- package/components/Icons/PizzaSlice.js +8 -2
- package/components/Icons/PizzaSlice.js.map +1 -1
- package/components/Icons/Plane.js +3 -3
- package/components/Icons/Plane.js.map +1 -1
- package/components/Icons/Plant.js +3 -3
- package/components/Icons/Plant.js.map +1 -1
- package/components/Icons/PlateKnifeFork.js +17 -14
- package/components/Icons/PlateKnifeFork.js.map +1 -1
- package/components/Icons/Play.js +4 -4
- package/components/Icons/Play.js.map +1 -1
- package/components/Icons/PlusLarge.js +4 -4
- package/components/Icons/PlusLarge.js.map +1 -1
- package/components/Icons/PlusSmall.js +4 -4
- package/components/Icons/PlusSmall.js.map +1 -1
- package/components/Icons/PngFile.js +4 -4
- package/components/Icons/PngFile.js.map +1 -1
- package/components/Icons/Podcast.js +4 -4
- package/components/Icons/Podcast.js.map +1 -1
- package/components/Icons/PoisonInformation.js +9 -3
- package/components/Icons/PoisonInformation.js.map +1 -1
- package/components/Icons/Pregnant.js +2 -2
- package/components/Icons/Pregnant.js.map +1 -1
- package/components/Icons/Printer.js +7 -7
- package/components/Icons/Printer.js.map +1 -1
- package/components/Icons/Psychosis.js +2 -2
- package/components/Icons/Psychosis.js.map +1 -1
- package/components/Icons/Publication.js +4 -4
- package/components/Icons/Publication.js.map +1 -1
- package/components/Icons/Puzzle.js +5 -2
- package/components/Icons/Puzzle.js.map +1 -1
- package/components/Icons/QrCode.js +7 -7
- package/components/Icons/QrCode.js.map +1 -1
- package/components/Icons/Quarrel.js +4 -4
- package/components/Icons/Quarrel.js.map +1 -1
- package/components/Icons/RadioTherapy.js +4 -4
- package/components/Icons/RadioTherapy.js.map +1 -1
- package/components/Icons/RadioactiveTreatment.js +4 -4
- package/components/Icons/RadioactiveTreatment.js.map +1 -1
- package/components/Icons/Radioiodine.js +4 -4
- package/components/Icons/Radioiodine.js.map +1 -1
- package/components/Icons/Receipt.js +2 -2
- package/components/Icons/Receipt.js.map +1 -1
- package/components/Icons/Receptionist.js +4 -4
- package/components/Icons/Receptionist.js.map +1 -1
- package/components/Icons/Recovery.js +4 -4
- package/components/Icons/Recovery.js.map +1 -1
- package/components/Icons/Referral.js +4 -4
- package/components/Icons/Referral.js.map +1 -1
- package/components/Icons/Refresh.js +4 -4
- package/components/Icons/Refresh.js.map +1 -1
- package/components/Icons/Refund.js +3 -3
- package/components/Icons/Refund.js.map +1 -1
- package/components/Icons/Reminder.js +14 -9
- package/components/Icons/Reminder.js.map +1 -1
- package/components/Icons/Reply.js +10 -4
- package/components/Icons/Reply.js.map +1 -1
- package/components/Icons/Rocket.js +3 -3
- package/components/Icons/Rocket.js.map +1 -1
- package/components/Icons/RtfFile.js +4 -4
- package/components/Icons/RtfFile.js.map +1 -1
- package/components/Icons/STDs.js +4 -4
- package/components/Icons/STDs.js.map +1 -1
- package/components/Icons/Save.js +12 -4
- package/components/Icons/Save.js.map +1 -1
- package/components/Icons/Scale.js +3 -3
- package/components/Icons/Scale.js.map +1 -1
- package/components/Icons/ScreenReader.js +18 -11
- package/components/Icons/ScreenReader.js.map +1 -1
- package/components/Icons/Search.js +4 -4
- package/components/Icons/Search.js.map +1 -1
- package/components/Icons/SectionSign.js +6 -6
- package/components/Icons/SectionSign.js.map +1 -1
- package/components/Icons/Settings.js +7 -7
- package/components/Icons/Settings.js.map +1 -1
- package/components/Icons/Sexualorientation.js +4 -4
- package/components/Icons/Sexualorientation.js.map +1 -1
- package/components/Icons/ShakingHand.js +3 -3
- package/components/Icons/ShakingHand.js.map +1 -1
- package/components/Icons/Share.js +10 -4
- package/components/Icons/Share.js.map +1 -1
- package/components/Icons/Shield.js +4 -4
- package/components/Icons/Shield.js.map +1 -1
- package/components/Icons/ShuntOperation.js +3 -3
- package/components/Icons/ShuntOperation.js.map +1 -1
- package/components/Icons/Skeleton.js +2 -2
- package/components/Icons/Skeleton.js.map +1 -1
- package/components/Icons/Skin.js +3 -3
- package/components/Icons/Skin.js.map +1 -1
- package/components/Icons/Snake.js +3 -3
- package/components/Icons/Snake.js.map +1 -1
- package/components/Icons/Snapchat.js +6 -3
- package/components/Icons/Snapchat.js.map +1 -1
- package/components/Icons/SortDown.js +19 -7
- package/components/Icons/SortDown.js.map +1 -1
- package/components/Icons/SortUp.js +19 -7
- package/components/Icons/SortUp.js.map +1 -1
- package/components/Icons/SpeechBubble.js +6 -6
- 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 +7 -7
- package/components/Icons/Stopwatch.js.map +1 -1
- package/components/Icons/Sun.js +14 -9
- package/components/Icons/Sun.js.map +1 -1
- package/components/Icons/SupportingPerson.js +25 -22
- package/components/Icons/SupportingPerson.js.map +1 -1
- package/components/Icons/Surgery.js +3 -3
- package/components/Icons/Surgery.js.map +1 -1
- package/components/Icons/Sweets.js +19 -14
- package/components/Icons/Sweets.js.map +1 -1
- package/components/Icons/Syringe.js +6 -6
- package/components/Icons/Syringe.js.map +1 -1
- package/components/Icons/Taxi.js +2 -2
- package/components/Icons/Taxi.js.map +1 -1
- package/components/Icons/TeddyBear.js +3 -3
- package/components/Icons/TeddyBear.js.map +1 -1
- package/components/Icons/Teenagers.js +4 -4
- package/components/Icons/Teenagers.js.map +1 -1
- package/components/Icons/ThinkingAboutBaby.js +3 -3
- package/components/Icons/ThinkingAboutBaby.js.map +1 -1
- package/components/Icons/Ticket.js +3 -3
- package/components/Icons/Ticket.js.map +1 -1
- package/components/Icons/TimePassing.js +7 -7
- package/components/Icons/TimePassing.js.map +1 -1
- package/components/Icons/Tombstone.js +12 -9
- package/components/Icons/Tombstone.js.map +1 -1
- package/components/Icons/Toolbox.js +36 -30
- package/components/Icons/Toolbox.js.map +1 -1
- package/components/Icons/Tooth.js +3 -3
- package/components/Icons/Tooth.js.map +1 -1
- package/components/Icons/TotalKneeProsthesis.js +4 -4
- package/components/Icons/TotalKneeProsthesis.js.map +1 -1
- package/components/Icons/Train.js +3 -3
- package/components/Icons/Train.js.map +1 -1
- package/components/Icons/Transplantation.js +3 -3
- package/components/Icons/Transplantation.js.map +1 -1
- package/components/Icons/TrashCan.js +7 -7
- package/components/Icons/TrashCan.js.map +1 -1
- package/components/Icons/TravelRoute.js +21 -16
- package/components/Icons/TravelRoute.js.map +1 -1
- package/components/Icons/TriangleX.js +32 -35
- package/components/Icons/TriangleX.js.map +1 -1
- package/components/Icons/Twitter.js +3 -3
- package/components/Icons/Twitter.js.map +1 -1
- package/components/Icons/Undo.js +8 -8
- package/components/Icons/Undo.js.map +1 -1
- package/components/Icons/UniProsthesis.js +3 -3
- package/components/Icons/UniProsthesis.js.map +1 -1
- package/components/Icons/Upload.js +10 -4
- package/components/Icons/Upload.js.map +1 -1
- package/components/Icons/UserOrganization.js +2 -2
- package/components/Icons/UserOrganization.js.map +1 -1
- package/components/Icons/Vaccine.js +7 -7
- package/components/Icons/Vaccine.js.map +1 -1
- package/components/Icons/VerticalDots.js +4 -4
- package/components/Icons/VerticalDots.js.map +1 -1
- package/components/Icons/VideoCamera.js +7 -7
- package/components/Icons/VideoCamera.js.map +1 -1
- package/components/Icons/VideoChat.js +4 -4
- package/components/Icons/VideoChat.js.map +1 -1
- package/components/Icons/Wallet.js +4 -4
- package/components/Icons/Wallet.js.map +1 -1
- package/components/Icons/Watch.js +6 -6
- package/components/Icons/Watch.js.map +1 -1
- package/components/Icons/Website.js +4 -4
- package/components/Icons/Website.js.map +1 -1
- package/components/Icons/Wheelchair.js +4 -4
- package/components/Icons/Wheelchair.js.map +1 -1
- package/components/Icons/WheelchairActive.js +3 -3
- package/components/Icons/WheelchairActive.js.map +1 -1
- package/components/Icons/Window.js +3 -3
- package/components/Icons/Window.js.map +1 -1
- package/components/Icons/WordDocument.js +3 -3
- 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 +4 -4
- package/components/Icons/X.js.map +1 -1
- package/components/Icons/XOutline.js +3 -3
- package/components/Icons/XOutline.js.map +1 -1
- package/components/Icons/XmlFile.js +4 -4
- package/components/Icons/XmlFile.js.map +1 -1
- package/components/Icons/YouTube.js +3 -3
- package/components/Icons/YouTube.js.map +1 -1
- package/components/Icons/Zoom.js +6 -6
- package/components/Icons/Zoom.js.map +1 -1
- package/components/Illustration/index.js +3 -3
- package/components/Illustrations/Doctor.js +8 -8
- package/components/Illustrations/Doctor.js.map +1 -1
- package/components/Illustrations/DoctorMedium.js +49 -41
- package/components/Illustrations/DoctorMedium.js.map +1 -1
- package/components/Illustrations/DoctorSmall.js +48 -38
- package/components/Illustrations/DoctorSmall.js.map +1 -1
- package/components/Illustrations/FacialRecognitionFingerprint.js +6 -6
- package/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
- package/components/Illustrations/FacialRecognitionFingerprintMedium.js +297 -253
- package/components/Illustrations/FacialRecognitionFingerprintMedium.js.map +1 -1
- package/components/Illustrations/HealthcarePersonnel.js +7 -7
- package/components/Illustrations/HealthcarePersonnel.js.map +1 -1
- package/components/Illustrations/HealthcarePersonnelMedium.js +202 -171
- package/components/Illustrations/HealthcarePersonnelMedium.js.map +1 -1
- package/components/Illustrations/HealthcarePersonnelSmall.js +190 -165
- package/components/Illustrations/HealthcarePersonnelSmall.js.map +1 -1
- package/components/Input/index.js +3 -3
- package/components/Label/index.js +7 -8
- package/components/Label/index.js.map +1 -1
- package/components/LazyIcon/index.js +2 -2
- package/components/LazyIllustration/index.js +5 -5
- package/components/LinkList/index.js +3 -3
- package/components/List/index.js +2 -2
- package/components/ListHeader/ListHeaderText/index.js +1 -1
- package/components/ListHeader/index.js +5 -5
- package/components/Loader/index.js +67 -4
- package/components/Loader/index.js.map +1 -1
- package/components/Logo/index.js +41 -2
- package/components/Logo/index.js.map +1 -1
- package/components/Modal/index.js +162 -5
- package/components/Modal/index.js.map +1 -1
- package/components/NotificationPanel/index.js +98 -2
- package/components/NotificationPanel/index.js.map +1 -1
- package/components/Panel/index.js +4 -4
- package/components/PanelList/index.js +15 -2
- package/components/PanelList/index.js.map +1 -1
- package/components/PopMenu/index.js +92 -6
- package/components/PopMenu/index.js.map +1 -1
- package/components/PopOver/index.js +4 -4
- package/components/Portal/index.js +3 -3
- package/components/Progressbar/index.js +92 -6
- package/components/Progressbar/index.js.map +1 -1
- package/components/Progressbar/styles.module.scss +5 -0
- package/components/Progressbar/styles.module.scss.d.ts +1 -0
- package/components/PromoPanel/index.js +57 -2
- package/components/PromoPanel/index.js.map +1 -1
- package/components/RadioButton/index.js +5 -5
- package/components/Select/index.js +1 -1
- package/components/ServiceMessage/index.js +110 -2
- package/components/ServiceMessage/index.js.map +1 -1
- package/components/SharingStatus/index.js +16 -2
- package/components/SharingStatus/index.js.map +1 -1
- package/components/Slider/index.js +189 -3
- package/components/Slider/index.js.map +1 -1
- package/components/Spacer/index.js +2 -2
- package/components/StatusDot/index.js +4 -4
- package/components/Step/index.js +31 -2
- package/components/Step/index.js.map +1 -1
- package/components/StepButtons/index.js +1 -1
- package/components/Stepper/index.js +49 -2
- package/components/Stepper/index.js.map +1 -1
- package/components/Table/TableBody/index.js +3 -3
- package/components/Table/TableCell/index.js +5 -5
- package/components/Table/TableExpandedRow/index.js +1 -1
- package/components/Table/TableExpanderCell/index.js +3 -3
- package/components/Table/TableHead/index.js +4 -4
- package/components/Table/TableHeadCell/index.js +3 -3
- package/components/Table/TableRow/index.js +3 -3
- package/components/Table/index.js +22 -22
- package/components/Tabs/TabList/index.js +2 -2
- package/components/Tabs/TabPanel/index.js +1 -1
- package/components/Tabs/index.js +94 -2
- package/components/Tabs/index.js.map +1 -1
- package/components/Tag/index.js +22 -5
- package/components/Tag/index.js.map +1 -1
- package/components/TagList/index.js +6 -2
- package/components/TagList/index.js.map +1 -1
- package/components/Textarea/index.js +1 -1
- package/components/Tile/index.js +70 -3
- package/components/Tile/index.js.map +1 -1
- package/components/Title/index.js +5 -5
- package/components/Toggle/Toggle.d.ts +31 -0
- package/components/Toggle/index.d.ts +3 -0
- package/components/Toggle/index.js +2656 -0
- package/components/Toggle/index.js.map +1 -0
- package/components/Toggle/styles.module.scss +125 -0
- package/components/Toggle/styles.module.scss.d.ts +24 -0
- package/components/Tooltip/TooltipWord/index.js +1 -1
- package/components/Tooltip/index.js +54 -5
- package/components/Tooltip/index.js.map +1 -1
- package/components/Trigger/index.js +2 -2
- package/components/Validation/index.js +47 -3
- package/components/Validation/index.js.map +1 -1
- package/constants.d.ts +1 -0
- package/constants.js +4 -4
- package/constants.js.map +1 -1
- package/{components → docs}/ButtonWithModal/ButtonWithModal.d.ts +1 -1
- package/{components → docs}/HelpBubbleExample/HelpBubbleExample.d.ts +1 -1
- package/{components → docs}/TooltipExample/TooltipExample.d.ts +1 -1
- package/hoc/withBreakpoint/withBreakpoint.js +9 -8
- package/hoc/withBreakpoint/withBreakpoint.js.map +1 -1
- package/hooks/useIcons.js +9 -9
- package/hooks/usePseudoClasses.d.ts +1 -0
- package/hooks/usePseudoClasses.js +11 -11
- package/hooks/usePseudoClasses.js.map +1 -1
- package/hooks/useUuid.js +3 -3
- package/index.js +3 -3
- package/package.json +4 -1
- package/style.css +1 -0
- package/utils/component.js +2 -2
- package/utils/uuid.js +4 -7
- package/utils/uuid.js.map +1 -1
- package/{components/Illustration/utils.js → utils.js} +1 -1
- package/utils.js.map +1 -0
- package/uuid.js +14 -0
- package/uuid.js.map +1 -0
- package/_virtual/_cloneBuffer.js +0 -5
- package/_virtual/_cloneBuffer.js.map +0 -1
- package/_virtual/_commonjs-dynamic-modules.js +0 -7
- package/_virtual/_commonjs-dynamic-modules.js.map +0 -1
- package/_virtual/_commonjsHelpers.js +0 -9
- package/_virtual/_commonjsHelpers.js.map +0 -1
- package/_virtual/_nodeUtil.js +0 -5
- package/_virtual/_nodeUtil.js.map +0 -1
- package/_virtual/dynamic-import-helper.js +0 -17
- package/_virtual/dynamic-import-helper.js.map +0 -1
- package/_virtual/isBuffer.js +0 -5
- package/_virtual/isBuffer.js.map +0 -1
- package/_virtual/memoizerific.js +0 -5
- package/_virtual/memoizerific.js.map +0 -1
- package/components/AnchorLink/AnchorLink.js +0 -53
- package/components/AnchorLink/AnchorLink.js.map +0 -1
- package/components/Avatar/Avatar.js +0 -33
- package/components/Avatar/Avatar.js.map +0 -1
- package/components/Badge/Badge.js +0 -30
- package/components/Badge/Badge.js.map +0 -1
- package/components/Badge/NotificationBadge.js +0 -68
- package/components/Badge/NotificationBadge.js.map +0 -1
- package/components/Button/Button.js +0 -118
- package/components/Button/Button.js.map +0 -1
- package/components/ButtonWithModal/ButtonWithModal.js +0 -11
- package/components/ButtonWithModal/ButtonWithModal.js.map +0 -1
- package/components/ButtonWithModal/index.js +0 -5
- package/components/ButtonWithModal/index.js.map +0 -1
- package/components/Checkbox/Checkbox.js +0 -110
- package/components/Checkbox/Checkbox.js.map +0 -1
- package/components/Chip/Chip.js +0 -30
- package/components/Chip/Chip.js.map +0 -1
- package/components/Close/Close.js +0 -30
- package/components/Close/Close.js.map +0 -1
- package/components/DictionaryTrigger/DictionaryTrigger.js +0 -27
- package/components/DictionaryTrigger/DictionaryTrigger.js.map +0 -1
- package/components/Dropdown/Dropdown.js +0 -117
- package/components/Dropdown/Dropdown.js.map +0 -1
- package/components/Duolist/Duolist.js +0 -63
- package/components/Duolist/Duolist.js.map +0 -1
- package/components/EmptyState/EmptyState.js +0 -10
- package/components/EmptyState/EmptyState.js.map +0 -1
- package/components/EmptyState/NobodyHome.js +0 -155
- package/components/EmptyState/NobodyHome.js.map +0 -1
- package/components/ErrorWrapper/ErrorWrapper.js +0 -12
- package/components/ErrorWrapper/ErrorWrapper.js.map +0 -1
- package/components/Expander/Expander.js +0 -101
- package/components/Expander/Expander.js.map +0 -1
- package/components/ExpanderHierarchy/Expander.js +0 -31
- package/components/ExpanderHierarchy/Expander.js.map +0 -1
- package/components/ExpanderHierarchy/ExpanderButton.js +0 -46
- package/components/ExpanderHierarchy/ExpanderButton.js.map +0 -1
- package/components/ExpanderHierarchy/ExpanderHierarchy.js +0 -28
- package/components/ExpanderHierarchy/ExpanderHierarchy.js.map +0 -1
- package/components/ExpanderHierarchy/utils.js +0 -20
- package/components/ExpanderHierarchy/utils.js.map +0 -1
- package/components/ExpanderList/ExpanderList.js +0 -139
- package/components/ExpanderList/ExpanderList.js.map +0 -1
- package/components/EyebrowHeader/EyebrowHeader.js +0 -12
- package/components/EyebrowHeader/EyebrowHeader.js.map +0 -1
- package/components/FormExample/FormExample.js +0 -161
- package/components/FormExample/FormExample.js.map +0 -1
- package/components/FormExample/index.js +0 -8
- package/components/FormExample/index.js.map +0 -1
- package/components/FormExample/styles.module.scss +0 -33
- package/components/FormExample/styles.module.scss.d.ts +0 -12
- package/components/FormGroup/FormGroup.js +0 -101
- package/components/FormGroup/FormGroup.js.map +0 -1
- package/components/FormLayout/FormLayout.js +0 -38
- package/components/FormLayout/FormLayout.js.map +0 -1
- package/components/GridExample/GridExample.js +0 -8
- package/components/GridExample/GridExample.js.map +0 -1
- package/components/GridExample/index.js +0 -6
- package/components/GridExample/index.js.map +0 -1
- package/components/HelpBubble/HelpBubble.js +0 -61
- package/components/HelpBubble/HelpBubble.js.map +0 -1
- package/components/HelpBubbleExample/HelpBubbleExample.js +0 -20
- package/components/HelpBubbleExample/HelpBubbleExample.js.map +0 -1
- package/components/HelpBubbleExample/index.js +0 -5
- package/components/HelpBubbleExample/index.js.map +0 -1
- package/components/HelpPanel/HelpPanel.js +0 -24
- package/components/HelpPanel/HelpPanel.js.map +0 -1
- package/components/HelpQuestion/HelpQuestion.js +0 -31
- package/components/HelpQuestion/HelpQuestion.js.map +0 -1
- package/components/HighlightPanel/HighlightPanel.js +0 -61
- package/components/HighlightPanel/HighlightPanel.js.map +0 -1
- package/components/HorizontalScroll/HorizontalScroll.js +0 -47
- package/components/HorizontalScroll/HorizontalScroll.js.map +0 -1
- package/components/Icon/Icon.js +0 -60
- package/components/Icon/Icon.js.map +0 -1
- package/components/Illustration/Illustration.js +0 -41
- package/components/Illustration/Illustration.js.map +0 -1
- package/components/Illustration/utils.js.map +0 -1
- package/components/Input/Input.js +0 -129
- package/components/Input/Input.js.map +0 -1
- package/components/Label/Label.js +0 -79
- package/components/Label/Label.js.map +0 -1
- package/components/Label/SubLabel.js +0 -19
- package/components/Label/SubLabel.js.map +0 -1
- package/components/LazyIcon/ErrorBoundary.js +0 -21
- package/components/LazyIcon/ErrorBoundary.js.map +0 -1
- package/components/LazyIcon/LazyIcon.js +0 -31
- package/components/LazyIcon/LazyIcon.js.map +0 -1
- package/components/LazyIllustration/LazyIllustration.js +0 -35
- package/components/LazyIllustration/LazyIllustration.js.map +0 -1
- package/components/LinkList/LinkList.js +0 -60
- package/components/LinkList/LinkList.js.map +0 -1
- package/components/List/List.js +0 -13
- package/components/List/List.js.map +0 -1
- package/components/ListHeader/ListHeader.js +0 -84
- package/components/ListHeader/ListHeader.js.map +0 -1
- package/components/ListHeader/ListHeaderText/ListHeaderText.js +0 -30
- package/components/ListHeader/ListHeaderText/ListHeaderText.js.map +0 -1
- package/components/Loader/Loader.js +0 -67
- package/components/Loader/Loader.js.map +0 -1
- package/components/Logo/Logo.js +0 -40
- package/components/Logo/Logo.js.map +0 -1
- package/components/MaxCharacters/MaxCharacters.js +0 -15
- package/components/MaxCharacters/MaxCharacters.js.map +0 -1
- package/components/Modal/Modal.js +0 -145
- package/components/Modal/Modal.js.map +0 -1
- package/components/NotificationPanel/NotificationPanel.js +0 -94
- package/components/NotificationPanel/NotificationPanel.js.map +0 -1
- package/components/Panel/Panel.js +0 -191
- package/components/Panel/Panel.js.map +0 -1
- package/components/PanelList/PanelList.js +0 -17
- package/components/PanelList/PanelList.js.map +0 -1
- package/components/PopMenu/PopMenu.js +0 -89
- package/components/PopMenu/PopMenu.js.map +0 -1
- package/components/PopOver/PopOver.js +0 -56
- package/components/PopOver/PopOver.js.map +0 -1
- package/components/PopOver/utils.js +0 -33
- package/components/PopOver/utils.js.map +0 -1
- package/components/Progressbar/Progressbar.js +0 -89
- package/components/Progressbar/Progressbar.js.map +0 -1
- package/components/PromoPanel/PromoPanel.js +0 -52
- package/components/PromoPanel/PromoPanel.js.map +0 -1
- package/components/RadioButton/RadioButton.js +0 -104
- package/components/RadioButton/RadioButton.js.map +0 -1
- package/components/Select/Select.js +0 -70
- package/components/Select/Select.js.map +0 -1
- package/components/ServiceMessage/ServiceMessage.js +0 -92
- package/components/ServiceMessage/ServiceMessage.js.map +0 -1
- package/components/SharingStatus/SharingStatus.js +0 -16
- package/components/SharingStatus/SharingStatus.js.map +0 -1
- package/components/Slider/Slider.js +0 -178
- package/components/Slider/Slider.js.map +0 -1
- package/components/Spacer/Spacer.js.map +0 -1
- package/components/StatusDot/StatusDot.js +0 -29
- package/components/StatusDot/StatusDot.js.map +0 -1
- package/components/Step/Step.js +0 -30
- package/components/Step/Step.js.map +0 -1
- package/components/StepButtons/StepButtons.js +0 -21
- package/components/StepButtons/StepButtons.js.map +0 -1
- package/components/Stepper/Dot.js +0 -16
- package/components/Stepper/Dot.js.map +0 -1
- package/components/Stepper/DotList.js +0 -7
- package/components/Stepper/DotList.js.map +0 -1
- package/components/Stepper/Stepper.js +0 -35
- package/components/Stepper/Stepper.js.map +0 -1
- package/components/Stepper/utils.js +0 -16
- package/components/Stepper/utils.js.map +0 -1
- package/components/Table/Table.js +0 -76
- package/components/Table/Table.js.map +0 -1
- package/components/Table/TableBody/TableBody.js +0 -13
- package/components/Table/TableBody/TableBody.js.map +0 -1
- package/components/Table/TableCell/TableCell.js.map +0 -1
- package/components/Table/TableExpandedRow/TableExpandedRow.js +0 -31
- package/components/Table/TableExpandedRow/TableExpandedRow.js.map +0 -1
- package/components/Table/TableExpanderCell/TableExpanderCell.js +0 -35
- package/components/Table/TableExpanderCell/TableExpanderCell.js.map +0 -1
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js +0 -25
- package/components/Table/TableExpanderCell/TableExpanderCellMobile.js.map +0 -1
- package/components/Table/TableHead/TableHead.js +0 -24
- package/components/Table/TableHead/TableHead.js.map +0 -1
- package/components/Table/TableHeadCell/TableHeadCell.js +0 -42
- package/components/Table/TableHeadCell/TableHeadCell.js.map +0 -1
- package/components/Table/TableRow/TableRow.js +0 -40
- package/components/Table/TableRow/TableRow.js.map +0 -1
- package/components/Table/utils.js +0 -32
- package/components/Table/utils.js.map +0 -1
- package/components/Tabs/Tab.js +0 -6
- package/components/Tabs/Tab.js.map +0 -1
- package/components/Tabs/TabList/TabItem.js +0 -45
- package/components/Tabs/TabList/TabItem.js.map +0 -1
- package/components/Tabs/TabList/TabList.js +0 -28
- package/components/Tabs/TabList/TabList.js.map +0 -1
- package/components/Tabs/TabPanel/TabPanel.js +0 -17
- package/components/Tabs/TabPanel/TabPanel.js.map +0 -1
- package/components/Tabs/Tabs.js +0 -92
- package/components/Tabs/Tabs.js.map +0 -1
- package/components/Tag/Tag.js +0 -22
- package/components/Tag/Tag.js.map +0 -1
- package/components/TagList/TagList.js +0 -8
- package/components/TagList/TagList.js.map +0 -1
- package/components/Textarea/Textarea.js +0 -105
- package/components/Textarea/Textarea.js.map +0 -1
- package/components/Tile/Tile.js +0 -67
- package/components/Tile/Tile.js.map +0 -1
- package/components/Title/Title.js +0 -25
- package/components/Title/Title.js.map +0 -1
- package/components/Tooltip/Tooltip.js +0 -55
- package/components/Tooltip/Tooltip.js.map +0 -1
- package/components/Tooltip/TooltipWord/TooltipWord.js +0 -27
- package/components/Tooltip/TooltipWord/TooltipWord.js.map +0 -1
- package/components/TooltipExample/TooltipExample.js +0 -8
- package/components/TooltipExample/TooltipExample.js.map +0 -1
- package/components/TooltipExample/index.js +0 -5
- package/components/TooltipExample/index.js.map +0 -1
- package/components/Trigger/HelpSign.js +0 -7
- package/components/Trigger/HelpSign.js.map +0 -1
- package/components/Trigger/Trigger.js +0 -73
- package/components/Trigger/Trigger.js.map +0 -1
- package/components/Validation/ErrorList.js +0 -8
- package/components/Validation/ErrorList.js.map +0 -1
- package/components/Validation/ErrorListItem.js +0 -12
- package/components/Validation/ErrorListItem.js.map +0 -1
- package/components/Validation/Validation.js +0 -18
- package/components/Validation/Validation.js.map +0 -1
- package/components/Validation/ValidationSummary.js +0 -25
- package/components/Validation/ValidationSummary.js.map +0 -1
- package/docs/index.d.ts +0 -8
- package/docs/index.js +0 -14
- package/docs/index.js.map +0 -1
- /package/{components → docs}/ButtonWithModal/index.d.ts +0 -0
- /package/{components → docs}/FormExample/FormExample.d.ts +0 -0
- /package/{components → docs}/FormExample/index.d.ts +0 -0
- /package/{components → docs}/GridExample/GridExample.d.ts +0 -0
- /package/{components → docs}/GridExample/index.d.ts +0 -0
- /package/{components → docs}/HelpBubbleExample/index.d.ts +0 -0
- /package/{components → docs}/TooltipExample/index.d.ts +0 -0
package/Expander.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C } from "react";
|
|
3
|
+
import i from "classnames";
|
|
4
|
+
import { ZIndex as O, AnalyticsId as z, IconSize as c } from "./constants.js";
|
|
5
|
+
import { useExpand as U } from "./hooks/useExpand.js";
|
|
6
|
+
import { useHover as Z } from "./hooks/useHover.js";
|
|
7
|
+
import { useSticky as q } from "./hooks/useSticky.js";
|
|
8
|
+
import { B as F } from "./Button.js";
|
|
9
|
+
import { I as x } from "./Icon.js";
|
|
10
|
+
import E from "./components/Icons/ChevronDown.js";
|
|
11
|
+
import b from "./components/Icons/ChevronUp.js";
|
|
12
|
+
import { L as G } from "./LazyIcon.js";
|
|
13
|
+
import e from "./components/Expander/styles.module.scss";
|
|
14
|
+
var J = /* @__PURE__ */ ((s) => (s.small = "small", s.large = "large", s))(J || {});
|
|
15
|
+
const ie = (s) => {
|
|
16
|
+
const {
|
|
17
|
+
title: g,
|
|
18
|
+
children: k,
|
|
19
|
+
size: n = "small",
|
|
20
|
+
color: _,
|
|
21
|
+
contentClassNames: $,
|
|
22
|
+
svgIcon: a,
|
|
23
|
+
expanded: S = !1,
|
|
24
|
+
noNestedLine: w = !1,
|
|
25
|
+
sticky: L = !1,
|
|
26
|
+
testId: f,
|
|
27
|
+
onExpand: W,
|
|
28
|
+
renderChildrenWhenClosed: X = !1,
|
|
29
|
+
zIndex: B = O.ExpanderTrigger
|
|
30
|
+
} = s, [r, u] = U(S, W), v = C(null), d = C(null), { isHovered: l } = Z(d), { isOutsideWindow: H, isLeavingWindow: h, offsetHeight: y, contentWidth: I } = q(v, d), o = L && r && H, N = (p) => /* @__PURE__ */ t("span", { className: i(e.expander__icon, e[`expander__icon--${p}`]), children: /* @__PURE__ */ t(x, { svgIcon: r ? b : E, size: c.XSmall, isHovered: l }) }), R = i(
|
|
31
|
+
e.expander__trigger,
|
|
32
|
+
n === "large" && e[`expander__trigger--${n}`],
|
|
33
|
+
n === "large" && e[`expander__trigger--${_ || "neutral"}`],
|
|
34
|
+
n === "large" && a && e["expander__trigger--icon"],
|
|
35
|
+
r && e["expander__trigger--expanded"],
|
|
36
|
+
o && !h && e["expander__trigger--sticky"]
|
|
37
|
+
), T = () => /* @__PURE__ */ m(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
className: R,
|
|
42
|
+
style: {
|
|
43
|
+
zIndex: l || o ? B : void 0,
|
|
44
|
+
width: o && I ? `${I}px` : void 0
|
|
45
|
+
},
|
|
46
|
+
"aria-expanded": r,
|
|
47
|
+
ref: d,
|
|
48
|
+
onClick: () => u(!r),
|
|
49
|
+
"data-testid": f,
|
|
50
|
+
"data-analyticsid": z.Expander,
|
|
51
|
+
children: [
|
|
52
|
+
n === "small" && N("left"),
|
|
53
|
+
a && /* @__PURE__ */ t("span", { className: i(e.expander__icon, e["expander__icon--left"]), children: typeof a == "string" ? /* @__PURE__ */ t(G, { iconName: a, size: c.XSmall, isHovered: l }) : /* @__PURE__ */ t(x, { svgIcon: a, size: c.XSmall, isHovered: l }) }),
|
|
54
|
+
g,
|
|
55
|
+
n === "large" && N("right")
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
), j = i(
|
|
59
|
+
e.expander__button,
|
|
60
|
+
r && e["expander__button--expanded"],
|
|
61
|
+
o && !h && e["expander__button--sticky"]
|
|
62
|
+
), A = () => /* @__PURE__ */ m(
|
|
63
|
+
F,
|
|
64
|
+
{
|
|
65
|
+
variant: "borderless",
|
|
66
|
+
className: j,
|
|
67
|
+
"aria-expanded": r,
|
|
68
|
+
ref: d,
|
|
69
|
+
onClick: () => u(!r),
|
|
70
|
+
testId: f,
|
|
71
|
+
"data-analyticsid": z.Expander,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ t(x, { svgIcon: r ? b : E, size: c.XSmall }),
|
|
74
|
+
g
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
), D = () => {
|
|
78
|
+
if (!X && !r)
|
|
79
|
+
return null;
|
|
80
|
+
const p = i(
|
|
81
|
+
e.expander__content,
|
|
82
|
+
e[`expander__content--${n}`],
|
|
83
|
+
n === "large" && e[`expander__content--${_ || "neutral"}`],
|
|
84
|
+
n === "large" && a && e["expander__content--icon"],
|
|
85
|
+
r && e["expander__content--expanded"],
|
|
86
|
+
n === "small" && !w && e["expander__content--nested-line"],
|
|
87
|
+
$
|
|
88
|
+
);
|
|
89
|
+
return /* @__PURE__ */ t("div", { className: p, children: k });
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ m(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: e.expander,
|
|
95
|
+
ref: v,
|
|
96
|
+
style: { paddingTop: o && y ? `${y}px` : void 0 },
|
|
97
|
+
children: [
|
|
98
|
+
n === "large" ? T() : A(),
|
|
99
|
+
D()
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
export {
|
|
105
|
+
ie as E,
|
|
106
|
+
J as a
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=Expander.js.map
|
package/Expander.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Expander.js","sources":["../src/components/Expander/Expander.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { useHover } from '../../hooks/useHover';\nimport { useSticky } from '../../hooks/useSticky';\nimport { PaletteNames } from '../../theme/palette';\nimport Button from '../Button';\nimport Icon, { IconSize, SvgIcon } from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\n\nimport styles from './styles.module.scss';\n\nexport enum ExpanderSize {\n small = 'small',\n large = 'large',\n}\n\nexport type ExpanderColors = Extract<PaletteNames, 'banana' | 'blueberry' | 'cherry' | 'kiwi' | 'neutral' | 'plum' | 'white'>;\n\nexport interface ExpanderProps {\n /** Sets the trigger title */\n title: string;\n /** Sets the expanded content */\n children?: React.ReactNode;\n /** Sets classnames on the content area */\n contentClassNames?: string;\n /** Sets the size of the expander. Default: ExpanderSize.small */\n size?: ExpanderSize;\n /** Sets the background of the expander. Requires size=ExpanderSize.large. */\n color?: ExpanderColors;\n /** Adds an icon to the expander trigger. Requires size=ExpanderSize.large. */\n svgIcon?: SvgIcon | IconName;\n /** Opens or closes the expander */\n expanded?: boolean;\n /** Removes border to the left of the content. Requires size=ExpanderSize.small. */\n noNestedLine?: boolean;\n /** Stick expander trigger to top of screen while scrolling down */\n sticky?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Whether to render children when closed (in which case they are hidden with CSS). Default: false */\n renderChildrenWhenClosed?: boolean;\n /** Sets the data-testid attribute on the expander button. */\n testId?: string;\n /** Overrides the default z-index of the expander header */\n zIndex?: number;\n}\n\nconst Expander: React.FC<ExpanderProps> = props => {\n const {\n title,\n children,\n size = ExpanderSize.small,\n color,\n contentClassNames,\n svgIcon: icon,\n expanded = false,\n noNestedLine = false,\n sticky = false,\n testId,\n onExpand,\n renderChildrenWhenClosed = false,\n zIndex = ZIndex.ExpanderTrigger,\n } = props;\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const expanderRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const { isHovered } = useHover(triggerRef);\n const { isOutsideWindow, isLeavingWindow, offsetHeight, contentWidth } = useSticky(expanderRef, triggerRef);\n\n const isSticky = sticky && isExpanded && isOutsideWindow;\n\n const renderChevron = (align: 'left' | 'right'): React.ReactNode => (\n <span className={classNames(styles['expander__icon'], styles[`expander__icon--${align}`])}>\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} isHovered={isHovered} />\n </span>\n );\n\n const triggerClassName = classNames(\n styles['expander__trigger'],\n size === ExpanderSize.large && styles[`expander__trigger--${size}`],\n size === ExpanderSize.large && styles[`expander__trigger--${color || 'neutral'}`],\n size === ExpanderSize.large && icon && styles['expander__trigger--icon'],\n isExpanded && styles['expander__trigger--expanded'],\n isSticky && !isLeavingWindow && styles['expander__trigger--sticky']\n );\n\n const renderTrigger = (): React.ReactNode => (\n <button\n type=\"button\"\n className={triggerClassName}\n style={{\n zIndex: isHovered || isSticky ? zIndex : undefined,\n width: isSticky && contentWidth ? `${contentWidth}px` : undefined,\n }}\n aria-expanded={isExpanded}\n ref={triggerRef}\n onClick={(): void => setIsExpanded(!isExpanded)}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Expander}\n >\n {size === ExpanderSize.small && renderChevron('left')}\n {icon && (\n <span className={classNames(styles['expander__icon'], styles['expander__icon--left'])}>\n {typeof icon === 'string' ? (\n <LazyIcon iconName={icon} size={IconSize.XSmall} isHovered={isHovered} />\n ) : (\n <Icon svgIcon={icon} size={IconSize.XSmall} isHovered={isHovered} />\n )}\n </span>\n )}\n {title}\n {size === ExpanderSize.large && renderChevron('right')}\n </button>\n );\n\n const buttonClassName = classNames(\n styles['expander__button'],\n isExpanded && styles['expander__button--expanded'],\n isSticky && !isLeavingWindow && styles['expander__button--sticky']\n );\n\n const renderButton = (): React.ReactNode => (\n <Button\n variant=\"borderless\"\n className={buttonClassName}\n aria-expanded={isExpanded}\n ref={triggerRef}\n onClick={(): void => setIsExpanded(!isExpanded)}\n testId={testId}\n data-analyticsid={AnalyticsId.Expander}\n >\n <Icon svgIcon={isExpanded ? ChevronUp : ChevronDown} size={IconSize.XSmall} />\n {title}\n </Button>\n );\n\n const renderContent = (): React.ReactNode => {\n if (!renderChildrenWhenClosed && !isExpanded) {\n return null;\n }\n\n const contentClassName = classNames(\n styles['expander__content'],\n styles[`expander__content--${size}`],\n size === ExpanderSize.large && styles[`expander__content--${color || 'neutral'}`],\n size === ExpanderSize.large && icon && styles['expander__content--icon'],\n isExpanded && styles['expander__content--expanded'],\n size === ExpanderSize.small && !noNestedLine && styles['expander__content--nested-line'],\n contentClassNames\n );\n\n return <div className={contentClassName}>{children}</div>;\n };\n\n return (\n <div\n className={styles['expander']}\n ref={expanderRef}\n style={{ paddingTop: isSticky && offsetHeight ? `${offsetHeight}px` : undefined }}\n >\n {size === ExpanderSize.large ? renderTrigger() : renderButton()}\n {renderContent()}\n </div>\n );\n};\n\nexport default Expander;\n"],"names":["ExpanderSize","Expander","props","title","children","size","color","contentClassNames","icon","expanded","noNestedLine","sticky","testId","onExpand","renderChildrenWhenClosed","zIndex","ZIndex","isExpanded","setIsExpanded","useExpand","expanderRef","useRef","triggerRef","isHovered","useHover","isOutsideWindow","isLeavingWindow","offsetHeight","contentWidth","useSticky","isSticky","renderChevron","align","jsx","classNames","styles","Icon","ChevronUp","ChevronDown","IconSize","triggerClassName","renderTrigger","jsxs","AnalyticsId","LazyIcon","buttonClassName","renderButton","Button","renderContent","contentClassName"],"mappings":"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"}
|
package/FormGroup.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsxs as i, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import t, { useState as A } from "react";
|
|
3
|
+
import f from "classnames";
|
|
4
|
+
import { FormMode as E, FormSize as k, AnalyticsId as D } from "./constants.js";
|
|
5
|
+
import { useUuid as F } from "./hooks/useUuid.js";
|
|
6
|
+
import { isComponent as s } from "./utils/component.js";
|
|
7
|
+
import { C as H } from "./Checkbox.js";
|
|
8
|
+
import { E as h } from "./ErrorWrapper.js";
|
|
9
|
+
import { F as q } from "./FormLayout.js";
|
|
10
|
+
import { I as J } from "./Input.js";
|
|
11
|
+
import { R as K, g as O } from "./RadioButton.js";
|
|
12
|
+
import { S as P } from "./Select.js";
|
|
13
|
+
import { T as Q } from "./Textarea.js";
|
|
14
|
+
import { T as V } from "./Title.js";
|
|
15
|
+
import d from "./components/FormGroup/styles.module.scss";
|
|
16
|
+
const G = t.forwardRef((r, R) => {
|
|
17
|
+
const {
|
|
18
|
+
className: y,
|
|
19
|
+
fieldsetClassName: _,
|
|
20
|
+
mode: a = E.onwhite,
|
|
21
|
+
size: m = k.medium,
|
|
22
|
+
error: o,
|
|
23
|
+
errorTextId: S,
|
|
24
|
+
name: l,
|
|
25
|
+
htmlMarkup: c = "fieldset",
|
|
26
|
+
renderError: b = !0,
|
|
27
|
+
errorWrapperClassName: w,
|
|
28
|
+
errorWrapperTestId: W
|
|
29
|
+
} = r, [v, L] = A(), M = F(), n = F(S), I = a === E.ondark, j = m === k.large, z = f(d["form-group-wrapper"], y), B = f({
|
|
30
|
+
[d["form-group-wrapper__title--on-dark"]]: I && !o
|
|
31
|
+
}), g = f(d["field-set__legend"], {
|
|
32
|
+
[d["field-set__legend--on-dark"]]: I && !o
|
|
33
|
+
}), C = f(d["field-set"], _), u = (e, U) => {
|
|
34
|
+
if (s(e, q))
|
|
35
|
+
return t.cloneElement(e, {
|
|
36
|
+
size: m,
|
|
37
|
+
mapHelper: u
|
|
38
|
+
});
|
|
39
|
+
if (s(e, G))
|
|
40
|
+
return t.cloneElement(e, {
|
|
41
|
+
mode: a,
|
|
42
|
+
size: m,
|
|
43
|
+
error: o,
|
|
44
|
+
renderError: !1,
|
|
45
|
+
errorTextId: n
|
|
46
|
+
});
|
|
47
|
+
if (s(e, H))
|
|
48
|
+
return t.cloneElement(e, {
|
|
49
|
+
name: l ?? e.props.name,
|
|
50
|
+
mode: a,
|
|
51
|
+
size: m,
|
|
52
|
+
error: !!o,
|
|
53
|
+
errorTextId: n
|
|
54
|
+
});
|
|
55
|
+
if (s(e, K)) {
|
|
56
|
+
const T = typeof e.props.inputId > "u" ? M + U : e.props.inputId;
|
|
57
|
+
return t.cloneElement(e, {
|
|
58
|
+
inputId: T,
|
|
59
|
+
name: l ?? e.props.name,
|
|
60
|
+
mode: a,
|
|
61
|
+
size: m,
|
|
62
|
+
onChange: (N) => {
|
|
63
|
+
L(N.target.id), e.props.onChange && e.props.onChange(N);
|
|
64
|
+
},
|
|
65
|
+
error: !!o,
|
|
66
|
+
errorTextId: n,
|
|
67
|
+
labelClassNames: O(T, a, j, v)
|
|
68
|
+
});
|
|
69
|
+
} else {
|
|
70
|
+
if (s(e, J))
|
|
71
|
+
return t.cloneElement(e, {
|
|
72
|
+
name: l ?? e.props.name,
|
|
73
|
+
mode: a,
|
|
74
|
+
size: m,
|
|
75
|
+
error: !!o,
|
|
76
|
+
errorTextId: n
|
|
77
|
+
});
|
|
78
|
+
if (s(e, Q))
|
|
79
|
+
return t.cloneElement(e, {
|
|
80
|
+
name: l ?? e.props.name,
|
|
81
|
+
mode: a,
|
|
82
|
+
error: !!o,
|
|
83
|
+
errorTextId: n
|
|
84
|
+
});
|
|
85
|
+
if (s(e, P))
|
|
86
|
+
return t.cloneElement(e, {
|
|
87
|
+
name: l ?? e.props.name,
|
|
88
|
+
mode: a,
|
|
89
|
+
error: !!o,
|
|
90
|
+
errorTextId: n
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return e;
|
|
94
|
+
}, x = () => /* @__PURE__ */ i("div", { children: [
|
|
95
|
+
c === "div" && /* @__PURE__ */ i("div", { className: C, children: [
|
|
96
|
+
r.legend && /* @__PURE__ */ p("h5", { className: g, children: r.legend }),
|
|
97
|
+
t.Children.map(r.children, u)
|
|
98
|
+
] }),
|
|
99
|
+
c === "fieldset" && /* @__PURE__ */ i("fieldset", { name: r.fieldsetName, className: C, children: [
|
|
100
|
+
r.legend && /* @__PURE__ */ p("legend", { className: g, children: r.legend }),
|
|
101
|
+
t.Children.map(r.children, u)
|
|
102
|
+
] })
|
|
103
|
+
] });
|
|
104
|
+
return /* @__PURE__ */ i("div", { "data-testid": r.testId, "data-analyticsid": D.FormGroup, className: z, ref: R, tabIndex: -1, children: [
|
|
105
|
+
r.title && /* @__PURE__ */ p(V, { className: B, htmlMarkup: "h4", appearance: "title4", margin: { marginTop: 0, marginBottom: o ? 1 : 2 }, children: r.title }),
|
|
106
|
+
b ? /* @__PURE__ */ p(h, { className: w, errorText: o, testId: W, errorTextId: n, children: x() }) : x()
|
|
107
|
+
] });
|
|
108
|
+
});
|
|
109
|
+
G.displayName = "FormGroup";
|
|
110
|
+
export {
|
|
111
|
+
G as F
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=FormGroup.js.map
|
package/FormGroup.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormGroup.js","sources":["../src/components/FormGroup/FormGroup.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormMode, FormSize } from '../../constants';\nimport { useUuid } from '../../hooks/useUuid';\nimport { isComponent } from '../../utils/component';\nimport Checkbox, { CheckboxProps } from '../Checkbox/Checkbox';\nimport ErrorWrapper from '../ErrorWrapper';\nimport FormLayout, { FormLayoutProps } from '../FormLayout';\nimport Input, { InputProps } from '../Input/Input';\nimport RadioButton, { RadioButtonProps, getRadioLabelClasses } from '../RadioButton/RadioButton';\nimport Select, { SelectProps } from '../Select';\nimport Textarea, { TextareaProps } from '../Textarea';\nimport Title from '../Title';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport type FormGroupTags = 'fieldset' | 'div';\n\nexport interface FormGroupProps {\n /** title for the the fieldset */\n title?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** Items in the FormGroup component */\n children?: React.ReactNode;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the errorWrapper. */\n errorWrapperClassName?: string;\n /** Adds custom classes to the fieldset element. */\n fieldsetClassName?: string;\n /** Changes the visuals of the formgroup */\n mode?: keyof typeof FormMode;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Error message */\n error?: string;\n /** Error text id */\n errorTextId?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the data-testid attribute for the error-wrapper. */\n errorWrapperTestId?: string;\n /** Unique name for the child input element */\n name?: string;\n /** Unique name for the fieldset */\n fieldsetName?: string;\n /** Sets div instead of fieldset tag */\n htmlMarkup?: FormGroupTags;\n /** Renders the error component (Default: true) */\n renderError?: boolean;\n}\n\nexport const FormGroup = React.forwardRef((props: FormGroupProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const {\n className,\n fieldsetClassName,\n mode = FormMode.onwhite,\n size = FormSize.medium,\n error,\n errorTextId,\n name,\n htmlMarkup = 'fieldset',\n renderError = true,\n errorWrapperClassName,\n errorWrapperTestId,\n } = props;\n const [checkedRadioId, setCheckedRadioId] = useState<string>();\n const radioGroupId = useUuid();\n const errorTextUuid = useUuid(errorTextId);\n const onDark = mode === FormMode.ondark;\n const isLarge = size === FormSize.large;\n const formGroupWrapperClasses = classNames(formGroupStyles['form-group-wrapper'], className);\n const titleClasses = classNames({\n [formGroupStyles['form-group-wrapper__title--on-dark']]: onDark && !error,\n });\n\n const legendClasses = classNames(formGroupStyles['field-set__legend'], {\n [formGroupStyles['field-set__legend--on-dark']]: onDark && !error,\n });\n\n const fieldsetClasses = classNames(formGroupStyles['field-set'], fieldsetClassName);\n\n const mapFormComponent = (child: React.ReactNode, index: number): React.ReactNode => {\n if (isComponent<FormLayoutProps>(child, FormLayout)) {\n return React.cloneElement(child, {\n size,\n mapHelper: mapFormComponent,\n });\n } else if (isComponent<FormGroupProps>(child, FormGroup)) {\n return React.cloneElement(child, {\n mode,\n size,\n error,\n renderError: false,\n errorTextId: errorTextUuid,\n });\n } else if (isComponent<CheckboxProps>(child, Checkbox)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n mode,\n size,\n error: !!error,\n errorTextId: errorTextUuid,\n });\n } else if (isComponent<RadioButtonProps>(child, RadioButton)) {\n const radioId = typeof child.props.inputId === 'undefined' ? radioGroupId + index : child.props.inputId;\n return React.cloneElement(child, {\n inputId: radioId,\n name: name ?? child.props.name,\n mode,\n size,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => {\n setCheckedRadioId(event.target.id);\n child.props.onChange && child.props.onChange(event);\n },\n error: !!error,\n errorTextId: errorTextUuid,\n labelClassNames: getRadioLabelClasses(radioId, mode as FormMode, isLarge, checkedRadioId),\n });\n } else if (isComponent<InputProps>(child, Input)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n mode,\n size,\n error: !!error,\n errorTextId: errorTextUuid,\n });\n } else if (isComponent<TextareaProps>(child, Textarea)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n mode,\n error: !!error,\n errorTextId: errorTextUuid,\n });\n } else if (isComponent<SelectProps>(child, Select)) {\n return React.cloneElement(child, {\n name: name ?? child.props.name,\n mode,\n error: !!error,\n errorTextId: errorTextUuid,\n });\n }\n return child;\n };\n\n const formGroupContent = (): React.ReactNode => {\n return (\n <div>\n {htmlMarkup === 'div' && (\n <div className={fieldsetClasses}>\n {props.legend && <h5 className={legendClasses}>{props.legend}</h5>}\n {React.Children.map(props.children, mapFormComponent)}\n </div>\n )}\n {htmlMarkup === 'fieldset' && (\n <fieldset name={props.fieldsetName} className={fieldsetClasses}>\n {props.legend && <legend className={legendClasses}>{props.legend}</legend>}\n {React.Children.map(props.children, mapFormComponent)}\n </fieldset>\n )}\n </div>\n );\n };\n\n return (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.FormGroup} className={formGroupWrapperClasses} ref={ref} tabIndex={-1}>\n {props.title && (\n <Title className={titleClasses} htmlMarkup={'h4'} appearance={'title4'} margin={{ marginTop: 0, marginBottom: error ? 1 : 2 }}>\n {props.title}\n </Title>\n )}\n {renderError ? (\n <ErrorWrapper className={errorWrapperClassName} errorText={error} testId={errorWrapperTestId} errorTextId={errorTextUuid}>\n {formGroupContent()}\n </ErrorWrapper>\n ) : (\n formGroupContent()\n )}\n </div>\n );\n});\n\nFormGroup.displayName = 'FormGroup';\n\nexport default FormGroup;\n"],"names":["FormGroup","React","props","ref","className","fieldsetClassName","mode","FormMode","size","FormSize","error","errorTextId","name","htmlMarkup","renderError","errorWrapperClassName","errorWrapperTestId","checkedRadioId","setCheckedRadioId","useState","radioGroupId","useUuid","errorTextUuid","onDark","isLarge","formGroupWrapperClasses","classNames","formGroupStyles","titleClasses","legendClasses","fieldsetClasses","mapFormComponent","child","index","isComponent","FormLayout","Checkbox","RadioButton","radioId","event","getRadioLabelClasses","Input","Textarea","Select","formGroupContent","jsxs","jsx","AnalyticsId","Title","ErrorWrapper"],"mappings":"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"}
|
package/FormLayout.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import s from "classnames";
|
|
4
|
+
import { FormSize as p, AnalyticsId as v } from "./constants.js";
|
|
5
|
+
import r from "./components/FormLayout/styles.module.scss";
|
|
6
|
+
var w = /* @__PURE__ */ ((o) => (o.one = "one", o.two = "two", o.three = "three", o.four = "four", o.five = "five", o))(w || {});
|
|
7
|
+
const N = l.forwardRef((o, m) => {
|
|
8
|
+
const { maxColumns: e = "one", colMinWidth: c = 300, size: f, className: n, mapHelper: t } = o, d = { "--min-col-width": `${c}px` }, h = s(
|
|
9
|
+
r["form-layout-container"],
|
|
10
|
+
{
|
|
11
|
+
[r["form-layout-container--large"]]: f === p.large
|
|
12
|
+
},
|
|
13
|
+
n
|
|
14
|
+
), u = s(r["form-layout-child"], {
|
|
15
|
+
[r["form-layout-child--two"]]: e === "two",
|
|
16
|
+
[r["form-layout-child--three"]]: e === "three",
|
|
17
|
+
[r["form-layout-child--four"]]: e === "four",
|
|
18
|
+
[r["form-layout-child--five"]]: e === "five"
|
|
19
|
+
/* five */
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ i(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
"data-testid": o.testId,
|
|
25
|
+
"data-analyticsid": v.FormLayout,
|
|
26
|
+
style: d,
|
|
27
|
+
className: h,
|
|
28
|
+
ref: m,
|
|
29
|
+
children: l.Children.map(o.children, (a, y) => /* @__PURE__ */ i("div", { className: u, children: t ? t(a, y) : a }))
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
N.displayName = "FormLayout";
|
|
34
|
+
export {
|
|
35
|
+
N as F,
|
|
36
|
+
w as a
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=FormLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormLayout.js","sources":["../src/components/FormLayout/FormLayout.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, FormSize } from '../../constants';\n\nimport formGroupStyles from './styles.module.scss';\n\nexport enum FormLayoutColumns {\n one = 'one',\n two = 'two',\n three = 'three',\n four = 'four',\n five = 'five',\n}\n\nexport interface FormLayoutProps {\n /** The max number of columns that will exist if space is available */\n maxColumns?: keyof typeof FormLayoutColumns;\n /** Sets the minimum width for the columns in pixels - this determines how many will fit on a row */\n colMinWidth?: number;\n /** Items in the FormLayout component */\n children?: React.ReactNode;\n /** Changes the visuals of the formgroup */\n size?: keyof typeof FormSize;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Function that helps map the form children */\n mapHelper?: (child: React.ReactNode, index: number) => React.ReactNode;\n}\n\nexport const FormLayout = React.forwardRef((props: FormLayoutProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const { maxColumns: columns = FormLayoutColumns.one, colMinWidth = 300, size, className, mapHelper } = props;\n\n const cssVariable = { '--min-col-width': `${colMinWidth}px` } as React.CSSProperties;\n const formLayoutContainerClasses = classNames(\n formGroupStyles['form-layout-container'],\n {\n [formGroupStyles['form-layout-container--large']]: size === FormSize.large,\n },\n className\n );\n const formLayoutChildClasses = classNames(formGroupStyles['form-layout-child'], {\n [formGroupStyles['form-layout-child--two']]: columns === FormLayoutColumns.two,\n [formGroupStyles['form-layout-child--three']]: columns === FormLayoutColumns.three,\n [formGroupStyles['form-layout-child--four']]: columns === FormLayoutColumns.four,\n [formGroupStyles['form-layout-child--five']]: columns === FormLayoutColumns.five,\n });\n\n return (\n <div\n data-testid={props.testId}\n data-analyticsid={AnalyticsId.FormLayout}\n style={cssVariable}\n className={formLayoutContainerClasses}\n ref={ref}\n >\n {React.Children.map(props.children, (child: React.ReactNode, index: number) => {\n return <div className={formLayoutChildClasses}>{mapHelper ? mapHelper(child, index) : child}</div>;\n })}\n </div>\n );\n});\n\nFormLayout.displayName = 'FormLayout';\n\nexport default FormLayout;\n"],"names":["FormLayoutColumns","FormLayout","React","props","ref","columns","colMinWidth","size","className","mapHelper","cssVariable","formLayoutContainerClasses","classNames","formGroupStyles","FormSize","formLayoutChildClasses","jsx","AnalyticsId","child","index"],"mappings":";;;;;AAQY,IAAAA,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,MAAM,OACNA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,OAAO,QALGA,IAAAA,KAAA,CAAA,CAAA;AAyBL,MAAMC,IAAaC,EAAM,WAAW,CAACC,GAAwBC,MAA4C;AACxG,QAAA,EAAE,YAAYC,IAAU,OAAuB,aAAAC,IAAc,KAAK,MAAAC,GAAM,WAAAC,GAAW,WAAAC,EAAc,IAAAN,GAEjGO,IAAc,EAAE,mBAAmB,GAAGJ,CAAW,QACjDK,IAA6BC;AAAA,IACjCC,EAAgB,uBAAuB;AAAA,IACvC;AAAA,MACE,CAACA,EAAgB,8BAA8B,CAAC,GAAGN,MAASO,EAAS;AAAA,IACvE;AAAA,IACAN;AAAA,EAAA,GAEIO,IAAyBH,EAAWC,EAAgB,mBAAmB,GAAG;AAAA,IAC9E,CAACA,EAAgB,wBAAwB,CAAC,GAAGR,MAAY;AAAA,IACzD,CAACQ,EAAgB,0BAA0B,CAAC,GAAGR,MAAY;AAAA,IAC3D,CAACQ,EAAgB,yBAAyB,CAAC,GAAGR,MAAY;AAAA,IAC1D,CAACQ,EAAgB,yBAAyB,CAAC,GAAGR,MAAY;AAAA;AAAA,EAAA,CAC3D;AAGC,SAAA,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAab,EAAM;AAAA,MACnB,oBAAkBc,EAAY;AAAA,MAC9B,OAAOP;AAAA,MACP,WAAWC;AAAA,MACX,KAAAP;AAAA,MAEC,YAAM,SAAS,IAAID,EAAM,UAAU,CAACe,GAAwBC,MACpD,gBAAAH,EAAC,SAAI,WAAWD,GAAyB,cAAYN,EAAUS,GAAOC,CAAK,IAAID,EAAM,CAAA,CAC7F;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;AAEDjB,EAAW,cAAc;"}
|
package/HelpBubble.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as l, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import x from "react";
|
|
3
|
+
import b from "classnames";
|
|
4
|
+
import { AnalyticsId as A } from "./constants.js";
|
|
5
|
+
import { A as j } from "./AnchorLink.js";
|
|
6
|
+
import { C as w } from "./Close.js";
|
|
7
|
+
import { P as I, a as P } from "./PopOver.js";
|
|
8
|
+
import r from "./components/HelpBubble/styles.module.scss";
|
|
9
|
+
const D = I, R = x.forwardRef((p, u) => {
|
|
10
|
+
const {
|
|
11
|
+
children: m,
|
|
12
|
+
className: d = "",
|
|
13
|
+
noCloseButton: o,
|
|
14
|
+
linkText: t = "Mer hjelp",
|
|
15
|
+
linkUrl: n,
|
|
16
|
+
linkTarget: h,
|
|
17
|
+
onLinkClick: s,
|
|
18
|
+
onClose: f,
|
|
19
|
+
closeAriaLabel: k,
|
|
20
|
+
// Props passed on to PopOver
|
|
21
|
+
showBubble: i,
|
|
22
|
+
helpBubbleId: C,
|
|
23
|
+
variant: B,
|
|
24
|
+
controllerRef: _,
|
|
25
|
+
role: a,
|
|
26
|
+
testId: N
|
|
27
|
+
} = p, e = a === "tooltip";
|
|
28
|
+
if (!i && !e)
|
|
29
|
+
return null;
|
|
30
|
+
const v = b(r.helpbubble, d), y = b(r.helpbubble__content, {
|
|
31
|
+
[r["helpbubble__content--close"]]: !o && !e
|
|
32
|
+
}), H = () => {
|
|
33
|
+
if (!e) {
|
|
34
|
+
if (s && t)
|
|
35
|
+
return /* @__PURE__ */ l("button", { className: r.helpbubble__link, onClick: s, type: "button", children: t });
|
|
36
|
+
if (n && t)
|
|
37
|
+
return /* @__PURE__ */ l(j, { href: n, target: h, children: t });
|
|
38
|
+
}
|
|
39
|
+
}, L = () => {
|
|
40
|
+
if (!(o || e))
|
|
41
|
+
return /* @__PURE__ */ l("div", { className: r.helpbubble__close, children: /* @__PURE__ */ l(w, { small: !0, onClick: f, ariaLabel: k }) });
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ l(
|
|
44
|
+
P,
|
|
45
|
+
{
|
|
46
|
+
id: C,
|
|
47
|
+
variant: B,
|
|
48
|
+
controllerRef: _,
|
|
49
|
+
role: a,
|
|
50
|
+
ref: u,
|
|
51
|
+
show: e && i,
|
|
52
|
+
testId: N,
|
|
53
|
+
children: /* @__PURE__ */ c("div", { className: v, "data-analyticsid": A.HelpBubble, children: [
|
|
54
|
+
L(),
|
|
55
|
+
/* @__PURE__ */ c("div", { className: y, children: [
|
|
56
|
+
m,
|
|
57
|
+
H()
|
|
58
|
+
] })
|
|
59
|
+
] })
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
R.displayName = "HelpBubble";
|
|
64
|
+
export {
|
|
65
|
+
R as H,
|
|
66
|
+
D as a
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=HelpBubble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelpBubble.js","sources":["../src/components/HelpBubble/HelpBubble.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport AnchorLink, { AnchorLinkTargets } from '../AnchorLink';\nimport Close from '../Close';\nimport PopOver, { PopOverProps, PopOverVariant } from '../PopOver';\n\nimport styles from './styles.module.scss';\n\nexport const HelpBubbleVariant = PopOverVariant;\n\ntype HelpBubbleRole = 'tooltip';\n\nexport interface HelpBubbleProps extends Pick<PopOverProps, 'children' | 'variant' | 'controllerRef' | 'role'> {\n /** Id of the HelpBubble */\n helpBubbleId?: string;\n /** Content shown inside HelpBubble. Note that if role=\"tooltip\", you must not include interactive/focusable elements. */\n children: React.ReactNode;\n /** Ref for the element the HelpBubble is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Adds custom classes to the element. */\n className?: string;\n /** Determines the placement of the helpbubble. Default: automatic positioning. */\n variant?: keyof typeof HelpBubbleVariant;\n /** Show the bubble. Default: false. */\n showBubble?: boolean;\n /** Hide the close button in the bubble. Close button is never rendered if role=\"tooltip\". */\n noCloseButton?: boolean;\n /** Visible text on the link. Link is never rendered if role=\"tooltip\". */\n linkText?: string;\n /** Url the link leads to */\n linkUrl?: string;\n /** Sets the target type of the link. _blank adds an arrow icon at the end of the link */\n linkTarget?: AnchorLinkTargets;\n /** Function is called when link is clicked */\n onLinkClick?: () => void;\n /** Function is called when user clicks the button */\n onClose?: () => void;\n /** aria-label to be passed onto Close */\n closeAriaLabel?: string;\n /** Sets role of the HelpBubble element. If set to \"tooltip\", */\n role?: HelpBubbleRole;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst HelpBubble = React.forwardRef<HTMLDivElement | SVGSVGElement, HelpBubbleProps>((props, ref) => {\n const {\n children,\n className = '',\n noCloseButton,\n linkText = 'Mer hjelp',\n linkUrl,\n linkTarget,\n onLinkClick,\n onClose,\n closeAriaLabel,\n // Props passed on to PopOver\n showBubble,\n helpBubbleId,\n variant,\n controllerRef,\n role,\n testId,\n } = props;\n\n const isTooltip = role === 'tooltip';\n\n if (!showBubble && !isTooltip) {\n return null;\n }\n\n const helpBubbleClasses = classNames(styles.helpbubble, className);\n\n const contentClasses = classNames(styles.helpbubble__content, {\n [styles['helpbubble__content--close']]: !noCloseButton && !isTooltip,\n });\n\n const renderLink = (): JSX.Element | undefined => {\n // Det er ikke tillatt med interaktive/fokuserbare elementer i role=\"tooltip\"\n if (isTooltip) {\n return;\n }\n if (onLinkClick && linkText) {\n return (\n <button className={styles.helpbubble__link} onClick={onLinkClick} type=\"button\">\n {linkText}\n </button>\n );\n } else if (linkUrl && linkText) {\n return (\n <AnchorLink href={linkUrl} target={linkTarget}>\n {linkText}\n </AnchorLink>\n );\n }\n };\n\n const renderCloseButton = (): JSX.Element | undefined => {\n if (noCloseButton || isTooltip) {\n return;\n }\n return (\n <div className={styles.helpbubble__close}>\n <Close small onClick={onClose} ariaLabel={closeAriaLabel} />\n </div>\n );\n };\n\n return (\n <PopOver\n id={helpBubbleId}\n variant={variant}\n controllerRef={controllerRef}\n role={role}\n ref={ref}\n show={isTooltip && showBubble}\n testId={testId}\n >\n <div className={helpBubbleClasses} data-analyticsid={AnalyticsId.HelpBubble}>\n {renderCloseButton()}\n <div className={contentClasses}>\n {children}\n {renderLink()}\n </div>\n </div>\n </PopOver>\n );\n});\n\nHelpBubble.displayName = 'HelpBubble';\n\nexport default HelpBubble;\n"],"names":["HelpBubbleVariant","PopOverVariant","HelpBubble","React","props","ref","children","className","noCloseButton","linkText","linkUrl","linkTarget","onLinkClick","onClose","closeAriaLabel","showBubble","helpBubbleId","variant","controllerRef","role","testId","isTooltip","helpBubbleClasses","classNames","styles","contentClasses","renderLink","jsx","AnchorLink","renderCloseButton","Close","PopOver","AnalyticsId","jsxs"],"mappings":";;;;;;;;AAWO,MAAMA,IAAoBC,GAqC3BC,IAAaC,EAAM,WAA4D,CAACC,GAAOC,MAAQ;AAC7F,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,eAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,gBAAAC;AAAA;AAAA,IAEA,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,MAAAC;AAAA,IACA,QAAAC;AAAA,EACE,IAAAhB,GAEEiB,IAAYF,MAAS;AAEvB,MAAA,CAACJ,KAAc,CAACM;AACX,WAAA;AAGT,QAAMC,IAAoBC,EAAWC,EAAO,YAAYjB,CAAS,GAE3DkB,IAAiBF,EAAWC,EAAO,qBAAqB;AAAA,IAC5D,CAACA,EAAO,4BAA4B,CAAC,GAAG,CAAChB,KAAiB,CAACa;AAAA,EAAA,CAC5D,GAEKK,IAAa,MAA+B;AAEhD,QAAI,CAAAL,GAGJ;AAAA,UAAIT,KAAeH;AAEf,eAAA,gBAAAkB,EAAC,YAAO,WAAWH,EAAO,kBAAkB,SAASZ,GAAa,MAAK,UACpE,UACHH,EAAA,CAAA;AAEJ,UAAWC,KAAWD;AACpB,iCACGmB,GAAW,EAAA,MAAMlB,GAAS,QAAQC,GAChC,UACHF,EAAA,CAAA;AAAA;AAAA,EAEJ,GAGIoB,IAAoB,MAA+B;AACvD,QAAI,EAAArB,KAAiBa;AAGrB,aACG,gBAAAM,EAAA,OAAA,EAAI,WAAWH,EAAO,mBACrB,UAAA,gBAAAG,EAACG,GAAM,EAAA,OAAK,IAAC,SAASjB,GAAS,WAAWC,GAAgB,EAC5D,CAAA;AAAA,EAAA;AAKF,SAAA,gBAAAa;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,IAAIf;AAAA,MACJ,SAAAC;AAAA,MACA,eAAAC;AAAA,MACA,MAAAC;AAAA,MACA,KAAAd;AAAA,MACA,MAAMgB,KAAaN;AAAA,MACnB,QAAAK;AAAA,MAEA,4BAAC,OAAI,EAAA,WAAWE,GAAmB,oBAAkBU,EAAY,YAC9D,UAAA;AAAA,QAAkBH,EAAA;AAAA,QACnB,gBAAAI,EAAC,OAAI,EAAA,WAAWR,GACb,UAAA;AAAA,UAAAnB;AAAA,UACAoB,EAAW;AAAA,QAAA,GACd;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AAEDxB,EAAW,cAAc;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as e, jsxs as g, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import l from "classnames";
|
|
3
|
+
import "./theme/grid.js";
|
|
4
|
+
import { useBreakpoint as H, Breakpoint as M } from "./hooks/useBreakpoint.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { AnalyticsId as u, IconSize as I } from "./constants.js";
|
|
7
|
+
import { I as x } from "./Icon.js";
|
|
8
|
+
import { L as T } from "./LazyIcon.js";
|
|
9
|
+
import { T as b } from "./Title.js";
|
|
10
|
+
import a from "./components/HighlightPanel/styles.module.scss";
|
|
11
|
+
var j = /* @__PURE__ */ ((t) => (t.medium = "medium", t.large = "large", t.fluid = "fluid", t))(j || {});
|
|
12
|
+
const _ = ({ className: t, size: n, children: s }) => /* @__PURE__ */ e("div", { className: t, "data-testid": "highlightpanel-wrapper", children: /* @__PURE__ */ e("div", { className: a.highlightpanel__row, children: /* @__PURE__ */ e("div", { className: l(a.highlightpanel__col, n === "medium" && a["highlightpanel__col--offset"]), children: s }) }) }), k = (t) => {
|
|
13
|
+
const { children: n, className: s } = t, i = l(a["highlightpanel__content-wrapper"], s);
|
|
14
|
+
return /* @__PURE__ */ e("div", { className: i, children: /* @__PURE__ */ e("div", { className: l(a.highlightpanel__row), children: n }) });
|
|
15
|
+
}, G = (t) => {
|
|
16
|
+
const {
|
|
17
|
+
children: n,
|
|
18
|
+
color: s = "white",
|
|
19
|
+
size: i = "medium",
|
|
20
|
+
testId: c,
|
|
21
|
+
svgIcon: r,
|
|
22
|
+
htmlMarkup: w = "div",
|
|
23
|
+
className: y,
|
|
24
|
+
contentWrapperClassName: C,
|
|
25
|
+
title: m,
|
|
26
|
+
titleHtmlMarkup: W = "h2"
|
|
27
|
+
} = t, N = H(), h = l(
|
|
28
|
+
a[`highlightpanel--${s}`],
|
|
29
|
+
a[`highlightpanel--${i}`],
|
|
30
|
+
r && a["highlightpanel--has-icon"],
|
|
31
|
+
{ container: i === "medium" || i === "large" },
|
|
32
|
+
y
|
|
33
|
+
), o = () => {
|
|
34
|
+
if (r) {
|
|
35
|
+
const f = i === "large" && N && N >= M.md ? I.Medium : I.Small, v = /* @__PURE__ */ e(b, { testId: "titleId", htmlMarkup: W, appearance: "title4", children: m });
|
|
36
|
+
return /* @__PURE__ */ g(z, { children: [
|
|
37
|
+
/* @__PURE__ */ g("div", { className: a.highlightpanel__icon, children: [
|
|
38
|
+
typeof r == "string" ? /* @__PURE__ */ e(T, { iconName: r, size: f }) : /* @__PURE__ */ e(x, { svgIcon: r, size: f }),
|
|
39
|
+
m && /* @__PURE__ */ e("div", { className: a.mobile, children: v })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ g("div", { className: a.highlightpanel__content, children: [
|
|
42
|
+
m && /* @__PURE__ */ e("div", { className: a.desktop, "aria-hidden": "true", children: v }),
|
|
43
|
+
n
|
|
44
|
+
] })
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
return n;
|
|
48
|
+
}, d = w, p = l(a["highlightpanel__content-wrapper"], C);
|
|
49
|
+
return i === "medium" ? /* @__PURE__ */ e(_, { className: h, size: i, children: /* @__PURE__ */ e(d, { className: p, "data-testid": c, "data-analyticsid": u.HighlightPanel, children: o() }) }) : i === "large" && r ? /* @__PURE__ */ e(_, { className: h, size: i, children: /* @__PURE__ */ e(k, { className: p, children: /* @__PURE__ */ e(
|
|
50
|
+
d,
|
|
51
|
+
{
|
|
52
|
+
className: l(a.highlightpanel__col, a["highlightpanel__col--large-with-icon"]),
|
|
53
|
+
"data-testid": c,
|
|
54
|
+
"data-analyticsid": u.HighlightPanel,
|
|
55
|
+
children: o()
|
|
56
|
+
}
|
|
57
|
+
) }) }) : i === "large" ? /* @__PURE__ */ e(_, { className: h, size: i, children: /* @__PURE__ */ e(k, { className: p, children: /* @__PURE__ */ e(
|
|
58
|
+
d,
|
|
59
|
+
{
|
|
60
|
+
className: l(a.highlightpanel__col, a["highlightpanel__col--offset"]),
|
|
61
|
+
"data-testid": c,
|
|
62
|
+
"data-analyticsid": u.HighlightPanel,
|
|
63
|
+
children: o()
|
|
64
|
+
}
|
|
65
|
+
) }) }) : i === "fluid" ? /* @__PURE__ */ e(d, { className: h, "data-testid": c, children: o() }) : null;
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
G as H,
|
|
69
|
+
j as a
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=HighlightPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HighlightPanel.js","sources":["../src/components/HighlightPanel/HighlightPanel.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { useBreakpoint, Breakpoint } from '../..';\nimport { AnalyticsId } from '../../constants';\nimport { PaletteNames } from '../../theme/palette';\nimport Icon, { SvgIcon, IconSize } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\nimport LazyIcon from '../LazyIcon';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport type HighlightPanelColors = Extract<PaletteNames, 'white' | 'neutral' | 'blueberry' | 'cherry'>;\n\nexport enum HighlightPanelSize {\n medium = 'medium',\n large = 'large',\n fluid = 'fluid',\n}\n\nexport type HighlightPanelTags = Exclude<\n keyof HTMLElementTagNameMap,\n 'dir' | 'font' | 'frame' | 'frameset' | 'marquee' | 'applet' | 'basefont' | 'search'\n>;\n\nexport interface HighlightPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the background color. Default: white */\n color?: HighlightPanelColors;\n /** Changes the size. Default: medium */\n size?: keyof typeof HighlightPanelSize;\n /** Adds an icon to the highlightpanel. */\n svgIcon?: SvgIcon | IconName;\n /** Changes the underlying element. Default: div */\n htmlMarkup?: HighlightPanelTags;\n /** Adds custom classes to the element. */\n className?: string;\n /** Adds custom classes to the content-wrapper */\n contentWrapperClassName?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Element that is set after the icon-element in the DOM, often a title-element */\n title?: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\ninterface WrapperProps {\n children?: React.ReactNode;\n className: string;\n size?: keyof typeof HighlightPanelSize;\n}\n\nconst Wrapper: React.FC<WrapperProps> = ({ className, size, children }) => (\n <div className={className} data-testid={'highlightpanel-wrapper'}>\n <div className={styles.highlightpanel__row}>\n <div className={classNames(styles.highlightpanel__col, size === HighlightPanelSize.medium && styles['highlightpanel__col--offset'])}>\n {children}\n </div>\n </div>\n </div>\n);\n\ninterface ContentWrapperProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst ContentWrapper: React.FC<ContentWrapperProps> = props => {\n const { children, className } = props;\n const contentWrapperClasses = classNames(styles['highlightpanel__content-wrapper'], className);\n\n return (\n <div className={contentWrapperClasses}>\n <div className={classNames(styles.highlightpanel__row)}>{children}</div>\n </div>\n );\n};\n\nconst HighlightPanel: React.FC<HighlightPanelProps> = props => {\n const {\n children,\n color = 'white',\n size = HighlightPanelSize.medium,\n testId,\n svgIcon,\n htmlMarkup = 'div',\n className,\n contentWrapperClassName,\n title,\n titleHtmlMarkup = 'h2',\n } = props;\n const breakpoint = useBreakpoint();\n\n const containerClassName = classNames(\n styles[`highlightpanel--${color}`],\n styles[`highlightpanel--${size}`],\n svgIcon && styles['highlightpanel--has-icon'],\n { container: size === 'medium' || size === 'large' },\n className\n );\n\n const renderContent = () => {\n if (svgIcon) {\n const iconSize = size === HighlightPanelSize.large && breakpoint && breakpoint >= Breakpoint.md ? IconSize.Medium : IconSize.Small;\n\n const titleElement = (\n <Title testId=\"titleId\" htmlMarkup={titleHtmlMarkup} appearance=\"title4\">\n {title}\n </Title>\n );\n\n return (\n <>\n <div className={styles.highlightpanel__icon}>\n {typeof svgIcon === 'string' ? <LazyIcon iconName={svgIcon} size={iconSize} /> : <Icon svgIcon={svgIcon} size={iconSize} />}\n {title && <div className={styles['mobile']}>{titleElement}</div>}\n </div>\n <div className={styles.highlightpanel__content}>\n {title && (\n <div className={styles['desktop']} aria-hidden=\"true\">\n {titleElement}\n </div>\n )}\n {children}\n </div>\n </>\n );\n }\n\n return children;\n };\n\n const CustomTag = htmlMarkup;\n\n const contentWrapperClasses = classNames(styles['highlightpanel__content-wrapper'], contentWrapperClassName);\n\n if (size === HighlightPanelSize.medium) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <CustomTag className={contentWrapperClasses} data-testid={testId} data-analyticsid={AnalyticsId.HighlightPanel}>\n {renderContent()}\n </CustomTag>\n </Wrapper>\n );\n }\n\n if (size === HighlightPanelSize.large && svgIcon) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightpanel__col, styles['highlightpanel__col--large-with-icon'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightPanel}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightPanelSize.large) {\n return (\n <Wrapper className={containerClassName} size={size}>\n <ContentWrapper className={contentWrapperClasses}>\n <CustomTag\n className={classNames(styles.highlightpanel__col, styles['highlightpanel__col--offset'])}\n data-testid={testId}\n data-analyticsid={AnalyticsId.HighlightPanel}\n >\n {renderContent()}\n </CustomTag>\n </ContentWrapper>\n </Wrapper>\n );\n }\n\n if (size === HighlightPanelSize.fluid) {\n return (\n <CustomTag className={containerClassName} data-testid={testId}>\n {renderContent()}\n </CustomTag>\n );\n }\n\n return null;\n};\n\nexport default HighlightPanel;\n"],"names":["HighlightPanelSize","Wrapper","className","size","children","jsx","styles","classNames","ContentWrapper","props","contentWrapperClasses","HighlightPanel","color","testId","svgIcon","htmlMarkup","contentWrapperClassName","title","titleHtmlMarkup","breakpoint","useBreakpoint","containerClassName","renderContent","iconSize","Breakpoint","IconSize","titleElement","Title","jsxs","Fragment","LazyIcon","Icon","CustomTag","AnalyticsId"],"mappings":"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"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as i, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l } from "react";
|
|
3
|
+
import s from "classnames";
|
|
4
|
+
import { useIsVisible as c } from "./hooks/useIsVisible.js";
|
|
5
|
+
import { useSize as g } from "./hooks/useSize.js";
|
|
6
|
+
import { useStopPropagation as N } from "./hooks/usestopPropagation.js";
|
|
7
|
+
import r from "./components/HorizontalScroll/styles.module.scss";
|
|
8
|
+
const d = "3px", V = ({ children: m, childWidth: h, testId: _, ...t }) => {
|
|
9
|
+
const o = l(null), a = l(null), e = l(null), f = c(a, 1, { root: o == null ? void 0 : o.current, rootMargin: d }, !0), u = c(e, 1, { root: o == null ? void 0 : o.current, rootMargin: d }, !0), { width: v = 0 } = g(o) || {}, p = h > v, z = s(r.horizontalscroll__viewport, p && r["horizontalscroll__viewport--overflow"]), n = t["aria-label"] || t["aria-labelledby"];
|
|
10
|
+
return N(o, ["touchstart", "touchmove"]), /* @__PURE__ */ i("div", { className: r.horizontalscroll, "data-testid": _, children: /* @__PURE__ */ b(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: z,
|
|
14
|
+
ref: o,
|
|
15
|
+
tabIndex: n ? 0 : void 0,
|
|
16
|
+
role: n ? "region" : void 0,
|
|
17
|
+
...t,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ i(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: s(
|
|
23
|
+
r.horizontalscroll__indicator,
|
|
24
|
+
r["horizontalscroll__indicator--left"],
|
|
25
|
+
!f && r["horizontalscroll__indicator--visible"]
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ i(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: s(
|
|
33
|
+
r.horizontalscroll__indicator,
|
|
34
|
+
r["horizontalscroll__indicator--right"],
|
|
35
|
+
!u && r["horizontalscroll__indicator--visible"]
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ i("div", { ref: a }),
|
|
40
|
+
m,
|
|
41
|
+
/* @__PURE__ */ i("div", { ref: e })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
) });
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
V as H
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=HorizontalScroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HorizontalScroll.js","sources":["../src/components/HorizontalScroll/HorizontalScroll.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useSize } from '../../hooks/useSize';\nimport { useStopPropagation } from '../../hooks/usestopPropagation';\nimport { AriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\n// Scrolle-indikator vises/skjules når det er x px igjen til venstre eller høyre side\nconst ROOT_MARGIN_OFFSET = '3px';\n\ninterface HorizontalScrollProps {\n children?: React.ReactNode;\n /**\n * Bredden på elementet som potensielt vil scrolle horisontalt i px\n */\n childWidth: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const HorizontalScroll: React.FC<HorizontalScrollProps & AriaLabelAttributes> = ({ children, childWidth, testId, ...rest }) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const leftRef = useRef<HTMLDivElement>(null);\n const rightRef = useRef<HTMLDivElement>(null);\n const leftIsVisible = useIsVisible(leftRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const rightIsVisible = useIsVisible(rightRef, 1, { root: viewportRef?.current, rootMargin: ROOT_MARGIN_OFFSET }, true);\n const { width: viewPortWidth = 0 } = useSize(viewportRef) || {};\n\n const isOverflowing = childWidth > viewPortWidth;\n const viewportClasses = classNames(styles.horizontalscroll__viewport, isOverflowing && styles['horizontalscroll__viewport--overflow']);\n const hasAriaAttributes = rest['aria-label'] || rest['aria-labelledby'];\n\n useStopPropagation(viewportRef, ['touchstart', 'touchmove']);\n\n return (\n <div className={styles.horizontalscroll} data-testid={testId}>\n {/* viewport-diven må ta tabIndex for å løse et annet UU-problem, at div med overflow: scroll må kunne navigeres med keyboard. */}\n {/* Enten aria-label eller aria-labelledbyid må settes */}\n <div\n className={viewportClasses}\n ref={viewportRef}\n tabIndex={hasAriaAttributes ? 0 : undefined}\n role={hasAriaAttributes ? 'region' : undefined}\n {...rest}\n >\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--left'],\n !leftIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div\n className={classNames(\n styles.horizontalscroll__indicator,\n styles['horizontalscroll__indicator--right'],\n !rightIsVisible && styles['horizontalscroll__indicator--visible']\n )}\n />\n <div ref={leftRef} />\n {children}\n <div ref={rightRef} />\n </div>\n </div>\n );\n};\n\nexport default HorizontalScroll;\n"],"names":["ROOT_MARGIN_OFFSET","HorizontalScroll","children","childWidth","testId","rest","viewportRef","useRef","leftRef","rightRef","leftIsVisible","useIsVisible","rightIsVisible","viewPortWidth","useSize","isOverflowing","viewportClasses","classNames","styles","hasAriaAttributes","useStopPropagation","jsxs","jsx"],"mappings":";;;;;;;AAYA,MAAMA,IAAqB,OAYdC,IAA0E,CAAC,EAAE,UAAAC,GAAU,YAAAC,GAAY,QAAAC,GAAQ,GAAGC,QAAW;AAC9H,QAAAC,IAAcC,EAAuB,IAAI,GACzCC,IAAUD,EAAuB,IAAI,GACrCE,IAAWF,EAAuB,IAAI,GACtCG,IAAgBC,EAAaH,GAAS,GAAG,EAAE,MAAMF,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC7GY,IAAiBD,EAAaF,GAAU,GAAG,EAAE,MAAMH,KAAA,gBAAAA,EAAa,SAAS,YAAYN,EAAmB,GAAG,EAAI,GAC/G,EAAE,OAAOa,IAAgB,MAAMC,EAAQR,CAAW,KAAK,IAEvDS,IAAgBZ,IAAaU,GAC7BG,IAAkBC,EAAWC,EAAO,4BAA4BH,KAAiBG,EAAO,sCAAsC,CAAC,GAC/HC,IAAoBd,EAAK,YAAY,KAAKA,EAAK,iBAAiB;AAEtE,SAAAe,EAAmBd,GAAa,CAAC,cAAc,WAAW,CAAC,qBAGxD,OAAI,EAAA,WAAWY,EAAO,kBAAkB,eAAad,GAGpD,UAAA,gBAAAiB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWL;AAAA,MACX,KAAKV;AAAA,MACL,UAAUa,IAAoB,IAAI;AAAA,MAClC,MAAMA,IAAoB,WAAW;AAAA,MACpC,GAAGd;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAiB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWL;AAAA,cACTC,EAAO;AAAA,cACPA,EAAO,mCAAmC;AAAA,cAC1C,CAACR,KAAiBQ,EAAO,sCAAsC;AAAA,YACjE;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAI;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWL;AAAA,cACTC,EAAO;AAAA,cACPA,EAAO,oCAAoC;AAAA,cAC3C,CAACN,KAAkBM,EAAO,sCAAsC;AAAA,YAClE;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAI,EAAC,OAAI,EAAA,KAAKd,EAAS,CAAA;AAAA,QAClBN;AAAA,QACD,gBAAAoB,EAAC,OAAI,EAAA,KAAKb,EAAU,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAExB,EAAA,CAAA;AAEJ;"}
|
package/Icon.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs as u, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import y from "classnames";
|
|
4
|
+
import { IconSize as c, AnalyticsId as v } from "./constants.js";
|
|
5
|
+
import { useUuid as w } from "./hooks/useUuid.js";
|
|
6
|
+
const z = ({
|
|
7
|
+
size: a,
|
|
8
|
+
isHovered: o,
|
|
9
|
+
normal: n,
|
|
10
|
+
normalHover: e,
|
|
11
|
+
xSmall: s,
|
|
12
|
+
xSmallHover: t,
|
|
13
|
+
xxSmall: i,
|
|
14
|
+
xxSmallHover: r
|
|
15
|
+
}) => a <= c.XXSmall && i && r ? o ? r : i : a <= c.XSmall && s && t ? o ? t : s : o ? e : n, N = f.forwardRef((a, o) => {
|
|
16
|
+
const {
|
|
17
|
+
svgIcon: n,
|
|
18
|
+
ariaLabel: e,
|
|
19
|
+
className: s = "",
|
|
20
|
+
size: t = c.Small,
|
|
21
|
+
color: i = "black",
|
|
22
|
+
hoverColor: r = i || "black",
|
|
23
|
+
isHovered: l = !1,
|
|
24
|
+
mode: h,
|
|
25
|
+
testId: I,
|
|
26
|
+
...g
|
|
27
|
+
} = a, p = f.createElement(n, {
|
|
28
|
+
size: t,
|
|
29
|
+
isHovered: l,
|
|
30
|
+
mode: h
|
|
31
|
+
}), d = w(), m = l ? r : i;
|
|
32
|
+
return /* @__PURE__ */ u(
|
|
33
|
+
"svg",
|
|
34
|
+
{
|
|
35
|
+
"data-testid": I,
|
|
36
|
+
"data-analyticsid": v.Icon,
|
|
37
|
+
ref: o,
|
|
38
|
+
className: y("hnds-style-icon", s),
|
|
39
|
+
role: e ? "img" : "presentation",
|
|
40
|
+
"aria-labelledby": e ? d : void 0,
|
|
41
|
+
focusable: !1,
|
|
42
|
+
"aria-hidden": e ? void 0 : !0,
|
|
43
|
+
viewBox: "0 0 48 48",
|
|
44
|
+
style: { minWidth: t, minHeight: t },
|
|
45
|
+
width: t,
|
|
46
|
+
height: t,
|
|
47
|
+
fill: m,
|
|
48
|
+
color: m,
|
|
49
|
+
...g,
|
|
50
|
+
children: [
|
|
51
|
+
e && /* @__PURE__ */ b("title", { id: d, children: e }),
|
|
52
|
+
p
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
N.displayName = "Icon";
|
|
58
|
+
export {
|
|
59
|
+
N as I,
|
|
60
|
+
z as g
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=Icon.js.map
|