@fremtind/jokul 0.22.1 → 0.22.2
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/styles/styles.css +34 -34
- package/src/styles/styles.min.css +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputGroupProps } from '../input-group';
|
|
3
|
+
import { BaseTextAreaProps } from './BaseTextArea';
|
|
4
|
+
export interface TextAreaProps extends Omit<InputGroupProps, "children">, BaseTextAreaProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputGroupProps } from '../input-group';
|
|
3
|
+
import { BaseTextInputProps } from './BaseTextInput';
|
|
4
|
+
export interface TextInputProps extends Omit<InputGroupProps, "children">, BaseTextInputProps {
|
|
5
|
+
"data-testautoid"?: string;
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
inputClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AriaToastProps } from '@react-aria/toast';
|
|
2
|
+
import { QueuedToast, ToastState } from '@react-stately/toast';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
import { ToastContent, ToastOptions } from './types';
|
|
5
|
+
interface ToastProps<T extends ToastContent> extends AriaToastProps<T> {
|
|
6
|
+
className?: string;
|
|
7
|
+
state: ToastState<T>;
|
|
8
|
+
toast: QueuedToast<T> & ToastOptions;
|
|
9
|
+
}
|
|
10
|
+
export declare function Toast<T extends ToastContent>({ className, state, ...props }: ToastProps<T>): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ToastQueue } from '@react-stately/toast';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { ToastContent } from './types';
|
|
4
|
+
export declare function ToastRegion({ queue, placement }: {
|
|
5
|
+
queue: ToastQueue<ToastContent>;
|
|
6
|
+
placement: "center" | "left";
|
|
7
|
+
}): React.ReactPortal | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { WithChildren } from '../..';
|
|
3
|
+
import { ToastContent, ToastOptions } from './types';
|
|
4
|
+
interface ToastContextProviderProps extends WithChildren {
|
|
5
|
+
maxVisibleToasts?: number;
|
|
6
|
+
/**
|
|
7
|
+
* @default "center"
|
|
8
|
+
*/
|
|
9
|
+
placement?: "center" | "left";
|
|
10
|
+
}
|
|
11
|
+
type ToastContext = {
|
|
12
|
+
add: (toast: ToastContent, options?: ToastOptions) => string;
|
|
13
|
+
};
|
|
14
|
+
export declare const useToast: () => ToastContext;
|
|
15
|
+
export declare const ToastProvider: FC<ToastContextProviderProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToastOptions as StatelyToastOptions } from '@react-stately/toast';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type ToastContent = {
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
} | string;
|
|
7
|
+
export type ToastOptions = Omit<StatelyToastOptions, "timeout"> & {
|
|
8
|
+
variant?: "info" | "success" | "warning" | "error";
|
|
9
|
+
timeout?: number | null | "off";
|
|
10
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { Density, WithChildren } from '../..';
|
|
3
|
+
interface Props extends WithChildren {
|
|
4
|
+
labels: [string, string];
|
|
5
|
+
onToggle: (value: string) => void;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
hideLegend?: boolean;
|
|
9
|
+
density?: Density;
|
|
10
|
+
}
|
|
11
|
+
export declare const ToggleSlider: FC<Props>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as React, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { Density } from '../..';
|
|
3
|
+
import { SwipeChangeHandler } from '../../hooks';
|
|
4
|
+
export type ToggleChangeHandler<T extends HTMLElement> = SwipeChangeHandler<T>;
|
|
5
|
+
export type ToggleProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> & {
|
|
6
|
+
density?: Density;
|
|
7
|
+
/**
|
|
8
|
+
* Handler for å håndtere toggling av knappen. Tar inn en boolean som indikerer om knappen er er togglet på
|
|
9
|
+
* eller ikke, samt en MouseEvent eller en PointerEvent avhengig av om togglingen skjedde via klikk eller swipe.
|
|
10
|
+
* @example
|
|
11
|
+
* ```js
|
|
12
|
+
* function handleChange(event, pressed) {
|
|
13
|
+
* console.log(`ToggleSwitch er ${pressed ? "på" : "av"}`);
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
onChange?: ToggleChangeHandler<HTMLButtonElement>;
|
|
18
|
+
};
|
|
19
|
+
export declare const ToggleSwitch: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> & {
|
|
20
|
+
density?: Density | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Handler for å håndtere toggling av knappen. Tar inn en boolean som indikerer om knappen er er togglet på
|
|
23
|
+
* eller ikke, samt en MouseEvent eller en PointerEvent avhengig av om togglingen skjedde via klikk eller swipe.
|
|
24
|
+
* @example
|
|
25
|
+
* ```js
|
|
26
|
+
* function handleChange(event, pressed) {
|
|
27
|
+
* console.log(`ToggleSwitch er ${pressed ? "på" : "av"}`);
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
onChange?: ToggleChangeHandler<HTMLButtonElement> | undefined;
|
|
32
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactNode, HTMLProps } from 'react';
|
|
2
|
+
import { TooltipProps } from './Tooltip';
|
|
3
|
+
export interface PopupTipProps extends Omit<TooltipProps, "triggerOn" | "children"> {
|
|
4
|
+
/**
|
|
5
|
+
* Innholdet i tooltipet som vises
|
|
6
|
+
*/
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Eventuelle props du vil sette på trigger-knappen for tooltipet
|
|
10
|
+
*/
|
|
11
|
+
triggerProps?: Omit<HTMLProps<HTMLButtonElement>, "children" | "type">;
|
|
12
|
+
}
|
|
13
|
+
export declare const PopupTip: FC<PopupTipProps>;
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly
|
|
3
|
+
* Generated on Mon, 23 Sep 2024 08:51:40 GMT
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: {
|
|
6
|
+
breakpoint: {
|
|
7
|
+
medium: string;
|
|
8
|
+
large: string;
|
|
9
|
+
xl: string;
|
|
10
|
+
};
|
|
11
|
+
color: {
|
|
12
|
+
brand: {
|
|
13
|
+
snohvit: string;
|
|
14
|
+
varde: string;
|
|
15
|
+
granitt: string;
|
|
16
|
+
hvit: string;
|
|
17
|
+
svart: string;
|
|
18
|
+
skifer: string;
|
|
19
|
+
fjellgra: string;
|
|
20
|
+
stein: string;
|
|
21
|
+
svaberg: string;
|
|
22
|
+
dis: string;
|
|
23
|
+
sand: string;
|
|
24
|
+
};
|
|
25
|
+
functional: {
|
|
26
|
+
info: string;
|
|
27
|
+
infoDark: string;
|
|
28
|
+
success: string;
|
|
29
|
+
successDark: string;
|
|
30
|
+
warning: string;
|
|
31
|
+
warningDark: string;
|
|
32
|
+
error: string;
|
|
33
|
+
errorDark: string;
|
|
34
|
+
};
|
|
35
|
+
background: {
|
|
36
|
+
page: {
|
|
37
|
+
light: string;
|
|
38
|
+
dark: string;
|
|
39
|
+
};
|
|
40
|
+
pageVariant: {
|
|
41
|
+
light: string;
|
|
42
|
+
dark: string;
|
|
43
|
+
};
|
|
44
|
+
container: {
|
|
45
|
+
light: string;
|
|
46
|
+
dark: string;
|
|
47
|
+
};
|
|
48
|
+
containerLow: {
|
|
49
|
+
light: string;
|
|
50
|
+
dark: string;
|
|
51
|
+
};
|
|
52
|
+
containerHigh: {
|
|
53
|
+
light: string;
|
|
54
|
+
dark: string;
|
|
55
|
+
};
|
|
56
|
+
containerInverted: {
|
|
57
|
+
light: string;
|
|
58
|
+
dark: string;
|
|
59
|
+
};
|
|
60
|
+
containerSubdued: {
|
|
61
|
+
light: string;
|
|
62
|
+
dark: string;
|
|
63
|
+
};
|
|
64
|
+
input: {
|
|
65
|
+
base: {
|
|
66
|
+
light: string;
|
|
67
|
+
dark: string;
|
|
68
|
+
};
|
|
69
|
+
focus: {
|
|
70
|
+
light: string;
|
|
71
|
+
dark: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
action: {
|
|
75
|
+
light: string;
|
|
76
|
+
dark: string;
|
|
77
|
+
};
|
|
78
|
+
interactive: {
|
|
79
|
+
light: string;
|
|
80
|
+
dark: string;
|
|
81
|
+
};
|
|
82
|
+
interactiveHover: {
|
|
83
|
+
light: string;
|
|
84
|
+
dark: string;
|
|
85
|
+
};
|
|
86
|
+
interactiveSelected: {
|
|
87
|
+
light: string;
|
|
88
|
+
dark: string;
|
|
89
|
+
};
|
|
90
|
+
alert: {
|
|
91
|
+
neutral: {
|
|
92
|
+
light: string;
|
|
93
|
+
dark: string;
|
|
94
|
+
};
|
|
95
|
+
info: {
|
|
96
|
+
light: string;
|
|
97
|
+
dark: string;
|
|
98
|
+
};
|
|
99
|
+
success: {
|
|
100
|
+
light: string;
|
|
101
|
+
dark: string;
|
|
102
|
+
};
|
|
103
|
+
warning: {
|
|
104
|
+
light: string;
|
|
105
|
+
dark: string;
|
|
106
|
+
};
|
|
107
|
+
error: {
|
|
108
|
+
light: string;
|
|
109
|
+
dark: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
text: {
|
|
114
|
+
default: {
|
|
115
|
+
light: string;
|
|
116
|
+
dark: string;
|
|
117
|
+
};
|
|
118
|
+
subdued: {
|
|
119
|
+
light: string;
|
|
120
|
+
dark: string;
|
|
121
|
+
};
|
|
122
|
+
inverted: {
|
|
123
|
+
light: string;
|
|
124
|
+
dark: string;
|
|
125
|
+
};
|
|
126
|
+
onAction: {
|
|
127
|
+
light: string;
|
|
128
|
+
dark: string;
|
|
129
|
+
};
|
|
130
|
+
interactive: {
|
|
131
|
+
light: string;
|
|
132
|
+
dark: string;
|
|
133
|
+
};
|
|
134
|
+
interactiveHover: {
|
|
135
|
+
light: string;
|
|
136
|
+
dark: string;
|
|
137
|
+
};
|
|
138
|
+
onAlert: {
|
|
139
|
+
light: string;
|
|
140
|
+
dark: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
border: {
|
|
144
|
+
action: {
|
|
145
|
+
light: string;
|
|
146
|
+
dark: string;
|
|
147
|
+
};
|
|
148
|
+
input: {
|
|
149
|
+
light: string;
|
|
150
|
+
dark: string;
|
|
151
|
+
};
|
|
152
|
+
inputFocus: {
|
|
153
|
+
light: string;
|
|
154
|
+
dark: string;
|
|
155
|
+
};
|
|
156
|
+
separator: {
|
|
157
|
+
light: string;
|
|
158
|
+
dark: string;
|
|
159
|
+
};
|
|
160
|
+
separatorStrong: {
|
|
161
|
+
light: string;
|
|
162
|
+
dark: string;
|
|
163
|
+
};
|
|
164
|
+
separatorHover: {
|
|
165
|
+
light: string;
|
|
166
|
+
dark: string;
|
|
167
|
+
};
|
|
168
|
+
subdued: {
|
|
169
|
+
light: string;
|
|
170
|
+
dark: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
svart: string;
|
|
174
|
+
granitt: string;
|
|
175
|
+
skifer: string;
|
|
176
|
+
fjellgra: string;
|
|
177
|
+
stein: string;
|
|
178
|
+
svaberg: string;
|
|
179
|
+
varde: string;
|
|
180
|
+
dis: string;
|
|
181
|
+
sand: string;
|
|
182
|
+
snohvit: string;
|
|
183
|
+
hvit: string;
|
|
184
|
+
suksess: string;
|
|
185
|
+
suksessDark: string;
|
|
186
|
+
feil: string;
|
|
187
|
+
feilDark: string;
|
|
188
|
+
info: string;
|
|
189
|
+
infoDark: string;
|
|
190
|
+
advarsel: string;
|
|
191
|
+
advarselDark: string;
|
|
192
|
+
};
|
|
193
|
+
motion: {
|
|
194
|
+
timing: {
|
|
195
|
+
energetic: string;
|
|
196
|
+
snappy: string;
|
|
197
|
+
productive: string;
|
|
198
|
+
expressive: string;
|
|
199
|
+
lazy: string;
|
|
200
|
+
};
|
|
201
|
+
easing: {
|
|
202
|
+
standard: string;
|
|
203
|
+
entrance: string;
|
|
204
|
+
exit: string;
|
|
205
|
+
easeInBounceOut: string;
|
|
206
|
+
focus: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
spacing: {
|
|
210
|
+
0: string;
|
|
211
|
+
2: string;
|
|
212
|
+
4: string;
|
|
213
|
+
8: string;
|
|
214
|
+
12: string;
|
|
215
|
+
16: string;
|
|
216
|
+
24: string;
|
|
217
|
+
32: string;
|
|
218
|
+
40: string;
|
|
219
|
+
64: string;
|
|
220
|
+
104: string;
|
|
221
|
+
168: string;
|
|
222
|
+
};
|
|
223
|
+
icon: {
|
|
224
|
+
weight: {
|
|
225
|
+
normal: string;
|
|
226
|
+
bold: string;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
typography: {
|
|
230
|
+
weight: {
|
|
231
|
+
normal: string;
|
|
232
|
+
bold: string;
|
|
233
|
+
};
|
|
234
|
+
font: {
|
|
235
|
+
size: {
|
|
236
|
+
16: string;
|
|
237
|
+
18: string;
|
|
238
|
+
20: string;
|
|
239
|
+
21: string;
|
|
240
|
+
23: string;
|
|
241
|
+
25: string;
|
|
242
|
+
26: string;
|
|
243
|
+
28: string;
|
|
244
|
+
30: string;
|
|
245
|
+
36: string;
|
|
246
|
+
44: string;
|
|
247
|
+
56: string;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
line: {
|
|
251
|
+
height: {
|
|
252
|
+
24: string;
|
|
253
|
+
28: string;
|
|
254
|
+
32: string;
|
|
255
|
+
36: string;
|
|
256
|
+
40: string;
|
|
257
|
+
44: string;
|
|
258
|
+
52: string;
|
|
259
|
+
64: string;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
title: {
|
|
263
|
+
small: {
|
|
264
|
+
fontSize: string;
|
|
265
|
+
lineHeight: string;
|
|
266
|
+
fontWeight: string;
|
|
267
|
+
};
|
|
268
|
+
base: {
|
|
269
|
+
fontSize: string;
|
|
270
|
+
lineHeight: string;
|
|
271
|
+
fontWeight: string;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
titleSmall: {
|
|
275
|
+
small: {
|
|
276
|
+
fontSize: string;
|
|
277
|
+
lineHeight: string;
|
|
278
|
+
fontWeight: string;
|
|
279
|
+
};
|
|
280
|
+
base: {
|
|
281
|
+
fontSize: string;
|
|
282
|
+
lineHeight: string;
|
|
283
|
+
fontWeight: string;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
heading_1: {
|
|
287
|
+
small: {
|
|
288
|
+
fontSize: string;
|
|
289
|
+
lineHeight: string;
|
|
290
|
+
fontWeight: string;
|
|
291
|
+
};
|
|
292
|
+
base: {
|
|
293
|
+
fontSize: string;
|
|
294
|
+
lineHeight: string;
|
|
295
|
+
fontWeight: string;
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
heading_2: {
|
|
299
|
+
small: {
|
|
300
|
+
fontSize: string;
|
|
301
|
+
lineHeight: string;
|
|
302
|
+
fontWeight: string;
|
|
303
|
+
};
|
|
304
|
+
base: {
|
|
305
|
+
fontSize: string;
|
|
306
|
+
lineHeight: string;
|
|
307
|
+
fontWeight: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
heading_3: {
|
|
311
|
+
small: {
|
|
312
|
+
fontSize: string;
|
|
313
|
+
lineHeight: string;
|
|
314
|
+
fontWeight: string;
|
|
315
|
+
};
|
|
316
|
+
base: {
|
|
317
|
+
fontSize: string;
|
|
318
|
+
lineHeight: string;
|
|
319
|
+
fontWeight: string;
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
heading_4: {
|
|
323
|
+
small: {
|
|
324
|
+
fontSize: string;
|
|
325
|
+
lineHeight: string;
|
|
326
|
+
fontWeight: string;
|
|
327
|
+
};
|
|
328
|
+
base: {
|
|
329
|
+
fontSize: string;
|
|
330
|
+
lineHeight: string;
|
|
331
|
+
fontWeight: string;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
heading_5: {
|
|
335
|
+
small: {
|
|
336
|
+
fontSize: string;
|
|
337
|
+
lineHeight: string;
|
|
338
|
+
fontWeight: string;
|
|
339
|
+
};
|
|
340
|
+
base: {
|
|
341
|
+
fontSize: string;
|
|
342
|
+
lineHeight: string;
|
|
343
|
+
fontWeight: string;
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
body: {
|
|
347
|
+
small: {
|
|
348
|
+
fontSize: string;
|
|
349
|
+
lineHeight: string;
|
|
350
|
+
fontWeight: string;
|
|
351
|
+
};
|
|
352
|
+
base: {
|
|
353
|
+
fontSize: string;
|
|
354
|
+
lineHeight: string;
|
|
355
|
+
fontWeight: string;
|
|
356
|
+
};
|
|
357
|
+
};
|
|
358
|
+
small: {
|
|
359
|
+
small: {
|
|
360
|
+
fontSize: string;
|
|
361
|
+
lineHeight: string;
|
|
362
|
+
fontWeight: string;
|
|
363
|
+
};
|
|
364
|
+
base: {
|
|
365
|
+
fontSize: string;
|
|
366
|
+
lineHeight: string;
|
|
367
|
+
fontWeight: string;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { tokens } from './';
|
|
3
|
+
export interface DataTestAutoId {
|
|
4
|
+
"data-testautoid"?: string;
|
|
5
|
+
}
|
|
6
|
+
export type ColorScheme = "light" | "dark";
|
|
7
|
+
export type Density = "comfortable" | "compact";
|
|
8
|
+
export type Easing = keyof typeof tokens.motion.easing;
|
|
9
|
+
export type Timing = keyof typeof tokens.motion.timing;
|
|
10
|
+
/**
|
|
11
|
+
* Etter React 18 er ikke children lenger en _implicit type_. Tanken er at
|
|
12
|
+
* TypeScript skal kunne oppdage når komponenten forventer children og ikke
|
|
13
|
+
* får det, eller at komponenten blir _gitt_ children men ikke forventer det.
|
|
14
|
+
*
|
|
15
|
+
* Om komponenten din ikke tar i mot children er det i prinsippet ikke noe du
|
|
16
|
+
* trenger å gjøre. Om den derimot tar i mot children bør du spesifisere det.
|
|
17
|
+
* Dersom de er valgfrie (for eksempel om du har en standardverdi) bruker du
|
|
18
|
+
* WithOptionalChildren.
|
|
19
|
+
*
|
|
20
|
+
* @see WithOptionalChildren
|
|
21
|
+
* @see https://solverfox.dev/writing/no-implicit-children/
|
|
22
|
+
*/
|
|
23
|
+
export interface WithChildren {
|
|
24
|
+
children: ReactNode | ReactNode[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Etter React 18 er ikke children lenger en _implicit type_. Tanken er at
|
|
28
|
+
* TypeScript skal kunne oppdage når komponenten forventer children og ikke
|
|
29
|
+
* får det, eller at komponenten blir _gitt_ children men ikke forventer det.
|
|
30
|
+
*
|
|
31
|
+
* Om komponenten din ikke tar i mot children er det i prinsippet ikke noe du
|
|
32
|
+
* trenger å gjøre. Om den derimot tar i mot children bør du spesifisere det.
|
|
33
|
+
*
|
|
34
|
+
* Om du alltid forventer å få children, bruk WithChildren.
|
|
35
|
+
*
|
|
36
|
+
* @see WithChildren
|
|
37
|
+
* @see https://solverfox.dev/writing/no-implicit-children/
|
|
38
|
+
*/
|
|
39
|
+
export interface WithOptionalChildren {
|
|
40
|
+
children?: ReactNode | ReactNode[];
|
|
41
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as o,jsx as n}from"react/jsx-runtime";import i
|
|
1
|
+
import{jsxs as o,jsx as n}from"react/jsx-runtime";import{c as i}from"../../../clsx-BeLtu-UY.js";import{forwardRef as c}from"react";import"../../hooks/useScreen/useScreen.js";import"../../hooks/useId/useId.js";import{useSwipeGesture as s}from"../../hooks/useSwipeGesture/useSwipeGesture.js";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import{CheckIcon as e}from"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import"../icon/icons/SuccessIcon.js";import"../icon/icons/WarningIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import"../icon/icons/TrashCanIcon.js";import"../icon/icons/PenIcon.js";const r=c(((c,r)=>{const{"aria-checked":t,className:m,children:a,icon:l,onChange:p,onClick:j,onPointerCancel:I,onPointerDown:h,onPointerMove:d,onPointerUp:u,onKeyDown:k,...w}=c,{gestureHandlers:g}=s({onClick:o=>{o.preventDefault(),null==p||p(o,!t),null==j||j(o)},onChange:(o,n)=>{n!==t&&(null==p||p(o,n))},onPointerCancel:I,onPointerDown:h,onPointerMove:d,onPointerUp:u});return o("div",{ref:r,tabIndex:-1,...w,role:"menuitemcheckbox","aria-checked":t,className:i("jkl-menu-item","jkl-menu-item--checkbox",m),...g,onKeyDown:o=>{"Enter"===o.key?null==p||p(o,!t):" "===o.key&&(o.preventDefault(),null==p||p(o,!t)),null==k||k(o)},children:[l&&n("span",{className:"jkl-menu-item__icon",children:l}),n("div",{className:"jkl-menu-item__content",children:a}),n("div",{className:"jkl-toggle-switch",children:n("div",{className:"jkl-toggle-switch-widget",children:o("div",{className:"jkl-toggle-switch-widget__slider",children:[n("div",{className:"jkl-toggle-switch-widget__knob"}),n(e,{variant:"small",bold:!0,className:"jkl-toggle-switch-widget__indicator"})]})})})]})}));r.displayName="MenuItemCheckbox";export{r as MenuItemCheckbox};
|
|
2
2
|
//# sourceMappingURL=MenuItemCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItemCheckbox.js","sources":["../../../../src/components/menu/MenuItemCheckbox.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"MenuItemCheckbox.js","sources":["../../../../src/components/menu/MenuItemCheckbox.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, {\n forwardRef,\n type HTMLAttributes,\n type KeyboardEventHandler,\n type MouseEventHandler,\n type ReactNode,\n} from \"react\";\nimport { useSwipeGesture, type SwipeChangeHandler } from \"../../hooks\";\nimport { CheckIcon } from \"../icon\";\n\nexport interface MenuItemCheckboxProps extends Omit<HTMLAttributes<HTMLDivElement>, \"aria-checked\" | \"onChange\"> {\n \"aria-checked\": boolean;\n /**\n * Et ikon som vises før innholdet i menypunktet\n */\n icon?: ReactNode;\n onChange?: SwipeChangeHandler<HTMLDivElement> &\n ((event: React.KeyboardEvent<HTMLDivElement> | React.PointerEvent<HTMLDivElement>, pressed: boolean) => void);\n}\n\nexport const MenuItemCheckbox = forwardRef<HTMLDivElement, MenuItemCheckboxProps>((props, ref) => {\n const {\n \"aria-checked\": checked,\n className,\n children,\n icon,\n onChange,\n onClick,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onKeyDown,\n ...rest\n } = props;\n\n const handleClick: MouseEventHandler<HTMLDivElement> = (event) => {\n event.preventDefault(); // Prevents the menu from closing on toggle\n onChange?.(event, !checked);\n onClick?.(event);\n };\n\n const handleChange: SwipeChangeHandler<HTMLDivElement> = (event, toggleTo) => {\n if (toggleTo !== checked) {\n onChange?.(event, toggleTo);\n }\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLDivElement> = (event) => {\n if (event.key === \"Enter\") {\n onChange?.(event, !checked);\n } else if (event.key === \" \") {\n event.preventDefault(); // Prevents the menu from closing on toggle, https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menuitemcheckbox_role#keyboard_interactions\n onChange?.(event, !checked);\n }\n onKeyDown?.(event);\n };\n\n const { gestureHandlers } = useSwipeGesture({\n onClick: handleClick,\n onChange: handleChange,\n onPointerCancel,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n });\n\n return (\n <div\n ref={ref}\n tabIndex={-1}\n {...rest}\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n className={clsx(\"jkl-menu-item\", \"jkl-menu-item--checkbox\", className)}\n {...gestureHandlers}\n onKeyDown={handleKeyDown}\n >\n {icon && <span className=\"jkl-menu-item__icon\">{icon}</span>}\n <div className=\"jkl-menu-item__content\">{children}</div>\n <div className=\"jkl-toggle-switch\">\n <div className=\"jkl-toggle-switch-widget\">\n <div className=\"jkl-toggle-switch-widget__slider\">\n <div className=\"jkl-toggle-switch-widget__knob\" />\n <CheckIcon variant=\"small\" bold className=\"jkl-toggle-switch-widget__indicator\" />\n </div>\n </div>\n </div>\n </div>\n );\n});\n\nMenuItemCheckbox.displayName = \"MenuItemCheckbox\";\n"],"names":["MenuItemCheckbox","forwardRef","props","ref","checked","className","children","icon","onChange","onClick","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","onKeyDown","rest","gestureHandlers","useSwipeGesture","event","preventDefault","toggleTo","jsxs","tabIndex","role","clsx","key","jsx","CheckIcon","variant","bold","displayName"],"mappings":"ynDAqBO,MAAMA,EAAmBC,GAAkD,CAACC,EAAOC,KAChF,MACF,eAAgBC,EAChBC,UAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAC,SAAAA,EACAC,QAAAA,EACAC,gBAAAA,EACAC,cAAAA,EACAC,cAAAA,EACAC,YAAAA,EACAC,UAAAA,KACGC,GACHb,GAwBIc,gBAAAA,GAAoBC,EAAgB,CACxCR,QAvBoDS,IACpDA,EAAMC,iBACK,MAAAX,GAAAA,EAAAU,GAAQd,GACnB,MAAAK,GAAAA,EAAUS,EAAAA,EAqBVV,SAlBqD,CAACU,EAAOE,KACzDA,IAAahB,IACb,MAAAI,GAAAA,EAAWU,EAAOE,GAAAA,EAiBtBV,gBAAAA,EACAC,cAAAA,EACAC,cAAAA,EACAC,YAAAA,IAIA,OAAAQ,EAAC,MAAA,CACGlB,IAAAA,EACAmB,UAAU,KACNP,EACJQ,KAAK,mBACL,eAAcnB,EACdC,UAAWmB,EAAK,gBAAiB,0BAA2BnB,MACxDW,EACJF,UA5BqDI,IACvC,UAAdA,EAAMO,IACK,MAAAjB,GAAAA,EAAAU,GAAQd,GACE,MAAdc,EAAMO,MACbP,EAAMC,iBACK,MAAAX,GAAAA,EAAAU,GAAQd,IAEvB,MAAAU,GAAAA,EAAYI,EAAAA,EAuBPZ,SAAA,CAAAC,GAASmB,EAAA,OAAA,CAAKrB,UAAU,sBAAuBC,SAAKC,IACpDmB,EAAA,MAAA,CAAIrB,UAAU,yBAA0BC,SAAAA,IACzCoB,EAAC,MAAI,CAAArB,UAAU,oBACXC,SAAAoB,EAAC,MAAI,CAAArB,UAAU,2BACXC,SAAAe,EAAC,MAAI,CAAAhB,UAAU,mCACXC,SAAA,CAACoB,EAAA,MAAA,CAAIrB,UAAU,qCACdsB,EAAU,CAAAC,QAAQ,QAAQC,MAAI,EAACxB,UAAU,iDAGtD,IAKZL,EAAiB8B,YAAc"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { useAnimatedDetails } from './useAnimatedDetails';
|
|
2
|
+
export { useAnimatedHeight, useAnimatedHeightBetween, useAutoAnimatedHeight, type UseAutoAnimatedHeightOptions, type UseAnimatedHeightOptions, } from './useAnimatedHeight';
|
|
3
|
+
export { useBrowserPreferences } from './/useBrowserPreferences';
|
|
4
|
+
export { useIntersectionObserver } from './useIntersectionObserver';
|
|
5
|
+
export { useLocalStorage } from './useLocalStorage/useLocalStorage';
|
|
6
|
+
export { useMutationObserver } from './useMutationObserver';
|
|
7
|
+
export { usePreviousValue } from './usePreviousValue';
|
|
8
|
+
export { useProgressiveImg, type ProgressiveImageProps } from './useProgressiveImg';
|
|
9
|
+
export { useScreen, type ScreenState } from './useScreen';
|
|
10
|
+
export { useScrollIntoView, type ScrollIntoViewProps } from './useScrollIntoView';
|
|
11
|
+
export { useAriaLiveRegion, type UseAriaLiveRegionOptions } from './useAriaLiveRegion';
|
|
12
|
+
export { useClickOutside } from './useClickOutside';
|
|
13
|
+
export { useFocusOutside } from './useFocusOutside';
|
|
14
|
+
export { useElementDimensions, type Dimensions } from './useElementDimensions';
|
|
15
|
+
export { useId } from './useId';
|
|
16
|
+
export { useKeyListener } from './useKeyListener';
|
|
17
|
+
export { useListNavigation } from './useListNavigation';
|
|
18
|
+
export { useSwipeGesture, type SwipeChangeHandler } from './useSwipeGesture';
|