@butternutbox/pawprint-native 0.3.1 → 0.3.2
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 +14 -14
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs +483 -477
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +483 -477
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/Button/Button.tsx +4 -1
- package/src/components/molecules/Drawer/DrawerBody.tsx +12 -24
package/package.json
CHANGED
|
@@ -212,7 +212,10 @@ const Button = React.forwardRef<View, ButtonProps>(
|
|
|
212
212
|
buttonPaddingHorizontal={parseTokenValue(
|
|
213
213
|
spacingTokens.horizontalPadding
|
|
214
214
|
)}
|
|
215
|
-
buttonPaddingVertical={
|
|
215
|
+
buttonPaddingVertical={
|
|
216
|
+
parseTokenValue(spacingTokens.verticalPadding) -
|
|
217
|
+
(variantStyles.borderWidth ?? 0)
|
|
218
|
+
}
|
|
216
219
|
buttonGap={parseTokenValue(spacingTokens.gap)}
|
|
217
220
|
buttonBorderRadius={parseTokenValue(buttons.borderRadius.default)}
|
|
218
221
|
buttonBgColor={variantStyles.backgroundColor}
|
|
@@ -2,9 +2,7 @@ import React from "react"
|
|
|
2
2
|
import { ScrollView, ScrollViewProps } 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"
|
|
6
5
|
import { useDrawerHeaderContext } from "./DrawerHeaderContext"
|
|
7
|
-
import { useDrawerFooterContext } from "./DrawerFooterContext"
|
|
8
6
|
|
|
9
7
|
export type DrawerBodyProps = ScrollViewProps
|
|
10
8
|
|
|
@@ -14,22 +12,12 @@ const StyledScrollView = styled(ScrollView)<{
|
|
|
14
12
|
bodyPaddingHorizontal: number
|
|
15
13
|
bodyPaddingRight: number
|
|
16
14
|
bodyGap: number
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
bodyPaddingVertical
|
|
24
|
-
}) => ({
|
|
25
|
-
flexGrow: 1,
|
|
26
|
-
flexShrink: 1,
|
|
27
|
-
paddingLeft: bodyPaddingHorizontal,
|
|
28
|
-
paddingRight: bodyPaddingRight,
|
|
29
|
-
gap: bodyGap,
|
|
30
|
-
paddingTop: bodyPaddingVertical
|
|
31
|
-
})
|
|
32
|
-
)
|
|
15
|
+
}>(({ bodyPaddingHorizontal, bodyPaddingRight, bodyGap }) => ({
|
|
16
|
+
flex: 1,
|
|
17
|
+
paddingLeft: bodyPaddingHorizontal,
|
|
18
|
+
paddingRight: bodyPaddingRight,
|
|
19
|
+
gap: bodyGap
|
|
20
|
+
}))
|
|
33
21
|
|
|
34
22
|
/**
|
|
35
23
|
* Scrollable content area of the drawer. Grows to fill available space
|
|
@@ -42,13 +30,10 @@ export const DrawerBody = React.forwardRef<ScrollView, DrawerBodyProps>(
|
|
|
42
30
|
const { buttons } = theme.tokens.components
|
|
43
31
|
const { content } = spacing
|
|
44
32
|
const headerContext = useDrawerHeaderContext()
|
|
45
|
-
const hasFooter = useDrawerFooterContext()
|
|
46
|
-
const insets = useSafeAreaInsets()
|
|
47
33
|
|
|
48
34
|
const gap = parseTokenValue(content.slot.gap)
|
|
49
|
-
const verticalPadding = parseTokenValue(content.slot.verticalPadding)
|
|
50
|
-
const bottomPadding = verticalPadding + (hasFooter ? 0 : insets.bottom)
|
|
51
35
|
const horizontalPadding = parseTokenValue(content.slot.horizontalPadding)
|
|
36
|
+
const topPadding = parseTokenValue(content.slot.verticalPadding)
|
|
52
37
|
|
|
53
38
|
// When there's no header the close button floats in the top-right corner.
|
|
54
39
|
// Reserve space on the right so body content doesn't slide under it.
|
|
@@ -64,9 +49,12 @@ export const DrawerBody = React.forwardRef<ScrollView, DrawerBodyProps>(
|
|
|
64
49
|
bodyPaddingHorizontal={horizontalPadding}
|
|
65
50
|
bodyPaddingRight={paddingRight}
|
|
66
51
|
bodyGap={gap}
|
|
67
|
-
bodyPaddingVertical={verticalPadding}
|
|
68
52
|
contentContainerStyle={[
|
|
69
|
-
{
|
|
53
|
+
{
|
|
54
|
+
gap,
|
|
55
|
+
paddingTop: topPadding,
|
|
56
|
+
paddingBottom: 0
|
|
57
|
+
},
|
|
70
58
|
contentContainerStyle
|
|
71
59
|
]}
|
|
72
60
|
{...props}
|