@retray-dev/ui-kit 2.5.0 → 2.5.2

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.
Files changed (35) hide show
  1. package/COMPONENTS.md +11 -7
  2. package/README.md +3 -5
  3. package/dist/index.js +374 -362
  4. package/dist/index.mjs +362 -331
  5. package/package.json +23 -21
  6. package/src/components/Accordion/Accordion.tsx +61 -57
  7. package/src/components/Alert/Alert.tsx +11 -10
  8. package/src/components/AlertBanner/AlertBanner.tsx +9 -8
  9. package/src/components/Avatar/Avatar.tsx +9 -8
  10. package/src/components/Badge/Badge.tsx +11 -10
  11. package/src/components/Button/Button.tsx +10 -9
  12. package/src/components/Card/Card.tsx +12 -11
  13. package/src/components/Checkbox/Checkbox.tsx +16 -13
  14. package/src/components/Chip/Chip.tsx +8 -7
  15. package/src/components/ConfirmDialog/ConfirmDialog.tsx +12 -11
  16. package/src/components/CurrencyDisplay/CurrencyDisplay.tsx +2 -1
  17. package/src/components/CurrencyInput/CurrencyInput.tsx +2 -1
  18. package/src/components/EmptyState/EmptyState.tsx +19 -18
  19. package/src/components/Input/Input.tsx +15 -14
  20. package/src/components/LabelValue/LabelValue.tsx +6 -5
  21. package/src/components/ListItem/ListItem.tsx +20 -19
  22. package/src/components/MonthPicker/MonthPicker.tsx +9 -8
  23. package/src/components/Progress/Progress.tsx +2 -1
  24. package/src/components/RadioGroup/RadioGroup.tsx +18 -15
  25. package/src/components/Select/Select.tsx +25 -24
  26. package/src/components/Sheet/Sheet.tsx +15 -14
  27. package/src/components/Slider/Slider.tsx +7 -6
  28. package/src/components/Switch/Switch.tsx +7 -6
  29. package/src/components/Tabs/Tabs.tsx +17 -14
  30. package/src/components/Text/Text.tsx +7 -6
  31. package/src/components/Textarea/Textarea.tsx +9 -8
  32. package/src/components/Toast/Toast.tsx +19 -18
  33. package/src/components/Toggle/Toggle.tsx +9 -8
  34. package/src/utils/haptics.ts +32 -0
  35. package/src/utils/scaling.ts +26 -0
package/COMPONENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- # @retray-dev/ui-kit — Component Reference (v2.1.0)
1
+ # @retray-dev/ui-kit — Component Reference (v2.5.2)
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
 
@@ -152,7 +152,7 @@ import type { ThemeColors } from '@retray-dev/ui-kit'
152
152
  | loading | `boolean` | `false` | Replaces label with a spinner and forces disabled state |
153
153
  | fullWidth | `boolean` | `false` | Stretches to container width (`alignSelf: 'stretch'`) |
154
154
  | disabled | `boolean` | — | Reduces opacity to 0.5 |
155
- | icon | `React.ReactNode` | — | Icon rendered alongside the label |
155
+ | icon | `React.ReactNode \| ((props: { label, size, variant }) => React.ReactNode)` | — | Icon rendered alongside the label. Can be a node or a render function |
156
156
  | iconPosition | `'left' \| 'right'` | `'left'` | Side the icon appears on |
157
157
 
158
158
  **Variants:**
@@ -162,7 +162,7 @@ import type { ThemeColors } from '@retray-dev/ui-kit'
162
162
  - `ghost`: fully transparent — in-context or low-emphasis actions
163
163
  - `destructive`: filled with `destructive` token — irreversible or dangerous actions
164
164
 
165
- **Animations:** Scale springs to 0.97 on `onPressIn`, back to 1.0 on `onPressOut`.
165
+ **Animations:** Scale springs to 0.95 on `onPressIn`, back to 1.0 on `onPressOut`.
166
166
 
167
167
  **Example:**
168
168
  ```tsx
@@ -188,7 +188,10 @@ import type { ThemeColors } from '@retray-dev/ui-kit'
188
188
  | hint | `string` | — | Helper text below (hidden when `error` is set) |
189
189
  | prefix | `string \| ReactNode` | — | Content rendered before the input field (e.g., `"$"` or an icon) |
190
190
  | suffix | `string \| ReactNode` | — | Content rendered after the input field (e.g., `"kg"` or a button) |
191
+ | prefixStyle | `TextStyle` | — | Style applied to the prefix text when prefix is a string |
192
+ | suffixStyle | `TextStyle` | — | Style applied to the suffix text when suffix is a string |
191
193
  | type | `'text' \| 'password'` | `'text'` | When `'password'`, shows a visibility toggle button in the suffix slot |
194
+ | containerStyle | `ViewStyle` | — | Style for the outer container `View` |
192
195
 
193
196
  **Border colors:** `destructive` when `error` is set, `ring` when focused, `border` otherwise.
194
197
 
@@ -260,7 +263,8 @@ const [amount, setAmount] = useState(0)
260
263
  | label | `string` | — | Label above |
261
264
  | error | `string` | — | Error text below; red border |
262
265
  | hint | `string` | — | Helper text below |
263
- | rows | `number` | `4` | Sets `minHeight` (each row ≈ 28px) |
266
+ | rows | `number` | `4` | Sets `minHeight` (each row ≈ 30px) and `numberOfLines` |
267
+ | containerStyle | `ViewStyle` | — | Style for the outer container `View` |
264
268
 
265
269
  **Example:**
266
270
  ```tsx
@@ -505,8 +509,8 @@ All sub-components (`CardHeader`, `CardTitle`, `CardDescription`, `CardContent`,
505
509
  **Notes:**
506
510
  - `CardHeader` and `CardContent` have `padding: 24`. Override via the `style` prop: `<CardContent style={{ padding: 16 }}>`
507
511
  - `CardFooter` has `paddingTop: 0` so it connects naturally to `CardContent`
508
- - `CardTitle`: 18px / 600 weight, `cardForeground` color
509
- - `CardDescription`: 14px, `mutedForeground` color
512
+ - `CardTitle`: 20px / 600 weight / lineHeight 28, `cardForeground` color
513
+ - `CardDescription`: 15px / lineHeight 22, `mutedForeground` color
510
514
  - Press animation scales to 0.98 via `Animated.spring` when `onPress` is provided
511
515
 
512
516
  ---
@@ -786,7 +790,7 @@ const [tab, setTab] = useState('profile')
786
790
  | defaultValue | `string \| string[]` | — | Initially open item(s). Use `string[]` with `type='multiple'` |
787
791
  | style | `ViewStyle` | — | — |
788
792
 
789
- **Animation:** Height and chevron rotation are animated on the UI thread via `react-native-reanimated` (`withTiming`, `useSharedValue`). `Easing.out(Easing.ease)` for expand, `Easing.in(Easing.ease)` for collapse (220ms, 60 fps).
793
+ **Animation:** All animation is handled exclusively by `react-native-reanimated` (`withTiming` for height/rotation, `withSpring` for press scale, `useSharedValue`, `useAnimatedStyle`) on the UI thread at 60 fps. `Easing.out(Easing.ease)` for expand, `Easing.in(Easing.ease)` for collapse (220ms). Press scale springs to 0.95 on press-in and back to 1.0 on press-out.
790
794
 
791
795
  **Example:**
792
796
  ```tsx
package/README.md CHANGED
@@ -23,7 +23,7 @@ pnpm add @retray-dev/ui-kit
23
23
  Install these in your app if not already present:
24
24
 
25
25
  ```bash
26
- pnpm add expo-haptics react-native-safe-area-context @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-worklets
26
+ pnpm add expo-haptics expo-linear-gradient react-native-safe-area-context @gorhom/bottom-sheet react-native-reanimated react-native-gesture-handler react-native-worklets @react-native-picker/picker @react-native-community/slider @expo/vector-icons
27
27
  ```
28
28
 
29
29
  For Expo projects, run `npx expo install` instead to get SDK-compatible versions.
@@ -100,7 +100,7 @@ const { colors, colorScheme } = useTheme()
100
100
  | Category | Components |
101
101
  | ----------- | ----------------------------------------------------------------------------------------------- |
102
102
  | Display | `Text`, `Badge`, `Avatar`, `Separator`, `Spinner`, `Skeleton`, `Progress`, `CurrencyDisplay` |
103
- | Surfaces | `Card`, `Alert`, `EmptyState` |
103
+ | Surfaces | `Card`, `AlertBanner`, `EmptyState` |
104
104
  | Form | `Button`, `Input`, `CurrencyInput`, `CurrencyInputLarge`, `Textarea`, `Checkbox`, `Switch`, `Toggle`, `RadioGroup`, `Select`, `Slider` |
105
105
  | Composition | `Tabs`, `Accordion` |
106
106
  | Overlays | `Sheet`, `ConfirmDialog` |
@@ -116,9 +116,7 @@ import {
116
116
  } from '@retray-dev/ui-kit'
117
117
 
118
118
  // Button
119
- <Button variant="default" size="md" onPress={() => {}}>
120
- Save
121
- </Button>
119
+ <Button label="Save" variant="primary" size="md" onPress={() => {}} />
122
120
 
123
121
  // Toast
124
122
  const { toast } = useToast()