react-modal-navigation 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +53 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +593 -554
- package/dist/style.css +17 -0
- package/docs/API.md +11 -0
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -77,3 +77,20 @@
|
|
|
77
77
|
.pmn-toast-close:hover{color:var(--pmn-text)}
|
|
78
78
|
|
|
79
79
|
.pmn-button-danger{background:#dc2626!important;color:#fff!important;border-color:#dc2626!important}
|
|
80
|
+
|
|
81
|
+
/* Internal page navigation (distinct from opening/closing the modal). */
|
|
82
|
+
@keyframes pmn-page-forward-in { from { opacity:.18; transform:translate3d(var(--pmn-page-distance,96px),0,0) scale(.985) } to { opacity:1; transform:translate3d(0,0,0) } }
|
|
83
|
+
@keyframes pmn-page-back-in { from { opacity:.18; transform:translate3d(calc(-1 * var(--pmn-page-distance,96px)),0,0) scale(.985) } to { opacity:1; transform:translate3d(0,0,0) } }
|
|
84
|
+
.pmn-page-enter { animation-duration:var(--pmn-page-duration,360ms); animation-timing-function:cubic-bezier(.2,.8,.2,1); animation-fill-mode:both; will-change:transform,opacity; }
|
|
85
|
+
.pmn-page-forward { animation-name:pmn-page-forward-in; }
|
|
86
|
+
.pmn-page-back { animation-name:pmn-page-back-in; }
|
|
87
|
+
@media (prefers-reduced-motion:reduce) { .pmn-page-enter { animation:none!important; will-change:auto; } }
|
|
88
|
+
|
|
89
|
+
/* Simultaneous incoming/outgoing pages: outgoing layer is an inert visual snapshot. */
|
|
90
|
+
.pmn-main{position:relative;isolation:isolate}
|
|
91
|
+
.pmn-page-exit{animation-duration:var(--pmn-page-duration,360ms);animation-timing-function:cubic-bezier(.22,1,.36,1);animation-fill-mode:forwards}
|
|
92
|
+
@keyframes pmn-page-forward-out{to{opacity:.45;transform:translate3d(calc(-1 * var(--pmn-page-distance,96px)),0,0) scale(.985)}}
|
|
93
|
+
@keyframes pmn-page-back-out{to{opacity:.45;transform:translate3d(var(--pmn-page-distance,96px),0,0) scale(.985)}}
|
|
94
|
+
.pmn-page-exit-forward{animation-name:pmn-page-forward-out}
|
|
95
|
+
.pmn-page-exit-back{animation-name:pmn-page-back-out}
|
|
96
|
+
@media(prefers-reduced-motion:reduce){.pmn-page-exit{animation:none!important}}
|
package/docs/API.md
CHANGED
|
@@ -627,3 +627,14 @@ import type { TypedModalNavigation } from 'react-modal-navigation';
|
|
|
627
627
|
type Routes = { UserDetail: { userId: number }; DeviceList: undefined };
|
|
628
628
|
type Navigation = TypedModalNavigation<Routes>;
|
|
629
629
|
```
|
|
630
|
+
|
|
631
|
+
### 页面切换动画
|
|
632
|
+
|
|
633
|
+
- `pageAnimation?: boolean` — 默认 `true`,控制弹窗内部的页面切换动画。
|
|
634
|
+
- `pageAnimationDuration?: number` — 默认 `360`,单位毫秒,范围限制在 0–1000。
|
|
635
|
+
- `animation: false` — 同时禁用弹窗开关动画和内部页面动画。
|
|
636
|
+
- `prefers-reduced-motion: reduce` — 自动禁用内部页面动画。
|
|
637
|
+
|
|
638
|
+
页面动画仅在当前路由 `key` 变化时触发;`navigate`、`goBack`、`replace` 等操作无需修改调用方式。
|
|
639
|
+
|
|
640
|
+
- `pageAnimationDistance?: number` — 默认 `96`,页面进入滑动距离(像素),范围 0–300。
|