@gryt/ui-native 0.8.0 → 0.8.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../../src/components/Sheet/Sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAyB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAerF,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAE7D;AAeD,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,IAAI,CAAC,EACZ,UAAoB,EACpB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,UAAU,+BAqBZ;AAWD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AACH,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,+BAOtD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B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AAE,iBAAiB,+BA0MtD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,+BAOlD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,+BAiBlD;AAED,eAAO,MAAM,KAAK;;;;;CAA0D,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { Pressable, Text, View } from "react-native";
|
|
|
4
4
|
import { BottomSheetBackdrop, BottomSheetModal, BottomSheetModalProvider, BottomSheetView, useBottomSheetTimingConfigs, } from "@gorhom/bottom-sheet";
|
|
5
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
6
|
import { grytDrawerBleed } from "@gryt/theme";
|
|
7
|
-
import { durations,
|
|
7
|
+
import { durations, easeSpringTight } from "../../motion/index.js";
|
|
8
8
|
import { useOpenState } from "../../overlay/useOpenState.js";
|
|
9
9
|
import { useTheme } from "../../theme/index.js";
|
|
10
10
|
/** Mount once, at the root. See the note above for why it is required. */
|
|
@@ -147,10 +147,22 @@ function Content({ children, style }) {
|
|
|
147
147
|
* bottom edge and covers nearly all of it. The same duration over a longer
|
|
148
148
|
* distance is a faster animation, and at 700 this arrived quickly enough to
|
|
149
149
|
* read as a snap rather than a slide.
|
|
150
|
+
*
|
|
151
|
+
* **`easeSpringTight`, not `easeSpring`.** This used the loose curve and
|
|
152
|
+
* bounced, and the two are labelled in `easing.ts` in a way that decides it:
|
|
153
|
+
* `easeSpring` "overshoots ~12%, for things that scale in place", and
|
|
154
|
+
* `easeSpringTight` is "critically damped, no overshoot, for things that
|
|
155
|
+
* travel inside bounds". A sheet sliding up from the bottom edge to a snap
|
|
156
|
+
* point is the second thing, not the first — so this was the wrong curve by
|
|
157
|
+
* the package's own rule, and it is the curve the Drawer already uses.
|
|
158
|
+
*
|
|
159
|
+
* Overshoot on a sheet is worse than on a button, too: the thing that
|
|
160
|
+
* overshoots is the top edge, so it travels past its snap point and comes
|
|
161
|
+
* back, which reads as the sheet failing to land rather than as bounce.
|
|
150
162
|
*/
|
|
151
163
|
const animationConfigs = useBottomSheetTimingConfigs({
|
|
152
164
|
duration: durations.springSlow,
|
|
153
|
-
easing:
|
|
165
|
+
easing: easeSpringTight,
|
|
154
166
|
});
|
|
155
167
|
const renderBackdrop = useCallback((props) => (_jsx(BottomSheetBackdrop, { ...props, appearsOnIndex: 0, disappearsOnIndex: -1,
|
|
156
168
|
// Tracks the drag, so dragging the sheet down lightens the scrim
|