@helsenorge/designsystem-react 10.3.0 → 10.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -3
- package/LazyIcon.js +1 -1
- package/LazyIcon.js.map +1 -1
- package/components/Drawer/index.js +3 -1
- package/components/Drawer/index.js.map +1 -1
- package/components/Dropdown/index.js +22 -6
- package/components/Dropdown/index.js.map +1 -1
- package/components/EmptyState/index.js +3 -23
- package/components/EmptyState/index.js.map +1 -1
- package/components/Icons/AdditionalIconInformation.d.ts +48 -4
- package/components/Icons/AdditionalIconInformation.js +15 -4
- package/components/Icons/AdditionalIconInformation.js.map +1 -1
- package/components/Icons/EmptyBox.d.ts +4 -0
- package/components/Icons/EmptyBox.js +24 -0
- package/components/Icons/EmptyBox.js.map +1 -0
- package/components/Icons/HealthMeasurements.d.ts +4 -0
- package/components/Icons/HealthMeasurements.js +24 -0
- package/components/Icons/HealthMeasurements.js.map +1 -0
- package/components/Icons/IconNames.d.ts +1 -1
- package/components/Icons/IconNames.js +6 -0
- package/components/Icons/IconNames.js.map +1 -1
- package/components/Icons/SharedHealthData.d.ts +4 -0
- package/components/Icons/SharedHealthData.js +24 -0
- package/components/Icons/SharedHealthData.js.map +1 -0
- package/components/Icons/SharedHealthMeasurements.d.ts +4 -0
- package/components/Icons/SharedHealthMeasurements.js +24 -0
- package/components/Icons/SharedHealthMeasurements.js.map +1 -0
- package/components/Icons/StickyNote.d.ts +4 -0
- package/components/Icons/StickyNote.js +24 -0
- package/components/Icons/StickyNote.js.map +1 -0
- package/components/Icons/StickyNotes.d.ts +4 -0
- package/components/Icons/StickyNotes.js +24 -0
- package/components/Icons/StickyNotes.js.map +1 -0
- package/components/PopMenu/styles.module.scss +2 -4
- package/constants.d.ts +6 -0
- package/constants.js +8 -0
- package/constants.js.map +1 -1
- package/index.js +2 -1
- package/package.json +1 -1
- package/utils/language.d.ts +16 -0
- package/utils/language.js +24 -0
- package/utils/language.js.map +1 -0
- package/utils/tests/language.test.d.ts +1 -0
- package/components/EmptyState/EmptyBoxBeeCompact.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
## [10.4.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv10.3.0&targetVersion=GTv10.4.0) (2025-03-04)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **drawer:** lukk drawer med escape knapp
|
|
6
|
+
([b307451](https://github.com/helsenorge/designsystem/commit/b30745144f54b4ceda551bd07e3b18e29d08e388)), closes
|
|
7
|
+
[#346116](https://github.com/helsenorge/designsystem/issues/346116)
|
|
8
|
+
- **icon:** nye ikoner ([cfb9c42](https://github.com/helsenorge/designsystem/commit/cfb9c42076e22649df45ab0497e478f5244e55ec)), closes
|
|
9
|
+
[#343101](https://github.com/helsenorge/designsystem/issues/343101)
|
|
10
|
+
- **utils:** felles språkkontekst ([bbd6d1e](https://github.com/helsenorge/designsystem/commit/bbd6d1eb9e5b06780e7ce29d631b83a3f5d01e89)),
|
|
11
|
+
closes [#345767](https://github.com/helsenorge/designsystem/issues/345767)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **dropdown:** oppdater interaksjon og aria attributter til menu button patternet
|
|
16
|
+
([3d594e2](https://github.com/helsenorge/designsystem/commit/3d594e2728df0d41a9e9ee3fcbab1dbaaebb7e73)), closes
|
|
17
|
+
[#342762](https://github.com/helsenorge/designsystem/issues/342762)
|
|
18
|
+
- **popmenu:** avrundede hjørner uansett
|
|
19
|
+
([f1ed605](https://github.com/helsenorge/designsystem/commit/f1ed60520d9b37a00bdbad39937a8beb2a78192a)), closes
|
|
20
|
+
[#346274](https://github.com/helsenorge/designsystem/issues/346274)
|
|
21
|
+
|
|
22
|
+
## [10.3.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv10.2.0&targetVersion=GTv10.3.0) (2025-02-27)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- **duolist:** ta i bruk ny styling med nye avstander
|
|
27
|
+
([fdea2a4](https://github.com/helsenorge/designsystem/commit/fdea2a49fd448fc56fb6c26e4208c1f367abaf65)), closes
|
|
28
|
+
[#342805](https://github.com/helsenorge/designsystem/issues/342805)
|
|
29
|
+
- **validation:** ny styling på feil
|
|
30
|
+
([7040cae](https://github.com/helsenorge/designsystem/commit/7040caec6a0ca76915a100c0b3b2328bdf63f78c)), closes
|
|
31
|
+
[#344114](https://github.com/helsenorge/designsystem/issues/344114) [#344114](https://github.com/helsenorge/designsystem/issues/344114)
|
|
32
|
+
|
|
1
33
|
## [10.2.0](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv10.1.0&targetVersion=GTv10.2.0) (2025-02-18)
|
|
2
34
|
|
|
3
35
|
### Features
|
|
@@ -2172,12 +2204,12 @@ Dette er fordi vi skal kunne dynamisk importere alt som ligger i Icons, så da b
|
|
|
2172
2204
|
|
|
2173
2205
|
### Bug Fixes
|
|
2174
2206
|
|
|
2175
|
-
- økt kontrast på understreking av lenker
|
|
2176
|
-
([50b7fa4](https://github.com/helsenorge/designsystem/commit/50b7fa47fb44cb7d75fb877bd53e2309b35e1e21)), closes
|
|
2177
|
-
[#229049](https://github.com/helsenorge/designsystem/issues/229049)
|
|
2178
2207
|
- panel har avstand fra tittel til badge
|
|
2179
2208
|
([09034c4](https://github.com/helsenorge/designsystem/commit/09034c4844408c7cfe8f65d7a1a0d82a7828c2ef)), closes
|
|
2180
2209
|
[#282359](https://github.com/helsenorge/designsystem/issues/282359)
|
|
2210
|
+
- økt kontrast på understreking av lenker
|
|
2211
|
+
([50b7fa4](https://github.com/helsenorge/designsystem/commit/50b7fa47fb44cb7d75fb877bd53e2309b35e1e21)), closes
|
|
2212
|
+
[#229049](https://github.com/helsenorge/designsystem/issues/229049)
|
|
2181
2213
|
|
|
2182
2214
|
## [1.2.2](https://github.com/helsenorge/designsystem/branchCompare?baseVersion=GTv1.2.1&targetVersion=GTv1.2.2) (2022-08-31)
|
|
2183
2215
|
|
package/LazyIcon.js
CHANGED
|
@@ -4,7 +4,7 @@ import { lazy, useMemo, Suspense } from "react";
|
|
|
4
4
|
import { useIsServerSide } from "./hooks/useIsServerSide.js";
|
|
5
5
|
import { I as Icon } from "./Icon.js";
|
|
6
6
|
import { IconSize } from "./constants.js";
|
|
7
|
-
const lazyLoadIcon = (iconName) => lazy(() => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../Icons/ActiveMonitoring.tsx": () => import("./components/Icons/ActiveMonitoring.js"), "../Icons/AcupunctureBack.tsx": () => import("./components/Icons/AcupunctureBack.js"), "../Icons/AlarmClock.tsx": () => import("./components/Icons/AlarmClock.js"), "../Icons/AlertSignFill.tsx": () => import("./components/Icons/AlertSignFill.js"), "../Icons/AlertSignStroke.tsx": () => import("./components/Icons/AlertSignStroke.js"), "../Icons/Amputation.tsx": () => import("./components/Icons/Amputation.js"), "../Icons/Anxiety.tsx": () => import("./components/Icons/Anxiety.js"), "../Icons/Apple.tsx": () => import("./components/Icons/Apple.js"), "../Icons/Archive.tsx": () => import("./components/Icons/Archive.js"), "../Icons/ArmFlexing.tsx": () => import("./components/Icons/ArmFlexing.js"), "../Icons/ArrowDown.tsx": () => import("./components/Icons/ArrowDown.js"), "../Icons/ArrowLeft.tsx": () => import("./components/Icons/ArrowLeft.js"), "../Icons/ArrowRight.tsx": () => import("./components/Icons/ArrowRight.js"), "../Icons/ArrowUp.tsx": () => import("./components/Icons/ArrowUp.js"), "../Icons/ArrowUpRight.tsx": () => import("./components/Icons/ArrowUpRight.js"), "../Icons/Attachment.tsx": () => import("./components/Icons/Attachment.js"), "../Icons/Atv.tsx": () => import("./components/Icons/Atv.js"), "../Icons/Avatar.tsx": () => import("./components/Icons/Avatar.js"), "../Icons/AwakePersonOnPillow.tsx": () => import("./components/Icons/AwakePersonOnPillow.js"), "../Icons/Baby.tsx": () => import("./components/Icons/Baby.js"), "../Icons/BandAid.tsx": () => import("./components/Icons/BandAid.js"), "../Icons/BeerAndPills.tsx": () => import("./components/Icons/BeerAndPills.js"), "../Icons/Bell.tsx": () => import("./components/Icons/Bell.js"), "../Icons/Bike.tsx": () => import("./components/Icons/Bike.js"), "../Icons/BirthControl.tsx": () => import("./components/Icons/BirthControl.js"), "../Icons/BirthdayCake.tsx": () => import("./components/Icons/BirthdayCake.js"), "../Icons/Boat.tsx": () => import("./components/Icons/Boat.js"), "../Icons/Body.tsx": () => import("./components/Icons/Body.js"), "../Icons/Braille.tsx": () => import("./components/Icons/Braille.js"), "../Icons/Brain.tsx": () => import("./components/Icons/Brain.js"), "../Icons/BreastReconstruction.tsx": () => import("./components/Icons/BreastReconstruction.js"), "../Icons/BreastRemoval.tsx": () => import("./components/Icons/BreastRemoval.js"), "../Icons/Breasts.tsx": () => import("./components/Icons/Breasts.js"), "../Icons/BrokenHeart.tsx": () => import("./components/Icons/BrokenHeart.js"), "../Icons/BrokenPuzzle.tsx": () => import("./components/Icons/BrokenPuzzle.js"), "../Icons/Bus.tsx": () => import("./components/Icons/Bus.js"), "../Icons/Calendar.tsx": () => import("./components/Icons/Calendar.js"), "../Icons/CalendarChange.tsx": () => import("./components/Icons/CalendarChange.js"), "../Icons/CalendarCheck.tsx": () => import("./components/Icons/CalendarCheck.js"), "../Icons/CalendarEvent.tsx": () => import("./components/Icons/CalendarEvent.js"), "../Icons/CalendarSave.tsx": () => import("./components/Icons/CalendarSave.js"), "../Icons/Cancer.tsx": () => import("./components/Icons/Cancer.js"), "../Icons/Candle.tsx": () => import("./components/Icons/Candle.js"), "../Icons/Car.tsx": () => import("./components/Icons/Car.js"), "../Icons/Carton.tsx": () => import("./components/Icons/Carton.js"), "../Icons/Change.tsx": () => import("./components/Icons/Change.js"), "../Icons/Check.tsx": () => import("./components/Icons/Check.js"), "../Icons/CheckFill.tsx": () => import("./components/Icons/CheckFill.js"), "../Icons/CheckOutline.tsx": () => import("./components/Icons/CheckOutline.js"), "../Icons/Chest.tsx": () => import("./components/Icons/Chest.js"), "../Icons/ChevronDown.tsx": () => import("./components/Icons/ChevronDown.js"), "../Icons/ChevronLeft.tsx": () => import("./components/Icons/ChevronLeft.js"), "../Icons/ChevronRight.tsx": () => import("./components/Icons/ChevronRight.js"), "../Icons/ChevronUp.tsx": () => import("./components/Icons/ChevronUp.js"), "../Icons/ChevronsDown.tsx": () => import("./components/Icons/ChevronsDown.js"), "../Icons/ChevronsUp.tsx": () => import("./components/Icons/ChevronsUp.js"), "../Icons/ChildPlaying.tsx": () => import("./components/Icons/ChildPlaying.js"), "../Icons/Cigarette.tsx": () => import("./components/Icons/Cigarette.js"), "../Icons/Coins.tsx": () => import("./components/Icons/Coins.js"), "../Icons/Contacts.tsx": () => import("./components/Icons/Contacts.js"), "../Icons/Copy.tsx": () => import("./components/Icons/Copy.js"), "../Icons/CoronaCertificate.tsx": () => import("./components/Icons/CoronaCertificate.js"), "../Icons/Coronavirus.tsx": () => import("./components/Icons/Coronavirus.js"), "../Icons/Cough.tsx": () => import("./components/Icons/Cough.js"), "../Icons/CreditCard.tsx": () => import("./components/Icons/CreditCard.js"), "../Icons/CriticalHealthInfo.tsx": () => import("./components/Icons/CriticalHealthInfo.js"), "../Icons/Cross.tsx": () => import("./components/Icons/Cross.js"), "../Icons/DataExchange.tsx": () => import("./components/Icons/DataExchange.js"), "../Icons/DataReceived.tsx": () => import("./components/Icons/DataReceived.js"), "../Icons/DataSent.tsx": () => import("./components/Icons/DataSent.js"), "../Icons/Depression.tsx": () => import("./components/Icons/Depression.js"), "../Icons/DigestiveSystem.tsx": () => import("./components/Icons/DigestiveSystem.js"), "../Icons/Dizzy.tsx": () => import("./components/Icons/Dizzy.js"), "../Icons/Documents.tsx": () => import("./components/Icons/Documents.js"), "../Icons/Dog.tsx": () => import("./components/Icons/Dog.js"), "../Icons/DonorCard.tsx": () => import("./components/Icons/DonorCard.js"), "../Icons/Download.tsx": () => import("./components/Icons/Download.js"), "../Icons/Draft.tsx": () => import("./components/Icons/Draft.js"), "../Icons/EChat.tsx": () => import("./components/Icons/EChat.js"), "../Icons/Ear.tsx": () => import("./components/Icons/Ear.js"), "../Icons/EarDeaf.tsx": () => import("./components/Icons/EarDeaf.js"), "../Icons/EarHearingAid.tsx": () => import("./components/Icons/EarHearingAid.js"), "../Icons/EarNoseThroat.tsx": () => import("./components/Icons/EarNoseThroat.js"), "../Icons/EarVolume.tsx": () => import("./components/Icons/EarVolume.js"), "../Icons/ElderlyPerson.tsx": () => import("./components/Icons/ElderlyPerson.js"), "../Icons/Embolization.tsx": () => import("./components/Icons/Embolization.js"), "../Icons/EmergencyCall.tsx": () => import("./components/Icons/EmergencyCall.js"), "../Icons/EmoticonAnnoyed.tsx": () => import("./components/Icons/EmoticonAnnoyed.js"), "../Icons/EmoticonDelighted.tsx": () => import("./components/Icons/EmoticonDelighted.js"), "../Icons/EmoticonDisappointed.tsx": () => import("./components/Icons/EmoticonDisappointed.js"), "../Icons/EmoticonHappy.tsx": () => import("./components/Icons/EmoticonHappy.js"), "../Icons/EmoticonMeh.tsx": () => import("./components/Icons/EmoticonMeh.js"), "../Icons/EnterFullScreen.tsx": () => import("./components/Icons/EnterFullScreen.js"), "../Icons/Envelope.tsx": () => import("./components/Icons/Envelope.js"), "../Icons/Epilepsy.tsx": () => import("./components/Icons/Epilepsy.js"), "../Icons/Eraser.tsx": () => import("./components/Icons/Eraser.js"), "../Icons/ErrorSignFill.tsx": () => import("./components/Icons/ErrorSignFill.js"), "../Icons/ErrorSignStroke.tsx": () => import("./components/Icons/ErrorSignStroke.js"), "../Icons/EuropeanHealthCard.tsx": () => import("./components/Icons/EuropeanHealthCard.js"), "../Icons/ExitFullScreen.tsx": () => import("./components/Icons/ExitFullScreen.js"), "../Icons/Eye.tsx": () => import("./components/Icons/Eye.js"), "../Icons/Facebook.tsx": () => import("./components/Icons/Facebook.js"), "../Icons/FallingLeaf.tsx": () => import("./components/Icons/FallingLeaf.js"), "../Icons/Female.tsx": () => import("./components/Icons/Female.js"), "../Icons/FemaleDoctor.tsx": () => import("./components/Icons/FemaleDoctor.js"), "../Icons/Ferry.tsx": () => import("./components/Icons/Ferry.js"), "../Icons/File.tsx": () => import("./components/Icons/File.js"), "../Icons/Filter.tsx": () => import("./components/Icons/Filter.js"), "../Icons/FingerBleed.tsx": () => import("./components/Icons/FingerBleed.js"), "../Icons/FirstAidKit.tsx": () => import("./components/Icons/FirstAidKit.js"), "../Icons/Fish.tsx": () => import("./components/Icons/Fish.js"), "../Icons/FloppyDisk.tsx": () => import("./components/Icons/FloppyDisk.js"), "../Icons/Football.tsx": () => import("./components/Icons/Football.js"), "../Icons/Form.tsx": () => import("./components/Icons/Form.js"), "../Icons/Forward.tsx": () => import("./components/Icons/Forward.js"), "../Icons/Gallery.tsx": () => import("./components/Icons/Gallery.js"), "../Icons/Garden.tsx": () => import("./components/Icons/Garden.js"), "../Icons/GasCan.tsx": () => import("./components/Icons/GasCan.js"), "../Icons/GenderIdentity.tsx": () => import("./components/Icons/GenderIdentity.js"), "../Icons/GlassWater.tsx": () => import("./components/Icons/GlassWater.js"), "../Icons/Glasses.tsx": () => import("./components/Icons/Glasses.js"), "../Icons/Globe.tsx": () => import("./components/Icons/Globe.js"), "../Icons/Grain.tsx": () => import("./components/Icons/Grain.js"), "../Icons/Graph.tsx": () => import("./components/Icons/Graph.js"), "../Icons/Group.tsx": () => import("./components/Icons/Group.js"), "../Icons/GroupTwins.tsx": () => import("./components/Icons/GroupTwins.js"), "../Icons/HTMLFile.tsx": () => import("./components/Icons/HTMLFile.js"), "../Icons/HandWaving.tsx": () => import("./components/Icons/HandWaving.js"), "../Icons/HandWithDisease.tsx": () => import("./components/Icons/HandWithDisease.js"), "../Icons/HandsAndHeart.tsx": () => import("./components/Icons/HandsAndHeart.js"), "../Icons/HealthClinic.tsx": () => import("./components/Icons/HealthClinic.js"), "../Icons/HealthWarning.tsx": () => import("./components/Icons/HealthWarning.js"), "../Icons/HealthcarePerson.tsx": () => import("./components/Icons/HealthcarePerson.js"), "../Icons/HealthcarePersonell.tsx": () => import("./components/Icons/HealthcarePersonell.js"), "../Icons/HearingProtection.tsx": () => import("./components/Icons/HearingProtection.js"), "../Icons/Heart.tsx": () => import("./components/Icons/Heart.js"), "../Icons/HeartHands.tsx": () => import("./components/Icons/HeartHands.js"), "../Icons/HelpSign.tsx": () => import("./components/Icons/HelpSign.js"), "../Icons/HelpingHand.tsx": () => import("./components/Icons/HelpingHand.js"), "../Icons/Hemodialysis.tsx": () => import("./components/Icons/Hemodialysis.js"), "../Icons/Hiker.tsx": () => import("./components/Icons/Hiker.js"), "../Icons/Hipprosthesis.tsx": () => import("./components/Icons/Hipprosthesis.js"), "../Icons/History.tsx": () => import("./components/Icons/History.js"), "../Icons/HivAndAids.tsx": () => import("./components/Icons/HivAndAids.js"), "../Icons/Home.tsx": () => import("./components/Icons/Home.js"), "../Icons/HomeFill.tsx": () => import("./components/Icons/HomeFill.js"), "../Icons/Hormone.tsx": () => import("./components/Icons/Hormone.js"), "../Icons/Hospital.tsx": () => import("./components/Icons/Hospital.js"), "../Icons/Hourglass.tsx": () => import("./components/Icons/Hourglass.js"), "../Icons/ImgFile.tsx": () => import("./components/Icons/ImgFile.js"), "../Icons/Inbox.tsx": () => import("./components/Icons/Inbox.js"), "../Icons/InfoSignFill.tsx": () => import("./components/Icons/InfoSignFill.js"), "../Icons/InfoSignStroke.tsx": () => import("./components/Icons/InfoSignStroke.js"), "../Icons/Instagram.tsx": () => import("./components/Icons/Instagram.js"), "../Icons/Intravenous.tsx": () => import("./components/Icons/Intravenous.js"), "../Icons/JointPain.tsx": () => import("./components/Icons/JointPain.js"), "../Icons/Journal.tsx": () => import("./components/Icons/Journal.js"), "../Icons/JpgFile.tsx": () => import("./components/Icons/JpgFile.js"), "../Icons/Kidney.tsx": () => import("./components/Icons/Kidney.js"), "../Icons/KitchenScale.tsx": () => import("./components/Icons/KitchenScale.js"), "../Icons/Kjernejournal.tsx": () => import("./components/Icons/Kjernejournal.js"), "../Icons/Laboratory.tsx": () => import("./components/Icons/Laboratory.js"), "../Icons/LaptopBlog.tsx": () => import("./components/Icons/LaptopBlog.js"), "../Icons/LawBook.tsx": () => import("./components/Icons/LawBook.js"), "../Icons/LegalDocument.tsx": () => import("./components/Icons/LegalDocument.js"), "../Icons/LightBulb.tsx": () => import("./components/Icons/LightBulb.js"), "../Icons/List.tsx": () => import("./components/Icons/List.js"), "../Icons/Location.tsx": () => import("./components/Icons/Location.js"), "../Icons/LocationFill.tsx": () => import("./components/Icons/LocationFill.js"), "../Icons/Lock.tsx": () => import("./components/Icons/Lock.js"), "../Icons/Login.tsx": () => import("./components/Icons/Login.js"), "../Icons/Logout.tsx": () => import("./components/Icons/Logout.js"), "../Icons/Lungs.tsx": () => import("./components/Icons/Lungs.js"), "../Icons/Makeup.tsx": () => import("./components/Icons/Makeup.js"), "../Icons/MaleDoctor.tsx": () => import("./components/Icons/MaleDoctor.js"), "../Icons/MaleDoctorAndPerson.tsx": () => import("./components/Icons/MaleDoctorAndPerson.js"), "../Icons/MaleDoctorCompact.tsx": () => import("./components/Icons/MaleDoctorCompact.js"), "../Icons/MaleDoctorCompactFill.tsx": () => import("./components/Icons/MaleDoctorCompactFill.js"), "../Icons/MaleGenitalia.tsx": () => import("./components/Icons/MaleGenitalia.js"), "../Icons/Medicine.tsx": () => import("./components/Icons/Medicine.js"), "../Icons/MedicineWarning.tsx": () => import("./components/Icons/MedicineWarning.js"), "../Icons/MentalHealthAdult.tsx": () => import("./components/Icons/MentalHealthAdult.js"), "../Icons/MentalHealthChild.tsx": () => import("./components/Icons/MentalHealthChild.js"), "../Icons/Menu.tsx": () => import("./components/Icons/Menu.js"), "../Icons/Microscope.tsx": () => import("./components/Icons/Microscope.js"), "../Icons/Minus.tsx": () => import("./components/Icons/Minus.js"), "../Icons/Mirror.tsx": () => import("./components/Icons/Mirror.js"), "../Icons/MobilePhone.tsx": () => import("./components/Icons/MobilePhone.js"), "../Icons/MotherHoldingBaby.tsx": () => import("./components/Icons/MotherHoldingBaby.js"), "../Icons/MuscleBack.tsx": () => import("./components/Icons/MuscleBack.js"), "../Icons/MuscleLeg.tsx": () => import("./components/Icons/MuscleLeg.js"), "../Icons/Mushroom.tsx": () => import("./components/Icons/Mushroom.js"), "../Icons/Music.tsx": () => import("./components/Icons/Music.js"), "../Icons/MusselsAndSalt.tsx": () => import("./components/Icons/MusselsAndSalt.js"), "../Icons/NoAccess.tsx": () => import("./components/Icons/NoAccess.js"), "../Icons/NoEye.tsx": () => import("./components/Icons/NoEye.js"), "../Icons/NoFilter.tsx": () => import("./components/Icons/NoFilter.js"), "../Icons/Notepad.tsx": () => import("./components/Icons/Notepad.js"), "../Icons/Osteotomy.tsx": () => import("./components/Icons/Osteotomy.js"), "../Icons/PaintRoller.tsx": () => import("./components/Icons/PaintRoller.js"), "../Icons/PaperPlane.tsx": () => import("./components/Icons/PaperPlane.js"), "../Icons/PatientAndPerson.tsx": () => import("./components/Icons/PatientAndPerson.js"), "../Icons/Pause.tsx": () => import("./components/Icons/Pause.js"), "../Icons/PdfFile.tsx": () => import("./components/Icons/PdfFile.js"), "../Icons/Pencil.tsx": () => import("./components/Icons/Pencil.js"), "../Icons/PeopleTalking.tsx": () => import("./components/Icons/PeopleTalking.js"), "../Icons/Peritonealdialysis.tsx": () => import("./components/Icons/Peritonealdialysis.js"), "../Icons/Person.tsx": () => import("./components/Icons/Person.js"), "../Icons/PersonAndPatient.tsx": () => import("./components/Icons/PersonAndPatient.js"), "../Icons/PersonCancel.tsx": () => import("./components/Icons/PersonCancel.js"), "../Icons/PersonInXRayMachine.tsx": () => import("./components/Icons/PersonInXRayMachine.js"), "../Icons/PersonOverweight.tsx": () => import("./components/Icons/PersonOverweight.js"), "../Icons/PersonRelaxing.tsx": () => import("./components/Icons/PersonRelaxing.js"), "../Icons/PersonWithBrain.tsx": () => import("./components/Icons/PersonWithBrain.js"), "../Icons/PersonWithBrokenArm.tsx": () => import("./components/Icons/PersonWithBrokenArm.js"), "../Icons/PersonWithCrutches.tsx": () => import("./components/Icons/PersonWithCrutches.js"), "../Icons/PersonWithJaw.tsx": () => import("./components/Icons/PersonWithJaw.js"), "../Icons/PersonWithMagnifyingGlass.tsx": () => import("./components/Icons/PersonWithMagnifyingGlass.js"), "../Icons/PersonWithSenses.tsx": () => import("./components/Icons/PersonWithSenses.js"), "../Icons/PersonWorking.tsx": () => import("./components/Icons/PersonWorking.js"), "../Icons/PersonalPlan.tsx": () => import("./components/Icons/PersonalPlan.js"), "../Icons/PizzaSlice.tsx": () => import("./components/Icons/PizzaSlice.js"), "../Icons/Plane.tsx": () => import("./components/Icons/Plane.js"), "../Icons/Plant.tsx": () => import("./components/Icons/Plant.js"), "../Icons/PlateKnifeFork.tsx": () => import("./components/Icons/PlateKnifeFork.js"), "../Icons/Play.tsx": () => import("./components/Icons/Play.js"), "../Icons/PlusLarge.tsx": () => import("./components/Icons/PlusLarge.js"), "../Icons/PlusSmall.tsx": () => import("./components/Icons/PlusSmall.js"), "../Icons/PngFile.tsx": () => import("./components/Icons/PngFile.js"), "../Icons/Podcast.tsx": () => import("./components/Icons/Podcast.js"), "../Icons/PoisonInformation.tsx": () => import("./components/Icons/PoisonInformation.js"), "../Icons/Pregnant.tsx": () => import("./components/Icons/Pregnant.js"), "../Icons/Printer.tsx": () => import("./components/Icons/Printer.js"), "../Icons/Psychosis.tsx": () => import("./components/Icons/Psychosis.js"), "../Icons/Publication.tsx": () => import("./components/Icons/Publication.js"), "../Icons/Puzzle.tsx": () => import("./components/Icons/Puzzle.js"), "../Icons/QrCode.tsx": () => import("./components/Icons/QrCode.js"), "../Icons/Quarrel.tsx": () => import("./components/Icons/Quarrel.js"), "../Icons/RadioTherapy.tsx": () => import("./components/Icons/RadioTherapy.js"), "../Icons/RadioactiveTreatment.tsx": () => import("./components/Icons/RadioactiveTreatment.js"), "../Icons/Radioiodine.tsx": () => import("./components/Icons/Radioiodine.js"), "../Icons/Receipt.tsx": () => import("./components/Icons/Receipt.js"), "../Icons/Receptionist.tsx": () => import("./components/Icons/Receptionist.js"), "../Icons/Recovery.tsx": () => import("./components/Icons/Recovery.js"), "../Icons/Referral.tsx": () => import("./components/Icons/Referral.js"), "../Icons/Refresh.tsx": () => import("./components/Icons/Refresh.js"), "../Icons/Refund.tsx": () => import("./components/Icons/Refund.js"), "../Icons/Reminder.tsx": () => import("./components/Icons/Reminder.js"), "../Icons/Reply.tsx": () => import("./components/Icons/Reply.js"), "../Icons/Rocket.tsx": () => import("./components/Icons/Rocket.js"), "../Icons/RtfFile.tsx": () => import("./components/Icons/RtfFile.js"), "../Icons/STDs.tsx": () => import("./components/Icons/STDs.js"), "../Icons/Save.tsx": () => import("./components/Icons/Save.js"), "../Icons/Scale.tsx": () => import("./components/Icons/Scale.js"), "../Icons/ScreenReader.tsx": () => import("./components/Icons/ScreenReader.js"), "../Icons/Search.tsx": () => import("./components/Icons/Search.js"), "../Icons/SectionSign.tsx": () => import("./components/Icons/SectionSign.js"), "../Icons/Settings.tsx": () => import("./components/Icons/Settings.js"), "../Icons/SettingsFill.tsx": () => import("./components/Icons/SettingsFill.js"), "../Icons/Sexualorientation.tsx": () => import("./components/Icons/Sexualorientation.js"), "../Icons/ShakingHand.tsx": () => import("./components/Icons/ShakingHand.js"), "../Icons/Share.tsx": () => import("./components/Icons/Share.js"), "../Icons/Shield.tsx": () => import("./components/Icons/Shield.js"), "../Icons/ShuntOperation.tsx": () => import("./components/Icons/ShuntOperation.js"), "../Icons/Skeleton.tsx": () => import("./components/Icons/Skeleton.js"), "../Icons/Skin.tsx": () => import("./components/Icons/Skin.js"), "../Icons/Snake.tsx": () => import("./components/Icons/Snake.js"), "../Icons/Snapchat.tsx": () => import("./components/Icons/Snapchat.js"), "../Icons/SortDown.tsx": () => import("./components/Icons/SortDown.js"), "../Icons/SortUp.tsx": () => import("./components/Icons/SortUp.js"), "../Icons/SpeechBubble.tsx": () => import("./components/Icons/SpeechBubble.js"), "../Icons/Spray.tsx": () => import("./components/Icons/Spray.js"), "../Icons/Stopwatch.tsx": () => import("./components/Icons/Stopwatch.js"), "../Icons/Sun.tsx": () => import("./components/Icons/Sun.js"), "../Icons/SupportingPerson.tsx": () => import("./components/Icons/SupportingPerson.js"), "../Icons/Surgery.tsx": () => import("./components/Icons/Surgery.js"), "../Icons/Sweets.tsx": () => import("./components/Icons/Sweets.js"), "../Icons/Syringe.tsx": () => import("./components/Icons/Syringe.js"), "../Icons/Taxi.tsx": () => import("./components/Icons/Taxi.js"), "../Icons/TeddyBear.tsx": () => import("./components/Icons/TeddyBear.js"), "../Icons/Teenagers.tsx": () => import("./components/Icons/Teenagers.js"), "../Icons/ThinkingAboutBaby.tsx": () => import("./components/Icons/ThinkingAboutBaby.js"), "../Icons/Ticket.tsx": () => import("./components/Icons/Ticket.js"), "../Icons/TimePassing.tsx": () => import("./components/Icons/TimePassing.js"), "../Icons/Tombstone.tsx": () => import("./components/Icons/Tombstone.js"), "../Icons/Toolbox.tsx": () => import("./components/Icons/Toolbox.js"), "../Icons/Tooth.tsx": () => import("./components/Icons/Tooth.js"), "../Icons/TotalKneeProsthesis.tsx": () => import("./components/Icons/TotalKneeProsthesis.js"), "../Icons/Train.tsx": () => import("./components/Icons/Train.js"), "../Icons/Transplantation.tsx": () => import("./components/Icons/Transplantation.js"), "../Icons/TrashCan.tsx": () => import("./components/Icons/TrashCan.js"), "../Icons/TravelRoute.tsx": () => import("./components/Icons/TravelRoute.js"), "../Icons/TriangleX.tsx": () => import("./components/Icons/TriangleX.js"), "../Icons/Twitter.tsx": () => import("./components/Icons/Twitter.js"), "../Icons/Undo.tsx": () => import("./components/Icons/Undo.js"), "../Icons/UniProsthesis.tsx": () => import("./components/Icons/UniProsthesis.js"), "../Icons/Upload.tsx": () => import("./components/Icons/Upload.js"), "../Icons/UserOrganization.tsx": () => import("./components/Icons/UserOrganization.js"), "../Icons/Vaccine.tsx": () => import("./components/Icons/Vaccine.js"), "../Icons/VerticalDots.tsx": () => import("./components/Icons/VerticalDots.js"), "../Icons/VideoCamera.tsx": () => import("./components/Icons/VideoCamera.js"), "../Icons/VideoChat.tsx": () => import("./components/Icons/VideoChat.js"), "../Icons/Wallet.tsx": () => import("./components/Icons/Wallet.js"), "../Icons/Watch.tsx": () => import("./components/Icons/Watch.js"), "../Icons/Website.tsx": () => import("./components/Icons/Website.js"), "../Icons/Wheelchair.tsx": () => import("./components/Icons/Wheelchair.js"), "../Icons/WheelchairActive.tsx": () => import("./components/Icons/WheelchairActive.js"), "../Icons/Window.tsx": () => import("./components/Icons/Window.js"), "../Icons/WordDocument.tsx": () => import("./components/Icons/WordDocument.js"), "../Icons/WorkSuitcase.tsx": () => import("./components/Icons/WorkSuitcase.js"), "../Icons/X.tsx": () => import("./components/Icons/X.js"), "../Icons/XOutline.tsx": () => import("./components/Icons/XOutline.js"), "../Icons/XmlFile.tsx": () => import("./components/Icons/XmlFile.js"), "../Icons/YouTube.tsx": () => import("./components/Icons/YouTube.js"), "../Icons/Zoom.tsx": () => import("./components/Icons/Zoom.js") }), `../Icons/${iconName}.tsx`, 3));
|
|
7
|
+
const lazyLoadIcon = (iconName) => lazy(() => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../Icons/ActiveMonitoring.tsx": () => import("./components/Icons/ActiveMonitoring.js"), "../Icons/AcupunctureBack.tsx": () => import("./components/Icons/AcupunctureBack.js"), "../Icons/AlarmClock.tsx": () => import("./components/Icons/AlarmClock.js"), "../Icons/AlertSignFill.tsx": () => import("./components/Icons/AlertSignFill.js"), "../Icons/AlertSignStroke.tsx": () => import("./components/Icons/AlertSignStroke.js"), "../Icons/Amputation.tsx": () => import("./components/Icons/Amputation.js"), "../Icons/Anxiety.tsx": () => import("./components/Icons/Anxiety.js"), "../Icons/Apple.tsx": () => import("./components/Icons/Apple.js"), "../Icons/Archive.tsx": () => import("./components/Icons/Archive.js"), "../Icons/ArmFlexing.tsx": () => import("./components/Icons/ArmFlexing.js"), "../Icons/ArrowDown.tsx": () => import("./components/Icons/ArrowDown.js"), "../Icons/ArrowLeft.tsx": () => import("./components/Icons/ArrowLeft.js"), "../Icons/ArrowRight.tsx": () => import("./components/Icons/ArrowRight.js"), "../Icons/ArrowUp.tsx": () => import("./components/Icons/ArrowUp.js"), "../Icons/ArrowUpRight.tsx": () => import("./components/Icons/ArrowUpRight.js"), "../Icons/Attachment.tsx": () => import("./components/Icons/Attachment.js"), "../Icons/Atv.tsx": () => import("./components/Icons/Atv.js"), "../Icons/Avatar.tsx": () => import("./components/Icons/Avatar.js"), "../Icons/AwakePersonOnPillow.tsx": () => import("./components/Icons/AwakePersonOnPillow.js"), "../Icons/Baby.tsx": () => import("./components/Icons/Baby.js"), "../Icons/BandAid.tsx": () => import("./components/Icons/BandAid.js"), "../Icons/BeerAndPills.tsx": () => import("./components/Icons/BeerAndPills.js"), "../Icons/Bell.tsx": () => import("./components/Icons/Bell.js"), "../Icons/Bike.tsx": () => import("./components/Icons/Bike.js"), "../Icons/BirthControl.tsx": () => import("./components/Icons/BirthControl.js"), "../Icons/BirthdayCake.tsx": () => import("./components/Icons/BirthdayCake.js"), "../Icons/Boat.tsx": () => import("./components/Icons/Boat.js"), "../Icons/Body.tsx": () => import("./components/Icons/Body.js"), "../Icons/Braille.tsx": () => import("./components/Icons/Braille.js"), "../Icons/Brain.tsx": () => import("./components/Icons/Brain.js"), "../Icons/BreastReconstruction.tsx": () => import("./components/Icons/BreastReconstruction.js"), "../Icons/BreastRemoval.tsx": () => import("./components/Icons/BreastRemoval.js"), "../Icons/Breasts.tsx": () => import("./components/Icons/Breasts.js"), "../Icons/BrokenHeart.tsx": () => import("./components/Icons/BrokenHeart.js"), "../Icons/BrokenPuzzle.tsx": () => import("./components/Icons/BrokenPuzzle.js"), "../Icons/Bus.tsx": () => import("./components/Icons/Bus.js"), "../Icons/Calendar.tsx": () => import("./components/Icons/Calendar.js"), "../Icons/CalendarChange.tsx": () => import("./components/Icons/CalendarChange.js"), "../Icons/CalendarCheck.tsx": () => import("./components/Icons/CalendarCheck.js"), "../Icons/CalendarEvent.tsx": () => import("./components/Icons/CalendarEvent.js"), "../Icons/CalendarSave.tsx": () => import("./components/Icons/CalendarSave.js"), "../Icons/Cancer.tsx": () => import("./components/Icons/Cancer.js"), "../Icons/Candle.tsx": () => import("./components/Icons/Candle.js"), "../Icons/Car.tsx": () => import("./components/Icons/Car.js"), "../Icons/Carton.tsx": () => import("./components/Icons/Carton.js"), "../Icons/Change.tsx": () => import("./components/Icons/Change.js"), "../Icons/Check.tsx": () => import("./components/Icons/Check.js"), "../Icons/CheckFill.tsx": () => import("./components/Icons/CheckFill.js"), "../Icons/CheckOutline.tsx": () => import("./components/Icons/CheckOutline.js"), "../Icons/Chest.tsx": () => import("./components/Icons/Chest.js"), "../Icons/ChevronDown.tsx": () => import("./components/Icons/ChevronDown.js"), "../Icons/ChevronLeft.tsx": () => import("./components/Icons/ChevronLeft.js"), "../Icons/ChevronRight.tsx": () => import("./components/Icons/ChevronRight.js"), "../Icons/ChevronUp.tsx": () => import("./components/Icons/ChevronUp.js"), "../Icons/ChevronsDown.tsx": () => import("./components/Icons/ChevronsDown.js"), "../Icons/ChevronsUp.tsx": () => import("./components/Icons/ChevronsUp.js"), "../Icons/ChildPlaying.tsx": () => import("./components/Icons/ChildPlaying.js"), "../Icons/Cigarette.tsx": () => import("./components/Icons/Cigarette.js"), "../Icons/Coins.tsx": () => import("./components/Icons/Coins.js"), "../Icons/Contacts.tsx": () => import("./components/Icons/Contacts.js"), "../Icons/Copy.tsx": () => import("./components/Icons/Copy.js"), "../Icons/CoronaCertificate.tsx": () => import("./components/Icons/CoronaCertificate.js"), "../Icons/Coronavirus.tsx": () => import("./components/Icons/Coronavirus.js"), "../Icons/Cough.tsx": () => import("./components/Icons/Cough.js"), "../Icons/CreditCard.tsx": () => import("./components/Icons/CreditCard.js"), "../Icons/CriticalHealthInfo.tsx": () => import("./components/Icons/CriticalHealthInfo.js"), "../Icons/Cross.tsx": () => import("./components/Icons/Cross.js"), "../Icons/DataExchange.tsx": () => import("./components/Icons/DataExchange.js"), "../Icons/DataReceived.tsx": () => import("./components/Icons/DataReceived.js"), "../Icons/DataSent.tsx": () => import("./components/Icons/DataSent.js"), "../Icons/Depression.tsx": () => import("./components/Icons/Depression.js"), "../Icons/DigestiveSystem.tsx": () => import("./components/Icons/DigestiveSystem.js"), "../Icons/Dizzy.tsx": () => import("./components/Icons/Dizzy.js"), "../Icons/Documents.tsx": () => import("./components/Icons/Documents.js"), "../Icons/Dog.tsx": () => import("./components/Icons/Dog.js"), "../Icons/DonorCard.tsx": () => import("./components/Icons/DonorCard.js"), "../Icons/Download.tsx": () => import("./components/Icons/Download.js"), "../Icons/Draft.tsx": () => import("./components/Icons/Draft.js"), "../Icons/EChat.tsx": () => import("./components/Icons/EChat.js"), "../Icons/Ear.tsx": () => import("./components/Icons/Ear.js"), "../Icons/EarDeaf.tsx": () => import("./components/Icons/EarDeaf.js"), "../Icons/EarHearingAid.tsx": () => import("./components/Icons/EarHearingAid.js"), "../Icons/EarNoseThroat.tsx": () => import("./components/Icons/EarNoseThroat.js"), "../Icons/EarVolume.tsx": () => import("./components/Icons/EarVolume.js"), "../Icons/ElderlyPerson.tsx": () => import("./components/Icons/ElderlyPerson.js"), "../Icons/Embolization.tsx": () => import("./components/Icons/Embolization.js"), "../Icons/EmergencyCall.tsx": () => import("./components/Icons/EmergencyCall.js"), "../Icons/EmoticonAnnoyed.tsx": () => import("./components/Icons/EmoticonAnnoyed.js"), "../Icons/EmoticonDelighted.tsx": () => import("./components/Icons/EmoticonDelighted.js"), "../Icons/EmoticonDisappointed.tsx": () => import("./components/Icons/EmoticonDisappointed.js"), "../Icons/EmoticonHappy.tsx": () => import("./components/Icons/EmoticonHappy.js"), "../Icons/EmoticonMeh.tsx": () => import("./components/Icons/EmoticonMeh.js"), "../Icons/EmptyBox.tsx": () => import("./components/Icons/EmptyBox.js"), "../Icons/EnterFullScreen.tsx": () => import("./components/Icons/EnterFullScreen.js"), "../Icons/Envelope.tsx": () => import("./components/Icons/Envelope.js"), "../Icons/Epilepsy.tsx": () => import("./components/Icons/Epilepsy.js"), "../Icons/Eraser.tsx": () => import("./components/Icons/Eraser.js"), "../Icons/ErrorSignFill.tsx": () => import("./components/Icons/ErrorSignFill.js"), "../Icons/ErrorSignStroke.tsx": () => import("./components/Icons/ErrorSignStroke.js"), "../Icons/EuropeanHealthCard.tsx": () => import("./components/Icons/EuropeanHealthCard.js"), "../Icons/ExitFullScreen.tsx": () => import("./components/Icons/ExitFullScreen.js"), "../Icons/Eye.tsx": () => import("./components/Icons/Eye.js"), "../Icons/Facebook.tsx": () => import("./components/Icons/Facebook.js"), "../Icons/FallingLeaf.tsx": () => import("./components/Icons/FallingLeaf.js"), "../Icons/Female.tsx": () => import("./components/Icons/Female.js"), "../Icons/FemaleDoctor.tsx": () => import("./components/Icons/FemaleDoctor.js"), "../Icons/Ferry.tsx": () => import("./components/Icons/Ferry.js"), "../Icons/File.tsx": () => import("./components/Icons/File.js"), "../Icons/Filter.tsx": () => import("./components/Icons/Filter.js"), "../Icons/FingerBleed.tsx": () => import("./components/Icons/FingerBleed.js"), "../Icons/FirstAidKit.tsx": () => import("./components/Icons/FirstAidKit.js"), "../Icons/Fish.tsx": () => import("./components/Icons/Fish.js"), "../Icons/FloppyDisk.tsx": () => import("./components/Icons/FloppyDisk.js"), "../Icons/Football.tsx": () => import("./components/Icons/Football.js"), "../Icons/Form.tsx": () => import("./components/Icons/Form.js"), "../Icons/Forward.tsx": () => import("./components/Icons/Forward.js"), "../Icons/Gallery.tsx": () => import("./components/Icons/Gallery.js"), "../Icons/Garden.tsx": () => import("./components/Icons/Garden.js"), "../Icons/GasCan.tsx": () => import("./components/Icons/GasCan.js"), "../Icons/GenderIdentity.tsx": () => import("./components/Icons/GenderIdentity.js"), "../Icons/GlassWater.tsx": () => import("./components/Icons/GlassWater.js"), "../Icons/Glasses.tsx": () => import("./components/Icons/Glasses.js"), "../Icons/Globe.tsx": () => import("./components/Icons/Globe.js"), "../Icons/Grain.tsx": () => import("./components/Icons/Grain.js"), "../Icons/Graph.tsx": () => import("./components/Icons/Graph.js"), "../Icons/Group.tsx": () => import("./components/Icons/Group.js"), "../Icons/GroupTwins.tsx": () => import("./components/Icons/GroupTwins.js"), "../Icons/HTMLFile.tsx": () => import("./components/Icons/HTMLFile.js"), "../Icons/HandWaving.tsx": () => import("./components/Icons/HandWaving.js"), "../Icons/HandWithDisease.tsx": () => import("./components/Icons/HandWithDisease.js"), "../Icons/HandsAndHeart.tsx": () => import("./components/Icons/HandsAndHeart.js"), "../Icons/HealthClinic.tsx": () => import("./components/Icons/HealthClinic.js"), "../Icons/HealthMeasurements.tsx": () => import("./components/Icons/HealthMeasurements.js"), "../Icons/HealthWarning.tsx": () => import("./components/Icons/HealthWarning.js"), "../Icons/HealthcarePerson.tsx": () => import("./components/Icons/HealthcarePerson.js"), "../Icons/HealthcarePersonell.tsx": () => import("./components/Icons/HealthcarePersonell.js"), "../Icons/HearingProtection.tsx": () => import("./components/Icons/HearingProtection.js"), "../Icons/Heart.tsx": () => import("./components/Icons/Heart.js"), "../Icons/HeartHands.tsx": () => import("./components/Icons/HeartHands.js"), "../Icons/HelpSign.tsx": () => import("./components/Icons/HelpSign.js"), "../Icons/HelpingHand.tsx": () => import("./components/Icons/HelpingHand.js"), "../Icons/Hemodialysis.tsx": () => import("./components/Icons/Hemodialysis.js"), "../Icons/Hiker.tsx": () => import("./components/Icons/Hiker.js"), "../Icons/Hipprosthesis.tsx": () => import("./components/Icons/Hipprosthesis.js"), "../Icons/History.tsx": () => import("./components/Icons/History.js"), "../Icons/HivAndAids.tsx": () => import("./components/Icons/HivAndAids.js"), "../Icons/Home.tsx": () => import("./components/Icons/Home.js"), "../Icons/HomeFill.tsx": () => import("./components/Icons/HomeFill.js"), "../Icons/Hormone.tsx": () => import("./components/Icons/Hormone.js"), "../Icons/Hospital.tsx": () => import("./components/Icons/Hospital.js"), "../Icons/Hourglass.tsx": () => import("./components/Icons/Hourglass.js"), "../Icons/ImgFile.tsx": () => import("./components/Icons/ImgFile.js"), "../Icons/Inbox.tsx": () => import("./components/Icons/Inbox.js"), "../Icons/InfoSignFill.tsx": () => import("./components/Icons/InfoSignFill.js"), "../Icons/InfoSignStroke.tsx": () => import("./components/Icons/InfoSignStroke.js"), "../Icons/Instagram.tsx": () => import("./components/Icons/Instagram.js"), "../Icons/Intravenous.tsx": () => import("./components/Icons/Intravenous.js"), "../Icons/JointPain.tsx": () => import("./components/Icons/JointPain.js"), "../Icons/Journal.tsx": () => import("./components/Icons/Journal.js"), "../Icons/JpgFile.tsx": () => import("./components/Icons/JpgFile.js"), "../Icons/Kidney.tsx": () => import("./components/Icons/Kidney.js"), "../Icons/KitchenScale.tsx": () => import("./components/Icons/KitchenScale.js"), "../Icons/Kjernejournal.tsx": () => import("./components/Icons/Kjernejournal.js"), "../Icons/Laboratory.tsx": () => import("./components/Icons/Laboratory.js"), "../Icons/LaptopBlog.tsx": () => import("./components/Icons/LaptopBlog.js"), "../Icons/LawBook.tsx": () => import("./components/Icons/LawBook.js"), "../Icons/LegalDocument.tsx": () => import("./components/Icons/LegalDocument.js"), "../Icons/LightBulb.tsx": () => import("./components/Icons/LightBulb.js"), "../Icons/List.tsx": () => import("./components/Icons/List.js"), "../Icons/Location.tsx": () => import("./components/Icons/Location.js"), "../Icons/LocationFill.tsx": () => import("./components/Icons/LocationFill.js"), "../Icons/Lock.tsx": () => import("./components/Icons/Lock.js"), "../Icons/Login.tsx": () => import("./components/Icons/Login.js"), "../Icons/Logout.tsx": () => import("./components/Icons/Logout.js"), "../Icons/Lungs.tsx": () => import("./components/Icons/Lungs.js"), "../Icons/Makeup.tsx": () => import("./components/Icons/Makeup.js"), "../Icons/MaleDoctor.tsx": () => import("./components/Icons/MaleDoctor.js"), "../Icons/MaleDoctorAndPerson.tsx": () => import("./components/Icons/MaleDoctorAndPerson.js"), "../Icons/MaleDoctorCompact.tsx": () => import("./components/Icons/MaleDoctorCompact.js"), "../Icons/MaleDoctorCompactFill.tsx": () => import("./components/Icons/MaleDoctorCompactFill.js"), "../Icons/MaleGenitalia.tsx": () => import("./components/Icons/MaleGenitalia.js"), "../Icons/Medicine.tsx": () => import("./components/Icons/Medicine.js"), "../Icons/MedicineWarning.tsx": () => import("./components/Icons/MedicineWarning.js"), "../Icons/MentalHealthAdult.tsx": () => import("./components/Icons/MentalHealthAdult.js"), "../Icons/MentalHealthChild.tsx": () => import("./components/Icons/MentalHealthChild.js"), "../Icons/Menu.tsx": () => import("./components/Icons/Menu.js"), "../Icons/Microscope.tsx": () => import("./components/Icons/Microscope.js"), "../Icons/Minus.tsx": () => import("./components/Icons/Minus.js"), "../Icons/Mirror.tsx": () => import("./components/Icons/Mirror.js"), "../Icons/MobilePhone.tsx": () => import("./components/Icons/MobilePhone.js"), "../Icons/MotherHoldingBaby.tsx": () => import("./components/Icons/MotherHoldingBaby.js"), "../Icons/MuscleBack.tsx": () => import("./components/Icons/MuscleBack.js"), "../Icons/MuscleLeg.tsx": () => import("./components/Icons/MuscleLeg.js"), "../Icons/Mushroom.tsx": () => import("./components/Icons/Mushroom.js"), "../Icons/Music.tsx": () => import("./components/Icons/Music.js"), "../Icons/MusselsAndSalt.tsx": () => import("./components/Icons/MusselsAndSalt.js"), "../Icons/NoAccess.tsx": () => import("./components/Icons/NoAccess.js"), "../Icons/NoEye.tsx": () => import("./components/Icons/NoEye.js"), "../Icons/NoFilter.tsx": () => import("./components/Icons/NoFilter.js"), "../Icons/Notepad.tsx": () => import("./components/Icons/Notepad.js"), "../Icons/Osteotomy.tsx": () => import("./components/Icons/Osteotomy.js"), "../Icons/PaintRoller.tsx": () => import("./components/Icons/PaintRoller.js"), "../Icons/PaperPlane.tsx": () => import("./components/Icons/PaperPlane.js"), "../Icons/PatientAndPerson.tsx": () => import("./components/Icons/PatientAndPerson.js"), "../Icons/Pause.tsx": () => import("./components/Icons/Pause.js"), "../Icons/PdfFile.tsx": () => import("./components/Icons/PdfFile.js"), "../Icons/Pencil.tsx": () => import("./components/Icons/Pencil.js"), "../Icons/PeopleTalking.tsx": () => import("./components/Icons/PeopleTalking.js"), "../Icons/Peritonealdialysis.tsx": () => import("./components/Icons/Peritonealdialysis.js"), "../Icons/Person.tsx": () => import("./components/Icons/Person.js"), "../Icons/PersonAndPatient.tsx": () => import("./components/Icons/PersonAndPatient.js"), "../Icons/PersonCancel.tsx": () => import("./components/Icons/PersonCancel.js"), "../Icons/PersonInXRayMachine.tsx": () => import("./components/Icons/PersonInXRayMachine.js"), "../Icons/PersonOverweight.tsx": () => import("./components/Icons/PersonOverweight.js"), "../Icons/PersonRelaxing.tsx": () => import("./components/Icons/PersonRelaxing.js"), "../Icons/PersonWithBrain.tsx": () => import("./components/Icons/PersonWithBrain.js"), "../Icons/PersonWithBrokenArm.tsx": () => import("./components/Icons/PersonWithBrokenArm.js"), "../Icons/PersonWithCrutches.tsx": () => import("./components/Icons/PersonWithCrutches.js"), "../Icons/PersonWithJaw.tsx": () => import("./components/Icons/PersonWithJaw.js"), "../Icons/PersonWithMagnifyingGlass.tsx": () => import("./components/Icons/PersonWithMagnifyingGlass.js"), "../Icons/PersonWithSenses.tsx": () => import("./components/Icons/PersonWithSenses.js"), "../Icons/PersonWorking.tsx": () => import("./components/Icons/PersonWorking.js"), "../Icons/PersonalPlan.tsx": () => import("./components/Icons/PersonalPlan.js"), "../Icons/PizzaSlice.tsx": () => import("./components/Icons/PizzaSlice.js"), "../Icons/Plane.tsx": () => import("./components/Icons/Plane.js"), "../Icons/Plant.tsx": () => import("./components/Icons/Plant.js"), "../Icons/PlateKnifeFork.tsx": () => import("./components/Icons/PlateKnifeFork.js"), "../Icons/Play.tsx": () => import("./components/Icons/Play.js"), "../Icons/PlusLarge.tsx": () => import("./components/Icons/PlusLarge.js"), "../Icons/PlusSmall.tsx": () => import("./components/Icons/PlusSmall.js"), "../Icons/PngFile.tsx": () => import("./components/Icons/PngFile.js"), "../Icons/Podcast.tsx": () => import("./components/Icons/Podcast.js"), "../Icons/PoisonInformation.tsx": () => import("./components/Icons/PoisonInformation.js"), "../Icons/Pregnant.tsx": () => import("./components/Icons/Pregnant.js"), "../Icons/Printer.tsx": () => import("./components/Icons/Printer.js"), "../Icons/Psychosis.tsx": () => import("./components/Icons/Psychosis.js"), "../Icons/Publication.tsx": () => import("./components/Icons/Publication.js"), "../Icons/Puzzle.tsx": () => import("./components/Icons/Puzzle.js"), "../Icons/QrCode.tsx": () => import("./components/Icons/QrCode.js"), "../Icons/Quarrel.tsx": () => import("./components/Icons/Quarrel.js"), "../Icons/RadioTherapy.tsx": () => import("./components/Icons/RadioTherapy.js"), "../Icons/RadioactiveTreatment.tsx": () => import("./components/Icons/RadioactiveTreatment.js"), "../Icons/Radioiodine.tsx": () => import("./components/Icons/Radioiodine.js"), "../Icons/Receipt.tsx": () => import("./components/Icons/Receipt.js"), "../Icons/Receptionist.tsx": () => import("./components/Icons/Receptionist.js"), "../Icons/Recovery.tsx": () => import("./components/Icons/Recovery.js"), "../Icons/Referral.tsx": () => import("./components/Icons/Referral.js"), "../Icons/Refresh.tsx": () => import("./components/Icons/Refresh.js"), "../Icons/Refund.tsx": () => import("./components/Icons/Refund.js"), "../Icons/Reminder.tsx": () => import("./components/Icons/Reminder.js"), "../Icons/Reply.tsx": () => import("./components/Icons/Reply.js"), "../Icons/Rocket.tsx": () => import("./components/Icons/Rocket.js"), "../Icons/RtfFile.tsx": () => import("./components/Icons/RtfFile.js"), "../Icons/STDs.tsx": () => import("./components/Icons/STDs.js"), "../Icons/Save.tsx": () => import("./components/Icons/Save.js"), "../Icons/Scale.tsx": () => import("./components/Icons/Scale.js"), "../Icons/ScreenReader.tsx": () => import("./components/Icons/ScreenReader.js"), "../Icons/Search.tsx": () => import("./components/Icons/Search.js"), "../Icons/SectionSign.tsx": () => import("./components/Icons/SectionSign.js"), "../Icons/Settings.tsx": () => import("./components/Icons/Settings.js"), "../Icons/SettingsFill.tsx": () => import("./components/Icons/SettingsFill.js"), "../Icons/Sexualorientation.tsx": () => import("./components/Icons/Sexualorientation.js"), "../Icons/ShakingHand.tsx": () => import("./components/Icons/ShakingHand.js"), "../Icons/Share.tsx": () => import("./components/Icons/Share.js"), "../Icons/SharedHealthData.tsx": () => import("./components/Icons/SharedHealthData.js"), "../Icons/SharedHealthMeasurements.tsx": () => import("./components/Icons/SharedHealthMeasurements.js"), "../Icons/Shield.tsx": () => import("./components/Icons/Shield.js"), "../Icons/ShuntOperation.tsx": () => import("./components/Icons/ShuntOperation.js"), "../Icons/Skeleton.tsx": () => import("./components/Icons/Skeleton.js"), "../Icons/Skin.tsx": () => import("./components/Icons/Skin.js"), "../Icons/Snake.tsx": () => import("./components/Icons/Snake.js"), "../Icons/Snapchat.tsx": () => import("./components/Icons/Snapchat.js"), "../Icons/SortDown.tsx": () => import("./components/Icons/SortDown.js"), "../Icons/SortUp.tsx": () => import("./components/Icons/SortUp.js"), "../Icons/SpeechBubble.tsx": () => import("./components/Icons/SpeechBubble.js"), "../Icons/Spray.tsx": () => import("./components/Icons/Spray.js"), "../Icons/StickyNote.tsx": () => import("./components/Icons/StickyNote.js"), "../Icons/StickyNotes.tsx": () => import("./components/Icons/StickyNotes.js"), "../Icons/Stopwatch.tsx": () => import("./components/Icons/Stopwatch.js"), "../Icons/Sun.tsx": () => import("./components/Icons/Sun.js"), "../Icons/SupportingPerson.tsx": () => import("./components/Icons/SupportingPerson.js"), "../Icons/Surgery.tsx": () => import("./components/Icons/Surgery.js"), "../Icons/Sweets.tsx": () => import("./components/Icons/Sweets.js"), "../Icons/Syringe.tsx": () => import("./components/Icons/Syringe.js"), "../Icons/Taxi.tsx": () => import("./components/Icons/Taxi.js"), "../Icons/TeddyBear.tsx": () => import("./components/Icons/TeddyBear.js"), "../Icons/Teenagers.tsx": () => import("./components/Icons/Teenagers.js"), "../Icons/ThinkingAboutBaby.tsx": () => import("./components/Icons/ThinkingAboutBaby.js"), "../Icons/Ticket.tsx": () => import("./components/Icons/Ticket.js"), "../Icons/TimePassing.tsx": () => import("./components/Icons/TimePassing.js"), "../Icons/Tombstone.tsx": () => import("./components/Icons/Tombstone.js"), "../Icons/Toolbox.tsx": () => import("./components/Icons/Toolbox.js"), "../Icons/Tooth.tsx": () => import("./components/Icons/Tooth.js"), "../Icons/TotalKneeProsthesis.tsx": () => import("./components/Icons/TotalKneeProsthesis.js"), "../Icons/Train.tsx": () => import("./components/Icons/Train.js"), "../Icons/Transplantation.tsx": () => import("./components/Icons/Transplantation.js"), "../Icons/TrashCan.tsx": () => import("./components/Icons/TrashCan.js"), "../Icons/TravelRoute.tsx": () => import("./components/Icons/TravelRoute.js"), "../Icons/TriangleX.tsx": () => import("./components/Icons/TriangleX.js"), "../Icons/Twitter.tsx": () => import("./components/Icons/Twitter.js"), "../Icons/Undo.tsx": () => import("./components/Icons/Undo.js"), "../Icons/UniProsthesis.tsx": () => import("./components/Icons/UniProsthesis.js"), "../Icons/Upload.tsx": () => import("./components/Icons/Upload.js"), "../Icons/UserOrganization.tsx": () => import("./components/Icons/UserOrganization.js"), "../Icons/Vaccine.tsx": () => import("./components/Icons/Vaccine.js"), "../Icons/VerticalDots.tsx": () => import("./components/Icons/VerticalDots.js"), "../Icons/VideoCamera.tsx": () => import("./components/Icons/VideoCamera.js"), "../Icons/VideoChat.tsx": () => import("./components/Icons/VideoChat.js"), "../Icons/Wallet.tsx": () => import("./components/Icons/Wallet.js"), "../Icons/Watch.tsx": () => import("./components/Icons/Watch.js"), "../Icons/Website.tsx": () => import("./components/Icons/Website.js"), "../Icons/Wheelchair.tsx": () => import("./components/Icons/Wheelchair.js"), "../Icons/WheelchairActive.tsx": () => import("./components/Icons/WheelchairActive.js"), "../Icons/Window.tsx": () => import("./components/Icons/Window.js"), "../Icons/WordDocument.tsx": () => import("./components/Icons/WordDocument.js"), "../Icons/WorkSuitcase.tsx": () => import("./components/Icons/WorkSuitcase.js"), "../Icons/X.tsx": () => import("./components/Icons/X.js"), "../Icons/XOutline.tsx": () => import("./components/Icons/XOutline.js"), "../Icons/XmlFile.tsx": () => import("./components/Icons/XmlFile.js"), "../Icons/YouTube.tsx": () => import("./components/Icons/YouTube.js"), "../Icons/Zoom.tsx": () => import("./components/Icons/Zoom.js") }), `../Icons/${iconName}.tsx`, 3));
|
|
8
8
|
const LazyIcon = ({ iconName, size = IconSize.Small, ...rest }) => {
|
|
9
9
|
const icon = useMemo(() => lazyLoadIcon(iconName), [iconName]);
|
|
10
10
|
const isServerSide = useIsServerSide();
|
package/LazyIcon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LazyIcon.js","sources":["../src/components/LazyIcon/LazyIcon.tsx"],"sourcesContent":["import React, { lazy, Suspense, useMemo } from 'react';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport { useIsServerSide } from '../../hooks/useIsServerSide';\nimport Icon, { BaseIconProps, IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\n\nexport interface LazyIconProps extends BaseIconProps {\n // Navnet på ikonet som skal vises. Tilsvarer filnavnet til ikonet i Icons-mappen\n iconName: IconName;\n}\n\nexport const lazyLoadIcon = (iconName: IconName): React.LazyExoticComponent<SvgIcon> =>\n lazy<SvgIcon>(() => import(`../Icons/${iconName}.tsx`));\n\nexport const LazyIcon: React.FC<LazyIconProps> = ({ iconName, size = IconSize.Small, ...rest }) => {\n const icon = useMemo(() => lazyLoadIcon(iconName), [iconName]);\n const isServerSide = useIsServerSide();\n\n if (isServerSide) {\n return null;\n }\n\n const fallback = (\n <svg\n data-testid={'fallback'}\n role={'presentation'}\n focusable={false}\n aria-hidden={true}\n viewBox=\"0 0 48 48\"\n style={{ minWidth: size, minHeight: size }}\n width={size}\n height={size}\n />\n );\n\n return (\n <ErrorBoundary fallback={fallback} reset={iconName}>\n <Suspense fallback={fallback}>\n <Icon svgIcon={icon} size={size} {...rest} />\n </Suspense>\n </ErrorBoundary>\n );\n};\n\nexport default LazyIcon;\n"],"names":[],"mappings":";;;;;;AAYa,MAAA,eAAe,CAAC,aAC3B,KAAc,MAAM,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,8BAAA,GAAA,sBAAA,MAAA,OAAA,6BAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,2BAAA,MAAA,OAAA,kCAAA,GAAA,iCAAA,MAAA,OAAA,wCAAA,GAAA,uBAAA,MAAA,OAAA,8BAAA,GAAA,6BAAA,MAAA,OAAA,oCAAA,GAAA,6BAAA,MAAA,OAAA,oCAAA,GAAA,kBAAA,MAAA,OAAA,yBAAA,GAAA,yBAAA,MAAA,OAAA,gCAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,qBAAA,MAAA,OAAA,4BAAA,EAAA,CAAA,GAAA,YAAA,QAAA,QAAA,CAAA,CAAA;AAE3C,MAAA,WAAoC,CAAC,EAAE,UAAU,OAAO,SAAS,OAAO,GAAG,WAAW;AAC3F,QAAA,OAAO,QAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAC7D,QAAM,eAAe,gBAAgB;AAErC,MAAI,cAAc;AACT,WAAA;AAAA,EAAA;AAGT,QAAM,WACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAa;AAAA,MACb,MAAM;AAAA,MACN,WAAW;AAAA,MACX,eAAa;AAAA,MACb,SAAQ;AAAA,MACR,OAAO,EAAE,UAAU,MAAM,WAAW,KAAK;AAAA,MACzC,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACV;AAGF,6BACG,eAAc,EAAA,UAAoB,OAAO,UACxC,8BAAC,UAAS,EAAA,UACR,UAAC,oBAAA,MAAA,EAAK,SAAS,MAAM,MAAa,GAAG,KAAA,CAAM,EAC7C,CAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"LazyIcon.js","sources":["../src/components/LazyIcon/LazyIcon.tsx"],"sourcesContent":["import React, { lazy, Suspense, useMemo } from 'react';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport { useIsServerSide } from '../../hooks/useIsServerSide';\nimport Icon, { BaseIconProps, IconSize, SvgIcon } from '../Icon';\nimport { IconName } from '../Icons/IconNames';\n\nexport interface LazyIconProps extends BaseIconProps {\n // Navnet på ikonet som skal vises. Tilsvarer filnavnet til ikonet i Icons-mappen\n iconName: IconName;\n}\n\nexport const lazyLoadIcon = (iconName: IconName): React.LazyExoticComponent<SvgIcon> =>\n lazy<SvgIcon>(() => import(`../Icons/${iconName}.tsx`));\n\nexport const LazyIcon: React.FC<LazyIconProps> = ({ iconName, size = IconSize.Small, ...rest }) => {\n const icon = useMemo(() => lazyLoadIcon(iconName), [iconName]);\n const isServerSide = useIsServerSide();\n\n if (isServerSide) {\n return null;\n }\n\n const fallback = (\n <svg\n data-testid={'fallback'}\n role={'presentation'}\n focusable={false}\n aria-hidden={true}\n viewBox=\"0 0 48 48\"\n style={{ minWidth: size, minHeight: size }}\n width={size}\n height={size}\n />\n );\n\n return (\n <ErrorBoundary fallback={fallback} reset={iconName}>\n <Suspense fallback={fallback}>\n <Icon svgIcon={icon} size={size} {...rest} />\n </Suspense>\n </ErrorBoundary>\n );\n};\n\nexport default LazyIcon;\n"],"names":[],"mappings":";;;;;;AAYa,MAAA,eAAe,CAAC,aAC3B,KAAc,MAAM,qCAAkC,uBAAA,OAAA,EAAA,iCAAA,MAAA,OAAA,wCAAA,GAAA,gCAAA,MAAA,OAAA,uCAAA,GAAA,2BAAA,MAAA,OAAA,kCAAA,GAAA,8BAAA,MAAA,OAAA,qCAAA,GAAA,gCAAA,MAAA,OAAA,uCAAA,GAAA,2BAAA,MAAA,OAAA,kCAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,sBAAA,MAAA,OAAA,6BAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,2BAAA,MAAA,OAAA,kCAAA,GAAA,0BAAA,MAAA,OAAA,iCAAA,GAAA,0BAAA,MAAA,OAAA,iCAAA,GAAA,2BAAA,MAAA,OAAA,kCAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,6BAAA,M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AAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,wBAAA,MAAA,OAAA,+BAAA,GAAA,qBAAA,MAAA,OAAA,4BAAA,EAAA,CAAA,GAAA,YAAA,QAAA,QAAA,CAAA,CAAA;AAE3C,MAAA,WAAoC,CAAC,EAAE,UAAU,OAAO,SAAS,OAAO,GAAG,WAAW;AAC3F,QAAA,OAAO,QAAQ,MAAM,aAAa,QAAQ,GAAG,CAAC,QAAQ,CAAC;AAC7D,QAAM,eAAe,gBAAgB;AAErC,MAAI,cAAc;AACT,WAAA;AAAA,EAAA;AAGT,QAAM,WACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAa;AAAA,MACb,MAAM;AAAA,MACN,WAAW;AAAA,MACX,eAAa;AAAA,MACb,SAAQ;AAAA,MACR,OAAO,EAAE,UAAU,MAAM,WAAW,KAAK;AAAA,MACzC,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACV;AAGF,6BACG,eAAc,EAAA,UAAoB,OAAO,UACxC,8BAAC,UAAS,EAAA,UACR,UAAC,oBAAA,MAAA,EAAK,SAAS,MAAM,MAAa,GAAG,KAAA,CAAM,EAC7C,CAAA,GACF;AAEJ;"}
|
|
@@ -2,9 +2,10 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { createContext, useId, useRef, useContext, useInsertionEffect, useCallback, useMemo, useEffect, Children, isValidElement, useLayoutEffect, useState } from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
|
-
import { ZIndex, AnalyticsId } from "../../constants.js";
|
|
5
|
+
import { ZIndex, KeyboardEventKey, AnalyticsId } from "../../constants.js";
|
|
6
6
|
import { useBreakpoint } from "../../hooks/useBreakpoint.js";
|
|
7
7
|
import { useFocusTrap } from "../../hooks/useFocusTrap.js";
|
|
8
|
+
import { useKeyboardEvent } from "../../hooks/useKeyboardEvent.js";
|
|
8
9
|
import { useOutsideEvent } from "../../hooks/useOutsideEvent.js";
|
|
9
10
|
import { useReturnFocusOnUnmount } from "../../hooks/useReturnFocusOnUnmount.js";
|
|
10
11
|
import { breakpoints } from "../../theme/grid.js";
|
|
@@ -251,6 +252,7 @@ const InnerDrawer = (props) => {
|
|
|
251
252
|
useOutsideEvent(containerRef, () => {
|
|
252
253
|
onRequestClose && onRequestClose();
|
|
253
254
|
});
|
|
255
|
+
useKeyboardEvent(containerRef, () => onRequestClose && onRequestClose(), [KeyboardEventKey.Escape]);
|
|
254
256
|
useEffect(() => {
|
|
255
257
|
var _a;
|
|
256
258
|
(_a = containerRef.current) == null ? void 0 : _a.focus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/motion/dist/es/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/context/PresenceContext.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/utils.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs","../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\nimport { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = createContext(null);\n\nexport { PresenceContext };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n top: ${top}px !important;\n left: ${left}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useCallback, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n const memoizedOnExitComplete = useCallback((childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n }, [presenceChildren, onExitComplete]);\n const context = useMemo(() => ({\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: memoizedOnExitComplete,\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n }), \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout\n ? [Math.random(), memoizedOnExitComplete]\n : [isPresent, memoizedOnExitComplete]);\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = jsx(PopChild, { isPresent: isPresent, children: children });\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe)\n register(id);\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","import { Children, isValidElement } from 'react';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n\nexport { getChildKey, onlyElements };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender === null || forceRender === void 0 ? void 0 : forceRender();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove());\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: isPresent ? undefined : custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n","import React, { useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\nimport { AnimatePresence, useAnimate, usePresence } from 'motion/react';\n\nimport { AnalyticsId, ZIndex } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { breakpoints } from '../../theme/grid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport uuid from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\ntype DesktopDirections = 'left' | 'right';\n\nexport interface DrawerProps extends InnerDrawerProps {\n /** Opens and closes the drawer */\n isOpen: boolean;\n}\n\nexport interface InnerDrawerProps {\n /** Sets the aria-label of the drawer */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the drawer */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Direction of the drawer on desktop. Default: left */\n desktopDirection?: DesktopDirections;\n /** Title to display in the header of the drawer */\n title: string;\n /** id of the drawer title */\n titleId?: string;\n /** Changes the underlying element of the title. Default: h3 */\n titleHtmlMarkup?: TitleTags;\n /** Callback that triggers when clicking on close button or outside the drawer, update isOpen state when this triggers */\n onRequestClose: () => void;\n /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\n /** Main content of the drawer */\n children?: React.ReactNode;\n /** Primary CTA callback */\n onPrimaryAction?: () => void;\n /** Text for primary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n primaryActionText?: string;\n /** Text for secondary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n secondaryActionText?: string;\n /** Secondary CTA callback */\n onSecondaryAction?: () => void;\n /** Customize the z-index of the drawer */\n zIndex?: number;\n}\n\nconst Drawer: React.FC<DrawerProps> = props => {\n const { isOpen, ...rest } = props;\n\n return <AnimatePresence>{isOpen && <InnerDrawer {...rest} />}</AnimatePresence>;\n};\n\nconst InnerDrawer: React.FC<InnerDrawerProps> = props => {\n const {\n ariaLabel,\n ariaLabelledBy,\n ariaLabelCloseBtn,\n children,\n desktopDirection = 'left',\n footerContent,\n onPrimaryAction,\n onRequestClose,\n onSecondaryAction,\n primaryActionText,\n secondaryActionText,\n title,\n titleHtmlMarkup = 'h3',\n titleId = uuid(),\n zIndex = ZIndex.Modal,\n } = props;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledBy, fallbackId: titleId });\n const overlayRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const breakpoint = useBreakpoint();\n const isMobile = breakpoint < breakpoints.md;\n const [scope, animate] = useAnimate();\n const [isPresent, safeToRemove] = usePresence();\n const contentIsScrollable = contentRef.current && contentRef.current.scrollHeight > contentRef.current.clientHeight;\n\n useFocusTrap(containerRef, true);\n useReturnFocusOnUnmount(containerRef);\n useOutsideEvent(containerRef, () => {\n onRequestClose && onRequestClose();\n });\n\n useEffect(() => {\n containerRef.current?.focus();\n }, []);\n\n // Open animation.\n useEffect(() => {\n if (!overlayRef.current || !containerRef.current) return;\n\n if (!isPresent) {\n closeDrawer();\n return;\n }\n\n if (isMobile) {\n animate(containerRef.current, { y: '0' }, { duration: 0.3, ease: 'easeInOut' });\n } else {\n animate(containerRef.current, { x: '0' }, { duration: 0.3, ease: 'easeInOut' });\n }\n\n animate(overlayRef.current, { opacity: 1, pointerEvents: 'auto' }, { duration: 0.3, ease: 'easeInOut' });\n }, [isPresent]);\n\n useEffect(() => {}, [isPresent]);\n\n // Close animasjon, vi kaller `onClose()` til slutt\n const closeDrawer = (): void => {\n if (!overlayRef.current || !containerRef.current) return;\n\n animate(overlayRef.current, { opacity: 0, pointerEvents: 'none' }, { duration: 0.3, ease: 'easeInOut' });\n\n if (isMobile) {\n animate(\n containerRef.current,\n { y: '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n safeToRemove && safeToRemove();\n },\n }\n );\n } else {\n animate(\n containerRef.current,\n { x: desktopDirection === 'left' ? '-100%' : '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n safeToRemove && safeToRemove();\n },\n }\n );\n }\n };\n\n const handleCTA = (callback?: () => void): void => {\n if (callback) {\n callback();\n }\n };\n\n return (\n <div className={styles.drawer} ref={scope} style={{ zIndex }} data-analyticsid={AnalyticsId.Drawer}>\n <div className={styles.drawer__overlay} ref={overlayRef} aria-hidden=\"true\" />\n <div\n className={classNames(styles.drawer__container, {\n [styles['drawer__container--right']]: desktopDirection === 'right',\n })}\n ref={containerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n {...ariaLabelAttributes}\n >\n <div className={styles.drawer__container__inner}>\n <div className={styles.drawer__header}>\n <Title id={ariaLabelAttributes?.['aria-labelledby']} htmlMarkup={titleHtmlMarkup} appearance=\"title3\">\n {title}\n </Title>\n <Close ariaLabel={ariaLabelCloseBtn} onClick={onRequestClose} small={isMobile} />\n </div>\n <div\n className={styles.drawer__content}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\n ref={contentRef}\n >\n {children}\n </div>\n </div>\n <div className={styles.drawer__footer}>\n {footerContent ? (\n footerContent\n ) : (\n <>\n {primaryActionText && <Button onClick={() => handleCTA(onPrimaryAction)}>{primaryActionText}</Button>}\n {secondaryActionText && (\n <Button variant=\"borderless\" onClick={() => handleCTA(onSecondaryAction)}>\n {secondaryActionText}\n </Button>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n );\n};\n\nexport default Drawer;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAGA,MAAM,qBAAqB,cAAc,EAAE;ACG3C,MAAM,kBAAkB,cAAc,IAAI;ACA1C,MAAM,sBAAsB,cAAc;AAAA,EACtC,oBAAoB,CAAC,MAAM;AAAA,EAC3B,UAAU;AAAA,EACV,eAAe;AACnB,CAAC;ACAD,MAAM,wBAAwB,MAAM,UAAU;AAAA,EAC1C,wBAAwB,WAAW;AAC/B,UAAM,UAAU,KAAK,MAAM,SAAS;AACpC,QAAI,WAAW,UAAU,aAAa,CAAC,KAAK,MAAM,WAAW;AACzD,YAAM,OAAO,KAAK,MAAM,QAAQ;AAChC,WAAK,SAAS,QAAQ,gBAAgB;AACtC,WAAK,QAAQ,QAAQ,eAAe;AACpC,WAAK,MAAM,QAAQ;AACnB,WAAK,OAAO,QAAQ;AAAA,IAChC;AACQ,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAII,qBAAqB;AAAA,EAAA;AAAA,EACrB,SAAS;AACL,WAAO,KAAK,MAAM;AAAA,EAC1B;AACA;AACA,SAAS,SAAS,EAAE,UAAU,aAAa;AACvC,QAAM,KAAK,MAAO;AAClB,QAAM,MAAM,OAAO,IAAI;AACvB,QAAM,OAAO,OAAO;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACd,CAAK;AACD,QAAM,EAAE,MAAK,IAAK,WAAW,mBAAmB;AAUhD,q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D,KAAK;AAAA,QACL,MAAK;AAAA,QACL,cAAW;AAAA,QACX,UAAU;AAAA,QACT,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAC,qBAAA,OAAA,EAAI,WAAW,OAAO,0BACrB,UAAA;AAAA,YAAC,qBAAA,OAAA,EAAI,WAAW,OAAO,gBACrB,UAAA;AAAA,cAAC,oBAAA,OAAA,EAAM,IAAI,2DAAsB,oBAAoB,YAAY,iBAAiB,YAAW,UAC1F,UACH,MAAA,CAAA;AAAA,kCACC,OAAM,EAAA,WAAW,mBAAmB,SAAS,gBAAgB,OAAO,SAAU,CAAA;AAAA,YAAA,GACjF;AAAA,YACA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW,OAAO;AAAA,gBAClB,UAAU,sBAAsB,IAAI;AAAA,gBACpC,MAAM,sBAAsB,WAAW;AAAA,gBACtC,GAAI,sBAAsB,sBAAsB,CAAC;AAAA,gBAClD,KAAK;AAAA,gBAEJ;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GACF;AAAA,8BACC,OAAI,EAAA,WAAW,OAAO,gBACpB,UAAA,gBACC,gBAGG,qBAAA,UAAA,EAAA,UAAA;AAAA,YAAA,yCAAsB,QAAO,EAAA,SAAS,MAAM,UAAU,eAAe,GAAI,UAAkB,mBAAA;AAAA,YAC3F,uBACE,oBAAA,QAAA,EAAO,SAAQ,cAAa,SAAS,MAAM,UAAU,iBAAiB,GACpE,UACH,oBAAA,CAAA;AAAA,UAAA,EAAA,CAEJ,EAEJ,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/motion/dist/es/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/context/PresenceContext.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/utils.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/index.mjs","../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["\"use client\";\nimport { createContext } from 'react';\n\nconst LayoutGroupContext = createContext({});\n\nexport { LayoutGroupContext };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst PresenceContext = createContext(null);\n\nexport { PresenceContext };\n","\"use client\";\nimport { createContext } from 'react';\n\n/**\n * @public\n */\nconst MotionConfigContext = createContext({\n transformPagePoint: (p) => p,\n isStatic: false,\n reducedMotion: \"never\",\n});\n\nexport { MotionConfigContext };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useRef, useContext, useInsertionEffect } from 'react';\nimport { MotionConfigContext } from '../../context/MotionConfigContext.mjs';\n\n/**\n * Measurement functionality has to be within a separate component\n * to leverage snapshot lifecycle.\n */\nclass PopChildMeasure extends React.Component {\n getSnapshotBeforeUpdate(prevProps) {\n const element = this.props.childRef.current;\n if (element && prevProps.isPresent && !this.props.isPresent) {\n const size = this.props.sizeRef.current;\n size.height = element.offsetHeight || 0;\n size.width = element.offsetWidth || 0;\n size.top = element.offsetTop;\n size.left = element.offsetLeft;\n }\n return null;\n }\n /**\n * Required with getSnapshotBeforeUpdate to stop React complaining.\n */\n componentDidUpdate() { }\n render() {\n return this.props.children;\n }\n}\nfunction PopChild({ children, isPresent }) {\n const id = useId();\n const ref = useRef(null);\n const size = useRef({\n width: 0,\n height: 0,\n top: 0,\n left: 0,\n });\n const { nonce } = useContext(MotionConfigContext);\n /**\n * We create and inject a style block so we can apply this explicit\n * sizing in a non-destructive manner by just deleting the style block.\n *\n * We can't apply size via render as the measurement happens\n * in getSnapshotBeforeUpdate (post-render), likewise if we apply the\n * styles directly on the DOM node, we might be overwriting\n * styles set via the style prop.\n */\n useInsertionEffect(() => {\n const { width, height, top, left } = size.current;\n if (isPresent || !ref.current || !width || !height)\n return;\n ref.current.dataset.motionPopId = id;\n const style = document.createElement(\"style\");\n if (nonce)\n style.nonce = nonce;\n document.head.appendChild(style);\n if (style.sheet) {\n style.sheet.insertRule(`\n [data-motion-pop-id=\"${id}\"] {\n position: absolute !important;\n width: ${width}px !important;\n height: ${height}px !important;\n top: ${top}px !important;\n left: ${left}px !important;\n }\n `);\n }\n return () => {\n document.head.removeChild(style);\n };\n }, [isPresent]);\n return (jsx(PopChildMeasure, { isPresent: isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) }));\n}\n\nexport { PopChild };\n","\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport * as React from 'react';\nimport { useId, useCallback, useMemo } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PopChild } from './PopChild.mjs';\n\nconst PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, presenceAffectsLayout, mode, }) => {\n const presenceChildren = useConstant(newChildrenMap);\n const id = useId();\n const memoizedOnExitComplete = useCallback((childId) => {\n presenceChildren.set(childId, true);\n for (const isComplete of presenceChildren.values()) {\n if (!isComplete)\n return; // can stop searching when any is incomplete\n }\n onExitComplete && onExitComplete();\n }, [presenceChildren, onExitComplete]);\n const context = useMemo(() => ({\n id,\n initial,\n isPresent,\n custom,\n onExitComplete: memoizedOnExitComplete,\n register: (childId) => {\n presenceChildren.set(childId, false);\n return () => presenceChildren.delete(childId);\n },\n }), \n /**\n * If the presence of a child affects the layout of the components around it,\n * we want to make a new context value to ensure they get re-rendered\n * so they can detect that layout change.\n */\n presenceAffectsLayout\n ? [Math.random(), memoizedOnExitComplete]\n : [isPresent, memoizedOnExitComplete]);\n useMemo(() => {\n presenceChildren.forEach((_, key) => presenceChildren.set(key, false));\n }, [isPresent]);\n /**\n * If there's no `motion` components to fire exit animations, we want to remove this\n * component immediately.\n */\n React.useEffect(() => {\n !isPresent &&\n !presenceChildren.size &&\n onExitComplete &&\n onExitComplete();\n }, [isPresent]);\n if (mode === \"popLayout\") {\n children = jsx(PopChild, { isPresent: isPresent, children: children });\n }\n return (jsx(PresenceContext.Provider, { value: context, children: children }));\n};\nfunction newChildrenMap() {\n return new Map();\n}\n\nexport { PresenceChild };\n","import { useContext, useId, useEffect, useCallback } from 'react';\nimport { PresenceContext } from '../../context/PresenceContext.mjs';\n\n/**\n * When a component is the child of `AnimatePresence`, it can use `usePresence`\n * to access information about whether it's still present in the React tree.\n *\n * ```jsx\n * import { usePresence } from \"framer-motion\"\n *\n * export const Component = () => {\n * const [isPresent, safeToRemove] = usePresence()\n *\n * useEffect(() => {\n * !isPresent && setTimeout(safeToRemove, 1000)\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * If `isPresent` is `false`, it means that a component has been removed the tree, but\n * `AnimatePresence` won't really remove it until `safeToRemove` has been called.\n *\n * @public\n */\nfunction usePresence(subscribe = true) {\n const context = useContext(PresenceContext);\n if (context === null)\n return [true, null];\n const { isPresent, onExitComplete, register } = context;\n // It's safe to call the following hooks conditionally (after an early return) because the context will always\n // either be null or non-null for the lifespan of the component.\n const id = useId();\n useEffect(() => {\n if (subscribe)\n register(id);\n }, [subscribe]);\n const safeToRemove = useCallback(() => subscribe && onExitComplete && onExitComplete(id), [id, onExitComplete, subscribe]);\n return !isPresent && onExitComplete ? [false, safeToRemove] : [true];\n}\n/**\n * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.\n * There is no `safeToRemove` function.\n *\n * ```jsx\n * import { useIsPresent } from \"framer-motion\"\n *\n * export const Component = () => {\n * const isPresent = useIsPresent()\n *\n * useEffect(() => {\n * !isPresent && console.log(\"I've been removed!\")\n * }, [isPresent])\n *\n * return <div />\n * }\n * ```\n *\n * @public\n */\nfunction useIsPresent() {\n return isPresent(useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n\nexport { isPresent, useIsPresent, usePresence };\n","import { Children, isValidElement } from 'react';\n\nconst getChildKey = (child) => child.key || \"\";\nfunction onlyElements(children) {\n const filtered = [];\n // We use forEach here instead of map as map mutates the component key by preprending `.$`\n Children.forEach(children, (child) => {\n if (isValidElement(child))\n filtered.push(child);\n });\n return filtered;\n}\n\nexport { getChildKey, onlyElements };\n","import { useLayoutEffect, useEffect } from 'react';\nimport { isBrowser } from './is-browser.mjs';\n\nconst useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicLayoutEffect };\n","\"use client\";\nimport { jsx, Fragment } from 'react/jsx-runtime';\nimport { useMemo, useRef, useState, useContext } from 'react';\nimport { LayoutGroupContext } from '../../context/LayoutGroupContext.mjs';\nimport { useConstant } from '../../utils/use-constant.mjs';\nimport { PresenceChild } from './PresenceChild.mjs';\nimport { usePresence } from './use-presence.mjs';\nimport { onlyElements, getChildKey } from './utils.mjs';\nimport { useIsomorphicLayoutEffect } from '../../utils/use-isomorphic-effect.mjs';\n\n/**\n * `AnimatePresence` enables the animation of components that have been removed from the tree.\n *\n * When adding/removing more than a single child, every child **must** be given a unique `key` prop.\n *\n * Any `motion` components that have an `exit` property defined will animate out when removed from\n * the tree.\n *\n * ```jsx\n * import { motion, AnimatePresence } from 'framer-motion'\n *\n * export const Items = ({ items }) => (\n * <AnimatePresence>\n * {items.map(item => (\n * <motion.div\n * key={item.id}\n * initial={{ opacity: 0 }}\n * animate={{ opacity: 1 }}\n * exit={{ opacity: 0 }}\n * />\n * ))}\n * </AnimatePresence>\n * )\n * ```\n *\n * You can sequence exit animations throughout a tree using variants.\n *\n * If a child contains multiple `motion` components with `exit` props, it will only unmount the child\n * once all `motion` components have finished animating out. Likewise, any components using\n * `usePresence` all need to call `safeToRemove`.\n *\n * @public\n */\nconst AnimatePresence = ({ children, custom, initial = true, onExitComplete, presenceAffectsLayout = true, mode = \"sync\", propagate = false, }) => {\n const [isParentPresent, safeToRemove] = usePresence(propagate);\n /**\n * Filter any children that aren't ReactElements. We can only track components\n * between renders with a props.key.\n */\n const presentChildren = useMemo(() => onlyElements(children), [children]);\n /**\n * Track the keys of the currently rendered children. This is used to\n * determine which children are exiting.\n */\n const presentKeys = propagate && !isParentPresent ? [] : presentChildren.map(getChildKey);\n /**\n * If `initial={false}` we only want to pass this to components in the first render.\n */\n const isInitialRender = useRef(true);\n /**\n * A ref containing the currently present children. When all exit animations\n * are complete, we use this to re-render the component with the latest children\n * *committed* rather than the latest children *rendered*.\n */\n const pendingPresentChildren = useRef(presentChildren);\n /**\n * Track which exiting children have finished animating out.\n */\n const exitComplete = useConstant(() => new Map());\n /**\n * Save children to render as React state. To ensure this component is concurrent-safe,\n * we check for exiting children via an effect.\n */\n const [diffedChildren, setDiffedChildren] = useState(presentChildren);\n const [renderedChildren, setRenderedChildren] = useState(presentChildren);\n useIsomorphicLayoutEffect(() => {\n isInitialRender.current = false;\n pendingPresentChildren.current = presentChildren;\n /**\n * Update complete status of exiting children.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const key = getChildKey(renderedChildren[i]);\n if (!presentKeys.includes(key)) {\n if (exitComplete.get(key) !== true) {\n exitComplete.set(key, false);\n }\n }\n else {\n exitComplete.delete(key);\n }\n }\n }, [renderedChildren, presentKeys.length, presentKeys.join(\"-\")]);\n const exitingChildren = [];\n if (presentChildren !== diffedChildren) {\n let nextChildren = [...presentChildren];\n /**\n * Loop through all the currently rendered components and decide which\n * are exiting.\n */\n for (let i = 0; i < renderedChildren.length; i++) {\n const child = renderedChildren[i];\n const key = getChildKey(child);\n if (!presentKeys.includes(key)) {\n nextChildren.splice(i, 0, child);\n exitingChildren.push(child);\n }\n }\n /**\n * If we're in \"wait\" mode, and we have exiting children, we want to\n * only render these until they've all exited.\n */\n if (mode === \"wait\" && exitingChildren.length) {\n nextChildren = exitingChildren;\n }\n setRenderedChildren(onlyElements(nextChildren));\n setDiffedChildren(presentChildren);\n /**\n * Early return to ensure once we've set state with the latest diffed\n * children, we can immediately re-render.\n */\n return;\n }\n if (process.env.NODE_ENV !== \"production\" &&\n mode === \"wait\" &&\n renderedChildren.length > 1) {\n console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.`);\n }\n /**\n * If we've been provided a forceRender function by the LayoutGroupContext,\n * we can use it to force a re-render amongst all surrounding components once\n * all components have finished animating out.\n */\n const { forceRender } = useContext(LayoutGroupContext);\n return (jsx(Fragment, { children: renderedChildren.map((child) => {\n const key = getChildKey(child);\n const isPresent = propagate && !isParentPresent\n ? false\n : presentChildren === renderedChildren ||\n presentKeys.includes(key);\n const onExit = () => {\n if (exitComplete.has(key)) {\n exitComplete.set(key, true);\n }\n else {\n return;\n }\n let isEveryExitComplete = true;\n exitComplete.forEach((isExitComplete) => {\n if (!isExitComplete)\n isEveryExitComplete = false;\n });\n if (isEveryExitComplete) {\n forceRender === null || forceRender === void 0 ? void 0 : forceRender();\n setRenderedChildren(pendingPresentChildren.current);\n propagate && (safeToRemove === null || safeToRemove === void 0 ? void 0 : safeToRemove());\n onExitComplete && onExitComplete();\n }\n };\n return (jsx(PresenceChild, { isPresent: isPresent, initial: !isInitialRender.current || initial\n ? undefined\n : false, custom: isPresent ? undefined : custom, presenceAffectsLayout: presenceAffectsLayout, mode: mode, onExitComplete: isPresent ? undefined : onExit, children: child }, key));\n }) }));\n};\n\nexport { AnimatePresence };\n","import React, { useEffect, useRef } from 'react';\n\nimport classNames from 'classnames';\nimport { AnimatePresence, useAnimate, usePresence } from 'motion/react';\n\nimport { AnalyticsId, KeyboardEventKey, ZIndex } from '../../constants';\nimport { useBreakpoint } from '../../hooks/useBreakpoint';\nimport useFocusTrap from '../../hooks/useFocusTrap';\nimport { useKeyboardEvent } from '../../hooks/useKeyboardEvent';\nimport { useOutsideEvent } from '../../hooks/useOutsideEvent';\nimport { useReturnFocusOnUnmount } from '../../hooks/useReturnFocusOnUnmount';\nimport { breakpoints } from '../../theme/grid';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport uuid from '../../utils/uuid';\nimport Button from '../Button';\nimport Close from '../Close';\nimport Title, { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\ntype DesktopDirections = 'left' | 'right';\n\nexport interface DrawerProps extends InnerDrawerProps {\n /** Opens and closes the drawer */\n isOpen: boolean;\n}\n\nexport interface InnerDrawerProps {\n /** Sets the aria-label of the drawer */\n ariaLabel?: string;\n /** Sets the aria-labelledby of the drawer */\n ariaLabelledBy?: string;\n /** Close button aria-label */\n ariaLabelCloseBtn?: string;\n /** Direction of the drawer on desktop. Default: left */\n desktopDirection?: DesktopDirections;\n /** Title to display in the header of the drawer */\n title: string;\n /** id of the drawer title */\n titleId?: string;\n /** Changes the underlying element of the title. Default: h3 */\n titleHtmlMarkup?: TitleTags;\n /** Callback that triggers when clicking on close button or outside the drawer, update isOpen state when this triggers */\n onRequestClose: () => void;\n /** Optional footer content that can be rendered instead of default CTA(s) */\n footerContent?: React.ReactNode;\n /** Main content of the drawer */\n children?: React.ReactNode;\n /** Primary CTA callback */\n onPrimaryAction?: () => void;\n /** Text for primary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n primaryActionText?: string;\n /** Text for secondary CTA button if you want a default CTA button rendered (instead of `footerContent`) */\n secondaryActionText?: string;\n /** Secondary CTA callback */\n onSecondaryAction?: () => void;\n /** Customize the z-index of the drawer */\n zIndex?: number;\n}\n\nconst Drawer: React.FC<DrawerProps> = props => {\n const { isOpen, ...rest } = props;\n\n return <AnimatePresence>{isOpen && <InnerDrawer {...rest} />}</AnimatePresence>;\n};\n\nconst InnerDrawer: React.FC<InnerDrawerProps> = props => {\n const {\n ariaLabel,\n ariaLabelledBy,\n ariaLabelCloseBtn,\n children,\n desktopDirection = 'left',\n footerContent,\n onPrimaryAction,\n onRequestClose,\n onSecondaryAction,\n primaryActionText,\n secondaryActionText,\n title,\n titleHtmlMarkup = 'h3',\n titleId = uuid(),\n zIndex = ZIndex.Modal,\n } = props;\n\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledBy, fallbackId: titleId });\n const overlayRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const breakpoint = useBreakpoint();\n const isMobile = breakpoint < breakpoints.md;\n const [scope, animate] = useAnimate();\n const [isPresent, safeToRemove] = usePresence();\n const contentIsScrollable = contentRef.current && contentRef.current.scrollHeight > contentRef.current.clientHeight;\n\n useFocusTrap(containerRef, true);\n useReturnFocusOnUnmount(containerRef);\n useOutsideEvent(containerRef, () => {\n onRequestClose && onRequestClose();\n });\n useKeyboardEvent(containerRef, () => onRequestClose && onRequestClose(), [KeyboardEventKey.Escape]);\n\n useEffect(() => {\n containerRef.current?.focus();\n }, []);\n\n // Open animation.\n useEffect(() => {\n if (!overlayRef.current || !containerRef.current) return;\n\n if (!isPresent) {\n closeDrawer();\n return;\n }\n\n if (isMobile) {\n animate(containerRef.current, { y: '0' }, { duration: 0.3, ease: 'easeInOut' });\n } else {\n animate(containerRef.current, { x: '0' }, { duration: 0.3, ease: 'easeInOut' });\n }\n\n animate(overlayRef.current, { opacity: 1, pointerEvents: 'auto' }, { duration: 0.3, ease: 'easeInOut' });\n }, [isPresent]);\n\n useEffect(() => {}, [isPresent]);\n\n // Close animasjon, vi kaller `onClose()` til slutt\n const closeDrawer = (): void => {\n if (!overlayRef.current || !containerRef.current) return;\n\n animate(overlayRef.current, { opacity: 0, pointerEvents: 'none' }, { duration: 0.3, ease: 'easeInOut' });\n\n if (isMobile) {\n animate(\n containerRef.current,\n { y: '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n safeToRemove && safeToRemove();\n },\n }\n );\n } else {\n animate(\n containerRef.current,\n { x: desktopDirection === 'left' ? '-100%' : '100%' },\n {\n duration: 0.3,\n ease: 'easeInOut',\n onComplete: () => {\n safeToRemove && safeToRemove();\n },\n }\n );\n }\n };\n\n const handleCTA = (callback?: () => void): void => {\n if (callback) {\n callback();\n }\n };\n\n return (\n <div className={styles.drawer} ref={scope} style={{ zIndex }} data-analyticsid={AnalyticsId.Drawer}>\n <div className={styles.drawer__overlay} ref={overlayRef} aria-hidden=\"true\" />\n <div\n className={classNames(styles.drawer__container, {\n [styles['drawer__container--right']]: desktopDirection === 'right',\n })}\n ref={containerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n tabIndex={-1}\n {...ariaLabelAttributes}\n >\n <div className={styles.drawer__container__inner}>\n <div className={styles.drawer__header}>\n <Title id={ariaLabelAttributes?.['aria-labelledby']} htmlMarkup={titleHtmlMarkup} appearance=\"title3\">\n {title}\n </Title>\n <Close ariaLabel={ariaLabelCloseBtn} onClick={onRequestClose} small={isMobile} />\n </div>\n <div\n className={styles.drawer__content}\n tabIndex={contentIsScrollable ? 0 : undefined}\n role={contentIsScrollable ? 'region' : undefined}\n {...(contentIsScrollable ? ariaLabelAttributes : {})}\n ref={contentRef}\n >\n {children}\n </div>\n </div>\n <div className={styles.drawer__footer}>\n {footerContent ? (\n footerContent\n ) : (\n <>\n {primaryActionText && <Button onClick={() => handleCTA(onPrimaryAction)}>{primaryActionText}</Button>}\n {secondaryActionText && (\n <Button variant=\"borderless\" onClick={() => handleCTA(onSecondaryAction)}>\n {secondaryActionText}\n </Button>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n );\n};\n\nexport default Drawer;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAGA,MAAM,qBAAqB,cAAc,EAAE;ACG3C,MAAM,kBAAkB,cAAc,IAAI;ACA1C,MAAM,sBAAsB,cAAc;AAAA,EACtC,oBAAoB,CAAC,MAAM;AAAA,E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C;AAAA,cAAA;AAAA,gBACC,WAAW,OAAO;AAAA,gBAClB,UAAU,sBAAsB,IAAI;AAAA,gBACpC,MAAM,sBAAsB,WAAW;AAAA,gBACtC,GAAI,sBAAsB,sBAAsB,CAAC;AAAA,gBAClD,KAAK;AAAA,gBAEJ;AAAA,cAAA;AAAA,YAAA;AAAA,UACH,GACF;AAAA,8BACC,OAAI,EAAA,WAAW,OAAO,gBACpB,UAAA,gBACC,gBAGG,qBAAA,UAAA,EAAA,UAAA;AAAA,YAAA,yCAAsB,QAAO,EAAA,SAAS,MAAM,UAAU,eAAe,GAAI,UAAkB,mBAAA;AAAA,YAC3F,uBACE,oBAAA,QAAA,EAAO,SAAQ,cAAa,SAAS,MAAM,UAAU,iBAAiB,GACpE,UACH,oBAAA,CAAA;AAAA,UAAA,EAAA,CAEJ,EAEJ,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React__default, { useRef, useState } from "react";
|
|
2
|
+
import React__default, { useRef, useState, useEffect } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { theme } from "../../theme/index.js";
|
|
5
5
|
import "../../hooks/useBreakpoint.js";
|
|
@@ -9,10 +9,13 @@ import { useKeyboardEvent } from "../../hooks/useKeyboardEvent.js";
|
|
|
9
9
|
import { useOutsideEvent } from "../../hooks/useOutsideEvent.js";
|
|
10
10
|
import { useUuid } from "../../hooks/useUuid.js";
|
|
11
11
|
import { ZIndex, KeyboardEventKey, AnalyticsId, IconSize } from "../../constants.js";
|
|
12
|
+
import { isComponent } from "../../utils/component.js";
|
|
12
13
|
import { mergeRefs } from "../../utils/refs.js";
|
|
13
14
|
import { B as Button } from "../../Button.js";
|
|
15
|
+
import { C as Checkbox } from "../../Checkbox.js";
|
|
14
16
|
import { I as Icon } from "../../Icon.js";
|
|
15
17
|
import PlusSmall from "../Icons/PlusSmall.js";
|
|
18
|
+
import { R as RadioButton } from "../../RadioButton.js";
|
|
16
19
|
import styles from "./styles.module.scss";
|
|
17
20
|
var DropdownOnColor = /* @__PURE__ */ ((DropdownOnColor2) => {
|
|
18
21
|
DropdownOnColor2["onwhite"] = "onwhite";
|
|
@@ -47,15 +50,24 @@ const Dropdown = (props) => {
|
|
|
47
50
|
const toggleLabelId = useUuid();
|
|
48
51
|
const optionIdPrefix = useUuid();
|
|
49
52
|
const handleOpen = () => {
|
|
50
|
-
var _a;
|
|
51
53
|
toggleIsOpen();
|
|
52
|
-
(_a = optionsRef.current) == null ? void 0 : _a.focus();
|
|
53
54
|
};
|
|
54
55
|
const handleClose = () => {
|
|
55
56
|
var _a;
|
|
56
57
|
toggleIsOpen();
|
|
57
58
|
(_a = buttonRef.current) == null ? void 0 : _a.focus();
|
|
58
59
|
};
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
var _a, _b, _c;
|
|
62
|
+
if (isOpen) {
|
|
63
|
+
(_c = (_b = (_a = inputRefList.current) == null ? void 0 : _a.find((inputRef, index) => {
|
|
64
|
+
if (inputRef.current && !inputRef.current.hasAttribute("disabled")) {
|
|
65
|
+
setCurrentIndex(index);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
})) == null ? void 0 : _b.current) == null ? void 0 : _c.focus();
|
|
69
|
+
}
|
|
70
|
+
}, [isOpen]);
|
|
59
71
|
const handleKeyboardNavigation = (event) => {
|
|
60
72
|
var _a;
|
|
61
73
|
if (!inputRefList.current) {
|
|
@@ -63,6 +75,7 @@ const Dropdown = (props) => {
|
|
|
63
75
|
}
|
|
64
76
|
if (!isOpen) {
|
|
65
77
|
handleOpen();
|
|
78
|
+
event.preventDefault();
|
|
66
79
|
return;
|
|
67
80
|
} else if (event.key === KeyboardEventKey.Escape && isOpen) {
|
|
68
81
|
handleClose();
|
|
@@ -109,7 +122,10 @@ const Dropdown = (props) => {
|
|
|
109
122
|
}
|
|
110
123
|
);
|
|
111
124
|
const contentClasses = classNames(styles.dropdown__content, isOpen && styles["dropdown__content--open"]);
|
|
112
|
-
const renderChildren = React__default.Children.map(children, (child, index) =>
|
|
125
|
+
const renderChildren = React__default.Children.map(children, (child, index) => {
|
|
126
|
+
const role = isComponent(child, RadioButton) ? "menuitemradio" : isComponent(child, Checkbox) ? "menuitemcheckbox" : "menuitem";
|
|
127
|
+
return /* @__PURE__ */ jsx("li", { className: styles.dropdown__input, role, id: `${optionIdPrefix}-${index}`, children: React__default.isValidElement(child) && inputRefList.current && inputRefList.current[index] ? React__default.cloneElement(child, { ref: mergeRefs([child.props.ref, inputRefList.current[index]]) }) : child });
|
|
128
|
+
});
|
|
113
129
|
return /* @__PURE__ */ jsxs("div", { className: styles.dropdown, ref: dropdownRef, children: [
|
|
114
130
|
/* @__PURE__ */ jsx("span", { id: labelId, className: styles.dropdown__label, children: label }),
|
|
115
131
|
/* @__PURE__ */ jsxs(
|
|
@@ -123,7 +139,7 @@ const Dropdown = (props) => {
|
|
|
123
139
|
"data-analyticsid": AnalyticsId.Dropdown,
|
|
124
140
|
disabled,
|
|
125
141
|
"aria-labelledby": toggleLabelId,
|
|
126
|
-
"aria-haspopup": "
|
|
142
|
+
"aria-haspopup": "menu",
|
|
127
143
|
"aria-expanded": isOpen,
|
|
128
144
|
children: [
|
|
129
145
|
/* @__PURE__ */ jsx("span", { id: toggleLabelId, className: styles.dropdown__toggle__label, children: placeholder }),
|
|
@@ -145,7 +161,7 @@ const Dropdown = (props) => {
|
|
|
145
161
|
"ul",
|
|
146
162
|
{
|
|
147
163
|
className: styles.dropdown__options,
|
|
148
|
-
role: "
|
|
164
|
+
role: "menu",
|
|
149
165
|
"aria-labelledby": labelId,
|
|
150
166
|
tabIndex: -1,
|
|
151
167
|
"aria-activedescendant": typeof currentIndex !== "undefined" ? `${optionIdPrefix}-${currentIndex}` : void 0,
|