decathlon-ui 0.3.13 → 0.3.15

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":"action-button.component.d.ts","sourceRoot":"","sources":["../../../src/components/action-button/action-button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAuD/D,eAAO,MAAM,YAAY,+CAAoC,CAAC"}
1
+ {"version":3,"file":"action-button.component.d.ts","sourceRoot":"","sources":["../../../src/components/action-button/action-button.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AA8D/D,eAAO,MAAM,YAAY,+CAAoC,CAAC"}
@@ -4,7 +4,7 @@ import { Text, TouchableOpacity, View } from "react-native";
4
4
  import { ChevronRightIcon, HelpCircleIcon } from "../../icons";
5
5
  import { useTheme } from "../../themes";
6
6
  import { useActionButtonStyles } from "./action-button.styles";
7
- const ActionButtonComponent = ({ label = "Preciso de ajuda", icon, iconSize = 24, iconColor, iconBackgroundColor, onPress, disabled = false, testID, }) => {
7
+ const ActionButtonComponent = ({ label = "Preciso de ajuda", icon, iconSize = 24, iconColor, iconBackgroundColor, onPress, disabled = false, testID, hasChevron = false, chevronColor, }) => {
8
8
  const styles = useActionButtonStyles();
9
9
  const { colors } = useTheme();
10
10
  const finalIconColor = iconColor || colors.backgroundAction1;
@@ -22,7 +22,7 @@ const ActionButtonComponent = ({ label = "Preciso de ajuda", icon, iconSize = 24
22
22
  return (_jsxs(TouchableOpacity, { style: [styles.container, disabled && styles.disabled], onPress: onPress, disabled: disabled, testID: testID, accessibilityRole: "button", accessibilityLabel: label, accessibilityState: { disabled }, children: [_jsxs(View, { style: styles.contentContainer, children: [icon && (_jsx(View, { style: [
23
23
  styles.iconContainer,
24
24
  iconBackgroundColor && { backgroundColor: iconBackgroundColor },
25
- ], children: iconElement })), _jsx(Text, { style: styles.label, children: label })] }), _jsx(ChevronRightIcon, { size: 20, color: colors.textTertiary })] }));
25
+ ], children: iconElement })), _jsx(Text, { style: styles.label, children: label })] }), hasChevron && (_jsx(ChevronRightIcon, { size: 20, color: chevronColor || colors.textTertiary }))] }));
26
26
  };
27
27
  export const ActionButton = React.memo(ActionButtonComponent);
28
28
  ActionButton.displayName = "ActionButton";
@@ -6,7 +6,7 @@ export declare const useActionButtonStyles: () => {
6
6
  paddingVertical: 16;
7
7
  paddingHorizontal: 16;
8
8
  borderWidth: number;
9
- borderColor: "#B3BAC3";
9
+ borderColor: "#D9DDE1";
10
10
  width: "100%";
11
11
  };
12
12
  disabled: {
@@ -11,7 +11,7 @@ export const useActionButtonStyles = () => {
11
11
  paddingVertical: spacing.md,
12
12
  paddingHorizontal: spacing.md,
13
13
  borderWidth: 1,
14
- borderColor: colors.borderPrimary,
14
+ borderColor: colors.borderSecondary,
15
15
  width: "100%",
16
16
  },
17
17
  disabled: {
@@ -33,5 +33,13 @@ export interface ActionButtonProps {
33
33
  * ID para testes
34
34
  */
35
35
  testID?: string;
36
+ /**
37
+ * Indica se o botão deve ter chevron
38
+ */
39
+ hasChevron?: boolean;
40
+ /**
41
+ * customiza a cor do chevron
42
+ */
43
+ chevronColor?: string;
36
44
  }
37
45
  //# sourceMappingURL=action-button.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-button.types.d.ts","sourceRoot":"","sources":["../../../src/components/action-button/action-button.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC;IACrD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"action-button.types.d.ts","sourceRoot":"","sources":["../../../src/components/action-button/action-button.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC;IACrD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"input.component.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.component.tsx"],"names":[],"mappings":"AAAA,O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IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkKD,eAAO,MAAM,KAAK,wCAA6B,CAAC"}
@@ -83,16 +83,11 @@ const InputComponent = ({ label, placeholder, error, value, disabled = false, ma
83
83
  useNativeDriver: false,
84
84
  }).start();
85
85
  }, [isFocused]);
86
- const borderWidth = focusAnimation.interpolate({
87
- inputRange: [0, 1],
88
- outputRange: [1, 2],
89
- });
90
86
  return (_jsxs(View, { style: styles.container, accessible: true, testID: testID, accessibilityLabel: `${label} input field`, children: [label && (_jsx(View, { style: styles.labelWrapper, children: _jsx(Text, { style: [styles.labelText, disabled && styles.disabledText], accessibilityRole: "text", children: label }) })), _jsx(Animated.View, { style: [
91
87
  styles.inputContainer,
92
88
  error && styles.inputError,
93
89
  disabled && styles.inputDisabled,
94
90
  isFocused && styles.inputFocused,
95
- { borderWidth },
96
91
  ], children: _jsx(TextInput, { style: [styles.input, disabled && styles.inputTextDisabled], placeholder: placeholder, value: value, onChangeText: handleChangeText, editable: !disabled, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), accessibilityLabel: label, accessibilityState: {
97
92
  disabled: disabled,
98
93
  }, placeholderTextColor: "#A4ADB7", ...rest }) }), error && _jsx(ErrorMessage, { message: error })] }));
@@ -26,6 +26,7 @@ export declare const useInputStyles: () => {
26
26
  borderColor: "#B3BAC3";
27
27
  paddingHorizontal: 16;
28
28
  height: number;
29
+ borderWidth: number;
29
30
  };
30
31
  input: {
31
32
  flex: number;
@@ -1 +1 @@
1
- {"version":3,"file":"input.styles.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+D1B,CAAC"}
1
+ {"version":3,"file":"input.styles.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgE1B,CAAC"}
@@ -31,6 +31,7 @@ export const useInputStyles = () => {
31
31
  // paddingVertical: theme.spacing.mmd2,
32
32
  paddingHorizontal: theme.spacing.md,
33
33
  height: 64,
34
+ borderWidth: 1,
34
35
  },
35
36
  input: {
36
37
  flex: 1,
@@ -52,7 +53,7 @@ export const useInputStyles = () => {
52
53
  },
53
54
  inputFocused: {
54
55
  borderColor: theme.colors.borderInformation,
55
- borderWidth: 2,
56
+ borderWidth: 1,
56
57
  },
57
58
  cursor: {
58
59
  width: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"product-card.component.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAqJ7D,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
1
+ {"version":3,"file":"product-card.component.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAoJ7D,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
@@ -5,7 +5,7 @@ import { HeartFillIcon, HeartIcon, StarIcon } from "../../icons";
5
5
  import { Badge } from "../badge";
6
6
  import { Loading } from "../loading";
7
7
  import { useProductCardStyles } from "./product-card.styles";
8
- const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName, rating, reviewCount, price, isFavorite = false, onFavoritePress, onPress, testID, width, flags = [], showFavoriteButton = true, showRating = true, isLoadingFavorite = false, }) => {
8
+ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName, rating, reviewCount, price, isFavorite = false, onFavoritePress, onPress, testID, width, flags = [], showRating = true, isLoadingFavorite = false, }) => {
9
9
  const styles = useProductCardStyles(variant, width);
10
10
  const handleFavoritePress = React.useCallback((e) => {
11
11
  e.stopPropagation();
@@ -13,7 +13,7 @@ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName,
13
13
  }, [onFavoritePress]);
14
14
  const renderContent = React.useCallback(() => (_jsxs(View, { style: styles.cardContainer, children: [_jsxs(View, { style: styles.imageContainer, children: [_jsx(Image, { resizeMode: "cover", source: { uri: imageUrl }, style: styles.productImage, accessibilityLabel: `Imagem do produto ${productName}` }), ["grid", "shelf"].includes(variant) &&
15
15
  (flags === null || flags === void 0 ? void 0 : flags.length) > 0 &&
16
- (flags === null || flags === void 0 ? void 0 : flags.map((flag, index) => (_jsx(Badge, { text: flag.text, style: { position: "absolute", top: 0, left: 0 }, icon: flag.icon }, flag.name + index + productName)))), variant === "grid" && showFavoriteButton && (_jsx(TouchableOpacity, { style: [
16
+ (flags === null || flags === void 0 ? void 0 : flags.map((flag, index) => (_jsx(Badge, { text: flag.text, style: { position: "absolute", top: 0, left: 0 }, icon: flag.icon }, flag.name + index + productName)))), isFavorite && (_jsx(TouchableOpacity, { style: [
17
17
  isFavorite ? styles.favoriteButton : styles.unfavoriteButton,
18
18
  ], onPress: handleFavoritePress, accessibilityLabel: isFavorite ? "Remover dos favoritos" : "Adicionar aos favoritos", accessibilityRole: "button", children: isLoadingFavorite ? (_jsx(Loading, { size: 20 })) : isFavorite ? (_jsx(HeartFillIcon, { size: 20, color: "#101010" })) : (_jsx(HeartIcon, { size: 20, color: "#101010" })) }))] }), variant !== "lastViewed" && (_jsxs(View, { style: styles.detailsContainer, children: [_jsxs(View, { style: styles.productInfo, children: [_jsx(Text, { style: styles.brandText, children: brand }), _jsx(View, { style: styles.nameContainer, children: _jsx(Text, { numberOfLines: 3, style: styles.nameText, accessibilityLabel: `Nome do produto: ${productName}`, children: productName }) })] }), variant === "grid" && showRating && (_jsxs(View, { style: styles.ratingContainer, accessibilityLabel: `Avaliação: ${rating} estrelas, ${reviewCount} avaliações`, children: [_jsx(StarIcon, { size: 11, color: "#101010", fill: "#101010" }), _jsxs(View, { style: styles.reviewCountWrapper, children: [_jsx(Text, { style: styles.ratingText, children: rating }), _jsxs(Text, { style: styles.reviewCountText, children: ["(", reviewCount, ")"] })] })] })), _jsx(View, { style: styles.priceContainer, children: _jsx(Text, { style: styles.priceText, accessibilityLabel: `Preço: ${price}`, children: price }) })] }))] })), [
19
19
  brand,
@@ -2,7 +2,7 @@ import type { ProductCardVariant } from "./product-card.types";
2
2
  export declare const useProductCardStyles: (variant?: ProductCardVariant, customWidth?: number) => {
3
3
  cardContainer: {
4
4
  display: "flex";
5
- width: number;
5
+ width: "100%";
6
6
  maxWidth: number;
7
7
  flexDirection: "column";
8
8
  alignItems: "stretch";
@@ -19,8 +19,8 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
19
19
  return StyleSheet.create({
20
20
  cardContainer: {
21
21
  display: "flex",
22
- width: cardWidth,
23
- maxWidth: cardWidth,
22
+ width: "100%",
23
+ maxWidth: 184,
24
24
  flexDirection: "column",
25
25
  alignItems: "stretch",
26
26
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decathlon-ui",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
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",