@retray-dev/ui-kit 2.8.0 → 3.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/COMPONENTS.md +71 -15
- package/README.md +23 -3
- package/dist/index.d.mts +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +441 -327
- package/dist/index.mjs +442 -328
- package/package.json +6 -3
- package/src/assets/fonts/Poppins-Black.ttf +0 -0
- package/src/assets/fonts/Poppins-BlackItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Bold.ttf +0 -0
- package/src/assets/fonts/Poppins-BoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Italic.ttf +0 -0
- package/src/assets/fonts/Poppins-Light.ttf +0 -0
- package/src/assets/fonts/Poppins-LightItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Medium.ttf +0 -0
- package/src/assets/fonts/Poppins-MediumItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Regular.ttf +0 -0
- package/src/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/src/assets/fonts/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/assets/fonts/Poppins-Thin.ttf +0 -0
- package/src/assets/fonts/Poppins-ThinItalic.ttf +0 -0
- package/src/components/Accordion/Accordion.tsx +16 -9
- package/src/components/AlertBanner/AlertBanner.tsx +35 -35
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Badge/Badge.tsx +12 -8
- package/src/components/Button/Button.tsx +8 -8
- package/src/components/Card/Card.tsx +12 -9
- package/src/components/Checkbox/Checkbox.tsx +8 -8
- package/src/components/Chip/Chip.tsx +22 -6
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +86 -38
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +1 -1
- package/src/components/CurrencyInput/CurrencyInput.tsx +11 -4
- package/src/components/EmptyState/EmptyState.tsx +2 -1
- package/src/components/Input/Input.tsx +12 -8
- package/src/components/LabelValue/LabelValue.tsx +4 -3
- package/src/components/ListItem/ListItem.tsx +10 -9
- package/src/components/MonthPicker/MonthPicker.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.tsx +36 -36
- package/src/components/Select/Select.tsx +17 -19
- package/src/components/Sheet/Sheet.tsx +2 -1
- package/src/components/Slider/Slider.tsx +3 -3
- package/src/components/Spinner/Spinner.tsx +36 -2
- package/src/components/Switch/Switch.tsx +4 -4
- package/src/components/Tabs/Tabs.tsx +9 -16
- package/src/components/Text/Text.tsx +6 -6
- package/src/components/Textarea/Textarea.tsx +8 -6
- package/src/components/Toast/Toast.tsx +27 -21
- package/src/components/Toggle/Toggle.tsx +6 -4
- package/src/fonts.ts +30 -0
- package/src/theme/colors.ts +22 -14
- package/src/theme/types.ts +4 -0
package/COMPONENTS.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @retray-dev/ui-kit — Component Reference (
|
|
1
|
+
# @retray-dev/ui-kit — Component Reference (v3.0.0)
|
|
2
2
|
|
|
3
3
|
This file is the AI reference for this package. It is shipped inside the npm package so consuming projects can import it into their `CLAUDE.md` with:
|
|
4
4
|
|
|
@@ -42,6 +42,54 @@ export default function App() {
|
|
|
42
42
|
- `BottomSheetModalProvider` must be inside `GestureHandlerRootView`
|
|
43
43
|
- `ToastProvider` must be inside `SafeAreaProvider`
|
|
44
44
|
|
|
45
|
+
## Typography — Poppins (Required)
|
|
46
|
+
|
|
47
|
+
All components use **Poppins** as the font family. You **must** load it before rendering any UI kit component, otherwise text will fall back to the system font.
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { useFonts } from 'expo-font'
|
|
51
|
+
import { PoppinsFonts } from '@retray-dev/ui-kit/fonts'
|
|
52
|
+
|
|
53
|
+
export default function App() {
|
|
54
|
+
const [fontsLoaded] = useFonts(PoppinsFonts)
|
|
55
|
+
if (!fontsLoaded) return null // or show a splash screen
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
// ... your providers and app
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**How it works:**
|
|
64
|
+
1. Import `PoppinsFonts` from `@retray-dev/ui-kit/fonts` (separate export path)
|
|
65
|
+
2. Pass it to `expo-font`'s `useFonts()` hook at your app root
|
|
66
|
+
3. Metro resolves font files from `node_modules/@retray-dev/ui-kit/src/assets/fonts/` at bundle time
|
|
67
|
+
4. All library components reference fonts by family name (e.g., `fontFamily: 'Poppins-SemiBold'`)
|
|
68
|
+
|
|
69
|
+
**Why this pattern:**
|
|
70
|
+
- Fonts are NOT bundled into `dist/` — they ship as raw `.ttf` files inside `src/assets/fonts/`
|
|
71
|
+
- Metro resolves `require()` calls to these files when it bundles your app
|
|
72
|
+
- This prevents font corruption that can occur when `.ttf` files pass through bundlers like esbuild/tsup
|
|
73
|
+
|
|
74
|
+
**Setup:**
|
|
75
|
+
- Add `expo-font` to your app: `pnpm add expo-font`
|
|
76
|
+
- The `if (!fontsLoaded) return null` guard prevents text from rendering before fonts are ready
|
|
77
|
+
- Pair with `expo-splash-screen` in production to avoid a flash:
|
|
78
|
+
```tsx
|
|
79
|
+
import * as SplashScreen from 'expo-splash-screen'
|
|
80
|
+
SplashScreen.preventAutoHideAsync()
|
|
81
|
+
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (fontsLoaded) SplashScreen.hideAsync()
|
|
84
|
+
}, [fontsLoaded])
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Included weights:**
|
|
88
|
+
- Regular: `Poppins-Thin`, `Poppins-ExtraLight`, `Poppins-Light`, `Poppins-Regular`, `Poppins-Medium`, `Poppins-SemiBold`, `Poppins-Bold`, `Poppins-ExtraBold`, `Poppins-Black`
|
|
89
|
+
- Italic: `Poppins-Italic`, `Poppins-MediumItalic`, `Poppins-SemiBoldItalic`, `Poppins-BoldItalic`
|
|
90
|
+
|
|
91
|
+
**Total: 13 font files** exported from the package. Additional italic variants exist in `src/assets/fonts/` but are not exported — if you need them, open an issue.
|
|
92
|
+
|
|
45
93
|
### ThemeProvider Props
|
|
46
94
|
|
|
47
95
|
| Prop | Type | Default | Notes |
|
|
@@ -74,7 +122,7 @@ function MyComponent() {
|
|
|
74
122
|
|
|
75
123
|
## Theme Tokens
|
|
76
124
|
|
|
77
|
-
All
|
|
125
|
+
All 23 tokens are available via `useTheme().colors` and are applied exactly as provided — there is no automatic color derivation or forced contrast applied by the library. Consumers may pass partial overrides for `light` and/or `dark` and the values are used as-is.
|
|
78
126
|
|
|
79
127
|
The `ThemeColors` type (and `Theme`, `ColorScheme`) are exported directly from the package:
|
|
80
128
|
```ts
|
|
@@ -83,25 +131,29 @@ import type { ThemeColors } from '@retray-dev/ui-kit'
|
|
|
83
131
|
|
|
84
132
|
| Token | Light | Dark | Semantic Role |
|
|
85
133
|
|-------|-------|------|---------------|
|
|
86
|
-
| `background` | `#ffffff` | `#
|
|
134
|
+
| `background` | `#ffffff` | `#0f0f0f` | Screen / page background |
|
|
87
135
|
| `foreground` | `#171717` | `#fafafa` | Primary text color |
|
|
88
|
-
| `card` | `#ffffff` | `#
|
|
136
|
+
| `card` | `#ffffff` | `#1c1c1c` | Card / surface background |
|
|
89
137
|
| `cardForeground` | `#171717` | `#fafafa` | Text on cards |
|
|
90
138
|
| `primary` | `#1a1a1a` | `#fafafa` | Primary action (buttons, selected states) |
|
|
91
|
-
| `primaryForeground` | `#ffffff` | `#
|
|
92
|
-
| `secondary` | `#f1f1f1` | `#
|
|
139
|
+
| `primaryForeground` | `#ffffff` | `#0f0f0f` | Text/icon on primary background |
|
|
140
|
+
| `secondary` | `#f1f1f1` | `#272727` | Secondary surfaces |
|
|
93
141
|
| `secondaryForeground` | `#171717` | `#fafafa` | Text on secondary |
|
|
94
|
-
| `muted` | `#f1f1f1` | `#
|
|
95
|
-
| `mutedForeground` | `#a2a2a2` | `#
|
|
96
|
-
| `accent` | `#e4e4e4` | `#
|
|
142
|
+
| `muted` | `#f1f1f1` | `#272727` | Muted backgrounds, skeleton fills, track fills |
|
|
143
|
+
| `mutedForeground` | `#a2a2a2` | `#9a9a9a` | Placeholder text, helper text, captions |
|
|
144
|
+
| `accent` | `#e4e4e4` | `#2e2e2e` | Hover / pressed state fills |
|
|
97
145
|
| `accentForeground` | `#171717` | `#fafafa` | Text on accent |
|
|
98
|
-
| `destructive` | `#ef4444` | `#dc2626` | Error / danger / delete actions |
|
|
99
|
-
| `destructiveForeground` | `#
|
|
100
|
-
| `
|
|
146
|
+
| `destructive` | `#ef4444` | `#dc2626` | Error / danger / delete actions — base color |
|
|
147
|
+
| `destructiveForeground` | `#ffffff` | `#ffffff` | Text on destructive |
|
|
148
|
+
| `destructiveTint` | `#fff5f5` | `#3b0a0a` | Very light/dark background tint for destructive states |
|
|
149
|
+
| `destructiveBorder` | `#fecaca` | `#7f1d1d` | Border color for destructive outlined elements |
|
|
150
|
+
| `success` | `#1a7a45` | `#166534` | Success / confirmation / done actions — base color |
|
|
151
|
+
| `successForeground` | `#ffffff` | `#ffffff` | Text on success |
|
|
152
|
+
| `successTint` | `#f0fdf4` | `#052e16` | Very light/dark background tint for success states |
|
|
153
|
+
| `successBorder` | `#bbf7d0` | `#166534` | Border color for success outlined elements |
|
|
154
|
+
| `border` | `#e5e5e5` | `#303030` | Borders and dividers |
|
|
101
155
|
| `input` | `#e5e5e5` | `#2a2a2a` | Input field border color |
|
|
102
156
|
| `ring` | `#1a1a1a` | `#fafafa` | Optional focus ring token (components may use `primary` by default) |
|
|
103
|
-
| `success` | `#16a34a` | `#22c55e` | Success state (Toast success variant) |
|
|
104
|
-
| `successForeground` | `#1a1a1a` | `#1a1a1a` | Text on success background |
|
|
105
157
|
|
|
106
158
|
---
|
|
107
159
|
|
|
@@ -485,11 +537,13 @@ const [amount, setAmount] = useState(0)
|
|
|
485
537
|
|------|------|---------|-------|
|
|
486
538
|
| size | `'sm' \| 'md' \| 'lg'` | `'md'` | `sm`/`md` map to RN `'small'`, `lg` maps to `'large'` |
|
|
487
539
|
| color | `string` | `primary` token | Override spinner color |
|
|
540
|
+
| label | `string` | — | Text displayed below the spinner |
|
|
488
541
|
|
|
489
542
|
**Example:**
|
|
490
543
|
```tsx
|
|
491
544
|
<Spinner />
|
|
492
545
|
<Spinner size="lg" color="#6366f1" />
|
|
546
|
+
<Spinner size="lg" label="Loading..." />
|
|
493
547
|
```
|
|
494
548
|
|
|
495
549
|
---
|
|
@@ -888,7 +942,7 @@ const [accepted, setAccepted] = useState(false)
|
|
|
888
942
|
|
|
889
943
|
| Prop | Type | Default | Notes |
|
|
890
944
|
|------|------|---------|-------|
|
|
891
|
-
| tabs | `TabItem[]` | required | Each item: `{ label: string, value: string }` |
|
|
945
|
+
| tabs | `TabItem[]` | required | Each item: `{ label: string, value: string, icon?: ReactNode \| ((active: boolean) => ReactNode) }` |
|
|
892
946
|
| value | `string` | — | Controlled active tab |
|
|
893
947
|
| onValueChange | `(value: string) => void` | — | — |
|
|
894
948
|
| children | `ReactNode` | — | `TabsContent` components |
|
|
@@ -1153,6 +1207,8 @@ function MyComponent() {
|
|
|
1153
1207
|
| label | `string` | required | — |
|
|
1154
1208
|
| selected | `boolean` | `false` | Controls fill color |
|
|
1155
1209
|
| onPress | `() => void` | — | — |
|
|
1210
|
+
| icon | `ReactNode` | — | Custom icon rendered before the label |
|
|
1211
|
+
| iconName | `string` | — | Icon name from `@expo/vector-icons`. Takes precedence over `icon` |
|
|
1156
1212
|
| style | `ViewStyle` | — | — |
|
|
1157
1213
|
|
|
1158
1214
|
**`ChipGroup` Props:**
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A personal React Native / Expo UI component library with a built-in design system, dark mode support, haptic feedback, and smooth animations.
|
|
4
4
|
|
|
5
5
|
- 33 components across 6 categories
|
|
6
|
-
- Light/dark theme with
|
|
6
|
+
- Light/dark theme with 23 color tokens and full customization
|
|
7
7
|
- Apple HIG–compliant touch targets and haptic feedback
|
|
8
8
|
- Animated interactions: spring press, sliding tabs, accordion easing, animated progress
|
|
9
9
|
- Built with TypeScript — full type declarations included
|
|
@@ -23,7 +23,7 @@ pnpm add @retray-dev/ui-kit
|
|
|
23
23
|
Install these in your app if not already present:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
pnpm add expo-haptics expo-linear-gradient react-native-safe-area-context @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-worklets @react-native-picker/picker @react-native-community/slider @expo/vector-icons
|
|
26
|
+
pnpm add expo-font expo-haptics expo-linear-gradient react-native-safe-area-context @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-worklets @react-native-picker/picker @react-native-community/slider @expo/vector-icons
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
For Expo projects, run `npx expo install` instead to get SDK-compatible versions.
|
|
@@ -40,6 +40,26 @@ module.exports = function (api) {
|
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Typography
|
|
44
|
+
|
|
45
|
+
All components use **Poppins** font family. You must load the fonts at app root before rendering any component:
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { useFonts } from 'expo-font'
|
|
49
|
+
import { PoppinsFonts } from '@retray-dev/ui-kit/fonts'
|
|
50
|
+
|
|
51
|
+
export default function App() {
|
|
52
|
+
const [fontsLoaded] = useFonts(PoppinsFonts)
|
|
53
|
+
if (!fontsLoaded) return null
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
// ... providers and app
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The library ships 13 font files (9 regular weights + 4 italic variants) as raw `.ttf` files. Metro resolves them at bundle time.
|
|
62
|
+
|
|
43
63
|
## Setup
|
|
44
64
|
|
|
45
65
|
Wrap your app root with all required providers. Order matters.
|
|
@@ -93,7 +113,7 @@ import { useTheme } from '@retray-dev/ui-kit'
|
|
|
93
113
|
const { colors, colorScheme } = useTheme()
|
|
94
114
|
```
|
|
95
115
|
|
|
96
|
-
**Available tokens:** `background`, `foreground`, `card`, `cardForeground`, `primary`, `primaryForeground`, `secondary`, `secondaryForeground`, `muted`, `mutedForeground`, `accent`, `accentForeground`, `destructive`, `destructiveForeground`, `border`, `input`, `ring`, `success`, `successForeground`
|
|
116
|
+
**Available tokens:** `background`, `foreground`, `card`, `cardForeground`, `primary`, `primaryForeground`, `secondary`, `secondaryForeground`, `muted`, `mutedForeground`, `accent`, `accentForeground`, `destructive`, `destructiveForeground`, `destructiveTint`, `destructiveBorder`, `border`, `input`, `ring`, `success`, `successForeground`, `successTint`, `successBorder`
|
|
97
117
|
|
|
98
118
|
## Design Tokens
|
|
99
119
|
|
package/dist/index.d.mts
CHANGED
|
@@ -22,6 +22,10 @@ type ThemeColors = {
|
|
|
22
22
|
ring: string;
|
|
23
23
|
success: string;
|
|
24
24
|
successForeground: string;
|
|
25
|
+
destructiveTint: string;
|
|
26
|
+
destructiveBorder: string;
|
|
27
|
+
successTint: string;
|
|
28
|
+
successBorder: string;
|
|
25
29
|
};
|
|
26
30
|
type Theme = {
|
|
27
31
|
light?: Partial<ThemeColors>;
|
|
@@ -149,7 +153,7 @@ interface InputProps extends TextInputProps {
|
|
|
149
153
|
}
|
|
150
154
|
declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
|
|
151
155
|
|
|
152
|
-
type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
|
|
156
|
+
type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'successOutline' | 'destructiveOutline';
|
|
153
157
|
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
154
158
|
interface BadgeProps {
|
|
155
159
|
label?: string;
|
|
@@ -216,8 +220,9 @@ type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
|
216
220
|
interface SpinnerProps extends Omit<ActivityIndicatorProps, 'size'> {
|
|
217
221
|
size?: SpinnerSize;
|
|
218
222
|
color?: string;
|
|
223
|
+
label?: string;
|
|
219
224
|
}
|
|
220
|
-
declare function Spinner({ size, color, ...props }: SpinnerProps): React.JSX.Element;
|
|
225
|
+
declare function Spinner({ size, color, label, ...props }: SpinnerProps): React.JSX.Element;
|
|
221
226
|
|
|
222
227
|
interface SkeletonProps {
|
|
223
228
|
width?: number | string;
|
|
@@ -358,7 +363,7 @@ declare function RadioGroup({ options, value, onValueChange, orientation, style,
|
|
|
358
363
|
interface TabItem {
|
|
359
364
|
label: string;
|
|
360
365
|
value: string;
|
|
361
|
-
icon?: React.ReactNode;
|
|
366
|
+
icon?: React.ReactNode | ((active: boolean) => React.ReactNode);
|
|
362
367
|
}
|
|
363
368
|
interface TabsProps {
|
|
364
369
|
tabs: TabItem[];
|
|
@@ -496,10 +501,12 @@ interface CurrencyInputProps {
|
|
|
496
501
|
hint?: string;
|
|
497
502
|
placeholder?: string;
|
|
498
503
|
editable?: boolean;
|
|
504
|
+
/** Icon or element rendered at the left edge inside the input field. */
|
|
505
|
+
prefixIcon?: React.ReactNode;
|
|
499
506
|
containerStyle?: ViewStyle;
|
|
500
507
|
style?: TextStyle;
|
|
501
508
|
}
|
|
502
|
-
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
509
|
+
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, prefixIcon, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
503
510
|
|
|
504
511
|
interface CurrencyDisplayProps {
|
|
505
512
|
value: number | string;
|
|
@@ -574,6 +581,10 @@ interface ChipProps {
|
|
|
574
581
|
label: string;
|
|
575
582
|
selected?: boolean;
|
|
576
583
|
onPress?: () => void;
|
|
584
|
+
/** JSX icon rendered before the label. */
|
|
585
|
+
icon?: React.ReactNode;
|
|
586
|
+
/** Icon name from @expo/vector-icons resolved automatically. */
|
|
587
|
+
iconName?: string;
|
|
577
588
|
style?: ViewStyle;
|
|
578
589
|
}
|
|
579
590
|
interface ChipOption {
|
|
@@ -588,7 +599,7 @@ interface ChipGroupProps {
|
|
|
588
599
|
multiSelect?: boolean;
|
|
589
600
|
style?: ViewStyle;
|
|
590
601
|
}
|
|
591
|
-
declare function Chip({ label, selected, onPress, style }: ChipProps): React.JSX.Element;
|
|
602
|
+
declare function Chip({ label, selected, onPress, icon, iconName, style }: ChipProps): React.JSX.Element;
|
|
592
603
|
declare function ChipGroup({ options, value, onValueChange, multiSelect, style }: ChipGroupProps): React.JSX.Element;
|
|
593
604
|
|
|
594
605
|
interface ConfirmDialogProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ type ThemeColors = {
|
|
|
22
22
|
ring: string;
|
|
23
23
|
success: string;
|
|
24
24
|
successForeground: string;
|
|
25
|
+
destructiveTint: string;
|
|
26
|
+
destructiveBorder: string;
|
|
27
|
+
successTint: string;
|
|
28
|
+
successBorder: string;
|
|
25
29
|
};
|
|
26
30
|
type Theme = {
|
|
27
31
|
light?: Partial<ThemeColors>;
|
|
@@ -149,7 +153,7 @@ interface InputProps extends TextInputProps {
|
|
|
149
153
|
}
|
|
150
154
|
declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, prefixIcon, suffixIcon, prefixIconColor, suffixIconColor, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
|
|
151
155
|
|
|
152
|
-
type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
|
|
156
|
+
type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'successOutline' | 'destructiveOutline';
|
|
153
157
|
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
154
158
|
interface BadgeProps {
|
|
155
159
|
label?: string;
|
|
@@ -216,8 +220,9 @@ type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
|
216
220
|
interface SpinnerProps extends Omit<ActivityIndicatorProps, 'size'> {
|
|
217
221
|
size?: SpinnerSize;
|
|
218
222
|
color?: string;
|
|
223
|
+
label?: string;
|
|
219
224
|
}
|
|
220
|
-
declare function Spinner({ size, color, ...props }: SpinnerProps): React.JSX.Element;
|
|
225
|
+
declare function Spinner({ size, color, label, ...props }: SpinnerProps): React.JSX.Element;
|
|
221
226
|
|
|
222
227
|
interface SkeletonProps {
|
|
223
228
|
width?: number | string;
|
|
@@ -358,7 +363,7 @@ declare function RadioGroup({ options, value, onValueChange, orientation, style,
|
|
|
358
363
|
interface TabItem {
|
|
359
364
|
label: string;
|
|
360
365
|
value: string;
|
|
361
|
-
icon?: React.ReactNode;
|
|
366
|
+
icon?: React.ReactNode | ((active: boolean) => React.ReactNode);
|
|
362
367
|
}
|
|
363
368
|
interface TabsProps {
|
|
364
369
|
tabs: TabItem[];
|
|
@@ -496,10 +501,12 @@ interface CurrencyInputProps {
|
|
|
496
501
|
hint?: string;
|
|
497
502
|
placeholder?: string;
|
|
498
503
|
editable?: boolean;
|
|
504
|
+
/** Icon or element rendered at the left edge inside the input field. */
|
|
505
|
+
prefixIcon?: React.ReactNode;
|
|
499
506
|
containerStyle?: ViewStyle;
|
|
500
507
|
style?: TextStyle;
|
|
501
508
|
}
|
|
502
|
-
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
509
|
+
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, prefixIcon, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
503
510
|
|
|
504
511
|
interface CurrencyDisplayProps {
|
|
505
512
|
value: number | string;
|
|
@@ -574,6 +581,10 @@ interface ChipProps {
|
|
|
574
581
|
label: string;
|
|
575
582
|
selected?: boolean;
|
|
576
583
|
onPress?: () => void;
|
|
584
|
+
/** JSX icon rendered before the label. */
|
|
585
|
+
icon?: React.ReactNode;
|
|
586
|
+
/** Icon name from @expo/vector-icons resolved automatically. */
|
|
587
|
+
iconName?: string;
|
|
577
588
|
style?: ViewStyle;
|
|
578
589
|
}
|
|
579
590
|
interface ChipOption {
|
|
@@ -588,7 +599,7 @@ interface ChipGroupProps {
|
|
|
588
599
|
multiSelect?: boolean;
|
|
589
600
|
style?: ViewStyle;
|
|
590
601
|
}
|
|
591
|
-
declare function Chip({ label, selected, onPress, style }: ChipProps): React.JSX.Element;
|
|
602
|
+
declare function Chip({ label, selected, onPress, icon, iconName, style }: ChipProps): React.JSX.Element;
|
|
592
603
|
declare function ChipGroup({ options, value, onValueChange, multiSelect, style }: ChipGroupProps): React.JSX.Element;
|
|
593
604
|
|
|
594
605
|
interface ConfirmDialogProps {
|