@butternutbox/pawprint-native 0.4.0 → 0.4.1

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
@@ -1984,7 +1984,7 @@ type ProductDisplayCardDevice = "desktop" | "mobile";
1984
1984
  type ProductDisplayCardProps = ViewProps & {
1985
1985
  device?: ProductDisplayCardDevice;
1986
1986
  title: string;
1987
- subtext?: string;
1987
+ subtext?: string | React.ReactNode;
1988
1988
  showSubtext?: boolean;
1989
1989
  quantity?: number;
1990
1990
  onQuantityChange?: (quantity: number) => void;
@@ -1995,7 +1995,9 @@ type ProductDisplayCardProps = ViewProps & {
1995
1995
  showDecrementButton?: boolean;
1996
1996
  incrementDisabled?: boolean;
1997
1997
  decrementDisabled?: boolean;
1998
- image?: React.ReactNode;
1998
+ image?: string | React.ReactNode;
1999
+ imageBackgroundColor?: string;
2000
+ showImageQuantityBadge?: boolean;
1999
2001
  banner?: React.ReactNode;
2000
2002
  showBanner?: boolean;
2001
2003
  bannerType?: "error" | "success" | "warning" | "info";
@@ -2019,12 +2021,14 @@ type ProductDisplayCardProps = ViewProps & {
2019
2021
  *
2020
2022
  * @param device - *(optional)* Device variant: "desktop" or "mobile" (default)
2021
2023
  * @param title - Product title
2022
- * @param subtext - *(optional)* Subtitle text (e.g. price)
2024
+ * @param subtext - *(optional)* Subtitle text or JSX element (e.g. price)
2023
2025
  * @param showSubtext - *(optional)* Show/hide subtext
2024
2026
  * @param quantity - *(optional)* Current quantity value
2025
2027
  * @param onQuantityChange - *(optional)* Callback when quantity changes
2026
2028
  * @param showQuantityPicker - *(optional)* Show/hide quantity picker
2027
- * @param image - *(optional)* Image element or content
2029
+ * @param image - *(optional)* Image URL string or React element/JSX content
2030
+ * @param imageBackgroundColor - *(optional)* Background color for image container (default: theme background.container.secondary)
2031
+ * @param showImageQuantityBadge - *(optional)* Show/hide quantity badge overlay on image
2028
2032
  * @param banner - *(optional)* Banner content to show below card
2029
2033
  * @param showBanner - *(optional)* Show/hide banner
2030
2034
  * @param bannerType - *(optional)* Banner notification type: "error", "success", "warning", or "info" (default)
@@ -2033,7 +2037,7 @@ type ProductDisplayCardProps = ViewProps & {
2033
2037
  declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
2034
2038
  device?: ProductDisplayCardDevice;
2035
2039
  title: string;
2036
- subtext?: string;
2040
+ subtext?: string | React.ReactNode;
2037
2041
  showSubtext?: boolean;
2038
2042
  quantity?: number;
2039
2043
  onQuantityChange?: (quantity: number) => void;
@@ -2044,7 +2048,9 @@ declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
2044
2048
  showDecrementButton?: boolean;
2045
2049
  incrementDisabled?: boolean;
2046
2050
  decrementDisabled?: boolean;
2047
- image?: React.ReactNode;
2051
+ image?: string | React.ReactNode;
2052
+ imageBackgroundColor?: string;
2053
+ showImageQuantityBadge?: boolean;
2048
2054
  banner?: React.ReactNode;
2049
2055
  showBanner?: boolean;
2050
2056
  bannerType?: "error" | "success" | "warning" | "info";
package/dist/index.d.ts CHANGED
@@ -1984,7 +1984,7 @@ type ProductDisplayCardDevice = "desktop" | "mobile";
1984
1984
  type ProductDisplayCardProps = ViewProps & {
1985
1985
  device?: ProductDisplayCardDevice;
1986
1986
  title: string;
1987
- subtext?: string;
1987
+ subtext?: string | React.ReactNode;
1988
1988
  showSubtext?: boolean;
1989
1989
  quantity?: number;
1990
1990
  onQuantityChange?: (quantity: number) => void;
@@ -1995,7 +1995,9 @@ type ProductDisplayCardProps = ViewProps & {
1995
1995
  showDecrementButton?: boolean;
1996
1996
  incrementDisabled?: boolean;
1997
1997
  decrementDisabled?: boolean;
1998
- image?: React.ReactNode;
1998
+ image?: string | React.ReactNode;
1999
+ imageBackgroundColor?: string;
2000
+ showImageQuantityBadge?: boolean;
1999
2001
  banner?: React.ReactNode;
2000
2002
  showBanner?: boolean;
2001
2003
  bannerType?: "error" | "success" | "warning" | "info";
@@ -2019,12 +2021,14 @@ type ProductDisplayCardProps = ViewProps & {
2019
2021
  *
2020
2022
  * @param device - *(optional)* Device variant: "desktop" or "mobile" (default)
2021
2023
  * @param title - Product title
2022
- * @param subtext - *(optional)* Subtitle text (e.g. price)
2024
+ * @param subtext - *(optional)* Subtitle text or JSX element (e.g. price)
2023
2025
  * @param showSubtext - *(optional)* Show/hide subtext
2024
2026
  * @param quantity - *(optional)* Current quantity value
2025
2027
  * @param onQuantityChange - *(optional)* Callback when quantity changes
2026
2028
  * @param showQuantityPicker - *(optional)* Show/hide quantity picker
2027
- * @param image - *(optional)* Image element or content
2029
+ * @param image - *(optional)* Image URL string or React element/JSX content
2030
+ * @param imageBackgroundColor - *(optional)* Background color for image container (default: theme background.container.secondary)
2031
+ * @param showImageQuantityBadge - *(optional)* Show/hide quantity badge overlay on image
2028
2032
  * @param banner - *(optional)* Banner content to show below card
2029
2033
  * @param showBanner - *(optional)* Show/hide banner
2030
2034
  * @param bannerType - *(optional)* Banner notification type: "error", "success", "warning", or "info" (default)
@@ -2033,7 +2037,7 @@ type ProductDisplayCardProps = ViewProps & {
2033
2037
  declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
2034
2038
  device?: ProductDisplayCardDevice;
2035
2039
  title: string;
2036
- subtext?: string;
2040
+ subtext?: string | React.ReactNode;
2037
2041
  showSubtext?: boolean;
2038
2042
  quantity?: number;
2039
2043
  onQuantityChange?: (quantity: number) => void;
@@ -2044,7 +2048,9 @@ declare const ProductDisplayCard: React.ForwardRefExoticComponent<ViewProps & {
2044
2048
  showDecrementButton?: boolean;
2045
2049
  incrementDisabled?: boolean;
2046
2050
  decrementDisabled?: boolean;
2047
- image?: React.ReactNode;
2051
+ image?: string | React.ReactNode;
2052
+ imageBackgroundColor?: string;
2053
+ showImageQuantityBadge?: boolean;
2048
2054
  banner?: React.ReactNode;
2049
2055
  showBanner?: boolean;
2050
2056
  bannerType?: "error" | "success" | "warning" | "info";
package/dist/index.js CHANGED
@@ -10157,28 +10157,20 @@ var StyledFieldWrapper = styled60(View)(
10157
10157
  overflow: "hidden"
10158
10158
  })
10159
10159
  );
10160
- var StyledTextInput = styled60(TextInput)(
10161
- ({
10162
- inputColor,
10163
- inputFontFamily,
10164
- inputFontWeight,
10165
- inputFontSize,
10166
- inputLineHeight
10167
- }) => __spreadProps(__spreadValues({
10168
- textAlign: "center",
10169
- outlineStyle: "none",
10170
- padding: 0,
10171
- minWidth: 0,
10172
- minHeight: 0,
10173
- width: "100%",
10174
- height: "100%",
10175
- color: inputColor,
10176
- fontFamily: inputFontFamily
10177
- }, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
10178
- fontSize: inputFontSize,
10179
- lineHeight: inputLineHeight
10180
- })
10181
- );
10160
+ var StyledTextInput = styled60(TextInput)(({ inputColor, inputFontFamily, inputFontWeight, inputFontSize }) => __spreadProps(__spreadValues({
10161
+ textAlign: "center",
10162
+ outlineStyle: "none",
10163
+ padding: 0,
10164
+ minWidth: 0,
10165
+ minHeight: 0,
10166
+ width: "100%",
10167
+ height: "100%",
10168
+ color: inputColor,
10169
+ fontFamily: inputFontFamily
10170
+ }, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
10171
+ fontSize: inputFontSize,
10172
+ lineHeight: 0
10173
+ }));
10182
10174
  var StyledRow = styled60(View)(({ rowGap }) => ({
10183
10175
  flexDirection: "row",
10184
10176
  alignItems: "center",
@@ -10312,7 +10304,6 @@ var NumberFieldInput = React60.forwardRef(
10312
10304
  inputFontFamily: resolvedInputFontFamily,
10313
10305
  inputFontWeight: resolvedInputFontFamily === typographyToken.fontFamily ? typographyToken.fontWeight : void 0,
10314
10306
  inputFontSize: parseTokenValue34(typographyToken.fontSize),
10315
- inputLineHeight: parseTokenValue34(typographyToken.lineHeight),
10316
10307
  keyboardType: "numeric",
10317
10308
  editable: !disabled,
10318
10309
  onFocus: handleFocus,
@@ -14164,13 +14155,34 @@ var StyledCardContainer = styled60(View)(({ theme: theme2 }) => {
14164
14155
  zIndex: 1
14165
14156
  };
14166
14157
  });
14167
- var StyledImage3 = styled60(View)(() => ({
14168
- flexShrink: 0,
14169
- backgroundColor: "#f5f5f5",
14170
- overflow: "hidden",
14171
- aspectRatio: "1 / 1",
14172
- height: "100%"
14173
- }));
14158
+ var StyledImage3 = styled60(View)(
14159
+ ({ theme: theme2, imageBackgroundColor }) => ({
14160
+ flexShrink: 0,
14161
+ backgroundColor: imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
14162
+ overflow: "hidden",
14163
+ aspectRatio: "1 / 1",
14164
+ height: "100%",
14165
+ position: "relative"
14166
+ })
14167
+ );
14168
+ var StyledQuantityBadge = styled60(View)(({ theme: theme2 }) => {
14169
+ const spacing = theme2.tokens.semantics.dimensions.spacing;
14170
+ const borderRadius = theme2.tokens.semantics.dimensions.borderRadius;
14171
+ const { colour } = theme2.tokens.semantics;
14172
+ return {
14173
+ position: "absolute",
14174
+ top: parseTokenValue8(spacing["2xs"]),
14175
+ right: parseTokenValue8(spacing["2xs"]),
14176
+ backgroundColor: colour.background.container.brand,
14177
+ borderRadius: parseTokenValue8(borderRadius.xs),
14178
+ paddingHorizontal: parseTokenValue8(spacing.sm),
14179
+ height: parseTokenValue8(spacing["2xl"]),
14180
+ minWidth: parseTokenValue8(spacing["2xl"]),
14181
+ alignItems: "center",
14182
+ justifyContent: "center",
14183
+ zIndex: 2
14184
+ };
14185
+ });
14174
14186
  var StyledContentArea = styled60(View)(({ theme: theme2 }) => {
14175
14187
  const { spacing } = theme2.tokens.semantics.dimensions;
14176
14188
  return {
@@ -14222,6 +14234,8 @@ var ProductDisplayCard = React60.forwardRef(
14222
14234
  incrementDisabled = false,
14223
14235
  decrementDisabled = false,
14224
14236
  image,
14237
+ imageBackgroundColor,
14238
+ showImageQuantityBadge = false,
14225
14239
  banner,
14226
14240
  showBanner = false,
14227
14241
  bannerType = "info",
@@ -14241,6 +14255,8 @@ var ProductDisplayCard = React60.forwardRef(
14241
14255
  "incrementDisabled",
14242
14256
  "decrementDisabled",
14243
14257
  "image",
14258
+ "imageBackgroundColor",
14259
+ "showImageQuantityBadge",
14244
14260
  "banner",
14245
14261
  "showBanner",
14246
14262
  "bannerType",
@@ -14252,7 +14268,16 @@ var ProductDisplayCard = React60.forwardRef(
14252
14268
  }
14253
14269
  };
14254
14270
  const cardContent = /* @__PURE__ */ jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref, cardDevice: device }, rest), { children: [
14255
- image && /* @__PURE__ */ jsx(StyledImage3, { children: image }),
14271
+ image && /* @__PURE__ */ jsxs(StyledImage3, { imageBackgroundColor, children: [
14272
+ typeof image === "string" ? /* @__PURE__ */ jsx(
14273
+ Image,
14274
+ {
14275
+ source: { uri: image },
14276
+ style: { width: "100%", height: "100%" }
14277
+ }
14278
+ ) : image,
14279
+ showImageQuantityBadge && quantity && /* @__PURE__ */ jsx(StyledQuantityBadge, { children: /* @__PURE__ */ jsx(Typography, { variant: "body", size: "sm", weight: "bold", children: quantity }) })
14280
+ ] }),
14256
14281
  /* @__PURE__ */ jsxs(StyledContentArea, { contentDevice: device, children: [
14257
14282
  /* @__PURE__ */ jsxs(StyledTextContainer, { children: [
14258
14283
  /* @__PURE__ */ jsx(Typography, { variant: "heading", size: "xs", color: "primary", children: title }),