@retray-dev/ui-kit 2.7.0 → 2.8.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 CHANGED
@@ -1,4 +1,4 @@
1
- # @retray-dev/ui-kit — Component Reference (v2.7.0)
1
+ # @retray-dev/ui-kit — Component Reference (v2.8.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
 
@@ -271,6 +271,36 @@ const isWide = width >= BREAKPOINTS.wide
271
271
 
272
272
  ---
273
273
 
274
+ ### IconButton
275
+
276
+ **Import:** `import { IconButton } from '@retray-dev/ui-kit'`
277
+ **When to use:** Compact icon-only pressable action — toolbars, FABs, inline icon actions. Use `Button` when a label is needed.
278
+ **Extends:** `TouchableOpacityProps` — all RN TouchableOpacity props pass through.
279
+
280
+ | Prop | Type | Default | Notes |
281
+ |------|------|---------|-------|
282
+ | iconName | `string` | — | Icon name from `@expo/vector-icons` (e.g. `"plus"`, `"x"`, `"home"`). Takes precedence over `icon` |
283
+ | icon | `React.ReactNode` | — | Custom icon node — used when `iconName` is not provided |
284
+ | iconColor | `string` | — | Override icon color. Defaults to variant foreground color |
285
+ | variant | `'primary' \| 'secondary' \| 'outline' \| 'ghost' \| 'destructive'` | `'primary'` | Visual style — same tokens as `Button` |
286
+ | size | `'sm' \| 'md' \| 'lg'` | `'md'` | sm=40pt / md=44pt / lg=52pt (all ≥44pt on md/lg per HIG) |
287
+ | loading | `boolean` | `false` | Replaces icon with a spinner and forces disabled state |
288
+ | disabled | `boolean` | — | Reduces opacity to 0.5 |
289
+
290
+ **Variants:** Same color logic as `Button` — `primary`, `secondary`, `outline`, `ghost`, `destructive`.
291
+
292
+ **Animations:** Scale springs to 0.95 on `onPressIn`, back to 1.0 on `onPressOut`. `impactAsync(Light)` haptic on press.
293
+
294
+ **Example:**
295
+ ```tsx
296
+ <IconButton iconName="plus" onPress={handleAdd} />
297
+ <IconButton iconName="x" variant="ghost" size="sm" onPress={handleClose} />
298
+ <IconButton iconName="trash-2" variant="destructive" onPress={handleDelete} />
299
+ <IconButton iconName="check" variant="outline" size="lg" loading={saving} />
300
+ ```
301
+
302
+ ---
303
+
274
304
  ### Input
275
305
 
276
306
  **Import:** `import { Input } from '@retray-dev/ui-kit'`
@@ -1307,6 +1337,7 @@ Each component that accepts icon slots now has a corresponding `iconName` prop.
1307
1337
  | Component | Prop(s) | Slot | Default size | Default color |
1308
1338
  |---|---|---|---|---|
1309
1339
  | `Button` | `iconName`, `iconColor` | Left or right of label | sm=16 / md=18 / lg=20 | Variant label color |
1340
+ | `IconButton` | `iconName`, `iconColor` | Center (icon-only) | sm=18 / md=20 / lg=24 | Variant foreground color |
1310
1341
  | `Input` | `prefixIcon`, `prefixIconColor` | Before input text | 20 | `mutedForeground` |
1311
1342
  | `Input` | `suffixIcon`, `suffixIconColor` | After input text | 20 | `mutedForeground` |
1312
1343
  | `ListItem` | `leftIcon`, `leftIconColor` | Left 44×44 slot | 24 | `foreground` |
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
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
- - 32 components across 6 categories
5
+ - 33 components across 6 categories
6
6
  - Light/dark theme with 20 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
@@ -119,7 +119,7 @@ import { SPACING, ICON_SIZES, RADIUS, SHADOWS, BREAKPOINTS } from '@retray-dev/u
119
119
  | ----------- | ----------------------------------------------------------------------------------------------- |
120
120
  | Display | `Text`, `Badge`, `Avatar`, `Separator`, `Spinner`, `Skeleton`, `Progress`, `CurrencyDisplay` |
121
121
  | Surfaces | `Card`, `AlertBanner`, `EmptyState` |
122
- | Form | `Button`, `Input`, `CurrencyInput`, `CurrencyInputLarge`, `Textarea`, `Checkbox`, `Switch`, `Toggle`, `RadioGroup`, `Select`, `Slider` |
122
+ | Form | `Button`, `IconButton`, `Input`, `CurrencyInput`, `CurrencyInputLarge`, `Textarea`, `Checkbox`, `Switch`, `Toggle`, `RadioGroup`, `Select`, `Slider` |
123
123
  | Composition | `Tabs`, `Accordion` |
124
124
  | Overlays | `Sheet`, `ConfirmDialog` |
125
125
  | Feedback | `Toast` / `ToastProvider` / `useToast` |
package/dist/index.d.mts CHANGED
@@ -88,6 +88,25 @@ interface ButtonProps extends TouchableOpacityProps {
88
88
  }
89
89
  declare function Button({ label, variant, size, loading, fullWidth, icon, iconName, iconColor, iconPosition, disabled, style, onPress, ...props }: ButtonProps): React.JSX.Element;
90
90
 
91
+ type IconButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
92
+ type IconButtonSize = 'sm' | 'md' | 'lg';
93
+ interface IconButtonProps extends TouchableOpacityProps {
94
+ /**
95
+ * Icon name from `@expo/vector-icons` (e.g. `"home"`, `"star"`, `"plus"`).
96
+ * See https://icons.expo.fyi. Takes precedence over `icon` when both supplied.
97
+ */
98
+ iconName?: string;
99
+ /** ReactNode icon — used when `iconName` is not provided. */
100
+ icon?: React.ReactNode;
101
+ /** Override the resolved icon color. Defaults to the foreground color for the active variant. */
102
+ iconColor?: string;
103
+ variant?: IconButtonVariant;
104
+ size?: IconButtonSize;
105
+ /** Replaces icon with a spinner and forces `disabled`. */
106
+ loading?: boolean;
107
+ }
108
+ declare function IconButton({ iconName, icon, iconColor, variant, size, loading, disabled, style, onPress, ...props }: IconButtonProps): React.JSX.Element;
109
+
91
110
  type TextVariant = 'h1' | 'h2' | 'h3' | 'body' | 'caption' | 'label';
92
111
  interface TextProps extends TextProps$1 {
93
112
  variant?: TextVariant;
@@ -690,4 +709,4 @@ type IconSizeKey = keyof IconSize;
690
709
  type Radius = typeof RADIUS;
691
710
  type RadiusKey = keyof Radius;
692
711
 
693
- 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, 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, type IconFamily, type IconProps, type IconSize, type IconSizeKey, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, 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, 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 };
712
+ 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, 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, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, 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, 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 };
package/dist/index.d.ts CHANGED
@@ -88,6 +88,25 @@ interface ButtonProps extends TouchableOpacityProps {
88
88
  }
89
89
  declare function Button({ label, variant, size, loading, fullWidth, icon, iconName, iconColor, iconPosition, disabled, style, onPress, ...props }: ButtonProps): React.JSX.Element;
90
90
 
91
+ type IconButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive';
92
+ type IconButtonSize = 'sm' | 'md' | 'lg';
93
+ interface IconButtonProps extends TouchableOpacityProps {
94
+ /**
95
+ * Icon name from `@expo/vector-icons` (e.g. `"home"`, `"star"`, `"plus"`).
96
+ * See https://icons.expo.fyi. Takes precedence over `icon` when both supplied.
97
+ */
98
+ iconName?: string;
99
+ /** ReactNode icon — used when `iconName` is not provided. */
100
+ icon?: React.ReactNode;
101
+ /** Override the resolved icon color. Defaults to the foreground color for the active variant. */
102
+ iconColor?: string;
103
+ variant?: IconButtonVariant;
104
+ size?: IconButtonSize;
105
+ /** Replaces icon with a spinner and forces `disabled`. */
106
+ loading?: boolean;
107
+ }
108
+ declare function IconButton({ iconName, icon, iconColor, variant, size, loading, disabled, style, onPress, ...props }: IconButtonProps): React.JSX.Element;
109
+
91
110
  type TextVariant = 'h1' | 'h2' | 'h3' | 'body' | 'caption' | 'label';
92
111
  interface TextProps extends TextProps$1 {
93
112
  variant?: TextVariant;
@@ -690,4 +709,4 @@ type IconSizeKey = keyof IconSize;
690
709
  type Radius = typeof RADIUS;
691
710
  type RadiusKey = keyof Radius;
692
711
 
693
- 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, 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, type IconFamily, type IconProps, type IconSize, type IconSizeKey, Input, type InputProps, LabelValue, type LabelValueProps, ListItem, type ListItemProps, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, 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, 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 };
712
+ 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, 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, MonthPicker, type MonthPickerProps, type MonthPickerValue, Progress, type ProgressProps, RADIUS, RadioGroup, type RadioGroupProps, type RadioOption, type Radius, type RadiusKey, 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, 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 };