Skip to content

Commit

Permalink
feat(PPDSC-2115): accordion motion (#264)
Browse files Browse the repository at this point in the history
* feat(PPDSC-2155): accordion header motion

- Add motion support to accordion header
- Add backgroundColorChange default transition present
- Update test snapshots
- Add transitionPreset override support
- Update overrides test snapshot
- Add transitionPreset override to storybook scenario

* feat(PPDSC-2115): accordion panel transitions

- Add maxHeightChange transition preset
- Conditionally set max-height on accordion panel (to scroll height or 0)
- Set maxHeightChange as default transitionPreset for accordion
- Add support for accordion transitionPreset overrides on panel
- Update types, tests and stories

* feat(PPDSC-2115): update theme snapshots

* feat(PPDSC-2115): fix a117 storybook issue

* feat(PPDSC-2115): support other transition presets

* feat(PPDSC-2115): update snapshots

* feat(PPDSC-2115): update panel height on window resize

* feat(PPDSC-2115): test for setting max height

* feat(PPDSC-2115): add storybook config for failing tests

- Accordion tests failing because responsiveness managed by JS: 'In Ultrafast Grid, the DOM is taken from the local rendering and rerendered on multiple devices. This works for pages that are CSS-responsive. If JS comes into picture, we need to take multiple DOMs locally, for each width on which page DOM changes.'
- Add layoutBreakpoints config to fix.

* feat(PPDSC-2115): layout breakpoints global setting

* feat(PPDSC-2115): Revert "feat(PPDSC-2115): layout breakpoints global setting"

This reverts commit 297abb2.

* feat(PPDSC-2115): prevent animation on first render

* feat(PPDSC-2115): prevent test failures

- Unset max height for expanded accordions. It is calculated incorrectly in the Applitools test env, causing the tests to fail.
  • Loading branch information
mstuartf authored Sep 7, 2022
1 parent 9516ff1 commit 319fed2
Show file tree
Hide file tree
Showing 14 changed files with 2,045 additions and 157 deletions.
216 changes: 216 additions & 0 deletions site/theme/__tests__/__snapshots__/doc-theme.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -4574,6 +4601,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -7143,6 +7197,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -9709,6 +9790,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -12278,6 +12386,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -14844,6 +14979,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -17413,6 +17575,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down Expand Up @@ -19979,6 +20168,33 @@ Object {
"transitionTimingFunction": "{{motions.motionTimingEaseOut}}",
},
},
"maxHeightChange": Object {
"base": Object {
"transitionProperty": "max-height",
},
"enter": Object {
"maxHeight": "0",
},
"enterActive": Object {
"maxHeight": "unset",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"enterDone": Object {
"maxHeight": "unset",
},
"exit": Object {
"maxHeight": "unset",
},
"exitActive": Object {
"maxHeight": "0",
"transitionDuration": "{{motions.motionDuration020}}",
"transitionProperty": "max-height",
},
"exitDone": Object {
"maxHeight": "0",
},
},
"moveUp": Object {
"appear": Object {},
"appearActive": Object {},
Expand Down
Loading

0 comments on commit 319fed2

Please sign in to comment.