@butternutbox/pawprint-native 0.19.2 → 0.20.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +8 -0
- package/dist/index.cjs +26 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +26 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.stories.tsx +31 -0
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.test.tsx +54 -0
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.tsx +34 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
[34mCJS[39m Build start
|
|
8
8
|
[34mESM[39m Build start
|
|
9
9
|
[34mDTS[39m Build start
|
|
10
|
-
[
|
|
11
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m1.06 MB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 7309ms
|
|
13
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m546.81 KB[39m
|
|
10
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m547.43 KB[39m
|
|
14
11
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.06 MB[39m
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 7630ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m517.29 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m1.06 MB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 7630ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 22133ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m101.81 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m101.81 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @butternutbox/pawprint-native
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 246e43e: `ProductDisplayCard`: add an optional `quantityBadge` prop.
|
|
8
|
+
|
|
9
|
+
When `quantityBadge` is `true`, a quantity badge (the pawprint `Badge`, `variant="primary" size="large"`) is overlaid on the top-right of the product image and renders the current `quantity`, matching Figma node `10864:736`. It defaults to `false`, so existing usages are unaffected. The badge and the quantity picker are mutually exclusive — when `quantityBadge` is set the picker is never rendered (only one is visible at a time). Intended for the OOB recipe and Extras cards.
|
|
10
|
+
|
|
3
11
|
## 0.19.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -12037,6 +12037,17 @@ var StyledImage3 = styled51__default.default(reactNative.View)(({ theme: theme2,
|
|
|
12037
12037
|
minHeight: thumbnailWidth,
|
|
12038
12038
|
position: "relative"
|
|
12039
12039
|
}));
|
|
12040
|
+
var StyledBadgeOverlay = styled51__default.default(reactNative.View)(({ theme: theme2 }) => {
|
|
12041
|
+
const offset = parseTokenValue9(
|
|
12042
|
+
theme2.tokens.semantics.dimensions.spacing["2xs"]
|
|
12043
|
+
);
|
|
12044
|
+
return {
|
|
12045
|
+
position: "absolute",
|
|
12046
|
+
top: offset,
|
|
12047
|
+
right: offset,
|
|
12048
|
+
zIndex: 2
|
|
12049
|
+
};
|
|
12050
|
+
});
|
|
12040
12051
|
var StyledContentArea = styled51__default.default(reactNative.View)(({ theme: theme2 }) => {
|
|
12041
12052
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
12042
12053
|
const paddingValue = parseTokenValue9(spacing.md);
|
|
@@ -12113,6 +12124,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12113
12124
|
quantity = 1,
|
|
12114
12125
|
onQuantityChange,
|
|
12115
12126
|
showQuantityPicker = false,
|
|
12127
|
+
quantityBadge = false,
|
|
12116
12128
|
disableQuantityButtons = false,
|
|
12117
12129
|
hideQuantityButtons = false,
|
|
12118
12130
|
incrementDisabled = false,
|
|
@@ -12133,6 +12145,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12133
12145
|
"quantity",
|
|
12134
12146
|
"onQuantityChange",
|
|
12135
12147
|
"showQuantityPicker",
|
|
12148
|
+
"quantityBadge",
|
|
12136
12149
|
"disableQuantityButtons",
|
|
12137
12150
|
"hideQuantityButtons",
|
|
12138
12151
|
"incrementDisabled",
|
|
@@ -12159,19 +12172,22 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12159
12172
|
showBanner: showBanner && !!banner
|
|
12160
12173
|
}, rest), {
|
|
12161
12174
|
children: [
|
|
12162
|
-
image && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { disabled: !onImagePress, onPress: onImagePress, children: /* @__PURE__ */ jsxRuntime.
|
|
12175
|
+
image && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { disabled: !onImagePress, onPress: onImagePress, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12163
12176
|
StyledImage3,
|
|
12164
12177
|
{
|
|
12165
12178
|
imageBackgroundColor,
|
|
12166
12179
|
thumbnailWidth,
|
|
12167
|
-
children:
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12180
|
+
children: [
|
|
12181
|
+
typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
12182
|
+
reactNative.Image,
|
|
12183
|
+
{
|
|
12184
|
+
source: { uri: image },
|
|
12185
|
+
resizeMode: "cover",
|
|
12186
|
+
style: { flex: 1, width: "100%" }
|
|
12187
|
+
}
|
|
12188
|
+
) : image,
|
|
12189
|
+
quantityBadge && /* @__PURE__ */ jsxRuntime.jsx(StyledBadgeOverlay, { pointerEvents: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "large", children: String(quantity) }) })
|
|
12190
|
+
]
|
|
12175
12191
|
}
|
|
12176
12192
|
) }),
|
|
12177
12193
|
/* @__PURE__ */ jsxRuntime.jsxs(StyledContentArea, { children: [
|
|
@@ -12179,7 +12195,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12179
12195
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
|
|
12180
12196
|
showSubtext && subtext && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
|
|
12181
12197
|
] }),
|
|
12182
|
-
showQuantityPicker && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12198
|
+
showQuantityPicker && !quantityBadge && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12183
12199
|
NumberField,
|
|
12184
12200
|
{
|
|
12185
12201
|
size: "sm",
|