@lookiero/checkout 15.2.3 → 15.3.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/public/public/assets/adaptive-icon.png +0 -0
  3. package/dist/public/public/assets/favicon.png +0 -0
  4. package/dist/public/public/assets/icon.png +0 -0
  5. package/dist/public/public/assets/splash.png +0 -0
  6. package/dist/public/public/images/not-found.png +0 -0
  7. package/dist/src/ExpoRoot.js +1 -1
  8. package/dist/src/infrastructure/projection/pricing/pricing.d.ts +31 -0
  9. package/dist/src/infrastructure/projection/pricing/pricing.js +39 -0
  10. package/dist/src/infrastructure/ui/hooks/useCheckoutFlow.js +1 -1
  11. package/dist/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.js +2 -1
  12. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.d.ts +0 -1
  13. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.js +19 -10
  14. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.d.ts +21 -10
  15. package/dist/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.js +24 -16
  16. package/dist/src/version.d.ts +2 -2
  17. package/dist/src/version.js +2 -2
  18. package/package.json +3 -3
  19. package/src/ExpoRoot.tsx +2 -2
  20. package/src/infrastructure/ui/hooks/useCheckoutFlow.tsx +3 -3
  21. package/src/infrastructure/ui/views/checkout/components/paymentInstrument/PaymentInstrument.tsx +1 -1
  22. package/src/infrastructure/ui/views/item/components/itemActions/ItemActions.test.tsx +4 -0
  23. package/src/infrastructure/ui/views/item/components/itemActions/__snapshots__/ItemActions.test.tsx.snap +277 -100
  24. package/src/infrastructure/ui/views/item/components/selectModal/SelecModal.test.tsx +62 -7
  25. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.style.ts +35 -18
  26. package/src/infrastructure/ui/views/item/components/selectModal/SelectModal.tsx +36 -32
  27. package/src/infrastructure/ui/views/item/components/selectModal/__snapshots__/SelecModal.test.tsx.snap +280 -44
  28. /package/dist/public/{index.html → public/index.html} +0 -0
@@ -1,12 +1,12 @@
1
- import React, { FC, useCallback, useMemo } from "react";
2
- import { StyleProp, TextStyle, TouchableHighlight, View, ViewStyle } from "react-native";
3
- import { Text } from "@lookiero/sty-psp-ui";
4
- import { Modal } from "@lookiero/sty-psp-ui";
1
+ import React, { FC, useMemo } from "react";
2
+ import { StyleProp, TextStyle, Pressable, View, ViewStyle } from "react-native";
3
+ import { Checkbox, Modal, Text } from "@lookiero/sty-psp-ui";
4
+ import { Tradename } from "@lookiero/sty-sp-tradename";
5
+ import { useStaticInfo } from "../../../../hooks/useStaticInfo";
5
6
  import { style as modalStyle } from "./SelectModal.style";
6
7
 
7
8
  interface SelectModalStyle {
8
9
  readonly modalContent: StyleProp<ViewStyle>;
9
- readonly option: StyleProp<ViewStyle>;
10
10
  readonly optionText: StyleProp<TextStyle>;
11
11
  }
12
12
 
@@ -38,15 +38,8 @@ const SelectModal: FC<SelectModalProps> = ({
38
38
  onChange = () => void 0,
39
39
  onClose = () => void 0,
40
40
  }) => {
41
- const handleOnPressOption = useCallback(
42
- (value: string) => {
43
- onChange(value);
44
- onClose();
45
- },
46
- [onClose, onChange],
47
- );
48
-
49
41
  const style = useMemo(() => modalStyle(), []);
42
+ const { tradename } = useStaticInfo();
50
43
 
51
44
  return (
52
45
  <Modal
@@ -63,25 +56,36 @@ const SelectModal: FC<SelectModalProps> = ({
63
56
  {title}
64
57
  </Text>
65
58
  )}
66
- {options.map(({ label, value: optionValue }) => (
67
- <TouchableHighlight
68
- key={optionValue}
69
- accessibilityLabel={optionValue}
70
- disabled={value === optionValue}
71
- style={[style.option, customStyle?.option]}
72
- testID={optionValue}
73
- underlayColor={style.underlayColor}
74
- accessible
75
- onPress={value !== optionValue ? () => handleOnPressOption(optionValue) : undefined}
76
- >
77
- <Text
78
- level={3}
79
- style={[style.optionText, value === optionValue && style.textActive, customStyle?.optionText]}
80
- >
81
- {label}
82
- </Text>
83
- </TouchableHighlight>
84
- ))}
59
+ <View accessibilityRole="radiogroup" style={style.container} testID="options-radiogroup">
60
+ {options.map(({ label, value: optionValue }) => {
61
+ const checked = value === optionValue;
62
+
63
+ return (
64
+ <Pressable
65
+ key={optionValue}
66
+ accessibilityLabel={label}
67
+ accessibilityRole="radio"
68
+ accessibilityState={{ checked, disabled: checked }}
69
+ disabled={checked}
70
+ testID={optionValue}
71
+ style={[
72
+ style.wrapper,
73
+ checked && style.wrapperChecked,
74
+ tradename === Tradename.LOOKIERO && style.wrapperLookiero,
75
+ ]}
76
+ accessible
77
+ onPress={() => {
78
+ onChange(optionValue);
79
+ onClose();
80
+ }}
81
+ >
82
+ <Checkbox checked={checked} />
83
+
84
+ <Text style={style.text}>{label}</Text>
85
+ </Pressable>
86
+ );
87
+ })}
88
+ </View>
85
89
  </View>
86
90
  </Modal>
87
91
  );
@@ -258,7 +258,6 @@ exports[`SelectField component matches the snapshot 1`] = `
258
258
  style={
259
259
  [
260
260
  {
261
- "paddingBottom": 24,
262
261
  "paddingHorizontal": 24,
263
262
  },
264
263
  undefined,
@@ -266,65 +265,302 @@ exports[`SelectField component matches the snapshot 1`] = `
266
265
  }
267
266
  >
268
267
  <View
269
- accessibilityLabel="optionValue"
270
- accessibilityState={
268
+ accessibilityRole="radiogroup"
269
+ style={
271
270
  {
272
- "disabled": false,
271
+ "gap": 12,
273
272
  }
274
273
  }
275
- accessibilityValue={
276
- {
277
- "max": undefined,
278
- "min": undefined,
279
- "now": undefined,
280
- "text": undefined,
274
+ testID="options-radiogroup"
275
+ >
276
+ <View
277
+ accessibilityLabel="Option label"
278
+ accessibilityRole="radio"
279
+ accessibilityState={
280
+ {
281
+ "busy": undefined,
282
+ "checked": false,
283
+ "disabled": false,
284
+ "expanded": undefined,
285
+ "selected": undefined,
286
+ }
281
287
  }
282
- }
283
- accessible={true}
284
- focusable={true}
285
- onClick={[Function]}
286
- onResponderGrant={[Function]}
287
- onResponderMove={[Function]}
288
- onResponderRelease={[Function]}
289
- onResponderTerminate={[Function]}
290
- onResponderTerminationRequest={[Function]}
291
- onStartShouldSetResponder={[Function]}
292
- style={
293
- [
288
+ accessibilityValue={
294
289
  {
295
- "borderBottomColor": "#DAD8D8",
296
- "borderBottomWidth": 1,
297
- "paddingVertical": 20,
298
- },
299
- undefined,
300
- ]
301
- }
302
- testID="optionValue"
303
- >
304
- <Text
290
+ "max": undefined,
291
+ "min": undefined,
292
+ "now": undefined,
293
+ "text": undefined,
294
+ }
295
+ }
296
+ accessible={true}
297
+ collapsable={false}
298
+ focusable={true}
299
+ onBlur={[Function]}
300
+ onClick={[Function]}
301
+ onFocus={[Function]}
302
+ onResponderGrant={[Function]}
303
+ onResponderMove={[Function]}
304
+ onResponderRelease={[Function]}
305
+ onResponderTerminate={[Function]}
306
+ onResponderTerminationRequest={[Function]}
307
+ onStartShouldSetResponder={[Function]}
305
308
  style={
306
309
  [
307
310
  {
308
- "color": "#0C0A0A",
309
- "fontFamily": "AreaNormal-Semibold",
310
- "fontSize": 15,
311
- "fontStyle": "normal",
312
- "fontWeight": "300",
313
- "letterSpacing": -0.2,
314
- "lineHeight": 20,
311
+ "alignItems": "center",
312
+ "borderColor": "#DAD8D8",
313
+ "borderWidth": 1,
314
+ "flex": 1,
315
+ "flexDirection": "row",
316
+ "padding": 16,
317
+ },
318
+ false,
319
+ {
320
+ "borderRadius": 8,
315
321
  },
322
+ ]
323
+ }
324
+ testID="optionValue"
325
+ >
326
+ <View
327
+ style={
316
328
  [
317
329
  {
318
- "lineHeight": 24,
330
+ "alignItems": "center",
331
+ "borderRadius": 9999,
332
+ "borderWidth": 2,
333
+ "height": 22,
334
+ "justifyContent": "center",
335
+ "width": 22,
319
336
  },
320
- false,
321
337
  undefined,
322
- ],
338
+ {
339
+ "backgroundColor": "#FFFFFF",
340
+ "borderColor": "#DAD8D8",
341
+ },
342
+ ]
343
+ }
344
+ testID="animated-checked"
345
+ >
346
+ <View
347
+ style={
348
+ {
349
+ "opacity": 0,
350
+ "scale": 0,
351
+ }
352
+ }
353
+ >
354
+ <Text
355
+ accessibilityElementsHidden={true}
356
+ allowFontScaling={false}
357
+ importantForAccessibility="no"
358
+ selectable={false}
359
+ style={
360
+ [
361
+ {
362
+ "color": "#0C0A0A",
363
+ "fontFamily": "AreaNormal-Semibold",
364
+ "fontSize": 15,
365
+ "fontStyle": "normal",
366
+ "fontWeight": "300",
367
+ "letterSpacing": -0.2,
368
+ "lineHeight": 20,
369
+ },
370
+ [
371
+ {
372
+ "fontFamily": "auroraicons",
373
+ "fontSize": 24,
374
+ "fontStyle": "normal",
375
+ "fontWeight": "normal",
376
+ "height": 24,
377
+ "lineHeight": 24,
378
+ "minHeight": 24,
379
+ "minWidth": 24,
380
+ "width": 24,
381
+ },
382
+ [
383
+ {
384
+ "color": "#0C0A0A",
385
+ },
386
+ undefined,
387
+ ],
388
+ ],
389
+ ]
390
+ }
391
+ testID="icon"
392
+ >
393
+
394
+ </Text>
395
+ </View>
396
+ </View>
397
+ <Text
398
+ style={
399
+ [
400
+ {
401
+ "color": "#0C0A0A",
402
+ "fontFamily": "AreaNormal-Semibold",
403
+ "fontSize": 15,
404
+ "fontStyle": "normal",
405
+ "fontWeight": "300",
406
+ "letterSpacing": -0.2,
407
+ "lineHeight": 20,
408
+ },
409
+ {
410
+ "color": "#0C0A0A",
411
+ "flex": 1,
412
+ "marginLeft": 16,
413
+ },
414
+ ]
415
+ }
416
+ >
417
+ Option label
418
+ </Text>
419
+ </View>
420
+ <View
421
+ accessibilityLabel="Selected label"
422
+ accessibilityRole="radio"
423
+ accessibilityState={
424
+ {
425
+ "busy": undefined,
426
+ "checked": false,
427
+ "disabled": false,
428
+ "expanded": undefined,
429
+ "selected": undefined,
430
+ }
431
+ }
432
+ accessibilityValue={
433
+ {
434
+ "max": undefined,
435
+ "min": undefined,
436
+ "now": undefined,
437
+ "text": undefined,
438
+ }
439
+ }
440
+ accessible={true}
441
+ collapsable={false}
442
+ focusable={true}
443
+ onBlur={[Function]}
444
+ onClick={[Function]}
445
+ onFocus={[Function]}
446
+ onResponderGrant={[Function]}
447
+ onResponderMove={[Function]}
448
+ onResponderRelease={[Function]}
449
+ onResponderTerminate={[Function]}
450
+ onResponderTerminationRequest={[Function]}
451
+ onStartShouldSetResponder={[Function]}
452
+ style={
453
+ [
454
+ {
455
+ "alignItems": "center",
456
+ "borderColor": "#DAD8D8",
457
+ "borderWidth": 1,
458
+ "flex": 1,
459
+ "flexDirection": "row",
460
+ "padding": 16,
461
+ },
462
+ false,
463
+ {
464
+ "borderRadius": 8,
465
+ },
323
466
  ]
324
467
  }
468
+ testID="selectedValue"
325
469
  >
326
- Option label
327
- </Text>
470
+ <View
471
+ style={
472
+ [
473
+ {
474
+ "alignItems": "center",
475
+ "borderRadius": 9999,
476
+ "borderWidth": 2,
477
+ "height": 22,
478
+ "justifyContent": "center",
479
+ "width": 22,
480
+ },
481
+ undefined,
482
+ {
483
+ "backgroundColor": "#FFFFFF",
484
+ "borderColor": "#DAD8D8",
485
+ },
486
+ ]
487
+ }
488
+ testID="animated-checked"
489
+ >
490
+ <View
491
+ style={
492
+ {
493
+ "opacity": 0,
494
+ "scale": 0,
495
+ }
496
+ }
497
+ >
498
+ <Text
499
+ accessibilityElementsHidden={true}
500
+ allowFontScaling={false}
501
+ importantForAccessibility="no"
502
+ selectable={false}
503
+ style={
504
+ [
505
+ {
506
+ "color": "#0C0A0A",
507
+ "fontFamily": "AreaNormal-Semibold",
508
+ "fontSize": 15,
509
+ "fontStyle": "normal",
510
+ "fontWeight": "300",
511
+ "letterSpacing": -0.2,
512
+ "lineHeight": 20,
513
+ },
514
+ [
515
+ {
516
+ "fontFamily": "auroraicons",
517
+ "fontSize": 24,
518
+ "fontStyle": "normal",
519
+ "fontWeight": "normal",
520
+ "height": 24,
521
+ "lineHeight": 24,
522
+ "minHeight": 24,
523
+ "minWidth": 24,
524
+ "width": 24,
525
+ },
526
+ [
527
+ {
528
+ "color": "#0C0A0A",
529
+ },
530
+ undefined,
531
+ ],
532
+ ],
533
+ ]
534
+ }
535
+ testID="icon"
536
+ >
537
+
538
+ </Text>
539
+ </View>
540
+ </View>
541
+ <Text
542
+ style={
543
+ [
544
+ {
545
+ "color": "#0C0A0A",
546
+ "fontFamily": "AreaNormal-Semibold",
547
+ "fontSize": 15,
548
+ "fontStyle": "normal",
549
+ "fontWeight": "300",
550
+ "letterSpacing": -0.2,
551
+ "lineHeight": 20,
552
+ },
553
+ {
554
+ "color": "#0C0A0A",
555
+ "flex": 1,
556
+ "marginLeft": 16,
557
+ },
558
+ ]
559
+ }
560
+ >
561
+ Selected label
562
+ </Text>
563
+ </View>
328
564
  </View>
329
565
  </View>
330
566
  </View>
File without changes