@fremtind/jokul 0.22.1 → 0.22.3
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/build/build-stats.html +1 -1
- package/build/cjs/components/menu/MenuItemCheckbox.js +1 -1
- package/build/cjs/components/menu/MenuItemCheckbox.js.map +1 -1
- package/build/components/ScreenReaderOnly.d.ts +6 -0
- package/build/components/accordion/Accordion.d.ts +8 -0
- package/build/components/accordion/AccordionItem.d.ts +10 -0
- package/build/components/accordion/index.d.ts +4 -0
- package/build/components/breadcrumb/Breadcrumb.d.ts +6 -0
- package/build/components/breadcrumb/BreadcrumbItem.d.ts +10 -0
- package/build/components/breadcrumb/index.d.ts +4 -0
- package/build/components/button/Button.d.ts +7 -0
- package/build/components/button/index.d.ts +2 -0
- package/build/components/button/types.d.ts +43 -0
- package/build/components/card/Card.d.ts +37 -0
- package/build/components/card/CardImage.d.ts +19 -0
- package/build/components/card/InfoCard.d.ts +13 -0
- package/build/components/card/NavCard.d.ts +35 -0
- package/build/components/card/TaskCard.d.ts +23 -0
- package/build/components/card/documentation/examples/FakturainfoExample.d.ts +4 -0
- package/build/components/card/documentation/examples/InfoCardExample.d.ts +3 -0
- package/build/components/card/documentation/examples/NavCardExample.d.ts +3 -0
- package/build/components/card/documentation/examples/StatuskortExample.d.ts +4 -0
- package/build/components/card/documentation/examples/TaskCardExample.d.ts +3 -0
- package/build/components/card/documentation/examples/TopExample.d.ts +3 -0
- package/build/components/card/documentation/examples/cardExampleProps.d.ts +13 -0
- package/build/components/card/index.d.ts +9 -0
- package/build/components/card/types.d.ts +44 -0
- package/build/components/card/utils.d.ts +3 -0
- package/build/components/checkbox/Checkbox.d.ts +17 -0
- package/build/components/checkbox/index.d.ts +2 -0
- package/build/components/combobox/Combobox.d.ts +39 -0
- package/build/components/combobox/index.d.ts +2 -0
- package/build/components/cookie-consent/CookieConsent.d.ts +6 -0
- package/build/components/cookie-consent/CookieConsentContext.d.ts +48 -0
- package/build/components/cookie-consent/CookieConsentModal.d.ts +3 -0
- package/build/components/cookie-consent/consents/CustomConsents.d.ts +9 -0
- package/build/components/cookie-consent/consents/DefaultConsents.d.ts +9 -0
- package/build/components/cookie-consent/consents/RequirementCheckbox.d.ts +9 -0
- package/build/components/cookie-consent/cookieConsentUtils.d.ts +23 -0
- package/build/components/cookie-consent/index.d.ts +5 -0
- package/build/components/cookie-consent/types.d.ts +12 -0
- package/build/components/datepicker/DatePicker.d.ts +3 -0
- package/build/components/datepicker/index.d.ts +4 -0
- package/build/components/datepicker/internal/Calendar.d.ts +17 -0
- package/build/components/datepicker/internal/calendarReducer.d.ts +18 -0
- package/build/components/datepicker/internal/useCalendar.d.ts +59 -0
- package/build/components/datepicker/internal/utils.d.ts +167 -0
- package/build/components/datepicker/types.d.ts +269 -0
- package/build/components/datepicker/utils.d.ts +23 -0
- package/build/components/datepicker/validation.d.ts +11 -0
- package/build/components/description-list/DescriptionList.d.ts +14 -0
- package/build/components/description-list/index.d.ts +1 -0
- package/build/components/expander/ExpandSection.d.ts +22 -0
- package/build/components/expander/Expander.d.ts +28 -0
- package/build/components/expander/index.d.ts +4 -0
- package/build/components/feedback/Feedback.d.ts +50 -0
- package/build/components/feedback/FeedbackSuccess.d.ts +3 -0
- package/build/components/feedback/FeedbackValues.d.ts +6 -0
- package/build/components/feedback/feedbackContext.d.ts +20 -0
- package/build/components/feedback/followup/Followup.d.ts +14 -0
- package/build/components/feedback/followup/followupContext.d.ts +9 -0
- package/build/components/feedback/followup/useFollowup.d.ts +19 -0
- package/build/components/feedback/index.d.ts +3 -0
- package/build/components/feedback/main-question/MainQuestion.d.ts +16 -0
- package/build/components/feedback/main-question/mainQuestionContext.d.ts +9 -0
- package/build/components/feedback/main-question/useMainQuestion.d.ts +13 -0
- package/build/components/feedback/presets.d.ts +6 -0
- package/build/components/feedback/questions/AddonQuestion.d.ts +7 -0
- package/build/components/feedback/questions/CheckboxQuestion.d.ts +3 -0
- package/build/components/feedback/questions/ContactQuestion.d.ts +28 -0
- package/build/components/feedback/questions/RadioQuestion.d.ts +3 -0
- package/build/components/feedback/questions/SmileyQuestion.d.ts +3 -0
- package/build/components/feedback/questions/TextQuestion.d.ts +3 -0
- package/build/components/feedback/questions/index.d.ts +6 -0
- package/build/components/feedback/questions/smileyUtils.d.ts +4 -0
- package/build/components/feedback/types.d.ts +86 -0
- package/build/components/feedback/utils.d.ts +4 -0
- package/build/components/flex/Flex.d.ts +14 -0
- package/build/components/flex/index.d.ts +1 -0
- package/build/components/icon/Icon.d.ts +24 -0
- package/build/components/icon/documentation/internal/AnimatedIcon.d.ts +7 -0
- package/build/components/icon/documentation/internal/IconExample.d.ts +7 -0
- package/build/components/icon/documentation/internal/IconsExampleGrid.d.ts +8 -0
- package/build/components/icon/icons/ArrowDownIcon.d.ts +2 -0
- package/build/components/icon/icons/ArrowLeftIcon.d.ts +2 -0
- package/build/components/icon/icons/ArrowNorthEastIcon.d.ts +2 -0
- package/build/components/icon/icons/ArrowRightIcon.d.ts +2 -0
- package/build/components/icon/icons/ArrowUpIcon.d.ts +2 -0
- package/build/components/icon/icons/CalendarIcon.d.ts +2 -0
- package/build/components/icon/icons/CheckIcon.d.ts +2 -0
- package/build/components/icon/icons/ChevronDownIcon.d.ts +2 -0
- package/build/components/icon/icons/ChevronLeftIcon.d.ts +2 -0
- package/build/components/icon/icons/ChevronRightIcon.d.ts +2 -0
- package/build/components/icon/icons/ChevronUpIcon.d.ts +2 -0
- package/build/components/icon/icons/CloseIcon.d.ts +2 -0
- package/build/components/icon/icons/CopyIcon.d.ts +2 -0
- package/build/components/icon/icons/DotsIcon.d.ts +2 -0
- package/build/components/icon/icons/DragIcon.d.ts +2 -0
- package/build/components/icon/icons/ErrorIcon.d.ts +2 -0
- package/build/components/icon/icons/GreenCheckIcon.d.ts +3 -0
- package/build/components/icon/icons/HamburgerIcon.d.ts +2 -0
- package/build/components/icon/icons/InfoIcon.d.ts +2 -0
- package/build/components/icon/icons/LinkIcon.d.ts +2 -0
- package/build/components/icon/icons/MinusIcon.d.ts +2 -0
- package/build/components/icon/icons/PenIcon.d.ts +2 -0
- package/build/components/icon/icons/PlusIcon.d.ts +2 -0
- package/build/components/icon/icons/QuestionIcon.d.ts +2 -0
- package/build/components/icon/icons/RedCrossIcon.d.ts +3 -0
- package/build/components/icon/icons/SearchIcon.d.ts +2 -0
- package/build/components/icon/icons/SuccessIcon.d.ts +2 -0
- package/build/components/icon/icons/ThumbDownIcon.d.ts +2 -0
- package/build/components/icon/icons/ThumbUpIcon.d.ts +2 -0
- package/build/components/icon/icons/TrashCanIcon.d.ts +2 -0
- package/build/components/icon/icons/WarningIcon.d.ts +2 -0
- package/build/components/icon/icons/animated/ArrowHorizontalAnimated.d.ts +9 -0
- package/build/components/icon/icons/animated/ArrowVerticalAnimated.d.ts +9 -0
- package/build/components/icon/icons/animated/PlusRemoveAnimated.d.ts +9 -0
- package/build/components/icon/index.d.ts +39 -0
- package/build/components/icon/types.d.ts +19 -0
- package/build/components/icon-button/IconButton.d.ts +6 -0
- package/build/components/icon-button/index.d.ts +2 -0
- package/build/components/image/Image.d.ts +13 -0
- package/build/components/image/documentation/internal/props.d.ts +5 -0
- package/build/components/image/index.d.ts +3 -0
- package/build/components/image/useImageLoadingStatus.d.ts +2 -0
- package/build/components/index.d.ts +39 -0
- package/build/components/input-group/FieldGroup.d.ts +16 -0
- package/build/components/input-group/InputGroup.d.ts +40 -0
- package/build/components/input-group/Label.d.ts +14 -0
- package/build/components/input-group/SupportLabel.d.ts +61 -0
- package/build/components/input-group/index.d.ts +4 -0
- package/build/components/link/Link.d.ts +7 -0
- package/build/components/link/NavLink.d.ts +8 -0
- package/build/components/link/index.d.ts +2 -0
- package/build/components/link-list/LinkList.d.ts +16 -0
- package/build/components/link-list/index.d.ts +1 -0
- package/build/components/list/List.d.ts +8 -0
- package/build/components/list/ListItem.d.ts +8 -0
- package/build/components/list/index.d.ts +3 -0
- package/build/components/loader/Loader.d.ts +16 -0
- package/build/components/loader/index.d.ts +18 -0
- package/build/components/loader/skeletons/SkeletonAnimation.d.ts +16 -0
- package/build/components/loader/skeletons/SkeletonButton.d.ts +7 -0
- package/build/components/loader/skeletons/SkeletonCheckboxGroup.d.ts +12 -0
- package/build/components/loader/skeletons/SkeletonElement.d.ts +8 -0
- package/build/components/loader/skeletons/SkeletonInput.d.ts +11 -0
- package/build/components/loader/skeletons/SkeletonLabel.d.ts +8 -0
- package/build/components/loader/skeletons/SkeletonRadioButtonGroup.d.ts +12 -0
- package/build/components/loader/skeletons/SkeletonTable.d.ts +19 -0
- package/build/components/loader/skeletons/SkeletonTextArea.d.ts +11 -0
- package/build/components/loader/useDelayedRender.d.ts +1 -0
- package/build/components/logo/Logo.d.ts +15 -0
- package/build/components/logo/LogoStamp.d.ts +16 -0
- package/build/components/logo/index.d.ts +5 -0
- package/build/components/logo/text-paths/ForsikringLevertAvFremtind.d.ts +2 -0
- package/build/components/logo/text-paths/FraSB1ogDNB.d.ts +2 -0
- package/build/components/logo/text-paths/InnovasjonFraFremtind.d.ts +2 -0
- package/build/components/logo/text-paths/TeknologiFraFremtind.d.ts +2 -0
- package/build/components/logo/text-paths/VartEgetForsikringsselskap.d.ts +2 -0
- package/build/components/logo/text-paths/VartForsikringsselskap.d.ts +2 -0
- package/build/components/logo/text-paths/index.d.ts +6 -0
- package/build/components/logo/useTextSpinner.d.ts +5 -0
- package/build/components/menu/Menu.d.ts +39 -0
- package/build/components/menu/MenuDivider.d.ts +2 -0
- package/build/components/menu/MenuItem.d.ts +25 -0
- package/build/components/menu/MenuItemCheckbox.d.ts +11 -0
- package/build/components/menu/index.d.ts +4 -0
- package/build/components/menu/useMenuWideEvents.d.ts +6 -0
- package/build/components/message/DismissButton.d.ts +5 -0
- package/build/components/message/FormErrorMessage.d.ts +14 -0
- package/build/components/message/Message.d.ts +19 -0
- package/build/components/message/index.d.ts +2 -0
- package/build/components/modal/Modal.d.ts +72 -0
- package/build/components/modal/index.d.ts +4 -0
- package/build/components/modal/useModal.d.ts +69 -0
- package/build/components/pagination/PageButton.d.ts +7 -0
- package/build/components/pagination/Pagination.d.ts +18 -0
- package/build/components/pagination/index.d.ts +1 -0
- package/build/components/popover/Popover.d.ts +154 -0
- package/build/components/popover/index.d.ts +1 -0
- package/build/components/progress-bar/Countdown.d.ts +12 -0
- package/build/components/progress-bar/ProgressBar.d.ts +22 -0
- package/build/components/progress-bar/index.d.ts +4 -0
- package/build/components/radio-button/BaseRadioButton.d.ts +10 -0
- package/build/components/radio-button/RadioButton.d.ts +15 -0
- package/build/components/radio-button/RadioButtonGroup.d.ts +24 -0
- package/build/components/radio-button/index.d.ts +6 -0
- package/build/components/radio-button/radioGroupContext.d.ts +16 -0
- package/build/components/select/NativeSelect.d.ts +19 -0
- package/build/components/select/Select.d.ts +53 -0
- package/build/components/select/index.d.ts +4 -0
- package/build/components/select/select-utils.d.ts +2 -0
- package/build/components/summary-table/SummaryTable.d.ts +9 -0
- package/build/components/summary-table/SummaryTableRow.d.ts +7 -0
- package/build/components/summary-table/index.d.ts +2 -0
- package/build/components/summary-table/mocks/index.d.ts +10 -0
- package/build/components/system-message/SystemMessage.d.ts +21 -0
- package/build/components/system-message/common/DismissButton.d.ts +5 -0
- package/build/components/system-message/common/MessageIcon.d.ts +7 -0
- package/build/components/system-message/index.d.ts +1 -0
- package/build/components/table/DataTable.d.ts +18 -0
- package/build/components/table/ExpandableTableRow.d.ts +17 -0
- package/build/components/table/ExpandableTableRowController.d.ts +10 -0
- package/build/components/table/Table.d.ts +11 -0
- package/build/components/table/TableBody.d.ts +5 -0
- package/build/components/table/TableCaption.d.ts +7 -0
- package/build/components/table/TableCell.d.ts +17 -0
- package/build/components/table/TableColumn.d.ts +5 -0
- package/build/components/table/TableColumnGroup.d.ts +5 -0
- package/build/components/table/TableFooter.d.ts +5 -0
- package/build/components/table/TableHead.d.ts +7 -0
- package/build/components/table/TableHeader.d.ts +22 -0
- package/build/components/table/TablePagination.d.ts +43 -0
- package/build/components/table/TableRow.d.ts +15 -0
- package/build/components/table/index.d.ts +34 -0
- package/build/components/table/tableContext.d.ts +12 -0
- package/build/components/table/tableSectionContext.d.ts +13 -0
- package/build/components/table/utils.d.ts +10 -0
- package/build/components/tabs/NavTab.d.ts +25 -0
- package/build/components/tabs/NavTabs.d.ts +9 -0
- package/build/components/tabs/Tab.d.ts +11 -0
- package/build/components/tabs/TabList.d.ts +18 -0
- package/build/components/tabs/TabPanel.d.ts +11 -0
- package/build/components/tabs/Tabs.d.ts +15 -0
- package/build/components/tabs/index.d.ts +6 -0
- package/build/components/tabs/tabsContext.d.ts +11 -0
- package/build/components/tag/Tag.d.ts +15 -0
- package/build/components/tag/index.d.ts +3 -0
- package/build/components/text-input/BaseTextArea.d.ts +27 -0
- package/build/components/text-input/BaseTextInput.d.ts +42 -0
- package/build/components/text-input/TextArea.d.ts +6 -0
- package/build/components/text-input/TextInput.d.ts +9 -0
- package/build/components/text-input/index.d.ts +4 -0
- package/build/components/toast/Toast.d.ts +11 -0
- package/build/components/toast/ToastRegion.d.ts +7 -0
- package/build/components/toast/index.d.ts +2 -0
- package/build/components/toast/toastContext.d.ts +16 -0
- package/build/components/toast/types.d.ts +10 -0
- package/build/components/toggle-switch/ToggleSlider.d.ts +12 -0
- package/build/components/toggle-switch/ToggleSwitch.d.ts +32 -0
- package/build/components/toggle-switch/index.d.ts +2 -0
- package/build/components/toggle-switch/usePillStyles.d.ts +5 -0
- package/build/components/tooltip/PopupTip.d.ts +13 -0
- package/build/components/tooltip/TooltipContent.d.ts +2 -0
- package/build/components/tooltip/TooltipTrigger.d.ts +2 -0
- package/build/components/tooltip/index.d.ts +4 -0
- package/build/core/index.d.ts +2 -0
- package/build/core/tokens.d.ts +372 -0
- package/build/core/types.d.ts +41 -0
- package/build/es/components/menu/MenuItemCheckbox.js +1 -1
- package/build/es/components/menu/MenuItemCheckbox.js.map +1 -1
- package/build/hooks/index.d.ts +18 -0
- package/build/hooks/mediaQueryUtils.d.ts +21 -0
- package/build/hooks/useAnimatedDetails/index.d.ts +1 -0
- package/build/hooks/useAnimatedDetails/useAnimatedDetails.d.ts +20 -0
- package/build/hooks/useAnimatedHeight/index.d.ts +4 -0
- package/build/hooks/useAnimatedHeight/types.d.ts +26 -0
- package/build/hooks/useAnimatedHeight/useAnimatedHeight.d.ts +10 -0
- package/build/hooks/useAnimatedHeight/useAnimatedHeightBetween.d.ts +10 -0
- package/build/hooks/useAnimatedHeight/useAutoAnimateHeight.d.ts +20 -0
- package/build/hooks/useAriaLiveRegion/index.d.ts +1 -0
- package/build/hooks/useAriaLiveRegion/useAriaLiveRegion.d.ts +15 -0
- package/build/hooks/useBrowserPreferences/index.d.ts +1 -0
- package/build/hooks/useBrowserPreferences/useBrowserPreferences.d.ts +12 -0
- package/build/hooks/useClickOutside/index.d.ts +1 -0
- package/build/hooks/useClickOutside/useClickOutside.d.ts +7 -0
- package/build/hooks/useElementDimensions/index.d.ts +1 -0
- package/build/hooks/useElementDimensions/useElementDimensions.d.ts +11 -0
- package/build/hooks/useFocusOutside/index.d.ts +1 -0
- package/build/hooks/useFocusOutside/useFocusOutside.d.ts +7 -0
- package/build/hooks/useId/index.d.ts +1 -0
- package/build/hooks/useId/useId.d.ts +11 -0
- package/build/hooks/useIntersectionObserver/index.d.ts +1 -0
- package/build/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +13 -0
- package/build/hooks/useKeyListener/index.d.ts +1 -0
- package/build/hooks/useKeyListener/useKeyListener.d.ts +8 -0
- package/build/hooks/useListNavigation/index.d.ts +1 -0
- package/build/hooks/useListNavigation/useListNavigation.d.ts +7 -0
- package/build/hooks/useLocalStorage/index.d.ts +1 -0
- package/build/hooks/useLocalStorage/useLocalStorage.d.ts +1 -0
- package/build/hooks/useMutationObserver/index.d.ts +1 -0
- package/build/hooks/useMutationObserver/useMutationObserver.d.ts +9 -0
- package/build/hooks/usePreviousValue/index.d.ts +1 -0
- package/build/hooks/usePreviousValue/usePreviousValue.d.ts +6 -0
- package/build/hooks/useProgressiveImg/index.d.ts +1 -0
- package/build/hooks/useProgressiveImg/useProgressiveImg.d.ts +10 -0
- package/build/hooks/useScreen/index.d.ts +2 -0
- package/build/hooks/useScreen/state.d.ts +17 -0
- package/build/hooks/useScreen/useScreen.d.ts +6 -0
- package/build/hooks/useScrollIntoView/index.d.ts +1 -0
- package/build/hooks/useScrollIntoView/useScrollIntoView.d.ts +11 -0
- package/build/hooks/useSwipeGesture/index.d.ts +1 -0
- package/build/hooks/useSwipeGesture/useSwipeGesture.d.ts +27 -0
- package/build/index.d.ts +4 -0
- package/build/utilities/constants/index.d.ts +2 -0
- package/build/utilities/constants/unicode.d.ts +13 -0
- package/build/utilities/formatters/avstand/formatAvstand.d.ts +23 -0
- package/build/utilities/formatters/bytes/formatBytes.d.ts +8 -0
- package/build/utilities/formatters/date/formatDate.d.ts +15 -0
- package/build/utilities/formatters/fodselsnummer/formatFodselsnummer.d.ts +15 -0
- package/build/utilities/formatters/index.d.ts +14 -0
- package/build/utilities/formatters/kontonummer/formatKontonummer.d.ts +16 -0
- package/build/utilities/formatters/kortnummer/formatKortnummer.d.ts +15 -0
- package/build/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.d.ts +15 -0
- package/build/utilities/formatters/telefonnummer/formatTelefonnummer.d.ts +18 -0
- package/build/utilities/formatters/util/formatNumber.d.ts +14 -0
- package/build/utilities/formatters/util/parseNumber.d.ts +6 -0
- package/build/utilities/formatters/util/registerWithMask.d.ts +42 -0
- package/build/utilities/formatters/valuta/formatValuta.d.ts +18 -0
- package/build/utilities/getThemeAndDensity.d.ts +4 -0
- package/build/utilities/index.d.ts +7 -0
- package/build/utilities/polymorphism/SlotComponent.d.ts +7 -0
- package/build/utilities/polymorphism/as-child.d.ts +39 -0
- package/build/utilities/polymorphism/index.d.ts +5 -0
- package/build/utilities/polymorphism/mergeProps.d.ts +3 -0
- package/build/utilities/polymorphism/mergeRefs.d.ts +3 -0
- package/build/utilities/polymorphism/polymorphism.d.ts +11 -0
- package/build/utilities/tabListener.d.ts +1 -0
- package/build/utilities/validators/hasMinimumWords/hasMinimumWords.d.ts +10 -0
- package/build/utilities/validators/hasNoIllegalCharacters/hasNoIllegalCharacters.d.ts +7 -0
- package/build/utilities/validators/index.d.ts +12 -0
- package/build/utilities/validators/isExactLength/isExactLength.d.ts +7 -0
- package/build/utilities/validators/isInteger/isInteger.d.ts +7 -0
- package/build/utilities/validators/isValidChassisnummer/isValidChassisnummer.d.ts +7 -0
- package/build/utilities/validators/isValidDogId/isValidDogId.d.ts +7 -0
- package/build/utilities/validators/isValidEpost/isValidEpost.d.ts +7 -0
- package/build/utilities/validators/isValidFodselsnummer/isValidFodselsnummer.d.ts +30 -0
- package/build/utilities/validators/isValidKortnummer/isValidKortnummer.d.ts +6 -0
- package/build/utilities/validators/isValidName/isValidName.d.ts +7 -0
- package/build/utilities/validators/isValidOrganisasjonsnummer/isValidOrganisasjonsnummer.d.ts +6 -0
- package/build/utilities/validators/isValidRegistreringsnummer/isValidRegistreringsnummer.d.ts +12 -0
- package/build/utilities/validators/isValidTelefonnummer/isValidTelefonnummer.d.ts +7 -0
- package/build/utilities/valuePair.d.ts +6 -0
- package/package.json +2 -2
- package/src/components/button/styles/button.css +2 -2
- package/src/components/button/styles/button.min.css +1 -1
- package/src/components/checkbox/styles/checkbox.css +4 -4
- package/src/components/checkbox/styles/checkbox.min.css +1 -1
- package/src/components/feedback/styles/feedback.css +2 -2
- package/src/components/feedback/styles/feedback.min.css +1 -1
- package/src/components/input-group/styles/input-group.css +2 -2
- package/src/components/input-group/styles/input-group.min.css +1 -1
- package/src/components/loader/styles/loader.css +6 -6
- package/src/components/loader/styles/loader.min.css +1 -1
- package/src/components/loader/styles/skeleton-loader.css +5 -5
- package/src/components/loader/styles/skeleton-loader.min.css +1 -1
- package/src/components/message/styles/message.css +2 -2
- package/src/components/message/styles/message.min.css +1 -1
- package/src/components/progress-bar/styles/progress-bar.css +2 -2
- package/src/components/progress-bar/styles/progress-bar.min.css +1 -1
- package/src/components/radio-button/styles/radio-button.css +3 -3
- package/src/components/radio-button/styles/radio-button.min.css +1 -1
- package/src/components/radio-button/styles/radio-button.scss +1 -1
- package/src/components/system-message/styles/system-message.css +2 -2
- package/src/components/system-message/styles/system-message.min.css +1 -1
- package/src/components/toast/styles/toast.css +4 -4
- package/src/components/toast/styles/toast.min.css +1 -1
- package/src/core/styles/core.css +1 -1
- package/src/core/styles/core.scss +1 -1
- package/src/styles/styles.css +34 -34
- package/src/styles/styles.min.css +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Placement } from '@floating-ui/react';
|
|
2
|
+
import { default as React, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { DataTestAutoId, WithChildren } from '../..';
|
|
4
|
+
export interface MenuProps extends DataTestAutoId, WithChildren, Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Initiell plassering av menyen. Dersom det ikke er plass på skjermen der du
|
|
8
|
+
* angir at den skal åpnes vil den slyttes automatisk.
|
|
9
|
+
* @default "bottom-start" på toppnivå, "right-start" for undermenyer
|
|
10
|
+
* */
|
|
11
|
+
initialPlacement?: Placement;
|
|
12
|
+
/**
|
|
13
|
+
* Angir om menyen skal åpnes ved hover (uten å måtte klikke)
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
openOnHover?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Angir om menyen skal holdes åpen når man klikker utenfor menyen
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
keepOpenOnClickOutside?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Elementet som fungerer som trigger for menyen. Dersom elementet ikke er en `<button>`
|
|
24
|
+
* eller en `forwardRef<HTMLButtonElement>` vil det bli lagt inne i en knapp
|
|
25
|
+
* med forhåndsdefinert stil. For å komme raskt i gang kan du bruke komponenten
|
|
26
|
+
* `MenuTriggerButton` fra denne pakken.
|
|
27
|
+
*/
|
|
28
|
+
triggerElement: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Kan brukes til å styre utenfra om menyen skal være åpen eller ikke.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
isOpen?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Callback som kalles når menyen åpnes eller lukkes.
|
|
36
|
+
*/
|
|
37
|
+
onToggle?: (isOpen: boolean) => void;
|
|
38
|
+
}
|
|
39
|
+
export declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { PolymorphicPropsWithRef } from '../../utilities/polymorphism/polymorphism';
|
|
3
|
+
export type MenuItemProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<ElementType, {
|
|
4
|
+
/**
|
|
5
|
+
* Et ikon som vises før innholdet i menypunktet
|
|
6
|
+
*/
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
} & ({
|
|
9
|
+
expandable?: never;
|
|
10
|
+
/**
|
|
11
|
+
* Indikerer at menypunktet åpner noe i et nytt vindu eller tab
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
external?: boolean;
|
|
15
|
+
} | {
|
|
16
|
+
external?: never;
|
|
17
|
+
/**
|
|
18
|
+
* Indikerer at menypunktet er utvidbart ved å vise en chevron
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
expandable?: boolean;
|
|
22
|
+
})>;
|
|
23
|
+
type MenuItemComponent = <ElementType extends React.ElementType = "button">(props: MenuItemProps<ElementType>) => React.ReactElement | null;
|
|
24
|
+
export declare const MenuItem: MenuItemComponent;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { SwipeChangeHandler } from '../../hooks';
|
|
3
|
+
export interface MenuItemCheckboxProps extends Omit<HTMLAttributes<HTMLDivElement>, "aria-checked" | "onChange"> {
|
|
4
|
+
"aria-checked": boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Et ikon som vises før innholdet i menypunktet
|
|
7
|
+
*/
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
onChange?: SwipeChangeHandler<HTMLDivElement> & ((event: React.KeyboardEvent<HTMLDivElement> | React.PointerEvent<HTMLDivElement>, pressed: boolean) => void);
|
|
10
|
+
}
|
|
11
|
+
export declare const MenuItemCheckbox: React.ForwardRefExoticComponent<MenuItemCheckboxProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FloatingTreeType } from '@floating-ui/react';
|
|
2
|
+
export declare const useMenuWideEvents: (tree: FloatingTreeType | null, nodeId: string, parentId: string | null) => {
|
|
3
|
+
allowHover: boolean;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export interface DismissButtonProps extends Exclude<ButtonHTMLAttributes<HTMLButtonElement>, "disabled"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const DismissButton: React.ForwardRefExoticComponent<DismissButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MessageProps } from './Message';
|
|
3
|
+
export interface FormErrorMessageProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
/**
|
|
7
|
+
* @default { title: "Feil og mangler i skjemaet" }
|
|
8
|
+
*/
|
|
9
|
+
messageProps?: Partial<MessageProps>;
|
|
10
|
+
errors: (string | undefined)[];
|
|
11
|
+
isSubmitted: boolean;
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const FormErrorMessage: React.ForwardRefExoticComponent<FormErrorMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React, AriaRole } from 'react';
|
|
2
|
+
import { Density, WithChildren } from '../..';
|
|
3
|
+
export interface MessageProps extends WithChildren {
|
|
4
|
+
id?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
density?: Density;
|
|
8
|
+
className?: string;
|
|
9
|
+
dismissed?: boolean;
|
|
10
|
+
dismissAction?: {
|
|
11
|
+
handleDismiss: () => void;
|
|
12
|
+
buttonTitle?: string;
|
|
13
|
+
};
|
|
14
|
+
role?: AriaRole;
|
|
15
|
+
}
|
|
16
|
+
export declare const InfoMessage: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const ErrorMessage: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const WarningMessage: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export declare const SuccessMessage: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { WithOptionalChildren } from '../..';
|
|
3
|
+
import { IconButtonProps } from '../icon-button';
|
|
4
|
+
export interface ModalProps extends WithOptionalChildren {
|
|
5
|
+
id?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
component?: React.ElementType;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* Overstyrer padding på modalen via en CSS-variabel.
|
|
11
|
+
*/
|
|
12
|
+
padding?: 16 | 24 | 40;
|
|
13
|
+
}
|
|
14
|
+
type BaseModalProps = Omit<ModalProps, "padding" | "component">;
|
|
15
|
+
/**
|
|
16
|
+
* Ment å brukes med `useModal`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const ModalContainer: React.ForwardRefExoticComponent<Omit<{
|
|
19
|
+
id: string;
|
|
20
|
+
ref: (node: HTMLElement | React.ReactNode) => void;
|
|
21
|
+
role: string;
|
|
22
|
+
'aria-modal': boolean;
|
|
23
|
+
'aria-hidden': boolean;
|
|
24
|
+
'aria-labelledby': string;
|
|
25
|
+
} & BaseModalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
/**
|
|
27
|
+
* Ment å brukes med `useModal`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ModalOverlay: React.ForwardRefExoticComponent<{
|
|
30
|
+
onClick?: (() => void) | undefined;
|
|
31
|
+
} & BaseModalProps & {
|
|
32
|
+
/**
|
|
33
|
+
* Rendre uten bakgrunnsfarge, men med click target for å lukke modalen ved klikk utenfor.
|
|
34
|
+
*/
|
|
35
|
+
transparent?: boolean | undefined;
|
|
36
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
/**
|
|
38
|
+
* Ment å brukes med `useModal`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const Modal: React.ForwardRefExoticComponent<{
|
|
41
|
+
role: "document";
|
|
42
|
+
} & ModalProps & React.RefAttributes<HTMLElement>>;
|
|
43
|
+
/**
|
|
44
|
+
* Ment å brukes med `useModal`.
|
|
45
|
+
*/
|
|
46
|
+
export declare const ModalHeader: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
/**
|
|
48
|
+
* Ment å brukes med `useModal`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const ModalTitle: React.ForwardRefExoticComponent<{
|
|
51
|
+
role: "heading";
|
|
52
|
+
'aria-level': number;
|
|
53
|
+
id: string;
|
|
54
|
+
} & BaseModalProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* Ment å brukes med `useModal`.
|
|
57
|
+
*/
|
|
58
|
+
export declare const ModalCloseButton: React.ForwardRefExoticComponent<Omit<{
|
|
59
|
+
type: "button";
|
|
60
|
+
onClick: () => void;
|
|
61
|
+
} & {
|
|
62
|
+
"aria-label": string;
|
|
63
|
+
}, "onClick"> & BaseModalProps & IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
64
|
+
/**
|
|
65
|
+
* Ment å brukes med `useModal`.
|
|
66
|
+
*/
|
|
67
|
+
export declare const ModalBody: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
68
|
+
/**
|
|
69
|
+
* Ment å brukes med `useModal`.
|
|
70
|
+
*/
|
|
71
|
+
export declare const ModalActions: React.ForwardRefExoticComponent<BaseModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ModalProps } from './Modal';
|
|
2
|
+
export { ModalContainer, ModalOverlay, Modal, ModalHeader, ModalTitle, ModalCloseButton, ModalBody, ModalActions, } from './Modal';
|
|
3
|
+
export type { UseModalOptions, ModalInstance, ModalConfig } from './useModal';
|
|
4
|
+
export { useModal } from './useModal';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { A11yDialogConfig, A11yDialogProps } from 'react-a11y-dialog';
|
|
2
|
+
export interface UseModalOptions extends Omit<A11yDialogProps, "id" | "closeButtonPosition"> {
|
|
3
|
+
id?: string;
|
|
4
|
+
/**
|
|
5
|
+
* @default "Lukk"
|
|
6
|
+
*/
|
|
7
|
+
closeButtonLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Sett til `alertdialog` om du ønsker å slå av muligheten til å lukke med ESC og klikk utenfor.
|
|
10
|
+
*
|
|
11
|
+
* @default "dialog"
|
|
12
|
+
*/
|
|
13
|
+
role?: "dialog" | "alertdialog";
|
|
14
|
+
/**
|
|
15
|
+
* Påkrevd for universell utforming. Tittelen kan gjenbrukes som `children` i `<ModalTitle>` med en konstant.
|
|
16
|
+
*/
|
|
17
|
+
title: string;
|
|
18
|
+
}
|
|
19
|
+
export type ModalInstance = ReturnType<typeof useModal>[0];
|
|
20
|
+
export interface ModalConfig extends Omit<A11yDialogConfig, "dialog"> {
|
|
21
|
+
modal: A11yDialogConfig["dialog"];
|
|
22
|
+
closeButton: A11yDialogConfig["closeButton"] & {
|
|
23
|
+
"aria-label": string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @example
|
|
28
|
+
* ```jsx
|
|
29
|
+
* const heading = "Bekreft sletting";
|
|
30
|
+
* const [instance, { title, overlay, container, modal, closeButton }] = useModal({ title: heading });
|
|
31
|
+
*
|
|
32
|
+
* useEffect(() => {
|
|
33
|
+
* if (!instance) {
|
|
34
|
+
* return;
|
|
35
|
+
* }
|
|
36
|
+
* instance.show();
|
|
37
|
+
* }, [instance]);
|
|
38
|
+
*
|
|
39
|
+
* return ReactDOM.createPortal(
|
|
40
|
+
* <ModalContainer {...container}>
|
|
41
|
+
* <ModalOverlay {...overlay} />
|
|
42
|
+
* <Modal {...modal}>
|
|
43
|
+
* <ModalHeader>
|
|
44
|
+
* <ModalTitle {...title}>{heading}</ModalTitle>
|
|
45
|
+
* <ModalCloseButton {...closeButton} />
|
|
46
|
+
* </ModalHeader>
|
|
47
|
+
* <ModalBody>
|
|
48
|
+
* Er du sikker på at du vil slette Foo Bar Baz?
|
|
49
|
+
* </ModalBody>
|
|
50
|
+
* <ModalActions>
|
|
51
|
+
* <PrimaryButton
|
|
52
|
+
* onClick={() => {
|
|
53
|
+
* // Do the thing
|
|
54
|
+
* instance?.hide()
|
|
55
|
+
* }}
|
|
56
|
+
* >
|
|
57
|
+
* Bekreft
|
|
58
|
+
* </PrimaryButton>
|
|
59
|
+
* <TertiaryButton onClick={() => instance?.hide()}>
|
|
60
|
+
* Avbryt
|
|
61
|
+
* </TertiaryButton>
|
|
62
|
+
* </ModalActions>
|
|
63
|
+
* </Modal>
|
|
64
|
+
* </ModalContainer>,
|
|
65
|
+
* document.body,
|
|
66
|
+
* );
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function useModal(props: UseModalOptions): readonly [A11yDialog.A11yDialog, ModalConfig];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicPropsWithRef } from '../../utilities/polymorphism';
|
|
3
|
+
export type PaginationProps<ElementType extends React.ElementType> = PolymorphicPropsWithRef<ElementType, {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
numberOfPages: number;
|
|
6
|
+
onPageChange: (toPage: number, fromPage: number) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Dersom du ønsker å ha custom labels kan du sende inn disse. "next" og "previous"
|
|
9
|
+
* brukes som hint til skjermlesere for ikon-knappene til Neste/Forrige side
|
|
10
|
+
* @default { previous: "Forrige side", next: "Neste side" }
|
|
11
|
+
*/
|
|
12
|
+
labels?: {
|
|
13
|
+
previous: string;
|
|
14
|
+
next: string;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export type PaginationComponent = <ElementType extends React.ElementType = "nav">(props: PaginationProps<ElementType>) => React.ReactElement | null;
|
|
18
|
+
export declare const Pagination: PaginationComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Pagination';
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { useFocus, useHover, useClick, useDismiss, useRole, UseFloatingOptions, ReferenceType } from '@floating-ui/react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type ClickOptions = Parameters<typeof useClick>[1];
|
|
4
|
+
type DismissOptions = Parameters<typeof useDismiss>[1];
|
|
5
|
+
type FocusOptions = Parameters<typeof useFocus>[1];
|
|
6
|
+
type HoverOptions = Parameters<typeof useHover>[1];
|
|
7
|
+
type RoleOptions = Parameters<typeof useRole>[1];
|
|
8
|
+
interface PopoverOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Angir om popoveren er åpen eller lukket.
|
|
11
|
+
*
|
|
12
|
+
* @see https://floating-ui.com/docs/usefloating#open
|
|
13
|
+
*/
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Callback som trigges når popoveren åpnes eller lukkes.
|
|
17
|
+
*
|
|
18
|
+
* @see https://floating-ui.com/docs/usefloating#onopenchange
|
|
19
|
+
*/
|
|
20
|
+
onOpenChange?: UseFloatingOptions["onOpenChange"];
|
|
21
|
+
/**
|
|
22
|
+
* Bestemmer plasseringen av popoveren.
|
|
23
|
+
*
|
|
24
|
+
* @see https://floating-ui.com/docs/usefloating#placement
|
|
25
|
+
*
|
|
26
|
+
* @default "bottom-start"
|
|
27
|
+
*/
|
|
28
|
+
placement?: UseFloatingOptions["placement"];
|
|
29
|
+
/**
|
|
30
|
+
* Definerer strategien for posisjonering av popoveren.
|
|
31
|
+
*
|
|
32
|
+
* @see https://floating-ui.com/docs/usefloating#strategy
|
|
33
|
+
*
|
|
34
|
+
* @default "absolute"
|
|
35
|
+
*/
|
|
36
|
+
strategy?: UseFloatingOptions["strategy"];
|
|
37
|
+
/**
|
|
38
|
+
* Angir om popoveren skal fungere som en modal, der fokus er låst til det flytende elementet
|
|
39
|
+
* og innhold utenfor ikke kan interageres med.
|
|
40
|
+
*
|
|
41
|
+
* @see https://floating-ui.com/docs/usefloating#modal
|
|
42
|
+
*
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
modal?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Justerer avstanden mellom referanse-elementet og popoveren.
|
|
48
|
+
*
|
|
49
|
+
* @see https://floating-ui.com/docs/offset
|
|
50
|
+
*
|
|
51
|
+
* @default 4
|
|
52
|
+
*/
|
|
53
|
+
offset?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Referanse til elementet som popoveren skal posisjoneres i forhold til.
|
|
56
|
+
*
|
|
57
|
+
* @see https://floating-ui.com/docs/usefloating#setpositionreference
|
|
58
|
+
*
|
|
59
|
+
* @default Popover.Trigger
|
|
60
|
+
*/
|
|
61
|
+
positionReference?: React.RefObject<ReferenceType>;
|
|
62
|
+
/**
|
|
63
|
+
* Options for hover-interaksjoner.
|
|
64
|
+
*
|
|
65
|
+
* @see https://floating-ui.com/docs/usehover
|
|
66
|
+
*
|
|
67
|
+
* @default { enabled: false }
|
|
68
|
+
*/
|
|
69
|
+
hoverOptions?: HoverOptions;
|
|
70
|
+
/**
|
|
71
|
+
* Options for fokus-interaksjoner.
|
|
72
|
+
*
|
|
73
|
+
* @see https://floating-ui.com/docs/usefocus
|
|
74
|
+
*
|
|
75
|
+
* @default { enabled: false }
|
|
76
|
+
*/
|
|
77
|
+
focusOptions?: FocusOptions;
|
|
78
|
+
/**
|
|
79
|
+
* Options for klikk-interaksjoner.
|
|
80
|
+
*
|
|
81
|
+
* @see https://floating-ui.com/docs/useclick
|
|
82
|
+
*
|
|
83
|
+
* @default { enabled: false }
|
|
84
|
+
*/
|
|
85
|
+
clickOptions?: ClickOptions;
|
|
86
|
+
/**
|
|
87
|
+
* Konfigurerer rollen for popoveren.
|
|
88
|
+
*
|
|
89
|
+
* @see https://floating-ui.com/docs/userole
|
|
90
|
+
*
|
|
91
|
+
* @default { enabled: true, role: "dialog" }
|
|
92
|
+
*/
|
|
93
|
+
roleOptions?: RoleOptions;
|
|
94
|
+
/**
|
|
95
|
+
* Options for å lukke popoveren når en dismissal skjer,
|
|
96
|
+
* som ved å klikke utenfor eller trykke på "Escape"-tasten.
|
|
97
|
+
*
|
|
98
|
+
* @see https://floating-ui.com/docs/usedismiss
|
|
99
|
+
*
|
|
100
|
+
* @default { enabled: true }
|
|
101
|
+
*/
|
|
102
|
+
dismissOptions?: DismissOptions;
|
|
103
|
+
}
|
|
104
|
+
declare const Popover: {
|
|
105
|
+
({ children, ...restOptions }: {
|
|
106
|
+
children: React.ReactNode;
|
|
107
|
+
} & PopoverOptions): React.JSX.Element;
|
|
108
|
+
Trigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
109
|
+
Content: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLDivElement> & PopoverContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
110
|
+
};
|
|
111
|
+
interface PopoverTriggerProps {
|
|
112
|
+
children: React.ReactNode;
|
|
113
|
+
/**
|
|
114
|
+
* Rendrer komponenten som child-elementet sitt, og slår sammen egenskaper og props.
|
|
115
|
+
*
|
|
116
|
+
* Default er `false`.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* <Component asChild foo="bar">
|
|
121
|
+
* <Child baz="qux" />
|
|
122
|
+
* </Component>
|
|
123
|
+
*
|
|
124
|
+
* // Rendrer følgende:
|
|
125
|
+
* <Child foo="bar" baz="qux" />
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
asChild?: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface PopoverContentProps {
|
|
131
|
+
/**
|
|
132
|
+
* Padding rundt innholdet i popoveren.
|
|
133
|
+
*
|
|
134
|
+
* Default er `0`.
|
|
135
|
+
*/
|
|
136
|
+
padding?: 0 | 8 | 16 | 24;
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* Angir hvilket element som skal motta fokus ved åpning.
|
|
140
|
+
* Kan være en tabbar index eller en referanse til et element."
|
|
141
|
+
*
|
|
142
|
+
* Default er `0`, som betyr at det første fokuserbare elementet i popoveren får fokus.
|
|
143
|
+
* @see https://floating-ui.com/docs/FloatingFocusManager#initialfocus
|
|
144
|
+
*/
|
|
145
|
+
initialFocus?: number | React.RefObject<HTMLElement>;
|
|
146
|
+
/**
|
|
147
|
+
* Angir om fokus skal returneres til triggeren når popoveren lukkes.
|
|
148
|
+
*
|
|
149
|
+
* Default er `true`.
|
|
150
|
+
* @see https://floating-ui.com/docs/FloatingFocusManager#returnfocus
|
|
151
|
+
*/
|
|
152
|
+
returnFocus?: boolean;
|
|
153
|
+
}
|
|
154
|
+
export default Popover;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Popover } from './Popover';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React, CSSProperties, FC } from 'react';
|
|
2
|
+
export interface CountdownProps extends Pick<React.HTMLAttributes<HTMLDivElement>, "onAnimationEnd" | "onAnimationStart"> {
|
|
3
|
+
id?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Millisekunder å telle ned fra
|
|
7
|
+
*/
|
|
8
|
+
from: number;
|
|
9
|
+
isPaused?: boolean;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export declare const Countdown: FC<CountdownProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSProperties, FC } from 'react';
|
|
2
|
+
export interface ProgressBarProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* @default "Fremdrift"
|
|
7
|
+
*/
|
|
8
|
+
title?: string;
|
|
9
|
+
"aria-valuetext"?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
"aria-valuemin"?: number;
|
|
14
|
+
"aria-valuenow": number;
|
|
15
|
+
/**
|
|
16
|
+
* @default 100
|
|
17
|
+
*/
|
|
18
|
+
"aria-valuemax"?: number;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
}
|
|
21
|
+
export declare const calculatePercentage: (current: number, total: number) => number;
|
|
22
|
+
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React, ChangeEventHandler } from 'react';
|
|
2
|
+
import { Density } from '../..';
|
|
3
|
+
import { RadioButtonProps } from './RadioButton';
|
|
4
|
+
export interface BaseRadioButtonProps extends RadioButtonProps {
|
|
5
|
+
inline?: boolean;
|
|
6
|
+
density?: Density;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare const BaseRadioButton: React.ForwardRefExoticComponent<BaseRadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React, InputHTMLAttributes, ChangeEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { SupportLabelProps } from '../input-group';
|
|
3
|
+
export interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "children"> {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
value: string;
|
|
6
|
+
/** Kan også settes på RadioButtonGroup, men settes på RadioButton f. eks. av react-hook-form */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Kan også settes på RadioButtonGroup, men settes på RadioButton f. eks. av react-hook-form */
|
|
9
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
10
|
+
/** @deprecated Bruk children */
|
|
11
|
+
label?: ReactNode;
|
|
12
|
+
helpLabel?: ReactNode;
|
|
13
|
+
supportLabelProps?: Omit<SupportLabelProps, "id" | "errorLabel" | "helpLabel" | "density">;
|
|
14
|
+
}
|
|
15
|
+
export declare const RadioButton: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChangeEventHandler, FC } from 'react';
|
|
2
|
+
import { Density } from '../..';
|
|
3
|
+
import { FieldGroupProps } from '../input-group';
|
|
4
|
+
export interface RadioButtonGroupProps extends Omit<FieldGroupProps, "onChange"> {
|
|
5
|
+
legend: string;
|
|
6
|
+
/** Alle RadioButton i gruppen får dette som name. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Om gruppen skal være controlled setter du den valgte verdien her. */
|
|
9
|
+
value?: string;
|
|
10
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
11
|
+
helpLabel?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Erstatter hjelpeteksten (hvis noen) med en feilmelding.
|
|
14
|
+
* Merker samtidig alle RadioButton i gruppen som ugyldige.
|
|
15
|
+
*/
|
|
16
|
+
errorLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Setter inline-modifieren på alle RadioButton i gruppen.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
inline?: boolean;
|
|
22
|
+
density?: Density;
|
|
23
|
+
}
|
|
24
|
+
export declare const RadioButtonGroup: FC<RadioButtonGroupProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { RadioButtonProps } from './RadioButton';
|
|
2
|
+
export { RadioButton } from './RadioButton';
|
|
3
|
+
export type { RadioButtonGroupProps } from './RadioButtonGroup';
|
|
4
|
+
export { RadioButtonGroup } from './RadioButtonGroup';
|
|
5
|
+
export type { BaseRadioButtonProps } from './BaseRadioButton';
|
|
6
|
+
export { BaseRadioButton } from './BaseRadioButton';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React, ChangeEventHandler } from 'react';
|
|
2
|
+
import { Density, WithChildren } from '../..';
|
|
3
|
+
type RadioGroupContext = {
|
|
4
|
+
name: string | undefined;
|
|
5
|
+
value: string | undefined;
|
|
6
|
+
inline: boolean;
|
|
7
|
+
density?: Density;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
onChange: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare const useRadioGroupContext: () => RadioGroupContext;
|
|
12
|
+
interface Props extends WithChildren {
|
|
13
|
+
state: RadioGroupContext;
|
|
14
|
+
}
|
|
15
|
+
export declare const RadioGroupContextProvider: React.FC<Props>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React, SelectHTMLAttributes } from 'react';
|
|
2
|
+
import { ValuePair } from '../..';
|
|
3
|
+
import { InputGroupProps } from '../input-group';
|
|
4
|
+
export interface NativeSelectProps extends Omit<InputGroupProps, "children">, SelectHTMLAttributes<HTMLSelectElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Merk som ugyldig uten å sende inn en errorLabel.
|
|
7
|
+
* NB! Brukes kun i tilfeller der valideringsfeil dukker opp andre steder, for eksempel i en FieldGroup.
|
|
8
|
+
*/
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Setter inn et placeholderelement som vises når ingenting er valgt i nedtrekkslisten.
|
|
12
|
+
* @default "Velg"
|
|
13
|
+
*/
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
items: Array<string | ValuePair>;
|
|
16
|
+
selectClassName?: string;
|
|
17
|
+
width?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>;
|