@mari-ui/native 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +88 -2
- package/dist/index.cjs +9602 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2871 -0
- package/dist/index.d.ts +2871 -0
- package/dist/index.js +9497 -0
- package/dist/index.js.map +1 -0
- package/package.json +72 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aykut Yılmaz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mari-ui/native
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[mari-ui](https://github.com/aykutyilmaz37/mari-ui) tasarım sisteminin React Native component'leri. Web'deki `@mari-ui/components` ile aynı prop adları, aynı tema ve renk sözleşmesi; ölçüler ise dokunmatik ekrana göre (en az 44 pt dokunma hedefi, platform metin ölçeği).
|
|
4
|
+
|
|
5
|
+
- **~45 component** — form, gezinme, veri gösterimi, katmanlar (Modal, BottomSheet, Toast), görsel galerisi.
|
|
6
|
+
- **Sıfır kurulum** — `StyleSheet` + `@mari-ui/tokens`; NativeWind, babel ya da metro eklentisi gerekmez.
|
|
7
|
+
- **Açık / koyu tema** otomatik (işletim sistemi tercihi), WCAG AA kontrastı token'lardan.
|
|
8
|
+
- Her component'te **iskelet** (`skeleton`), erişilebilirlik (rol, ad, durum) ve hareket azaltma desteği.
|
|
9
|
+
|
|
10
|
+
## Kurulum
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add @mari-ui/native @mari-ui/tokens react-native-svg
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Peer bağımlılıklar: `react` ≥ 18.2, `react-native` ≥ 0.76, `react-native-svg` ≥ 15. Expo ile `npx expo install react-native-svg` kullanın.
|
|
17
|
+
|
|
18
|
+
## Kullanım
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { Button, Input, Field } from "@mari-ui/native";
|
|
22
|
+
|
|
23
|
+
<Field label="E-posta">
|
|
24
|
+
<Input type="email" placeholder="ornek@mari-ui.com" />
|
|
25
|
+
</Field>
|
|
26
|
+
<Button color="primary" onPress={save}>Kaydet</Button>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`ThemeProvider` isteğe bağlıdır; verilmezse tema cihazın açık/koyu ayarını izler.
|
|
30
|
+
|
|
31
|
+
## Tema
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { ThemeProvider } from "@mari-ui/native";
|
|
35
|
+
import { darkTheme, resolveThemeConfig } from "@mari-ui/tokens";
|
|
36
|
+
|
|
37
|
+
// Her zaman koyu:
|
|
38
|
+
<ThemeProvider theme={darkTheme}><App /></ThemeProvider>
|
|
39
|
+
|
|
40
|
+
// Projenin mari-ui.config.json'ı (marka rengi, kişilik, ek temalar):
|
|
41
|
+
const { light, dark } = resolveThemeConfig(config);
|
|
42
|
+
<ThemeProvider theme={scheme === "dark" ? dark : light}><App /></ThemeProvider>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`npx @mari-ui/cli theme` aynı config'ten `mari-ui-theme.ts` üretir; içindeki temalar doğrudan `ThemeProvider`a verilebilir.
|
|
46
|
+
|
|
47
|
+
### Fontlar
|
|
48
|
+
|
|
49
|
+
Varsayılan `fonts="system"`: iOS'ta SF, Android'de Roboto — dosya yüklemek gerekmez. mari-ui'ın kendi aileleri için `fonts="brand"` verin ve fontları aynı adlarla yükleyin:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { useFonts } from "expo-font";
|
|
53
|
+
|
|
54
|
+
const [loaded] = useFonts({
|
|
55
|
+
Geist: require("@mari-ui/tokens/fonts/Geist.ttf"),
|
|
56
|
+
Manrope: require("@mari-ui/tokens/fonts/Manrope.ttf"),
|
|
57
|
+
"Geist Mono": require("@mari-ui/tokens/fonts/GeistMono.ttf"),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
<ThemeProvider theme={theme} fonts="brand">…</ThemeProvider>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Tasarım kişilikleri renk, köşe, gölge ve hareketi uygular; native'de font dosyası getirmez.
|
|
64
|
+
|
|
65
|
+
### Güvenli alan ve ölçüler
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { NativeConfigProvider, ThemeProvider } from "@mari-ui/native";
|
|
69
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
70
|
+
|
|
71
|
+
<ThemeProvider theme={theme} insets={useSafeAreaInsets()}>
|
|
72
|
+
<NativeConfigProvider config={{ sizes: { md: { height: 48 } } }}>
|
|
73
|
+
<App />
|
|
74
|
+
</NativeConfigProvider>
|
|
75
|
+
</ThemeProvider>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`insets`, ekran kenarına değen bileşenlere (AppBar, BottomNavigation, BottomSheet, Toast…) çentik ve ev çubuğu payını verir. `NativeConfigProvider` varsayılan ölçüleri (yükseklik, dolgu, yazı boyutu) uygulama genelinde ezer; yalnız verilen alanlar değişir.
|
|
79
|
+
|
|
80
|
+
## İpucu: klavye ve kaydırma
|
|
81
|
+
|
|
82
|
+
Select / BottomSheet / Modal açan ekranın `ScrollView`una `keyboardShouldPersistTaps="handled"` verin; yoksa klavye açıkken paneldeki ilk dokunuş yalnız klavyeyi kapatır.
|
|
83
|
+
|
|
84
|
+
## Bağlantılar
|
|
85
|
+
|
|
86
|
+
- Component dokümanları ve örnekler: [mari-ui deposu](https://github.com/aykutyilmaz37/mari-ui#readme) (Storybook: `pnpm storybook`, "Native" grubu)
|
|
87
|
+
- Web component'leri: [`@mari-ui/components`](https://www.npmjs.com/package/@mari-ui/components)
|
|
88
|
+
|
|
89
|
+
Lisans: MIT.
|