@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.
- package/.turbo/turbo-build.log +15 -15
- package/CHANGELOG.md +16 -0
- package/dist/index.cjs +598 -333
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -1
- package/dist/index.d.ts +55 -1
- package/dist/index.js +556 -292
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/Switch/Switch.tsx +3 -1
- package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.stories.tsx +98 -0
- package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.styled.ts +127 -0
- package/src/components/molecules/NativeSelectPicker/NativeSelectPicker.tsx +250 -0
- package/src/components/molecules/NativeSelectPicker/index.ts +5 -0
- package/src/components/molecules/Notification/Notification.stories.tsx +4 -0
- package/src/components/molecules/Notification/Notification.tsx +43 -36
- package/src/components/molecules/TabNavigation/TabNavigation.stories.tsx +35 -0
- package/src/components/molecules/TabNavigation/TabNavigation.tsx +15 -1
- package/src/components/molecules/index.ts +1 -0
|
@@ -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>
|