@butternutbox/pawprint-native 0.25.0 → 1.0.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 +8 -8
- package/CHANGELOG.md +16 -0
- package/dist/index.cjs +26 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +16 -37
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/atoms/Button/Button.stories.tsx +90 -16
- package/src/components/atoms/Button/Button.tsx +14 -3
- package/src/components/atoms/Input/InputField.tsx +1 -1
- package/src/components/atoms/TextArea/TextAreaField.tsx +1 -1
- package/src/components/atoms/Typography/Typography.tsx +1 -1
- package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.styled.ts +1 -1
- package/src/components/molecules/NumberField/NumberFieldInput.tsx +1 -1
- package/src/index.ts +1 -1
- package/tsup.config.ts +1 -2
- package/dist/ibm-plex-sans-condensed-400-normal.ttf +0 -0
- package/dist/ibm-plex-sans-condensed-500-normal.ttf +0 -0
- package/dist/ibm-plex-sans-condensed-600-normal.ttf +0 -0
- package/dist/ibm-plex-sans-condensed-700-normal.ttf +0 -0
- package/dist/ida-narrow-500-normal.ttf +0 -0
- package/dist/ida-narrow-700-normal.ttf +0 -0
- package/src/fonts/ibm-plex-sans-condensed-400-normal.ttf +0 -0
- package/src/fonts/ibm-plex-sans-condensed-500-normal.ttf +0 -0
- package/src/fonts/ibm-plex-sans-condensed-600-normal.ttf +0 -0
- package/src/fonts/ibm-plex-sans-condensed-700-normal.ttf +0 -0
- package/src/fonts/ida-narrow-500-normal.ttf +0 -0
- package/src/fonts/ida-narrow-700-normal.ttf +0 -0
- package/src/fonts/index.ts +0 -48
- package/src/types/fonts.d.ts +0 -4
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
|
-
[
|
|
11
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.08 MB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 8316ms
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[32m524.34 KB[39m
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m523.46 KB[39m
|
|
14
11
|
[32mESM[39m [1mdist/index.js.map [22m[32m1.08 MB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 8053ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m553.74 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.08 MB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 8056ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 24238ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m103.09 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m103.09 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @butternutbox/pawprint-native
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 8d9c9e7: Adopt `@butternutbox/pawprint-fonts` as the source of brand font assets.
|
|
8
|
+
- **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.
|
|
9
|
+
- **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.
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
## 0.25.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 225f6c1: Allow custom date headers to be passed into date picker
|
|
18
|
+
|
|
3
19
|
## 0.25.0
|
|
4
20
|
|
|
5
21
|
### Minor 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
|
|
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") {
|
|
@@ -1300,6 +1262,16 @@ var Button = React66__default.default.forwardRef(
|
|
|
1300
1262
|
};
|
|
1301
1263
|
};
|
|
1302
1264
|
const variantStyles = getVariantStyles(pressed);
|
|
1265
|
+
const renderIcon = (icon) => {
|
|
1266
|
+
if (!React66__default.default.isValidElement(icon)) return icon;
|
|
1267
|
+
const iconElement = icon;
|
|
1268
|
+
if (!pressed) {
|
|
1269
|
+
return icon;
|
|
1270
|
+
}
|
|
1271
|
+
return React66__default.default.cloneElement(iconElement, {
|
|
1272
|
+
customColour: variantStyles.textColor
|
|
1273
|
+
});
|
|
1274
|
+
};
|
|
1303
1275
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1304
1276
|
StyledButton,
|
|
1305
1277
|
__spreadProps(__spreadValues({
|
|
@@ -1323,7 +1295,7 @@ var Button = React66__default.default.forwardRef(
|
|
|
1323
1295
|
buttonFullWidth: fullWidth
|
|
1324
1296
|
}, rest), {
|
|
1325
1297
|
children: [
|
|
1326
|
-
startIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: startIcon }),
|
|
1298
|
+
startIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: renderIcon(startIcon) }),
|
|
1327
1299
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1328
1300
|
Typography,
|
|
1329
1301
|
{
|
|
@@ -1339,7 +1311,7 @@ var Button = React66__default.default.forwardRef(
|
|
|
1339
1311
|
children
|
|
1340
1312
|
}
|
|
1341
1313
|
),
|
|
1342
|
-
endIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: endIcon }),
|
|
1314
|
+
endIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: renderIcon(endIcon) }),
|
|
1343
1315
|
loading && /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1344
1316
|
Spinner,
|
|
1345
1317
|
{
|
|
@@ -1670,7 +1642,7 @@ var StyledInput = styled51__default.default(reactNative.TextInput)(({
|
|
|
1670
1642
|
var _a, _b;
|
|
1671
1643
|
const { colour, field } = theme2.tokens.components.inputs;
|
|
1672
1644
|
const typography = field.placeholder.default;
|
|
1673
|
-
const { fontFamily } = resolveFont(
|
|
1645
|
+
const { fontFamily } = pawprintFonts.resolveFont(
|
|
1674
1646
|
typography.fontFamily,
|
|
1675
1647
|
typography.fontWeight
|
|
1676
1648
|
);
|
|
@@ -5004,7 +4976,7 @@ var StyledTextArea = styled51__default.default(reactNative.TextInput)(({ theme:
|
|
|
5004
4976
|
var _a, _b;
|
|
5005
4977
|
const { colour, field } = theme2.tokens.components.inputs;
|
|
5006
4978
|
const typography = field.placeholder.default;
|
|
5007
|
-
const { fontFamily } = resolveFont(
|
|
4979
|
+
const { fontFamily } = pawprintFonts.resolveFont(
|
|
5008
4980
|
typography.fontFamily,
|
|
5009
4981
|
typography.fontWeight
|
|
5010
4982
|
);
|
|
@@ -7438,7 +7410,7 @@ var NumberFieldInput = React66__default.default.forwardRef(
|
|
|
7438
7410
|
[onChangeText]
|
|
7439
7411
|
);
|
|
7440
7412
|
const typographyToken = fieldSize === "lg" ? tokens3.typography.field.large : tokens3.typography.field.small;
|
|
7441
|
-
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;
|
|
7442
7414
|
return /* @__PURE__ */ jsxRuntime.jsxs(StyledRow, { rowGap: parseTokenValue35(sizeTokens.group.gap), children: [
|
|
7443
7415
|
showDecrementButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7444
7416
|
IconButton,
|
|
@@ -9358,7 +9330,7 @@ var parseSize = (value) => {
|
|
|
9358
9330
|
};
|
|
9359
9331
|
var resolveTypography = (typography) => {
|
|
9360
9332
|
var _a, _b;
|
|
9361
|
-
const { fontFamily } = resolveFont(
|
|
9333
|
+
const { fontFamily } = pawprintFonts.resolveFont(
|
|
9362
9334
|
typography.fontFamily,
|
|
9363
9335
|
typography.fontWeight
|
|
9364
9336
|
);
|
|
@@ -12596,7 +12568,6 @@ Object.defineProperty(exports, "styled", {
|
|
|
12596
12568
|
exports.Accordion = Accordion;
|
|
12597
12569
|
exports.Animated = Animated5;
|
|
12598
12570
|
exports.Avatar = Avatar;
|
|
12599
|
-
exports.BRAND_FONTS = BRAND_FONTS;
|
|
12600
12571
|
exports.Badge = Badge;
|
|
12601
12572
|
exports.Button = Button;
|
|
12602
12573
|
exports.ButtonDock = ButtonDock;
|
|
@@ -12670,7 +12641,6 @@ exports.fadeAnimation = fadeAnimation;
|
|
|
12670
12641
|
exports.fadeDownAnimation = fadeDownAnimation;
|
|
12671
12642
|
exports.fadeUpAnimation = fadeUpAnimation;
|
|
12672
12643
|
exports.registerLogo = registerLogo;
|
|
12673
|
-
exports.resolveFont = resolveFont;
|
|
12674
12644
|
exports.resolveLogo = resolveLogo;
|
|
12675
12645
|
exports.scaleAnimation = scaleAnimation;
|
|
12676
12646
|
exports.slideInAnimation = slideInAnimation;
|
|
@@ -12682,5 +12652,11 @@ exports.usePasswordField = usePasswordField;
|
|
|
12682
12652
|
exports.usePawprint = usePawprint;
|
|
12683
12653
|
exports.useSearchField = useSearchField;
|
|
12684
12654
|
exports.useSelectField = useSelectField;
|
|
12655
|
+
Object.keys(pawprintFonts).forEach(function (k) {
|
|
12656
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
12657
|
+
enumerable: true,
|
|
12658
|
+
get: function () { return pawprintFonts[k]; }
|
|
12659
|
+
});
|
|
12660
|
+
});
|
|
12685
12661
|
//# sourceMappingURL=index.cjs.map
|
|
12686
12662
|
//# sourceMappingURL=index.cjs.map
|