@retray-dev/ui-kit 2.5.2 → 2.6.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/dist/index.d.ts CHANGED
@@ -75,10 +75,18 @@ interface ButtonProps extends TouchableOpacityProps {
75
75
  size: ButtonSize;
76
76
  variant: ButtonVariant;
77
77
  }) => React.ReactNode);
78
+ /**
79
+ * Icon name from `@expo/vector-icons` (e.g. `"home"`, `"star"`, `"arrow-right"`).
80
+ * See https://icons.expo.fyi to browse available icons.
81
+ * Takes precedence over `icon` when both are supplied.
82
+ */
83
+ iconName?: string;
84
+ /** Override the resolved icon color. Defaults to the label foreground color for the active variant. */
85
+ iconColor?: string;
78
86
  /** Side the icon appears on. Defaults to `'left'`. */
79
87
  iconPosition?: 'left' | 'right';
80
88
  }
81
- declare function Button({ label, variant, size, loading, fullWidth, icon, iconPosition, disabled, style, onPress, ...props }: ButtonProps): React.JSX.Element;
89
+ declare function Button({ label, variant, size, loading, fullWidth, icon, iconName, iconColor, iconPosition, disabled, style, onPress, ...props }: ButtonProps): React.JSX.Element;
82
90
 
83
91
  type TextVariant = 'h1' | 'h2' | 'h3' | 'body' | 'caption' | 'label';
84
92
  interface TextProps extends TextProps$1 {
@@ -101,12 +109,26 @@ interface InputProps extends TextInputProps {
101
109
  prefixStyle?: TextStyle;
102
110
  /** Style applied to suffix text if suffix is a string. */
103
111
  suffixStyle?: TextStyle;
112
+ /**
113
+ * Icon name from `@expo/vector-icons` rendered before the input text.
114
+ * See https://icons.expo.fyi. Takes precedence over `prefix`.
115
+ */
116
+ prefixIcon?: string;
117
+ /**
118
+ * Icon name from `@expo/vector-icons` rendered after the input text.
119
+ * See https://icons.expo.fyi. Takes precedence over `suffix` (unless `type="password"`).
120
+ */
121
+ suffixIcon?: string;
122
+ /** Override the resolved prefix icon color. Defaults to `mutedForeground`. */
123
+ prefixIconColor?: string;
124
+ /** Override the resolved suffix icon color. Defaults to `mutedForeground`. */
125
+ suffixIconColor?: string;
104
126
  /** Input type. When set to \`'password'\`, shows a toggle button to reveal/hide text. */
105
127
  type?: 'text' | 'password';
106
128
  /** Style for the outer container \`View\`. Use \`style\` (from \`TextInputProps\`) to style the \`TextInput\` itself. */
107
129
  containerStyle?: ViewStyle;
108
130
  }
109
- declare function Input({ label, error, hint, prefix, suffix, prefixStyle, suffixStyle, type, containerStyle, style, onFocus, onBlur, secureTextEntry, ...props }: InputProps): React.JSX.Element;
131
+ 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;
110
132
 
111
133
  type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
112
134
  type BadgeSize = 'sm' | 'md' | 'lg';
@@ -118,9 +140,16 @@ interface BadgeProps {
118
140
  size?: BadgeSize;
119
141
  /** Icon rendered before the label/children. */
120
142
  icon?: React.ReactNode;
143
+ /**
144
+ * Icon name from `@expo/vector-icons` rendered before the label.
145
+ * See https://icons.expo.fyi. Takes precedence over `icon`.
146
+ */
147
+ iconName?: string;
148
+ /** Override the resolved icon color. Defaults to the variant foreground color. */
149
+ iconColor?: string;
121
150
  style?: ViewStyle;
122
151
  }
123
- declare function Badge({ label, children, variant, size, icon, style }: BadgeProps): React.JSX.Element;
152
+ declare function Badge({ label, children, variant, size, icon, iconName, iconColor, style }: BadgeProps): React.JSX.Element;
124
153
 
125
154
  type CardVariant = 'elevated' | 'outlined' | 'filled';
126
155
  interface CardProps {
@@ -196,9 +225,16 @@ interface AlertBannerProps {
196
225
  description?: string;
197
226
  variant?: AlertBannerVariant;
198
227
  icon?: React.ReactNode;
228
+ /**
229
+ * Icon name from `@expo/vector-icons`. See https://icons.expo.fyi.
230
+ * Takes precedence over `icon`. When neither is set, a default variant icon is shown.
231
+ */
232
+ iconName?: string;
233
+ /** Override the resolved icon color. Defaults to the variant title color. */
234
+ iconColor?: string;
199
235
  style?: ViewStyle;
200
236
  }
201
- declare function AlertBanner({ title, description, variant, icon, style }: AlertBannerProps): React.JSX.Element;
237
+ declare function AlertBanner({ title, description, variant, icon, iconName, iconColor, style }: AlertBannerProps): React.JSX.Element;
202
238
 
203
239
  interface ProgressProps {
204
240
  /** Current progress value. Clamped to `[0, max]`. Defaults to `0`. */
@@ -211,6 +247,13 @@ declare function Progress({ value, max, style }: ProgressProps): React.JSX.Eleme
211
247
 
212
248
  interface EmptyStateProps {
213
249
  icon?: React.ReactNode;
250
+ /**
251
+ * Icon name from `@expo/vector-icons`. See https://icons.expo.fyi.
252
+ * Takes precedence over `icon`. Sized automatically to fit the slot (48 default, 32 compact).
253
+ */
254
+ iconName?: string;
255
+ /** Override the resolved icon color. Defaults to `mutedForeground`. */
256
+ iconColor?: string;
214
257
  title: string;
215
258
  description?: string;
216
259
  action?: React.ReactNode;
@@ -218,7 +261,7 @@ interface EmptyStateProps {
218
261
  size?: 'default' | 'compact';
219
262
  style?: ViewStyle;
220
263
  }
221
- declare function EmptyState({ icon, title, description, action, size, style }: EmptyStateProps): React.JSX.Element;
264
+ declare function EmptyState({ icon, iconName, iconColor, title, description, action, size, style }: EmptyStateProps): React.JSX.Element;
222
265
 
223
266
  interface TextareaProps extends TextInputProps {
224
267
  label?: string;
@@ -262,8 +305,22 @@ interface ToggleProps extends TouchableOpacityProps {
262
305
  icon?: React.ReactNode | ((pressed: boolean) => React.ReactNode);
263
306
  /** Icon to show when pressed/active. If omitted, a default check mark is used. */
264
307
  activeIcon?: React.ReactNode | ((pressed: boolean) => React.ReactNode);
308
+ /**
309
+ * Icon name from `@expo/vector-icons` shown when not pressed.
310
+ * See https://icons.expo.fyi. Takes precedence over `icon`.
311
+ */
312
+ iconName?: string;
313
+ /**
314
+ * Icon name from `@expo/vector-icons` shown when pressed/active.
315
+ * See https://icons.expo.fyi. Takes precedence over `activeIcon`.
316
+ */
317
+ activeIconName?: string;
318
+ /** Override the resolved inactive icon color. Defaults to `mutedForeground`. */
319
+ iconColor?: string;
320
+ /** Override the resolved active icon color. Defaults to `primary`. */
321
+ activeIconColor?: string;
265
322
  }
266
- declare function Toggle({ pressed, onPressedChange, variant, size, label, icon, activeIcon, disabled, style, ...props }: ToggleProps): React.JSX.Element;
323
+ declare function Toggle({ pressed, onPressedChange, variant, size, label, icon, activeIcon, iconName, activeIconName, iconColor, activeIconColor, disabled, style, ...props }: ToggleProps): React.JSX.Element;
267
324
 
268
325
  interface RadioOption {
269
326
  label: string;
@@ -378,6 +435,13 @@ interface ToastItem {
378
435
  description?: string;
379
436
  variant?: ToastVariant;
380
437
  icon?: React.ReactNode;
438
+ /**
439
+ * Icon name from `@expo/vector-icons`. See https://icons.expo.fyi.
440
+ * Takes precedence over `icon`. When neither is set, a default variant icon is shown.
441
+ */
442
+ iconName?: string;
443
+ /** Override the resolved icon color. Defaults to the variant text color. */
444
+ iconColor?: string;
381
445
  /** Auto-dismiss delay in milliseconds. Defaults to `3000`. */
382
446
  duration?: number;
383
447
  }
@@ -446,6 +510,20 @@ interface ListItemProps {
446
510
  trailing?: React.ReactNode | string;
447
511
  /** @deprecated Use `leftRender` instead. */
448
512
  icon?: React.ReactNode;
513
+ /**
514
+ * Icon name from `@expo/vector-icons` rendered in the left slot.
515
+ * See https://icons.expo.fyi. Takes precedence over `leftRender`.
516
+ */
517
+ leftIcon?: string;
518
+ /**
519
+ * Icon name from `@expo/vector-icons` rendered in the right slot.
520
+ * See https://icons.expo.fyi. Takes precedence over `rightRender`.
521
+ */
522
+ rightIcon?: string;
523
+ /** Override the resolved left icon color. Defaults to `foreground`. */
524
+ leftIconColor?: string;
525
+ /** Override the resolved right icon color. Defaults to `mutedForeground`. */
526
+ rightIconColor?: string;
449
527
  title: string;
450
528
  /** Secondary line below the title. */
451
529
  subtitle?: string;
@@ -471,7 +549,7 @@ interface ListItemProps {
471
549
  /** Style applied to the caption Text. */
472
550
  captionStyle?: TextStyle;
473
551
  }
474
- declare function ListItem({ leftRender, rightRender, trailing, icon, title, subtitle, caption, variant, showChevron, showSeparator, onPress, disabled, style, titleStyle, subtitleStyle, captionStyle, }: ListItemProps): React.JSX.Element;
552
+ declare function ListItem({ leftRender, rightRender, trailing, icon, leftIcon, rightIcon, leftIconColor, rightIconColor, title, subtitle, caption, variant, showChevron, showSeparator, onPress, disabled, style, titleStyle, subtitleStyle, captionStyle, }: ListItemProps): React.JSX.Element;
475
553
 
476
554
  interface ChipProps {
477
555
  label: string;
@@ -525,4 +603,16 @@ interface MonthPickerProps {
525
603
  }
526
604
  declare function MonthPicker({ value, onChange, style }: MonthPickerProps): React.JSX.Element;
527
605
 
528
- 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 };
606
+ type IconFamily = 'Feather' | 'AntDesign' | 'Entypo' | 'FontAwesome5' | 'MaterialIcons' | 'Ionicons';
607
+ interface IconProps {
608
+ /** Icon name from any supported @expo/vector-icons family. See https://icons.expo.fyi */
609
+ name: string;
610
+ size: number;
611
+ color: string;
612
+ /** Override the resolved family when the same name exists in multiple families. */
613
+ family?: IconFamily;
614
+ }
615
+ declare function Icon({ name, size, color, family }: IconProps): React.ReactElement | null;
616
+ declare function renderIcon(name: string, size: number, color: string): React.ReactElement | null;
617
+
618
+ 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, Icon, type IconFamily, type IconProps, 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, renderIcon, useTheme, useToast };