@butternutbox/pawprint-native 0.25.1 → 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.
Files changed (34) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/CHANGELOG.md +20 -0
  3. package/dist/index.cjs +19 -50
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +36 -10
  6. package/dist/index.d.ts +36 -10
  7. package/dist/index.js +9 -37
  8. package/dist/index.js.map +1 -1
  9. package/package.json +2 -1
  10. package/src/components/atoms/Button/Button.tsx +1 -1
  11. package/src/components/atoms/Input/InputField.tsx +1 -1
  12. package/src/components/atoms/TextArea/TextAreaField.tsx +1 -1
  13. package/src/components/atoms/Typography/Typography.tsx +1 -1
  14. package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.styled.ts +1 -1
  15. package/src/components/molecules/NumberField/NumberFieldInput.tsx +1 -1
  16. package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.stories.tsx +40 -5
  17. package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.test.tsx +55 -0
  18. package/src/components/molecules/ProductDisplayCard/ProductDisplayCard.tsx +35 -9
  19. package/src/index.ts +1 -1
  20. package/tsup.config.ts +1 -2
  21. package/dist/ibm-plex-sans-condensed-400-normal.ttf +0 -0
  22. package/dist/ibm-plex-sans-condensed-500-normal.ttf +0 -0
  23. package/dist/ibm-plex-sans-condensed-600-normal.ttf +0 -0
  24. package/dist/ibm-plex-sans-condensed-700-normal.ttf +0 -0
  25. package/dist/ida-narrow-500-normal.ttf +0 -0
  26. package/dist/ida-narrow-700-normal.ttf +0 -0
  27. package/src/fonts/ibm-plex-sans-condensed-400-normal.ttf +0 -0
  28. package/src/fonts/ibm-plex-sans-condensed-500-normal.ttf +0 -0
  29. package/src/fonts/ibm-plex-sans-condensed-600-normal.ttf +0 -0
  30. package/src/fonts/ibm-plex-sans-condensed-700-normal.ttf +0 -0
  31. package/src/fonts/ida-narrow-500-normal.ttf +0 -0
  32. package/src/fonts/ida-narrow-700-normal.ttf +0 -0
  33. package/src/fonts/index.ts +0 -48
  34. package/src/types/fonts.d.ts +0 -4
@@ -7,12 +7,12 @@
7
7
  CJS Build start
8
8
  ESM Build start
9
9
  DTS Build start
10
- CJS dist/index.cjs 555.31 KB
10
+ CJS dist/index.cjs 553.93 KB
11
11
  CJS dist/index.cjs.map 1.08 MB
12
- CJS ⚡️ Build success in 8617ms
13
- ESM dist/index.js 524.64 KB
12
+ CJS ⚡️ Build success in 7609ms
13
+ ESM dist/index.js 523.65 KB
14
14
  ESM dist/index.js.map 1.08 MB
15
- ESM ⚡️ Build success in 8621ms
16
- DTS ⚡️ Build success in 23481ms
17
- DTS dist/index.d.cts 103.29 KB
18
- DTS dist/index.d.ts 103.29 KB
15
+ ESM ⚡️ Build success in 7611ms
16
+ DTS ⚡️ Build success in 20912ms
17
+ DTS dist/index.d.cts 104.52 KB
18
+ DTS dist/index.d.ts 104.52 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
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
+
13
+ ## 1.0.0
14
+
15
+ ### Major Changes
16
+
17
+ - 8d9c9e7: Adopt `@butternutbox/pawprint-fonts` as the source of brand font assets.
18
+ - **Native** — `.ttf` files and font helpers no longer ship inside `@butternutbox/pawprint-native`. The package now depends on `@butternutbox/pawprint-fonts` and re-exports `BRAND_FONTS` / `resolveFont` from it, so consumers importing those symbols from `@butternutbox/pawprint-native` continue to work with no code changes. Downstream Expo apps should add `@butternutbox/pawprint-fonts` to their dependencies alongside the bump.
19
+ - **Web** — Ida Narrow `.woff2` files no longer ship inside `@butternutbox/pawprint-web`. Ida Narrow is imported via `@butternutbox/pawprint-fonts/*.woff2` subpath imports and resolved at consumer build time (Next.js, Vite, and webpack handle `.woff2` imports out of the box). IBM Plex Sans Condensed (from `@fontsource/ibm-plex-sans-condensed`) continues to be inlined into the bundle as before.
20
+
21
+ Why: font bytes shipped inside `pawprint-native` are embedded into the native app bundle by `expo-font`, so any change flows into Expo's fingerprint and forces a native rebuild in consuming apps. Font bytes inside `pawprint-web` bloat every published bundle. Moving them into a separately-versioned `pawprint-fonts` package that changes rarely avoids both — JS-only bumps to these packages no longer touch font bytes downstream.
22
+
3
23
  ## 0.25.1
4
24
 
5
25
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -3,12 +3,7 @@
3
3
  var react = require('@emotion/react');
4
4
  var pawprintTokens = require('@butternutbox/pawprint-tokens');
5
5
  var styled51 = require('@emotion/native');
6
- var idaNarrow500 = require('./ida-narrow-500-normal.ttf');
7
- var idaNarrow700 = require('./ida-narrow-700-normal.ttf');
8
- var ibmPlexSansCondensed400 = require('./ibm-plex-sans-condensed-400-normal.ttf');
9
- var ibmPlexSansCondensed500 = require('./ibm-plex-sans-condensed-500-normal.ttf');
10
- var ibmPlexSansCondensed600 = require('./ibm-plex-sans-condensed-600-normal.ttf');
11
- var ibmPlexSansCondensed700 = require('./ibm-plex-sans-condensed-700-normal.ttf');
6
+ var pawprintFonts = require('@butternutbox/pawprint-fonts');
12
7
  var React66 = require('react');
13
8
  var jsxRuntime = require('react/jsx-runtime');
14
9
  var AvatarPrimitive = require('@rn-primitives/avatar');
@@ -48,12 +43,6 @@ function _interopNamespace(e) {
48
43
  }
49
44
 
50
45
  var styled51__default = /*#__PURE__*/_interopDefault(styled51);
51
- var idaNarrow500__default = /*#__PURE__*/_interopDefault(idaNarrow500);
52
- var idaNarrow700__default = /*#__PURE__*/_interopDefault(idaNarrow700);
53
- var ibmPlexSansCondensed400__default = /*#__PURE__*/_interopDefault(ibmPlexSansCondensed400);
54
- var ibmPlexSansCondensed500__default = /*#__PURE__*/_interopDefault(ibmPlexSansCondensed500);
55
- var ibmPlexSansCondensed600__default = /*#__PURE__*/_interopDefault(ibmPlexSansCondensed600);
56
- var ibmPlexSansCondensed700__default = /*#__PURE__*/_interopDefault(ibmPlexSansCondensed700);
57
46
  var React66__default = /*#__PURE__*/_interopDefault(React66);
58
47
  var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
59
48
  var Svg__default = /*#__PURE__*/_interopDefault(Svg);
@@ -116,33 +105,6 @@ var __async = (__this, __arguments, generator) => {
116
105
  step((generator = generator.apply(__this, __arguments)).next());
117
106
  });
118
107
  };
119
- var BRAND_FONTS = {
120
- [pawprintTokens.Brand.Butternutbox]: {
121
- "IdaWebNarrow-Medium": idaNarrow500__default.default,
122
- "IdaWebNarrow-Bold": idaNarrow700__default.default,
123
- "IBMPlexSansCond-Regular": ibmPlexSansCondensed400__default.default,
124
- "IBMPlexSansCond-Medium": ibmPlexSansCondensed500__default.default,
125
- "IBMPlexSansCond-SemiBold": ibmPlexSansCondensed600__default.default,
126
- "IBMPlexSansCond-Bold": ibmPlexSansCondensed700__default.default
127
- }
128
- };
129
- var FONT_MAP = {
130
- "IBM Plex Sans Condensed": {
131
- "400": "IBMPlexSansCond-Regular",
132
- "500": "IBMPlexSansCond-Medium",
133
- "600": "IBMPlexSansCond-SemiBold",
134
- "700": "IBMPlexSansCond-Bold"
135
- },
136
- "Ida Narrow": {
137
- "500": "IdaWebNarrow-Medium",
138
- "700": "IdaWebNarrow-Bold"
139
- }
140
- };
141
- var resolveFont = (fontFamily, fontWeight) => {
142
- var _a;
143
- const resolved = (_a = FONT_MAP[fontFamily]) == null ? void 0 : _a[fontWeight];
144
- return { fontFamily: resolved != null ? resolved : fontFamily };
145
- };
146
108
  var createPawprintTheme = (brand = pawprintTokens.Brand.Butternutbox, theme2 = pawprintTokens.Theme.Default) => {
147
109
  const brandThemes = pawprintTokens.THEME_OPTIONS_MAP[brand];
148
110
  const themeOptions = brandThemes && theme2 in brandThemes ? brandThemes[theme2] : pawprintTokens.DEFAULT_THEME_OPTIONS;
@@ -193,7 +155,7 @@ var resolveLetterSpacing = (letterSpacing, fontSize) => {
193
155
  return parseFloat(letterSpacing);
194
156
  };
195
157
  var semanticToStyle = (token) => {
196
- const { fontFamily } = resolveFont(token.fontFamily, token.fontWeight);
158
+ const { fontFamily } = pawprintFonts.resolveFont(token.fontFamily, token.fontWeight);
197
159
  const fontSize = parseTokenValue(token.fontSize);
198
160
  return __spreadValues({
199
161
  fontFamily,
@@ -206,7 +168,7 @@ var semanticToStyle = (token) => {
206
168
  var nativeTokenToStyle = (token) => {
207
169
  const style = {};
208
170
  if (token.fontFamily && token.fontWeight) {
209
- const { fontFamily } = resolveFont(token.fontFamily, token.fontWeight);
171
+ const { fontFamily } = pawprintFonts.resolveFont(token.fontFamily, token.fontWeight);
210
172
  style.fontFamily = fontFamily;
211
173
  } else if (token.fontFamily) {
212
174
  style.fontFamily = token.fontFamily;
@@ -1270,7 +1232,7 @@ var Button = React66__default.default.forwardRef(
1270
1232
  const spacingTokens = buttons.spacing[size];
1271
1233
  const typographyKey = sizeToTypographyKey[size];
1272
1234
  const typography = buttons.text[typographyKey];
1273
- resolveFont(typography.fontFamily, typography.fontWeight);
1235
+ pawprintFonts.resolveFont(typography.fontFamily, typography.fontWeight);
1274
1236
  const [pressed, setPressed] = React66__default.default.useState(false);
1275
1237
  const getVariantStyles = (isPressed) => {
1276
1238
  if (variant === "filled") {
@@ -1680,7 +1642,7 @@ var StyledInput = styled51__default.default(reactNative.TextInput)(({
1680
1642
  var _a, _b;
1681
1643
  const { colour, field } = theme2.tokens.components.inputs;
1682
1644
  const typography = field.placeholder.default;
1683
- const { fontFamily } = resolveFont(
1645
+ const { fontFamily } = pawprintFonts.resolveFont(
1684
1646
  typography.fontFamily,
1685
1647
  typography.fontWeight
1686
1648
  );
@@ -5014,7 +4976,7 @@ var StyledTextArea = styled51__default.default(reactNative.TextInput)(({ theme:
5014
4976
  var _a, _b;
5015
4977
  const { colour, field } = theme2.tokens.components.inputs;
5016
4978
  const typography = field.placeholder.default;
5017
- const { fontFamily } = resolveFont(
4979
+ const { fontFamily } = pawprintFonts.resolveFont(
5018
4980
  typography.fontFamily,
5019
4981
  typography.fontWeight
5020
4982
  );
@@ -7448,7 +7410,7 @@ var NumberFieldInput = React66__default.default.forwardRef(
7448
7410
  [onChangeText]
7449
7411
  );
7450
7412
  const typographyToken = fieldSize === "lg" ? tokens3.typography.field.large : tokens3.typography.field.small;
7451
- const resolvedInputFontFamily = typographyToken.fontFamily && typographyToken.fontWeight ? resolveFont(typographyToken.fontFamily, typographyToken.fontWeight).fontFamily : typographyToken.fontFamily;
7413
+ const resolvedInputFontFamily = typographyToken.fontFamily && typographyToken.fontWeight ? pawprintFonts.resolveFont(typographyToken.fontFamily, typographyToken.fontWeight).fontFamily : typographyToken.fontFamily;
7452
7414
  return /* @__PURE__ */ jsxRuntime.jsxs(StyledRow, { rowGap: parseTokenValue35(sizeTokens.group.gap), children: [
7453
7415
  showDecrementButton && /* @__PURE__ */ jsxRuntime.jsx(
7454
7416
  IconButton,
@@ -9368,7 +9330,7 @@ var parseSize = (value) => {
9368
9330
  };
9369
9331
  var resolveTypography = (typography) => {
9370
9332
  var _a, _b;
9371
- const { fontFamily } = resolveFont(
9333
+ const { fontFamily } = pawprintFonts.resolveFont(
9372
9334
  typography.fontFamily,
9373
9335
  typography.fontWeight
9374
9336
  );
@@ -12300,6 +12262,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
12300
12262
  onQuantityChange,
12301
12263
  showQuantityPicker = false,
12302
12264
  quantityBadge = false,
12265
+ thumbnailBadge,
12303
12266
  disableQuantityButtons = false,
12304
12267
  hideQuantityButtons = false,
12305
12268
  incrementDisabled = false,
@@ -12322,6 +12285,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
12322
12285
  "onQuantityChange",
12323
12286
  "showQuantityPicker",
12324
12287
  "quantityBadge",
12288
+ "thumbnailBadge",
12325
12289
  "disableQuantityButtons",
12326
12290
  "hideQuantityButtons",
12327
12291
  "incrementDisabled",
@@ -12342,6 +12306,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
12342
12306
  onQuantityChange == null ? void 0 : onQuantityChange(newQuantity);
12343
12307
  }
12344
12308
  };
12309
+ const resolvedBadgeProps = thumbnailBadge != null ? thumbnailBadge : quantityBadge ? { variant: "primary", size: "large", children: String(quantity) } : void 0;
12345
12310
  const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(
12346
12311
  StyledCardContainer,
12347
12312
  __spreadProps(__spreadValues({
@@ -12363,7 +12328,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
12363
12328
  style: { flex: 1, width: "100%" }
12364
12329
  }
12365
12330
  ) : image,
12366
- quantityBadge && /* @__PURE__ */ jsxRuntime.jsx(StyledBadgeOverlay, { pointerEvents: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "large", children: String(quantity) }) })
12331
+ resolvedBadgeProps && /* @__PURE__ */ jsxRuntime.jsx(StyledBadgeOverlay, { pointerEvents: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, __spreadValues({}, resolvedBadgeProps)) })
12367
12332
  ]
12368
12333
  }
12369
12334
  ) }),
@@ -12372,7 +12337,7 @@ var ProductDisplayCard = React66__default.default.forwardRef(
12372
12337
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading", size: "2xs", color: "primary", children: title }),
12373
12338
  showSubtext && subtext && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", size: "sm", color: "secondary", children: subtext })
12374
12339
  ] }),
12375
- showQuantityPicker && !quantityBadge && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
12340
+ showQuantityPicker && !resolvedBadgeProps && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { marginLeft: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(
12376
12341
  NumberField,
12377
12342
  {
12378
12343
  size: "sm",
@@ -12606,7 +12571,6 @@ Object.defineProperty(exports, "styled", {
12606
12571
  exports.Accordion = Accordion;
12607
12572
  exports.Animated = Animated5;
12608
12573
  exports.Avatar = Avatar;
12609
- exports.BRAND_FONTS = BRAND_FONTS;
12610
12574
  exports.Badge = Badge;
12611
12575
  exports.Button = Button;
12612
12576
  exports.ButtonDock = ButtonDock;
@@ -12680,7 +12644,6 @@ exports.fadeAnimation = fadeAnimation;
12680
12644
  exports.fadeDownAnimation = fadeDownAnimation;
12681
12645
  exports.fadeUpAnimation = fadeUpAnimation;
12682
12646
  exports.registerLogo = registerLogo;
12683
- exports.resolveFont = resolveFont;
12684
12647
  exports.resolveLogo = resolveLogo;
12685
12648
  exports.scaleAnimation = scaleAnimation;
12686
12649
  exports.slideInAnimation = slideInAnimation;
@@ -12692,5 +12655,11 @@ exports.usePasswordField = usePasswordField;
12692
12655
  exports.usePawprint = usePawprint;
12693
12656
  exports.useSearchField = useSearchField;
12694
12657
  exports.useSelectField = useSelectField;
12658
+ Object.keys(pawprintFonts).forEach(function (k) {
12659
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
12660
+ enumerable: true,
12661
+ get: function () { return pawprintFonts[k]; }
12662
+ });
12663
+ });
12695
12664
  //# sourceMappingURL=index.cjs.map
12696
12665
  //# sourceMappingURL=index.cjs.map