Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@os-design/utils

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@os-design/utils - npm Package Compare versions

Comparing version 1.0.26 to 1.0.27

36

dist/cjs/index.js

@@ -137,23 +137,23 @@ "use strict";

var _isTouchDevice = _interopRequireDefault(require("./isTouchDevice"));
var _isTouchDevice = _interopRequireDefault(require("@os-design/is-touch-device"));
var _useBodyScroll = _interopRequireDefault(require("./useBodyScroll"));
var _useBodyScroll = _interopRequireDefault(require("@os-design/use-body-scroll"));
var _useBrowserLayoutEffect = _interopRequireDefault(require("./useBrowserLayoutEffect"));
var _useBrowserLayoutEffect = _interopRequireDefault(require("@os-design/use-browser-layout-effect"));
var _useClickOutside = _interopRequireDefault(require("./useClickOutside"));
var _useClickOutside = _interopRequireDefault(require("@os-design/use-click-outside"));
var _useClosable = _interopRequireDefault(require("./useClosable"));
var _useClosable = _interopRequireDefault(require("@os-design/use-closable"));
var _useDebounce = _interopRequireDefault(require("./useDebounce"));
var _useDebounce = _interopRequireDefault(require("@os-design/use-debounce"));
var _useEvent = _interopRequireDefault(require("./useEvent"));
var _useEvent = _interopRequireDefault(require("@os-design/use-event"));
var _useFontSize = _interopRequireDefault(require("./useFontSize"));
var _useFontSize = _interopRequireDefault(require("@os-design/use-font-size"));
var _useForwardedRef = _interopRequireDefault(require("./useForwardedRef"));
var _useForwardedRef = _interopRequireDefault(require("@os-design/use-forwarded-ref"));
var _useForwardedState = _interopRequireDefault(require("./useForwardedState"));
var _useForwardedState = _interopRequireDefault(require("@os-design/use-forwarded-state"));
var _useKeyPress = _interopRequireWildcard(require("./useKeyPress"));
var _useKeyPress = _interopRequireWildcard(require("@os-design/use-key-press"));

@@ -172,15 +172,15 @@ Object.keys(_useKeyPress).forEach(function (key) {

var _usePrevious = _interopRequireDefault(require("./usePrevious"));
var _usePrevious = _interopRequireDefault(require("@os-design/use-previous"));
var _usePropRef = _interopRequireDefault(require("./usePropRef"));
var _usePropRef = _interopRequireDefault(require("@os-design/use-prop-ref"));
var _useResizeObserver = _interopRequireDefault(require("./useResizeObserver"));
var _useResizeObserver = _interopRequireDefault(require("@os-design/use-resize-observer"));
var _useSafeAreaInset = _interopRequireDefault(require("./useSafeAreaInset"));
var _useSafeAreaInset = _interopRequireDefault(require("@os-design/use-safe-area-inset"));
var _useSize = _interopRequireDefault(require("./useSize"));
var _useSize = _interopRequireDefault(require("@os-design/use-size"));
var _useThrottle = _interopRequireDefault(require("./useThrottle"));
var _useThrottle = _interopRequireDefault(require("@os-design/use-throttle"));
var _useVh = _interopRequireDefault(require("./useVh"));
var _useVh = _interopRequireDefault(require("@os-design/use-vh"));

@@ -187,0 +187,0 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -1,20 +0,20 @@

export { default as isTouchDevice } from './isTouchDevice';
export { default as useBodyScroll } from './useBodyScroll';
export { default as useBrowserLayoutEffect } from './useBrowserLayoutEffect';
export { default as useClickOutside } from './useClickOutside';
export { default as useClosable } from './useClosable';
export { default as useDebounce } from './useDebounce';
export { default as useEvent } from './useEvent';
export { default as useFontSize } from './useFontSize';
export { default as useForwardedRef } from './useForwardedRef';
export { default as useForwardedState } from './useForwardedState';
export { default as useKeyPress } from './useKeyPress';
export { default as usePrevious } from './usePrevious';
export { default as usePropRef } from './usePropRef';
export { default as useResizeObserver } from './useResizeObserver';
export { default as useSafeAreaInset } from './useSafeAreaInset';
export { default as useSize } from './useSize';
export { default as useThrottle } from './useThrottle';
export { default as useVh } from './useVh';
export * from './useKeyPress';
export { default as isTouchDevice } from '@os-design/is-touch-device';
export { default as useBodyScroll } from '@os-design/use-body-scroll';
export { default as useBrowserLayoutEffect } from '@os-design/use-browser-layout-effect';
export { default as useClickOutside } from '@os-design/use-click-outside';
export { default as useClosable } from '@os-design/use-closable';
export { default as useDebounce } from '@os-design/use-debounce';
export { default as useEvent } from '@os-design/use-event';
export { default as useFontSize } from '@os-design/use-font-size';
export { default as useForwardedRef } from '@os-design/use-forwarded-ref';
export { default as useForwardedState } from '@os-design/use-forwarded-state';
export { default as useKeyPress } from '@os-design/use-key-press';
export { default as usePrevious } from '@os-design/use-previous';
export { default as usePropRef } from '@os-design/use-prop-ref';
export { default as useResizeObserver } from '@os-design/use-resize-observer';
export { default as useSafeAreaInset } from '@os-design/use-safe-area-inset';
export { default as useSize } from '@os-design/use-size';
export { default as useThrottle } from '@os-design/use-throttle';
export { default as useVh } from '@os-design/use-vh';
export * from '@os-design/use-key-press';
//# sourceMappingURL=index.js.map

@@ -1,20 +0,20 @@

export { default as isTouchDevice } from './isTouchDevice';
export { default as useBodyScroll } from './useBodyScroll';
export { default as useBrowserLayoutEffect } from './useBrowserLayoutEffect';
export { default as useClickOutside } from './useClickOutside';
export { default as useClosable } from './useClosable';
export { default as useDebounce } from './useDebounce';
export { default as useEvent } from './useEvent';
export { default as useFontSize } from './useFontSize';
export { default as useForwardedRef } from './useForwardedRef';
export { default as useForwardedState } from './useForwardedState';
export { default as useKeyPress } from './useKeyPress';
export { default as usePrevious } from './usePrevious';
export { default as usePropRef } from './usePropRef';
export { default as useResizeObserver } from './useResizeObserver';
export { default as useSafeAreaInset } from './useSafeAreaInset';
export { default as useSize } from './useSize';
export { default as useThrottle } from './useThrottle';
export { default as useVh } from './useVh';
export * from './useKeyPress';
export { default as isTouchDevice } from '@os-design/is-touch-device';
export { default as useBodyScroll } from '@os-design/use-body-scroll';
export { default as useBrowserLayoutEffect } from '@os-design/use-browser-layout-effect';
export { default as useClickOutside } from '@os-design/use-click-outside';
export { default as useClosable } from '@os-design/use-closable';
export { default as useDebounce } from '@os-design/use-debounce';
export { default as useEvent } from '@os-design/use-event';
export { default as useFontSize } from '@os-design/use-font-size';
export { default as useForwardedRef } from '@os-design/use-forwarded-ref';
export { default as useForwardedState } from '@os-design/use-forwarded-state';
export { default as useKeyPress } from '@os-design/use-key-press';
export { default as usePrevious } from '@os-design/use-previous';
export { default as usePropRef } from '@os-design/use-prop-ref';
export { default as useResizeObserver } from '@os-design/use-resize-observer';
export { default as useSafeAreaInset } from '@os-design/use-safe-area-inset';
export { default as useSize } from '@os-design/use-size';
export { default as useThrottle } from '@os-design/use-throttle';
export { default as useVh } from '@os-design/use-vh';
export * from '@os-design/use-key-press';
//# sourceMappingURL=index.d.ts.map
{
"name": "@os-design/utils",
"version": "1.0.26",
"version": "1.0.27",
"license": "UNLICENSED",

@@ -30,6 +30,21 @@ "repository": "git@gitlab.com:os-team/libs/os-design.git",

},
"devDependencies": {
"@os-design/styles": "^1.0.21",
"@types/resize-observer-browser": "^0.1.5",
"react": ">=17"
"dependencies": {
"@os-design/is-touch-device": "^1.0.0",
"@os-design/use-body-scroll": "^1.0.0",
"@os-design/use-browser-layout-effect": "^1.0.0",
"@os-design/use-click-outside": "^1.0.0",
"@os-design/use-closable": "^1.0.0",
"@os-design/use-debounce": "^1.0.0",
"@os-design/use-event": "^1.0.0",
"@os-design/use-font-size": "^1.0.0",
"@os-design/use-forwarded-ref": "^1.0.0",
"@os-design/use-forwarded-state": "^1.0.0",
"@os-design/use-key-press": "^1.0.0",
"@os-design/use-previous": "^1.0.0",
"@os-design/use-prop-ref": "^1.0.0",
"@os-design/use-resize-observer": "^1.0.0",
"@os-design/use-safe-area-inset": "^1.0.0",
"@os-design/use-size": "^1.0.0",
"@os-design/use-throttle": "^1.0.0",
"@os-design/use-vh": "^1.0.0"
},

@@ -39,6 +54,3 @@ "peerDependencies": {

},
"dependencies": {
"resize-observer-polyfill": "^1.5.1"
},
"gitHead": "8a838dd04ab7d4adc65cac37edd2aeb1c69bd191"
"gitHead": "2128998b2d8c0415f5183f56986e338affb1fc3b"
}
# @os-design/utils [![NPM version](https://img.shields.io/npm/v/@os-design/utils)](https://yarnpkg.com/package/@os-design/utils) [![BundlePhobia](https://img.shields.io/bundlephobia/minzip/@os-design/utils)](https://bundlephobia.com/result?p=@os-design/utils)
Additional utils and hooks used in os-design.
Utils and hooks used in os-design.
- `isTouchDevice` – Detects whether the client device is touch-enabled.
- `useBodyScroll` – Enables or disables scrolling of the body element.
- `useBrowserLayoutEffect` – Mocks the useLayoutEffect on the server side.
- `useClickOutside` – Sets the listener that will be called when the click event occurs outside the target element.
- `useClosable` – Sets the closed state to true after a delay to apply the fade out animation.
- `useDebounce` – The callback function will be called only when N ms has elapsed after the last call attempt.
- `useEvent` – Sets the listener that will be called whenever the specified event occurs.
- `useFontSize` – Computes the font size of the element.
- `useForwardedRef` – Allows to use the forwardedRef.
- `useForwardedState` – Uses the inner state if the passed value is undefined.
- `useKeyPress` – Sets the listener that will be called whenever the key down event occurs.
- `usePrevious` – Returns the previous value.
- `usePropRef` – Prevents re-rendering when the value changes.
- `useResizeObserver` – Sets the listener that will be called whenever the resize event of an element occurs.
- `useSafeAreaInset` – Calculates the safe area inset.
- `useSize` – Returns the width and height of the container. By default, the container is window.
- `useThrottle` – The callback function will be called no more than once during the N ms, even if it is called many times during that period.
- `useVh` – Sets the `--vh` css variable.
1. [isTouchDevice](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/is-touch-device) – Detects whether the client device is touch-enabled.
1. [useBodyScroll](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-body-scroll) – Enables or disables scrolling of the body element.
1. [useBrowserLayoutEffect](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-browser-layout-effect) – Mocks the useLayoutEffect on the server side.
1. [useClickOutside](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-click-outside) – Sets the listener that will be called when the click event occurs outside the target element.
1. [useClosable](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-closable) – Sets the closed state to true after a delay to apply the fade out animation.
1. [useDebounce](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-debounce) – The callback function will be called only when N ms has elapsed after the last call attempt.
1. [useEvent](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-event) – Sets the listener that will be called whenever the specified event occurs.
1. [useFontSize](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-font-size) – Computes the font size of the element.
1. [useForwardedRef](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-forwarded-ref) – Allows to use the forwardedRef.
1. [useForwardedState](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-forwarded-state) – Uses the inner state if the passed value is undefined.
1. [useKeyPress](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-key-press) – Sets the listener that will be called whenever the key down event occurs.
1. [usePrevious](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-previous) – Returns the previous value.
1. [usePropRef](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-prop-ref) – Prevents re-rendering when the value changes.
1. [useResizeObserver](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-resize-observer) – Sets the listener that will be called whenever the resize event of an element occurs.
1. [useSafeAreaInset](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-safe-area-inset) – Calculates the safe area inset.
1. [useSize](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-size) – Returns the width and height of the container. By default, the container is window.
1. [useThrottle](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-throttle) – The callback function will be called no more than once during the N ms, even if it is called many times during that period.
1. [useVh](https://gitlab.com/os-team/libs/os-design/-/tree/master/packages/use-vh) – Sets the --vh css variable.

@@ -24,0 +24,0 @@ ## Installation

Sorry, the diff of this file is not supported yet

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