decathlon-ui 0.3.45 → 0.3.47
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.
- package/dist/components/product-card/product-card.types.d.ts +2 -2
- package/dist/components/product-card/product-card.types.d.ts.map +1 -1
- package/dist/components/quick-add-product-card/quick-add-product-card.component.d.ts.map +1 -1
- package/dist/components/quick-add-product-card/quick-add-product-card.component.js +3 -3
- package/dist/components/quick-add-product-card/quick-add-product-card.types.d.ts +3 -1
- package/dist/components/quick-add-product-card/quick-add-product-card.types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
1
|
+
import { StyleProp, ViewProps, ViewStyle } from "react-native";
|
|
2
2
|
export type ProductCardVariant = "grid" | "shelf" | "lastViewed";
|
|
3
|
-
export interface ProductCardProps {
|
|
3
|
+
export interface ProductCardProps extends ViewProps {
|
|
4
4
|
variant?: ProductCardVariant;
|
|
5
5
|
imageUrl: string;
|
|
6
6
|
brand: string;
|
|
@@ -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;
|
|
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,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;AAEjE,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,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,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,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,CAAC,EAAE,MAAM,CAAC;QACd,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":"quick-add-product-card.component.d.ts","sourceRoot":"","sources":["../../../src/components/quick-add-product-card/quick-add-product-card.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"quick-add-product-card.component.d.ts","sourceRoot":"","sources":["../../../src/components/quick-add-product-card/quick-add-product-card.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AA2F/E,eAAO,MAAM,mBAAmB,sDAA2C,CAAC"}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { Image, Text, TouchableOpacity, View } from "react-native";
|
|
4
4
|
import { AddToBagIcon } from "../../icons";
|
|
5
5
|
import { useQuickAddProductCardStyles } from "./quick-add-product-card.styles";
|
|
6
|
-
const QuickAddProductCardComponent = ({ imageUrl, productName, price, onAddPress, onPress, testID, }) => {
|
|
6
|
+
const QuickAddProductCardComponent = ({ imageUrl, productName, price, onAddPress, onPress, testID, ...props }) => {
|
|
7
7
|
const styles = useQuickAddProductCardStyles();
|
|
8
8
|
const handleAddPress = React.useCallback((e) => {
|
|
9
9
|
e.stopPropagation();
|
|
@@ -11,9 +11,9 @@ const QuickAddProductCardComponent = ({ imageUrl, productName, price, onAddPress
|
|
|
11
11
|
}, [onAddPress]);
|
|
12
12
|
const renderContent = React.useCallback(() => (_jsxs(View, { style: styles.cardContainer, children: [_jsx(View, { style: styles.imageContainer, children: _jsx(Image, { resizeMode: "cover", source: { uri: imageUrl }, style: styles.productImage, accessibilityLabel: `Imagem do produto ${productName}` }) }), _jsxs(View, { style: styles.contentContainer, children: [_jsx(Text, { numberOfLines: 3, style: styles.nameText, ellipsizeMode: "head", accessibilityLabel: `Nome do produto: ${productName}`, children: productName }), _jsx(Text, { style: styles.priceText, accessibilityLabel: `Preço: ${price}`, children: price })] }), _jsx(TouchableOpacity, { style: styles.addButton, onPress: handleAddPress, accessibilityLabel: "Adicionar ao carrinho", accessibilityRole: "button", children: _jsx(AddToBagIcon, { color: "#FFFFFF", size: 18 }) })] })), [handleAddPress, imageUrl, price, productName, styles]);
|
|
13
13
|
if (onPress) {
|
|
14
|
-
return (_jsx(TouchableOpacity, { style: styles.touchable, onPress: onPress, testID: testID, accessibilityRole: "button", accessibilityLabel: `Produto ${productName}`, children: renderContent() }));
|
|
14
|
+
return (_jsx(TouchableOpacity, { style: [styles.touchable, props.style], onPress: onPress, testID: testID, accessibilityRole: "button", accessibilityLabel: `Produto ${productName}`, ...props, children: renderContent() }));
|
|
15
15
|
}
|
|
16
|
-
return (_jsx(View, { style: styles.touchable, testID: testID, accessibilityRole: "none", accessibilityLabel: `Produto ${productName}`, children: renderContent() }));
|
|
16
|
+
return (_jsx(View, { style: [styles.touchable, props.style], testID: testID, accessibilityRole: "none", accessibilityLabel: `Produto ${productName}`, ...props, children: renderContent() }));
|
|
17
17
|
};
|
|
18
18
|
export const QuickAddProductCard = React.memo(QuickAddProductCardComponent);
|
|
19
19
|
QuickAddProductCard.displayName = "QuickAddProductCard";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { StyleProp, ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
export interface QuickAddProductCardProps extends ViewProps {
|
|
2
3
|
imageUrl: string;
|
|
3
4
|
productName: string;
|
|
4
5
|
price: string;
|
|
5
6
|
onAddPress?: () => void;
|
|
6
7
|
onPress?: () => void;
|
|
7
8
|
testID?: string;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=quick-add-product-card.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-add-product-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/quick-add-product-card/quick-add-product-card.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"quick-add-product-card.types.d.ts","sourceRoot":"","sources":["../../../src/components/quick-add-product-card/quick-add-product-card.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B"}
|