@szhsin/react-accordion
Advanced tools
Comparing version 1.2.6 to 1.3.0
@@ -318,3 +318,3 @@ 'use strict'; | ||
const [transitionStyle, _panelRef] = useHeightTransition(state); | ||
const panelRef = useMergeRef(panelProps && panelProps.ref, _panelRef); | ||
const panelRef = useMergeRef(panelProps?.ref, _panelRef); | ||
const { | ||
@@ -336,9 +336,9 @@ status, | ||
margin: 0, | ||
...(headingProps && headingProps.style) | ||
...headingProps?.style | ||
}, | ||
className: bem(ACCORDION_BLOCK, 'item-heading')(headingProps && headingProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-heading')(headingProps?.className, state), | ||
children: /*#__PURE__*/jsxRuntime.jsx("button", { | ||
...mergeProps(_buttonProps, buttonProps), | ||
type: "button", | ||
className: bem(ACCORDION_BLOCK, 'item-btn')(buttonProps && buttonProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-btn')(buttonProps?.className, state), | ||
children: getRenderNode(header, itemState) | ||
@@ -351,9 +351,9 @@ }) | ||
...transitionStyle, | ||
...(contentProps && contentProps.style) | ||
...contentProps?.style | ||
}, | ||
className: bem(ACCORDION_BLOCK, 'item-content')(contentProps && contentProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-content')(contentProps?.className, state), | ||
children: /*#__PURE__*/jsxRuntime.jsx("div", { | ||
...mergeProps(_panelProps, panelProps), | ||
ref: panelRef, | ||
className: bem(ACCORDION_BLOCK, 'item-panel')(panelProps && panelProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-panel')(panelProps?.className, state), | ||
children: getRenderNode(children, itemState) | ||
@@ -360,0 +360,0 @@ }) |
@@ -38,3 +38,3 @@ import { memo } from 'react'; | ||
const [transitionStyle, _panelRef] = useHeightTransition(state); | ||
const panelRef = useMergeRef(panelProps && panelProps.ref, _panelRef); | ||
const panelRef = useMergeRef(panelProps?.ref, _panelRef); | ||
const { | ||
@@ -56,9 +56,9 @@ status, | ||
margin: 0, | ||
...(headingProps && headingProps.style) | ||
...headingProps?.style | ||
}, | ||
className: bem(ACCORDION_BLOCK, 'item-heading')(headingProps && headingProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-heading')(headingProps?.className, state), | ||
children: /*#__PURE__*/jsx("button", { | ||
...mergeProps(_buttonProps, buttonProps), | ||
type: "button", | ||
className: bem(ACCORDION_BLOCK, 'item-btn')(buttonProps && buttonProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-btn')(buttonProps?.className, state), | ||
children: getRenderNode(header, itemState) | ||
@@ -71,9 +71,9 @@ }) | ||
...transitionStyle, | ||
...(contentProps && contentProps.style) | ||
...contentProps?.style | ||
}, | ||
className: bem(ACCORDION_BLOCK, 'item-content')(contentProps && contentProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-content')(contentProps?.className, state), | ||
children: /*#__PURE__*/jsx("div", { | ||
...mergeProps(_panelProps, panelProps), | ||
ref: panelRef, | ||
className: bem(ACCORDION_BLOCK, 'item-panel')(panelProps && panelProps.className, state), | ||
className: bem(ACCORDION_BLOCK, 'item-panel')(panelProps?.className, state), | ||
children: getRenderNode(children, itemState) | ||
@@ -80,0 +80,0 @@ }) |
{ | ||
"name": "@szhsin/react-accordion", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"description": "The complete accordion solution for React.", | ||
@@ -49,39 +49,39 @@ "author": "Zheng Song", | ||
"peerDependencies": { | ||
"react": "^16.14 || ^17.0 || ^18.0", | ||
"react-dom": "^16.14 || ^17.0 || ^18.0" | ||
"react": "^16.14 || ^17.0 || ^18.0 || ^19.0", | ||
"react-dom": "^16.14 || ^17.0 || ^18.0 || ^19.0" | ||
}, | ||
"dependencies": { | ||
"react-transition-state": "^2.1.3" | ||
"react-transition-state": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.25.2", | ||
"@babel/preset-env": "^7.25.4", | ||
"@babel/preset-react": "^7.24.7", | ||
"@babel/preset-typescript": "^7.25.9", | ||
"@eslint/js": "^9.12.0", | ||
"@babel/core": "^7.26.0", | ||
"@babel/preset-env": "^7.26.0", | ||
"@babel/preset-react": "^7.26.3", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@eslint/js": "^9.16.0", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@testing-library/jest-dom": "^6.5.0", | ||
"@testing-library/react": "^16.0.1", | ||
"@types/jest": "^29.5.13", | ||
"@types/react": "^18.3.12", | ||
"@types/react-dom": "^18.3.0", | ||
"@rollup/plugin-node-resolve": "^15.3.0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/react": "^16.1.0", | ||
"@types/jest": "^29.5.14", | ||
"@types/react": "^19.0.1", | ||
"@types/react-dom": "^19.0.1", | ||
"babel-plugin-pure-annotations": "^0.1.2", | ||
"eslint": "^9.12.0", | ||
"eslint": "^9.16.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-jest": "^28.8.3", | ||
"eslint-plugin-jest": "^28.9.0", | ||
"eslint-plugin-react": "^7.37.2", | ||
"eslint-plugin-react-hooks": "^5.0.0", | ||
"eslint-plugin-react-hooks": "^5.1.0", | ||
"eslint-plugin-react-hooks-addons": "^0.4.1", | ||
"globals": "^15.9.0", | ||
"globals": "^15.13.0", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^3.3.3", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"rollup": "^4.24.0", | ||
"typescript": "^5.6.2", | ||
"typescript-eslint": "^8.9.0" | ||
"prettier": "^3.4.2", | ||
"react": "^19.0.0", | ||
"react-dom": "^19.0.0", | ||
"rollup": "^4.28.1", | ||
"typescript": "^5.7.2", | ||
"typescript-eslint": "^8.17.0" | ||
} | ||
} |
@@ -1,5 +0,5 @@ | ||
import { RefObject, ForwardedRef, MemoExoticComponent } from 'react'; | ||
import { ItemState, ItemStateOptions } from '../utils/constants'; | ||
import type { RefObject, ForwardedRef, MemoExoticComponent, JSX } from 'react'; | ||
import type { ItemState, ItemStateOptions } from '../utils/constants'; | ||
interface ItemStateProps<E extends Element, T = E> extends ItemState { | ||
itemRef: RefObject<E>; | ||
itemRef: RefObject<E | null>; | ||
forwardedRef: ForwardedRef<T>; | ||
@@ -6,0 +6,0 @@ } |
import { ItemStateOptions } from '../utils/constants'; | ||
declare const useAccordionItemEffect: <E extends Element>({ itemKey, initialEntered, disabled }?: ItemStateOptions) => { | ||
itemRef: import("react").RefObject<E>; | ||
itemRef: import("react").RefObject<E | null>; | ||
state: Readonly<{ | ||
@@ -5,0 +5,0 @@ status: import("react-transition-state").TransitionStatus; |
import { CSSProperties } from 'react'; | ||
import { TransitionState } from 'react-transition-state'; | ||
declare const useHeightTransition: <E extends Element>({ status, isResolved }: TransitionState) => readonly [CSSProperties, import("react").RefObject<E>]; | ||
declare const useHeightTransition: <E extends Element>({ status, isResolved }: TransitionState) => readonly [CSSProperties, import("react").RefObject<E | null>]; | ||
export { useHeightTransition }; |
@@ -1,3 +0,2 @@ | ||
import React from 'react'; | ||
declare const useId: typeof React.useId; | ||
declare const useId: () => string | undefined; | ||
export { useId }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39618
960
+ Addedreact@19.0.0(transitive)
+ Addedreact-dom@19.0.0(transitive)
+ Addedscheduler@0.25.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)
- Removedreact-dom@18.3.1(transitive)
- Removedscheduler@0.23.2(transitive)