Skip to content

Releases: roginfarrer/collapsed

[email protected]

16 Nov 00:15
b4ba53e
Compare
Choose a tag to compare

Patch Changes

  • cc68b19: Added aria-labelledby to the collapse panel, to be labelled by the toggle.

[email protected]

23 Oct 22:38
6d4965c
Compare
Choose a tag to compare

Patch Changes

  • a12f2e4: Do not call window.matchMedia if it does not exist. Fixes errors thrown in environments like JSDOM.

[email protected]

16 Oct 19:40
8c2a07b
Compare
Choose a tag to compare

Minor Changes

  • 3c86a81: Added support for overriding id.

[email protected]

18 Jul 16:25
8979004
Compare
Choose a tag to compare

Patch Changes

  • 2a098e1: Account for different signatures of addEventListener and addListener, fix #152

[email protected]

17 Jul 22:27
Compare
Choose a tag to compare

Patch Changes

[email protected]

07 Apr 14:51
a46a49e
Compare
Choose a tag to compare

4.0.2

Patch Changes

980b971: Fixed mismatched logic for prefer-reduced-motion

@collapsed/[email protected]

24 Jan 16:29
Compare
Choose a tag to compare

Major Changes

  • 5e427ec: This is a big refactor of react-collapsed, enough I wanted to denote it with a new major version.

    BREAKING CHANGES

    • expandStyles and collapseStyles options have been removed.

    • onExpandStart, onExpandEnd, onCollapseStart, onCollapseEnd options have been removed and replaced with onTransitionStateChange:

      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.useId if 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.flushSync to 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 getCollapseProps and getToggleProps, 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 as ref or style).
    • Changes the props returned by getToggleProps depending on the HTML tag of the component.

@collapsed/[email protected]

24 Jan 16:30
Compare
Choose a tag to compare

Patch Changes

  • cd21fd4: Remove package.json exports

@collapsed/[email protected]

16 Jan 02:10
Compare
Choose a tag to compare

Major Changes

  • 1ee93e8:

    BREAKING CHANGES

    • Adopts React 18's useId, making the library incompatible with React <18
    • Switch to tsup from microbundle for bundling library. No longer exports a UMD version, just CJS and MJS

    Features & Bug fixes

    • Refactors core functionality to vanilla JS (with a React) adapter, which I think should fix #103 and fix #100
    • Added onExpandedChange option
    • Tries to detect if getToggleProps is used. If the toggle element ref can be accessed, the aria-labelledby attribute will be added to the collapse element
    • Added role="region" to collapse
    • Updated toggle props to pass the appropriate attributes to the element, whether it's a button or not

@collapsed/[email protected]

16 Jan 02:11
Compare
Choose a tag to compare

Major Changes

  • 1ee93e8:

    BREAKING CHANGES

    • Adopts React 18's useId, making the library incompatible with React <18
    • Switch to tsup from microbundle for bundling library. No longer exports a UMD version, just CJS and MJS

    Features & Bug fixes

    • Refactors core functionality to vanilla JS (with a React) adapter, which I think should fix #103 and fix #100
    • Added onExpandedChange option
    • Tries to detect if getToggleProps is used. If the toggle element ref can be accessed, the aria-labelledby attribute will be added to the collapse element
    • Added role="region" to collapse
    • Updated toggle props to pass the appropriate attributes to the element, whether it's a button or not