decathlon-ui 0.3.9 → 0.3.11

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":"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,4 +1,4 @@
1
- import { IconProps } from "../types";
1
+ import { IconProps } from '../types';
2
2
  declare const SvgClubeDecathlon: ({ size, color, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default SvgClubeDecathlon;
4
4
  //# sourceMappingURL=ClubeDecathlon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClubeDecathlon.d.ts","sourceRoot":"","sources":["../../../src/icons/components/ClubeDecathlon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,QAAA,MAAM,iBAAiB,GAAI,2BAIxB,SAAS,4CAcX,CAAC;AACF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"ClubeDecathlon.d.ts","sourceRoot":"","sources":["../../../src/icons/components/ClubeDecathlon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,QAAA,MAAM,iBAAiB,GAAI,2BAIxB,SAAS,4CAAgqB,CAAC;AAC7qB,eAAe,iBAAiB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import Svg, { Path } from "react-native-svg";
3
- const SvgClubeDecathlon = ({ size = 24, color = "#101010", ...props }) => (_jsx(Svg, { width: size, height: size, fill: "none", viewBox: "0 0 21 18", preserveAspectRatio: "xMidYMid meet", ...props, children: _jsx(Path, { d: "M15.051 0.5C8.45491 0.5 0.25 7.37506 0.25 13.073C0.25 16.0158 2.49386 17.5 5.45745 17.5C7.63357 17.5 10.2669 16.6982 12.8072 15.1543V3.78399C12.1298 4.95258 8.94602 9.66106 6.38886 12.1688C5.08489 13.4483 4.05187 14.0028 3.16279 14.0028C2.16363 14.0028 1.68946 13.3204 1.68946 12.3053C1.68946 7.6992 9.38632 1.71124 14.4837 1.71124C16.5836 1.71124 17.9384 2.64952 17.9384 4.47491C17.9384 6.14676 16.8122 8.24511 14.8901 10.1814V13.7042C18.2432 11.0344 20.25 7.63096 20.25 4.88434C20.25 1.99272 18.0146 0.5 15.051 0.5Z", fill: color }) }));
2
+ import Svg, { Path } from 'react-native-svg';
3
+ const SvgClubeDecathlon = ({ size = 24, color = "#101010", ...props }) => _jsx(Svg, { width: size, height: size, fill: "none", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", ...props, children: _jsx(Path, { d: "M15.051 0.5C8.45491 0.5 0.25 7.37506 0.25 13.073C0.25 16.0158 2.49386 17.5 5.45745 17.5C7.63357 17.5 10.2669 16.6982 12.8072 15.1543V3.78399C12.1298 4.95258 8.94602 9.66106 6.38886 12.1688C5.08489 13.4483 4.05187 14.0028 3.16279 14.0028C2.16363 14.0028 1.68946 13.3204 1.68946 12.3053C1.68946 7.6992 9.38632 1.71124 14.4837 1.71124C16.5836 1.71124 17.9384 2.64952 17.9384 4.47491C17.9384 6.14676 16.8122 8.24511 14.8901 10.1814V13.7042C18.2432 11.0344 20.25 7.63096 20.25 4.88434C20.25 1.99272 18.0146 0.5 15.051 0.5Z", fill: "currentColor" }) });
4
4
  export default SvgClubeDecathlon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decathlon-ui",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
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",