@helsenorge/designsystem-react 13.5.0 → 13.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AnchorLink.js +2 -2
- package/lib/AnchorLink.js.map +1 -1
- package/lib/Avatar.js +2 -2
- package/lib/Avatar.js.map +1 -1
- package/lib/Badge.js +2 -2
- package/lib/Badge.js.map +1 -1
- package/lib/Button.js +6 -6
- package/lib/Button.js.map +1 -1
- package/lib/CHANGELOG.md +36 -1
- package/lib/Checkbox.js +6 -6
- package/lib/Checkbox.js.map +1 -1
- package/lib/Close.js +3 -3
- package/lib/Close.js.map +1 -1
- package/lib/DictionaryTrigger.js +2 -2
- package/lib/DictionaryTrigger.js.map +1 -1
- package/lib/Drawer.js +5 -5
- package/lib/Drawer.js.map +1 -1
- package/lib/Duolist.js +8 -5
- package/lib/Duolist.js.map +1 -1
- package/lib/ElementHeader.js +9 -9
- package/lib/ElementHeader.js.map +1 -1
- package/lib/ElementHeaderText.js +4 -4
- package/lib/ElementHeaderText.js.map +1 -1
- package/lib/ErrorWrapper.js +2 -2
- package/lib/ErrorWrapper.js.map +1 -1
- package/lib/Expander.js +12 -8
- package/lib/Expander.js.map +1 -1
- package/lib/FormFieldTag.js +2 -2
- package/lib/FormFieldTag.js.map +1 -1
- package/lib/FormGroup.js +9 -8
- package/lib/FormGroup.js.map +1 -1
- package/lib/FormLayout.js +3 -3
- package/lib/FormLayout.js.map +1 -1
- package/lib/HelpDetails.js +3 -3
- package/lib/HelpDetails.js.map +1 -1
- package/lib/HelpTriggerIcon.js +2 -2
- package/lib/HelpTriggerIcon.js.map +1 -1
- package/lib/HelpTriggerStandalone.js +2 -2
- package/lib/HelpTriggerStandalone.js.map +1 -1
- package/lib/HighlightPanel.js +3 -3
- package/lib/HighlightPanel.js.map +1 -1
- package/lib/HorizontalScroll.js +4 -4
- package/lib/HorizontalScroll.js.map +1 -1
- package/lib/Icon.js +2 -2
- package/lib/Icon.js.map +1 -1
- package/lib/InfoTeaser.js +5 -4
- package/lib/InfoTeaser.js.map +1 -1
- package/lib/Input.js +4 -4
- package/lib/Input.js.map +1 -1
- package/lib/Label.js +5 -5
- package/lib/Label.js.map +1 -1
- package/lib/LinkList.js +5 -5
- package/lib/LinkList.js.map +1 -1
- package/lib/List.js +2 -2
- package/lib/List.js.map +1 -1
- package/lib/ListEditMode.js +4 -4
- package/lib/ListEditMode.js.map +1 -1
- package/lib/MaxCharacters.js +2 -2
- package/lib/MaxCharacters.js.map +1 -1
- package/lib/Panel.js +63 -39
- package/lib/Panel.js.map +1 -1
- package/lib/PanelOld.js +14 -14
- package/lib/PanelOld.js.map +1 -1
- package/lib/PanelTitle.js +2 -2
- package/lib/PanelTitle.js.map +1 -1
- package/lib/PopOver.js +2 -2
- package/lib/PopOver.js.map +1 -1
- package/lib/RadioButton.js +5 -5
- package/lib/RadioButton.js.map +1 -1
- package/lib/Select.js +4 -4
- package/lib/Select.js.map +1 -1
- package/lib/SingleSelectItem.js +3 -3
- package/lib/SingleSelectItem.js.map +1 -1
- package/lib/Slider.js +4 -4
- package/lib/Slider.js.map +1 -1
- package/lib/Spacer.js +2 -2
- package/lib/Spacer.js.map +1 -1
- package/lib/StatusDot.js +4 -4
- package/lib/StatusDot.js.map +1 -1
- package/lib/StatusDotList.js +2 -2
- package/lib/StatusDotList.js.map +1 -1
- package/lib/StepButtons.js +5 -5
- package/lib/StepButtons.js.map +1 -1
- package/lib/TabList.js +8 -8
- package/lib/TabList.js.map +1 -1
- package/lib/TabPanel.js +2 -2
- package/lib/TabPanel.js.map +1 -1
- package/lib/Table.js +2 -2
- package/lib/Table.js.map +1 -1
- package/lib/TableBody.js +2 -2
- package/lib/TableBody.js.map +1 -1
- package/lib/TableCell.js +2 -2
- package/lib/TableCell.js.map +1 -1
- package/lib/TableExpandedRow.js +4 -4
- package/lib/TableExpandedRow.js.map +1 -1
- package/lib/TableExpanderCell.js +2 -2
- package/lib/TableExpanderCell.js.map +1 -1
- package/lib/TableHead.js +2 -2
- package/lib/TableHead.js.map +1 -1
- package/lib/TableHeadCell.js +3 -3
- package/lib/TableHeadCell.js.map +1 -1
- package/lib/TableRow.js +3 -3
- package/lib/TableRow.js.map +1 -1
- package/lib/Textarea.js +4 -4
- package/lib/Textarea.js.map +1 -1
- package/lib/Title.js +2 -2
- package/lib/Title.js.map +1 -1
- package/lib/Toast.js +3 -3
- package/lib/Toast.js.map +1 -1
- package/lib/__mocks__/uuid.js +0 -1
- package/lib/__mocks__/uuid.js.map +1 -1
- package/lib/components/AnchorLink/index.js +0 -13
- package/lib/components/ArticleTeaser/index.js +4 -4
- package/lib/components/ArticleTeaser/index.js.map +1 -1
- package/lib/components/AsChildSlot/index.js +0 -1
- package/lib/components/Avatar/index.js +0 -4
- package/lib/components/Badge/index.js +0 -8
- package/lib/components/Button/index.js +0 -17
- package/lib/components/Checkbox/index.js +0 -44
- package/lib/components/Chip/index.js +2 -2
- package/lib/components/Chip/index.js.map +1 -1
- package/lib/components/Close/index.js +0 -8
- package/lib/components/DictionaryTrigger/index.js +0 -1
- package/lib/components/Drawer/index.js +0 -37
- package/lib/components/Drawer/styles.module.scss +6 -0
- package/lib/components/Dropdown/SingleSelect/index.js +0 -2
- package/lib/components/Dropdown/SingleSelect/index.js.map +1 -1
- package/lib/components/Dropdown/index.js +5 -42
- package/lib/components/Dropdown/index.js.map +1 -1
- package/lib/components/DropdownOld/index.js +3 -31
- package/lib/components/DropdownOld/index.js.map +1 -1
- package/lib/components/Duolist/Duolist.d.ts +3 -1
- package/lib/components/Duolist/index.js +0 -4
- package/lib/components/ElementHeader/ElementHeaderText/index.js +0 -9
- package/lib/components/ElementHeader/ElementHeaderText/index.js.map +1 -1
- package/lib/components/ElementHeader/StatusDotList/index.js +0 -34
- package/lib/components/ElementHeader/index.js +0 -48
- package/lib/components/ElementHeader/index.js.map +1 -1
- package/lib/components/EmptyState/index.js +2 -4
- package/lib/components/EmptyState/index.js.map +1 -1
- package/lib/components/Expander/index.js +0 -24
- package/lib/components/Expander/styles.module.scss +16 -7
- package/lib/components/Expander/styles.module.scss.d.ts +2 -1
- package/lib/components/ExpanderHierarchy/index.js +7 -8
- package/lib/components/ExpanderHierarchy/index.js.map +1 -1
- package/lib/components/ExpanderList/index.js +6 -52
- package/lib/components/ExpanderList/index.js.map +1 -1
- package/lib/components/EyebrowHeader/index.js +0 -1
- package/lib/components/EyebrowHeader/index.js.map +1 -1
- package/lib/components/FavoriteButton/index.js +2 -3
- package/lib/components/FavoriteButton/index.js.map +1 -1
- package/lib/components/FormFieldTag/index.js +0 -2
- package/lib/components/FormGroup/FormGroup.d.ts +5 -0
- package/lib/components/FormGroup/index.js +0 -55
- package/lib/components/FormGroup/index.js.map +1 -1
- package/lib/components/FormLayout/index.js +0 -1
- package/lib/components/HelpBubble/index.js +3 -20
- package/lib/components/HelpBubble/index.js.map +1 -1
- package/lib/components/HelpDrawer/index.js +0 -36
- package/lib/components/HelpDrawer/index.js.map +1 -1
- package/lib/components/HelpExpanderInline/index.js +0 -2
- package/lib/components/HelpExpanderInline/index.js.map +1 -1
- package/lib/components/HelpExpanderStandalone/index.js +0 -6
- package/lib/components/HelpExpanderStandalone/index.js.map +1 -1
- package/lib/components/HelpPanel/index.js +2 -34
- package/lib/components/HelpPanel/index.js.map +1 -1
- package/lib/components/HelpTeaser/HelpTeaser.d.ts +2 -0
- package/lib/components/HelpTeaser/index.js +2 -9
- package/lib/components/HelpTeaser/index.js.map +1 -1
- package/lib/components/HelpTooltip/index.js +0 -2
- package/lib/components/HelpTooltip/index.js.map +1 -1
- package/lib/components/HelpTriggerIcon/index.js +0 -4
- package/lib/components/HelpTriggerInline/index.js +2 -2
- package/lib/components/HelpTriggerInline/index.js.map +1 -1
- package/lib/components/HelpTriggerStandalone/index.js +0 -8
- package/lib/components/HighlightPanel/index.js +0 -32
- package/lib/components/Highlighter/index.js +0 -8
- package/lib/components/HorizontalScroll/index.js +0 -5
- package/lib/components/Icons/AlarmClock.js +0 -1
- package/lib/components/Icons/AlarmClock.js.map +1 -1
- package/lib/components/Icons/AlertSignFill.js +0 -2
- package/lib/components/Icons/AlertSignStroke.js +0 -2
- package/lib/components/Icons/Archive.js +0 -1
- package/lib/components/Icons/Archive.js.map +1 -1
- package/lib/components/Icons/ArrowDown.js +0 -2
- package/lib/components/Icons/ArrowLeft.js +0 -1
- package/lib/components/Icons/ArrowLeft.js.map +1 -1
- package/lib/components/Icons/ArrowRight.js +0 -2
- package/lib/components/Icons/ArrowUp.js +0 -2
- package/lib/components/Icons/ArrowUpRight.js +0 -2
- package/lib/components/Icons/Attachment.js +0 -1
- package/lib/components/Icons/Attachment.js.map +1 -1
- package/lib/components/Icons/Avatar.js +0 -1
- package/lib/components/Icons/Avatar.js.map +1 -1
- package/lib/components/Icons/Braille.js +0 -1
- package/lib/components/Icons/Braille.js.map +1 -1
- package/lib/components/Icons/Bus.js +0 -1
- package/lib/components/Icons/Bus.js.map +1 -1
- package/lib/components/Icons/Calendar.js +0 -2
- package/lib/components/Icons/CalendarChange.js +0 -1
- package/lib/components/Icons/CalendarChange.js.map +1 -1
- package/lib/components/Icons/CalendarCheck.js +0 -1
- package/lib/components/Icons/CalendarCheck.js.map +1 -1
- package/lib/components/Icons/CalendarSave.js +0 -1
- package/lib/components/Icons/CalendarSave.js.map +1 -1
- package/lib/components/Icons/Candle.js +0 -1
- package/lib/components/Icons/Candle.js.map +1 -1
- package/lib/components/Icons/Change.js +0 -1
- package/lib/components/Icons/Change.js.map +1 -1
- package/lib/components/Icons/Check.js +0 -2
- package/lib/components/Icons/CheckFill.js +0 -2
- package/lib/components/Icons/ChevronDown.js +0 -2
- package/lib/components/Icons/ChevronLeft.js +0 -2
- package/lib/components/Icons/ChevronRight.js +0 -2
- package/lib/components/Icons/ChevronUp.js +0 -2
- package/lib/components/Icons/ChevronsDown.js +0 -1
- package/lib/components/Icons/ChevronsDown.js.map +1 -1
- package/lib/components/Icons/ChevronsUp.js +0 -1
- package/lib/components/Icons/ChevronsUp.js.map +1 -1
- package/lib/components/Icons/Contacts.js +0 -1
- package/lib/components/Icons/Contacts.js.map +1 -1
- package/lib/components/Icons/Copy.js +0 -1
- package/lib/components/Icons/Copy.js.map +1 -1
- package/lib/components/Icons/DotActive.js +0 -1
- package/lib/components/Icons/DotActive.js.map +1 -1
- package/lib/components/Icons/DotAlert.js +0 -1
- package/lib/components/Icons/DotAlert.js.map +1 -1
- package/lib/components/Icons/DotCancelled.js +0 -1
- package/lib/components/Icons/DotCancelled.js.map +1 -1
- package/lib/components/Icons/DotHalfDisc.js +0 -1
- package/lib/components/Icons/DotHalfDisc.js.map +1 -1
- package/lib/components/Icons/DotInactive.js +0 -1
- package/lib/components/Icons/DotInactive.js.map +1 -1
- package/lib/components/Icons/DotInfo.js +0 -1
- package/lib/components/Icons/DotInfo.js.map +1 -1
- package/lib/components/Icons/DotLookingGlass.js +0 -1
- package/lib/components/Icons/DotLookingGlass.js.map +1 -1
- package/lib/components/Icons/DotPending.js +0 -1
- package/lib/components/Icons/DotPending.js.map +1 -1
- package/lib/components/Icons/DotQuestionMark.js +0 -1
- package/lib/components/Icons/DotQuestionMark.js.map +1 -1
- package/lib/components/Icons/DotSuccess.js +0 -1
- package/lib/components/Icons/DotSuccess.js.map +1 -1
- package/lib/components/Icons/DotTransparent.js +0 -1
- package/lib/components/Icons/DotTransparent.js.map +1 -1
- package/lib/components/Icons/DotWarningTriangle.js +0 -1
- package/lib/components/Icons/DotWarningTriangle.js.map +1 -1
- package/lib/components/Icons/Download.js +0 -1
- package/lib/components/Icons/Download.js.map +1 -1
- package/lib/components/Icons/Drag.js +0 -1
- package/lib/components/Icons/Drag.js.map +1 -1
- package/lib/components/Icons/EChat.js +0 -1
- package/lib/components/Icons/EChat.js.map +1 -1
- package/lib/components/Icons/Ear.js +0 -1
- package/lib/components/Icons/Ear.js.map +1 -1
- package/lib/components/Icons/EarDeaf.js +0 -1
- package/lib/components/Icons/EarDeaf.js.map +1 -1
- package/lib/components/Icons/EarHearingAid.js +0 -1
- package/lib/components/Icons/EarHearingAid.js.map +1 -1
- package/lib/components/Icons/EarVolume.js +0 -1
- package/lib/components/Icons/EarVolume.js.map +1 -1
- package/lib/components/Icons/Edit.js +0 -1
- package/lib/components/Icons/Edit.js.map +1 -1
- package/lib/components/Icons/EmergencyCall.js +0 -1
- package/lib/components/Icons/EmergencyCall.js.map +1 -1
- package/lib/components/Icons/EmoticonAnnoyed.js +0 -1
- package/lib/components/Icons/EmoticonAnnoyed.js.map +1 -1
- package/lib/components/Icons/EmoticonDelighted.js +0 -1
- package/lib/components/Icons/EmoticonDelighted.js.map +1 -1
- package/lib/components/Icons/EmoticonDisappointed.js +0 -1
- package/lib/components/Icons/EmoticonDisappointed.js.map +1 -1
- package/lib/components/Icons/EmoticonHappy.js +0 -1
- package/lib/components/Icons/EmoticonHappy.js.map +1 -1
- package/lib/components/Icons/EmoticonMeh.js +0 -1
- package/lib/components/Icons/EmoticonMeh.js.map +1 -1
- package/lib/components/Icons/EnterFullScreen.js +0 -1
- package/lib/components/Icons/EnterFullScreen.js.map +1 -1
- package/lib/components/Icons/Envelope.js +0 -1
- package/lib/components/Icons/Envelope.js.map +1 -1
- package/lib/components/Icons/Eraser.js +0 -1
- package/lib/components/Icons/Eraser.js.map +1 -1
- package/lib/components/Icons/ErrorSignFill.js +0 -2
- package/lib/components/Icons/ErrorSignStroke.js +0 -1
- package/lib/components/Icons/ErrorSignStroke.js.map +1 -1
- package/lib/components/Icons/ExitFullScreen.js +0 -1
- package/lib/components/Icons/ExitFullScreen.js.map +1 -1
- package/lib/components/Icons/Eye.js +0 -1
- package/lib/components/Icons/Eye.js.map +1 -1
- package/lib/components/Icons/FallingLeaf.js +0 -1
- package/lib/components/Icons/FallingLeaf.js.map +1 -1
- package/lib/components/Icons/File.js +0 -1
- package/lib/components/Icons/File.js.map +1 -1
- package/lib/components/Icons/Filter.js +0 -1
- package/lib/components/Icons/Filter.js.map +1 -1
- package/lib/components/Icons/Form.js +0 -1
- package/lib/components/Icons/Form.js.map +1 -1
- package/lib/components/Icons/Forward.js +0 -2
- package/lib/components/Icons/Gallery.js +0 -1
- package/lib/components/Icons/Gallery.js.map +1 -1
- package/lib/components/Icons/Glasses.js +0 -1
- package/lib/components/Icons/Glasses.js.map +1 -1
- package/lib/components/Icons/Globe.js +0 -1
- package/lib/components/Icons/Globe.js.map +1 -1
- package/lib/components/Icons/Graph.js +0 -1
- package/lib/components/Icons/Graph.js.map +1 -1
- package/lib/components/Icons/Group.js +0 -1
- package/lib/components/Icons/Group.js.map +1 -1
- package/lib/components/Icons/GroupTwins.js +0 -1
- package/lib/components/Icons/GroupTwins.js.map +1 -1
- package/lib/components/Icons/HTMLFile.js +0 -1
- package/lib/components/Icons/HTMLFile.js.map +1 -1
- package/lib/components/Icons/HandsAndHeart.js +0 -1
- package/lib/components/Icons/HandsAndHeart.js.map +1 -1
- package/lib/components/Icons/HealthcarePerson.js +0 -1
- package/lib/components/Icons/HealthcarePerson.js.map +1 -1
- package/lib/components/Icons/HealthcarePersonell.js +0 -1
- package/lib/components/Icons/HealthcarePersonell.js.map +1 -1
- package/lib/components/Icons/HearingProtection.js +0 -1
- package/lib/components/Icons/HearingProtection.js.map +1 -1
- package/lib/components/Icons/Heart.js +0 -1
- package/lib/components/Icons/Heart.js.map +1 -1
- package/lib/components/Icons/HelpSign.js +0 -1
- package/lib/components/Icons/HelpSign.js.map +1 -1
- package/lib/components/Icons/History.js +0 -1
- package/lib/components/Icons/History.js.map +1 -1
- package/lib/components/Icons/Home.js +0 -1
- package/lib/components/Icons/Home.js.map +1 -1
- package/lib/components/Icons/HomeFill.js +0 -1
- package/lib/components/Icons/HomeFill.js.map +1 -1
- package/lib/components/Icons/Hospital.js +0 -1
- package/lib/components/Icons/Hospital.js.map +1 -1
- package/lib/components/Icons/Hourglass.js +0 -1
- package/lib/components/Icons/Hourglass.js.map +1 -1
- package/lib/components/Icons/InfoSignFill.js +0 -2
- package/lib/components/Icons/InfoSignStroke.js +0 -1
- package/lib/components/Icons/InfoSignStroke.js.map +1 -1
- package/lib/components/Icons/Journal.js +0 -1
- package/lib/components/Icons/Journal.js.map +1 -1
- package/lib/components/Icons/LegalDocument.js +0 -1
- package/lib/components/Icons/LegalDocument.js.map +1 -1
- package/lib/components/Icons/List.js +0 -1
- package/lib/components/Icons/List.js.map +1 -1
- package/lib/components/Icons/Location.js +0 -1
- package/lib/components/Icons/Location.js.map +1 -1
- package/lib/components/Icons/LocationFill.js +0 -1
- package/lib/components/Icons/LocationFill.js.map +1 -1
- package/lib/components/Icons/Lock.js +0 -1
- package/lib/components/Icons/Lock.js.map +1 -1
- package/lib/components/Icons/Login.js +0 -1
- package/lib/components/Icons/Login.js.map +1 -1
- package/lib/components/Icons/Logout.js +0 -1
- package/lib/components/Icons/Logout.js.map +1 -1
- package/lib/components/Icons/MaleDoctorCompact.js +0 -1
- package/lib/components/Icons/MaleDoctorCompact.js.map +1 -1
- package/lib/components/Icons/MaleDoctorCompactFill.js +0 -1
- package/lib/components/Icons/MaleDoctorCompactFill.js.map +1 -1
- package/lib/components/Icons/Medicine.js +0 -1
- package/lib/components/Icons/Medicine.js.map +1 -1
- package/lib/components/Icons/Menu.js +0 -1
- package/lib/components/Icons/Menu.js.map +1 -1
- package/lib/components/Icons/Minus.js +0 -1
- package/lib/components/Icons/Minus.js.map +1 -1
- package/lib/components/Icons/MobilePhone.js +0 -1
- package/lib/components/Icons/MobilePhone.js.map +1 -1
- package/lib/components/Icons/NoAccess.js +0 -1
- package/lib/components/Icons/NoAccess.js.map +1 -1
- package/lib/components/Icons/NoEye.js +0 -1
- package/lib/components/Icons/NoEye.js.map +1 -1
- package/lib/components/Icons/NoFilter.js +0 -1
- package/lib/components/Icons/NoFilter.js.map +1 -1
- package/lib/components/Icons/PaperPlane.js +0 -1
- package/lib/components/Icons/PaperPlane.js.map +1 -1
- package/lib/components/Icons/Pause.js +0 -1
- package/lib/components/Icons/Pause.js.map +1 -1
- package/lib/components/Icons/Pencil.js +0 -2
- package/lib/components/Icons/PersonCancel.js +0 -1
- package/lib/components/Icons/PersonCancel.js.map +1 -1
- package/lib/components/Icons/PersonalPlan.js +0 -1
- package/lib/components/Icons/PersonalPlan.js.map +1 -1
- package/lib/components/Icons/Play.js +0 -1
- package/lib/components/Icons/Play.js.map +1 -1
- package/lib/components/Icons/PlusLarge.js +0 -1
- package/lib/components/Icons/PlusLarge.js.map +1 -1
- package/lib/components/Icons/PlusSmall.js +0 -2
- package/lib/components/Icons/Printer.js +0 -1
- package/lib/components/Icons/Printer.js.map +1 -1
- package/lib/components/Icons/QrCode.js +0 -1
- package/lib/components/Icons/QrCode.js.map +1 -1
- package/lib/components/Icons/Receptionist.js +0 -1
- package/lib/components/Icons/Receptionist.js.map +1 -1
- package/lib/components/Icons/Referral.js +0 -1
- package/lib/components/Icons/Referral.js.map +1 -1
- package/lib/components/Icons/Refresh.js +0 -1
- package/lib/components/Icons/Refresh.js.map +1 -1
- package/lib/components/Icons/Reply.js +0 -1
- package/lib/components/Icons/Reply.js.map +1 -1
- package/lib/components/Icons/Save.js +0 -1
- package/lib/components/Icons/Save.js.map +1 -1
- package/lib/components/Icons/ScreenReader.js +0 -1
- package/lib/components/Icons/ScreenReader.js.map +1 -1
- package/lib/components/Icons/Search.js +0 -1
- package/lib/components/Icons/Search.js.map +1 -1
- package/lib/components/Icons/SectionSign.js +0 -1
- package/lib/components/Icons/SectionSign.js.map +1 -1
- package/lib/components/Icons/Settings.js +0 -1
- package/lib/components/Icons/Settings.js.map +1 -1
- package/lib/components/Icons/SettingsFill.js +0 -1
- package/lib/components/Icons/SettingsFill.js.map +1 -1
- package/lib/components/Icons/Share.js +0 -1
- package/lib/components/Icons/Share.js.map +1 -1
- package/lib/components/Icons/SortDown.js +0 -1
- package/lib/components/Icons/SortDown.js.map +1 -1
- package/lib/components/Icons/SortUp.js +0 -1
- package/lib/components/Icons/SortUp.js.map +1 -1
- package/lib/components/Icons/SpeechBubble.js +0 -1
- package/lib/components/Icons/SpeechBubble.js.map +1 -1
- package/lib/components/Icons/Stopwatch.js +0 -1
- package/lib/components/Icons/Stopwatch.js.map +1 -1
- package/lib/components/Icons/Sun.js +0 -1
- package/lib/components/Icons/Sun.js.map +1 -1
- package/lib/components/Icons/SupportingPerson.js +0 -1
- package/lib/components/Icons/SupportingPerson.js.map +1 -1
- package/lib/components/Icons/TimePassing.js +0 -1
- package/lib/components/Icons/TimePassing.js.map +1 -1
- package/lib/components/Icons/Tombstone.js +0 -1
- package/lib/components/Icons/Tombstone.js.map +1 -1
- package/lib/components/Icons/Toolbox.js +0 -1
- package/lib/components/Icons/Toolbox.js.map +1 -1
- package/lib/components/Icons/TrashCan.js +0 -1
- package/lib/components/Icons/TrashCan.js.map +1 -1
- package/lib/components/Icons/TreatmentAids.js +0 -1
- package/lib/components/Icons/TreatmentAids.js.map +1 -1
- package/lib/components/Icons/TriangleX.js +0 -2
- package/lib/components/Icons/Undo.js +0 -2
- package/lib/components/Icons/Upload.js +0 -1
- package/lib/components/Icons/Upload.js.map +1 -1
- package/lib/components/Icons/Vaccine.js +0 -1
- package/lib/components/Icons/Vaccine.js.map +1 -1
- package/lib/components/Icons/VerticalDots.js +0 -2
- package/lib/components/Icons/VideoCamera.js +0 -1
- package/lib/components/Icons/VideoCamera.js.map +1 -1
- package/lib/components/Icons/VideoChat.js +0 -1
- package/lib/components/Icons/VideoChat.js.map +1 -1
- package/lib/components/Icons/Wallet.js +0 -1
- package/lib/components/Icons/Wallet.js.map +1 -1
- package/lib/components/Icons/Watch.js +0 -2
- package/lib/components/Icons/X.js +0 -2
- package/lib/components/Icons/Zoom.js +0 -1
- package/lib/components/Icons/Zoom.js.map +1 -1
- package/lib/components/Icons/ZoomInLeft.js +0 -1
- package/lib/components/Icons/ZoomInLeft.js.map +1 -1
- package/lib/components/Icons/ZoomOutLeft.js +0 -1
- package/lib/components/Icons/ZoomOutLeft.js.map +1 -1
- package/lib/components/Illustration/index.js +0 -2
- package/lib/components/Illustrations/BabyMobile.js +0 -2
- package/lib/components/Illustrations/BabyMobile.js.map +1 -1
- package/lib/components/Illustrations/BabyMobileMedium.js +0 -3
- package/lib/components/Illustrations/Child.js +0 -2
- package/lib/components/Illustrations/Child.js.map +1 -1
- package/lib/components/Illustrations/ChildMedium.js +0 -3
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js +0 -2
- package/lib/components/Illustrations/FacialRecognitionFingerprint.js.map +1 -1
- package/lib/components/Illustrations/FacialRecognitionFingerprintMedium.js +0 -3
- package/lib/components/Illustrations/GiveBabyFood.js +0 -2
- package/lib/components/Illustrations/GiveBabyFood.js.map +1 -1
- package/lib/components/Illustrations/GiveBabyFoodMedium.js +0 -3
- package/lib/components/Illustrations/ReadLetters.js +0 -2
- package/lib/components/Illustrations/ReadLetters.js.map +1 -1
- package/lib/components/Illustrations/ReadLettersMedium.js +0 -3
- package/lib/components/Illustrations/Stroller.js +0 -2
- package/lib/components/Illustrations/Stroller.js.map +1 -1
- package/lib/components/Illustrations/StrollerMedium.js +0 -3
- package/lib/components/Illustrations/Support2.js +0 -2
- package/lib/components/Illustrations/Support2.js.map +1 -1
- package/lib/components/Illustrations/Support2Medium.js +0 -3
- package/lib/components/InfoTeaser/InfoTeaser.d.ts +2 -0
- package/lib/components/InfoTeaser/index.js +0 -8
- package/lib/components/InfoTeaser/styles.module.scss +0 -2
- package/lib/components/Input/Input.d.ts +2 -2
- package/lib/components/Input/index.js +0 -44
- package/lib/components/Label/index.js +0 -38
- package/lib/components/LazyIcon/index.js +0 -4
- package/lib/components/LazyIllustration/index.js +0 -6
- package/lib/components/LinkList/index.js +0 -54
- package/lib/components/List/index.js +0 -1
- package/lib/components/ListEditMode/index.js +0 -4
- package/lib/components/Loader/index.js +4 -5
- package/lib/components/Loader/index.js.map +1 -1
- package/lib/components/Logo/index.js +0 -4
- package/lib/components/Logo/index.js.map +1 -1
- package/lib/components/Modal/index.js +9 -30
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/NotificationPanel/index.js +6 -34
- package/lib/components/NotificationPanel/index.js.map +1 -1
- package/lib/components/Panel/PanelTitle/index.js +0 -11
- package/lib/components/Panel/index.js +0 -31
- package/lib/components/Panel/index.js.map +1 -1
- package/lib/components/PanelList/PanelList.d.ts +6 -0
- package/lib/components/PanelList/index.js +3 -53
- package/lib/components/PanelList/index.js.map +1 -1
- package/lib/components/PanelListOld/index.js +2 -36
- package/lib/components/PanelListOld/index.js.map +1 -1
- package/lib/components/PanelOld/index.js +0 -35
- package/lib/components/PopMenu/index.js +3 -54
- package/lib/components/PopMenu/index.js.map +1 -1
- package/lib/components/PopOver/index.js +0 -3
- package/lib/components/Portal/index.js +0 -1
- package/lib/components/Progressbar/index.js +2 -2
- package/lib/components/Progressbar/index.js.map +1 -1
- package/lib/components/PromoPanel/index.js +2 -12
- package/lib/components/PromoPanel/index.js.map +1 -1
- package/lib/components/RadioButton/index.js +0 -43
- package/lib/components/Select/index.js +0 -43
- package/lib/components/Select/styles.module.scss +2 -0
- package/lib/components/ServiceMessage/index.js +5 -48
- package/lib/components/ServiceMessage/index.js.map +1 -1
- package/lib/components/SharingStatus/index.js +4 -4
- package/lib/components/SharingStatus/index.js.map +1 -1
- package/lib/components/Slider/index.js +0 -10
- package/lib/components/Spacer/index.js +0 -1
- package/lib/components/StatusDot/index.js +0 -33
- package/lib/components/Step/index.js +2 -2
- package/lib/components/Step/index.js.map +1 -1
- package/lib/components/StepButtons/index.js +0 -1
- package/lib/components/Stepper/index.js +2 -3
- package/lib/components/Stepper/index.js.map +1 -1
- package/lib/components/StickyNote/index.js +8 -11
- package/lib/components/StickyNote/index.js.map +1 -1
- package/lib/components/Table/TableBody/index.js +0 -13
- package/lib/components/Table/TableCell/index.js +0 -13
- package/lib/components/Table/TableExpandedRow/index.js +0 -29
- package/lib/components/Table/TableExpanderCell/index.js +0 -30
- package/lib/components/Table/TableHead/index.js +0 -13
- package/lib/components/Table/TableHeadCell/index.js +0 -16
- package/lib/components/Table/TableRow/index.js +0 -30
- package/lib/components/Table/index.js +0 -31
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/TabList/index.js +0 -14
- package/lib/components/Tabs/index.js +4 -17
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Tag/index.js +2 -4
- package/lib/components/Tag/index.js.map +1 -1
- package/lib/components/Textarea/Textarea.d.ts +1 -1
- package/lib/components/Textarea/index.js +0 -43
- package/lib/components/Tile/index.js +4 -6
- package/lib/components/Tile/index.js.map +1 -1
- package/lib/components/Title/index.js +0 -1
- package/lib/components/Toast/index.js +0 -10
- package/lib/components/Toast/index.js.map +1 -1
- package/lib/components/ToastList/index.js +0 -9
- package/lib/components/ToastList/index.js.map +1 -1
- package/lib/components/Toggle/index.js +10 -10
- package/lib/components/Toggle/index.js.map +1 -1
- package/lib/components/Validation/index.js +2 -53
- package/lib/components/Validation/index.js.map +1 -1
- package/lib/floating-ui.react.js +65 -61
- package/lib/floating-ui.react.js.map +1 -1
- package/lib/hoc/withBreakpoint/index.js +0 -2
- package/lib/hoc/withBreakpoint/index.js.map +1 -1
- package/lib/hoc/withBreakpoint/withBreakpoint.js +0 -2
- package/lib/hooks/useBreakpoint.js +0 -1
- package/lib/hooks/useExpand.js +0 -1
- package/lib/hooks/useFocusToggle.js +0 -2
- package/lib/hooks/useFocusTrap.js +0 -3
- package/lib/hooks/useFocusableElements.js +0 -1
- package/lib/hooks/useIcons.js +0 -6
- package/lib/hooks/useIsMobileBreakpoint.js +0 -2
- package/lib/hooks/useIsVisible.js +0 -1
- package/lib/hooks/useLayoutEvent.js +0 -1
- package/lib/hooks/useReturnFocusOnUnmount.js +0 -2
- package/lib/hooks/useRovingFocus.js +0 -2
- package/lib/hooks/useSize.js +0 -1
- package/lib/hooks/useToggle.js +0 -1
- package/lib/index.js +0 -9
- package/lib/theme/currys/color.js +0 -4
- package/lib/theme/currys/index.js +0 -5
- package/lib/theme/currys/spacing.js +0 -1
- package/lib/theme/index.js +0 -3
- package/lib/useElementList.js +15 -2
- package/lib/useElementList.js.map +1 -1
- package/lib/utils/uuid.js +0 -1
- package/lib/uuid.js +1 -1
- package/package.json +3 -8
- package/lib/scss/_figma-tokens.scss +0 -68
- package/scss/_figma-tokens.scss +0 -68
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Subtitle: React.FC<SubtitleProps>"],"sources":["../../../src/components/EyebrowHeader/EyebrowHeader.tsx","../../../src/components/EyebrowHeader/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface SubtitleProps {\n children?: React.ReactNode;\n}\n\nconst Subtitle: React.FC<SubtitleProps> = props => {\n return <p className={styles.subtitle}>{props.children}</p>;\n};\n\nexport interface EyebrowHeaderProps {\n children?: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport interface EyebrowHeaderType extends React.FC<EyebrowHeaderProps> {\n Subtitle: typeof Subtitle;\n Title: typeof Title;\n}\n\nconst EyebrowHeader = ((props: EyebrowHeaderProps): React.JSX.Element => (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.EyebrowHeader}>\n {props.children}\n </div>\n)) as EyebrowHeaderType;\n\nEyebrowHeader.Subtitle = Subtitle;\nEyebrowHeader.Title = Title;\nEyebrowHeader.displayName = 'EyebrowHeader';\n\nexport default EyebrowHeader;\n","import EyebrowHeader from './EyebrowHeader';\nexport * from './EyebrowHeader';\nexport default EyebrowHeader;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["Subtitle: React.FC<SubtitleProps>"],"sources":["../../../src/components/EyebrowHeader/EyebrowHeader.tsx","../../../src/components/EyebrowHeader/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\nimport Title from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface SubtitleProps {\n children?: React.ReactNode;\n}\n\nconst Subtitle: React.FC<SubtitleProps> = props => {\n return <p className={styles.subtitle}>{props.children}</p>;\n};\n\nexport interface EyebrowHeaderProps {\n children?: React.ReactNode;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport interface EyebrowHeaderType extends React.FC<EyebrowHeaderProps> {\n Subtitle: typeof Subtitle;\n Title: typeof Title;\n}\n\nconst EyebrowHeader = ((props: EyebrowHeaderProps): React.JSX.Element => (\n <div data-testid={props.testId} data-analyticsid={AnalyticsId.EyebrowHeader}>\n {props.children}\n </div>\n)) as EyebrowHeaderType;\n\nEyebrowHeader.Subtitle = Subtitle;\nEyebrowHeader.Title = Title;\nEyebrowHeader.displayName = 'EyebrowHeader';\n\nexport default EyebrowHeader;\n","import EyebrowHeader from './EyebrowHeader';\nexport * from './EyebrowHeader';\nexport default EyebrowHeader;\n"],"mappings":";;;;;AAWA,IAAMA,YAAoC,UAAS;AACjD,QAAO,oBAAC,KAAA;EAAE,WAAW,OAAO;YAAW,MAAM;GAAa;;AAc5D,IAAM,kBAAkB,UACtB,oBAAC,OAAA;CAAI,eAAa,MAAM;CAAQ,oBAAkB,YAAY;WAC3D,MAAM;EACH;AAGR,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,cAAc;AChC5B,IAAA,wBDkCe"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { n as AnalyticsId, s as LanguageLocales } from "../../constants2.js";
|
|
2
2
|
import { t as usePseudoClasses } from "../../usePseudoClasses.js";
|
|
3
|
-
import "../../grid.js";
|
|
4
3
|
import { t as isMutableRefObject } from "../../refs.js";
|
|
5
4
|
import { r as useLanguage } from "../../language.js";
|
|
6
5
|
import { n as useBreakpoint, t as Breakpoint } from "../../useBreakpoint.js";
|
|
7
6
|
import React from "react";
|
|
8
|
-
import
|
|
7
|
+
import classNames from "classnames";
|
|
9
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import styles from "./styles.module.scss";
|
|
11
10
|
var HN_Designsystem_FavoriteButton_nb_NO_default = { ariaLabel: "Favorittmarkering" };
|
|
@@ -99,7 +98,7 @@ const starIconHoverDesktop = (isChecked, isActive) => /* @__PURE__ */ jsxs(Fragm
|
|
|
99
98
|
})] });
|
|
100
99
|
const FavoriteButton = React.forwardRef(function FavoriteButtonForwardedRef(props, ref) {
|
|
101
100
|
const { checked, id, onClick, resources, tabIndex, testId, ...other } = props;
|
|
102
|
-
const buttonWrapperClasses =
|
|
101
|
+
const buttonWrapperClasses = classNames(styles.favoritebutton);
|
|
103
102
|
const { refObject, isHovered, isActive } = usePseudoClasses(isMutableRefObject(ref) ? ref : null);
|
|
104
103
|
const breakpoint = useBreakpoint();
|
|
105
104
|
const { language } = useLanguage(LanguageLocales.NORWEGIAN);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["mergedResources: HNDesignsystemFavoriteButton"],"sources":["../../../src/resources/HN.Designsystem.FavoriteButton.nb-NO.json","../../../src/components/FavoriteButton/resourceHelper.ts","../../../src/components/FavoriteButton/StarIcon.tsx","../../../src/components/FavoriteButton/FavoriteButton.tsx","../../../src/components/FavoriteButton/index.ts"],"sourcesContent":["{\n \"ariaLabel\": \"Favorittmarkering\"\n}\n","import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.FavoriteButton.nb-NO.json';\nimport { HNDesignsystemFavoriteButton } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFavoriteButton => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import styles from './styles.module.scss';\n\nconst normalStroke = 'var(--color-action-graphics-onlight)';\nconst normalFill = 'transparent';\nconst hoverFill = 'var(--color-action-graphics-onlight-hover)';\nconst hoverStroke = 'var(--color-action-graphics-onlight-hover)';\nconst activeStroke = 'var(--core-color-blueberry-800)';\n\nconst fillColor = (isChecked: boolean, isActive: boolean, isHovered: boolean): string => {\n if (isChecked) {\n if (isActive) {\n return activeStroke;\n } else {\n if (isHovered) {\n return hoverStroke;\n } else {\n return normalStroke;\n }\n }\n } else {\n if (isHovered) {\n return hoverFill;\n } else {\n return normalFill;\n }\n }\n};\n\nconst strokeColor = (isActive: boolean, isHovered: boolean): string => {\n if (isActive) {\n return activeStroke;\n } else {\n if (isHovered) {\n return hoverStroke;\n } else {\n return normalStroke;\n }\n }\n};\n\nexport const starIconNormalMobile = (isChecked: boolean, isActive: boolean): React.JSX.Element => {\n return (\n <>\n <path\n d=\"M20.1026 31.1787L13.4007 34.7023C10.833 36.0523 7.83185 33.8719 8.32233 31.0126L9.60261 23.5492L4.17653 18.2675C2.09656 16.2428 3.24317 12.712 6.11581 12.2956L13.5982 11.2112L16.9493 4.42107C18.2332 1.81969 21.9426 1.81969 23.2265 4.42107L26.5776 11.2112L34.06 12.2956C36.9326 12.712 38.0792 16.2428 35.9993 18.2675L30.5732 23.5492L31.852 31.0044C32.3428 33.8651 29.3386 36.0456 26.7708 34.6925L20.1026 31.1787Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n display=\"block\"\n />\n <path\n d=\"M20.0961 26.5515L12.6372 30.4731L14.0621 22.1671L8.01953 16.2853L16.3582 15.0768L20.0877 7.52002L23.8171 15.0768L32.1558 16.2853L26.1133 22.1671L27.5381 30.4731L20.0961 26.5515Z\"\n stroke={strokeColor(isActive, false)}\n fill={fillColor(isChecked, isActive, false)}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n );\n};\n\nexport const starIconHoverMobile = (isChecked: boolean, isActive: boolean): React.JSX.Element => (\n <>\n <path\n d=\"M22.2128 31.4832L16.2246 36.117C13.9303 37.8924 10.5961 36.2662 10.5826 33.3653L10.5475 25.7929L4.28665 21.5336C1.88672 19.9009 2.40278 16.2246 5.15948 15.3158L12.3399 12.9486L14.461 5.67964C15.2736 2.89484 18.9267 2.2507 20.6428 4.58962L25.1221 10.6947L32.6791 10.4633C35.5804 10.3745 37.3227 13.6526 35.6259 16.0077L31.1994 22.1514L33.7534 29.2712C34.7335 32.0033 32.1536 34.6724 29.3898 33.7857L22.2128 31.4832Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n />\n <path\n d=\"M21.4079 26.8365L14.7433 31.9937L14.7041 23.5664L7.73204 18.8233L15.7342 16.1851L18.0947 8.09555L23.0798 14.8899L31.5016 14.6321L26.5722 21.4738L29.4178 29.4062L21.4079 26.8365Z\"\n stroke={strokeColor(isActive, true)}\n fill={fillColor(isChecked, isActive, true)}\n fillOpacity={isChecked ? '1' : '0.13'}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n);\nexport const starIconNormalDesktop = (isChecked: boolean, isActive: boolean): React.JSX.Element => (\n <>\n <path\n d=\"M30.1061 44.1854L20.3139 49.3338C17.7461 50.6838 14.745 48.5034 15.2355 45.6441L17.1061 34.7394L9.17653 27.0207C7.09656 24.9961 8.24318 21.4653 11.1158 21.0489L22.053 19.4638L26.9493 9.54278C28.2331 6.9414 31.9426 6.94139 33.2265 9.54278L38.1227 19.4638L49.06 21.0489C51.9326 21.4653 53.0792 24.9961 50.9993 27.0207L43.0697 34.7394L44.9389 45.6359C45.4296 48.4966 42.4254 50.6772 39.8576 49.324L30.1061 44.1854Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n />\n <path\n d=\"M30.0998 39.4723L19.5927 44.9966L21.5998 33.2961L13.0879 25.0106L24.8343 23.3082L30.0879 12.6632L35.3414 23.3082L47.0879 25.0106L38.576 33.2961L40.5831 44.9966L30.0998 39.4723Z\"\n stroke={strokeColor(isActive, false)}\n fill={fillColor(isChecked, isActive, false)}\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n);\n\nexport const starIconHoverDesktop = (isChecked: boolean, isActive: boolean): React.JSX.Element => (\n <>\n <path\n d=\"M33.1609 44.7458L24.4114 51.5164C22.1171 53.2918 18.783 51.6656 18.7695 48.7646L18.7181 37.7007L9.56864 31.4763C7.1687 29.8436 7.68476 26.1672 10.4415 25.2584L20.9373 21.7982L24.0364 11.1776C24.849 8.39281 28.5021 7.74867 30.2182 10.0876L36.7629 19.0077L47.8092 18.6695C50.7105 18.5807 52.4528 21.8588 50.756 24.2138L44.2872 33.1922L48.0201 43.5985C49.0002 46.3306 46.4203 48.9997 43.6565 48.113L33.1609 44.7458Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n />\n <path\n d=\"M32.3991 40.1029L23.0108 47.3678L22.9557 35.4965L13.1343 28.815L24.4067 25.0987L27.732 13.7031L34.7542 23.2741L46.6178 22.9109L39.674 32.5486L43.6823 43.7228L32.3991 40.1029Z\"\n stroke={strokeColor(isActive, true)}\n fill={fillColor(isChecked, isActive, true)}\n fillOpacity={isChecked ? '1' : '0.13'}\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n);\n","import React, { AriaAttributes } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport { starIconHoverDesktop, starIconHoverMobile, starIconNormalDesktop, starIconNormalMobile } from './StarIcon';\nimport { AnalyticsId, HTMLButtonProps, LanguageLocales } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { HNDesignsystemFavoriteButton } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport { isMutableRefObject } from '../../utils/refs';\n\nimport styles from './styles.module.scss';\n\nexport interface FavoriteButtonProps extends Omit<HTMLButtonProps, 'type'>, AriaAttributes {\n /** Determines if the FavoriteButton is checked */\n checked: boolean;\n /** Gives a unique id to the button */\n id?: string;\n /** Function that is called when clicked */\n onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Resources for component */\n resources?: Partial<HNDesignsystemFavoriteButton>;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const FavoriteButton = React.forwardRef(function FavoriteButtonForwardedRef(\n props: FavoriteButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement>\n) {\n const { checked, id, onClick, resources, tabIndex, testId, ...other } = props;\n\n const buttonWrapperClasses = classNames(styles.favoritebutton);\n const { refObject, isHovered, isActive } = usePseudoClasses<HTMLButtonElement>(isMutableRefObject(ref) ? ref : null);\n const breakpoint = useBreakpoint();\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemFavoriteButton = {\n ...defaultResources,\n ...resources,\n ariaLabel: other['aria-label'] || resources?.ariaLabel || defaultResources.ariaLabel,\n };\n\n const isMobile = breakpoint <= Breakpoint.sm;\n\n const starIcon = ((): React.JSX.Element => {\n if (isMobile) {\n if (isHovered) {\n return starIconHoverMobile(checked, isActive);\n } else {\n return starIconNormalMobile(checked, isActive);\n }\n } else {\n if (isHovered) {\n return starIconHoverDesktop(checked, isActive);\n } else {\n return starIconNormalDesktop(checked, isActive);\n }\n }\n })();\n\n return (\n <button\n id={id}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.FavoriteButton}\n className={buttonWrapperClasses}\n ref={refObject}\n tabIndex={tabIndex}\n role=\"switch\"\n aria-checked={checked}\n type=\"button\"\n aria-label={mergedResources.ariaLabel}\n {...other}\n >\n <svg focusable={false} overflow=\"visible\" role=\"presentation\" viewBox={isMobile ? '0 0 41 41' : '0 0 61 61'}>\n {starIcon}\n </svg>\n </button>\n );\n});\n\nFavoriteButton.displayName = 'FavoriteButton';\n\nexport default FavoriteButton;\n","export * from './FavoriteButton';\n\nimport { FavoriteButton } from './FavoriteButton';\nexport default FavoriteButton;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["mergedResources: HNDesignsystemFavoriteButton"],"sources":["../../../src/resources/HN.Designsystem.FavoriteButton.nb-NO.json","../../../src/components/FavoriteButton/resourceHelper.ts","../../../src/components/FavoriteButton/StarIcon.tsx","../../../src/components/FavoriteButton/FavoriteButton.tsx","../../../src/components/FavoriteButton/index.ts"],"sourcesContent":["{\n \"ariaLabel\": \"Favorittmarkering\"\n}\n","import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.FavoriteButton.nb-NO.json';\nimport { HNDesignsystemFavoriteButton } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemFavoriteButton => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import styles from './styles.module.scss';\n\nconst normalStroke = 'var(--color-action-graphics-onlight)';\nconst normalFill = 'transparent';\nconst hoverFill = 'var(--color-action-graphics-onlight-hover)';\nconst hoverStroke = 'var(--color-action-graphics-onlight-hover)';\nconst activeStroke = 'var(--core-color-blueberry-800)';\n\nconst fillColor = (isChecked: boolean, isActive: boolean, isHovered: boolean): string => {\n if (isChecked) {\n if (isActive) {\n return activeStroke;\n } else {\n if (isHovered) {\n return hoverStroke;\n } else {\n return normalStroke;\n }\n }\n } else {\n if (isHovered) {\n return hoverFill;\n } else {\n return normalFill;\n }\n }\n};\n\nconst strokeColor = (isActive: boolean, isHovered: boolean): string => {\n if (isActive) {\n return activeStroke;\n } else {\n if (isHovered) {\n return hoverStroke;\n } else {\n return normalStroke;\n }\n }\n};\n\nexport const starIconNormalMobile = (isChecked: boolean, isActive: boolean): React.JSX.Element => {\n return (\n <>\n <path\n d=\"M20.1026 31.1787L13.4007 34.7023C10.833 36.0523 7.83185 33.8719 8.32233 31.0126L9.60261 23.5492L4.17653 18.2675C2.09656 16.2428 3.24317 12.712 6.11581 12.2956L13.5982 11.2112L16.9493 4.42107C18.2332 1.81969 21.9426 1.81969 23.2265 4.42107L26.5776 11.2112L34.06 12.2956C36.9326 12.712 38.0792 16.2428 35.9993 18.2675L30.5732 23.5492L31.852 31.0044C32.3428 33.8651 29.3386 36.0456 26.7708 34.6925L20.1026 31.1787Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n display=\"block\"\n />\n <path\n d=\"M20.0961 26.5515L12.6372 30.4731L14.0621 22.1671L8.01953 16.2853L16.3582 15.0768L20.0877 7.52002L23.8171 15.0768L32.1558 16.2853L26.1133 22.1671L27.5381 30.4731L20.0961 26.5515Z\"\n stroke={strokeColor(isActive, false)}\n fill={fillColor(isChecked, isActive, false)}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n );\n};\n\nexport const starIconHoverMobile = (isChecked: boolean, isActive: boolean): React.JSX.Element => (\n <>\n <path\n d=\"M22.2128 31.4832L16.2246 36.117C13.9303 37.8924 10.5961 36.2662 10.5826 33.3653L10.5475 25.7929L4.28665 21.5336C1.88672 19.9009 2.40278 16.2246 5.15948 15.3158L12.3399 12.9486L14.461 5.67964C15.2736 2.89484 18.9267 2.2507 20.6428 4.58962L25.1221 10.6947L32.6791 10.4633C35.5804 10.3745 37.3227 13.6526 35.6259 16.0077L31.1994 22.1514L33.7534 29.2712C34.7335 32.0033 32.1536 34.6724 29.3898 33.7857L22.2128 31.4832Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n />\n <path\n d=\"M21.4079 26.8365L14.7433 31.9937L14.7041 23.5664L7.73204 18.8233L15.7342 16.1851L18.0947 8.09555L23.0798 14.8899L31.5016 14.6321L26.5722 21.4738L29.4178 29.4062L21.4079 26.8365Z\"\n stroke={strokeColor(isActive, true)}\n fill={fillColor(isChecked, isActive, true)}\n fillOpacity={isChecked ? '1' : '0.13'}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n);\nexport const starIconNormalDesktop = (isChecked: boolean, isActive: boolean): React.JSX.Element => (\n <>\n <path\n d=\"M30.1061 44.1854L20.3139 49.3338C17.7461 50.6838 14.745 48.5034 15.2355 45.6441L17.1061 34.7394L9.17653 27.0207C7.09656 24.9961 8.24318 21.4653 11.1158 21.0489L22.053 19.4638L26.9493 9.54278C28.2331 6.9414 31.9426 6.94139 33.2265 9.54278L38.1227 19.4638L49.06 21.0489C51.9326 21.4653 53.0792 24.9961 50.9993 27.0207L43.0697 34.7394L44.9389 45.6359C45.4296 48.4966 42.4254 50.6772 39.8576 49.324L30.1061 44.1854Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n />\n <path\n d=\"M30.0998 39.4723L19.5927 44.9966L21.5998 33.2961L13.0879 25.0106L24.8343 23.3082L30.0879 12.6632L35.3414 23.3082L47.0879 25.0106L38.576 33.2961L40.5831 44.9966L30.0998 39.4723Z\"\n stroke={strokeColor(isActive, false)}\n fill={fillColor(isChecked, isActive, false)}\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n);\n\nexport const starIconHoverDesktop = (isChecked: boolean, isActive: boolean): React.JSX.Element => (\n <>\n <path\n d=\"M33.1609 44.7458L24.4114 51.5164C22.1171 53.2918 18.783 51.6656 18.7695 48.7646L18.7181 37.7007L9.56864 31.4763C7.1687 29.8436 7.68476 26.1672 10.4415 25.2584L20.9373 21.7982L24.0364 11.1776C24.849 8.39281 28.5021 7.74867 30.2182 10.0876L36.7629 19.0077L47.8092 18.6695C50.7105 18.5807 52.4528 21.8588 50.756 24.2138L44.2872 33.1922L48.0201 43.5985C49.0002 46.3306 46.4203 48.9997 43.6565 48.113L33.1609 44.7458Z\"\n stroke=\"black\"\n fill=\"transparent\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n className={styles['favoritebutton__star-icon--focus']}\n />\n <path\n d=\"M32.3991 40.1029L23.0108 47.3678L22.9557 35.4965L13.1343 28.815L24.4067 25.0987L27.732 13.7031L34.7542 23.2741L46.6178 22.9109L39.674 32.5486L43.6823 43.7228L32.3991 40.1029Z\"\n stroke={strokeColor(isActive, true)}\n fill={fillColor(isChecked, isActive, true)}\n fillOpacity={isChecked ? '1' : '0.13'}\n strokeWidth=\"2.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </>\n);\n","import React, { AriaAttributes } from 'react';\n\nimport classNames from 'classnames';\n\nimport { getResources } from './resourceHelper';\nimport { starIconHoverDesktop, starIconHoverMobile, starIconNormalDesktop, starIconNormalMobile } from './StarIcon';\nimport { AnalyticsId, HTMLButtonProps, LanguageLocales } from '../../constants';\nimport { Breakpoint, useBreakpoint } from '../../hooks/useBreakpoint';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { HNDesignsystemFavoriteButton } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport { isMutableRefObject } from '../../utils/refs';\n\nimport styles from './styles.module.scss';\n\nexport interface FavoriteButtonProps extends Omit<HTMLButtonProps, 'type'>, AriaAttributes {\n /** Determines if the FavoriteButton is checked */\n checked: boolean;\n /** Gives a unique id to the button */\n id?: string;\n /** Function that is called when clicked */\n onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Resources for component */\n resources?: Partial<HNDesignsystemFavoriteButton>;\n /** Specifies the focus order relative to the other buttons or controls on the page */\n tabIndex?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const FavoriteButton = React.forwardRef(function FavoriteButtonForwardedRef(\n props: FavoriteButtonProps,\n ref: React.ForwardedRef<HTMLButtonElement>\n) {\n const { checked, id, onClick, resources, tabIndex, testId, ...other } = props;\n\n const buttonWrapperClasses = classNames(styles.favoritebutton);\n const { refObject, isHovered, isActive } = usePseudoClasses<HTMLButtonElement>(isMutableRefObject(ref) ? ref : null);\n const breakpoint = useBreakpoint();\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n\n const mergedResources: HNDesignsystemFavoriteButton = {\n ...defaultResources,\n ...resources,\n ariaLabel: other['aria-label'] || resources?.ariaLabel || defaultResources.ariaLabel,\n };\n\n const isMobile = breakpoint <= Breakpoint.sm;\n\n const starIcon = ((): React.JSX.Element => {\n if (isMobile) {\n if (isHovered) {\n return starIconHoverMobile(checked, isActive);\n } else {\n return starIconNormalMobile(checked, isActive);\n }\n } else {\n if (isHovered) {\n return starIconHoverDesktop(checked, isActive);\n } else {\n return starIconNormalDesktop(checked, isActive);\n }\n }\n })();\n\n return (\n <button\n id={id}\n onClick={onClick}\n data-testid={testId}\n data-analyticsid={AnalyticsId.FavoriteButton}\n className={buttonWrapperClasses}\n ref={refObject}\n tabIndex={tabIndex}\n role=\"switch\"\n aria-checked={checked}\n type=\"button\"\n aria-label={mergedResources.ariaLabel}\n {...other}\n >\n <svg focusable={false} overflow=\"visible\" role=\"presentation\" viewBox={isMobile ? '0 0 41 41' : '0 0 61 61'}>\n {starIcon}\n </svg>\n </button>\n );\n});\n\nFavoriteButton.displayName = 'FavoriteButton';\n\nexport default FavoriteButton;\n","export * from './FavoriteButton';\n\nimport { FavoriteButton } from './FavoriteButton';\nexport default FavoriteButton;\n"],"mappings":"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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { FormOnColor, FormSize } from '../../constants';
|
|
3
|
+
import { TitleTags } from '../Title';
|
|
3
4
|
export type FormGroupTags = 'fieldset' | 'div';
|
|
4
5
|
export interface FormGroupProps {
|
|
5
6
|
/** Can be used as a replacement text for legend in cases where the group title already exists externally */
|
|
@@ -38,6 +39,10 @@ export interface FormGroupProps {
|
|
|
38
39
|
fieldsetName?: string;
|
|
39
40
|
/** Sets div instead of fieldset tag */
|
|
40
41
|
htmlMarkup?: FormGroupTags;
|
|
42
|
+
/** Markup for legend if formgroup htmlMarkup is div*/
|
|
43
|
+
legendHtmlMarkup?: TitleTags;
|
|
44
|
+
/** Markup for title */
|
|
45
|
+
titleHtmlMarkup?: TitleTags;
|
|
41
46
|
/** Renders the error component (Default: true) */
|
|
42
47
|
renderError?: boolean;
|
|
43
48
|
}
|
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
import "../../uuid.js";
|
|
2
|
-
import "../../environment.js";
|
|
3
|
-
import "../../constants2.js";
|
|
4
|
-
import "../../usePseudoClasses.js";
|
|
5
|
-
import "../../grid.js";
|
|
6
|
-
import "../../palette.js";
|
|
7
|
-
import "../../spacers.js";
|
|
8
|
-
import "../../theme.js";
|
|
9
|
-
import "../../color.js";
|
|
10
|
-
import "../../spacing.js";
|
|
11
|
-
import "../../currys.js";
|
|
12
|
-
import "../../refs.js";
|
|
13
|
-
import "../../Icon.js";
|
|
14
|
-
import "../../language.js";
|
|
15
|
-
import "../../Check.js";
|
|
16
|
-
import "../../_rolldown_dynamic_import_helper.js";
|
|
17
|
-
import "../../useIsServerSide.js";
|
|
18
|
-
import "../../LazyIcon.js";
|
|
19
|
-
import "../../component.js";
|
|
20
|
-
import "../../useBreakpoint.js";
|
|
21
|
-
import "../../useIdWithFallback.js";
|
|
22
|
-
import "../../accessibility.js";
|
|
23
|
-
import "../../ErrorWrapper.js";
|
|
24
|
-
import "../../Spacer.js";
|
|
25
|
-
import "../../Label.js";
|
|
26
|
-
import "../../FormFieldTag.js";
|
|
27
|
-
import "../../useElementList.js";
|
|
28
|
-
import "../../useFocusableElements.js";
|
|
29
|
-
import "../../useFocusToggle.js";
|
|
30
|
-
import "../../focus.js";
|
|
31
|
-
import "../../useFocusTrap.js";
|
|
32
|
-
import "../../useIntersectionObserver.js";
|
|
33
|
-
import "../../useIsVisible.js";
|
|
34
|
-
import "../../debounce.js";
|
|
35
|
-
import "../../useLayoutEvent.js";
|
|
36
|
-
import "../../usePrevious.js";
|
|
37
|
-
import "../../useSize.js";
|
|
38
|
-
import "../../useResizeObserver.js";
|
|
39
|
-
import "../../useToggle.js";
|
|
40
|
-
import "../../useKeyboardEvent.js";
|
|
41
|
-
import "../../useOutsideEvent.js";
|
|
42
|
-
import "../../mobile.js";
|
|
43
|
-
import "../../src.js";
|
|
44
|
-
import "../../StatusDot.js";
|
|
45
|
-
import "../../Checkbox.js";
|
|
46
|
-
import "../../Title.js";
|
|
47
|
-
import "../../Title2.js";
|
|
48
|
-
import "../../ChevronDown.js";
|
|
49
|
-
import "../../FormLayout.js";
|
|
50
|
-
import "../../Input.js";
|
|
51
|
-
import "../../MaxCharacters.js";
|
|
52
|
-
import "../../RadioButton.js";
|
|
53
|
-
import "../../Select.js";
|
|
54
|
-
import "../../Slider.js";
|
|
55
|
-
import "../../Textarea.js";
|
|
56
1
|
import { n as FormGroup_default$1, t as FormGroup } from "../../FormGroup.js";
|
|
57
2
|
var FormGroup_default = FormGroup_default$1;
|
|
58
3
|
export { FormGroup, FormGroup_default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/FormGroup/index.ts"],"sourcesContent":["import FormGroup from './FormGroup';\nexport * from './FormGroup';\nexport default FormGroup;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/FormGroup/index.ts"],"sourcesContent":["import FormGroup from './FormGroup';\nexport * from './FormGroup';\nexport default FormGroup;\n"],"mappings":";AAEA,IAAA,oBAAe"}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import { n as AnalyticsId, s as LanguageLocales } from "../../constants2.js";
|
|
2
|
-
import "../../usePseudoClasses.js";
|
|
3
|
-
import "../../grid.js";
|
|
4
|
-
import "../../palette.js";
|
|
5
|
-
import "../../spacers.js";
|
|
6
|
-
import "../../theme.js";
|
|
7
|
-
import "../../color.js";
|
|
8
|
-
import "../../spacing.js";
|
|
9
|
-
import "../../currys.js";
|
|
10
|
-
import "../../refs.js";
|
|
11
|
-
import "../../AsChildSlot.js";
|
|
12
|
-
import "../../Icon.js";
|
|
13
|
-
import "../../ArrowUpRight.js";
|
|
14
2
|
import { t as AnchorLink_default } from "../../AnchorLink.js";
|
|
15
3
|
import { r as useLanguage } from "../../language.js";
|
|
16
|
-
import "../../useBreakpoint.js";
|
|
17
|
-
import "../../useIsMobileBreakpoint.js";
|
|
18
|
-
import "../../accessibility.js";
|
|
19
|
-
import "../../X.js";
|
|
20
4
|
import { t as Close_default } from "../../Close.js";
|
|
21
|
-
import "../../floating-ui.react.js";
|
|
22
5
|
import { n as PopOverVariant, t as PopOver_default } from "../../PopOver.js";
|
|
23
6
|
import React from "react";
|
|
24
|
-
import
|
|
7
|
+
import classNames from "classnames";
|
|
25
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
9
|
import styles from "./styles.module.scss";
|
|
27
10
|
var HN_Designsystem_HelpBubble_nb_NO_default = { ariaLabel: "Hjelpetekst" };
|
|
@@ -42,8 +25,8 @@ var HelpBubble = React.forwardRef((props, ref) => {
|
|
|
42
25
|
...resources,
|
|
43
26
|
ariaLabel: props.ariaLabel ?? resources?.ariaLabel ?? defaultResources.ariaLabel
|
|
44
27
|
};
|
|
45
|
-
const helpBubbleClasses =
|
|
46
|
-
const contentClasses =
|
|
28
|
+
const helpBubbleClasses = classNames(styles.helpbubble, className);
|
|
29
|
+
const contentClasses = classNames(styles.helpbubble__content);
|
|
47
30
|
const renderLink = () => {
|
|
48
31
|
if (onLinkClick && linkText) return /* @__PURE__ */ jsx("button", {
|
|
49
32
|
className: styles.helpbubble__link,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["mergedResources: HNDesignsystemHelpBubble"],"sources":["../../../src/resources/HN.Designsystem.HelpBubble.nb-NO.json","../../../src/components/HelpBubble/resourceHelper.ts","../../../src/components/HelpBubble/HelpBubble.tsx","../../../src/components/HelpBubble/index.ts"],"sourcesContent":["{\n \"ariaLabel\": \"Hjelpetekst\"\n}\n","import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.HelpBubble.nb-NO.json';\nimport { HNDesignsystemHelpBubble } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemHelpBubble => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { HNDesignsystemHelpBubble } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport AnchorLink, { AnchorLinkTargets } from '../AnchorLink';\nimport Close from '../Close';\nimport PopOver, { PopOverProps, PopOverVariant } from '../PopOver';\nimport { getResources } from './resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport const HelpBubbleVariant = PopOverVariant;\n\nexport interface HelpBubbleProps extends Pick<PopOverProps, 'children' | 'variant' | 'controllerRef' | 'role'> {\n /** Sets aria-label of the bubble. */\n ariaLabel?: string;\n /** Sets aria-labelledby of the bubble. */\n ariaLabelledById?: string;\n /** Id of the HelpBubble */\n helpBubbleId?: string;\n /** Content shown inside HelpBubble. */\n children: React.ReactNode;\n /** Ref for the element the HelpBubble is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Adds custom classes to the element. */\n className?: string;\n /** Determines the placement of the helpbubble. Default: automatic positioning. */\n variant?: keyof typeof HelpBubbleVariant;\n /** Show the bubble. Default: false. */\n showBubble?: boolean;\n /** Hide the close button in the bubble. */\n noCloseButton?: boolean;\n /** Visible text on the link. */\n linkText?: string;\n /** Url the link leads to */\n linkUrl?: string;\n /** Sets the target type of the link. _blank adds an arrow icon at the end of the link */\n linkTarget?: AnchorLinkTargets;\n /** Function is called when link is clicked */\n onLinkClick?: () => void;\n /** Function is called when user clicks the button */\n onClose?: () => void;\n /** aria-label to be passed onto Close */\n closeAriaLabel?: string;\n /** Resources for the component */\n resources?: Partial<HNDesignsystemHelpBubble>;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst HelpBubble = React.forwardRef<HTMLDivElement | SVGSVGElement, HelpBubbleProps>((props, ref) => {\n const {\n ariaLabelledById,\n children,\n className = '',\n noCloseButton,\n linkText = 'Mer hjelp',\n linkUrl,\n linkTarget,\n onLinkClick,\n onClose,\n closeAriaLabel,\n // Props passed on to PopOver\n showBubble,\n helpBubbleId,\n variant,\n controllerRef,\n resources,\n testId,\n } = props;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n\n if (!showBubble) {\n return null;\n }\n\n const defaultResources = getResources(language);\n const mergedResources: HNDesignsystemHelpBubble = {\n ...defaultResources,\n ...resources,\n ariaLabel: props.ariaLabel ?? resources?.ariaLabel ?? defaultResources.ariaLabel,\n };\n\n const helpBubbleClasses = classNames(styles.helpbubble, className);\n const contentClasses = classNames(styles.helpbubble__content);\n\n const renderLink = (): JSX.Element | undefined => {\n if (onLinkClick && linkText) {\n return (\n <button className={styles.helpbubble__link} onClick={onLinkClick} type=\"button\">\n {linkText}\n </button>\n );\n } else if (linkUrl && linkText) {\n return (\n <AnchorLink href={linkUrl} target={linkTarget}>\n {linkText}\n </AnchorLink>\n );\n }\n };\n\n const renderCloseButton = (): JSX.Element | undefined => {\n if (noCloseButton) {\n return;\n }\n return <Close small color=\"plum\" onClick={onClose} ariaLabel={closeAriaLabel} className={styles.helpbubble__close} />;\n };\n\n return (\n <PopOver\n ariaLabel={mergedResources.ariaLabel}\n ariaLabelledById={ariaLabelledById}\n id={helpBubbleId}\n variant={variant}\n controllerRef={controllerRef}\n role=\"group\"\n ref={ref}\n show={showBubble}\n testId={testId}\n >\n <div className={helpBubbleClasses} data-analyticsid={AnalyticsId.HelpBubble}>\n <div className={contentClasses}>\n {children}\n {renderLink()}\n </div>\n {renderCloseButton()}\n </div>\n </PopOver>\n );\n});\n\nHelpBubble.displayName = 'HelpBubble';\n\nexport default HelpBubble;\n","import HelpBubble from './HelpBubble';\nexport * from './HelpBubble';\nexport default HelpBubble;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["mergedResources: HNDesignsystemHelpBubble"],"sources":["../../../src/resources/HN.Designsystem.HelpBubble.nb-NO.json","../../../src/components/HelpBubble/resourceHelper.ts","../../../src/components/HelpBubble/HelpBubble.tsx","../../../src/components/HelpBubble/index.ts"],"sourcesContent":["{\n \"ariaLabel\": \"Hjelpetekst\"\n}\n","import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.HelpBubble.nb-NO.json';\nimport { HNDesignsystemHelpBubble } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemHelpBubble => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId, LanguageLocales } from '../../constants';\nimport { HNDesignsystemHelpBubble } from '../../resources/Resources';\nimport { useLanguage } from '../../utils/language';\nimport AnchorLink, { AnchorLinkTargets } from '../AnchorLink';\nimport Close from '../Close';\nimport PopOver, { PopOverProps, PopOverVariant } from '../PopOver';\nimport { getResources } from './resourceHelper';\n\nimport styles from './styles.module.scss';\n\nexport const HelpBubbleVariant = PopOverVariant;\n\nexport interface HelpBubbleProps extends Pick<PopOverProps, 'children' | 'variant' | 'controllerRef' | 'role'> {\n /** Sets aria-label of the bubble. */\n ariaLabel?: string;\n /** Sets aria-labelledby of the bubble. */\n ariaLabelledById?: string;\n /** Id of the HelpBubble */\n helpBubbleId?: string;\n /** Content shown inside HelpBubble. */\n children: React.ReactNode;\n /** Ref for the element the HelpBubble is placed upon */\n controllerRef: React.RefObject<HTMLElement | SVGSVGElement>;\n /** Adds custom classes to the element. */\n className?: string;\n /** Determines the placement of the helpbubble. Default: automatic positioning. */\n variant?: keyof typeof HelpBubbleVariant;\n /** Show the bubble. Default: false. */\n showBubble?: boolean;\n /** Hide the close button in the bubble. */\n noCloseButton?: boolean;\n /** Visible text on the link. */\n linkText?: string;\n /** Url the link leads to */\n linkUrl?: string;\n /** Sets the target type of the link. _blank adds an arrow icon at the end of the link */\n linkTarget?: AnchorLinkTargets;\n /** Function is called when link is clicked */\n onLinkClick?: () => void;\n /** Function is called when user clicks the button */\n onClose?: () => void;\n /** aria-label to be passed onto Close */\n closeAriaLabel?: string;\n /** Resources for the component */\n resources?: Partial<HNDesignsystemHelpBubble>;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst HelpBubble = React.forwardRef<HTMLDivElement | SVGSVGElement, HelpBubbleProps>((props, ref) => {\n const {\n ariaLabelledById,\n children,\n className = '',\n noCloseButton,\n linkText = 'Mer hjelp',\n linkUrl,\n linkTarget,\n onLinkClick,\n onClose,\n closeAriaLabel,\n // Props passed on to PopOver\n showBubble,\n helpBubbleId,\n variant,\n controllerRef,\n resources,\n testId,\n } = props;\n\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n\n if (!showBubble) {\n return null;\n }\n\n const defaultResources = getResources(language);\n const mergedResources: HNDesignsystemHelpBubble = {\n ...defaultResources,\n ...resources,\n ariaLabel: props.ariaLabel ?? resources?.ariaLabel ?? defaultResources.ariaLabel,\n };\n\n const helpBubbleClasses = classNames(styles.helpbubble, className);\n const contentClasses = classNames(styles.helpbubble__content);\n\n const renderLink = (): JSX.Element | undefined => {\n if (onLinkClick && linkText) {\n return (\n <button className={styles.helpbubble__link} onClick={onLinkClick} type=\"button\">\n {linkText}\n </button>\n );\n } else if (linkUrl && linkText) {\n return (\n <AnchorLink href={linkUrl} target={linkTarget}>\n {linkText}\n </AnchorLink>\n );\n }\n };\n\n const renderCloseButton = (): JSX.Element | undefined => {\n if (noCloseButton) {\n return;\n }\n return <Close small color=\"plum\" onClick={onClose} ariaLabel={closeAriaLabel} className={styles.helpbubble__close} />;\n };\n\n return (\n <PopOver\n ariaLabel={mergedResources.ariaLabel}\n ariaLabelledById={ariaLabelledById}\n id={helpBubbleId}\n variant={variant}\n controllerRef={controllerRef}\n role=\"group\"\n ref={ref}\n show={showBubble}\n testId={testId}\n >\n <div className={helpBubbleClasses} data-analyticsid={AnalyticsId.HelpBubble}>\n <div className={contentClasses}>\n {children}\n {renderLink()}\n </div>\n {renderCloseButton()}\n </div>\n </PopOver>\n );\n});\n\nHelpBubble.displayName = 'HelpBubble';\n\nexport default HelpBubble;\n","import HelpBubble from './HelpBubble';\nexport * from './HelpBubble';\nexport default HelpBubble;\n"],"mappings":";;;;;;;;;;ACIA,MAAa,gBAAgB,aAAwD;AACnF,SAAQ,UAAR;EACE,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACMb,MAAa,oBAAoB;AAuCjC,IAAM,aAAa,MAAM,YAA6D,OAAO,QAAQ;CACnG,MAAM,EACJ,kBACA,UACA,YAAY,IACZ,eACA,WAAW,aACX,SACA,YACA,aACA,SACA,gBAEA,YACA,cACA,SACA,eACA,WACA,WACE;CAEJ,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;AAE5E,KAAI,CAAC,WACH,QAAO;CAGT,MAAM,mBAAmB,aAAa,SAAS;CAC/C,MAAMA,kBAA4C;EAChD,GAAG;EACH,GAAG;EACH,WAAW,MAAM,aAAa,WAAW,aAAa,iBAAiB;EACxE;CAED,MAAM,oBAAoB,WAAW,OAAO,YAAY,UAAU;CAClE,MAAM,iBAAiB,WAAW,OAAO,oBAAoB;CAE7D,MAAM,mBAA4C;AAChD,MAAI,eAAe,SACjB,QACE,oBAAC,UAAA;GAAO,WAAW,OAAO;GAAkB,SAAS;GAAa,MAAK;aACpE;IACM;WAEF,WAAW,SACpB,QACE,oBAAC,oBAAA;GAAW,MAAM;GAAS,QAAQ;aAChC;IACU;;CAKnB,MAAM,0BAAmD;AACvD,MAAI,cACF;AAEF,SAAO,oBAAC,eAAA;GAAM,OAAA;GAAM,OAAM;GAAO,SAAS;GAAS,WAAW;GAAgB,WAAW,OAAO;IAAqB;;AAGvH,QACE,oBAAC,iBAAA;EACC,WAAW,gBAAgB;EACT;EAClB,IAAI;EACK;EACM;EACf,MAAK;EACA;EACL,MAAM;EACE;YAER,qBAAC,OAAA;GAAI,WAAW;GAAmB,oBAAkB,YAAY;cAC/D,qBAAC,OAAA;IAAI,WAAW;eACb,UACA,YAAY,CAAA;KACT,EACL,mBAAmB,CAAA;IAChB;GACE;EAEZ;AAEF,WAAW,cAAc;ACtIzB,IAAA,qBDwIe"}
|
|
@@ -1,42 +1,6 @@
|
|
|
1
|
-
import "../../uuid.js";
|
|
2
|
-
import "../../environment.js";
|
|
3
1
|
import { s as LanguageLocales } from "../../constants2.js";
|
|
4
|
-
import "../../usePseudoClasses.js";
|
|
5
|
-
import "../../grid.js";
|
|
6
|
-
import "../../palette.js";
|
|
7
|
-
import "../../spacers.js";
|
|
8
|
-
import "../../theme.js";
|
|
9
|
-
import "../../color.js";
|
|
10
|
-
import "../../refs.js";
|
|
11
|
-
import "../../Icon.js";
|
|
12
2
|
import { r as useLanguage } from "../../language.js";
|
|
13
|
-
import "../../_rolldown_dynamic_import_helper.js";
|
|
14
|
-
import "../../useIsServerSide.js";
|
|
15
|
-
import "../../LazyIcon.js";
|
|
16
|
-
import "../../component.js";
|
|
17
|
-
import "../../useIcons.js";
|
|
18
|
-
import "../../useBreakpoint.js";
|
|
19
|
-
import "../../useIsMobileBreakpoint.js";
|
|
20
|
-
import "../../ArrowRight.js";
|
|
21
|
-
import "../../Button.js";
|
|
22
|
-
import "../../accessibility.js";
|
|
23
|
-
import "../../useElementList.js";
|
|
24
|
-
import "../../useFocusableElements.js";
|
|
25
|
-
import "../../focus.js";
|
|
26
|
-
import "../../useFocusTrap.js";
|
|
27
|
-
import "../../useIntersectionObserver.js";
|
|
28
|
-
import "../../useIsVisible.js";
|
|
29
|
-
import "../../useKeyboardEvent.js";
|
|
30
|
-
import "../../useOutsideEvent.js";
|
|
31
|
-
import "../../X.js";
|
|
32
|
-
import "../../Close.js";
|
|
33
3
|
import { t as Drawer_default } from "../../Drawer.js";
|
|
34
|
-
import "../../deepContains.js";
|
|
35
|
-
import "../../useReturnFocusOnUnmount.js";
|
|
36
|
-
import "../../scroll.js";
|
|
37
|
-
import "../../Title.js";
|
|
38
|
-
import "../../Title2.js";
|
|
39
|
-
import React from "react";
|
|
40
4
|
import { jsx } from "react/jsx-runtime";
|
|
41
5
|
import styles from "./styles.module.scss";
|
|
42
6
|
var HN_Designsystem_HelpDrawer_nb_NO_default = { ariaLabel: "Hjelpetekst" };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HelpDrawer: React.FC<HelpDrawerProps>","mergedResources: HNDesignsystemHelpDrawer"],"sources":["../../../src/resources/HN.Designsystem.HelpDrawer.nb-NO.json","../../../src/components/HelpDrawer/resourceHelper.ts","../../../src/components/HelpDrawer/HelpDrawer.tsx","../../../src/components/HelpDrawer/index.ts"],"sourcesContent":["{\n \"ariaLabel\": \"Hjelpetekst\"\n}\n","import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.HelpDrawer.nb-NO.json';\nimport { HNDesignsystemHelpDrawer } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemHelpDrawer => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["HelpDrawer: React.FC<HelpDrawerProps>","mergedResources: HNDesignsystemHelpDrawer"],"sources":["../../../src/resources/HN.Designsystem.HelpDrawer.nb-NO.json","../../../src/components/HelpDrawer/resourceHelper.ts","../../../src/components/HelpDrawer/HelpDrawer.tsx","../../../src/components/HelpDrawer/index.ts"],"sourcesContent":["{\n \"ariaLabel\": \"Hjelpetekst\"\n}\n","import { LanguageLocales } from '../../constants';\nimport nbNO from '../../resources/HN.Designsystem.HelpDrawer.nb-NO.json';\nimport { HNDesignsystemHelpDrawer } from '../../resources/Resources';\n\nexport const getResources = (language: LanguageLocales): HNDesignsystemHelpDrawer => {\n switch (language) {\n case LanguageLocales.NORWEGIAN:\n default:\n return nbNO;\n }\n};\n","import type React from 'react';\n\nimport type { HNDesignsystemHelpDrawer } from '../../resources/Resources';\n\nimport { getResources } from './resourceHelper';\nimport { LanguageLocales } from '../../constants';\nimport { useLanguage } from '../../utils/language';\nimport Drawer, { type DrawerProps } from '../Drawer';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpDrawerProps extends Pick<\n DrawerProps,\n | 'ariaLabel'\n | 'ariaLabelledBy'\n | 'ariaLabelCloseBtn'\n | 'children'\n | 'isOpen'\n | 'onRequestClose'\n | 'title'\n | 'titleHtmlMarkup'\n | 'titleId'\n | 'zIndex'\n> {\n /** Resources for the component */\n resources?: Partial<HNDesignsystemHelpDrawer>;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst HelpDrawer: React.FC<HelpDrawerProps> = props => {\n const { resources, ...drawerProps } = props;\n const { language } = useLanguage<LanguageLocales>(LanguageLocales.NORWEGIAN);\n const defaultResources = getResources(language);\n const mergedResources: HNDesignsystemHelpDrawer = {\n ...defaultResources,\n ...resources,\n ariaLabel: props.ariaLabel ?? props.resources?.ariaLabel ?? defaultResources.ariaLabel,\n };\n\n return (\n <Drawer\n {...drawerProps}\n closeColor={'plum'}\n headerClasses={styles['help-drawer']}\n desktopDirection={'left'}\n ariaLabel={mergedResources.ariaLabel}\n />\n );\n};\n\nexport default HelpDrawer;\n","import HelpDrawer from './HelpDrawer';\nexport * from './HelpDrawer';\nexport default HelpDrawer;\n"],"mappings":";;;;;;ACIA,MAAa,gBAAgB,aAAwD;AACnF,SAAQ,UAAR;EACE,KAAK,gBAAgB;EACrB,QACE,QAAO;;;ACsBb,IAAMA,cAAwC,UAAS;CACrD,MAAM,EAAE,WAAW,GAAG,gBAAgB;CACtC,MAAM,EAAE,aAAa,YAA6B,gBAAgB,UAAU;CAC5E,MAAM,mBAAmB,aAAa,SAAS;CAC/C,MAAMC,kBAA4C;EAChD,GAAG;EACH,GAAG;EACH,WAAW,MAAM,aAAa,MAAM,WAAW,aAAa,iBAAiB;EAC9E;AAED,QACE,oBAAC,gBAAA;EACC,GAAI;EACJ,YAAY;EACZ,eAAe,OAAO;EACtB,kBAAkB;EAClB,WAAW,gBAAgB;GAC3B;;AC7CN,IAAA,qBDiDe"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { n as AnalyticsId } from "../../constants2.js";
|
|
2
|
-
import "../../usePrevious.js";
|
|
3
|
-
import "../../floating-ui.react.js";
|
|
4
2
|
import { t as useExpand } from "../../useExpand.js";
|
|
5
3
|
import { t as HelpDetails_default } from "../../HelpDetails.js";
|
|
6
4
|
import React from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/HelpExpanderInline/HelpExpanderInline.tsx","../../../src/components/HelpExpanderInline/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport HelpDetails from '../HelpDetails/HelpDetails';\n\nexport interface HelpExpanderInlineProps {\n /** Sets the text content of the help text that appears when expanded. */\n children: React.ReactNode;\n /** Ref for the element that triggers the HelpExpanderInline */\n controllerRef?: React.RefObject<HTMLButtonElement>;\n /** Expands the component */\n expanded?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Classname will be applied to the button element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst HelpExpanderInline = React.forwardRef<HTMLDivElement, HelpExpanderInlineProps>(\n ({ children, className, controllerRef, expanded = false, onExpand, testId }, ref) => {\n const [isExpanded] = useExpand(expanded, onExpand);\n\n return (\n isExpanded && (\n <div className={className} data-testid={testId} data-analyticsid={AnalyticsId.HelpExpanderInline} ref={ref}>\n <HelpDetails controllerRef={controllerRef}>{children}</HelpDetails>\n </div>\n )\n );\n }\n);\n\nHelpExpanderInline.displayName = 'HelpExpanderInline';\n\nexport default HelpExpanderInline;\n","import HelpExpanderInline from './HelpExpanderInline';\nexport * from './HelpExpanderInline';\nexport default HelpExpanderInline;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/HelpExpanderInline/HelpExpanderInline.tsx","../../../src/components/HelpExpanderInline/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport HelpDetails from '../HelpDetails/HelpDetails';\n\nexport interface HelpExpanderInlineProps {\n /** Sets the text content of the help text that appears when expanded. */\n children: React.ReactNode;\n /** Ref for the element that triggers the HelpExpanderInline */\n controllerRef?: React.RefObject<HTMLButtonElement>;\n /** Expands the component */\n expanded?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /** Classname will be applied to the button element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst HelpExpanderInline = React.forwardRef<HTMLDivElement, HelpExpanderInlineProps>(\n ({ children, className, controllerRef, expanded = false, onExpand, testId }, ref) => {\n const [isExpanded] = useExpand(expanded, onExpand);\n\n return (\n isExpanded && (\n <div className={className} data-testid={testId} data-analyticsid={AnalyticsId.HelpExpanderInline} ref={ref}>\n <HelpDetails controllerRef={controllerRef}>{children}</HelpDetails>\n </div>\n )\n );\n }\n);\n\nHelpExpanderInline.displayName = 'HelpExpanderInline';\n\nexport default HelpExpanderInline;\n","import HelpExpanderInline from './HelpExpanderInline';\nexport * from './HelpExpanderInline';\nexport default HelpExpanderInline;\n"],"mappings":";;;;;AAqBA,IAAM,qBAAqB,MAAM,YAC9B,EAAE,UAAU,WAAW,eAAe,WAAW,OAAO,UAAU,UAAU,QAAQ;CACnF,MAAM,CAAC,cAAc,UAAU,UAAU,SAAS;AAElD,QACE,cACE,oBAAC,OAAA;EAAe;EAAW,eAAa;EAAQ,oBAAkB,YAAY;EAAyB;YACrG,oBAAC,qBAAA;GAA2B;GAAgB;IAAuB;GAC/D;EAIb;AAED,mBAAmB,cAAc;ACjCjC,IAAA,6BDmCe"}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { a as IconSize, n as AnalyticsId } from "../../constants2.js";
|
|
2
2
|
import { t as usePseudoClasses } from "../../usePseudoClasses.js";
|
|
3
|
-
import "../../grid.js";
|
|
4
3
|
import { n as mergeRefs } from "../../refs.js";
|
|
5
4
|
import { t as Icon_default } from "../../Icon.js";
|
|
6
|
-
import "../../useBreakpoint.js";
|
|
7
|
-
import "../../useIsMobileBreakpoint.js";
|
|
8
5
|
import { n as getAriaLabelAttributes } from "../../accessibility.js";
|
|
9
|
-
import "../../usePrevious.js";
|
|
10
|
-
import "../../floating-ui.react.js";
|
|
11
6
|
import { t as ChevronDown_default } from "../../ChevronDown.js";
|
|
12
7
|
import { t as ChevronUp_default } from "../../ChevronUp.js";
|
|
13
8
|
import { t as useExpand } from "../../useExpand.js";
|
|
14
9
|
import { t as HelpDetails_default } from "../../HelpDetails.js";
|
|
15
|
-
import "../../HelpTriggerIcon.js";
|
|
16
10
|
import { t as HelpTriggerStandalone_default } from "../../HelpTriggerStandalone.js";
|
|
17
11
|
import React from "react";
|
|
18
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/HelpExpanderStandalone/HelpExpanderStandalone.tsx","../../../src/components/HelpExpanderStandalone/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { mergeRefs } from '../../utils/refs';\nimport HelpDetails from '../HelpDetails/HelpDetails';\nimport { HelpTriggerWeights } from '../HelpTriggerIcon/HelpTriggerIcon';\nimport HelpTriggerStandalone from '../HelpTriggerStandalone';\nimport Icon from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpExpanderStandaloneProps {\n /** Sets aria-label of the trigger. */\n ariaLabel?: string;\n /** Sets aria-labelledby of the trigger. */\n ariaLabelledById?: string;\n /** Sets the text content of the help text that appears when expanded. */\n children: React.ReactNode;\n /** Expands the component */\n expanded?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /**\n * Sets the colors of the help trigger. Default: normal.\n */\n weight?: HelpTriggerWeights;\n /**\n * Classname will be applied to the button element.\n */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** The text that will be displayed in the trigger. */\n triggerText: string;\n}\n\nconst HelpExpanderStandalone = React.forwardRef<HTMLButtonElement, HelpExpanderStandaloneProps>(\n ({ ariaLabel, ariaLabelledById, children, className, expanded = false, onExpand, testId, triggerText, weight = 'normal' }, ref) => {\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>);\n\n return (\n <div className={className} data-testid={testId} data-analyticsid={AnalyticsId.HelpExpanderStandalone}>\n <HelpTriggerStandalone\n className={styles['help-expander-standalone-trigger']}\n aria-expanded={isExpanded}\n onClick={(): void => setIsExpanded(!isExpanded)}\n ref={mergeRefs([ref, refObject])}\n weight={weight}\n {...ariaLabelAttributes}\n >\n {triggerText}\n <Icon\n color={`var(--core-color-plum-${isHovered ? '900' : '700'})`}\n svgIcon={isExpanded ? ChevronUp : ChevronDown}\n size={IconSize.XXSmall}\n />\n </HelpTriggerStandalone>\n {isExpanded && <HelpDetails>{children}</HelpDetails>}\n </div>\n );\n }\n);\n\nHelpExpanderStandalone.displayName = 'HelpExpanderStandalone';\n\nexport default HelpExpanderStandalone;\n","import HelpExpanderStandalone from './HelpExpanderStandalone';\nexport * from './HelpExpanderStandalone';\nexport default HelpExpanderStandalone;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/HelpExpanderStandalone/HelpExpanderStandalone.tsx","../../../src/components/HelpExpanderStandalone/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { AnalyticsId, IconSize } from '../../constants';\nimport { useExpand } from '../../hooks/useExpand';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { mergeRefs } from '../../utils/refs';\nimport HelpDetails from '../HelpDetails/HelpDetails';\nimport { HelpTriggerWeights } from '../HelpTriggerIcon/HelpTriggerIcon';\nimport HelpTriggerStandalone from '../HelpTriggerStandalone';\nimport Icon from '../Icon';\nimport ChevronDown from '../Icons/ChevronDown';\nimport ChevronUp from '../Icons/ChevronUp';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpExpanderStandaloneProps {\n /** Sets aria-label of the trigger. */\n ariaLabel?: string;\n /** Sets aria-labelledby of the trigger. */\n ariaLabelledById?: string;\n /** Sets the text content of the help text that appears when expanded. */\n children: React.ReactNode;\n /** Expands the component */\n expanded?: boolean;\n /** Called when expander is open/closed. */\n onExpand?: (isExpanded: boolean) => void;\n /**\n * Sets the colors of the help trigger. Default: normal.\n */\n weight?: HelpTriggerWeights;\n /**\n * Classname will be applied to the button element.\n */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** The text that will be displayed in the trigger. */\n triggerText: string;\n}\n\nconst HelpExpanderStandalone = React.forwardRef<HTMLButtonElement, HelpExpanderStandaloneProps>(\n ({ ariaLabel, ariaLabelledById, children, className, expanded = false, onExpand, testId, triggerText, weight = 'normal' }, ref) => {\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>);\n\n return (\n <div className={className} data-testid={testId} data-analyticsid={AnalyticsId.HelpExpanderStandalone}>\n <HelpTriggerStandalone\n className={styles['help-expander-standalone-trigger']}\n aria-expanded={isExpanded}\n onClick={(): void => setIsExpanded(!isExpanded)}\n ref={mergeRefs([ref, refObject])}\n weight={weight}\n {...ariaLabelAttributes}\n >\n {triggerText}\n <Icon\n color={`var(--core-color-plum-${isHovered ? '900' : '700'})`}\n svgIcon={isExpanded ? ChevronUp : ChevronDown}\n size={IconSize.XXSmall}\n />\n </HelpTriggerStandalone>\n {isExpanded && <HelpDetails>{children}</HelpDetails>}\n </div>\n );\n }\n);\n\nHelpExpanderStandalone.displayName = 'HelpExpanderStandalone';\n\nexport default HelpExpanderStandalone;\n","import HelpExpanderStandalone from './HelpExpanderStandalone';\nexport * from './HelpExpanderStandalone';\nexport default HelpExpanderStandalone;\n"],"mappings":";;;;;;;;;;;;;AAyCA,IAAM,yBAAyB,MAAM,YAClC,EAAE,WAAW,kBAAkB,UAAU,WAAW,WAAW,OAAO,UAAU,QAAQ,aAAa,SAAS,YAAY,QAAQ;CACjI,MAAM,sBAAsB,uBAAuB;EAAE,OAAO;EAAW,IAAI;EAAkB,CAAC;CAC9F,MAAM,CAAC,YAAY,iBAAiB,UAAU,UAAU,SAAS;CACjE,MAAM,EAAE,WAAW,cAAc,iBAAoC,IAA0C;AAE/G,QACE,qBAAC,OAAA;EAAe;EAAW,eAAa;EAAQ,oBAAkB,YAAY;aAC5E,qBAAC,+BAAA;GACC,WAAW,OAAO;GAClB,iBAAe;GACf,eAAqB,cAAc,CAAC,WAAW;GAC/C,KAAK,UAAU,CAAC,KAAK,UAAU,CAAC;GACxB;GACR,GAAI;cAEH,aACD,oBAAC,cAAA;IACC,OAAO,yBAAyB,YAAY,QAAQ,MAAM;IAC1D,SAAS,aAAa,oBAAY;IAClC,MAAM,SAAS;KACf,CAAA;IACoB,EACvB,cAAc,oBAAC,qBAAA,EAAa,UAAA,CAAuB,CAAA;GAChD;EAGX;AAED,uBAAuB,cAAc;ACpErC,IAAA,iCDsEe"}
|
|
@@ -1,44 +1,12 @@
|
|
|
1
|
-
import "../../uuid.js";
|
|
2
|
-
import "../../environment.js";
|
|
3
|
-
import "../../constants2.js";
|
|
4
|
-
import "../../usePseudoClasses.js";
|
|
5
|
-
import "../../grid.js";
|
|
6
|
-
import "../../palette.js";
|
|
7
|
-
import "../../spacers.js";
|
|
8
|
-
import "../../theme.js";
|
|
9
|
-
import "../../Icon.js";
|
|
10
|
-
import "../../_rolldown_dynamic_import_helper.js";
|
|
11
|
-
import "../../useIsServerSide.js";
|
|
12
|
-
import "../../LazyIcon.js";
|
|
13
|
-
import "../../useBreakpoint.js";
|
|
14
|
-
import "../../useElementList.js";
|
|
15
|
-
import "../../useFocusableElements.js";
|
|
16
|
-
import "../../useFocusToggle.js";
|
|
17
|
-
import "../../focus.js";
|
|
18
|
-
import "../../useFocusTrap.js";
|
|
19
|
-
import "../../useIntersectionObserver.js";
|
|
20
|
-
import "../../useIsVisible.js";
|
|
21
|
-
import "../../debounce.js";
|
|
22
|
-
import "../../useLayoutEvent.js";
|
|
23
|
-
import "../../usePrevious.js";
|
|
24
|
-
import "../../useSize.js";
|
|
25
|
-
import "../../useResizeObserver.js";
|
|
26
|
-
import "../../useToggle.js";
|
|
27
|
-
import "../../useKeyboardEvent.js";
|
|
28
|
-
import "../../useOutsideEvent.js";
|
|
29
|
-
import "../../mobile.js";
|
|
30
|
-
import "../../src.js";
|
|
31
|
-
import "../../Title.js";
|
|
32
|
-
import "../../Title2.js";
|
|
33
1
|
import { t as HighlightPanel_default } from "../../HighlightPanel.js";
|
|
34
2
|
import { t as HandWaving_default } from "../../HandWaving.js";
|
|
35
3
|
import React from "react";
|
|
36
|
-
import
|
|
4
|
+
import classNames from "classnames";
|
|
37
5
|
import { jsx } from "react/jsx-runtime";
|
|
38
6
|
import styles from "./styles.module.scss";
|
|
39
7
|
var HelpPanel = ({ className, variant = "normal", testId, children, title }) => {
|
|
40
8
|
return /* @__PURE__ */ jsx(HighlightPanel_default, {
|
|
41
|
-
className:
|
|
9
|
+
className: classNames([styles["help-panel"]], className),
|
|
42
10
|
testId,
|
|
43
11
|
svgIcon: HandWaving_default,
|
|
44
12
|
title,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HelpPanel: React.FC<HelpPanelProps>"],"sources":["../../../src/components/HelpPanel/HelpPanel.tsx","../../../src/components/HelpPanel/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport HighlightPanel from '../HighlightPanel';\nimport HandWaving from '../Icons/HandWaving';\n\nimport styles from './styles.module.scss';\n\nexport type HelpPanelVariants = 'normal' | 'compact';\n\nexport interface HelpPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** If set the compact styling will be used */\n variant?: HelpPanelVariants;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets title if needed */\n title?: string;\n}\n\nconst HelpPanel: React.FC<HelpPanelProps> = ({ className, variant = 'normal', testId, children, title }) => {\n return (\n <HighlightPanel\n className={classNames([styles['help-panel']], className)}\n testId={testId}\n svgIcon={HandWaving}\n title={title}\n variant={variant}\n >\n {children}\n </HighlightPanel>\n );\n};\n\nexport default HelpPanel;\n","import HelpPanel from './HelpPanel';\nexport * from './HelpPanel';\nexport default HelpPanel;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["HelpPanel: React.FC<HelpPanelProps>"],"sources":["../../../src/components/HelpPanel/HelpPanel.tsx","../../../src/components/HelpPanel/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport HighlightPanel from '../HighlightPanel';\nimport HandWaving from '../Icons/HandWaving';\n\nimport styles from './styles.module.scss';\n\nexport type HelpPanelVariants = 'normal' | 'compact';\n\nexport interface HelpPanelProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** If set the compact styling will be used */\n variant?: HelpPanelVariants;\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Sets title if needed */\n title?: string;\n}\n\nconst HelpPanel: React.FC<HelpPanelProps> = ({ className, variant = 'normal', testId, children, title }) => {\n return (\n <HighlightPanel\n className={classNames([styles['help-panel']], className)}\n testId={testId}\n svgIcon={HandWaving}\n title={title}\n variant={variant}\n >\n {children}\n </HighlightPanel>\n );\n};\n\nexport default HelpPanel;\n","import HelpPanel from './HelpPanel';\nexport * from './HelpPanel';\nexport default HelpPanel;\n"],"mappings":";;;;;;AAwBA,IAAMA,aAAuC,EAAE,WAAW,UAAU,UAAU,QAAQ,UAAU,YAAY;AAC1G,QACE,oBAAC,wBAAA;EACC,WAAW,WAAW,CAAC,OAAO,cAAc,EAAE,UAAU;EAChD;EACR,SAAS;EACF;EACE;EAER;GACc;;AChCrB,IAAA,oBDoCe"}
|
|
@@ -5,6 +5,8 @@ import { TitleTags } from '../Title';
|
|
|
5
5
|
export interface HelpTeaserProps {
|
|
6
6
|
/** What's in the box? */
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
/** Override the default max height for collapsed teaser. Default is 12.25rem */
|
|
9
|
+
collapsedMaxHeight?: string;
|
|
8
10
|
/** Changes the underlying element of the wrapper */
|
|
9
11
|
htmlMarkup?: InfoTeaserTags;
|
|
10
12
|
/** Resources for component */
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import "../../constants2.js";
|
|
2
|
-
import "../../Icon.js";
|
|
3
|
-
import "../../language.js";
|
|
4
|
-
import "../../_rolldown_dynamic_import_helper.js";
|
|
5
|
-
import "../../useIsServerSide.js";
|
|
6
|
-
import "../../LazyIcon.js";
|
|
7
|
-
import "../../Title.js";
|
|
8
|
-
import "../../Title2.js";
|
|
9
1
|
import { t as HandWaving_default } from "../../HandWaving.js";
|
|
10
2
|
import { t as InfoTeaser_default } from "../../InfoTeaser.js";
|
|
11
3
|
import React from "react";
|
|
12
4
|
import { jsx } from "react/jsx-runtime";
|
|
13
5
|
import styles from "./styles.module.scss";
|
|
14
6
|
var HelpTeaser = (props) => {
|
|
15
|
-
const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup } = props;
|
|
7
|
+
const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup, collapsedMaxHeight } = props;
|
|
16
8
|
return /* @__PURE__ */ jsx(InfoTeaser_default, {
|
|
17
9
|
testId,
|
|
18
10
|
htmlMarkup,
|
|
@@ -22,6 +14,7 @@ var HelpTeaser = (props) => {
|
|
|
22
14
|
resources,
|
|
23
15
|
svgIcon: HandWaving_default,
|
|
24
16
|
buttonClassName: styles["helpteaser__button"],
|
|
17
|
+
collapsedMaxHeight,
|
|
25
18
|
children
|
|
26
19
|
});
|
|
27
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HelpTeaser: React.FC<HelpTeaserProps>"],"sources":["../../../src/components/HelpTeaser/HelpTeaser.tsx","../../../src/components/HelpTeaser/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { HNDesignsystemInfoTeaser } from '../../resources/Resources';\nimport HandWaving from '../Icons/HandWaving';\nimport InfoTeaser, { InfoTeaserTags } from '../InfoTeaser';\nimport { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTeaserProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Changes the underlying element of the wrapper */\n htmlMarkup?: InfoTeaserTags;\n /** Resources for component */\n resources?: Partial<HNDesignsystemInfoTeaser>;\n /** Sets the data-testid attribute */\n testId?: string;\n /** Title on top of the component */\n title: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\nconst HelpTeaser: React.FC<HelpTeaserProps> = props => {\n const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup } = props;\n return (\n <InfoTeaser\n testId={testId}\n htmlMarkup={htmlMarkup}\n className={styles.helpteaser}\n title={title}\n titleHtmlMarkup={titleHtmlMarkup}\n resources={resources}\n svgIcon={HandWaving}\n buttonClassName={styles['helpteaser__button']}\n >\n {children}\n </InfoTeaser>\n );\n};\n\nexport default HelpTeaser;\n","import HelpTeaser from './HelpTeaser';\nexport * from './HelpTeaser';\nexport default HelpTeaser;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["HelpTeaser: React.FC<HelpTeaserProps>"],"sources":["../../../src/components/HelpTeaser/HelpTeaser.tsx","../../../src/components/HelpTeaser/index.ts"],"sourcesContent":["import React from 'react';\n\nimport { HNDesignsystemInfoTeaser } from '../../resources/Resources';\nimport HandWaving from '../Icons/HandWaving';\nimport InfoTeaser, { InfoTeaserTags } from '../InfoTeaser';\nimport { TitleTags } from '../Title';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTeaserProps {\n /** What's in the box? */\n children: React.ReactNode;\n /** Override the default max height for collapsed teaser. Default is 12.25rem */\n collapsedMaxHeight?: string;\n /** Changes the underlying element of the wrapper */\n htmlMarkup?: InfoTeaserTags;\n /** Resources for component */\n resources?: Partial<HNDesignsystemInfoTeaser>;\n /** Sets the data-testid attribute */\n testId?: string;\n /** Title on top of the component */\n title: string;\n /** Markup props for title */\n titleHtmlMarkup?: TitleTags;\n}\n\nconst HelpTeaser: React.FC<HelpTeaserProps> = props => {\n const { children, htmlMarkup, resources, testId, title, titleHtmlMarkup, collapsedMaxHeight } = props;\n return (\n <InfoTeaser\n testId={testId}\n htmlMarkup={htmlMarkup}\n className={styles.helpteaser}\n title={title}\n titleHtmlMarkup={titleHtmlMarkup}\n resources={resources}\n svgIcon={HandWaving}\n buttonClassName={styles['helpteaser__button']}\n collapsedMaxHeight={collapsedMaxHeight}\n >\n {children}\n </InfoTeaser>\n );\n};\n\nexport default HelpTeaser;\n","import HelpTeaser from './HelpTeaser';\nexport * from './HelpTeaser';\nexport default HelpTeaser;\n"],"mappings":";;;;;AA0BA,IAAMA,cAAwC,UAAS;CACrD,MAAM,EAAE,UAAU,YAAY,WAAW,QAAQ,OAAO,iBAAiB,uBAAuB;AAChG,QACE,oBAAC,oBAAA;EACS;EACI;EACZ,WAAW,OAAO;EACX;EACU;EACN;EACX,SAAS;EACT,iBAAiB,OAAO;EACJ;EAEnB;GACU;;ACvCjB,IAAA,qBD2Ce"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "../../constants2.js";
|
|
2
|
-
import "../../accessibility.js";
|
|
3
1
|
import { t as DictionaryTrigger_default } from "../../DictionaryTrigger.js";
|
|
4
2
|
import { a as useDismiss, c as useHover, l as useInteractions, n as FloatingDelayGroup, o as useFloating, s as useFocus } from "../../floating-ui.react.js";
|
|
5
3
|
import { t as PopOver_default } from "../../PopOver.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HelpTooltip: React.FC<HelpTooltipProps>"],"sources":["../../../src/components/HelpTooltip/HelpTooltip.tsx","../../../src/components/HelpTooltip/index.ts"],"sourcesContent":["import React, { useState, useRef, useId } from 'react';\n\nimport { useFloating, useHover, useFocus, useDismiss, useInteractions, FloatingDelayGroup } from '@floating-ui/react';\n\nimport DictionaryTrigger from '../DictionaryTrigger';\nimport PopOver from '../PopOver';\n\nexport interface HelpTooltipProps {\n /** Ordet som skal ha en tilhørende tooltip. Det skal bare sendes inn string som children. Er satt til ReactNode for å kunne brukes i CMSet. */\n children: React.ReactNode;\n /** Teksten som skal vises i boblen som åpnes */\n description: React.ReactNode;\n /** Valgfri test-id */\n testId?: string;\n}\n\nexport const HelpTooltip: React.FC<HelpTooltipProps> = ({ children, description, testId }) => {\n const popoverId = useId();\n const [showTooltip, setShowTooltip] = useState(false);\n\n const wordRef = useRef<HTMLButtonElement>(null);\n const { refs, context } = useFloating({\n open: showTooltip,\n elements: {\n reference: wordRef.current,\n },\n onOpenChange: setShowTooltip,\n });\n\n const hover = useHover(context, { move: false });\n const focus = useFocus(context);\n const dismiss = useDismiss(context);\n\n const { getReferenceProps } = useInteractions([hover, focus, dismiss]);\n\n return (\n <>\n <DictionaryTrigger ref={wordRef} {...getReferenceProps()} selected={showTooltip} aria-describedby={popoverId} data-testid={testId}>\n {children}\n </DictionaryTrigger>\n <PopOver role=\"tooltip\" ref={refs.setFloating} id={popoverId} show={showTooltip} testId={testId} controllerRef={wordRef}>\n {description}\n </PopOver>\n </>\n );\n};\n\nexport const HelpTooltipDelayGroup = FloatingDelayGroup;\n\nexport default HelpTooltip;\n","import HelpTooltip from './HelpTooltip';\nexport * from './HelpTooltip';\nexport default HelpTooltip;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["HelpTooltip: React.FC<HelpTooltipProps>"],"sources":["../../../src/components/HelpTooltip/HelpTooltip.tsx","../../../src/components/HelpTooltip/index.ts"],"sourcesContent":["import React, { useState, useRef, useId } from 'react';\n\nimport { useFloating, useHover, useFocus, useDismiss, useInteractions, FloatingDelayGroup } from '@floating-ui/react';\n\nimport DictionaryTrigger from '../DictionaryTrigger';\nimport PopOver from '../PopOver';\n\nexport interface HelpTooltipProps {\n /** Ordet som skal ha en tilhørende tooltip. Det skal bare sendes inn string som children. Er satt til ReactNode for å kunne brukes i CMSet. */\n children: React.ReactNode;\n /** Teksten som skal vises i boblen som åpnes */\n description: React.ReactNode;\n /** Valgfri test-id */\n testId?: string;\n}\n\nexport const HelpTooltip: React.FC<HelpTooltipProps> = ({ children, description, testId }) => {\n const popoverId = useId();\n const [showTooltip, setShowTooltip] = useState(false);\n\n const wordRef = useRef<HTMLButtonElement>(null);\n const { refs, context } = useFloating({\n open: showTooltip,\n elements: {\n reference: wordRef.current,\n },\n onOpenChange: setShowTooltip,\n });\n\n const hover = useHover(context, { move: false });\n const focus = useFocus(context);\n const dismiss = useDismiss(context);\n\n const { getReferenceProps } = useInteractions([hover, focus, dismiss]);\n\n return (\n <>\n <DictionaryTrigger ref={wordRef} {...getReferenceProps()} selected={showTooltip} aria-describedby={popoverId} data-testid={testId}>\n {children}\n </DictionaryTrigger>\n <PopOver role=\"tooltip\" ref={refs.setFloating} id={popoverId} show={showTooltip} testId={testId} controllerRef={wordRef}>\n {description}\n </PopOver>\n </>\n );\n};\n\nexport const HelpTooltipDelayGroup = FloatingDelayGroup;\n\nexport default HelpTooltip;\n","import HelpTooltip from './HelpTooltip';\nexport * from './HelpTooltip';\nexport default HelpTooltip;\n"],"mappings":";;;;;AAgBA,MAAaA,eAA2C,EAAE,UAAU,aAAa,aAAa;CAC5F,MAAM,YAAY,OAAO;CACzB,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CAErD,MAAM,UAAU,OAA0B,KAAK;CAC/C,MAAM,EAAE,MAAM,YAAY,YAAY;EACpC,MAAM;EACN,UAAU,EACR,WAAW,QAAQ,SACpB;EACD,cAAc;EACf,CAAC;CAMF,MAAM,EAAE,sBAAsB,gBAAgB;EAJhC,SAAS,SAAS,EAAE,MAAM,OAAO,CAAC;EAClC,SAAS,QAAQ;EACf,WAAW,QAAQ;EAEkC,CAAC;AAEtE,QACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,2BAAA;EAAkB,KAAK;EAAS,GAAI,mBAAmB;EAAE,UAAU;EAAa,oBAAkB;EAAW,eAAa;EACxH;GACiB,EACpB,oBAAC,iBAAA;EAAQ,MAAK;EAAU,KAAK,KAAK;EAAa,IAAI;EAAW,MAAM;EAAqB;EAAQ,eAAe;YAC7G;GACO,CAAA,EAAA,CACT;;AAIP,MAAa,wBAAwB;AC7CrC,IAAA,sBD+Ce"}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import "../../constants2.js";
|
|
2
|
-
import "../../usePseudoClasses.js";
|
|
3
|
-
import "../../refs.js";
|
|
4
|
-
import "../../accessibility.js";
|
|
5
1
|
import { n as HelpTriggerIconInternal, t as HelpTriggerIcon_default } from "../../HelpTriggerIcon.js";
|
|
6
2
|
export { HelpTriggerIconInternal, HelpTriggerIcon_default as default };
|
|
@@ -4,7 +4,7 @@ import { n as mergeRefs } from "../../refs.js";
|
|
|
4
4
|
import { n as getAriaLabelAttributes } from "../../accessibility.js";
|
|
5
5
|
import { n as HelpTriggerIconInternal } from "../../HelpTriggerIcon.js";
|
|
6
6
|
import React from "react";
|
|
7
|
-
import
|
|
7
|
+
import classNames from "classnames";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import styles from "./styles.module.scss";
|
|
10
10
|
var HelpTriggerInline = React.forwardRef(({ ariaLabel, ariaLabelledById, children, className, testId, weight = "normal", ...rest }, ref) => {
|
|
@@ -12,7 +12,7 @@ var HelpTriggerInline = React.forwardRef(({ ariaLabel, ariaLabelledById, childre
|
|
|
12
12
|
label: ariaLabel,
|
|
13
13
|
id: ariaLabelledById
|
|
14
14
|
});
|
|
15
|
-
const helpTriggerInlineStyles =
|
|
15
|
+
const helpTriggerInlineStyles = classNames(styles["help-trigger-inline"], className);
|
|
16
16
|
const { refObject, isHovered } = usePseudoClasses(ref);
|
|
17
17
|
return /* @__PURE__ */ jsxs("button", {
|
|
18
18
|
"aria-label": ariaLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/HelpTriggerInline/HelpTriggerInline.tsx","../../../src/components/HelpTriggerInline/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { mergeRefs } from '../../utils/refs';\nimport { HelpTriggerIconInternal, HelpTriggerWeights } from '../HelpTriggerIcon';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTriggerInlineProps
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/HelpTriggerInline/HelpTriggerInline.tsx","../../../src/components/HelpTriggerInline/index.ts"],"sourcesContent":["import React from 'react';\n\nimport classNames from 'classnames';\n\nimport { AnalyticsId } from '../../constants';\nimport { usePseudoClasses } from '../../hooks/usePseudoClasses';\nimport { getAriaLabelAttributes } from '../../utils/accessibility';\nimport { mergeRefs } from '../../utils/refs';\nimport { HelpTriggerIconInternal, type HelpTriggerWeights } from '../HelpTriggerIcon';\n\nimport styles from './styles.module.scss';\n\nexport interface HelpTriggerInlineProps extends Pick<\n React.InputHTMLAttributes<HTMLButtonElement>,\n 'onClick' | 'aria-haspopup' | 'aria-controls' | 'aria-expanded'\n> {\n /**\n * Sets aria-label of the trigger. ariaLabel or ariaLabelledById MUST be set!\n */\n ariaLabel?: string;\n /**\n * Sets aria-labelledby of the trigger. ariaLabel or ariaLabelledById MUST be set!\n */\n ariaLabelledById?: string;\n /** Sets the text content of the HelpTriggerInline. */\n children: string;\n /**\n * Sets the colors of the help trigger. Default: normal.\n */\n weight?: HelpTriggerWeights;\n /**\n * Classname will be applied to the button element.\n */\n className?: string;\n /**\n * Optional test id.\n */\n testId?: string;\n}\n\nconst HelpTriggerInline = React.forwardRef<HTMLButtonElement, HelpTriggerInlineProps>(\n ({ ariaLabel, ariaLabelledById, children, className, testId, weight = 'normal', ...rest }, ref) => {\n const ariaLabelAttributes = getAriaLabelAttributes({ label: ariaLabel, id: ariaLabelledById });\n const helpTriggerInlineStyles = classNames(styles['help-trigger-inline'], className);\n const { refObject, isHovered } = usePseudoClasses<HTMLButtonElement>(ref as React.RefObject<HTMLButtonElement>);\n\n return (\n <button\n aria-label={ariaLabel}\n type=\"button\"\n data-testid={testId}\n data-analyticsid={AnalyticsId.HelpTriggerInline}\n className={helpTriggerInlineStyles}\n ref={mergeRefs([refObject, ref])}\n {...ariaLabelAttributes}\n {...rest}\n >\n <span className={styles['help-trigger-inline__text']}>{children}</span>\n <HelpTriggerIconInternal weight={weight} size={'inherit'} htmlMarkup={'span'} isHovered={isHovered} />\n </button>\n );\n }\n);\n\nHelpTriggerInline.displayName = 'HelpTriggerInline';\n\nexport default HelpTriggerInline;\n","import HelpTriggerInline from './HelpTriggerInline';\nexport * from './HelpTriggerInline';\nexport default HelpTriggerInline;\n"],"mappings":";;;;;;;;;AAwCA,IAAM,oBAAoB,MAAM,YAC7B,EAAE,WAAW,kBAAkB,UAAU,WAAW,QAAQ,SAAS,UAAU,GAAG,QAAQ,QAAQ;CACjG,MAAM,sBAAsB,uBAAuB;EAAE,OAAO;EAAW,IAAI;EAAkB,CAAC;CAC9F,MAAM,0BAA0B,WAAW,OAAO,wBAAwB,UAAU;CACpF,MAAM,EAAE,WAAW,cAAc,iBAAoC,IAA0C;AAE/G,QACE,qBAAC,UAAA;EACC,cAAY;EACZ,MAAK;EACL,eAAa;EACb,oBAAkB,YAAY;EAC9B,WAAW;EACX,KAAK,UAAU,CAAC,WAAW,IAAI,CAAC;EAChC,GAAI;EACJ,GAAI;aAEJ,oBAAC,QAAA;GAAK,WAAW,OAAO;GAA+B;IAAgB,EACvE,oBAAC,yBAAA;GAAgC;GAAQ,MAAM;GAAW,YAAY;GAAmB;IAAa,CAAA;GAC/F;EAGd;AAED,kBAAkB,cAAc;AC9DhC,IAAA,4BDgEe"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import "../../constants2.js";
|
|
2
|
-
import "../../usePseudoClasses.js";
|
|
3
|
-
import "../../grid.js";
|
|
4
|
-
import "../../refs.js";
|
|
5
|
-
import "../../useBreakpoint.js";
|
|
6
|
-
import "../../useIsMobileBreakpoint.js";
|
|
7
|
-
import "../../accessibility.js";
|
|
8
|
-
import "../../HelpTriggerIcon.js";
|
|
9
1
|
import { t as HelpTriggerStandalone_default } from "../../HelpTriggerStandalone.js";
|
|
10
2
|
export { HelpTriggerStandalone_default as default };
|