@butternutbox/pawprint-native 0.18.0 → 0.19.0
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/Drawer/DrawerBody.tsx +11 -1
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react"
|
|
|
2
2
|
import { ScrollView, ScrollViewProps, useWindowDimensions } from "react-native"
|
|
3
3
|
import styled from "@emotion/native"
|
|
4
4
|
import { useTheme } from "@emotion/react"
|
|
5
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context"
|
|
5
6
|
import { useDrawerHeaderContext } from "./DrawerHeaderContext"
|
|
6
7
|
import { useDrawerFooterContext } from "./DrawerFooterContext"
|
|
7
8
|
import { useDrawerBodyMax } from "./DrawerBodyMaxContext"
|
|
@@ -48,6 +49,7 @@ export const DrawerBody = React.forwardRef<ScrollView, DrawerBodyProps>(
|
|
|
48
49
|
const footerContext = useDrawerFooterContext()
|
|
49
50
|
const providedMaxHeight = useDrawerBodyMax()
|
|
50
51
|
const { height: windowHeight } = useWindowDimensions()
|
|
52
|
+
const insets = useSafeAreaInsets()
|
|
51
53
|
|
|
52
54
|
const gap = parseTokenValue(content.slot.gap)
|
|
53
55
|
const horizontalPadding = parseTokenValue(content.slot.horizontalPadding)
|
|
@@ -66,8 +68,16 @@ export const DrawerBody = React.forwardRef<ScrollView, DrawerBodyProps>(
|
|
|
66
68
|
parseTokenValue(buttons.size.sm.height)
|
|
67
69
|
: horizontalPadding
|
|
68
70
|
|
|
71
|
+
// With no footer, the body is the last element in the panel, so it must
|
|
72
|
+
// clear the bottom safe area (home indicator / Android nav bar) itself —
|
|
73
|
+
// DrawerFooter does this when present. Use the larger of the standard 2xl
|
|
74
|
+
// content pad and the safe-area inset so short insets (iOS) keep the usual
|
|
75
|
+
// spacing while a taller inset (Android nav bar) isn't clipped.
|
|
69
76
|
const bodyPaddingBottom = !footerContext
|
|
70
|
-
?
|
|
77
|
+
? Math.max(
|
|
78
|
+
parseTokenValue(theme.tokens.semantics.dimensions.spacing["2xl"]),
|
|
79
|
+
insets.bottom
|
|
80
|
+
)
|
|
71
81
|
: 0
|
|
72
82
|
|
|
73
83
|
return (
|