@pagopa/io-app-design-system 1.32.1 → 1.34.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/lib/commonjs/components/avatar/Avatar.js +1 -1
- package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -2
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -0
- package/lib/commonjs/components/buttons/ButtonLink.js +4 -1
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +4 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +6 -3
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +4 -1
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +3 -0
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +3 -0
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +2 -0
- package/lib/commonjs/components/icons/svg/IconCategCulture.js +1 -7
- package/lib/commonjs/components/icons/svg/IconCategCulture.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategFinance.js +3 -4
- package/lib/commonjs/components/icons/svg/IconCategFinance.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategHome.js +3 -4
- package/lib/commonjs/components/icons/svg/IconCategHome.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategJobOffers.js +3 -1
- package/lib/commonjs/components/icons/svg/IconCategJobOffers.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategLearning.js +3 -1
- package/lib/commonjs/components/icons/svg/IconCategLearning.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategMobility.js +3 -1
- package/lib/commonjs/components/icons/svg/IconCategMobility.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategSport.js +1 -1
- package/lib/commonjs/components/icons/svg/IconCategSport.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategTelco.js +3 -9
- package/lib/commonjs/components/icons/svg/IconCategTelco.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategTravel.js +1 -6
- package/lib/commonjs/components/icons/svg/IconCategTravel.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconCategWellness.js +3 -4
- package/lib/commonjs/components/icons/svg/IconCategWellness.js.map +1 -1
- package/lib/commonjs/components/icons/svg/originals/IconCategCulture.svg +1 -14
- package/lib/commonjs/components/icons/svg/originals/IconCategFinance.svg +1 -10
- package/lib/commonjs/components/icons/svg/originals/IconCategHome.svg +1 -10
- package/lib/commonjs/components/icons/svg/originals/IconCategJobOffers.svg +1 -6
- package/lib/commonjs/components/icons/svg/originals/IconCategLearning.svg +1 -6
- package/lib/commonjs/components/icons/svg/originals/IconCategMobility.svg +1 -6
- package/lib/commonjs/components/icons/svg/originals/IconCategSport.svg +1 -8
- package/lib/commonjs/components/icons/svg/originals/IconCategTelco.svg +1 -13
- package/lib/commonjs/components/icons/svg/originals/IconCategTravel.svg +1 -12
- package/lib/commonjs/components/icons/svg/originals/IconCategWellness.svg +1 -10
- package/lib/commonjs/components/index.js +42 -31
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js +7 -4
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +5 -0
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +6 -4
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +23 -9
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js +5 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/commonjs/components/listitems/PressableListItemsBase.js +7 -6
- package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -8
- package/lib/commonjs/components/modules/ModuleAttachment.js +6 -3
- package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js +3 -3
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js +90 -0
- package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -0
- package/lib/commonjs/components/modules/PressableModuleBase.js +5 -3
- package/lib/commonjs/components/modules/PressableModuleBase.js.map +1 -1
- package/lib/commonjs/components/modules/index.js +31 -20
- package/lib/commonjs/components/modules/index.js.map +1 -1
- package/lib/commonjs/components/radio/RadioButtonLabel.js +10 -9
- package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/commonjs/components/radio/RadioGroup.js +7 -2
- package/lib/commonjs/components/radio/RadioGroup.js.map +1 -1
- package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
- package/lib/commonjs/components/stack/Stack.js +47 -0
- package/lib/commonjs/components/stack/Stack.js.map +1 -0
- package/lib/commonjs/components/stack/index.js +17 -0
- package/lib/commonjs/components/stack/index.js.map +1 -0
- package/lib/commonjs/components/tabs/TabItem.js +59 -7
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tabs/TabNavigation.js +2 -7
- package/lib/commonjs/components/tabs/TabNavigation.js.map +1 -1
- package/lib/module/components/avatar/Avatar.js +1 -1
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -2
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -0
- package/lib/module/components/buttons/ButtonLink.js +4 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +4 -1
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +6 -3
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +4 -1
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +3 -0
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +3 -0
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +2 -0
- package/lib/module/components/icons/svg/IconCategCulture.js +1 -7
- package/lib/module/components/icons/svg/IconCategCulture.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategFinance.js +3 -4
- package/lib/module/components/icons/svg/IconCategFinance.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategHome.js +3 -4
- package/lib/module/components/icons/svg/IconCategHome.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategJobOffers.js +3 -1
- package/lib/module/components/icons/svg/IconCategJobOffers.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategLearning.js +3 -1
- package/lib/module/components/icons/svg/IconCategLearning.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategMobility.js +3 -1
- package/lib/module/components/icons/svg/IconCategMobility.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategSport.js +1 -1
- package/lib/module/components/icons/svg/IconCategSport.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategTelco.js +3 -9
- package/lib/module/components/icons/svg/IconCategTelco.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategTravel.js +1 -6
- package/lib/module/components/icons/svg/IconCategTravel.js.map +1 -1
- package/lib/module/components/icons/svg/IconCategWellness.js +3 -4
- package/lib/module/components/icons/svg/IconCategWellness.js.map +1 -1
- package/lib/module/components/icons/svg/originals/IconCategCulture.svg +1 -14
- package/lib/module/components/icons/svg/originals/IconCategFinance.svg +1 -10
- package/lib/module/components/icons/svg/originals/IconCategHome.svg +1 -10
- package/lib/module/components/icons/svg/originals/IconCategJobOffers.svg +1 -6
- package/lib/module/components/icons/svg/originals/IconCategLearning.svg +1 -6
- package/lib/module/components/icons/svg/originals/IconCategMobility.svg +1 -6
- package/lib/module/components/icons/svg/originals/IconCategSport.svg +1 -8
- package/lib/module/components/icons/svg/originals/IconCategTelco.svg +1 -13
- package/lib/module/components/icons/svg/originals/IconCategTravel.svg +1 -12
- package/lib/module/components/icons/svg/originals/IconCategWellness.svg +1 -10
- package/lib/module/components/index.js +5 -4
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +7 -4
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +5 -0
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +6 -4
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +23 -9
- package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemSwitch.js +5 -1
- package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/module/components/listitems/PressableListItemsBase.js +7 -6
- package/lib/module/components/listitems/PressableListItemsBase.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -8
- package/lib/module/components/modules/ModuleAttachment.js +6 -3
- package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/module/components/modules/ModuleCheckout.js +3 -3
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/components/modules/ModuleCredential.js +83 -0
- package/lib/module/components/modules/ModuleCredential.js.map +1 -0
- package/lib/module/components/modules/PressableModuleBase.js +5 -3
- package/lib/module/components/modules/PressableModuleBase.js.map +1 -1
- package/lib/module/components/modules/index.js +3 -2
- package/lib/module/components/modules/index.js.map +1 -1
- package/lib/module/components/radio/RadioButtonLabel.js +10 -9
- package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/module/components/radio/RadioGroup.js +7 -2
- package/lib/module/components/radio/RadioGroup.js.map +1 -1
- package/lib/module/components/spacer/Spacer.js.map +1 -1
- package/lib/module/components/stack/Stack.js +39 -0
- package/lib/module/components/stack/Stack.js.map +1 -0
- package/lib/module/components/stack/index.js +2 -0
- package/lib/module/components/stack/index.js.map +1 -0
- package/lib/module/components/tabs/TabItem.js +60 -7
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tabs/TabNavigation.js +2 -7
- package/lib/module/components/tabs/TabNavigation.js.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts +4 -10
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +4 -16
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonContained.d.ts +1 -1
- package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategCulture.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategFinance.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategHome.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategJobOffers.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategLearning.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategMobility.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategTelco.d.ts +2 -2
- package/lib/typescript/components/icons/svg/IconCategTelco.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategTravel.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconCategWellness.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +5 -4
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemCheckbox.d.ts +2 -2
- package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts +4 -5
- package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadio.d.ts +2 -2
- package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts +4 -2
- package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
- package/lib/typescript/components/listitems/PressableListItemsBase.d.ts +3 -5
- package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleCredential.d.ts +25 -0
- package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -0
- package/lib/typescript/components/modules/PressableModuleBase.d.ts +4 -5
- package/lib/typescript/components/modules/PressableModuleBase.d.ts.map +1 -1
- package/lib/typescript/components/modules/index.d.ts +3 -2
- package/lib/typescript/components/modules/index.d.ts.map +1 -1
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts +2 -2
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
- package/lib/typescript/components/radio/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/components/stack/Stack.d.ts +18 -0
- package/lib/typescript/components/stack/Stack.d.ts.map +1 -0
- package/lib/typescript/components/stack/index.d.ts +2 -0
- package/lib/typescript/components/stack/index.d.ts.map +1 -0
- package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabNavigation.d.ts +1 -1
- package/lib/typescript/components/tabs/TabNavigation.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +1 -1
- package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -2
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -0
- package/src/components/buttons/ButtonLink.tsx +2 -1
- package/src/components/buttons/ButtonOutline.tsx +18 -15
- package/src/components/buttons/ButtonSolid.tsx +33 -30
- package/src/components/buttons/IconButton.tsx +1 -0
- package/src/components/buttons/IconButtonContained.tsx +2 -1
- package/src/components/buttons/IconButtonSolid.tsx +1 -0
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +2 -0
- package/src/components/icons/svg/IconCategCulture.tsx +1 -9
- package/src/components/icons/svg/IconCategFinance.tsx +3 -5
- package/src/components/icons/svg/IconCategHome.tsx +3 -5
- package/src/components/icons/svg/IconCategJobOffers.tsx +3 -1
- package/src/components/icons/svg/IconCategLearning.tsx +3 -1
- package/src/components/icons/svg/IconCategMobility.tsx +3 -1
- package/src/components/icons/svg/IconCategSport.tsx +1 -1
- package/src/components/icons/svg/IconCategTelco.tsx +3 -8
- package/src/components/icons/svg/IconCategTravel.tsx +1 -7
- package/src/components/icons/svg/IconCategWellness.tsx +3 -5
- package/src/components/icons/svg/originals/IconCategCulture.svg +1 -14
- package/src/components/icons/svg/originals/IconCategFinance.svg +1 -10
- package/src/components/icons/svg/originals/IconCategHome.svg +1 -10
- package/src/components/icons/svg/originals/IconCategJobOffers.svg +1 -6
- package/src/components/icons/svg/originals/IconCategLearning.svg +1 -6
- package/src/components/icons/svg/originals/IconCategMobility.svg +1 -6
- package/src/components/icons/svg/originals/IconCategSport.svg +1 -8
- package/src/components/icons/svg/originals/IconCategTelco.svg +1 -13
- package/src/components/icons/svg/originals/IconCategTravel.svg +1 -12
- package/src/components/icons/svg/originals/IconCategWellness.svg +1 -10
- package/src/components/index.tsx +5 -4
- package/src/components/listitems/ListItemCheckbox.tsx +12 -6
- package/src/components/listitems/ListItemNav.tsx +17 -11
- package/src/components/listitems/ListItemRadio.tsx +9 -6
- package/src/components/listitems/ListItemRadioWithAmount.tsx +28 -13
- package/src/components/listitems/ListItemSwitch.tsx +1 -0
- package/src/components/listitems/PressableListItemsBase.tsx +16 -8
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -8
- package/src/components/modules/ModuleAttachment.tsx +4 -3
- package/src/components/modules/ModuleCheckout.tsx +5 -5
- package/src/components/modules/ModuleCredential.tsx +111 -0
- package/src/components/modules/PressableModuleBase.tsx +16 -10
- package/src/components/modules/index.tsx +3 -2
- package/src/components/radio/RadioButtonLabel.tsx +16 -11
- package/src/components/radio/RadioGroup.tsx +18 -8
- package/src/components/spacer/Spacer.tsx +1 -1
- package/src/components/stack/Stack.tsx +41 -0
- package/src/components/stack/index.tsx +1 -0
- package/src/components/tabs/TabItem.tsx +93 -10
- package/src/components/tabs/TabNavigation.tsx +2 -10
package/src/components/index.tsx
CHANGED
|
@@ -5,8 +5,8 @@ export * from "./badge";
|
|
|
5
5
|
export * from "./banner";
|
|
6
6
|
export * from "./buttons";
|
|
7
7
|
export * from "./checkbox";
|
|
8
|
-
export * from "./contentWrapper";
|
|
9
8
|
export * from "./codeInput";
|
|
9
|
+
export * from "./contentWrapper";
|
|
10
10
|
export * from "./divider";
|
|
11
11
|
export * from "./endOfPage";
|
|
12
12
|
export * from "./featureInfo";
|
|
@@ -14,8 +14,8 @@ export * from "./icons";
|
|
|
14
14
|
export * from "./image";
|
|
15
15
|
export * from "./layout";
|
|
16
16
|
export * from "./listitems";
|
|
17
|
-
export * from "./logos";
|
|
18
17
|
export * from "./loadingSpinner";
|
|
18
|
+
export * from "./logos";
|
|
19
19
|
export * from "./modules";
|
|
20
20
|
export * from "./numberpad";
|
|
21
21
|
export * from "./otpInput";
|
|
@@ -23,10 +23,11 @@ export * from "./pictograms";
|
|
|
23
23
|
export * from "./progressLoader";
|
|
24
24
|
export * from "./radio";
|
|
25
25
|
export * from "./spacer";
|
|
26
|
+
export * from "./stack";
|
|
26
27
|
export * from "./stepper";
|
|
27
28
|
export * from "./switch";
|
|
28
|
-
export * from "./tag";
|
|
29
29
|
export * from "./tabs";
|
|
30
|
+
export * from "./tag";
|
|
31
|
+
export * from "./textInput";
|
|
30
32
|
export * from "./toast";
|
|
31
33
|
export * from "./typography";
|
|
32
|
-
export * from "./textInput";
|
|
@@ -36,12 +36,10 @@ type Props = {
|
|
|
36
36
|
|
|
37
37
|
const DISABLED_OPACITY = 0.5;
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
// onPress:
|
|
41
|
-
type OwnProps = Props &
|
|
39
|
+
type ListItemCheckboxProps = Props &
|
|
42
40
|
Pick<
|
|
43
41
|
React.ComponentProps<typeof Pressable>,
|
|
44
|
-
"onPress" | "accessibilityLabel" | "disabled"
|
|
42
|
+
"onPress" | "accessibilityLabel" | "accessibilityHint" | "disabled"
|
|
45
43
|
>;
|
|
46
44
|
|
|
47
45
|
/**
|
|
@@ -57,9 +55,10 @@ export const ListItemCheckbox = ({
|
|
|
57
55
|
icon,
|
|
58
56
|
selected,
|
|
59
57
|
accessibilityLabel,
|
|
58
|
+
accessibilityHint,
|
|
60
59
|
disabled,
|
|
61
60
|
onValueChange
|
|
62
|
-
}:
|
|
61
|
+
}: ListItemCheckboxProps) => {
|
|
63
62
|
const [toggleValue, setToggleValue] = useState(selected ?? false);
|
|
64
63
|
// Animations
|
|
65
64
|
const isPressed: Animated.SharedValue<number> = useSharedValue(0);
|
|
@@ -74,6 +73,12 @@ export const ListItemCheckbox = ({
|
|
|
74
73
|
// Theme
|
|
75
74
|
const theme = useIOTheme();
|
|
76
75
|
|
|
76
|
+
// Accessibility
|
|
77
|
+
// Comma = Small pause when announcing content
|
|
78
|
+
const fallbackAccessibilityLabel = description
|
|
79
|
+
? `${value}, ${description}`
|
|
80
|
+
: value;
|
|
81
|
+
|
|
77
82
|
const mapBackgroundStates: Record<string, string> = {
|
|
78
83
|
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
79
84
|
pressed: IOColors[theme["listItem-pressed"]]
|
|
@@ -130,7 +135,8 @@ export const ListItemCheckbox = ({
|
|
|
130
135
|
onTouchEnd={handlePressOut}
|
|
131
136
|
testID="ListItemCheckbox"
|
|
132
137
|
accessible={true}
|
|
133
|
-
accessibilityLabel={accessibilityLabel}
|
|
138
|
+
accessibilityLabel={accessibilityLabel || fallbackAccessibilityLabel}
|
|
139
|
+
accessibilityHint={accessibilityHint}
|
|
134
140
|
accessibilityRole="checkbox"
|
|
135
141
|
accessibilityState={{
|
|
136
142
|
checked: selected ?? toggleValue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback } from "react";
|
|
1
|
+
import React, { ComponentProps, useCallback } from "react";
|
|
2
2
|
import {
|
|
3
3
|
GestureResponderEvent,
|
|
4
4
|
Image,
|
|
@@ -44,16 +44,19 @@ type ListItemTopElementProps =
|
|
|
44
44
|
dateValue: string;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
type ListItemNavPartialProps = WithTestID<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
type ListItemNavPartialProps = WithTestID<
|
|
48
|
+
{
|
|
49
|
+
value: string | React.ReactNode;
|
|
50
|
+
description?: string | React.ReactNode;
|
|
51
|
+
loading?: boolean;
|
|
52
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
53
|
+
hideChevron?: boolean;
|
|
54
|
+
topElement?: ListItemTopElementProps;
|
|
55
|
+
} & Pick<
|
|
56
|
+
ComponentProps<typeof Pressable>,
|
|
57
|
+
"accessibilityLabel" | "accessibilityHint"
|
|
58
|
+
>
|
|
59
|
+
>;
|
|
57
60
|
|
|
58
61
|
export type ListItemNavGraphicProps =
|
|
59
62
|
| { icon?: never; iconColor?: never; paymentLogoUri: string }
|
|
@@ -77,6 +80,7 @@ export const ListItemNav = ({
|
|
|
77
80
|
iconColor = "grey-450",
|
|
78
81
|
paymentLogoUri,
|
|
79
82
|
accessibilityLabel,
|
|
83
|
+
accessibilityHint,
|
|
80
84
|
testID,
|
|
81
85
|
hideChevron = false,
|
|
82
86
|
topElement,
|
|
@@ -197,7 +201,9 @@ export const ListItemNav = ({
|
|
|
197
201
|
onPressIn={handlePressIn}
|
|
198
202
|
onPressOut={handlePressOut}
|
|
199
203
|
accessible={true}
|
|
204
|
+
accessibilityState={{ busy: loading }}
|
|
200
205
|
accessibilityLabel={accessibilityLabel}
|
|
206
|
+
accessibilityHint={accessibilityHint}
|
|
201
207
|
accessibilityRole="button"
|
|
202
208
|
testID={testID}
|
|
203
209
|
>
|
|
@@ -57,18 +57,17 @@ type Props = WithTestID<{
|
|
|
57
57
|
|
|
58
58
|
const DISABLED_OPACITY = 0.5;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
// onPress:
|
|
62
|
-
type OwnProps = Props &
|
|
60
|
+
type ListItemRadioProps = Props &
|
|
63
61
|
Pick<
|
|
64
62
|
React.ComponentProps<typeof Pressable>,
|
|
65
|
-
"onPress" | "accessibilityLabel" | "disabled"
|
|
63
|
+
"onPress" | "accessibilityLabel" | "accessibilityHint" | "disabled"
|
|
66
64
|
>;
|
|
67
65
|
|
|
68
66
|
const styles = StyleSheet.create({
|
|
69
67
|
imageSize: {
|
|
70
68
|
width: IOSelectionListItemVisualParams.iconSize,
|
|
71
|
-
height: IOSelectionListItemVisualParams.iconSize
|
|
69
|
+
height: IOSelectionListItemVisualParams.iconSize,
|
|
70
|
+
resizeMode: "contain"
|
|
72
71
|
}
|
|
73
72
|
});
|
|
74
73
|
|
|
@@ -86,9 +85,11 @@ export const ListItemRadio = ({
|
|
|
86
85
|
selected,
|
|
87
86
|
disabled,
|
|
88
87
|
onValueChange,
|
|
88
|
+
accessibilityLabel,
|
|
89
|
+
accessibilityHint,
|
|
89
90
|
loadingProps,
|
|
90
91
|
testID
|
|
91
|
-
}:
|
|
92
|
+
}: ListItemRadioProps) => {
|
|
92
93
|
const [toggleValue, setToggleValue] = useState(selected ?? false);
|
|
93
94
|
// Animations
|
|
94
95
|
const isPressed: Animated.SharedValue<number> = useSharedValue(0);
|
|
@@ -216,6 +217,8 @@ export const ListItemRadio = ({
|
|
|
216
217
|
checked: selected ?? toggleValue,
|
|
217
218
|
disabled: !!disabled
|
|
218
219
|
}}
|
|
220
|
+
accessibilityLabel={accessibilityLabel}
|
|
221
|
+
accessibilityHint={accessibilityHint}
|
|
219
222
|
onPress={toggleRadioItem}
|
|
220
223
|
onPressIn={handlePressIn}
|
|
221
224
|
onPressOut={handlePressOut}
|
|
@@ -14,24 +14,32 @@ export type ListItemRadioWithAmountProps = {
|
|
|
14
14
|
selected?: boolean;
|
|
15
15
|
label: string;
|
|
16
16
|
formattedAmountString: string;
|
|
17
|
+
accessibilityLabel?: string;
|
|
17
18
|
} & (
|
|
18
19
|
| {
|
|
19
20
|
isSuggested?: false;
|
|
21
|
+
suggestReason?: never;
|
|
20
22
|
}
|
|
21
23
|
| {
|
|
22
|
-
isSuggested
|
|
24
|
+
isSuggested?: true;
|
|
23
25
|
suggestReason: string;
|
|
24
26
|
}
|
|
25
27
|
);
|
|
26
|
-
export const ListItemRadioWithAmount = (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
export const ListItemRadioWithAmount = ({
|
|
29
|
+
onValueChange,
|
|
30
|
+
selected,
|
|
31
|
+
label,
|
|
32
|
+
accessibilityLabel,
|
|
33
|
+
isSuggested = false,
|
|
34
|
+
suggestReason,
|
|
35
|
+
formattedAmountString
|
|
36
|
+
}: ListItemRadioWithAmountProps) => {
|
|
37
|
+
const [toggleValue, setToggleValue] = React.useState(selected ?? false);
|
|
30
38
|
const pressHandler = () => {
|
|
31
39
|
RNReactNativeHapticFeedback.trigger("impactLight");
|
|
32
40
|
setToggleValue(val => !val);
|
|
33
|
-
if (
|
|
34
|
-
|
|
41
|
+
if (onValueChange !== undefined) {
|
|
42
|
+
onValueChange(!toggleValue);
|
|
35
43
|
}
|
|
36
44
|
};
|
|
37
45
|
const theme = useIOTheme();
|
|
@@ -39,19 +47,26 @@ export const ListItemRadioWithAmount = (
|
|
|
39
47
|
const suggestColor: IOColors = "hanPurple-500";
|
|
40
48
|
|
|
41
49
|
return (
|
|
42
|
-
<PressableListItemBase
|
|
50
|
+
<PressableListItemBase
|
|
51
|
+
onPress={pressHandler}
|
|
52
|
+
accessibilityRole="radio"
|
|
53
|
+
accessibilityLabel={accessibilityLabel}
|
|
54
|
+
accessibilityState={{
|
|
55
|
+
checked: selected ?? toggleValue
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
43
58
|
<View style={{ flexShrink: 1 }}>
|
|
44
59
|
<LabelSmallAlt numberOfLines={1} color={theme["textBody-default"]}>
|
|
45
|
-
{
|
|
60
|
+
{label} con nome molto molto lungo
|
|
46
61
|
</LabelSmallAlt>
|
|
47
|
-
{
|
|
62
|
+
{isSuggested && (
|
|
48
63
|
<>
|
|
49
64
|
<VSpacer size={4} />
|
|
50
65
|
<View style={styles.rowCenter}>
|
|
51
66
|
<Icon name="sparkles" size={16} color={suggestColor} />
|
|
52
67
|
<HSpacer size={4} />
|
|
53
68
|
<LabelSmall weight="Regular" color={suggestColor}>
|
|
54
|
-
{
|
|
69
|
+
{suggestReason}
|
|
55
70
|
</LabelSmall>
|
|
56
71
|
</View>
|
|
57
72
|
</>
|
|
@@ -60,10 +75,10 @@ export const ListItemRadioWithAmount = (
|
|
|
60
75
|
<View pointerEvents="none" style={{ flexDirection: "row" }}>
|
|
61
76
|
<HSpacer size={8} />
|
|
62
77
|
<H6 color={theme["interactiveElem-default"]}>
|
|
63
|
-
{
|
|
78
|
+
{formattedAmountString}
|
|
64
79
|
</H6>
|
|
65
80
|
<HSpacer size={8} />
|
|
66
|
-
<AnimatedRadio checked={
|
|
81
|
+
<AnimatedRadio checked={selected ?? toggleValue} />
|
|
67
82
|
</View>
|
|
68
83
|
</PressableListItemBase>
|
|
69
84
|
);
|
|
@@ -5,15 +5,23 @@ import { IOListItemStyles } from "../../core";
|
|
|
5
5
|
import { WithTestID } from "../../utils/types";
|
|
6
6
|
import { useListItemSpringAnimation } from "./hooks/useListItemSpringAnimation";
|
|
7
7
|
|
|
8
|
-
export type PressableBaseProps = WithTestID<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export type PressableBaseProps = WithTestID<
|
|
9
|
+
Pick<
|
|
10
|
+
React.ComponentProps<typeof Pressable>,
|
|
11
|
+
| "onPress"
|
|
12
|
+
| "accessibilityLabel"
|
|
13
|
+
| "accessibilityHint"
|
|
14
|
+
| "accessibilityState"
|
|
15
|
+
| "accessibilityRole"
|
|
16
|
+
>
|
|
17
|
+
>;
|
|
18
|
+
|
|
12
19
|
export const PressableListItemBase = ({
|
|
13
20
|
onPress,
|
|
14
21
|
testID,
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
children,
|
|
23
|
+
accessibilityRole,
|
|
24
|
+
...props
|
|
17
25
|
}: React.PropsWithChildren<PressableBaseProps>) => {
|
|
18
26
|
const { onPressIn, onPressOut, animatedScaleStyle, animatedBackgroundStyle } =
|
|
19
27
|
useListItemSpringAnimation();
|
|
@@ -22,11 +30,11 @@ export const PressableListItemBase = ({
|
|
|
22
30
|
onPress={onPress}
|
|
23
31
|
testID={testID}
|
|
24
32
|
accessible={true}
|
|
25
|
-
accessibilityLabel={accessibilityLabel}
|
|
26
33
|
onPressIn={onPressIn}
|
|
27
34
|
onPressOut={onPressOut}
|
|
28
35
|
onTouchEnd={onPressOut}
|
|
29
|
-
accessibilityRole="button"
|
|
36
|
+
accessibilityRole={accessibilityRole || "button"}
|
|
37
|
+
{...props}
|
|
30
38
|
>
|
|
31
39
|
<Animated.View
|
|
32
40
|
style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
|
|
@@ -931,11 +931,11 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
|
|
|
931
931
|
|
|
932
932
|
exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmount Snapshot 1`] = `
|
|
933
933
|
<View
|
|
934
|
-
accessibilityRole="
|
|
934
|
+
accessibilityRole="radio"
|
|
935
935
|
accessibilityState={
|
|
936
936
|
{
|
|
937
937
|
"busy": undefined,
|
|
938
|
-
"checked":
|
|
938
|
+
"checked": true,
|
|
939
939
|
"disabled": undefined,
|
|
940
940
|
"expanded": undefined,
|
|
941
941
|
"selected": undefined,
|
|
@@ -1348,11 +1348,11 @@ exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmou
|
|
|
1348
1348
|
|
|
1349
1349
|
exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmount Snapshot 2`] = `
|
|
1350
1350
|
<View
|
|
1351
|
-
accessibilityRole="
|
|
1351
|
+
accessibilityRole="radio"
|
|
1352
1352
|
accessibilityState={
|
|
1353
1353
|
{
|
|
1354
1354
|
"busy": undefined,
|
|
1355
|
-
"checked":
|
|
1355
|
+
"checked": false,
|
|
1356
1356
|
"disabled": undefined,
|
|
1357
1357
|
"expanded": undefined,
|
|
1358
1358
|
"selected": undefined,
|
|
@@ -2736,11 +2736,11 @@ exports[`Test List Item Components ListItemNavAlert Snapshot 1`] = `
|
|
|
2736
2736
|
|
|
2737
2737
|
exports[`Test List Item Components ListItemRadioWithAmount Snapshot 1`] = `
|
|
2738
2738
|
<View
|
|
2739
|
-
accessibilityRole="
|
|
2739
|
+
accessibilityRole="radio"
|
|
2740
2740
|
accessibilityState={
|
|
2741
2741
|
{
|
|
2742
2742
|
"busy": undefined,
|
|
2743
|
-
"checked":
|
|
2743
|
+
"checked": true,
|
|
2744
2744
|
"disabled": undefined,
|
|
2745
2745
|
"expanded": undefined,
|
|
2746
2746
|
"selected": undefined,
|
|
@@ -3153,11 +3153,11 @@ exports[`Test List Item Components ListItemRadioWithAmount Snapshot 1`] = `
|
|
|
3153
3153
|
|
|
3154
3154
|
exports[`Test List Item Components ListItemRadioWithAmount Snapshot 2`] = `
|
|
3155
3155
|
<View
|
|
3156
|
-
accessibilityRole="
|
|
3156
|
+
accessibilityRole="radio"
|
|
3157
3157
|
accessibilityState={
|
|
3158
3158
|
{
|
|
3159
3159
|
"busy": undefined,
|
|
3160
|
-
"checked":
|
|
3160
|
+
"checked": false,
|
|
3161
3161
|
"disabled": undefined,
|
|
3162
3162
|
"expanded": undefined,
|
|
3163
3163
|
"selected": undefined,
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
useIOTheme
|
|
24
24
|
} from "../../core";
|
|
25
25
|
import { WithTestID } from "../../utils/types";
|
|
26
|
-
import { Icon } from "../icons";
|
|
27
|
-
import { LabelSmall } from "../typography";
|
|
28
|
-
import { VSpacer } from "../spacer";
|
|
29
26
|
import { Badge } from "../badge";
|
|
27
|
+
import { Icon } from "../icons";
|
|
30
28
|
import { LoadingSpinner } from "../loadingSpinner";
|
|
29
|
+
import { VSpacer } from "../spacer";
|
|
30
|
+
import { LabelSmall } from "../typography";
|
|
31
31
|
|
|
32
32
|
type PartialProps = WithTestID<{
|
|
33
33
|
title: string;
|
|
@@ -243,6 +243,7 @@ const SkeletonComponent = ({
|
|
|
243
243
|
<View
|
|
244
244
|
style={styles.button}
|
|
245
245
|
accessible={true}
|
|
246
|
+
accessibilityState={{ busy: true }}
|
|
246
247
|
accessibilityLabel={loadingAccessibilityLabel}
|
|
247
248
|
>
|
|
248
249
|
<View style={styles.innerContent}>
|
|
@@ -35,7 +35,7 @@ export type ModuleCheckoutProps = ModuleCheckoutPartialProps & {
|
|
|
35
35
|
ctaText?: string;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
type
|
|
38
|
+
type ActionOnlyProps = { text?: string };
|
|
39
39
|
|
|
40
40
|
// ---------------- component ----------------
|
|
41
41
|
|
|
@@ -75,7 +75,7 @@ export const ModuleCheckout = (props: ModuleCheckoutProps) => {
|
|
|
75
75
|
return (
|
|
76
76
|
<PressableModuleBase onPress={props.onPress}>
|
|
77
77
|
<ModuleBaseContent />
|
|
78
|
-
{props.ctaText && <
|
|
78
|
+
{props.ctaText && <ModuleAction text={props.ctaText} />}
|
|
79
79
|
</PressableModuleBase>
|
|
80
80
|
);
|
|
81
81
|
}
|
|
@@ -89,7 +89,7 @@ export const ModuleCheckout = (props: ModuleCheckoutProps) => {
|
|
|
89
89
|
|
|
90
90
|
// ---------------- sub-components----------------
|
|
91
91
|
|
|
92
|
-
const
|
|
92
|
+
const ModuleAction = ({ text }: ActionOnlyProps) => (
|
|
93
93
|
<View pointerEvents="none">
|
|
94
94
|
<ButtonLink
|
|
95
95
|
label={text ?? ""}
|
|
@@ -99,7 +99,7 @@ const CTA = ({ text }: CtaOnlyProps) => (
|
|
|
99
99
|
</View>
|
|
100
100
|
);
|
|
101
101
|
|
|
102
|
-
const LoadingVersion = ({ text }:
|
|
102
|
+
const LoadingVersion = ({ text }: ActionOnlyProps) => (
|
|
103
103
|
<View style={IOModuleStyles.button}>
|
|
104
104
|
<View style={styles.rowCenter}>
|
|
105
105
|
<Placeholder.Box animate="fade" radius={8} height={24} width={24} />
|
|
@@ -110,7 +110,7 @@ const LoadingVersion = ({ text }: CtaOnlyProps) => (
|
|
|
110
110
|
<Placeholder.Box animate="fade" radius={8} height={16} width={116} />
|
|
111
111
|
</View>
|
|
112
112
|
</View>
|
|
113
|
-
<
|
|
113
|
+
<ModuleAction text={text} />
|
|
114
114
|
</View>
|
|
115
115
|
);
|
|
116
116
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Image,
|
|
4
|
+
ImageSourcePropType,
|
|
5
|
+
ImageURISource,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
View
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import Placeholder from "rn-placeholder";
|
|
10
|
+
import {
|
|
11
|
+
IOListItemVisualParams,
|
|
12
|
+
IOModuleStyles,
|
|
13
|
+
IOSelectionListItemVisualParams,
|
|
14
|
+
IOStyles,
|
|
15
|
+
useIOTheme
|
|
16
|
+
} from "../../core";
|
|
17
|
+
import { WithTestID } from "../../utils/types";
|
|
18
|
+
import { Badge } from "../badge";
|
|
19
|
+
import { IOIcons, Icon } from "../icons";
|
|
20
|
+
import { HSpacer } from "../spacer";
|
|
21
|
+
import { LabelSmallAlt } from "../typography";
|
|
22
|
+
import {
|
|
23
|
+
PressableModuleBase,
|
|
24
|
+
PressableModuleBaseProps
|
|
25
|
+
} from "./PressableModuleBase";
|
|
26
|
+
|
|
27
|
+
type LoadingProps = {
|
|
28
|
+
isLoading: true;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type ImageProps =
|
|
32
|
+
| { icon: IOIcons; image?: never }
|
|
33
|
+
| { icon?: never; image: ImageURISource | ImageSourcePropType };
|
|
34
|
+
|
|
35
|
+
type BaseProps = {
|
|
36
|
+
isLoading?: false;
|
|
37
|
+
label: string;
|
|
38
|
+
badge?: Badge;
|
|
39
|
+
} & ImageProps &
|
|
40
|
+
PressableModuleBaseProps;
|
|
41
|
+
|
|
42
|
+
type ModuleCredentialProps = LoadingProps | BaseProps;
|
|
43
|
+
|
|
44
|
+
const ModuleCredential = (props: WithTestID<ModuleCredentialProps>) => {
|
|
45
|
+
const theme = useIOTheme();
|
|
46
|
+
|
|
47
|
+
if (props.isLoading) {
|
|
48
|
+
return <ModuleCredentialSkeleton />;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const { icon, image, label, onPress, badge, ...pressableProps } = props;
|
|
52
|
+
|
|
53
|
+
const iconComponent = (
|
|
54
|
+
<>
|
|
55
|
+
{icon && <Icon name={icon} size={24} color="grey-300" />}
|
|
56
|
+
{image && (
|
|
57
|
+
<Image
|
|
58
|
+
source={image}
|
|
59
|
+
style={styles.image}
|
|
60
|
+
accessibilityIgnoresInvertColors={true}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<PressableModuleBase {...pressableProps} onPress={onPress}>
|
|
68
|
+
<View>{iconComponent}</View>
|
|
69
|
+
<View style={{ flexGrow: 1, flexShrink: 1, paddingHorizontal: 8 }}>
|
|
70
|
+
<LabelSmallAlt
|
|
71
|
+
color="blueIO-500"
|
|
72
|
+
numberOfLines={2}
|
|
73
|
+
lineBreakMode="middle"
|
|
74
|
+
>
|
|
75
|
+
{label}
|
|
76
|
+
</LabelSmallAlt>
|
|
77
|
+
</View>
|
|
78
|
+
<View style={IOStyles.row}>
|
|
79
|
+
{badge && <Badge {...badge} />}
|
|
80
|
+
{onPress && (
|
|
81
|
+
<Icon
|
|
82
|
+
name="chevronRightListItem"
|
|
83
|
+
color={theme["interactiveElem-default"]}
|
|
84
|
+
size={IOListItemVisualParams.chevronSize}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
</View>
|
|
88
|
+
</PressableModuleBase>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const ModuleCredentialSkeleton = () => (
|
|
93
|
+
<View style={IOModuleStyles.button}>
|
|
94
|
+
<View style={[IOStyles.row, IOStyles.alignCenter]}>
|
|
95
|
+
<Placeholder.Box animate="fade" width={24} height={24} radius={8} />
|
|
96
|
+
<HSpacer size={8} />
|
|
97
|
+
<Placeholder.Box animate="fade" width={96} height={19} radius={8} />
|
|
98
|
+
</View>
|
|
99
|
+
<Placeholder.Box animate="fade" width={64} height={22} radius={8} />
|
|
100
|
+
</View>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const styles = StyleSheet.create({
|
|
104
|
+
image: {
|
|
105
|
+
width: IOSelectionListItemVisualParams.iconSize,
|
|
106
|
+
height: IOSelectionListItemVisualParams.iconSize,
|
|
107
|
+
resizeMode: "contain"
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export { ModuleCredential };
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
import { Pressable } from "react-native";
|
|
3
4
|
import Animated from "react-native-reanimated";
|
|
4
5
|
import { IOModuleIDPSavedVSpacing, IOModuleStyles } from "../../core";
|
|
5
6
|
import { WithTestID } from "../../utils/types";
|
|
6
7
|
import { useModuleSpringAnimation } from "./hooks/useModuleSpringAnimation";
|
|
7
8
|
|
|
8
|
-
export type PressableModuleBaseProps = WithTestID<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export type PressableModuleBaseProps = WithTestID<
|
|
10
|
+
{
|
|
11
|
+
withLooseSpacing?: boolean;
|
|
12
|
+
} & Pick<
|
|
13
|
+
React.ComponentProps<typeof Pressable>,
|
|
14
|
+
"onPress" | "accessibilityLabel" | "accessibilityHint"
|
|
15
|
+
>
|
|
16
|
+
>;
|
|
13
17
|
|
|
14
18
|
export const PressableModuleBase = ({
|
|
15
19
|
onPress,
|
|
16
|
-
testID,
|
|
17
|
-
accessibilityLabel,
|
|
18
20
|
withLooseSpacing = false,
|
|
21
|
+
accessibilityLabel,
|
|
22
|
+
accessibilityHint,
|
|
23
|
+
testID,
|
|
19
24
|
children
|
|
20
|
-
}:
|
|
25
|
+
}: PropsWithChildren<PressableModuleBaseProps>) => {
|
|
21
26
|
const { handlePressIn, handlePressOut, animatedStyle } =
|
|
22
27
|
useModuleSpringAnimation();
|
|
23
28
|
return (
|
|
@@ -25,10 +30,11 @@ export const PressableModuleBase = ({
|
|
|
25
30
|
onPress={onPress}
|
|
26
31
|
testID={testID}
|
|
27
32
|
accessible={true}
|
|
28
|
-
accessibilityLabel={accessibilityLabel}
|
|
29
33
|
onPressIn={handlePressIn}
|
|
30
34
|
onPressOut={handlePressOut}
|
|
31
35
|
onTouchEnd={handlePressOut}
|
|
36
|
+
accessibilityLabel={accessibilityLabel}
|
|
37
|
+
accessibilityHint={accessibilityHint}
|
|
32
38
|
accessibilityRole="button"
|
|
33
39
|
>
|
|
34
40
|
<Animated.View
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export * from "./ModuleAttachment";
|
|
2
|
+
export * from "./ModuleCheckout";
|
|
3
|
+
export * from "./ModuleCredential";
|
|
1
4
|
export * from "./ModuleIDP";
|
|
2
5
|
export * from "./ModulePaymentNotice";
|
|
3
6
|
export * from "./PressableModuleBase";
|
|
4
|
-
export * from "./ModuleCheckout";
|
|
5
|
-
export * from "./ModuleAttachment";
|
|
@@ -16,11 +16,12 @@ type Props = {
|
|
|
16
16
|
|
|
17
17
|
const DISABLED_OPACITY = 0.5;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
// onPress:
|
|
21
|
-
type OwnProps = Props &
|
|
19
|
+
type RadioButtonLabelProps = Props &
|
|
22
20
|
Pick<React.ComponentProps<typeof AnimatedRadio>, "disabled" | "checked"> &
|
|
23
|
-
Pick<
|
|
21
|
+
Pick<
|
|
22
|
+
React.ComponentProps<typeof Pressable>,
|
|
23
|
+
"onPress" | "accessibilityLabel" | "accessibilityHint"
|
|
24
|
+
>;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* A radio button with the automatic state management that uses a {@link AnimatedRadio}
|
|
@@ -33,8 +34,10 @@ export const RadioButtonLabel = ({
|
|
|
33
34
|
label,
|
|
34
35
|
checked,
|
|
35
36
|
disabled,
|
|
36
|
-
onValueChange
|
|
37
|
-
|
|
37
|
+
onValueChange,
|
|
38
|
+
accessibilityLabel,
|
|
39
|
+
accessibilityHint
|
|
40
|
+
}: RadioButtonLabelProps) => {
|
|
38
41
|
const theme = useIOTheme();
|
|
39
42
|
|
|
40
43
|
const [toggleValue, setToggleValue] = useState(checked ?? false);
|
|
@@ -49,17 +52,19 @@ export const RadioButtonLabel = ({
|
|
|
49
52
|
|
|
50
53
|
return (
|
|
51
54
|
<Pressable
|
|
52
|
-
accessibilityRole="radio"
|
|
53
|
-
accessibilityState={{
|
|
54
|
-
checked: checked ?? toggleValue,
|
|
55
|
-
disabled: !!disabled
|
|
56
|
-
}}
|
|
57
55
|
onPress={toggleRadioButton}
|
|
58
56
|
style={{
|
|
59
57
|
alignSelf: "flex-start",
|
|
60
58
|
opacity: disabled ? DISABLED_OPACITY : 1
|
|
61
59
|
}}
|
|
62
60
|
disabled={disabled}
|
|
61
|
+
accessibilityRole="radio"
|
|
62
|
+
accessibilityState={{
|
|
63
|
+
checked: checked ?? toggleValue,
|
|
64
|
+
disabled: !!disabled
|
|
65
|
+
}}
|
|
66
|
+
accessibilityLabel={accessibilityLabel}
|
|
67
|
+
accessibilityHint={accessibilityHint}
|
|
63
68
|
testID="AnimatedRadioButton"
|
|
64
69
|
>
|
|
65
70
|
<View
|