decathlon-ui 0.3.10 → 0.3.13

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":"input.component.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA6B,cAAc,EAAQ,MAAM,cAAc,CAAC;AAK/E,KAAK,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE5D,UAAU,UAAW,SAAQ,cAAc;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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;AA2KD,eAAO,MAAM,KAAK,wCAA6B,CAAC"}
1
+ {"version":3,"file":"input.component.d.ts","sourceRoot":"","sources":["../../../src/components/input/input.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA6B,cAAc,EAAQ,MAAM,cAAc,CAAC;AAK/E,KAAK,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE5D,UAAU,UAAW,SAAQ,cAAc;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,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;AAwKD,eAAO,MAAM,KAAK,wCAA6B,CAAC"}
@@ -87,10 +87,7 @@ const InputComponent = ({ label, placeholder, error, value, disabled = false, ma
87
87
  inputRange: [0, 1],
88
88
  outputRange: [1, 2],
89
89
  });
90
- 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: [
91
- styles.labelText,
92
- disabled && styles.disabledText,
93
- ], accessibilityRole: "text", children: label }) })), _jsx(Animated.View, { style: [
90
+ 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: [
94
91
  styles.inputContainer,
95
92
  error && styles.inputError,
96
93
  disabled && styles.inputDisabled,
@@ -24,9 +24,8 @@ export declare const useInputStyles: () => {
24
24
  alignItems: "center";
25
25
  backgroundColor: string;
26
26
  borderColor: "#B3BAC3";
27
- paddingVertical: 20;
28
27
  paddingHorizontal: 16;
29
- maxHeight: number;
28
+ height: number;
30
29
  };
31
30
  input: {
32
31
  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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8D1B,CAAC"}
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"}
@@ -28,9 +28,9 @@ export const useInputStyles = () => {
28
28
  alignItems: "center",
29
29
  backgroundColor: "transparent",
30
30
  borderColor: theme.colors.borderPrimary,
31
- paddingVertical: theme.spacing.mmd2,
31
+ // paddingVertical: theme.spacing.mmd2,
32
32
  paddingHorizontal: theme.spacing.md,
33
- maxHeight: 64,
33
+ height: 64,
34
34
  },
35
35
  input: {
36
36
  flex: 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;AAO/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAkJ7D,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;AAqJ7D,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
@@ -3,8 +3,9 @@ import * as React from "react";
3
3
  import { Image, Text, TouchableOpacity, View } from "react-native";
4
4
  import { HeartFillIcon, HeartIcon, StarIcon } from "../../icons";
5
5
  import { Badge } from "../badge";
6
+ import { Loading } from "../loading";
6
7
  import { useProductCardStyles } from "./product-card.styles";
7
- const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName, rating, reviewCount, price, isFavorite = false, onFavoritePress, onPress, testID, width, flags = [], showFavoriteButton = true, showRating = true, }) => {
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
9
  const styles = useProductCardStyles(variant, width);
9
10
  const handleFavoritePress = React.useCallback((e) => {
10
11
  e.stopPropagation();
@@ -14,7 +15,7 @@ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName,
14
15
  (flags === null || flags === void 0 ? void 0 : flags.length) > 0 &&
15
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
17
  isFavorite ? styles.favoriteButton : styles.unfavoriteButton,
17
- ], onPress: handleFavoritePress, accessibilityLabel: isFavorite ? "Remover dos favoritos" : "Adicionar aos favoritos", accessibilityRole: "button", children: 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 }) })] }))] })), [
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 }) })] }))] })), [
18
19
  brand,
19
20
  handleFavoritePress,
20
21
  imageUrl,
@@ -19,5 +19,6 @@ export interface ProductCardProps {
19
19
  }[];
20
20
  showFavoriteButton?: boolean;
21
21
  showRating?: boolean;
22
+ isLoadingFavorite?: boolean;
22
23
  }
23
24
  //# sourceMappingURL=product-card.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
1
+ {"version":3,"file":"product-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"select.component.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAiF7C,eAAO,MAAM,MAAM,yCAA8B,CAAC"}
1
+ {"version":3,"file":"select.component.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA8E7C,eAAO,MAAM,MAAM,yCAA8B,CAAC"}
@@ -23,18 +23,11 @@ const SelectComponent = ({ label, placeholder, error, value, disabled = false, o
23
23
  setTimeout(() => setIsFocused(false), 200);
24
24
  }
25
25
  };
26
- return (_jsxs(View, { style: styles.container, accessible: true, testID: testID, accessibilityLabel: `${label} select field`, children: [_jsx(View, { style: styles.labelWrapper, children: _jsx(Text, { style: [
27
- styles.labelText,
28
- disabled && styles.disabledText
29
- ], accessibilityRole: "text", children: label }) }), _jsx(TouchableOpacity, { onPress: handlePress, disabled: disabled, activeOpacity: 0.7, children: _jsxs(Animated.View, { style: [
26
+ return (_jsxs(View, { style: styles.container, accessible: true, testID: testID, accessibilityLabel: `${label} select field`, children: [_jsx(View, { style: styles.labelWrapper, children: _jsx(Text, { style: [styles.labelText, disabled && styles.disabledText], accessibilityRole: "text", children: label }) }), _jsx(TouchableOpacity, { onPress: handlePress, disabled: disabled, activeOpacity: 0.7, children: _jsxs(Animated.View, { style: [
30
27
  styles.selectContainer,
31
28
  error && styles.selectError,
32
29
  disabled && styles.selectDisabled,
33
- ], children: [_jsx(Text, { style: [
34
- styles.selectText,
35
- !value && styles.placeholderText,
36
- disabled && styles.selectTextDisabled,
37
- ], children: value || placeholder }), _jsx(View, { style: styles.chevronContainer, children: _jsx(ChevronDownIcon, { width: 20, height: 20, color: disabled ? "#A4ADB7" : "#15181B" }) })] }) }), error && _jsx(ErrorMessage, { message: error })] }));
30
+ ], children: [_jsx(Text, { style: [styles.selectText, disabled && styles.selectTextDisabled], children: value || placeholder }), _jsx(View, { style: styles.chevronContainer, children: _jsx(ChevronDownIcon, { width: 20, height: 20, color: disabled ? "#A4ADB7" : "#15181B" }) })] }) }), error && _jsx(ErrorMessage, { message: error })] }));
38
31
  };
39
32
  export const Select = React.memo(SelectComponent);
40
33
  Select.displayName = "Select";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decathlon-ui",
3
- "version": "0.3.10",
3
+ "version": "0.3.13",
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",