@butternutbox/pawprint-native 0.4.1 → 0.5.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 +6 -6
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +79 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -10
- package/dist/index.d.ts +34 -10
- package/dist/index.js +79 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/Countdown/Countdown.stories.tsx +35 -0
- package/src/components/molecules/Countdown/Countdown.tsx +52 -10
- package/src/components/molecules/Countdown/index.ts +5 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.stories.tsx +25 -11
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.test.tsx +1 -1
- package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.tsx +53 -33
- package/src/components/molecules/ProductDisplayCard/index.ts +1 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
[32mESM[39m [1mdist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 [22m[32m18.90 KB[39m
|
|
16
16
|
[32mESM[39m [1mdist/index.js [22m[32m1.70 MB[39m
|
|
17
17
|
[32mESM[39m [1mdist/index.js.map [22m[32m2.65 MB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in
|
|
18
|
+
[32mESM[39m ⚡️ Build success in 11263ms
|
|
19
19
|
[32mCJS[39m [1mdist/ida-narrow-500-normal-C6I2PK4T.woff2 [22m[32m47.41 KB[39m
|
|
20
20
|
[32mCJS[39m [1mdist/ida-narrow-700-normal-UPHPRIN6.woff2 [22m[32m49.90 KB[39m
|
|
21
21
|
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 [22m[32m19.33 KB[39m
|
|
22
|
+
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-500-normal-IEQBNVGX.woff2 [22m[32m19.48 KB[39m
|
|
22
23
|
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-600-normal-UX5ZU5T6.woff2 [22m[32m19.35 KB[39m
|
|
23
24
|
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 [22m[32m18.90 KB[39m
|
|
24
|
-
[32mCJS[39m [1mdist/ibm-plex-sans-condensed-500-normal-IEQBNVGX.woff2 [22m[32m19.48 KB[39m
|
|
25
25
|
[32mCJS[39m [1mdist/index.cjs [22m[32m1.77 MB[39m
|
|
26
26
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m2.65 MB[39m
|
|
27
|
-
[32mCJS[39m ⚡️ Build success in
|
|
28
|
-
[32mDTS[39m ⚡️ Build success in
|
|
29
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
30
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
27
|
+
[32mCJS[39m ⚡️ Build success in 11267ms
|
|
28
|
+
[32mDTS[39m ⚡️ Build success in 22041ms
|
|
29
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m88.44 KB[39m
|
|
30
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m88.44 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @butternutbox/pawprint-native
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8d7fa63: Countdown unit labels are now configurable via a new `labels` prop, so consumers can pass translated strings. Each unit (`days`/`hours`/`minutes`/`seconds`) accepts either a plain string or a `{ singular, plural }` pair that resolves against the unit's value. Omitted units fall back to the English defaults.
|
|
8
|
+
|
|
9
|
+
Note: the default labels are now pluralised, so a unit value of exactly `1` renders the singular form (e.g. `hours={1}` shows "hr" instead of "hrs").
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- a48558b: Product Display card spacing changes
|
|
14
|
+
|
|
3
15
|
## 0.4.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -13683,12 +13683,13 @@ var PictureSelector = React60__default.default.forwardRef(
|
|
|
13683
13683
|
}
|
|
13684
13684
|
);
|
|
13685
13685
|
PictureSelector.displayName = "PictureSelector";
|
|
13686
|
-
var
|
|
13687
|
-
days: "days",
|
|
13688
|
-
hours: "hrs",
|
|
13689
|
-
minutes: "min",
|
|
13690
|
-
seconds: "secs"
|
|
13686
|
+
var DEFAULT_UNIT_LABELS = {
|
|
13687
|
+
days: { singular: "day", plural: "days" },
|
|
13688
|
+
hours: { singular: "hr", plural: "hrs" },
|
|
13689
|
+
minutes: { singular: "min", plural: "min" },
|
|
13690
|
+
seconds: { singular: "sec", plural: "secs" }
|
|
13691
13691
|
};
|
|
13692
|
+
var resolveLabel = (label, value) => typeof label === "string" ? label : value === 1 ? label.singular : label.plural;
|
|
13692
13693
|
var parseTokenValue54 = (value) => parseFloat(value);
|
|
13693
13694
|
var pad = (value) => String(Math.max(0, Math.floor(value))).padStart(2, "0");
|
|
13694
13695
|
var StackedRoot = styled60__default.default(reactNative.View)(({ rootGap }) => ({
|
|
@@ -13766,7 +13767,8 @@ var Countdown = React60__default.default.forwardRef(
|
|
|
13766
13767
|
seconds = 0,
|
|
13767
13768
|
showDays = true,
|
|
13768
13769
|
showSeconds = true,
|
|
13769
|
-
label
|
|
13770
|
+
label,
|
|
13771
|
+
labels
|
|
13770
13772
|
} = _b, rest = __objRest(_b, [
|
|
13771
13773
|
"layout",
|
|
13772
13774
|
"days",
|
|
@@ -13775,23 +13777,33 @@ var Countdown = React60__default.default.forwardRef(
|
|
|
13775
13777
|
"seconds",
|
|
13776
13778
|
"showDays",
|
|
13777
13779
|
"showSeconds",
|
|
13778
|
-
"label"
|
|
13780
|
+
"label",
|
|
13781
|
+
"labels"
|
|
13779
13782
|
]);
|
|
13780
13783
|
const theme2 = react.useTheme();
|
|
13781
13784
|
const { countdown } = theme2.tokens.components;
|
|
13782
13785
|
const { countdownItem } = countdown;
|
|
13786
|
+
const unitLabels = __spreadValues(__spreadValues({}, DEFAULT_UNIT_LABELS), labels);
|
|
13783
13787
|
const units = [
|
|
13784
13788
|
showDays && {
|
|
13785
13789
|
key: "days",
|
|
13786
13790
|
value: days,
|
|
13787
|
-
label:
|
|
13791
|
+
label: resolveLabel(unitLabels.days, days)
|
|
13792
|
+
},
|
|
13793
|
+
{
|
|
13794
|
+
key: "hours",
|
|
13795
|
+
value: hours,
|
|
13796
|
+
label: resolveLabel(unitLabels.hours, hours)
|
|
13797
|
+
},
|
|
13798
|
+
{
|
|
13799
|
+
key: "minutes",
|
|
13800
|
+
value: minutes,
|
|
13801
|
+
label: resolveLabel(unitLabels.minutes, minutes)
|
|
13788
13802
|
},
|
|
13789
|
-
{ key: "hours", value: hours, label: UNIT_LABELS.hours },
|
|
13790
|
-
{ key: "minutes", value: minutes, label: UNIT_LABELS.minutes },
|
|
13791
13803
|
showSeconds && {
|
|
13792
13804
|
key: "seconds",
|
|
13793
13805
|
value: seconds,
|
|
13794
|
-
label:
|
|
13806
|
+
label: resolveLabel(unitLabels.seconds, seconds)
|
|
13795
13807
|
}
|
|
13796
13808
|
].filter(Boolean);
|
|
13797
13809
|
const colon = (key) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14165,36 +14177,47 @@ var ProductListingCardWithBadgeAndGrid = Object.assign(_ProductListingCard, {
|
|
|
14165
14177
|
Badge: Badge2,
|
|
14166
14178
|
Grid
|
|
14167
14179
|
});
|
|
14168
|
-
var StyledCardContainer = styled60__default.default(reactNative.View)(({
|
|
14180
|
+
var StyledCardContainer = styled60__default.default(reactNative.View)(({
|
|
14181
|
+
theme: theme2,
|
|
14182
|
+
borderless
|
|
14183
|
+
}) => {
|
|
14169
14184
|
const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
14170
14185
|
const { colour } = theme2.tokens.semantics;
|
|
14171
14186
|
const spacingMd = parseTokenValue8(spacing.md);
|
|
14172
14187
|
const spacingXl = parseTokenValue8(spacing.xl);
|
|
14173
|
-
return {
|
|
14188
|
+
return __spreadProps(__spreadValues({
|
|
14174
14189
|
flexDirection: "row",
|
|
14175
14190
|
width: "100%",
|
|
14176
|
-
height: "100%",
|
|
14191
|
+
height: borderless ? void 0 : "100%",
|
|
14177
14192
|
maxHeight: spacingXl * 6 + spacingMd,
|
|
14178
|
-
backgroundColor: colour.background.surface.default
|
|
14193
|
+
backgroundColor: colour.background.surface.default
|
|
14194
|
+
}, borderless ? {} : {
|
|
14179
14195
|
borderWidth: 1,
|
|
14180
14196
|
borderColor: colour.border.default,
|
|
14181
|
-
borderRadius: parseTokenValue8(borderRadius.md),
|
|
14182
|
-
overflow: "hidden",
|
|
14183
14197
|
shadowColor: "#522a10",
|
|
14184
14198
|
shadowOffset: { width: 0, height: spacingMd / 4 },
|
|
14185
14199
|
shadowOpacity: 0.05,
|
|
14186
14200
|
shadowRadius: spacingXl - 4,
|
|
14187
|
-
elevation: 5
|
|
14201
|
+
elevation: 5
|
|
14202
|
+
}), {
|
|
14203
|
+
borderRadius: parseTokenValue8(borderRadius.md),
|
|
14204
|
+
overflow: "hidden",
|
|
14188
14205
|
zIndex: 1
|
|
14189
|
-
};
|
|
14206
|
+
});
|
|
14190
14207
|
});
|
|
14191
14208
|
var StyledImage3 = styled60__default.default(reactNative.View)(
|
|
14192
|
-
({
|
|
14209
|
+
({
|
|
14210
|
+
theme: theme2,
|
|
14211
|
+
imageBackgroundColor,
|
|
14212
|
+
thumbnailWidth = 100,
|
|
14213
|
+
thumbnailBackgroundColor
|
|
14214
|
+
}) => ({
|
|
14193
14215
|
flexShrink: 0,
|
|
14194
|
-
backgroundColor: imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
|
|
14216
|
+
backgroundColor: thumbnailBackgroundColor || imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
|
|
14195
14217
|
overflow: "hidden",
|
|
14196
14218
|
aspectRatio: "1 / 1",
|
|
14197
|
-
|
|
14219
|
+
width: thumbnailWidth,
|
|
14220
|
+
height: thumbnailWidth,
|
|
14198
14221
|
position: "relative"
|
|
14199
14222
|
})
|
|
14200
14223
|
);
|
|
@@ -14216,12 +14239,16 @@ var StyledQuantityBadge = styled60__default.default(reactNative.View)(({ theme:
|
|
|
14216
14239
|
zIndex: 2
|
|
14217
14240
|
};
|
|
14218
14241
|
});
|
|
14219
|
-
var StyledContentArea = styled60__default.default(reactNative.View)(({
|
|
14242
|
+
var StyledContentArea = styled60__default.default(reactNative.View)(({
|
|
14243
|
+
theme: theme2,
|
|
14244
|
+
borderless
|
|
14245
|
+
}) => {
|
|
14220
14246
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
14247
|
+
const paddingValue = parseTokenValue8(spacing.md);
|
|
14221
14248
|
return {
|
|
14222
14249
|
flex: 1,
|
|
14223
|
-
paddingHorizontal:
|
|
14224
|
-
paddingVertical:
|
|
14250
|
+
paddingHorizontal: paddingValue,
|
|
14251
|
+
paddingVertical: borderless ? 0 : paddingValue,
|
|
14225
14252
|
gap: parseTokenValue8(spacing.xs),
|
|
14226
14253
|
justifyContent: "space-between"
|
|
14227
14254
|
};
|
|
@@ -14253,7 +14280,6 @@ var StyledNotification = styled60__default.default(Notification)(({ theme: theme
|
|
|
14253
14280
|
var ProductDisplayCard = React60__default.default.forwardRef(
|
|
14254
14281
|
(_a, ref) => {
|
|
14255
14282
|
var _b = _a, {
|
|
14256
|
-
device = "mobile",
|
|
14257
14283
|
title,
|
|
14258
14284
|
subtext,
|
|
14259
14285
|
showSubtext = true,
|
|
@@ -14268,13 +14294,15 @@ var ProductDisplayCard = React60__default.default.forwardRef(
|
|
|
14268
14294
|
decrementDisabled = false,
|
|
14269
14295
|
image,
|
|
14270
14296
|
imageBackgroundColor,
|
|
14297
|
+
thumbnailWidth,
|
|
14298
|
+
thumbnailBackgroundColor,
|
|
14271
14299
|
showImageQuantityBadge = false,
|
|
14300
|
+
borderless = false,
|
|
14272
14301
|
banner,
|
|
14273
14302
|
showBanner = false,
|
|
14274
14303
|
bannerType = "info",
|
|
14275
14304
|
showBannerIcon = false
|
|
14276
14305
|
} = _b, rest = __objRest(_b, [
|
|
14277
|
-
"device",
|
|
14278
14306
|
"title",
|
|
14279
14307
|
"subtext",
|
|
14280
14308
|
"showSubtext",
|
|
@@ -14289,7 +14317,10 @@ var ProductDisplayCard = React60__default.default.forwardRef(
|
|
|
14289
14317
|
"decrementDisabled",
|
|
14290
14318
|
"image",
|
|
14291
14319
|
"imageBackgroundColor",
|
|
14320
|
+
"thumbnailWidth",
|
|
14321
|
+
"thumbnailBackgroundColor",
|
|
14292
14322
|
"showImageQuantityBadge",
|
|
14323
|
+
"borderless",
|
|
14293
14324
|
"banner",
|
|
14294
14325
|
"showBanner",
|
|
14295
14326
|
"bannerType",
|
|
@@ -14300,20 +14331,28 @@ var ProductDisplayCard = React60__default.default.forwardRef(
|
|
|
14300
14331
|
onQuantityChange == null ? void 0 : onQuantityChange(newQuantity);
|
|
14301
14332
|
}
|
|
14302
14333
|
};
|
|
14303
|
-
const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref,
|
|
14304
|
-
image && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14334
|
+
const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref, borderless }, rest), { children: [
|
|
14335
|
+
image && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
14336
|
+
StyledImage3,
|
|
14337
|
+
{
|
|
14338
|
+
imageBackgroundColor,
|
|
14339
|
+
thumbnailWidth,
|
|
14340
|
+
thumbnailBackgroundColor,
|
|
14341
|
+
children: [
|
|
14342
|
+
typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
14343
|
+
reactNative.Image,
|
|
14344
|
+
{
|
|
14345
|
+
source: { uri: image },
|
|
14346
|
+
style: { width: "100%", height: "100%" }
|
|
14347
|
+
}
|
|
14348
|
+
) : image,
|
|
14349
|
+
showImageQuantityBadge && quantity && /* @__PURE__ */ jsxRuntime.jsx(StyledQuantityBadge, { children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", weight: "bold", children: quantity }) })
|
|
14350
|
+
]
|
|
14351
|
+
}
|
|
14352
|
+
),
|
|
14353
|
+
/* @__PURE__ */ jsxRuntime.jsxs(StyledContentArea, { borderless, children: [
|
|
14315
14354
|
/* @__PURE__ */ jsxRuntime.jsxs(StyledTextContainer, { children: [
|
|
14316
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "
|
|
14355
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
|
|
14317
14356
|
showSubtext && subtext && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
|
|
14318
14357
|
] }),
|
|
14319
14358
|
showQuantityPicker && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|