@wecareu/icons 1.2.2 → 1.3.0

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/dist/index.js CHANGED
@@ -614,7 +614,7 @@ var ICONS = {
614
614
 
615
615
  // src/Icon.tsx
616
616
  var import_jsx_runtime70 = require("react/jsx-runtime");
617
- var Icon = ({ name, size, color, testID = "icon", ...rest }) => {
617
+ function Icon({ color, name, size, testID = "icon", ...rest }) {
618
618
  const theme = (0, import_theme.useTheme)();
619
619
  const Cmp = ICONS[name];
620
620
  const { fill: fillProp, stroke: strokeProp, ...svgRest } = rest;
@@ -635,7 +635,7 @@ var Icon = ({ name, size, color, testID = "icon", ...rest }) => {
635
635
  ...svgRest
636
636
  }
637
637
  );
638
- };
638
+ }
639
639
 
640
640
  // src/FlagIcon.tsx
641
641
  var import_react_native = require("react-native");
package/dist/index.mjs CHANGED
@@ -577,7 +577,7 @@ var ICONS = {
577
577
 
578
578
  // src/Icon.tsx
579
579
  import { jsx as jsx70 } from "react/jsx-runtime";
580
- var Icon = ({ name, size, color, testID = "icon", ...rest }) => {
580
+ function Icon({ color, name, size, testID = "icon", ...rest }) {
581
581
  const theme = useTheme();
582
582
  const Cmp = ICONS[name];
583
583
  const { fill: fillProp, stroke: strokeProp, ...svgRest } = rest;
@@ -598,7 +598,7 @@ var Icon = ({ name, size, color, testID = "icon", ...rest }) => {
598
598
  ...svgRest
599
599
  }
600
600
  );
601
- };
601
+ }
602
602
 
603
603
  // src/FlagIcon.tsx
604
604
  import { Image as Image2, Platform, Text } from "react-native";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wecareu/icons",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Sistema de ícones SVG para WeCareU Design System",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -41,6 +41,7 @@
41
41
  "license": "UNLICENSED",
42
42
  "devDependencies": {
43
43
  "@svgr/core": "^8.1.0",
44
+ "@wecareu/theme": "*",
44
45
  "@svgr/plugin-jsx": "^8.1.0",
45
46
  "@svgr/plugin-svgo": "^8.1.0",
46
47
  "@types/react": "^18.2.0",
package/src/FlagIcon.tsx CHANGED
@@ -1,5 +1,3 @@
1
- import React from 'react'
2
-
3
1
  import { Image, Platform, Text } from 'react-native'
4
2
 
5
3
  interface FlagIconProps {
@@ -19,7 +17,7 @@ function countryCodeToEmoji(code: string): string {
19
17
  .join('')
20
18
  }
21
19
 
22
- export function FlagIcon({ countryCode, size = 20 }: FlagIconProps): React.ReactElement {
20
+ export function FlagIcon({ countryCode, size = 20 }: FlagIconProps) {
23
21
  const code = countryCode.toLowerCase().slice(0, 2)
24
22
 
25
23
  if (Platform.OS === 'web') {
package/src/Icon.tsx CHANGED
@@ -1,15 +1,16 @@
1
- import React from 'react';
2
1
  import type { SvgProps } from 'react-native-svg';
2
+
3
3
  import { useTheme } from '@wecareu/theme';
4
+
4
5
  import { ICONS, type IconName } from './icons-map';
5
6
 
6
7
  type Props = SvgProps & {
8
+ color?: string;
7
9
  name: IconName;
8
10
  size?: number;
9
- color?: string;
10
11
  };
11
12
 
12
- export const Icon: React.FC<Props> = ({ name, size, color, testID = 'icon', ...rest }) => {
13
+ export function Icon({ color, name, size, testID = 'icon', ...rest }: Props) {
13
14
  const theme = useTheme();
14
15
  const Cmp = ICONS[name];
15
16
 
@@ -33,7 +34,7 @@ export const Icon: React.FC<Props> = ({ name, size, color, testID = 'icon', ...r
33
34
  {...svgRest}
34
35
  />
35
36
  );
36
- };
37
+ }
37
38
 
38
39
  export type { IconName };
39
40
  export { ICONS };
@@ -21,7 +21,7 @@ export function Lottie({
21
21
  speed = 1,
22
22
  style,
23
23
  testID
24
- }: LottieProps): JSX.Element {
24
+ }: LottieProps) {
25
25
  const source = LOTTIE_ANIMATIONS[name];
26
26
 
27
27
  const sizeStyle = size != null ? { height: size, width: size } : {};
@@ -1,5 +1,5 @@
1
1
  import lottie, { AnimationItem } from 'lottie-web';
2
- import React, { useEffect, useRef } from 'react';
2
+ import { useEffect, useRef } from 'react';
3
3
  import type { ViewStyle } from 'react-native';
4
4
  import { View } from 'react-native';
5
5
 
@@ -24,7 +24,7 @@ export function Lottie({
24
24
  loop = true,
25
25
  speed = 1,
26
26
  testID
27
- }: LottieProps): JSX.Element {
27
+ }: LottieProps) {
28
28
  const containerRef = useRef<HTMLDivElement>(null);
29
29
  const animationRef = useRef<AnimationItem | null>(null);
30
30
  const source = LOTTIE_ANIMATIONS[name];