@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
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import a, { useState as D, useRef as z, useEffect as v } from "react";
|
|
2
|
-
import M from "classnames";
|
|
3
|
-
import { AnalyticsId as Z } from "../../constants.js";
|
|
4
|
-
import { useSize as x } from "../../hooks/useSize.js";
|
|
5
|
-
import { useUuid as C } from "../../hooks/useUuid.js";
|
|
6
|
-
import { getAriaLabelAttributes as V } from "../../utils/accessibility.js";
|
|
7
|
-
import { Title as ee } from "../Title/Title.js";
|
|
8
|
-
import n from "../Slider/styles.module.scss";
|
|
9
|
-
const te = (s, k, f) => {
|
|
10
|
-
const [_, o] = D(s), p = (r) => {
|
|
11
|
-
r > f ? o(f) : r < k ? o(k) : o(r);
|
|
12
|
-
};
|
|
13
|
-
return v(() => {
|
|
14
|
-
p(s);
|
|
15
|
-
}, [k, f]), [_, p];
|
|
16
|
-
}, fe = ({
|
|
17
|
-
title: s,
|
|
18
|
-
ariaLabel: k,
|
|
19
|
-
labelLeft: f,
|
|
20
|
-
labelRight: _,
|
|
21
|
-
disabled: o = !1,
|
|
22
|
-
onChange: p,
|
|
23
|
-
steps: r,
|
|
24
|
-
step: g = 1,
|
|
25
|
-
minValue: i = 0,
|
|
26
|
-
maxValue: d = r ? r.length - 1 : 100,
|
|
27
|
-
selected: w = !0,
|
|
28
|
-
testId: K,
|
|
29
|
-
value: m
|
|
30
|
-
}) => {
|
|
31
|
-
const [L, U] = D(!1), [y, R] = D(typeof m > "u" ? w : !0), [c, u] = te(
|
|
32
|
-
typeof m > "u" ? (d - i) / 2 + i : m,
|
|
33
|
-
i,
|
|
34
|
-
d
|
|
35
|
-
), h = C(), N = C(), b = C(), P = z(null), j = z(null), { width: B } = x(P) || { width: 0 }, X = d / 10;
|
|
36
|
-
v(() => {
|
|
37
|
-
const t = () => {
|
|
38
|
-
U(!1);
|
|
39
|
-
};
|
|
40
|
-
return document.addEventListener("pointerup", t), () => {
|
|
41
|
-
document.removeEventListener("pointerup", t);
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
|
-
const $ = (t) => {
|
|
45
|
-
var T;
|
|
46
|
-
const e = ((T = P.current) == null ? void 0 : T.getBoundingClientRect().x) ?? 0, l = (t - e) / B, E = d - i;
|
|
47
|
-
let S = l * E + i;
|
|
48
|
-
return S = Math.round(S / g) * g, S = Math.max(i, Math.min(d, S)), S;
|
|
49
|
-
};
|
|
50
|
-
v(() => {
|
|
51
|
-
const t = (e) => {
|
|
52
|
-
if (!o && L) {
|
|
53
|
-
const l = $(e.clientX);
|
|
54
|
-
u(l);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return document.addEventListener("pointermove", t), () => {
|
|
58
|
-
document.removeEventListener("pointermove", t);
|
|
59
|
-
};
|
|
60
|
-
}, [L]), v(() => {
|
|
61
|
-
m !== c && typeof m < "u" && (A(), u(m));
|
|
62
|
-
}, [m]), v(() => {
|
|
63
|
-
!o && y && p && p(c);
|
|
64
|
-
}, [c, y]), v(() => {
|
|
65
|
-
typeof m > "u" && w !== y && R(w);
|
|
66
|
-
}, [w]);
|
|
67
|
-
const A = () => {
|
|
68
|
-
y === !1 && R(!0);
|
|
69
|
-
}, H = (t) => {
|
|
70
|
-
if (o) return;
|
|
71
|
-
let e = !1;
|
|
72
|
-
switch (t.key) {
|
|
73
|
-
case "ArrowLeft":
|
|
74
|
-
case "ArrowDown":
|
|
75
|
-
u(c - g), e = !0;
|
|
76
|
-
break;
|
|
77
|
-
case "PageDown":
|
|
78
|
-
u(c - X), e = !0;
|
|
79
|
-
break;
|
|
80
|
-
case "ArrowRight":
|
|
81
|
-
case "ArrowUp":
|
|
82
|
-
u(c + g), e = !0;
|
|
83
|
-
break;
|
|
84
|
-
case "PageUp":
|
|
85
|
-
u(c + X), e = !0;
|
|
86
|
-
break;
|
|
87
|
-
case "Home":
|
|
88
|
-
u(i), e = !0;
|
|
89
|
-
break;
|
|
90
|
-
case "End":
|
|
91
|
-
u(d), e = !0;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
e && (A(), t.preventDefault(), t.stopPropagation());
|
|
95
|
-
}, O = (t) => {
|
|
96
|
-
var l;
|
|
97
|
-
if (o) return;
|
|
98
|
-
const e = $(t.clientX);
|
|
99
|
-
u(e), (l = j.current) == null || l.focus();
|
|
100
|
-
}, W = (t) => {
|
|
101
|
-
var e;
|
|
102
|
-
o || (U(!0), A(), t.preventDefault(), t.stopPropagation(), (e = j.current) == null || e.focus());
|
|
103
|
-
}, q = d !== i ? B / (d - i) * (c - i) : 0, F = () => {
|
|
104
|
-
const t = r ? Math.round((c - i) / g) : null;
|
|
105
|
-
if (r && t !== null && t >= 0 && t < r.length) {
|
|
106
|
-
const e = r[t], l = e.emojiUniCode, E = typeof e.label < "u" ? e.label.toString() : void 0;
|
|
107
|
-
return l && E ? `${l} ${E}` : l || E;
|
|
108
|
-
}
|
|
109
|
-
}, G = V({
|
|
110
|
-
label: k,
|
|
111
|
-
id: (() => {
|
|
112
|
-
if (s && f && _)
|
|
113
|
-
return [h, N, b].join(" ");
|
|
114
|
-
if (s && f)
|
|
115
|
-
return [h, N].join(" ");
|
|
116
|
-
if (s && _)
|
|
117
|
-
return [h, b].join(" ");
|
|
118
|
-
if (s)
|
|
119
|
-
return h;
|
|
120
|
-
})(),
|
|
121
|
-
prefer: "label"
|
|
122
|
-
}), I = (t, e) => ({ left: `${t / (e - 1) * 100}%` }), J = () => /* @__PURE__ */ a.createElement("div", { className: n["slider__emoji-container"] }, r == null ? void 0 : r.map((t, e) => t.emojiUniCode && /* @__PURE__ */ a.createElement(
|
|
123
|
-
"div",
|
|
124
|
-
{
|
|
125
|
-
"aria-hidden": !0,
|
|
126
|
-
key: "emoji" + e,
|
|
127
|
-
className: n.slider__emoji,
|
|
128
|
-
style: I(e, r.length)
|
|
129
|
-
},
|
|
130
|
-
t.emojiUniCode
|
|
131
|
-
))), Q = () => r == null ? void 0 : r.map((t, e) => /* @__PURE__ */ a.createElement("div", { key: "step" + e, className: n.slider__track__step, style: I(e, r.length) })), Y = () => /* @__PURE__ */ a.createElement("div", { className: n["slider__value-container"] }, r == null ? void 0 : r.map((t, e) => typeof t.label < "u" && /* @__PURE__ */ a.createElement(
|
|
132
|
-
"div",
|
|
133
|
-
{
|
|
134
|
-
"aria-hidden": !0,
|
|
135
|
-
key: "label" + e,
|
|
136
|
-
className: n.slider__value,
|
|
137
|
-
style: I(e, r.length)
|
|
138
|
-
},
|
|
139
|
-
t.label
|
|
140
|
-
)));
|
|
141
|
-
return /* @__PURE__ */ a.createElement("div", { className: n.slider, "data-testid": K, "data-analyticsid": Z.Slider }, s && /* @__PURE__ */ a.createElement(ee, { className: n.slider__title, htmlMarkup: "h3", margin: 0, appearance: "title3", id: h }, s), /* @__PURE__ */ a.createElement("div", { className: n["slider__content-container"] }, J(), /* @__PURE__ */ a.createElement(
|
|
142
|
-
"div",
|
|
143
|
-
{
|
|
144
|
-
ref: P,
|
|
145
|
-
className: M(n["slider__track-wrapper"], o && n["slider__track-wrapper--disabled"]),
|
|
146
|
-
onClick: O,
|
|
147
|
-
onPointerDown: W
|
|
148
|
-
},
|
|
149
|
-
/* @__PURE__ */ a.createElement("div", { className: M(n.slider__track, o && n["slider__track--disabled"]) }, Q()),
|
|
150
|
-
/* @__PURE__ */ a.createElement(
|
|
151
|
-
"div",
|
|
152
|
-
{
|
|
153
|
-
role: o ? void 0 : "slider",
|
|
154
|
-
ref: j,
|
|
155
|
-
className: M(n.slider__marker, {
|
|
156
|
-
[n["slider__marker--disabled"]]: o,
|
|
157
|
-
[n["slider__marker--selected"]]: y
|
|
158
|
-
}),
|
|
159
|
-
style: {
|
|
160
|
-
left: `${q}px`
|
|
161
|
-
},
|
|
162
|
-
onKeyDown: H,
|
|
163
|
-
"aria-valuenow": c,
|
|
164
|
-
"aria-valuetext": F(),
|
|
165
|
-
"aria-valuemin": i,
|
|
166
|
-
"aria-valuemax": d,
|
|
167
|
-
tabIndex: o ? void 0 : 0,
|
|
168
|
-
"aria-disabled": o,
|
|
169
|
-
...G
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
), Y()), (f || _) && /* @__PURE__ */ a.createElement("span", { className: n.slider__options }, /* @__PURE__ */ a.createElement("span", { id: N }, f), /* @__PURE__ */ a.createElement("span", { id: b }, _)));
|
|
173
|
-
};
|
|
174
|
-
export {
|
|
175
|
-
fe as Slider,
|
|
176
|
-
fe as default
|
|
177
|
-
};
|
|
178
|
-
//# sourceMappingURL=Slider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.js","sources":["../../../src/components/Slider/Slider.tsx"],"sourcesContent":["import React, { useEffect, useState, useRef } from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { useUuid } from '../../hooks/useUuid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nconst useSafeNumberValue = (initial: number, min: number, max: number): [number, (value: number) => void] => {\n const [value, setValue] = useState(initial);\n\n const setSafeValue = (newValue: number): void => {\n if (newValue > max) {\n setValue(max);\n } else if (newValue < min) {\n setValue(min);\n } else {\n setValue(newValue);\n }\n };\n\n useEffect(() => {\n setSafeValue(initial);\n }, [min, max]);\n\n return [value, setSafeValue];\n};\n\nexport type SliderStep = {\n label?: number | string;\n emojiUniCode?: string;\n};\n\nexport interface SliderProps {\n /**\tSets the title of the slider. */\n title?: string;\n /** Adds the left hand label to the element. */\n labelLeft?: string;\n /** Adds the right hand label to the element. */\n labelRight?: string;\n /**\tSets aria-label of the slider. */\n ariaLabel?: string;\n /** Disables the slider element. */\n disabled?: boolean;\n /** Sets the minimum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n minValue?: number;\n /** Sets the maximum allowed value on the slider - this overrides the use of steps prop for minValue/maxValue. */\n maxValue?: number;\n /** Function to be called when the value state has changed. */\n onChange?: (value: number) => void;\n /** If set to false will only trigger onChange once a user interaction has been made, updates to this prop will be taken into account - true by default */\n selected?: boolean;\n /** Sets the steps data for the slider */\n steps?: SliderStep[];\n /** Sets the step to move per point in the slider */\n step?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets the value of the slider */\n value?: number;\n}\n\nexport const Slider: React.FC<SliderProps> = ({\n title,\n ariaLabel,\n labelLeft,\n labelRight,\n disabled = false,\n onChange,\n steps,\n step = 1,\n minValue = 0,\n maxValue = steps ? steps.length - 1 : 100,\n selected = true,\n testId,\n value,\n}) => {\n const [isMoving, setIsMoving] = useState(false);\n const [selectedState, setSelectedState] = useState(typeof value === 'undefined' ? selected : true);\n const [valueState, setValueState] = useSafeNumberValue(\n typeof value === 'undefined' ? (maxValue - minValue) / 2 + minValue : value,\n minValue,\n maxValue\n );\n\n const titleId = useUuid();\n const labelLeftId = useUuid();\n const labelRightId = useUuid();\n const trackRef = useRef<HTMLDivElement>(null);\n const markerRef = useRef<HTMLDivElement>(null);\n const { width: trackWidth } = useSize(trackRef) || { width: 0 };\n const largeStep = maxValue / 10;\n\n useEffect(() => {\n const handlePointerUp = (): void => {\n setIsMoving(false);\n };\n\n document.addEventListener('pointerup', handlePointerUp);\n\n return () => {\n document.removeEventListener('pointerup', handlePointerUp);\n };\n }, []);\n\n const getValueBasedOnMarkerPosition = (markerPosition: number): number => {\n const trackPosition = trackRef.current?.getBoundingClientRect().x ?? 0;\n\n // Calculate the normalized position (0 to 1) of the marker along the track\n const normalizedPosition = (markerPosition - trackPosition) / trackWidth;\n const valueRange = maxValue - minValue;\n // Calculate the value without considering the step\n let value = normalizedPosition * valueRange + minValue;\n // Adjust the value to account for the step increment\n const stepCount = Math.round(value / step);\n value = stepCount * step;\n value = Math.max(minValue, Math.min(maxValue, value));\n\n return value;\n };\n\n useEffect(() => {\n const handlePointerMove = (e: PointerEvent): void => {\n if (!disabled && isMoving) {\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValueState(newValue);\n }\n };\n\n document.addEventListener('pointermove', handlePointerMove);\n\n return () => {\n document.removeEventListener('pointermove', handlePointerMove);\n };\n }, [isMoving]);\n\n useEffect(() => {\n if (value !== valueState && typeof value !== 'undefined') {\n handleSelected();\n setValueState(value);\n }\n }, [value]);\n\n useEffect(() => {\n if (!disabled && selectedState && onChange) {\n onChange(valueState);\n }\n }, [valueState, selectedState]);\n\n useEffect(() => {\n if (typeof value === 'undefined' && selected !== selectedState) {\n setSelectedState(selected);\n }\n }, [selected]);\n\n const handleSelected = (): void => {\n if (selectedState === false) {\n setSelectedState(true);\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n let flag = false;\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowDown':\n setValueState(valueState - step);\n flag = true;\n break;\n case 'PageDown':\n setValueState(valueState - largeStep);\n flag = true;\n break;\n case 'ArrowRight':\n case 'ArrowUp':\n setValueState(valueState + step);\n flag = true;\n break;\n case 'PageUp':\n setValueState(valueState + largeStep);\n flag = true;\n break;\n case 'Home':\n setValueState(minValue);\n flag = true;\n break;\n case 'End':\n setValueState(maxValue);\n flag = true;\n break;\n default:\n break;\n }\n\n if (flag) {\n handleSelected();\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const handleTrackClick: React.MouseEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n const newValue = getValueBasedOnMarkerPosition(e.clientX);\n setValueState(newValue);\n markerRef.current?.focus();\n };\n\n const handlePointerDown: React.PointerEventHandler<HTMLDivElement> = e => {\n if (disabled) return;\n\n setIsMoving(true);\n handleSelected();\n\n e.preventDefault();\n e.stopPropagation();\n\n markerRef.current?.focus();\n };\n\n const markerXPos = maxValue !== minValue ? (trackWidth / (maxValue - minValue)) * (valueState - minValue) : 0;\n\n const getAriaValueText = (): string | undefined => {\n const stepIndex = steps ? Math.round((valueState - minValue) / step) : null;\n\n if (steps && stepIndex !== null && stepIndex >= 0 && stepIndex < steps.length) {\n const step = steps[stepIndex];\n const emojiCode = step.emojiUniCode;\n const label = typeof step.label !== 'undefined' ? step.label.toString() : undefined;\n\n return emojiCode && label ? `${emojiCode} ${label}` : emojiCode || label;\n }\n\n return undefined;\n };\n\n const getAriaLabeledById = (): string | undefined => {\n if (title && labelLeft && labelRight) {\n return [titleId, labelLeftId, labelRightId].join(' ');\n }\n if (title && labelLeft) {\n return [titleId, labelLeftId].join(' ');\n }\n if (title && labelRight) {\n return [titleId, labelRightId].join(' ');\n }\n if (title) {\n return titleId;\n }\n };\n\n const ariaLabelAttributes = getAriaLabelAttributes({\n label: ariaLabel,\n id: getAriaLabeledById(),\n prefer: 'label',\n });\n\n const getXPositionStyling = (index: number, stepsLength: number): { left: string } => {\n return { left: `${(index / (stepsLength - 1)) * 100}%` };\n };\n\n const renderEmojies = (): React.ReactNode => {\n return (\n <div className={styles['slider__emoji-container']}>\n {steps?.map((step, index) => {\n return (\n step.emojiUniCode && (\n <div\n aria-hidden={true}\n key={'emoji' + index}\n className={styles['slider__emoji']}\n style={getXPositionStyling(index, steps.length)}\n >\n {step.emojiUniCode}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n const renderSteps = (): React.ReactNode => {\n return steps?.map((_step, index) => {\n return <div key={'step' + index} className={styles['slider__track__step']} style={getXPositionStyling(index, steps.length)} />;\n });\n };\n\n const renderStepLabels = (): React.ReactNode => {\n return (\n <div className={styles['slider__value-container']}>\n {steps?.map((step, index) => {\n return (\n typeof step.label !== 'undefined' && (\n <div\n aria-hidden={true}\n key={'label' + index}\n className={styles['slider__value']}\n style={getXPositionStyling(index, steps.length)}\n >\n {step.label}\n </div>\n )\n );\n })}\n </div>\n );\n };\n\n return (\n <div className={styles.slider} data-testid={testId} data-analyticsid={AnalyticsId.Slider}>\n {title && (\n <Title className={styles['slider__title']} htmlMarkup={'h3'} margin={0} appearance={'title3'} id={titleId}>\n {title}\n </Title>\n )}\n <div className={styles['slider__content-container']}>\n {renderEmojies()}\n {/* Komponenten er tilgjengelig for mus/keyboard gjennom bruk av slideren */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n ref={trackRef}\n className={classNames(styles['slider__track-wrapper'], disabled && styles['slider__track-wrapper--disabled'])}\n onClick={handleTrackClick}\n onPointerDown={handlePointerDown}\n >\n <div className={classNames(styles.slider__track, disabled && styles['slider__track--disabled'])}>{renderSteps()}</div>\n <div\n role={disabled ? undefined : 'slider'}\n ref={markerRef}\n className={classNames(styles.slider__marker, {\n [styles['slider__marker--disabled']]: disabled,\n [styles['slider__marker--selected']]: selectedState,\n })}\n style={{\n left: `${markerXPos}px`,\n }}\n onKeyDown={handleKeyDown}\n aria-valuenow={valueState}\n aria-valuetext={getAriaValueText()}\n aria-valuemin={minValue}\n aria-valuemax={maxValue}\n tabIndex={disabled ? undefined : 0}\n aria-disabled={disabled}\n {...ariaLabelAttributes}\n />\n </div>\n {renderStepLabels()}\n </div>\n {(labelLeft || labelRight) && (\n <span className={styles.slider__options}>\n <span id={labelLeftId}>{labelLeft}</span>\n <span id={labelRightId}>{labelRight}</span>\n </span>\n )}\n </div>\n );\n};\n\nexport default Slider;\n"],"names":["useSafeNumberValue","initial","min","max","value","setValue","useState","setSafeValue","newValue","useEffect","Slider","title","ariaLabel","labelLeft","labelRight","disabled","onChange","steps","step","minValue","maxValue","selected","testId","isMoving","setIsMoving","selectedState","setSelectedState","valueState","setValueState","titleId","useUuid","labelLeftId","labelRightId","trackRef","useRef","markerRef","trackWidth","useSize","largeStep","handlePointerUp","getValueBasedOnMarkerPosition","markerPosition","trackPosition","_a","normalizedPosition","valueRange","handlePointerMove","handleSelected","handleKeyDown","e","flag","handleTrackClick","handlePointerDown","markerXPos","getAriaValueText","stepIndex","emojiCode","label","ariaLabelAttributes","getAriaLabelAttributes","getXPositionStyling","index","stepsLength","renderEmojies","React","styles","renderSteps","_step","renderStepLabels","AnalyticsId","Title","classNames"],"mappings":";;;;;;;;AAYA,MAAMA,KAAqB,CAACC,GAAiBC,GAAaC,MAAmD;AAC3G,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAASL,CAAO,GAEpCM,IAAe,CAACC,MAA2B;AAC/C,IAAIA,IAAWL,IACbE,EAASF,CAAG,IACHK,IAAWN,IACpBG,EAASH,CAAG,IAEZG,EAASG,CAAQ;AAAA,EACnB;AAGF,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAaN,CAAO;AAAA,EAAA,GACnB,CAACC,GAAKC,CAAG,CAAC,GAEN,CAACC,GAAOG,CAAY;AAC7B,GAoCaG,KAAgC,CAAC;AAAA,EAC5C,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAA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@
|
|
|
1
|
-
{"version":3,"file":"Spacer.js","sources":["../../../src/components/Spacer/Spacer.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { SpacerSizes } from './../../theme/spacers';\nimport { AnalyticsId } from '../../constants';\n\nimport spacerStyles from './styles.module.scss';\n\nexport interface SpacerProps {\n /** Sets the size of the spacer. */\n size?: SpacerSizes;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst Spacer = React.forwardRef(function SpacerForwardedRef(props: SpacerProps, ref: React.ForwardedRef<HTMLElement>) {\n const { size = 's', className, testId } = props;\n const spacerClasses = classNames(\n spacerStyles.spacer,\n {\n [spacerStyles['spacer--4xs']]: size === '4xs',\n [spacerStyles['spacer--3xs']]: size === '3xs',\n [spacerStyles['spacer--2xs']]: size === '2xs',\n [spacerStyles['spacer--xs']]: size === 'xs',\n [spacerStyles['spacer--s']]: size === 's',\n [spacerStyles['spacer--m']]: size === 'm',\n [spacerStyles['spacer--l']]: size === 'l',\n [spacerStyles['spacer--xl']]: size === 'xl',\n [spacerStyles['spacer--2xl']]: size === '2xl',\n [spacerStyles['spacer--3xl']]: size === '3xl',\n [spacerStyles['spacer--4xl']]: size === '4xl',\n [spacerStyles['spacer--5xl']]: size === '5xl',\n [spacerStyles['spacer--6xl']]: size === '6xl',\n },\n className\n );\n\n return <span className={spacerClasses} ref={ref} data-testid={testId} data-analyticsid={AnalyticsId.Spacer}></span>;\n});\n\nexport default Spacer;\n"],"names":["Spacer","React","props","ref","size","className","testId","spacerClasses","classNames","spacerStyles","AnalyticsId"],"mappings":";;;;AAkBA,MAAMA,IAASC,EAAM,WAAW,SAA4BC,GAAoBC,GAAsC;AACpH,QAAM,EAAE,MAAAC,IAAO,KAAK,WAAAC,GAAW,QAAAC,MAAWJ,GACpCK,IAAgBC;AAAA,IACpBC,EAAa;AAAA,IACb;AAAA,MACE,CAACA,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,YAAY,CAAC,GAAGL,MAAS;AAAA,MACvC,CAACK,EAAa,WAAW,CAAC,GAAGL,MAAS;AAAA,MACtC,CAACK,EAAa,WAAW,CAAC,GAAGL,MAAS;AAAA,MACtC,CAACK,EAAa,WAAW,CAAC,GAAGL,MAAS;AAAA,MACtC,CAACK,EAAa,YAAY,CAAC,GAAGL,MAAS;AAAA,MACvC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,MACxC,CAACK,EAAa,aAAa,CAAC,GAAGL,MAAS;AAAA,IAC1C;AAAA,IACAC;AAAA,EAAA;AAGK,SAAAJ,gBAAAA,EAAA,cAAC,UAAK,WAAWM,GAAe,KAAAJ,GAAU,eAAaG,GAAQ,oBAAkBI,EAAY,OAAQ,CAAA;AAC9G,CAAC;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import t from "react";
|
|
2
|
-
import l from "classnames";
|
|
3
|
-
import "../../theme/grid.js";
|
|
4
|
-
import "../../hooks/useBreakpoint.js";
|
|
5
|
-
import { FormMode as d, AnalyticsId as k, IconSize as E } from "../../constants.js";
|
|
6
|
-
import { getColor as m } from "../../theme/currys/color.js";
|
|
7
|
-
import { Icon as a } from "../Icon/Icon.js";
|
|
8
|
-
import w from "../Icons/Attachment.js";
|
|
9
|
-
import v from "../Icons/Change.js";
|
|
10
|
-
import C from "../Icons/Group.js";
|
|
11
|
-
import N from "../Icons/NoAccess.js";
|
|
12
|
-
import n from "../StatusDot/styles.module.scss";
|
|
13
|
-
var c = ((e) => (e[e.onwhite = d.onwhite] = "onwhite", e[e.ondark = d.ondark] = "ondark", e))(c || {}), y = /* @__PURE__ */ ((e) => (e.info = "info", e.warning = "warning", e.alert = "alert", e.cancelled = "cancelled", e.active = "active", e.transparent = "transparent", e.recurring = "recurring", e.group = "group", e.noaccess = "noaccess", e.attachment = "attachment", e))(y || {});
|
|
14
|
-
const b = ({ mode: e, variant: o }) => {
|
|
15
|
-
const r = { color: e === c.ondark ? m("white") : m("black"), size: E.XXSmall, mode: e };
|
|
16
|
-
return o === "recurring" ? /* @__PURE__ */ t.createElement(a, { ...r, svgIcon: v }) : o === "group" ? /* @__PURE__ */ t.createElement(a, { ...r, svgIcon: C }) : o === "noaccess" ? /* @__PURE__ */ t.createElement(a, { ...r, svgIcon: N, color: m("cherry", 600) }) : o === "attachment" ? /* @__PURE__ */ t.createElement(a, { ...r, svgIcon: w }) : null;
|
|
17
|
-
}, H = (e) => {
|
|
18
|
-
const { id: o, mode: s = c.onwhite, variant: r = "info", text: i, className: p, testId: f } = e, u = r === "recurring" || r === "group" || r === "noaccess" || r === "attachment", g = r === "cancelled", h = l(n.statusdot, g && n["statusdot--cancelled"], p), I = l(n.statusdot__dot, {
|
|
19
|
-
...u ? {} : { [n[`statusdot__dot--${r}`]]: !0 },
|
|
20
|
-
[n["statusdot__dot--on-dark"]]: s === c.ondark
|
|
21
|
-
}), _ = l(s === c.ondark && n["statusdot__label--on-dark"]);
|
|
22
|
-
return /* @__PURE__ */ t.createElement("span", { id: o, className: h, "data-testid": f, "data-analyticsid": k.StatusDot }, /* @__PURE__ */ t.createElement("span", { className: I }, /* @__PURE__ */ t.createElement(b, { mode: s, variant: r })), /* @__PURE__ */ t.createElement("span", { className: _ }, i));
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
c as StatusDotModes,
|
|
26
|
-
y as StatusDotVariant,
|
|
27
|
-
H as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=StatusDot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDot.js","sources":["../../../src/components/StatusDot/StatusDot.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { IconSize } from '../..';\nimport { AnalyticsId, FormMode } from '../../constants';\nimport { getColor } from '../../theme/currys';\nimport { Icon } from '../Icon';\nimport Attachment from '../Icons/Attachment';\nimport Change from '../Icons/Change';\nimport Group from '../Icons/Group';\nimport NoAccess from '../Icons/NoAccess';\n\nimport styles from './styles.module.scss';\n\nexport enum StatusDotModes {\n onwhite = FormMode.onwhite,\n ondark = FormMode.ondark,\n}\n\nexport enum StatusDotVariant {\n info = 'info',\n warning = 'warning',\n alert = 'alert',\n cancelled = 'cancelled',\n active = 'active',\n transparent = 'transparent',\n recurring = 'recurring',\n group = 'group',\n noaccess = 'noaccess',\n attachment = 'attachment',\n}\n\nexport interface StatusDotIconProps {\n /** Defines the color of the icon */\n mode?: keyof typeof StatusDotModes;\n /** The variant defines style formatting and what icon to use */\n variant?: keyof typeof StatusDotVariant;\n}\n\nconst StatusDotIcon: React.FC<StatusDotIconProps> = ({ mode, variant }) => {\n const color = mode === StatusDotModes.ondark ? getColor('white') : getColor('black');\n const iconProps = { color, size: IconSize.XXSmall, mode };\n\n if (variant === StatusDotVariant.recurring) {\n return <Icon {...iconProps} svgIcon={Change} />;\n } else if (variant === StatusDotVariant.group) {\n return <Icon {...iconProps} svgIcon={Group} />;\n } else if (variant === StatusDotVariant.noaccess) {\n return <Icon {...iconProps} svgIcon={NoAccess} color={getColor('cherry', 600)} />;\n } else if (variant === StatusDotVariant.attachment) {\n return <Icon {...iconProps} svgIcon={Attachment} />;\n }\n\n return null;\n};\n\nexport interface StatusDotProps {\n /** id that is placed on the wrapper */\n id?: string;\n /** Defines the color mode, onwhite, ondark etc. */\n mode?: keyof typeof StatusDotModes;\n /** Visual variants for the statusdot */\n variant?: keyof typeof StatusDotVariant;\n /** Text placed to the right of the statusdot */\n text: string;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst StatusDot: React.FC<StatusDotProps> = props => {\n const { id, mode = StatusDotModes.onwhite, variant = StatusDotVariant.info, text, className, testId } = props;\n\n const hasIcon =\n variant === StatusDotVariant.recurring ||\n variant === StatusDotVariant.group ||\n variant === StatusDotVariant.noaccess ||\n variant === StatusDotVariant.attachment;\n\n const isCancelled = variant === StatusDotVariant.cancelled;\n\n const statusDotClasses = classNames(styles['statusdot'], isCancelled && styles['statusdot--cancelled'], className);\n const dotClasses = classNames(styles['statusdot__dot'], {\n ...(hasIcon ? {} : { [styles[`statusdot__dot--${variant}`]]: true }),\n [styles['statusdot__dot--on-dark']]: mode === StatusDotModes.ondark,\n });\n const labelClasses = classNames(mode === StatusDotModes.ondark && styles['statusdot__label--on-dark']);\n\n return (\n <span id={id} className={statusDotClasses} data-testid={testId} data-analyticsid={AnalyticsId.StatusDot}>\n <span className={dotClasses}>\n <StatusDotIcon mode={mode} variant={variant} />\n </span>\n <span className={labelClasses}>{text}</span>\n </span>\n );\n};\n\nexport default StatusDot;\n"],"names":["StatusDotModes","FormMode","StatusDotVariant","StatusDotIcon","mode","variant","iconProps","getColor","IconSize","React","Icon","Change","Group","NoAccess","Attachment","StatusDot","props","id","text","className","testId","hasIcon","isCancelled","statusDotClasses","classNames","styles","dotClasses","labelClasses","AnalyticsId"],"mappings":";;;;;;;;;;;;AAeY,IAAAA,KAAL,CAAKA,OACVA,EAAAA,EAAA,UAAUC,EAAS,OAAnB,IAAA,WACAD,EAAAA,EAAA,SAASC,EAAS,MAAlB,IAAA,UAFUD,IAAAA,KAAA,CAAA,CAAA,GAKAE,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,UAAU,WACVA,EAAA,QAAQ,SACRA,EAAA,YAAY,aACZA,EAAA,SAAS,UACTA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,aAAa,cAVHA,IAAAA,KAAA,CAAA,CAAA;AAoBZ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AAQ,oBAAkBQ,EAAY,UAAA,GAC3FnB,gBAAAA,EAAA,cAAA,QAAA,EAAK,WAAWiB,EACf,GAAAjB,gBAAAA,EAAA,cAACN,GAAc,EAAA,MAAAC,GAAY,SAAAC,GAAkB,CAC/C,GACAI,gBAAAA,EAAA,cAAC,QAAK,EAAA,WAAWkB,EAAe,GAAAT,CAAK,CACvC;AAEJ;"}
|
package/components/Step/Step.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import { AnalyticsId as d } from "../../constants.js";
|
|
3
|
-
import { StepButtons as n } from "../StepButtons/StepButtons.js";
|
|
4
|
-
import i from "../Step/styles.module.scss";
|
|
5
|
-
const E = ({
|
|
6
|
-
stepper: t,
|
|
7
|
-
children: c,
|
|
8
|
-
backButton: a,
|
|
9
|
-
forwardButton: s,
|
|
10
|
-
additionalButtons: m,
|
|
11
|
-
cancelButton: r,
|
|
12
|
-
stickyButtons: l = !1,
|
|
13
|
-
testId: p
|
|
14
|
-
}) => {
|
|
15
|
-
const o = a || s || m || r;
|
|
16
|
-
return /* @__PURE__ */ e.createElement("div", { "data-testid": p, "data-analyticsid": d.Step }, t && /* @__PURE__ */ e.createElement("div", { className: i.step__stepper }, t), /* @__PURE__ */ e.createElement("div", { className: i.step__content }, c), o && /* @__PURE__ */ e.createElement(
|
|
17
|
-
n,
|
|
18
|
-
{
|
|
19
|
-
backButton: a,
|
|
20
|
-
forwardButton: s,
|
|
21
|
-
additionalButtons: m,
|
|
22
|
-
cancelButton: r,
|
|
23
|
-
sticky: l
|
|
24
|
-
}
|
|
25
|
-
));
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
E as default
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=Step.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Step.js","sources":["../../../src/components/Step/Step.tsx"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\nimport { ButtonProps } from '../Button';\nimport StepButtons from '../StepButtons';\nimport { StepperProps } from '../Stepper';\n\nimport styles from './styles.module.scss';\n\nexport interface StepProps {\n /** Stepper viser fremdriften */\n stepper?: React.ReactElement<StepperProps>;\n /** Innhold i steget */\n children: React.ReactNode;\n /** Knapp for å gå tilbake. Vises med \"outline\" variant. */\n backButton?: React.ReactElement<ButtonProps>;\n /** Knapp for å gå videre. Vises med \"fill\" variant. */\n forwardButton?: React.ReactElement<ButtonProps>;\n /** Ekstra knapper. Valgfritt utseende. */\n additionalButtons?: React.ReactElement<ButtonProps>[];\n /** Knapp for å avbryte eller fortsette senere. Vises med \"borderless\" variant. */\n cancelButton?: React.ReactElement<ButtonProps>;\n /** Knappene vil vises sticky nederst på skjermen dersom innholdet i Step tar mer plass enn vinduet. Default: false */\n stickyButtons?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst Step: React.FC<StepProps> = ({\n stepper,\n children,\n backButton,\n forwardButton,\n additionalButtons,\n cancelButton,\n stickyButtons = false,\n testId,\n}) => {\n const hasNavigation = backButton || forwardButton || additionalButtons || cancelButton;\n\n return (\n <div data-testid={testId} data-analyticsid={AnalyticsId.Step}>\n {stepper && <div className={styles.step__stepper}>{stepper}</div>}\n <div className={styles.step__content}>{children}</div>\n {hasNavigation && (\n <StepButtons\n backButton={backButton}\n forwardButton={forwardButton}\n additionalButtons={additionalButtons}\n cancelButton={cancelButton}\n sticky={stickyButtons}\n />\n )}\n </div>\n );\n};\n\nexport default Step;\n"],"names":["Step","stepper","children","backButton","forwardButton","additionalButtons","cancelButton","stickyButtons","testId","hasNavigation","React","AnalyticsId","styles","StepButtons"],"mappings":";;;;AA4BA,MAAMA,IAA4B,CAAC;AAAA,EACjC,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,QAAAC;AACF,MAAM;AACE,QAAAC,IAAgBN,KAAcC,KAAiBC,KAAqBC;AAGxE,SAAAI,gBAAAA,EAAA,cAAC,SAAI,eAAaF,GAAQ,oBAAkBG,EAAY,KAAA,GACrDV,KAAWS,gBAAAA,EAAA,cAAC,OAAI,EAAA,WAAWE,EAAO,cAAgB,GAAAX,CAAQ,GAC1DS,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWE,EAAO,cAAA,GAAgBV,CAAS,GAC/CO,KACCC,gBAAAA,EAAA;AAAA,IAACG;AAAA,IAAA;AAAA,MACC,YAAAV;AAAA,MACA,eAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,QAAQC;AAAA,IAAA;AAAA,EAAA,CAGd;AAEJ;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import n from "classnames";
|
|
3
|
-
import { AnalyticsId as m } from "../../constants.js";
|
|
4
|
-
import t from "../StepButtons/styles.module.scss";
|
|
5
|
-
const f = (r) => {
|
|
6
|
-
const { backButton: s, forwardButton: a, additionalButtons: o, cancelButton: l, sticky: u = !1, testId: i } = r, c = n(t.stepbuttons, u && t["stepbuttons--has-sticky-buttons"]);
|
|
7
|
-
return s || a || o || l ? /* @__PURE__ */ e.createElement("div", { className: c, "data-testid": i, "data-analyticsid": m.StepButtons }, (s || a) && /* @__PURE__ */ e.createElement("div", { className: t.stepbuttons__buttons }, s && e.cloneElement(s, {
|
|
8
|
-
variant: "outline",
|
|
9
|
-
wrapperClassName: n(t["stepbuttons__button--back"])
|
|
10
|
-
}), a && e.cloneElement(a, {
|
|
11
|
-
variant: "fill",
|
|
12
|
-
wrapperClassName: n(t["stepbuttons__button--forward"])
|
|
13
|
-
})), o && /* @__PURE__ */ e.createElement("div", { className: n(t.stepbuttons__buttons, t["stepbuttons__buttons--additional"]) }, o), l && /* @__PURE__ */ e.createElement("div", { className: t.stepbuttons__buttons }, e.cloneElement(l, {
|
|
14
|
-
variant: "borderless"
|
|
15
|
-
}))) : null;
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
f as StepButtons,
|
|
19
|
-
f as default
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=StepButtons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StepButtons.js","sources":["../../../src/components/StepButtons/StepButtons.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { ButtonProps } from '../Button';\n\nimport styles from './styles.module.scss';\n\nexport interface StepButtonsProps {\n /** Knapp for å gå tilbake. Vises med \"outline\" variant. */\n backButton?: React.ReactElement<ButtonProps>;\n /** Knapp for å gå videre. Vises med \"fill\" variant. */\n forwardButton?: React.ReactElement<ButtonProps>;\n /** Ekstra knapper. Valgfritt utseende. */\n additionalButtons?: React.ReactElement<ButtonProps>[];\n /** Knapp for å avbryte eller fortsette senere. Vises med \"borderless\" variant. */\n cancelButton?: React.ReactElement<ButtonProps>;\n /** Knappene vil vises sticky nederst på skjermen. Default: false */\n sticky?: boolean;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const StepButtons: React.FC<StepButtonsProps> = props => {\n const { backButton, forwardButton, additionalButtons, cancelButton, sticky = false, testId } = props;\n\n const navigationClasses = classNames(styles.stepbuttons, sticky && styles['stepbuttons--has-sticky-buttons']);\n\n if (backButton || forwardButton || additionalButtons || cancelButton) {\n return (\n <div className={navigationClasses} data-testid={testId} data-analyticsid={AnalyticsId.StepButtons}>\n {(backButton || forwardButton) && (\n <div className={styles.stepbuttons__buttons}>\n {backButton &&\n React.cloneElement(backButton, {\n variant: 'outline',\n wrapperClassName: classNames(styles['stepbuttons__button--back']),\n })}\n {forwardButton &&\n React.cloneElement(forwardButton, {\n variant: 'fill',\n wrapperClassName: classNames(styles['stepbuttons__button--forward']),\n })}\n </div>\n )}\n {additionalButtons && (\n <div className={classNames(styles.stepbuttons__buttons, styles['stepbuttons__buttons--additional'])}>{additionalButtons}</div>\n )}\n {cancelButton && (\n <div className={styles.stepbuttons__buttons}>\n {React.cloneElement(cancelButton, {\n variant: 'borderless',\n })}\n </div>\n )}\n </div>\n );\n }\n return null;\n};\n\nexport default StepButtons;\n"],"names":["StepButtons","props","backButton","forwardButton","additionalButtons","cancelButton","sticky","testId","navigationClasses","classNames","styles","AnalyticsId","React"],"mappings":";;;;AAwBO,MAAMA,IAA0C,CAASC,MAAA;AACxD,QAAA,EAAE,YAAAC,GAAY,eAAAC,GAAe,mBAAAC,GAAmB,cAAAC,GAAc,QAAAC,IAAS,IAAO,QAAAC,EAAW,IAAAN,GAEzFO,IAAoBC,EAAWC,EAAO,aAAaJ,KAAUI,EAAO,iCAAiC,CAAC;AAExG,SAAAR,KAAcC,KAAiBC,KAAqBC,oCAEnD,OAAI,EAAA,WAAWG,GAAmB,eAAaD,GAAQ,oBAAkBI,EAAY,YAAA,IAClFT,KAAcC,MACdS,gBAAAA,EAAA,cAAC,SAAI,WAAWF,EAAO,wBACpBR,KACCU,EAAM,aAAaV,GAAY;AAAA,IAC7B,SAAS;AAAA,IACT,kBAAkBO,EAAWC,EAAO,2BAA2B,CAAC;AAAA,EACjE,CAAA,GACFP,KACCS,EAAM,aAAaT,GAAe;AAAA,IAChC,SAAS;AAAA,IACT,kBAAkBM,EAAWC,EAAO,8BAA8B,CAAC;AAAA,EACpE,CAAA,CACL,GAEDN,KACCQ,gBAAAA,EAAA,cAAC,SAAI,WAAWH,EAAWC,EAAO,sBAAsBA,EAAO,kCAAkC,CAAC,KAAIN,CAAkB,GAEzHC,KACEO,gBAAAA,EAAA,cAAA,OAAA,EAAI,WAAWF,EAAO,qBAAA,GACpBE,EAAM,aAAaP,GAAc;AAAA,IAChC,SAAS;AAAA,EACV,CAAA,CACH,CAEJ,IAGG;AACT;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import d from "react";
|
|
2
|
-
import l from "classnames";
|
|
3
|
-
import { STEPPER_PADDING_X_PX as m } from "./utils.js";
|
|
4
|
-
import e from "../Stepper/styles.module.scss";
|
|
5
|
-
const y = ({ index: o, completed: p, distanceBetweenDots: s, position: t }) => {
|
|
6
|
-
const r = l(
|
|
7
|
-
e.stepper__dot,
|
|
8
|
-
p && e["stepper__dot--completed"],
|
|
9
|
-
t && e[`stepper__dot--${t}`]
|
|
10
|
-
), a = !t && typeof o < "u" && typeof s < "u" ? { left: `${o * s + m}px` } : void 0;
|
|
11
|
-
return /* @__PURE__ */ d.createElement("span", { className: r, style: a, "data-testid": "dot" });
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
y as default
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=Dot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dot.js","sources":["../../../src/components/Stepper/Dot.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { STEPPER_PADDING_X_PX } from './utils';\n\nimport styles from './styles.module.scss';\n\ninterface DotProps {\n index?: number;\n completed: boolean;\n distanceBetweenDots?: number;\n position?: 'left' | 'right';\n}\n\nconst Dot: React.FC<DotProps> = ({ index, completed, distanceBetweenDots, position }) => {\n const classes = classNames(\n styles.stepper__dot,\n completed && styles['stepper__dot--completed'],\n position && styles[`stepper__dot--${position}`]\n );\n const positionWithStyle = !position && typeof index !== 'undefined' && typeof distanceBetweenDots !== 'undefined';\n const style: React.HTMLAttributes<HTMLSpanElement>['style'] = positionWithStyle\n ? { left: `${index * distanceBetweenDots + STEPPER_PADDING_X_PX}px` }\n : undefined;\n\n return <span className={classes} style={style} data-testid=\"dot\" />;\n};\n\nexport default Dot;\n"],"names":["Dot","index","completed","distanceBetweenDots","position","classes","classNames","styles","style","STEPPER_PADDING_X_PX"],"mappings":";;;;AAeA,MAAMA,IAA0B,CAAC,EAAE,OAAAC,GAAO,WAAAC,GAAW,qBAAAC,GAAqB,UAAAC,QAAe;AACvF,QAAMC,IAAUC;AAAA,IACdC,EAAO;AAAA,IACPL,KAAaK,EAAO,yBAAyB;AAAA,IAC7CH,KAAYG,EAAO,iBAAiBH,CAAQ,EAAE;AAAA,EAAA,GAG1CI,IADoB,CAACJ,KAAY,OAAOH,IAAU,OAAe,OAAOE,IAAwB,MAElG,EAAE,MAAM,GAAGF,IAAQE,IAAsBM,CAAoB,KAC7D,IAAA;AAEJ,yCAAQ,QAAK,EAAA,WAAWJ,GAAS,OAAAG,GAAc,eAAY,MAAM,CAAA;AACnE;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import l from "./Dot.js";
|
|
3
|
-
const p = ({ allowedValues: m, currentValue: o, distanceBetweenDots: r }) => /* @__PURE__ */ e.createElement(e.Fragment, null, m.map((t, a) => /* @__PURE__ */ e.createElement(l, { index: a, key: t, completed: t < o, distanceBetweenDots: r })));
|
|
4
|
-
export {
|
|
5
|
-
p as default
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=DotList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DotList.js","sources":["../../../src/components/Stepper/DotList.tsx"],"sourcesContent":["import React from 'react';\n\nimport Dot from './Dot';\n\ninterface DotListProps {\n allowedValues: number[];\n currentValue: number;\n distanceBetweenDots: number;\n}\n\nconst Dots: React.FC<DotListProps> = ({ allowedValues, currentValue, distanceBetweenDots }) => (\n <>\n {allowedValues.map((value, index) => (\n <Dot index={index} key={value} completed={value < currentValue} distanceBetweenDots={distanceBetweenDots} />\n ))}\n </>\n);\n\nexport default Dots;\n"],"names":["Dots","allowedValues","currentValue","distanceBetweenDots","React","value","index","Dot"],"mappings":";;AAUM,MAAAA,IAA+B,CAAC,EAAE,eAAAC,GAAe,cAAAC,GAAc,qBAAAC,EAAoB,MAEpFC,gBAAAA,EAAA,cAAAA,EAAA,UAAA,MAAAH,EAAc,IAAI,CAACI,GAAOC,MACzBF,gBAAAA,EAAA,cAACG,GAAI,EAAA,OAAAD,GAAc,KAAKD,GAAO,WAAWA,IAAQH,GAAc,qBAAAC,EAA0C,CAAA,CAC3G,CACH;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import e, { useRef as d } from "react";
|
|
2
|
-
import u from "./Dot.js";
|
|
3
|
-
import V from "./DotList.js";
|
|
4
|
-
import { getAllowedValues as k, getMaximumDots as M, getDistanceBetweenDots as N, getValidatedProps as P, getMarkerPosition as $ } from "./utils.js";
|
|
5
|
-
import { AnalyticsId as R } from "../../constants.js";
|
|
6
|
-
import { useSize as f } from "../../hooks/useSize.js";
|
|
7
|
-
import { getAriaLabelAttributes as S } from "../../utils/accessibility.js";
|
|
8
|
-
import s from "../Stepper/styles.module.scss";
|
|
9
|
-
const X = ({ ariaLabelledById: g, ariaLabel: w, value: x, min: b = 0, max: h = 2, testId: D }) => {
|
|
10
|
-
const n = d(null), i = d(null), { width: E = 0 } = f(n) || {}, { width: m = 0 } = f(i) || {}, { validatedValue: t, validatedMin: o, validatedMax: a } = P(x, b, h), r = k(o, a), v = r.indexOf(t), A = M(E), p = N(m, r.length), c = $(p, v), l = r.length <= A, _ = t === a, y = S({ label: w, id: g });
|
|
11
|
-
return /* @__PURE__ */ e.createElement("div", { className: s["stepper-wrapper"], ref: n }, /* @__PURE__ */ e.createElement(
|
|
12
|
-
"span",
|
|
13
|
-
{
|
|
14
|
-
role: "progressbar",
|
|
15
|
-
...y,
|
|
16
|
-
"aria-valuenow": t,
|
|
17
|
-
"aria-valuemin": o,
|
|
18
|
-
"aria-valuemax": a,
|
|
19
|
-
className: s.stepper,
|
|
20
|
-
style: {
|
|
21
|
-
backgroundPositionX: `${_ ? m : c}px`
|
|
22
|
-
},
|
|
23
|
-
ref: i,
|
|
24
|
-
"data-testid": D,
|
|
25
|
-
"data-analyticsid": R.Stepper
|
|
26
|
-
},
|
|
27
|
-
l && /* @__PURE__ */ e.createElement(V, { allowedValues: r, currentValue: t, distanceBetweenDots: p }),
|
|
28
|
-
!l && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(u, { completed: t > o, position: "left" }), /* @__PURE__ */ e.createElement(u, { completed: t === a, position: "right" })),
|
|
29
|
-
/* @__PURE__ */ e.createElement("span", { className: s.stepper__marker, style: { left: `${c}px` } })
|
|
30
|
-
), !l && /* @__PURE__ */ e.createElement("span", { className: s.stepper__number }, `${t}/${a}`));
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
X as default
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=Stepper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sources":["../../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import React, { useRef } from 'react';\n\nimport Dot from './Dot';\nimport DotList from './DotList';\nimport { getMaximumDots, getDistanceBetweenDots, getMarkerPosition, getAllowedValues, getValidatedProps } from './utils';\nimport { AnalyticsId } from '../../constants';\nimport { useSize } from '../../hooks/useSize';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\n\nimport styles from './styles.module.scss';\n\nexport interface StepperProps {\n /**\n * Sets aria-label of the stepper. ariaLabel or ariaLabelledById MUST be set!\n */\n ariaLabel?: string;\n /**\n * Sets aria-labelledby of the stepper. ariaLabel or ariaLabelledById MUST be set!\n */\n ariaLabelledById?: string;\n /**\n * Current value. Must be between min and max\n */\n value?: number;\n /**\n * Minimum value\n */\n min?: number;\n /**\n * Maximum value\n */\n max?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst Stepper: React.FC<StepperProps> = ({ ariaLabelledById, ariaLabel, value, min = 0, max = 2, testId }) => {\n const wrapperRef = useRef<HTMLDivElement>(null);\n const ref = useRef<HTMLSpanElement>(null);\n const { width: wrapperWidth = 0 } = useSize(wrapperRef) || {};\n const { width: stepperWidth = 0 } = useSize(ref) || {};\n\n const { validatedValue, validatedMin, validatedMax } = getValidatedProps(value, min, max);\n const allowedValues = getAllowedValues(validatedMin, validatedMax);\n const index = allowedValues.indexOf(validatedValue);\n const maximumDots = getMaximumDots(wrapperWidth);\n const distanceBetweenDots = getDistanceBetweenDots(stepperWidth, allowedValues.length);\n const markerPosition = getMarkerPosition(distanceBetweenDots, index);\n\n const showAllDots = allowedValues.length <= maximumDots;\n const isCompleted = validatedValue === validatedMax;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n\n return (\n <div className={styles['stepper-wrapper']} ref={wrapperRef}>\n <span\n role=\"progressbar\"\n {...ariaLabelAttributes}\n aria-valuenow={validatedValue}\n aria-valuemin={validatedMin}\n aria-valuemax={validatedMax}\n className={styles.stepper}\n style={{\n backgroundPositionX: `${isCompleted ? stepperWidth : markerPosition}px`,\n }}\n ref={ref}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Stepper}\n >\n {showAllDots && <DotList allowedValues={allowedValues} currentValue={validatedValue} distanceBetweenDots={distanceBetweenDots} />}\n {!showAllDots && (\n <>\n <Dot completed={validatedValue > validatedMin} position=\"left\" />\n <Dot completed={validatedValue === validatedMax} position=\"right\" />\n </>\n )}\n <span className={styles.stepper__marker} style={{ left: `${markerPosition}px` }} />\n </span>\n {!showAllDots && <span className={styles.stepper__number}>{`${validatedValue}/${validatedMax}`}</span>}\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["Stepper","ariaLabelledById","ariaLabel","value","min","max","testId","wrapperRef","useRef","ref","wrapperWidth","useSize","stepperWidth","validatedValue","validatedMin","validatedMax","getValidatedProps","allowedValues","getAllowedValues","index","maximumDots","getMaximumDots","distanceBetweenDots","getDistanceBetweenDots","markerPosition","getMarkerPosition","showAllDots","isCompleted","ariaLabelAttributes","getAriaLabelAttributes","styles","React","AnalyticsId","DotList","Dot"],"mappings":";;;;;;;;AAoCM,MAAAA,IAAkC,CAAC,EAAE,kBAAAC,GAAkB,WAAAC,GAAW,OAAAC,GAAO,KAAAC,IAAM,GAAG,KAAAC,IAAM,GAAG,QAAAC,QAAa;AACtG,QAAAC,IAAaC,EAAuB,IAAI,GACxCC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QAAK,EAAA,WAAWD,EAAO,iBAAiB,OAAO,EAAE,MAAM,GAAGN,CAAc,KAAQ,EAAA,CAAA;AAAA,EAAA,GAElF,CAACE,KAAeK,gBAAAA,EAAA,cAAC,QAAK,EAAA,WAAWD,EAAO,gBAAA,GAAkB,GAAGjB,CAAc,IAAIE,CAAY,EAAG,CACjG;AAEJ;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const c = 8, s = (t, e) => t < e ? t : e - 1, d = (t, e) => e < t ? t : e, _ = (t, e, o) => typeof t > "u" || t < e ? e : t > o ? o : t, M = (t) => Math.floor(t / 28), i = (t, e) => (t - 24) / (e - 1), l = (t, e) => t * e, D = (t, e) => Array.from(Array(e - t + 1), (o, a) => a + t), A = (t, e, o) => {
|
|
2
|
-
const a = s(e, o), n = d(a, o);
|
|
3
|
-
return { validatedValue: _(t, a, n), validatedMin: a, validatedMax: n };
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
c as STEPPER_PADDING_X_PX,
|
|
7
|
-
D as getAllowedValues,
|
|
8
|
-
i as getDistanceBetweenDots,
|
|
9
|
-
l as getMarkerPosition,
|
|
10
|
-
M as getMaximumDots,
|
|
11
|
-
d as getValidatedMax,
|
|
12
|
-
s as getValidatedMin,
|
|
13
|
-
A as getValidatedProps,
|
|
14
|
-
_ as getValidatedValue
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/Stepper/utils.ts"],"sourcesContent":["/**\n * Minimum avstand fra markør til prikk\n */\nconst MARKER_DOT_MIN_DISTANCE_PX = 4;\n\n/**\n * Bredde på markør\n */\nconst MARKER_WIDTH_PX = 24;\n\n/**\n * Horisontal padding på stepper\n */\nexport const STEPPER_PADDING_X_PX = 8;\n\n/**\n * Valider at minimum-verdi er innenfor gyldig område\n * @param min Mimimum-verdi\n * @param max Maksimum-verdi\n * @returns Mimimum-verdi, ikke større enn eller lik maksimum-verdi\n */\nexport const getValidatedMin = (min: number, max: number): number => (min < max ? min : max - 1);\n\n/**\n * Valider at maksimum-verdi er innenfor gyldig område\n * @param min Mimimum-verdi\n * @param max Maksimum-verdi\n * @returns Maksimum-verdi, ikke mindre enn minimum-verdi\n */\nexport const getValidatedMax = (min: number, max: number): number => (max < min ? min : max);\n\n/**\n * Valider at verdi er innenfor gyldig område\n * @param value Nåværende verdi\n * @param min Mimimum-verdi\n * @param max Maksimum-verdi\n * @returns Verdi, ikke mindre enn 0, ikke mer enn max\n */\nexport const getValidatedValue = (value: number | undefined, min: number, max: number): number => {\n if (typeof value === 'undefined' || value < min) {\n return min;\n }\n\n return value > max ? max : value;\n};\n\n/**\n * Finn antall prikker det er plass til\n * @param stepperWidth Bredde på stepper\n * @returns Antall prikker\n */\nexport const getMaximumDots = (stepperWidth: number): number => Math.floor(stepperWidth / (MARKER_WIDTH_PX + MARKER_DOT_MIN_DISTANCE_PX));\n\n/**\n * Beregn riktig distance mellom prikker\n * @param stepperWidth Bredde på stepper\n * @param dots Antall prikker som skal vises\n * @returns Distanse mellom prikker\n */\nexport const getDistanceBetweenDots = (stepperWidth: number, dots: number): number => (stepperWidth - MARKER_WIDTH_PX) / (dots - 1);\n\n/**\n * Beregn riktig plassering av markør\n * @param distanceBetweenDots Distanse mellom prikker\n * @param index Nåværende verdi i stepper\n * @returns Plassering til markør fra venstre\n */\nexport const getMarkerPosition = (distanceBetweenDots: number, index: number): number => distanceBetweenDots * index;\n\n/**\n * Lag liste med tillate verdier fra min til maks\n * @param min Mimimum-verdi\n * @param max Maksimum-verdi\n * @returns Liste med verdier\n */\nexport const getAllowedValues = (min: number, max: number): number[] => Array.from(Array(max - min + 1), (_, index) => index + min);\n\n/**\n * Valider props som skal brukes til beregning av posisjon m.m.\n * @param value Nåværende verdi\n * @param min Mimimum-verdi\n * @param max Maksimum-verdi\n * @returns Objekt med gyldige verdier\n */\nexport const getValidatedProps = (\n value: number | undefined,\n min: number,\n max: number\n): { validatedValue: number; validatedMin: number; validatedMax: number } => {\n const validatedMin = getValidatedMin(min, max);\n const validatedMax = getValidatedMax(validatedMin, max);\n const validatedValue = getValidatedValue(value, validatedMin, validatedMax);\n\n return { validatedValue, validatedMin, validatedMax };\n};\n"],"names":["STEPPER_PADDING_X_PX","getValidatedMin","min","max","getValidatedMax","getValidatedValue","value","getMaximumDots","stepperWidth","getDistanceBetweenDots","dots","getMarkerPosition","distanceBetweenDots","index","getAllowedValues","_","getValidatedProps","validatedMin","validatedMax"],"mappings":"AAaO,MAAMA,IAAuB,GAQvBC,IAAkB,CAACC,GAAaC,MAAyBD,IAAMC,IAAMD,IAAMC,IAAM,GAQjFC,IAAkB,CAACF,GAAaC,MAAyBA,IAAMD,IAAMA,IAAMC,GAS3EE,IAAoB,CAACC,GAA2BJ,GAAaC,MACpE,OAAOG,IAAU,OAAeA,IAAQJ,IACnCA,IAGFI,IAAQH,IAAMA,IAAMG,GAQhBC,IAAiB,CAACC,MAAiC,KAAK,MAAMA,IAAgB,EAA6C,GAQ3HC,IAAyB,CAACD,GAAsBE,OAA0BF,IAAe,OAAoBE,IAAO,IAQpHC,IAAoB,CAACC,GAA6BC,MAA0BD,IAAsBC,GAQlGC,IAAmB,CAACZ,GAAaC,MAA0B,MAAM,KAAK,MAAMA,IAAMD,IAAM,CAAC,GAAG,CAACa,GAAGF,MAAUA,IAAQX,CAAG,GASrHc,IAAoB,CAC/BV,GACAJ,GACAC,MAC2E;AACrE,QAAAc,IAAehB,EAAgBC,GAAKC,CAAG,GACvCe,IAAed,EAAgBa,GAAcd,CAAG;AAG/C,SAAA,EAAE,gBAFcE,EAAkBC,GAAOW,GAAcC,CAAY,GAEjD,cAAAD,GAAc,cAAAC;AACzC;"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import a, { useState as n, useRef as L, useEffect as s } from "react";
|
|
2
|
-
import R from "classnames";
|
|
3
|
-
import { getCurrentConfig as V, getCenteredOverflowTableStyle as N, getBreakpointClass as _ } from "./utils.js";
|
|
4
|
-
import { AnalyticsId as H } from "../../constants.js";
|
|
5
|
-
import { useBreakpoint as O } from "../../hooks/useBreakpoint.js";
|
|
6
|
-
import { useIsVisible as P } from "../../hooks/useIsVisible.js";
|
|
7
|
-
import { useLayoutEvent as j } from "../../hooks/useLayoutEvent.js";
|
|
8
|
-
import { getAriaLabelAttributes as q } from "../../utils/accessibility.js";
|
|
9
|
-
import { HorizontalScroll as D } from "../HorizontalScroll/HorizontalScroll.js";
|
|
10
|
-
import F from "../Table/styles.module.scss";
|
|
11
|
-
var G = /* @__PURE__ */ ((e) => (e.none = "none", e.centeredoverflow = "centeredoverflow", e.horizontalscroll = "horizontalscroll", e.block = "block", e))(G || {}), J = /* @__PURE__ */ ((e) => (e.compact = "compact", e.normal = "normal", e))(J || {});
|
|
12
|
-
const K = [
|
|
13
|
-
{
|
|
14
|
-
breakpoint: "xl",
|
|
15
|
-
variant: "centeredoverflow",
|
|
16
|
-
fallbackVariant: "horizontalscroll"
|
|
17
|
-
/* horizontalscroll */
|
|
18
|
-
}
|
|
19
|
-
], ot = [
|
|
20
|
-
{
|
|
21
|
-
breakpoint: "xl",
|
|
22
|
-
variant: "centeredoverflow",
|
|
23
|
-
fallbackVariant: "horizontalscroll"
|
|
24
|
-
/* horizontalscroll */
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
breakpoint: "sm",
|
|
28
|
-
variant: "centeredoverflow",
|
|
29
|
-
fallbackVariant: "block"
|
|
30
|
-
/* block */
|
|
31
|
-
}
|
|
32
|
-
], lt = ({
|
|
33
|
-
id: e,
|
|
34
|
-
testId: w,
|
|
35
|
-
className: v,
|
|
36
|
-
children: u,
|
|
37
|
-
breakpointConfig: c = K,
|
|
38
|
-
mode: k = "normal",
|
|
39
|
-
scrollAriaLabel: W,
|
|
40
|
-
scrollAriaLabelledById: z,
|
|
41
|
-
...E
|
|
42
|
-
}) => {
|
|
43
|
-
const [t, y] = n(), [l, d] = n(0), [B, S] = n(0), [m, g] = n(window.innerWidth), r = L(null), f = P(r, 0), i = O();
|
|
44
|
-
s(() => {
|
|
45
|
-
y(V(c, i, l, m));
|
|
46
|
-
}, [c, i, l, m]), s(() => {
|
|
47
|
-
var o, h, p;
|
|
48
|
-
((t == null ? void 0 : t.variant) === "centeredoverflow" || (t == null ? void 0 : t.variant) === "horizontalscroll") && d(((o = r.current) == null ? void 0 : o.getBoundingClientRect().width) ?? 0), (t == null ? void 0 : t.variant) === "centeredoverflow" && S(((p = (h = r.current) == null ? void 0 : h.parentElement) == null ? void 0 : p.getBoundingClientRect().width) ?? 0);
|
|
49
|
-
}, [t, i]), j(() => g(window.innerWidth), ["resize"], 100), s(() => {
|
|
50
|
-
var o;
|
|
51
|
-
l === 0 && f && d(((o = r.current) == null ? void 0 : o.getBoundingClientRect().width) ?? 0);
|
|
52
|
-
}, [l, f]);
|
|
53
|
-
const A = (t == null ? void 0 : t.variant) === "centeredoverflow" ? N(B, l) : void 0, C = _(t), I = R(F.table, C, v), b = /* @__PURE__ */ a.createElement(
|
|
54
|
-
"table",
|
|
55
|
-
{
|
|
56
|
-
className: I,
|
|
57
|
-
id: e,
|
|
58
|
-
"data-testid": w,
|
|
59
|
-
"data-analyticsid": H.Table,
|
|
60
|
-
ref: r,
|
|
61
|
-
style: A,
|
|
62
|
-
...E
|
|
63
|
-
},
|
|
64
|
-
a.Children.map(u, (o) => a.isValidElement(o) && a.cloneElement(o, { mode: k }))
|
|
65
|
-
), x = q({ label: W, id: z });
|
|
66
|
-
return (t == null ? void 0 : t.variant) === "horizontalscroll" ? /* @__PURE__ */ a.createElement(D, { childWidth: l, testId: "horizontal-scroll", ...x }, b) : b;
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
J as ModeType,
|
|
70
|
-
G as ResponsiveTableVariant,
|
|
71
|
-
lt as Table,
|
|
72
|
-
lt as default,
|
|
73
|
-
K as defaultConfig,
|
|
74
|
-
ot as simpleConfig
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=Table.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sources":["../../../src/components/Table/Table.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getCurrentConfig, getBreakpointClass, getCenteredOverflowTableStyle } from './utils';\nimport { AnalyticsId } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { useIsVisible } from '../../hooks/useIsVisible';\nimport { useLayoutEvent } from '../../hooks/useLayoutEvent';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport HorizontalScroll from '../HorizontalScroll';\n\nimport styles from './styles.module.scss';\n\nexport enum ResponsiveTableVariant {\n /** No handling responsive behaviour. Default. */\n none = 'none',\n /** Overflow parent container to the left and right while remaining centered horizontally. */\n centeredoverflow = 'centeredoverflow',\n /** Show horizontal scrollbar when table is too big for the screen. */\n horizontalscroll = 'horizontalscroll',\n /** Collapse to two columns. */\n block = 'block',\n}\nexport enum ModeType {\n compact = 'compact',\n normal = 'normal',\n}\nexport interface BreakpointConfig {\n /** Breakpoint at which responsive behaviour will be applied. The table component uses a \"desktop first\" approach. */\n breakpoint: keyof typeof Breakpoint;\n /** Desired behaviour on this breakpoint and all smaller screens. */\n variant: keyof typeof ResponsiveTableVariant;\n /** If variant is horizontallscroll, use a fallback instead of device is not a touch device. */\n fallbackVariant?: keyof typeof ResponsiveTableVariant;\n}\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'table'>, 'style'> {\n /** Unique ID */\n id?: string;\n /** Id used for testing */\n testId?: string;\n /** Customize how the table behaves on various screen widths */\n breakpointConfig?: BreakpointConfig | BreakpointConfig[];\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the table. Use TableHead and TableBody */\n children: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n /** Sets aria-label of the horizontal scroll container. scrollAriaLabel or scrollAriaLabelledById MUST be set if horizontal scrolling is enabled! */\n scrollAriaLabel?: string;\n /** Sets aria-labelledby of the horizontal scroll container. scrollAriaLabel or scrollAriaLabelledById MUST be set if horizontal scrolling is enabled! */\n scrollAriaLabelledById?: string;\n}\n\nexport const defaultConfig: BreakpointConfig[] = [\n {\n breakpoint: 'xl',\n variant: ResponsiveTableVariant.centeredoverflow,\n fallbackVariant: ResponsiveTableVariant.horizontalscroll,\n },\n];\n\nexport const simpleConfig: BreakpointConfig[] = [\n {\n breakpoint: 'xl',\n variant: ResponsiveTableVariant.centeredoverflow,\n fallbackVariant: ResponsiveTableVariant.horizontalscroll,\n },\n {\n breakpoint: 'sm',\n variant: ResponsiveTableVariant.centeredoverflow,\n fallbackVariant: ResponsiveTableVariant.block,\n },\n];\n\nexport const Table: React.FC<Props> = ({\n id,\n testId,\n className,\n children,\n breakpointConfig = defaultConfig,\n mode = ModeType.normal,\n scrollAriaLabel,\n scrollAriaLabelledById,\n ...rest\n}) => {\n const [currentConfig, setCurrentConfig] = useState<BreakpointConfig>();\n const [tableWidth, setTableWidth] = useState<number>(0);\n const [parentWidth, setParentWidth] = useState<number>(0);\n const [windowWidth, setWindowWidth] = useState(window.innerWidth);\n const tableRef = useRef<HTMLTableElement>(null);\n const tableIsVisible = useIsVisible(tableRef, 0);\n const breakpoint = useBreakpoint();\n\n useEffect(() => {\n setCurrentConfig(getCurrentConfig(breakpointConfig, breakpoint, tableWidth, windowWidth));\n }, [breakpointConfig, breakpoint, tableWidth, windowWidth]);\n\n useEffect(() => {\n if (\n currentConfig?.variant === ResponsiveTableVariant.centeredoverflow ||\n currentConfig?.variant === ResponsiveTableVariant.horizontalscroll\n ) {\n setTableWidth(tableRef.current?.getBoundingClientRect().width ?? 0);\n }\n if (currentConfig?.variant === ResponsiveTableVariant.centeredoverflow) {\n setParentWidth(tableRef.current?.parentElement?.getBoundingClientRect().width ?? 0);\n }\n }, [currentConfig, breakpoint]);\n\n useLayoutEvent(() => setWindowWidth(window.innerWidth), ['resize'], 100);\n\n useEffect(() => {\n if (tableWidth === 0 && tableIsVisible) {\n setTableWidth(tableRef.current?.getBoundingClientRect().width ?? 0);\n }\n }, [tableWidth, tableIsVisible]);\n\n const tableStyle =\n currentConfig?.variant === ResponsiveTableVariant.centeredoverflow ? getCenteredOverflowTableStyle(parentWidth, tableWidth) : undefined;\n\n const breakpointClass = getBreakpointClass(currentConfig);\n const tableClass = classNames(styles.table, breakpointClass, className);\n\n const table = (\n <table\n className={tableClass}\n id={id}\n data-testid={testId}\n data-analyticsid={AnalyticsId.Table}\n ref={tableRef}\n style={tableStyle}\n {...rest}\n >\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n </table>\n );\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: scrollAriaLabel, id: scrollAriaLabelledById });\n\n if (currentConfig?.variant === ResponsiveTableVariant.horizontalscroll) {\n return (\n <HorizontalScroll childWidth={tableWidth} testId=\"horizontal-scroll\" {...ariaLabelAttributes}>\n {table}\n </HorizontalScroll>\n );\n }\n\n return table;\n};\n\nexport default Table;\n"],"names":["ResponsiveTableVariant","ModeType","defaultConfig","simpleConfig","Table","id","testId","className","children","breakpointConfig","mode","scrollAriaLabel","scrollAriaLabelledById","rest","currentConfig","setCurrentConfig","useState","tableWidth","setTableWidth","parentWidth","setParentWidth","windowWidth","setWindowWidth","tableRef","useRef","tableIsVisible","useIsVisible","breakpoint","useBreakpoint","useEffect","getCurrentConfig","_a","_c","_b","useLayoutEvent","tableStyle","getCenteredOverflowTableStyle","breakpointClass","getBreakpointClass","tableClass","classNames","styles","table","React","AnalyticsId","child","ariaLabelAttributes","getAriaLabelAttributes","HorizontalScroll"],"mappings":";;;;;;;;;;AAcY,IAAAA,sBAAAA,OAEVA,EAAA,OAAO,QAEPA,EAAA,mBAAmB,oBAEnBA,EAAA,mBAAmB,oBAEnBA,EAAA,QAAQ,SAREA,IAAAA,KAAA,CAAA,CAAA,GAUAC,sBA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C,IAAAV,EAAS,YAAT,gBAAAU,EAAkB,kBAAlB,gBAAAD,EAAiC,wBAAwB,UAAS,CAAC;AAAA,EACpF,GACC,CAAClB,GAAea,CAAU,CAAC,GAEfO,EAAA,MAAMZ,EAAe,OAAO,UAAU,GAAG,CAAC,QAAQ,GAAG,GAAG,GAEvEO,EAAU,MAAM;;AACV,IAAAZ,MAAe,KAAKQ,KACtBP,IAAca,IAAAR,EAAS,YAAT,gBAAAQ,EAAkB,wBAAwB,UAAS,CAAC;AAAA,EACpE,GACC,CAACd,GAAYQ,CAAc,CAAC;AAE/B,QAAMU,KACJrB,KAAA,gBAAAA,EAAe,aAAY,qBAA0CsB,EAA8BjB,GAAaF,CAAU,IAAI,QAE1HoB,IAAkBC,EAAmBxB,CAAa,GAClDyB,IAAaC,EAAWC,EAAO,OAAOJ,GAAiB9B,CAAS,GAEhEmC,IACJC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWJ;AAAA,MACX,IAAAlC;AAAA,MACA,eAAaC;AAAA,MACb,oBAAkBsC,EAAY;AAAA,MAC9B,KAAKrB;AAAA,MACL,OAAOY;AAAA,MACN,GAAGtB;AAAA,IAAA;AAAA,IAEH8B,EAAM,SAAS,IAAInC,GAAU,OAASmC,EAAM,eAAoCE,CAAK,KAAKF,EAAM,aAAaE,GAAO,EAAE,MAAAnC,EAAM,CAAA,CAAC;AAAA,EAAA,GAI5HoC,IAAsBC,EAAuB,EAAE,OAAOpC,GAAiB,IAAIC,GAAwB;AAErG,UAAAE,KAAA,gBAAAA,EAAe,aAAY,qBAE3B6B,gBAAAA,EAAA,cAACK,KAAiB,YAAY/B,GAAY,QAAO,qBAAqB,GAAG6B,KACtEJ,CACH,IAIGA;AACT;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import e from "react";
|
|
2
|
-
import s from "classnames";
|
|
3
|
-
import n from "../../Table/styles.module.scss";
|
|
4
|
-
import { ModeType as d } from "../Table.js";
|
|
5
|
-
const i = ({ className: o, children: a, mode: l = d.normal, ...m }) => {
|
|
6
|
-
const r = s(n["table-body"], o);
|
|
7
|
-
return /* @__PURE__ */ e.createElement("tbody", { className: r, ...m }, e.Children.map(a, (t) => e.isValidElement(t) && e.cloneElement(t, { mode: l })));
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
i as TableBody,
|
|
11
|
-
i as default
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=TableBody.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.js","sources":["../../../../src/components/Table/TableBody/TableBody.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'tbody'>, 'style'> {\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the table body. Use TableRows */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n}\n\nexport const TableBody: React.FC<Props> = ({ className, children, mode = ModeType.normal, ...rest }) => {\n const tableBodyClasses = classNames(tableStyles['table-body'], className);\n return (\n <tbody className={tableBodyClasses} {...rest}>\n {React.Children.map(children, child => React.isValidElement<{ mode?: ModeType }>(child) && React.cloneElement(child, { mode }))}\n </tbody>\n );\n};\n\nexport default TableBody;\n"],"names":["TableBody","className","children","mode","ModeType","rest","tableBodyClasses","classNames","tableStyles","React","child"],"mappings":";;;;AAgBa,MAAAA,IAA6B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,MAAAC,IAAOC,EAAS,QAAQ,GAAGC,QAAW;AACtG,QAAMC,IAAmBC,EAAWC,EAAY,YAAY,GAAGP,CAAS;AAEtE,SAAAQ,gBAAAA,EAAA,cAAC,WAAM,WAAWH,GAAmB,GAAGD,EACrC,GAAAI,EAAM,SAAS,IAAIP,GAAU,CAAAQ,MAASD,EAAM,eAAoCC,CAAK,KAAKD,EAAM,aAAaC,GAAO,EAAE,MAAAP,EAAM,CAAA,CAAC,CAChI;AAEJ;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sources":["../../../../src/components/Table/TableCell/TableCell.tsx"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport tableStyles from '../styles.module.scss';\nimport { ModeType } from '../Table';\n\nexport enum TextAlign {\n left = 'left',\n center = 'center',\n right = 'right',\n}\n\nexport interface Props extends Omit<React.ComponentPropsWithoutRef<'td'>, 'style'> {\n /** Label used for small viewport block */\n dataLabel?: string;\n /** text align in cell */\n textAlign?: TextAlign;\n /** nowrap for white space */\n nowrap?: boolean;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the content of the table cell */\n children?: React.ReactNode;\n /** For display with less space. Discouraged to use together with interactive elements. */\n mode?: ModeType;\n /** For test purposes */\n testId?: string;\n}\n\nexport const TableCell: React.FC<Props> = ({\n nowrap = false,\n textAlign = TextAlign.left,\n dataLabel,\n children,\n className,\n testId,\n mode = ModeType.normal,\n ...rest\n}) => {\n const tableCellClass = classNames(\n tableStyles['table__cell'],\n { [tableStyles['table__cell--compact']]: mode === ModeType.compact },\n { [tableStyles['table__cell--nowrap']]: nowrap },\n { [tableStyles['table__cell--center']]: textAlign === 'center' },\n { [tableStyles['table__cell--right']]: textAlign === 'right' },\n className\n );\n\n return (\n <td className={tableCellClass} data-label={dataLabel} data-testid={testId} {...rest}>\n {children}\n </td>\n );\n};\n\nexport default TableCell;\n"],"names":["TextAlign","TableCell","nowrap","textAlign","dataLabel","children","className","testId","mode","ModeType","rest","tableCellClass","classNames","tableStyles","React"],"mappings":";;;;AAOY,IAAAA,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAHEA,IAAAA,KAAA,CAAA,CAAA;AAuBL,MAAMC,IAA6B,CAAC;AAAA,EACzC,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC,IAAOC,EAAS;AAAA,EAChB,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAiBC;AAAA,IACrBC,EAAY;AAAA,IACZ,EAAE,CAACA,EAAY,sBAAsB,CAAC,GAAGL,MAASC,EAAS,QAAQ;AAAA,IACnE,EAAE,CAACI,EAAY,qBAAqB,CAAC,GAAGX,EAAO;AAAA,IAC/C,EAAE,CAACW,EAAY,qBAAqB,CAAC,GAAGV,MAAc,SAAS;AAAA,IAC/D,EAAE,CAACU,EAAY,oBAAoB,CAAC,GAAGV,MAAc,QAAQ;AAAA,IAC7DG;AAAA,EAAA;AAIA,SAAAQ,gBAAAA,EAAA,cAAC,MAAG,EAAA,WAAWH,GAAgB,cAAYP,GAAW,eAAaG,GAAS,GAAGG,EAAA,GAC5EL,CACH;AAEJ;"}
|