@pagopa/io-app-design-system 5.6.2 → 5.6.4

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 (62) hide show
  1. package/lib/commonjs/components/buttons/IOButton/IOButton.js +2 -5
  2. package/lib/commonjs/components/buttons/IOButton/IOButton.js.map +1 -1
  3. package/lib/commonjs/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +0 -3
  4. package/lib/commonjs/components/claimsSelector/ClaimsSelector.js +35 -13
  5. package/lib/commonjs/components/claimsSelector/ClaimsSelector.js.map +1 -1
  6. package/lib/commonjs/components/claimsSelector/__test__/ClaimsSelector.test.js +16 -3
  7. package/lib/commonjs/components/claimsSelector/__test__/ClaimsSelector.test.js.map +1 -1
  8. package/lib/commonjs/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +295 -0
  9. package/lib/commonjs/components/icons/Icon.js +6 -2
  10. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  11. package/lib/commonjs/components/icons/svg/IconDocumentAdd.js +45 -0
  12. package/lib/commonjs/components/icons/svg/IconDocumentAdd.js.map +1 -0
  13. package/lib/commonjs/components/icons/svg/originals/IconDocumentAdd.svg +7 -0
  14. package/lib/commonjs/components/layout/HeaderFirstLevel.js +6 -4
  15. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  16. package/lib/commonjs/components/searchInput/SearchInput.js +8 -5
  17. package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
  18. package/lib/commonjs/core/IOColors.js +2 -1
  19. package/lib/commonjs/core/IOColors.js.map +1 -1
  20. package/lib/module/components/buttons/IOButton/IOButton.js +2 -5
  21. package/lib/module/components/buttons/IOButton/IOButton.js.map +1 -1
  22. package/lib/module/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +0 -3
  23. package/lib/module/components/claimsSelector/ClaimsSelector.js +36 -14
  24. package/lib/module/components/claimsSelector/ClaimsSelector.js.map +1 -1
  25. package/lib/module/components/claimsSelector/__test__/ClaimsSelector.test.js +16 -3
  26. package/lib/module/components/claimsSelector/__test__/ClaimsSelector.test.js.map +1 -1
  27. package/lib/module/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +295 -0
  28. package/lib/module/components/icons/Icon.js +6 -2
  29. package/lib/module/components/icons/Icon.js.map +1 -1
  30. package/lib/module/components/icons/svg/IconDocumentAdd.js +40 -0
  31. package/lib/module/components/icons/svg/IconDocumentAdd.js.map +1 -0
  32. package/lib/module/components/icons/svg/originals/IconDocumentAdd.svg +7 -0
  33. package/lib/module/components/layout/HeaderFirstLevel.js +6 -4
  34. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  35. package/lib/module/components/searchInput/SearchInput.js +9 -6
  36. package/lib/module/components/searchInput/SearchInput.js.map +1 -1
  37. package/lib/module/core/IOColors.js +2 -1
  38. package/lib/module/core/IOColors.js.map +1 -1
  39. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts.map +1 -1
  40. package/lib/typescript/components/claimsSelector/ClaimsSelector.d.ts +2 -1
  41. package/lib/typescript/components/claimsSelector/ClaimsSelector.d.ts.map +1 -1
  42. package/lib/typescript/components/icons/Icon.d.ts +2 -0
  43. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  44. package/lib/typescript/components/icons/svg/IconDocumentAdd.d.ts +5 -0
  45. package/lib/typescript/components/icons/svg/IconDocumentAdd.d.ts.map +1 -0
  46. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts +3 -1
  47. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  48. package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
  49. package/lib/typescript/core/IOColors.d.ts +1 -1
  50. package/lib/typescript/core/IOColors.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/src/components/buttons/IOButton/IOButton.tsx +6 -7
  53. package/src/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +0 -3
  54. package/src/components/claimsSelector/ClaimsSelector.tsx +49 -22
  55. package/src/components/claimsSelector/__test__/ClaimsSelector.test.tsx +21 -3
  56. package/src/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +295 -0
  57. package/src/components/icons/Icon.tsx +5 -2
  58. package/src/components/icons/svg/IconDocumentAdd.tsx +36 -0
  59. package/src/components/icons/svg/originals/IconDocumentAdd.svg +7 -0
  60. package/src/components/layout/HeaderFirstLevel.tsx +17 -4
  61. package/src/components/searchInput/SearchInput.tsx +13 -5
  62. package/src/core/IOColors.ts +2 -0
@@ -11,7 +11,7 @@ describe("ClaimsSelector", () => {
11
11
  items={[
12
12
  {
13
13
  id: "name",
14
- title: "Mario Rossi",
14
+ value: "Mario Rossi",
15
15
  description: "Nome e cognome"
16
16
  }
17
17
  ]}
@@ -27,7 +27,7 @@ describe("ClaimsSelector", () => {
27
27
  items={[
28
28
  {
29
29
  id: "name",
30
- title: "Mario Rossi",
30
+ value: "Mario Rossi",
31
31
  description: "Nome e cognome"
32
32
  }
33
33
  ]}
@@ -44,7 +44,7 @@ describe("ClaimsSelector", () => {
44
44
  items={[
45
45
  {
46
46
  id: "name",
47
- title: "Mario Rossi",
47
+ value: "Mario Rossi",
48
48
  description: "Nome e cognome"
49
49
  }
50
50
  ]}
@@ -52,4 +52,22 @@ describe("ClaimsSelector", () => {
52
52
  );
53
53
  expect(claimsSelector).toMatchSnapshot();
54
54
  });
55
+
56
+ it("ClaimsSelector Snapshot (custom component)", () => {
57
+ const claimsSelector = TestRenderer.create(
58
+ <ClaimsSelector
59
+ title="Patente di guida"
60
+ selectionEnabled={false}
61
+ items={[
62
+ {
63
+ id: "name",
64
+ value: "data:image/png;base64,iVBORw0KGgoAAAANSUh",
65
+ description: "Nome e cognome",
66
+ type: "image"
67
+ }
68
+ ]}
69
+ />
70
+ );
71
+ expect(claimsSelector).toMatchSnapshot();
72
+ });
55
73
  });
@@ -523,6 +523,300 @@ exports[`ClaimsSelector ClaimsSelector Snapshot (controlled) 1`] = `
523
523
  </View>
524
524
  `;
525
525
 
526
+ exports[`ClaimsSelector ClaimsSelector Snapshot (custom component) 1`] = `
527
+ <View
528
+ style={
529
+ [
530
+ {
531
+ "borderCurve": "continuous",
532
+ "borderRadius": 8,
533
+ "borderWidth": 1,
534
+ },
535
+ {
536
+ "backgroundColor": "#F4F5F8",
537
+ "borderColor": "#E8EBF1",
538
+ },
539
+ ]
540
+ }
541
+ >
542
+ <RNGestureHandlerButton
543
+ collapsable={false}
544
+ delayLongPress={600}
545
+ enabled={true}
546
+ exclusive={true}
547
+ handlerTag={4}
548
+ handlerType="NativeViewGestureHandler"
549
+ innerRef={null}
550
+ onGestureHandlerEvent={[Function]}
551
+ onGestureHandlerStateChange={[Function]}
552
+ rippleColor="transparent"
553
+ style={
554
+ [
555
+ undefined,
556
+ {
557
+ "cursor": undefined,
558
+ },
559
+ ]
560
+ }
561
+ touchSoundDisabled={false}
562
+ >
563
+ <View
564
+ accessibilityLabel="Patente di guida"
565
+ accessibilityRole="button"
566
+ accessibilityState={
567
+ {
568
+ "expanded": false,
569
+ }
570
+ }
571
+ accessible={true}
572
+ collapsable={false}
573
+ style={{}}
574
+ >
575
+ <View
576
+ style={
577
+ {
578
+ "alignItems": "center",
579
+ "flexDirection": "row",
580
+ "justifyContent": "space-between",
581
+ "padding": 16,
582
+ }
583
+ }
584
+ >
585
+ <Text
586
+ allowFontScaling={true}
587
+ dynamicTypeRamp="headline"
588
+ maxFontSizeMultiplier={1.5}
589
+ style={
590
+ [
591
+ {},
592
+ {
593
+ "color": "#0E0F13",
594
+ "fontFamily": "Titillio",
595
+ "fontSize": 16,
596
+ "fontStyle": "normal",
597
+ "fontWeight": "600",
598
+ "lineHeight": 24,
599
+ },
600
+ ]
601
+ }
602
+ >
603
+ Patente di guida
604
+ </Text>
605
+ <View
606
+ style={
607
+ {
608
+ "transform": [
609
+ {
610
+ "rotate": "0deg",
611
+ },
612
+ ],
613
+ }
614
+ }
615
+ >
616
+ <RNSVGSvgView
617
+ accessibilityElementsHidden={true}
618
+ accessibilityLabel=""
619
+ accessible={false}
620
+ align="xMidYMid"
621
+ bbHeight={24}
622
+ bbWidth={24}
623
+ color="#0B3EE3"
624
+ focusable={false}
625
+ height={24}
626
+ importantForAccessibility="no-hide-descendants"
627
+ meetOrSlice={0}
628
+ minX={0}
629
+ minY={0}
630
+ style={
631
+ [
632
+ {
633
+ "backgroundColor": "transparent",
634
+ "borderWidth": 0,
635
+ },
636
+ {
637
+ "flex": 0,
638
+ "height": 24,
639
+ "width": 24,
640
+ },
641
+ ]
642
+ }
643
+ vbHeight={24}
644
+ vbWidth={24}
645
+ width={24}
646
+ >
647
+ <RNSVGGroup
648
+ fill={
649
+ {
650
+ "payload": 4278190080,
651
+ "type": 0,
652
+ }
653
+ }
654
+ >
655
+ <RNSVGPath
656
+ clipRule={0}
657
+ d="M18.7071 8.29289c.3905.39053.3905 1.02369 0 1.41422l-6 5.99999c-.3905.3905-1.0237.3905-1.4142 0L5.29289 9.70711c-.39052-.39053-.39052-1.02369 0-1.41422.39053-.39052 1.02369-.39052 1.41422 0L12 13.5858l5.2929-5.29291c.3905-.39052 1.0237-.39052 1.4142 0Z"
658
+ fill={
659
+ {
660
+ "type": 2,
661
+ }
662
+ }
663
+ fillRule={0}
664
+ propList={
665
+ [
666
+ "fill",
667
+ "fillRule",
668
+ ]
669
+ }
670
+ />
671
+ </RNSVGGroup>
672
+ </RNSVGSvgView>
673
+ </View>
674
+ </View>
675
+ </View>
676
+ </RNGestureHandlerButton>
677
+ <View
678
+ style={
679
+ [
680
+ {
681
+ "height": 0,
682
+ },
683
+ {
684
+ "overflow": "hidden",
685
+ },
686
+ ]
687
+ }
688
+ >
689
+ <View
690
+ onLayout={[Function]}
691
+ style={
692
+ [
693
+ {
694
+ "padding": 16,
695
+ "paddingTop": 0,
696
+ "position": "absolute",
697
+ "width": "100%",
698
+ },
699
+ {
700
+ "width": "100%",
701
+ },
702
+ ]
703
+ }
704
+ >
705
+ <View
706
+ accessibilityLabel="Nome e cognome; "
707
+ accessibilityRole="image"
708
+ accessible={true}
709
+ style={
710
+ {
711
+ "marginHorizontal": -24,
712
+ "paddingHorizontal": 24,
713
+ "paddingVertical": 12,
714
+ }
715
+ }
716
+ >
717
+ <View
718
+ style={
719
+ [
720
+ {
721
+ "alignItems": "center",
722
+ "flexDirection": "row",
723
+ "justifyContent": "space-between",
724
+ },
725
+ {
726
+ "columnGap": 12,
727
+ },
728
+ ]
729
+ }
730
+ >
731
+ <View
732
+ style={
733
+ {
734
+ "flex": 1,
735
+ }
736
+ }
737
+ >
738
+ <View
739
+ accessible={true}
740
+ style={
741
+ {
742
+ "flexDirection": "column-reverse",
743
+ }
744
+ }
745
+ >
746
+ <Text
747
+ allowFontScaling={true}
748
+ dynamicTypeRamp="footnote"
749
+ maxFontSizeMultiplier={1.5}
750
+ style={
751
+ [
752
+ {},
753
+ {
754
+ "color": "#555C70",
755
+ "fontFamily": "Titillio",
756
+ "fontSize": 14,
757
+ "fontStyle": "normal",
758
+ "fontWeight": "400",
759
+ "lineHeight": 21,
760
+ },
761
+ ]
762
+ }
763
+ >
764
+ Nome e cognome
765
+ </Text>
766
+ <Image
767
+ accessibilityIgnoresInvertColors={true}
768
+ resizeMode="contain"
769
+ source={
770
+ {
771
+ "uri": "data:image/png;base64,iVBORw0KGgoAAAANSUh",
772
+ }
773
+ }
774
+ style={
775
+ {
776
+ "aspectRatio": 0.75,
777
+ "width": 160,
778
+ }
779
+ }
780
+ />
781
+ </View>
782
+ </View>
783
+ </View>
784
+ </View>
785
+ </View>
786
+ </View>
787
+ <BVLinearGradient
788
+ colors={
789
+ [
790
+ 16053752,
791
+ 4294243832,
792
+ ]
793
+ }
794
+ endPoint={
795
+ {
796
+ "x": 0.5,
797
+ "y": 1,
798
+ }
799
+ }
800
+ locations={null}
801
+ startPoint={
802
+ {
803
+ "x": 0.5,
804
+ "y": 0,
805
+ }
806
+ }
807
+ style={
808
+ {
809
+ "bottom": 0,
810
+ "height": 16,
811
+ "left": 16,
812
+ "position": "absolute",
813
+ "right": 16,
814
+ }
815
+ }
816
+ />
817
+ </View>
818
+ `;
819
+
526
820
  exports[`ClaimsSelector ClaimsSelector Snapshot (uncontrolled) 1`] = `
527
821
  <View
528
822
  style={
@@ -1158,6 +1452,7 @@ exports[`ClaimsSelector ClaimsSelector Snapshot (unselectable items) 1`] = `
1158
1452
  >
1159
1453
  <View
1160
1454
  accessibilityLabel="Nome e cognome; Mario Rossi"
1455
+ accessibilityRole="text"
1161
1456
  accessible={true}
1162
1457
  style={
1163
1458
  {
@@ -206,6 +206,7 @@ import LegIconCheckOff from "./svg/LegIconCheckOff";
206
206
  import LegIconCheckOn from "./svg/LegIconCheckOn";
207
207
  import LegIconRadioOff from "./svg/LegIconRadioOff";
208
208
  import LegIconRadioOn from "./svg/LegIconRadioOn";
209
+ import IconDocumentAdd from "./svg/IconDocumentAdd";
209
210
 
210
211
  export const IOIcons = {
211
212
  spid: IconSpid,
@@ -252,6 +253,7 @@ export const IOIcons = {
252
253
  security: IconSecurity,
253
254
  option: IconOption,
254
255
  key: IconKey,
256
+ documentAdd: IconDocumentAdd,
255
257
  docGiacenza: IconDocGiacenza,
256
258
  docPaymentTitle: IconDocPaymentTitle,
257
259
  docPaymentCode: IconDocPaymentCode,
@@ -530,11 +532,12 @@ export const AnimatedIconWithColorTransition = Animated.createAnimatedComponent(
530
532
  */
531
533
 
532
534
  /* New icons */
533
- const { sparkles, profileRegistered } = IOIcons;
535
+ const { sparkles, profileRegistered, documentAdd } = IOIcons;
534
536
 
535
537
  export const IOIconsNew = {
536
538
  sparkles,
537
- profileRegistered
539
+ profileRegistered,
540
+ documentAdd
538
541
  };
539
542
 
540
543
  /* Navigation */
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { Svg, Path } from "react-native-svg";
3
+ import { SVGIconProps } from "../types";
4
+
5
+ const IconDocumentAdd = ({ size, style, ...props }: SVGIconProps) => (
6
+ <Svg width={size} height={size} viewBox="0 0 24 24" style={style} {...props}>
7
+ <Path
8
+ fill="currentColor"
9
+ d="M5.065 2.5a.532.532 0 0 0-.532.532v3.501H1.032a.532.532 0 0 0 0 1.064h3.5v3.502a.532.532 0 0 0 1.064 0V7.597h3.502a.532.532 0 0 0 0-1.064H5.596V3.032a.532.532 0 0 0-.531-.532Z"
10
+ />
11
+ <Path
12
+ fill="currentColor"
13
+ fillRule="evenodd"
14
+ d="M4.033 3.032a1.032 1.032 0 0 1 2.063 0v3.001h3.002a1.032 1.032 0 0 1 0 2.064H6.096v3.002a1.032 1.032 0 1 1-2.063 0V8.097H1.032a1.032 1.032 0 0 1 0-2.064h3V3.032ZM5.065 3a.032.032 0 0 0-.032.032v4.001H1.032a.032.032 0 0 0 0 .064h4v4.002a.032.032 0 1 0 .064 0V7.097h4.002a.032.032 0 0 0 0-.064H5.096V3.032A.032.032 0 0 0 5.065 3Z"
15
+ clipRule="evenodd"
16
+ />
17
+ <Path
18
+ fill="currentColor"
19
+ fillRule="evenodd"
20
+ d="M10.845 5.5H20.3a3 3 0 0 1 3 3v11a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V13h2v6.5a1 1 0 0 0 1 1h13.3a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-9.455v-2Z"
21
+ clipRule="evenodd"
22
+ />
23
+ <Path
24
+ fill="currentColor"
25
+ fillRule="evenodd"
26
+ d="M15.5 16.5h-8v-2h8v2ZM18.5 19.5h-11v-2h11v2Z"
27
+ clipRule="evenodd"
28
+ />
29
+ <Path
30
+ fill="currentColor"
31
+ d="M19.5 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"
32
+ />
33
+ </Svg>
34
+ );
35
+
36
+ export default IconDocumentAdd;
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
2
+ <path fill="#BBC2D6" d="M5.065 2.5a.532.532 0 0 0-.532.532v3.501H1.032a.532.532 0 0 0 0 1.064h3.5v3.502a.532.532 0 0 0 1.064 0V7.597h3.502a.532.532 0 0 0 0-1.064H5.596V3.032a.532.532 0 0 0-.531-.532Z"/>
3
+ <path fill="#BBC2D6" fill-rule="evenodd" d="M4.033 3.032a1.032 1.032 0 0 1 2.063 0v3.001h3.002a1.032 1.032 0 0 1 0 2.064H6.096v3.002a1.032 1.032 0 1 1-2.063 0V8.097H1.032a1.032 1.032 0 0 1 0-2.064h3V3.032ZM5.065 3a.032.032 0 0 0-.032.032v4.001H1.032a.032.032 0 0 0 0 .064h4v4.002a.032.032 0 1 0 .064 0V7.097h4.002a.032.032 0 0 0 0-.064H5.096V3.032A.032.032 0 0 0 5.065 3Z" clip-rule="evenodd"/>
4
+ <path fill="#BBC2D6" fill-rule="evenodd" d="M10.845 5.5H20.3a3 3 0 0 1 3 3v11a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V13h2v6.5a1 1 0 0 0 1 1h13.3a1 1 0 0 0 1-1v-11a1 1 0 0 0-1-1h-9.455v-2Z" clip-rule="evenodd"/>
5
+ <path fill="#BBC2D6" fill-rule="evenodd" d="M15.5 16.5h-8v-2h8v2ZM18.5 19.5h-11v-2h11v2Z" clip-rule="evenodd"/>
6
+ <path fill="#BBC2D6" d="M19.5 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/>
7
+ </svg>
@@ -32,12 +32,15 @@ type HeaderActionsProp =
32
32
  | readonly [HeaderActionProps, HeaderActionProps] // Two actions
33
33
  | readonly [HeaderActionProps, HeaderActionProps, HeaderActionProps]; // Three actions
34
34
 
35
+ type Variant = "primary" | "contrast";
36
+
35
37
  export type HeaderFirstLevel = WithTestID<{
36
38
  title: string;
37
39
  actions: HeaderActionsProp;
38
40
  animatedRef?: AnimatedRef<Animated.ScrollView>;
39
41
  animatedFlatListRef?: AnimatedRef<Animated.FlatList<any>>;
40
42
  ignoreSafeAreaMargin?: boolean;
43
+ variant?: Variant;
41
44
  }>;
42
45
 
43
46
  const styles = StyleSheet.create({
@@ -65,12 +68,14 @@ export const HeaderFirstLevel = ({
65
68
  actions = [],
66
69
  ignoreSafeAreaMargin = false,
67
70
  animatedRef,
71
+ variant = "primary",
68
72
  animatedFlatListRef
69
73
  }: HeaderFirstLevel) => {
70
74
  const titleRef = createRef<View>();
71
75
  const insets = useSafeAreaInsets();
72
76
  const theme = useIOTheme();
73
77
  const paddingTop = useSharedValue(ignoreSafeAreaMargin ? 0 : insets.top);
78
+ const isPrimary = variant === "primary";
74
79
 
75
80
  useLayoutEffect(() => {
76
81
  const reactNode = findNodeHandle(titleRef.current);
@@ -105,14 +110,18 @@ export const HeaderFirstLevel = ({
105
110
  return (
106
111
  <Animated.View
107
112
  style={[
108
- { backgroundColor: IOColors[theme["appBackground-primary"]] },
113
+ {
114
+ backgroundColor: isPrimary
115
+ ? IOColors[theme["appBackground-primary"]]
116
+ : IOColors[theme["appBackground-accent"]]
117
+ },
109
118
  animatedStyle
110
119
  ]}
111
120
  accessibilityRole="header"
112
121
  testID={testID}
113
122
  >
114
123
  {/* Divider */}
115
- {(animatedRef || animatedFlatListRef) && (
124
+ {(animatedRef || animatedFlatListRef) && isPrimary && (
116
125
  <Animated.View
117
126
  style={[
118
127
  {
@@ -130,7 +139,11 @@ export const HeaderFirstLevel = ({
130
139
  weight="Bold"
131
140
  style={{ flexShrink: 1 }}
132
141
  numberOfLines={1}
133
- color={theme["textHeading-default"]}
142
+ color={
143
+ isPrimary
144
+ ? theme["textHeading-default"]
145
+ : theme["textHeading-constrast"]
146
+ }
134
147
  maxFontSizeMultiplier={1.25}
135
148
  >
136
149
  {title}
@@ -141,7 +154,7 @@ export const HeaderFirstLevel = ({
141
154
  <IconButton
142
155
  key={`header-first-level-action-${index}`}
143
156
  {...action}
144
- color={"primary"}
157
+ color={variant}
145
158
  />
146
159
  ))}
147
160
  </HStack>
@@ -36,7 +36,11 @@ import {
36
36
  useIONewTypeface,
37
37
  useIOTheme
38
38
  } from "../../core";
39
- import { IOFontSize, makeFontStyleObject } from "../../utils/fonts";
39
+ import {
40
+ IOFontSize,
41
+ IOMaxFontSizeMultiplier,
42
+ makeFontStyleObject
43
+ } from "../../utils/fonts";
40
44
  import { Icon, IOIconSizeScale } from "../icons";
41
45
  import {
42
46
  buttonTextFontSize,
@@ -46,6 +50,7 @@ import {
46
50
 
47
51
  /* Component visual attributes */
48
52
  const inputPaddingHorizontal: IOSpacingScale = 12;
53
+ const inputPaddingVertical: IOSpacingScale = 8;
49
54
  const inputPaddingClearButton: IOSpacingScale = 8;
50
55
  const inputRadius: number = 8;
51
56
  const iconMargin: IOSpacingScale = 8;
@@ -54,8 +59,6 @@ const iconCloseSize: IOIconSizeScale = 24;
54
59
  const inputFontSizePlaceholder: IOFontSize = 14;
55
60
  const cancelButtonMargin: IOSpacingScale = 16;
56
61
  const inputTransitionDuration: number = 250;
57
- const inputHeightIOS: number = 36;
58
- const inputHeightAndroid: number = 42;
59
62
 
60
63
  type SearchInputPressableProps = {
61
64
  onPress: (event: GestureResponderEvent) => void;
@@ -260,6 +263,7 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
260
263
  returnKeyType="search"
261
264
  accessibilityRole={"search"}
262
265
  accessibilityLabel={accessibilityLabel}
266
+ numberOfLines={1}
263
267
  style={[
264
268
  {
265
269
  color: IOColors[theme["textBody-default"]],
@@ -284,7 +288,9 @@ export const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
284
288
  onChangeText={handleChangeText}
285
289
  value={value}
286
290
  autoFocus={autoFocus}
291
+ maxFontSizeMultiplier={IOMaxFontSizeMultiplier}
287
292
  />
293
+
288
294
  <AnimatedPressable
289
295
  style={[styles.clearButton, clearButtonAnimatedStyle]}
290
296
  onPress={handleClear}
@@ -358,10 +364,11 @@ const styles = StyleSheet.create({
358
364
  flexGrow: 1
359
365
  },
360
366
  textInputIOS: {
361
- height: inputHeightIOS
367
+ paddingVertical: inputPaddingVertical
362
368
  },
363
369
  textInputAndroid: {
364
- height: inputHeightAndroid
370
+ textAlignVertical: "center",
371
+ overflow: "hidden"
365
372
  },
366
373
  iconContainer: {
367
374
  marginRight: iconMargin
@@ -372,6 +379,7 @@ const styles = StyleSheet.create({
372
379
  paddingLeft: cancelButtonMargin
373
380
  },
374
381
  clearButton: {
382
+ transformOrigin: "center",
375
383
  marginLeft: iconMargin
376
384
  }
377
385
  });
@@ -221,6 +221,7 @@ const themeKeys = [
221
221
  "textHeading-default",
222
222
  "textHeading-secondary",
223
223
  "textHeading-tertiary",
224
+ "textHeading-constrast",
224
225
  "textBody-default",
225
226
  "textBody-secondary",
226
227
  "textBody-tertiary",
@@ -294,6 +295,7 @@ export const IOThemeLight: IOTheme = {
294
295
  "textHeading-default": "black",
295
296
  "textHeading-secondary": "grey-850",
296
297
  "textHeading-tertiary": "grey-700",
298
+ "textHeading-constrast": "white",
297
299
  "textBody-default": "black",
298
300
  "textBody-secondary": "grey-850",
299
301
  "textBody-tertiary": "grey-700",