Socket
Socket
Sign inDemoInstall

@fremtind/jkl-react-hooks

Package Overview
Dependencies
Maintainers
3
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fremtind/jkl-react-hooks - npm Package Compare versions

Comparing version 11.0.2 to 11.1.0

6

build/cjs/useAnimatedHeight.js

@@ -28,2 +28,3 @@ "use strict";

var import_usePreviousValue = require("./usePreviousValue/usePreviousValue");
const defaultDisplay = "block";
const defaultEasing = "standard";

@@ -35,2 +36,3 @@ const defaultTiming = "productive";

const timing = (options == null ? void 0 : options.timing) || defaultTiming;
const display = (options == null ? void 0 : options.display) || defaultDisplay;
const transition = `${import_jkl_core.timings[timing]} height ${import_jkl_core.easings[easing]}`;

@@ -78,3 +80,3 @@ const { prefersReducedMotion } = (0, import_useBrowserPreferences.useBrowserPreferences)();

element.style.transition = transition;
element.style.display = "block";
element.style.display = display;
element.style.overflow = "hidden";

@@ -97,3 +99,3 @@ if (isOpen) {

}
}, [isOpen, options, wasOpen, transition, prefersReducedMotion]);
}, [isOpen, options, wasOpen, transition, prefersReducedMotion, display]);
(0, import_react.useEffect)(() => {

@@ -100,0 +102,0 @@ runAnimation();

@@ -5,2 +5,3 @@ import { easings, timings } from "@fremtind/jkl-core";

import { usePreviousValue } from "./usePreviousValue/usePreviousValue";
const defaultDisplay = "block";
const defaultEasing = "standard";

@@ -12,2 +13,3 @@ const defaultTiming = "productive";

const timing = (options == null ? void 0 : options.timing) || defaultTiming;
const display = (options == null ? void 0 : options.display) || defaultDisplay;
const transition = `${timings[timing]} height ${easings[easing]}`;

@@ -55,3 +57,3 @@ const { prefersReducedMotion } = useBrowserPreferences();

element.style.transition = transition;
element.style.display = "block";
element.style.display = display;
element.style.overflow = "hidden";

@@ -74,3 +76,3 @@ if (isOpen) {

}
}, [isOpen, options, wasOpen, transition, prefersReducedMotion]);
}, [isOpen, options, wasOpen, transition, prefersReducedMotion, display]);
useEffect(() => {

@@ -77,0 +79,0 @@ runAnimation();

import type { Easing, Timing } from "@fremtind/jkl-core";
import { RefObject } from "react";
export interface UseAnimatedHeightOptions<T extends HTMLElement = HTMLElement> {
display?: "block" | "grid" | "flex";
/**

@@ -5,0 +6,0 @@ * Overstyr standard easingfunksjon

{
"name": "@fremtind/jkl-react-hooks",
"version": "11.0.2",
"version": "11.1.0",
"publishConfig": {

@@ -57,3 +57,3 @@ "access": "public"

},
"gitHead": "3def7a7685c9da4e0dfddf181b1e021ab1eb87da"
"gitHead": "e374435aa84c77d27fef476ecf649d973963c2a3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc