@butternutbox/pawprint-native 0.20.0 → 0.21.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 +7 -7
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +33 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +33 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/Drawer/DrawerBody.tsx +17 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDrawerKeyboardAvoidance.ts +29 -0
- package/src/index.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
[34mCJS[39m Build start
|
|
8
8
|
[34mESM[39m Build start
|
|
9
9
|
[34mDTS[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
10
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m548.39 KB[39m
|
|
11
11
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.06 MB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 8017ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m518.18 KB[39m
|
|
14
14
|
[32mESM[39m [1mdist/index.js.map [22m[32m1.06 MB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 8017ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 22080ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m102.08 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m102.08 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -6298,6 +6298,26 @@ var DrawerDescription = React66__default.default.forwardRef(
|
|
|
6298
6298
|
}
|
|
6299
6299
|
);
|
|
6300
6300
|
DrawerDescription.displayName = "Drawer.Description";
|
|
6301
|
+
var useDrawerKeyboardAvoidance = (minPadding = 16) => {
|
|
6302
|
+
const [keyboardHeight, setKeyboardHeight] = React66.useState(0);
|
|
6303
|
+
React66.useEffect(() => {
|
|
6304
|
+
const showListener = reactNative.Keyboard.addListener("keyboardDidShow", (e) => {
|
|
6305
|
+
setKeyboardHeight(e.endCoordinates.height);
|
|
6306
|
+
});
|
|
6307
|
+
const hideListener = reactNative.Keyboard.addListener("keyboardDidHide", () => {
|
|
6308
|
+
setKeyboardHeight(0);
|
|
6309
|
+
});
|
|
6310
|
+
return () => {
|
|
6311
|
+
showListener.remove();
|
|
6312
|
+
hideListener.remove();
|
|
6313
|
+
};
|
|
6314
|
+
}, []);
|
|
6315
|
+
return {
|
|
6316
|
+
contentContainerStyle: {
|
|
6317
|
+
paddingBottom: Math.max(minPadding, keyboardHeight)
|
|
6318
|
+
}
|
|
6319
|
+
};
|
|
6320
|
+
};
|
|
6301
6321
|
var parseTokenValue27 = (value) => parseFloat(value);
|
|
6302
6322
|
var StyledScrollView = styled51__default.default(reactNative.ScrollView)(
|
|
6303
6323
|
({
|
|
@@ -6319,7 +6339,15 @@ var StyledScrollView = styled51__default.default(reactNative.ScrollView)(
|
|
|
6319
6339
|
);
|
|
6320
6340
|
var DrawerBody = React66__default.default.forwardRef(
|
|
6321
6341
|
(_a, ref) => {
|
|
6322
|
-
var _b = _a, {
|
|
6342
|
+
var _b = _a, {
|
|
6343
|
+
children,
|
|
6344
|
+
contentContainerStyle,
|
|
6345
|
+
ignoreKeyboardAvoidance = false
|
|
6346
|
+
} = _b, props = __objRest(_b, [
|
|
6347
|
+
"children",
|
|
6348
|
+
"contentContainerStyle",
|
|
6349
|
+
"ignoreKeyboardAvoidance"
|
|
6350
|
+
]);
|
|
6323
6351
|
const theme2 = react.useTheme();
|
|
6324
6352
|
const { spacing } = theme2.tokens.components.drawer;
|
|
6325
6353
|
const { buttons } = theme2.tokens.components;
|
|
@@ -6329,6 +6357,8 @@ var DrawerBody = React66__default.default.forwardRef(
|
|
|
6329
6357
|
const providedMaxHeight = useDrawerBodyMax();
|
|
6330
6358
|
const { height: windowHeight } = reactNative.useWindowDimensions();
|
|
6331
6359
|
const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
|
|
6360
|
+
const { contentContainerStyle: keyboardStyle } = useDrawerKeyboardAvoidance();
|
|
6361
|
+
const effectiveKeyboardStyle = ignoreKeyboardAvoidance ? {} : keyboardStyle;
|
|
6332
6362
|
const gap = parseTokenValue27(content.slot.gap);
|
|
6333
6363
|
const horizontalPadding = parseTokenValue27(content.slot.horizontalPadding);
|
|
6334
6364
|
const topPadding = parseTokenValue27(content.slot.verticalPadding);
|
|
@@ -6352,6 +6382,7 @@ var DrawerBody = React66__default.default.forwardRef(
|
|
|
6352
6382
|
paddingTop: topPadding,
|
|
6353
6383
|
paddingBottom: 0
|
|
6354
6384
|
},
|
|
6385
|
+
effectiveKeyboardStyle,
|
|
6355
6386
|
contentContainerStyle
|
|
6356
6387
|
]
|
|
6357
6388
|
}, props), {
|
|
@@ -12505,6 +12536,7 @@ exports.slideInAnimation = slideInAnimation;
|
|
|
12505
12536
|
exports.slideOutAnimation = slideOutAnimation;
|
|
12506
12537
|
exports.theme = theme;
|
|
12507
12538
|
exports.useCopyField = useCopyField;
|
|
12539
|
+
exports.useDrawerKeyboardAvoidance = useDrawerKeyboardAvoidance;
|
|
12508
12540
|
exports.usePasswordField = usePasswordField;
|
|
12509
12541
|
exports.usePawprint = usePawprint;
|
|
12510
12542
|
exports.useSearchField = useSearchField;
|