youricons-native 0.1.0 → 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/README.md +211 -11
- package/dist/android/YourIcons.kt +1 -1
- package/dist/android/YourIconsCompose.kt +2 -0
- package/dist/android/res/font/youricons.ttf +0 -0
- package/dist/android/res/font/youricons_bold.ttf +0 -0
- package/dist/android/res/font/youricons_bubble.ttf +0 -0
- package/dist/android/res/font/youricons_bubble_bold.ttf +0 -0
- package/dist/android/res/font/youricons_bubble_heavy.ttf +0 -0
- package/dist/android/res/font/youricons_bubble_light.ttf +0 -0
- package/dist/android/res/font/youricons_bubble_thin.ttf +0 -0
- package/dist/android/res/font/youricons_duotone.ttf +0 -0
- package/dist/android/res/font/youricons_heavy.ttf +0 -0
- package/dist/android/res/font/youricons_ink.ttf +0 -0
- package/dist/android/res/font/youricons_ink_bold.ttf +0 -0
- package/dist/android/res/font/youricons_ink_heavy.ttf +0 -0
- package/dist/android/res/font/youricons_ink_light.ttf +0 -0
- package/dist/android/res/font/youricons_ink_thin.ttf +0 -0
- package/dist/android/res/font/youricons_light.ttf +0 -0
- package/dist/android/res/font/youricons_pixel.ttf +0 -0
- package/dist/android/res/font/youricons_pixel_bold.ttf +0 -0
- package/dist/android/res/font/youricons_pixel_heavy.ttf +0 -0
- package/dist/android/res/font/youricons_pixel_light.ttf +0 -0
- package/dist/android/res/font/youricons_pixel_thin.ttf +0 -0
- package/dist/android/res/font/youricons_shine.ttf +0 -0
- package/dist/android/res/font/youricons_sketch.ttf +0 -0
- package/dist/android/res/font/youricons_sketch_bold.ttf +0 -0
- package/dist/android/res/font/youricons_sketch_heavy.ttf +0 -0
- package/dist/android/res/font/youricons_sketch_light.ttf +0 -0
- package/dist/android/res/font/youricons_sketch_thin.ttf +0 -0
- package/dist/android/res/font/youricons_solid.ttf +0 -0
- package/dist/android/res/font/youricons_solid_bold.ttf +0 -0
- package/dist/android/res/font/youricons_solid_heavy.ttf +0 -0
- package/dist/android/res/font/youricons_solid_light.ttf +0 -0
- package/dist/android/res/font/youricons_solid_thin.ttf +0 -0
- package/dist/android/res/font/youricons_thin.ttf +0 -0
- package/dist/fonts/YourIcons-Bold.ttf +0 -0
- package/dist/fonts/YourIcons-Bubble-Bold.ttf +0 -0
- package/dist/fonts/YourIcons-Bubble-Heavy.ttf +0 -0
- package/dist/fonts/YourIcons-Bubble-Light.ttf +0 -0
- package/dist/fonts/YourIcons-Bubble-Thin.ttf +0 -0
- package/dist/fonts/YourIcons-Bubble.ttf +0 -0
- package/dist/fonts/YourIcons-Duotone.ttf +0 -0
- package/dist/fonts/YourIcons-Heavy.ttf +0 -0
- package/dist/fonts/YourIcons-Ink-Bold.ttf +0 -0
- package/dist/fonts/YourIcons-Ink-Heavy.ttf +0 -0
- package/dist/fonts/YourIcons-Ink-Light.ttf +0 -0
- package/dist/fonts/YourIcons-Ink-Thin.ttf +0 -0
- package/dist/fonts/YourIcons-Ink.ttf +0 -0
- package/dist/fonts/YourIcons-Light.ttf +0 -0
- package/dist/fonts/YourIcons-Pixel-Bold.ttf +0 -0
- package/dist/fonts/YourIcons-Pixel-Heavy.ttf +0 -0
- package/dist/fonts/YourIcons-Pixel-Light.ttf +0 -0
- package/dist/fonts/YourIcons-Pixel-Thin.ttf +0 -0
- package/dist/fonts/YourIcons-Pixel.ttf +0 -0
- package/dist/fonts/YourIcons-Shine.ttf +0 -0
- package/dist/fonts/YourIcons-Sketch-Bold.ttf +0 -0
- package/dist/fonts/YourIcons-Sketch-Heavy.ttf +0 -0
- package/dist/fonts/YourIcons-Sketch-Light.ttf +0 -0
- package/dist/fonts/YourIcons-Sketch-Thin.ttf +0 -0
- package/dist/fonts/YourIcons-Sketch.ttf +0 -0
- package/dist/fonts/YourIcons-Solid-Bold.ttf +0 -0
- package/dist/fonts/YourIcons-Solid-Heavy.ttf +0 -0
- package/dist/fonts/YourIcons-Solid-Light.ttf +0 -0
- package/dist/fonts/YourIcons-Solid-Thin.ttf +0 -0
- package/dist/fonts/YourIcons-Solid.ttf +0 -0
- package/dist/fonts/YourIcons-Thin.ttf +0 -0
- package/dist/fonts/YourIcons.ttf +0 -0
- package/dist/ios/YourIcons.swift +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,16 +1,216 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://youricons-3af51.web.app">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://youricons-3af51.web.app/assets/logo-dk.svg" />
|
|
5
|
+
<img src="https://youricons-3af51.web.app/assets/logo.svg" alt="youricons" width="240" />
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
2
9
|
|
|
3
|
-
|
|
10
|
+
<h1 align="center">youricons-native</h1>
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
<p align="center">
|
|
13
|
+
Los iconos de <a href="https://www.npmjs.com/package/youricons">youricons</a> para <b>Android</b>, <b>iOS</b> y <b>React Native en modo fuente</b>.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://www.npmjs.com/package/youricons-native"><img src="https://img.shields.io/npm/v/youricons-native?color=E8078F&label=npm" alt="versión en npm" /></a>
|
|
18
|
+
<a href="https://github.com/cirilojesus/youricons/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/youricons-native?color=25264F&label=licencia" alt="licencia MIT" /></a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="https://youricons-3af51.web.app/assets/readme/iconos.svg" alt="Algunos iconos de youricons" width="100%" />
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
## ¿Es este el paquete que necesitas?
|
|
26
|
+
|
|
27
|
+
| Vas a usarlo en… | Usa |
|
|
28
|
+
|---|---|
|
|
29
|
+
| Android nativo (Kotlin, Jetpack Compose, vistas XML) | **`youricons-native`** (este) |
|
|
30
|
+
| iOS nativo (Swift, SwiftUI, UIKit) | **`youricons-native`** (este) |
|
|
31
|
+
| React Native **como fuente** (`mode="font"`) | [`youricons`](https://www.npmjs.com/package/youricons) + **`youricons-native`** |
|
|
32
|
+
| React Native como SVG (lo normal) | solo [`youricons`](https://www.npmjs.com/package/youricons) + `react-native-svg` |
|
|
33
|
+
| Web, React, Vue, Angular | solo [`youricons`](https://www.npmjs.com/package/youricons) |
|
|
34
|
+
|
|
35
|
+
## Qué trae
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
dist/
|
|
39
|
+
├── fonts/ 32 fuentes TTF (iOS y React Native)
|
|
40
|
+
│ ├── YourIcons.ttf outline
|
|
41
|
+
│ ├── YourIcons-Bold.ttf outline con grosor bold (también -Thin, -Light, -Heavy)
|
|
42
|
+
│ ├── YourIcons-Solid*.ttf solid (y gradient)
|
|
43
|
+
│ ├── YourIcons-Pixel*.ttf, -Sketch*, -Ink*, -Bubble*
|
|
44
|
+
│ ├── YourIcons-Duotone.ttf segunda capa de duotone
|
|
45
|
+
│ └── YourIcons-Shine.ttf brillo de bubble y 3d
|
|
46
|
+
├── android/
|
|
47
|
+
│ ├── res/drawable/yi_*.xml un vector drawable por icono
|
|
48
|
+
│ ├── res/font/youricons*.ttf las mismas fuentes, con nombres válidos en Android
|
|
49
|
+
│ ├── YourIcons.kt constantes de cada icono (YourIcons.HOME)
|
|
50
|
+
│ └── YourIconsCompose.kt YiFontIcon para Jetpack Compose (opcional)
|
|
51
|
+
└── ios/
|
|
52
|
+
├── YourIcons.xcassets un SVG vectorial por icono (se puede colorear)
|
|
53
|
+
└── YourIcons.swift enum YourIcon, YourIconView y extensiones de Font/UIFont
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
No hace falta copiarlo todo: llévate solo los iconos y las fuentes que vayas a usar.
|
|
57
|
+
|
|
58
|
+
## Descargar
|
|
59
|
+
|
|
60
|
+
En un proyecto con npm (React Native):
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm i youricons-native
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
En un proyecto Android o iOS que no usa npm, descarga el paquete y descomprímelo:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm pack youricons-native # descarga youricons-native-<versión>.tgz
|
|
70
|
+
tar -xzf youricons-native-*.tgz # los archivos quedan en package/dist/
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
También puedes bajar archivos sueltos desde el CDN, por ejemplo
|
|
74
|
+
`https://cdn.jsdelivr.net/npm/youricons-native/dist/fonts/YourIcons.ttf`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Android
|
|
79
|
+
|
|
80
|
+
**1. Copia los archivos** a tu módulo (`app/src/main/`):
|
|
81
|
+
|
|
82
|
+
| De `dist/android/` | A | Para |
|
|
83
|
+
|---|---|---|
|
|
84
|
+
| `res/drawable/yi_*.xml` | `res/drawable/` | iconos como imagen vectorial (copia solo los que uses) |
|
|
85
|
+
| `res/font/youricons*.ttf` | `res/font/` | iconos como fuente |
|
|
86
|
+
| `YourIcons.kt` | junto a tu código Kotlin | constantes `YourIcons.HOME`… |
|
|
87
|
+
| `YourIconsCompose.kt` | junto a tu código Kotlin | `YiFontIcon` para Compose (opcional) |
|
|
88
|
+
|
|
89
|
+
**2. En `YourIconsCompose.kt`** añade, debajo de `package com.youricons`, el import del `R` de tu app (por ejemplo
|
|
90
|
+
`import com.miempresa.miapp.R`). Lo necesita para encontrar las fuentes en `R.font`.
|
|
91
|
+
|
|
92
|
+
**3. Úsalos:**
|
|
93
|
+
|
|
94
|
+
```kotlin
|
|
95
|
+
// Jetpack Compose: imagen vectorial
|
|
96
|
+
Icon(painterResource(R.drawable.yi_home), contentDescription = "Inicio")
|
|
97
|
+
|
|
98
|
+
// Jetpack Compose: fuente, con estilos y grosores
|
|
99
|
+
YiFontIcon(YourIcons.HOME, size = 24.sp)
|
|
100
|
+
YiFontIcon(YourIcons.HEART, variant = YiVariant.Solid, weight = YiWeight.Bold, color = Color.Red)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```xml
|
|
104
|
+
<!-- Vistas XML -->
|
|
105
|
+
<ImageView
|
|
106
|
+
android:layout_width="24dp"
|
|
107
|
+
android:layout_height="24dp"
|
|
108
|
+
android:src="@drawable/yi_home"
|
|
109
|
+
app:tint="?attr/colorPrimary" />
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Nombres: `home` → `R.drawable.yi_home` y `YourIcons.HOME`; `arrow-left` → `R.drawable.yi_arrow_left` y
|
|
113
|
+
`YourIcons.ARROW_LEFT`.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## iOS
|
|
118
|
+
|
|
119
|
+
**1. Arrastra a Xcode** (marca *Copy items if needed* y tu *target*):
|
|
120
|
+
|
|
121
|
+
| Archivo | Para |
|
|
122
|
+
|---|---|
|
|
123
|
+
| `dist/ios/YourIcons.xcassets` | iconos como imagen vectorial |
|
|
124
|
+
| `dist/fonts/*.ttf` | iconos como fuente (solo las que uses) |
|
|
125
|
+
| `dist/ios/YourIcons.swift` | `YourIcon`, `YourIconView` y las fuentes |
|
|
126
|
+
|
|
127
|
+
**2. Registra las fuentes** en el `Info.plist`, en *Fonts provided by application* (`UIAppFonts`), con el nombre de
|
|
128
|
+
cada archivo: `YourIcons.ttf`, `YourIcons-Solid.ttf`…
|
|
129
|
+
|
|
130
|
+
**3. Úsalos:**
|
|
131
|
+
|
|
132
|
+
```swift
|
|
133
|
+
// SwiftUI: imagen vectorial
|
|
134
|
+
YourIcon.home.image
|
|
135
|
+
.foregroundStyle(.blue)
|
|
136
|
+
|
|
137
|
+
// SwiftUI: fuente, con los 10 estilos
|
|
138
|
+
YourIconView(.home, size: 24)
|
|
139
|
+
YourIconView(.heart, size: 32, variant: .solid, weight: .bold, color: .pink)
|
|
140
|
+
|
|
141
|
+
// UIKit
|
|
142
|
+
label.font = .yourIcons(size: 24)
|
|
143
|
+
label.text = YourIcon.home.glyph
|
|
144
|
+
imageView.image = UIImage(named: YourIcon.home.assetName)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Nombres: `home` → `YourIcon.home`; `arrow-left` → `YourIcon.arrowLeft`.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## React Native (modo fuente)
|
|
152
|
+
|
|
153
|
+
Para usar los iconos como SVG en React Native **no necesitas este paquete**: basta con `youricons` y
|
|
154
|
+
`react-native-svg`. Este paquete solo hace falta para `mode="font"`.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npm i youricons youricons-native
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**React Native CLI:** crea `react-native.config.js` en la raíz de tu app:
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
module.exports = { assets: ['./node_modules/youricons-native/dist/fonts'] };
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npx react-native-asset # copia las fuentes a Android y las registra en iOS
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Después vuelve a compilar la app (`npx react-native run-android` o `run-ios`).
|
|
171
|
+
|
|
172
|
+
**Expo:** carga las fuentes que vayas a usar, con exactamente estos nombres:
|
|
173
|
+
|
|
174
|
+
```jsx
|
|
175
|
+
import { useFonts } from 'expo-font';
|
|
176
|
+
|
|
177
|
+
const [ready] = useFonts({
|
|
178
|
+
'YourIcons': require('youricons-native/dist/fonts/YourIcons.ttf'),
|
|
179
|
+
'YourIcons-Solid': require('youricons-native/dist/fonts/YourIcons-Solid.ttf'),
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Y úsalos:**
|
|
184
|
+
|
|
185
|
+
```jsx
|
|
186
|
+
import { YIcon } from 'youricons/react-native';
|
|
187
|
+
|
|
188
|
+
<YIcon name="home" size={24} mode="font" />
|
|
189
|
+
<YIcon name="heart" variant="solid" weight="bold" color="crimson" mode="font" />
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
| Estilo | Fuentes que necesita |
|
|
6
193
|
|---|---|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
194
|
+
| outline, shadow, neon | `YourIcons` (y `-Thin`, `-Light`, `-Bold`, `-Heavy` si cambias el grosor) |
|
|
195
|
+
| solid, gradient | `YourIcons-Solid` (+ grosores) |
|
|
196
|
+
| duotone | `YourIcons` + `YourIcons-Duotone` |
|
|
197
|
+
| pixel, sketch, ink | `YourIcons-Pixel`, `YourIcons-Sketch`, `YourIcons-Ink` (+ grosores) |
|
|
198
|
+
| bubble, 3d | `YourIcons-Bubble` (+ grosores) + `YourIcons-Shine` |
|
|
199
|
+
|
|
200
|
+
## Problemas frecuentes
|
|
201
|
+
|
|
202
|
+
- **Sale un cuadrado o nada en vez del icono:** la fuente no está cargada. En React Native, ejecuta
|
|
203
|
+
`npx react-native-asset` y vuelve a compilar (recargar no basta). En Expo, revisa que el nombre en `useFonts` sea
|
|
204
|
+
exacto. En iOS, revisa que la fuente esté en el target y en `UIAppFonts`.
|
|
205
|
+
- **Android: «Unresolved reference: R»:** falta el import del `R` de tu app en `YourIconsCompose.kt` (paso 2).
|
|
206
|
+
- **Las esquinas no cambian:** como fuente los iconos tienen siempre las esquinas redondeadas. Para cambiarlas,
|
|
207
|
+
usa los iconos como SVG con `youricons`.
|
|
10
208
|
|
|
11
|
-
|
|
12
|
-
`module.exports = { assets: ['./node_modules/youricons-native/dist/fonts'] };` y `npx react-native-asset`.
|
|
13
|
-
Con Expo: `useFonts({ YourIcons: require('youricons-native/dist/fonts/YourIcons.ttf') })`.
|
|
14
|
-
Para el modo SVG (por defecto) no hace falta este paquete.
|
|
209
|
+
---
|
|
15
210
|
|
|
16
|
-
|
|
211
|
+
<p align="center">
|
|
212
|
+
<a href="https://youricons-3af51.web.app">Ver todos los iconos</a> ·
|
|
213
|
+
<a href="https://www.npmjs.com/package/youricons">youricons</a> ·
|
|
214
|
+
<a href="https://github.com/cirilojesus/youricons">GitHub</a> ·
|
|
215
|
+
Licencia MIT
|
|
216
|
+
</p>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// youricons v0.1.
|
|
1
|
+
// youricons v0.1.1 - generado automáticamente, no editar.
|
|
2
2
|
// Uso (Compose): YiFontIcon(YourIcons.HOME, variant = YiVariant.Solid, weight = YiWeight.Bold) (ver YourIconsCompose.kt)
|
|
3
3
|
// Uso (SVG): Icon(painterResource(R.drawable.yi_home), contentDescription = null)
|
|
4
4
|
package com.youricons
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// Helper opcional para Jetpack Compose. Copia este archivo junto a res/font/youricons*.ttf
|
|
2
|
+
// IMPORTANTE: usa las fuentes de tu app (R.font...). Añade debajo de "package" el import del R de tu app,
|
|
3
|
+
// por ejemplo: import com.miempresa.miapp.R (o cambia "package com.youricons" por el paquete de tu app).
|
|
2
4
|
package com.youricons
|
|
3
5
|
|
|
4
6
|
import androidx.compose.foundation.layout.Box
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/fonts/YourIcons.ttf
CHANGED
|
Binary file
|
package/dist/ios/YourIcons.swift
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// youricons v0.1.
|
|
1
|
+
// youricons v0.1.1 - generado automáticamente, no editar.
|
|
2
2
|
// 1. Añade las fuentes de youricons-native/dist/fonts (*.ttf) al target y regístralas en Info.plist (UIAppFonts).
|
|
3
3
|
// 2. SwiftUI (fuente): YourIcon.home.text.font(.yourIcons(size: 24, variant: .solid, weight: .bold))
|
|
4
4
|
// SwiftUI (SVG): YourIcon.home.image (requiere YourIcons.xcassets)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "youricons-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Recursos nativos de youricons: fuentes TTF (iOS y React Native en modo fuente), Android (vector drawables, fuentes, Kotlin/Compose) e iOS (xcassets, Swift).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/cirilojesus/youricons#readme",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"youricons"
|
|
23
23
|
],
|
|
24
24
|
"exports": {
|
|
25
|
+
"./dist/*": "./dist/*",
|
|
25
26
|
"./*": "./dist/*",
|
|
26
27
|
"./package.json": "./package.json"
|
|
27
28
|
},
|