@butternutbox/pawprint-native 1.1.0 → 1.1.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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -10
- package/dist/index.d.ts +6 -10
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.test.tsx +5 -5
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.tsx +4 -6
package/package.json
CHANGED
|
@@ -222,7 +222,7 @@ describe("ProductDisplayCard (Native)", () => {
|
|
|
222
222
|
expect(screen.queryByText("6")).toBeFalsy()
|
|
223
223
|
})
|
|
224
224
|
|
|
225
|
-
it("
|
|
225
|
+
it("renders the quantity picker alongside a quantityBadge", () => {
|
|
226
226
|
renderWithTheme(
|
|
227
227
|
<ProductDisplayCard
|
|
228
228
|
title="Test Product"
|
|
@@ -239,8 +239,8 @@ describe("ProductDisplayCard (Native)", () => {
|
|
|
239
239
|
|
|
240
240
|
// The badge shows the quantity...
|
|
241
241
|
expect(screen.getByText("3")).toBeTruthy()
|
|
242
|
-
// ...and the picker
|
|
243
|
-
expect(screen.
|
|
242
|
+
// ...and the picker is rendered independently of it.
|
|
243
|
+
expect(screen.getByDisplayValue("3")).toBeTruthy()
|
|
244
244
|
})
|
|
245
245
|
|
|
246
246
|
it("renders a thumbnailBadge from BadgeProps", () => {
|
|
@@ -259,7 +259,7 @@ describe("ProductDisplayCard (Native)", () => {
|
|
|
259
259
|
expect(screen.getByText("New")).toBeTruthy()
|
|
260
260
|
})
|
|
261
261
|
|
|
262
|
-
it("
|
|
262
|
+
it("renders the quantity picker alongside a thumbnailBadge", () => {
|
|
263
263
|
renderWithTheme(
|
|
264
264
|
<ProductDisplayCard
|
|
265
265
|
title="Test Product"
|
|
@@ -275,7 +275,7 @@ describe("ProductDisplayCard (Native)", () => {
|
|
|
275
275
|
)
|
|
276
276
|
|
|
277
277
|
expect(screen.getByText("New")).toBeTruthy()
|
|
278
|
-
expect(screen.
|
|
278
|
+
expect(screen.getByDisplayValue("2")).toBeTruthy()
|
|
279
279
|
})
|
|
280
280
|
|
|
281
281
|
it("prefers thumbnailBadge over the deprecated quantityBadge when both are set", () => {
|
|
@@ -20,16 +20,14 @@ export type ProductDisplayCardProps = ViewProps & {
|
|
|
20
20
|
* wins. This prop will be removed in a future major release.
|
|
21
21
|
*
|
|
22
22
|
* Show a quantity badge overlaid on the top-right of the image (rendering the
|
|
23
|
-
* current `quantity`)
|
|
24
|
-
*
|
|
25
|
-
* at a time; when `quantityBadge` is true the picker is never rendered.
|
|
23
|
+
* current `quantity`). Defaults to `false`. Independent of the quantity
|
|
24
|
+
* picker — use `showQuantityPicker` to control that separately.
|
|
26
25
|
*/
|
|
27
26
|
quantityBadge?: boolean
|
|
28
27
|
/**
|
|
29
28
|
* Render a `Badge` overlaid on the top-right of the image. Accepts any
|
|
30
29
|
* `BadgeProps` (variant, size, icon, children, etc.) — pass them as an object.
|
|
31
|
-
*
|
|
32
|
-
* rendered.
|
|
30
|
+
* Independent of the quantity picker: both can be shown at the same time.
|
|
33
31
|
*
|
|
34
32
|
* @example
|
|
35
33
|
* thumbnailBadge={{ variant: "primary", size: "large", children: "New" }}
|
|
@@ -312,7 +310,7 @@ export const ProductDisplayCard = React.forwardRef<
|
|
|
312
310
|
)}
|
|
313
311
|
</StyledTextContainer>
|
|
314
312
|
|
|
315
|
-
{showQuantityPicker &&
|
|
313
|
+
{showQuantityPicker && (
|
|
316
314
|
<View style={{ marginLeft: "auto" }}>
|
|
317
315
|
<NumberField
|
|
318
316
|
size="sm"
|