@pagopa/io-app-design-system 1.1.1 → 1.1.3

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 (101) hide show
  1. package/README.md +6 -0
  2. package/lib/commonjs/components/alert/Alert.js +7 -7
  3. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  4. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +1 -0
  5. package/lib/commonjs/components/buttons/ButtonLink.js +1 -0
  6. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  7. package/lib/commonjs/components/buttons/IconButton.js +0 -1
  8. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  9. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +1 -5
  10. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +79 -0
  11. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -0
  12. package/lib/commonjs/components/checkbox/index.js +11 -0
  13. package/lib/commonjs/components/checkbox/index.js.map +1 -1
  14. package/lib/commonjs/components/icons/Icon.js +2 -0
  15. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  16. package/lib/commonjs/components/icons/svg/IconArchive.js +31 -0
  17. package/lib/commonjs/components/icons/svg/IconArchive.js.map +1 -0
  18. package/lib/commonjs/components/icons/svg/originals/IconArchive.svg +4 -0
  19. package/lib/commonjs/components/layout/HeaderSecondLevel.js +95 -0
  20. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -0
  21. package/lib/commonjs/components/layout/index.js +33 -0
  22. package/lib/commonjs/components/layout/index.js.map +1 -1
  23. package/lib/commonjs/components/typography/CTA.js +34 -0
  24. package/lib/commonjs/components/typography/CTA.js.map +1 -0
  25. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +32 -0
  26. package/lib/commonjs/components/typography/__test__/typography.test.js +6 -1
  27. package/lib/commonjs/components/typography/__test__/typography.test.js.map +1 -1
  28. package/lib/commonjs/components/typography/index.js +15 -4
  29. package/lib/commonjs/components/typography/index.js.map +1 -1
  30. package/lib/commonjs/core/IOStyles.js +2 -1
  31. package/lib/commonjs/core/IOStyles.js.map +1 -1
  32. package/lib/module/components/alert/Alert.js +7 -7
  33. package/lib/module/components/alert/Alert.js.map +1 -1
  34. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +1 -0
  35. package/lib/module/components/buttons/ButtonLink.js +1 -0
  36. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  37. package/lib/module/components/buttons/IconButton.js +1 -2
  38. package/lib/module/components/buttons/IconButton.js.map +1 -1
  39. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +1 -5
  40. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +70 -0
  41. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -0
  42. package/lib/module/components/checkbox/index.js +1 -0
  43. package/lib/module/components/checkbox/index.js.map +1 -1
  44. package/lib/module/components/icons/Icon.js +2 -0
  45. package/lib/module/components/icons/Icon.js.map +1 -1
  46. package/lib/module/components/icons/svg/IconArchive.js +23 -0
  47. package/lib/module/components/icons/svg/IconArchive.js.map +1 -0
  48. package/lib/module/components/icons/svg/originals/IconArchive.svg +4 -0
  49. package/lib/module/components/layout/HeaderSecondLevel.js +84 -0
  50. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -0
  51. package/lib/module/components/layout/index.js +3 -0
  52. package/lib/module/components/layout/index.js.map +1 -1
  53. package/lib/module/components/typography/CTA.js +27 -0
  54. package/lib/module/components/typography/CTA.js.map +1 -0
  55. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +32 -0
  56. package/lib/module/components/typography/__test__/typography.test.js +6 -1
  57. package/lib/module/components/typography/__test__/typography.test.js.map +1 -1
  58. package/lib/module/components/typography/index.js +2 -1
  59. package/lib/module/components/typography/index.js.map +1 -1
  60. package/lib/module/core/IOStyles.js +1 -1
  61. package/lib/module/core/IOStyles.js.map +1 -1
  62. package/lib/typescript/components/alert/Alert.d.ts +3 -3
  63. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  64. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  65. package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
  66. package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts +13 -0
  67. package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -0
  68. package/lib/typescript/components/checkbox/index.d.ts +1 -0
  69. package/lib/typescript/components/checkbox/index.d.ts.map +1 -1
  70. package/lib/typescript/components/icons/Icon.d.ts +1 -0
  71. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  72. package/lib/typescript/components/icons/svg/IconArchive.d.ts +5 -0
  73. package/lib/typescript/components/icons/svg/IconArchive.d.ts.map +1 -0
  74. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts +20 -0
  75. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -0
  76. package/lib/typescript/components/layout/index.d.ts +3 -0
  77. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  78. package/lib/typescript/components/typography/CTA.d.ts +16 -0
  79. package/lib/typescript/components/typography/CTA.d.ts.map +1 -0
  80. package/lib/typescript/components/typography/index.d.ts +2 -1
  81. package/lib/typescript/components/typography/index.d.ts.map +1 -1
  82. package/lib/typescript/core/IOStyles.d.ts +1 -0
  83. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  84. package/package.json +1 -1
  85. package/src/components/alert/Alert.tsx +12 -12
  86. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +1 -0
  87. package/src/components/buttons/ButtonLink.tsx +1 -0
  88. package/src/components/buttons/IconButton.tsx +0 -2
  89. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +1 -5
  90. package/src/components/checkbox/AnimatedMessageCheckbox.tsx +105 -0
  91. package/src/components/checkbox/index.tsx +1 -0
  92. package/src/components/icons/Icon.tsx +2 -0
  93. package/src/components/icons/svg/IconArchive.tsx +16 -0
  94. package/src/components/icons/svg/originals/IconArchive.svg +4 -0
  95. package/src/components/layout/HeaderSecondLevel.tsx +153 -0
  96. package/src/components/layout/index.tsx +3 -0
  97. package/src/components/typography/CTA.tsx +35 -0
  98. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +32 -0
  99. package/src/components/typography/__test__/typography.test.tsx +7 -2
  100. package/src/components/typography/index.tsx +2 -2
  101. package/src/core/IOStyles.ts +1 -1
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import Animated from "react-native-reanimated";
3
+ import { WithTestID } from "../../utils/types";
4
+ export type HeaderSecondLevel = WithTestID<{
5
+ scrollValues: ScrollValues;
6
+ title: string;
7
+ goBack: () => void;
8
+ backAccessibilityLabel: string;
9
+ firstAction?: React.ReactNode;
10
+ secondAction?: React.ReactNode;
11
+ thirdAction?: React.ReactNode;
12
+ transparent?: boolean;
13
+ }>;
14
+ type ScrollValues = {
15
+ contentOffsetY: Animated.SharedValue<number>;
16
+ triggerOffset: number;
17
+ };
18
+ export declare const HeaderSecondLevel: ({ scrollValues, goBack, backAccessibilityLabel, title, firstAction, secondAction, thirdAction, transparent, testID }: HeaderSecondLevel) => React.JSX.Element;
19
+ export default HeaderSecondLevel;
20
+ //# sourceMappingURL=HeaderSecondLevel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderSecondLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/HeaderSecondLevel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,QAIN,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;IACzC,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,sBAAsB,EAAE,MAAM,CAAC;IAG/B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH,KAAK,YAAY,GAAG;IAClB,cAAc,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AA2BF,eAAO,MAAM,iBAAiB,yHAU3B,iBAAiB,sBA2EnB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,2 +1,5 @@
1
+ export * from "./GradientScrollView";
1
2
  export * from "./GradientBottomActions";
3
+ export * from "./HeaderFirstLevel";
4
+ export * from "./HeaderSecondLevel";
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/index.tsx"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { IOTheme } from "../../core/IOColors";
3
+ import { IOFontWeight } from "../../utils/fonts";
4
+ import { ExternalTypographyProps, TypographyProps } from "./common";
5
+ type AllowedColors = IOTheme["textBody-default"] | "blueIO-850";
6
+ type AllowedWeight = Extract<IOFontWeight, "SemiBold" | "Regular">;
7
+ type OwnProps = ExternalTypographyProps<TypographyProps<AllowedWeight, AllowedColors>>;
8
+ /**
9
+ * Typography component to render `CTA` text with font size {@link ctaFontSize} and fontFamily {@link ctaFontName}.
10
+ * default values(if not defined) are weight: {@link ctaDefaultWeight}, color: {@link ctaDefaultColor}
11
+ * @param props
12
+ * @constructor
13
+ */
14
+ export declare const CTA: React.FunctionComponent<OwnProps>;
15
+ export {};
16
+ //# sourceMappingURL=CTA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CTA.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/CTA.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAgB,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAgB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEpE,KAAK,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,YAAY,CAAC;AAChE,KAAK,aAAa,GAAG,OAAO,CAAC,YAAY,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAEnE,KAAK,QAAQ,GAAG,uBAAuB,CACrC,eAAe,CAAC,aAAa,EAAE,aAAa,CAAC,CAC9C,CAAC;AAUF;;;;;GAKG;AACH,eAAO,MAAM,GAAG,EAAE,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAO9C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export * from "./BaseTypography";
2
2
  export * from "./Body";
3
- export * from "./common";
3
+ export * from "./CTA";
4
4
  export * from "./Factory";
5
5
  export * from "./H1";
6
6
  export * from "./H2";
@@ -12,4 +12,5 @@ export * from "./Label";
12
12
  export * from "./LabelSmall";
13
13
  export * from "./Link";
14
14
  export * from "./Monospace";
15
+ export * from "./common";
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
@@ -60,6 +60,7 @@ export declare const IOStyles: {
60
60
  };
61
61
  };
62
62
  export declare const buttonSolidHeight: number;
63
+ export declare const iconBtnSizeSmall: number;
63
64
  export declare const IOButtonLegacyStyles: {
64
65
  button: {
65
66
  flexDirection: "row";
@@ -1 +1 @@
1
- {"version":3,"file":"IOStyles.d.ts","sourceRoot":"","sources":["../../../src/core/IOStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpE;;GAEG;AAEH,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,WAAW,C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AAEJ,UAAU,+BAA+B;IACvC,eAAe,EAAE,cAAc,CAAC;IAChC,iBAAiB,EAAE,WAAW,CAAC;IAC/B,UAAU,EAAE,cAAc,CAAC;IAC3B,YAAY,EAAE,QAAQ,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,iBAAiB,EAAE,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,+BAA+B,EAAE,+BAQ3C,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;;;;;;;;CAWpC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-app-design-system",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,11 +1,11 @@
1
+ import React, { useCallback } from "react";
1
2
  import {
2
3
  GestureResponderEvent,
3
4
  Pressable,
4
5
  StyleSheet,
5
- View,
6
- Text
6
+ Text,
7
+ View
7
8
  } from "react-native";
8
- import React, { useCallback } from "react";
9
9
  import Animated, {
10
10
  Extrapolate,
11
11
  interpolate,
@@ -14,21 +14,21 @@ import Animated, {
14
14
  useSharedValue,
15
15
  withSpring
16
16
  } from "react-native-reanimated";
17
- import { Label } from "../typography/Label";
17
+ import { IOScaleValues, IOSpringValues } from "../../core/IOAnimations";
18
18
  import {
19
19
  IOColors,
20
20
  IOColorsStatusBackground,
21
21
  IOColorsStatusForeground
22
22
  } from "../../core/IOColors";
23
- import { IOIconSizeScale, IOIcons, Icon } from "../icons";
24
- import { HSpacer, VSpacer } from "../spacer";
25
- import { IOStyles } from "../../core/IOStyles";
26
23
  import { IOAlertRadius } from "../../core/IOShapes";
27
24
  import { IOAlertSpacing } from "../../core/IOSpacing";
28
- import { H4 } from "../typography/H4";
29
- import { IOScaleValues, IOSpringValues } from "../../core/IOAnimations";
25
+ import { IOStyles } from "../../core/IOStyles";
30
26
  import { makeFontStyleObject } from "../../utils/fonts";
31
27
  import { WithTestID } from "../../utils/types";
28
+ import { IOIconSizeScale, IOIcons, Icon } from "../icons";
29
+ import { HSpacer, VSpacer } from "../spacer";
30
+ import { H4 } from "../typography/H4";
31
+ import { Label } from "../typography/Label";
32
32
 
33
33
  const iconSize: IOIconSizeScale = 24;
34
34
 
@@ -73,7 +73,7 @@ type AlertActionProps =
73
73
  onPress?: never;
74
74
  };
75
75
 
76
- export type Alert = AlertProps & AlertActionProps;
76
+ type AlertType = AlertProps & AlertActionProps;
77
77
 
78
78
  type VariantStates = {
79
79
  icon: IOIcons;
@@ -83,7 +83,7 @@ type VariantStates = {
83
83
 
84
84
  // COMPONENT CONFIGURATION
85
85
 
86
- const mapVariantStates: Record<NonNullable<Alert["variant"]>, VariantStates> = {
86
+ const mapVariantStates: Record<NonNullable<AlertType["variant"]>, VariantStates> = {
87
87
  error: {
88
88
  icon: "errorFilled",
89
89
  background: "error-100",
@@ -116,7 +116,7 @@ export const Alert = ({
116
116
  fullWidth = false,
117
117
  accessibilityHint,
118
118
  testID
119
- }: Alert) => {
119
+ }: AlertType): JSX.Element => {
120
120
  const isPressed: Animated.SharedValue<number> = useSharedValue(0);
121
121
 
122
122
  // Scaling transformation applied when the button is pressed
@@ -154,6 +154,7 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
154
154
  onResponderTerminate={[Function]}
155
155
  onResponderTerminationRequest={[Function]}
156
156
  onStartShouldSetResponder={[Function]}
157
+ onTouchEnd={[Function]}
157
158
  style={
158
159
  {
159
160
  "alignSelf": "flex-start",
@@ -185,6 +185,7 @@ export const ButtonLink = React.memo(
185
185
  onPress={onPress}
186
186
  onPressIn={onPressIn}
187
187
  onPressOut={onPressOut}
188
+ onTouchEnd={onPressOut}
188
189
  accessible={true}
189
190
  disabled={disabled}
190
191
  hitSlop={{ top: 14, right: 24, bottom: 14, left: 24 }}
@@ -11,7 +11,6 @@ import Animated, {
11
11
  withSpring
12
12
  } from "react-native-reanimated";
13
13
  import {
14
- IOButtonStyles,
15
14
  IOColors,
16
15
  IOIconButtonStyles,
17
16
  IOScaleValues,
@@ -124,7 +123,6 @@ export const IconButton = ({
124
123
 
125
124
  return (
126
125
  <Pressable
127
- style={IOButtonStyles.dimensionsDefault}
128
126
  disabled={disabled}
129
127
  // Events
130
128
  onPress={onPress}
@@ -202,6 +202,7 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
202
202
  onResponderTerminate={[Function]}
203
203
  onResponderTerminationRequest={[Function]}
204
204
  onStartShouldSetResponder={[Function]}
205
+ onTouchEnd={[Function]}
205
206
  style={
206
207
  {
207
208
  "alignSelf": "flex-start",
@@ -496,11 +497,6 @@ exports[`Test Buttons Components IconButton Snapshot 1`] = `
496
497
  onResponderTerminate={[Function]}
497
498
  onResponderTerminationRequest={[Function]}
498
499
  onStartShouldSetResponder={[Function]}
499
- style={
500
- {
501
- "alignSelf": "flex-start",
502
- }
503
- }
504
500
  >
505
501
  <View
506
502
  style={
@@ -0,0 +1,105 @@
1
+ import React, { useEffect } from "react";
2
+ import { StyleSheet, Pressable, PressableProps } from "react-native";
3
+ import Animated, {
4
+ useSharedValue,
5
+ useAnimatedStyle,
6
+ interpolate,
7
+ withSpring,
8
+ withTiming,
9
+ Easing
10
+ } from "react-native-reanimated";
11
+ import { IOColors } from "../../core/IOColors";
12
+ import { IOSpringValues } from "../../core/IOAnimations";
13
+ import { AnimatedTick } from "../common/AnimatedTick";
14
+ import {
15
+ IOSelectionTickVisualParams,
16
+ IOVisualCostants
17
+ } from "../../core/IOStyles";
18
+ import { IOSpacingScale } from "../../core/IOSpacing";
19
+
20
+ type Props = {
21
+ checked?: boolean;
22
+ };
23
+
24
+ type AnimatedMessageCheckbox = Props & Pick<PressableProps, "onPress">;
25
+
26
+ const internalSpacing: IOSpacingScale = 4;
27
+
28
+ const styles = StyleSheet.create({
29
+ checkBoxWrapper: {
30
+ width: IOVisualCostants.avatarSizeSmall,
31
+ height: IOVisualCostants.avatarSizeSmall,
32
+ padding: internalSpacing
33
+ },
34
+ checkBoxCircle: {
35
+ position: "absolute",
36
+ left: 0,
37
+ top: 0,
38
+ width: IOVisualCostants.avatarSizeSmall,
39
+ height: IOVisualCostants.avatarSizeSmall,
40
+ borderRadius: IOVisualCostants.avatarSizeSmall
41
+ }
42
+ });
43
+
44
+ /**
45
+ * Animated message checkbox used for the specific message
46
+ * list item (Select mode that enables related actions)
47
+ */
48
+ export const AnimatedMessageCheckbox = ({
49
+ checked,
50
+ onPress
51
+ }: AnimatedMessageCheckbox) => {
52
+ const isChecked = checked ?? true;
53
+
54
+ const circleAnimationProgress = useSharedValue(checked ? 1 : 0);
55
+ const tickAnimationProgress = useSharedValue(checked ? 1 : 0);
56
+
57
+ useEffect(() => {
58
+ // eslint-disable-next-line functional/immutable-data
59
+ circleAnimationProgress.value = withSpring(
60
+ checked ? 1 : 0,
61
+ IOSpringValues.selection
62
+ );
63
+ // eslint-disable-next-line functional/immutable-data
64
+ tickAnimationProgress.value = withTiming(checked ? 1 : 0, {
65
+ duration: 250,
66
+ easing: Easing.out(Easing.cubic)
67
+ });
68
+ }, [checked, circleAnimationProgress, tickAnimationProgress]);
69
+
70
+ const animatedCheckboxCircle = useAnimatedStyle(() => {
71
+ const scale = interpolate(circleAnimationProgress.value, [0, 1], [0.8, 1]);
72
+ const opacity = circleAnimationProgress.value;
73
+
74
+ return {
75
+ opacity,
76
+ transform: [{ scale }]
77
+ };
78
+ });
79
+
80
+ return (
81
+ <Pressable
82
+ testID="AnimatedMessageCheckboxInput"
83
+ onPress={onPress}
84
+ style={styles.checkBoxWrapper}
85
+ >
86
+ <Animated.View
87
+ style={[
88
+ styles.checkBoxCircle,
89
+ {
90
+ backgroundColor:
91
+ IOColors[IOSelectionTickVisualParams.bgColorOnState]
92
+ },
93
+ animatedCheckboxCircle
94
+ ]}
95
+ />
96
+ {isChecked && (
97
+ <AnimatedTick
98
+ progress={tickAnimationProgress}
99
+ strokeWidth={1.5}
100
+ stroke={IOColors[IOSelectionTickVisualParams.tickColor]}
101
+ />
102
+ )}
103
+ </Pressable>
104
+ );
105
+ };
@@ -1,2 +1,3 @@
1
1
  export * from "./CheckboxLabel";
2
2
  export * from "./AnimatedCheckbox";
3
+ export * from "./AnimatedMessageCheckbox";
@@ -144,8 +144,10 @@ import IconSystemSettingsiOS from "./svg/IconSystemSettingsiOS";
144
144
  import IconSystemToggleInstructions from "./svg/IconSystemToggleInstructions";
145
145
  import IconSystemAppsAndroid from "./svg/IconSystemAppsAndroid";
146
146
  import IconSystemNotificationsInstructions from "./svg/IconSystemNotificationsInstructions";
147
+ import IconArchive from "./svg/IconArchive";
147
148
 
148
149
  export const IOIcons = {
150
+ archive: IconArchive,
149
151
  spid: IconSpid,
150
152
  cie: IconCie /* io-cie */,
151
153
  qrCode: IconQrCode,
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { Svg, Path } from "react-native-svg";
3
+ import { SVGIconProps } from "../Icon";
4
+
5
+ const IconArchive = ({ size, style, ...props }: SVGIconProps) => (
6
+ <Svg width={size} height={size} viewBox="0 0 24 24" style={style} {...props}>
7
+ <Path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M0 4c0-1.65685 1.34315-3 3-3h18c1.6569 0 3 1.34315 3 3v2c0 1.30622-.8348 2.41746-2 2.82929V18c0 2.7614-2.2386 5-5 5H7c-2.76142 0-5-2.2386-5-5V8.82929C.8348 8.41746 0 7.30622 0 6V4Zm4 5h16v9c0 1.6569-1.3431 3-3 3H7c-1.65685 0-3-1.3431-3-3V9Zm18-3c0 .55228-.4477 1-1 1H3c-.55228 0-1-.44771-1-1V4c0-.55228.44772-1 1-1h18c.5523 0 1 .44771 1 1v2ZM9 11c-.55229 0-1 .4477-1 1s.44771 1 1 1h6c.5523 0 1-.4477 1-1s-.4477-1-1-1H9Z"
11
+ fill="currentColor"
12
+ />
13
+ </Svg>
14
+ );
15
+
16
+ export default IconArchive;
@@ -0,0 +1,4 @@
1
+ <svg fill="none"
2
+ xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0 4c0-1.65685 1.34315-3 3-3h18c1.6569 0 3 1.34315 3 3v2c0 1.30622-.8348 2.41746-2 2.82929V18c0 2.7614-2.2386 5-5 5H7c-2.76142 0-5-2.2386-5-5V8.82929C.8348 8.41746 0 7.30622 0 6V4Zm4 5h16v9c0 1.6569-1.3431 3-3 3H7c-1.65685 0-3-1.3431-3-3V9Zm18-3c0 .55228-.4477 1-1 1H3c-.55228 0-1-.44771-1-1V4c0-.55228.44772-1 1-1h18c.5523 0 1 .44771 1 1v2ZM9 11c-.55229 0-1 .4477-1 1s.44771 1 1 1h6c.5523 0 1-.4477 1-1s-.4477-1-1-1H9Z" fill="#0E0F13" />
4
+ </svg>
@@ -0,0 +1,153 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet, Platform } from "react-native";
3
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
4
+ import Animated, {
5
+ interpolate,
6
+ interpolateColor,
7
+ useAnimatedStyle
8
+ } from "react-native-reanimated";
9
+ import { IOColors, hexToRgba } from "../../core/IOColors";
10
+
11
+ import {
12
+ IOStyles,
13
+ IOVisualCostants,
14
+ iconBtnSizeSmall
15
+ } from "../../core/IOStyles";
16
+ import { HSpacer } from "../spacer";
17
+ import type { IOSpacer } from "../../core/IOSpacing";
18
+ import { WithTestID } from "../../utils/types";
19
+ import IconButton from "../buttons/IconButton";
20
+ import { makeFontStyleObject } from "../../utils/fonts";
21
+
22
+ export type HeaderSecondLevel = WithTestID<{
23
+ scrollValues: ScrollValues;
24
+ title: string;
25
+ goBack: () => void;
26
+ backAccessibilityLabel: string;
27
+ // Accepted components: IconButton
28
+ // Don't use any components other than this, please.
29
+ firstAction?: React.ReactNode;
30
+ secondAction?: React.ReactNode;
31
+ thirdAction?: React.ReactNode;
32
+ // Visual attributes
33
+ transparent?: boolean;
34
+ }>;
35
+
36
+ type ScrollValues = {
37
+ contentOffsetY: Animated.SharedValue<number>;
38
+ triggerOffset: number;
39
+ };
40
+
41
+ const HEADER_BG_COLOR: IOColors = "white";
42
+ const borderColorDisabled = hexToRgba(IOColors["grey-100"], 0);
43
+ const headerTransparent = hexToRgba(IOColors[HEADER_BG_COLOR], 0);
44
+ const titleHorizontalMargin: IOSpacer = 16;
45
+
46
+ const styles = StyleSheet.create({
47
+ headerInner: {
48
+ paddingHorizontal: IOVisualCostants.appMarginDefault,
49
+ height: IOVisualCostants.headerHeight,
50
+ borderBottomWidth: 1,
51
+ flexGrow: 1,
52
+ flexDirection: "row",
53
+ alignItems: "center",
54
+ justifyContent: "space-between"
55
+ },
56
+ headerTitle: {
57
+ ...makeFontStyleObject("Regular", false, "ReadexPro"),
58
+ fontSize: 14,
59
+ textAlign: "center",
60
+ flexGrow: 1,
61
+ flexShrink: 1,
62
+ marginHorizontal: titleHorizontalMargin
63
+ }
64
+ });
65
+
66
+ export const HeaderSecondLevel = ({
67
+ scrollValues,
68
+ goBack,
69
+ backAccessibilityLabel,
70
+ title,
71
+ firstAction,
72
+ secondAction,
73
+ thirdAction,
74
+ transparent = false,
75
+ testID
76
+ }: HeaderSecondLevel) => {
77
+ const insets = useSafeAreaInsets();
78
+
79
+ const headerWrapperAnimatedStyle = useAnimatedStyle(() => ({
80
+ backgroundColor: transparent
81
+ ? interpolateColor(
82
+ scrollValues.contentOffsetY.value,
83
+ [0, scrollValues.triggerOffset],
84
+ [headerTransparent, IOColors[HEADER_BG_COLOR]]
85
+ )
86
+ : undefined,
87
+ borderColor: interpolateColor(
88
+ scrollValues.contentOffsetY.value,
89
+ [0, scrollValues.triggerOffset],
90
+ [borderColorDisabled, IOColors["grey-100"]]
91
+ )
92
+ }));
93
+
94
+ const titleAnimatedStyle = useAnimatedStyle(() => ({
95
+ opacity: interpolate(
96
+ scrollValues.contentOffsetY.value,
97
+ [0, scrollValues.triggerOffset],
98
+ [0, 1]
99
+ )
100
+ }));
101
+
102
+ return (
103
+ <Animated.View
104
+ accessibilityRole="header"
105
+ testID={testID}
106
+ style={[
107
+ { marginTop: insets.top },
108
+ styles.headerInner,
109
+ transparent
110
+ ? { borderBottomWidth: 0 }
111
+ : { backgroundColor: IOColors[HEADER_BG_COLOR] },
112
+ headerWrapperAnimatedStyle
113
+ ]}
114
+ >
115
+ <IconButton
116
+ icon={Platform.OS === "ios" ? "backiOS" : "backAndroid"}
117
+ color="neutral"
118
+ onPress={goBack}
119
+ accessibilityLabel={backAccessibilityLabel}
120
+ />
121
+ <Animated.Text
122
+ numberOfLines={1}
123
+ style={[styles.headerTitle, titleAnimatedStyle]}
124
+ >
125
+ {title}
126
+ </Animated.Text>
127
+ <View style={[IOStyles.row, { flexShrink: 0 }]}>
128
+ {firstAction ? (
129
+ firstAction
130
+ ) : (
131
+ <HSpacer size={iconBtnSizeSmall as IOSpacer} />
132
+ )}
133
+ {secondAction && (
134
+ <>
135
+ {/* Ideally, with the "gap" flex property,
136
+ we can get rid of these ugly constructs */}
137
+ <HSpacer size={16} />
138
+ {secondAction}
139
+ </>
140
+ )}
141
+ {thirdAction && (
142
+ <>
143
+ {/* Same as above */}
144
+ <HSpacer size={16} />
145
+ {thirdAction}
146
+ </>
147
+ )}
148
+ </View>
149
+ </Animated.View>
150
+ );
151
+ };
152
+
153
+ export default HeaderSecondLevel;
@@ -1 +1,4 @@
1
+ export * from "./GradientScrollView";
1
2
  export * from "./GradientBottomActions";
3
+ export * from "./HeaderFirstLevel";
4
+ export * from "./HeaderSecondLevel";
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { IOTheme, IOThemeLight } from "../../core/IOColors";
3
+ import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
4
+ import { useTypographyFactory } from "./Factory";
5
+ import { ExternalTypographyProps, TypographyProps } from "./common";
6
+
7
+ type AllowedColors = IOTheme["textBody-default"] | "blueIO-850";
8
+ type AllowedWeight = Extract<IOFontWeight, "SemiBold" | "Regular">;
9
+
10
+ type OwnProps = ExternalTypographyProps<
11
+ TypographyProps<AllowedWeight, AllowedColors>
12
+ >;
13
+
14
+ /* Common typographic styles */
15
+ const ctaFontSize = 16;
16
+ const ctaLineHeight = 20;
17
+ const ctaDefaultColor: AllowedColors = IOThemeLight["textBody-default"];
18
+ /* New typographic styles */
19
+ const ctaFontName: IOFontFamily = "ReadexPro";
20
+ const ctaDefaultWeight: AllowedWeight = "Regular";
21
+
22
+ /**
23
+ * Typography component to render `CTA` text with font size {@link ctaFontSize} and fontFamily {@link ctaFontName}.
24
+ * default values(if not defined) are weight: {@link ctaDefaultWeight}, color: {@link ctaDefaultColor}
25
+ * @param props
26
+ * @constructor
27
+ */
28
+ export const CTA: React.FunctionComponent<OwnProps> = props =>
29
+ useTypographyFactory<AllowedWeight, AllowedColors>({
30
+ ...props,
31
+ defaultWeight: ctaDefaultWeight,
32
+ defaultColor: ctaDefaultColor,
33
+ font: ctaFontName,
34
+ fontStyle: { fontSize: ctaFontSize, lineHeight: ctaLineHeight }
35
+ });
@@ -32,6 +32,38 @@ exports[`Test Typography Components Body Snapshot 1`] = `
32
32
  </Text>
33
33
  `;
34
34
 
35
+ exports[`Test Typography Components CTA Snapshot 1`] = `
36
+ <Text
37
+ color="black"
38
+ defaultColor="black"
39
+ defaultWeight="Regular"
40
+ font="ReadexPro"
41
+ fontStyle={
42
+ {
43
+ "fontSize": 16,
44
+ "lineHeight": 20,
45
+ }
46
+ }
47
+ style={
48
+ [
49
+ {
50
+ "fontSize": 16,
51
+ "lineHeight": 20,
52
+ },
53
+ {
54
+ "color": "#0E0F13",
55
+ "fontFamily": "Readex Pro",
56
+ "fontStyle": "normal",
57
+ "fontWeight": "400",
58
+ },
59
+ ]
60
+ }
61
+ weight="Regular"
62
+ >
63
+ Text
64
+ </Text>
65
+ `;
66
+
35
67
  exports[`Test Typography Components H1 Snapshot 1`] = `
36
68
  <Text
37
69
  color="bluegreyDark"
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import * as TestRenderer from "react-test-renderer";
3
- import { IOFontWeight } from "../../../utils/fonts";
4
3
  import type { IOColors } from "../../../core/IOColors";
4
+ import { IOFontWeight } from "../../../utils/fonts";
5
5
  import { Body } from "../Body";
6
- import { calculateWeightColor } from "../common";
6
+ import { CTA } from "../CTA";
7
7
  import { H1 } from "../H1";
8
8
  import { H2 } from "../H2";
9
9
  import { H3 } from "../H3";
@@ -14,6 +14,7 @@ import { Label } from "../Label";
14
14
  import { LabelSmall } from "../LabelSmall";
15
15
  import { Link } from "../Link";
16
16
  import { Monospace } from "../Monospace";
17
+ import { calculateWeightColor } from "../common";
17
18
 
18
19
  describe("Test Typography Components", () => {
19
20
  it("H1 Snapshot", () => {
@@ -144,6 +145,10 @@ describe("Test Typography Components", () => {
144
145
  const bodyDefault = TestRenderer.create(<Body>Text</Body>).toJSON();
145
146
  expect(bodyDefault).toMatchSnapshot();
146
147
  });
148
+ it("CTA Snapshot", () => {
149
+ const cta = TestRenderer.create(<CTA>Text</CTA>).toJSON();
150
+ expect(cta).toMatchSnapshot();
151
+ });
147
152
  it("LabelSmall Snapshot", () => {
148
153
  const labelSmallDefault = TestRenderer.create(
149
154
  <LabelSmall>Text</LabelSmall>
@@ -1,6 +1,6 @@
1
1
  export * from "./BaseTypography";
2
2
  export * from "./Body";
3
- export * from "./common";
3
+ export * from "./CTA";
4
4
  export * from "./Factory";
5
5
  export * from "./H1";
6
6
  export * from "./H2";
@@ -12,5 +12,5 @@ export * from "./Label";
12
12
  export * from "./LabelSmall";
13
13
  export * from "./Link";
14
14
  export * from "./Monospace";
15
-
15
+ export * from "./common";
16
16