@retray-dev/ui-kit 5.2.0 → 5.4.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 +242 -17
- package/EXAMPLES.md +666 -0
- package/README.md +3 -3
- package/dist/index.d.mts +112 -11
- package/dist/index.d.ts +112 -11
- package/dist/index.js +579 -358
- package/dist/index.mjs +516 -298
- package/package.json +3 -2
- package/src/components/Accordion/Accordion.tsx +25 -2
- package/src/components/Avatar/Avatar.tsx +21 -7
- package/src/components/Button/Button.tsx +16 -7
- package/src/components/ButtonGroup/ButtonGroup.tsx +60 -0
- package/src/components/ButtonGroup/index.ts +1 -0
- package/src/components/Chip/Chip.tsx +8 -1
- package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +25 -3
- package/src/components/DetailRow/DetailRow.tsx +140 -0
- package/src/components/DetailRow/index.ts +1 -0
- package/src/components/LabelValue/LabelValue.tsx +25 -4
- package/src/components/MonthPicker/MonthPicker.tsx +18 -6
- package/src/components/Sheet/Sheet.tsx +19 -3
- package/src/components/Textarea/Textarea.tsx +66 -29
- package/src/index.ts +5 -0
- package/src/tokens.ts +1 -1
- package/src/utils/typography.ts +24 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TouchableOpacityProps, TextProps as TextProps$1, TextInputProps, TextStyle,
|
|
2
|
+
import { TouchableOpacityProps, ViewStyle, TextProps as TextProps$1, TextInputProps, TextStyle, ActivityIndicatorProps, ImageSourcePropType } from 'react-native';
|
|
3
3
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
4
4
|
|
|
5
5
|
type ThemeColors = {
|
|
@@ -74,6 +74,7 @@ interface ButtonProps extends TouchableOpacityProps {
|
|
|
74
74
|
label: string;
|
|
75
75
|
size: ButtonSize;
|
|
76
76
|
variant: ButtonVariant;
|
|
77
|
+
color: string;
|
|
77
78
|
}) => React.ReactNode);
|
|
78
79
|
iconName?: string;
|
|
79
80
|
iconColor?: string;
|
|
@@ -81,6 +82,28 @@ interface ButtonProps extends TouchableOpacityProps {
|
|
|
81
82
|
}
|
|
82
83
|
declare function Button({ label, variant, size, loading, fullWidth, icon, iconName, iconColor, iconPosition, disabled, style, onPress, ...props }: ButtonProps): React.JSX.Element;
|
|
83
84
|
|
|
85
|
+
interface ButtonGroupProps {
|
|
86
|
+
children: React.ReactNode;
|
|
87
|
+
/** Spacing between buttons. Defaults to 12px. */
|
|
88
|
+
gap?: number;
|
|
89
|
+
/** Stack buttons vertically instead of horizontally. */
|
|
90
|
+
vertical?: boolean;
|
|
91
|
+
style?: ViewStyle;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Container that auto-distributes space equally among Button children.
|
|
95
|
+
* Each child gets `flex: 1` — perfect for side-by-side CTAs.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <ButtonGroup>
|
|
100
|
+
* <Button label="Cancel" variant="secondary" onPress={...} />
|
|
101
|
+
* <Button label="Confirm" onPress={...} />
|
|
102
|
+
* </ButtonGroup>
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare function ButtonGroup({ children, gap, vertical, style }: ButtonGroupProps): React.JSX.Element;
|
|
106
|
+
|
|
84
107
|
type IconButtonVariant = 'primary' | 'secondary' | 'outline' | 'text' | 'destructive';
|
|
85
108
|
type IconButtonSize = 'sm' | 'md' | 'lg';
|
|
86
109
|
interface IconButtonProps extends TouchableOpacityProps {
|
|
@@ -229,14 +252,17 @@ declare function Skeleton({ width, height, borderRadius, preset, diameter, style
|
|
|
229
252
|
type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
230
253
|
type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
|
|
231
254
|
interface AvatarProps {
|
|
232
|
-
src?: string;
|
|
255
|
+
src?: string | null;
|
|
256
|
+
/** Manual initials (max 2 chars). */
|
|
233
257
|
fallback?: string;
|
|
234
|
-
|
|
258
|
+
/** Full name — extracts up to 2 initials (e.g. "Julian Cruz" → "JC"). */
|
|
259
|
+
fallbackText?: string;
|
|
260
|
+
size?: AvatarSize | number;
|
|
235
261
|
/** Optional status indicator dot — bottom-right corner. */
|
|
236
262
|
status?: AvatarStatus;
|
|
237
263
|
style?: ViewStyle;
|
|
238
264
|
}
|
|
239
|
-
declare function Avatar({ src, fallback, size, status, style }: AvatarProps): React.JSX.Element;
|
|
265
|
+
declare function Avatar({ src, fallback, fallbackText, size, status, style }: AvatarProps): React.JSX.Element;
|
|
240
266
|
|
|
241
267
|
type AlertBannerVariant = 'default' | 'destructive' | 'success' | 'warning';
|
|
242
268
|
interface AlertBannerProps {
|
|
@@ -285,10 +311,16 @@ interface TextareaProps extends TextInputProps {
|
|
|
285
311
|
hint?: string;
|
|
286
312
|
/** Number of visible text rows. Defaults to `4`. Controls `numberOfLines` and `minHeight`. */
|
|
287
313
|
rows?: number;
|
|
314
|
+
/** Icon name from @expo/vector-icons rendered inside top-left corner. */
|
|
315
|
+
prefixIcon?: string;
|
|
316
|
+
/** Custom icon node rendered top-left. */
|
|
317
|
+
prefixIconNode?: React.ReactNode;
|
|
318
|
+
/** Override prefix icon color. Defaults to foregroundMuted. */
|
|
319
|
+
prefixIconColor?: string;
|
|
288
320
|
/** Style for the outer container `View`. Use `style` (from `TextInputProps`) to style the `TextInput` itself. */
|
|
289
321
|
containerStyle?: ViewStyle;
|
|
290
322
|
}
|
|
291
|
-
declare function Textarea({ label, error, hint, rows, containerStyle, style, onFocus, onBlur, ...props }: TextareaProps): React.JSX.Element;
|
|
323
|
+
declare function Textarea({ label, error, hint, rows, prefixIcon, prefixIconNode, prefixIconColor, containerStyle, style, onFocus, onBlur, ...props }: TextareaProps): React.JSX.Element;
|
|
292
324
|
|
|
293
325
|
interface CheckboxProps {
|
|
294
326
|
checked?: boolean;
|
|
@@ -377,6 +409,12 @@ interface AccordionItem {
|
|
|
377
409
|
value: string;
|
|
378
410
|
trigger: string;
|
|
379
411
|
content: React.ReactNode;
|
|
412
|
+
/** Icon name from @expo/vector-icons rendered left of trigger. */
|
|
413
|
+
iconName?: string;
|
|
414
|
+
/** Custom icon node rendered left of trigger. */
|
|
415
|
+
icon?: React.ReactNode;
|
|
416
|
+
/** Override icon color. Defaults to foregroundMuted. */
|
|
417
|
+
iconColor?: string;
|
|
380
418
|
}
|
|
381
419
|
interface AccordionProps {
|
|
382
420
|
items: AccordionItem[];
|
|
@@ -419,8 +457,12 @@ interface SheetProps {
|
|
|
419
457
|
scrollable?: boolean;
|
|
420
458
|
/** Cap sheet height (dp). Children scroll when content exceeds this value. */
|
|
421
459
|
maxHeight?: number;
|
|
460
|
+
/** Wrap content in KeyboardAvoidingView. Defaults to platform-appropriate behavior when set. */
|
|
461
|
+
keyboardBehavior?: 'padding' | 'height' | 'position' | 'none';
|
|
462
|
+
/** Extra vertical offset for the keyboard avoiding view. */
|
|
463
|
+
keyboardOffset?: number;
|
|
422
464
|
}
|
|
423
|
-
declare function Sheet({ open, onClose, title, description, children, style, scrollable, maxHeight, }: SheetProps): React.JSX.Element;
|
|
465
|
+
declare function Sheet({ open, onClose, title, description, children, style, scrollable, maxHeight, keyboardBehavior, keyboardOffset, }: SheetProps): React.JSX.Element;
|
|
424
466
|
|
|
425
467
|
interface SelectOption {
|
|
426
468
|
label: string;
|
|
@@ -494,6 +536,7 @@ interface CurrencyInputProps {
|
|
|
494
536
|
}
|
|
495
537
|
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
496
538
|
|
|
539
|
+
type CurrencyDisplayVariant = 'hero' | 'large' | 'medium' | 'small';
|
|
497
540
|
interface CurrencyDisplayProps {
|
|
498
541
|
value: number | string;
|
|
499
542
|
/** Symbol prepended to the formatted value. Defaults to `'$'`. */
|
|
@@ -502,9 +545,15 @@ interface CurrencyDisplayProps {
|
|
|
502
545
|
showDecimals?: boolean;
|
|
503
546
|
/** Override the color of the formatted text. Defaults to the `foreground` theme token. */
|
|
504
547
|
textColor?: string;
|
|
548
|
+
/** Predefined size variant. Overrides the default 56px size. */
|
|
549
|
+
variant?: CurrencyDisplayVariant;
|
|
550
|
+
/** Enable adjustsFontSizeToFit so long values shrink to fit in one line. */
|
|
551
|
+
autoScale?: boolean;
|
|
552
|
+
/** Maximum font size when autoScale is true (defaults to variant size or 56px). */
|
|
553
|
+
maxFontSize?: number;
|
|
505
554
|
style?: ViewStyle;
|
|
506
555
|
}
|
|
507
|
-
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
556
|
+
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, variant, autoScale, maxFontSize, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
508
557
|
|
|
509
558
|
type ListItemVariant = 'plain' | 'card';
|
|
510
559
|
interface ListItemProps {
|
|
@@ -576,6 +625,11 @@ interface ChipProps {
|
|
|
576
625
|
interface ChipOption {
|
|
577
626
|
label: string;
|
|
578
627
|
value: string | number;
|
|
628
|
+
/** Icon name resolved via renderIcon (Feather, AntDesign, etc.). */
|
|
629
|
+
iconName?: string;
|
|
630
|
+
/** Icon tint color override. */
|
|
631
|
+
iconColor?: string;
|
|
632
|
+
disabled?: boolean;
|
|
579
633
|
}
|
|
580
634
|
interface ChipGroupProps {
|
|
581
635
|
options: ChipOption[];
|
|
@@ -603,9 +657,13 @@ declare function ConfirmDialog({ visible, title, description, confirmLabel, canc
|
|
|
603
657
|
interface LabelValueProps {
|
|
604
658
|
label: string;
|
|
605
659
|
value: string | React.ReactNode;
|
|
660
|
+
/** Icon name from @expo/vector-icons rendered left of label. */
|
|
661
|
+
iconName?: string;
|
|
662
|
+
/** Override icon color. Defaults to foregroundMuted. */
|
|
663
|
+
iconColor?: string;
|
|
606
664
|
style?: ViewStyle;
|
|
607
665
|
}
|
|
608
|
-
declare function LabelValue({ label, value, style }: LabelValueProps): React.JSX.Element;
|
|
666
|
+
declare function LabelValue({ label, value, iconName, iconColor, style }: LabelValueProps): React.JSX.Element;
|
|
609
667
|
|
|
610
668
|
interface MonthPickerValue {
|
|
611
669
|
/** Month number 1–12 */
|
|
@@ -615,9 +673,13 @@ interface MonthPickerValue {
|
|
|
615
673
|
interface MonthPickerProps {
|
|
616
674
|
value: MonthPickerValue;
|
|
617
675
|
onChange: (value: MonthPickerValue) => void;
|
|
676
|
+
/** BCP 47 locale tag. Built-in: 'en' | 'es' | 'pt' | 'fr'. For other locales supply formatLabel. */
|
|
677
|
+
locale?: string;
|
|
678
|
+
/** Custom label formatter. Takes precedence over locale. */
|
|
679
|
+
formatLabel?: (value: MonthPickerValue) => string;
|
|
618
680
|
style?: ViewStyle;
|
|
619
681
|
}
|
|
620
|
-
declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
|
|
682
|
+
declare function MonthPicker({ value, onChange, locale, formatLabel, style }: MonthPickerProps): React.JSX.Element;
|
|
621
683
|
|
|
622
684
|
type MediaCardAspectRatio = '1:1' | '4:3' | '16:9' | '4:5' | '3:2';
|
|
623
685
|
interface MediaCardProps {
|
|
@@ -696,6 +758,32 @@ interface PressableProps extends Omit<TouchableOpacityProps, 'activeOpacity'> {
|
|
|
696
758
|
*/
|
|
697
759
|
declare function Pressable({ children, onPress, pressScale, bounciness, haptics, style, disabled, hoverScale, ...touchableProps }: PressableProps): React.JSX.Element;
|
|
698
760
|
|
|
761
|
+
type DetailRowSeparator = 'dotted' | 'solid' | 'dashed' | 'none';
|
|
762
|
+
type DetailRowLabelWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
763
|
+
interface DetailRowProps {
|
|
764
|
+
label: React.ReactNode;
|
|
765
|
+
value: string;
|
|
766
|
+
/** Dotted/dashed/solid line between label and value. Defaults to 'dotted'. */
|
|
767
|
+
separator?: DetailRowSeparator;
|
|
768
|
+
labelWeight?: DetailRowLabelWeight;
|
|
769
|
+
/** Semantic color key or hex string for value text. */
|
|
770
|
+
valueColor?: string;
|
|
771
|
+
/** Node rendered left of the label (e.g. Avatar, Icon). */
|
|
772
|
+
leftIcon?: React.ReactNode;
|
|
773
|
+
/** Icon name from @expo/vector-icons rendered left of label. Takes precedence over leftIcon. */
|
|
774
|
+
leftIconName?: string;
|
|
775
|
+
/** Override left icon color. Defaults to foregroundMuted. */
|
|
776
|
+
leftIconColor?: string;
|
|
777
|
+
/** Icon name from @expo/vector-icons rendered right of value. */
|
|
778
|
+
rightIconName?: string;
|
|
779
|
+
/** Override right icon color. Defaults to foregroundMuted. */
|
|
780
|
+
rightIconColor?: string;
|
|
781
|
+
style?: ViewStyle;
|
|
782
|
+
labelStyle?: TextStyle;
|
|
783
|
+
valueStyle?: TextStyle;
|
|
784
|
+
}
|
|
785
|
+
declare function DetailRow({ label, value, separator, labelWeight, valueColor, leftIcon, leftIconName, leftIconColor, rightIconName, rightIconColor, style, labelStyle, valueStyle, }: DetailRowProps): React.JSX.Element;
|
|
786
|
+
|
|
699
787
|
type IconFamily = 'Feather' | 'AntDesign' | 'Entypo' | 'FontAwesome5' | 'MaterialIcons' | 'Ionicons';
|
|
700
788
|
interface IconProps {
|
|
701
789
|
/** Icon name from any supported @expo/vector-icons family. See https://icons.expo.fyi */
|
|
@@ -708,6 +796,19 @@ interface IconProps {
|
|
|
708
796
|
declare function Icon({ name, size, color, family }: IconProps): React.ReactElement | null;
|
|
709
797
|
declare function renderIcon(name: string, size: number, color: string): React.ReactElement | null;
|
|
710
798
|
|
|
799
|
+
/**
|
|
800
|
+
* Returns a font size that steps down as formatted text grows longer.
|
|
801
|
+
* Designed for currency/numeric displays where long values overflow.
|
|
802
|
+
*
|
|
803
|
+
* @param text - The formatted string (e.g. "$1.250.000")
|
|
804
|
+
* @param maxSize - Base (maximum) font size in points
|
|
805
|
+
* @param steps - Custom step config [{ maxLen, subtract }] — sorted ascending by maxLen
|
|
806
|
+
*/
|
|
807
|
+
declare function getResponsiveFontSize(text: string, maxSize: number, steps?: {
|
|
808
|
+
maxLen: number;
|
|
809
|
+
subtract: number;
|
|
810
|
+
}[]): number;
|
|
811
|
+
|
|
711
812
|
declare const SPACING: {
|
|
712
813
|
readonly xxs: 2;
|
|
713
814
|
readonly xs: 4;
|
|
@@ -884,7 +985,7 @@ declare const TYPOGRAPHY: {
|
|
|
884
985
|
readonly fontFamily: "Poppins-Medium";
|
|
885
986
|
readonly fontSize: 16;
|
|
886
987
|
readonly fontWeight: "500";
|
|
887
|
-
readonly lineHeight:
|
|
988
|
+
readonly lineHeight: 22;
|
|
888
989
|
readonly letterSpacing: 0;
|
|
889
990
|
};
|
|
890
991
|
readonly 'button-sm': {
|
|
@@ -904,4 +1005,4 @@ type RadiusKey = keyof Radius;
|
|
|
904
1005
|
type Typography = typeof TYPOGRAPHY;
|
|
905
1006
|
type TypographyKey = keyof Typography;
|
|
906
1007
|
|
|
907
|
-
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, BREAKPOINTS, 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, type CategoryItem, CategoryStrip, type CategoryStripProps, 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, ICON_SIZES, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconFamily, type IconProps, type IconSize, type IconSizeKey, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MediaCard, type MediaCardAspectRatio, type MediaCardProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Pressable, type PressableProps, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, type ResolvedColors, SHADOWS, SPACING, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type Spacing, type SpacingKey, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, TYPOGRAPHY, 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, type Typography, type TypographyKey, defaultDark, defaultLight, deriveColors, renderIcon, useTheme, useToast };
|
|
1008
|
+
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, BREAKPOINTS, Badge, type BadgeProps, type BadgeVariant, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type CategoryItem, CategoryStrip, type CategoryStripProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipOption, type ChipProps, type ColorScheme, ConfirmDialog, type ConfirmDialogProps, CurrencyDisplay, type CurrencyDisplayProps, type CurrencyDisplayVariant, CurrencyInput, CurrencyInput as CurrencyInputLarge, type CurrencyInputProps, DetailRow, type DetailRowLabelWeight, type DetailRowProps, type DetailRowSeparator, EmptyState, type EmptyStateProps, ICON_SIZES, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconFamily, type IconProps, type IconSize, type IconSizeKey, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MediaCard, type MediaCardAspectRatio, type MediaCardProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Pressable, type PressableProps, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, type ResolvedColors, SHADOWS, SPACING, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type Spacing, type SpacingKey, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, TYPOGRAPHY, 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, type Typography, type TypographyKey, defaultDark, defaultLight, deriveColors, getResponsiveFontSize, renderIcon, 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, TextStyle,
|
|
2
|
+
import { TouchableOpacityProps, ViewStyle, TextProps as TextProps$1, TextInputProps, TextStyle, ActivityIndicatorProps, ImageSourcePropType } from 'react-native';
|
|
3
3
|
export { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
4
4
|
|
|
5
5
|
type ThemeColors = {
|
|
@@ -74,6 +74,7 @@ interface ButtonProps extends TouchableOpacityProps {
|
|
|
74
74
|
label: string;
|
|
75
75
|
size: ButtonSize;
|
|
76
76
|
variant: ButtonVariant;
|
|
77
|
+
color: string;
|
|
77
78
|
}) => React.ReactNode);
|
|
78
79
|
iconName?: string;
|
|
79
80
|
iconColor?: string;
|
|
@@ -81,6 +82,28 @@ interface ButtonProps extends TouchableOpacityProps {
|
|
|
81
82
|
}
|
|
82
83
|
declare function Button({ label, variant, size, loading, fullWidth, icon, iconName, iconColor, iconPosition, disabled, style, onPress, ...props }: ButtonProps): React.JSX.Element;
|
|
83
84
|
|
|
85
|
+
interface ButtonGroupProps {
|
|
86
|
+
children: React.ReactNode;
|
|
87
|
+
/** Spacing between buttons. Defaults to 12px. */
|
|
88
|
+
gap?: number;
|
|
89
|
+
/** Stack buttons vertically instead of horizontally. */
|
|
90
|
+
vertical?: boolean;
|
|
91
|
+
style?: ViewStyle;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Container that auto-distributes space equally among Button children.
|
|
95
|
+
* Each child gets `flex: 1` — perfect for side-by-side CTAs.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <ButtonGroup>
|
|
100
|
+
* <Button label="Cancel" variant="secondary" onPress={...} />
|
|
101
|
+
* <Button label="Confirm" onPress={...} />
|
|
102
|
+
* </ButtonGroup>
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
declare function ButtonGroup({ children, gap, vertical, style }: ButtonGroupProps): React.JSX.Element;
|
|
106
|
+
|
|
84
107
|
type IconButtonVariant = 'primary' | 'secondary' | 'outline' | 'text' | 'destructive';
|
|
85
108
|
type IconButtonSize = 'sm' | 'md' | 'lg';
|
|
86
109
|
interface IconButtonProps extends TouchableOpacityProps {
|
|
@@ -229,14 +252,17 @@ declare function Skeleton({ width, height, borderRadius, preset, diameter, style
|
|
|
229
252
|
type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
230
253
|
type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
|
|
231
254
|
interface AvatarProps {
|
|
232
|
-
src?: string;
|
|
255
|
+
src?: string | null;
|
|
256
|
+
/** Manual initials (max 2 chars). */
|
|
233
257
|
fallback?: string;
|
|
234
|
-
|
|
258
|
+
/** Full name — extracts up to 2 initials (e.g. "Julian Cruz" → "JC"). */
|
|
259
|
+
fallbackText?: string;
|
|
260
|
+
size?: AvatarSize | number;
|
|
235
261
|
/** Optional status indicator dot — bottom-right corner. */
|
|
236
262
|
status?: AvatarStatus;
|
|
237
263
|
style?: ViewStyle;
|
|
238
264
|
}
|
|
239
|
-
declare function Avatar({ src, fallback, size, status, style }: AvatarProps): React.JSX.Element;
|
|
265
|
+
declare function Avatar({ src, fallback, fallbackText, size, status, style }: AvatarProps): React.JSX.Element;
|
|
240
266
|
|
|
241
267
|
type AlertBannerVariant = 'default' | 'destructive' | 'success' | 'warning';
|
|
242
268
|
interface AlertBannerProps {
|
|
@@ -285,10 +311,16 @@ interface TextareaProps extends TextInputProps {
|
|
|
285
311
|
hint?: string;
|
|
286
312
|
/** Number of visible text rows. Defaults to `4`. Controls `numberOfLines` and `minHeight`. */
|
|
287
313
|
rows?: number;
|
|
314
|
+
/** Icon name from @expo/vector-icons rendered inside top-left corner. */
|
|
315
|
+
prefixIcon?: string;
|
|
316
|
+
/** Custom icon node rendered top-left. */
|
|
317
|
+
prefixIconNode?: React.ReactNode;
|
|
318
|
+
/** Override prefix icon color. Defaults to foregroundMuted. */
|
|
319
|
+
prefixIconColor?: string;
|
|
288
320
|
/** Style for the outer container `View`. Use `style` (from `TextInputProps`) to style the `TextInput` itself. */
|
|
289
321
|
containerStyle?: ViewStyle;
|
|
290
322
|
}
|
|
291
|
-
declare function Textarea({ label, error, hint, rows, containerStyle, style, onFocus, onBlur, ...props }: TextareaProps): React.JSX.Element;
|
|
323
|
+
declare function Textarea({ label, error, hint, rows, prefixIcon, prefixIconNode, prefixIconColor, containerStyle, style, onFocus, onBlur, ...props }: TextareaProps): React.JSX.Element;
|
|
292
324
|
|
|
293
325
|
interface CheckboxProps {
|
|
294
326
|
checked?: boolean;
|
|
@@ -377,6 +409,12 @@ interface AccordionItem {
|
|
|
377
409
|
value: string;
|
|
378
410
|
trigger: string;
|
|
379
411
|
content: React.ReactNode;
|
|
412
|
+
/** Icon name from @expo/vector-icons rendered left of trigger. */
|
|
413
|
+
iconName?: string;
|
|
414
|
+
/** Custom icon node rendered left of trigger. */
|
|
415
|
+
icon?: React.ReactNode;
|
|
416
|
+
/** Override icon color. Defaults to foregroundMuted. */
|
|
417
|
+
iconColor?: string;
|
|
380
418
|
}
|
|
381
419
|
interface AccordionProps {
|
|
382
420
|
items: AccordionItem[];
|
|
@@ -419,8 +457,12 @@ interface SheetProps {
|
|
|
419
457
|
scrollable?: boolean;
|
|
420
458
|
/** Cap sheet height (dp). Children scroll when content exceeds this value. */
|
|
421
459
|
maxHeight?: number;
|
|
460
|
+
/** Wrap content in KeyboardAvoidingView. Defaults to platform-appropriate behavior when set. */
|
|
461
|
+
keyboardBehavior?: 'padding' | 'height' | 'position' | 'none';
|
|
462
|
+
/** Extra vertical offset for the keyboard avoiding view. */
|
|
463
|
+
keyboardOffset?: number;
|
|
422
464
|
}
|
|
423
|
-
declare function Sheet({ open, onClose, title, description, children, style, scrollable, maxHeight, }: SheetProps): React.JSX.Element;
|
|
465
|
+
declare function Sheet({ open, onClose, title, description, children, style, scrollable, maxHeight, keyboardBehavior, keyboardOffset, }: SheetProps): React.JSX.Element;
|
|
424
466
|
|
|
425
467
|
interface SelectOption {
|
|
426
468
|
label: string;
|
|
@@ -494,6 +536,7 @@ interface CurrencyInputProps {
|
|
|
494
536
|
}
|
|
495
537
|
declare function CurrencyInput({ value, onChangeText, onChangeValue, prefix, thousandsSeparator, size, label, error, hint, placeholder, editable, containerStyle, style, }: CurrencyInputProps): React.JSX.Element;
|
|
496
538
|
|
|
539
|
+
type CurrencyDisplayVariant = 'hero' | 'large' | 'medium' | 'small';
|
|
497
540
|
interface CurrencyDisplayProps {
|
|
498
541
|
value: number | string;
|
|
499
542
|
/** Symbol prepended to the formatted value. Defaults to `'$'`. */
|
|
@@ -502,9 +545,15 @@ interface CurrencyDisplayProps {
|
|
|
502
545
|
showDecimals?: boolean;
|
|
503
546
|
/** Override the color of the formatted text. Defaults to the `foreground` theme token. */
|
|
504
547
|
textColor?: string;
|
|
548
|
+
/** Predefined size variant. Overrides the default 56px size. */
|
|
549
|
+
variant?: CurrencyDisplayVariant;
|
|
550
|
+
/** Enable adjustsFontSizeToFit so long values shrink to fit in one line. */
|
|
551
|
+
autoScale?: boolean;
|
|
552
|
+
/** Maximum font size when autoScale is true (defaults to variant size or 56px). */
|
|
553
|
+
maxFontSize?: number;
|
|
505
554
|
style?: ViewStyle;
|
|
506
555
|
}
|
|
507
|
-
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
556
|
+
declare function CurrencyDisplay({ value, prefix, showDecimals, textColor, variant, autoScale, maxFontSize, style }: CurrencyDisplayProps): React.JSX.Element;
|
|
508
557
|
|
|
509
558
|
type ListItemVariant = 'plain' | 'card';
|
|
510
559
|
interface ListItemProps {
|
|
@@ -576,6 +625,11 @@ interface ChipProps {
|
|
|
576
625
|
interface ChipOption {
|
|
577
626
|
label: string;
|
|
578
627
|
value: string | number;
|
|
628
|
+
/** Icon name resolved via renderIcon (Feather, AntDesign, etc.). */
|
|
629
|
+
iconName?: string;
|
|
630
|
+
/** Icon tint color override. */
|
|
631
|
+
iconColor?: string;
|
|
632
|
+
disabled?: boolean;
|
|
579
633
|
}
|
|
580
634
|
interface ChipGroupProps {
|
|
581
635
|
options: ChipOption[];
|
|
@@ -603,9 +657,13 @@ declare function ConfirmDialog({ visible, title, description, confirmLabel, canc
|
|
|
603
657
|
interface LabelValueProps {
|
|
604
658
|
label: string;
|
|
605
659
|
value: string | React.ReactNode;
|
|
660
|
+
/** Icon name from @expo/vector-icons rendered left of label. */
|
|
661
|
+
iconName?: string;
|
|
662
|
+
/** Override icon color. Defaults to foregroundMuted. */
|
|
663
|
+
iconColor?: string;
|
|
606
664
|
style?: ViewStyle;
|
|
607
665
|
}
|
|
608
|
-
declare function LabelValue({ label, value, style }: LabelValueProps): React.JSX.Element;
|
|
666
|
+
declare function LabelValue({ label, value, iconName, iconColor, style }: LabelValueProps): React.JSX.Element;
|
|
609
667
|
|
|
610
668
|
interface MonthPickerValue {
|
|
611
669
|
/** Month number 1–12 */
|
|
@@ -615,9 +673,13 @@ interface MonthPickerValue {
|
|
|
615
673
|
interface MonthPickerProps {
|
|
616
674
|
value: MonthPickerValue;
|
|
617
675
|
onChange: (value: MonthPickerValue) => void;
|
|
676
|
+
/** BCP 47 locale tag. Built-in: 'en' | 'es' | 'pt' | 'fr'. For other locales supply formatLabel. */
|
|
677
|
+
locale?: string;
|
|
678
|
+
/** Custom label formatter. Takes precedence over locale. */
|
|
679
|
+
formatLabel?: (value: MonthPickerValue) => string;
|
|
618
680
|
style?: ViewStyle;
|
|
619
681
|
}
|
|
620
|
-
declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
|
|
682
|
+
declare function MonthPicker({ value, onChange, locale, formatLabel, style }: MonthPickerProps): React.JSX.Element;
|
|
621
683
|
|
|
622
684
|
type MediaCardAspectRatio = '1:1' | '4:3' | '16:9' | '4:5' | '3:2';
|
|
623
685
|
interface MediaCardProps {
|
|
@@ -696,6 +758,32 @@ interface PressableProps extends Omit<TouchableOpacityProps, 'activeOpacity'> {
|
|
|
696
758
|
*/
|
|
697
759
|
declare function Pressable({ children, onPress, pressScale, bounciness, haptics, style, disabled, hoverScale, ...touchableProps }: PressableProps): React.JSX.Element;
|
|
698
760
|
|
|
761
|
+
type DetailRowSeparator = 'dotted' | 'solid' | 'dashed' | 'none';
|
|
762
|
+
type DetailRowLabelWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
763
|
+
interface DetailRowProps {
|
|
764
|
+
label: React.ReactNode;
|
|
765
|
+
value: string;
|
|
766
|
+
/** Dotted/dashed/solid line between label and value. Defaults to 'dotted'. */
|
|
767
|
+
separator?: DetailRowSeparator;
|
|
768
|
+
labelWeight?: DetailRowLabelWeight;
|
|
769
|
+
/** Semantic color key or hex string for value text. */
|
|
770
|
+
valueColor?: string;
|
|
771
|
+
/** Node rendered left of the label (e.g. Avatar, Icon). */
|
|
772
|
+
leftIcon?: React.ReactNode;
|
|
773
|
+
/** Icon name from @expo/vector-icons rendered left of label. Takes precedence over leftIcon. */
|
|
774
|
+
leftIconName?: string;
|
|
775
|
+
/** Override left icon color. Defaults to foregroundMuted. */
|
|
776
|
+
leftIconColor?: string;
|
|
777
|
+
/** Icon name from @expo/vector-icons rendered right of value. */
|
|
778
|
+
rightIconName?: string;
|
|
779
|
+
/** Override right icon color. Defaults to foregroundMuted. */
|
|
780
|
+
rightIconColor?: string;
|
|
781
|
+
style?: ViewStyle;
|
|
782
|
+
labelStyle?: TextStyle;
|
|
783
|
+
valueStyle?: TextStyle;
|
|
784
|
+
}
|
|
785
|
+
declare function DetailRow({ label, value, separator, labelWeight, valueColor, leftIcon, leftIconName, leftIconColor, rightIconName, rightIconColor, style, labelStyle, valueStyle, }: DetailRowProps): React.JSX.Element;
|
|
786
|
+
|
|
699
787
|
type IconFamily = 'Feather' | 'AntDesign' | 'Entypo' | 'FontAwesome5' | 'MaterialIcons' | 'Ionicons';
|
|
700
788
|
interface IconProps {
|
|
701
789
|
/** Icon name from any supported @expo/vector-icons family. See https://icons.expo.fyi */
|
|
@@ -708,6 +796,19 @@ interface IconProps {
|
|
|
708
796
|
declare function Icon({ name, size, color, family }: IconProps): React.ReactElement | null;
|
|
709
797
|
declare function renderIcon(name: string, size: number, color: string): React.ReactElement | null;
|
|
710
798
|
|
|
799
|
+
/**
|
|
800
|
+
* Returns a font size that steps down as formatted text grows longer.
|
|
801
|
+
* Designed for currency/numeric displays where long values overflow.
|
|
802
|
+
*
|
|
803
|
+
* @param text - The formatted string (e.g. "$1.250.000")
|
|
804
|
+
* @param maxSize - Base (maximum) font size in points
|
|
805
|
+
* @param steps - Custom step config [{ maxLen, subtract }] — sorted ascending by maxLen
|
|
806
|
+
*/
|
|
807
|
+
declare function getResponsiveFontSize(text: string, maxSize: number, steps?: {
|
|
808
|
+
maxLen: number;
|
|
809
|
+
subtract: number;
|
|
810
|
+
}[]): number;
|
|
811
|
+
|
|
711
812
|
declare const SPACING: {
|
|
712
813
|
readonly xxs: 2;
|
|
713
814
|
readonly xs: 4;
|
|
@@ -884,7 +985,7 @@ declare const TYPOGRAPHY: {
|
|
|
884
985
|
readonly fontFamily: "Poppins-Medium";
|
|
885
986
|
readonly fontSize: 16;
|
|
886
987
|
readonly fontWeight: "500";
|
|
887
|
-
readonly lineHeight:
|
|
988
|
+
readonly lineHeight: 22;
|
|
888
989
|
readonly letterSpacing: 0;
|
|
889
990
|
};
|
|
890
991
|
readonly 'button-sm': {
|
|
@@ -904,4 +1005,4 @@ type RadiusKey = keyof Radius;
|
|
|
904
1005
|
type Typography = typeof TYPOGRAPHY;
|
|
905
1006
|
type TypographyKey = keyof Typography;
|
|
906
1007
|
|
|
907
|
-
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, BREAKPOINTS, 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, type CategoryItem, CategoryStrip, type CategoryStripProps, 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, ICON_SIZES, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconFamily, type IconProps, type IconSize, type IconSizeKey, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MediaCard, type MediaCardAspectRatio, type MediaCardProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Pressable, type PressableProps, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, type ResolvedColors, SHADOWS, SPACING, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type Spacing, type SpacingKey, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, TYPOGRAPHY, 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, type Typography, type TypographyKey, defaultDark, defaultLight, deriveColors, renderIcon, useTheme, useToast };
|
|
1008
|
+
export { Accordion, type AccordionItem, type AccordionProps, AlertBanner, type AlertBannerProps, type AlertBannerVariant, Avatar, type AvatarProps, type AvatarSize, BREAKPOINTS, Badge, type BadgeProps, type BadgeVariant, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type CategoryItem, CategoryStrip, type CategoryStripProps, Checkbox, type CheckboxProps, Chip, ChipGroup, type ChipGroupProps, type ChipOption, type ChipProps, type ColorScheme, ConfirmDialog, type ConfirmDialogProps, CurrencyDisplay, type CurrencyDisplayProps, type CurrencyDisplayVariant, CurrencyInput, CurrencyInput as CurrencyInputLarge, type CurrencyInputProps, DetailRow, type DetailRowLabelWeight, type DetailRowProps, type DetailRowSeparator, EmptyState, type EmptyStateProps, ICON_SIZES, Icon, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconFamily, type IconProps, type IconSize, type IconSizeKey, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MediaCard, type MediaCardAspectRatio, type MediaCardProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Pressable, type PressableProps, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, type ResolvedColors, SHADOWS, SPACING, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type Spacing, type SpacingKey, Spinner, type SpinnerProps, type SpinnerSize, Switch, type SwitchProps, TYPOGRAPHY, 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, type Typography, type TypographyKey, defaultDark, defaultLight, deriveColors, getResponsiveFontSize, renderIcon, useTheme, useToast };
|