@butternutbox/pawprint-native 0.8.0 → 0.9.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/dist/index.d.cts CHANGED
@@ -2070,16 +2070,11 @@ type ProductDisplayCardProps = ViewProps & {
2070
2070
  showQuantityPicker?: boolean;
2071
2071
  disableQuantityButtons?: boolean;
2072
2072
  hideQuantityButtons?: boolean;
2073
- showIncrementButton?: boolean;
2074
- showDecrementButton?: boolean;
2075
2073
  incrementDisabled?: boolean;
2076
2074
  decrementDisabled?: boolean;
2077
2075
  image?: string | React.ReactNode;
2078
2076
  imageBackgroundColor?: string;
2079
2077
  thumbnailWidth?: number;
2080
- thumbnailBackgroundColor?: string;
2081
- showImageQuantityBadge?: boolean;
2082
- borderless?: boolean;
2083
2078
  banner?: React.ReactNode;
2084
2079
  showBanner?: boolean;
2085
2080
  bannerType?: "error" | "success" | "warning" | "info";
@@ -2121,16 +2116,11 @@ declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
2121
2116
  showQuantityPicker?: boolean;
2122
2117
  disableQuantityButtons?: boolean;
2123
2118
  hideQuantityButtons?: boolean;
2124
- showIncrementButton?: boolean;
2125
- showDecrementButton?: boolean;
2126
2119
  incrementDisabled?: boolean;
2127
2120
  decrementDisabled?: boolean;
2128
2121
  image?: string | React.ReactNode;
2129
2122
  imageBackgroundColor?: string;
2130
2123
  thumbnailWidth?: number;
2131
- thumbnailBackgroundColor?: string;
2132
- showImageQuantityBadge?: boolean;
2133
- borderless?: boolean;
2134
2124
  banner?: React.ReactNode;
2135
2125
  showBanner?: boolean;
2136
2126
  bannerType?: "error" | "success" | "warning" | "info";
package/dist/index.d.ts CHANGED
@@ -2070,16 +2070,11 @@ type ProductDisplayCardProps = ViewProps & {
2070
2070
  showQuantityPicker?: boolean;
2071
2071
  disableQuantityButtons?: boolean;
2072
2072
  hideQuantityButtons?: boolean;
2073
- showIncrementButton?: boolean;
2074
- showDecrementButton?: boolean;
2075
2073
  incrementDisabled?: boolean;
2076
2074
  decrementDisabled?: boolean;
2077
2075
  image?: string | React.ReactNode;
2078
2076
  imageBackgroundColor?: string;
2079
2077
  thumbnailWidth?: number;
2080
- thumbnailBackgroundColor?: string;
2081
- showImageQuantityBadge?: boolean;
2082
- borderless?: boolean;
2083
2078
  banner?: React.ReactNode;
2084
2079
  showBanner?: boolean;
2085
2080
  bannerType?: "error" | "success" | "warning" | "info";
@@ -2121,16 +2116,11 @@ declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
2121
2116
  showQuantityPicker?: boolean;
2122
2117
  disableQuantityButtons?: boolean;
2123
2118
  hideQuantityButtons?: boolean;
2124
- showIncrementButton?: boolean;
2125
- showDecrementButton?: boolean;
2126
2119
  incrementDisabled?: boolean;
2127
2120
  decrementDisabled?: boolean;
2128
2121
  image?: string | React.ReactNode;
2129
2122
  imageBackgroundColor?: string;
2130
2123
  thumbnailWidth?: number;
2131
- thumbnailBackgroundColor?: string;
2132
- showImageQuantityBadge?: boolean;
2133
- borderless?: boolean;
2134
2124
  banner?: React.ReactNode;
2135
2125
  showBanner?: boolean;
2136
2126
  bannerType?: "error" | "success" | "warning" | "info";
package/dist/index.js CHANGED
@@ -14242,8 +14242,8 @@ var BadgeContainer = styled51(View)(({ theme: theme2 }) => {
14242
14242
  alignItems: "center",
14243
14243
  justifyContent: "center",
14244
14244
  height: parseTokenValue55(sizing["2xl"]),
14245
- paddingRight: parseTokenValue55(spacing.sm),
14246
- backgroundColor: colour.background.container.alt,
14245
+ paddingRight: parseTokenValue55(spacing.xs),
14246
+ backgroundColor: colour.background.container.brand,
14247
14247
  borderTopRightRadius: parseTokenValue55(borderRadius.xs),
14248
14248
  borderBottomRightRadius: parseTokenValue55(borderRadius.xs)
14249
14249
  };
@@ -14320,37 +14320,25 @@ var StyledRoot16 = styled51(Pressable)(({ theme: theme2 }) => {
14320
14320
  width: "100%"
14321
14321
  };
14322
14322
  });
14323
- var ImageContainer = styled51(View)({
14323
+ var ImageContainer = styled51(View)(({ theme: theme2 }) => ({
14324
14324
  position: "relative",
14325
14325
  width: "100%",
14326
14326
  aspectRatio: 1,
14327
- overflow: "hidden"
14328
- });
14327
+ overflow: "hidden",
14328
+ borderRadius: parseTokenValue56(
14329
+ theme2.tokens.semantics.dimensions.borderRadius.md
14330
+ )
14331
+ }));
14329
14332
  var StyledImage2 = styled51(Image)({
14330
14333
  width: "100%",
14331
14334
  height: "100%",
14332
14335
  resizeMode: "cover"
14333
14336
  });
14334
- var BadgeContainer2 = styled51(View)(({ theme: theme2 }) => {
14335
- const spacing = theme2.tokens.semantics.dimensions.spacing;
14336
- const { sizing, borderRadius } = theme2.tokens.semantics.dimensions;
14337
- const { colour } = theme2.tokens.semantics;
14338
- return {
14339
- position: "absolute",
14340
- top: parseTokenValue56(spacing.md),
14341
- left: 0,
14342
- display: "flex",
14343
- flexDirection: "row",
14344
- gap: parseTokenValue56(spacing["2xs"]),
14345
- alignItems: "center",
14346
- justifyContent: "center",
14347
- height: parseTokenValue56(sizing["2xl"]),
14348
- paddingRight: parseTokenValue56(spacing.sm),
14349
- backgroundColor: colour.background.container.alt,
14350
- borderTopRightRadius: parseTokenValue56(borderRadius.sm),
14351
- borderBottomRightRadius: parseTokenValue56(borderRadius.sm)
14352
- };
14353
- });
14337
+ var BadgeContainer2 = styled51(View)(({ theme: theme2 }) => ({
14338
+ position: "absolute",
14339
+ top: parseTokenValue56(theme2.tokens.semantics.dimensions.spacing.md),
14340
+ left: 0
14341
+ }));
14354
14342
  var ContentContainer = styled51(View)(({ theme: theme2 }) => {
14355
14343
  const spacing = theme2.tokens.semantics.dimensions.spacing;
14356
14344
  return {
@@ -14373,20 +14361,12 @@ var CategoryWrapper = styled51(View)(({ theme: theme2 }) => {
14373
14361
  marginBottom: parseTokenValue56(spacing["3xs"])
14374
14362
  };
14375
14363
  });
14376
- var TitleContainer = styled51(View)(({ theme: theme2 }) => {
14377
- const spacing = theme2.tokens.semantics.dimensions.spacing;
14378
- return {
14379
- display: "flex",
14380
- flexDirection: "row",
14381
- width: "100%",
14382
- marginBottom: parseTokenValue56(spacing.xs)
14383
- };
14384
- });
14385
- var SizeWrapper = styled51(View)(({ theme: theme2 }) => {
14386
- const spacing = theme2.tokens.semantics.dimensions.spacing;
14387
- return {
14388
- marginBottom: parseTokenValue56(spacing.md)
14389
- };
14364
+ var TitleContainer = styled51(View)({
14365
+ display: "flex",
14366
+ flexDirection: "row",
14367
+ width: "100%",
14368
+ // 6px below the title to match Figma (4px title bottom padding + 2px gap).
14369
+ marginBottom: 6
14390
14370
  });
14391
14371
  var PricingContainer = styled51(View)(({ theme: theme2 }) => {
14392
14372
  const spacing = theme2.tokens.semantics.dimensions.spacing;
@@ -14447,7 +14427,7 @@ var _ProductListingCard = React60.forwardRef(
14447
14427
  /* @__PURE__ */ jsxs(DetailsContainer, { children: [
14448
14428
  showCategory && category && /* @__PURE__ */ jsx(CategoryWrapper, { children: /* @__PURE__ */ jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: category }) }),
14449
14429
  showTitle && /* @__PURE__ */ jsx(TitleContainer, { children: /* @__PURE__ */ jsx(Typography, { variant: "heading", size: "xs", children: title }) }),
14450
- showSize && size && /* @__PURE__ */ jsx(SizeWrapper, { children: /* @__PURE__ */ jsx(Typography, { variant: "body", size: "md", color: "secondary", children: size }) })
14430
+ showSize && size && /* @__PURE__ */ jsx(Typography, { variant: "body", size: "md", color: "secondary", children: size })
14451
14431
  ] }),
14452
14432
  showPrice && price && /* @__PURE__ */ jsxs(PricingContainer, { children: [
14453
14433
  /* @__PURE__ */ jsx(Typography, { variant: "body", size: "md", color: "secondary", children: price }),
@@ -14471,78 +14451,50 @@ var ProductListingCardWithBadgeAndGrid = Object.assign(_ProductListingCard, {
14471
14451
  Badge: Badge2,
14472
14452
  Grid
14473
14453
  });
14474
- var StyledCardContainer = styled51(View)(({
14475
- theme: theme2,
14476
- borderless
14477
- }) => {
14454
+ var StyledCardContainer = styled51(View)(({ theme: theme2 }) => {
14478
14455
  const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
14479
14456
  const { colour } = theme2.tokens.semantics;
14480
14457
  const spacingMd = parseTokenValue8(spacing.md);
14481
14458
  const spacingXl = parseTokenValue8(spacing.xl);
14482
- return __spreadProps(__spreadValues({
14459
+ return {
14483
14460
  flexDirection: "row",
14484
14461
  width: "100%",
14485
- height: borderless ? void 0 : "100%",
14486
- maxHeight: spacingXl * 6 + spacingMd,
14487
- backgroundColor: colour.background.surface.default
14488
- }, borderless ? {} : {
14462
+ // Cap at the Figma mobile card width (can be narrower — responsive).
14463
+ maxWidth: 358,
14464
+ // The 148px image sets the baseline height; the card grows if the content
14465
+ // is taller (e.g. a long or translated title wrapping to multiple lines)
14466
+ // so nothing is clipped.
14467
+ minHeight: 148,
14468
+ backgroundColor: colour.background.surface.default,
14489
14469
  borderWidth: 1,
14490
14470
  borderColor: colour.border.default,
14491
14471
  shadowColor: "#522a10",
14492
14472
  shadowOffset: { width: 0, height: spacingMd / 4 },
14493
14473
  shadowOpacity: 0.05,
14494
14474
  shadowRadius: spacingXl - 4,
14495
- elevation: 5
14496
- }), {
14475
+ elevation: 5,
14497
14476
  borderRadius: parseTokenValue8(borderRadius.md),
14498
14477
  overflow: "hidden",
14499
14478
  zIndex: 1
14500
- });
14501
- });
14502
- var StyledImage3 = styled51(View)(
14503
- ({
14504
- theme: theme2,
14505
- imageBackgroundColor,
14506
- thumbnailWidth = 100,
14507
- thumbnailBackgroundColor
14508
- }) => ({
14509
- flexShrink: 0,
14510
- backgroundColor: thumbnailBackgroundColor || imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
14511
- overflow: "hidden",
14512
- aspectRatio: "1 / 1",
14513
- width: thumbnailWidth,
14514
- height: thumbnailWidth,
14515
- position: "relative"
14516
- })
14517
- );
14518
- var StyledQuantityBadge = styled51(View)(({ theme: theme2 }) => {
14519
- const spacing = theme2.tokens.semantics.dimensions.spacing;
14520
- const borderRadius = theme2.tokens.semantics.dimensions.borderRadius;
14521
- const { colour } = theme2.tokens.semantics;
14522
- return {
14523
- position: "absolute",
14524
- top: parseTokenValue8(spacing["2xs"]),
14525
- right: parseTokenValue8(spacing["2xs"]),
14526
- backgroundColor: colour.background.container.brand,
14527
- borderRadius: parseTokenValue8(borderRadius.xs),
14528
- paddingHorizontal: parseTokenValue8(spacing.sm),
14529
- height: parseTokenValue8(spacing["2xl"]),
14530
- minWidth: parseTokenValue8(spacing["2xl"]),
14531
- alignItems: "center",
14532
- justifyContent: "center",
14533
- zIndex: 2
14534
14479
  };
14535
14480
  });
14536
- var StyledContentArea = styled51(View)(({
14537
- theme: theme2,
14538
- borderless
14539
- }) => {
14481
+ var StyledImage3 = styled51(View)(({ theme: theme2, imageBackgroundColor, thumbnailWidth = 148 }) => ({
14482
+ flexShrink: 0,
14483
+ backgroundColor: imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
14484
+ overflow: "hidden",
14485
+ width: thumbnailWidth,
14486
+ // Square (148) by default; stretches taller to fill the card when the
14487
+ // content makes it taller than the image.
14488
+ minHeight: thumbnailWidth,
14489
+ position: "relative"
14490
+ }));
14491
+ var StyledContentArea = styled51(View)(({ theme: theme2 }) => {
14540
14492
  const { spacing } = theme2.tokens.semantics.dimensions;
14541
14493
  const paddingValue = parseTokenValue8(spacing.md);
14542
14494
  return {
14543
14495
  flex: 1,
14544
14496
  paddingHorizontal: paddingValue,
14545
- paddingVertical: borderless ? 0 : paddingValue,
14497
+ paddingVertical: paddingValue,
14546
14498
  gap: parseTokenValue8(spacing.xs),
14547
14499
  justifyContent: "space-between"
14548
14500
  };
@@ -14550,25 +14502,38 @@ var StyledContentArea = styled51(View)(({
14550
14502
  var StyledTextContainer = styled51(View)(() => ({
14551
14503
  gap: 2
14552
14504
  }));
14553
- var StyledBannerWrapper = styled51(View)(() => ({
14554
- width: "100%",
14555
- marginTop: -48,
14556
- paddingTop: 24,
14557
- paddingBottom: 16
14558
- }));
14505
+ var StyledBannerWrapper = styled51(View)(({ theme: theme2 }) => {
14506
+ const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
14507
+ return {
14508
+ width: "100%",
14509
+ // Tuck the banner up behind the card by the corner radius so its square top
14510
+ // corners hide under the card's rounded bottom; the rest sits below.
14511
+ marginTop: -parseTokenValue8(borderRadius.md),
14512
+ paddingBottom: parseTokenValue8(spacing.md)
14513
+ };
14514
+ });
14559
14515
  var StyledRootWrapper = styled51(View)(() => {
14560
14516
  return {
14561
14517
  flexDirection: "column",
14562
14518
  width: "100%",
14563
- height: "100%"
14519
+ maxWidth: 358
14564
14520
  };
14565
14521
  });
14566
14522
  var StyledNotification = styled51(Notification)(({ theme: theme2 }) => {
14567
- const { spacing } = theme2.tokens.semantics.dimensions;
14523
+ const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
14524
+ const spacingMd = parseTokenValue8(spacing.md);
14525
+ const radiusMd = parseTokenValue8(borderRadius.md);
14568
14526
  return {
14569
- top: parseTokenValue8(spacing.md),
14570
- paddingHorizontal: parseTokenValue8(spacing.xl),
14571
- paddingVertical: parseTokenValue8(spacing.md)
14527
+ paddingHorizontal: spacingMd,
14528
+ // 27px top padding (Figma) leaves a small cream reveal above the text once
14529
+ // the banner tucks behind the card.
14530
+ paddingTop: 27,
14531
+ paddingBottom: spacingMd,
14532
+ // Square top corners, rounded bottom corners (banner tucks under the card).
14533
+ borderTopLeftRadius: 0,
14534
+ borderTopRightRadius: 0,
14535
+ borderBottomLeftRadius: radiusMd,
14536
+ borderBottomRightRadius: radiusMd
14572
14537
  };
14573
14538
  });
14574
14539
  var ProductDisplayCard = React60.forwardRef(
@@ -14582,16 +14547,11 @@ var ProductDisplayCard = React60.forwardRef(
14582
14547
  showQuantityPicker = false,
14583
14548
  disableQuantityButtons = false,
14584
14549
  hideQuantityButtons = false,
14585
- showIncrementButton,
14586
- showDecrementButton,
14587
14550
  incrementDisabled = false,
14588
14551
  decrementDisabled = false,
14589
14552
  image,
14590
14553
  imageBackgroundColor,
14591
14554
  thumbnailWidth,
14592
- thumbnailBackgroundColor,
14593
- showImageQuantityBadge = false,
14594
- borderless = false,
14595
14555
  banner,
14596
14556
  showBanner = false,
14597
14557
  bannerType = "info",
@@ -14605,16 +14565,11 @@ var ProductDisplayCard = React60.forwardRef(
14605
14565
  "showQuantityPicker",
14606
14566
  "disableQuantityButtons",
14607
14567
  "hideQuantityButtons",
14608
- "showIncrementButton",
14609
- "showDecrementButton",
14610
14568
  "incrementDisabled",
14611
14569
  "decrementDisabled",
14612
14570
  "image",
14613
14571
  "imageBackgroundColor",
14614
14572
  "thumbnailWidth",
14615
- "thumbnailBackgroundColor",
14616
- "showImageQuantityBadge",
14617
- "borderless",
14618
14573
  "banner",
14619
14574
  "showBanner",
14620
14575
  "bannerType",
@@ -14625,26 +14580,23 @@ var ProductDisplayCard = React60.forwardRef(
14625
14580
  onQuantityChange == null ? void 0 : onQuantityChange(newQuantity);
14626
14581
  }
14627
14582
  };
14628
- const cardContent = /* @__PURE__ */ jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref, borderless }, rest), { children: [
14629
- image && /* @__PURE__ */ jsxs(
14583
+ const cardContent = /* @__PURE__ */ jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref }, rest), { children: [
14584
+ image && /* @__PURE__ */ jsx(
14630
14585
  StyledImage3,
14631
14586
  {
14632
14587
  imageBackgroundColor,
14633
14588
  thumbnailWidth,
14634
- thumbnailBackgroundColor,
14635
- children: [
14636
- typeof image === "string" ? /* @__PURE__ */ jsx(
14637
- Image,
14638
- {
14639
- source: { uri: image },
14640
- style: { width: "100%", height: "100%" }
14641
- }
14642
- ) : image,
14643
- showImageQuantityBadge && quantity && /* @__PURE__ */ jsx(StyledQuantityBadge, { children: /* @__PURE__ */ jsx(Typography, { variant: "body", size: "sm", weight: "bold", children: quantity }) })
14644
- ]
14589
+ children: typeof image === "string" ? /* @__PURE__ */ jsx(
14590
+ Image,
14591
+ {
14592
+ source: { uri: image },
14593
+ resizeMode: "cover",
14594
+ style: { flex: 1, width: "100%" }
14595
+ }
14596
+ ) : image
14645
14597
  }
14646
14598
  ),
14647
- /* @__PURE__ */ jsxs(StyledContentArea, { borderless, children: [
14599
+ /* @__PURE__ */ jsxs(StyledContentArea, { children: [
14648
14600
  /* @__PURE__ */ jsxs(StyledTextContainer, { children: [
14649
14601
  /* @__PURE__ */ jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
14650
14602
  showSubtext && subtext && /* @__PURE__ */ jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
@@ -14665,8 +14617,8 @@ var ProductDisplayCard = React60.forwardRef(
14665
14617
  min: 1,
14666
14618
  accessible: true,
14667
14619
  accessibilityLabel: `Quantity: ${quantity}`,
14668
- showIncrementButton: showIncrementButton !== void 0 ? showIncrementButton : !hideQuantityButtons,
14669
- showDecrementButton: showDecrementButton !== void 0 ? showDecrementButton : !hideQuantityButtons,
14620
+ showIncrementButton: !hideQuantityButtons,
14621
+ showDecrementButton: !hideQuantityButtons,
14670
14622
  incrementDisabled: incrementDisabled || disableQuantityButtons,
14671
14623
  decrementDisabled: decrementDisabled || disableQuantityButtons
14672
14624
  }