@otfdashkit/ui-native 0.1.0 → 0.1.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.
- package/LICENSE +1 -1
- package/README.md +110 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +608 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +539 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +36 -3
package/LICENSE
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<h1 align="center">@otfdashkit/ui-native</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
React Native + Expo component library — same component API as <code>@otfdashkit/ui</code> (web).<br/>
|
|
5
|
+
Tamagui under the hood, parity primitives, tokens shared with the web SDK.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://www.npmjs.com/package/@otfdashkit/ui-native" target="_blank">
|
|
10
|
+
<img src="https://img.shields.io/npm/v/@otfdashkit/ui-native?style=flat-square&color=000" alt="npm version">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@otfdashkit/ui-native" target="_blank">
|
|
13
|
+
<img src="https://img.shields.io/npm/dm/@otfdashkit/ui-native?style=flat-square&color=000" alt="npm downloads">
|
|
14
|
+
</a>
|
|
15
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="MIT License">
|
|
16
|
+
<img src="https://img.shields.io/badge/platforms-iOS%20%7C%20Android-000?style=flat-square" alt="platforms">
|
|
17
|
+
<img src="https://img.shields.io/badge/Expo-SDK%2054-000?style=flat-square" alt="Expo SDK 54">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Live demo
|
|
23
|
+
|
|
24
|
+
- **[native.otf-kit.dev](https://native.otf-kit.dev/)** — full storybook in a phone-frame, with an Expo Go QR for real-device preview
|
|
25
|
+
- **[fitness-preview.otf-kit.dev](https://fitness-preview.otf-kit.dev/)** — production fitness app built end-to-end with this package
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm add @otfdashkit/ui-native @otfdashkit/tokens
|
|
31
|
+
# or: npm install @otfdashkit/ui-native @otfdashkit/tokens
|
|
32
|
+
# or: bun add @otfdashkit/ui-native @otfdashkit/tokens
|
|
33
|
+
|
|
34
|
+
npx expo install react-native-svg react-native-safe-area-context
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick start
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
// App.tsx
|
|
41
|
+
import { TamaguiProvider, createTamagui } from '@tamagui/core'
|
|
42
|
+
import { otfTamaguiConfig } from '@otfdashkit/tokens'
|
|
43
|
+
import { Button, Card, Input } from '@otfdashkit/ui-native'
|
|
44
|
+
|
|
45
|
+
const config = createTamagui(otfTamaguiConfig)
|
|
46
|
+
|
|
47
|
+
export default function App() {
|
|
48
|
+
return (
|
|
49
|
+
<TamaguiProvider config={config}>
|
|
50
|
+
<Card>
|
|
51
|
+
<Input placeholder="Email" />
|
|
52
|
+
<Button variant="primary" size="lg" onPress={handlePress}>
|
|
53
|
+
Continue
|
|
54
|
+
</Button>
|
|
55
|
+
</Card>
|
|
56
|
+
</TamaguiProvider>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The same component names, props, and variants work on web (`@otfdashkit/ui`) and native — port a screen by changing the import.
|
|
62
|
+
|
|
63
|
+
## Cross-platform parity
|
|
64
|
+
|
|
65
|
+
| Component | Web (`@otfdashkit/ui`) | Native (`@otfdashkit/ui-native`) |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| `<Button>` | Radix primitive | Tamagui primitive |
|
|
68
|
+
| `<Card>` | Tailwind v4 | Tamagui tokens |
|
|
69
|
+
| `<Input>` | Radix Form | Tamagui Input |
|
|
70
|
+
| `<Avatar>` | Radix Avatar | Tamagui Avatar |
|
|
71
|
+
| `<Text>` | Tailwind typography | Tamagui Text |
|
|
72
|
+
|
|
73
|
+
Everything reads from the same [`@otfdashkit/tokens`](https://www.npmjs.com/package/@otfdashkit/tokens) palette, so switching themes from `mono` → `ocean-teal` → `forest` cascades through both runtimes.
|
|
74
|
+
|
|
75
|
+
## Theming
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
// Apply a theme at the Tamagui provider level
|
|
79
|
+
import { otfTamaguiConfig, OTF_DESIGN_THEMES } from '@otfdashkit/tokens'
|
|
80
|
+
|
|
81
|
+
const config = createTamagui({
|
|
82
|
+
...otfTamaguiConfig,
|
|
83
|
+
defaultTheme: 'ocean-teal',
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
All 17 themes from `@otfdashkit/tokens` are available.
|
|
88
|
+
|
|
89
|
+
## AI-coding-tool-native
|
|
90
|
+
|
|
91
|
+
Every component ships with structured JSDoc and tested prompts (`ai/prompts/*.md`). Cursor, Claude Code, Copilot, and Lovable all generate correct native usage on the first try, including the right Expo Go imports, safe-area handling, and theme tokens.
|
|
92
|
+
|
|
93
|
+
## Live demos
|
|
94
|
+
|
|
95
|
+
- **Phone-frame storybook**: https://native.otf-kit.dev (every component, every variant + Expo Go QR)
|
|
96
|
+
- **Fitness reference app**: https://fitness-preview.otf-kit.dev ([source](https://github.com/otf-kit/fitness-kit))
|
|
97
|
+
|
|
98
|
+
## Related packages
|
|
99
|
+
|
|
100
|
+
- [`@otfdashkit/ui`](https://www.npmjs.com/package/@otfdashkit/ui) — web counterpart, same component API
|
|
101
|
+
- [`@otfdashkit/tokens`](https://www.npmjs.com/package/@otfdashkit/tokens) — shared design tokens (CSS vars + Tamagui config)
|
|
102
|
+
- [`@otfdashkit/eslint-plugin-otf-design`](https://www.npmjs.com/package/@otfdashkit/eslint-plugin-otf-design) — design-system lint rules
|
|
103
|
+
|
|
104
|
+
## Status
|
|
105
|
+
|
|
106
|
+
`v0.1.x` — alpha. APIs may change before `1.0`. Pin exact versions if you ship to production.
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT © otfdashkit
|
package/dist/index.d.ts
CHANGED
|
@@ -307,3 +307,20 @@ export type CardScrollerProps<T = unknown> = {
|
|
|
307
307
|
export const useCollapsibleHeader: any
|
|
308
308
|
export type UseCollapsibleHeaderOptions = any
|
|
309
309
|
export type UseCollapsibleHeaderReturn = any
|
|
310
|
+
|
|
311
|
+
// ─── Shockwave (Skia shader transition) ───────────────────────────────────
|
|
312
|
+
export const Shockwave: any
|
|
313
|
+
export type ShockwaveProps = any
|
|
314
|
+
export type ShockwaveSlotProps = any
|
|
315
|
+
export type ShockwaveContextValue = any
|
|
316
|
+
export type ShockwaveOrigin = any
|
|
317
|
+
export type ShockwaveValue = 'from' | 'to'
|
|
318
|
+
|
|
319
|
+
// ─── Stay (real-estate / booking marketing screens) ───────────────────────
|
|
320
|
+
export const StayBrowseScreen: any
|
|
321
|
+
export const StayDetailScreen: any
|
|
322
|
+
export type StayBrowseScreenProps = any
|
|
323
|
+
export type StayCategoryChip = any
|
|
324
|
+
export type StayDetailMetric = any
|
|
325
|
+
export type StayDetailScreenProps = any
|
|
326
|
+
export type StayListing = any
|