react-panel-layout 0.6.1 → 0.7.1

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.
Files changed (127) hide show
  1. package/dist/FloatingWindow-CE-WzkNv.js +1542 -0
  2. package/dist/FloatingWindow-CE-WzkNv.js.map +1 -0
  3. package/dist/FloatingWindow-DpFpmX1f.cjs +2 -0
  4. package/dist/FloatingWindow-DpFpmX1f.cjs.map +1 -0
  5. package/dist/GridLayout-EwKszYBy.cjs +2 -0
  6. package/dist/{GridLayout-DKTg_N61.cjs.map → GridLayout-EwKszYBy.cjs.map} +1 -1
  7. package/dist/GridLayout-kiWdpMLQ.js +947 -0
  8. package/dist/{GridLayout-UWNxXw77.js.map → GridLayout-kiWdpMLQ.js.map} +1 -1
  9. package/dist/PanelSystem-Dmy5YI_6.cjs +3 -0
  10. package/dist/PanelSystem-Dmy5YI_6.cjs.map +1 -0
  11. package/dist/{PanelSystem-BqUzNtf2.js → PanelSystem-DrYsYwuV.js} +208 -247
  12. package/dist/PanelSystem-DrYsYwuV.js.map +1 -0
  13. package/dist/components/window/Drawer.d.ts +1 -0
  14. package/dist/components/window/DrawerRevealContext.d.ts +61 -0
  15. package/dist/components/window/drawerRevealAnimationUtils.d.ts +212 -0
  16. package/dist/components/window/drawerStyles.d.ts +5 -0
  17. package/dist/components/window/useDrawerSwipeTransform.d.ts +8 -2
  18. package/dist/components/window/useDrawerTransform.d.ts +68 -0
  19. package/dist/components/window/useRevealDrawerTransform.d.ts +56 -0
  20. package/dist/config.cjs +1 -1
  21. package/dist/config.cjs.map +1 -1
  22. package/dist/config.js +8 -7
  23. package/dist/config.js.map +1 -1
  24. package/dist/dialog/index.d.ts +1 -1
  25. package/dist/grid.cjs +1 -1
  26. package/dist/grid.js +2 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +4 -4
  29. package/dist/modules/dialog/DialogContainer.d.ts +22 -2
  30. package/dist/modules/dialog/Modal.d.ts +23 -2
  31. package/dist/modules/dialog/SwipeDialogContainer.d.ts +6 -2
  32. package/dist/modules/dialog/types.d.ts +12 -0
  33. package/dist/modules/drawer/drawerStateMachine.d.ts +168 -0
  34. package/dist/modules/drawer/revealDrawerConstants.d.ts +33 -0
  35. package/dist/modules/drawer/revealDrawerStateMachine.d.ts +146 -0
  36. package/dist/modules/drawer/strategies/index.d.ts +8 -0
  37. package/dist/modules/drawer/strategies/overlayStrategy.d.ts +12 -0
  38. package/dist/modules/drawer/strategies/revealStrategy.d.ts +12 -0
  39. package/dist/modules/drawer/strategies/types.d.ts +116 -0
  40. package/dist/panels.cjs +1 -1
  41. package/dist/panels.js +1 -1
  42. package/dist/stack.cjs +1 -1
  43. package/dist/stack.cjs.map +1 -1
  44. package/dist/stack.js +306 -347
  45. package/dist/stack.js.map +1 -1
  46. package/dist/types.d.ts +14 -0
  47. package/dist/useAnimationFrame-CRuFlk5t.js +394 -0
  48. package/dist/useAnimationFrame-CRuFlk5t.js.map +1 -0
  49. package/dist/useAnimationFrame-XRpDXkwV.cjs +2 -0
  50. package/dist/useAnimationFrame-XRpDXkwV.cjs.map +1 -0
  51. package/dist/window.cjs +1 -1
  52. package/dist/window.js +1 -1
  53. package/package.json +1 -1
  54. package/src/components/gesture/SwipeSafeZone.tsx +1 -0
  55. package/src/components/grid/GridLayout.tsx +110 -38
  56. package/src/components/window/Drawer.tsx +114 -10
  57. package/src/components/window/DrawerLayers.tsx +48 -15
  58. package/src/components/window/DrawerRevealContext.spec.ts +20 -0
  59. package/src/components/window/DrawerRevealContext.tsx +99 -0
  60. package/src/components/window/drawerRevealAnimationUtils.spec.ts +375 -0
  61. package/src/components/window/drawerRevealAnimationUtils.ts +415 -0
  62. package/src/components/window/drawerStyles.spec.ts +39 -0
  63. package/src/components/window/drawerStyles.ts +24 -0
  64. package/src/components/window/useDrawerSwipeTransform.ts +28 -90
  65. package/src/components/window/useDrawerTransform.ts +505 -0
  66. package/src/components/window/useRevealDrawerTransform.spec.ts +1936 -0
  67. package/src/components/window/useRevealDrawerTransform.ts +105 -0
  68. package/src/demo/components/FullscreenDemoPage.tsx +47 -0
  69. package/src/demo/fullscreenRoutes.tsx +32 -0
  70. package/src/demo/index.tsx +5 -0
  71. package/src/demo/pages/Dialog/components/CardExpandDemo.tsx +23 -8
  72. package/src/demo/pages/Drawer/components/DrawerBasics.module.css +6 -1
  73. package/src/demo/pages/Drawer/components/DrawerBasics.tsx +14 -4
  74. package/src/demo/pages/Drawer/components/DrawerReveal.module.css +157 -0
  75. package/src/demo/pages/Drawer/components/DrawerReveal.tsx +128 -0
  76. package/src/demo/pages/Drawer/reveal/index.tsx +17 -0
  77. package/src/demo/pages/Drawer/reveal-fullscreen/index.tsx +135 -0
  78. package/src/demo/pages/Drawer/reveal-fullscreen/styles.module.css +233 -0
  79. package/src/demo/pages/Stack/components/StackBasics.spec.tsx +56 -52
  80. package/src/demo/pages/Stack/components/StackTablet.spec.tsx +39 -49
  81. package/src/demo/routes.tsx +2 -0
  82. package/src/dialog/index.ts +2 -0
  83. package/src/hooks/gesture/testing/createGestureSimulator.ts +1 -0
  84. package/src/hooks/gesture/useNativeGestureGuard.spec.ts +10 -2
  85. package/src/hooks/gesture/useSwipeInput.spec.ts +69 -0
  86. package/src/hooks/gesture/useSwipeInput.ts +2 -0
  87. package/src/hooks/gesture/utils.ts +15 -4
  88. package/src/hooks/useAnimatedVisibility.spec.ts +3 -3
  89. package/src/hooks/useOperationContinuity.spec.ts +17 -10
  90. package/src/hooks/useOperationContinuity.ts +5 -5
  91. package/src/hooks/useSharedElementTransition.ts +28 -7
  92. package/src/modules/dialog/DialogContainer.tsx +39 -5
  93. package/src/modules/dialog/Modal.tsx +46 -4
  94. package/src/modules/dialog/SwipeDialogContainer.tsx +12 -2
  95. package/src/modules/dialog/dialogAnimationUtils.spec.ts +0 -1
  96. package/src/modules/dialog/types.ts +14 -0
  97. package/src/modules/dialog/useDialogContainer.spec.ts +11 -3
  98. package/src/modules/dialog/useDialogSwipeInput.spec.ts +49 -28
  99. package/src/modules/dialog/useDialogSwipeInput.ts +37 -6
  100. package/src/modules/dialog/useDialogTransform.spec.ts +63 -30
  101. package/src/modules/drawer/drawerStateMachine.ts +500 -0
  102. package/src/modules/drawer/revealDrawerConstants.ts +38 -0
  103. package/src/modules/drawer/revealDrawerStateMachine.spec.ts +558 -0
  104. package/src/modules/drawer/revealDrawerStateMachine.ts +197 -0
  105. package/src/modules/drawer/strategies/index.ts +9 -0
  106. package/src/modules/drawer/strategies/overlayStrategy.ts +133 -0
  107. package/src/modules/drawer/strategies/revealStrategy.ts +111 -0
  108. package/src/modules/drawer/strategies/types.ts +160 -0
  109. package/src/modules/drawer/useDrawerSwipeInput.ts +7 -4
  110. package/src/modules/pivot/SwipePivotContent.spec.tsx +48 -37
  111. package/src/modules/pivot/usePivotSwipeInput.spec.ts +8 -8
  112. package/src/modules/stack/swipeTransitionContinuity.spec.tsx +1 -1
  113. package/src/types.ts +15 -0
  114. package/dist/FloatingWindow-CUXnEtrb.js +0 -827
  115. package/dist/FloatingWindow-CUXnEtrb.js.map +0 -1
  116. package/dist/FloatingWindow-DMwyK0eK.cjs +0 -2
  117. package/dist/FloatingWindow-DMwyK0eK.cjs.map +0 -1
  118. package/dist/GridLayout-DKTg_N61.cjs +0 -2
  119. package/dist/GridLayout-UWNxXw77.js +0 -926
  120. package/dist/PanelSystem-BqUzNtf2.js.map +0 -1
  121. package/dist/PanelSystem-D603LKKv.cjs +0 -3
  122. package/dist/PanelSystem-D603LKKv.cjs.map +0 -1
  123. package/dist/useNativeGestureGuard-C7TSqEkr.cjs +0 -2
  124. package/dist/useNativeGestureGuard-C7TSqEkr.cjs.map +0 -1
  125. package/dist/useNativeGestureGuard-CGYo6O0r.js +0 -347
  126. package/dist/useNativeGestureGuard-CGYo6O0r.js.map +0 -1
  127. package/src/components/window/useDrawerSwipeTransform.spec.ts +0 -234
package/dist/stack.js CHANGED
@@ -1,28 +1,28 @@
1
- import { jsx as P, Fragment as j, jsxs as q } from "react/jsx-runtime";
1
+ import { jsx as O, Fragment as Y, jsxs as j } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
- import { S as J, s as Q, t as Z, u as z } from "./styles-NkjuMOVS.js";
4
- import { u as ee } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
5
- import { u as te } from "./useContentCache-CO3LYNmz.js";
6
- import { u as ne, a as re, m as se, I as ie } from "./useNativeGestureGuard-CGYo6O0r.js";
7
- function ce(t) {
8
- const { wasActive: e, isActive: n, transitionMode: i } = t;
9
- return i !== "css" || e === n ? null : n ? "push" : "pop";
3
+ import { S as J, s as q, t as Q, u as Z } from "./styles-NkjuMOVS.js";
4
+ import { u as z } from "./useIsomorphicLayoutEffect-DhmEnmZ_.js";
5
+ import { u as ee } from "./useContentCache-CO3LYNmz.js";
6
+ import { u as te, a as ne, m as re, I as se, i as ie, b as oe, e as ae } from "./useAnimationFrame-CRuFlk5t.js";
7
+ function ce(n) {
8
+ const { wasActive: e, isActive: t, transitionMode: i } = n;
9
+ return i !== "css" || e === t ? null : t ? "push" : "pop";
10
10
  }
11
- function oe(t) {
11
+ function ue(n) {
12
12
  const {
13
13
  displayMode: e,
14
- depth: n,
14
+ depth: t,
15
15
  navigationDepth: i,
16
- isActive: o,
17
- isAnimatingOut: c,
16
+ isActive: c,
17
+ isAnimatingOut: o,
18
18
  isRevealing: u,
19
19
  revealDepth: s
20
- } = t;
21
- return e === "overlay" ? o || c || u && n === s ? "visible" : "hidden" : n <= i || c ? "visible" : "hidden";
20
+ } = n;
21
+ return e === "overlay" ? c || o || u && t === s ? "visible" : "hidden" : t <= i || o ? "visible" : "hidden";
22
22
  }
23
- function ae(t) {
24
- const { depth: e, activeDepth: n, displayMode: i, isRevealing: o, revealDepth: c } = t, u = e === n, s = e < n;
25
- if (o && u && c !== null)
23
+ function le(n) {
24
+ const { depth: e, activeDepth: t, displayMode: i, isRevealing: c, revealDepth: o } = n, u = e === t, s = e < t;
25
+ if (c && u && o !== null)
26
26
  return `translateX(${0.3 * 100}%)`;
27
27
  if (u)
28
28
  return "translateX(0)";
@@ -33,91 +33,91 @@ function ae(t) {
33
33
  case "slide":
34
34
  return "translateX(-30%)";
35
35
  case "stack": {
36
- const l = (n - e) * -5, f = 1 - (n - e) * 0.05;
36
+ const l = (t - e) * -5, f = 1 - (t - e) * 0.05;
37
37
  return `translateX(${l}%) scale(${f})`;
38
38
  }
39
39
  }
40
40
  return "translateX(100%)";
41
41
  }
42
- function ue(t, e, n) {
43
- return e === void 0 || e <= 0 || !n ? t : `translateX(${e * 100}%)`;
42
+ function fe(n, e, t) {
43
+ return e === void 0 || e <= 0 || !t ? n : `translateX(${e * 100}%)`;
44
44
  }
45
- function le(t) {
46
- if (t === "css")
47
- return `transform ${J} ${Q}`;
45
+ function pe(n) {
46
+ if (n === "css")
47
+ return `transform ${J} ${q}`;
48
48
  }
49
- function fe(t) {
49
+ function de(n) {
50
50
  const {
51
51
  depth: e,
52
- isActive: n,
52
+ isActive: t,
53
53
  wasActive: i,
54
- currentAnimationType: o,
55
- displayMode: c,
54
+ currentAnimationType: c,
55
+ displayMode: o,
56
56
  transitionMode: u,
57
57
  navigationState: s,
58
58
  swipeProgress: l
59
- } = t, m = ce({
59
+ } = n, m = ce({
60
60
  wasActive: i,
61
- isActive: n,
61
+ isActive: t,
62
62
  transitionMode: u
63
- }) ?? o, v = m === "pop", a = oe({
64
- displayMode: c,
63
+ }) ?? c, g = m === "pop", a = ue({
64
+ displayMode: o,
65
65
  depth: e,
66
66
  navigationDepth: s.depth,
67
- isActive: n,
68
- isAnimatingOut: v,
67
+ isActive: t,
68
+ isAnimatingOut: g,
69
69
  isRevealing: s.isRevealing,
70
70
  revealDepth: s.revealDepth
71
- }), g = ae({
71
+ }), v = le({
72
72
  depth: e,
73
73
  activeDepth: s.depth,
74
- displayMode: c,
74
+ displayMode: o,
75
75
  isRevealing: s.isRevealing,
76
76
  revealDepth: s.revealDepth
77
- }), R = ue(g, l, n), A = (() => {
77
+ }), y = fe(v, l, t), A = (() => {
78
78
  if (u === "css") {
79
79
  if (m === "push")
80
- return Z;
80
+ return Q;
81
81
  if (m === "pop")
82
- return z;
82
+ return Z;
83
83
  }
84
- })(), d = le(u);
84
+ })(), d = pe(u);
85
85
  return {
86
86
  nextAnimationType: m,
87
87
  visibility: a,
88
- transform: R,
88
+ transform: y,
89
89
  animation: A,
90
90
  transition: d,
91
91
  zIndex: e,
92
- pointerEvents: n ? "auto" : "none"
92
+ pointerEvents: t ? "auto" : "none"
93
93
  };
94
94
  }
95
- const pe = {
95
+ const me = {
96
96
  position: "absolute",
97
97
  inset: 0,
98
98
  width: "100%",
99
99
  height: "100%"
100
- }, de = r.memo(
101
- ({ id: t, depth: e, isActive: n, displayMode: i, transitionMode: o, navigationState: c, swipeProgress: u, children: s }) => {
102
- const l = r.useRef(null), f = r.useRef(n), [m, v] = r.useState(null), a = fe({
100
+ }, he = r.memo(
101
+ ({ id: n, depth: e, isActive: t, displayMode: i, transitionMode: c, navigationState: o, swipeProgress: u, children: s }) => {
102
+ const l = r.useRef(null), f = r.useRef(t), [m, g] = r.useState(null), a = de({
103
103
  depth: e,
104
- isActive: n,
104
+ isActive: t,
105
105
  wasActive: f.current,
106
106
  currentAnimationType: m,
107
107
  displayMode: i,
108
- transitionMode: o,
109
- navigationState: c,
108
+ transitionMode: c,
109
+ navigationState: o,
110
110
  swipeProgress: u
111
111
  });
112
- ee(() => {
112
+ z(() => {
113
113
  const d = f.current;
114
- f.current = n, d !== n && v(a.nextAnimationType);
115
- }, [n, a.nextAnimationType]);
116
- const g = r.useCallback((d) => {
117
- d.target === d.currentTarget && v(null);
118
- }, []), R = r.useMemo(() => {
114
+ f.current = t, d !== t && g(a.nextAnimationType);
115
+ }, [t, a.nextAnimationType]);
116
+ const v = r.useCallback((d) => {
117
+ d.target === d.currentTarget && g(null);
118
+ }, []), y = r.useMemo(() => {
119
119
  const d = {
120
- ...pe,
120
+ ...me,
121
121
  transform: a.transform,
122
122
  pointerEvents: a.pointerEvents,
123
123
  zIndex: a.zIndex,
@@ -131,120 +131,120 @@ const pe = {
131
131
  a.visibility,
132
132
  a.animation,
133
133
  a.transition
134
- ]), A = /* @__PURE__ */ P(
134
+ ]), A = /* @__PURE__ */ O(
135
135
  "div",
136
136
  {
137
137
  ref: l,
138
- "data-stack-content": t,
138
+ "data-stack-content": n,
139
139
  "data-depth": e,
140
- "data-active": n ? "true" : "false",
141
- style: R,
142
- onAnimationEnd: g,
140
+ "data-active": t ? "true" : "false",
141
+ style: y,
142
+ onAnimationEnd: v,
143
143
  children: s
144
144
  }
145
145
  );
146
- return o === "none" ? /* @__PURE__ */ P(r.Activity, { mode: n ? "visible" : "hidden", children: A }) : A;
146
+ return c === "none" ? /* @__PURE__ */ O(r.Activity, { mode: t ? "visible" : "hidden", children: A }) : A;
147
147
  }
148
148
  );
149
- function me(t, e) {
149
+ function ve(n, e) {
150
150
  switch (e.type) {
151
151
  case "push":
152
- return [...t, e.id];
152
+ return [...n, e.id];
153
153
  case "go": {
154
154
  if (e.direction >= 0)
155
- return t;
156
- const i = t.length - 1 + e.direction;
157
- return i < 0 ? t : t.slice(0, i + 1);
155
+ return n;
156
+ const i = n.length - 1 + e.direction;
157
+ return i < 0 ? n : n.slice(0, i + 1);
158
158
  }
159
159
  case "move":
160
- return e.targetDepth < 0 || e.targetDepth >= t.length ? t : t.slice(0, e.targetDepth + 1);
160
+ return e.targetDepth < 0 || e.targetDepth >= n.length ? n : n.slice(0, e.targetDepth + 1);
161
161
  case "replace":
162
- return t.length === 0 ? [e.id] : [...t.slice(0, -1), e.id];
162
+ return n.length === 0 ? [e.id] : [...n.slice(0, -1), e.id];
163
163
  }
164
164
  }
165
- const G = r.createContext(null), he = r.memo(() => {
166
- const t = r.useContext(G);
167
- if (!t)
165
+ const G = r.createContext(null), ge = r.memo(() => {
166
+ const n = r.useContext(G);
167
+ if (!n)
168
168
  throw new Error("StackOutlet must be used within useStackNavigation");
169
169
  const [, e] = r.useReducer((s) => s + 1, 0);
170
- r.useEffect(() => t.subscribe(e), [t]);
171
- const { panels: n, navigationState: i, displayMode: o, transitionMode: c } = t.getState(), u = r.useMemo(() => i.stack.map((s, l) => {
172
- const f = n.find((m) => m.id === s);
170
+ r.useEffect(() => n.subscribe(e), [n]);
171
+ const { panels: t, navigationState: i, displayMode: c, transitionMode: o } = n.getState(), u = r.useMemo(() => i.stack.map((s, l) => {
172
+ const f = t.find((m) => m.id === s);
173
173
  return f ? { panel: f, depth: l } : null;
174
- }).filter((s) => s !== null), [i.stack, n]);
175
- return /* @__PURE__ */ P(j, { children: u.map(({ panel: s, depth: l }) => /* @__PURE__ */ P(
176
- de,
174
+ }).filter((s) => s !== null), [i.stack, t]);
175
+ return /* @__PURE__ */ O(Y, { children: u.map(({ panel: s, depth: l }) => /* @__PURE__ */ O(
176
+ he,
177
177
  {
178
178
  id: s.id,
179
179
  depth: l,
180
180
  isActive: l === i.depth,
181
- displayMode: o,
182
- transitionMode: c,
181
+ displayMode: c,
182
+ transitionMode: o,
183
183
  navigationState: i,
184
- children: s.cache ? t.getCachedContent(s.id) : s.content
184
+ children: s.cache ? n.getCachedContent(s.id) : s.content
185
185
  },
186
186
  s.id
187
187
  )) });
188
188
  });
189
- function Ve(t) {
189
+ function Ge(n) {
190
190
  const {
191
191
  panels: e,
192
- initialPanelId: n,
192
+ initialPanelId: t,
193
193
  displayMode: i,
194
- transitionMode: o = "css",
195
- onPanelChange: c
196
- } = t, u = n ?? e[0]?.id;
194
+ transitionMode: c = "css",
195
+ onPanelChange: o
196
+ } = n, u = t ?? e[0]?.id;
197
197
  if (!u)
198
198
  throw new Error("useStackNavigation: No panels provided");
199
199
  const [s, l] = r.useReducer(
200
- me,
200
+ ve,
201
201
  [u]
202
202
  ), f = r.useRef(s);
203
203
  f.current = s;
204
204
  const m = r.useRef(s);
205
205
  r.useEffect(() => {
206
206
  const p = m.current;
207
- if (m.current = s, c && s !== p) {
208
- const C = s.length - 1, b = s[C];
209
- b !== void 0 && c(b, C);
207
+ if (m.current = s, o && s !== p) {
208
+ const k = s.length - 1, b = s[k];
209
+ b !== void 0 && o(b, k);
210
210
  }
211
- }, [s, c]);
212
- const [v, a] = r.useState({ isRevealing: !1, revealDepth: null }), g = s.length - 1, R = r.useMemo(() => ({
211
+ }, [s, o]);
212
+ const [g, a] = r.useState({ isRevealing: !1, revealDepth: null }), v = s.length - 1, y = r.useMemo(() => ({
213
213
  stack: s,
214
- depth: g,
215
- isRevealing: v.isRevealing,
216
- revealDepth: v.revealDepth
217
- }), [s, g, v.isRevealing, v.revealDepth]), A = s[g], d = g > 0 ? s[g - 1] : null, h = r.useCallback((p) => {
214
+ depth: v,
215
+ isRevealing: g.isRevealing,
216
+ revealDepth: g.revealDepth
217
+ }), [s, v, g.isRevealing, g.revealDepth]), A = s[v], d = v > 0 ? s[v - 1] : null, h = r.useCallback((p) => {
218
218
  e.find((b) => b.id === p) && l({ type: "push", id: p });
219
- }, [e]), y = r.useCallback((p) => {
219
+ }, [e]), R = r.useCallback((p) => {
220
220
  l({ type: "go", direction: p });
221
- }, []), k = r.useCallback((p) => {
221
+ }, []), C = r.useCallback((p) => {
222
222
  l({ type: "move", targetDepth: p });
223
- }, []), M = r.useCallback((p) => {
223
+ }, []), w = r.useCallback((p) => {
224
224
  e.find((b) => b.id === p) && l({ type: "replace", id: p });
225
- }, [e]), w = r.useCallback((p) => p >= 0 ? !1 : f.current.length - 1 + p >= 0, []), _ = r.useCallback((p) => {
226
- const C = f.current.length - 1, b = p ?? C - 1;
227
- b < 0 || b >= C || a({ isRevealing: !0, revealDepth: b });
228
- }, []), F = r.useCallback(() => {
225
+ }, [e]), M = r.useCallback((p) => p >= 0 ? !1 : f.current.length - 1 + p >= 0, []), _ = r.useCallback((p) => {
226
+ const k = f.current.length - 1, b = p ?? k - 1;
227
+ b < 0 || b >= k || a({ isRevealing: !0, revealDepth: b });
228
+ }, []), $ = r.useCallback(() => {
229
229
  f.current.length - 1 !== 0 && a({ isRevealing: !0, revealDepth: 0 });
230
230
  }, []), x = r.useCallback(() => {
231
231
  a({ isRevealing: !1, revealDepth: null });
232
232
  }, []), N = r.useCallback((p) => {
233
- const C = f.current, b = C.indexOf(p), X = C.length - 1, L = b === X;
233
+ const k = f.current, b = k.indexOf(p), X = k.length - 1, F = b === X;
234
234
  return {
235
235
  "data-stack-panel": p,
236
236
  "data-depth": b,
237
- "data-active": L ? "true" : "false",
238
- "aria-hidden": !L
237
+ "data-active": F ? "true" : "false",
238
+ "aria-hidden": !F
239
239
  };
240
240
  }, []), T = r.useCallback(() => {
241
- const p = f.current, C = p.length - 1, b = C > 0, X = C > 0 ? p[C - 1] : null, L = X ? e.find((Y) => Y.id === X) : null, H = L?.title ? `Back to ${L.title}` : "Go back";
241
+ const p = f.current, k = p.length - 1, b = k > 0, X = k > 0 ? p[k - 1] : null, F = X ? e.find((H) => H.id === X) : null, W = F?.title ? `Back to ${F.title}` : "Go back";
242
242
  return {
243
- onClick: () => y(-1),
243
+ onClick: () => R(-1),
244
244
  disabled: !b,
245
- "aria-label": H
245
+ "aria-label": W
246
246
  };
247
- }, [e, y]), D = r.useMemo(
247
+ }, [e, R]), S = r.useMemo(
248
248
  () => ({
249
249
  position: "relative",
250
250
  width: "100%",
@@ -252,86 +252,86 @@ function Ve(t) {
252
252
  overflow: "hidden"
253
253
  }),
254
254
  []
255
- ), I = r.useRef({
255
+ ), D = r.useRef({
256
256
  panels: e,
257
- navigationState: R,
257
+ navigationState: y,
258
258
  displayMode: i,
259
- transitionMode: o
259
+ transitionMode: c
260
260
  });
261
- I.current = {
261
+ D.current = {
262
262
  panels: e,
263
- navigationState: R,
263
+ navigationState: y,
264
264
  displayMode: i,
265
- transitionMode: o
265
+ transitionMode: c
266
266
  };
267
267
  const E = r.useRef(/* @__PURE__ */ new Set());
268
268
  r.useEffect(() => {
269
269
  E.current.forEach((p) => p());
270
- }, [R, i, o]);
270
+ }, [y, i, c]);
271
271
  const U = r.useCallback(
272
- (p) => I.current.panels.find((b) => b.id === p)?.content ?? null,
272
+ (p) => D.current.panels.find((b) => b.id === p)?.content ?? null,
273
273
  []
274
- ), S = r.useMemo(() => e.map((p) => p.id), [e]), { getCachedContent: O } = te({
274
+ ), I = r.useMemo(() => e.map((p) => p.id), [e]), { getCachedContent: P } = ee({
275
275
  resolveContent: U,
276
- validIds: S
277
- }), $ = r.useMemo(
276
+ validIds: I
277
+ }), L = r.useMemo(
278
278
  () => ({
279
- getState: () => I.current,
279
+ getState: () => D.current,
280
280
  subscribe: (p) => (E.current.add(p), () => E.current.delete(p)),
281
- getCachedContent: O
281
+ getCachedContent: P
282
282
  }),
283
- [O]
284
- ), W = r.useMemo(() => {
285
- const p = () => /* @__PURE__ */ P(G.Provider, { value: $, children: /* @__PURE__ */ P("div", { style: D, "data-stack-container": !0, children: /* @__PURE__ */ P(he, {}) }) });
283
+ [P]
284
+ ), K = r.useMemo(() => {
285
+ const p = () => /* @__PURE__ */ O(G.Provider, { value: L, children: /* @__PURE__ */ O("div", { style: S, "data-stack-container": !0, children: /* @__PURE__ */ O(ge, {}) }) });
286
286
  return p.displayName = "StackOutlet", p;
287
- }, [$, D]);
287
+ }, [L, S]);
288
288
  return {
289
- state: R,
289
+ state: y,
290
290
  push: h,
291
- go: y,
292
- move: k,
293
- replace: M,
291
+ go: R,
292
+ move: C,
293
+ replace: w,
294
294
  revealParent: _,
295
- revealRoot: F,
295
+ revealRoot: $,
296
296
  dismissReveal: x,
297
297
  getPanelProps: N,
298
298
  getBackButtonProps: T,
299
- canGo: w,
299
+ canGo: M,
300
300
  currentPanelId: A,
301
301
  previousPanelId: d,
302
- Outlet: W
302
+ Outlet: K
303
303
  };
304
304
  }
305
- function Ke(t) {
305
+ function Ve(n) {
306
306
  const {
307
307
  containerRef: e,
308
- navigation: n,
308
+ navigation: t,
309
309
  edge: i = "left",
310
- edgeWidth: o = 20,
311
- enabled: c = !0
312
- } = t, [u, s] = r.useState(null), l = r.useCallback(
310
+ edgeWidth: c = 20,
311
+ enabled: o = !0
312
+ } = n, [u, s] = r.useState(null), l = r.useCallback(
313
313
  (d) => {
314
- s(null), i === "left" && d.direction === 1 && n.canGo(-1) && n.go(-1);
314
+ s(null), i === "left" && d.direction === 1 && t.canGo(-1) && t.go(-1);
315
315
  },
316
- [i, n]
317
- ), { isEdgeGesture: f, state: m, containerProps: v } = ne({
316
+ [i, t]
317
+ ), { isEdgeGesture: f, state: m, containerProps: g } = te({
318
318
  containerRef: e,
319
319
  edge: i,
320
- edgeWidth: o,
321
- enabled: c ? n.canGo(-1) : !1,
320
+ edgeWidth: c,
321
+ enabled: o ? t.canGo(-1) : !1,
322
322
  // Only enable if can go back
323
323
  onSwipeEnd: l
324
324
  });
325
325
  r.useEffect(() => {
326
326
  f && (m.phase === "swiping" || m.phase === "tracking") ? s(m) : m.phase === "idle" && s(null);
327
327
  }, [f, m]);
328
- const { containerProps: a } = re({
328
+ const { containerProps: a } = ne({
329
329
  containerRef: e,
330
330
  active: f,
331
331
  preventEdgeBack: !0,
332
332
  preventOverscroll: !0,
333
- edgeWidth: o
334
- }), g = r.useMemo(() => {
333
+ edgeWidth: c
334
+ }), v = r.useMemo(() => {
335
335
  if (!u || !e.current)
336
336
  return 0;
337
337
  const d = e.current.clientWidth;
@@ -340,224 +340,183 @@ function Ke(t) {
340
340
  const h = u.displacement.x;
341
341
  if (i === "left" && h <= 0 || i === "right" && h >= 0)
342
342
  return 0;
343
- const y = Math.abs(h);
344
- return Math.min(y / d, 1);
345
- }, [u, e, i]), R = r.useMemo(
346
- () => se(v, a),
347
- [v, a]
343
+ const R = Math.abs(h);
344
+ return Math.min(R / d, 1);
345
+ }, [u, e, i]), y = r.useMemo(
346
+ () => re(g, a),
347
+ [g, a]
348
348
  );
349
349
  return {
350
350
  isEdgeSwiping: f,
351
- progress: g,
352
- inputState: f ? m : ie,
353
- containerProps: R
351
+ progress: v,
352
+ inputState: f ? m : se,
353
+ containerProps: y
354
354
  };
355
355
  }
356
- const V = {
357
- /** Ease out expo (similar to cubic-bezier(0.22, 1, 0.36, 1)) */
358
- easeOutExpo: (t) => t === 1 ? 1 : 1 - Math.pow(2, -10 * t)
359
- }, ve = 300;
360
- function ge(t) {
361
- const {
362
- duration: e = ve,
363
- easing: n = V.easeOutExpo,
364
- onFrame: i,
365
- onComplete: o
366
- } = t, [c, u] = r.useState(!1), s = r.useRef(null), l = r.useRef(null), f = r.useRef(i), m = r.useRef(o);
367
- r.useEffect(() => {
368
- f.current = i, m.current = o;
369
- }, [i, o]);
370
- const v = r.useCallback(() => {
371
- s.current !== null && (cancelAnimationFrame(s.current), s.current = null), l.current = null, u(!1);
372
- }, []), a = r.useCallback(() => {
373
- v(), u(!0), l.current = null;
374
- const g = (R) => {
375
- l.current === null && (l.current = R);
376
- const A = R - l.current, d = Math.min(A / e, 1), h = n(d), y = d >= 1, k = {
377
- progress: d,
378
- easedProgress: h,
379
- elapsed: A,
380
- isComplete: y
381
- };
382
- f.current?.(k), y ? (s.current = null, l.current = null, u(!1), m.current?.()) : s.current = requestAnimationFrame(g);
383
- };
384
- s.current = requestAnimationFrame(g);
385
- }, [e, n, v]);
386
- return r.useEffect(() => () => {
387
- s.current !== null && cancelAnimationFrame(s.current);
388
- }, []), {
389
- isAnimating: c,
390
- start: a,
391
- cancel: v
392
- };
393
- }
394
- function Re(t, e, n) {
395
- return t + (e - t) * n;
396
- }
397
- const Ae = 300, B = (t) => t === "horizontal" ? "translateX" : "translateY", ye = (t, e, n, i) => t || e === void 0 || e <= 0 || n === void 0 || n === i ? null : { from: n, to: i }, be = (t, e, n, i, o, c, u) => t === e ? { type: "none" } : i ? { type: "none" } : o ? { type: "none" } : c ? Math.abs(n - t) <= 1 ? { type: "snap", position: t } : u ? n > t ? { type: "snap", position: t } : { type: "animate", animation: { from: n, to: t } } : { type: "animate", animation: { from: n, to: t } } : { type: "snap", position: t }, Ce = (t, e, n) => t === void 0 || t === e || t <= 0 ? null : n;
398
- function ke(t) {
356
+ const ye = 300, B = (n) => n === "horizontal" ? "translateX" : "translateY", Ae = (n, e, t, i) => n || e === void 0 || e <= 0 || t === void 0 || t === i ? null : { from: t, to: i }, Re = (n, e, t, i, c, o, u) => n === e ? { type: "none" } : i ? { type: "none" } : c ? { type: "none" } : o ? Math.abs(t - n) <= 1 ? { type: "snap", position: n } : u ? t > n ? { type: "snap", position: n } : { type: "animate", animation: { from: t, to: n } } : { type: "animate", animation: { from: t, to: n } } : { type: "snap", position: n }, be = (n, e, t) => n === void 0 || n === e || n <= 0 ? null : t;
357
+ function ke(n) {
399
358
  const {
400
359
  elementRef: e,
401
- targetPx: n,
360
+ targetPx: t,
402
361
  displacement: i,
403
- isOperating: o,
404
- axis: c = "horizontal",
405
- animationDuration: u = Ae,
362
+ isOperating: c,
363
+ axis: o = "horizontal",
364
+ animationDuration: u = ye,
406
365
  containerSize: s,
407
366
  animateOnTargetChange: l = !1,
408
367
  initialPx: f,
409
368
  skipTargetChangeAnimation: m = !1
410
- } = t, v = f ?? n, a = r.useRef(v), g = r.useRef(null), R = r.useRef(n), A = r.useRef(s), d = r.useRef(null), h = r.useRef(!1), y = ye(
369
+ } = n, g = f ?? t, a = r.useRef(g), v = r.useRef(null), y = r.useRef(t), A = r.useRef(s), d = r.useRef(null), h = r.useRef(!1), R = Ae(
411
370
  h.current,
412
371
  s,
413
372
  f,
414
- n
373
+ t
415
374
  );
416
- y !== null && (d.current = y, h.current = !0);
417
- const k = be(
418
- n,
419
- R.current,
375
+ R !== null && (d.current = R, h.current = !0);
376
+ const C = Re(
377
+ t,
378
+ y.current,
420
379
  a.current,
421
- o,
422
- g.current !== null,
380
+ c,
381
+ v.current !== null,
423
382
  l,
424
383
  m
425
384
  );
426
- k.type === "animate" ? (d.current = k.animation, R.current = n) : k.type === "snap" && (a.current = k.position, R.current = n);
427
- const M = Ce(
385
+ C.type === "animate" ? (d.current = C.animation, y.current = t) : C.type === "snap" && (a.current = C.position, y.current = t);
386
+ const w = be(
428
387
  s,
429
388
  A.current,
430
- n
389
+ t
431
390
  );
432
- M !== null && (a.current = M, A.current = s);
433
- const w = r.useCallback(
391
+ w !== null && (a.current = w, A.current = s);
392
+ const M = r.useCallback(
434
393
  ({ easedProgress: T }) => {
435
- const D = e.current, I = g.current;
436
- if (!D || !I)
394
+ const S = e.current, D = v.current;
395
+ if (!S || !D)
437
396
  return;
438
- const E = Re(I.from, I.to, T);
439
- a.current = E, D.style.transform = `${B(c)}(${E}px)`;
397
+ const E = ie(D.from, D.to, T);
398
+ a.current = E, S.style.transform = `${B(o)}(${E}px)`;
440
399
  },
441
- [c, e]
400
+ [o, e]
442
401
  ), _ = r.useCallback(() => {
443
- g.current = null, a.current = n, R.current = n;
444
- }, [n]), { isAnimating: F, start: x, cancel: N } = ge({
402
+ v.current = null, a.current = t, y.current = t;
403
+ }, [t]), { isAnimating: $, start: x, cancel: N } = oe({
445
404
  duration: u,
446
- easing: V.easeOutExpo,
447
- onFrame: w,
405
+ easing: ae.easeOutExpo,
406
+ onFrame: M,
448
407
  onComplete: _
449
408
  });
450
409
  return r.useLayoutEffect(() => {
451
- if (o) {
452
- N(), g.current = null, d.current = null;
410
+ if (c) {
411
+ N(), v.current = null, d.current = null;
453
412
  return;
454
413
  }
455
414
  if (d.current) {
456
- const I = d.current;
457
- g.current = I, d.current = null;
415
+ const D = d.current;
416
+ v.current = D, d.current = null;
458
417
  const E = e.current;
459
- E && (E.style.transform = `${B(c)}(${I.from}px)`), x();
418
+ E && (E.style.transform = `${B(o)}(${D.from}px)`), x();
460
419
  return;
461
420
  }
462
421
  const T = a.current;
463
- Math.abs(T - n) > 1 ? (g.current = { from: T, to: n }, x()) : (a.current = n, R.current = n);
464
- }, [o, n, x, N]), r.useLayoutEffect(() => {
422
+ Math.abs(T - t) > 1 ? (v.current = { from: T, to: t }, x()) : (a.current = t, y.current = t);
423
+ }, [c, t, x, N]), r.useLayoutEffect(() => {
465
424
  const T = e.current;
466
- if (!T || F || g.current !== null || d.current !== null)
425
+ if (!T || $ || v.current !== null || d.current !== null)
467
426
  return;
468
- const D = n + i;
469
- a.current = D, T.style.transform = `${B(c)}(${D}px)`;
470
- }, [n, i, c, F, e]), {
471
- isAnimating: F,
427
+ const S = t + i;
428
+ a.current = S, T.style.transform = `${B(o)}(${S}px)`;
429
+ }, [t, i, o, $, e]), {
430
+ isAnimating: $,
472
431
  currentPx: a.current,
473
- animationDirection: g.current
432
+ animationDirection: v.current
474
433
  };
475
434
  }
476
- function Te(t, e) {
477
- const n = r.useRef(e), i = r.useRef(t), o = r.useRef(!1), u = n.current && !e, s = t !== i.current, l = e && s, v = o.current || l || u && s, a = e ? i.current : t;
435
+ function Ce(n, e) {
436
+ const t = r.useRef(e), i = r.useRef(n), c = r.useRef(!1), u = t.current ? !e : !1, s = n !== i.current, l = e ? s : !1, g = (c.current ? !0 : l) ? !0 : u ? s : !1, a = e ? i.current : n;
478
437
  return r.useLayoutEffect(() => {
479
- e ? l && (o.current = !0) : (o.current = !1, i.current = t), n.current = e;
438
+ e ? l && (c.current = !0) : (c.current = !1, i.current = n), t.current = e;
480
439
  }), {
481
440
  value: a,
482
- changedDuringOperation: v,
441
+ changedDuringOperation: g,
483
442
  operationJustEnded: u
484
443
  };
485
444
  }
486
- const K = -0.3;
487
- function De(t) {
488
- return Math.max(0, t);
445
+ const V = -0.3;
446
+ function Te(n) {
447
+ return Math.max(0, n);
489
448
  }
490
- function Ie(t, e, n = K) {
449
+ function Se(n, e, t = V) {
491
450
  if (e <= 0)
492
451
  return 0;
493
- const i = Math.max(0, t), o = Math.min(i / e, 1), c = n * e, u = Math.abs(n) * o * e;
494
- return c + u;
452
+ const i = Math.max(0, n), c = Math.min(i / e, 1), o = t * e, u = Math.abs(t) * c * e;
453
+ return o + u;
495
454
  }
496
- function Se(t) {
497
- const { depth: e, navigationDepth: n, isActive: i, isOperating: o, isAnimating: c } = t;
498
- return !!(i || e === n - 1 && (o || c));
455
+ function De(n) {
456
+ const { depth: e, navigationDepth: t, isActive: i, isOperating: c, isAnimating: o } = n;
457
+ return !!(i || e === t - 1 && (c || o));
499
458
  }
500
- function Ee(t, e) {
501
- return t === e ? "active" : t === e - 1 ? "behind" : "hidden";
459
+ function Ie(n, e) {
460
+ return n === e ? "active" : n === e - 1 ? "behind" : "hidden";
502
461
  }
503
- const Me = 300, we = 0.05, xe = 0.1, Oe = {
462
+ const Ee = 300, we = 0.05, Me = 0.1, xe = {
504
463
  position: "absolute",
505
464
  inset: 0,
506
465
  width: "100%",
507
466
  height: "100%"
508
- }, Pe = (t, e) => t.phase === "idle" ? 0 : e === "horizontal" ? t.displacement.x : t.displacement.y, Ne = "-5px 0 15px rgba(0, 0, 0, 0.1)", _e = r.memo(
467
+ }, Pe = (n, e) => n.phase === "idle" ? 0 : e === "horizontal" ? n.displacement.x : n.displacement.y, Oe = "-5px 0 15px rgba(0, 0, 0, 0.1)", Ne = r.memo(
509
468
  ({
510
- id: t,
469
+ id: n,
511
470
  depth: e,
512
- navigationDepth: n,
471
+ navigationDepth: t,
513
472
  isActive: i,
514
- operationState: o,
515
- containerSize: c,
473
+ operationState: c,
474
+ containerSize: o,
516
475
  axis: u = "horizontal",
517
- behindOffset: s = K,
518
- animationDuration: l = Me,
476
+ behindOffset: s = V,
477
+ animationDuration: l = Ee,
519
478
  animateOnMount: f = !1,
520
479
  showShadow: m = !0,
521
- displayMode: v = "overlay",
480
+ displayMode: g = "overlay",
522
481
  showDimming: a = !0,
523
- children: g
482
+ children: v
524
483
  }) => {
525
- const R = r.useRef(null), A = Pe(o, u), d = o.phase === "operating", h = Ee(e, n), { value: y, changedDuringOperation: k } = Te(
484
+ const y = r.useRef(null), A = Pe(c, u), d = c.phase === "operating", h = Ie(e, t), { value: R, changedDuringOperation: C } = Ce(
526
485
  h,
527
486
  A > 0
528
- ), M = r.useMemo(() => {
529
- switch (y) {
487
+ ), w = r.useMemo(() => {
488
+ switch (R) {
530
489
  case "active":
531
490
  return 0;
532
491
  case "behind":
533
- return s * c;
492
+ return s * o;
534
493
  case "hidden":
535
- return c;
494
+ return o;
536
495
  }
537
- }, [y, s, c]), w = r.useMemo(() => {
496
+ }, [R, s, o]), M = r.useMemo(() => {
538
497
  if (A <= 0)
539
498
  return 0;
540
- switch (y) {
499
+ switch (R) {
541
500
  case "active":
542
- return De(A);
501
+ return Te(A);
543
502
  case "behind": {
544
- const S = Ie(A, c, s), O = s * c;
545
- return S - O;
503
+ const I = Se(A, o, s), P = s * o;
504
+ return I - P;
546
505
  }
547
506
  case "hidden":
548
507
  return 0;
549
508
  }
550
- }, [y, A, c, s]), _ = r.useMemo(() => {
509
+ }, [R, A, o, s]), _ = r.useMemo(() => {
551
510
  if (f && h === "active" && e > 0)
552
- return c;
553
- }, [f, h, e, c]), { isAnimating: F } = ke({
554
- elementRef: R,
555
- targetPx: M,
556
- displacement: w,
511
+ return o;
512
+ }, [f, h, e, o]), { isAnimating: $ } = ke({
513
+ elementRef: y,
514
+ targetPx: w,
515
+ displacement: M,
557
516
  isOperating: d,
558
517
  axis: u,
559
518
  animationDuration: l,
560
- containerSize: c,
519
+ containerSize: o,
561
520
  // Animate when targetPx changes (button navigation)
562
521
  animateOnTargetChange: !0,
563
522
  // For push animation: start from off-screen
@@ -566,108 +525,108 @@ const Me = 300, we = 0.05, xe = 0.1, Oe = {
566
525
  // This handles over-swipe where panel moves beyond 100% and needs to snap back.
567
526
  // useSwipeContentTransform allows forward animations (normal swipe-to-complete)
568
527
  // but skips backward animations (over-swipe snap).
569
- skipTargetChangeAnimation: k
570
- }), x = Se({
528
+ skipTargetChangeAnimation: C
529
+ }), x = De({
571
530
  depth: e,
572
- navigationDepth: n,
531
+ navigationDepth: t,
573
532
  isActive: i,
574
533
  isOperating: d,
575
- isAnimating: F
576
- }), N = r.useMemo(() => c <= 0 || A <= 0 ? 0 : Math.min(A / c, 1), [A, c]), T = r.useMemo(() => {
577
- if (v !== "stack")
534
+ isAnimating: $
535
+ }), N = r.useMemo(() => o <= 0 || A <= 0 ? 0 : Math.min(A / o, 1), [A, o]), T = r.useMemo(() => {
536
+ if (g !== "stack")
578
537
  return 1;
579
- const S = n - e;
538
+ const I = t - e;
580
539
  if (h === "active")
581
540
  return 1;
582
541
  if (h === "behind") {
583
- const O = 1 - S * we;
584
- return O + N * (1 - O);
542
+ const P = 1 - I * we;
543
+ return P + N * (1 - P);
585
544
  }
586
545
  return 1;
587
- }, [v, h, e, n, N]), D = r.useMemo(() => !a || h !== "behind" ? 0 : xe * (1 - N), [a, h, N]);
546
+ }, [g, h, e, t, N]), S = r.useMemo(() => !a || h !== "behind" ? 0 : Me * (1 - N), [a, h, N]);
588
547
  r.useLayoutEffect(() => {
589
- const S = R.current;
590
- S && (S.style.visibility = x ? "visible" : "hidden");
548
+ const I = y.current;
549
+ I && (I.style.visibility = x ? "visible" : "hidden");
591
550
  }, [x]), r.useLayoutEffect(() => {
592
- const S = R.current;
593
- if (!S || v !== "stack")
551
+ const I = y.current;
552
+ if (!I || g !== "stack")
594
553
  return;
595
- const O = S.style.transform;
596
- if (O.includes("translateX")) {
597
- const $ = O.match(/translateX\([^)]+\)/);
598
- $ && (S.style.transform = `${$[0]} scale(${T})`);
554
+ const P = I.style.transform;
555
+ if (P.includes("translateX")) {
556
+ const L = P.match(/translateX\([^)]+\)/);
557
+ L && (I.style.transform = `${L[0]} scale(${T})`);
599
558
  } else
600
- S.style.transform = `scale(${T})`;
601
- }, [T, v]);
602
- const I = m ? e > 0 && h === "active" : !1, E = r.useMemo(
559
+ I.style.transform = `scale(${T})`;
560
+ }, [T, g]);
561
+ const D = m ? e > 0 && h === "active" : !1, E = r.useMemo(
603
562
  () => ({
604
- ...Oe,
563
+ ...xe,
605
564
  pointerEvents: i ? "auto" : "none",
606
565
  willChange: "transform",
607
566
  zIndex: e,
608
567
  visibility: x ? "visible" : "hidden",
609
- boxShadow: I ? Ne : void 0
568
+ boxShadow: D ? Oe : void 0
610
569
  }),
611
- [i, e, x, I]
612
- ), U = r.useMemo(() => D <= 0 ? null : {
570
+ [i, e, x, D]
571
+ ), U = r.useMemo(() => S <= 0 ? null : {
613
572
  position: "absolute",
614
573
  inset: 0,
615
- backgroundColor: `rgba(0, 0, 0, ${D})`,
574
+ backgroundColor: `rgba(0, 0, 0, ${S})`,
616
575
  pointerEvents: "none",
617
576
  zIndex: 1
618
- }, [D]);
619
- return /* @__PURE__ */ q(
577
+ }, [S]);
578
+ return /* @__PURE__ */ j(
620
579
  "div",
621
580
  {
622
- ref: R,
623
- "data-stack-content": t,
581
+ ref: y,
582
+ "data-stack-content": n,
624
583
  "data-depth": e,
625
584
  "data-active": i ? "true" : "false",
626
585
  "data-role": h,
627
586
  style: E,
628
587
  children: [
629
- g,
630
- U != null ? /* @__PURE__ */ P("div", { style: U, "data-dimming-overlay": !0 }) : null
588
+ v,
589
+ U != null ? /* @__PURE__ */ O("div", { style: U, "data-dimming-overlay": !0 }) : null
631
590
  ]
632
591
  }
633
592
  );
634
593
  }
635
- ), Fe = 300;
636
- function $e(t, e, n) {
637
- const { stack: i, depth: o } = e, c = [o];
638
- o > 0 && c.push(o - 1);
594
+ ), _e = 300;
595
+ function $e(n, e, t) {
596
+ const { stack: i, depth: c } = e, o = [c];
597
+ c > 0 && o.push(c - 1);
639
598
  const u = [];
640
- for (const s of c) {
641
- const l = i[s], f = t.find((m) => m.id === l);
599
+ for (const s of o) {
600
+ const l = i[s], f = n.find((m) => m.id === l);
642
601
  f && u.push({ panel: f, depth: s, isExiting: !1 });
643
602
  }
644
- if (n != null && !u.some((l) => l.panel.id === n)) {
645
- const l = t.find((f) => f.id === n);
646
- l && u.push({ panel: l, depth: o + 1, isExiting: !0 });
603
+ if (t != null && !u.some((l) => l.panel.id === t)) {
604
+ const l = n.find((f) => f.id === t);
605
+ l && u.push({ panel: l, depth: c + 1, isExiting: !0 });
647
606
  }
648
607
  return u.sort((s, l) => s.depth - l.depth);
649
608
  }
650
- const We = r.memo(
609
+ const Ke = r.memo(
651
610
  ({
652
- panels: t,
611
+ panels: n,
653
612
  navigationState: e,
654
- operationState: n,
613
+ operationState: t,
655
614
  containerSize: i,
656
- getCachedContent: o,
657
- behindOffset: c,
615
+ getCachedContent: c,
616
+ behindOffset: o,
658
617
  animateOnMount: u = !1,
659
- animationDuration: s = Fe,
618
+ animationDuration: s = _e,
660
619
  showShadow: l,
661
620
  displayMode: f,
662
621
  showDimming: m
663
622
  }) => {
664
- const [v, a] = r.useState(null), g = r.useRef(e.depth), R = r.useRef(e.stack);
623
+ const [g, a] = r.useState(null), v = r.useRef(e.depth), y = r.useRef(e.stack);
665
624
  r.useLayoutEffect(() => {
666
- const h = g.current, y = R.current, { depth: k, stack: M } = e;
667
- if (g.current = k, R.current = M, k < h) {
668
- const w = y[h];
669
- if (w != null) {
670
- a(w);
625
+ const h = v.current, R = y.current, { depth: C, stack: w } = e;
626
+ if (v.current = C, y.current = w, C < h) {
627
+ const M = R[h];
628
+ if (M != null) {
629
+ a(M);
671
630
  const _ = setTimeout(() => {
672
631
  a(null);
673
632
  }, s);
@@ -676,8 +635,8 @@ const We = r.memo(
676
635
  }
677
636
  }, [e.depth, e.stack, s]);
678
637
  const A = r.useMemo(
679
- () => $e(t, e, v),
680
- [t, e, v]
638
+ () => $e(n, e, g),
639
+ [n, e, g]
681
640
  ), d = r.useMemo(
682
641
  () => ({
683
642
  position: "relative",
@@ -687,24 +646,24 @@ const We = r.memo(
687
646
  }),
688
647
  []
689
648
  );
690
- return /* @__PURE__ */ P("div", { style: d, "data-swipe-stack-container": !0, children: A.map(({ panel: h, depth: y, isExiting: k }) => {
691
- const M = y === e.depth && !k, w = o?.(h.id) ?? h.content;
692
- return /* @__PURE__ */ P(
693
- _e,
649
+ return /* @__PURE__ */ O("div", { style: d, "data-swipe-stack-container": !0, children: A.map(({ panel: h, depth: R, isExiting: C }) => {
650
+ const w = R === e.depth && !C, M = c?.(h.id) ?? h.content;
651
+ return /* @__PURE__ */ O(
652
+ Ne,
694
653
  {
695
654
  id: h.id,
696
- depth: y,
655
+ depth: R,
697
656
  navigationDepth: e.depth,
698
- isActive: M,
699
- operationState: n,
657
+ isActive: w,
658
+ operationState: t,
700
659
  containerSize: i,
701
- behindOffset: c,
660
+ behindOffset: o,
702
661
  animateOnMount: u,
703
662
  animationDuration: s,
704
663
  showShadow: l,
705
664
  displayMode: f,
706
665
  showDimming: m,
707
- children: w
666
+ children: M
708
667
  },
709
668
  h.id
710
669
  );
@@ -712,10 +671,10 @@ const We = r.memo(
712
671
  }
713
672
  );
714
673
  export {
715
- de as StackContent,
716
- _e as SwipeStackContent,
717
- We as SwipeStackOutlet,
718
- Ve as useStackNavigation,
719
- Ke as useStackSwipeInput
674
+ he as StackContent,
675
+ Ne as SwipeStackContent,
676
+ Ke as SwipeStackOutlet,
677
+ Ge as useStackNavigation,
678
+ Ve as useStackSwipeInput
720
679
  };
721
680
  //# sourceMappingURL=stack.js.map