@butternutbox/pawprint-native 0.16.0 → 0.17.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.16.0",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "description": "ButternutBox Pawprint Design System - React Native Components",
6
6
  "main": "./dist/index.cjs",
@@ -22,7 +22,7 @@
22
22
  "test": "vitest run"
23
23
  },
24
24
  "dependencies": {
25
- "@butternutbox/pawprint-tokens": "^0.3.0",
25
+ "@butternutbox/pawprint-tokens": "^0.4.0",
26
26
  "@emotion/native": "^11.11.0",
27
27
  "@emotion/react": "^11.14.0",
28
28
  "@rn-primitives/avatar": "^1.4.0",
@@ -3,6 +3,11 @@ import { View, StyleSheet } from "react-native"
3
3
  import { Button } from "./Button"
4
4
  import type { ButtonProps } from "./Button"
5
5
  import { Typography } from "../Typography"
6
+ import { Icon } from "../Icon"
7
+ import { Check } from "@butternutbox/pawprint-icons/core"
8
+ import { IosShare, Whatsapp } from "@butternutbox/pawprint-icons/marketing"
9
+
10
+ import { KeyboardDoubleArrowDown } from "@butternutbox/pawprint-icons/core"
6
11
 
7
12
  export default {
8
13
  title: "Atoms/Button",
@@ -118,6 +123,45 @@ export const AllStates = () => (
118
123
  </View>
119
124
  )
120
125
 
126
+ export const WithStartIcon = () => (
127
+ <View style={styles.column}>
128
+ {(["sm", "md", "lg"] as const).map((size) => (
129
+ <View key={size} style={styles.section}>
130
+ <Typography size="sm" weight="semiBold" color="tertiary">
131
+ {size}
132
+ </Typography>
133
+ <View style={styles.row}>
134
+ <Button
135
+ size={size}
136
+ startIcon={<Icon icon={KeyboardDoubleArrowDown} colour="primary" />}
137
+ >
138
+ Add
139
+ </Button>
140
+ <Button
141
+ size={size}
142
+ startIcon={<Icon icon={IosShare} colour="success" />}
143
+ >
144
+ Search
145
+ </Button>
146
+ <Button
147
+ size={size}
148
+ startIcon={<Icon icon={Whatsapp} colour="warning" />}
149
+ >
150
+ Settings
151
+ </Button>
152
+ <Button
153
+ size={size}
154
+ startIcon={<Icon icon={Check} colour="error" />}
155
+ colour="secondary"
156
+ >
157
+ Confirm
158
+ </Button>
159
+ </View>
160
+ </View>
161
+ ))}
162
+ </View>
163
+ )
164
+
121
165
  export const FullWidth = () => (
122
166
  <View style={styles.column}>
123
167
  {(["filled", "outlined", "text"] as const).map((variant) => (
@@ -4,7 +4,7 @@ import styled from "@emotion/native"
4
4
  import { useTheme } from "@emotion/react"
5
5
 
6
6
  type IconCategory = "core" | "marketing" | "payments" | "flags"
7
- type IconSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
7
+ type IconSize = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
8
8
  type IconColour =
9
9
  | "primary"
10
10
  | "secondary"
@@ -284,14 +284,22 @@ export const NumberFieldInput = React.forwardRef<
284
284
  style={{
285
285
  position: "absolute",
286
286
  bottom: 4,
287
- width: fieldMinWidth,
287
+ // Span the full field (not the min-width) so the help text
288
+ // centres and never wraps into the value when the field is
289
+ // wider than its min-width (e.g. fullWidth) or the copy is long.
290
+ left: 0,
291
+ right: 0,
288
292
  display: "flex",
289
293
  justifyContent: "center",
290
294
  alignItems: "center"
291
295
  }}
292
296
  >
293
297
  <Typography
294
- token={inputTokens.description.text.default}
298
+ token={
299
+ isLarge
300
+ ? tokens.typography.large.secondaryContent
301
+ : tokens.typography.small.smallLabel
302
+ }
295
303
  color={inputTokens.colour.description.default}
296
304
  >
297
305
  {inlineHelpText}