@fremtind/jokul 0.37.14 → 0.37.16
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 +2230 -2123
- package/build/cjs/components/accordion/AccordionItem.cjs.map +1 -1
- package/build/cjs/components/autosuggest/Autosuggest.cjs +1 -1
- package/build/cjs/components/autosuggest/Autosuggest.cjs.map +1 -1
- package/build/cjs/components/autosuggest/BaseAutosuggest.cjs +3 -3
- package/build/cjs/components/autosuggest/BaseAutosuggest.cjs.map +1 -1
- package/build/cjs/components/autosuggest/ControllerButton.cjs.map +1 -1
- package/build/cjs/components/autosuggest/utils.cjs.map +1 -1
- package/build/cjs/components/breadcrumb/Breadcrumb.cjs.map +1 -1
- package/build/cjs/components/button/Button.cjs.map +1 -1
- package/build/cjs/components/card/Card.cjs.map +1 -1
- package/build/cjs/components/card/CardImage.cjs.map +1 -1
- package/build/cjs/components/card/NavCard.cjs.map +1 -1
- package/build/cjs/components/checkbox/Checkbox.cjs.map +1 -1
- package/build/cjs/components/combobox/Combobox.cjs.map +1 -1
- package/build/cjs/components/cookie-consent/CookieConsentContext.cjs.map +1 -1
- package/build/cjs/components/cookie-consent/CookieConsentModal.cjs.map +1 -1
- package/build/cjs/components/cookie-consent/consents/CustomConsents.cjs.map +1 -1
- package/build/cjs/components/cookie-consent/consents/DefaultConsents.cjs.map +1 -1
- package/build/cjs/components/cookie-consent/cookieConsentUtils.cjs.map +1 -1
- package/build/cjs/components/cookie-consent/cookieConsentUtils.d.cts +3 -3
- package/build/cjs/components/datepicker/DatePicker.cjs.map +1 -1
- package/build/cjs/components/datepicker/internal/Calendar.cjs.map +1 -1
- package/build/cjs/components/datepicker/internal/calendarReducer.cjs.map +1 -1
- package/build/cjs/components/datepicker/internal/useCalendar.cjs.map +1 -1
- package/build/cjs/components/datepicker/internal/utils.cjs.map +1 -1
- package/build/cjs/components/expander/ExpandablePanel.cjs.map +1 -1
- package/build/cjs/components/expander/ExpandablePanelContent.cjs.map +1 -1
- package/build/cjs/components/expander/Expander.cjs.map +1 -1
- package/build/cjs/components/expander/deprecated/ExpandSection.cjs.map +1 -1
- package/build/cjs/components/expander/deprecated/Expander.cjs.map +1 -1
- package/build/cjs/components/feedback/Feedback.cjs.map +1 -1
- package/build/cjs/components/feedback/feedbackContext.cjs.map +1 -1
- package/build/cjs/components/feedback/followup/Followup.cjs.map +1 -1
- package/build/cjs/components/feedback/followup/useFollowup.cjs.map +1 -1
- package/build/cjs/components/feedback/main-question/MainQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/main-question/useMainQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/AddonQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/CheckboxQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/ContactQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/RadioQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/SmileyQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/TextQuestion.cjs.map +1 -1
- package/build/cjs/components/feedback/questions/smileyUtils.cjs.map +1 -1
- package/build/cjs/components/feedback/utils.cjs.map +1 -1
- package/build/cjs/components/file-input/File.cjs.map +1 -1
- package/build/cjs/components/file-input/FileInput.cjs.map +1 -1
- package/build/cjs/components/file-input/internal/Dropzone.cjs.map +1 -1
- package/build/cjs/components/file-input/internal/Input.cjs.map +1 -1
- package/build/cjs/components/file-input/internal/fileInputContext.cjs.map +1 -1
- package/build/cjs/components/file-input/internal/validateFile.cjs.map +1 -1
- package/build/cjs/components/flex/Flex.cjs.map +1 -1
- package/build/cjs/components/icon/icons/GreenCheckIcon.cjs.map +1 -1
- package/build/cjs/components/icon/icons/RedCrossIcon.cjs.map +1 -1
- package/build/cjs/components/icon/types.d.cts +0 -1
- package/build/cjs/components/icon-button/IconButton.cjs.map +1 -1
- package/build/cjs/components/image/Image.cjs.map +1 -1
- package/build/cjs/components/image/useImageLoadingStatus.cjs.map +1 -1
- package/build/cjs/components/input-group/FieldGroup.cjs.map +1 -1
- package/build/cjs/components/input-group/InputGroup.cjs.map +1 -1
- package/build/cjs/components/input-group/InputGroup.d.cts +9 -9
- package/build/cjs/components/input-group/Label.cjs.map +1 -1
- package/build/cjs/components/input-group/SupportLabel.cjs.map +1 -1
- package/build/cjs/components/input-panel/RadioPanel.cjs.map +1 -1
- package/build/cjs/components/input-panel/RadioPanelGroup.cjs.map +1 -1
- package/build/cjs/components/input-panel/radioPanelContext.d.cts +0 -1
- package/build/cjs/components/link-list/LinkList.cjs.map +1 -1
- package/build/cjs/components/list/List.cjs.map +1 -1
- package/build/cjs/components/list/types.d.cts +0 -1
- package/build/cjs/components/loader/Loader.cjs.map +1 -1
- package/build/cjs/components/loader/skeletons/SkeletonAnimation.cjs.map +1 -1
- package/build/cjs/components/loader/skeletons/SkeletonLabel.cjs.map +1 -1
- package/build/cjs/components/loader/skeletons/SkeletonTextArea.cjs.map +1 -1
- package/build/cjs/components/logo/Logo.cjs.map +1 -1
- package/build/cjs/components/logo/LogoStamp.cjs.map +1 -1
- package/build/cjs/components/logo/useTextSpinner.cjs.map +1 -1
- package/build/cjs/components/menu/Menu.cjs.map +1 -1
- package/build/cjs/components/menu/MenuItem.cjs.map +1 -1
- package/build/cjs/components/menu/MenuItemCheckbox.cjs.map +1 -1
- package/build/cjs/components/menu/useMenuWideEvents.cjs.map +1 -1
- package/build/cjs/components/message/FormErrorMessage.cjs.map +1 -1
- package/build/cjs/components/message/Message.cjs.map +1 -1
- package/build/cjs/components/modal/Modal.cjs.map +1 -1
- package/build/cjs/components/modal/Modal.d.cts +2 -2
- package/build/cjs/components/modal/useModal.cjs.map +1 -1
- package/build/cjs/components/pagination/Pagination.cjs.map +1 -1
- package/build/cjs/components/popover/Popover.cjs.map +1 -1
- package/build/cjs/components/progress-bar/Countdown.cjs.map +1 -1
- package/build/cjs/components/progress-bar/ProgressBar.cjs.map +1 -1
- package/build/cjs/components/radio-button/BaseRadioButton.cjs.map +1 -1
- package/build/cjs/components/radio-button/RadioButton.cjs.map +1 -1
- package/build/cjs/components/radio-button/RadioButtonGroup.cjs.map +1 -1
- package/build/cjs/components/select/NativeSelect.cjs.map +1 -1
- package/build/cjs/components/select/Select.cjs.map +1 -1
- package/build/cjs/components/system-message/SystemMessage.cjs.map +1 -1
- package/build/cjs/components/system-message/common/MessageIcon.cjs.map +1 -1
- package/build/cjs/components/table/ExpandableTableRowController.cjs.map +1 -1
- package/build/cjs/components/table/Table.cjs.map +1 -1
- package/build/cjs/components/table/TableCell.cjs.map +1 -1
- package/build/cjs/components/table/TableHead.cjs.map +1 -1
- package/build/cjs/components/table/TableHeader.cjs.map +1 -1
- package/build/cjs/components/table/TablePagination.cjs.map +1 -1
- package/build/cjs/components/table/TableRow.cjs.map +1 -1
- package/build/cjs/components/table/utils.cjs.map +1 -1
- package/build/cjs/components/tabs/NavTab.cjs.map +1 -1
- package/build/cjs/components/tabs/NavTabs.cjs.map +1 -1
- package/build/cjs/components/tabs/Tab.cjs.map +1 -1
- package/build/cjs/components/tabs/TabList.cjs.map +1 -1
- package/build/cjs/components/tabs/TabPanel.cjs.map +1 -1
- package/build/cjs/components/tabs/Tabs.cjs.map +1 -1
- package/build/cjs/components/text-input/BaseTextArea.cjs.map +1 -1
- package/build/cjs/components/text-input/BaseTextInput.cjs.map +1 -1
- package/build/cjs/components/text-input/TextArea.cjs.map +1 -1
- package/build/cjs/components/text-input/TextInput.cjs.map +1 -1
- package/build/cjs/components/toast/Toast.cjs.map +1 -1
- package/build/cjs/components/toast/toastContext.cjs.map +1 -1
- package/build/cjs/components/toggle-switch/ToggleSlider.cjs.map +1 -1
- package/build/cjs/components/toggle-switch/ToggleSwitch.cjs.map +1 -1
- package/build/cjs/components/toggle-switch/ToggleSwitch.d.cts +2 -2
- package/build/cjs/components/toggle-switch/usePillStyles.cjs.map +1 -1
- package/build/cjs/components/tooltip/PopupTip.cjs.map +1 -1
- package/build/cjs/components/tooltip/Tooltip.cjs.map +1 -1
- package/build/cjs/components/tooltip/TooltipContent.cjs.map +1 -1
- package/build/cjs/components/tooltip/TooltipContent.d.cts +1 -1
- package/build/cjs/components/tooltip/TooltipTrigger.cjs.map +1 -1
- package/build/cjs/hooks/useAnimatedDetails/useAnimatedDetails.cjs.map +1 -1
- package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.cjs.map +1 -1
- package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.cjs.map +1 -1
- package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.cjs.map +1 -1
- package/build/cjs/hooks/useAriaLiveRegion/useAriaLiveRegion.cjs.map +1 -1
- package/build/cjs/hooks/useBrowserPreferences/useBrowserPreferences.cjs.map +1 -1
- package/build/cjs/hooks/useClickOutside/useClickOutside.cjs.map +1 -1
- package/build/cjs/hooks/useElementDimensions/useElementDimensions.cjs.map +1 -1
- package/build/cjs/hooks/useFocusOutside/useFocusOutside.cjs.map +1 -1
- package/build/cjs/hooks/useIntersectionObserver/useIntersectionObserver.cjs.map +1 -1
- package/build/cjs/hooks/useKeyListener/useKeyListener.cjs.map +1 -1
- package/build/cjs/hooks/useListNavigation/useListNavigation.cjs.map +1 -1
- package/build/cjs/hooks/useMutationObserver/useMutationObserver.cjs.map +1 -1
- package/build/cjs/hooks/useProgressiveImg/useProgressiveImg.cjs.map +1 -1
- package/build/cjs/hooks/useScreen/state.cjs.map +1 -1
- package/build/cjs/hooks/useScreen/useScreen.cjs.map +1 -1
- package/build/cjs/utilities/formatters/avstand/formatAvstand.cjs.map +1 -1
- package/build/cjs/utilities/formatters/bytes/formatBytes.cjs.map +1 -1
- package/build/cjs/utilities/formatters/fodselsnummer/formatFodselsnummer.cjs.map +1 -1
- package/build/cjs/utilities/formatters/kontonummer/formatKontonummer.cjs.map +1 -1
- package/build/cjs/utilities/formatters/kortnummer/formatKortnummer.cjs.map +1 -1
- package/build/cjs/utilities/formatters/organisasjonsnummer/formatOrganisasjonsnummer.cjs.map +1 -1
- package/build/cjs/utilities/formatters/telefonnummer/formatTelefonnummer.cjs.map +1 -1
- package/build/cjs/utilities/formatters/util/registerWithMask.cjs.map +1 -1
- package/build/cjs/utilities/formatters/util/registerWithMask.d.cts +11 -11
- package/build/cjs/utilities/getThemeAndDensity.cjs.map +1 -1
- package/build/cjs/utilities/getThemeAndDensity.d.cts +2 -2
- package/build/cjs/utilities/polymorphism/SlotComponent.cjs.map +1 -1
- package/build/cjs/utilities/polymorphism/mergeProps.cjs.map +1 -1
- package/build/cjs/utilities/polymorphism/polymorphism.d.cts +0 -1
- package/build/cjs/utilities/tabListener.cjs.map +1 -1
- package/build/cjs/utilities/validators/isValidKortnummer/isValidKortnummer.cjs.map +1 -1
- package/build/es/components/accordion/AccordionItem.js.map +1 -1
- package/build/es/components/autosuggest/Autosuggest.js +1 -1
- package/build/es/components/autosuggest/Autosuggest.js.map +1 -1
- package/build/es/components/autosuggest/BaseAutosuggest.js +4 -4
- package/build/es/components/autosuggest/BaseAutosuggest.js.map +1 -1
- package/build/es/components/autosuggest/utils.js.map +1 -1
- package/build/es/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/build/es/components/button/Button.js.map +1 -1
- package/build/es/components/card/NavCard.js.map +1 -1
- package/build/es/components/checkbox/Checkbox.js.map +1 -1
- package/build/es/components/combobox/Combobox.js.map +1 -1
- package/build/es/components/cookie-consent/CookieConsentContext.js.map +1 -1
- package/build/es/components/cookie-consent/CookieConsentModal.js.map +1 -1
- package/build/es/components/cookie-consent/consents/CustomConsents.js.map +1 -1
- package/build/es/components/cookie-consent/cookieConsentUtils.d.ts +3 -3
- package/build/es/components/cookie-consent/cookieConsentUtils.js.map +1 -1
- package/build/es/components/datepicker/DatePicker.js.map +1 -1
- package/build/es/components/datepicker/internal/Calendar.js.map +1 -1
- package/build/es/components/datepicker/internal/calendarReducer.js.map +1 -1
- package/build/es/components/datepicker/internal/useCalendar.js.map +1 -1
- package/build/es/components/datepicker/internal/utils.js.map +1 -1
- package/build/es/components/expander/ExpandablePanelContent.js.map +1 -1
- package/build/es/components/expander/Expander.js.map +1 -1
- package/build/es/components/expander/deprecated/ExpandSection.js.map +1 -1
- package/build/es/components/expander/deprecated/Expander.js.map +1 -1
- package/build/es/components/feedback/Feedback.js.map +1 -1
- package/build/es/components/feedback/followup/useFollowup.js.map +1 -1
- package/build/es/components/feedback/main-question/useMainQuestion.js.map +1 -1
- package/build/es/components/feedback/questions/CheckboxQuestion.js.map +1 -1
- package/build/es/components/feedback/questions/ContactQuestion.js.map +1 -1
- package/build/es/components/feedback/questions/RadioQuestion.js.map +1 -1
- package/build/es/components/feedback/questions/SmileyQuestion.js.map +1 -1
- package/build/es/components/feedback/questions/TextQuestion.js.map +1 -1
- package/build/es/components/feedback/questions/smileyUtils.js.map +1 -1
- package/build/es/components/feedback/utils.js.map +1 -1
- package/build/es/components/file-input/File.js.map +1 -1
- package/build/es/components/file-input/FileInput.js.map +1 -1
- package/build/es/components/file-input/internal/Dropzone.js.map +1 -1
- package/build/es/components/file-input/internal/Input.js.map +1 -1
- package/build/es/components/flex/Flex.js.map +1 -1
- package/build/es/components/icon/types.d.ts +0 -1
- package/build/es/components/icon-button/IconButton.js.map +1 -1
- package/build/es/components/image/Image.js.map +1 -1
- package/build/es/components/image/useImageLoadingStatus.js.map +1 -1
- package/build/es/components/input-group/FieldGroup.js.map +1 -1
- package/build/es/components/input-group/InputGroup.d.ts +9 -9
- package/build/es/components/input-group/InputGroup.js.map +1 -1
- package/build/es/components/input-group/Label.js.map +1 -1
- package/build/es/components/input-group/SupportLabel.js.map +1 -1
- package/build/es/components/input-panel/RadioPanel.js.map +1 -1
- package/build/es/components/input-panel/radioPanelContext.d.ts +0 -1
- package/build/es/components/list/types.d.ts +0 -1
- package/build/es/components/loader/Loader.js.map +1 -1
- package/build/es/components/loader/skeletons/SkeletonAnimation.js.map +1 -1
- package/build/es/components/loader/skeletons/SkeletonLabel.js.map +1 -1
- package/build/es/components/loader/skeletons/SkeletonTextArea.js.map +1 -1
- package/build/es/components/logo/Logo.js.map +1 -1
- package/build/es/components/logo/LogoStamp.js.map +1 -1
- package/build/es/components/menu/Menu.js.map +1 -1
- package/build/es/components/menu/MenuItem.js.map +1 -1
- package/build/es/components/menu/MenuItemCheckbox.js.map +1 -1
- package/build/es/components/menu/useMenuWideEvents.js.map +1 -1
- package/build/es/components/message/FormErrorMessage.js.map +1 -1
- package/build/es/components/message/Message.js.map +1 -1
- package/build/es/components/modal/Modal.d.ts +2 -2
- package/build/es/components/pagination/Pagination.js.map +1 -1
- package/build/es/components/popover/Popover.js.map +1 -1
- package/build/es/components/progress-bar/Countdown.js.map +1 -1
- package/build/es/components/progress-bar/ProgressBar.js.map +1 -1
- package/build/es/components/radio-button/BaseRadioButton.js.map +1 -1
- package/build/es/components/radio-button/RadioButtonGroup.js.map +1 -1
- package/build/es/components/select/NativeSelect.js.map +1 -1
- package/build/es/components/select/Select.js.map +1 -1
- package/build/es/components/system-message/SystemMessage.js.map +1 -1
- package/build/es/components/system-message/common/MessageIcon.js.map +1 -1
- package/build/es/components/table/ExpandableTableRowController.js.map +1 -1
- package/build/es/components/table/Table.js.map +1 -1
- package/build/es/components/table/TableCell.js.map +1 -1
- package/build/es/components/table/TableHead.js.map +1 -1
- package/build/es/components/table/TableHeader.js.map +1 -1
- package/build/es/components/table/TablePagination.js.map +1 -1
- package/build/es/components/table/TableRow.js.map +1 -1
- package/build/es/components/table/utils.js.map +1 -1
- package/build/es/components/tabs/NavTab.js.map +1 -1
- package/build/es/components/tabs/NavTabs.js.map +1 -1
- package/build/es/components/tabs/Tab.js.map +1 -1
- package/build/es/components/tabs/TabList.js.map +1 -1
- package/build/es/components/tabs/Tabs.js.map +1 -1
- package/build/es/components/text-input/BaseTextArea.js.map +1 -1
- package/build/es/components/text-input/BaseTextInput.js.map +1 -1
- package/build/es/components/text-input/TextArea.js.map +1 -1
- package/build/es/components/text-input/TextInput.js.map +1 -1
- package/build/es/components/toast/Toast.js.map +1 -1
- package/build/es/components/toast/toastContext.js.map +1 -1
- package/build/es/components/toggle-switch/ToggleSlider.js.map +1 -1
- package/build/es/components/toggle-switch/ToggleSwitch.d.ts +2 -2
- package/build/es/components/toggle-switch/ToggleSwitch.js.map +1 -1
- package/build/es/components/toggle-switch/usePillStyles.js.map +1 -1
- package/build/es/components/tooltip/Tooltip.js.map +1 -1
- package/build/es/components/tooltip/TooltipContent.d.ts +1 -1
- package/build/es/components/tooltip/TooltipTrigger.js.map +1 -1
- package/build/es/hooks/useAnimatedDetails/useAnimatedDetails.js.map +1 -1
- package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -1
- package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -1
- package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -1
- package/build/es/hooks/useAriaLiveRegion/useAriaLiveRegion.js.map +1 -1
- package/build/es/hooks/useBrowserPreferences/useBrowserPreferences.js.map +1 -1
- package/build/es/hooks/useClickOutside/useClickOutside.js.map +1 -1
- package/build/es/hooks/useElementDimensions/useElementDimensions.js.map +1 -1
- package/build/es/hooks/useFocusOutside/useFocusOutside.js.map +1 -1
- package/build/es/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -1
- package/build/es/hooks/useKeyListener/useKeyListener.js.map +1 -1
- package/build/es/hooks/useListNavigation/useListNavigation.js.map +1 -1
- package/build/es/hooks/useMutationObserver/useMutationObserver.js.map +1 -1
- package/build/es/hooks/useProgressiveImg/useProgressiveImg.js.map +1 -1
- package/build/es/hooks/useScreen/state.js.map +1 -1
- package/build/es/hooks/useScreen/useScreen.js.map +1 -1
- package/build/es/utilities/formatters/util/registerWithMask.d.ts +11 -11
- package/build/es/utilities/formatters/util/registerWithMask.js.map +1 -1
- package/build/es/utilities/getThemeAndDensity.d.ts +2 -2
- package/build/es/utilities/getThemeAndDensity.js.map +1 -1
- package/build/es/utilities/polymorphism/SlotComponent.js.map +1 -1
- package/build/es/utilities/polymorphism/mergeProps.js.map +1 -1
- package/build/es/utilities/polymorphism/polymorphism.d.ts +0 -1
- package/build/es/utilities/tabListener.js.map +1 -1
- package/build/es/utilities/validators/isValidKortnummer/isValidKortnummer.js.map +1 -1
- package/package.json +25 -25
- package/styles/components/accordion/accordion.min.css +1 -1
- package/styles/components/breadcrumb/breadcrumb.min.css +1 -1
- package/styles/components/button/button.css +2 -2
- package/styles/components/button/button.min.css +1 -1
- package/styles/components/card/card.min.css +1 -1
- package/styles/components/checkbox/checkbox.css +4 -4
- package/styles/components/checkbox/checkbox.min.css +1 -1
- package/styles/components/chip/chip.min.css +1 -1
- package/styles/components/combobox/combobox.css +2 -1
- package/styles/components/combobox/combobox.min.css +1 -1
- package/styles/components/combobox/combobox.scss +5 -3
- package/styles/components/cookie-consent/cookie-consent.min.css +1 -1
- package/styles/components/datepicker/datepicker.min.css +1 -1
- package/styles/components/description-list/description-list.min.css +1 -1
- package/styles/components/expander/deprecated/expander.min.css +1 -1
- package/styles/components/expander/expandable.min.css +1 -1
- package/styles/components/feedback/feedback.css +2 -2
- package/styles/components/feedback/feedback.min.css +1 -1
- package/styles/components/file-input/file-input.min.css +1 -1
- package/styles/components/icon-button/icon-button.css +2 -15
- package/styles/components/icon-button/icon-button.min.css +1 -1
- package/styles/components/icon-button/icon-button.scss +2 -6
- package/styles/components/input-group/input-group.css +2 -2
- package/styles/components/input-group/input-group.min.css +1 -1
- package/styles/components/input-panel/checkbox-panel.css +2 -2
- package/styles/components/input-panel/checkbox-panel.min.css +1 -1
- package/styles/components/input-panel/radio-panel.css +2 -2
- package/styles/components/input-panel/radio-panel.min.css +1 -1
- package/styles/components/input-panel/shared.min.css +1 -1
- package/styles/components/link/link.min.css +1 -1
- package/styles/components/link-list/link-list.min.css +1 -1
- package/styles/components/loader/loader.css +6 -6
- package/styles/components/loader/loader.min.css +1 -1
- package/styles/components/loader/skeleton-loader.css +5 -5
- package/styles/components/loader/skeleton-loader.min.css +1 -1
- package/styles/components/menu/menu.min.css +1 -1
- package/styles/components/message/message.css +2 -2
- package/styles/components/message/message.min.css +1 -1
- package/styles/components/modal/modal.min.css +1 -1
- package/styles/components/popover/popover.min.css +1 -1
- package/styles/components/progress-bar/progress-bar.css +2 -2
- package/styles/components/progress-bar/progress-bar.min.css +1 -1
- package/styles/components/radio-button/radio-button.css +2 -2
- package/styles/components/radio-button/radio-button.min.css +1 -1
- package/styles/components/select/select.css +14 -5
- package/styles/components/select/select.min.css +1 -1
- package/styles/components/select/select.scss +22 -5
- package/styles/components/system-message/system-message.css +2 -2
- package/styles/components/system-message/system-message.min.css +1 -1
- package/styles/components/table/table.min.css +1 -1
- package/styles/components/tabs/tabs.css +1 -2
- package/styles/components/tabs/tabs.min.css +1 -1
- package/styles/components/tabs/tabs.scss +1 -2
- package/styles/components/text-input/text-input.css +30 -11
- package/styles/components/text-input/text-input.min.css +1 -1
- package/styles/components/text-input/text-input.scss +20 -6
- package/styles/components/toast/toast.css +7 -17
- package/styles/components/toast/toast.min.css +1 -1
- package/styles/components/toast/toast.scss +5 -15
- package/styles/components/toggle-switch/toggle-switch.min.css +1 -1
- package/styles/components/tooltip/tooltip.min.css +1 -1
- package/styles/core/core.min.css +1 -1
- package/styles/styles.css +89 -84
- package/styles/styles.min.css +1 -1
- package/styles/vind/vind.min.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs","sources":["../../../../../src/components/file-input/internal/Input.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { useId } from \"../../../hooks/useId/useId.js\";\nimport { formatBytes } from \"../../../utilities/formatters/bytes/formatBytes.js\";\nimport { FileInputFile } from \"../types.js\";\nimport { useFileInputContext } from \"./fileInputContext.js\";\nimport { validateFile } from \"./validateFile.js\";\n\ninterface FileInputProps {\n id?: string;\n label: string;\n multiple: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, FileInputProps>(\n (props, ref) => {\n const { multiple, id: idProp, label, ...rest } = props;\n\n const id = useId(idProp || \"jkl-file-input\", {\n generateSuffix: !idProp,\n });\n const maxSizeDescriptionId = id + \"-description\";\n const descriptor = multiple ? \"filer\" : \"fil\";\n\n const context = useFileInputContext();\n if (!context) {\n return (\n <p>Input must be placed inside a FileInputContextProvider.</p>\n );\n }\n const { accept, maxSizeBytes, onChange, files } = context;\n\n return (\n <>\n <label\n className=\"jkl-button jkl-button--secondary\"\n htmlFor={id}\n >\n {label}\n </label>\n <input\n {...rest}\n ref={ref}\n id={id}\n accept={accept}\n aria-describedby={\n maxSizeBytes ? maxSizeDescriptionId : undefined\n }\n className=\"jkl-sr-only\"\n type=\"file\"\n multiple={multiple}\n onChange={(e) => {\n if (e.target.files) {\n onChange(\n e,\n [...e.target.files].map<FileInputFile>(\n (file) => ({\n file,\n state: \"SELECTED\",\n validation: validateFile(\n file,\n accept,\n maxSizeBytes,\n ),\n uploadProgress: 0,\n }),\n ),\n );\n }\n }}\n />\n {files.length === 0 && <p>eller slipp {descriptor} her</p>}\n {typeof maxSizeBytes !== \"undefined\" && (\n <div\n id={maxSizeDescriptionId}\n className=\"jkl-file-input__max-size-text\"\n >\n Maks {formatBytes(maxSizeBytes)} per fil\n </div>\n )}\n </>\n );\n },\n);\n\nInput.displayName = \"Input\";\n"],"names":["Input","forwardRef","props","ref","multiple","id","idProp","label","rest","useId","generateSuffix","maxSizeDescriptionId","descriptor","context","useFileInputContext","jsx","children","accept","maxSizeBytes","onChange","files","jsxs","Fragment","className","htmlFor","type","e","target","map","file","state","validation","validateFile","uploadProgress","length","formatBytes","displayName"],"mappings":"yTAaaA,EAAQC,EAAAA,YACjB,CAACC,EAAOC,KACJ,MAAQC,SAAAA,EAAUC,GAAIC,EAAQC,MAAAA,KAAUC,GAASN,EAE3CG,EAAKI,EAAAA,MAAMH,GAAU,iBAAkB,CACzCI,gBAAiBJ,IAEfK,EAAuBN,EAAK,eAC5BO,EAAaR,EAAW,QAAU,MAElCS,EAAUC,EAAAA,sBAChB,IAAKD,EAEG,OAAAE,EAAAA,IAAC,KAAEC,SAAuD,4DAGlE,MAAQC,OAAAA,EAAQC,aAAAA,EAAcC,SAAAA,EAAUC,MAAAA,GAAUP,EAElD,OAEQQ,EAAAA,KAAAC,WAAA,CAAAN,SAAA,CAAAD,EAAAA,IAAC,QAAA,CACGQ,UAAU,mCACVC,QAASnB,EAERW,SAAAT,IAELQ,EAAAA,IAAC,QAAA,IACOP,EACJL,IAAAA,EACAE,GAAAA,EACAY,OAAAA,EACA,mBACIC,EAAeP,OAAuB,EAE1CY,UAAU,cACVE,KAAK,OACLrB,SAAAA,EACAe,SAAWO,IACHA,EAAEC,OAAOP,OACTD,EACIO,EACA,IAAIA,EAAEC,OAAOP,OAAOQ,KACfC,IAAU,CACPA,KAAAA,EACAC,MAAO,WACPC,WAAYC,EAAAA,aACRH,EACAZ,EACAC,GAEJe,eAAgB,
|
|
1
|
+
{"version":3,"file":"Input.cjs","sources":["../../../../../src/components/file-input/internal/Input.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { useId } from \"../../../hooks/useId/useId.js\";\nimport { formatBytes } from \"../../../utilities/formatters/bytes/formatBytes.js\";\nimport { FileInputFile } from \"../types.js\";\nimport { useFileInputContext } from \"./fileInputContext.js\";\nimport { validateFile } from \"./validateFile.js\";\n\ninterface FileInputProps {\n id?: string;\n label: string;\n multiple: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, FileInputProps>(\n (props, ref) => {\n const { multiple, id: idProp, label, ...rest } = props;\n\n const id = useId(idProp || \"jkl-file-input\", {\n generateSuffix: !idProp,\n });\n const maxSizeDescriptionId = id + \"-description\";\n const descriptor = multiple ? \"filer\" : \"fil\";\n\n const context = useFileInputContext();\n if (!context) {\n return (\n <p>Input must be placed inside a FileInputContextProvider.</p>\n );\n }\n const { accept, maxSizeBytes, onChange, files } = context;\n\n return (\n <>\n <label\n className=\"jkl-button jkl-button--secondary\"\n htmlFor={id}\n >\n {label}\n </label>\n <input\n {...rest}\n ref={ref}\n id={id}\n accept={accept}\n aria-describedby={\n maxSizeBytes ? maxSizeDescriptionId : undefined\n }\n className=\"jkl-sr-only\"\n type=\"file\"\n multiple={multiple}\n onChange={(e) => {\n if (e.target.files) {\n onChange(\n e,\n [...e.target.files].map<FileInputFile>(\n (file) => ({\n file,\n state: \"SELECTED\",\n validation: validateFile(\n file,\n accept,\n maxSizeBytes,\n ),\n uploadProgress: 0,\n }),\n ),\n );\n }\n }}\n />\n {files.length === 0 && <p>eller slipp {descriptor} her</p>}\n {typeof maxSizeBytes !== \"undefined\" && (\n <div\n id={maxSizeDescriptionId}\n className=\"jkl-file-input__max-size-text\"\n >\n Maks {formatBytes(maxSizeBytes)} per fil\n </div>\n )}\n </>\n );\n },\n);\n\nInput.displayName = \"Input\";\n"],"names":["Input","forwardRef","props","ref","multiple","id","idProp","label","rest","useId","generateSuffix","maxSizeDescriptionId","descriptor","context","useFileInputContext","jsx","children","accept","maxSizeBytes","onChange","files","jsxs","Fragment","className","htmlFor","type","e","target","map","file","state","validation","validateFile","uploadProgress","length","formatBytes","displayName"],"mappings":"yTAaaA,EAAQC,EAAAA,YACjB,CAACC,EAAOC,KACJ,MAAQC,SAAAA,EAAUC,GAAIC,EAAQC,MAAAA,KAAUC,GAASN,EAE3CG,EAAKI,EAAAA,MAAMH,GAAU,iBAAkB,CACzCI,gBAAiBJ,IAEfK,EAAuBN,EAAK,eAC5BO,EAAaR,EAAW,QAAU,MAElCS,EAAUC,EAAAA,sBAChB,IAAKD,EAEG,OAAAE,EAAAA,IAAC,KAAEC,SAAuD,4DAGlE,MAAQC,OAAAA,EAAQC,aAAAA,EAAcC,SAAAA,EAAUC,MAAAA,GAAUP,EAElD,OAEQQ,EAAAA,KAAAC,WAAA,CAAAN,SAAA,CAAAD,EAAAA,IAAC,QAAA,CACGQ,UAAU,mCACVC,QAASnB,EAERW,SAAAT,IAELQ,EAAAA,IAAC,QAAA,IACOP,EACJL,IAAAA,EACAE,GAAAA,EACAY,OAAAA,EACA,mBACIC,EAAeP,OAAuB,EAE1CY,UAAU,cACVE,KAAK,OACLrB,SAAAA,EACAe,SAAWO,IACHA,EAAEC,OAAOP,OACTD,EACIO,EACA,IAAIA,EAAEC,OAAOP,OAAOQ,KACfC,IAAU,CACPA,KAAAA,EACAC,MAAO,WACPC,WAAYC,EAAAA,aACRH,EACAZ,EACAC,GAEJe,eAAgB,MAG5B,IAIM,IAAjBb,EAAMc,QAAgBb,EAAAA,KAAC,IAAE,CAAAL,SAAA,CAAA,eAAaJ,EAAW,iBAC1CM,EAAiB,KACrBG,EAAAA,KAAC,MAAA,CACGhB,GAAIM,EACJY,UAAU,gCACbP,SAAA,CAAA,QACSmB,EAAAA,YAAYjB,GAAc,gBAG5C,IAKZlB,EAAMoC,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileInputContext.cjs","sources":["../../../../../src/components/file-input/internal/fileInputContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport { WithChildren } from \"../../../core/types.js\";\nimport { FileInputFile } from \"../types.js\";\n\ntype FileInputContext = {\n accept?: \"image/*\" | \".pdf\" | \"image/*,.pdf\" | HTMLInputElement[\"accept\"];\n maxSizeBytes?: number;\n files: FileInputFile[];\n onChange: (\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.DragEvent<HTMLDivElement>,\n files: FileInputFile[],\n ) => void;\n};\n\nconst fileInputContext = createContext<FileInputContext | null>(null);\n\nexport const useFileInputContext = (): FileInputContext | null =>\n useContext(fileInputContext);\n\nexport interface FileInputContextProviderProps extends WithChildren {\n context: FileInputContext;\n}\n\nexport const FileInputContextProvider: React.FC<\n FileInputContextProviderProps\n> = ({ context, children }) => (\n <fileInputContext.Provider value={context}>\n {children}\n </fileInputContext.Provider>\n);\n"],"names":["fileInputContext","createContext","context","children","jsx","Provider","value","useContext"],"mappings":"wIAgBMA,EAAmBC,
|
|
1
|
+
{"version":3,"file":"fileInputContext.cjs","sources":["../../../../../src/components/file-input/internal/fileInputContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport { WithChildren } from \"../../../core/types.js\";\nimport { FileInputFile } from \"../types.js\";\n\ntype FileInputContext = {\n accept?: \"image/*\" | \".pdf\" | \"image/*,.pdf\" | HTMLInputElement[\"accept\"];\n maxSizeBytes?: number;\n files: FileInputFile[];\n onChange: (\n e:\n | React.ChangeEvent<HTMLInputElement>\n | React.DragEvent<HTMLDivElement>,\n files: FileInputFile[],\n ) => void;\n};\n\nconst fileInputContext = createContext<FileInputContext | null>(null);\n\nexport const useFileInputContext = (): FileInputContext | null =>\n useContext(fileInputContext);\n\nexport interface FileInputContextProviderProps extends WithChildren {\n context: FileInputContext;\n}\n\nexport const FileInputContextProvider: React.FC<\n FileInputContextProviderProps\n> = ({ context, children }) => (\n <fileInputContext.Provider value={context}>\n {children}\n </fileInputContext.Provider>\n);\n"],"names":["fileInputContext","createContext","context","children","jsx","Provider","value","useContext"],"mappings":"wIAgBMA,EAAmBC,gBAAuC,uCAW5D,EAAGC,QAAAA,EAASC,SAAAA,KACXC,EAAAA,IAAAJ,EAAiBK,SAAjB,CAA0BC,MAAOJ,EAC7BC,SAAAA,gCAX0B,IAC/BI,EAAAA,WAAWP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateFile.cjs","sources":["../../../../../src/components/file-input/internal/validateFile.ts"],"sourcesContent":["import { formatBytes } from \"../../../utilities/formatters/bytes/formatBytes.js\";\nimport type { FileInputFileValidation } from \"../types.js\";\n\nexport function validateFile(\n file: File,\n accept = \"\",\n maxSizeBytes?: number,\n): FileInputFileValidation | undefined {\n const acceptStrings = accept\n .split(\",\")\n .map((s) => s.toLowerCase())\n .map((s) => s.replaceAll(\"*\", \"\"))\n .map((s) => s.trim());\n\n let isValidFormat = acceptStrings.length === 0;\n\n isValidFormat = acceptStrings.reduce(\n (found, acceptString) =>\n found ||\n file.type.includes(acceptString) ||\n file.name.endsWith(acceptString),\n isValidFormat,\n );\n\n if (!isValidFormat) {\n return {\n type: \"WRONG_TYPE\",\n message: `Filtypen ${file.name?.split(\".\")[1] || \"\"} støttes ikke`,\n };\n }\n\n if (typeof maxSizeBytes != \"undefined\" && file.size > maxSizeBytes) {\n return {\n type: \"TOO_LARGE\",\n message: `Filen er ${formatBytes(\n file.size,\n )}, men kan maksimalt være ${formatBytes(maxSizeBytes)}`,\n };\n }\n\n return undefined;\n}\n"],"names":["file","accept","maxSizeBytes","acceptStrings","split","map","s","toLowerCase","replaceAll","trim","isValidFormat","length","reduce","found","acceptString","type","includes","name","endsWith","size","message","formatBytes","_a"],"mappings":"4KAGO,SACHA,EACAC,EAAS,GACTC,SAEM,MAAAC,EAAgBF,EACjBG,MAAM,KACNC,KAAKC,GAAMA,EAAEC,gBACbF,KAAKC,GAAMA,EAAEE,WAAW,IAAK,MAC7BH,KAAKC,GAAMA,EAAEG,SAEd,IAAAC,EAAyC,IAAzBP,EAAcQ,OAUlC,OARAD,EAAgBP,EAAcS,QAC1B,CAACC,EAAOC,IACJD,GACAb,EAAKe,KAAKC,SAASF,IACnBd,EAAKiB,KAAKC,SAASJ,IACvBJ,GAGCA,SAOMR,EAAgB,KAAeF,EAAKmB,KAAOjB,EAC3C,CACHa,KAAM,YACNK,QAAS,YAAYC,EAAAA,YACjBrB,EAAKmB,iCACoBE,
|
|
1
|
+
{"version":3,"file":"validateFile.cjs","sources":["../../../../../src/components/file-input/internal/validateFile.ts"],"sourcesContent":["import { formatBytes } from \"../../../utilities/formatters/bytes/formatBytes.js\";\nimport type { FileInputFileValidation } from \"../types.js\";\n\nexport function validateFile(\n file: File,\n accept = \"\",\n maxSizeBytes?: number,\n): FileInputFileValidation | undefined {\n const acceptStrings = accept\n .split(\",\")\n .map((s) => s.toLowerCase())\n .map((s) => s.replaceAll(\"*\", \"\"))\n .map((s) => s.trim());\n\n let isValidFormat = acceptStrings.length === 0;\n\n isValidFormat = acceptStrings.reduce(\n (found, acceptString) =>\n found ||\n file.type.includes(acceptString) ||\n file.name.endsWith(acceptString),\n isValidFormat,\n );\n\n if (!isValidFormat) {\n return {\n type: \"WRONG_TYPE\",\n message: `Filtypen ${file.name?.split(\".\")[1] || \"\"} støttes ikke`,\n };\n }\n\n if (typeof maxSizeBytes != \"undefined\" && file.size > maxSizeBytes) {\n return {\n type: \"TOO_LARGE\",\n message: `Filen er ${formatBytes(\n file.size,\n )}, men kan maksimalt være ${formatBytes(maxSizeBytes)}`,\n };\n }\n\n return undefined;\n}\n"],"names":["file","accept","maxSizeBytes","acceptStrings","split","map","s","toLowerCase","replaceAll","trim","isValidFormat","length","reduce","found","acceptString","type","includes","name","endsWith","size","message","formatBytes","_a"],"mappings":"4KAGO,SACHA,EACAC,EAAS,GACTC,SAEM,MAAAC,EAAgBF,EACjBG,MAAM,KACNC,KAAKC,GAAMA,EAAEC,gBACbF,KAAKC,GAAMA,EAAEE,WAAW,IAAK,MAC7BH,KAAKC,GAAMA,EAAEG,SAEd,IAAAC,EAAyC,IAAzBP,EAAcQ,OAUlC,OARAD,EAAgBP,EAAcS,QAC1B,CAACC,EAAOC,IACJD,GACAb,EAAKe,KAAKC,SAASF,IACnBd,EAAKiB,KAAKC,SAASJ,IACvBJ,GAGCA,SAOMR,EAAgB,KAAeF,EAAKmB,KAAOjB,EAC3C,CACHa,KAAM,YACNK,QAAS,YAAYC,EAAAA,YACjBrB,EAAKmB,iCACoBE,cAAYnB,WALjD,EANW,CACHa,KAAM,aACNK,QAAS,aAAY,OAAAE,EAAAtB,EAAKiB,WAALK,EAAAA,EAAWlB,MAAM,KAAK,KAAM,kBAc7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.cjs","sources":["../../../../src/components/flex/Flex.tsx"],"sourcesContent":["import React, { type CSSProperties } from \"react\";\nimport tokens from \"../../core/tokens.js\";\nimport { AsChildProps } from \"../../utilities/polymorphism/as-child.js\";\nimport {\n PolymorphicPropsWithRef,\n PolymorphicRef,\n} from \"../../utilities/polymorphism/polymorphism.js\";\nimport { SlotComponent } from \"../../utilities/polymorphism/SlotComponent.js\";\n\nexport type FlexDirection = \"row\" | \"row-reverse\" | \"column\" | \"column-reverse\";\nexport type GapValue = Exclude<keyof (typeof tokens)[\"spacing\"], 0>;\n\nexport type FlexProps<ElementType extends React.ElementType> =\n PolymorphicPropsWithRef<\n ElementType,\n {\n direction?: FlexDirection;\n wrap?: boolean;\n gap?: GapValue;\n colGap?: GapValue;\n rowGap?: GapValue;\n } & Pick<\n CSSProperties,\n \"alignContent\" | \"alignItems\" | \"justifyContent\" | \"justifyItems\"\n >\n >;\n\nexport type FlexComponent = <ElementType extends React.ElementType = \"div\">(\n props: FlexProps<ElementType> & AsChildProps,\n) => React.ReactElement | null;\n\nexport const Flex = React.forwardRef(function Flex<\n ElementType extends React.ElementType = \"div\",\n>(props: FlexProps<ElementType>, ref?: PolymorphicRef<ElementType>) {\n const {\n asChild,\n as = \"div\",\n alignContent,\n alignItems,\n children,\n colGap,\n direction,\n gap,\n justifyContent,\n justifyItems,\n rowGap,\n wrap = false,\n ...rest\n } = props;\n const Component = asChild ? SlotComponent : as;\n\n const flexStyle: CSSProperties = {\n display: \"flex\",\n flexDirection: direction,\n alignContent,\n alignItems,\n justifyContent,\n justifyItems,\n ...(wrap ? { flexWrap: \"wrap\" } : {}),\n ...(gap ? { gap: tokens.spacing[gap] } : {}),\n ...(colGap ? { columnGap: tokens.spacing[colGap] } : {}),\n ...(rowGap ? { rowGap: tokens.spacing[rowGap] } : {}),\n };\n\n return (\n <Component ref={ref} {...rest} style={{ ...flexStyle, ...rest.style }}>\n {children}\n </Component>\n );\n}) as FlexComponent;\n"],"names":["Flex","React","forwardRef","props","ref","asChild","as","alignContent","alignItems","children","colGap","direction","gap","justifyContent","justifyItems","rowGap","wrap","rest","Component","SlotComponent","flexStyle","display","flexDirection","flexWrap","tokens","spacing","columnGap","jsx","style"],"mappings":"uOA+BaA,EAAOC,EAAMC,YAAW,SAEnCC,EAA+BC,GACvB,MACFC,QAAAA,EACAC,GAAAA,EAAK,MACLC,aAAAA,EACAC,WAAAA,EACAC,SAAAA,EACAC,OAAAA,EACAC,UAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAC,aAAAA,EACAC,OAAAA,EACAC,KAAAA,GAAO,KACJC,GACHd,EACEe,EAAYb,EAAUc,
|
|
1
|
+
{"version":3,"file":"Flex.cjs","sources":["../../../../src/components/flex/Flex.tsx"],"sourcesContent":["import React, { type CSSProperties } from \"react\";\nimport tokens from \"../../core/tokens.js\";\nimport { AsChildProps } from \"../../utilities/polymorphism/as-child.js\";\nimport {\n PolymorphicPropsWithRef,\n PolymorphicRef,\n} from \"../../utilities/polymorphism/polymorphism.js\";\nimport { SlotComponent } from \"../../utilities/polymorphism/SlotComponent.js\";\n\nexport type FlexDirection = \"row\" | \"row-reverse\" | \"column\" | \"column-reverse\";\nexport type GapValue = Exclude<keyof (typeof tokens)[\"spacing\"], 0>;\n\nexport type FlexProps<ElementType extends React.ElementType> =\n PolymorphicPropsWithRef<\n ElementType,\n {\n direction?: FlexDirection;\n wrap?: boolean;\n gap?: GapValue;\n colGap?: GapValue;\n rowGap?: GapValue;\n } & Pick<\n CSSProperties,\n \"alignContent\" | \"alignItems\" | \"justifyContent\" | \"justifyItems\"\n >\n >;\n\nexport type FlexComponent = <ElementType extends React.ElementType = \"div\">(\n props: FlexProps<ElementType> & AsChildProps,\n) => React.ReactElement | null;\n\nexport const Flex = React.forwardRef(function Flex<\n ElementType extends React.ElementType = \"div\",\n>(props: FlexProps<ElementType>, ref?: PolymorphicRef<ElementType>) {\n const {\n asChild,\n as = \"div\",\n alignContent,\n alignItems,\n children,\n colGap,\n direction,\n gap,\n justifyContent,\n justifyItems,\n rowGap,\n wrap = false,\n ...rest\n } = props;\n const Component = asChild ? SlotComponent : as;\n\n const flexStyle: CSSProperties = {\n display: \"flex\",\n flexDirection: direction,\n alignContent,\n alignItems,\n justifyContent,\n justifyItems,\n ...(wrap ? { flexWrap: \"wrap\" } : {}),\n ...(gap ? { gap: tokens.spacing[gap] } : {}),\n ...(colGap ? { columnGap: tokens.spacing[colGap] } : {}),\n ...(rowGap ? { rowGap: tokens.spacing[rowGap] } : {}),\n };\n\n return (\n <Component ref={ref} {...rest} style={{ ...flexStyle, ...rest.style }}>\n {children}\n </Component>\n );\n}) as FlexComponent;\n"],"names":["Flex","React","forwardRef","props","ref","asChild","as","alignContent","alignItems","children","colGap","direction","gap","justifyContent","justifyItems","rowGap","wrap","rest","Component","SlotComponent","flexStyle","display","flexDirection","flexWrap","tokens","spacing","columnGap","jsx","style"],"mappings":"uOA+BaA,EAAOC,EAAMC,YAAW,SAEnCC,EAA+BC,GACvB,MACFC,QAAAA,EACAC,GAAAA,EAAK,MACLC,aAAAA,EACAC,WAAAA,EACAC,SAAAA,EACAC,OAAAA,EACAC,UAAAA,EACAC,IAAAA,EACAC,eAAAA,EACAC,aAAAA,EACAC,OAAAA,EACAC,KAAAA,GAAO,KACJC,GACHd,EACEe,EAAYb,EAAUc,EAAAA,cAAgBb,EAEtCc,EAA2B,CAC7BC,QAAS,OACTC,cAAeX,EACfJ,aAAAA,EACAC,WAAAA,EACAK,eAAAA,EACAC,aAAAA,KACIE,EAAO,CAAEO,SAAU,QAAW,CAAC,KAC/BX,EAAM,CAAEA,IAAKY,EAAOC,QAAQb,IAAS,CAAC,KACtCF,EAAS,CAAEgB,UAAWF,EAAOC,QAAQf,IAAY,CAAC,KAClDK,EAAS,CAAEA,OAAQS,EAAOC,QAAQV,IAAY,CAAA,GAGtD,OACKY,EAAAA,IAAAT,EAAA,CAAUd,IAAAA,KAAca,EAAMW,MAAO,IAAKR,KAAcH,EAAKW,OACzDnB,SAAAA,GAGb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GreenCheckIcon.cjs","sources":["../../../../../src/components/icon/icons/GreenCheckIcon.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { IconProps } from \"../types.js\";\n\n/*\n * NOTE: The green-check and red-cross icons also exists as a copy in the jkl-list package.\n * If you're here to change them, consider changing them there as well, or\n * finding a technical solution to sharing the SVG markup\n */\nexport const GreenCheckIcon: FC<IconProps> = ({\n as = \"div\",\n bold = false,\n className,\n variant = \"inherit\",\n \"data-testid\": testId,\n style,\n ...rest\n}) => {\n const El = as;\n\n return (\n <El\n className={clsx(\n className,\n \"jkl-icon\",\n \"jkl-icon-green-check\",\n `jkl-icon--${variant}`,\n {\n \"jkl-icon--bold\": bold,\n },\n )}\n aria-hidden=\"true\"\n style={style}\n data-testid={testId}\n {...rest}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path\n fillRule=\"evenodd\"\n d=\"M17.52 9.54 10.7 16.2l-4.21-4.1 1.04-1.08 3.17 3.09 5.79-5.65 1.04 1.08Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </El>\n );\n};\nGreenCheckIcon.displayName = \"GreenCheckIcon\";\n"],"names":["GreenCheckIcon","as","bold","className","variant","testId","style","rest","El","jsx","clsx","children","jsxs","xmlns","viewBox","width","height","cx","cy","r","fillRule","d","clipRule","displayName"],"mappings":"gKASaA,EAAgC,EACzCC,GAAAA,EAAK,MACLC,KAAAA,GAAO,EACPC,UAAAA,EACAC,QAAAA,EAAU,UACV,cAAeC,EACfC,MAAAA,KACGC,MAEH,MAAMC,EAAKP,EAGP,OAAAQ,EAAAA,IAACD,EAAA,CACGL,UAAWO,EAAAA,KACPP,EACA,WACA,uBACA,aAAaC,IACb,CACI,iBAAkBF,IAG1B,cAAY,OACZI,MAAAA,EACA,cAAaD,KACTE,EAEJI,SAAAC,EAAAA,KAAC,MAAA,CACGC,MAAM,6BACNC,QAAQ,YACRC,MAAM,OACNC,OAAO,OAEPL,SAAA,CAAAF,MAAC,UAAOQ,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC1BV,EAAAA,IAAC,OAAA,CACGW,SAAS,UACTC,EAAE,2EACFC,SAAS,
|
|
1
|
+
{"version":3,"file":"GreenCheckIcon.cjs","sources":["../../../../../src/components/icon/icons/GreenCheckIcon.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { IconProps } from \"../types.js\";\n\n/*\n * NOTE: The green-check and red-cross icons also exists as a copy in the jkl-list package.\n * If you're here to change them, consider changing them there as well, or\n * finding a technical solution to sharing the SVG markup\n */\nexport const GreenCheckIcon: FC<IconProps> = ({\n as = \"div\",\n bold = false,\n className,\n variant = \"inherit\",\n \"data-testid\": testId,\n style,\n ...rest\n}) => {\n const El = as;\n\n return (\n <El\n className={clsx(\n className,\n \"jkl-icon\",\n \"jkl-icon-green-check\",\n `jkl-icon--${variant}`,\n {\n \"jkl-icon--bold\": bold,\n },\n )}\n aria-hidden=\"true\"\n style={style}\n data-testid={testId}\n {...rest}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path\n fillRule=\"evenodd\"\n d=\"M17.52 9.54 10.7 16.2l-4.21-4.1 1.04-1.08 3.17 3.09 5.79-5.65 1.04 1.08Z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </El>\n );\n};\nGreenCheckIcon.displayName = \"GreenCheckIcon\";\n"],"names":["GreenCheckIcon","as","bold","className","variant","testId","style","rest","El","jsx","clsx","children","jsxs","xmlns","viewBox","width","height","cx","cy","r","fillRule","d","clipRule","displayName"],"mappings":"gKASaA,EAAgC,EACzCC,GAAAA,EAAK,MACLC,KAAAA,GAAO,EACPC,UAAAA,EACAC,QAAAA,EAAU,UACV,cAAeC,EACfC,MAAAA,KACGC,MAEH,MAAMC,EAAKP,EAGP,OAAAQ,EAAAA,IAACD,EAAA,CACGL,UAAWO,EAAAA,KACPP,EACA,WACA,uBACA,aAAaC,IACb,CACI,iBAAkBF,IAG1B,cAAY,OACZI,MAAAA,EACA,cAAaD,KACTE,EAEJI,SAAAC,EAAAA,KAAC,MAAA,CACGC,MAAM,6BACNC,QAAQ,YACRC,MAAM,OACNC,OAAO,OAEPL,SAAA,CAAAF,MAAC,UAAOQ,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC1BV,EAAAA,IAAC,OAAA,CACGW,SAAS,UACTC,EAAE,2EACFC,SAAS,gBAGrB,EAGRtB,EAAeuB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedCrossIcon.cjs","sources":["../../../../../src/components/icon/icons/RedCrossIcon.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { IconProps } from \"../types.js\";\n\n/*\n * NOTE: The green-check and red-cross icons also exists as a copy in the jkl-list package.\n * If you're here to change them, consider changing them there as well, or\n * finding a technical solution to sharing the SVG markup\n */\nexport const RedCrossIcon: FC<IconProps> = ({\n as = \"div\",\n bold = false,\n className,\n variant = \"inherit\",\n \"data-testid\": testId,\n style,\n ...rest\n}) => {\n const El = as;\n\n return (\n <El\n className={clsx(\n className,\n \"jkl-icon\",\n \"jkl-icon-red-cross\",\n `jkl-icon--${variant}`,\n {\n \"jkl-icon--bold\": bold,\n },\n )}\n aria-hidden=\"true\"\n style={style}\n data-testid={testId}\n {...rest}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15.71 7.23 1.06 1.06-8.48 8.48-1.06-1.06 8.48-8.48Z\" />\n <path d=\"m8.29 7.23 8.48 8.48-1.06 1.06L7.23 8.3l1.06-1.06Z\" />\n </svg>\n </El>\n );\n};\nRedCrossIcon.displayName = \"RedCrossIcon\";\n"],"names":["RedCrossIcon","as","bold","className","variant","testId","style","rest","El","jsx","clsx","children","jsxs","xmlns","viewBox","width","height","cx","cy","r","d","displayName"],"mappings":"gKASaA,EAA8B,EACvCC,GAAAA,EAAK,MACLC,KAAAA,GAAO,EACPC,UAAAA,EACAC,QAAAA,EAAU,UACV,cAAeC,EACfC,MAAAA,KACGC,MAEH,MAAMC,EAAKP,EAGP,OAAAQ,EAAAA,IAACD,EAAA,CACGL,UAAWO,EAAAA,KACPP,EACA,WACA,qBACA,aAAaC,IACb,CACI,iBAAkBF,IAG1B,cAAY,OACZI,MAAAA,EACA,cAAaD,KACTE,EAEJI,SAAAC,EAAAA,KAAC,MAAA,CACGC,MAAM,6BACNC,QAAQ,YACRC,MAAM,OACNC,OAAO,OAEPL,SAAA,CAAAF,MAAC,UAAOQ,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC1BV,EAAAA,IAAC,OAAK,CAAAW,EAAE,yDACRX,EAAAA,IAAC,OAAK,CAAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"RedCrossIcon.cjs","sources":["../../../../../src/components/icon/icons/RedCrossIcon.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { IconProps } from \"../types.js\";\n\n/*\n * NOTE: The green-check and red-cross icons also exists as a copy in the jkl-list package.\n * If you're here to change them, consider changing them there as well, or\n * finding a technical solution to sharing the SVG markup\n */\nexport const RedCrossIcon: FC<IconProps> = ({\n as = \"div\",\n bold = false,\n className,\n variant = \"inherit\",\n \"data-testid\": testId,\n style,\n ...rest\n}) => {\n const El = as;\n\n return (\n <El\n className={clsx(\n className,\n \"jkl-icon\",\n \"jkl-icon-red-cross\",\n `jkl-icon--${variant}`,\n {\n \"jkl-icon--bold\": bold,\n },\n )}\n aria-hidden=\"true\"\n style={style}\n data-testid={testId}\n {...rest}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24px\"\n height=\"24px\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15.71 7.23 1.06 1.06-8.48 8.48-1.06-1.06 8.48-8.48Z\" />\n <path d=\"m8.29 7.23 8.48 8.48-1.06 1.06L7.23 8.3l1.06-1.06Z\" />\n </svg>\n </El>\n );\n};\nRedCrossIcon.displayName = \"RedCrossIcon\";\n"],"names":["RedCrossIcon","as","bold","className","variant","testId","style","rest","El","jsx","clsx","children","jsxs","xmlns","viewBox","width","height","cx","cy","r","d","displayName"],"mappings":"gKASaA,EAA8B,EACvCC,GAAAA,EAAK,MACLC,KAAAA,GAAO,EACPC,UAAAA,EACAC,QAAAA,EAAU,UACV,cAAeC,EACfC,MAAAA,KACGC,MAEH,MAAMC,EAAKP,EAGP,OAAAQ,EAAAA,IAACD,EAAA,CACGL,UAAWO,EAAAA,KACPP,EACA,WACA,qBACA,aAAaC,IACb,CACI,iBAAkBF,IAG1B,cAAY,OACZI,MAAAA,EACA,cAAaD,KACTE,EAEJI,SAAAC,EAAAA,KAAC,MAAA,CACGC,MAAM,6BACNC,QAAQ,YACRC,MAAM,OACNC,OAAO,OAEPL,SAAA,CAAAF,MAAC,UAAOQ,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC1BV,EAAAA,IAAC,OAAK,CAAAW,EAAE,yDACRX,EAAAA,IAAC,OAAK,CAAAW,EAAE,2DAEhB,EAGRpB,EAAaqB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.cjs","sources":["../../../../src/components/icon-button/IconButton.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { ButtonHTMLAttributes, forwardRef } from \"react\";\nimport { Density } from \"../../core/types.js\";\n\nexport interface IconButtonProps\n extends Exclude<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n density?: Density;\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (props, ref) => {\n const { className, children, density, ...rest } = props;\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(\"jkl-icon-button\", className)}\n data-testid=\"jkl-icon-button\"\n data-density={density}\n {...rest}\n >\n {children}\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":["IconButton","forwardRef","props","ref","className","children","density","rest","jsx","type","clsx","displayName"],"mappings":"6JASaA,mBAAaC,YACtB,CAACC,EAAOC,KACJ,MAAQC,UAAAA,EAAWC,SAAAA,EAAUC,QAAAA,KAAYC,GAASL,EAE9C,OAAAM,EAAAA,IAAC,SAAA,CACGL,IAAAA,EACAM,KAAK,SACLL,UAAWM,EAAAA,KAAK,kBAAmBN,GACnC,cAAY,kBACZ,eAAcE,KACVC,EAEHF,SAAAA,
|
|
1
|
+
{"version":3,"file":"IconButton.cjs","sources":["../../../../src/components/icon-button/IconButton.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { ButtonHTMLAttributes, forwardRef } from \"react\";\nimport { Density } from \"../../core/types.js\";\n\nexport interface IconButtonProps\n extends Exclude<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n density?: Density;\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n (props, ref) => {\n const { className, children, density, ...rest } = props;\n return (\n <button\n ref={ref}\n type=\"button\"\n className={clsx(\"jkl-icon-button\", className)}\n data-testid=\"jkl-icon-button\"\n data-density={density}\n {...rest}\n >\n {children}\n </button>\n );\n },\n);\n\nIconButton.displayName = \"IconButton\";\n"],"names":["IconButton","forwardRef","props","ref","className","children","density","rest","jsx","type","clsx","displayName"],"mappings":"6JASaA,mBAAaC,YACtB,CAACC,EAAOC,KACJ,MAAQC,UAAAA,EAAWC,SAAAA,EAAUC,QAAAA,KAAYC,GAASL,EAE9C,OAAAM,EAAAA,IAAC,SAAA,CACGL,IAAAA,EACAM,KAAK,SACLL,UAAWM,EAAAA,KAAK,kBAAmBN,GACnC,cAAY,kBACZ,eAAcE,KACVC,EAEHF,SAAAA,GACL,IAKZL,EAAWW,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.cjs","sources":["../../../../src/components/image/Image.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { useElementDimensions } from \"../../hooks/useElementDimensions/useElementDimensions.js\";\nimport { useImageLoadingStatus } from \"./useImageLoadingStatus.js\";\n\nexport interface ImageProps {\n src: string;\n srcSet?: string;\n placeholder?: string;\n /**\n * Send inn en tom streng hvis bildet kun er dekorativt. Sannsynligvis bør du beskrive innholdet i bildet så en person med nedsatt syn får en fullgod opplevelse av siden.\n * Les mer på https://jokul.fremtind.no/universell-utforming/guide#uu/dekorativt-innhold\n */\n alt: string;\n className?: string;\n}\n\nexport const Image: FC<ImageProps> = ({\n className,\n placeholder,\n alt,\n ...imageProperties\n}) => {\n const [imageRef, imageLoaded] = useImageLoadingStatus();\n const [containerRef, dimensions] =\n useElementDimensions<HTMLDivElement>(400);\n\n return (\n <div\n ref={containerRef}\n className={clsx(\"jkl-image\", className, {\n \"jkl-image--loading\": !imageLoaded,\n })}\n >\n {/* Placeholder er bevisst uten loading og decoding for å vises umiddelbart */}\n <img\n className=\"jkl-image__placeholder\"\n alt={alt}\n src={placeholder || imageProperties.src}\n />\n <img\n alt={alt}\n className=\"jkl-image__image\"\n data-testid=\"jkl-image__image\"\n ref={imageRef}\n sizes={`${dimensions.width}px`}\n loading=\"lazy\"\n decoding=\"async\"\n {...imageProperties}\n />\n </div>\n );\n};\n"],"names":["className","placeholder","alt","imageProperties","imageRef","imageLoaded","useImageLoadingStatus","containerRef","dimensions","useElementDimensions","jsxs","ref","clsx","children","jsx","src","sizes","width","loading","decoding"],"mappings":"2RAiBqC,EACjCA,UAAAA,EACAC,YAAAA,EACAC,IAAAA,KACGC,MAEH,MAAOC,EAAUC,GAAeC,
|
|
1
|
+
{"version":3,"file":"Image.cjs","sources":["../../../../src/components/image/Image.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { useElementDimensions } from \"../../hooks/useElementDimensions/useElementDimensions.js\";\nimport { useImageLoadingStatus } from \"./useImageLoadingStatus.js\";\n\nexport interface ImageProps {\n src: string;\n srcSet?: string;\n placeholder?: string;\n /**\n * Send inn en tom streng hvis bildet kun er dekorativt. Sannsynligvis bør du beskrive innholdet i bildet så en person med nedsatt syn får en fullgod opplevelse av siden.\n * Les mer på https://jokul.fremtind.no/universell-utforming/guide#uu/dekorativt-innhold\n */\n alt: string;\n className?: string;\n}\n\nexport const Image: FC<ImageProps> = ({\n className,\n placeholder,\n alt,\n ...imageProperties\n}) => {\n const [imageRef, imageLoaded] = useImageLoadingStatus();\n const [containerRef, dimensions] =\n useElementDimensions<HTMLDivElement>(400);\n\n return (\n <div\n ref={containerRef}\n className={clsx(\"jkl-image\", className, {\n \"jkl-image--loading\": !imageLoaded,\n })}\n >\n {/* Placeholder er bevisst uten loading og decoding for å vises umiddelbart */}\n <img\n className=\"jkl-image__placeholder\"\n alt={alt}\n src={placeholder || imageProperties.src}\n />\n <img\n alt={alt}\n className=\"jkl-image__image\"\n data-testid=\"jkl-image__image\"\n ref={imageRef}\n sizes={`${dimensions.width}px`}\n loading=\"lazy\"\n decoding=\"async\"\n {...imageProperties}\n />\n </div>\n );\n};\n"],"names":["className","placeholder","alt","imageProperties","imageRef","imageLoaded","useImageLoadingStatus","containerRef","dimensions","useElementDimensions","jsxs","ref","clsx","children","jsx","src","sizes","width","loading","decoding"],"mappings":"2RAiBqC,EACjCA,UAAAA,EACAC,YAAAA,EACAC,IAAAA,KACGC,MAEH,MAAOC,EAAUC,GAAeC,2BACzBC,EAAcC,GACjBC,EAAAA,qBAAqC,KAGrC,OAAAC,EAAAA,KAAC,MAAA,CACGC,IAAKJ,EACLP,UAAWY,EAAAA,KAAK,YAAaZ,EAAW,CACpC,sBAAuBK,IAI3BQ,SAAA,CAAAC,EAAAA,IAAC,MAAA,CACGd,UAAU,yBACVE,IAAAA,EACAa,IAAKd,GAAeE,EAAgBY,MAExCD,EAAAA,IAAC,MAAA,CACGZ,IAAAA,EACAF,UAAU,mBACV,cAAY,mBACZW,IAAKP,EACLY,MAAO,GAAGR,EAAWS,UACrBC,QAAQ,OACRC,SAAS,WACLhB,MAEZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImageLoadingStatus.cjs","sources":["../../../../src/components/image/useImageLoadingStatus.ts"],"sourcesContent":["import { RefObject, useEffect, useRef, useState } from \"react\";\n\nconst doWhenImageLoaded = (image: HTMLImageElement, callback?: () => void) => {\n let timeout: number | undefined;\n\n function checkLoaded() {\n if (image.complete) {\n clearTimeout(timeout);\n callback?.();\n return;\n }\n timeout = window.setTimeout(checkLoaded, 50);\n }\n\n checkLoaded();\n};\n\nexport const useImageLoadingStatus = (\n callback?: () => void,\n): [RefObject<HTMLImageElement>, boolean] => {\n const imageRef = useRef<HTMLImageElement>(null);\n const [imageLoaded, setImageLoaded] = useState(false);\n\n useEffect(() => {\n imageRef.current &&\n doWhenImageLoaded(imageRef.current, () => {\n setImageLoaded(true);\n callback?.();\n });\n }, [callback]);\n\n return [imageRef, imageLoaded];\n};\n"],"names":["callback","imageRef","useRef","imageLoaded","setImageLoaded","useState","useEffect","current","image","timeout","checkLoaded","complete","clearTimeout","window","setTimeout","doWhenImageLoaded"],"mappings":"uIAkBIA,IAEM,MAAAC,EAAWC,SAAyB,OACnCC,EAAaC,GAAkBC,
|
|
1
|
+
{"version":3,"file":"useImageLoadingStatus.cjs","sources":["../../../../src/components/image/useImageLoadingStatus.ts"],"sourcesContent":["import { RefObject, useEffect, useRef, useState } from \"react\";\n\nconst doWhenImageLoaded = (image: HTMLImageElement, callback?: () => void) => {\n let timeout: number | undefined;\n\n function checkLoaded() {\n if (image.complete) {\n clearTimeout(timeout);\n callback?.();\n return;\n }\n timeout = window.setTimeout(checkLoaded, 50);\n }\n\n checkLoaded();\n};\n\nexport const useImageLoadingStatus = (\n callback?: () => void,\n): [RefObject<HTMLImageElement>, boolean] => {\n const imageRef = useRef<HTMLImageElement>(null);\n const [imageLoaded, setImageLoaded] = useState(false);\n\n useEffect(() => {\n imageRef.current &&\n doWhenImageLoaded(imageRef.current, () => {\n setImageLoaded(true);\n callback?.();\n });\n }, [callback]);\n\n return [imageRef, imageLoaded];\n};\n"],"names":["callback","imageRef","useRef","imageLoaded","setImageLoaded","useState","useEffect","current","image","timeout","checkLoaded","complete","clearTimeout","window","setTimeout","doWhenImageLoaded"],"mappings":"uIAkBIA,IAEM,MAAAC,EAAWC,SAAyB,OACnCC,EAAaC,GAAkBC,EAAAA,UAAS,GAE/CC,OAAAA,EAAAA,WAAU,KACNL,EAASM,SAtBS,EAACC,EAAyBR,KAC5C,IAAAS,GAEJ,SAASC,IACL,GAAIF,EAAMG,SAGN,OAFAC,aAAaH,QACF,MAAAT,GAAAA,KAGLS,EAAAI,OAAOC,WAAWJ,EAAa,GAAE,CAGnCA,EAAA,EAWJK,CAAkBd,EAASM,SAAS,KAChCH,GAAe,GACJ,MAAAJ,GAAAA,MACd,GACN,CAACA,IAEG,CAACC,EAAUE,EAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.cjs","sources":["../../../../src/components/input-group/FieldGroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC, FieldsetHTMLAttributes, type ReactNode } from \"react\";\nimport { DataTestAutoId, Density } from \"../../core/types.js\";\nimport { useId } from \"../../hooks/useId/useId.js\";\nimport { Label, LabelProps } from \"./Label.js\";\nimport { SupportLabel, SupportLabelProps } from \"./SupportLabel.js\";\n\nexport interface FieldGroupProps\n extends DataTestAutoId,\n FieldsetHTMLAttributes<HTMLFieldSetElement> {\n legend: string;\n labelProps?: Omit<LabelProps, \"children\" | \"density\">;\n supportLabelProps?: Omit<\n SupportLabelProps,\n \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\"\n >;\n tooltip?: ReactNode;\n className?: string;\n helpLabel?: string;\n errorLabel?: string;\n density?: Density;\n}\n\nexport const FieldGroup: FC<FieldGroupProps> = (props) => {\n const {\n id,\n legend,\n labelProps,\n supportLabelProps,\n tooltip,\n className,\n children,\n helpLabel,\n errorLabel,\n density,\n \"data-testautoid\": testAutoId,\n ...rest\n } = props;\n\n const uid = useId(id || \"jkl-field-group\", { generateSuffix: !id });\n const supportId = `${uid}_support-label`;\n\n const supportText = errorLabel || helpLabel;\n const supportTextType = errorLabel\n ? \"error\"\n : helpLabel\n ? \"help\"\n : undefined;\n\n const describedBy = supportText ? supportId : undefined;\n\n return (\n <fieldset\n id={uid}\n className={clsx(\"jkl-field-group\", className)}\n data-testautoid={testAutoId}\n {...rest}\n aria-describedby={describedBy}\n data-density={density}\n >\n <legend className=\"jkl-field-group__legend\">\n <Label {...labelProps} density={density}>\n {tooltip ? (\n <>\n <span style={{ whiteSpace: \"normal\" }}>\n {legend}\n </span>\n {`\\u00A0`}\n {tooltip}\n </>\n ) : (\n legend\n )}\n </Label>\n </legend>\n {children}\n {(helpLabel || errorLabel) && (\n <SupportLabel\n {...supportLabelProps}\n label={supportText}\n labelType={supportTextType}\n id={supportId}\n density={density}\n />\n )}\n </fieldset>\n );\n};\n"],"names":["props","id","legend","labelProps","supportLabelProps","tooltip","className","children","helpLabel","errorLabel","density","testAutoId","rest","uid","useId","generateSuffix","supportId","supportText","supportTextType","describedBy","jsxs","clsx","jsx","Label","Fragment","style","whiteSpace","SupportLabel","label","labelType"],"mappings":"kRAuBgDA,IACtC,MACFC,GAAAA,EACAC,OAAAA,EACAC,WAAAA,EACAC,kBAAAA,EACAC,QAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,QAAAA,EACA,kBAAmBC,KAChBC,GACHZ,EAEEa,EAAMC,
|
|
1
|
+
{"version":3,"file":"FieldGroup.cjs","sources":["../../../../src/components/input-group/FieldGroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC, FieldsetHTMLAttributes, type ReactNode } from \"react\";\nimport { DataTestAutoId, Density } from \"../../core/types.js\";\nimport { useId } from \"../../hooks/useId/useId.js\";\nimport { Label, LabelProps } from \"./Label.js\";\nimport { SupportLabel, SupportLabelProps } from \"./SupportLabel.js\";\n\nexport interface FieldGroupProps\n extends DataTestAutoId,\n FieldsetHTMLAttributes<HTMLFieldSetElement> {\n legend: string;\n labelProps?: Omit<LabelProps, \"children\" | \"density\">;\n supportLabelProps?: Omit<\n SupportLabelProps,\n \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\"\n >;\n tooltip?: ReactNode;\n className?: string;\n helpLabel?: string;\n errorLabel?: string;\n density?: Density;\n}\n\nexport const FieldGroup: FC<FieldGroupProps> = (props) => {\n const {\n id,\n legend,\n labelProps,\n supportLabelProps,\n tooltip,\n className,\n children,\n helpLabel,\n errorLabel,\n density,\n \"data-testautoid\": testAutoId,\n ...rest\n } = props;\n\n const uid = useId(id || \"jkl-field-group\", { generateSuffix: !id });\n const supportId = `${uid}_support-label`;\n\n const supportText = errorLabel || helpLabel;\n const supportTextType = errorLabel\n ? \"error\"\n : helpLabel\n ? \"help\"\n : undefined;\n\n const describedBy = supportText ? supportId : undefined;\n\n return (\n <fieldset\n id={uid}\n className={clsx(\"jkl-field-group\", className)}\n data-testautoid={testAutoId}\n {...rest}\n aria-describedby={describedBy}\n data-density={density}\n >\n <legend className=\"jkl-field-group__legend\">\n <Label {...labelProps} density={density}>\n {tooltip ? (\n <>\n <span style={{ whiteSpace: \"normal\" }}>\n {legend}\n </span>\n {`\\u00A0`}\n {tooltip}\n </>\n ) : (\n legend\n )}\n </Label>\n </legend>\n {children}\n {(helpLabel || errorLabel) && (\n <SupportLabel\n {...supportLabelProps}\n label={supportText}\n labelType={supportTextType}\n id={supportId}\n density={density}\n />\n )}\n </fieldset>\n );\n};\n"],"names":["props","id","legend","labelProps","supportLabelProps","tooltip","className","children","helpLabel","errorLabel","density","testAutoId","rest","uid","useId","generateSuffix","supportId","supportText","supportTextType","describedBy","jsxs","clsx","jsx","Label","Fragment","style","whiteSpace","SupportLabel","label","labelType"],"mappings":"kRAuBgDA,IACtC,MACFC,GAAAA,EACAC,OAAAA,EACAC,WAAAA,EACAC,kBAAAA,EACAC,QAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,QAAAA,EACA,kBAAmBC,KAChBC,GACHZ,EAEEa,EAAMC,EAAAA,MAAMb,GAAM,kBAAmB,CAAEc,gBAAiBd,IACxDe,EAAY,GAAGH,kBAEfI,EAAcR,GAAcD,EAC5BU,EAAkBT,EAClB,QACAD,EACA,YACA,EAEAW,EAAcF,EAAcD,OAAY,EAG1C,OAAAI,EAAAA,KAAC,WAAA,CACGnB,GAAIY,EACJP,UAAWe,EAAAA,KAAK,kBAAmBf,GACnC,kBAAiBK,KACbC,EACJ,mBAAkBO,EAClB,eAAcT,EAEdH,SAAA,CAACe,EAAAA,IAAA,SAAA,CAAOhB,UAAU,0BACdC,SAAAe,EAAAA,IAACC,YAAUpB,EAAYO,QAAAA,EAClBH,SAAAF,EAEOe,EAAAA,KAAAI,EAAAA,SAAA,CAAAjB,SAAA,CAAAe,MAAC,QAAKG,MAAO,CAAEC,WAAY,UACtBnB,SACLL,IACC,IACAG,KAGLH,MAIXK,GACCC,GAAaC,IACXa,EAAAA,IAACK,EAAAA,aAAA,IACOvB,EACJwB,MAAOX,EACPY,UAAWX,EACXjB,GAAIe,EACJN,QAAAA,MAGZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.cjs","sources":["../../../../src/components/input-group/InputGroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { forwardRef, type CSSProperties, type ReactNode } from \"react\";\nimport {\n DataTestAutoId,\n Density,\n WithOptionalChildren,\n} from \"../../core/types.js\";\nimport { useId } from \"../../hooks/useId/useId.js\";\nimport { Label, LabelProps } from \"./Label.js\";\nimport { SupportLabel, SupportLabelProps } from \"./SupportLabel.js\";\n\nexport interface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n}\n\nexport type InputGroupProps = WithOptionalChildren &\n DataTestAutoId & {\n id?: string;\n className?: string;\n \"data-testid\"?: string;\n density?: Density;\n errorLabel?: ReactNode;\n helpLabel?: ReactNode;\n inline?: boolean;\n label: ReactNode;\n labelProps?: Omit<LabelProps, \"children\" | \"density\">;\n supportLabelProps?: Omit<\n SupportLabelProps,\n \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\"\n >;\n tooltip?: ReactNode;\n style?: CSSProperties;\n render?: (props: InputProps) => JSX.Element;\n };\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(\n (props, ref) => {\n const {\n className,\n children,\n density,\n errorLabel,\n helpLabel,\n inline,\n label,\n labelProps,\n render,\n supportLabelProps,\n tooltip,\n id,\n ...rest\n } = props;\n\n const uid = useId(id || \"jkl-input\", { generateSuffix: !id });\n const supportId = useId(\"jkl-support-label\");\n\n const hasTooltip = !!tooltip;\n\n const supportText = errorLabel || helpLabel;\n const supportTextType = errorLabel\n ? \"error\"\n : helpLabel\n ? \"help\"\n : undefined;\n\n const describedBy = supportText ? supportId : undefined;\n\n const inputProps: InputProps = {\n \"aria-describedby\": describedBy,\n \"aria-invalid\": Boolean(errorLabel) ? true : undefined,\n id: uid,\n };\n\n const renderInput = render\n ? () => render(inputProps)\n : () => {\n const input = React.Children.toArray(props.children)[0];\n\n if (!React.isValidElement<InputProps>(input)) return;\n\n return React.cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n });\n };\n\n return (\n <div\n ref={ref}\n className={clsx(className, \"jkl-input-group\", {\n \"jkl-input-group--inline\": inline,\n })}\n data-density={density}\n {...rest}\n >\n <Label\n standAlone\n htmlFor={uid}\n srOnly={inline}\n {...labelProps}\n style={{\n whiteSpace: hasTooltip ? \"nowrap\" : undefined,\n ...labelProps?.style,\n }}\n density={density}\n >\n {hasTooltip ? (\n <>\n <span style={{ whiteSpace: \"normal\" }}>\n {label}\n </span>\n {`\\u00A0`}\n {tooltip}\n </>\n ) : (\n label\n )}\n </Label>\n {renderInput()}\n <SupportLabel\n srOnly={inline}\n {...supportLabelProps}\n label={supportText}\n labelType={supportTextType}\n id={supportId}\n density={density}\n />\n </div>\n );\n },\n);\n\nInputGroup.displayName = \"InputGroup\";\n"],"names":["InputGroup","forwardRef","props","ref","className","children","density","errorLabel","helpLabel","inline","label","labelProps","render","supportLabelProps","tooltip","id","rest","uid","useId","generateSuffix","supportId","hasTooltip","supportText","supportTextType","inputProps","renderInput","input","React","Children","toArray","isValidElement","cloneElement","jsxs","clsx","jsx","Label","standAlone","htmlFor","srOnly","style","whiteSpace","Fragment","SupportLabel","labelType","displayName"],"mappings":"kRAqCaA,EAAaC,EAAAA,YACtB,CAACC,EAAOC,KACE,MACFC,UAAAA,EACAC,SAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,WAAAA,EACAC,OAAAA,EACAC,kBAAAA,EACAC,QAAAA,EACAC,GAAAA,KACGC,GACHd,EAEEe,EAAMC,
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","sources":["../../../../src/components/input-group/InputGroup.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { forwardRef, type CSSProperties, type ReactNode } from \"react\";\nimport {\n DataTestAutoId,\n Density,\n WithOptionalChildren,\n} from \"../../core/types.js\";\nimport { useId } from \"../../hooks/useId/useId.js\";\nimport { Label, LabelProps } from \"./Label.js\";\nimport { SupportLabel, SupportLabelProps } from \"./SupportLabel.js\";\n\nexport interface InputProps {\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: boolean;\n id?: string;\n}\n\nexport type InputGroupProps = WithOptionalChildren &\n DataTestAutoId & {\n id?: string;\n className?: string;\n \"data-testid\"?: string;\n density?: Density;\n errorLabel?: ReactNode;\n helpLabel?: ReactNode;\n inline?: boolean;\n label: ReactNode;\n labelProps?: Omit<LabelProps, \"children\" | \"density\">;\n supportLabelProps?: Omit<\n SupportLabelProps,\n \"id\" | \"errorLabel\" | \"helpLabel\" | \"density\"\n >;\n tooltip?: ReactNode;\n style?: CSSProperties;\n render?: (props: InputProps) => JSX.Element;\n };\n\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(\n (props, ref) => {\n const {\n className,\n children,\n density,\n errorLabel,\n helpLabel,\n inline,\n label,\n labelProps,\n render,\n supportLabelProps,\n tooltip,\n id,\n ...rest\n } = props;\n\n const uid = useId(id || \"jkl-input\", { generateSuffix: !id });\n const supportId = useId(\"jkl-support-label\");\n\n const hasTooltip = !!tooltip;\n\n const supportText = errorLabel || helpLabel;\n const supportTextType = errorLabel\n ? \"error\"\n : helpLabel\n ? \"help\"\n : undefined;\n\n const describedBy = supportText ? supportId : undefined;\n\n const inputProps: InputProps = {\n \"aria-describedby\": describedBy,\n \"aria-invalid\": Boolean(errorLabel) ? true : undefined,\n id: uid,\n };\n\n const renderInput = render\n ? () => render(inputProps)\n : () => {\n const input = React.Children.toArray(props.children)[0];\n\n if (!React.isValidElement<InputProps>(input)) return;\n\n return React.cloneElement<InputProps>(input, {\n ...inputProps,\n ...input.props,\n });\n };\n\n return (\n <div\n ref={ref}\n className={clsx(className, \"jkl-input-group\", {\n \"jkl-input-group--inline\": inline,\n })}\n data-density={density}\n {...rest}\n >\n <Label\n standAlone\n htmlFor={uid}\n srOnly={inline}\n {...labelProps}\n style={{\n whiteSpace: hasTooltip ? \"nowrap\" : undefined,\n ...labelProps?.style,\n }}\n density={density}\n >\n {hasTooltip ? (\n <>\n <span style={{ whiteSpace: \"normal\" }}>\n {label}\n </span>\n {`\\u00A0`}\n {tooltip}\n </>\n ) : (\n label\n )}\n </Label>\n {renderInput()}\n <SupportLabel\n srOnly={inline}\n {...supportLabelProps}\n label={supportText}\n labelType={supportTextType}\n id={supportId}\n density={density}\n />\n </div>\n );\n },\n);\n\nInputGroup.displayName = \"InputGroup\";\n"],"names":["InputGroup","forwardRef","props","ref","className","children","density","errorLabel","helpLabel","inline","label","labelProps","render","supportLabelProps","tooltip","id","rest","uid","useId","generateSuffix","supportId","hasTooltip","supportText","supportTextType","inputProps","renderInput","input","React","Children","toArray","isValidElement","cloneElement","jsxs","clsx","jsx","Label","standAlone","htmlFor","srOnly","style","whiteSpace","Fragment","SupportLabel","labelType","displayName"],"mappings":"kRAqCaA,EAAaC,EAAAA,YACtB,CAACC,EAAOC,KACE,MACFC,UAAAA,EACAC,SAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,UAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,WAAAA,EACAC,OAAAA,EACAC,kBAAAA,EACAC,QAAAA,EACAC,GAAAA,KACGC,GACHd,EAEEe,EAAMC,EAAAA,MAAMH,GAAM,YAAa,CAAEI,gBAAiBJ,IAClDK,EAAYF,QAAM,qBAElBG,IAAeP,EAEfQ,EAAcf,GAAcC,EAC5Be,EAAkBhB,EAClB,QACAC,EACA,YACA,EAIAgB,EAAyB,CAC3B,mBAHgBF,EAAcF,OAAY,EAI1C,iBAAwBb,QAAqB,EAC7CQ,GAAIE,GAGFQ,EAAcb,EACd,IAAMA,EAAOY,GACb,KACI,MAAME,EAAQC,EAAMC,SAASC,QAAQ3B,EAAMG,UAAU,GAErD,GAAKsB,EAAMG,eAA2BJ,GAE/B,OAAAC,EAAMI,aAAyBL,EAAO,IACtCF,KACAE,EAAMxB,OACZ,EAIP,OAAA8B,EAAAA,KAAC,MAAA,CACG7B,IAAAA,EACAC,UAAW6B,EAAAA,KAAK7B,EAAW,kBAAmB,CAC1C,0BAA2BK,IAE/B,eAAcH,KACVU,EAEJX,SAAA,CAAA6B,EAAAA,IAACC,EAAAA,MAAA,CACGC,YAAU,EACVC,QAASpB,EACTqB,OAAQ7B,KACJE,EACJ4B,MAAO,CACHC,WAAYnB,EAAa,cAAW,KACjC,MAAAV,OAAAA,EAAAA,EAAY4B,OAEnBjC,QAAAA,EAECD,WAEO2B,EAAAA,KAAAS,EAAAA,SAAA,CAAApC,SAAA,CAAA6B,MAAC,QAAKK,MAAO,CAAEC,WAAY,UACtBnC,SACLK,IACC,IACAI,KAGLJ,IAGPe,IACDS,EAAAA,IAACQ,EAAAA,aAAA,CACGJ,OAAQ7B,KACJI,EACJH,MAAOY,EACPqB,UAAWpB,EACXR,GAAIK,EACJd,QAAAA,MAER,IAKZN,EAAW4C,YAAc"}
|
|
@@ -23,17 +23,17 @@ export type InputGroupProps = WithOptionalChildren & DataTestAutoId & {
|
|
|
23
23
|
render?: (props: InputProps) => JSX.Element;
|
|
24
24
|
};
|
|
25
25
|
export declare const InputGroup: React.ForwardRefExoticComponent<WithOptionalChildren & DataTestAutoId & {
|
|
26
|
-
id?: string
|
|
27
|
-
className?: string
|
|
28
|
-
"data-testid"?: string
|
|
29
|
-
density?: Density
|
|
26
|
+
id?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
"data-testid"?: string;
|
|
29
|
+
density?: Density;
|
|
30
30
|
errorLabel?: ReactNode;
|
|
31
31
|
helpLabel?: ReactNode;
|
|
32
|
-
inline?: boolean
|
|
32
|
+
inline?: boolean;
|
|
33
33
|
label: ReactNode;
|
|
34
|
-
labelProps?: Omit<LabelProps, "
|
|
35
|
-
supportLabelProps?: Omit<SupportLabelProps, "
|
|
34
|
+
labelProps?: Omit<LabelProps, "children" | "density">;
|
|
35
|
+
supportLabelProps?: Omit<SupportLabelProps, "id" | "errorLabel" | "helpLabel" | "density">;
|
|
36
36
|
tooltip?: ReactNode;
|
|
37
|
-
style?:
|
|
38
|
-
render?: (
|
|
37
|
+
style?: CSSProperties;
|
|
38
|
+
render?: (props: InputProps) => JSX.Element;
|
|
39
39
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.cjs","sources":["../../../../src/components/input-group/Label.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { type CSSProperties, type FC } from \"react\";\nimport { Density, WithChildren } from \"../../core/types.js\";\n\nexport type LabelVariant = \"small\" | \"medium\" | \"large\";\n\nexport interface LabelProps extends WithChildren {\n id?: string;\n variant?: LabelVariant;\n density?: Density;\n srOnly?: boolean;\n standAlone?: boolean;\n htmlFor?: string;\n className?: string;\n style?: CSSProperties;\n}\n\nexport const Label: FC<LabelProps> = ({\n variant = \"small\",\n density,\n srOnly,\n children,\n standAlone,\n htmlFor,\n className = \"\",\n ...rest\n}) => {\n const labelClassNames = clsx(\"jkl-label\", className, {\n [`jkl-label--${variant}`]: variant,\n \"jkl-label--sr-only\": srOnly,\n });\n\n const C = standAlone ? \"label\" : \"span\";\n\n if (!standAlone && htmlFor) {\n htmlFor = undefined;\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n \"WARNING: The standard Label component renders as a <span> element, which does not take a htmlFor prop. If you want the Label to belong to a specific input, use the standAlone prop, which renders as a <label> element instead. In most cases the Label component should not be used directly, as it is part of all our input components.\",\n );\n }\n }\n\n return (\n <C\n {...rest}\n className={labelClassNames}\n htmlFor={htmlFor}\n data-density={density}\n >\n {children}\n </C>\n );\n};\n"],"names":["variant","density","srOnly","children","standAlone","htmlFor","className","rest","labelClassNames","clsx","C","process","env","NODE_ENV","console","warn","jsx"],"mappings":"2KAiBqC,EACjCA,QAAAA,EAAU,QACVC,QAAAA,EACAC,OAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,UAAAA,EAAY,MACTC,MAEG,MAAAC,EAAkBC,EAAAA,KAAK,YAAaH,EAAW,CACjD,CAAC,cAAcN,KAAYA,EAC3B,qBAAsBE,IAGpBQ,EAAIN,EAAa,QAAU,OAE7B,OAACA,GAAcC,IACLA,OAAA,EACmB,eAAzBM,QAAQC,IAAIC,UACJC,QAAAC,KACJ,+UAMRC,EAAAA,IAACN,EAAA,IACOH,EACJD,UAAWE,EACXH,QAAAA,EACA,eAAcJ,EAEbE,SAAAA,
|
|
1
|
+
{"version":3,"file":"Label.cjs","sources":["../../../../src/components/input-group/Label.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { type CSSProperties, type FC } from \"react\";\nimport { Density, WithChildren } from \"../../core/types.js\";\n\nexport type LabelVariant = \"small\" | \"medium\" | \"large\";\n\nexport interface LabelProps extends WithChildren {\n id?: string;\n variant?: LabelVariant;\n density?: Density;\n srOnly?: boolean;\n standAlone?: boolean;\n htmlFor?: string;\n className?: string;\n style?: CSSProperties;\n}\n\nexport const Label: FC<LabelProps> = ({\n variant = \"small\",\n density,\n srOnly,\n children,\n standAlone,\n htmlFor,\n className = \"\",\n ...rest\n}) => {\n const labelClassNames = clsx(\"jkl-label\", className, {\n [`jkl-label--${variant}`]: variant,\n \"jkl-label--sr-only\": srOnly,\n });\n\n const C = standAlone ? \"label\" : \"span\";\n\n if (!standAlone && htmlFor) {\n htmlFor = undefined;\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n \"WARNING: The standard Label component renders as a <span> element, which does not take a htmlFor prop. If you want the Label to belong to a specific input, use the standAlone prop, which renders as a <label> element instead. In most cases the Label component should not be used directly, as it is part of all our input components.\",\n );\n }\n }\n\n return (\n <C\n {...rest}\n className={labelClassNames}\n htmlFor={htmlFor}\n data-density={density}\n >\n {children}\n </C>\n );\n};\n"],"names":["variant","density","srOnly","children","standAlone","htmlFor","className","rest","labelClassNames","clsx","C","process","env","NODE_ENV","console","warn","jsx"],"mappings":"2KAiBqC,EACjCA,QAAAA,EAAU,QACVC,QAAAA,EACAC,OAAAA,EACAC,SAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,UAAAA,EAAY,MACTC,MAEG,MAAAC,EAAkBC,EAAAA,KAAK,YAAaH,EAAW,CACjD,CAAC,cAAcN,KAAYA,EAC3B,qBAAsBE,IAGpBQ,EAAIN,EAAa,QAAU,OAE7B,OAACA,GAAcC,IACLA,OAAA,EACmB,eAAzBM,QAAQC,IAAIC,UACJC,QAAAC,KACJ,+UAMRC,EAAAA,IAACN,EAAA,IACOH,EACJD,UAAWE,EACXH,QAAAA,EACA,eAAcJ,EAEbE,SAAAA,GACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportLabel.cjs","sources":["../../../../src/components/input-group/SupportLabel.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { type FC, type ReactNode } from \"react\";\nimport { Density } from \"../../core/types.js\";\nimport { ErrorIcon } from \"../icon/icons/ErrorIcon.js\";\nimport { SuccessIcon } from \"../icon/icons/SuccessIcon.js\";\nimport { WarningIcon } from \"../icon/icons/WarningIcon.js\";\n\nexport type SupportLabelType = \"help\" | \"error\" | \"warning\" | \"success\";\n\nexport interface SupportLabelProps {\n /**\n * En ID er påkrevd for å kunne referere til SupportLabel med aria-describedby.\n *\n * @example\n * ```tsx\n * const uid = useId();\n * const supportId = useId();\n * const hasSupportText = helpLabel || errorLabel;\n * const describedBy = hasSupportText ? supportId : undefined;\n *\n * return (\n * <div>\n * <Label standAlone htmlFor={uid}>\n * Velg en tekst\n * </Label>\n * <select\n * id={uid}\n * aria-describedby={describedBy}\n * >\n * <option value=\"e\">Example</option>\n * </select>\n * <SupportLabel\n * id={supportId}\n * label={errorLabel}\n * labelType=\"error\"\n * density={density}\n * />\n * </div>\n * );\n * ```\n */\n id: string;\n /**\n * @deprecated Bruk `label` for å få samme resultat.\n */\n helpLabel?: ReactNode;\n /**\n * @deprecated Bruk `label` og `labelType=\"warning\"` for å få samme resultat.\n */\n errorLabel?: ReactNode;\n label?: ReactNode;\n /**\n * Bestemmer hvilket ikon som skal vises:\n *\n * - \"help\" viser ikke noe ikon\n * - \"warning\" viser WarningIcon, det som tidligere ble vist med `errorLabel`\n * - \"error\" viser ErrorIcon\n * - \"success\" viser SuccessIcon\n *\n * @default \"help\"\n */\n labelType?: SupportLabelType;\n density?: Density;\n className?: string;\n srOnly?: boolean;\n}\n\nexport const SupportLabel: FC<SupportLabelProps> = ({\n id,\n helpLabel,\n errorLabel,\n label,\n labelType = \"help\",\n density,\n className,\n srOnly,\n ...rest\n}) => {\n const hasLabel = errorLabel || helpLabel || label;\n\n const isHelp = labelType === \"help\" || (helpLabel && !errorLabel);\n const isWarning = labelType === \"warning\" || errorLabel;\n const isError = labelType === \"error\";\n const isSuccess = labelType === \"success\";\n\n const componentClassName = hasLabel\n ? clsx(\"jkl-form-support-label\", className, {\n \"jkl-form-support-label--sr-only\": srOnly,\n \"jkl-form-support-label--help\": isHelp,\n \"jkl-form-support-label--error\": isError,\n \"jkl-form-support-label--warning\": isWarning,\n \"jkl-form-support-label--success\": isSuccess,\n })\n : \"jkl-dormant-form-support-label\";\n\n const restProps = hasLabel ? rest : {};\n\n const Icon = isError ? ErrorIcon : isSuccess ? SuccessIcon : WarningIcon;\n\n return (\n <span\n id={id}\n className={componentClassName}\n {...restProps}\n data-density={density}\n >\n <Icon variant=\"small\" className=\"jkl-form-support-label__icon\" />\n <span>{errorLabel || helpLabel || label}</span>\n </span>\n );\n};\n"],"names":["id","helpLabel","errorLabel","label","labelType","density","className","srOnly","rest","hasLabel","isHelp","isWarning","isError","isSuccess","componentClassName","clsx","restProps","Icon","ErrorIcon","SuccessIcon","WarningIcon","jsxs","children","jsx","variant"],"mappings":"iTAmEmD,EAC/CA,GAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,MAAAA,EACAC,UAAAA,EAAY,OACZC,QAAAA,EACAC,UAAAA,EACAC,OAAAA,KACGC,MAEG,MAAAC,EAAWP,GAAcD,GAAaE,EAEtCO,EAAuB,SAAdN,GAAyBH,IAAcC,EAChDS,EAA0B,YAAdP,GAA2BF,EACvCU,EAAwB,UAAdR,EACVS,EAA0B,YAAdT,EAEZU,EAAqBL,EACrBM,OAAK,yBAA0BT,EAAW,CACtC,kCAAmCC,EACnC,+BAAgCG,EAChC,gCAAiCE,EACjC,kCAAmCD,EACnC,kCAAmCE,IAEvC,iCAEAG,EAAYP,EAAWD,EAAO,
|
|
1
|
+
{"version":3,"file":"SupportLabel.cjs","sources":["../../../../src/components/input-group/SupportLabel.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { type FC, type ReactNode } from \"react\";\nimport { Density } from \"../../core/types.js\";\nimport { ErrorIcon } from \"../icon/icons/ErrorIcon.js\";\nimport { SuccessIcon } from \"../icon/icons/SuccessIcon.js\";\nimport { WarningIcon } from \"../icon/icons/WarningIcon.js\";\n\nexport type SupportLabelType = \"help\" | \"error\" | \"warning\" | \"success\";\n\nexport interface SupportLabelProps {\n /**\n * En ID er påkrevd for å kunne referere til SupportLabel med aria-describedby.\n *\n * @example\n * ```tsx\n * const uid = useId();\n * const supportId = useId();\n * const hasSupportText = helpLabel || errorLabel;\n * const describedBy = hasSupportText ? supportId : undefined;\n *\n * return (\n * <div>\n * <Label standAlone htmlFor={uid}>\n * Velg en tekst\n * </Label>\n * <select\n * id={uid}\n * aria-describedby={describedBy}\n * >\n * <option value=\"e\">Example</option>\n * </select>\n * <SupportLabel\n * id={supportId}\n * label={errorLabel}\n * labelType=\"error\"\n * density={density}\n * />\n * </div>\n * );\n * ```\n */\n id: string;\n /**\n * @deprecated Bruk `label` for å få samme resultat.\n */\n helpLabel?: ReactNode;\n /**\n * @deprecated Bruk `label` og `labelType=\"warning\"` for å få samme resultat.\n */\n errorLabel?: ReactNode;\n label?: ReactNode;\n /**\n * Bestemmer hvilket ikon som skal vises:\n *\n * - \"help\" viser ikke noe ikon\n * - \"warning\" viser WarningIcon, det som tidligere ble vist med `errorLabel`\n * - \"error\" viser ErrorIcon\n * - \"success\" viser SuccessIcon\n *\n * @default \"help\"\n */\n labelType?: SupportLabelType;\n density?: Density;\n className?: string;\n srOnly?: boolean;\n}\n\nexport const SupportLabel: FC<SupportLabelProps> = ({\n id,\n helpLabel,\n errorLabel,\n label,\n labelType = \"help\",\n density,\n className,\n srOnly,\n ...rest\n}) => {\n const hasLabel = errorLabel || helpLabel || label;\n\n const isHelp = labelType === \"help\" || (helpLabel && !errorLabel);\n const isWarning = labelType === \"warning\" || errorLabel;\n const isError = labelType === \"error\";\n const isSuccess = labelType === \"success\";\n\n const componentClassName = hasLabel\n ? clsx(\"jkl-form-support-label\", className, {\n \"jkl-form-support-label--sr-only\": srOnly,\n \"jkl-form-support-label--help\": isHelp,\n \"jkl-form-support-label--error\": isError,\n \"jkl-form-support-label--warning\": isWarning,\n \"jkl-form-support-label--success\": isSuccess,\n })\n : \"jkl-dormant-form-support-label\";\n\n const restProps = hasLabel ? rest : {};\n\n const Icon = isError ? ErrorIcon : isSuccess ? SuccessIcon : WarningIcon;\n\n return (\n <span\n id={id}\n className={componentClassName}\n {...restProps}\n data-density={density}\n >\n <Icon variant=\"small\" className=\"jkl-form-support-label__icon\" />\n <span>{errorLabel || helpLabel || label}</span>\n </span>\n );\n};\n"],"names":["id","helpLabel","errorLabel","label","labelType","density","className","srOnly","rest","hasLabel","isHelp","isWarning","isError","isSuccess","componentClassName","clsx","restProps","Icon","ErrorIcon","SuccessIcon","WarningIcon","jsxs","children","jsx","variant"],"mappings":"iTAmEmD,EAC/CA,GAAAA,EACAC,UAAAA,EACAC,WAAAA,EACAC,MAAAA,EACAC,UAAAA,EAAY,OACZC,QAAAA,EACAC,UAAAA,EACAC,OAAAA,KACGC,MAEG,MAAAC,EAAWP,GAAcD,GAAaE,EAEtCO,EAAuB,SAAdN,GAAyBH,IAAcC,EAChDS,EAA0B,YAAdP,GAA2BF,EACvCU,EAAwB,UAAdR,EACVS,EAA0B,YAAdT,EAEZU,EAAqBL,EACrBM,OAAK,yBAA0BT,EAAW,CACtC,kCAAmCC,EACnC,+BAAgCG,EAChC,gCAAiCE,EACjC,kCAAmCD,EACnC,kCAAmCE,IAEvC,iCAEAG,EAAYP,EAAWD,EAAO,CAAC,EAE/BS,EAAOL,EAAUM,EAAYA,UAAAL,EAAYM,EAAcA,YAAAC,EAAAA,YAGzD,OAAAC,EAAAA,KAAC,OAAA,CACGrB,GAAAA,EACAM,UAAWQ,KACPE,EACJ,eAAcX,EAEdiB,SAAA,CAAAC,EAAAA,IAACN,EAAK,CAAAO,QAAQ,QAAQlB,UAAU,iCAC/BiB,EAAAA,IAAA,OAAA,CAAMD,SAAcpB,GAAAD,GAAaE,MACtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioPanel.cjs","sources":["../../../../src/components/input-panel/RadioPanel.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ComponentPropsWithRef,\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n} from \"react\";\nimport { BasePanel } from \"./BasePanel.js\";\nimport { context } from \"./radioPanelContext.js\";\n\n// aria-invalid has been deprecated for the \"radio\" role, it should go on the\n// parent radiogroup\nexport type RadioPanelProps = Omit<\n ComponentPropsWithRef<\"input\">,\n \"type\" | \"aria-invalid\"\n> & {\n value: string;\n label: string;\n extraLabel?: React.ReactNode;\n alwaysOpen?: boolean;\n};\n\nexport const RadioPanel = forwardRef(function RadioPanel(\n {\n alwaysOpen = false,\n label,\n extraLabel,\n checked,\n onChange,\n value,\n defaultChecked,\n ...rest\n }: RadioPanelProps,\n ref: ForwardedRef<HTMLInputElement>,\n) {\n const { onValueChange, checkedValue } = useContext(context);\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n if (!onValueChange) {\n throw new Error(\n \"RadioPanel will not work properly when used outside a RadioPanelGroup\",\n );\n }\n onValueChange(value);\n },\n [onChange, onValueChange, value],\n );\n\n useEffect(() => {\n if (defaultChecked) {\n if (!onValueChange) {\n throw new Error(\n \"RadioPanel will not work properly when used outside a RadioPanelGroup\",\n );\n }\n onValueChange(value);\n }\n // We never want to rerun this effect. Changing the default value after the\n // input control is first mounted should not cause any updates\n /* eslint-disable-next-line react-hooks/exhaustive-deps */\n }, []);\n\n const isControlled = typeof checked !== \"undefined\";\n const isChecked = isControlled ? checked : checkedValue === value;\n\n return (\n <BasePanel\n ref={ref}\n type=\"radio\"\n value={value}\n isChecked={isChecked}\n defaultChecked={defaultChecked}\n checked={isControlled ? checked : undefined}\n onChange={handleChange}\n alwaysOpen={alwaysOpen}\n label={label}\n extraLabel={extraLabel}\n {...rest}\n />\n );\n});\n"],"names":["RadioPanel","forwardRef","alwaysOpen","label","extraLabel","checked","onChange","value","defaultChecked","rest","ref","onValueChange","checkedValue","useContext","context","handleChange","useCallback","e","Error","useEffect","isControlled","isChecked","jsx","BasePanel","type"],"mappings":"0MAwBaA,EAAaC,EAAAA,YAAW,UAE7BC,WAAAA,GAAa,EACbC,MAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,SAAAA,EACAC,MAAAA,EACAC,eAAAA,KACGC,GAEPC,GAEA,MAAQC,cAAAA,EAAeC,aAAAA,GAAiBC,
|
|
1
|
+
{"version":3,"file":"RadioPanel.cjs","sources":["../../../../src/components/input-panel/RadioPanel.tsx"],"sourcesContent":["import React, {\n ChangeEvent,\n ComponentPropsWithRef,\n ForwardedRef,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n} from \"react\";\nimport { BasePanel } from \"./BasePanel.js\";\nimport { context } from \"./radioPanelContext.js\";\n\n// aria-invalid has been deprecated for the \"radio\" role, it should go on the\n// parent radiogroup\nexport type RadioPanelProps = Omit<\n ComponentPropsWithRef<\"input\">,\n \"type\" | \"aria-invalid\"\n> & {\n value: string;\n label: string;\n extraLabel?: React.ReactNode;\n alwaysOpen?: boolean;\n};\n\nexport const RadioPanel = forwardRef(function RadioPanel(\n {\n alwaysOpen = false,\n label,\n extraLabel,\n checked,\n onChange,\n value,\n defaultChecked,\n ...rest\n }: RadioPanelProps,\n ref: ForwardedRef<HTMLInputElement>,\n) {\n const { onValueChange, checkedValue } = useContext(context);\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n if (!onValueChange) {\n throw new Error(\n \"RadioPanel will not work properly when used outside a RadioPanelGroup\",\n );\n }\n onValueChange(value);\n },\n [onChange, onValueChange, value],\n );\n\n useEffect(() => {\n if (defaultChecked) {\n if (!onValueChange) {\n throw new Error(\n \"RadioPanel will not work properly when used outside a RadioPanelGroup\",\n );\n }\n onValueChange(value);\n }\n // We never want to rerun this effect. Changing the default value after the\n // input control is first mounted should not cause any updates\n /* eslint-disable-next-line react-hooks/exhaustive-deps */\n }, []);\n\n const isControlled = typeof checked !== \"undefined\";\n const isChecked = isControlled ? checked : checkedValue === value;\n\n return (\n <BasePanel\n ref={ref}\n type=\"radio\"\n value={value}\n isChecked={isChecked}\n defaultChecked={defaultChecked}\n checked={isControlled ? checked : undefined}\n onChange={handleChange}\n alwaysOpen={alwaysOpen}\n label={label}\n extraLabel={extraLabel}\n {...rest}\n />\n );\n});\n"],"names":["RadioPanel","forwardRef","alwaysOpen","label","extraLabel","checked","onChange","value","defaultChecked","rest","ref","onValueChange","checkedValue","useContext","context","handleChange","useCallback","e","Error","useEffect","isControlled","isChecked","jsx","BasePanel","type"],"mappings":"0MAwBaA,EAAaC,EAAAA,YAAW,UAE7BC,WAAAA,GAAa,EACbC,MAAAA,EACAC,WAAAA,EACAC,QAAAA,EACAC,SAAAA,EACAC,MAAAA,EACAC,eAAAA,KACGC,GAEPC,GAEA,MAAQC,cAAAA,EAAeC,aAAAA,GAAiBC,EAAAA,WAAWC,EAAAA,SAE7CC,EAAeC,EAAAA,aAChBC,IAEG,GADA,MAAAX,GAAAA,EAAWW,IACNN,EACD,MAAM,IAAIO,MACN,yEAGRP,EAAcJ,EAAK,GAEvB,CAACD,EAAUK,EAAeJ,IAG9BY,EAAAA,WAAU,KACN,GAAIX,EAAgB,CAChB,IAAKG,EACD,MAAM,IAAIO,MACN,yEAGRP,EAAcJ,EAAK,IAKxB,IAEG,MAAAa,SAAsBf,EAAY,IAClCgB,EAAYD,EAAef,EAAUO,IAAiBL,EAGxD,OAAAe,EAAAA,IAACC,EAAAA,UAAA,CACGb,IAAAA,EACAc,KAAK,QACLjB,MAAAA,EACAc,UAAAA,EACAb,eAAAA,EACAH,QAASe,EAAef,OAAU,EAClCC,SAAUS,EACVb,WAAAA,EACAC,MAAAA,EACAC,WAAAA,KACIK,GAGhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioPanelGroup.cjs","sources":["../../../../src/components/input-panel/RadioPanelGroup.tsx"],"sourcesContent":["import React, { FC, useState } from \"react\";\nimport { FieldGroup, FieldGroupProps } from \"../input-group/FieldGroup.js\";\nimport { context } from \"./radioPanelContext.js\";\n\nexport type RadioPanelGroupProps = FieldGroupProps & {};\n\nexport const RadioPanelGroup: FC<RadioPanelGroupProps> = ({\n className,\n ...rest\n}) => {\n const [checkedValue, setCheckedValue] = useState<string>();\n\n const onChange = (value: string) => {\n setCheckedValue(value);\n };\n\n return (\n <context.Provider value={{ checkedValue, onValueChange: onChange }}>\n <FieldGroup\n className={className}\n role=\"radiogroup\"\n aria-invalid={!!rest.errorLabel}\n {...rest}\n />\n </context.Provider>\n );\n};\n"],"names":["className","rest","checkedValue","setCheckedValue","useState","jsx","context","Provider","value","onValueChange","children","FieldGroup","role","errorLabel"],"mappings":"gPAMyD,EACrDA,UAAAA,KACGC,MAEH,MAAOC,EAAcC,GAAmBC,
|
|
1
|
+
{"version":3,"file":"RadioPanelGroup.cjs","sources":["../../../../src/components/input-panel/RadioPanelGroup.tsx"],"sourcesContent":["import React, { FC, useState } from \"react\";\nimport { FieldGroup, FieldGroupProps } from \"../input-group/FieldGroup.js\";\nimport { context } from \"./radioPanelContext.js\";\n\nexport type RadioPanelGroupProps = FieldGroupProps & {};\n\nexport const RadioPanelGroup: FC<RadioPanelGroupProps> = ({\n className,\n ...rest\n}) => {\n const [checkedValue, setCheckedValue] = useState<string>();\n\n const onChange = (value: string) => {\n setCheckedValue(value);\n };\n\n return (\n <context.Provider value={{ checkedValue, onValueChange: onChange }}>\n <FieldGroup\n className={className}\n role=\"radiogroup\"\n aria-invalid={!!rest.errorLabel}\n {...rest}\n />\n </context.Provider>\n );\n};\n"],"names":["className","rest","checkedValue","setCheckedValue","useState","jsx","context","Provider","value","onValueChange","children","FieldGroup","role","errorLabel"],"mappings":"gPAMyD,EACrDA,UAAAA,KACGC,MAEH,MAAOC,EAAcC,GAAmBC,aAOpC,OAAAC,MAACC,EAAAA,QAAQC,SAAR,CAAiBC,MAAO,CAAEN,aAAAA,EAAcO,cAL3BD,IACdL,EAAgBK,EAAK,GAKjBE,SAAAL,EAAAA,IAACM,EAAAA,WAAA,CACGX,UAAAA,EACAY,KAAK,aACL,iBAAgBX,EAAKY,cACjBZ,KAEZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkList.cjs","sources":["../../../../src/components/link-list/LinkList.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport {\n PolymorphicPropsWithRef,\n PolymorphicRef,\n} from \"../../utilities/polymorphism/polymorphism.js\";\nimport { ArrowRightIcon } from \"../icon/icons/ArrowRightIcon.js\";\nimport { ItemProps, LinkComponent, LinkListProps } from \"./types.js\";\n\nconst Item: ItemProps = ({ className, ...rest }) => {\n return (\n <li className={clsx(\"jkl-link-list-item\", className)} {...rest}></li>\n );\n};\n\nconst Link = React.forwardRef(function LinkListLink<\n ElementType extends React.ElementType = \"a\",\n>(\n props: PolymorphicPropsWithRef<ElementType>,\n ref: PolymorphicRef<ElementType>,\n) {\n const { as: Component = \"a\", children, className, ...rest } = props;\n\n return (\n <Component\n className={clsx(\"jkl-link-list-link\", className)}\n ref={ref}\n {...rest}\n >\n {children}\n <ArrowRightIcon className=\"jkl-link-list-link__arrow\" />\n </Component>\n );\n}) as LinkComponent;\n\nexport const LinkList = ({\n variant,\n className,\n ...rest\n}: LinkListProps): React.JSX.Element => {\n const Component = variant === \"ordered\" ? \"ol\" : \"ul\";\n\n return (\n <Component\n className={clsx(\"jkl-link-list\", className, {\n \"jkl-link-list--ordered\": variant === \"ordered\",\n \"jkl-link-list--unordered\": variant === \"unordered\",\n })}\n {...rest}\n />\n );\n};\n\nLinkList.Link = Link;\nLinkList.Item = Item;\n"],"names":["Link","React","forwardRef","props","ref","as","Component","children","className","rest","jsxs","clsx","jsx","ArrowRightIcon","LinkList","variant","Item"],"mappings":"8NAeMA,EAAOC,EAAMC,YAAW,SAG1BC,EACAC,GAEM,MAAEC,GAAIC,EAAY,IAAKC,SAAAA,EAAUC,UAAAA,KAAcC,GAASN,EAG1D,OAAAO,EAAAA,KAACJ,EAAA,CACGE,UAAWG,EAAAA,KAAK,qBAAsBH,GACtCJ,IAAAA,KACIK,EAEHF,SAAA,CAAAA,EACDK,EAAAA,IAACC,EAAeA,eAAA,CAAAL,UAAU,gCAGtC,IAEaM,EAAW,EACpBC,QAAAA,EACAP,UAAAA,KACGC,MAEG,MAAAH,EAAwB,YAAZS,EAAwB,KAAO,KAG7C,OAAAH,EAAAA,IAACN,EAAA,CACGE,UAAWG,EAAAA,KAAK,gBAAiBH,EAAW,CACxC,yBAAsC,YAAZO,EAC1B,2BAAwC,cAAZA,OAE5BN,
|
|
1
|
+
{"version":3,"file":"LinkList.cjs","sources":["../../../../src/components/link-list/LinkList.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport {\n PolymorphicPropsWithRef,\n PolymorphicRef,\n} from \"../../utilities/polymorphism/polymorphism.js\";\nimport { ArrowRightIcon } from \"../icon/icons/ArrowRightIcon.js\";\nimport { ItemProps, LinkComponent, LinkListProps } from \"./types.js\";\n\nconst Item: ItemProps = ({ className, ...rest }) => {\n return (\n <li className={clsx(\"jkl-link-list-item\", className)} {...rest}></li>\n );\n};\n\nconst Link = React.forwardRef(function LinkListLink<\n ElementType extends React.ElementType = \"a\",\n>(\n props: PolymorphicPropsWithRef<ElementType>,\n ref: PolymorphicRef<ElementType>,\n) {\n const { as: Component = \"a\", children, className, ...rest } = props;\n\n return (\n <Component\n className={clsx(\"jkl-link-list-link\", className)}\n ref={ref}\n {...rest}\n >\n {children}\n <ArrowRightIcon className=\"jkl-link-list-link__arrow\" />\n </Component>\n );\n}) as LinkComponent;\n\nexport const LinkList = ({\n variant,\n className,\n ...rest\n}: LinkListProps): React.JSX.Element => {\n const Component = variant === \"ordered\" ? \"ol\" : \"ul\";\n\n return (\n <Component\n className={clsx(\"jkl-link-list\", className, {\n \"jkl-link-list--ordered\": variant === \"ordered\",\n \"jkl-link-list--unordered\": variant === \"unordered\",\n })}\n {...rest}\n />\n );\n};\n\nLinkList.Link = Link;\nLinkList.Item = Item;\n"],"names":["Link","React","forwardRef","props","ref","as","Component","children","className","rest","jsxs","clsx","jsx","ArrowRightIcon","LinkList","variant","Item"],"mappings":"8NAeMA,EAAOC,EAAMC,YAAW,SAG1BC,EACAC,GAEM,MAAEC,GAAIC,EAAY,IAAKC,SAAAA,EAAUC,UAAAA,KAAcC,GAASN,EAG1D,OAAAO,EAAAA,KAACJ,EAAA,CACGE,UAAWG,EAAAA,KAAK,qBAAsBH,GACtCJ,IAAAA,KACIK,EAEHF,SAAA,CAAAA,EACDK,EAAAA,IAACC,EAAeA,eAAA,CAAAL,UAAU,gCAGtC,IAEaM,EAAW,EACpBC,QAAAA,EACAP,UAAAA,KACGC,MAEG,MAAAH,EAAwB,YAAZS,EAAwB,KAAO,KAG7C,OAAAH,EAAAA,IAACN,EAAA,CACGE,UAAWG,EAAAA,KAAK,gBAAiBH,EAAW,CACxC,yBAAsC,YAAZO,EAC1B,2BAAwC,cAAZA,OAE5BN,GACR,EAIRK,EAASd,KAAOA,EAChBc,EAASE,KA7Ce,EAAGR,UAAAA,KAAcC,KAEjCG,EAAAA,IAAC,MAAGJ,UAAWG,EAAAA,KAAK,qBAAsBH,MAAgBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.cjs","sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { ListProps } from \"./types.js\";\n\ntype ValidLists = \"unordered\" | \"ordered\";\n\nfunction makeListComponent(listType: ValidLists): FC<ListProps> {\n const BaseList: FC<ListProps> = ({ children, className, ...rest }) => {\n const C = listType === \"ordered\" ? \"ol\" : \"ul\";\n\n return (\n <C\n className={clsx(\"jkl-list\", className, {\n \"jkl-list--ordered\": listType === \"ordered\",\n })}\n data-testid=\"jkl-list\"\n {...rest}\n >\n {children}\n </C>\n );\n };\n return BaseList;\n}\n\nexport const UnorderedList = makeListComponent(\"unordered\");\nUnorderedList.displayName = \"UnorderedList\";\nexport const OrderedList = makeListComponent(\"ordered\");\nOrderedList.displayName = \"OrderedList\";\nexport const List = UnorderedList;\nList.displayName = \"List\";\n"],"names":["makeListComponent","listType","children","className","rest","C","jsx","clsx","UnorderedList","displayName","OrderedList","List"],"mappings":"6JAMA,SAASA,EAAkBC,GAgBhB,MAfyB,EAAGC,SAAAA,EAAUC,UAAAA,KAAcC,MACjD,MAAAC,EAAiB,YAAbJ,EAAyB,KAAO,KAGtC,OAAAK,EAAAA,IAACD,EAAA,CACGF,UAAWI,EAAAA,KAAK,WAAYJ,EAAW,CACnC,oBAAkC,YAAbF,IAEzB,cAAY,cACRG,EAEHF,SAAAA,
|
|
1
|
+
{"version":3,"file":"List.cjs","sources":["../../../../src/components/list/List.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { FC } from \"react\";\nimport { ListProps } from \"./types.js\";\n\ntype ValidLists = \"unordered\" | \"ordered\";\n\nfunction makeListComponent(listType: ValidLists): FC<ListProps> {\n const BaseList: FC<ListProps> = ({ children, className, ...rest }) => {\n const C = listType === \"ordered\" ? \"ol\" : \"ul\";\n\n return (\n <C\n className={clsx(\"jkl-list\", className, {\n \"jkl-list--ordered\": listType === \"ordered\",\n })}\n data-testid=\"jkl-list\"\n {...rest}\n >\n {children}\n </C>\n );\n };\n return BaseList;\n}\n\nexport const UnorderedList = makeListComponent(\"unordered\");\nUnorderedList.displayName = \"UnorderedList\";\nexport const OrderedList = makeListComponent(\"ordered\");\nOrderedList.displayName = \"OrderedList\";\nexport const List = UnorderedList;\nList.displayName = \"List\";\n"],"names":["makeListComponent","listType","children","className","rest","C","jsx","clsx","UnorderedList","displayName","OrderedList","List"],"mappings":"6JAMA,SAASA,EAAkBC,GAgBhB,MAfyB,EAAGC,SAAAA,EAAUC,UAAAA,KAAcC,MACjD,MAAAC,EAAiB,YAAbJ,EAAyB,KAAO,KAGtC,OAAAK,EAAAA,IAACD,EAAA,CACGF,UAAWI,EAAAA,KAAK,WAAYJ,EAAW,CACnC,oBAAkC,YAAbF,IAEzB,cAAY,cACRG,EAEHF,SAAAA,GACL,CAIZ,CAEa,MAAAM,EAAgBR,EAAkB,aAC/CQ,EAAcC,YAAc,gBACf,MAAAC,EAAcV,EAAkB,WAC7CU,EAAYD,YAAc,cACnB,MAAME,EAAOH,EACpBG,EAAKF,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.cjs","sources":["../../../../src/components/loader/Loader.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { AriaRole } from \"react\";\nimport { useDelayedRender } from \"./useDelayedRender.js\";\n\nexport type LoaderVariant = \"small\" | \"medium\" | \"large\";\n\nexport interface LoaderProps {\n variant?: LoaderVariant;\n textDescription: string;\n className?: string;\n dataTestAutoId?: string;\n role?: AriaRole;\n inline?: boolean;\n /**\n * Antall millisekunder komponenten vil vente før den rendrer\n * @default 0\n */\n delay?: number;\n}\n\nexport const Loader = ({\n delay = 0,\n variant = \"large\",\n textDescription,\n className,\n dataTestAutoId = \"jkl-loader\",\n inline = false,\n ...rest\n}: LoaderProps): JSX.Element | null => {\n const renderComponent = useDelayedRender(delay);\n\n if (delay && !renderComponent) {\n return null;\n }\n\n const componentClassName = clsx(\"jkl-loader\", className, {\n \"jkl-loader--medium\": variant === \"medium\",\n \"jkl-loader--small\": variant === \"small\",\n \"jkl-loader--inline\": inline,\n });\n\n return (\n <span\n aria-busy=\"true\"\n className={componentClassName}\n data-testautoid={dataTestAutoId}\n data-testid=\"jkl-loader\"\n title={textDescription}\n {...rest}\n >\n <span className=\"jkl-loader__dot jkl-loader__dot--left\" />\n <span className=\"jkl-loader__dot jkl-loader__dot--middle\" />\n <span className=\"jkl-loader__dot jkl-loader__dot--right\" />\n <span className=\"jkl-sr-only\">{textDescription}</span>\n </span>\n );\n};\n"],"names":["delay","variant","textDescription","className","dataTestAutoId","inline","rest","renderComponent","useDelayedRender","componentClassName","clsx","jsxs","title","children","jsx"],"mappings":"gNAoBsB,EAClBA,MAAAA,EAAQ,EACRC,QAAAA,EAAU,QACVC,gBAAAA,EACAC,UAAAA,EACAC,eAAAA,EAAiB,aACjBC,OAAAA,GAAS,KACNC,MAEG,MAAAC,EAAkBC,mBAAiBR,GAErC,GAAAA,IAAUO,EACH,OAAA,KAGL,MAAAE,EAAqBC,EAAAA,KAAK,aAAcP,EAAW,CACrD,qBAAkC,WAAZF,EACtB,oBAAiC,UAAZA,EACrB,qBAAsBI,IAItB,OAAAM,EAAAA,KAAC,OAAA,CACG,YAAU,OACVR,UAAWM,EACX,kBAAiBL,EACjB,cAAY,aACZQ,MAAOV,KACHI,EAEJO,SAAA,CAACC,EAAAA,IAAA,OAAA,CAAKX,UAAU,0CAChBW,EAAAA,IAAC,OAAK,CAAAX,UAAU,4CAChBW,EAAAA,IAAC,OAAK,CAAAX,UAAU,2CACfW,EAAAA,IAAA,OAAA,CAAKX,UAAU,cAAeU,SAAgBX,
|
|
1
|
+
{"version":3,"file":"Loader.cjs","sources":["../../../../src/components/loader/Loader.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { AriaRole } from \"react\";\nimport { useDelayedRender } from \"./useDelayedRender.js\";\n\nexport type LoaderVariant = \"small\" | \"medium\" | \"large\";\n\nexport interface LoaderProps {\n variant?: LoaderVariant;\n textDescription: string;\n className?: string;\n dataTestAutoId?: string;\n role?: AriaRole;\n inline?: boolean;\n /**\n * Antall millisekunder komponenten vil vente før den rendrer\n * @default 0\n */\n delay?: number;\n}\n\nexport const Loader = ({\n delay = 0,\n variant = \"large\",\n textDescription,\n className,\n dataTestAutoId = \"jkl-loader\",\n inline = false,\n ...rest\n}: LoaderProps): JSX.Element | null => {\n const renderComponent = useDelayedRender(delay);\n\n if (delay && !renderComponent) {\n return null;\n }\n\n const componentClassName = clsx(\"jkl-loader\", className, {\n \"jkl-loader--medium\": variant === \"medium\",\n \"jkl-loader--small\": variant === \"small\",\n \"jkl-loader--inline\": inline,\n });\n\n return (\n <span\n aria-busy=\"true\"\n className={componentClassName}\n data-testautoid={dataTestAutoId}\n data-testid=\"jkl-loader\"\n title={textDescription}\n {...rest}\n >\n <span className=\"jkl-loader__dot jkl-loader__dot--left\" />\n <span className=\"jkl-loader__dot jkl-loader__dot--middle\" />\n <span className=\"jkl-loader__dot jkl-loader__dot--right\" />\n <span className=\"jkl-sr-only\">{textDescription}</span>\n </span>\n );\n};\n"],"names":["delay","variant","textDescription","className","dataTestAutoId","inline","rest","renderComponent","useDelayedRender","componentClassName","clsx","jsxs","title","children","jsx"],"mappings":"gNAoBsB,EAClBA,MAAAA,EAAQ,EACRC,QAAAA,EAAU,QACVC,gBAAAA,EACAC,UAAAA,EACAC,eAAAA,EAAiB,aACjBC,OAAAA,GAAS,KACNC,MAEG,MAAAC,EAAkBC,mBAAiBR,GAErC,GAAAA,IAAUO,EACH,OAAA,KAGL,MAAAE,EAAqBC,EAAAA,KAAK,aAAcP,EAAW,CACrD,qBAAkC,WAAZF,EACtB,oBAAiC,UAAZA,EACrB,qBAAsBI,IAItB,OAAAM,EAAAA,KAAC,OAAA,CACG,YAAU,OACVR,UAAWM,EACX,kBAAiBL,EACjB,cAAY,aACZQ,MAAOV,KACHI,EAEJO,SAAA,CAACC,EAAAA,IAAA,OAAA,CAAKX,UAAU,0CAChBW,EAAAA,IAAC,OAAK,CAAAX,UAAU,4CAChBW,EAAAA,IAAC,OAAK,CAAAX,UAAU,2CACfW,EAAAA,IAAA,OAAA,CAAKX,UAAU,cAAeU,SAAgBX,MACnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonAnimation.cjs","sources":["../../../../../src/components/loader/skeletons/SkeletonAnimation.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { AriaRole, HTMLProps, ReactNode } from \"react\";\nimport { Density } from \"../../../core/types.js\";\nimport { useDelayedRender } from \"../useDelayedRender.js\";\n\nexport interface SkeletonAnimationProps\n extends Pick<HTMLProps<HTMLDivElement>, \"style\"> {\n className?: string;\n children: ReactNode;\n density?: Density;\n /** @default \"Vennligst vent\" */\n textDescription?: string;\n role?: AriaRole;\n /**\n * Antall millisekunder komponenten vil vente før den rendrer\n * @default 0\n */\n delay?: number;\n}\n\nexport const SkeletonAnimation = ({\n className,\n delay = 0,\n density,\n textDescription = \"Vennligst vent\",\n ...rest\n}: SkeletonAnimationProps) => {\n const renderComponent = useDelayedRender(delay);\n\n if (delay && !renderComponent) {\n return null;\n }\n\n return (\n <div\n className={clsx(\"jkl-skeleton-animation\", className)}\n aria-busy=\"true\"\n aria-label={textDescription}\n {...rest}\n data-density={density}\n />\n );\n};\n"],"names":["className","delay","density","textDescription","rest","renderComponent","useDelayedRender","jsx","clsx"],"mappings":"+NAoBiC,EAC7BA,UAAAA,EACAC,MAAAA,EAAQ,EACRC,QAAAA,EACAC,gBAAAA,EAAkB,oBACfC,MAEG,MAAAC,EAAkBC,mBAAiBL,GAErC,OAAAA,IAAUI,EACH,KAIPE,EAAAA,IAAC,MAAA,CACGP,UAAWQ,EAAAA,KAAK,yBAA0BR,GAC1C,YAAU,OACV,aAAYG,KACRC,EACJ,eAAcF,
|
|
1
|
+
{"version":3,"file":"SkeletonAnimation.cjs","sources":["../../../../../src/components/loader/skeletons/SkeletonAnimation.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { AriaRole, HTMLProps, ReactNode } from \"react\";\nimport { Density } from \"../../../core/types.js\";\nimport { useDelayedRender } from \"../useDelayedRender.js\";\n\nexport interface SkeletonAnimationProps\n extends Pick<HTMLProps<HTMLDivElement>, \"style\"> {\n className?: string;\n children: ReactNode;\n density?: Density;\n /** @default \"Vennligst vent\" */\n textDescription?: string;\n role?: AriaRole;\n /**\n * Antall millisekunder komponenten vil vente før den rendrer\n * @default 0\n */\n delay?: number;\n}\n\nexport const SkeletonAnimation = ({\n className,\n delay = 0,\n density,\n textDescription = \"Vennligst vent\",\n ...rest\n}: SkeletonAnimationProps) => {\n const renderComponent = useDelayedRender(delay);\n\n if (delay && !renderComponent) {\n return null;\n }\n\n return (\n <div\n className={clsx(\"jkl-skeleton-animation\", className)}\n aria-busy=\"true\"\n aria-label={textDescription}\n {...rest}\n data-density={density}\n />\n );\n};\n"],"names":["className","delay","density","textDescription","rest","renderComponent","useDelayedRender","jsx","clsx"],"mappings":"+NAoBiC,EAC7BA,UAAAA,EACAC,MAAAA,EAAQ,EACRC,QAAAA,EACAC,gBAAAA,EAAkB,oBACfC,MAEG,MAAAC,EAAkBC,mBAAiBL,GAErC,OAAAA,IAAUI,EACH,KAIPE,EAAAA,IAAC,MAAA,CACGP,UAAWQ,EAAAA,KAAK,yBAA0BR,GAC1C,YAAU,OACV,aAAYG,KACRC,EACJ,eAAcF,GAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonLabel.cjs","sources":["../../../../../src/components/loader/skeletons/SkeletonLabel.tsx"],"sourcesContent":["import React from \"react\";\nimport { Density } from \"../../../core/types.js\";\nimport { SkeletonElement, SkeletonElementProps } from \"./SkeletonElement.js\";\n\nexport interface SkeletonLabelProps\n extends Omit<SkeletonElementProps, \"width\" | \"height\"> {\n className?: string;\n density?: Density;\n}\n\nexport const SkeletonLabel = ({ density, ...rest }: SkeletonLabelProps) => {\n const compact = density === \"compact\";\n return (\n <SkeletonElement\n {...rest}\n width={compact ? 100 : 115}\n height={compact ? 12 : 16}\n />\n );\n};\n"],"names":["density","rest","compact","jsx","SkeletonElement","width","height"],"mappings":"8KAU6B,EAAGA,QAAAA,KAAYC,MACxC,MAAMC,EAAsB,YAAZF,EAEZ,OAAAG,EAAAA,IAACC,EAAAA,gBAAA,IACOH,EACJI,MAAOH,EAAU,IAAM,IACvBI,OAAQJ,EAAU,GAAK,
|
|
1
|
+
{"version":3,"file":"SkeletonLabel.cjs","sources":["../../../../../src/components/loader/skeletons/SkeletonLabel.tsx"],"sourcesContent":["import React from \"react\";\nimport { Density } from \"../../../core/types.js\";\nimport { SkeletonElement, SkeletonElementProps } from \"./SkeletonElement.js\";\n\nexport interface SkeletonLabelProps\n extends Omit<SkeletonElementProps, \"width\" | \"height\"> {\n className?: string;\n density?: Density;\n}\n\nexport const SkeletonLabel = ({ density, ...rest }: SkeletonLabelProps) => {\n const compact = density === \"compact\";\n return (\n <SkeletonElement\n {...rest}\n width={compact ? 100 : 115}\n height={compact ? 12 : 16}\n />\n );\n};\n"],"names":["density","rest","compact","jsx","SkeletonElement","width","height"],"mappings":"8KAU6B,EAAGA,QAAAA,KAAYC,MACxC,MAAMC,EAAsB,YAAZF,EAEZ,OAAAG,EAAAA,IAACC,EAAAA,gBAAA,IACOH,EACJI,MAAOH,EAAU,IAAM,IACvBI,OAAQJ,EAAU,GAAK,IAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonTextArea.cjs","sources":["../../../../../src/components/loader/skeletons/SkeletonTextArea.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport { Density } from \"../../../core/types.js\";\nimport { SkeletonElement, SkeletonElementProps } from \"./SkeletonElement.js\";\nimport { SkeletonLabel, SkeletonLabelProps } from \"./SkeletonLabel.js\";\n\nexport interface SkeletonTextAreaProps {\n className?: string;\n labelProps?: SkeletonLabelProps;\n inputProps?: SkeletonElementProps;\n density?: Density;\n}\n\nexport const SkeletonTextArea = ({\n className,\n density,\n labelProps,\n inputProps,\n ...rest\n}: SkeletonTextAreaProps) => {\n const compact = density === \"compact\";\n return (\n <div\n className={clsx(\"jkl-skeleton-input\", className)}\n {...rest}\n data-density={density}\n >\n <SkeletonLabel density={density} {...labelProps} />\n <SkeletonElement\n width={compact ? 301 : 316}\n height={compact ? 148 : 168}\n {...inputProps}\n />\n </div>\n );\n};\n"],"names":["className","density","labelProps","inputProps","rest","compact","jsxs","clsx","children","jsx","SkeletonLabel","SkeletonElement","width","height"],"mappings":"6PAagC,EAC5BA,UAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,WAAAA,KACGC,MAEH,MAAMC,EAAsB,YAAZJ,EAEZ,OAAAK,EAAAA,KAAC,MAAA,CACGN,UAAWO,EAAAA,KAAK,qBAAsBP,MAClCI,EACJ,eAAcH,EAEdO,SAAA,CAACC,EAAAA,IAAAC,EAAAA,cAAA,CAAcT,QAAAA,KAAsBC,IACrCO,EAAAA,IAACE,EAAAA,gBAAA,CACGC,MAAOP,EAAU,IAAM,IACvBQ,OAAQR,EAAU,IAAM,OACpBF,
|
|
1
|
+
{"version":3,"file":"SkeletonTextArea.cjs","sources":["../../../../../src/components/loader/skeletons/SkeletonTextArea.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React from \"react\";\nimport { Density } from \"../../../core/types.js\";\nimport { SkeletonElement, SkeletonElementProps } from \"./SkeletonElement.js\";\nimport { SkeletonLabel, SkeletonLabelProps } from \"./SkeletonLabel.js\";\n\nexport interface SkeletonTextAreaProps {\n className?: string;\n labelProps?: SkeletonLabelProps;\n inputProps?: SkeletonElementProps;\n density?: Density;\n}\n\nexport const SkeletonTextArea = ({\n className,\n density,\n labelProps,\n inputProps,\n ...rest\n}: SkeletonTextAreaProps) => {\n const compact = density === \"compact\";\n return (\n <div\n className={clsx(\"jkl-skeleton-input\", className)}\n {...rest}\n data-density={density}\n >\n <SkeletonLabel density={density} {...labelProps} />\n <SkeletonElement\n width={compact ? 301 : 316}\n height={compact ? 148 : 168}\n {...inputProps}\n />\n </div>\n );\n};\n"],"names":["className","density","labelProps","inputProps","rest","compact","jsxs","clsx","children","jsx","SkeletonLabel","SkeletonElement","width","height"],"mappings":"6PAagC,EAC5BA,UAAAA,EACAC,QAAAA,EACAC,WAAAA,EACAC,WAAAA,KACGC,MAEH,MAAMC,EAAsB,YAAZJ,EAEZ,OAAAK,EAAAA,KAAC,MAAA,CACGN,UAAWO,EAAAA,KAAK,qBAAsBP,MAClCI,EACJ,eAAcH,EAEdO,SAAA,CAACC,EAAAA,IAAAC,EAAAA,cAAA,CAAcT,QAAAA,KAAsBC,IACrCO,EAAAA,IAACE,EAAAA,gBAAA,CACGC,MAAOP,EAAU,IAAM,IACvBQ,OAAQR,EAAU,IAAM,OACpBF,MAEZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.cjs","sources":["../../../../src/components/logo/Logo.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { CSSProperties } from \"react\";\nimport { useId } from \"../../hooks/useId/useId.js\";\n\nexport interface LogoProps {\n className?: string;\n id?: string;\n style?: CSSProperties;\n /** Sentrerer logosymbolet i viewboksen i stedet for den vanlige venstrejusteringen */\n centered?: boolean;\n /** Animerer overgangen mellom logo og logosymbol */\n animated?: boolean;\n /** Vis logosymbol i stedet for logo */\n isSymbol?: boolean;\n /** Beskrivelse av logoen tilgjengelig for skjermlesere */\n title?: string;\n}\n\nexport const Logo = ({\n className,\n id,\n centered = true,\n isSymbol = false,\n animated = false,\n title = \"Fremtind\",\n ...rest\n}: LogoProps): JSX.Element => {\n const uniqueId = useId(id || \"jkl-logo\", { generateSuffix: !id });\n\n return (\n <svg\n {...rest}\n className={clsx(\"jkl-logo\", className, {\n \"jkl-logo--animated\": animated,\n \"jkl-logo--symbol-only\": isSymbol,\n \"jkl-logo--centered\": centered && isSymbol,\n })}\n aria-labelledby={uniqueId}\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n viewBox={\n !animated && isSymbol && !centered\n ? \"31 60 150 83\"\n : \"32 27 581 120\"\n }\n >\n <title id={uniqueId}>{title}</title>\n <g\n fill=\"none\"\n className=\"jkl-logo__F\"\n strokeWidth=\"8\"\n transform={`${isSymbol ? \"rotate(45) translate(90, -70)\" : \"\"}`}\n >\n <line\n x1=\"34.3\"\n x2=\"104.846844\"\n y1=\"32.563024\"\n y2=\"32.563024\"\n className=\"jkl-logo__F-line\"\n transform={\n isSymbol ? \"scale(1.45, 1) translate(-10, 6)\" : \"\"\n }\n />\n <line\n x1=\"35.12226\"\n x2=\"91.504088\"\n y1=\"80.105318\"\n y2=\"80.105318\"\n />\n <line\n x1=\"-10.820058\"\n x2=\"87.38984\"\n y1=\"84.219561\"\n y2=\"84.219561\"\n transform=\"rotate(90, 38.2849, 84.2196)\"\n />\n </g>\n {!(isSymbol && !animated) && (\n <path\n strokeWidth=\".57975\"\n d=\"M145.752 58.979c-10.21 0-20.201 6.854-23.793 16.133l-.157-15.179-.002-.224h-6.907v73.723h7.782V98.038c0-11.791 2.998-31.572 23.077-31.572 2.89 0 5.153.23 7.12.724l.283.07v-7.806l-.187-.035c-2.363-.44-4.831-.44-7.216-.44M170.88 91.357c.1-15.2 10.325-26.21 24.387-26.21 15.08 0 23.29 13.146 23.658 26.21H170.88zm24.387-33.554c-10.228 0-18.904 4.44-25.092 12.84-4.925 6.7-7.22 15.031-7.22 26.218 0 11.088 3.262 20.766 9.433 27.99 6.099 6.954 13.994 10.481 23.466 10.481 8.097 0 15.596-3.04 21.115-8.559 4.522-4.364 7.305-9.583 8.269-15.515l.044-.262h-8.075l-.038.182c-.77 3.876-2.52 7.146-5.503 10.292-3.968 4.11-9.583 6.375-15.812 6.375-7.332 0-13.239-2.586-17.557-7.684-4.619-5.48-7.37-13.341-7.563-21.602h55.97v-.227c0-.877.038-1.659.074-2.415.037-.758.076-1.543.076-2.426 0-9.44-2.952-18.247-8.313-24.797-5.831-7.126-13.88-10.891-23.274-10.891h0zM324.782 57.803c-10.833 0-19.176 5.465-23.558 15.41-2.377-7.168-8.339-15.41-23.183-15.41-9.606 0-17.811 5.162-22.111 13.86l-.813-11.743-.016-.211h-6.89v73.723h7.78V96.568c0-12.182 2.933-21.098 8.72-26.501 3.425-3.265 7.76-4.92 12.885-4.92 11.845 0 17.362 6.4 17.362 20.142v48.143h7.923V91.736c0-8.853 2.965-16.346 8.573-21.666 3.682-3.36 7.777-4.924 12.89-4.924 11.741 0 17.21 6.4 17.21 20.143v48.143h7.783V84.844c0-17.438-8.721-27.041-24.555-27.041M387.105 37.665l-7.782 1.873v20.17h-14.656v7.195h14.656v45.933c0 14.145 6.615 21.622 19.133 21.622 3.964 0 7.73-.804 11.72-1.657l.668-.142v-6.91l-.267.05c-3.606.666-7.465 1.315-11.54 1.315-8.364 0-11.932-4.357-11.932-14.571v-45.64h43.533v66.529h8.22V59.709h-51.753V37.665M499.748 57.803c-10.364 0-20.339 5.951-24.596 14.576l-.83-12.67h-6.893v73.723h7.781V96.568c0-6.054.932-14.697 5.367-21.487 4.18-6.398 10.483-9.64 18.734-9.64 12.565 0 18.674 6.492 18.674 19.848v48.143h7.781V84.844c0-17.185-9.482-27.041-26.018-27.041M434.672 28.547a5.9 5.9 0 0 0-5.894 5.893 5.9 5.9 0 0 0 5.894 5.895 5.9 5.9 0 0 0 5.895-5.895 5.9 5.9 0 0 0-5.895-5.893M592.914 121.901c-4.007 3.85-8.984 5.801-14.793 5.801-5.777 0-10.472-1.658-14.354-5.068-6.188-5.519-9.597-14.775-9.597-26.066 0-10.31 2.89-19.102 8.139-24.751 4.135-4.291 9.212-6.376 15.52-6.376 6.202 0 11.324 1.9 15.23 5.653 6.251 5.846 9.164 13.941 9.164 25.474 0 10.765-3.132 19.29-9.309 25.333zm9.157-94.721v44.113c-4.264-7.988-14.077-13.49-24.243-13.49-8.072 0-14.828 2.585-20.081 7.682-7.309 6.897-11.5 18.281-11.5 31.234 0 13.6 4.294 24.848 12.091 31.673 5.234 4.605 11.841 6.94 19.64 6.94 10.115 0 20.112-5.893 24.154-14.127l.835 12.227h6.886V27.18h-7.782 0z\"\n className=\"jkl-logo__remtind\"\n />\n )}\n </svg>\n );\n};\n"],"names":["className","id","centered","isSymbol","animated","title","rest","uniqueId","useId","generateSuffix","jsxs","clsx","role","xmlns","fill","stroke","viewBox","children","jsx","strokeWidth","transform","x1","x2","y1","y2","d"],"mappings":"mNAkBoB,EAChBA,UAAAA,EACAC,GAAAA,EACAC,SAAAA,GAAW,EACXC,SAAAA,GAAW,EACXC,SAAAA,GAAW,EACXC,MAAAA,EAAQ,cACLC,MAEG,MAAAC,EAAWC,
|
|
1
|
+
{"version":3,"file":"Logo.cjs","sources":["../../../../src/components/logo/Logo.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { CSSProperties } from \"react\";\nimport { useId } from \"../../hooks/useId/useId.js\";\n\nexport interface LogoProps {\n className?: string;\n id?: string;\n style?: CSSProperties;\n /** Sentrerer logosymbolet i viewboksen i stedet for den vanlige venstrejusteringen */\n centered?: boolean;\n /** Animerer overgangen mellom logo og logosymbol */\n animated?: boolean;\n /** Vis logosymbol i stedet for logo */\n isSymbol?: boolean;\n /** Beskrivelse av logoen tilgjengelig for skjermlesere */\n title?: string;\n}\n\nexport const Logo = ({\n className,\n id,\n centered = true,\n isSymbol = false,\n animated = false,\n title = \"Fremtind\",\n ...rest\n}: LogoProps): JSX.Element => {\n const uniqueId = useId(id || \"jkl-logo\", { generateSuffix: !id });\n\n return (\n <svg\n {...rest}\n className={clsx(\"jkl-logo\", className, {\n \"jkl-logo--animated\": animated,\n \"jkl-logo--symbol-only\": isSymbol,\n \"jkl-logo--centered\": centered && isSymbol,\n })}\n aria-labelledby={uniqueId}\n role=\"img\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n viewBox={\n !animated && isSymbol && !centered\n ? \"31 60 150 83\"\n : \"32 27 581 120\"\n }\n >\n <title id={uniqueId}>{title}</title>\n <g\n fill=\"none\"\n className=\"jkl-logo__F\"\n strokeWidth=\"8\"\n transform={`${isSymbol ? \"rotate(45) translate(90, -70)\" : \"\"}`}\n >\n <line\n x1=\"34.3\"\n x2=\"104.846844\"\n y1=\"32.563024\"\n y2=\"32.563024\"\n className=\"jkl-logo__F-line\"\n transform={\n isSymbol ? \"scale(1.45, 1) translate(-10, 6)\" : \"\"\n }\n />\n <line\n x1=\"35.12226\"\n x2=\"91.504088\"\n y1=\"80.105318\"\n y2=\"80.105318\"\n />\n <line\n x1=\"-10.820058\"\n x2=\"87.38984\"\n y1=\"84.219561\"\n y2=\"84.219561\"\n transform=\"rotate(90, 38.2849, 84.2196)\"\n />\n </g>\n {!(isSymbol && !animated) && (\n <path\n strokeWidth=\".57975\"\n d=\"M145.752 58.979c-10.21 0-20.201 6.854-23.793 16.133l-.157-15.179-.002-.224h-6.907v73.723h7.782V98.038c0-11.791 2.998-31.572 23.077-31.572 2.89 0 5.153.23 7.12.724l.283.07v-7.806l-.187-.035c-2.363-.44-4.831-.44-7.216-.44M170.88 91.357c.1-15.2 10.325-26.21 24.387-26.21 15.08 0 23.29 13.146 23.658 26.21H170.88zm24.387-33.554c-10.228 0-18.904 4.44-25.092 12.84-4.925 6.7-7.22 15.031-7.22 26.218 0 11.088 3.262 20.766 9.433 27.99 6.099 6.954 13.994 10.481 23.466 10.481 8.097 0 15.596-3.04 21.115-8.559 4.522-4.364 7.305-9.583 8.269-15.515l.044-.262h-8.075l-.038.182c-.77 3.876-2.52 7.146-5.503 10.292-3.968 4.11-9.583 6.375-15.812 6.375-7.332 0-13.239-2.586-17.557-7.684-4.619-5.48-7.37-13.341-7.563-21.602h55.97v-.227c0-.877.038-1.659.074-2.415.037-.758.076-1.543.076-2.426 0-9.44-2.952-18.247-8.313-24.797-5.831-7.126-13.88-10.891-23.274-10.891h0zM324.782 57.803c-10.833 0-19.176 5.465-23.558 15.41-2.377-7.168-8.339-15.41-23.183-15.41-9.606 0-17.811 5.162-22.111 13.86l-.813-11.743-.016-.211h-6.89v73.723h7.78V96.568c0-12.182 2.933-21.098 8.72-26.501 3.425-3.265 7.76-4.92 12.885-4.92 11.845 0 17.362 6.4 17.362 20.142v48.143h7.923V91.736c0-8.853 2.965-16.346 8.573-21.666 3.682-3.36 7.777-4.924 12.89-4.924 11.741 0 17.21 6.4 17.21 20.143v48.143h7.783V84.844c0-17.438-8.721-27.041-24.555-27.041M387.105 37.665l-7.782 1.873v20.17h-14.656v7.195h14.656v45.933c0 14.145 6.615 21.622 19.133 21.622 3.964 0 7.73-.804 11.72-1.657l.668-.142v-6.91l-.267.05c-3.606.666-7.465 1.315-11.54 1.315-8.364 0-11.932-4.357-11.932-14.571v-45.64h43.533v66.529h8.22V59.709h-51.753V37.665M499.748 57.803c-10.364 0-20.339 5.951-24.596 14.576l-.83-12.67h-6.893v73.723h7.781V96.568c0-6.054.932-14.697 5.367-21.487 4.18-6.398 10.483-9.64 18.734-9.64 12.565 0 18.674 6.492 18.674 19.848v48.143h7.781V84.844c0-17.185-9.482-27.041-26.018-27.041M434.672 28.547a5.9 5.9 0 0 0-5.894 5.893 5.9 5.9 0 0 0 5.894 5.895 5.9 5.9 0 0 0 5.895-5.895 5.9 5.9 0 0 0-5.895-5.893M592.914 121.901c-4.007 3.85-8.984 5.801-14.793 5.801-5.777 0-10.472-1.658-14.354-5.068-6.188-5.519-9.597-14.775-9.597-26.066 0-10.31 2.89-19.102 8.139-24.751 4.135-4.291 9.212-6.376 15.52-6.376 6.202 0 11.324 1.9 15.23 5.653 6.251 5.846 9.164 13.941 9.164 25.474 0 10.765-3.132 19.29-9.309 25.333zm9.157-94.721v44.113c-4.264-7.988-14.077-13.49-24.243-13.49-8.072 0-14.828 2.585-20.081 7.682-7.309 6.897-11.5 18.281-11.5 31.234 0 13.6 4.294 24.848 12.091 31.673 5.234 4.605 11.841 6.94 19.64 6.94 10.115 0 20.112-5.893 24.154-14.127l.835 12.227h6.886V27.18h-7.782 0z\"\n className=\"jkl-logo__remtind\"\n />\n )}\n </svg>\n );\n};\n"],"names":["className","id","centered","isSymbol","animated","title","rest","uniqueId","useId","generateSuffix","jsxs","clsx","role","xmlns","fill","stroke","viewBox","children","jsx","strokeWidth","transform","x1","x2","y1","y2","d"],"mappings":"mNAkBoB,EAChBA,UAAAA,EACAC,GAAAA,EACAC,SAAAA,GAAW,EACXC,SAAAA,GAAW,EACXC,SAAAA,GAAW,EACXC,MAAAA,EAAQ,cACLC,MAEG,MAAAC,EAAWC,EAAAA,MAAMP,GAAM,WAAY,CAAEQ,gBAAiBR,IAGxD,OAAAS,EAAAA,KAAC,MAAA,IACOJ,EACJN,UAAWW,EAAAA,KAAK,WAAYX,EAAW,CACnC,qBAAsBI,EACtB,wBAAyBD,EACzB,qBAAsBD,GAAYC,IAEtC,kBAAiBI,EACjBK,KAAK,MACLC,MAAM,6BACNC,KAAK,eACLC,OAAO,eACPC,QACKZ,IAAYD,GAAaD,EAEpB,gBADA,eAIVe,SAAA,CAACC,EAAAA,IAAA,QAAA,CAAMjB,GAAIM,EAAWU,SAAMZ,IAC5BK,EAAAA,KAAC,IAAA,CACGI,KAAK,OACLd,UAAU,cACVmB,YAAY,IACZC,UAAW,IAAGjB,EAAW,gCAAkC,IAE3Dc,SAAA,CAAAC,EAAAA,IAAC,OAAA,CACGG,GAAG,OACHC,GAAG,aACHC,GAAG,YACHC,GAAG,YACHxB,UAAU,mBACVoB,UACIjB,EAAW,mCAAqC,KAGxDe,EAAAA,IAAC,OAAA,CACGG,GAAG,WACHC,GAAG,YACHC,GAAG,YACHC,GAAG,cAEPN,EAAAA,IAAC,OAAA,CACGG,GAAG,aACHC,GAAG,WACHC,GAAG,YACHC,GAAG,YACHJ,UAAU,sCAGfjB,IAAaC,IACZc,EAAAA,IAAC,OAAA,CACGC,YAAY,SACZM,EAAE,w8EACFzB,UAAU,wBAGtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoStamp.cjs","sources":["../../../../src/components/logo/LogoStamp.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { CSSProperties, useRef } from \"react\";\nimport { WithChildren } from \"../../core/types.js\";\nimport { useId } from \"../../hooks/useId/useId.js\";\nimport { useTextSpinner } from \"./useTextSpinner.js\";\n\nexport interface LogoStampProps extends WithChildren {\n className?: string;\n id?: string;\n style?: CSSProperties;\n /**\n * Beskrivelse av logostempelet tilgjengelig for skjermlesere.\n * Teksten i logostempelet er en path, og ikke tilgjengelig for skjermlesere.\n * @default \"Forsikring levert av Fremtind\"\n */\n title?: string;\n /** Roterer teksten rundt logostempelet første gangen stempelet kommer til syne */\n animated?: boolean;\n}\n\nexport const LogoStamp = ({\n children,\n className,\n id,\n animated = false,\n title,\n ...rest\n}: LogoStampProps): JSX.Element => {\n const uniqueId = useId(id || \"jkl-logo-stamp\", { generateSuffix: !id });\n const stampRef = useRef<SVGSVGElement>(null);\n const { hasAnimated, visible } = useTextSpinner(stampRef);\n\n return (\n <svg\n {...rest}\n ref={stampRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-labelledby={uniqueId}\n className={clsx(\"jkl-logo-stamp\", className, {\n \"jkl-logo-stamp--animated\": animated,\n })}\n data-rotate={animated && (visible || hasAnimated)}\n role=\"img\"\n >\n <title id={uniqueId}>\n {title || \"Forsikring levert av Fremtind\"}\n </title>\n <g className=\"jkl-logo-stamp__logo\">\n <path\n fill=\"currentColor\"\n d=\"M256 177.2L146.4 286.8l8.5 8.4 51.4-51.4 51.4 51.4 8.2-8.1-51.5-51.5 41.9-41.8L357.5 295l8.1-8.2z\"\n />\n </g>\n <g className=\"jkl-logo-stamp__text\">{children}</g>\n </svg>\n );\n};\n"],"names":["children","className","id","animated","title","rest","uniqueId","useId","generateSuffix","stampRef","useRef","hasAnimated","visible","useTextSpinner","jsxs","ref","xmlns","viewBox","clsx","role","jsx","fill","d"],"mappings":"6QAoByB,EACrBA,SAAAA,EACAC,UAAAA,EACAC,GAAAA,EACAC,SAAAA,GAAW,EACXC,MAAAA,KACGC,MAEG,MAAAC,EAAWC,
|
|
1
|
+
{"version":3,"file":"LogoStamp.cjs","sources":["../../../../src/components/logo/LogoStamp.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { CSSProperties, useRef } from \"react\";\nimport { WithChildren } from \"../../core/types.js\";\nimport { useId } from \"../../hooks/useId/useId.js\";\nimport { useTextSpinner } from \"./useTextSpinner.js\";\n\nexport interface LogoStampProps extends WithChildren {\n className?: string;\n id?: string;\n style?: CSSProperties;\n /**\n * Beskrivelse av logostempelet tilgjengelig for skjermlesere.\n * Teksten i logostempelet er en path, og ikke tilgjengelig for skjermlesere.\n * @default \"Forsikring levert av Fremtind\"\n */\n title?: string;\n /** Roterer teksten rundt logostempelet første gangen stempelet kommer til syne */\n animated?: boolean;\n}\n\nexport const LogoStamp = ({\n children,\n className,\n id,\n animated = false,\n title,\n ...rest\n}: LogoStampProps): JSX.Element => {\n const uniqueId = useId(id || \"jkl-logo-stamp\", { generateSuffix: !id });\n const stampRef = useRef<SVGSVGElement>(null);\n const { hasAnimated, visible } = useTextSpinner(stampRef);\n\n return (\n <svg\n {...rest}\n ref={stampRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 512 512\"\n aria-labelledby={uniqueId}\n className={clsx(\"jkl-logo-stamp\", className, {\n \"jkl-logo-stamp--animated\": animated,\n })}\n data-rotate={animated && (visible || hasAnimated)}\n role=\"img\"\n >\n <title id={uniqueId}>\n {title || \"Forsikring levert av Fremtind\"}\n </title>\n <g className=\"jkl-logo-stamp__logo\">\n <path\n fill=\"currentColor\"\n d=\"M256 177.2L146.4 286.8l8.5 8.4 51.4-51.4 51.4 51.4 8.2-8.1-51.5-51.5 41.9-41.8L357.5 295l8.1-8.2z\"\n />\n </g>\n <g className=\"jkl-logo-stamp__text\">{children}</g>\n </svg>\n );\n};\n"],"names":["children","className","id","animated","title","rest","uniqueId","useId","generateSuffix","stampRef","useRef","hasAnimated","visible","useTextSpinner","jsxs","ref","xmlns","viewBox","clsx","role","jsx","fill","d"],"mappings":"6QAoByB,EACrBA,SAAAA,EACAC,UAAAA,EACAC,GAAAA,EACAC,SAAAA,GAAW,EACXC,MAAAA,KACGC,MAEG,MAAAC,EAAWC,EAAAA,MAAML,GAAM,iBAAkB,CAAEM,gBAAiBN,IAC5DO,EAAWC,SAAsB,OAC/BC,YAAAA,EAAaC,QAAAA,GAAYC,EAAAA,eAAeJ,GAG5C,OAAAK,EAAAA,KAAC,MAAA,IACOT,EACJU,IAAKN,EACLO,MAAM,6BACNC,QAAQ,cACR,kBAAiBX,EACjBL,UAAWiB,EAAAA,KAAK,iBAAkBjB,EAAW,CACzC,2BAA4BE,IAEhC,cAAaA,IAAaS,GAAWD,GACrCQ,KAAK,MAELnB,SAAA,CAAAoB,EAAAA,IAAC,QAAM,CAAAlB,GAAII,EACNN,SAAAI,GAAS,kCAEdgB,EAAAA,IAAC,IAAE,CAAAnB,UAAU,uBACTD,SAAAoB,EAAAA,IAAC,OAAA,CACGC,KAAK,eACLC,EAAE,wGAGTF,EAAAA,IAAA,IAAA,CAAEnB,UAAU,uBAAwBD,SAAAA,MACzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTextSpinner.cjs","sources":["../../../../src/components/logo/useTextSpinner.ts"],"sourcesContent":["import React, { useState } from \"react\";\nimport { useIntersectionObserver } from \"../../hooks/useIntersectionObserver/useIntersectionObserver.js\";\nexport function useTextSpinner<T extends HTMLElement | SVGElement>(\n ref: React.RefObject<T>,\n) {\n const [hasAnimated, setHasAnimated] = useState(false);\n const [visible, setVisible] = useState(false);\n\n const onIntersect = (entries: IntersectionObserverEntry[]) => {\n const intersecting = entries.some((entry) => entry.isIntersecting);\n setVisible(intersecting);\n if (intersecting) {\n setHasAnimated(true);\n }\n };\n useIntersectionObserver(ref, onIntersect, () => setVisible(true), {\n rootMargin: \"50% 0% 0% 0%\",\n threshold: 0.5,\n });\n\n return { hasAnimated, visible };\n}\n"],"names":["ref","hasAnimated","setHasAnimated","useState","visible","setVisible","useIntersectionObserver","entries","intersecting","some","entry","isIntersecting","rootMargin","threshold"],"mappings":"6MAEO,SACHA,GAEA,MAAOC,EAAaC,GAAkBC,
|
|
1
|
+
{"version":3,"file":"useTextSpinner.cjs","sources":["../../../../src/components/logo/useTextSpinner.ts"],"sourcesContent":["import React, { useState } from \"react\";\nimport { useIntersectionObserver } from \"../../hooks/useIntersectionObserver/useIntersectionObserver.js\";\nexport function useTextSpinner<T extends HTMLElement | SVGElement>(\n ref: React.RefObject<T>,\n) {\n const [hasAnimated, setHasAnimated] = useState(false);\n const [visible, setVisible] = useState(false);\n\n const onIntersect = (entries: IntersectionObserverEntry[]) => {\n const intersecting = entries.some((entry) => entry.isIntersecting);\n setVisible(intersecting);\n if (intersecting) {\n setHasAnimated(true);\n }\n };\n useIntersectionObserver(ref, onIntersect, () => setVisible(true), {\n rootMargin: \"50% 0% 0% 0%\",\n threshold: 0.5,\n });\n\n return { hasAnimated, visible };\n}\n"],"names":["ref","hasAnimated","setHasAnimated","useState","visible","setVisible","useIntersectionObserver","entries","intersecting","some","entry","isIntersecting","rootMargin","threshold"],"mappings":"6MAEO,SACHA,GAEA,MAAOC,EAAaC,GAAkBC,EAAAA,UAAS,IACxCC,EAASC,GAAcF,EAAAA,UAAS,GASvCG,OAAAA,EAAAA,wBAAwBN,GAPHO,IACjB,MAAMC,EAAeD,EAAQE,MAAMC,GAAUA,EAAMC,iBACnDN,EAAWG,GACPA,GACAN,GAAe,EAAI,IAGe,IAAMG,GAAW,IAAO,CAC9DO,WAAY,eACZC,UAAW,KAGR,CAAEZ,YAAAA,EAAaG,QAAAA,EAC1B"}
|