Socket
Socket
Sign inDemoInstall

@chakra-ui/popper

Package Overview
Dependencies
Maintainers
3
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-ui/popper - npm Package Compare versions

Comparing version 2.4.3 to 3.0.0-next.0

4

dist/chakra-ui-popper.cjs.dev.js

@@ -104,3 +104,3 @@ 'use strict';

The match width modifier sets the popper width to match the reference.
It us useful for custom selects, autocomplete, etc.
It is useful for custom selects, autocomplete, etc.
* -----------------------------------------------------------------------------------------------*/

@@ -336,3 +336,3 @@

var setupPopper = react.useCallback(function () {
if (!enabled || !reference.current || !popper.current) return; // If popper instance exists, destroy it so we can create a new one
if (!enabled || !reference.current || !popper.current) return; // If popper instance exists, destroy it, so we can create a new one

@@ -339,0 +339,0 @@ cleanup.current == null ? void 0 : cleanup.current();

@@ -104,3 +104,3 @@ 'use strict';

The match width modifier sets the popper width to match the reference.
It us useful for custom selects, autocomplete, etc.
It is useful for custom selects, autocomplete, etc.
* -----------------------------------------------------------------------------------------------*/

@@ -336,3 +336,3 @@

var setupPopper = react.useCallback(function () {
if (!enabled || !reference.current || !popper.current) return; // If popper instance exists, destroy it so we can create a new one
if (!enabled || !reference.current || !popper.current) return; // If popper instance exists, destroy it, so we can create a new one

@@ -339,0 +339,0 @@ cleanup.current == null ? void 0 : cleanup.current();

@@ -100,3 +100,3 @@ import { mergeRefs } from '@chakra-ui/react-utils';

The match width modifier sets the popper width to match the reference.
It us useful for custom selects, autocomplete, etc.
It is useful for custom selects, autocomplete, etc.
* -----------------------------------------------------------------------------------------------*/

@@ -332,3 +332,3 @@

var setupPopper = useCallback(function () {
if (!enabled || !reference.current || !popper.current) return; // If popper instance exists, destroy it so we can create a new one
if (!enabled || !reference.current || !popper.current) return; // If popper instance exists, destroy it, so we can create a new one

@@ -335,0 +335,0 @@ cleanup.current == null ? void 0 : cleanup.current();

{
"name": "@chakra-ui/popper",
"version": "2.4.3",
"version": "3.0.0-next.0",
"description": "A React component and hooks wrapper for popper.js",

@@ -40,3 +40,3 @@ "keywords": [

"dependencies": {
"@chakra-ui/react-utils": "1.2.3",
"@chakra-ui/react-utils": "2.0.0-next.0",
"@popperjs/core": "^2.9.3"

@@ -48,4 +48,4 @@ },

"devDependencies": {
"react": "^17.0.1"
"react": "^18.0.0"
}
}

@@ -6,3 +6,3 @@ # Popper

> This is an internal hook of Chakra-UI and it's not covered by semver, and may
> This is an internal hook of Chakra-UI, and it's not covered by semver, and may
> cause unexpected or broken application behavior. Use them at your own risk.

@@ -22,4 +22,4 @@

```jsx
import { Box } from '@chakra-ui/layout'
import { Button } from '@chakra-ui/button'
import { Box } from "@chakra-ui/layout"
import { Button } from "@chakra-ui/button"
import { useDisclosure } from "@chakra-ui/hooks"

@@ -81,4 +81,4 @@ import { usePopper } from "@chakra-ui/popper"

You can place the popper next to the reference without margin or distance between them.
Useful to create an autocomplete or typeahead feature.
You can place the popper next to the reference without margin or distance
between them. Useful to create an autocomplete or typeahead feature.

@@ -93,7 +93,8 @@ ```jsx

If the reference element is inside a fixed container, you should use the `fixed` strategy.
If the reference element is inside a fixed container, you should use the `fixed`
strategy.
```jsx
const { popperRef, referenceRef } = usePopper({
strategy: 'fixed',
strategy: "fixed",
})

@@ -107,3 +108,3 @@ ```

```jsx
```tsx
// 1. Import components

@@ -131,5 +132,6 @@ import { useDisclosure } from "@chakra-ui/hooks"

// 4. Consume the `usePopper` hook
const { getPopperProps, getReferenceProps, getArrowProps, transformOrigin } = usePopper({
placement: "bottom-start",
})
const { getPopperProps, getReferenceProps, getArrowProps, transformOrigin } =
usePopper({
placement: "bottom-start",
})

@@ -136,0 +138,0 @@ return (

@@ -6,3 +6,3 @@ import { Placement, Modifier, State } from "@popperjs/core"

The match width modifier sets the popper width to match the reference.
It us useful for custom selects, autocomplete, etc.
It is useful for custom selects, autocomplete, etc.
* -----------------------------------------------------------------------------------------------*/

@@ -18,6 +18,8 @@

},
effect: ({ state }) => () => {
const reference = state.elements.reference as HTMLElement
state.elements.popper.style.width = `${reference.offsetWidth}px`
},
effect:
({ state }) =>
() => {
const reference = state.elements.reference as HTMLElement
state.elements.popper.style.width = `${reference.offsetWidth}px`
},
}

@@ -39,5 +41,7 @@

},
effect: ({ state }) => () => {
setTransformOrigin(state)
},
effect:
({ state }) =>
() => {
setTransformOrigin(state)
},
}

@@ -117,5 +121,7 @@

},
effect: ({ state }) => () => {
setInnerArrowStyles(state)
},
effect:
({ state }) =>
() => {
setInnerArrowStyles(state)
},
}

@@ -122,0 +128,0 @@

@@ -135,3 +135,3 @@ import { mergeRefs, PropGetterV2 } from "@chakra-ui/react-utils"

// If popper instance exists, destroy it so we can create a new one
// If popper instance exists, destroy it, so we can create a new one
cleanup.current?.()

@@ -138,0 +138,0 @@

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