@butternutbox/pawprint-native 0.0.1
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 +30 -0
- package/COMPONENT_GUIDELINES.md +610 -0
- package/README.md +72 -0
- package/dist/ibm-plex-sans-condensed-400-normal-I2XLJNNB.woff2 +0 -0
- package/dist/ibm-plex-sans-condensed-500-normal-IEQBNVGX.woff2 +0 -0
- package/dist/ibm-plex-sans-condensed-600-normal-UX5ZU5T6.woff2 +0 -0
- package/dist/ibm-plex-sans-condensed-700-normal-4PFYFTSO.woff2 +0 -0
- package/dist/ida-narrow-500-normal-C6I2PK4T.woff2 +0 -0
- package/dist/ida-narrow-700-normal-UPHPRIN6.woff2 +0 -0
- package/dist/index.cjs +2686 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +780 -0
- package/dist/index.d.ts +780 -0
- package/dist/index.js +2617 -0
- package/dist/index.js.map +1 -0
- package/eslint.config.js +3 -0
- package/llms.txt +458 -0
- package/package.json +57 -0
- package/src/components/atoms/Avatar/Avatar.stories.tsx +125 -0
- package/src/components/atoms/Avatar/Avatar.tsx +159 -0
- package/src/components/atoms/Avatar/index.ts +7 -0
- package/src/components/atoms/Badge/Badge.stories.tsx +231 -0
- package/src/components/atoms/Badge/Badge.tsx +184 -0
- package/src/components/atoms/Badge/index.ts +2 -0
- package/src/components/atoms/Button/Button.stories.tsx +145 -0
- package/src/components/atoms/Button/Button.tsx +261 -0
- package/src/components/atoms/Button/index.ts +7 -0
- package/src/components/atoms/Hint/Hint.stories.tsx +84 -0
- package/src/components/atoms/Hint/Hint.tsx +59 -0
- package/src/components/atoms/Hint/index.ts +2 -0
- package/src/components/atoms/Icon/Icon.stories.tsx +200 -0
- package/src/components/atoms/Icon/Icon.tsx +112 -0
- package/src/components/atoms/Icon/index.ts +8 -0
- package/src/components/atoms/IconButton/IconButton.stories.tsx +162 -0
- package/src/components/atoms/IconButton/IconButton.tsx +227 -0
- package/src/components/atoms/IconButton/index.ts +7 -0
- package/src/components/atoms/Illustration/Illustration.stories.tsx +167 -0
- package/src/components/atoms/Illustration/Illustration.tsx +81 -0
- package/src/components/atoms/Illustration/index.ts +6 -0
- package/src/components/atoms/Input/Input.stories.tsx +142 -0
- package/src/components/atoms/Input/Input.tsx +110 -0
- package/src/components/atoms/Input/InputDescription.tsx +49 -0
- package/src/components/atoms/Input/InputError.tsx +39 -0
- package/src/components/atoms/Input/InputField.tsx +119 -0
- package/src/components/atoms/Input/InputLabel.tsx +61 -0
- package/src/components/atoms/Input/index.ts +10 -0
- package/src/components/atoms/Link/Link.stories.tsx +119 -0
- package/src/components/atoms/Link/Link.tsx +118 -0
- package/src/components/atoms/Link/index.ts +2 -0
- package/src/components/atoms/Logo/Logo.registry.ts +39 -0
- package/src/components/atoms/Logo/Logo.tsx +68 -0
- package/src/components/atoms/Logo/index.ts +4 -0
- package/src/components/atoms/Spinner/Spinner.stories.tsx +98 -0
- package/src/components/atoms/Spinner/Spinner.tsx +91 -0
- package/src/components/atoms/Spinner/index.ts +2 -0
- package/src/components/atoms/Switch/Switch.stories.tsx +120 -0
- package/src/components/atoms/Switch/Switch.tsx +196 -0
- package/src/components/atoms/Switch/index.ts +2 -0
- package/src/components/atoms/Tag/Tag.stories.tsx +89 -0
- package/src/components/atoms/Tag/Tag.tsx +122 -0
- package/src/components/atoms/Tag/index.ts +2 -0
- package/src/components/atoms/Typography/Typography.stories.tsx +315 -0
- package/src/components/atoms/Typography/Typography.tsx +284 -0
- package/src/components/atoms/Typography/index.ts +2 -0
- package/src/components/atoms/index.ts +14 -0
- package/src/components/index.ts +2 -0
- package/src/components/molecules/ButtonDock/ButtonDock.stories.tsx +95 -0
- package/src/components/molecules/ButtonDock/ButtonDock.tsx +148 -0
- package/src/components/molecules/ButtonDock/index.ts +2 -0
- package/src/components/molecules/ButtonGroup/ButtonGroup.stories.tsx +82 -0
- package/src/components/molecules/ButtonGroup/ButtonGroup.tsx +94 -0
- package/src/components/molecules/ButtonGroup/index.ts +2 -0
- package/src/components/molecules/Checkbox/Checkbox.stories.tsx +148 -0
- package/src/components/molecules/Checkbox/Checkbox.tsx +279 -0
- package/src/components/molecules/Checkbox/CheckboxGroup.tsx +53 -0
- package/src/components/molecules/Checkbox/index.ts +4 -0
- package/src/components/molecules/Radio/Radio.stories.tsx +182 -0
- package/src/components/molecules/Radio/Radio.tsx +249 -0
- package/src/components/molecules/Radio/RadioGroup.tsx +142 -0
- package/src/components/molecules/Radio/index.ts +4 -0
- package/src/components/molecules/SegmentedControl/SegmentedControl.stories.tsx +151 -0
- package/src/components/molecules/SegmentedControl/SegmentedControl.tsx +323 -0
- package/src/components/molecules/SegmentedControl/index.ts +5 -0
- package/src/components/molecules/Slider/Slider.stories.tsx +144 -0
- package/src/components/molecules/Slider/Slider.tsx +303 -0
- package/src/components/molecules/Slider/index.ts +2 -0
- package/src/components/molecules/index.ts +6 -0
- package/src/fonts/ibm-plex-sans-condensed-400-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-sans-condensed-500-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-sans-condensed-600-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-sans-condensed-700-normal.woff2 +0 -0
- package/src/fonts/ida-narrow-500-normal.woff2 +0 -0
- package/src/fonts/ida-narrow-700-normal.woff2 +0 -0
- package/src/fonts/index.ts +49 -0
- package/src/index.ts +9 -0
- package/src/theme/PawprintProvider.tsx +26 -0
- package/src/theme/ThemeProvider.tsx +63 -0
- package/src/theme/index.ts +5 -0
- package/src/theme/theme.ts +3 -0
- package/src/theme/utils.ts +31 -0
- package/src/types/fonts.d.ts +4 -0
- package/src/types/index.ts +1 -0
- package/src/types/theme.ts +24 -0
- package/tsconfig.json +5 -0
- package/tsup.config.ts +11 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,780 @@
|
|
|
1
|
+
import * as _butternutbox_pawprint_tokens from '@butternutbox/pawprint-tokens';
|
|
2
|
+
import { TokensCorePrimitives, BrandThemeSemantics, BrandThemeComponents, BrandName, ThemeName, BrandThemeSemanticsColourText } from '@butternutbox/pawprint-tokens';
|
|
3
|
+
export { tokens } from '@butternutbox/pawprint-tokens';
|
|
4
|
+
import * as _emotion_native from '@emotion/native';
|
|
5
|
+
export { default as styled } from '@emotion/native';
|
|
6
|
+
import { FontSource } from 'expo-font';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import * as _emotion_react from '@emotion/react';
|
|
9
|
+
import { Theme } from '@emotion/react';
|
|
10
|
+
import { View, TextProps, Text, ViewProps, PressableProps, TextInputProps, TextInput } from 'react-native';
|
|
11
|
+
|
|
12
|
+
declare module "@emotion/react" {
|
|
13
|
+
interface Theme {
|
|
14
|
+
tokens: {
|
|
15
|
+
primitives: TokensCorePrimitives;
|
|
16
|
+
semantics: BrandThemeSemantics;
|
|
17
|
+
components: BrandThemeComponents;
|
|
18
|
+
};
|
|
19
|
+
fontFaces?: string;
|
|
20
|
+
}
|
|
21
|
+
interface ThemeOptions {
|
|
22
|
+
tokens: Theme["tokens"];
|
|
23
|
+
fontFaces?: string;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare const BRAND_FONTS: Partial<Record<BrandName, Record<string, FontSource>>>;
|
|
28
|
+
declare const resolveFont: (fontFamily: string, fontWeight: string) => {
|
|
29
|
+
fontFamily: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
interface PawprintProviderProps {
|
|
33
|
+
brand?: BrandName;
|
|
34
|
+
initialTheme?: ThemeName;
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare const PawprintProvider: React.FC<PawprintProviderProps>;
|
|
38
|
+
|
|
39
|
+
type ThemeContextType = {
|
|
40
|
+
brand: BrandName;
|
|
41
|
+
theme: ThemeName;
|
|
42
|
+
setTheme: (theme: ThemeName) => void;
|
|
43
|
+
emotionTheme: Theme;
|
|
44
|
+
};
|
|
45
|
+
type Props = {
|
|
46
|
+
brand?: BrandName;
|
|
47
|
+
initialTheme?: ThemeName;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
};
|
|
50
|
+
declare const ThemeProvider: ({ children, brand, initialTheme }: Props) => React.JSX.Element;
|
|
51
|
+
declare const usePawprint: () => ThemeContextType;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Creates a pawprint theme based on brand and theme name for React Native
|
|
55
|
+
*
|
|
56
|
+
* @param brand - The brand to use (butternutbox, marro, etc.)
|
|
57
|
+
* @param theme - The theme name to use (default, dark, etc.)
|
|
58
|
+
* @returns A theme object with the selected brand and theme options
|
|
59
|
+
*/
|
|
60
|
+
declare const createPawprintTheme: (brand?: BrandName, theme?: ThemeName) => Theme;
|
|
61
|
+
|
|
62
|
+
declare const theme: _butternutbox_pawprint_tokens.Tokens;
|
|
63
|
+
|
|
64
|
+
type AvatarSize = "sm" | "md" | "lg";
|
|
65
|
+
type AvatarBorder = "none" | "sm" | "md";
|
|
66
|
+
type AvatarFallbackType = "string" | "image";
|
|
67
|
+
interface AvatarProps {
|
|
68
|
+
src?: string;
|
|
69
|
+
alt: string;
|
|
70
|
+
size?: AvatarSize;
|
|
71
|
+
border?: AvatarBorder;
|
|
72
|
+
fallbackType?: AvatarFallbackType;
|
|
73
|
+
fallbackString?: string;
|
|
74
|
+
}
|
|
75
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<View>>;
|
|
76
|
+
|
|
77
|
+
type BodySize = "xs" | "sm" | "md" | "lg";
|
|
78
|
+
type HeadingSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
79
|
+
type DisplaySize = "md" | "lg";
|
|
80
|
+
type BodyWeight = "medium" | "semiBold" | "bold";
|
|
81
|
+
type TextAlign = "left" | "right" | "center" | "justify";
|
|
82
|
+
type TextTransform = "none" | "capitalize" | "uppercase" | "lowercase";
|
|
83
|
+
type TextDecoration = "none" | "underline" | "line-through";
|
|
84
|
+
type SemanticTextColorKey = Exclude<keyof BrandThemeSemanticsColourText, "link" | "action">;
|
|
85
|
+
type FlattenTextColorValues<T> = T extends string ? T : T extends object ? {
|
|
86
|
+
[K in keyof T]: FlattenTextColorValues<T[K]>;
|
|
87
|
+
}[keyof T] : never;
|
|
88
|
+
type SemanticTextColorValue = FlattenTextColorValues<BrandThemeSemanticsColourText>;
|
|
89
|
+
type NativeTypographyToken = {
|
|
90
|
+
fontFamily?: string;
|
|
91
|
+
fontWeight?: string;
|
|
92
|
+
fontSize?: string;
|
|
93
|
+
lineHeight?: string;
|
|
94
|
+
letterSpacing?: string;
|
|
95
|
+
};
|
|
96
|
+
type NativeTextProps = Omit<TextProps, "style">;
|
|
97
|
+
type BodyVariant = {
|
|
98
|
+
variant?: "body";
|
|
99
|
+
size?: BodySize;
|
|
100
|
+
weight?: BodyWeight;
|
|
101
|
+
};
|
|
102
|
+
type HeadingVariant = {
|
|
103
|
+
variant: "heading";
|
|
104
|
+
size?: HeadingSize;
|
|
105
|
+
weight?: never;
|
|
106
|
+
};
|
|
107
|
+
type DisplayVariant = {
|
|
108
|
+
variant: "display";
|
|
109
|
+
size?: DisplaySize;
|
|
110
|
+
weight?: never;
|
|
111
|
+
};
|
|
112
|
+
type CommonProps = {
|
|
113
|
+
align?: TextAlign;
|
|
114
|
+
noWrap?: boolean;
|
|
115
|
+
textTransform?: TextTransform;
|
|
116
|
+
textDecoration?: TextDecoration;
|
|
117
|
+
};
|
|
118
|
+
type SemanticVariant = (BodyVariant | HeadingVariant | DisplayVariant) & {
|
|
119
|
+
color?: SemanticTextColorKey;
|
|
120
|
+
token?: never;
|
|
121
|
+
} & CommonProps;
|
|
122
|
+
type TokenVariant = {
|
|
123
|
+
token: NativeTypographyToken;
|
|
124
|
+
color?: SemanticTextColorValue;
|
|
125
|
+
} & CommonProps;
|
|
126
|
+
type TypographyProps = (SemanticVariant & NativeTextProps) | (TokenVariant & NativeTextProps);
|
|
127
|
+
/**
|
|
128
|
+
* Typography component for body text, headings, and display copy.
|
|
129
|
+
* Styling and semantics only — no i18n concerns.
|
|
130
|
+
*
|
|
131
|
+
* **Semantic mode:**
|
|
132
|
+
* - `variant="body"` — 4 sizes (xs–lg), 3 weights.
|
|
133
|
+
* - `variant="heading"` — 6 sizes (2xs–xl), responsive (steps down one size on narrow screens).
|
|
134
|
+
* - `variant="display"` — 2 sizes (md/lg), responsive.
|
|
135
|
+
*
|
|
136
|
+
* **Token mode:**
|
|
137
|
+
* - `token` — Pass resolved typography token object from theme.tokens.components
|
|
138
|
+
*
|
|
139
|
+
* @param {"body" | "heading" | "display"} [variant="body"] - Text style variant.
|
|
140
|
+
* @param {"xs" | "sm" | "md" | "lg" | "2xs" | "xl"} [size="md"] - Size token. Available sizes depend on variant.
|
|
141
|
+
* @param {"medium" | "semiBold" | "bold"} [weight="medium"] - Font weight. Body only — heading and display have fixed weight.
|
|
142
|
+
* @param {NativeTypographyToken} [token] - Resolved typography token object (alternative to semantic props).
|
|
143
|
+
* @param {SemanticTextColorKey} [color] - Semantic text color key for semantic mode.
|
|
144
|
+
* @param {SemanticTextColorValue} [color] - Hex color string for token mode.
|
|
145
|
+
* @param {"left" | "right" | "center" | "justify"} [align] - Text alignment.
|
|
146
|
+
* @param {boolean} [noWrap] - If true, text is truncated to one line with an ellipsis.
|
|
147
|
+
* @param {"none" | "capitalize" | "uppercase" | "lowercase"} [textTransform] - Text transformation.
|
|
148
|
+
* @param {"none" | "underline" | "line-through"} [textDecoration] - Text decoration.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* // Semantic usage
|
|
152
|
+
* <Typography size="md" weight="semiBold">Body text</Typography>
|
|
153
|
+
* <Typography variant="heading" size="xl">Page title</Typography>
|
|
154
|
+
* <Typography variant="display" size="lg" color="secondary">Hero copy</Typography>
|
|
155
|
+
*
|
|
156
|
+
* // Token usage (for component-owned text)
|
|
157
|
+
* <Typography
|
|
158
|
+
* token={theme.tokens.components.checkbox.typography.label}
|
|
159
|
+
* color={theme.tokens.components.checkbox.colour.text.title}
|
|
160
|
+
* >
|
|
161
|
+
* Accept terms
|
|
162
|
+
* </Typography>
|
|
163
|
+
*/
|
|
164
|
+
declare const Typography: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<Text>>;
|
|
165
|
+
|
|
166
|
+
type IconCategory = "core" | "marketing" | "payments" | "flags";
|
|
167
|
+
type IconSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
168
|
+
type IconColour = "primary" | "secondary" | "disabled" | "success" | "warning" | "error" | "promo" | "info" | "alt" | "action-default" | "action-inverse";
|
|
169
|
+
type PawprintIcon = React.ComponentType<{
|
|
170
|
+
width?: number;
|
|
171
|
+
height?: number;
|
|
172
|
+
color?: string;
|
|
173
|
+
}> & {
|
|
174
|
+
category?: IconCategory;
|
|
175
|
+
};
|
|
176
|
+
type IconOwnProps = {
|
|
177
|
+
icon: PawprintIcon;
|
|
178
|
+
size?: IconSize;
|
|
179
|
+
colour?: IconColour;
|
|
180
|
+
"aria-label"?: string;
|
|
181
|
+
};
|
|
182
|
+
type IconProps = IconOwnProps & Omit<ViewProps, keyof IconOwnProps>;
|
|
183
|
+
/**
|
|
184
|
+
* Renders an SVG icon with token-based sizing and colour.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```tsx
|
|
188
|
+
* import { Icon } from "@butternutbox/pawprint-native"
|
|
189
|
+
* import { ArrowRight } from "@butternutbox/pawprint-icons/core"
|
|
190
|
+
*
|
|
191
|
+
* <Icon icon={ArrowRight} size="md" colour="primary" aria-label="Go forward" />
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* @param icon - **(required)** Icon component from `@butternutbox/pawprint-icons/{category}`
|
|
195
|
+
* @param size - *(optional)* Size variant: xs, sm, md (default), lg, xl, 2xl
|
|
196
|
+
* @param colour - *(optional)* Colour variant from semantic icon tokens (default: primary)
|
|
197
|
+
* @param aria-label - *(optional)* Accessible label; omit for decorative icons
|
|
198
|
+
*/
|
|
199
|
+
declare const Icon: React.ForwardRefExoticComponent<IconOwnProps & Omit<ViewProps, keyof IconOwnProps> & React.RefAttributes<View>>;
|
|
200
|
+
|
|
201
|
+
type BadgeVariant = "primary" | "promo" | "success" | "warning" | "error";
|
|
202
|
+
type BadgeSize = "small" | "medium" | "large";
|
|
203
|
+
type BaseBadgeProps = {
|
|
204
|
+
children: React.ReactNode;
|
|
205
|
+
variant?: BadgeVariant;
|
|
206
|
+
size?: BadgeSize;
|
|
207
|
+
icon?: PawprintIcon;
|
|
208
|
+
};
|
|
209
|
+
type PinnedBadgeProps = BaseBadgeProps & {
|
|
210
|
+
pinned: true;
|
|
211
|
+
top?: number;
|
|
212
|
+
bottom?: number;
|
|
213
|
+
};
|
|
214
|
+
type UnpinnedBadgeProps = BaseBadgeProps & {
|
|
215
|
+
pinned?: false;
|
|
216
|
+
top?: never;
|
|
217
|
+
bottom?: never;
|
|
218
|
+
};
|
|
219
|
+
type BadgeOwnProps = PinnedBadgeProps | UnpinnedBadgeProps;
|
|
220
|
+
type BadgeProps = BadgeOwnProps & Omit<ViewProps, keyof BadgeOwnProps>;
|
|
221
|
+
/**
|
|
222
|
+
* Badge component for displaying labels with optional icons.
|
|
223
|
+
* Used to highlight status, categories, or notifications.
|
|
224
|
+
*
|
|
225
|
+
* @param {React.ReactNode} children - Badge label text.
|
|
226
|
+
* @param {"primary" | "promo" | "success" | "warning" | "error"} [variant="primary"] - Visual style variant.
|
|
227
|
+
* @param {"small" | "medium" | "large"} [size="medium"] - Size of the badge.
|
|
228
|
+
* @param {boolean} [pinned=false] - If true, applies pinned styling and positions absolutely to the left edge.
|
|
229
|
+
* @param {PawprintIcon} [icon] - Optional icon from @butternutbox/pawprint-icons.
|
|
230
|
+
* @param {number} [top] - Top position when pinned.
|
|
231
|
+
* @param {number} [bottom] - Bottom position when pinned.
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* <Badge>New</Badge>
|
|
235
|
+
* <Badge variant="success" size="large" icon={CheckCircle}>Verified</Badge>
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* <View style={{ position: "relative" }}>
|
|
239
|
+
* <Badge variant="promo" pinned top={16}>Special</Badge>
|
|
240
|
+
* </View>
|
|
241
|
+
*/
|
|
242
|
+
declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<View>>;
|
|
243
|
+
|
|
244
|
+
type ButtonVariant = "filled" | "outlined" | "text";
|
|
245
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
246
|
+
type ButtonColour = "primary" | "secondary";
|
|
247
|
+
type ButtonOwnProps = {
|
|
248
|
+
variant?: ButtonVariant;
|
|
249
|
+
size?: ButtonSize;
|
|
250
|
+
colour?: ButtonColour;
|
|
251
|
+
loading?: boolean;
|
|
252
|
+
fullWidth?: boolean;
|
|
253
|
+
startIcon?: React.ReactNode;
|
|
254
|
+
endIcon?: React.ReactNode;
|
|
255
|
+
children?: React.ReactNode;
|
|
256
|
+
};
|
|
257
|
+
type ButtonProps = ButtonOwnProps & Omit<PressableProps, keyof ButtonOwnProps | "children">;
|
|
258
|
+
/**
|
|
259
|
+
* A button component with token-based styling.
|
|
260
|
+
*
|
|
261
|
+
* Supports `filled` (default), `outlined`, and `text` variants.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```tsx
|
|
265
|
+
* import { Button } from "@butternutbox/pawprint-native"
|
|
266
|
+
*
|
|
267
|
+
* <Button variant="filled" colour="primary" size="md">Click me</Button>
|
|
268
|
+
* <Button variant="text">Text button</Button>
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* @param variant - *(optional)* Visual variant: filled (default), outlined, or text.
|
|
272
|
+
* @param size - *(optional)* Size variant: sm, md (default), lg
|
|
273
|
+
* @param colour - *(optional)* Colour variant: primary (default), secondary
|
|
274
|
+
* @param loading - *(optional)* Shows spinner and disables interaction
|
|
275
|
+
* @param fullWidth - *(optional)* Stretches button to fill its container
|
|
276
|
+
* @param startIcon - *(optional)* Leading icon element
|
|
277
|
+
* @param endIcon - *(optional)* Trailing icon element
|
|
278
|
+
*/
|
|
279
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonOwnProps & Omit<PressableProps, keyof ButtonOwnProps> & React.RefAttributes<View>>;
|
|
280
|
+
|
|
281
|
+
type HintVariant = "default" | "success" | "warning" | "error";
|
|
282
|
+
type HintOwnProps = {
|
|
283
|
+
variant?: HintVariant;
|
|
284
|
+
};
|
|
285
|
+
type HintProps = HintOwnProps & Omit<ViewProps, keyof HintOwnProps>;
|
|
286
|
+
/**
|
|
287
|
+
* Hint component for displaying notification indicators.
|
|
288
|
+
* A small circular dot used to draw attention or indicate status.
|
|
289
|
+
*
|
|
290
|
+
* @param {"default" | "success" | "warning" | "error"} [variant="default"] - Visual style variant.
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* <Hint variant="success" />
|
|
294
|
+
* <Hint variant="error" />
|
|
295
|
+
*/
|
|
296
|
+
declare const Hint: React.ForwardRefExoticComponent<HintOwnProps & Omit<ViewProps, "variant"> & React.RefAttributes<View>>;
|
|
297
|
+
|
|
298
|
+
type IconButtonVariant = "filled" | "outlined" | "text";
|
|
299
|
+
type IconButtonSize = "sm" | "md" | "lg";
|
|
300
|
+
type IconButtonColour = "primary" | "secondary" | "tertiary";
|
|
301
|
+
type IconButtonOwnProps = {
|
|
302
|
+
icon: PawprintIcon;
|
|
303
|
+
variant?: IconButtonVariant;
|
|
304
|
+
size?: IconButtonSize;
|
|
305
|
+
colour?: IconButtonColour;
|
|
306
|
+
loading?: boolean;
|
|
307
|
+
disabled?: boolean;
|
|
308
|
+
"aria-label": string;
|
|
309
|
+
};
|
|
310
|
+
type IconButtonProps = IconButtonOwnProps & Omit<PressableProps, keyof IconButtonOwnProps | "children">;
|
|
311
|
+
/**
|
|
312
|
+
* A circular icon-only button with token-based styling.
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```tsx
|
|
316
|
+
* import { IconButton } from "@butternutbox/pawprint-native"
|
|
317
|
+
* import { Add } from "@butternutbox/pawprint-icons/core"
|
|
318
|
+
*
|
|
319
|
+
* <IconButton icon={Add} aria-label="Add item" />
|
|
320
|
+
* <IconButton icon={Add} variant="outlined" aria-label="Add item" />
|
|
321
|
+
* ```
|
|
322
|
+
*
|
|
323
|
+
* @param icon - **(required)** Icon component
|
|
324
|
+
* @param variant - *(optional)* Visual variant: filled (default), outlined, or text.
|
|
325
|
+
* @param size - *(optional)* Size variant: sm, md (default), lg
|
|
326
|
+
* @param colour - *(optional)* Colour variant: primary (default), secondary, tertiary
|
|
327
|
+
* @param loading - *(optional)* Shows spinner and disables interaction
|
|
328
|
+
* @param aria-label - **(required)** Accessible label for the button
|
|
329
|
+
*/
|
|
330
|
+
declare const IconButton: React.ForwardRefExoticComponent<IconButtonOwnProps & Omit<PressableProps, "children" | keyof IconButtonOwnProps> & React.RefAttributes<View>>;
|
|
331
|
+
|
|
332
|
+
type IllustrationSize = "sm" | "lg";
|
|
333
|
+
type PawprintIllustration = React.ComponentType<{
|
|
334
|
+
width?: number;
|
|
335
|
+
height?: number;
|
|
336
|
+
}>;
|
|
337
|
+
type IllustrationOwnProps = {
|
|
338
|
+
illustration: PawprintIllustration;
|
|
339
|
+
size?: IllustrationSize;
|
|
340
|
+
"aria-label"?: string;
|
|
341
|
+
};
|
|
342
|
+
type IllustrationProps = IllustrationOwnProps & Omit<ViewProps, keyof IllustrationOwnProps>;
|
|
343
|
+
/**
|
|
344
|
+
* Renders a multi-colour SVG illustration with token-based sizing.
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```tsx
|
|
348
|
+
* import { Illustration } from "@butternutbox/pawprint-native"
|
|
349
|
+
* import { DogSittingFilled } from "@butternutbox/pawprint-illustrations/poses"
|
|
350
|
+
*
|
|
351
|
+
* <Illustration illustration={DogSittingFilled} size="sm" aria-label="Dog sitting" />
|
|
352
|
+
* ```
|
|
353
|
+
*
|
|
354
|
+
* @param illustration - **(required)** Illustration component
|
|
355
|
+
* @param size - *(optional)* Size variant: sm (default), lg
|
|
356
|
+
* @param aria-label - *(optional)* Accessible label
|
|
357
|
+
*/
|
|
358
|
+
declare const Illustration: React.ForwardRefExoticComponent<IllustrationOwnProps & Omit<ViewProps, keyof IllustrationOwnProps> & React.RefAttributes<View>>;
|
|
359
|
+
|
|
360
|
+
type InputState = "default" | "error" | "success";
|
|
361
|
+
type InputFieldOwnProps = {
|
|
362
|
+
leadingIcon?: React.ReactNode;
|
|
363
|
+
trailingIcon?: React.ReactNode;
|
|
364
|
+
state?: InputState;
|
|
365
|
+
};
|
|
366
|
+
type InputFieldProps = InputFieldOwnProps & Omit<TextInputProps, keyof InputFieldOwnProps>;
|
|
367
|
+
/**
|
|
368
|
+
* InputField component - The input field wrapper with icons and visual states.
|
|
369
|
+
*
|
|
370
|
+
* @param {React.ReactNode} [leadingIcon] - Icon to display before the input
|
|
371
|
+
* @param {React.ReactNode} [trailingIcon] - Icon to display after the input
|
|
372
|
+
* @param {InputState} [state] - Visual state of the input (default, error, success)
|
|
373
|
+
*/
|
|
374
|
+
declare const InputField: React.ForwardRefExoticComponent<InputFieldOwnProps & Omit<TextInputProps, keyof InputFieldOwnProps> & React.RefAttributes<TextInput>>;
|
|
375
|
+
|
|
376
|
+
type InputLabelOwnProps = {
|
|
377
|
+
optionalText?: string;
|
|
378
|
+
state?: InputState;
|
|
379
|
+
children: React.ReactNode;
|
|
380
|
+
};
|
|
381
|
+
type InputLabelProps = InputLabelOwnProps & Omit<ViewProps, keyof InputLabelOwnProps>;
|
|
382
|
+
/**
|
|
383
|
+
* Label component for Input fields.
|
|
384
|
+
*
|
|
385
|
+
* @param optionalText - Optional text to display next to label (e.g., "(optional)")
|
|
386
|
+
* @param state - Visual state of the input (affects label color for error state)
|
|
387
|
+
* @param children - Label text content
|
|
388
|
+
*/
|
|
389
|
+
declare const InputLabel: React.ForwardRefExoticComponent<InputLabelOwnProps & Omit<ViewProps, keyof InputLabelOwnProps> & React.RefAttributes<View>>;
|
|
390
|
+
|
|
391
|
+
type InputDescriptionOwnProps = {
|
|
392
|
+
state?: InputState;
|
|
393
|
+
children: React.ReactNode;
|
|
394
|
+
};
|
|
395
|
+
type InputDescriptionProps = InputDescriptionOwnProps & Omit<ViewProps, keyof InputDescriptionOwnProps>;
|
|
396
|
+
/**
|
|
397
|
+
* Description/help text component for Input fields.
|
|
398
|
+
*
|
|
399
|
+
* @param state - Visual state of the input (affects description color for error state)
|
|
400
|
+
* @param children - Description text content
|
|
401
|
+
*/
|
|
402
|
+
declare const InputDescription: React.ForwardRefExoticComponent<InputDescriptionOwnProps & Omit<ViewProps, keyof InputDescriptionOwnProps> & React.RefAttributes<View>>;
|
|
403
|
+
|
|
404
|
+
type InputErrorProps = {
|
|
405
|
+
children?: React.ReactNode;
|
|
406
|
+
} & ViewProps;
|
|
407
|
+
/**
|
|
408
|
+
* Error message component for Input fields.
|
|
409
|
+
*
|
|
410
|
+
* @param children - Error message text
|
|
411
|
+
*/
|
|
412
|
+
declare const InputError: React.ForwardRefExoticComponent<{
|
|
413
|
+
children?: React.ReactNode;
|
|
414
|
+
} & ViewProps & React.RefAttributes<View>>;
|
|
415
|
+
|
|
416
|
+
type InputOwnProps = {
|
|
417
|
+
label?: string;
|
|
418
|
+
description?: string;
|
|
419
|
+
error?: string;
|
|
420
|
+
state?: InputState;
|
|
421
|
+
optionalText?: string;
|
|
422
|
+
};
|
|
423
|
+
type InputProps = InputOwnProps & Omit<InputFieldProps, keyof InputOwnProps> & Omit<ViewProps, keyof InputOwnProps>;
|
|
424
|
+
declare const StyledRoot: _emotion_native.StyledComponent<ViewProps & {
|
|
425
|
+
theme?: _emotion_react.Theme;
|
|
426
|
+
as?: React.ElementType;
|
|
427
|
+
}, {}, {
|
|
428
|
+
ref?: React.Ref<View> | undefined;
|
|
429
|
+
}>;
|
|
430
|
+
type InputComponent = React.ForwardRefExoticComponent<InputProps & React.RefAttributes<View>> & {
|
|
431
|
+
Root: typeof StyledRoot;
|
|
432
|
+
Label: typeof InputLabel;
|
|
433
|
+
Field: typeof InputField;
|
|
434
|
+
Description: typeof InputDescription;
|
|
435
|
+
Error: typeof InputError;
|
|
436
|
+
};
|
|
437
|
+
declare const Input: InputComponent;
|
|
438
|
+
|
|
439
|
+
type LinkSize = "sm" | "md" | "lg";
|
|
440
|
+
type LinkWeight = "medium" | "semiBold" | "bold";
|
|
441
|
+
type LinkOwnProps = {
|
|
442
|
+
weight?: LinkWeight;
|
|
443
|
+
standalone?: boolean;
|
|
444
|
+
size?: LinkSize;
|
|
445
|
+
disabled?: boolean;
|
|
446
|
+
href?: string;
|
|
447
|
+
children?: React.ReactNode;
|
|
448
|
+
};
|
|
449
|
+
type LinkProps = LinkOwnProps & Omit<PressableProps, keyof LinkOwnProps | "children">;
|
|
450
|
+
/**
|
|
451
|
+
* Link component for navigational elements.
|
|
452
|
+
*
|
|
453
|
+
* - Inline (default) — underlined, inherits font size from surrounding context.
|
|
454
|
+
* - Standalone — includes a trailing arrow indicator.
|
|
455
|
+
*
|
|
456
|
+
* @param {"sm" | "md" | "lg"} [size="md"] - Size of standalone link text.
|
|
457
|
+
* @param {"medium" | "semiBold" | "bold"} [weight="semiBold"] - Font weight.
|
|
458
|
+
* @param {boolean} [standalone=false] - Renders with a trailing arrow.
|
|
459
|
+
* @param {boolean} [disabled=false] - Disables the link.
|
|
460
|
+
* @param {string} [href] - URL to open when pressed.
|
|
461
|
+
*
|
|
462
|
+
* @example
|
|
463
|
+
* <Link href="https://example.com" standalone>Find out more</Link>
|
|
464
|
+
*/
|
|
465
|
+
declare const Link: React.ForwardRefExoticComponent<LinkOwnProps & Omit<PressableProps, keyof LinkOwnProps> & React.RefAttributes<View>>;
|
|
466
|
+
|
|
467
|
+
type LogoBrand = "butternut" | "psibufet" | "bcorp";
|
|
468
|
+
type LogoVariant = "wordmark" | "primary" | "tabbed-top" | "tabbed-bottom" | "favicon";
|
|
469
|
+
type LogoOwnProps = {
|
|
470
|
+
brand: LogoBrand;
|
|
471
|
+
variant?: LogoVariant;
|
|
472
|
+
"aria-label"?: string;
|
|
473
|
+
};
|
|
474
|
+
type LogoProps = LogoOwnProps & Omit<ViewProps, keyof LogoOwnProps>;
|
|
475
|
+
/**
|
|
476
|
+
* Renders a brand logo SVG.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```tsx
|
|
480
|
+
* import { Logo } from "@butternutbox/pawprint-native"
|
|
481
|
+
*
|
|
482
|
+
* <Logo brand="butternut" variant="primary" aria-label="ButternutBox" />
|
|
483
|
+
* ```
|
|
484
|
+
*
|
|
485
|
+
* @param brand - **(required)** Brand: "butternut", "psibufet", or "bcorp"
|
|
486
|
+
* @param variant - *(optional)* Logo variant (default: "primary"). Ignored for "bcorp".
|
|
487
|
+
* @param aria-label - *(optional)* Accessible label
|
|
488
|
+
*/
|
|
489
|
+
declare const Logo: React.ForwardRefExoticComponent<LogoOwnProps & Omit<ViewProps, keyof LogoOwnProps> & React.RefAttributes<View>>;
|
|
490
|
+
|
|
491
|
+
type LogoSvgComponent = React.ComponentType<{
|
|
492
|
+
width?: number;
|
|
493
|
+
height?: number;
|
|
494
|
+
}>;
|
|
495
|
+
declare function resolveLogo(brand: LogoBrand, variant: LogoVariant): LogoSvgComponent | undefined;
|
|
496
|
+
declare function registerLogo(brand: LogoBrand, variant: LogoVariant, component: LogoSvgComponent): void;
|
|
497
|
+
|
|
498
|
+
type SpinnerSize = "sm" | "md" | "lg";
|
|
499
|
+
type SpinnerVariant = "dark" | "light";
|
|
500
|
+
type SpinnerOwnProps = {
|
|
501
|
+
size?: SpinnerSize;
|
|
502
|
+
variant?: SpinnerVariant;
|
|
503
|
+
};
|
|
504
|
+
type SpinnerProps = SpinnerOwnProps & Omit<ViewProps, keyof SpinnerOwnProps>;
|
|
505
|
+
/**
|
|
506
|
+
* A spinner component for indicating indeterminate loading states.
|
|
507
|
+
*
|
|
508
|
+
* @example
|
|
509
|
+
* ```tsx
|
|
510
|
+
* import { Spinner } from "@butternutbox/pawprint-native"
|
|
511
|
+
*
|
|
512
|
+
* <Spinner />
|
|
513
|
+
* <Spinner size="lg" variant="light" />
|
|
514
|
+
* ```
|
|
515
|
+
*
|
|
516
|
+
* @param size - *(optional)* Size variant: sm, md (default), lg
|
|
517
|
+
* @param variant - *(optional)* Colour variant: dark (default), light
|
|
518
|
+
*/
|
|
519
|
+
declare const Spinner: React.ForwardRefExoticComponent<SpinnerOwnProps & Omit<ViewProps, keyof SpinnerOwnProps> & React.RefAttributes<View>>;
|
|
520
|
+
|
|
521
|
+
type SwitchOwnProps = {
|
|
522
|
+
label?: React.ReactNode;
|
|
523
|
+
subText?: React.ReactNode;
|
|
524
|
+
disabled?: boolean;
|
|
525
|
+
checked?: boolean;
|
|
526
|
+
defaultChecked?: boolean;
|
|
527
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
528
|
+
};
|
|
529
|
+
type SwitchProps = SwitchOwnProps & Omit<ViewProps, keyof SwitchOwnProps>;
|
|
530
|
+
/**
|
|
531
|
+
* Switch component for toggling between two states, on and off.
|
|
532
|
+
*
|
|
533
|
+
* @param {React.ReactNode} [label] - Main label text or content.
|
|
534
|
+
* @param {React.ReactNode} [subText] - Optional descriptive subtext.
|
|
535
|
+
* @param {boolean} [disabled=false] - Whether the switch is disabled.
|
|
536
|
+
* @param {boolean} [checked] - Controlled checked state.
|
|
537
|
+
* @param {(checked: boolean) => void} [onCheckedChange] - Controlled change handler.
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* <Switch label="SMS Delivery Notifications" subText="I want to receive SMS notifications" />
|
|
541
|
+
*/
|
|
542
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchOwnProps & Omit<ViewProps, keyof SwitchOwnProps> & React.RefAttributes<View>>;
|
|
543
|
+
|
|
544
|
+
type TagVariant = "primary" | "secondary" | "tertiary" | "promo" | "success" | "warning" | "error";
|
|
545
|
+
type TagSize = "small" | "medium" | "large";
|
|
546
|
+
type TagOwnProps = {
|
|
547
|
+
children: React.ReactNode;
|
|
548
|
+
variant?: TagVariant;
|
|
549
|
+
size?: TagSize;
|
|
550
|
+
icon?: PawprintIcon;
|
|
551
|
+
};
|
|
552
|
+
type TagProps = TagOwnProps & Omit<ViewProps, keyof TagOwnProps>;
|
|
553
|
+
/**
|
|
554
|
+
* Tag component for labelling and categorising content.
|
|
555
|
+
*
|
|
556
|
+
* @param {React.ReactNode} children - Tag label text.
|
|
557
|
+
* @param {"primary" | "secondary" | "tertiary" | "promo" | "success" | "warning" | "error"} [variant="primary"] - Visual style variant.
|
|
558
|
+
* @param {"small" | "medium" | "large"} [size="medium"] - Size of the tag.
|
|
559
|
+
* @param {PawprintIcon} [icon] - Optional leading icon from @butternutbox/pawprint-icons.
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* <Tag>Company news</Tag>
|
|
563
|
+
* <Tag variant="success" size="large" icon={CheckCircle}>Verified</Tag>
|
|
564
|
+
*/
|
|
565
|
+
declare const Tag: React.ForwardRefExoticComponent<TagOwnProps & Omit<ViewProps, keyof TagOwnProps> & React.RefAttributes<View>>;
|
|
566
|
+
|
|
567
|
+
type ButtonDockVariant = "stacked" | "inline";
|
|
568
|
+
type ButtonDockOwnProps = {
|
|
569
|
+
variant?: ButtonDockVariant;
|
|
570
|
+
leadingContent?: React.ReactNode;
|
|
571
|
+
description?: React.ReactNode;
|
|
572
|
+
};
|
|
573
|
+
type ButtonDockProps = ButtonDockOwnProps & Omit<ViewProps, keyof ButtonDockOwnProps>;
|
|
574
|
+
/**
|
|
575
|
+
* A layout container for action buttons, typically placed at the bottom of a
|
|
576
|
+
* page or section.
|
|
577
|
+
*
|
|
578
|
+
* @example
|
|
579
|
+
* ```tsx
|
|
580
|
+
* import { ButtonDock, Button } from "@butternutbox/pawprint-native"
|
|
581
|
+
*
|
|
582
|
+
* <ButtonDock variant="stacked" description="Helper text">
|
|
583
|
+
* <Button fullWidth>Continue</Button>
|
|
584
|
+
* <Button fullWidth variant="filled" colour="secondary">Back</Button>
|
|
585
|
+
* </ButtonDock>
|
|
586
|
+
* ```
|
|
587
|
+
*
|
|
588
|
+
* @param variant - *(optional)* Layout variant: stacked (default) or inline
|
|
589
|
+
* @param leadingContent - *(optional)* Content rendered above buttons (stacked only)
|
|
590
|
+
* @param description - *(optional)* Helper text rendered below buttons (stacked only)
|
|
591
|
+
*/
|
|
592
|
+
declare const ButtonDock: React.ForwardRefExoticComponent<ButtonDockOwnProps & Omit<ViewProps, keyof ButtonDockOwnProps> & React.RefAttributes<View>>;
|
|
593
|
+
|
|
594
|
+
type ButtonGroupLayout = "stacked" | "inline";
|
|
595
|
+
type ButtonGroupOwnProps = {
|
|
596
|
+
layout?: ButtonGroupLayout;
|
|
597
|
+
description?: React.ReactNode;
|
|
598
|
+
children: React.ReactNode;
|
|
599
|
+
};
|
|
600
|
+
type ButtonGroupProps = ButtonGroupOwnProps & Omit<ViewProps, keyof ButtonGroupOwnProps>;
|
|
601
|
+
/**
|
|
602
|
+
* ButtonGroup arranges 1 or 2 buttons in a stacked or inline layout
|
|
603
|
+
* with an optional description below.
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```tsx
|
|
607
|
+
* <ButtonGroup description="Choose an option">
|
|
608
|
+
* <Button colour="primary">Confirm</Button>
|
|
609
|
+
* <Button colour="secondary">Cancel</Button>
|
|
610
|
+
* </ButtonGroup>
|
|
611
|
+
* ```
|
|
612
|
+
*
|
|
613
|
+
* @param {"stacked" | "inline"} [layout="stacked"] - Layout direction for buttons.
|
|
614
|
+
* @param {React.ReactNode} [description] - Optional text displayed below the buttons.
|
|
615
|
+
* @param {React.ReactNode} children - 1 or 2 Button elements.
|
|
616
|
+
*/
|
|
617
|
+
declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupOwnProps & Omit<ViewProps, keyof ButtonGroupOwnProps> & React.RefAttributes<View>>;
|
|
618
|
+
|
|
619
|
+
type CheckboxVariant = "standalone" | "tile";
|
|
620
|
+
type CheckboxOwnProps = {
|
|
621
|
+
variant?: CheckboxVariant;
|
|
622
|
+
label: string;
|
|
623
|
+
subText?: string;
|
|
624
|
+
illustration?: React.ReactNode;
|
|
625
|
+
checked?: boolean;
|
|
626
|
+
defaultChecked?: boolean;
|
|
627
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
628
|
+
disabled?: boolean;
|
|
629
|
+
name?: string;
|
|
630
|
+
value?: string;
|
|
631
|
+
};
|
|
632
|
+
type CheckboxProps = CheckboxOwnProps & Omit<PressableProps, keyof CheckboxOwnProps | "children">;
|
|
633
|
+
/**
|
|
634
|
+
* Checkbox component for binary selection, supporting standalone and tile layouts.
|
|
635
|
+
*
|
|
636
|
+
* @param {"standalone" | "tile"} [variant="standalone"] - Visual layout variant.
|
|
637
|
+
* @param {string} label - Visible label text.
|
|
638
|
+
* @param {string} [subText] - Optional secondary descriptive text.
|
|
639
|
+
* @param {React.ReactNode} [illustration] - Optional decorative slot (tile variant only).
|
|
640
|
+
* @param {boolean} [checked] - Controlled checked state.
|
|
641
|
+
* @param {boolean} [defaultChecked] - Uncontrolled initial checked state.
|
|
642
|
+
* @param {(checked: boolean) => void} [onCheckedChange] - Callback when state changes.
|
|
643
|
+
* @param {boolean} [disabled=false] - Prevents interaction.
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
* <Checkbox label="Accept terms" subText="Required to proceed" />
|
|
647
|
+
* <Checkbox variant="tile" label="Newsletters" subText="Stay up to date" />
|
|
648
|
+
*/
|
|
649
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxOwnProps & Omit<PressableProps, "children" | keyof CheckboxOwnProps> & React.RefAttributes<View>>;
|
|
650
|
+
|
|
651
|
+
type CheckboxGroupOwnProps = {
|
|
652
|
+
children: React.ReactNode;
|
|
653
|
+
orientation?: "horizontal" | "vertical";
|
|
654
|
+
};
|
|
655
|
+
type CheckboxGroupProps = CheckboxGroupOwnProps & Omit<ViewProps, keyof CheckboxGroupOwnProps>;
|
|
656
|
+
/**
|
|
657
|
+
* CheckboxGroup manages layout for a collection of Checkboxes.
|
|
658
|
+
*
|
|
659
|
+
* @param {"horizontal" | "vertical"} [orientation="vertical"] - Layout direction.
|
|
660
|
+
*
|
|
661
|
+
* @example
|
|
662
|
+
* <CheckboxGroup>
|
|
663
|
+
* <Checkbox label="Chicken" />
|
|
664
|
+
* <Checkbox label="Beef" />
|
|
665
|
+
* </CheckboxGroup>
|
|
666
|
+
*/
|
|
667
|
+
declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupOwnProps & Omit<ViewProps, keyof CheckboxGroupOwnProps> & React.RefAttributes<View>>;
|
|
668
|
+
|
|
669
|
+
type RadioOwnProps = {
|
|
670
|
+
value: string;
|
|
671
|
+
variant?: "standalone" | "tile";
|
|
672
|
+
label?: React.ReactNode;
|
|
673
|
+
subText?: React.ReactNode;
|
|
674
|
+
asset?: IllustrationProps;
|
|
675
|
+
disabled?: boolean;
|
|
676
|
+
selected?: boolean;
|
|
677
|
+
onSelect?: (value: string) => void;
|
|
678
|
+
};
|
|
679
|
+
type RadioProps = RadioOwnProps & Omit<PressableProps, keyof RadioOwnProps | "children">;
|
|
680
|
+
/**
|
|
681
|
+
* Radio button component for single selection within a group.
|
|
682
|
+
*
|
|
683
|
+
* @param {string} value - The value of the radio button (required).
|
|
684
|
+
* @param {"standalone" | "tile"} [variant="standalone"] - Visual style variant.
|
|
685
|
+
* @param {React.ReactNode} [label] - Main label text or content.
|
|
686
|
+
* @param {React.ReactNode} [subText] - Optional descriptive subtext.
|
|
687
|
+
* @param {IllustrationProps} [asset] - Optional illustration asset for tile variant.
|
|
688
|
+
* @param {boolean} [disabled=false] - Whether the radio is disabled.
|
|
689
|
+
* @param {boolean} [selected=false] - Whether the radio is currently selected.
|
|
690
|
+
* @param {(value: string) => void} [onSelect] - Callback when radio is selected.
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* <Radio value="chicken" label="Chicken" subText="Tender & tasty" />
|
|
694
|
+
*/
|
|
695
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioOwnProps & Omit<PressableProps, "children" | keyof RadioOwnProps> & React.RefAttributes<View>>;
|
|
696
|
+
|
|
697
|
+
type RadioGroupOwnProps = {
|
|
698
|
+
name: string;
|
|
699
|
+
options?: RadioOwnProps[];
|
|
700
|
+
orientation?: "horizontal" | "vertical";
|
|
701
|
+
value?: string;
|
|
702
|
+
defaultValue?: string;
|
|
703
|
+
disabled?: boolean;
|
|
704
|
+
onValueChange?: (value: string) => void;
|
|
705
|
+
};
|
|
706
|
+
type RadioGroupProps = RadioGroupOwnProps & Omit<ViewProps, keyof RadioGroupOwnProps>;
|
|
707
|
+
type RadioGroupComponent = React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<View>> & {
|
|
708
|
+
Radio: typeof Radio;
|
|
709
|
+
};
|
|
710
|
+
declare const RadioGroup: RadioGroupComponent;
|
|
711
|
+
|
|
712
|
+
type SegmentedControlLayout = "fixed" | "intrinsic";
|
|
713
|
+
type SegmentedControlOption = {
|
|
714
|
+
value: string;
|
|
715
|
+
label: React.ReactNode;
|
|
716
|
+
disabled?: boolean;
|
|
717
|
+
};
|
|
718
|
+
type SegmentedControlOwnProps = {
|
|
719
|
+
options?: SegmentedControlOption[];
|
|
720
|
+
value?: string;
|
|
721
|
+
defaultValue?: string;
|
|
722
|
+
onValueChange?: (value: string) => void;
|
|
723
|
+
layout?: SegmentedControlLayout;
|
|
724
|
+
disabled?: boolean;
|
|
725
|
+
};
|
|
726
|
+
type SegmentedControlProps = SegmentedControlOwnProps & Omit<ViewProps, keyof SegmentedControlOwnProps>;
|
|
727
|
+
type SegmentedControlItemOwnProps = {
|
|
728
|
+
value: string;
|
|
729
|
+
disabled?: boolean;
|
|
730
|
+
children: React.ReactNode;
|
|
731
|
+
};
|
|
732
|
+
type SegmentedControlItemProps = SegmentedControlItemOwnProps & Omit<ViewProps, keyof SegmentedControlItemOwnProps>;
|
|
733
|
+
/**
|
|
734
|
+
* SegmentedControl.Item for compound component API.
|
|
735
|
+
*/
|
|
736
|
+
declare const SegmentedControlItem: React.ForwardRefExoticComponent<SegmentedControlItemOwnProps & Omit<ViewProps, keyof SegmentedControlItemOwnProps> & React.RefAttributes<View>>;
|
|
737
|
+
type SegmentedControlComponent = React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<View>> & {
|
|
738
|
+
Item: typeof SegmentedControlItem;
|
|
739
|
+
};
|
|
740
|
+
declare const SegmentedControl: SegmentedControlComponent;
|
|
741
|
+
|
|
742
|
+
type SliderOwnProps = {
|
|
743
|
+
value?: number;
|
|
744
|
+
defaultValue?: number;
|
|
745
|
+
onValueChange?: (value: number) => void;
|
|
746
|
+
onValueCommitted?: (value: number) => void;
|
|
747
|
+
min?: number;
|
|
748
|
+
max?: number;
|
|
749
|
+
step?: number;
|
|
750
|
+
disabled?: boolean;
|
|
751
|
+
leadingLabel?: string;
|
|
752
|
+
trailingLabel?: string;
|
|
753
|
+
leadingIcon?: React.ReactNode;
|
|
754
|
+
trailingIcon?: React.ReactNode;
|
|
755
|
+
description?: string;
|
|
756
|
+
};
|
|
757
|
+
type SliderProps = SliderOwnProps & Omit<ViewProps, keyof SliderOwnProps>;
|
|
758
|
+
/**
|
|
759
|
+
* Slider component for selecting a numeric value within a min/max range.
|
|
760
|
+
*
|
|
761
|
+
* @param {number} [value] - Controlled value.
|
|
762
|
+
* @param {number} [defaultValue] - Uncontrolled initial value.
|
|
763
|
+
* @param {(value: number) => void} [onValueChange] - Callback fired on every value change.
|
|
764
|
+
* @param {(value: number) => void} [onValueCommitted] - Callback fired when the user finishes dragging.
|
|
765
|
+
* @param {number} [min=0] - Minimum value.
|
|
766
|
+
* @param {number} [max=100] - Maximum value.
|
|
767
|
+
* @param {number} [step=1] - Step increment.
|
|
768
|
+
* @param {boolean} [disabled=false] - Prevents interaction.
|
|
769
|
+
* @param {string} [leadingLabel] - Label to the left of the track.
|
|
770
|
+
* @param {string} [trailingLabel] - Label to the right of the track.
|
|
771
|
+
* @param {React.ReactNode} [leadingIcon] - Icon before the leading label.
|
|
772
|
+
* @param {React.ReactNode} [trailingIcon] - Icon after the trailing label.
|
|
773
|
+
* @param {string} [description] - Descriptive text below the control.
|
|
774
|
+
*
|
|
775
|
+
* @example
|
|
776
|
+
* <Slider defaultValue={25} leadingLabel="0kg" trailingLabel="50kg+" />
|
|
777
|
+
*/
|
|
778
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderOwnProps & Omit<ViewProps, keyof SliderOwnProps> & React.RefAttributes<View>>;
|
|
779
|
+
|
|
780
|
+
export { Avatar, type AvatarBorder, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, type PawprintIcon, type PawprintIllustration, PawprintProvider, type PawprintProviderProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, Switch, type SwitchProps, Tag, type TagProps, ThemeProvider, Typography, type TypographyProps, createPawprintTheme, registerLogo, resolveFont, resolveLogo, theme, usePawprint };
|