@butternutbox/pawprint-native 0.25.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@butternutbox/pawprint-native",
3
- "version": "0.25.1",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "description": "ButternutBox Pawprint Design System - React Native Components",
6
6
  "main": "./dist/index.cjs",
@@ -22,6 +22,7 @@
22
22
  "test": "vitest run"
23
23
  },
24
24
  "dependencies": {
25
+ "@butternutbox/pawprint-fonts": "^2.0.0",
25
26
  "@butternutbox/pawprint-tokens": "^0.5.0",
26
27
  "@emotion/native": "^11.11.0",
27
28
  "@emotion/react": "^11.14.0",
@@ -4,7 +4,7 @@ import styled from "@emotion/native"
4
4
  import { useTheme } from "@emotion/react"
5
5
  import { Typography } from "../Typography"
6
6
  import { Spinner } from "../Spinner"
7
- import { resolveFont } from "../../../fonts"
7
+ import { resolveFont } from "@butternutbox/pawprint-fonts"
8
8
 
9
9
  type ButtonVariant = "filled" | "outlined" | "text"
10
10
  type ButtonSize = "sm" | "md" | "lg"
@@ -13,7 +13,7 @@ import {
13
13
  Error as ErrorIcon,
14
14
  CheckCircle as SuccessIcon
15
15
  } from "@butternutbox/pawprint-icons/core"
16
- import { resolveFont } from "../../../fonts"
16
+ import { resolveFont } from "@butternutbox/pawprint-fonts"
17
17
  import { Icon } from "../Icon"
18
18
 
19
19
  export type InputState = "default" | "error" | "success"
@@ -13,7 +13,7 @@ import {
13
13
  Error as ErrorIcon,
14
14
  CheckCircle as SuccessIcon
15
15
  } from "@butternutbox/pawprint-icons/core"
16
- import { resolveFont } from "../../../fonts"
16
+ import { resolveFont } from "@butternutbox/pawprint-fonts"
17
17
  import { Icon } from "../Icon"
18
18
  import type { InputState } from "../Input/InputField"
19
19
 
@@ -3,7 +3,7 @@ import { Text, TextStyle, TextProps } from "react-native"
3
3
  import { useTheme } from "@emotion/react"
4
4
  import styled from "@emotion/native"
5
5
  import { type BrandThemeSemanticsColourText } from "@butternutbox/pawprint-tokens"
6
- import { resolveFont } from "../../../fonts"
6
+ import { resolveFont } from "@butternutbox/pawprint-fonts"
7
7
 
8
8
  type BodySize = "xs" | "sm" | "md" | "lg"
9
9
  type HeadingSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl"
@@ -3,7 +3,7 @@ import { View, Text } from "react-native"
3
3
  import Animated from "react-native-reanimated"
4
4
  import { DEFAULT_THEME_OPTIONS } from "@butternutbox/pawprint-tokens"
5
5
 
6
- import { resolveFont } from "../../../fonts"
6
+ import { resolveFont } from "@butternutbox/pawprint-fonts"
7
7
 
8
8
  type AndroidOptionTextProps = {
9
9
  isSelected: boolean
@@ -4,7 +4,7 @@ import styled from "@emotion/native"
4
4
  import { useTheme } from "@emotion/react"
5
5
  import { IconButton } from "../../atoms/IconButton"
6
6
  import { Add, Remove } from "@butternutbox/pawprint-icons/core"
7
- import { resolveFont } from "../../../fonts"
7
+ import { resolveFont } from "@butternutbox/pawprint-fonts"
8
8
  import { Typography } from "../../atoms/Typography"
9
9
 
10
10
  type NumberFieldSize = "sm" | "lg"
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ export { tokens } from "@butternutbox/pawprint-tokens"
4
4
 
5
5
  export { default as styled } from "@emotion/native"
6
6
 
7
- export * from "./fonts"
7
+ export * from "@butternutbox/pawprint-fonts"
8
8
  export * from "./theme"
9
9
  export * from "./components"
10
10
  export * from "./hooks"
package/tsup.config.ts CHANGED
@@ -14,10 +14,9 @@ export default defineConfig({
14
14
  "react-native-svg",
15
15
  "react-native-worklets",
16
16
  /^@rn-primitives\/.*/,
17
- /\.ttf$/
17
+ /^@butternutbox\/pawprint-fonts/
18
18
  ],
19
19
  treeshake: true,
20
- onSuccess: "cp src/fonts/*.ttf dist/",
21
20
  esbuildOptions(options) {
22
21
  options.conditions = ["react-native", "import", "module", "default"]
23
22
  options.loader = {
Binary file
Binary file
Binary file
Binary file
@@ -1,48 +0,0 @@
1
- import { Brand, BrandName } from "@butternutbox/pawprint-tokens"
2
- import type { FontSource } from "expo-font"
3
-
4
- import idaNarrow500 from "./ida-narrow-500-normal.ttf"
5
- import idaNarrow700 from "./ida-narrow-700-normal.ttf"
6
- import ibmPlexSansCondensed400 from "./ibm-plex-sans-condensed-400-normal.ttf"
7
- import ibmPlexSansCondensed500 from "./ibm-plex-sans-condensed-500-normal.ttf"
8
- import ibmPlexSansCondensed600 from "./ibm-plex-sans-condensed-600-normal.ttf"
9
- import ibmPlexSansCondensed700 from "./ibm-plex-sans-condensed-700-normal.ttf"
10
-
11
- // Keys passed to useFonts — each key becomes the exact @font-face family name
12
- // that expo-font registers on web, and the postscript font name on iOS/Android.
13
- export const BRAND_FONTS: Partial<
14
- Record<BrandName, Record<string, FontSource>>
15
- > = {
16
- [Brand.Butternutbox]: {
17
- "IdaWebNarrow-Medium": idaNarrow500 as FontSource,
18
- "IdaWebNarrow-Bold": idaNarrow700 as FontSource,
19
- "IBMPlexSansCond-Regular": ibmPlexSansCondensed400 as FontSource,
20
- "IBMPlexSansCond-Medium": ibmPlexSansCondensed500 as FontSource,
21
- "IBMPlexSansCond-SemiBold": ibmPlexSansCondensed600 as FontSource,
22
- "IBMPlexSansCond-Bold": ibmPlexSansCondensed700 as FontSource
23
- }
24
- }
25
-
26
- // Maps token fontFamily + fontWeight → PostScript font name.
27
- // Keys must match the PostScript name embedded in the font file — iOS registers
28
- // fonts under their PostScript name regardless of the useFonts key.
29
- const FONT_MAP: Record<string, Record<string, string>> = {
30
- "IBM Plex Sans Condensed": {
31
- "400": "IBMPlexSansCond-Regular",
32
- "500": "IBMPlexSansCond-Medium",
33
- "600": "IBMPlexSansCond-SemiBold",
34
- "700": "IBMPlexSansCond-Bold"
35
- },
36
- "Ida Narrow": {
37
- "500": "IdaWebNarrow-Medium",
38
- "700": "IdaWebNarrow-Bold"
39
- }
40
- }
41
-
42
- export const resolveFont = (
43
- fontFamily: string,
44
- fontWeight: string
45
- ): { fontFamily: string } => {
46
- const resolved = FONT_MAP[fontFamily]?.[fontWeight]
47
- return { fontFamily: resolved ?? fontFamily }
48
- }
@@ -1,4 +0,0 @@
1
- declare module "*.ttf" {
2
- const src: string
3
- export default src
4
- }