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 { StoreCardProps } from "./store-card.types";
2
+ export declare const StoreCard: ({ storeName, address, distance, itemsAvailable, itemsUnavailable, pickupTime, flags, value, onPress, isSelected, }: StoreCardProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=store-card.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-card.component.d.ts","sourceRoot":"","sources":["../../../src/components/store-card/store-card.component.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA8BpD,eAAO,MAAM,SAAS,GAAI,oHAWvB,cAAc,4CAsFhB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text, TouchableOpacity, View } from "react-native";
3
+ import { CalendarIcon, MapPinIcon } from "../../icons";
4
+ import { useTheme } from "../../themes";
5
+ import { Badge } from "../badge";
6
+ import { useStoreCardStyles } from "./store-card.styles";
7
+ let FastImageComponent = null;
8
+ try {
9
+ // Tenta importar o FastImage
10
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
11
+ FastImageComponent = require("react-native-fast-image").default;
12
+ }
13
+ catch (e) {
14
+ // Se não existir, permanece null
15
+ }
16
+ // Fallback para quando FastImage não estiver disponível (ex: Storybook web)
17
+ if (!FastImageComponent) {
18
+ FastImageComponent = ({ source, style, ...props }) => (_jsx(View, { style: [
19
+ style,
20
+ {
21
+ backgroundColor: "#e0e0e0",
22
+ justifyContent: "center",
23
+ alignItems: "center",
24
+ },
25
+ ], ...props, children: _jsx(Text, { style: { fontSize: 12, color: "#666" }, children: "IMG" }) }));
26
+ }
27
+ export const StoreCard = ({ storeName, address, distance, itemsAvailable, itemsUnavailable, pickupTime, flags, value, onPress, isSelected, }) => {
28
+ const { spacing, fonts, colors, metrics } = useTheme();
29
+ const allAvailable = (itemsUnavailable === null || itemsUnavailable === void 0 ? void 0 : itemsUnavailable.length) === 0;
30
+ const styles = useStoreCardStyles({
31
+ allAvailable,
32
+ });
33
+ return (_jsxs(TouchableOpacity, { onPress: onPress, style: [styles.container, isSelected && styles.isSelected], children: [_jsxs(View, { style: styles.header, children: [_jsx(Text, { style: styles.storeName, children: storeName }), _jsxs(View, { style: styles.tagsContainer, children: [flags === null || flags === void 0 ? void 0 : flags.map((flag) => {
34
+ const variants = {
35
+ free: "default",
36
+ cashback: "cashback",
37
+ };
38
+ return (
39
+ // TODO: adicionar tipo para flags
40
+ _jsx(Badge, { variant: variants[flag], text: flag }, flag));
41
+ }), value && _jsx(Text, { style: styles.value, children: value })] })] }), _jsxs(View, { style: styles.availableItemsContainer, children: [_jsxs(View, { style: styles.availableItemsContainerText, children: [_jsx(View, { style: styles.storeCard }), _jsx(Text, { style: styles.itemsAvailable, children: !(itemsUnavailable === null || itemsUnavailable === void 0 ? void 0 : itemsUnavailable.length)
42
+ ? "Todos itens disponíveis"
43
+ : `${itemsUnavailable === null || itemsUnavailable === void 0 ? void 0 : itemsUnavailable.length} indisponíveis` })] }), _jsxs(View, { style: styles.availableItemsContainerText, children: [_jsx(CalendarIcon, { size: 10 }), _jsx(Text, { style: styles.pickupTime, children: pickupTime })] })] }), _jsxs(View, { style: {
44
+ gap: spacing.sm,
45
+ flexDirection: "row",
46
+ }, children: [itemsAvailable === null || itemsAvailable === void 0 ? void 0 : itemsAvailable.map((item) => (_jsx(FastImageComponent, { source: {
47
+ uri: item.imageUrl,
48
+ }, style: styles.image }, item.itemIndex))), itemsUnavailable === null || itemsUnavailable === void 0 ? void 0 : itemsUnavailable.map((item) => (_jsxs(View, { children: [_jsx(FastImageComponent, { source: {
49
+ uri: item.imageUrl,
50
+ }, style: styles.image }), _jsx(View, { style: styles.unavailableItemContainer, children: _jsx(View, { style: styles.unavailableItem }) })] }, item.itemIndex)))] }), _jsxs(View, { style: styles.footer, children: [_jsx(Text, { style: styles.address, children: address }), _jsxs(View, { style: styles.availableItemsContainerText, children: [_jsx(MapPinIcon, { size: 13 }), _jsx(Text, { style: styles.distance, children: distance })] })] })] }));
51
+ };
@@ -0,0 +1,115 @@
1
+ export declare const useStoreCardStyles: ({ allAvailable, }: {
2
+ allAvailable: boolean;
3
+ }) => {
4
+ container: {
5
+ width: "100%";
6
+ backgroundColor: "#FFFFFF";
7
+ padding: 8;
8
+ gap: 16;
9
+ borderBottomWidth: number;
10
+ borderBottomColor: "#D9DDE1";
11
+ paddingBottom: 16;
12
+ };
13
+ header: {
14
+ flexDirection: "row";
15
+ justifyContent: "space-between";
16
+ alignItems: "center";
17
+ marginBottom: 8;
18
+ };
19
+ storeName: {
20
+ fontSize: 14;
21
+ fontWeight: "600";
22
+ lineHeight: number;
23
+ color: "#101010";
24
+ textAlign: "left";
25
+ };
26
+ itemsAvailable: {
27
+ fontSize: 12;
28
+ fontWeight: "400";
29
+ lineHeight: number;
30
+ textAlign: "left";
31
+ color: "#616161" | "#DB6900";
32
+ };
33
+ pickupTime: {
34
+ fontSize: 12;
35
+ fontWeight: "400";
36
+ lineHeight: number;
37
+ textAlign: "left";
38
+ color: "#616161";
39
+ };
40
+ footer: {
41
+ flexDirection: "row";
42
+ justifyContent: "space-between";
43
+ alignItems: "center";
44
+ };
45
+ address: {
46
+ fontSize: 10;
47
+ fontWeight: "400";
48
+ lineHeight: number;
49
+ textAlign: "left";
50
+ color: "#616161";
51
+ };
52
+ distance: {
53
+ fontSize: 12;
54
+ fontWeight: "600";
55
+ lineHeight: number;
56
+ textAlign: "left";
57
+ color: "#383838";
58
+ flexDirection: "row";
59
+ alignItems: "center";
60
+ };
61
+ image: {
62
+ width: number;
63
+ height: number;
64
+ };
65
+ value: {
66
+ fontSize: 14;
67
+ fontWeight: "600";
68
+ lineHeight: number;
69
+ textAlign: "right";
70
+ color: "#3643BA";
71
+ };
72
+ storeCard: {
73
+ width: number;
74
+ height: number;
75
+ backgroundColor: "#006F43" | "#DB6900";
76
+ borderRadius: number;
77
+ };
78
+ isSelected: {
79
+ borderWidth: number;
80
+ borderColor: "#3643BA";
81
+ borderBottomColor: "#3643BA";
82
+ };
83
+ unavailableItemContainer: {
84
+ position: "absolute";
85
+ top: number;
86
+ left: number;
87
+ right: number;
88
+ bottom: number;
89
+ backgroundColor: string;
90
+ justifyContent: "center";
91
+ alignItems: "center";
92
+ };
93
+ unavailableItem: {
94
+ width: "130%";
95
+ height: number;
96
+ backgroundColor: "#949494";
97
+ position: "absolute";
98
+ transform: {
99
+ rotate: string;
100
+ }[];
101
+ };
102
+ tagsContainer: {
103
+ flexDirection: "row";
104
+ gap: 4;
105
+ };
106
+ availableItemsContainerText: {
107
+ gap: 4;
108
+ flexDirection: "row";
109
+ alignItems: "center";
110
+ };
111
+ availableItemsContainer: {
112
+ gap: 2;
113
+ };
114
+ };
115
+ //# sourceMappingURL=store-card.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-card.styles.d.ts","sourceRoot":"","sources":["../../../src/components/store-card/store-card.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,GAAI,mBAEhC;IACD,YAAY,EAAE,OAAO,CAAC;CACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiHA,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { useTheme } from "../../themes";
3
+ export const useStoreCardStyles = ({ allAvailable, }) => {
4
+ const { colors, fonts, spacing } = useTheme();
5
+ return StyleSheet.create({
6
+ container: {
7
+ width: "100%",
8
+ backgroundColor: colors.backgroundPrimary,
9
+ padding: spacing.xs,
10
+ gap: spacing.md,
11
+ borderBottomWidth: 1,
12
+ borderBottomColor: colors.borderSecondary,
13
+ paddingBottom: spacing.md,
14
+ },
15
+ header: {
16
+ flexDirection: "row",
17
+ justifyContent: "space-between",
18
+ alignItems: "center",
19
+ marginBottom: spacing.xs,
20
+ },
21
+ storeName: {
22
+ fontSize: fonts.sizes.xs,
23
+ fontWeight: "600",
24
+ lineHeight: 21,
25
+ color: colors.textPrimary,
26
+ textAlign: "left",
27
+ },
28
+ itemsAvailable: {
29
+ fontSize: fonts.sizes.xxs,
30
+ fontWeight: "400",
31
+ lineHeight: 18,
32
+ textAlign: "left",
33
+ color: allAvailable ? colors.textTertiary : colors.textHighlight, // TODO: ajustar a lógica para pegar o length do array
34
+ },
35
+ pickupTime: {
36
+ fontSize: fonts.sizes.xxs,
37
+ fontWeight: "400",
38
+ lineHeight: 18,
39
+ textAlign: "left",
40
+ color: colors.textTertiary,
41
+ },
42
+ footer: {
43
+ flexDirection: "row",
44
+ justifyContent: "space-between",
45
+ alignItems: "center",
46
+ },
47
+ address: {
48
+ fontSize: fonts.sizes.xxxs,
49
+ fontWeight: "400",
50
+ lineHeight: 10,
51
+ textAlign: "left",
52
+ color: colors.textTertiary,
53
+ },
54
+ distance: {
55
+ fontSize: fonts.sizes.xxs,
56
+ fontWeight: "600",
57
+ lineHeight: 18,
58
+ textAlign: "left",
59
+ color: colors.textSecondary,
60
+ flexDirection: "row",
61
+ alignItems: "center",
62
+ },
63
+ image: {
64
+ width: 48,
65
+ height: 48,
66
+ },
67
+ value: {
68
+ fontSize: fonts.sizes.xs,
69
+ fontWeight: "600",
70
+ lineHeight: 21,
71
+ textAlign: "right",
72
+ color: colors.textAction,
73
+ },
74
+ storeCard: {
75
+ width: 9,
76
+ height: 9,
77
+ backgroundColor: allAvailable ? colors.textSuccess : colors.textHighlight,
78
+ borderRadius: 10,
79
+ },
80
+ isSelected: {
81
+ borderWidth: 1,
82
+ borderColor: colors.primary,
83
+ borderBottomColor: colors.primary,
84
+ },
85
+ unavailableItemContainer: {
86
+ position: "absolute",
87
+ top: 0,
88
+ left: 0,
89
+ right: 0,
90
+ bottom: 0,
91
+ backgroundColor: "rgba(255,255,255,0.7)",
92
+ justifyContent: "center",
93
+ alignItems: "center",
94
+ },
95
+ unavailableItem: {
96
+ width: "130%",
97
+ height: 1,
98
+ backgroundColor: colors.textDisabled,
99
+ position: "absolute",
100
+ transform: [{ rotate: "130deg" }],
101
+ },
102
+ tagsContainer: {
103
+ flexDirection: "row",
104
+ gap: spacing.xxs,
105
+ },
106
+ availableItemsContainerText: {
107
+ gap: spacing.xxs,
108
+ flexDirection: "row",
109
+ alignItems: "center",
110
+ },
111
+ availableItemsContainer: {
112
+ gap: spacing.xxxs,
113
+ },
114
+ });
115
+ };
@@ -0,0 +1,23 @@
1
+ export interface StoreCardProps {
2
+ storeName: string;
3
+ address: string;
4
+ distance: string;
5
+ itemsAvailable?: Array<{
6
+ itemIndex: number;
7
+ imageUrl: string;
8
+ name: string;
9
+ sellerName: string;
10
+ }>;
11
+ itemsUnavailable?: Array<{
12
+ itemIndex?: number;
13
+ imageUrl: string;
14
+ name: string;
15
+ sellerName: string;
16
+ }>;
17
+ pickupTime: string;
18
+ flags?: string[];
19
+ value?: string | number;
20
+ onPress: () => void;
21
+ isSelected?: boolean;
22
+ }
23
+ //# sourceMappingURL=store-card.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/store-card/store-card.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC;QACvB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,103 @@
1
+ export declare const useStoreCardStyles: ({ allAvailable }: {
2
+ allAvailable: boolean;
3
+ }) => {
4
+ container: {
5
+ width: "100%";
6
+ backgroundColor: any;
7
+ padding: any;
8
+ gap: any;
9
+ borderBottomWidth: number;
10
+ borderBottomColor: any;
11
+ paddingBottom: any;
12
+ };
13
+ header: {
14
+ flexDirection: "row";
15
+ justifyContent: "space-between";
16
+ alignItems: "center";
17
+ marginBottom: any;
18
+ };
19
+ storeName: {
20
+ fontSize: any;
21
+ fontWeight: "600";
22
+ lineHeight: number;
23
+ color: any;
24
+ textAlign: "left";
25
+ };
26
+ itemsAvailable: {
27
+ fontSize: any;
28
+ fontWeight: "400";
29
+ lineHeight: number;
30
+ textAlign: "left";
31
+ color: any;
32
+ };
33
+ pickupTime: {
34
+ fontSize: any;
35
+ fontWeight: "400";
36
+ lineHeight: number;
37
+ textAlign: "left";
38
+ color: any;
39
+ };
40
+ footer: {
41
+ flexDirection: "row";
42
+ justifyContent: "space-between";
43
+ alignItems: "center";
44
+ };
45
+ address: {
46
+ fontSize: any;
47
+ fontWeight: "400";
48
+ lineHeight: number;
49
+ textAlign: "left";
50
+ color: any;
51
+ };
52
+ distance: {
53
+ fontSize: any;
54
+ fontWeight: "600";
55
+ lineHeight: number;
56
+ textAlign: "left";
57
+ color: any;
58
+ flexDirection: "row";
59
+ alignItems: "center";
60
+ };
61
+ image: {
62
+ width: number;
63
+ height: number;
64
+ };
65
+ value: {
66
+ fontSize: any;
67
+ fontWeight: "600";
68
+ lineHeight: number;
69
+ textAlign: "right";
70
+ color: any;
71
+ };
72
+ storeCard: {
73
+ width: number;
74
+ height: number;
75
+ backgroundColor: any;
76
+ borderRadius: number;
77
+ };
78
+ isSelected: {
79
+ borderWidth: number;
80
+ borderColor: any;
81
+ borderBottomColor: any;
82
+ };
83
+ unavailableItemContainer: {
84
+ position: "absolute";
85
+ top: number;
86
+ left: number;
87
+ right: number;
88
+ bottom: number;
89
+ backgroundColor: string;
90
+ justifyContent: "center";
91
+ alignItems: "center";
92
+ };
93
+ unavailableItem: {
94
+ width: "130%";
95
+ height: number;
96
+ backgroundColor: any;
97
+ position: "absolute";
98
+ transform: {
99
+ rotate: string;
100
+ }[];
101
+ };
102
+ };
103
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/store-card/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,GAAI,kBAAgB;IAAC,YAAY,EAAE,OAAO,CAAA;CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGzE,CAAC"}
@@ -0,0 +1,103 @@
1
+ import { useTheme } from 'decathlon-ui';
2
+ import { StyleSheet } from 'react-native';
3
+ export const useStoreCardStyles = ({ allAvailable }) => {
4
+ const { colors, fonts, spacing } = useTheme();
5
+ return StyleSheet.create({
6
+ container: {
7
+ width: '100%',
8
+ backgroundColor: colors.backgroundPrimary,
9
+ padding: spacing.xs,
10
+ gap: spacing.md,
11
+ borderBottomWidth: 1,
12
+ borderBottomColor: colors.borderSecondary,
13
+ paddingBottom: spacing.md,
14
+ },
15
+ header: {
16
+ flexDirection: 'row',
17
+ justifyContent: 'space-between',
18
+ alignItems: 'center',
19
+ marginBottom: spacing.xs,
20
+ },
21
+ storeName: {
22
+ fontSize: fonts.sizes.xs,
23
+ fontWeight: '600',
24
+ lineHeight: 21,
25
+ color: colors.textPrimary,
26
+ textAlign: 'left',
27
+ },
28
+ itemsAvailable: {
29
+ fontSize: fonts.sizes.xxs,
30
+ fontWeight: '400',
31
+ lineHeight: 18,
32
+ textAlign: 'left',
33
+ color: allAvailable ? colors.textTertiary : colors.textHighlight, // TODO: ajustar a lógica para pegar o length do array
34
+ },
35
+ pickupTime: {
36
+ fontSize: fonts.sizes.xxs,
37
+ fontWeight: '400',
38
+ lineHeight: 18,
39
+ textAlign: 'left',
40
+ color: colors.textTertiary,
41
+ },
42
+ footer: {
43
+ flexDirection: 'row',
44
+ justifyContent: 'space-between',
45
+ alignItems: 'center',
46
+ },
47
+ address: {
48
+ fontSize: fonts.sizes.xxxs,
49
+ fontWeight: '400',
50
+ lineHeight: 10,
51
+ textAlign: 'left',
52
+ color: colors.textTertiary,
53
+ },
54
+ distance: {
55
+ fontSize: fonts.sizes.xxs,
56
+ fontWeight: '600',
57
+ lineHeight: 18,
58
+ textAlign: 'left',
59
+ color: colors.textSecondary,
60
+ flexDirection: 'row',
61
+ alignItems: 'center',
62
+ },
63
+ image: {
64
+ width: 48,
65
+ height: 48,
66
+ },
67
+ value: {
68
+ fontSize: fonts.sizes.xs,
69
+ fontWeight: '600',
70
+ lineHeight: 21,
71
+ textAlign: 'right',
72
+ color: colors.textAction,
73
+ },
74
+ storeCard: {
75
+ width: 9,
76
+ height: 9,
77
+ backgroundColor: allAvailable ? colors.textSuccess : colors.textHighlight,
78
+ borderRadius: 10,
79
+ },
80
+ isSelected: {
81
+ borderWidth: 1,
82
+ borderColor: colors.primary,
83
+ borderBottomColor: colors.primary,
84
+ },
85
+ unavailableItemContainer: {
86
+ position: 'absolute',
87
+ top: 0,
88
+ left: 0,
89
+ right: 0,
90
+ bottom: 0,
91
+ backgroundColor: 'rgba(255,255,255,0.7)',
92
+ justifyContent: 'center',
93
+ alignItems: 'center',
94
+ },
95
+ unavailableItem: {
96
+ width: '130%',
97
+ height: 1,
98
+ backgroundColor: colors.textDisabled,
99
+ position: 'absolute',
100
+ transform: [{ rotate: '130deg' }],
101
+ },
102
+ });
103
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./toast.component";
2
+ export * from "./toast.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./toast.component";
2
+ export * from "./toast.types";
@@ -0,0 +1,11 @@
1
+ import { ShowToastParams } from "./toast.types";
2
+ interface ToastProps {
3
+ message: string;
4
+ description?: string;
5
+ type?: ShowToastParams["type"];
6
+ duration?: number;
7
+ onHide: () => void;
8
+ }
9
+ export declare function Toast({ message, description, type, duration, onHide, }: ToastProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=toast.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.component.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast.component.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,WAAW,EACX,IAAa,EACb,QAAe,EACf,MAAM,GACP,EAAE,UAAU,2CA0DZ"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useMemo } from "react";
3
+ import { Animated, Text, View } from "react-native";
4
+ import { AlertTriangleIcon, CheckIcon, InfoIcon, XIcon } from "../../icons";
5
+ import { useTheme } from "../../themes";
6
+ import { Button } from "../button";
7
+ import { useToastStyles } from "./toast.styles";
8
+ export function Toast({ message, description, type = "info", duration = 3000, onHide, }) {
9
+ const { colors } = useTheme();
10
+ const styles = useToastStyles({ type });
11
+ const opacity = useMemo(() => new Animated.Value(0), []);
12
+ const getIcon = () => {
13
+ const icons = {
14
+ success: _jsx(CheckIcon, { size: 24, color: colors.green5 }),
15
+ error: _jsx(XIcon, { size: 24, color: colors.red5 }),
16
+ info: _jsx(InfoIcon, { size: 24, color: colors.blue5 }),
17
+ warning: _jsx(AlertTriangleIcon, { size: 24, color: colors.yellow5 }),
18
+ alert_info: _jsx(_Fragment, {}),
19
+ };
20
+ return icons[type];
21
+ };
22
+ useLayoutEffect(() => {
23
+ const animation = Animated.sequence([
24
+ Animated.timing(opacity, {
25
+ toValue: 1,
26
+ duration: 300,
27
+ useNativeDriver: true,
28
+ }),
29
+ Animated.delay(duration),
30
+ Animated.timing(opacity, {
31
+ toValue: 0,
32
+ duration: 300,
33
+ useNativeDriver: true,
34
+ }),
35
+ ]);
36
+ animation.start(() => onHide());
37
+ return () => {
38
+ animation.stop();
39
+ };
40
+ }, [duration, opacity, onHide]);
41
+ return (_jsxs(Animated.View, { style: [styles.container, { opacity }], children: [_jsx(View, { style: styles.iconContainer, children: getIcon() }), _jsxs(View, { style: styles.textContainer, children: [_jsx(Text, { style: styles.message, children: message }), description && _jsx(Text, { style: styles.description, children: description }), type === "alert_info" && (_jsx(View, { style: styles.footerButton, children: _jsx(Button, { label: "Entendi", variant: "primary", size: "medium", onPress: onHide }) }))] })] }));
42
+ }
@@ -0,0 +1,16 @@
1
+ import { CreateToastStylesProps } from "./toast.types";
2
+ export declare function useToastStyles(data: CreateToastStylesProps): {
3
+ container: any;
4
+ iconContainer: {
5
+ marginRight: number;
6
+ };
7
+ textContainer: {
8
+ flex: number;
9
+ };
10
+ message: any;
11
+ description: any;
12
+ footerButton: {
13
+ marginTop: number;
14
+ };
15
+ };
16
+ //# sourceMappingURL=toast.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.styles.d.ts","sourceRoot":"","sources":["../../../src/components/toast/toast.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,wBAAgB,cAAc,CAAC,IAAI,EAAE,sBAAsB;;;;;;;;;;;;;EAyD1D"}