@fremtind/jokul 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/build/build-stats.html +4842 -0
- package/build/cjs/components/ScreenReaderOnly.js +2 -0
- package/build/cjs/components/ScreenReaderOnly.js.map +1 -0
- package/build/cjs/components/SlotComponent.js +2 -0
- package/build/cjs/components/SlotComponent.js.map +1 -0
- package/build/cjs/components/index.js +2 -0
- package/build/cjs/components/index.js.map +1 -0
- package/build/cjs/components/navigation/Link.js +2 -0
- package/build/cjs/components/navigation/Link.js.map +1 -0
- package/build/cjs/components/navigation/NavLink.js +2 -0
- package/build/cjs/components/navigation/NavLink.js.map +1 -0
- package/build/cjs/components/navigation/index.js +2 -0
- package/build/cjs/components/navigation/index.js.map +1 -0
- package/build/cjs/core/as-child.js +2 -0
- package/build/cjs/core/as-child.js.map +1 -0
- package/build/cjs/core/index.js +2 -0
- package/build/cjs/core/index.js.map +1 -0
- package/build/cjs/core/polymorphism.js +2 -0
- package/build/cjs/core/polymorphism.js.map +1 -0
- package/build/cjs/core/tokens.js +2 -0
- package/build/cjs/core/tokens.js.map +1 -0
- package/build/cjs/core/types.js +2 -0
- package/build/cjs/core/types.js.map +1 -0
- package/build/cjs/core/utils/breakpoints.js +2 -0
- package/build/cjs/core/utils/breakpoints.js.map +1 -0
- package/build/cjs/core/utils/density.js +2 -0
- package/build/cjs/core/utils/density.js.map +1 -0
- package/build/cjs/core/utils/getValuePair.js +2 -0
- package/build/cjs/core/utils/getValuePair.js.map +1 -0
- package/build/cjs/core/utils/index.js +2 -0
- package/build/cjs/core/utils/index.js.map +1 -0
- package/build/cjs/core/utils/mergeProps.js +2 -0
- package/build/cjs/core/utils/mergeProps.js.map +1 -0
- package/build/cjs/core/utils/mergeRefs.js +2 -0
- package/build/cjs/core/utils/mergeRefs.js.map +1 -0
- package/build/cjs/core/utils/motion.js +2 -0
- package/build/cjs/core/utils/motion.js.map +1 -0
- package/build/cjs/core/utils/tabListener.js +2 -0
- package/build/cjs/core/utils/tabListener.js.map +1 -0
- package/build/cjs/hooks/index.js +2 -0
- package/build/cjs/hooks/index.js.map +1 -0
- package/build/cjs/hooks/mediaQueryUtils.js +2 -0
- package/build/cjs/hooks/mediaQueryUtils.js.map +1 -0
- package/build/cjs/hooks/useAnimatedDetails/index.js +2 -0
- package/build/cjs/hooks/useAnimatedDetails/index.js.map +1 -0
- package/build/cjs/hooks/useAnimatedDetails/useAnimatedDetails.js +2 -0
- package/build/cjs/hooks/useAnimatedDetails/useAnimatedDetails.js.map +1 -0
- package/build/cjs/hooks/useAnimatedHeight/index.js +2 -0
- package/build/cjs/hooks/useAnimatedHeight/index.js.map +1 -0
- package/build/cjs/hooks/useAnimatedHeight/types.js +2 -0
- package/build/cjs/hooks/useAnimatedHeight/types.js.map +1 -0
- package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js +2 -0
- package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -0
- package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +2 -0
- package/build/cjs/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -0
- package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js +2 -0
- package/build/cjs/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -0
- package/build/cjs/hooks/useAriaLiveRegion/index.js +2 -0
- package/build/cjs/hooks/useAriaLiveRegion/index.js.map +1 -0
- package/build/cjs/hooks/useAriaLiveRegion/useAriaLiveRegion.js +2 -0
- package/build/cjs/hooks/useAriaLiveRegion/useAriaLiveRegion.js.map +1 -0
- package/build/cjs/hooks/useBrowserPreferences/index.js +2 -0
- package/build/cjs/hooks/useBrowserPreferences/index.js.map +1 -0
- package/build/cjs/hooks/useBrowserPreferences/useBrowserPreferences.js +2 -0
- package/build/cjs/hooks/useBrowserPreferences/useBrowserPreferences.js.map +1 -0
- package/build/cjs/hooks/useClickOutside/index.js +2 -0
- package/build/cjs/hooks/useClickOutside/index.js.map +1 -0
- package/build/cjs/hooks/useClickOutside/useClickOutside.js +2 -0
- package/build/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -0
- package/build/cjs/hooks/useElementDimensions/index.js +2 -0
- package/build/cjs/hooks/useElementDimensions/index.js.map +1 -0
- package/build/cjs/hooks/useElementDimensions/useElementDimensions.js +2 -0
- package/build/cjs/hooks/useElementDimensions/useElementDimensions.js.map +1 -0
- package/build/cjs/hooks/useFocusOutside/index.js +2 -0
- package/build/cjs/hooks/useFocusOutside/index.js.map +1 -0
- package/build/cjs/hooks/useFocusOutside/useFocusOutside.js +2 -0
- package/build/cjs/hooks/useFocusOutside/useFocusOutside.js.map +1 -0
- package/build/cjs/hooks/useId/index.js +2 -0
- package/build/cjs/hooks/useId/index.js.map +1 -0
- package/build/cjs/hooks/useId/useId.js +2 -0
- package/build/cjs/hooks/useId/useId.js.map +1 -0
- package/build/cjs/hooks/useIntersectionObserver/index.js +2 -0
- package/build/cjs/hooks/useIntersectionObserver/index.js.map +1 -0
- package/build/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -0
- package/build/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -0
- package/build/cjs/hooks/useKeyListener/index.js +2 -0
- package/build/cjs/hooks/useKeyListener/index.js.map +1 -0
- package/build/cjs/hooks/useKeyListener/useKeyListener.js +2 -0
- package/build/cjs/hooks/useKeyListener/useKeyListener.js.map +1 -0
- package/build/cjs/hooks/useListNavigation/index.js +2 -0
- package/build/cjs/hooks/useListNavigation/index.js.map +1 -0
- package/build/cjs/hooks/useListNavigation/useListNavigation.js +2 -0
- package/build/cjs/hooks/useListNavigation/useListNavigation.js.map +1 -0
- package/build/cjs/hooks/useLocalStorage/index.js +2 -0
- package/build/cjs/hooks/useLocalStorage/index.js.map +1 -0
- package/build/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -0
- package/build/cjs/hooks/useLocalStorage/useLocalStorage.js.map +1 -0
- package/build/cjs/hooks/useMutationObserver/index.js +2 -0
- package/build/cjs/hooks/useMutationObserver/index.js.map +1 -0
- package/build/cjs/hooks/useMutationObserver/useMutationObserver.js +2 -0
- package/build/cjs/hooks/useMutationObserver/useMutationObserver.js.map +1 -0
- package/build/cjs/hooks/usePreviousValue/index.js +2 -0
- package/build/cjs/hooks/usePreviousValue/index.js.map +1 -0
- package/build/cjs/hooks/usePreviousValue/usePreviousValue.js +2 -0
- package/build/cjs/hooks/usePreviousValue/usePreviousValue.js.map +1 -0
- package/build/cjs/hooks/useProgressiveImg/index.js +2 -0
- package/build/cjs/hooks/useProgressiveImg/index.js.map +1 -0
- package/build/cjs/hooks/useProgressiveImg/useProgressiveImg.js +2 -0
- package/build/cjs/hooks/useProgressiveImg/useProgressiveImg.js.map +1 -0
- package/build/cjs/hooks/useScreen/index.js +2 -0
- package/build/cjs/hooks/useScreen/index.js.map +1 -0
- package/build/cjs/hooks/useScreen/state.js +2 -0
- package/build/cjs/hooks/useScreen/state.js.map +1 -0
- package/build/cjs/hooks/useScreen/useScreen.js +2 -0
- package/build/cjs/hooks/useScreen/useScreen.js.map +1 -0
- package/build/cjs/hooks/useScrollIntoView/index.js +2 -0
- package/build/cjs/hooks/useScrollIntoView/index.js.map +1 -0
- package/build/cjs/hooks/useScrollIntoView/useScrollIntoView.js +2 -0
- package/build/cjs/hooks/useScrollIntoView/useScrollIntoView.js.map +1 -0
- package/build/cjs/hooks/useSwipeGesture/index.js +2 -0
- package/build/cjs/hooks/useSwipeGesture/index.js.map +1 -0
- package/build/cjs/hooks/useSwipeGesture/useSwipeGesture.js +2 -0
- package/build/cjs/hooks/useSwipeGesture/useSwipeGesture.js.map +1 -0
- package/build/clsx-BeLtu-UY.js +2 -0
- package/build/clsx-BeLtu-UY.js.map +1 -0
- package/build/clsx-E3yX_9sL.cjs +2 -0
- package/build/clsx-E3yX_9sL.cjs.map +1 -0
- package/build/components/ScreenReaderOnly.d.ts +6 -0
- package/build/components/SlotComponent.d.ts +7 -0
- package/build/components/index.d.ts +2 -0
- package/build/components/navigation/Link.d.ts +5 -0
- package/build/components/navigation/NavLink.d.ts +6 -0
- package/build/components/navigation/index.d.ts +2 -0
- package/build/core/as-child.d.ts +39 -0
- package/build/core/index.d.ts +7 -0
- package/build/core/polymorphism.d.ts +11 -0
- package/build/core/tokens.d.ts +351 -0
- package/build/core/types.d.ts +42 -0
- package/build/core/utils/breakpoints.d.ts +6 -0
- package/build/core/utils/density.d.ts +1 -0
- package/build/core/utils/getValuePair.d.ts +2 -0
- package/build/core/utils/index.d.ts +8 -0
- package/build/core/utils/mergeProps.d.ts +3 -0
- package/build/core/utils/mergeRefs.d.ts +3 -0
- package/build/core/utils/motion.d.ts +16 -0
- package/build/core/utils/tabListener.d.ts +1 -0
- package/build/es/components/ScreenReaderOnly.js +2 -0
- package/build/es/components/ScreenReaderOnly.js.map +1 -0
- package/build/es/components/SlotComponent.js +2 -0
- package/build/es/components/SlotComponent.js.map +1 -0
- package/build/es/components/index.js +2 -0
- package/build/es/components/index.js.map +1 -0
- package/build/es/components/navigation/Link.js +2 -0
- package/build/es/components/navigation/Link.js.map +1 -0
- package/build/es/components/navigation/NavLink.js +2 -0
- package/build/es/components/navigation/NavLink.js.map +1 -0
- package/build/es/components/navigation/index.js +2 -0
- package/build/es/components/navigation/index.js.map +1 -0
- package/build/es/core/as-child.js +2 -0
- package/build/es/core/as-child.js.map +1 -0
- package/build/es/core/index.js +2 -0
- package/build/es/core/index.js.map +1 -0
- package/build/es/core/polymorphism.js +2 -0
- package/build/es/core/polymorphism.js.map +1 -0
- package/build/es/core/tokens.js +2 -0
- package/build/es/core/tokens.js.map +1 -0
- package/build/es/core/types.js +2 -0
- package/build/es/core/types.js.map +1 -0
- package/build/es/core/utils/breakpoints.js +2 -0
- package/build/es/core/utils/breakpoints.js.map +1 -0
- package/build/es/core/utils/density.js +2 -0
- package/build/es/core/utils/density.js.map +1 -0
- package/build/es/core/utils/getValuePair.js +2 -0
- package/build/es/core/utils/getValuePair.js.map +1 -0
- package/build/es/core/utils/index.js +2 -0
- package/build/es/core/utils/index.js.map +1 -0
- package/build/es/core/utils/mergeProps.js +2 -0
- package/build/es/core/utils/mergeProps.js.map +1 -0
- package/build/es/core/utils/mergeRefs.js +2 -0
- package/build/es/core/utils/mergeRefs.js.map +1 -0
- package/build/es/core/utils/motion.js +2 -0
- package/build/es/core/utils/motion.js.map +1 -0
- package/build/es/core/utils/tabListener.js +2 -0
- package/build/es/core/utils/tabListener.js.map +1 -0
- package/build/es/hooks/index.js +2 -0
- package/build/es/hooks/index.js.map +1 -0
- package/build/es/hooks/mediaQueryUtils.js +2 -0
- package/build/es/hooks/mediaQueryUtils.js.map +1 -0
- package/build/es/hooks/useAnimatedDetails/index.js +2 -0
- package/build/es/hooks/useAnimatedDetails/index.js.map +1 -0
- package/build/es/hooks/useAnimatedDetails/useAnimatedDetails.js +2 -0
- package/build/es/hooks/useAnimatedDetails/useAnimatedDetails.js.map +1 -0
- package/build/es/hooks/useAnimatedHeight/index.js +2 -0
- package/build/es/hooks/useAnimatedHeight/index.js.map +1 -0
- package/build/es/hooks/useAnimatedHeight/types.js +2 -0
- package/build/es/hooks/useAnimatedHeight/types.js.map +1 -0
- package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js +2 -0
- package/build/es/hooks/useAnimatedHeight/useAnimatedHeight.js.map +1 -0
- package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js +2 -0
- package/build/es/hooks/useAnimatedHeight/useAnimatedHeightBetween.js.map +1 -0
- package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js +2 -0
- package/build/es/hooks/useAnimatedHeight/useAutoAnimateHeight.js.map +1 -0
- package/build/es/hooks/useAriaLiveRegion/index.js +2 -0
- package/build/es/hooks/useAriaLiveRegion/index.js.map +1 -0
- package/build/es/hooks/useAriaLiveRegion/useAriaLiveRegion.js +2 -0
- package/build/es/hooks/useAriaLiveRegion/useAriaLiveRegion.js.map +1 -0
- package/build/es/hooks/useBrowserPreferences/index.js +2 -0
- package/build/es/hooks/useBrowserPreferences/index.js.map +1 -0
- package/build/es/hooks/useBrowserPreferences/useBrowserPreferences.js +2 -0
- package/build/es/hooks/useBrowserPreferences/useBrowserPreferences.js.map +1 -0
- package/build/es/hooks/useClickOutside/index.js +2 -0
- package/build/es/hooks/useClickOutside/index.js.map +1 -0
- package/build/es/hooks/useClickOutside/useClickOutside.js +2 -0
- package/build/es/hooks/useClickOutside/useClickOutside.js.map +1 -0
- package/build/es/hooks/useElementDimensions/index.js +2 -0
- package/build/es/hooks/useElementDimensions/index.js.map +1 -0
- package/build/es/hooks/useElementDimensions/useElementDimensions.js +2 -0
- package/build/es/hooks/useElementDimensions/useElementDimensions.js.map +1 -0
- package/build/es/hooks/useFocusOutside/index.js +2 -0
- package/build/es/hooks/useFocusOutside/index.js.map +1 -0
- package/build/es/hooks/useFocusOutside/useFocusOutside.js +2 -0
- package/build/es/hooks/useFocusOutside/useFocusOutside.js.map +1 -0
- package/build/es/hooks/useId/index.js +2 -0
- package/build/es/hooks/useId/index.js.map +1 -0
- package/build/es/hooks/useId/useId.js +2 -0
- package/build/es/hooks/useId/useId.js.map +1 -0
- package/build/es/hooks/useIntersectionObserver/index.js +2 -0
- package/build/es/hooks/useIntersectionObserver/index.js.map +1 -0
- package/build/es/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -0
- package/build/es/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -0
- package/build/es/hooks/useKeyListener/index.js +2 -0
- package/build/es/hooks/useKeyListener/index.js.map +1 -0
- package/build/es/hooks/useKeyListener/useKeyListener.js +2 -0
- package/build/es/hooks/useKeyListener/useKeyListener.js.map +1 -0
- package/build/es/hooks/useListNavigation/index.js +2 -0
- package/build/es/hooks/useListNavigation/index.js.map +1 -0
- package/build/es/hooks/useListNavigation/useListNavigation.js +2 -0
- package/build/es/hooks/useListNavigation/useListNavigation.js.map +1 -0
- package/build/es/hooks/useLocalStorage/index.js +2 -0
- package/build/es/hooks/useLocalStorage/index.js.map +1 -0
- package/build/es/hooks/useLocalStorage/useLocalStorage.js +2 -0
- package/build/es/hooks/useLocalStorage/useLocalStorage.js.map +1 -0
- package/build/es/hooks/useMutationObserver/index.js +2 -0
- package/build/es/hooks/useMutationObserver/index.js.map +1 -0
- package/build/es/hooks/useMutationObserver/useMutationObserver.js +2 -0
- package/build/es/hooks/useMutationObserver/useMutationObserver.js.map +1 -0
- package/build/es/hooks/usePreviousValue/index.js +2 -0
- package/build/es/hooks/usePreviousValue/index.js.map +1 -0
- package/build/es/hooks/usePreviousValue/usePreviousValue.js +2 -0
- package/build/es/hooks/usePreviousValue/usePreviousValue.js.map +1 -0
- package/build/es/hooks/useProgressiveImg/index.js +2 -0
- package/build/es/hooks/useProgressiveImg/index.js.map +1 -0
- package/build/es/hooks/useProgressiveImg/useProgressiveImg.js +2 -0
- package/build/es/hooks/useProgressiveImg/useProgressiveImg.js.map +1 -0
- package/build/es/hooks/useScreen/index.js +2 -0
- package/build/es/hooks/useScreen/index.js.map +1 -0
- package/build/es/hooks/useScreen/state.js +2 -0
- package/build/es/hooks/useScreen/state.js.map +1 -0
- package/build/es/hooks/useScreen/useScreen.js +2 -0
- package/build/es/hooks/useScreen/useScreen.js.map +1 -0
- package/build/es/hooks/useScrollIntoView/index.js +2 -0
- package/build/es/hooks/useScrollIntoView/index.js.map +1 -0
- package/build/es/hooks/useScrollIntoView/useScrollIntoView.js +2 -0
- package/build/es/hooks/useScrollIntoView/useScrollIntoView.js.map +1 -0
- package/build/es/hooks/useSwipeGesture/index.js +2 -0
- package/build/es/hooks/useSwipeGesture/index.js.map +1 -0
- package/build/es/hooks/useSwipeGesture/useSwipeGesture.js +2 -0
- package/build/es/hooks/useSwipeGesture/useSwipeGesture.js.map +1 -0
- package/build/hooks/index.d.ts +18 -0
- package/build/hooks/mediaQueryUtils.d.ts +21 -0
- package/build/hooks/useAnimatedDetails/index.d.ts +1 -0
- package/build/hooks/useAnimatedDetails/useAnimatedDetails.d.ts +20 -0
- package/build/hooks/useAnimatedHeight/index.d.ts +4 -0
- package/build/hooks/useAnimatedHeight/types.d.ts +26 -0
- package/build/hooks/useAnimatedHeight/useAnimatedHeight.d.ts +10 -0
- package/build/hooks/useAnimatedHeight/useAnimatedHeightBetween.d.ts +10 -0
- package/build/hooks/useAnimatedHeight/useAutoAnimateHeight.d.ts +20 -0
- package/build/hooks/useAriaLiveRegion/index.d.ts +1 -0
- package/build/hooks/useAriaLiveRegion/useAriaLiveRegion.d.ts +15 -0
- package/build/hooks/useBrowserPreferences/index.d.ts +1 -0
- package/build/hooks/useBrowserPreferences/useBrowserPreferences.d.ts +12 -0
- package/build/hooks/useClickOutside/index.d.ts +1 -0
- package/build/hooks/useClickOutside/useClickOutside.d.ts +7 -0
- package/build/hooks/useElementDimensions/index.d.ts +1 -0
- package/build/hooks/useElementDimensions/useElementDimensions.d.ts +11 -0
- package/build/hooks/useFocusOutside/index.d.ts +1 -0
- package/build/hooks/useFocusOutside/useFocusOutside.d.ts +7 -0
- package/build/hooks/useId/index.d.ts +1 -0
- package/build/hooks/useId/useId.d.ts +11 -0
- package/build/hooks/useIntersectionObserver/index.d.ts +1 -0
- package/build/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +13 -0
- package/build/hooks/useKeyListener/index.d.ts +1 -0
- package/build/hooks/useKeyListener/useKeyListener.d.ts +8 -0
- package/build/hooks/useListNavigation/index.d.ts +1 -0
- package/build/hooks/useListNavigation/useListNavigation.d.ts +7 -0
- package/build/hooks/useLocalStorage/index.d.ts +1 -0
- package/build/hooks/useLocalStorage/useLocalStorage.d.ts +1 -0
- package/build/hooks/useMutationObserver/index.d.ts +1 -0
- package/build/hooks/useMutationObserver/useMutationObserver.d.ts +9 -0
- package/build/hooks/usePreviousValue/index.d.ts +1 -0
- package/build/hooks/usePreviousValue/usePreviousValue.d.ts +6 -0
- package/build/hooks/useProgressiveImg/index.d.ts +1 -0
- package/build/hooks/useProgressiveImg/useProgressiveImg.d.ts +10 -0
- package/build/hooks/useScreen/index.d.ts +2 -0
- package/build/hooks/useScreen/state.d.ts +17 -0
- package/build/hooks/useScreen/useScreen.d.ts +6 -0
- package/build/hooks/useScrollIntoView/index.d.ts +1 -0
- package/build/hooks/useScrollIntoView/useScrollIntoView.d.ts +11 -0
- package/build/hooks/useSwipeGesture/index.d.ts +1 -0
- package/build/hooks/useSwipeGesture/useSwipeGesture.d.ts +27 -0
- package/package.json +83 -0
- package/src/components/navigation/styles/link.css +152 -0
- package/src/components/navigation/styles/link.min.css +1 -0
- package/src/components/navigation/styles/link.scss +138 -0
- package/src/core/jkl/_colors.scss +26 -0
- package/src/core/jkl/_convert.scss +96 -0
- package/src/core/jkl/_helpers.scss +20 -0
- package/src/core/jkl/_index.scss +18 -0
- package/src/core/jkl/_legacy-tokens.scss +22 -0
- package/src/core/jkl/_motion.scss +62 -0
- package/src/core/jkl/_navigation.scss +9 -0
- package/src/core/jkl/_ornaments.scss +26 -0
- package/src/core/jkl/_reset.scss +43 -0
- package/src/core/jkl/_responsive-units.scss +30 -0
- package/src/core/jkl/_screenreader.scss +59 -0
- package/src/core/jkl/_screens.scss +135 -0
- package/src/core/jkl/_shadows.scss +25 -0
- package/src/core/jkl/_spacing.scss +210 -0
- package/src/core/jkl/_theme.scss +144 -0
- package/src/core/jkl/_tokens.scss +148 -0
- package/src/core/jkl/_typography.scss +327 -0
- package/src/core/jkl/_underline.scss +16 -0
- package/src/core/jkl/_z-index.scss +23 -0
- package/src/core/styles/_color-tokens.scss +75 -0
- package/src/core/styles/_headings.scss +29 -0
- package/src/core/styles/_index.scss +10 -0
- package/src/core/styles/_legacy-tokens.scss +26 -0
- package/src/core/styles/_normalize.scss +250 -0
- package/src/core/styles/_paragraphs.scss +16 -0
- package/src/core/styles/_reset.scss +66 -0
- package/src/core/styles/_screen-reader.scss +9 -0
- package/src/core/styles/_spacing.scss +75 -0
- package/src/core/styles/_tokens.scss +114 -0
- package/src/core/styles/core.css +1614 -0
- package/src/core/styles/core.min.css +1 -0
- package/src/core/styles/core.scss +71 -0
- package/src/core/styles/vind/_flex.scss +113 -0
- package/src/core/styles/vind/_font.scss +19 -0
- package/src/core/styles/vind/_margin.scss +43 -0
- package/src/core/styles/vind/_padding.scss +43 -0
- package/src/core/styles/vind/_space-between.scss +13 -0
- package/src/core/styles/vind/_typography.scss +47 -0
- package/src/core/styles/vind/_vind.scss +6 -0
- package/src/core/styles/vind.css +1742 -0
- package/src/core/styles/vind.min.css +1 -0
- package/src/core/styles/vind.scss +3 -0
- package/src/core/tokens.less +196 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIntersectionObserver.js","sources":["../../../../src/hooks/useIntersectionObserver/useIntersectionObserver.ts"],"sourcesContent":["import { useEffect, useRef, RefObject, MutableRefObject } from \"react\";\n\ntype ValidElement = HTMLElement | SVGElement;\ntype Target =\n | MutableRefObject<ValidElement>\n | RefObject<ValidElement>\n | MutableRefObject<NodeListOf<ValidElement>>\n | RefObject<NodeListOf<ValidElement>>\n | NodeListOf<ValidElement>;\n\nfunction isNodeList(target: Target | ValidElement): target is NodeListOf<ValidElement> {\n return (target as NodeListOf<ValidElement>).forEach !== undefined;\n}\n\nconst hasWindowWithIntersectionObserver = () =>\n typeof window !== \"undefined\" && typeof IntersectionObserver !== \"undefined\";\n\n/**\n * Hook som gjør det enkelt å observere om et element er synlig i viewporten.\n *\n * @param target Elementet eller elementene som skal observeres. Du kan sende in en React ref til et HTMLElement eller SVG Element, eller en NodeList av samme type elementer (returneres f.eks. av document.querySelectorAll), eller en React ref med en NodeList av samme type elementer.\n * @param onIntersect Callback-funksjon som utføres når et av elementene som observeres overlapper angitt mål. Se https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#parameters for mer info.\n * @param fallback Funksjon som kalles dersom nettleseren ikke støtter IntersectionOpserver-APIet.\n * @param options Objekt med innstillinger for oberveren. Se https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#parameters for mer info.\n */\nexport const useIntersectionObserver = (\n target: Target,\n onIntersect: IntersectionObserverCallback,\n fallback?: VoidFunction | null,\n options?: Partial<IntersectionObserverInit>,\n): void => {\n const observerRef = useRef<IntersectionObserver>(null);\n\n useEffect(() => {\n let observer = observerRef.current;\n\n if (hasWindowWithIntersectionObserver()) {\n if (observer) {\n observer.disconnect();\n }\n\n observer = new IntersectionObserver(onIntersect, options);\n\n if (isNodeList(target)) {\n target.forEach((element) => observer?.observe(element));\n } else if (target.current && isNodeList(target.current)) {\n target.current.forEach((element) => observer?.observe(element));\n } else if (target.current) {\n observer.observe(target.current);\n }\n } else if (fallback) {\n fallback();\n }\n\n return () => {\n if (hasWindowWithIntersectionObserver() && observer) {\n observer.disconnect();\n }\n };\n }, [target, onIntersect, fallback, options]);\n};\n"],"names":["isNodeList","target","forEach","hasWindowWithIntersectionObserver","window","IntersectionObserver","onIntersect","fallback","options","observerRef","useRef","useEffect","observer","current","disconnect","element","observe"],"mappings":"yGAUA,SAASA,EAAWC,GAChB,YAAwD,IAAhDA,EAAoCC,OAChD,CAEA,MAAMC,EAAoC,WAC/BC,OAAW,YAAsBC,qBAAyB,oCAU9B,CACnCJ,EACAK,EACAC,EACAC,KAEM,MAAAC,EAAcC,SAA6B,MAEjDC,EAAAA,WAAU,KACN,IAAIC,EAAWH,EAAYI,QAE3B,OAAIV,KACIS,GACAA,EAASE,aAGFF,EAAA,IAAIP,qBAAqBC,EAAaE,GAE7CR,EAAWC,GACXA,EAAOC,SAASa,GAAY,MAAAH,OAAAA,EAAAA,EAAUI,QAAQD,KACvCd,EAAOY,SAAWb,EAAWC,EAAOY,SAC3CZ,EAAOY,QAAQX,SAASa,GAAY,MAAAH,OAAAA,EAAAA,EAAUI,QAAQD,KAC/Cd,EAAOY,SACLD,EAAAI,QAAQf,EAAOY,UAErBN,GACEA,IAGN,KACCJ,KAAuCS,GACvCA,EAASE,YAAW,CACxB,GAEL,CAACb,EAAQK,EAAaC,EAAUC,GAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useKeyListener=function(t,n,r){function o(e){n&&!n.includes(e.key)||r(e)}"string"==typeof n&&(n=[n]),e.useEffect((()=>{const e=t&&t.current;return e&&e.addEventListener("keydown",o),()=>{e&&e.removeEventListener("keydown",o)}}))};
|
|
2
|
+
//# sourceMappingURL=useKeyListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyListener.js","sources":["../../../../src/hooks/useKeyListener/useKeyListener.ts"],"sourcesContent":["import { RefObject, useEffect } from \"react\";\n\n/**\n * Lar deg sette opp en tastaturlytter på et element.\n * @param ref Element som skal observeres\n * @param keys Taster som skal lyttes på\n * @param fn Funksjon som kalles når en tastetrykk observeres\n */\nexport function useKeyListener(\n ref: RefObject<HTMLElement> | null,\n keys: string[] | string | null,\n fn: (event: KeyboardEvent) => void,\n): void {\n if (typeof keys === \"string\") {\n keys = [keys];\n }\n function handleKeyDown(event: KeyboardEvent) {\n if (keys && !keys.includes(event.key)) {\n return;\n }\n fn(event);\n }\n\n useEffect(() => {\n const element = ref && ref.current;\n if (element) {\n element.addEventListener(\"keydown\", handleKeyDown);\n }\n return () => {\n if (element) {\n element.removeEventListener(\"keydown\", handleKeyDown);\n }\n };\n });\n}\n"],"names":["ref","keys","fn","handleKeyDown","event","includes","key","useEffect","element","current","addEventListener","removeEventListener"],"mappings":"gIAQgB,SACZA,EACAC,EACAC,GAKA,SAASC,EAAcC,GACfH,IAASA,EAAKI,SAASD,EAAME,MAGjCJ,EAAGE,EACP,CARoB,iBAATH,IACPA,EAAO,CAACA,IASZM,EAAAA,WAAU,KACA,MAAAC,EAAUR,GAAOA,EAAIS,QAC3B,OAAID,GACQA,EAAAE,iBAAiB,UAAWP,GAEjC,KACCK,GACQA,EAAAG,oBAAoB,UAAWR,EAAa,CACxD,GAGZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function t(e,{event:t,list:r,currentFocus:n}){t.preventDefault(),function(e,t,r){const n=r;switch(e){case"prev":const e=n&&n.previousElementSibling;e&&e.focus();break;case"next":const r=n&&n.nextElementSibling;r&&r.focus();break;case"first":const s=t.querySelector('[role="option"]');s&&s.focus();break;case"last":const o=t.querySelectorAll('[role="option"]');o.length&&o[o.length-1].focus()}}(e,r,n)}exports.useListNavigation=function({ref:r}){e.useEffect((()=>{const e={keys:""},n=r.current,s=r=>{n&&function({list:e,event:r,search:n,searchResetTimer:s}){const{key:o,target:c}=r,i={event:r,list:e,currentFocus:c};switch(o){case"ArrowUp":t("prev",i);break;case"ArrowDown":t("next",i);break;case"Home":t("first",i);break;case"End":t("last",i);break;case"Tab":r.preventDefault();break;case"Enter":break;default:if(void 0!==n){const t=function({list:e,key:t,search:r,searchResetTimer:n}){const s=e.querySelectorAll('[role="option"]');if(!s.length)return null;if(r){r.keys=r.keys.concat(t),function(e,t){t&&(clearTimeout(t),t=void 0),t=setTimeout((()=>{e?e.keys="":e={keys:""},t=void 0}),500,e,t)}(r,n);for(let e=0;e<s.length;e++){const t=s[e].innerText;if(t&&0===t.toLowerCase().indexOf(r.keys))return s[e]}}return null}({list:e,key:o,search:n,searchResetTimer:s});t&&t.focus()}}}({list:n,event:r,search:e,searchResetTimer:undefined})};return n&&n.addEventListener("keydown",s),()=>{n&&n.removeEventListener("keydown",s)}}),[r])};
|
|
2
|
+
//# sourceMappingURL=useListNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListNavigation.js","sources":["../../../../src/hooks/useListNavigation/useListNavigation.ts"],"sourcesContent":["import { useEffect, RefObject } from \"react\";\n\ntype Timer = number | undefined;\ntype KeyBuffer = { keys: string } | undefined;\ntype Direction = \"prev\" | \"next\" | \"first\" | \"last\";\ninterface MoveDetails {\n event: KeyboardEvent;\n list: HTMLElement;\n currentFocus: HTMLButtonElement;\n}\ninterface ListDetails {\n list: HTMLElement;\n search: KeyBuffer;\n searchResetTimer: Timer;\n}\ninterface SearchDetails extends ListDetails {\n key: string;\n}\ninterface EventDetails extends ListDetails {\n event: KeyboardEvent;\n}\ntype UseListNavigationProps<T> = {\n /** Ref til et element med rollen `listbox` */\n ref: RefObject<T>;\n};\n\nexport function useListNavigation<T extends HTMLElement>({ ref }: UseListNavigationProps<T>): void {\n useEffect(() => {\n let searchResetTimer: Timer;\n const search: KeyBuffer = { keys: \"\" }; // keypress buffer is an object to preserve state\n const list = ref.current;\n const handler = (event: KeyboardEvent) => {\n if (list) {\n handleListKeyNav({ list, event, search, searchResetTimer });\n }\n };\n\n if (list) {\n list.addEventListener(\"keydown\", handler);\n }\n\n return () => {\n if (list) {\n list.removeEventListener(\"keydown\", handler);\n }\n };\n }, [ref]);\n}\n\nfunction handleMoveTo(direction: Direction, { event, list, currentFocus }: MoveDetails) {\n event.preventDefault();\n moveFocusTo(direction, list, currentFocus);\n}\n\nfunction handleListKeyNav({ list, event, search, searchResetTimer }: EventDetails) {\n const { key, target } = event;\n const currentFocus = target as HTMLButtonElement;\n\n const moveDetails = {\n event,\n list,\n currentFocus,\n };\n\n switch (key) {\n case \"ArrowUp\" || \"PageUp\":\n handleMoveTo(\"prev\", moveDetails);\n break;\n case \"ArrowDown\" || \"PageDown\":\n handleMoveTo(\"next\", moveDetails);\n break;\n case \"Home\":\n handleMoveTo(\"first\", moveDetails);\n break;\n case \"End\":\n handleMoveTo(\"last\", moveDetails);\n break;\n case \"Tab\":\n // in a standard select, tab does nothing in-menu\n event.preventDefault();\n break;\n case \"Enter\" || \" \":\n break;\n\n default:\n if (search !== undefined) {\n const searchResult = findItem({ list, key, search, searchResetTimer });\n if (searchResult) {\n searchResult.focus();\n }\n }\n break;\n }\n}\n\nfunction moveFocusTo(direction: Direction, list: HTMLElement, current: HTMLButtonElement) {\n const thisOption = current;\n switch (direction) {\n case \"prev\":\n const prevOption: HTMLButtonElement | null =\n thisOption && (thisOption.previousElementSibling as HTMLButtonElement);\n if (prevOption) {\n prevOption.focus();\n }\n break;\n case \"next\":\n const nextOption: HTMLButtonElement | null =\n thisOption && (thisOption.nextElementSibling as HTMLButtonElement);\n if (nextOption) {\n nextOption.focus();\n }\n break;\n case \"first\":\n const firstItem = list.querySelector<HTMLButtonElement>(`[role=\"option\"]`);\n if (firstItem) {\n firstItem.focus();\n }\n break;\n case \"last\":\n const listItems = list.querySelectorAll<HTMLButtonElement>(`[role=\"option\"]`);\n if (listItems.length) {\n listItems[listItems.length - 1].focus();\n }\n break;\n }\n}\n\nfunction findItem({ list, key, search, searchResetTimer }: SearchDetails): HTMLButtonElement | null {\n const listItems = list.querySelectorAll(`[role=\"option\"]`);\n if (!listItems.length) return null;\n\n if (search) {\n search.keys = search.keys.concat(key);\n resetWhenIdle(search, searchResetTimer);\n\n for (let n = 0; n < listItems.length; n++) {\n const label = (listItems[n] as HTMLButtonElement).innerText;\n if (label && label.toLowerCase().indexOf(search.keys) === 0) {\n return listItems[n] as HTMLButtonElement;\n }\n }\n }\n\n return null;\n}\n\nfunction resetWhenIdle(search: KeyBuffer, timer: Timer) {\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n timer = setTimeout(\n () => {\n search ? (search.keys = \"\") : (search = { keys: \"\" });\n timer = undefined;\n },\n 500,\n search,\n timer,\n );\n}\n"],"names":["handleMoveTo","direction","event","list","currentFocus","preventDefault","current","thisOption","prevOption","previousElementSibling","focus","nextOption","nextElementSibling","firstItem","querySelector","listItems","querySelectorAll","length","moveFocusTo","ref","useEffect","search","keys","handler","searchResetTimer","key","target","moveDetails","searchResult","concat","timer","clearTimeout","setTimeout","resetWhenIdle","n","label","innerText","toLowerCase","indexOf","findItem","handleListKeyNav","addEventListener","removeEventListener"],"mappings":"yGAiDA,SAASA,EAAaC,GAAwBC,MAAAA,EAAOC,KAAAA,EAAMC,aAAAA,IACvDF,EAAMG,iBA6CV,SAAqBJ,EAAsBE,EAAmBG,GAC1D,MAAMC,EAAaD,EACnB,OAAQL,GACJ,IAAK,OACK,MAAAO,EACFD,GAAeA,EAAWE,uBAC1BD,GACAA,EAAWE,QAEf,MACJ,IAAK,OACK,MAAAC,EACFJ,GAAeA,EAAWK,mBAC1BD,GACAA,EAAWD,QAEf,MACJ,IAAK,QACK,MAAAG,EAAYV,EAAKW,cAAiC,mBACpDD,GACAA,EAAUH,QAEd,MACJ,IAAK,OACK,MAAAK,EAAYZ,EAAKa,iBAAoC,mBACvDD,EAAUE,QACVF,EAAUA,EAAUE,OAAS,GAAGP,QAIhD,CA1EgBQ,CAAAjB,EAAWE,EAAMC,EACjC,2BA1BgB,UAA2Ce,IAAAA,IACvDC,EAAAA,WAAU,KAEA,MAAAC,EAAoB,CAAEC,KAAM,IAC5BnB,EAAOgB,EAAIb,QACXiB,EAAWrB,IACTC,GAsBhB,UAA4BA,KAAAA,EAAMD,MAAAA,EAAOmB,OAAAA,EAAQG,iBAAAA,IACvC,MAAEC,IAAAA,EAAKC,OAAAA,GAAWxB,EAGlByB,EAAc,CAChBzB,MAAAA,EACAC,KAAAA,EACAC,aALiBsB,GAQrB,OAAQD,GACJ,IAAK,UACDzB,EAAa,OAAQ2B,GACrB,MACJ,IAAK,YACD3B,EAAa,OAAQ2B,GACrB,MACJ,IAAK,OACD3B,EAAa,QAAS2B,GACtB,MACJ,IAAK,MACD3B,EAAa,OAAQ2B,GACrB,MACJ,IAAK,MAEDzB,EAAMG,iBACN,MACJ,IAAK,QACD,MAEJ,QACI,QAAe,IAAXgB,EAAsB,CACtB,MAAMO,EAyCtB,UAAoBzB,KAAAA,EAAMsB,IAAAA,EAAKJ,OAAAA,EAAQG,iBAAAA,IAC7B,MAAAT,EAAYZ,EAAKa,iBAAiB,mBACpC,IAACD,EAAUE,OAAe,OAAA,KAE9B,GAAII,EAAQ,CACRA,EAAOC,KAAOD,EAAOC,KAAKO,OAAOJ,GAczC,SAAuBJ,EAAmBS,GAClCA,IACAC,aAAaD,GACLA,OAAA,GAEJA,EAAAE,YACJ,KACIX,EAAUA,EAAOC,KAAO,GAAOD,EAAS,CAAEC,KAAM,IACxCQ,OAAA,CAAA,GAEZ,IACAT,EACAS,EAER,CA3BQG,CAAcZ,EAAQG,GAEtB,QAASU,EAAI,EAAGA,EAAInB,EAAUE,OAAQiB,IAAK,CACjC,MAAAC,EAASpB,EAAUmB,GAAyBE,UAC9C,GAAAD,GAAsD,IAA7CA,EAAME,cAAcC,QAAQjB,EAAOC,MAC5C,OAAOP,EAAUmB,EAEzB,CACJ,CAEO,OAAA,IACX,CA1DqCK,CAAS,CAAEpC,KAAAA,EAAMsB,IAAAA,EAAKJ,OAAAA,EAAQG,iBAAAA,IAC/CI,GACAA,EAAalB,OAErB,EAGZ,CA5DgB8B,CAAiB,CAAErC,KAAAA,EAAMD,MAAAA,EAAOmB,OAAAA,EAAQG,iBAL5CA,WAK8D,EAIlE,OAAIrB,GACKA,EAAAsC,iBAAiB,UAAWlB,GAG9B,KACCpB,GACKA,EAAAuC,oBAAoB,UAAWnB,EAAO,CAC/C,GAEL,CAACJ,GACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useLocalStorage=(t,o)=>{const[r,a]=e.useState((()=>typeof window>"u"||!localStorage?o:JSON.parse(localStorage.getItem(t)||"null")||o));return[r,e.useCallback((e=>{a(e),typeof window<"u"&&localStorage&&localStorage.setItem(t,JSON.stringify(e))}),[t])]};
|
|
2
|
+
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLocalStorage.js","sources":["../../../../src/hooks/useLocalStorage/useLocalStorage.ts"],"sourcesContent":["import { useCallback, useState } from \"react\";\n\nexport const useLocalStorage = <T>(key: string, defaultValue: T): [T, (newValue: T) => void] => {\n const [state, setState] = useState(() => {\n if (typeof window === \"undefined\" || !localStorage) {\n return defaultValue;\n }\n const storedValue = JSON.parse(localStorage.getItem(key) || \"null\");\n return storedValue || defaultValue;\n });\n\n const updateState = useCallback(\n (newValue: T) => {\n setState(newValue);\n if (typeof window !== \"undefined\" && localStorage) {\n localStorage.setItem(key, JSON.stringify(newValue));\n }\n },\n [key],\n );\n\n return [state, updateState];\n};\n"],"names":["key","defaultValue","state","setState","useState","window","localStorage","JSON","parse","getItem","useCallback","newValue","setItem","stringify"],"mappings":"iIAE+B,CAAIA,EAAaC,KAC5C,MAAOC,EAAOC,GAAYC,YAAS,WACpBC,OAAW,MAAgBC,aAC3BL,EAESM,KAAKC,MAAMF,aAAaG,QAAQT,IAAQ,SACtCC,IAanB,MAAA,CAACC,EAVYQ,EAAAA,aACfC,IACGR,EAASQ,UACEN,OAAW,KAAeC,cACjCA,aAAaM,QAAQZ,EAAKO,KAAKM,UAAUF,GAAS,GAG1D,CAACX,IAGqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=()=>typeof window<"u"&&typeof MutationObserver<"u";exports.useMutationObserver=(r,n,o)=>{const s=e.useRef(null);e.useEffect((()=>{let e=s.current;if(t()){const t=r.current;e&&e.disconnect(),e=new MutationObserver(n),t&&e.observe(t,o)}return()=>{t()&&e&&e.disconnect()}}),[r,n,o])};
|
|
2
|
+
//# sourceMappingURL=useMutationObserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMutationObserver.js","sources":["../../../../src/hooks/useMutationObserver/useMutationObserver.ts"],"sourcesContent":["import { useEffect, useRef, RefObject } from \"react\";\n\nconst hasWindowWithMutationObserver = () => typeof window !== \"undefined\" && typeof MutationObserver !== \"undefined\";\n\n/**\n * Hook som gjør det enklere å sjekke en komponents children for endringer.\n *\n * @param targetRef Container som skal observeres. Containeren må ikke rerendres, da vil observereren bli opprettet på nytt.\n * @param onObservation Callback-funksjon som utføres når en mutasjon observeres.\n * @param config Parametere til observereren. Se https://developer.mozilla.org/en-US/docs/Web/API/MutationObserverInit#properties for mer info.\n */\nexport const useMutationObserver = (\n targetRef: RefObject<HTMLElement>,\n onObservation: MutationCallback,\n config?: Partial<MutationObserverInit>,\n): void => {\n const observerRef = useRef<MutationObserver>(null);\n\n useEffect(() => {\n let observer = observerRef.current;\n\n if (hasWindowWithMutationObserver()) {\n const target = targetRef.current;\n\n if (observer) {\n observer.disconnect();\n }\n\n observer = new MutationObserver(onObservation);\n\n if (target) {\n observer.observe(target, config);\n }\n }\n return () => {\n if (hasWindowWithMutationObserver() && observer) {\n observer.disconnect();\n }\n };\n }, [targetRef, onObservation, config]);\n};\n"],"names":["hasWindowWithMutationObserver","window","MutationObserver","targetRef","onObservation","config","observerRef","useRef","useEffect","observer","current","target","disconnect","observe"],"mappings":"yGAEMA,EAAgC,WAAaC,OAAW,YAAsBC,iBAAqB,gCAStE,CAC/BC,EACAC,EACAC,KAEM,MAAAC,EAAcC,SAAyB,MAE7CC,EAAAA,WAAU,KACN,IAAIC,EAAWH,EAAYI,QAE3B,GAAIV,IAAiC,CACjC,MAAMW,EAASR,EAAUO,QAErBD,GACAA,EAASG,aAGFH,EAAA,IAAIP,iBAAiBE,GAE5BO,GACSF,EAAAI,QAAQF,EAAQN,EAEjC,CACA,MAAO,KACCL,KAAmCS,GACnCA,EAASG,YAAW,CACxB,GAEL,CAACT,EAAWC,EAAeC,GAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePreviousValue.js","sources":["../../../../src/hooks/usePreviousValue/usePreviousValue.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * Lar deg huske en verdi fra forrige render.\n * @param value Verdien som skal huskes.\n * @returns Forrige render av verdien, eller undefined første render.\n */\nexport const usePreviousValue = <T>(value: T): T | undefined => {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n};\n"],"names":["value","ref","useRef","useEffect","current"],"mappings":"kIAOoCA,IAChC,MAAMC,EAAMC,EAAAA,SAEZC,OAAAA,EAAAA,WAAU,KACNF,EAAIG,QAAUJ,KAGXC,EAAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useProgressiveImg=({lowQualitySrc:r,highQualitySrc:t})=>{const[s,o]=e.useState(r);return e.useEffect((()=>{o(r);const e=new Image;e.src=t,e.onload=()=>{o(t)}}),[r,t]),{src:s,isBlurred:s===r}};
|
|
2
|
+
//# sourceMappingURL=useProgressiveImg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProgressiveImg.js","sources":["../../../../src/hooks/useProgressiveImg/useProgressiveImg.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nexport interface ProgressiveImageProps {\n lowQualitySrc: string;\n highQualitySrc: string;\n}\n\ntype ProgressiveImage = { src: string; isBlurred: boolean };\n\nexport const useProgressiveImg = ({ lowQualitySrc, highQualitySrc }: ProgressiveImageProps): ProgressiveImage => {\n const [src, setSrc] = useState(lowQualitySrc);\n\n useEffect(() => {\n setSrc(lowQualitySrc);\n const img = new Image();\n img.src = highQualitySrc;\n\n img.onload = () => {\n setSrc(highQualitySrc);\n };\n }, [lowQualitySrc, highQualitySrc]);\n\n return { src, isBlurred: src === lowQualitySrc };\n};\n"],"names":["lowQualitySrc","highQualitySrc","src","setSrc","useState","useEffect","img","Image","onload","isBlurred"],"mappings":"mIASiC,EAAGA,cAAAA,EAAeC,eAAAA,MAC/C,MAAOC,EAAKC,GAAUC,WAASJ,GAE/BK,OAAAA,EAAAA,WAAU,KACNF,EAAOH,GACD,MAAAM,EAAM,IAAIC,MAChBD,EAAIJ,IAAMD,EAEVK,EAAIE,OAAS,KACTL,EAAOF,EAAc,CAAA,GAE1B,CAACD,EAAeC,IAEZ,CAAEC,IAAAA,EAAKO,UAAWP,IAAQF,EAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e,i=((e=i||{}).orientation="ORIENTATION_CHANGED",e.deviceSize="DEVICE_SIZE_CHANGED",e);function r(e){return{isSmallDevice:"isSmallDevice"===e,isMediumDevice:"isMediumDevice"===e,isLargeDevice:"isLargeDevice"===e,isXlDevice:"isXlDevice"===e}}function t(e){return{isLandscape:"isLandscape"===e,isPortrait:"isPortrait"===e}}exports.ActionType=i,exports.reducer=(e,i)=>{switch(i.type){case"ORIENTATION_CHANGED":return{...e,...t(i.property)};case"DEVICE_SIZE_CHANGED":return{...e,...r(i.property)};default:return e}};
|
|
2
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sources":["../../../../src/hooks/useScreen/state.ts"],"sourcesContent":["export interface ScreenState {\n isSmallDevice: boolean;\n isMediumDevice: boolean;\n isLargeDevice: boolean;\n isXlDevice: boolean;\n isLandscape: boolean;\n isPortrait: boolean;\n}\n\nexport enum ActionType {\n orientation = \"ORIENTATION_CHANGED\",\n deviceSize = \"DEVICE_SIZE_CHANGED\",\n}\n\nexport interface ScreenAction {\n type: ActionType;\n property: keyof ScreenState;\n}\n\nfunction setDeviceSize(deviceSize: keyof ScreenState): Omit<ScreenState, \"isLandscape\" | \"isPortrait\"> {\n return {\n isSmallDevice: deviceSize === \"isSmallDevice\",\n isMediumDevice: deviceSize === \"isMediumDevice\",\n isLargeDevice: deviceSize === \"isLargeDevice\",\n isXlDevice: deviceSize === \"isXlDevice\",\n };\n}\n\nfunction setOrientation(orientation: keyof ScreenState): Pick<ScreenState, \"isLandscape\" | \"isPortrait\"> {\n return {\n isLandscape: orientation === \"isLandscape\",\n isPortrait: orientation === \"isPortrait\",\n };\n}\n\nexport const reducer = (state: ScreenState, action: ScreenAction): ScreenState => {\n switch (action.type) {\n case ActionType.orientation:\n return {\n ...state,\n ...setOrientation(action.property),\n };\n case ActionType.deviceSize:\n return {\n ...state,\n ...setDeviceSize(action.property),\n };\n default:\n return state;\n }\n};\n"],"names":["ActionType","orientation","deviceSize","setDeviceSize","isSmallDevice","isMediumDevice","isLargeDevice","isXlDevice","setOrientation","isLandscape","isPortrait","state","action","type","property"],"mappings":"gFASY,IAAAA,EAAAA,IAAAA,EAAAA,GAAA,CAAA,GACRC,YAAc,sBACdD,EAAAE,WAAa,sBAFLF,GAUZ,SAASG,EAAcD,GACZ,MAAA,CACHE,cAA8B,kBAAfF,EACfG,eAA+B,mBAAfH,EAChBI,cAA8B,kBAAfJ,EACfK,WAA2B,eAAfL,EAEpB,CAEA,SAASM,EAAeP,GACb,MAAA,CACHQ,YAA6B,gBAAhBR,EACbS,WAA4B,eAAhBT,EAEpB,sCAEuB,CAACU,EAAoBC,KACxC,OAAQA,EAAOC,MACX,IAAK,sBACM,MAAA,IACAF,KACAH,EAAeI,EAAOE,WAEjC,IAAK,sBACM,MAAA,IACAH,KACAR,EAAcS,EAAOE,WAEhC,QACW,OAAAH,EACf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),i=require("../../core/utils/breakpoints.js"),t=require("../mediaQueryUtils.js"),r=require("./state.js"),a={isSmallDevice:`(max-width: ${i.breakpoints.medium-1}px)`,isMediumDevice:`(min-width: ${i.breakpoints.medium}px) and (max-width: ${i.breakpoints.large-1}px)`,isLargeDevice:`(min-width: ${i.breakpoints.large}px) and (max-width: ${i.breakpoints.xl-1}px)`,isXlDevice:`(min-width: ${i.breakpoints.xl}px)`,isPortrait:"(orientation: portrait)",isLandscape:"(orientation: landscape)"},s=e=>({type:"isLandscape"===e||"isPortrait"===e?r.ActionType.orientation:r.ActionType.deviceSize,property:e});exports.useScreen=()=>{const[i,n]=e.useState(!1),[c,o]=e.useReducer(r.reducer,{isSmallDevice:!1,isMediumDevice:!1,isLargeDevice:!1,isXlDevice:!1,isLandscape:!1,isPortrait:!1});e.useEffect((()=>{n(!0),Object.entries(a).map((([e,i])=>[e,t.getInitialMediaQueryMatch(i)])).forEach((([e,i])=>{i&&o(s(e))}))}),[]);const d=e.useCallback((e=>i=>{requestAnimationFrame((()=>{i.matches&&o(s(e))}))}),[]);return e.useEffect((()=>{if(!i||!window.matchMedia)return;const e=[];return Object.entries(a).forEach((([i,r])=>{const a=window.matchMedia(r),s=d(i);e.push([a,s]),t.addMediaQueryListener(a,s)})),()=>{e.forEach((([e,i])=>t.removeMediaQueryListener(e,i)))}}),[d,i]),{...c}};
|
|
2
|
+
//# sourceMappingURL=useScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreen.js","sources":["../../../../src/hooks/useScreen/useScreen.ts"],"sourcesContent":["import { useCallback, useEffect, useReducer, useState } from \"react\";\nimport { breakpoints } from \"../../core\";\nimport { addMediaQueryListener, getInitialMediaQueryMatch, removeMediaQueryListener } from \"../mediaQueryUtils\";\nimport { ScreenAction, ActionType, reducer, ScreenState } from \"./state\";\n\nconst MEDIA_RULES: Record<keyof ScreenState, string> = {\n isSmallDevice: `(max-width: ${breakpoints.medium - 1}px)`,\n isMediumDevice: `(min-width: ${breakpoints.medium}px) and (max-width: ${breakpoints.large - 1}px)`,\n isLargeDevice: `(min-width: ${breakpoints.large}px) and (max-width: ${breakpoints.xl - 1}px)`,\n isXlDevice: `(min-width: ${breakpoints.xl}px)`,\n isPortrait: \"(orientation: portrait)\",\n isLandscape: \"(orientation: landscape)\",\n};\n\nconst createAction = (property: keyof ScreenState): ScreenAction => ({\n type: property === \"isLandscape\" || property === \"isPortrait\" ? ActionType.orientation : ActionType.deviceSize,\n property,\n});\n\n/**\n * Finn størrelsen og orienteringen til skjermen.\n * @returns Et objekt med boolean som indikerer om skjermstørrelsen er liten, medium, stor eller ekstra stor, og om skjermen er i portrett- eller landskapsmodus.\n */\nexport const useScreen = (): ScreenState => {\n const [hasMounted, setHasMounted] = useState(false);\n\n const [device, deviceDispatch] = useReducer(reducer, {\n isSmallDevice: false,\n isMediumDevice: false,\n isLargeDevice: false,\n isXlDevice: false,\n isLandscape: false,\n isPortrait: false,\n });\n\n useEffect(() => {\n setHasMounted(true);\n Object.entries(MEDIA_RULES)\n .map(([key, rule]) => [key, getInitialMediaQueryMatch(rule)])\n .forEach(([key, value]) => {\n if (value) {\n deviceDispatch(createAction(key as keyof ScreenState));\n }\n });\n }, []);\n\n const createListener = useCallback(\n (key: keyof ScreenState) => (e: MediaQueryListEvent) => {\n requestAnimationFrame(() => {\n if (e.matches) {\n deviceDispatch(createAction(key));\n }\n });\n },\n [],\n );\n\n useEffect(() => {\n if (!hasMounted || !window.matchMedia) {\n return;\n }\n const eventListenerPairs: Array<[MediaQueryList, (e: MediaQueryListEvent) => void]> = [];\n\n Object.entries(MEDIA_RULES).forEach(([key, rule]) => {\n const queryList = window.matchMedia(rule);\n const listener = createListener(key as keyof ScreenState);\n eventListenerPairs.push([queryList, listener]);\n addMediaQueryListener(queryList, listener);\n });\n\n return () => {\n eventListenerPairs.forEach(([queryList, listener]) => removeMediaQueryListener(queryList, listener));\n };\n }, [createListener, hasMounted]);\n\n return { ...device };\n};\n"],"names":["MEDIA_RULES","isSmallDevice","breakpoints","medium","isMediumDevice","large","isLargeDevice","xl","isXlDevice","isPortrait","isLandscape","createAction","property","type","ActionType","orientation","deviceSize","hasMounted","setHasMounted","useState","device","deviceDispatch","useReducer","reducer","useEffect","Object","entries","map","key","rule","getInitialMediaQueryMatch","forEach","value","createListener","useCallback","e","requestAnimationFrame","matches","window","matchMedia","eventListenerPairs","queryList","listener","push","addMediaQueryListener","removeMediaQueryListener"],"mappings":"iNAKMA,EAAiD,CACnDC,cAAe,eAAeC,EAAAA,YAAYC,OAAS,OACnDC,eAAgB,eAAeF,EAAAA,YAAYC,6BAA6BD,cAAYG,MAAQ,OAC5FC,cAAe,eAAeJ,EAAAA,YAAYG,4BAA4BH,cAAYK,GAAK,OACvFC,WAAY,eAAeN,cAAYK,QACvCE,WAAY,0BACZC,YAAa,4BAGXC,EAAgBC,IAA+C,CACjEC,KAAmB,gBAAbD,GAA2C,eAAbA,EAA4BE,aAAWC,YAAcD,EAAAA,WAAWE,WACpGJ,SAAAA,sBAOqB,KACrB,MAAOK,EAAYC,GAAiBC,YAAS,IAEtCC,EAAQC,GAAkBC,EAAAA,WAAWC,EAAAA,QAAS,CACjDtB,eAAe,EACfG,gBAAgB,EAChBE,eAAe,EACfE,YAAY,EACZE,aAAa,EACbD,YAAY,IAGhBe,EAAAA,WAAU,KACNN,GAAc,GACPO,OAAAC,QAAQ1B,GACV2B,KAAI,EAAEC,EAAKC,KAAU,CAACD,EAAKE,EAA0BA,0BAAAD,MACrDE,SAAQ,EAAEH,EAAKI,MACRA,GACeX,EAAAV,EAAaiB,GAAyB,GAE5D,GACN,IAEH,MAAMK,EAAiBC,EAAAA,aAClBN,GAA4BO,IACzBC,uBAAsB,KACdD,EAAEE,SACahB,EAAAV,EAAaiB,GAAI,GAEvC,GAEL,IAGJJ,OAAAA,EAAAA,WAAU,KACN,IAAKP,IAAeqB,OAAOC,WACvB,OAEJ,MAAMC,EAAgF,GAE/E,OAAAf,OAAAC,QAAQ1B,GAAa+B,SAAQ,EAAEH,EAAKC,MACjC,MAAAY,EAAYH,OAAOC,WAAWV,GAC9Ba,EAAWT,EAAeL,GAChCY,EAAmBG,KAAK,CAACF,EAAWC,IACpCE,wBAAsBH,EAAWC,EAAQ,IAGtC,KACgBF,EAAAT,SAAQ,EAAEU,EAAWC,KAAcG,2BAAyBJ,EAAWC,IAAS,CAAA,GAExG,CAACT,EAAgBhB,IAEb,IAAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useScrollIntoView=({ref:t,timeout:r=0,autoScroll:o=!0,options:u={behavior:"smooth"}})=>{const n=()=>{null!=t&&t.current&&t.current.scrollIntoView(u)};return e.useEffect((()=>{if(!o)return;const e=setTimeout(n,r);return()=>clearTimeout(e)}),[t,r,o]),[n]};
|
|
2
|
+
//# sourceMappingURL=useScrollIntoView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollIntoView.js","sources":["../../../../src/hooks/useScrollIntoView/useScrollIntoView.tsx"],"sourcesContent":["import { useEffect, RefObject } from \"react\";\n\ntype ValueOf<T> = T[keyof T];\n\nexport interface ScrollIntoViewProps {\n ref: RefObject<ValueOf<HTMLElementTagNameMap>>;\n timeout?: number;\n autoScroll?: boolean;\n options?: ScrollIntoViewOptions;\n}\n\ntype ScrollFunction = () => void;\n\nexport const useScrollIntoView = ({\n ref,\n timeout = 0,\n autoScroll = true,\n options = { behavior: \"smooth\" },\n}: ScrollIntoViewProps): [ScrollFunction] => {\n const scrollIntoView: ScrollFunction = () => {\n if (ref?.current) {\n ref.current.scrollIntoView(options);\n }\n };\n useEffect(() => {\n if (!autoScroll) {\n return;\n }\n const scrollFn = setTimeout(scrollIntoView, timeout);\n return () => clearTimeout(scrollFn);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [ref, timeout, autoScroll]);\n\n return [scrollIntoView];\n};\n"],"names":["ref","timeout","autoScroll","options","behavior","scrollIntoView","current","useEffect","scrollFn","setTimeout","clearTimeout"],"mappings":"mIAaiC,EAC7BA,IAAAA,EACAC,QAAAA,EAAU,EACVC,WAAAA,GAAa,EACbC,QAAAA,EAAU,CAAEC,SAAU,cAEtB,MAAMC,EAAiC,KAC/B,MAAAL,GAAAA,EAAKM,SACDN,EAAAM,QAAQD,eAAeF,EAAO,EAG1CI,OAAAA,EAAAA,WAAU,KACN,IAAKL,EACD,OAEE,MAAAM,EAAWC,WAAWJ,EAAgBJ,GACrC,MAAA,IAAMS,aAAaF,EAAQ,GAEnC,CAACR,EAAKC,EAASC,IAEX,CAACG,EAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function n(e){return{x:e.clientX,y:e.clientY}}exports.useSwipeGesture=function(r){const t=e.useRef(!1),o=e.useRef(),{onClick:u,onChange:l,onPointerCancel:c,onPointerDown:a,onPointerMove:i,onPointerUp:s}=r,p=e.useCallback((e=>{t.current||null==u||u(e),t.current=!1}),[u]),f=e.useCallback((e=>{var r,u;e.preventDefault(),null==(u=(r=e.target).setPointerCapture)||u.call(r,e.pointerId),o.current=n(e),t.current=!1,null==a||a(e)}),[a]),C=e.useCallback((e=>{if(e.preventDefault(),!o.current)return;const{x:r}=n(e),{x:u}=o.current;r-u>10&&l&&"on"!==t.current?(l(e,!0),t.current="on",o.current=n(e)):u-r>10&&l&&"off"!==t.current&&(l(e,!1),t.current="off",o.current=n(e)),null==i||i(e)}),[i,l]),P=e.useCallback((e=>{var n,r;e.preventDefault(),null==(r=(n=e.target).releasePointerCapture)||r.call(n,e.pointerId),o.current=void 0,"pointerup"===e.type?null==s||s(e):null==c||c(e)}),[s,c]);return{swipeHandled:t,gestureHandlers:{onClick:p,onPointerDown:f,onPointerMove:C,onPointerUp:P,onPointerCancel:P}}};
|
|
2
|
+
//# sourceMappingURL=useSwipeGesture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSwipeGesture.js","sources":["../../../../src/hooks/useSwipeGesture/useSwipeGesture.ts"],"sourcesContent":["import { type MouseEventHandler, type PointerEventHandler, type MutableRefObject, useCallback, useRef } from \"react\";\n\nexport type SwipeChangeHandler<T extends HTMLElement> = (\n event: React.MouseEvent<T> | React.PointerEvent<T>,\n pressed: boolean,\n) => void;\n\ntype Point = { x: number; y: number };\n\nfunction getGesturePointFromEvent<T extends HTMLElement>(event: React.PointerEvent<T>): Point {\n return {\n x: event.clientX,\n y: event.clientY,\n };\n}\n\ntype SwipeGestureOptions<T extends HTMLElement> = {\n onClick?: MouseEventHandler<T>;\n onChange?: SwipeChangeHandler<T>;\n onPointerDown?: PointerEventHandler<T>;\n onPointerUp?: PointerEventHandler<T>;\n onPointerMove?: PointerEventHandler<T>;\n onPointerCancel?: PointerEventHandler<T>;\n};\n\n/**\n * Logikk for å håndtere en swipe, for eksempel brukt i toggle switch.\n *\n * @param options Callbacks for de ulike stegene i en swipe-gesture\n * @returns Handlers for de ulike stegene i en swipe-gesture\n */\nexport function useSwipeGesture<T extends HTMLElement>(\n options: SwipeGestureOptions<T>,\n): {\n swipeHandled: MutableRefObject<\"on\" | \"off\" | false>;\n gestureHandlers: {\n onClick: MouseEventHandler<T>;\n onPointerDown: PointerEventHandler<T>;\n onPointerMove: PointerEventHandler<T>;\n onPointerUp: PointerEventHandler<T>;\n onPointerCancel: PointerEventHandler<T>;\n };\n} {\n const swipeHandled = useRef<\"on\" | \"off\" | false>(false);\n const gestureStartPosition = useRef<Point>();\n\n const { onClick, onChange, onPointerCancel, onPointerDown, onPointerMove, onPointerUp } = options;\n\n const handleClick: MouseEventHandler<T> = useCallback(\n (event) => {\n if (!swipeHandled.current) {\n onClick?.(event);\n }\n swipeHandled.current = false; // sørg for at vi får klikke igjen etter swipes\n },\n [onClick],\n );\n\n const handleGestureStart: PointerEventHandler<T> = useCallback(\n (event) => {\n event.preventDefault();\n\n (event.target as T).setPointerCapture?.(event.pointerId);\n gestureStartPosition.current = getGesturePointFromEvent(event);\n swipeHandled.current = false;\n\n onPointerDown?.(event);\n },\n [onPointerDown],\n );\n\n const handleGestureMove: PointerEventHandler<T> = useCallback(\n (event) => {\n event.preventDefault();\n\n if (!gestureStartPosition.current) {\n return;\n }\n\n const { x: currentX } = getGesturePointFromEvent(event);\n const { x: startX } = gestureStartPosition.current;\n\n if (currentX - startX > 10 && onChange && swipeHandled.current !== \"on\") {\n onChange(event, true);\n swipeHandled.current = \"on\";\n gestureStartPosition.current = getGesturePointFromEvent(event);\n } else if (startX - currentX > 10 && onChange && swipeHandled.current !== \"off\") {\n onChange(event, false);\n swipeHandled.current = \"off\";\n gestureStartPosition.current = getGesturePointFromEvent(event);\n }\n\n onPointerMove?.(event);\n },\n [onPointerMove, onChange],\n );\n\n const handleGestureEnd: PointerEventHandler<T> = useCallback(\n (event) => {\n event.preventDefault();\n\n (event.target as T).releasePointerCapture?.(event.pointerId);\n gestureStartPosition.current = undefined;\n\n event.type === \"pointerup\" ? onPointerUp?.(event) : onPointerCancel?.(event);\n },\n [onPointerUp, onPointerCancel],\n );\n\n return {\n swipeHandled,\n gestureHandlers: {\n onClick: handleClick,\n onPointerDown: handleGestureStart,\n onPointerMove: handleGestureMove,\n onPointerUp: handleGestureEnd,\n onPointerCancel: handleGestureEnd,\n },\n };\n}\n"],"names":["getGesturePointFromEvent","event","x","clientX","y","clientY","options","swipeHandled","useRef","gestureStartPosition","onClick","onChange","onPointerCancel","onPointerDown","onPointerMove","onPointerUp","handleClick","useCallback","current","handleGestureStart","preventDefault","_b","_a","target","setPointerCapture","call","pointerId","handleGestureMove","currentX","startX","handleGestureEnd","releasePointerCapture","type","gestureHandlers"],"mappings":"yGASA,SAASA,EAAgDC,GAC9C,MAAA,CACHC,EAAGD,EAAME,QACTC,EAAGH,EAAMI,QAEjB,yBAiBO,SACHC,GAWM,MAAAC,EAAeC,UAA6B,GAC5CC,EAAuBD,EAAAA,UAErBE,QAAAA,EAASC,SAAAA,EAAUC,gBAAAA,EAAiBC,cAAAA,EAAeC,cAAAA,EAAeC,YAAAA,GAAgBT,EAEpFU,EAAoCC,EAAAA,aACrChB,IACQM,EAAaW,SACd,MAAAR,GAAAA,EAAUT,GAEdM,EAAaW,SAAU,CAC3B,GACA,CAACR,IAGCS,EAA6CF,EAAAA,aAC9ChB,YACGA,EAAMmB,iBAEL,OAAAC,GAAAC,EAAArB,EAAMsB,QAAaC,oBAAnBH,EAAAI,KAAAH,EAAuCrB,EAAMyB,WACzBjB,EAAAS,QAAUlB,EAAyBC,GACxDM,EAAaW,SAAU,EAEvB,MAAAL,GAAAA,EAAgBZ,EAAAA,GAEpB,CAACY,IAGCc,EAA4CV,EAAAA,aAC7ChB,IAGO,GAFJA,EAAMmB,kBAEDX,EAAqBS,QACtB,OAGJ,MAAQhB,EAAG0B,GAAa5B,EAAyBC,IACzCC,EAAG2B,GAAWpB,EAAqBS,QAEvCU,EAAWC,EAAS,IAAMlB,GAAqC,OAAzBJ,EAAaW,SACnDP,EAASV,GAAO,GAChBM,EAAaW,QAAU,KACFT,EAAAS,QAAUlB,EAAyBC,IACjD4B,EAASD,EAAW,IAAMjB,GAAqC,QAAzBJ,EAAaW,UAC1DP,EAASV,GAAO,GAChBM,EAAaW,QAAU,MACFT,EAAAS,QAAUlB,EAAyBC,IAG5D,MAAAa,GAAAA,EAAgBb,EAAAA,GAEpB,CAACa,EAAeH,IAGdmB,EAA2Cb,EAAAA,aAC5ChB,YACGA,EAAMmB,iBAEL,OAAAC,GAAAC,EAAArB,EAAMsB,QAAaQ,wBAAnBV,EAAAI,KAAAH,EAA2CrB,EAAMyB,WAClDjB,EAAqBS,aAAU,EAEhB,cAAfjB,EAAM+B,KAAuB,MAAAjB,GAAAA,EAAcd,GAAS,MAAAW,GAAAA,EAAkBX,EAAAA,GAE1E,CAACc,EAAaH,IAGX,MAAA,CACHL,aAAAA,EACA0B,gBAAiB,CACbvB,QAASM,EACTH,cAAeM,EACfL,cAAea,EACfZ,YAAae,EACblB,gBAAiBkB,GAG7B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function e(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}export{e as c};
|
|
2
|
+
//# sourceMappingURL=clsx-BeLtu-UY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clsx-BeLtu-UY.js","sources":["../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":["r","e","t","f","n","Array","isArray","o","length","clsx","arguments"],"mappings":"AAAA,SAASA,EAAEC,GAAOC,IAAAA,EAAEC,EAAEC,EAAE,GAAG,GAAG,iBAAiBH,GAAG,iBAAiBA,EAAEG,GAAGH,OAAA,GAAU,iBAAiBA,KAAKI,MAAMC,QAAQL,GAAG,CAAC,IAAIM,EAAEN,EAAEO,OAAO,IAAIN,EAAE,EAAEA,EAAEK,EAAEL,IAAID,EAAEC,KAAKC,EAAEH,EAAEC,EAAEC,OAAOE,IAAIA,GAAG,KAAKA,GAAGD,EAAE,MAAUA,IAAAA,KAAKF,EAAEA,EAAEE,KAAKC,IAAIA,GAAG,KAAKA,GAAGD,GAAUC,OAAAA,CAAC,CAAQ,SAASK,IAAeR,IAAAA,IAAAA,EAAEC,EAAEC,EAAE,EAAEC,EAAE,GAAGG,EAAEG,UAAUF,OAAOL,EAAEI,EAAEJ,KAAKF,EAAES,UAAUP,MAAMD,EAAEF,EAAEC,MAAMG,IAAIA,GAAG,KAAKA,GAAGF,GAAUE,OAAAA,CAAC","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}exports.clsx=function(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n};
|
|
2
|
+
//# sourceMappingURL=clsx-E3yX_9sL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clsx-E3yX_9sL.cjs","sources":["../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":["r","e","t","f","n","Array","isArray","o","length","arguments"],"mappings":"aAAA,SAASA,EAAEC,GAAG,IAAIC,EAAEC,EAAEC,EAAE,GAAG,GAAG,iBAAiBH,GAAG,iBAAiBA,EAAEG,GAAGH,UAAU,iBAAiBA,EAAE,GAAGI,MAAMC,QAAQL,GAAG,CAAC,IAAIM,EAAEN,EAAEO,OAAO,IAAIN,EAAE,EAAEA,EAAEK,EAAEL,IAAID,EAAEC,KAAKC,EAAEH,EAAEC,EAAEC,OAAOE,IAAIA,GAAG,KAAKA,GAAGD,EAAE,MAAM,IAAIA,KAAKF,EAAEA,EAAEE,KAAKC,IAAIA,GAAG,KAAKA,GAAGD,GAAG,OAAOC,CAAC,cAAQ,WAAgB,IAAQH,IAAAA,EAAEC,EAAEC,EAAE,EAAEC,EAAE,GAAGG,EAAEE,UAAUD,OAAOL,EAAEI,EAAEJ,KAAKF,EAAEQ,UAAUN,MAAMD,EAAEF,EAAEC,MAAMG,IAAIA,GAAG,KAAKA,GAAGF,GAAG,OAAOE,CAAC","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type SlotComponentProps = React.HTMLAttributes<HTMLElement> & {
|
|
3
|
+
children: React.ReactElement | false | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const SlotComponent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
6
|
+
children: React.ReactElement | false | null;
|
|
7
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AsChildProps = {
|
|
3
|
+
children: React.ReactElement | false | null;
|
|
4
|
+
/**
|
|
5
|
+
* Rendrer komponenten som child-elementet sitt, og slår
|
|
6
|
+
* sammen egenskaper og props.
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Component asChild foo="bar">
|
|
10
|
+
* <Child baz="qux" />
|
|
11
|
+
* </Component>
|
|
12
|
+
*
|
|
13
|
+
* // Rendrer følgende:
|
|
14
|
+
* <Child foo="bar" baz="qux" />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
asChild: true;
|
|
18
|
+
/**
|
|
19
|
+
* Du kan ikke bruke `as` sammen med `asChild`, da den uansett
|
|
20
|
+
* ikke vil ha noen effekt
|
|
21
|
+
*/
|
|
22
|
+
as?: never;
|
|
23
|
+
} | {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Rendrer komponenten som child-elementet sitt, og slår
|
|
27
|
+
* sammen egenskaper og props.
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Component asChild foo="bar">
|
|
31
|
+
* <Child baz="qux" />
|
|
32
|
+
* </Component>
|
|
33
|
+
*
|
|
34
|
+
* // Rendrer følgende:
|
|
35
|
+
* <Child foo="bar" baz="qux" />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
asChild?: false;
|
|
39
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { Easing, Timing } from './utils';
|
|
2
|
+
export { initTabListener, getValuePair, breakpoints, timings, easings, mergeRefs, mergeProps } from './utils';
|
|
3
|
+
export type { Density, PossibleRef } from './utils';
|
|
4
|
+
export type { ColorScheme, DataTestAutoId, ValuePair, WithChildren, WithOptionalChildren } from './types';
|
|
5
|
+
export { default as tokens } from './tokens';
|
|
6
|
+
export type { PolymorphicProps, PolymorphicPropsWithRef, PolymorphicRef } from './polymorphism';
|
|
7
|
+
export type { AsChildProps } from './as-child';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type ElementTypeProp<ElementType extends React.ElementType> = {
|
|
3
|
+
as?: ElementType;
|
|
4
|
+
};
|
|
5
|
+
type PropsToOmit<ElementType extends React.ElementType, Props> = keyof (ElementTypeProp<ElementType> & Props);
|
|
6
|
+
export type PolymorphicProps<ElementType extends React.ElementType, Props = {}> = React.PropsWithChildren<Props & ElementTypeProp<ElementType>> & Omit<React.ComponentPropsWithoutRef<ElementType>, PropsToOmit<ElementType, Props>>;
|
|
7
|
+
export type PolymorphicRef<ElementType extends React.ElementType> = React.ComponentPropsWithRef<ElementType>["ref"];
|
|
8
|
+
export type PolymorphicPropsWithRef<ElementType extends React.ElementType, Props = {}> = PolymorphicProps<ElementType, Props> & {
|
|
9
|
+
ref?: PolymorphicRef<ElementType>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|