decathlon-ui 0.3.33 → 0.3.34

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.
@@ -1 +1 @@
1
- {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AAsC5D,eAAO,MAAM,MAAM,yCAA8B,CAAC"}
1
+ {"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AAuD5D,eAAO,MAAM,MAAM,yCAA8B,CAAC"}
@@ -3,6 +3,7 @@ import React from "react";
3
3
  import { Text, TouchableOpacity } from "react-native";
4
4
  import { useTheme } from "../../themes";
5
5
  import { Loading } from "../loading";
6
+ import { ButtonVariant } from "./button.props";
6
7
  import { useButtonStyles } from "./button.styles";
7
8
  const ButtonComponent = ({ label, loading, variant, fullWidth, size, disabled, ...rest }) => {
8
9
  const buttonStyle = useButtonStyles({
@@ -13,7 +14,19 @@ const ButtonComponent = ({ label, loading, variant, fullWidth, size, disabled, .
13
14
  });
14
15
  const { icon: Icon } = rest;
15
16
  const { colors } = useTheme();
16
- return (_jsx(TouchableOpacity, { style: [buttonStyle.container, disabled && buttonStyle.disabled], ...rest, children: loading ? (_jsx(Loading, { size: 28, containerStyle: { padding: 0 } })) : (_jsxs(_Fragment, { children: [rest.icon && _jsx(Icon, { stroke: 0.5, color: buttonStyle.icon.color }), _jsx(Text, { style: buttonStyle.buttonText, children: label })] })) }));
17
+ const variantsLoadingColors = {
18
+ [ButtonVariant.primary]: colors.white,
19
+ [ButtonVariant.primaryInverted]: colors.black,
20
+ [ButtonVariant.secondary]: colors.black,
21
+ [ButtonVariant.secondaryInverted]: colors.white,
22
+ [ButtonVariant.tertiary]: colors.textActionHover,
23
+ [ButtonVariant.tertiaryInverted]: colors.blue1,
24
+ [ButtonVariant.converted]: colors.white,
25
+ [ButtonVariant.danger]: colors.white,
26
+ [ButtonVariant.dangerInverted]: colors.backgroundError,
27
+ [ButtonVariant.dangerOutline]: colors.textError,
28
+ };
29
+ return (_jsx(TouchableOpacity, { style: [buttonStyle.container, disabled && buttonStyle.disabled], ...rest, children: loading ? (_jsx(Loading, { size: 28, containerStyle: { padding: 0 }, color: variantsLoadingColors[variant] })) : (_jsxs(_Fragment, { children: [rest.icon && _jsx(Icon, { stroke: 0.5, color: buttonStyle.icon.color }), _jsx(Text, { style: buttonStyle.buttonText, children: label })] })) }));
17
30
  };
18
31
  export const Button = React.memo(ButtonComponent);
19
32
  Button.displayName = "Button";
@@ -1 +1 @@
1
- {"version":3,"file":"loading.component.d.ts","sourceRoot":"","sources":["../../../src/components/loading/loading.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAwC/C,eAAO,MAAM,OAAO,0CAA+B,CAAC;AAEpD,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"loading.component.d.ts","sourceRoot":"","sources":["../../../src/components/loading/loading.component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAyC/C,eAAO,MAAM,OAAO,0CAA+B,CAAC;AAEpD,eAAe,OAAO,CAAC"}
@@ -5,11 +5,11 @@ import { View } from "react-native";
5
5
  import LoadingAnimation from "../../assets/animations/loading-animation.json";
6
6
  import { useLoadingStyles } from "./loading.styles";
7
7
  const LoadingComponent = ({ source, isDotLottie = false, // TODO: trabalhar nisso depois para aceitar dotLottie
8
- autoPlay = true, loop = true, speed = 1, containerStyle, style, onAnimationFinish, size = 100, }) => {
8
+ autoPlay = true, loop = true, speed = 1, containerStyle, style, color = "#3643BA", onAnimationFinish, size = 100, }) => {
9
9
  const styles = useLoadingStyles();
10
10
  const containerStyles = React.useMemo(() => [styles.container, { width: size, height: size }, containerStyle], [size, containerStyle, styles.container]);
11
11
  return (_jsx(View, { style: containerStyles, children: _jsx(LottieView, { source: source || LoadingAnimation, style: [styles.animation, style], autoPlay: autoPlay, loop: loop, colorFilters: [
12
- { keypath: "*", color: "#3643BA" }, // muda tudo para azul
12
+ { keypath: "*", color }, // muda tudo para azul
13
13
  ], speed: speed, onAnimationFinish: onAnimationFinish }) }));
14
14
  };
15
15
  export const Loading = React.memo(LoadingComponent);
@@ -20,6 +20,10 @@ export interface LoadingProps {
20
20
  * Velocidade da animação (1 é a velocidade normal)
21
21
  */
22
22
  speed?: number;
23
+ /**
24
+ * Cor da animação
25
+ */
26
+ color?: string;
23
27
  /**
24
28
  * Estilo para o container da animação
25
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"loading.types.d.ts","sourceRoot":"","sources":["../../../src/components/loading/loading.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"loading.types.d.ts","sourceRoot":"","sources":["../../../src/components/loading/loading.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,GAAG,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decathlon-ui",
3
- "version": "0.3.33",
3
+ "version": "0.3.34",
4
4
  "description": "Biblioteca de componentes React Native com Storybook e documentação via GitHub Pages.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",