@lookiero/checkout 9.3.0 → 9.4.0-beta.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.
- package/dist/pact.config.d.ts +21 -0
- package/dist/pact.config.js +16 -0
- package/dist/public/public/assets/adaptive-icon.png +0 -0
- package/dist/public/public/assets/favicon.png +0 -0
- package/dist/public/public/assets/icon.png +0 -0
- package/dist/public/public/assets/splash.png +0 -0
- package/dist/public/public/images/not-found.png +0 -0
- package/dist/src/ExpoRoot.js +2 -2
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/bookedProductsVariants/httpBookedProductsVariantsForCheckoutItemView.pact.js +55 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpCheckoutByIdView.pact.js +116 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpFirstAvailableCheckoutByCustomerIdView.pact.js +56 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpFiveItemsDiscountByCustomerIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpIsCheckoutEnabledByCustomerIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkout/httpIsSizeChangeEnabledByCheckoutIdView.pact.js +51 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.d.ts +13 -0
- package/dist/src/infrastructure/projection/checkout/react/useViewIsCheckoutAccessibleByCustomerId.js +19 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutBooking/httpCheckoutBookingByIdView.pact.js +56 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutItem/httpCheckoutItemByIdView.pact.js +57 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/checkoutQuestion/httpCheckoutQuestionsByCheckoutIdView.pact.js +55 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/payment/httpPaymentFlowPayloadByCheckoutIdView.pact.js +120 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/pricing/httpPricingByCheckoutIdView.pact.js +55 -0
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.d.ts +1 -0
- package/dist/src/infrastructure/projection/returnQuestion/httpReturnQuestionsByCheckoutItemIdView.pact.js +55 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.d.ts +22 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/Layout.js +1 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/footer/Footer.js +5 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.js +6 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/components/header/Header.style.js +20 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.d.ts +4 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.js +43 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/components/layouts/layout/dummyLayout/DummyLayout.style.js +14 -0
- package/dist/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.js +8 -6
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.d.ts +7 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.js +21 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.d.ts +8 -0
- package/dist/src/infrastructure/ui/components/templates/header/defaultHeader/DefaultHeader.style.js +12 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.d.ts +12 -0
- package/dist/src/infrastructure/ui/hooks/useNewFeedbackExperiment.js +64 -0
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.d.ts +10 -0
- package/dist/src/infrastructure/ui/i18n/fetchTranslations.js +17 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.d.ts +20 -0
- package/dist/src/infrastructure/ui/i18n/translationEndpoint.js +27 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.d.ts +10 -0
- package/dist/src/infrastructure/ui/routing/CheckoutAccessibilityMiddleware.js +27 -0
- package/dist/src/infrastructure/ui/views/App.style.d.ts +6 -0
- package/dist/src/infrastructure/ui/views/App.style.js +8 -0
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/feedback/components/checkoutQuestionsForm/CheckoutQuestionsForm.style.js +11 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.js +64 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.d.ts +12 -0
- package/dist/src/infrastructure/ui/views/item/components/returnQuestionsForm/ReturnQuestionsForm.style.js +16 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.d.ts +40 -0
- package/dist/src/infrastructure/ui/views/return/Return.style.js +44 -0
- package/dist/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.js +9 -5
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.d.ts +14 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.js +28 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.d.ts +7 -0
- package/dist/src/infrastructure/ui/views/summary/components/stickyPricing/StickyPricing.style.js +11 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.d.ts +26 -0
- package/dist/src/projection/checkout/viewIsCheckoutAccessibleByCustomerId.js +21 -0
- package/dist/src/projection/shared/country.d.ts +14 -0
- package/dist/src/projection/shared/country.js +15 -0
- package/dist/src/projection/shared/customer.d.ts +9 -0
- package/dist/src/projection/shared/customer.js +1 -0
- package/dist/src/projection/shared/locale.d.ts +12 -0
- package/dist/src/projection/shared/locale.js +13 -0
- package/dist/src/projection/shared/order.d.ts +6 -0
- package/dist/src/projection/shared/order.js +1 -0
- package/dist/src/projection/shared/price.d.ts +11 -0
- package/dist/src/projection/shared/price.js +1 -0
- package/dist/src/projection/shared/size.d.ts +21 -0
- package/dist/src/projection/shared/size.js +4 -0
- package/dist/src/projection/shared/subscription.d.ts +2 -0
- package/dist/src/projection/shared/subscription.js +1 -0
- package/dist/src/shared/ui/components/atoms/error/Error.d.ts +11 -0
- package/dist/src/shared/ui/components/atoms/error/Error.js +6 -0
- package/dist/src/shared/ui/components/atoms/field/Field.js +15 -12
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -2
- package/src/ExpoRoot.tsx +2 -2
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostSelectReturnQuestionItem/HostSelectReturnQuestionItem.test.tsx +1 -1
- package/src/infrastructure/ui/components/organisms/returnQuestions/components/hostStackReturnQuestionItem/modal/HostStackReturnQuestionItem.tsx +10 -8
- package/src/infrastructure/ui/views/item/components/getOutOfCheckoutModal/__snapshots__/GetOutOfCheckoutModal.test.tsx.snap +26 -2
- package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +375 -0
- package/src/infrastructure/ui/views/item/components/productVariantSlider/__snapshots__/ProductVariantSlider.test.tsx.snap +20 -0
- package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +26 -2
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/SizeWithoutStockModal.test.tsx +2 -2
- package/src/infrastructure/ui/views/item/components/sizeWithoutStockModal/__snapshots__/SizeWithoutStockModal.test.tsx.snap +26 -2
- package/src/infrastructure/ui/views/item/views/productVariant/__snapshots__/ProductVariant.test.tsx.snap +60 -0
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx +17 -7
- package/src/infrastructure/ui/views/summary/components/collapsiblePricing/__snapshots__/CollapsiblePricing.test.tsx.snap +16 -0
- package/src/infrastructure/ui/views/summaryTabs/components/checkoutItemsTabs/__snapshots__/CheckoutItemsTabs.test.tsx.snap +15 -8
- package/src/shared/ui/components/atoms/field/Field.tsx +18 -18
- package/src/shared/ui/components/atoms/field/__snapshots__/Field.test.tsx.snap +36 -0
- package/src/shared/ui/components/molecules/inputField/__snapshots__/InputField.test.tsx.snap +18 -0
|
@@ -58,7 +58,15 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
accessible={true}
|
|
61
|
+
collapsable={false}
|
|
61
62
|
focusable={true}
|
|
63
|
+
jestAnimatedStyle={
|
|
64
|
+
{
|
|
65
|
+
"value": {
|
|
66
|
+
"opacity": 1,
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
}
|
|
62
70
|
onClick={[Function]}
|
|
63
71
|
onResponderGrant={[Function]}
|
|
64
72
|
onResponderMove={[Function]}
|
|
@@ -70,7 +78,7 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
|
|
|
70
78
|
{
|
|
71
79
|
"backgroundColor": "rgba(12, 10, 10, 0.7)",
|
|
72
80
|
"height": "100%",
|
|
73
|
-
"opacity":
|
|
81
|
+
"opacity": 1,
|
|
74
82
|
"position": "absolute",
|
|
75
83
|
"width": "100%",
|
|
76
84
|
"zIndex": 1,
|
|
@@ -108,6 +116,22 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
|
|
|
108
116
|
}
|
|
109
117
|
>
|
|
110
118
|
<View
|
|
119
|
+
collapsable={false}
|
|
120
|
+
jestAnimatedStyle={
|
|
121
|
+
{
|
|
122
|
+
"value": {
|
|
123
|
+
"opacity": 1,
|
|
124
|
+
"transform": [
|
|
125
|
+
{
|
|
126
|
+
"translateY": 0,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"scale": 1,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
}
|
|
111
135
|
onLayout={[Function]}
|
|
112
136
|
pointerEvents="auto"
|
|
113
137
|
style={
|
|
@@ -121,7 +145,7 @@ exports[`SizeWithoutStockModal component matches the snapshot 1`] = `
|
|
|
121
145
|
"position": "absolute",
|
|
122
146
|
"transform": [
|
|
123
147
|
{
|
|
124
|
-
"translateY":
|
|
148
|
+
"translateY": 0,
|
|
125
149
|
},
|
|
126
150
|
{
|
|
127
151
|
"scale": 1,
|
|
@@ -476,6 +476,16 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
476
476
|
"selected": true,
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
+
collapsable={false}
|
|
480
|
+
jestAnimatedStyle={
|
|
481
|
+
{
|
|
482
|
+
"value": {
|
|
483
|
+
"height": 8,
|
|
484
|
+
"opacity": 1,
|
|
485
|
+
"width": 8,
|
|
486
|
+
},
|
|
487
|
+
}
|
|
488
|
+
}
|
|
479
489
|
style={
|
|
480
490
|
{
|
|
481
491
|
"backgroundColor": "#0C0A0A",
|
|
@@ -526,6 +536,16 @@ exports[`ItemActions component matches the snapshot for a KEPT checkoutItem 1`]
|
|
|
526
536
|
"selected": false,
|
|
527
537
|
}
|
|
528
538
|
}
|
|
539
|
+
collapsable={false}
|
|
540
|
+
jestAnimatedStyle={
|
|
541
|
+
{
|
|
542
|
+
"value": {
|
|
543
|
+
"height": 8,
|
|
544
|
+
"opacity": 0.3,
|
|
545
|
+
"width": 8,
|
|
546
|
+
},
|
|
547
|
+
}
|
|
548
|
+
}
|
|
529
549
|
style={
|
|
530
550
|
{
|
|
531
551
|
"backgroundColor": "#0C0A0A",
|
|
@@ -1158,6 +1178,16 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
1158
1178
|
"selected": true,
|
|
1159
1179
|
}
|
|
1160
1180
|
}
|
|
1181
|
+
collapsable={false}
|
|
1182
|
+
jestAnimatedStyle={
|
|
1183
|
+
{
|
|
1184
|
+
"value": {
|
|
1185
|
+
"height": 8,
|
|
1186
|
+
"opacity": 1,
|
|
1187
|
+
"width": 8,
|
|
1188
|
+
},
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1161
1191
|
style={
|
|
1162
1192
|
{
|
|
1163
1193
|
"backgroundColor": "#0C0A0A",
|
|
@@ -1208,6 +1238,16 @@ exports[`ItemActions component matches the snapshot for a REPLACED checkoutItem
|
|
|
1208
1238
|
"selected": false,
|
|
1209
1239
|
}
|
|
1210
1240
|
}
|
|
1241
|
+
collapsable={false}
|
|
1242
|
+
jestAnimatedStyle={
|
|
1243
|
+
{
|
|
1244
|
+
"value": {
|
|
1245
|
+
"height": 8,
|
|
1246
|
+
"opacity": 0.3,
|
|
1247
|
+
"width": 8,
|
|
1248
|
+
},
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1211
1251
|
style={
|
|
1212
1252
|
{
|
|
1213
1253
|
"backgroundColor": "#0C0A0A",
|
|
@@ -1840,6 +1880,16 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1840
1880
|
"selected": true,
|
|
1841
1881
|
}
|
|
1842
1882
|
}
|
|
1883
|
+
collapsable={false}
|
|
1884
|
+
jestAnimatedStyle={
|
|
1885
|
+
{
|
|
1886
|
+
"value": {
|
|
1887
|
+
"height": 8,
|
|
1888
|
+
"opacity": 1,
|
|
1889
|
+
"width": 8,
|
|
1890
|
+
},
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1843
1893
|
style={
|
|
1844
1894
|
{
|
|
1845
1895
|
"backgroundColor": "#0C0A0A",
|
|
@@ -1890,6 +1940,16 @@ exports[`ItemActions component matches the snapshot for an INITIAL checkoutItem
|
|
|
1890
1940
|
"selected": false,
|
|
1891
1941
|
}
|
|
1892
1942
|
}
|
|
1943
|
+
collapsable={false}
|
|
1944
|
+
jestAnimatedStyle={
|
|
1945
|
+
{
|
|
1946
|
+
"value": {
|
|
1947
|
+
"height": 8,
|
|
1948
|
+
"opacity": 0.3,
|
|
1949
|
+
"width": 8,
|
|
1950
|
+
},
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1893
1953
|
style={
|
|
1894
1954
|
{
|
|
1895
1955
|
"backgroundColor": "#0C0A0A",
|
package/src/infrastructure/ui/views/summary/components/collapsiblePricing/CollapsiblePricing.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { animated, useSpring } from "@react-spring/native";
|
|
2
1
|
import React, { FC } from "react";
|
|
3
2
|
import { Pressable, View } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
4
4
|
import { Button, Icon, Text } from "@lookiero/aurora";
|
|
5
5
|
import { useI18nMessage } from "@lookiero/i18n-react";
|
|
6
6
|
import { PricingProjection } from "../../../../../../projection/pricing/pricing";
|
|
@@ -35,8 +35,18 @@ const CollapsiblePricing: FC<CollapsiblePricingProps> = ({
|
|
|
35
35
|
values: { items: totalCheckoutItemsKept.toString() },
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const collapsedOpacity = useSharedValue(collapsed ? 1 : 0);
|
|
39
|
+
collapsedOpacity.value = collapsed ? 1 : 0;
|
|
40
|
+
const collapsedAnimatedStyle = useAnimatedStyle(
|
|
41
|
+
() => ({ opacity: withTiming(collapsedOpacity.value) }),
|
|
42
|
+
[collapsedOpacity.value],
|
|
43
|
+
);
|
|
44
|
+
const notCollapsedOpacity = useSharedValue(collapsed ? 0 : 1);
|
|
45
|
+
notCollapsedOpacity.value = collapsed ? 0 : 1;
|
|
46
|
+
const notCollapsedAnimatedStyle = useAnimatedStyle(
|
|
47
|
+
() => ({ opacity: withTiming(notCollapsedOpacity.value) }),
|
|
48
|
+
[notCollapsedOpacity.value],
|
|
49
|
+
);
|
|
40
50
|
|
|
41
51
|
return (
|
|
42
52
|
<>
|
|
@@ -51,7 +61,7 @@ const CollapsiblePricing: FC<CollapsiblePricingProps> = ({
|
|
|
51
61
|
)}
|
|
52
62
|
|
|
53
63
|
{collapsed && collapsible ? (
|
|
54
|
-
<
|
|
64
|
+
<Animated.View key="collapsed" style={[style.collapsed, collapsedAnimatedStyle]}>
|
|
55
65
|
<View style={style.collapsedContent}>
|
|
56
66
|
<Text level={1} style={style.totalCollapsed} detail>
|
|
57
67
|
{totalText} {totalCheckoutItemsKeptText}
|
|
@@ -64,15 +74,15 @@ const CollapsiblePricing: FC<CollapsiblePricingProps> = ({
|
|
|
64
74
|
{submitButtonText}
|
|
65
75
|
</Button>
|
|
66
76
|
</View>
|
|
67
|
-
</
|
|
77
|
+
</Animated.View>
|
|
68
78
|
) : (
|
|
69
|
-
<
|
|
79
|
+
<Animated.View key="not-collapsed" style={notCollapsedAnimatedStyle}>
|
|
70
80
|
<Pricing pricing={pricing} totalCheckoutItemsKept={totalCheckoutItemsKept} />
|
|
71
81
|
|
|
72
82
|
<Button testID="submit-checkout-button" onPress={onSubmit}>
|
|
73
83
|
{submitButtonText}
|
|
74
84
|
</Button>
|
|
75
|
-
</
|
|
85
|
+
</Animated.View>
|
|
76
86
|
)}
|
|
77
87
|
</>
|
|
78
88
|
);
|
|
@@ -91,6 +91,14 @@ exports[`Pricing component matches the snapshot for collaped pricing: collapsed
|
|
|
91
91
|
</Text>
|
|
92
92
|
</View>
|
|
93
93
|
<View
|
|
94
|
+
collapsable={false}
|
|
95
|
+
jestAnimatedStyle={
|
|
96
|
+
{
|
|
97
|
+
"value": {
|
|
98
|
+
"opacity": 1,
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
}
|
|
94
102
|
style={
|
|
95
103
|
{
|
|
96
104
|
"flexDirection": "row",
|
|
@@ -391,6 +399,14 @@ exports[`Pricing component matches the snapshot for non-collaped pricing: non-co
|
|
|
391
399
|
</Text>
|
|
392
400
|
</View>
|
|
393
401
|
<View
|
|
402
|
+
collapsable={false}
|
|
403
|
+
jestAnimatedStyle={
|
|
404
|
+
{
|
|
405
|
+
"value": {
|
|
406
|
+
"opacity": 1,
|
|
407
|
+
},
|
|
408
|
+
}
|
|
409
|
+
}
|
|
394
410
|
style={
|
|
395
411
|
{
|
|
396
412
|
"flexDirection": "row",
|
|
@@ -193,6 +193,12 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
193
193
|
</Text>
|
|
194
194
|
</View>
|
|
195
195
|
<View
|
|
196
|
+
collapsable={false}
|
|
197
|
+
jestAnimatedStyle={
|
|
198
|
+
{
|
|
199
|
+
"value": {},
|
|
200
|
+
}
|
|
201
|
+
}
|
|
196
202
|
style={
|
|
197
203
|
{
|
|
198
204
|
"backgroundColor": "#0C0A0A",
|
|
@@ -200,22 +206,23 @@ exports[`CheckoutItemTabs component matches the snapshot 1`] = `
|
|
|
200
206
|
"display": "flex",
|
|
201
207
|
"height": 2,
|
|
202
208
|
"left": 0,
|
|
203
|
-
"opacity": 0,
|
|
204
209
|
"position": "absolute",
|
|
205
|
-
"transform": [
|
|
206
|
-
{
|
|
207
|
-
"translateX": 0,
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
"width": 0,
|
|
211
210
|
}
|
|
212
211
|
}
|
|
213
212
|
/>
|
|
214
213
|
</View>
|
|
215
214
|
<View
|
|
215
|
+
collapsable={false}
|
|
216
|
+
jestAnimatedStyle={
|
|
217
|
+
{
|
|
218
|
+
"value": {
|
|
219
|
+
"opacity": 1,
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
}
|
|
216
223
|
style={
|
|
217
224
|
{
|
|
218
|
-
"opacity":
|
|
225
|
+
"opacity": 1,
|
|
219
226
|
"paddingBottom": 24,
|
|
220
227
|
"paddingHorizontal": 24,
|
|
221
228
|
"paddingTop": 8,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { animated, useSpring } from "@react-spring/native";
|
|
2
1
|
import React, { FC, useCallback, useState } from "react";
|
|
3
2
|
import { LayoutChangeEvent, StyleProp, TextStyle, View, ViewStyle } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
|
|
4
4
|
import { Text } from "@lookiero/aurora";
|
|
5
5
|
import { theme } from "@lookiero/sty-psp-ui";
|
|
6
6
|
import { style } from "./Field.style";
|
|
@@ -23,30 +23,30 @@ const Field: FC<FieldProps> = ({ label, isFocused = false, style: customStyle })
|
|
|
23
23
|
const [width, setWidth] = useState<number>(0);
|
|
24
24
|
const handleOnLayout = useCallback(({ nativeEvent: { layout } }: LayoutChangeEvent) => setWidth(layout.width), []);
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const scale = useSharedValue(isFocused ? SCALE : 1);
|
|
27
|
+
scale.value = isFocused ? SCALE : 1;
|
|
28
|
+
const translateY = useSharedValue(isFocused ? -14 : space4);
|
|
29
|
+
translateY.value = isFocused ? -14 : space4;
|
|
30
|
+
const translateX = useSharedValue(isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0);
|
|
31
|
+
translateX.value = isFocused ? -(((1 - SCALE) * width) / 2 + space1) : 0;
|
|
32
|
+
const animatedStyle = useAnimatedStyle(
|
|
33
|
+
() => ({
|
|
34
|
+
transform: [
|
|
35
|
+
{ scale: withTiming(scale.value) },
|
|
36
|
+
{ translateY: withTiming(translateY.value) },
|
|
37
|
+
{ translateX: withTiming(translateX.value) },
|
|
38
|
+
],
|
|
39
|
+
}),
|
|
40
|
+
[scale.value, translateX.value, translateY.value],
|
|
30
41
|
);
|
|
31
42
|
|
|
32
43
|
return (
|
|
33
|
-
<
|
|
34
|
-
pointerEvents="none"
|
|
35
|
-
style={[
|
|
36
|
-
{
|
|
37
|
-
transform: [{ scale: springs.scale }, { translateY: springs.translateY }, { translateX: springs.translateX }],
|
|
38
|
-
},
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
customStyle?.field,
|
|
42
|
-
]}
|
|
43
|
-
onLayout={handleOnLayout}
|
|
44
|
-
>
|
|
44
|
+
<Animated.View pointerEvents="none" style={[customStyle?.field, animatedStyle]} onLayout={handleOnLayout}>
|
|
45
45
|
<Text level={1} numberOfLines={1} style={[style.fieldText, customStyle?.fieldText]} detail>
|
|
46
46
|
{label}
|
|
47
47
|
</Text>
|
|
48
48
|
<View style={[style.fieldBackground, { opacity: isFocused ? 1 : 0 }]} />
|
|
49
|
-
</
|
|
49
|
+
</Animated.View>
|
|
50
50
|
);
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -30,6 +30,24 @@ exports[`Field atom matches the snapshot for a non-focused: non-focused 1`] = `
|
|
|
30
30
|
<RCTSafeAreaView />
|
|
31
31
|
</View>
|
|
32
32
|
<View
|
|
33
|
+
collapsable={false}
|
|
34
|
+
jestAnimatedStyle={
|
|
35
|
+
{
|
|
36
|
+
"value": {
|
|
37
|
+
"transform": [
|
|
38
|
+
{
|
|
39
|
+
"scale": 1,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"translateY": 16,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"translateX": 0,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
}
|
|
33
51
|
onLayout={[Function]}
|
|
34
52
|
pointerEvents="none"
|
|
35
53
|
style={
|
|
@@ -124,6 +142,24 @@ exports[`Field atom matches the snapshot for focused: focused 1`] = `
|
|
|
124
142
|
<RCTSafeAreaView />
|
|
125
143
|
</View>
|
|
126
144
|
<View
|
|
145
|
+
collapsable={false}
|
|
146
|
+
jestAnimatedStyle={
|
|
147
|
+
{
|
|
148
|
+
"value": {
|
|
149
|
+
"transform": [
|
|
150
|
+
{
|
|
151
|
+
"scale": 0.75,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"translateY": -14,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"translateX": -4,
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
}
|
|
162
|
+
}
|
|
127
163
|
onLayout={[Function]}
|
|
128
164
|
pointerEvents="none"
|
|
129
165
|
style={
|
package/src/shared/ui/components/molecules/inputField/__snapshots__/InputField.test.tsx.snap
CHANGED
|
@@ -45,6 +45,24 @@ exports[`InputField molecule matches the snapshot 1`] = `
|
|
|
45
45
|
testID="input-field"
|
|
46
46
|
>
|
|
47
47
|
<View
|
|
48
|
+
collapsable={false}
|
|
49
|
+
jestAnimatedStyle={
|
|
50
|
+
{
|
|
51
|
+
"value": {
|
|
52
|
+
"transform": [
|
|
53
|
+
{
|
|
54
|
+
"scale": 0.75,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"translateY": -14,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"translateX": -4,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
}
|
|
48
66
|
onLayout={[Function]}
|
|
49
67
|
pointerEvents="none"
|
|
50
68
|
style={
|