@butternutbox/pawprint-native 0.4.0 → 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.
@@ -14,8 +14,8 @@
14
14
  ESM dist/ibm-plex-sans-condensed-600-normal-UX5ZU5T6.woff2 19.35 KB
15
15
  ESM dist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 18.90 KB
16
16
  ESM dist/index.js 1.70 MB
17
- ESM dist/index.js.map 2.64 MB
18
- ESM ⚡️ Build success in 11381ms
17
+ ESM dist/index.js.map 2.65 MB
18
+ ESM ⚡️ Build success in 11263ms
19
19
  CJS dist/ida-narrow-500-normal-C6I2PK4T.woff2 47.41 KB
20
20
  CJS dist/ida-narrow-700-normal-UPHPRIN6.woff2 49.90 KB
21
21
  CJS dist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 19.33 KB
@@ -24,7 +24,7 @@
24
24
  CJS dist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 18.90 KB
25
25
  CJS dist/index.cjs 1.77 MB
26
26
  CJS dist/index.cjs.map 2.65 MB
27
- CJS ⚡️ Build success in 11382ms
28
- DTS ⚡️ Build success in 21549ms
29
- DTS dist/index.d.cts 87.33 KB
30
- DTS dist/index.d.ts 87.33 KB
27
+ CJS ⚡️ Build success in 11267ms
28
+ DTS ⚡️ Build success in 22041ms
29
+ DTS dist/index.d.cts 88.44 KB
30
+ DTS dist/index.d.ts 88.44 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
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
+
15
+ ## 0.4.1
16
+
17
+ ### Patch Changes
18
+
19
+ - ec6f6b4: Add additional quantity within thumbnail of display card
20
+
3
21
  ## 0.4.0
4
22
 
5
23
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -10190,28 +10190,20 @@ var StyledFieldWrapper = styled60__default.default(reactNative.View)(
10190
10190
  overflow: "hidden"
10191
10191
  })
10192
10192
  );
10193
- var StyledTextInput = styled60__default.default(reactNative.TextInput)(
10194
- ({
10195
- inputColor,
10196
- inputFontFamily,
10197
- inputFontWeight,
10198
- inputFontSize,
10199
- inputLineHeight
10200
- }) => __spreadProps(__spreadValues({
10201
- textAlign: "center",
10202
- outlineStyle: "none",
10203
- padding: 0,
10204
- minWidth: 0,
10205
- minHeight: 0,
10206
- width: "100%",
10207
- height: "100%",
10208
- color: inputColor,
10209
- fontFamily: inputFontFamily
10210
- }, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
10211
- fontSize: inputFontSize,
10212
- lineHeight: inputLineHeight
10213
- })
10214
- );
10193
+ var StyledTextInput = styled60__default.default(reactNative.TextInput)(({ inputColor, inputFontFamily, inputFontWeight, inputFontSize }) => __spreadProps(__spreadValues({
10194
+ textAlign: "center",
10195
+ outlineStyle: "none",
10196
+ padding: 0,
10197
+ minWidth: 0,
10198
+ minHeight: 0,
10199
+ width: "100%",
10200
+ height: "100%",
10201
+ color: inputColor,
10202
+ fontFamily: inputFontFamily
10203
+ }, inputFontWeight ? { fontWeight: inputFontWeight } : {}), {
10204
+ fontSize: inputFontSize,
10205
+ lineHeight: 0
10206
+ }));
10215
10207
  var StyledRow = styled60__default.default(reactNative.View)(({ rowGap }) => ({
10216
10208
  flexDirection: "row",
10217
10209
  alignItems: "center",
@@ -10345,7 +10337,6 @@ var NumberFieldInput = React60__default.default.forwardRef(
10345
10337
  inputFontFamily: resolvedInputFontFamily,
10346
10338
  inputFontWeight: resolvedInputFontFamily === typographyToken.fontFamily ? typographyToken.fontWeight : void 0,
10347
10339
  inputFontSize: parseTokenValue34(typographyToken.fontSize),
10348
- inputLineHeight: parseTokenValue34(typographyToken.lineHeight),
10349
10340
  keyboardType: "numeric",
10350
10341
  editable: !disabled,
10351
10342
  onFocus: handleFocus,
@@ -13692,12 +13683,13 @@ var PictureSelector = React60__default.default.forwardRef(
13692
13683
  }
13693
13684
  );
13694
13685
  PictureSelector.displayName = "PictureSelector";
13695
- var UNIT_LABELS = {
13696
- days: "days",
13697
- hours: "hrs",
13698
- minutes: "min",
13699
- 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" }
13700
13691
  };
13692
+ var resolveLabel = (label, value) => typeof label === "string" ? label : value === 1 ? label.singular : label.plural;
13701
13693
  var parseTokenValue54 = (value) => parseFloat(value);
13702
13694
  var pad = (value) => String(Math.max(0, Math.floor(value))).padStart(2, "0");
13703
13695
  var StackedRoot = styled60__default.default(reactNative.View)(({ rootGap }) => ({
@@ -13775,7 +13767,8 @@ var Countdown = React60__default.default.forwardRef(
13775
13767
  seconds = 0,
13776
13768
  showDays = true,
13777
13769
  showSeconds = true,
13778
- label
13770
+ label,
13771
+ labels
13779
13772
  } = _b, rest = __objRest(_b, [
13780
13773
  "layout",
13781
13774
  "days",
@@ -13784,23 +13777,33 @@ var Countdown = React60__default.default.forwardRef(
13784
13777
  "seconds",
13785
13778
  "showDays",
13786
13779
  "showSeconds",
13787
- "label"
13780
+ "label",
13781
+ "labels"
13788
13782
  ]);
13789
13783
  const theme2 = react.useTheme();
13790
13784
  const { countdown } = theme2.tokens.components;
13791
13785
  const { countdownItem } = countdown;
13786
+ const unitLabels = __spreadValues(__spreadValues({}, DEFAULT_UNIT_LABELS), labels);
13792
13787
  const units = [
13793
13788
  showDays && {
13794
13789
  key: "days",
13795
13790
  value: days,
13796
- label: UNIT_LABELS.days
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)
13797
13802
  },
13798
- { key: "hours", value: hours, label: UNIT_LABELS.hours },
13799
- { key: "minutes", value: minutes, label: UNIT_LABELS.minutes },
13800
13803
  showSeconds && {
13801
13804
  key: "seconds",
13802
13805
  value: seconds,
13803
- label: UNIT_LABELS.seconds
13806
+ label: resolveLabel(unitLabels.seconds, seconds)
13804
13807
  }
13805
13808
  ].filter(Boolean);
13806
13809
  const colon = (key) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -14174,42 +14177,78 @@ var ProductListingCardWithBadgeAndGrid = Object.assign(_ProductListingCard, {
14174
14177
  Badge: Badge2,
14175
14178
  Grid
14176
14179
  });
14177
- var StyledCardContainer = styled60__default.default(reactNative.View)(({ theme: theme2 }) => {
14180
+ var StyledCardContainer = styled60__default.default(reactNative.View)(({
14181
+ theme: theme2,
14182
+ borderless
14183
+ }) => {
14178
14184
  const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
14179
14185
  const { colour } = theme2.tokens.semantics;
14180
14186
  const spacingMd = parseTokenValue8(spacing.md);
14181
14187
  const spacingXl = parseTokenValue8(spacing.xl);
14182
- return {
14188
+ return __spreadProps(__spreadValues({
14183
14189
  flexDirection: "row",
14184
14190
  width: "100%",
14185
- height: "100%",
14191
+ height: borderless ? void 0 : "100%",
14186
14192
  maxHeight: spacingXl * 6 + spacingMd,
14187
- backgroundColor: colour.background.surface.default,
14193
+ backgroundColor: colour.background.surface.default
14194
+ }, borderless ? {} : {
14188
14195
  borderWidth: 1,
14189
14196
  borderColor: colour.border.default,
14190
- borderRadius: parseTokenValue8(borderRadius.md),
14191
- overflow: "hidden",
14192
14197
  shadowColor: "#522a10",
14193
14198
  shadowOffset: { width: 0, height: spacingMd / 4 },
14194
14199
  shadowOpacity: 0.05,
14195
14200
  shadowRadius: spacingXl - 4,
14196
- elevation: 5,
14201
+ elevation: 5
14202
+ }), {
14203
+ borderRadius: parseTokenValue8(borderRadius.md),
14204
+ overflow: "hidden",
14197
14205
  zIndex: 1
14206
+ });
14207
+ });
14208
+ var StyledImage3 = styled60__default.default(reactNative.View)(
14209
+ ({
14210
+ theme: theme2,
14211
+ imageBackgroundColor,
14212
+ thumbnailWidth = 100,
14213
+ thumbnailBackgroundColor
14214
+ }) => ({
14215
+ flexShrink: 0,
14216
+ backgroundColor: thumbnailBackgroundColor || imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
14217
+ overflow: "hidden",
14218
+ aspectRatio: "1 / 1",
14219
+ width: thumbnailWidth,
14220
+ height: thumbnailWidth,
14221
+ position: "relative"
14222
+ })
14223
+ );
14224
+ var StyledQuantityBadge = styled60__default.default(reactNative.View)(({ theme: theme2 }) => {
14225
+ const spacing = theme2.tokens.semantics.dimensions.spacing;
14226
+ const borderRadius = theme2.tokens.semantics.dimensions.borderRadius;
14227
+ const { colour } = theme2.tokens.semantics;
14228
+ return {
14229
+ position: "absolute",
14230
+ top: parseTokenValue8(spacing["2xs"]),
14231
+ right: parseTokenValue8(spacing["2xs"]),
14232
+ backgroundColor: colour.background.container.brand,
14233
+ borderRadius: parseTokenValue8(borderRadius.xs),
14234
+ paddingHorizontal: parseTokenValue8(spacing.sm),
14235
+ height: parseTokenValue8(spacing["2xl"]),
14236
+ minWidth: parseTokenValue8(spacing["2xl"]),
14237
+ alignItems: "center",
14238
+ justifyContent: "center",
14239
+ zIndex: 2
14198
14240
  };
14199
14241
  });
14200
- var StyledImage3 = styled60__default.default(reactNative.View)(() => ({
14201
- flexShrink: 0,
14202
- backgroundColor: "#f5f5f5",
14203
- overflow: "hidden",
14204
- aspectRatio: "1 / 1",
14205
- height: "100%"
14206
- }));
14207
- var StyledContentArea = styled60__default.default(reactNative.View)(({ theme: theme2 }) => {
14242
+ var StyledContentArea = styled60__default.default(reactNative.View)(({
14243
+ theme: theme2,
14244
+ borderless
14245
+ }) => {
14208
14246
  const { spacing } = theme2.tokens.semantics.dimensions;
14247
+ const paddingValue = parseTokenValue8(spacing.md);
14209
14248
  return {
14210
14249
  flex: 1,
14211
- paddingHorizontal: parseTokenValue8(spacing.md),
14212
- paddingVertical: parseTokenValue8(spacing.md),
14250
+ paddingHorizontal: paddingValue,
14251
+ paddingVertical: borderless ? 0 : paddingValue,
14213
14252
  gap: parseTokenValue8(spacing.xs),
14214
14253
  justifyContent: "space-between"
14215
14254
  };
@@ -14241,7 +14280,6 @@ var StyledNotification = styled60__default.default(Notification)(({ theme: theme
14241
14280
  var ProductDisplayCard = React60__default.default.forwardRef(
14242
14281
  (_a, ref) => {
14243
14282
  var _b = _a, {
14244
- device = "mobile",
14245
14283
  title,
14246
14284
  subtext,
14247
14285
  showSubtext = true,
@@ -14255,12 +14293,16 @@ var ProductDisplayCard = React60__default.default.forwardRef(
14255
14293
  incrementDisabled = false,
14256
14294
  decrementDisabled = false,
14257
14295
  image,
14296
+ imageBackgroundColor,
14297
+ thumbnailWidth,
14298
+ thumbnailBackgroundColor,
14299
+ showImageQuantityBadge = false,
14300
+ borderless = false,
14258
14301
  banner,
14259
14302
  showBanner = false,
14260
14303
  bannerType = "info",
14261
14304
  showBannerIcon = false
14262
14305
  } = _b, rest = __objRest(_b, [
14263
- "device",
14264
14306
  "title",
14265
14307
  "subtext",
14266
14308
  "showSubtext",
@@ -14274,6 +14316,11 @@ var ProductDisplayCard = React60__default.default.forwardRef(
14274
14316
  "incrementDisabled",
14275
14317
  "decrementDisabled",
14276
14318
  "image",
14319
+ "imageBackgroundColor",
14320
+ "thumbnailWidth",
14321
+ "thumbnailBackgroundColor",
14322
+ "showImageQuantityBadge",
14323
+ "borderless",
14277
14324
  "banner",
14278
14325
  "showBanner",
14279
14326
  "bannerType",
@@ -14284,11 +14331,28 @@ var ProductDisplayCard = React60__default.default.forwardRef(
14284
14331
  onQuantityChange == null ? void 0 : onQuantityChange(newQuantity);
14285
14332
  }
14286
14333
  };
14287
- const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(StyledCardContainer, __spreadProps(__spreadValues({ ref, cardDevice: device }, rest), { children: [
14288
- image && /* @__PURE__ */ jsxRuntime.jsx(StyledImage3, { children: image }),
14289
- /* @__PURE__ */ jsxRuntime.jsxs(StyledContentArea, { contentDevice: device, children: [
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: [
14290
14354
  /* @__PURE__ */ jsxRuntime.jsxs(StyledTextContainer, { children: [
14291
- /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "xs", color: "primary", children: title }),
14355
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
14292
14356
  showSubtext && subtext && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
14293
14357
  ] }),
14294
14358
  showQuantityPicker && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(