decathlon-ui 0.3.50 → 2.0.0

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 (61) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/components/badge/badge.component.d.ts +1 -1
  3. package/dist/components/badge/badge.component.d.ts.map +1 -1
  4. package/dist/components/badge/badge.component.js +53 -22
  5. package/dist/components/badge/badge.styles.d.ts +27 -1
  6. package/dist/components/badge/badge.styles.d.ts.map +1 -1
  7. package/dist/components/badge/badge.styles.js +76 -24
  8. package/dist/components/badge/badge.types.d.ts +15 -16
  9. package/dist/components/badge/badge.types.d.ts.map +1 -1
  10. package/dist/components/badge/index.d.ts +1 -1
  11. package/dist/components/badge/index.d.ts.map +1 -1
  12. package/dist/components/card-picto/card-picto.component.d.ts.map +1 -1
  13. package/dist/components/card-picto/card-picto.component.js +1 -11
  14. package/dist/components/delivery-option-card/delivery-option-card.component.d.ts +4 -0
  15. package/dist/components/delivery-option-card/delivery-option-card.component.d.ts.map +1 -0
  16. package/dist/components/delivery-option-card/delivery-option-card.component.js +26 -0
  17. package/dist/components/delivery-option-card/delivery-option-card.styles.d.ts +169 -0
  18. package/dist/components/delivery-option-card/delivery-option-card.styles.d.ts.map +1 -0
  19. package/dist/components/delivery-option-card/delivery-option-card.styles.js +168 -0
  20. package/dist/components/delivery-option-card/delivery-option-card.types.d.ts +32 -0
  21. package/dist/components/delivery-option-card/delivery-option-card.types.d.ts.map +1 -0
  22. package/dist/components/delivery-option-card/delivery-option-card.types.js +1 -0
  23. package/dist/components/delivery-option-card/index.d.ts +3 -0
  24. package/dist/components/delivery-option-card/index.d.ts.map +1 -0
  25. package/dist/components/delivery-option-card/index.js +1 -0
  26. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.component.d.ts +4 -0
  27. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.component.d.ts.map +1 -0
  28. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.component.js +13 -0
  29. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.styles.d.ts +38 -0
  30. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.styles.d.ts.map +1 -0
  31. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.styles.js +42 -0
  32. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.types.d.ts +17 -0
  33. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.types.d.ts.map +1 -0
  34. package/dist/components/delivery-orientation-banner/delivery-orientation-banner.types.js +1 -0
  35. package/dist/components/delivery-orientation-banner/index.d.ts +3 -0
  36. package/dist/components/delivery-orientation-banner/index.d.ts.map +1 -0
  37. package/dist/components/delivery-orientation-banner/index.js +1 -0
  38. package/dist/components/index.d.ts +2 -0
  39. package/dist/components/index.d.ts.map +1 -1
  40. package/dist/components/index.js +2 -0
  41. package/dist/components/product-card/product-card.component.d.ts.map +1 -1
  42. package/dist/components/product-card/product-card.component.js +22 -4
  43. package/dist/components/product-card/product-card.styles.d.ts +19 -3
  44. package/dist/components/product-card/product-card.styles.d.ts.map +1 -1
  45. package/dist/components/product-card/product-card.styles.js +27 -9
  46. package/dist/components/product-card/product-card.types.d.ts +2 -1
  47. package/dist/components/product-card/product-card.types.d.ts.map +1 -1
  48. package/dist/components/product-highlight/product-highlight.d.ts +1 -1
  49. package/dist/components/product-highlight/product-highlight.d.ts.map +1 -1
  50. package/dist/components/product-highlight/product-highlight.js +1 -1
  51. package/dist/components/store-card/store-card.component.d.ts.map +1 -1
  52. package/dist/components/store-card/store-card.component.js +3 -23
  53. package/dist/themes/dark.d.ts +22 -0
  54. package/dist/themes/dark.d.ts.map +1 -1
  55. package/dist/themes/dark.js +22 -0
  56. package/dist/themes/index.d.ts +22 -0
  57. package/dist/themes/index.d.ts.map +1 -1
  58. package/dist/themes/light.d.ts +24 -0
  59. package/dist/themes/light.d.ts.map +1 -1
  60. package/dist/themes/light.js +24 -0
  61. package/package.json +3 -1
@@ -0,0 +1,168 @@
1
+ import { Platform, StyleSheet } from "react-native";
2
+ import { useTheme } from "../../themes";
3
+ export const useDeliveryOptionCardStyles = ({ tone, selected, disabled = false, }) => {
4
+ const theme = useTheme();
5
+ const effectiveSelected = selected && !disabled;
6
+ const accent = tone === "featured"
7
+ ? theme.colors.deliveryOptionFeatured
8
+ : theme.colors.primary;
9
+ const borderWidth = effectiveSelected
10
+ ? theme.borderWidth.md
11
+ : theme.borderWidth.sm;
12
+ const borderColor = disabled || !effectiveSelected
13
+ ? theme.colors.borderDeliveryIdle
14
+ : accent;
15
+ const ringShadow = Platform.OS === "ios" && effectiveSelected
16
+ ? {
17
+ shadowColor: tone === "featured"
18
+ ? theme.colors.deliveryOptionFeatured
19
+ : theme.colors.primary,
20
+ shadowOffset: { width: 0, height: 0 },
21
+ shadowOpacity: tone === "featured" ? 0.15 : 0.1,
22
+ shadowRadius: 2,
23
+ }
24
+ : {};
25
+ return StyleSheet.create({
26
+ card: {
27
+ backgroundColor: theme.colors.white,
28
+ borderRadius: theme.radius.none,
29
+ borderWidth,
30
+ borderColor,
31
+ paddingHorizontal: theme.spacing.default,
32
+ paddingVertical: theme.spacing.sm,
33
+ opacity: disabled ? 0.55 : 1,
34
+ ...ringShadow,
35
+ },
36
+ topRow: {
37
+ flexDirection: "row",
38
+ alignItems: "flex-start",
39
+ justifyContent: "space-between",
40
+ },
41
+ leadingCluster: {
42
+ flexDirection: "row",
43
+ alignItems: "flex-start",
44
+ flex: 1,
45
+ marginRight: theme.spacing.xs,
46
+ },
47
+ badgesColumn: {
48
+ flex: 1,
49
+ marginLeft: theme.spacing.xs,
50
+ },
51
+ recommendedBadge: {
52
+ flexDirection: "row",
53
+ alignItems: "center",
54
+ alignSelf: "flex-start",
55
+ backgroundColor: theme.colors.backgroundDeliveryRecommendedBadge,
56
+ paddingHorizontal: theme.spacing.xs,
57
+ paddingVertical: 5.5,
58
+ gap: theme.spacing.xxs,
59
+ },
60
+ recommendedText: {
61
+ fontFamily: theme.fonts.inter.bold,
62
+ fontSize: theme.fonts.sizes.xxxs,
63
+ lineHeight: 15,
64
+ letterSpacing: 0.25,
65
+ textTransform: "uppercase",
66
+ color: theme.colors.white,
67
+ },
68
+ advantageousBadge: {
69
+ alignSelf: "flex-start",
70
+ marginTop: theme.spacing.xxs,
71
+ backgroundColor: theme.colors.backgroundDeliveryAdvantageBadge,
72
+ paddingHorizontal: theme.spacing.xs,
73
+ paddingVertical: 5.5,
74
+ },
75
+ advantageousText: {
76
+ fontFamily: theme.fonts.inter.bold,
77
+ fontSize: theme.fonts.sizes.xxxs,
78
+ lineHeight: 15,
79
+ letterSpacing: 0.25,
80
+ textTransform: "uppercase",
81
+ color: theme.colors.textDeliveryAdvantageBadge,
82
+ },
83
+ radioOuterSelected: {
84
+ width: 20,
85
+ height: 20,
86
+ borderRadius: theme.radius.round,
87
+ borderWidth: theme.borderWidth.md,
88
+ borderColor: accent,
89
+ backgroundColor: accent,
90
+ alignItems: "center",
91
+ justifyContent: "center",
92
+ marginLeft: theme.spacing.xs,
93
+ },
94
+ radioOuterIdle: {
95
+ width: 20,
96
+ height: 20,
97
+ borderRadius: theme.radius.round,
98
+ borderWidth: theme.borderWidth.md,
99
+ borderColor: theme.colors.borderDeliveryRadioIdle,
100
+ backgroundColor: theme.colors.white,
101
+ alignItems: "center",
102
+ justifyContent: "center",
103
+ marginLeft: theme.spacing.xs,
104
+ },
105
+ radioInner: {
106
+ width: 8,
107
+ height: 8,
108
+ borderRadius: theme.radius.round,
109
+ backgroundColor: theme.colors.white,
110
+ },
111
+ titleRow: {
112
+ flexDirection: "row",
113
+ alignItems: "center",
114
+ justifyContent: "space-between",
115
+ marginTop: theme.spacing.sm,
116
+ },
117
+ title: {
118
+ fontFamily: theme.fonts.inter.semiBold,
119
+ fontSize: 14,
120
+ lineHeight: 18.13,
121
+ color: theme.colors.textPrimary,
122
+ flex: 1,
123
+ marginRight: theme.spacing.sm,
124
+ },
125
+ trailingTitle: {
126
+ fontFamily: theme.fonts.inter.semiBold,
127
+ fontSize: 14,
128
+ lineHeight: 18.13,
129
+ color: theme.colors.textPrimary,
130
+ textAlign: "right",
131
+ },
132
+ subtitle: {
133
+ marginTop: theme.spacing.xxs,
134
+ },
135
+ subtitleText: {
136
+ fontFamily: theme.fonts.inter.regular,
137
+ fontSize: 13,
138
+ lineHeight: 17.88,
139
+ color: theme.colors.textDeliveryMuted,
140
+ },
141
+ availabilityRow: {
142
+ flexDirection: "row",
143
+ alignItems: "flex-start",
144
+ marginTop: theme.spacing.sm,
145
+ },
146
+ availabilityBar: {
147
+ width: 5,
148
+ height: 8,
149
+ marginRight: theme.spacing.xs,
150
+ marginTop: 4,
151
+ backgroundColor: theme.colors.deliveryAvailabilityIndicator,
152
+ borderRadius: theme.radius.none,
153
+ },
154
+ footerLink: {
155
+ flexDirection: "row",
156
+ alignItems: "center",
157
+ marginTop: theme.spacing.sm,
158
+ alignSelf: "flex-start",
159
+ gap: theme.spacing.xxs,
160
+ },
161
+ footerLinkText: {
162
+ fontFamily: theme.fonts.inter.semiBold,
163
+ fontSize: 13,
164
+ lineHeight: 19.5,
165
+ color: theme.colors.primary,
166
+ },
167
+ });
168
+ };
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ /** Tom visual da opção — handoff: featured = verde (sucesso), default = marca (azul). */
4
+ export type DeliveryOptionTone = "featured" | "default";
5
+ export type DeliveryOptionCardProps = {
6
+ testID?: string;
7
+ style?: StyleProp<ViewStyle>;
8
+ tone?: DeliveryOptionTone;
9
+ /** Equivalente ao handoff · bloqueia toque e aplica tratamento visual do estado indisponível */
10
+ disabled?: boolean;
11
+ /** Estado selecionado (borda 2px + anel conforme DS checkout) — ignorado visualmente quando `disabled` */
12
+ selected?: boolean;
13
+ /** Lista de tags / badges acima do título — substitui `showRecommendedBadge` + `advantageousLabel` quando definido */
14
+ tags?: ReactNode;
15
+ /** Ao tocar no cartão inteiro */
16
+ onPress?: () => void;
17
+ leadingIcon?: ReactNode;
18
+ showRecommendedBadge?: boolean;
19
+ recommendedBadgeIcon?: ReactNode;
20
+ advantageousLabel?: string;
21
+ title: string;
22
+ trailingTitle?: string;
23
+ subtitle?: ReactNode;
24
+ /** Alias de `subtitle` (layouts antigos) */
25
+ description?: ReactNode;
26
+ /** Barra lateral de contexto (ex.: aviso misto casa/loja) */
27
+ showAvailabilityIndicator?: boolean;
28
+ availabilitySummary?: ReactNode;
29
+ changeStoreLabel?: string;
30
+ onChangeStorePress?: () => void;
31
+ };
32
+ //# sourceMappingURL=delivery-option-card.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-option-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/delivery-option-card/delivery-option-card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,yFAAyF;AACzF,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,CAAC;AAExD,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sHAAsH;IACtH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,SAAS,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6DAA6D;IAC7D,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { DeliveryOptionCard } from "./delivery-option-card.component";
2
+ export type { DeliveryOptionCardProps, DeliveryOptionTone, } from "./delivery-option-card.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/delivery-option-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,YAAY,EACV,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1 @@
1
+ export { DeliveryOptionCard } from "./delivery-option-card.component";
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { DeliveryOrientationBannerProps } from "./delivery-orientation-banner.types";
3
+ export declare const DeliveryOrientationBanner: React.NamedExoticComponent<DeliveryOrientationBannerProps>;
4
+ //# sourceMappingURL=delivery-orientation-banner.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-orientation-banner.component.d.ts","sourceRoot":"","sources":["../../../src/components/delivery-orientation-banner/delivery-orientation-banner.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAiC1F,eAAO,MAAM,yBAAyB,4DAErC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { Text, View } from "react-native";
4
+ import { InfoIcon } from "../../icons";
5
+ import { useTheme } from "../../themes";
6
+ import { useDeliveryOrientationBannerStyles } from "./delivery-orientation-banner.styles";
7
+ const DeliveryOrientationBannerComponent = ({ testID, style, icon, line1, emphasis, afterEmphasis = "", line3, }) => {
8
+ const styles = useDeliveryOrientationBannerStyles();
9
+ const { colors } = useTheme();
10
+ return (_jsxs(View, { style: [styles.container, style], testID: testID, children: [_jsx(View, { style: styles.iconWrap, children: icon !== null && icon !== void 0 ? icon : _jsx(InfoIcon, { size: 20, color: colors.iconInformation }) }), _jsxs(View, { style: styles.textBlock, children: [_jsx(Text, { style: styles.line1, children: line1 }), _jsxs(Text, { style: styles.regular, children: [_jsx(Text, { style: styles.emphasis, children: emphasis }), afterEmphasis] }), _jsx(Text, { style: styles.regular, children: line3 })] })] }));
11
+ };
12
+ export const DeliveryOrientationBanner = React.memo(DeliveryOrientationBannerComponent);
13
+ DeliveryOrientationBanner.displayName = "DeliveryOrientationBanner";
@@ -0,0 +1,38 @@
1
+ export declare const useDeliveryOrientationBannerStyles: () => {
2
+ container: {
3
+ flexDirection: "row";
4
+ alignItems: "flex-start";
5
+ paddingVertical: 12;
6
+ paddingHorizontal: 14;
7
+ backgroundColor: "#EFF5FF";
8
+ borderWidth: 1;
9
+ borderColor: "#DBE7FF";
10
+ borderRadius: 0;
11
+ };
12
+ iconWrap: {
13
+ marginTop: number;
14
+ marginRight: 12;
15
+ };
16
+ textBlock: {
17
+ flex: number;
18
+ };
19
+ line1: {
20
+ fontFamily: "Inter-Regular";
21
+ fontSize: number;
22
+ lineHeight: number;
23
+ color: "#364153";
24
+ };
25
+ emphasis: {
26
+ fontFamily: "Inter-SemiBold";
27
+ fontSize: number;
28
+ lineHeight: number;
29
+ color: "#101010";
30
+ };
31
+ regular: {
32
+ fontFamily: "Inter-Regular";
33
+ fontSize: number;
34
+ lineHeight: number;
35
+ color: "#364153";
36
+ };
37
+ };
38
+ //# sourceMappingURL=delivery-orientation-banner.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-orientation-banner.styles.d.ts","sourceRoot":"","sources":["../../../src/components/delivery-orientation-banner/delivery-orientation-banner.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC9C,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { useTheme } from "../../themes";
3
+ export const useDeliveryOrientationBannerStyles = () => {
4
+ const theme = useTheme();
5
+ return StyleSheet.create({
6
+ container: {
7
+ flexDirection: "row",
8
+ alignItems: "flex-start",
9
+ paddingVertical: theme.spacing.sm,
10
+ paddingHorizontal: theme.spacing.default,
11
+ backgroundColor: theme.colors.backgroundCheckoutOrientacao,
12
+ borderWidth: theme.borderWidth.sm,
13
+ borderColor: theme.colors.borderCheckoutOrientacao,
14
+ borderRadius: theme.radius.none,
15
+ },
16
+ iconWrap: {
17
+ marginTop: 2,
18
+ marginRight: theme.spacing.sm,
19
+ },
20
+ textBlock: {
21
+ flex: 1,
22
+ },
23
+ line1: {
24
+ fontFamily: theme.fonts.inter.regular,
25
+ fontSize: 13,
26
+ lineHeight: 17.88,
27
+ color: theme.colors.textCheckoutOrientacao,
28
+ },
29
+ emphasis: {
30
+ fontFamily: theme.fonts.inter.semiBold,
31
+ fontSize: 13,
32
+ lineHeight: 17.88,
33
+ color: theme.colors.textPrimary,
34
+ },
35
+ regular: {
36
+ fontFamily: theme.fonts.inter.regular,
37
+ fontSize: 13,
38
+ lineHeight: 17.88,
39
+ color: theme.colors.textCheckoutOrientacao,
40
+ },
41
+ });
42
+ };
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
+ export type DeliveryOrientationBannerProps = {
4
+ testID?: string;
5
+ style?: StyleProp<ViewStyle>;
6
+ /** Ícone à esquerda (ex.: informação) */
7
+ icon?: ReactNode;
8
+ /** Primeira linha do texto */
9
+ line1: string;
10
+ /** Trecho em destaque (peso semibold) */
11
+ emphasis: string;
12
+ /** Continuação na mesma linha, após o destaque */
13
+ afterEmphasis?: string;
14
+ /** Linha final */
15
+ line3: string;
16
+ };
17
+ //# sourceMappingURL=delivery-orientation-banner.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-orientation-banner.types.d.ts","sourceRoot":"","sources":["../../../src/components/delivery-orientation-banner/delivery-orientation-banner.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,yCAAyC;IACzC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { DeliveryOrientationBanner } from "./delivery-orientation-banner.component";
2
+ export type { DeliveryOrientationBannerProps } from "./delivery-orientation-banner.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/delivery-orientation-banner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,YAAY,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1 @@
1
+ export { DeliveryOrientationBanner } from "./delivery-orientation-banner.component";
@@ -11,6 +11,8 @@ export * from "./card/index";
11
11
  export * from "./cashback-banner/index";
12
12
  export * from "./category-item/index";
13
13
  export * from "./checkbox/index";
14
+ export * from "./delivery-option-card/index";
15
+ export * from "./delivery-orientation-banner/index";
14
16
  export * from "./event-card/index";
15
17
  export * from "./filter-chip/index";
16
18
  export * from "./information-card/index";
@@ -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,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,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,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,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,uCAAuC,CAAC;AACtD,cAAc,6BAA6B,CAAC;AAC5C,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,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AAEvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
@@ -11,6 +11,8 @@ export * from "./card/index";
11
11
  export * from "./cashback-banner/index";
12
12
  export * from "./category-item/index";
13
13
  export * from "./checkbox/index";
14
+ export * from "./delivery-option-card/index";
15
+ export * from "./delivery-orientation-banner/index";
14
16
  export * from "./event-card/index";
15
17
  export * from "./filter-chip/index";
16
18
  export * from "./information-card/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;AAyO7D,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;AA8Q7D,eAAO,MAAM,WAAW,8CAAmC,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { Image, Text, TouchableOpacity, View } from "react-native";
4
- import { HeartFillIcon, HeartIcon, StarIcon } from "../../icons";
4
+ import { AddToBagIcon, HeartFillIcon, HeartIcon, StarIcon } from "../../icons";
5
5
  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, discountPrice, cashPrice, offerPrice, colorsVariants, 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, cashPrice, offerPrice, colorsVariants, isFavorite = false, onFavoritePress, onPress, testID, width, flags = [], showRating = true, isLoadingFavorite = false, customStyles, showFavoriteButton = true, onAddToCartPress, }) => {
10
10
  const styles = useProductCardStyles(variant, width);
11
11
  const theme = useTheme();
12
12
  const parsePriceToNumber = React.useCallback((price) => {
@@ -26,6 +26,10 @@ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName,
26
26
  e.stopPropagation();
27
27
  onFavoritePress === null || onFavoritePress === void 0 ? void 0 : onFavoritePress();
28
28
  }, [onFavoritePress]);
29
+ const handleAddToCartPress = React.useCallback((e) => {
30
+ e.stopPropagation();
31
+ onAddToCartPress === null || onAddToCartPress === void 0 ? void 0 : onAddToCartPress();
32
+ }, [onAddToCartPress]);
29
33
  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}` }), (flags === null || flags === void 0 ? void 0 : flags.some((flag) => { var _a; return (_a = flag.text) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes("produto azul"); })) && (_jsx(View, { style: {
30
34
  position: "absolute",
31
35
  top: 0,
@@ -35,7 +39,7 @@ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName,
35
39
  height: 55,
36
40
  }, children: _jsx(Image, { source: {
37
41
  uri: "https://decathlonstore.vtexassets.com/assets/vtex.file-manager-graphql/images/43a62e42-1b09-4a1b-9536-56a8fd6efb4a___57609de553b212bd01a55b5a862948b7.png",
38
- }, style: { width: 50, height: 55 } }) })), ["grid", "shelf"].includes(variant) &&
42
+ }, style: { width: 50, height: 55 } }) })), ["grid", "shelf", "shelfWithAddToCart"].includes(variant) &&
39
43
  (flags === null || flags === void 0 ? void 0 : flags.length) > 0 &&
40
44
  (flags === null || flags === void 0 ? void 0 : flags.map((flag, index) => {
41
45
  var _a;
@@ -51,19 +55,33 @@ const ProductCardComponent = ({ variant = "grid", imageUrl, brand, productName,
51
55
  }, icon: flag.icon }, flag.name + index + productName));
52
56
  })), showFavoriteButton && (_jsx(TouchableOpacity, { style: [
53
57
  isFavorite ? styles.favoriteButton : styles.unfavoriteButton,
54
- ], 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: "#15181B", filled: true }), _jsxs(View, { style: styles.reviewCountWrapper, children: [_jsx(Text, { style: styles.ratingText, children: rating === null || rating === void 0 ? void 0 : rating.toString().replace(/\./g, ",") }), _jsx(Text, { style: styles.reviewCountText, children: reviewCount })] })] })), _jsx(View, { style: styles.priceContainer, children: cashPrice && parsePriceToNumber(cashPrice) < parsePriceToNumber(offerPrice || price) ? (_jsxs(_Fragment, { children: [_jsx(Text, { style: styles.priceText, accessibilityLabel: `Preço à vista: ${cashPrice}`, children: `${cashPrice} à vista` }), _jsx(Text, { style: styles.priceDiscountText, accessibilityLabel: `Preço original: ${offerPrice || price}`, children: offerPrice || price })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { style: styles.priceText, accessibilityLabel: `Preço: ${offerPrice || price}`, children: offerPrice || price }), discountPrice && (_jsx(Text, { style: styles.priceDiscountText, children: discountPrice }))] })) }), colorsVariants && (_jsx(Text, { style: styles.colorsText, children: colorsVariants }))] }))] })), [
58
+ ], 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 === "shelfWithAddToCart" && (_jsx(TouchableOpacity, { style: styles.addToCartButton, onPress: handleAddToCartPress, accessibilityLabel: "Adicionar ao carrinho", accessibilityRole: "button", children: _jsx(AddToBagIcon, { color: "#FFFFFF", size: 16 }) }))] }), variant !== "lastViewed" && (_jsxs(View, { style: styles.detailsContainer, children: [_jsxs(View, { style: styles.productInfo, children: [variant !== "shelfWithAddToCart" && (_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: "#15181B", filled: true }), _jsxs(View, { style: styles.reviewCountWrapper, children: [_jsx(Text, { style: styles.ratingText, children: rating === null || rating === void 0 ? void 0 : rating.toString().replace(/\./g, ",") }), _jsx(Text, { style: styles.reviewCountText, children: reviewCount })] })] })), _jsx(View, { style: styles.priceContainer, children: cashPrice && parsePriceToNumber(cashPrice) < parsePriceToNumber(offerPrice || price) ? (_jsxs(_Fragment, { children: [_jsx(Text, { style: styles.priceText, accessibilityLabel: variant === "shelfWithAddToCart"
59
+ ? `Preço: ${cashPrice}`
60
+ : `Preço à vista: ${cashPrice}`, children: variant === "shelfWithAddToCart"
61
+ ? cashPrice
62
+ : `${cashPrice} à vista` }), _jsx(Text, { style: styles.priceDiscountText, accessibilityLabel: `Preço original: ${offerPrice || price}`, children: offerPrice || price })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { style: styles.priceText, accessibilityLabel: `Preço: ${offerPrice || price}`, children: offerPrice || price }), discountPrice && (_jsx(Text, { style: styles.priceDiscountText, children: discountPrice }))] })) }), colorsVariants && (_jsx(Text, { style: styles.colorsText, children: colorsVariants }))] }))] })), [
55
63
  brand,
56
64
  cashPrice,
65
+ colorsVariants,
66
+ customStyles,
67
+ discountPrice,
68
+ flags,
69
+ handleAddToCartPress,
57
70
  handleFavoritePress,
58
71
  imageUrl,
59
72
  isFavorite,
73
+ isLoadingFavorite,
60
74
  offerPrice,
75
+ onAddToCartPress,
61
76
  parsePriceToNumber,
62
77
  price,
63
78
  productName,
64
79
  rating,
65
80
  reviewCount,
81
+ showFavoriteButton,
82
+ showRating,
66
83
  styles,
84
+ theme.spacing.xxs2,
67
85
  variant,
68
86
  ]);
69
87
  if (onPress) {
@@ -9,6 +9,8 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
9
9
  justifyContent: "center";
10
10
  };
11
11
  imageContainer: {
12
+ position?: "relative" | undefined;
13
+ width?: "100%" | undefined;
12
14
  borderRadius: number;
13
15
  display: "flex";
14
16
  flex: number;
@@ -47,8 +49,8 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
47
49
  };
48
50
  priceContainer: {
49
51
  display: "flex";
50
- flexDirection: "column";
51
- alignItems: "flex-start";
52
+ flexDirection: "row" | "column";
53
+ alignItems: "flex-start" | "center";
52
54
  marginTop: number;
53
55
  gap: number;
54
56
  };
@@ -60,9 +62,10 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
60
62
  };
61
63
  priceDiscountText: {
62
64
  fontFamily: string;
63
- fontWeight: "500";
65
+ fontWeight: "400";
64
66
  fontStyle: "normal";
65
67
  fontSize: number;
68
+ lineHeight: number;
66
69
  letterSpacing: number;
67
70
  color: string;
68
71
  textDecorationLine: "line-through";
@@ -95,6 +98,7 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
95
98
  color: string;
96
99
  fontSize: number;
97
100
  lineHeight: number;
101
+ display: "none" | "flex";
98
102
  };
99
103
  favoriteButton: {
100
104
  display: "none" | "flex";
@@ -108,6 +112,18 @@ export declare const useProductCardStyles: (variant?: ProductCardVariant, custom
108
112
  top: number;
109
113
  right: number;
110
114
  };
115
+ addToCartButton: {
116
+ display: "none" | "flex";
117
+ position: "absolute";
118
+ right: number;
119
+ bottom: number;
120
+ width: number;
121
+ height: number;
122
+ borderRadius: number;
123
+ backgroundColor: string;
124
+ justifyContent: "center";
125
+ alignItems: "center";
126
+ };
111
127
  ratingText: {
112
128
  color: string;
113
129
  };
@@ -1 +1 @@
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
+ {"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6JrB,CAAC"}
@@ -6,6 +6,7 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
6
6
  const getImageSize = () => {
7
7
  switch (variant) {
8
8
  case "shelf":
9
+ case "shelfWithAddToCart":
9
10
  return 150;
10
11
  case "lastViewed":
11
12
  return 112;
@@ -22,7 +23,7 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
22
23
  cardContainer: {
23
24
  display: "flex",
24
25
  width: "100%",
25
- maxWidth: 184,
26
+ maxWidth: variant === "shelfWithAddToCart" ? 150 : 184,
26
27
  flexDirection: "column",
27
28
  alignItems: "stretch",
28
29
  justifyContent: "center",
@@ -33,6 +34,9 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
33
34
  flex: 1,
34
35
  justifyContent: "center",
35
36
  alignItems: "center",
37
+ ...(variant === "shelfWithAddToCart"
38
+ ? { position: "relative", width: "100%" }
39
+ : {}),
36
40
  },
37
41
  productImage: {
38
42
  position: "relative",
@@ -57,17 +61,17 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
57
61
  fontWeight: "400",
58
62
  },
59
63
  nameContainer: {
60
- marginTop: 4,
64
+ marginTop: variant === "shelfWithAddToCart" ? 0 : 4,
61
65
  },
62
66
  nameText: {
63
67
  color: "#101010",
64
- fontSize: 14,
65
- lineHeight: 21,
68
+ fontSize: variant === "shelfWithAddToCart" ? 12 : 14,
69
+ lineHeight: variant === "shelfWithAddToCart" ? 18 : 21,
66
70
  },
67
71
  priceContainer: {
68
72
  display: "flex",
69
- flexDirection: "column",
70
- alignItems: "flex-start",
73
+ flexDirection: variant === "shelfWithAddToCart" ? "row" : "column",
74
+ alignItems: variant === "shelfWithAddToCart" ? "center" : "flex-start",
71
75
  marginTop: 8,
72
76
  gap: 8,
73
77
  },
@@ -75,13 +79,14 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
75
79
  fontSize: 14,
76
80
  color: "#101010",
77
81
  fontWeight: "500",
78
- lineHeight: 16.8,
82
+ lineHeight: 16.8, // 120%
79
83
  },
80
84
  priceDiscountText: {
81
85
  fontFamily: "Inter",
82
- fontWeight: "500",
83
- fontStyle: "normal", // "Medium" não é um valor válido, use "normal"
86
+ fontWeight: "400",
87
+ fontStyle: "normal",
84
88
  fontSize: 10,
89
+ lineHeight: 10,
85
90
  letterSpacing: 0,
86
91
  color: "#616161",
87
92
  textDecorationLine: "line-through",
@@ -114,6 +119,7 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
114
119
  color: "#616161",
115
120
  fontSize: 10,
116
121
  lineHeight: 10,
122
+ display: variant === "shelfWithAddToCart" ? "none" : "flex",
117
123
  },
118
124
  favoriteButton: {
119
125
  display: variant === "grid" ? "flex" : "none",
@@ -127,6 +133,18 @@ export const useProductCardStyles = (variant = "grid", customWidth) => {
127
133
  top: 12,
128
134
  right: 12,
129
135
  },
136
+ addToCartButton: {
137
+ display: variant === "shelfWithAddToCart" ? "flex" : "none",
138
+ position: "absolute",
139
+ right: 8,
140
+ bottom: 8,
141
+ width: 32,
142
+ height: 32,
143
+ borderRadius: 16,
144
+ backgroundColor: "#101010",
145
+ justifyContent: "center",
146
+ alignItems: "center",
147
+ },
130
148
  ratingText: {
131
149
  color: "#383838",
132
150
  },