@butternutbox/pawprint-native 0.6.0 → 0.8.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.
@@ -10,6 +10,8 @@ import styled from "@emotion/native"
10
10
  import { useTheme } from "@emotion/react"
11
11
  import * as TabsPrimitive from "@rn-primitives/tabs"
12
12
  import { Typography, type TypographyProps } from "../../atoms/Typography"
13
+ import { Icon, type PawprintIcon } from "../../atoms/Icon"
14
+ import { Avatar, type AvatarProps } from "../../atoms/Avatar"
13
15
  import { Animated, type AnimatedVariant } from "../Animated"
14
16
 
15
17
  type TabNavigationLayout = "fixed" | "intrinsic"
@@ -64,6 +66,8 @@ export type TabNavigationListProps = TabNavigationListOwnProps &
64
66
  type TabNavigationTabOwnProps = {
65
67
  value: string
66
68
  disabled?: boolean
69
+ icon?: PawprintIcon
70
+ avatar?: AvatarProps
67
71
  children: React.ReactNode
68
72
  }
69
73
 
@@ -169,12 +173,18 @@ TabNavigationList.displayName = "TabNavigation.List"
169
173
  * disabled state). Unlike the web version there are no hover or focus-visible
170
174
  * states (not applicable on mobile).
171
175
  *
176
+ * Optionally renders a leading `Avatar` and/or `Icon` before the label, matching
177
+ * the Figma design. The icon colour tracks the tab's label colour (brand when
178
+ * active/idle, muted when disabled); the avatar is rendered as-is from its props.
179
+ *
172
180
  * @param {string} value - Unique identifier; matches the `value` of a `TabNavigation.Panel`.
173
181
  * @param {boolean} [disabled=false] - Whether this tab is disabled.
182
+ * @param {PawprintIcon} [icon] - Optional leading icon from `@butternutbox/pawprint-icons`.
183
+ * @param {AvatarProps} [avatar] - Optional leading `Avatar`; props are forwarded to the `Avatar` atom.
174
184
  * @param {React.ReactNode} children - Tab label (and optional leading content).
175
185
  */
176
186
  const TabNavigationTab = React.forwardRef<View, TabNavigationTabProps>(
177
- ({ value, disabled = false, children, ...rest }, ref) => {
187
+ ({ value, disabled = false, icon, avatar, children, ...rest }, ref) => {
178
188
  const { layout } = useTabNavigationContext()
179
189
  const { value: selectedValue } = TabsPrimitive.useRootContext()
180
190
  const theme = useTheme()
@@ -209,6 +219,10 @@ const TabNavigationTab = React.forwardRef<View, TabNavigationTabProps>(
209
219
  tabFlex={layout === "fixed" ? 1 : undefined}
210
220
  {...rest}
211
221
  >
222
+ {avatar && <Avatar {...avatar} />}
223
+ {icon && (
224
+ <Icon icon={icon} customColour={textColour as string} aria-hidden />
225
+ )}
212
226
  <Typography token={token} color={textColour}>
213
227
  {children}
214
228
  </Typography>
@@ -13,6 +13,7 @@ export * from "./Radio"
13
13
  export * from "./SearchField"
14
14
  export * from "./SegmentedControl"
15
15
  export * from "./SelectField"
16
+ export * from "./NativeSelectPicker"
16
17
  export * from "./Slider"
17
18
  export * from "./Notification"
18
19
  export * from "./Tooltip"