@retray-dev/ui-kit 2.5.0 → 2.5.1
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 +10 -6
- package/README.md +3 -5
- package/package.json +1 -1
package/COMPONENTS.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @retray-dev/ui-kit — Component Reference (v2.1
|
|
1
|
+
# @retray-dev/ui-kit — Component Reference (v2.5.1)
|
|
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.
|
|
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 ≈
|
|
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`:
|
|
509
|
-
- `CardDescription`:
|
|
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
|
---
|
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`, `
|
|
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="
|
|
120
|
-
Save
|
|
121
|
-
</Button>
|
|
119
|
+
<Button label="Save" variant="primary" size="md" onPress={() => {}} />
|
|
122
120
|
|
|
123
121
|
// Toast
|
|
124
122
|
const { toast } = useToast()
|