@butternutbox/pawprint-native 0.19.1 → 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 +7 -7
- package/CHANGELOG.md +16 -0
- package/dist/index.cjs +33 -11
- 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 +33 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.tsx +9 -2
- 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
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
10
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m547.43 KB[39m
|
|
11
11
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.06 MB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 7630ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m517.29 KB[39m
|
|
14
14
|
[32mESM[39m [1mdist/index.js.map [22m[32m1.06 MB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
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,21 @@
|
|
|
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
|
+
|
|
11
|
+
## 0.19.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 68b227a: `NativeSelectPicker`: fix the Android options panel being too short.
|
|
16
|
+
|
|
17
|
+
On Android the options `FlatList` was capped at a tiny fixed height (`spacing["8xl"]`), so only ~1 option was visible with a cramped scrollbar. It now sizes to a fraction of the screen height, filling the bottom-sheet dialog so all options are reachable/scrollable — matching the full-height iOS `ActionSheetIOS` picker. iOS is unaffected.
|
|
18
|
+
|
|
3
19
|
## 0.19.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -9357,6 +9357,7 @@ var NativeSelectPicker = React66__default.default.forwardRef(
|
|
|
9357
9357
|
var _a2;
|
|
9358
9358
|
const [isOpen, setIsOpen] = React66.useState(false);
|
|
9359
9359
|
const { iconAnimationStyles } = useIconAnimation();
|
|
9360
|
+
const { height: windowHeight } = reactNative.useWindowDimensions();
|
|
9360
9361
|
const hasPlaceholder = placeholder && Object.keys(placeholder).length > 0 && placeholder.label !== void 0;
|
|
9361
9362
|
const allItems = React66.useMemo(() => {
|
|
9362
9363
|
var _a3;
|
|
@@ -9471,7 +9472,12 @@ var NativeSelectPicker = React66__default.default.forwardRef(
|
|
|
9471
9472
|
);
|
|
9472
9473
|
},
|
|
9473
9474
|
style: {
|
|
9474
|
-
|
|
9475
|
+
// Fill the bottom-sheet dialog (sized 40-80% of the
|
|
9476
|
+
// screen) rather than a tiny fixed cap, so all options
|
|
9477
|
+
// are reachable/scrollable on Android like the iOS
|
|
9478
|
+
// ActionSheet. Previously capped at spacing["8xl"],
|
|
9479
|
+
// which showed only ~1 row.
|
|
9480
|
+
maxHeight: windowHeight * 0.7
|
|
9475
9481
|
}
|
|
9476
9482
|
}
|
|
9477
9483
|
)
|
|
@@ -12031,6 +12037,17 @@ var StyledImage3 = styled51__default.default(reactNative.View)(({ theme: theme2,
|
|
|
12031
12037
|
minHeight: thumbnailWidth,
|
|
12032
12038
|
position: "relative"
|
|
12033
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
|
+
});
|
|
12034
12051
|
var StyledContentArea = styled51__default.default(reactNative.View)(({ theme: theme2 }) => {
|
|
12035
12052
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
12036
12053
|
const paddingValue = parseTokenValue9(spacing.md);
|
|
@@ -12107,6 +12124,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12107
12124
|
quantity = 1,
|
|
12108
12125
|
onQuantityChange,
|
|
12109
12126
|
showQuantityPicker = false,
|
|
12127
|
+
quantityBadge = false,
|
|
12110
12128
|
disableQuantityButtons = false,
|
|
12111
12129
|
hideQuantityButtons = false,
|
|
12112
12130
|
incrementDisabled = false,
|
|
@@ -12127,6 +12145,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12127
12145
|
"quantity",
|
|
12128
12146
|
"onQuantityChange",
|
|
12129
12147
|
"showQuantityPicker",
|
|
12148
|
+
"quantityBadge",
|
|
12130
12149
|
"disableQuantityButtons",
|
|
12131
12150
|
"hideQuantityButtons",
|
|
12132
12151
|
"incrementDisabled",
|
|
@@ -12153,19 +12172,22 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12153
12172
|
showBanner: showBanner && !!banner
|
|
12154
12173
|
}, rest), {
|
|
12155
12174
|
children: [
|
|
12156
|
-
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(
|
|
12157
12176
|
StyledImage3,
|
|
12158
12177
|
{
|
|
12159
12178
|
imageBackgroundColor,
|
|
12160
12179
|
thumbnailWidth,
|
|
12161
|
-
children:
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
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
|
+
]
|
|
12169
12191
|
}
|
|
12170
12192
|
) }),
|
|
12171
12193
|
/* @__PURE__ */ jsxRuntime.jsxs(StyledContentArea, { children: [
|
|
@@ -12173,7 +12195,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
|
|
|
12173
12195
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
|
|
12174
12196
|
showSubtext && subtext && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
|
|
12175
12197
|
] }),
|
|
12176
|
-
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(
|
|
12177
12199
|
NumberField,
|
|
12178
12200
|
{
|
|
12179
12201
|
size: "sm",
|