@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.
@@ -7,12 +7,12 @@
7
7
  CJS Build start
8
8
  ESM Build start
9
9
  DTS Build start
10
- CJS dist/index.cjs 547.43 KB
10
+ CJS dist/index.cjs 548.39 KB
11
11
  CJS dist/index.cjs.map 1.06 MB
12
- CJS ⚡️ Build success in 7630ms
13
- ESM dist/index.js 517.29 KB
12
+ CJS ⚡️ Build success in 8017ms
13
+ ESM dist/index.js 518.18 KB
14
14
  ESM dist/index.js.map 1.06 MB
15
- ESM ⚡️ Build success in 7630ms
16
- DTS ⚡️ Build success in 22133ms
17
- DTS dist/index.d.cts 101.81 KB
18
- DTS dist/index.d.ts 101.81 KB
15
+ ESM ⚡️ Build success in 8017ms
16
+ DTS ⚡️ Build success in 22080ms
17
+ DTS dist/index.d.cts 102.08 KB
18
+ DTS dist/index.d.ts 102.08 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 0.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d90784c: ensure drawers sit above keyboard
8
+
3
9
  ## 0.20.0
4
10
 
5
11
  ### Minor Changes
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, { children, contentContainerStyle } = _b, props = __objRest(_b, ["children", "contentContainerStyle"]);
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;