@retray-dev/ui-kit 1.7.0 → 2.3.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 +258 -54
- package/README.md +6 -5
- package/dist/index.d.mts +113 -44
- package/dist/index.d.ts +113 -44
- package/dist/index.js +802 -324
- package/dist/index.mjs +794 -323
- package/package.json +6 -2
- package/src/components/Alert/Alert.tsx +24 -12
- package/src/components/AlertBanner/AlertBanner.tsx +83 -0
- package/src/components/AlertBanner/index.ts +2 -0
- package/src/components/Avatar/Avatar.tsx +1 -0
- package/src/components/Badge/Badge.tsx +44 -8
- package/src/components/Button/Button.tsx +12 -5
- package/src/components/Card/Card.tsx +86 -9
- package/src/components/Chip/Chip.tsx +173 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +87 -0
- package/src/components/ConfirmDialog/index.ts +2 -0
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +4 -2
- package/src/components/CurrencyInput/CurrencyInput.tsx +9 -1
- package/src/components/EmptyState/EmptyState.tsx +42 -7
- package/src/components/Input/Input.tsx +102 -21
- package/src/components/LabelValue/LabelValue.tsx +47 -0
- package/src/components/LabelValue/index.ts +2 -0
- package/src/components/ListItem/ListItem.tsx +121 -0
- package/src/components/ListItem/index.ts +2 -0
- package/src/components/MonthPicker/MonthPicker.tsx +92 -0
- package/src/components/MonthPicker/index.ts +2 -0
- package/src/components/Select/Select.tsx +189 -125
- package/src/components/Slider/Slider.tsx +64 -100
- package/src/components/Switch/Switch.tsx +25 -21
- package/src/components/Textarea/Textarea.tsx +12 -2
- package/src/components/Toggle/Toggle.tsx +13 -6
- package/src/index.ts +8 -2
- package/src/theme/ThemeProvider.tsx +11 -8
- package/src/theme/colors.ts +19 -18
- package/src/theme/types.ts +2 -0
- package/src/components/Alert/index.ts +0 -2
- package/src/components/CurrencyInputLarge/CurrencyInputLarge.tsx +0 -66
- package/src/components/CurrencyInputLarge/index.ts +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TouchableOpacityProps, TextProps as TextProps$1, TextInputProps,
|
|
2
|
+
import { TouchableOpacityProps, TextProps as TextProps$1, TextInputProps, TextStyle, ViewStyle, ActivityIndicatorProps } from 'react-native';
|
|
3
3
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
4
4
|
|
|
5
5
|
type ThemeColors = {
|
|
@@ -36,11 +36,10 @@ type ThemeContextValue = {
|
|
|
36
36
|
interface ThemeProviderProps {
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* dark: { primary: '#818cf8', primaryForeground: '#fff' } }
|
|
39
|
+
* Optional full-palette overrides per scheme. Supply a partial or full `ThemeColors` object
|
|
40
|
+
* for `light` and/or `dark` to override the defaults.
|
|
41
|
+
* @example
|
|
42
|
+
* { light: { primary: '#6366f1', card: '#fff' }, dark: { primary: '#818cf8' } }
|
|
44
43
|
*/
|
|
45
44
|
theme?: Theme;
|
|
46
45
|
/**
|
|
@@ -55,7 +54,7 @@ declare function useTheme(): ThemeContextValue;
|
|
|
55
54
|
declare const defaultLight: ThemeColors;
|
|
56
55
|
declare const defaultDark: ThemeColors;
|
|
57
56
|
|
|
58
|
-
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
57
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
59
58
|
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
60
59
|
interface ButtonProps extends TouchableOpacityProps {
|
|
61
60
|
label: string;
|
|
@@ -94,21 +93,42 @@ interface InputProps extends TextInputProps {
|
|
|
94
93
|
error?: string;
|
|
95
94
|
/** Helper text shown below the input when there is no error. */
|
|
96
95
|
hint?: string;
|
|
97
|
-
/**
|
|
96
|
+
/** Text or component rendered before the input text. */
|
|
97
|
+
prefix?: React.ReactNode;
|
|
98
|
+
/** Text or component rendered after the input text. */
|
|
99
|
+
suffix?: React.ReactNode;
|
|
100
|
+
/** Style applied to prefix text if prefix is a string. */
|
|
101
|
+
prefixStyle?: TextStyle;
|
|
102
|
+
/** Style applied to suffix text if suffix is a string. */
|
|
103
|
+
suffixStyle?: TextStyle;
|
|
104
|
+
/** Input type. When set to \`'password'\`, shows a toggle button to reveal/hide text. */
|
|
105
|
+
type?: 'text' | 'password';
|
|
106
|
+
/** Style for the outer container \`View\`. Use \`style\` (from \`TextInputProps\`) to style the \`TextInput\` itself. */
|
|
98
107
|
containerStyle?: ViewStyle;
|
|
99
108
|
}
|
|
100
|
-
declare function Input({ label, error, hint, containerStyle, style, onFocus, onBlur, ...props }: InputProps): React.JSX.Element;
|
|
109
|
+
declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
|
|
101
110
|
|
|
102
111
|
type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
|
|
112
|
+
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
103
113
|
interface BadgeProps {
|
|
104
|
-
label
|
|
114
|
+
label?: string;
|
|
115
|
+
/** Alternative to \`label\` — allows JSX children. */
|
|
116
|
+
children?: React.ReactNode;
|
|
105
117
|
variant?: BadgeVariant;
|
|
118
|
+
size?: BadgeSize;
|
|
119
|
+
/** Icon rendered before the label/children. */
|
|
120
|
+
icon?: React.ReactNode;
|
|
106
121
|
style?: ViewStyle;
|
|
107
122
|
}
|
|
108
|
-
declare function Badge({ label, variant, style }: BadgeProps): React.JSX.Element;
|
|
123
|
+
declare function Badge({ label, children, variant, size, icon, style }: BadgeProps): React.JSX.Element;
|
|
109
124
|
|
|
125
|
+
type CardVariant = 'elevated' | 'outlined' | 'filled';
|
|
110
126
|
interface CardProps {
|
|
111
127
|
children: React.ReactNode;
|
|
128
|
+
/** Visual style variant. `'elevated'` (default) has shadow, `'outlined'` has border only, `'filled'` uses accent background. */
|
|
129
|
+
variant?: CardVariant;
|
|
130
|
+
/** Makes the card tappable. Adds press animation and haptic feedback. */
|
|
131
|
+
onPress?: () => void;
|
|
112
132
|
style?: ViewStyle;
|
|
113
133
|
}
|
|
114
134
|
interface CardHeaderProps {
|
|
@@ -131,7 +151,7 @@ interface CardFooterProps {
|
|
|
131
151
|
children: React.ReactNode;
|
|
132
152
|
style?: ViewStyle;
|
|
133
153
|
}
|
|
134
|
-
declare function Card({ children, style }: CardProps): React.JSX.Element;
|
|
154
|
+
declare function Card({ children, variant, onPress, style }: CardProps): React.JSX.Element;
|
|
135
155
|
declare function CardHeader({ children, style }: CardHeaderProps): React.JSX.Element;
|
|
136
156
|
declare function CardTitle({ children, style }: CardTitleProps): React.JSX.Element;
|
|
137
157
|
declare function CardDescription({ children, style }: CardDescriptionProps): React.JSX.Element;
|
|
@@ -170,15 +190,15 @@ interface AvatarProps {
|
|
|
170
190
|
}
|
|
171
191
|
declare function Avatar({ src, fallback, size, style }: AvatarProps): React.JSX.Element;
|
|
172
192
|
|
|
173
|
-
type
|
|
174
|
-
interface
|
|
193
|
+
type AlertBannerVariant = 'default' | 'destructive' | 'success';
|
|
194
|
+
interface AlertBannerProps {
|
|
175
195
|
title?: string;
|
|
176
196
|
description?: string;
|
|
177
|
-
variant?:
|
|
197
|
+
variant?: AlertBannerVariant;
|
|
178
198
|
icon?: React.ReactNode;
|
|
179
199
|
style?: ViewStyle;
|
|
180
200
|
}
|
|
181
|
-
declare function
|
|
201
|
+
declare function AlertBanner({ title, description, variant, icon, style }: AlertBannerProps): React.JSX.Element;
|
|
182
202
|
|
|
183
203
|
interface ProgressProps {
|
|
184
204
|
/** Current progress value. Clamped to `[0, max]`. Defaults to `0`. */
|
|
@@ -194,9 +214,11 @@ interface EmptyStateProps {
|
|
|
194
214
|
title: string;
|
|
195
215
|
description?: string;
|
|
196
216
|
action?: React.ReactNode;
|
|
217
|
+
/** `compact` hides description/action and uses tighter spacing and a smaller icon. */
|
|
218
|
+
size?: 'default' | 'compact';
|
|
197
219
|
style?: ViewStyle;
|
|
198
220
|
}
|
|
199
|
-
declare function EmptyState({ icon, title, description, action, style }: EmptyStateProps): React.JSX.Element;
|
|
221
|
+
declare function EmptyState({ icon, title, description, action, size, style }: EmptyStateProps): React.JSX.Element;
|
|
200
222
|
|
|
201
223
|
interface TextareaProps extends TextInputProps {
|
|
202
224
|
label?: string;
|
|
@@ -301,20 +323,20 @@ interface AccordionProps {
|
|
|
301
323
|
declare function Accordion({ items, type, defaultValue, style }: AccordionProps): React.JSX.Element;
|
|
302
324
|
|
|
303
325
|
interface SliderProps {
|
|
304
|
-
/** Current value. Controlled when provided; falls back to internal state otherwise. */
|
|
305
326
|
value?: number;
|
|
306
327
|
minimumValue?: number;
|
|
307
328
|
maximumValue?: number;
|
|
308
|
-
/** Snap interval. `0` (default) means continuous (no snapping). */
|
|
309
329
|
step?: number;
|
|
310
|
-
/** Called on every move while dragging. */
|
|
311
330
|
onValueChange?: (value: number) => void;
|
|
312
|
-
/** Called once when the user releases the thumb. */
|
|
313
331
|
onSlidingComplete?: (value: number) => void;
|
|
332
|
+
label?: string;
|
|
333
|
+
showValue?: boolean;
|
|
334
|
+
formatValue?: (value: number) => string;
|
|
335
|
+
accessibilityLabel?: string;
|
|
314
336
|
disabled?: boolean;
|
|
315
337
|
style?: ViewStyle;
|
|
316
338
|
}
|
|
317
|
-
declare function Slider({ value, minimumValue, maximumValue, step, onValueChange, onSlidingComplete, disabled, style, }: SliderProps): React.JSX.Element;
|
|
339
|
+
declare function Slider({ value, minimumValue, maximumValue, step, onValueChange, onSlidingComplete, label, showValue, formatValue, accessibilityLabel, disabled, style, }: SliderProps): React.JSX.Element;
|
|
318
340
|
|
|
319
341
|
interface SheetProps {
|
|
320
342
|
open: boolean;
|
|
@@ -341,10 +363,8 @@ interface SelectProps {
|
|
|
341
363
|
options: SelectOption[];
|
|
342
364
|
value?: string;
|
|
343
365
|
onValueChange?: (value: string) => void;
|
|
344
|
-
/** Text shown when no option is selected. Defaults to `'Select an option'`. */
|
|
345
366
|
placeholder?: string;
|
|
346
367
|
label?: string;
|
|
347
|
-
/** Red helper text; also changes trigger border to `destructive` color. */
|
|
348
368
|
error?: string;
|
|
349
369
|
disabled?: boolean;
|
|
350
370
|
style?: ViewStyle;
|
|
@@ -385,6 +405,8 @@ interface CurrencyInputProps {
|
|
|
385
405
|
prefix?: string;
|
|
386
406
|
/** Character used to separate groups of three digits. Defaults to `'.'`. */
|
|
387
407
|
thousandsSeparator?: '.' | ',';
|
|
408
|
+
/** Font size variant. `'large'` renders at 36pt, `'default'` at 17pt. */
|
|
409
|
+
size?: 'default' | 'large';
|
|
388
410
|
label?: string;
|
|
389
411
|
/** Red helper text; also changes input border to destructive color. */
|
|
390
412
|
error?: string;
|
|
@@ -392,8 +414,9 @@ interface CurrencyInputProps {
|
|
|
392
414
|
placeholder?: string;
|
|
393
415
|
editable?: boolean;
|
|
394
416
|
containerStyle?: ViewStyle;
|
|
417
|
+
style?: TextStyle;
|
|
395
418
|
}
|
|
396
|
-
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, label, error, hint, placeholder, editable, containerStyle, }: CurrencyInputProps): React.JSX.Element;
|
|
419
|
+
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
397
420
|
|
|
398
421
|
interface CurrencyDisplayProps {
|
|
399
422
|
value: number | string;
|
|
@@ -401,27 +424,73 @@ interface CurrencyDisplayProps {
|
|
|
401
424
|
prefix?: string;
|
|
402
425
|
/** When true, shows two decimal places separated by a comma (e.g. `$25.000,00`). Defaults to `false`. */
|
|
403
426
|
showDecimals?: boolean;
|
|
427
|
+
/** Override the color of the formatted text. Defaults to the `foreground` theme token. */
|
|
428
|
+
textColor?: string;
|
|
404
429
|
style?: ViewStyle;
|
|
405
430
|
}
|
|
406
|
-
declare function CurrencyDisplay({ value, prefix, showDecimals, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
431
|
+
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
407
432
|
|
|
408
|
-
interface
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
433
|
+
interface ListItemProps {
|
|
434
|
+
icon?: React.ReactNode;
|
|
435
|
+
title: string;
|
|
436
|
+
subtitle?: string;
|
|
437
|
+
trailing?: string | React.ReactNode;
|
|
438
|
+
onPress?: () => void;
|
|
439
|
+
disabled?: boolean;
|
|
440
|
+
style?: ViewStyle;
|
|
441
|
+
}
|
|
442
|
+
declare function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style }: ListItemProps): React.JSX.Element;
|
|
443
|
+
|
|
444
|
+
interface ChipProps {
|
|
445
|
+
label: string;
|
|
446
|
+
selected?: boolean;
|
|
447
|
+
onPress?: () => void;
|
|
448
|
+
style?: ViewStyle;
|
|
449
|
+
}
|
|
450
|
+
interface ChipOption {
|
|
451
|
+
label: string;
|
|
452
|
+
value: string | number;
|
|
453
|
+
}
|
|
454
|
+
interface ChipGroupProps {
|
|
455
|
+
options: ChipOption[];
|
|
456
|
+
value?: string | number | (string | number)[];
|
|
457
|
+
onValueChange?: (value: string | number | (string | number)[]) => void;
|
|
458
|
+
/** When true, allows selecting multiple chips. `value` and `onValueChange` will use arrays. */
|
|
459
|
+
multiSelect?: boolean;
|
|
460
|
+
style?: ViewStyle;
|
|
461
|
+
}
|
|
462
|
+
declare function Chip({ label, selected, onPress, style }: ChipProps): React.JSX.Element;
|
|
463
|
+
declare function ChipGroup({ options, value, onValueChange, multiSelect, style }: ChipGroupProps): React.JSX.Element;
|
|
464
|
+
|
|
465
|
+
interface ConfirmDialogProps {
|
|
466
|
+
visible: boolean;
|
|
467
|
+
title: string;
|
|
468
|
+
description?: string;
|
|
469
|
+
confirmLabel?: string;
|
|
470
|
+
cancelLabel?: string;
|
|
471
|
+
confirmVariant?: 'primary' | 'destructive';
|
|
472
|
+
onConfirm: () => void;
|
|
473
|
+
onCancel: () => void;
|
|
474
|
+
}
|
|
475
|
+
declare function ConfirmDialog({ visible, title, description, confirmLabel, cancelLabel, confirmVariant, onConfirm, onCancel, }: ConfirmDialogProps): React.JSX.Element;
|
|
476
|
+
|
|
477
|
+
interface LabelValueProps {
|
|
478
|
+
label: string;
|
|
479
|
+
value: string | React.ReactNode;
|
|
480
|
+
style?: ViewStyle;
|
|
481
|
+
}
|
|
482
|
+
declare function LabelValue({ label, value, style }: LabelValueProps): React.JSX.Element;
|
|
483
|
+
|
|
484
|
+
interface MonthPickerValue {
|
|
485
|
+
/** Month number 1–12 */
|
|
486
|
+
month: number;
|
|
487
|
+
year: number;
|
|
488
|
+
}
|
|
489
|
+
interface MonthPickerProps {
|
|
490
|
+
value: MonthPickerValue;
|
|
491
|
+
onChange: (value: MonthPickerValue) => void;
|
|
492
|
+
style?: ViewStyle;
|
|
424
493
|
}
|
|
425
|
-
declare function
|
|
494
|
+
declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
|
|
426
495
|
|
|
427
|
-
export { Accordion, type AccordionItem, type AccordionProps,
|
|
496
|
+
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipOption, type ChipProps, type ColorScheme, ConfirmDialog, type ConfirmDialogProps, CurrencyDisplay, type CurrencyDisplayProps, CurrencyInput, CurrencyInput as CurrencyInputLarge, type CurrencyInputProps, EmptyState, type EmptyStateProps, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, type TabItem, Tabs, TabsContent, type TabsContentProps, type TabsProps, Text, type TextProps, type TextVariant, Textarea, type TextareaProps, type Theme, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ToastItem, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, type ToggleSize, type ToggleVariant, defaultDark, defaultLight, useTheme, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TouchableOpacityProps, TextProps as TextProps$1, TextInputProps,
|
|
2
|
+
import { TouchableOpacityProps, TextProps as TextProps$1, TextInputProps, TextStyle, ViewStyle, ActivityIndicatorProps } from 'react-native';
|
|
3
3
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
4
4
|
|
|
5
5
|
type ThemeColors = {
|
|
@@ -36,11 +36,10 @@ type ThemeContextValue = {
|
|
|
36
36
|
interface ThemeProviderProps {
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* dark: { primary: '#818cf8', primaryForeground: '#fff' } }
|
|
39
|
+
* Optional full-palette overrides per scheme. Supply a partial or full `ThemeColors` object
|
|
40
|
+
* for `light` and/or `dark` to override the defaults.
|
|
41
|
+
* @example
|
|
42
|
+
* { light: { primary: '#6366f1', card: '#fff' }, dark: { primary: '#818cf8' } }
|
|
44
43
|
*/
|
|
45
44
|
theme?: Theme;
|
|
46
45
|
/**
|
|
@@ -55,7 +54,7 @@ declare function useTheme(): ThemeContextValue;
|
|
|
55
54
|
declare const defaultLight: ThemeColors;
|
|
56
55
|
declare const defaultDark: ThemeColors;
|
|
57
56
|
|
|
58
|
-
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
57
|
+
type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
|
|
59
58
|
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
60
59
|
interface ButtonProps extends TouchableOpacityProps {
|
|
61
60
|
label: string;
|
|
@@ -94,21 +93,42 @@ interface InputProps extends TextInputProps {
|
|
|
94
93
|
error?: string;
|
|
95
94
|
/** Helper text shown below the input when there is no error. */
|
|
96
95
|
hint?: string;
|
|
97
|
-
/**
|
|
96
|
+
/** Text or component rendered before the input text. */
|
|
97
|
+
prefix?: React.ReactNode;
|
|
98
|
+
/** Text or component rendered after the input text. */
|
|
99
|
+
suffix?: React.ReactNode;
|
|
100
|
+
/** Style applied to prefix text if prefix is a string. */
|
|
101
|
+
prefixStyle?: TextStyle;
|
|
102
|
+
/** Style applied to suffix text if suffix is a string. */
|
|
103
|
+
suffixStyle?: TextStyle;
|
|
104
|
+
/** Input type. When set to \`'password'\`, shows a toggle button to reveal/hide text. */
|
|
105
|
+
type?: 'text' | 'password';
|
|
106
|
+
/** Style for the outer container \`View\`. Use \`style\` (from \`TextInputProps\`) to style the \`TextInput\` itself. */
|
|
98
107
|
containerStyle?: ViewStyle;
|
|
99
108
|
}
|
|
100
|
-
declare function Input({ label, error, hint, containerStyle, style, onFocus, onBlur, ...props }: InputProps): React.JSX.Element;
|
|
109
|
+
declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
|
|
101
110
|
|
|
102
111
|
type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
|
|
112
|
+
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
103
113
|
interface BadgeProps {
|
|
104
|
-
label
|
|
114
|
+
label?: string;
|
|
115
|
+
/** Alternative to \`label\` — allows JSX children. */
|
|
116
|
+
children?: React.ReactNode;
|
|
105
117
|
variant?: BadgeVariant;
|
|
118
|
+
size?: BadgeSize;
|
|
119
|
+
/** Icon rendered before the label/children. */
|
|
120
|
+
icon?: React.ReactNode;
|
|
106
121
|
style?: ViewStyle;
|
|
107
122
|
}
|
|
108
|
-
declare function Badge({ label, variant, style }: BadgeProps): React.JSX.Element;
|
|
123
|
+
declare function Badge({ label, children, variant, size, icon, style }: BadgeProps): React.JSX.Element;
|
|
109
124
|
|
|
125
|
+
type CardVariant = 'elevated' | 'outlined' | 'filled';
|
|
110
126
|
interface CardProps {
|
|
111
127
|
children: React.ReactNode;
|
|
128
|
+
/** Visual style variant. `'elevated'` (default) has shadow, `'outlined'` has border only, `'filled'` uses accent background. */
|
|
129
|
+
variant?: CardVariant;
|
|
130
|
+
/** Makes the card tappable. Adds press animation and haptic feedback. */
|
|
131
|
+
onPress?: () => void;
|
|
112
132
|
style?: ViewStyle;
|
|
113
133
|
}
|
|
114
134
|
interface CardHeaderProps {
|
|
@@ -131,7 +151,7 @@ interface CardFooterProps {
|
|
|
131
151
|
children: React.ReactNode;
|
|
132
152
|
style?: ViewStyle;
|
|
133
153
|
}
|
|
134
|
-
declare function Card({ children, style }: CardProps): React.JSX.Element;
|
|
154
|
+
declare function Card({ children, variant, onPress, style }: CardProps): React.JSX.Element;
|
|
135
155
|
declare function CardHeader({ children, style }: CardHeaderProps): React.JSX.Element;
|
|
136
156
|
declare function CardTitle({ children, style }: CardTitleProps): React.JSX.Element;
|
|
137
157
|
declare function CardDescription({ children, style }: CardDescriptionProps): React.JSX.Element;
|
|
@@ -170,15 +190,15 @@ interface AvatarProps {
|
|
|
170
190
|
}
|
|
171
191
|
declare function Avatar({ src, fallback, size, style }: AvatarProps): React.JSX.Element;
|
|
172
192
|
|
|
173
|
-
type
|
|
174
|
-
interface
|
|
193
|
+
type AlertBannerVariant = 'default' | 'destructive' | 'success';
|
|
194
|
+
interface AlertBannerProps {
|
|
175
195
|
title?: string;
|
|
176
196
|
description?: string;
|
|
177
|
-
variant?:
|
|
197
|
+
variant?: AlertBannerVariant;
|
|
178
198
|
icon?: React.ReactNode;
|
|
179
199
|
style?: ViewStyle;
|
|
180
200
|
}
|
|
181
|
-
declare function
|
|
201
|
+
declare function AlertBanner({ title, description, variant, icon, style }: AlertBannerProps): React.JSX.Element;
|
|
182
202
|
|
|
183
203
|
interface ProgressProps {
|
|
184
204
|
/** Current progress value. Clamped to `[0, max]`. Defaults to `0`. */
|
|
@@ -194,9 +214,11 @@ interface EmptyStateProps {
|
|
|
194
214
|
title: string;
|
|
195
215
|
description?: string;
|
|
196
216
|
action?: React.ReactNode;
|
|
217
|
+
/** `compact` hides description/action and uses tighter spacing and a smaller icon. */
|
|
218
|
+
size?: 'default' | 'compact';
|
|
197
219
|
style?: ViewStyle;
|
|
198
220
|
}
|
|
199
|
-
declare function EmptyState({ icon, title, description, action, style }: EmptyStateProps): React.JSX.Element;
|
|
221
|
+
declare function EmptyState({ icon, title, description, action, size, style }: EmptyStateProps): React.JSX.Element;
|
|
200
222
|
|
|
201
223
|
interface TextareaProps extends TextInputProps {
|
|
202
224
|
label?: string;
|
|
@@ -301,20 +323,20 @@ interface AccordionProps {
|
|
|
301
323
|
declare function Accordion({ items, type, defaultValue, style }: AccordionProps): React.JSX.Element;
|
|
302
324
|
|
|
303
325
|
interface SliderProps {
|
|
304
|
-
/** Current value. Controlled when provided; falls back to internal state otherwise. */
|
|
305
326
|
value?: number;
|
|
306
327
|
minimumValue?: number;
|
|
307
328
|
maximumValue?: number;
|
|
308
|
-
/** Snap interval. `0` (default) means continuous (no snapping). */
|
|
309
329
|
step?: number;
|
|
310
|
-
/** Called on every move while dragging. */
|
|
311
330
|
onValueChange?: (value: number) => void;
|
|
312
|
-
/** Called once when the user releases the thumb. */
|
|
313
331
|
onSlidingComplete?: (value: number) => void;
|
|
332
|
+
label?: string;
|
|
333
|
+
showValue?: boolean;
|
|
334
|
+
formatValue?: (value: number) => string;
|
|
335
|
+
accessibilityLabel?: string;
|
|
314
336
|
disabled?: boolean;
|
|
315
337
|
style?: ViewStyle;
|
|
316
338
|
}
|
|
317
|
-
declare function Slider({ value, minimumValue, maximumValue, step, onValueChange, onSlidingComplete, disabled, style, }: SliderProps): React.JSX.Element;
|
|
339
|
+
declare function Slider({ value, minimumValue, maximumValue, step, onValueChange, onSlidingComplete, label, showValue, formatValue, accessibilityLabel, disabled, style, }: SliderProps): React.JSX.Element;
|
|
318
340
|
|
|
319
341
|
interface SheetProps {
|
|
320
342
|
open: boolean;
|
|
@@ -341,10 +363,8 @@ interface SelectProps {
|
|
|
341
363
|
options: SelectOption[];
|
|
342
364
|
value?: string;
|
|
343
365
|
onValueChange?: (value: string) => void;
|
|
344
|
-
/** Text shown when no option is selected. Defaults to `'Select an option'`. */
|
|
345
366
|
placeholder?: string;
|
|
346
367
|
label?: string;
|
|
347
|
-
/** Red helper text; also changes trigger border to `destructive` color. */
|
|
348
368
|
error?: string;
|
|
349
369
|
disabled?: boolean;
|
|
350
370
|
style?: ViewStyle;
|
|
@@ -385,6 +405,8 @@ interface CurrencyInputProps {
|
|
|
385
405
|
prefix?: string;
|
|
386
406
|
/** Character used to separate groups of three digits. Defaults to `'.'`. */
|
|
387
407
|
thousandsSeparator?: '.' | ',';
|
|
408
|
+
/** Font size variant. `'large'` renders at 36pt, `'default'` at 17pt. */
|
|
409
|
+
size?: 'default' | 'large';
|
|
388
410
|
label?: string;
|
|
389
411
|
/** Red helper text; also changes input border to destructive color. */
|
|
390
412
|
error?: string;
|
|
@@ -392,8 +414,9 @@ interface CurrencyInputProps {
|
|
|
392
414
|
placeholder?: string;
|
|
393
415
|
editable?: boolean;
|
|
394
416
|
containerStyle?: ViewStyle;
|
|
417
|
+
style?: TextStyle;
|
|
395
418
|
}
|
|
396
|
-
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, label, error, hint, placeholder, editable, containerStyle, }: CurrencyInputProps): React.JSX.Element;
|
|
419
|
+
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
397
420
|
|
|
398
421
|
interface CurrencyDisplayProps {
|
|
399
422
|
value: number | string;
|
|
@@ -401,27 +424,73 @@ interface CurrencyDisplayProps {
|
|
|
401
424
|
prefix?: string;
|
|
402
425
|
/** When true, shows two decimal places separated by a comma (e.g. `$25.000,00`). Defaults to `false`. */
|
|
403
426
|
showDecimals?: boolean;
|
|
427
|
+
/** Override the color of the formatted text. Defaults to the `foreground` theme token. */
|
|
428
|
+
textColor?: string;
|
|
404
429
|
style?: ViewStyle;
|
|
405
430
|
}
|
|
406
|
-
declare function CurrencyDisplay({ value, prefix, showDecimals, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
431
|
+
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
407
432
|
|
|
408
|
-
interface
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
433
|
+
interface ListItemProps {
|
|
434
|
+
icon?: React.ReactNode;
|
|
435
|
+
title: string;
|
|
436
|
+
subtitle?: string;
|
|
437
|
+
trailing?: string | React.ReactNode;
|
|
438
|
+
onPress?: () => void;
|
|
439
|
+
disabled?: boolean;
|
|
440
|
+
style?: ViewStyle;
|
|
441
|
+
}
|
|
442
|
+
declare function ListItem({ icon, title, subtitle, trailing, onPress, disabled, style }: ListItemProps): React.JSX.Element;
|
|
443
|
+
|
|
444
|
+
interface ChipProps {
|
|
445
|
+
label: string;
|
|
446
|
+
selected?: boolean;
|
|
447
|
+
onPress?: () => void;
|
|
448
|
+
style?: ViewStyle;
|
|
449
|
+
}
|
|
450
|
+
interface ChipOption {
|
|
451
|
+
label: string;
|
|
452
|
+
value: string | number;
|
|
453
|
+
}
|
|
454
|
+
interface ChipGroupProps {
|
|
455
|
+
options: ChipOption[];
|
|
456
|
+
value?: string | number | (string | number)[];
|
|
457
|
+
onValueChange?: (value: string | number | (string | number)[]) => void;
|
|
458
|
+
/** When true, allows selecting multiple chips. `value` and `onValueChange` will use arrays. */
|
|
459
|
+
multiSelect?: boolean;
|
|
460
|
+
style?: ViewStyle;
|
|
461
|
+
}
|
|
462
|
+
declare function Chip({ label, selected, onPress, style }: ChipProps): React.JSX.Element;
|
|
463
|
+
declare function ChipGroup({ options, value, onValueChange, multiSelect, style }: ChipGroupProps): React.JSX.Element;
|
|
464
|
+
|
|
465
|
+
interface ConfirmDialogProps {
|
|
466
|
+
visible: boolean;
|
|
467
|
+
title: string;
|
|
468
|
+
description?: string;
|
|
469
|
+
confirmLabel?: string;
|
|
470
|
+
cancelLabel?: string;
|
|
471
|
+
confirmVariant?: 'primary' | 'destructive';
|
|
472
|
+
onConfirm: () => void;
|
|
473
|
+
onCancel: () => void;
|
|
474
|
+
}
|
|
475
|
+
declare function ConfirmDialog({ visible, title, description, confirmLabel, cancelLabel, confirmVariant, onConfirm, onCancel, }: ConfirmDialogProps): React.JSX.Element;
|
|
476
|
+
|
|
477
|
+
interface LabelValueProps {
|
|
478
|
+
label: string;
|
|
479
|
+
value: string | React.ReactNode;
|
|
480
|
+
style?: ViewStyle;
|
|
481
|
+
}
|
|
482
|
+
declare function LabelValue({ label, value, style }: LabelValueProps): React.JSX.Element;
|
|
483
|
+
|
|
484
|
+
interface MonthPickerValue {
|
|
485
|
+
/** Month number 1–12 */
|
|
486
|
+
month: number;
|
|
487
|
+
year: number;
|
|
488
|
+
}
|
|
489
|
+
interface MonthPickerProps {
|
|
490
|
+
value: MonthPickerValue;
|
|
491
|
+
onChange: (value: MonthPickerValue) => void;
|
|
492
|
+
style?: ViewStyle;
|
|
424
493
|
}
|
|
425
|
-
declare function
|
|
494
|
+
declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
|
|
426
495
|
|
|
427
|
-
export { Accordion, type AccordionItem, type AccordionProps,
|
|
496
|
+
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipOption, type ChipProps, type ColorScheme, ConfirmDialog, type ConfirmDialogProps, CurrencyDisplay, type CurrencyDisplayProps, CurrencyInput, CurrencyInput as CurrencyInputLarge, type CurrencyInputProps, EmptyState, type EmptyStateProps, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RadioGroup, type RadioGroupProps, type RadioOption, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, type TabItem, Tabs, TabsContent, type TabsContentProps, type TabsProps, Text, type TextProps, type TextVariant, Textarea, type TextareaProps, type Theme, type ThemeColors, ThemeProvider, type ThemeProviderProps, type ToastItem, ToastProvider, type ToastProviderProps, type ToastVariant, Toggle, type ToggleProps, type ToggleSize, type ToggleVariant, defaultDark, defaultLight, useTheme, useToast };
|