Releases: roginfarrer/collapsed
Releases · roginfarrer/collapsed
[email protected]
Minor Changes
- 3e498c4: Updated react peer dependency versions to include React 19
@collapsed/[email protected]
Minor Changes
- 3e498c4: Updated react peer dependency versions to include React 19
[email protected]
Patch Changes
- cc68b19: Added
aria-labelledbyto the collapse panel, to be labelled by the toggle.
[email protected]
Patch Changes
- a12f2e4: Do not call window.matchMedia if it does not exist. Fixes errors thrown in environments like JSDOM.
[email protected]
Minor Changes
- 3c86a81: Added support for overriding
id.
[email protected]
[email protected]
Patch Changes
- 6bb5507: Fixed crashing errors from MatchMedia in Safari <= 13. Thanks @kostia1st!
[email protected]
@collapsed/[email protected]
Major Changes
-
5e427ec: This is a big refactor of
react-collapsed, enough I wanted to denote it with a new major version.BREAKING CHANGES
-
expandStylesandcollapseStylesoptions have been removed. -
onExpandStart,onExpandEnd,onCollapseStart,onCollapseEndoptions have been removed and replaced withonTransitionStateChange:const useCollapse({ onTransitionStateChange(stage) { switch (stage) { case 'expandStart': case 'expandEnd': case 'expanding': case 'collapseStart': case 'collapseEnd': case 'collapsing': // do thing default: break; } } })
Other changes
- Unique IDs for accessibility are now generated with
React.useIdif it's available. - Styles assigned to the collapse element are now assigned to the DOM element directly via a ref, and no longer require
ReactDOM.flushSyncto update styles in transition. - Added
role="region"to collapse. - Added logic to handle disabling the animation if the user has the prefers reduced motion setting enabled.
- Replaced animation resolution handling to a programmatic timer, instead of the
'transitionend'event. Should fix #103. - Improved the types for
getCollapsePropsandgetToggleProps, so their arguments and return type is more accurately typed. This should help catch cases when props returned by the getters are duplicated on the component (such asreforstyle). - Changes the props returned by
getTogglePropsdepending on the HTML tag of the component.
-
@collapsed/[email protected]
Patch Changes
- cd21fd4: Remove package.json exports