@butternutbox/pawprint-native 0.20.0 → 0.22.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
11
- CJS dist/index.cjs.map 1.06 MB
12
- CJS ⚡️ Build success in 7630ms
13
- ESM dist/index.js 517.29 KB
10
+ ESM dist/index.js 518.12 KB
14
11
  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
12
+ ESM ⚡️ Build success in 7711ms
13
+ CJS dist/index.cjs 548.33 KB
14
+ CJS dist/index.cjs.map 1.06 MB
15
+ CJS ⚡️ Build success in 7715ms
16
+ DTS ⚡️ Build success in 22565ms
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,17 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 19b56fb: Allow checkbox content to drop to multiple lines
8
+
9
+ ## 0.21.0
10
+
11
+ ### Minor Changes
12
+
13
+ - d90784c: ensure drawers sit above keyboard
14
+
3
15
  ## 0.20.0
4
16
 
5
17
  ### 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), {
@@ -6702,7 +6733,7 @@ var StyledRootPressable = styled51__default.default(reactNative.Pressable)(
6702
6733
  alignItems: rootFlexAlign,
6703
6734
  gap: rootGap,
6704
6735
  opacity: rootOpacity
6705
- }, rootPaddingVertical !== void 0 ? { paddingVertical: rootPaddingVertical } : {}), rootPaddingHorizontal !== void 0 ? { paddingHorizontal: rootPaddingHorizontal } : {}), rootMaxWidth !== void 0 ? rootFitContent ? { maxWidth: rootMaxWidth, alignSelf: "flex-start" } : { maxWidth: rootMaxWidth, width: "100%" } : {}), rootBgColor ? { backgroundColor: rootBgColor } : {}), rootBorderWidth !== void 0 ? { borderWidth: rootBorderWidth, borderColor: rootBorderColor } : {}), rootBorderRadius !== void 0 ? { borderRadius: rootBorderRadius } : {})
6736
+ }, rootPaddingVertical !== void 0 ? { paddingVertical: rootPaddingVertical } : {}), rootPaddingHorizontal !== void 0 ? { paddingHorizontal: rootPaddingHorizontal } : {}), rootMaxWidth !== void 0 ? rootFitContent ? { maxWidth: rootMaxWidth, alignSelf: "flex-start" } : { maxWidth: rootMaxWidth, width: "100%" } : { width: "100%" }), rootBgColor ? { backgroundColor: rootBgColor } : {}), rootBorderWidth !== void 0 ? { borderWidth: rootBorderWidth, borderColor: rootBorderColor } : {}), rootBorderRadius !== void 0 ? { borderRadius: rootBorderRadius } : {})
6706
6737
  );
6707
6738
  var StyledControl = styled51__default.default(reactNative.View)(
6708
6739
  ({
@@ -6723,10 +6754,10 @@ var StyledControl = styled51__default.default(reactNative.View)(
6723
6754
  justifyContent: "center"
6724
6755
  })
6725
6756
  );
6726
- var StyledContent2 = styled51__default.default(reactNative.View)(({ contentGap, contentFlex }) => ({
6757
+ var StyledContent2 = styled51__default.default(reactNative.View)(({ contentGap }) => ({
6727
6758
  flexDirection: "column",
6728
6759
  gap: contentGap,
6729
- flex: contentFlex,
6760
+ flex: 1,
6730
6761
  minWidth: 0
6731
6762
  }));
6732
6763
  var StyledIllustration = styled51__default.default(reactNative.View)(({ illustrationSize }) => ({
@@ -6815,7 +6846,6 @@ var Checkbox = React66__default.default.forwardRef(
6815
6846
  StyledContent2,
6816
6847
  {
6817
6848
  contentGap: parseTokenValue31(checkbox.spacing.content.gap),
6818
- contentFlex: isTile && fitContent ? 0 : 1,
6819
6849
  children: [
6820
6850
  label && /* @__PURE__ */ jsxRuntime.jsx(
6821
6851
  Typography,
@@ -12505,6 +12535,7 @@ exports.slideInAnimation = slideInAnimation;
12505
12535
  exports.slideOutAnimation = slideOutAnimation;
12506
12536
  exports.theme = theme;
12507
12537
  exports.useCopyField = useCopyField;
12538
+ exports.useDrawerKeyboardAvoidance = useDrawerKeyboardAvoidance;
12508
12539
  exports.usePasswordField = usePasswordField;
12509
12540
  exports.usePawprint = usePawprint;
12510
12541
  exports.useSearchField = useSearchField;