Skip to content

Commit 91a48e3

Browse files
feat(item-sliding): added specific animations for ionic (#31103)
Issue number: resolves internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? The `item-sliding`has the same animations for md, iOS and Ionic ## What is the new behavior? New animations were added for the Ionic theme, including: - Animation for opening the `item-sliding` - Animation for closing the `item-sliding` - Animation for expandable options New conditions were also included to ensure a smoother experience: - Closing `item-sliding` by exceeding velocity - Selecting an extendable option by exceeding the velocity when options are visible - Rubber effect when selecting the option ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: Susmita Bhowmik <susmita.bhowmik@outsystems.com>
1 parent 73cadb1 commit 91a48e3

9 files changed

Lines changed: 553 additions & 92 deletions

File tree

core/package-lock.json

Lines changed: 22 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"fs-extra": "^9.0.1",
6969
"jest": "^29.7.0",
7070
"jest-cli": "^29.7.0",
71-
"outsystems-design-tokens": "^1.3.8",
71+
"outsystems-design-tokens": "^1.3.9",
7272
"playwright-core": "^1.58.2",
7373
"prettier": "^2.8.8",
7474
"rollup": "^2.26.4",

core/src/components/item-option/item-option.ionic.scss

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@
100100
color: globals.current-color(contrast);
101101
}
102102

103-
// Item Expandable Animation
104-
// --------------------------------------------------
105-
106-
:host(.item-option-expandable) {
107-
transition-timing-function: globals.$ion-transition-curve-expressive;
103+
:host(.item-option-expand-threshold) {
104+
filter: brightness(0.92);
108105
}

core/src/components/item-sliding/item-sliding.scss renamed to core/src/components/item-sliding/item-sliding.common.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@ ion-item-sliding .item {
1818
user-select: none;
1919
}
2020

21-
.item-sliding-active-slide .item {
22-
position: relative;
23-
24-
transition: transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);
25-
26-
opacity: 1;
27-
z-index: $z-index-item-options + 1;
28-
pointer-events: none;
29-
will-change: transform;
30-
}
31-
3221
.item-sliding-closing ion-item-options {
3322
pointer-events: none;
3423
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@use "./item-sliding.common";
2+
@use "../../themes/ionic/ionic.globals.scss" as globals;
3+
4+
// Transition utility classes
5+
.item-sliding-transition-open .item {
6+
transition: transform globals.$ion-transition-time-250 globals.$ion-transition-curve-smooth;
7+
}
8+
9+
.item-sliding-transition-snapback .item {
10+
transition: transform globals.$ion-transition-time-300 globals.$ion-transition-curve-bounce;
11+
}
12+
13+
// Ionic full-swipe confirm sequence (replaces inline `transition` on item / expandable width)
14+
.item-sliding-confirm-item-in .item {
15+
transition: transform globals.$ion-transition-time-150 globals.$ion-transition-curve-base;
16+
}
17+
18+
.item-sliding-confirm-item-back .item {
19+
transition: transform globals.$ion-transition-time-500 globals.$ion-transition-curve-bounce;
20+
}
21+
22+
ion-item-option.item-sliding-expandable-width-in {
23+
transition: width globals.$ion-transition-time-150 globals.$ion-transition-curve-base;
24+
}
25+
26+
ion-item-option.item-sliding-expandable-width-back {
27+
transition: width globals.$ion-transition-time-500 globals.$ion-transition-curve-bounce;
28+
}
29+
30+
.item-sliding-active-slide .item {
31+
position: relative;
32+
33+
opacity: 1;
34+
z-index: globals.$ion-z-index-100;
35+
pointer-events: none;
36+
will-change: transform;
37+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@use "./item-sliding.common";
2+
@import "../../themes/native/native.globals";
3+
4+
.item-sliding-active-slide .item {
5+
position: relative;
6+
7+
transition: transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);
8+
9+
opacity: 1;
10+
z-index: $z-index-item-options + 1;
11+
pointer-events: none;
12+
will-change: transform;
13+
}
14+
15+
// Native full-swipe animation (250ms ease-out; replaces inline styles on `ion-item`)
16+
.item-sliding-active-slide.item-sliding-full-swipe-transition .item {
17+
transition: transform 250ms ease-out;
18+
}
19+
20+
// During drag on native (ios/md), disable transition — matches former inline `transition: none`
21+
.item-sliding-active-slide.item-sliding-dragging .item {
22+
transition: none;
23+
}

0 commit comments

Comments
 (0)