@butternutbox/pawprint-native 0.12.0 → 0.13.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 527.12 KB
11
- CJS dist/index.cjs.map 1.00 MB
12
- CJS ⚡️ Build success in 7832ms
13
- ESM dist/index.js 497.76 KB
14
- ESM dist/index.js.map 1.00 MB
15
- ESM ⚡️ Build success in 7831ms
16
- DTS ⚡️ Build success in 23575ms
17
- DTS dist/index.d.cts 94.46 KB
18
- DTS dist/index.d.ts 94.46 KB
10
+ ESM dist/index.js 498.51 KB
11
+ ESM dist/index.js.map 1.01 MB
12
+ ESM ⚡️ Build success in 7655ms
13
+ CJS dist/index.cjs 527.91 KB
14
+ CJS dist/index.cjs.map 1.01 MB
15
+ CJS ⚡️ Build success in 7657ms
16
+ DTS ⚡️ Build success in 21826ms
17
+ DTS dist/index.d.cts 94.97 KB
18
+ DTS dist/index.d.ts 94.97 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3637663: `CheckboxGroup` with `orientation="horizontal"` now wraps its tiles onto multiple rows and makes them hug their content, so checkbox tiles can sit side by side. Adds a `fitContent` prop to `Checkbox` (tile only) to opt into content-hugging width — the horizontal group sets it automatically. Vertical groups and standalone checkboxes are unchanged.
8
+
3
9
  ## 0.12.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -6367,6 +6367,7 @@ var StyledRootPressable = styled51__default.default(reactNative.Pressable)(
6367
6367
  rootPaddingVertical,
6368
6368
  rootPaddingHorizontal,
6369
6369
  rootMaxWidth,
6370
+ rootFitContent,
6370
6371
  rootBgColor,
6371
6372
  rootBorderWidth,
6372
6373
  rootBorderColor,
@@ -6376,7 +6377,7 @@ var StyledRootPressable = styled51__default.default(reactNative.Pressable)(
6376
6377
  alignItems: rootFlexAlign,
6377
6378
  gap: rootGap,
6378
6379
  opacity: rootOpacity
6379
- }, rootPaddingVertical !== void 0 ? { paddingVertical: rootPaddingVertical } : {}), rootPaddingHorizontal !== void 0 ? { paddingHorizontal: rootPaddingHorizontal } : {}), rootMaxWidth !== void 0 ? { maxWidth: rootMaxWidth, width: "100%" } : {}), rootBgColor ? { backgroundColor: rootBgColor } : {}), rootBorderWidth !== void 0 ? { borderWidth: rootBorderWidth, borderColor: rootBorderColor } : {}), rootBorderRadius !== void 0 ? { borderRadius: rootBorderRadius } : {})
6380
+ }, 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 } : {})
6380
6381
  );
6381
6382
  var StyledControl = styled51__default.default(reactNative.View)(
6382
6383
  ({
@@ -6397,10 +6398,10 @@ var StyledControl = styled51__default.default(reactNative.View)(
6397
6398
  justifyContent: "center"
6398
6399
  })
6399
6400
  );
6400
- var StyledContent2 = styled51__default.default(reactNative.View)(({ contentGap }) => ({
6401
+ var StyledContent2 = styled51__default.default(reactNative.View)(({ contentGap, contentFlex }) => ({
6401
6402
  flexDirection: "column",
6402
6403
  gap: contentGap,
6403
- flex: 1,
6404
+ flex: contentFlex,
6404
6405
  minWidth: 0
6405
6406
  }));
6406
6407
  var StyledIllustration = styled51__default.default(reactNative.View)(({ illustrationSize }) => ({
@@ -6420,6 +6421,7 @@ var Checkbox = React66__default.default.forwardRef(
6420
6421
  defaultChecked = false,
6421
6422
  onCheckedChange,
6422
6423
  disabled = false,
6424
+ fitContent = false,
6423
6425
  style
6424
6426
  } = _b, rest = __objRest(_b, [
6425
6427
  "variant",
@@ -6430,6 +6432,7 @@ var Checkbox = React66__default.default.forwardRef(
6430
6432
  "defaultChecked",
6431
6433
  "onCheckedChange",
6432
6434
  "disabled",
6435
+ "fitContent",
6433
6436
  "style"
6434
6437
  ]);
6435
6438
  const theme2 = react.useTheme();
@@ -6464,6 +6467,7 @@ var Checkbox = React66__default.default.forwardRef(
6464
6467
  rootPaddingVertical: isTile ? parseTokenValue31(checkbox.checkboxTile.spacing.verticalPadding) : void 0,
6465
6468
  rootPaddingHorizontal: isTile ? parseTokenValue31(checkbox.checkboxTile.spacing.horizontalPadding) : void 0,
6466
6469
  rootMaxWidth: isTile ? parseTokenValue31(checkbox.checkboxTile.size.maxWidth) : void 0,
6470
+ rootFitContent: isTile && fitContent,
6467
6471
  rootBgColor: isTile ? isChecked ? checkbox.checkboxTile.colour.background.selected : checkbox.checkboxTile.colour.background.default : void 0,
6468
6472
  rootBorderWidth: isTile ? parseTokenValue31(checkbox.checkboxTile.borderWidth.default) : void 0,
6469
6473
  rootBorderColor: isTile ? isChecked ? checkbox.checkboxTile.colour.border.selected : checkbox.checkboxTile.colour.border.default : void 0,
@@ -6486,6 +6490,7 @@ var Checkbox = React66__default.default.forwardRef(
6486
6490
  StyledContent2,
6487
6491
  {
6488
6492
  contentGap: parseTokenValue31(checkbox.spacing.content.gap),
6493
+ contentFlex: isTile && fitContent ? 0 : 1,
6489
6494
  children: [
6490
6495
  label && /* @__PURE__ */ jsxRuntime.jsx(
6491
6496
  Typography,
@@ -6522,23 +6527,35 @@ var Checkbox = React66__default.default.forwardRef(
6522
6527
  );
6523
6528
  Checkbox.displayName = "Checkbox";
6524
6529
  var parseTokenValue32 = (value) => parseFloat(value);
6525
- var StyledGroup = styled51__default.default(reactNative.View)(({ groupDirection, groupGap }) => ({
6530
+ var StyledGroup = styled51__default.default(reactNative.View)(({ groupDirection, groupGap, groupWrap }) => ({
6526
6531
  flexDirection: groupDirection,
6527
- gap: groupGap
6532
+ gap: groupGap,
6533
+ flexWrap: groupWrap ? "wrap" : "nowrap"
6528
6534
  }));
6529
6535
  var CheckboxGroup = React66__default.default.forwardRef(
6530
6536
  (_a, ref) => {
6531
6537
  var _b = _a, { orientation = "vertical", children } = _b, rest = __objRest(_b, ["orientation", "children"]);
6532
6538
  const theme2 = react.useTheme();
6533
6539
  const { checkbox } = theme2.tokens.components;
6540
+ const isHorizontal = orientation === "horizontal";
6541
+ const renderChildren = () => isHorizontal ? React66__default.default.Children.map(children, (child) => {
6542
+ var _a2;
6543
+ if (!React66__default.default.isValidElement(child)) return child;
6544
+ const childProps = child.props;
6545
+ return React66__default.default.cloneElement(
6546
+ child,
6547
+ { fitContent: (_a2 = childProps.fitContent) != null ? _a2 : true }
6548
+ );
6549
+ }) : children;
6534
6550
  return /* @__PURE__ */ jsxRuntime.jsx(
6535
6551
  StyledGroup,
6536
6552
  __spreadProps(__spreadValues({
6537
6553
  ref,
6538
- groupDirection: orientation === "horizontal" ? "row" : "column",
6539
- groupGap: parseTokenValue32(checkbox.spacing.gap)
6554
+ groupDirection: isHorizontal ? "row" : "column",
6555
+ groupGap: parseTokenValue32(checkbox.spacing.gap),
6556
+ groupWrap: isHorizontal
6540
6557
  }, rest), {
6541
- children
6558
+ children: renderChildren()
6542
6559
  })
6543
6560
  );
6544
6561
  }