@butternutbox/pawprint-native 1.0.0 → 1.1.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 +10 -0
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.stories.tsx +40 -5
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.test.tsx +55 -0
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.tsx +35 -9
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.08 MB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 8053ms
|
|
13
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m553.74 KB[39m
|
|
10
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m553.93 KB[39m
|
|
14
11
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.08 MB[39m
|
|
15
|
-
[32mCJS[39m ⚡️ Build success in
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 7609ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m523.65 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m1.08 MB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 7611ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 20912ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m104.52 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m104.52 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @butternutbox/pawprint-native
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 99afbc0: `ProductDisplayCard`: add a new `thumbnailBadge` prop for overlaying a `Badge` on the thumbnail image.
|
|
8
|
+
- `thumbnailBadge` accepts any `BadgeProps` (`variant`, `size`, `icon`, `children`, …) as an object, so consumers can render any badge content (e.g. `"New"`, `"Popular"`, a quantity number) with any Badge variant/size.
|
|
9
|
+
- Mutually exclusive with the quantity picker: when `thumbnailBadge` is set, the picker is never rendered.
|
|
10
|
+
- **Native** — `quantityBadge` (boolean) is now marked `@deprecated`. It still works during the deprecation window and behaves the same as before (renders a hardcoded primary/large Badge containing `quantity`). When both `thumbnailBadge` and `quantityBadge` are set, `thumbnailBadge` wins. Migrate with `thumbnailBadge={{ variant: "primary", size: "large", children: String(quantity) }}`. `quantityBadge` will be removed in a future major release.
|
|
11
|
+
- **Web** — `thumbnailBadge` is a new prop; there was no equivalent before.
|
|
12
|
+
|
|
3
13
|
## 1.0.0
|
|
4
14
|
|
|
5
15
|
### Major Changes
|
package/dist/index.cjs
CHANGED
|
@@ -12262,6 +12262,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12262
12262
|
onQuantityChange,
|
|
12263
12263
|
showQuantityPicker = false,
|
|
12264
12264
|
quantityBadge = false,
|
|
12265
|
+
thumbnailBadge,
|
|
12265
12266
|
disableQuantityButtons = false,
|
|
12266
12267
|
hideQuantityButtons = false,
|
|
12267
12268
|
incrementDisabled = false,
|
|
@@ -12284,6 +12285,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12284
12285
|
"onQuantityChange",
|
|
12285
12286
|
"showQuantityPicker",
|
|
12286
12287
|
"quantityBadge",
|
|
12288
|
+
"thumbnailBadge",
|
|
12287
12289
|
"disableQuantityButtons",
|
|
12288
12290
|
"hideQuantityButtons",
|
|
12289
12291
|
"incrementDisabled",
|
|
@@ -12304,6 +12306,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12304
12306
|
onQuantityChange == null ? void 0 : onQuantityChange(newQuantity);
|
|
12305
12307
|
}
|
|
12306
12308
|
};
|
|
12309
|
+
const resolvedBadgeProps = thumbnailBadge != null ? thumbnailBadge : quantityBadge ? { variant: "primary", size: "large", children: String(quantity) } : void 0;
|
|
12307
12310
|
const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12308
12311
|
StyledCardContainer,
|
|
12309
12312
|
__spreadProps(__spreadValues({
|
|
@@ -12325,7 +12328,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12325
12328
|
style: { flex: 1, width: "100%" }
|
|
12326
12329
|
}
|
|
12327
12330
|
) : image,
|
|
12328
|
-
|
|
12331
|
+
resolvedBadgeProps && /* @__PURE__ */ jsxRuntime.jsx(StyledBadgeOverlay, { pointerEvents: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, __spreadValues({}, resolvedBadgeProps)) })
|
|
12329
12332
|
]
|
|
12330
12333
|
}
|
|
12331
12334
|
) }),
|
|
@@ -12334,7 +12337,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12334
12337
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
|
|
12335
12338
|
showSubtext && subtext && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
|
|
12336
12339
|
] }),
|
|
12337
|
-
showQuantityPicker && !
|
|
12340
|
+
showQuantityPicker && !resolvedBadgeProps && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12338
12341
|
NumberField,
|
|
12339
12342
|
{
|
|
12340
12343
|
size: "sm",
|