@wecareu/icons
v1.0.9
Published
Sistema de ícones SVG para WeCareU Design System
Maintainers
Readme
@wecareu/icons
Sistema de ícones SVG e animações Lottie para WeCareU Design System.
Instalação
npm install @wecareu/icons react-native-svg lottie-react-nativeUso
Ícones SVG
import { Icon } from '@wecareu/icons';
// Uso básico
<Icon name="home" />
// Com tamanho e cor personalizados
<Icon name="heart" size={24} color="#ff0000" />
// Com outras props do SVG
<Icon name="search" width={32} height={32} fill="currentColor" />Animações Lottie
import { Lottie } from '@wecareu/icons';
// Uso básico
<Lottie name="dots" />
// Com tamanho e opções personalizadas
<Lottie
name="notification"
size={200}
autoPlay={true}
loop={true}
speed={1.5}
/>Ícones Disponíveis
O pacote inclui 69 ícones SVG otimizados para React Native:
arrowDown,arrowLeft,arrowRight,arrowSpin,arrowUpavatar,avatarFillbank,bookProfile,bot,busStopcalendar,camera,car,card,chatClosechevronDown,chevronLeft,chevronRight,chevronUpclose,config,correct,crowndenounce,diamond,distance,dryeredit,eyeOff,eyeOnfilter,fingerPrint,fingernailheart,heartFilled,homeimage,imageGallery,informationlist,listAlt,location,lock,mailmaskSad,menu,money,money1,moneyCardnotificationOff,notificationOnpaperPlane,pix,plussearch,share,star,starFilled,starssupportCenter,tag,time,trash,uploaduser,userBlock,userFilled,walk
Animações Lottie Disponíveis
dots- Animação de pontos de carregamentolocations- Animação de localização/mapanotification- Animação de notificação
Props
Icon (SVG)
| Prop | Tipo | Padrão | Descrição |
|------|------|--------|-----------|
| name | IconName | - | Nome do ícone (obrigatório) |
| size | number | - | Tamanho do ícone (aplica width e height) |
| color | string | - | Cor do ícone (aplica fill) |
| ...rest | SvgProps | - | Outras props do componente SVG |
Lottie (Animações)
| Prop | Tipo | Padrão | Descrição |
|------|------|--------|-----------|
| name | LottieAnimationName | - | Nome da animação (obrigatório) |
| size | number | - | Tamanho da animação (aplica width e height) |
| autoPlay | boolean | true | Inicia automaticamente |
| loop | boolean | true | Loop infinito |
| speed | number | 1 | Velocidade da animação |
| style | ViewStyle | - | Estilos customizados |
| testID | string | - | ID para testes |
Desenvolvimento
Gerar Ícones SVG
Para gerar os componentes TSX a partir dos arquivos SVG:
npm run icons:genGerar Mapa Lottie
Para gerar o mapa de animações Lottie:
npm run lottie:genBuild
Para fazer build completo do pacote (gera ícones, mapa Lottie e faz build):
npm run buildEstrutura
src/
├── assets/
│ ├── svg/ # Arquivos SVG originais
│ └── lottie/ # Arquivos JSON Lottie
├── generated/ # Componentes TSX auto-gerados
├── icons-map.ts # Mapa de ícones SVG e tipos
├── lottie-map.ts # Mapa de animações Lottie (auto-gerado)
├── Icon.tsx # Componente de ícones SVG
├── Lottie.tsx # Componente de animações Lottie
└── index.tsx # Exports públicosCaracterísticas
- ✅ Build automático: SVGs são convertidos em componentes TSX usando @svgr/core
- ✅ Animações Lottie: Suporte completo para animações JSON Lottie
- ✅ TypeScript: Tipagem completa com
IconName,LottieAnimationNamee props - ✅ Tree-shaking: Suporte completo para tree-shaking
- ✅ React Native: Otimizado para React Native
- ✅ Sem configuração: Não requer transformers adicionais
- ✅ Acessibilidade: Suporte nativo a props de acessibilidade
Dependências
react(peer dependency)react-native(peer dependency)react-native-svg(peer dependency)lottie-react-native(peer dependency, >= 6.0.0)
Licença
UNLICENSED
