decathlon-ui 0.3.24 → 0.3.27

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.
Files changed (78) hide show
  1. package/dist/components/card-picto/card-picto.component.d.ts +3 -0
  2. package/dist/components/card-picto/card-picto.component.d.ts.map +1 -0
  3. package/dist/components/card-picto/card-picto.component.js +17 -0
  4. package/dist/components/card-picto/card-picto.styles.d.ts +27 -0
  5. package/dist/components/card-picto/card-picto.styles.d.ts.map +1 -0
  6. package/dist/components/card-picto/card-picto.styles.js +42 -0
  7. package/dist/components/card-picto/card-picto.types.d.ts +8 -0
  8. package/dist/components/card-picto/card-picto.types.d.ts.map +1 -0
  9. package/dist/components/card-picto/card-picto.types.js +1 -0
  10. package/dist/components/card-picto/index.d.ts +2 -0
  11. package/dist/components/card-picto/index.d.ts.map +1 -0
  12. package/dist/components/card-picto/index.js +1 -0
  13. package/dist/components/card-sport/card-sport.component.d.ts +3 -0
  14. package/dist/components/card-sport/card-sport.component.d.ts.map +1 -0
  15. package/dist/components/card-sport/card-sport.component.js +7 -0
  16. package/dist/components/card-sport/card-sport.styles.d.ts +21 -0
  17. package/dist/components/card-sport/card-sport.styles.d.ts.map +1 -0
  18. package/dist/components/card-sport/card-sport.styles.js +25 -0
  19. package/dist/components/card-sport/card-sport.types.d.ts +6 -0
  20. package/dist/components/card-sport/card-sport.types.d.ts.map +1 -0
  21. package/dist/components/card-sport/card-sport.types.js +1 -0
  22. package/dist/components/card-sport/index.d.ts +2 -0
  23. package/dist/components/card-sport/index.d.ts.map +1 -0
  24. package/dist/components/card-sport/index.js +1 -0
  25. package/dist/components/index.d.ts +4 -0
  26. package/dist/components/index.d.ts.map +1 -1
  27. package/dist/components/index.js +4 -0
  28. package/dist/components/product-card/product-card.component.d.ts.map +1 -1
  29. package/dist/components/product-card/product-card.component.js +4 -4
  30. package/dist/components/product-card/product-card.styles.d.ts +21 -0
  31. package/dist/components/product-card/product-card.styles.d.ts.map +1 -1
  32. package/dist/components/product-card/product-card.styles.js +23 -0
  33. package/dist/components/product-card/product-card.types.d.ts +2 -0
  34. package/dist/components/product-card/product-card.types.d.ts.map +1 -1
  35. package/dist/components/range-slider/range-slider.component.d.ts.map +1 -1
  36. package/dist/components/range-slider/range-slider.component.js +35 -37
  37. package/dist/components/range-slider/range-slider.styles.d.ts +4 -0
  38. package/dist/components/range-slider/range-slider.styles.d.ts.map +1 -1
  39. package/dist/components/range-slider/range-slider.styles.js +4 -0
  40. package/dist/components/store-card/index.d.ts +2 -0
  41. package/dist/components/store-card/index.d.ts.map +1 -0
  42. package/dist/components/store-card/index.js +1 -0
  43. package/dist/components/store-card/store-card.component.d.ts +3 -0
  44. package/dist/components/store-card/store-card.component.d.ts.map +1 -0
  45. package/dist/components/store-card/store-card.component.js +51 -0
  46. package/dist/components/store-card/store-card.styles.d.ts +115 -0
  47. package/dist/components/store-card/store-card.styles.d.ts.map +1 -0
  48. package/dist/components/store-card/store-card.styles.js +115 -0
  49. package/dist/components/store-card/store-card.types.d.ts +23 -0
  50. package/dist/components/store-card/store-card.types.d.ts.map +1 -0
  51. package/dist/components/store-card/store-card.types.js +1 -0
  52. package/dist/components/store-card/styles.d.ts +103 -0
  53. package/dist/components/store-card/styles.d.ts.map +1 -0
  54. package/dist/components/store-card/styles.js +103 -0
  55. package/dist/components/toast/index.d.ts +3 -0
  56. package/dist/components/toast/index.d.ts.map +1 -0
  57. package/dist/components/toast/index.js +2 -0
  58. package/dist/components/toast/toast.component.d.ts +11 -0
  59. package/dist/components/toast/toast.component.d.ts.map +1 -0
  60. package/dist/components/toast/toast.component.js +42 -0
  61. package/dist/components/toast/toast.styles.d.ts +16 -0
  62. package/dist/components/toast/toast.styles.d.ts.map +1 -0
  63. package/dist/components/toast/toast.styles.js +58 -0
  64. package/dist/components/toast/toast.types.d.ts +10 -0
  65. package/dist/components/toast/toast.types.d.ts.map +1 -0
  66. package/dist/components/toast/toast.types.js +1 -0
  67. package/dist/icons/components/Star.d.ts +5 -2
  68. package/dist/icons/components/Star.d.ts.map +1 -1
  69. package/dist/icons/components/Star.js +6 -2
  70. package/dist/icons/components/StarFill.d.ts +4 -0
  71. package/dist/icons/components/StarFill.d.ts.map +1 -0
  72. package/dist/icons/components/StarFill.js +4 -0
  73. package/dist/icons/index.d.ts +1 -0
  74. package/dist/icons/index.d.ts.map +1 -1
  75. package/dist/icons/index.js +1 -0
  76. package/dist/icons/types.d.ts +2 -1
  77. package/dist/icons/types.d.ts.map +1 -1
  78. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { CardPictoProps } from "./card-picto.types";
2
+ export declare function CardPicto({ title, image, onPress, variant, }: CardPictoProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=card-picto.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-picto.component.d.ts","sourceRoot":"","sources":["../../../src/components/card-picto/card-picto.component.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAmB,GACpB,EAAE,cAAc,2CAmBhB"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Image, Text, TouchableOpacity } from "react-native";
3
+ let FastImageComponent = null;
4
+ try {
5
+ // Tenta importar o FastImage
6
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
7
+ FastImageComponent = require("react-native-fast-image").default;
8
+ }
9
+ catch (e) {
10
+ // Se não existir, permanece null
11
+ }
12
+ const CardImage = FastImageComponent ? FastImageComponent : Image;
13
+ import { useCardPictoStyles } from "./card-picto.styles";
14
+ export function CardPicto({ title, image, onPress, variant = "default", }) {
15
+ const styles = useCardPictoStyles(variant);
16
+ return (_jsxs(TouchableOpacity, { style: styles.container, onPress: onPress, activeOpacity: 0.7, children: [_jsx(CardImage, { source: { uri: image }, style: styles.image, resizeMode: FastImageComponent ? FastImageComponent.resizeMode.contain : "contain" }), _jsx(Text, { style: styles.title, children: title })] }));
17
+ }
@@ -0,0 +1,27 @@
1
+ import { CardPictoVariant } from "./card-picto.types";
2
+ export declare const useCardPictoStyles: (variant: CardPictoVariant) => {
3
+ container: {};
4
+ image: {
5
+ width: number;
6
+ height: number;
7
+ };
8
+ title: {
9
+ textAlign: "center";
10
+ color: "#101010";
11
+ fontSize: 14;
12
+ };
13
+ } | {
14
+ container: {
15
+ width: number;
16
+ };
17
+ image: {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ title: {
22
+ textAlign: "center";
23
+ color: "#101010";
24
+ fontSize: 14;
25
+ };
26
+ };
27
+ //# sourceMappingURL=card-picto.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-picto.styles.d.ts","sourceRoot":"","sources":["../../../src/components/card-picto/card-picto.styles.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,eAAO,MAAM,kBAAkB,GAAI,SAAS,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CA0C3D,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { useTheme } from "../../themes";
3
+ export const useCardPictoStyles = (variant) => {
4
+ const { colors, fonts, spacing } = useTheme();
5
+ const baseStyles = StyleSheet.create({
6
+ container: {
7
+ alignItems: "center",
8
+ marginHorizontal: spacing.xxs,
9
+ },
10
+ image: {
11
+ borderRadius: 30,
12
+ marginBottom: spacing.xs,
13
+ },
14
+ title: {
15
+ textAlign: "center",
16
+ color: colors.textPrimary,
17
+ fontSize: fonts.sizes.xs,
18
+ },
19
+ });
20
+ const variantStyles = {
21
+ default: StyleSheet.create({
22
+ container: {},
23
+ image: {
24
+ width: 75,
25
+ height: 75,
26
+ },
27
+ }),
28
+ compact: StyleSheet.create({
29
+ container: {
30
+ width: 60,
31
+ },
32
+ image: {
33
+ width: 48,
34
+ height: 48,
35
+ },
36
+ }),
37
+ };
38
+ return {
39
+ ...baseStyles,
40
+ ...variantStyles[variant],
41
+ };
42
+ };
@@ -0,0 +1,8 @@
1
+ export type CardPictoVariant = 'default' | 'compact';
2
+ export interface CardPictoProps {
3
+ title: string;
4
+ image: string;
5
+ onPress?: () => void;
6
+ variant?: CardPictoVariant;
7
+ }
8
+ //# sourceMappingURL=card-picto.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-picto.types.d.ts","sourceRoot":"","sources":["../../../src/components/card-picto/card-picto.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./card-picto.component";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card-picto/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./card-picto.component";
@@ -0,0 +1,3 @@
1
+ import { CardSportsProps } from "./card-sport.types";
2
+ export declare function CardSports({ title, image, onPress }: CardSportsProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=card-sport.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-sport.component.d.ts","sourceRoot":"","sources":["../../../src/components/card-sport/card-sport.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,eAAe,2CAcpE"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ImageBackground, Text, TouchableOpacity } from "react-native";
3
+ import { useCardSportsStyles } from "./card-sport.styles";
4
+ export function CardSports({ title, image, onPress }) {
5
+ const styles = useCardSportsStyles();
6
+ return (_jsx(TouchableOpacity, { onPress: onPress, style: styles.container, children: _jsx(ImageBackground, { source: { uri: image }, style: styles.background, imageStyle: styles.image, children: _jsx(Text, { style: styles.title, children: title }) }) }));
7
+ }
@@ -0,0 +1,21 @@
1
+ export declare const useCardSportsStyles: () => {
2
+ container: {
3
+ width: number;
4
+ height: number;
5
+ overflow: "hidden";
6
+ };
7
+ background: {
8
+ flex: number;
9
+ justifyContent: "flex-end";
10
+ padding: 16;
11
+ };
12
+ image: {};
13
+ title: {
14
+ color: "#FFFFFF";
15
+ fontSize: 14;
16
+ fontWeight: "500";
17
+ lineHeight: number;
18
+ textAlign: "left";
19
+ };
20
+ };
21
+ //# sourceMappingURL=card-sport.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-sport.styles.d.ts","sourceRoot":"","sources":["../../../src/components/card-sport/card-sport.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;CAuB/B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { useTheme } from "../../themes";
3
+ export const useCardSportsStyles = () => {
4
+ const { colors, spacing, fonts } = useTheme();
5
+ return StyleSheet.create({
6
+ container: {
7
+ width: 160,
8
+ height: 200,
9
+ overflow: "hidden",
10
+ },
11
+ background: {
12
+ flex: 1,
13
+ justifyContent: "flex-end",
14
+ padding: spacing.md,
15
+ },
16
+ image: {},
17
+ title: {
18
+ color: colors.white,
19
+ fontSize: fonts.sizes.xs,
20
+ fontWeight: "500",
21
+ lineHeight: 16.8,
22
+ textAlign: "left",
23
+ },
24
+ });
25
+ };
@@ -0,0 +1,6 @@
1
+ export interface CardSportsProps {
2
+ title: string;
3
+ image: string;
4
+ onPress?: () => void;
5
+ }
6
+ //# sourceMappingURL=card-sport.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-sport.types.d.ts","sourceRoot":"","sources":["../../../src/components/card-sport/card-sport.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./card-sport.component";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card-sport/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./card-sport.component";
@@ -3,6 +3,8 @@ export * from "./action-button/index";
3
3
  export * from "./badge/index";
4
4
  export * from "./banner-carousel/index";
5
5
  export * from "./button/index";
6
+ export * from "./card-picto/index";
7
+ export * from "./card-sport/index";
6
8
  export * from "./card/index";
7
9
  export * from "./cashback-banner/index";
8
10
  export * from "./category-item/index";
@@ -23,6 +25,8 @@ export * from "./range-slider/index";
23
25
  export * from "./search-button/index";
24
26
  export * from "./select/index";
25
27
  export * from "./seller-box/index";
28
+ export * from "./store-card/index";
29
+ export * from "./toast/index";
26
30
  export * from "./toggle-switch/index";
27
31
  export * from "./typography/index";
28
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
@@ -3,6 +3,8 @@ export * from "./action-button/index";
3
3
  export * from "./badge/index";
4
4
  export * from "./banner-carousel/index";
5
5
  export * from "./button/index";
6
+ export * from "./card-picto/index";
7
+ export * from "./card-sport/index";
6
8
  export * from "./card/index";
7
9
  export * from "./cashback-banner/index";
8
10
  export * from "./category-item/index";
@@ -23,5 +25,7 @@ export * from "./range-slider/index";
23
25
  export * from "./search-button/index";
24
26
  export * from "./select/index";
25
27
  export * from "./seller-box/index";
28
+ export * from "./store-card/index";
29
+ export * from "./toast/index";
26
30
  export * from "./toggle-switch/index";
27
31
  export * from "./typography/index";
@@ -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;AAS/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAgK7D,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;AAS/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAwK7D,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
@@ -6,7 +6,7 @@ import { useTheme } from "../../themes";
6
6
  import { Badge } from "../badge";
7
7
  import { Loading } from "../loading";
8
8
  import { useProductCardStyles } from "./product-card.styles";
9
- const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName, rating, reviewCount, price, isFavorite = false, onFavoritePress, onPress, testID, width, flags = [], showRating = true, isLoadingFavorite = false, customStyles, showFavoriteButton = true, }) => {
9
+ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName, rating, reviewCount, price, discountPrice, colorsVariants, isFavorite = false, onFavoritePress, onPress, testID, width, flags = [], showRating = true, isLoadingFavorite = false, customStyles, showFavoriteButton = true, }) => {
10
10
  const styles = useProductCardStyles(variant, width);
11
11
  const theme = useTheme();
12
12
  const handleFavoritePress = React.useCallback((e) => {
@@ -15,15 +15,15 @@ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName,
15
15
  }, [onFavoritePress]);
16
16
  const renderContent = React.useCallback(() => (_jsxs(View, { style: [styles.cardContainer, customStyles], 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) &&
17
17
  (flags === null || flags === void 0 ? void 0 : flags.length) > 0 &&
18
- (flags === null || flags === void 0 ? void 0 : flags.map((flag, index) => (_jsx(Badge, { text: flag.text, textStyle: { color: flag.textColor }, iconPosition: "right", size: "small", style: {
18
+ (flags === null || flags === void 0 ? void 0 : flags.map((flag, index) => (_jsx(Badge, { text: flag.text, textStyle: { color: flag.textColor, fontWeight: "bold" }, iconPosition: "right", size: "small", style: {
19
19
  position: "absolute",
20
20
  top: 0,
21
21
  left: 0,
22
22
  backgroundColor: flag.color,
23
23
  padding: theme.spacing.xxs2,
24
- }, icon: flag.icon }, flag.name + index + productName)))), isFavorite && showFavoriteButton && (_jsx(TouchableOpacity, { style: [
24
+ }, icon: flag.icon }, flag.name + index + productName)))), showFavoriteButton && (_jsx(TouchableOpacity, { style: [
25
25
  isFavorite ? styles.favoriteButton : styles.unfavoriteButton,
26
- ], onPress: handleFavoritePress, accessibilityLabel: isFavorite ? "Remover dos favoritos" : "Adicionar aos favoritos", accessibilityRole: "button", children: isLoadingFavorite ? (_jsx(Loading, { size: 16 })) : isFavorite ? (_jsx(HeartFillIcon, { size: 16, color: "#101010" })) : (_jsx(HeartIcon, { size: 16, 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 }) })] }))] })), [
26
+ ], onPress: handleFavoritePress, accessibilityLabel: isFavorite ? "Remover dos favoritos" : "Adicionar aos favoritos", accessibilityRole: "button", children: isLoadingFavorite ? (_jsx(Loading, { size: 16 })) : isFavorite ? (_jsx(HeartFillIcon, { size: 16, color: "#101010" })) : (_jsx(HeartIcon, { size: 16, 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", filled: true }), _jsxs(View, { style: styles.reviewCountWrapper, children: [_jsx(Text, { style: styles.ratingText, children: rating }), _jsxs(Text, { style: styles.reviewCountText, children: ["(", reviewCount, ")"] })] })] })), _jsxs(View, { style: styles.priceContainer, children: [_jsx(Text, { style: styles.priceText, accessibilityLabel: `Preço: ${price}`, children: price }), discountPrice && (_jsx(Text, { style: styles.priceDiscountText, children: discountPrice }))] }), colorsVariants && (_jsx(Text, { style: styles.colorsText, children: colorsVariants }))] }))] })), [
27
27
  brand,
28
28
  handleFavoritePress,
29
29
  imageUrl,
@@ -46,6 +46,9 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
46
46
  lineHeight: number;
47
47
  };
48
48
  priceContainer: {
49
+ display: "flex";
50
+ flexDirection: "row";
51
+ alignItems: "center";
49
52
  marginTop: number;
50
53
  gap: number;
51
54
  };
@@ -55,6 +58,24 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
55
58
  fontWeight: "500";
56
59
  lineHeight: number;
57
60
  };
61
+ priceDiscountText: {
62
+ fontFamily: string;
63
+ fontWeight: "500";
64
+ fontStyle: "normal";
65
+ fontSize: number;
66
+ letterSpacing: number;
67
+ color: string;
68
+ textDecorationLine: "line-through";
69
+ };
70
+ colorsText: {
71
+ fontFamily: string;
72
+ fontWeight: "400";
73
+ fontStyle: "normal";
74
+ fontSize: number;
75
+ lineHeight: number;
76
+ letterSpacing: number;
77
+ color: "#616161";
78
+ };
58
79
  ratingContainer: {
59
80
  display: "none" | "flex";
60
81
  flexDirection: "row";
@@ -1 +1 @@
1
- {"version":3,"file":"product-card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,eAAO,MAAM,oBAAoB,GAC/B,UAAS,kBAA2B,EACpC,cAAc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHrB,CAAC"}
1
+ {"version":3,"file":"product-card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.styles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,eAAO,MAAM,oBAAoB,GAC/B,UAAS,kBAA2B,EACpC,cAAc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2IrB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { useMemo } from "react";
2
2
  import { StyleSheet } from "react-native";
3
+ import { useTheme } from "../../themes";
3
4
  export const useProductCardStyles = (variant = "grid", customWidth) => {
4
5
  return useMemo(() => {
5
6
  const getImageSize = () => {
@@ -16,6 +17,7 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
16
17
  const cardWidth = customWidth
17
18
  ? Math.max(customWidth, imageSize)
18
19
  : imageSize;
20
+ const { colors } = useTheme();
19
21
  return StyleSheet.create({
20
22
  cardContainer: {
21
23
  display: "flex",
@@ -63,6 +65,9 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
63
65
  lineHeight: 21,
64
66
  },
65
67
  priceContainer: {
68
+ display: "flex",
69
+ flexDirection: "row",
70
+ alignItems: "center",
66
71
  marginTop: 8,
67
72
  gap: 8,
68
73
  },
@@ -72,6 +77,24 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
72
77
  fontWeight: "500",
73
78
  lineHeight: 16.8,
74
79
  },
80
+ priceDiscountText: {
81
+ fontFamily: "Inter",
82
+ fontWeight: "500",
83
+ fontStyle: "normal", // "Medium" não é um valor válido, use "normal"
84
+ fontSize: 10,
85
+ letterSpacing: 0,
86
+ color: "#616161",
87
+ textDecorationLine: "line-through",
88
+ },
89
+ colorsText: {
90
+ fontFamily: "Inter",
91
+ fontWeight: "400",
92
+ fontStyle: "normal", // "Regular" não é um valor válido, use "normal"
93
+ fontSize: 12,
94
+ lineHeight: 18,
95
+ letterSpacing: 0,
96
+ color: colors.textTertiary,
97
+ },
75
98
  ratingContainer: {
76
99
  display: variant === "grid" ? "flex" : "none",
77
100
  flexDirection: "row",
@@ -8,6 +8,7 @@ export interface ProductCardProps {
8
8
  rating?: number;
9
9
  reviewCount?: number;
10
10
  price: string | number;
11
+ discountPrice?: string | number;
11
12
  isFavorite?: boolean;
12
13
  onFavoritePress?: () => void;
13
14
  onPress?: () => void;
@@ -24,5 +25,6 @@ export interface ProductCardProps {
24
25
  showRating?: boolean;
25
26
  isLoadingFavorite?: boolean;
26
27
  customStyles?: StyleProp<ViewStyle>;
28
+ colorsVariants?: string;
27
29
  }
28
30
  //# 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,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,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,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACrC"}
1
+ {"version":3,"file":"product-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,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,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,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;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"range-slider.component.d.ts","sourceRoot":"","sources":["../../../src/components/range-slider/range-slider.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAuKxD,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
1
+ {"version":3,"file":"range-slider.component.d.ts","sourceRoot":"","sources":["../../../src/components/range-slider/range-slider.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AA0KxD,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { Animated, PanResponder, Platform, UIManager, View } from "react-native";
3
+ import { Animated, PanResponder, Platform, UIManager, View, } from "react-native";
4
4
  import { useRangeSliderStyles } from "./range-slider.styles";
5
- if (Platform.OS === 'android') {
5
+ if (Platform.OS === "android") {
6
6
  if (UIManager.setLayoutAnimationEnabledExperimental) {
7
7
  UIManager.setLayoutAnimationEnabledExperimental(true);
8
8
  }
@@ -12,12 +12,12 @@ const RangeSliderComponent = ({ value = [0, 100], min = 0, max = 100, disabled,
12
12
  // Referência para o container do slider
13
13
  const sliderContainerRef = React.useRef(null);
14
14
  // Estado para valores do slider
15
- const [sliderWidth, setSliderWidth] = React.useState(343);
15
+ const [sliderWidth, setSliderWidth] = React.useState(0);
16
16
  const [leftValue, setLeftValue] = React.useState(value[0] || min);
17
17
  const [rightValue, setRightValue] = React.useState(value[1] || max);
18
18
  // Valores animados para as posições dos thumbs
19
19
  const leftThumbPosition = React.useRef(new Animated.Value(0)).current;
20
- const rightThumbPosition = React.useRef(new Animated.Value(sliderWidth)).current;
20
+ const rightThumbPosition = React.useRef(new Animated.Value(0)).current;
21
21
  // Atualiza os valores quando as props mudam
22
22
  React.useEffect(() => {
23
23
  if (value && value.length === 2) {
@@ -25,20 +25,29 @@ const RangeSliderComponent = ({ value = [0, 100], min = 0, max = 100, disabled,
25
25
  setRightValue(value[1]);
26
26
  }
27
27
  }, [value]);
28
+ // Função para calcular a posição baseada no valor
29
+ const valueToPosition = (val) => {
30
+ if (sliderWidth === 0)
31
+ return 0;
32
+ const percentage = (val - min) / (max - min);
33
+ return percentage * sliderWidth;
34
+ };
35
+ // Função para calcular o valor baseado na posição
36
+ const positionToValue = (position) => {
37
+ if (sliderWidth === 0)
38
+ return min;
39
+ const percentage = position / sliderWidth;
40
+ const value = min + percentage * (max - min);
41
+ return Math.round(value);
42
+ };
28
43
  // Atualiza as posições dos thumbs quando o tamanho do slider muda ou os valores mudam
29
44
  React.useEffect(() => {
30
- // Garante que os valores estejam dentro dos limites
31
- const clampedLeftValue = Math.max(min, Math.min(max, leftValue));
32
- const clampedRightValue = Math.max(min, Math.min(max, rightValue));
33
- // Calcula a porcentagem relativa ao intervalo min-max
34
- const leftPercentage = (clampedLeftValue - min) / (max - min);
35
- const rightPercentage = (clampedRightValue - min) / (max - min);
36
- // Calcula a posição em pixels
37
- const leftPos = leftPercentage * sliderWidth;
38
- const rightPos = rightPercentage * sliderWidth;
39
- // Atualiza as posições dos thumbs
40
- leftThumbPosition.setValue(leftPos);
41
- rightThumbPosition.setValue(rightPos);
45
+ if (sliderWidth > 0) {
46
+ const leftPos = valueToPosition(leftValue);
47
+ const rightPos = valueToPosition(rightValue);
48
+ leftThumbPosition.setValue(leftPos);
49
+ rightThumbPosition.setValue(rightPos);
50
+ }
42
51
  }, [sliderWidth, leftValue, rightValue, min, max]);
43
52
  // Função para obter a posição X relativa ao slider
44
53
  const getPositionInSlider = (gestureState) => {
@@ -55,12 +64,6 @@ const RangeSliderComponent = ({ value = [0, 100], min = 0, max = 100, disabled,
55
64
  }
56
65
  });
57
66
  };
58
- // Converte posição para valor real
59
- const positionToValue = (position) => {
60
- const percentage = position / sliderWidth;
61
- const value = min + percentage * (max - min);
62
- return Math.round(value);
63
- };
64
67
  // Cria os pan responders para ambos os thumbs
65
68
  const createPanResponder = (isLeft) => PanResponder.create({
66
69
  onStartShouldSetPanResponder: () => !disabled,
@@ -69,27 +72,25 @@ const RangeSliderComponent = ({ value = [0, 100], min = 0, max = 100, disabled,
69
72
  // Feedback visual pode ser adicionado aqui
70
73
  },
71
74
  onPanResponderMove: async (_, gestureState) => {
72
- if (disabled)
75
+ if (disabled || sliderWidth === 0)
73
76
  return;
74
77
  const newPosition = await getPositionInSlider(gestureState);
75
78
  const newValue = positionToValue(newPosition);
76
79
  if (isLeft) {
77
- if (newValue < rightValue) {
80
+ // Garante que o thumb esquerdo não passe do direito
81
+ if (newValue <= rightValue) {
78
82
  setLeftValue(newValue);
79
- // A posição é calculada com base na porcentagem do intervalo
80
- const leftPos = ((newValue - min) / (max - min)) * sliderWidth;
81
- leftThumbPosition.setValue(leftPos);
83
+ leftThumbPosition.setValue(newPosition);
82
84
  if (onChangeValue) {
83
85
  onChangeValue([newValue, rightValue]);
84
86
  }
85
87
  }
86
88
  }
87
89
  else {
88
- if (newValue > leftValue) {
90
+ // Garante que o thumb direito não passe do esquerdo
91
+ if (newValue >= leftValue) {
89
92
  setRightValue(newValue);
90
- // A posição é calculada com base na porcentagem do intervalo
91
- const rightPos = ((newValue - min) / (max - min)) * sliderWidth;
92
- rightThumbPosition.setValue(rightPos);
93
+ rightThumbPosition.setValue(newPosition);
93
94
  if (onChangeValue) {
94
95
  onChangeValue([leftValue, newValue]);
95
96
  }
@@ -98,18 +99,15 @@ const RangeSliderComponent = ({ value = [0, 100], min = 0, max = 100, disabled,
98
99
  },
99
100
  onPanResponderRelease: () => {
100
101
  // Feedback ao soltar pode ser adicionado aqui
101
- }
102
+ },
102
103
  });
103
104
  const leftPanResponder = createPanResponder(true);
104
105
  const rightPanResponder = createPanResponder(false);
105
- return (_jsxs(View, { ref: sliderContainerRef, style: [
106
- styles.sliderContainer,
107
- disabled && { opacity: 0.5 }
108
- ], onLayout: (event) => setSliderWidth(event.nativeEvent.layout.width), testID: testID, children: [_jsx(View, { style: styles.sliderTrack }), _jsx(Animated.View, { style: [
106
+ return (_jsxs(View, { ref: sliderContainerRef, style: [styles.sliderContainer, disabled && { opacity: 0.5 }], onLayout: (event) => setSliderWidth(event.nativeEvent.layout.width), testID: testID, children: [_jsx(View, { style: styles.sliderTrack }), _jsx(Animated.View, { style: [
109
107
  styles.sliderFilledTrack,
110
108
  {
111
109
  left: leftThumbPosition,
112
- right: Animated.subtract(sliderWidth, rightThumbPosition),
110
+ width: Animated.subtract(rightThumbPosition, leftThumbPosition),
113
111
  },
114
112
  ] }), _jsx(Animated.View, { ...leftPanResponder.panHandlers, style: [
115
113
  styles.thumb,
@@ -3,10 +3,13 @@ export declare const useRangeSliderStyles: () => {
3
3
  height: number;
4
4
  width: "100%";
5
5
  marginVertical: number;
6
+ position: "relative";
6
7
  };
7
8
  sliderTrack: {
8
9
  position: "absolute";
9
10
  top: number;
11
+ left: number;
12
+ right: number;
10
13
  height: number;
11
14
  backgroundColor: string;
12
15
  };
@@ -25,6 +28,7 @@ export declare const useRangeSliderStyles: () => {
25
28
  borderRadius: number;
26
29
  justifyContent: "center";
27
30
  alignItems: "center";
31
+ zIndex: number;
28
32
  };
29
33
  thumbDot: {
30
34
  width: number;
@@ -1 +1 @@
1
- {"version":3,"file":"range-slider.styles.d.ts","sourceRoot":"","sources":["../../../src/components/range-slider/range-slider.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsChC,CAAC"}
1
+ {"version":3,"file":"range-slider.styles.d.ts","sourceRoot":"","sources":["../../../src/components/range-slider/range-slider.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0ChC,CAAC"}
@@ -7,10 +7,13 @@ export const useRangeSliderStyles = () => {
7
7
  height: 40,
8
8
  width: "100%",
9
9
  marginVertical: 20,
10
+ position: "relative",
10
11
  },
11
12
  sliderTrack: {
12
13
  position: "absolute",
13
14
  top: 18,
15
+ left: 0,
16
+ right: 0,
14
17
  height: 2,
15
18
  backgroundColor: "#d9dde1",
16
19
  },
@@ -29,6 +32,7 @@ export const useRangeSliderStyles = () => {
29
32
  borderRadius: 10,
30
33
  justifyContent: "center",
31
34
  alignItems: "center",
35
+ zIndex: 1,
32
36
  },
33
37
  thumbDot: {
34
38
  width: 4,
@@ -0,0 +1,2 @@
1
+ export { StoreCard } from './store-card.component';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/store-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ export { StoreCard } from './store-card.component';