@pagopa/io-app-design-system 4.2.1 → 4.4.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/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
- package/lib/commonjs/components/alert/Alert.js +44 -65
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js +9 -29
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/commonjs/components/badge/Badge.js +16 -3
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +9 -5
- package/lib/commonjs/components/banner/Banner.js +10 -34
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
- package/lib/commonjs/components/buttons/ButtonLink.js +26 -54
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +27 -45
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +24 -45
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +15 -32
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +19 -42
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +16 -31
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +61 -19
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +23 -18
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/CheckboxLabel.js +13 -8
- package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/commonjs/components/common/AnimatedTick.js +7 -3
- package/lib/commonjs/components/common/AnimatedTick.js.map +1 -1
- package/lib/commonjs/components/common/LogoPaymentWithFallback.js +9 -3
- package/lib/commonjs/components/common/LogoPaymentWithFallback.js.map +1 -1
- package/lib/commonjs/components/featureInfo/FeatureInfo.js +9 -6
- package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/commonjs/components/icons/Icon.js +14 -7
- package/lib/commonjs/components/icons/Icon.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +7 -10
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +8 -9
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/layout/index.js +0 -11
- package/lib/commonjs/components/layout/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAction.js +24 -46
- package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAmount.js +13 -11
- package/lib/commonjs/components/listitems/ListItemAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js +25 -48
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js +11 -4
- package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +14 -17
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js +29 -55
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +36 -64
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +32 -58
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +43 -58
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +7 -2
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js +12 -14
- package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js +4 -2
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/{PressableListItemsBase.js → PressableListItemBase.js} +7 -7
- package/lib/commonjs/components/listitems/PressableListItemBase.js.map +1 -0
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +442 -430
- package/lib/commonjs/components/listitems/__test__/listitem.test.js +3 -3
- package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/commonjs/components/listitems/index.js +11 -11
- package/lib/commonjs/components/listitems/index.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js +7 -2
- package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleNavigation.js +5 -1
- package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/commonjs/components/modules/PressableModuleBase.js +17 -11
- package/lib/commonjs/components/modules/PressableModuleBase.js.map +1 -1
- package/lib/commonjs/components/modules/index.js +8 -8
- package/lib/commonjs/components/modules/index.js.map +1 -1
- package/lib/commonjs/components/numberpad/NumberButton.js +12 -28
- package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
- package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +40 -20
- package/lib/commonjs/components/pictograms/Pictogram.js +17 -4
- package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
- package/lib/commonjs/components/radio/AnimatedRadio.js +16 -15
- package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/commonjs/components/radio/RadioButtonLabel.js +9 -5
- package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/commonjs/components/searchInput/SearchInput.js +4 -3
- package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
- package/lib/commonjs/components/spacer/Spacer.js +13 -6
- package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
- package/lib/commonjs/components/stack/Stack.js +19 -9
- package/lib/commonjs/components/stack/Stack.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +15 -21
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +21 -8
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInput.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +23 -10
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/typography/IOText.js +3 -6
- package/lib/commonjs/components/typography/IOText.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +84 -84
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +50 -50
- package/lib/commonjs/core/IOAnimations.js +6 -12
- package/lib/commonjs/core/IOAnimations.js.map +1 -1
- package/lib/commonjs/hooks/index.js +28 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useListItemAnimation.js +40 -0
- package/lib/commonjs/hooks/useListItemAnimation.js.map +1 -0
- package/lib/commonjs/hooks/useScaleAnimation.js +36 -0
- package/lib/commonjs/hooks/useScaleAnimation.js.map +1 -0
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/accessibility.js +29 -1
- package/lib/commonjs/utils/accessibility.js.map +1 -1
- package/lib/commonjs/utils/fonts.js +3 -2
- package/lib/commonjs/utils/fonts.js.map +1 -1
- package/lib/commonjs/utils/hooks/index.js +28 -0
- package/lib/commonjs/utils/hooks/index.js.map +1 -0
- package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js +5 -7
- package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js.map +1 -1
- package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
- package/lib/module/components/alert/Alert.js +45 -67
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/alert/AlertEdgeToEdge.js +10 -31
- package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/module/components/badge/Badge.js +16 -3
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +9 -5
- package/lib/module/components/banner/Banner.js +10 -33
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
- package/lib/module/components/buttons/ButtonLink.js +29 -57
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +30 -48
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +27 -48
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +18 -35
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +21 -45
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +18 -34
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +61 -19
- package/lib/module/components/checkbox/AnimatedCheckbox.js +23 -18
- package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/CheckboxLabel.js +14 -9
- package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/module/components/common/AnimatedTick.js +7 -3
- package/lib/module/components/common/AnimatedTick.js.map +1 -1
- package/lib/module/components/common/LogoPaymentWithFallback.js +9 -3
- package/lib/module/components/common/LogoPaymentWithFallback.js.map +1 -1
- package/lib/module/components/featureInfo/FeatureInfo.js +11 -8
- package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/module/components/icons/Icon.js +15 -6
- package/lib/module/components/icons/Icon.js.map +1 -1
- package/lib/module/components/layout/HeaderFirstLevel.js +8 -11
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +9 -10
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/layout/index.js +0 -1
- package/lib/module/components/layout/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemAction.js +25 -48
- package/lib/module/components/listitems/ListItemAction.js.map +1 -1
- package/lib/module/components/listitems/ListItemAmount.js +13 -11
- package/lib/module/components/listitems/ListItemAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +28 -51
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemHeader.js +11 -4
- package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +14 -17
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +30 -57
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +38 -65
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +33 -58
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +46 -61
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +7 -2
- package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemSwitch.js +12 -14
- package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js +3 -1
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/{PressableListItemsBase.js → PressableListItemBase.js} +7 -7
- package/lib/module/components/listitems/PressableListItemBase.js.map +1 -0
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +442 -430
- package/lib/module/components/listitems/__test__/listitem.test.js +1 -1
- package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/module/components/listitems/index.js +1 -1
- package/lib/module/components/listitems/index.js.map +1 -1
- package/lib/module/components/modules/ModuleCredential.js +7 -2
- package/lib/module/components/modules/ModuleCredential.js.map +1 -1
- package/lib/module/components/modules/ModuleNavigation.js +5 -1
- package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/module/components/modules/PressableModuleBase.js +17 -10
- package/lib/module/components/modules/PressableModuleBase.js.map +1 -1
- package/lib/module/components/modules/index.js +1 -1
- package/lib/module/components/modules/index.js.map +1 -1
- package/lib/module/components/numberpad/NumberButton.js +14 -30
- package/lib/module/components/numberpad/NumberButton.js.map +1 -1
- package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +40 -20
- package/lib/module/components/pictograms/Pictogram.js +17 -4
- package/lib/module/components/pictograms/Pictogram.js.map +1 -1
- package/lib/module/components/radio/AnimatedRadio.js +16 -15
- package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/module/components/radio/RadioButtonLabel.js +10 -6
- package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/module/components/searchInput/SearchInput.js +5 -4
- package/lib/module/components/searchInput/SearchInput.js.map +1 -1
- package/lib/module/components/spacer/Spacer.js +11 -5
- package/lib/module/components/spacer/Spacer.js.map +1 -1
- package/lib/module/components/stack/Stack.js +19 -9
- package/lib/module/components/stack/Stack.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +18 -24
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tag/Tag.js +21 -8
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInput.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +23 -10
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/typography/IOText.js +5 -8
- package/lib/module/components/typography/IOText.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +84 -84
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +50 -50
- package/lib/module/core/IOAnimations.js +4 -10
- package/lib/module/core/IOAnimations.js.map +1 -1
- package/lib/module/hooks/index.js +3 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useListItemAnimation.js +33 -0
- package/lib/module/hooks/useListItemAnimation.js.map +1 -0
- package/lib/module/hooks/useScaleAnimation.js +29 -0
- package/lib/module/hooks/useScaleAnimation.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/accessibility.js +28 -1
- package/lib/module/utils/accessibility.js.map +1 -1
- package/lib/module/utils/fonts.js +1 -0
- package/lib/module/utils/fonts.js.map +1 -1
- package/lib/module/utils/hooks/index.js +3 -0
- package/lib/module/utils/hooks/index.js.map +1 -0
- package/lib/module/utils/hooks/useSpringPressProgressValue.js +5 -5
- package/lib/module/utils/hooks/useSpringPressProgressValue.js.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/components/alert/AlertEdgeToEdge.d.ts.map +1 -1
- package/lib/typescript/components/badge/Badge.d.ts +2 -1
- package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +1 -1
- 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.map +1 -1
- package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts +2 -1
- package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/CheckboxLabel.d.ts +2 -1
- package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
- package/lib/typescript/components/common/AnimatedTick.d.ts +4 -3
- package/lib/typescript/components/common/AnimatedTick.d.ts.map +1 -1
- package/lib/typescript/components/common/LogoPaymentWithFallback.d.ts.map +1 -1
- package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
- package/lib/typescript/components/icons/Icon.d.ts +5 -3
- package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/index.d.ts +0 -1
- package/lib/typescript/components/layout/index.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemAmount.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts +2 -2
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/listitems/{PressableListItemsBase.d.ts → PressableListItemBase.d.ts} +3 -2
- package/lib/typescript/components/listitems/PressableListItemBase.d.ts.map +1 -0
- package/lib/typescript/components/listitems/index.d.ts +1 -1
- package/lib/typescript/components/listitems/index.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
- package/lib/typescript/components/modules/PressableModuleBase.d.ts.map +1 -1
- package/lib/typescript/components/modules/index.d.ts +1 -1
- package/lib/typescript/components/modules/index.d.ts.map +1 -1
- package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts +5 -3
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/types.d.ts +1 -2
- package/lib/typescript/components/pictograms/types.d.ts.map +1 -1
- package/lib/typescript/components/radio/AnimatedRadio.d.ts +2 -1
- package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts +2 -1
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
- package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
- package/lib/typescript/components/spacer/Spacer.d.ts +1 -0
- package/lib/typescript/components/spacer/Spacer.d.ts.map +1 -1
- package/lib/typescript/components/stack/Stack.d.ts +2 -1
- package/lib/typescript/components/stack/Stack.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts +4 -2
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInput.d.ts +2 -1
- package/lib/typescript/components/textInput/TextInput.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/typography/BodyMonospace.d.ts +1 -1
- package/lib/typescript/components/typography/ButtonText.d.ts +1 -1
- package/lib/typescript/components/typography/Caption.d.ts +1 -1
- package/lib/typescript/components/typography/H1.d.ts +1 -1
- package/lib/typescript/components/typography/H2.d.ts +1 -1
- package/lib/typescript/components/typography/H3.d.ts +1 -1
- package/lib/typescript/components/typography/H4.d.ts +1 -1
- package/lib/typescript/components/typography/H5.d.ts +1 -1
- package/lib/typescript/components/typography/H6.d.ts +1 -1
- package/lib/typescript/components/typography/Hero.d.ts +1 -1
- package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
- package/lib/typescript/components/typography/markdown/MdH1.d.ts +1 -1
- package/lib/typescript/components/typography/markdown/MdH2.d.ts +1 -1
- package/lib/typescript/components/typography/markdown/MdH3.d.ts +1 -1
- package/lib/typescript/core/IOAnimations.d.ts +6 -10
- package/lib/typescript/core/IOAnimations.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +7 -7
- package/lib/typescript/hooks/index.d.ts +3 -0
- package/lib/typescript/hooks/index.d.ts.map +1 -0
- package/lib/typescript/hooks/useListItemAnimation.d.ts +10 -0
- package/lib/typescript/hooks/useListItemAnimation.d.ts.map +1 -0
- package/lib/typescript/hooks/useScaleAnimation.d.ts +10 -0
- package/lib/typescript/hooks/useScaleAnimation.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils/accessibility.d.ts +10 -0
- package/lib/typescript/utils/accessibility.d.ts.map +1 -1
- package/lib/typescript/utils/fonts.d.ts +2 -1
- package/lib/typescript/utils/fonts.d.ts.map +1 -1
- package/lib/typescript/utils/hooks/index.d.ts +3 -0
- package/lib/typescript/utils/hooks/index.d.ts.map +1 -0
- package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts +7 -8
- package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
- package/src/components/alert/Alert.tsx +49 -106
- package/src/components/alert/AlertEdgeToEdge.tsx +6 -46
- package/src/components/badge/Badge.tsx +29 -4
- package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +9 -5
- package/src/components/banner/Banner.tsx +6 -54
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
- package/src/components/buttons/ButtonLink.tsx +36 -89
- package/src/components/buttons/ButtonOutline.tsx +40 -75
- package/src/components/buttons/ButtonSolid.tsx +21 -67
- package/src/components/buttons/IconButton.tsx +12 -47
- package/src/components/buttons/IconButtonContained.tsx +21 -57
- package/src/components/buttons/IconButtonSolid.tsx +16 -46
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +61 -19
- package/src/components/checkbox/AnimatedCheckbox.tsx +36 -18
- package/src/components/checkbox/CheckboxLabel.tsx +22 -10
- package/src/components/common/AnimatedTick.tsx +9 -3
- package/src/components/common/LogoPaymentWithFallback.tsx +27 -5
- package/src/components/featureInfo/FeatureInfo.tsx +13 -9
- package/src/components/icons/Icon.tsx +23 -7
- package/src/components/layout/HeaderFirstLevel.tsx +11 -21
- package/src/components/layout/HeaderSecondLevel.tsx +5 -14
- package/src/components/layout/index.tsx +0 -1
- package/src/components/listitems/ListItemAction.tsx +28 -73
- package/src/components/listitems/ListItemAmount.tsx +16 -11
- package/src/components/listitems/ListItemCheckbox.tsx +39 -83
- package/src/components/listitems/ListItemHeader.tsx +14 -4
- package/src/components/listitems/ListItemInfo.tsx +27 -20
- package/src/components/listitems/ListItemInfoCopy.tsx +37 -86
- package/src/components/listitems/ListItemNav.tsx +55 -112
- package/src/components/listitems/ListItemNavAlert.tsx +42 -102
- package/src/components/listitems/ListItemRadio.tsx +60 -107
- package/src/components/listitems/ListItemRadioWithAmount.tsx +9 -3
- package/src/components/listitems/ListItemSwitch.tsx +21 -27
- package/src/components/listitems/ListItemTransaction.tsx +4 -1
- package/src/components/listitems/{PressableListItemsBase.tsx → PressableListItemBase.tsx} +7 -6
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +442 -430
- package/src/components/listitems/__test__/listitem.test.tsx +1 -1
- package/src/components/listitems/index.tsx +1 -1
- package/src/components/modules/ModuleCredential.tsx +5 -2
- package/src/components/modules/ModuleNavigation.tsx +3 -1
- package/src/components/modules/PressableModuleBase.tsx +15 -8
- package/src/components/modules/index.tsx +1 -1
- package/src/components/numberpad/NumberButton.tsx +12 -43
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +40 -20
- package/src/components/pictograms/Pictogram.tsx +24 -5
- package/src/components/pictograms/types.ts +1 -3
- package/src/components/radio/AnimatedRadio.tsx +31 -15
- package/src/components/radio/RadioButtonLabel.tsx +16 -8
- package/src/components/searchInput/SearchInput.tsx +10 -5
- package/src/components/spacer/Spacer.tsx +21 -6
- package/src/components/stack/Stack.tsx +25 -14
- package/src/components/tabs/TabItem.tsx +15 -29
- package/src/components/tag/Tag.tsx +26 -8
- package/src/components/textInput/TextInput.tsx +2 -1
- package/src/components/textInput/TextInputBase.tsx +44 -11
- package/src/components/typography/IOText.tsx +5 -6
- package/src/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +84 -84
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +50 -50
- package/src/core/IOAnimations.ts +8 -10
- package/src/hooks/index.tsx +2 -0
- package/src/hooks/useListItemAnimation.tsx +59 -0
- package/src/hooks/useScaleAnimation.tsx +41 -0
- package/src/index.tsx +1 -0
- package/src/utils/accessibility.ts +32 -1
- package/src/utils/fonts.ts +1 -0
- package/src/utils/hooks/index.tsx +2 -0
- package/src/utils/hooks/useSpringPressProgressValue.ts +14 -8
- package/lib/commonjs/components/layout/FooterWithButtons.js +0 -84
- package/lib/commonjs/components/layout/FooterWithButtons.js.map +0 -1
- package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +0 -1
- package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js +0 -56
- package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +0 -1
- package/lib/commonjs/components/modules/hooks/useModuleSpringAnimation.js +0 -41
- package/lib/commonjs/components/modules/hooks/useModuleSpringAnimation.js.map +0 -1
- package/lib/module/components/layout/FooterWithButtons.js +0 -75
- package/lib/module/components/layout/FooterWithButtons.js.map +0 -1
- package/lib/module/components/listitems/PressableListItemsBase.js.map +0 -1
- package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js +0 -47
- package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +0 -1
- package/lib/module/components/modules/hooks/useModuleSpringAnimation.js +0 -34
- package/lib/module/components/modules/hooks/useModuleSpringAnimation.js.map +0 -1
- package/lib/typescript/components/layout/FooterWithButtons.d.ts +0 -16
- package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +0 -1
- package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +0 -1
- package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts +0 -13
- package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts.map +0 -1
- package/lib/typescript/components/modules/hooks/useModuleSpringAnimation.d.ts +0 -10
- package/lib/typescript/components/modules/hooks/useModuleSpringAnimation.d.ts.map +0 -1
- package/src/components/layout/FooterWithButtons.tsx +0 -90
- package/src/components/listitems/hooks/useListItemSpringAnimation.ts +0 -72
- package/src/components/modules/hooks/useModuleSpringAnimation.ts +0 -49
|
@@ -1,39 +1,23 @@
|
|
|
1
|
-
import React, { ComponentProps
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Image,
|
|
5
|
-
Pressable,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
View
|
|
8
|
-
} from "react-native";
|
|
9
|
-
import Animated, {
|
|
10
|
-
Extrapolate,
|
|
11
|
-
interpolate,
|
|
12
|
-
interpolateColor,
|
|
13
|
-
useAnimatedStyle,
|
|
14
|
-
useDerivedValue,
|
|
15
|
-
useSharedValue,
|
|
16
|
-
withSpring
|
|
17
|
-
} from "react-native-reanimated";
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
|
+
import { GestureResponderEvent, Image, Pressable, View } from "react-native";
|
|
3
|
+
import Animated from "react-native-reanimated";
|
|
18
4
|
import {
|
|
19
5
|
IOColors,
|
|
20
6
|
IOListItemStyles,
|
|
21
7
|
IOListItemVisualParams,
|
|
22
|
-
IOScaleValues,
|
|
23
8
|
IOSelectionListItemVisualParams,
|
|
24
|
-
IOSpringValues,
|
|
25
9
|
IOStyles,
|
|
26
|
-
hexToRgba,
|
|
27
|
-
useIOExperimentalDesign,
|
|
28
10
|
useIOTheme
|
|
29
11
|
} from "../../core";
|
|
12
|
+
import { useListItemAnimation } from "../../hooks";
|
|
13
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
30
14
|
import { WithTestID } from "../../utils/types";
|
|
31
15
|
import { Avatar } from "../avatar";
|
|
32
16
|
import { Badge } from "../badge";
|
|
33
17
|
import { IOIcons, Icon } from "../icons";
|
|
34
18
|
import { LoadingSpinner } from "../loadingSpinner";
|
|
35
19
|
import { HSpacer, VSpacer } from "../spacer";
|
|
36
|
-
import { Caption, H6
|
|
20
|
+
import { BodySmall, Caption, H6 } from "../typography";
|
|
37
21
|
|
|
38
22
|
type ListItemTopElementProps =
|
|
39
23
|
| {
|
|
@@ -91,13 +75,6 @@ export type ListItemNavGraphicProps =
|
|
|
91
75
|
|
|
92
76
|
export type ListItemNav = ListItemNavPartialProps & ListItemNavGraphicProps;
|
|
93
77
|
|
|
94
|
-
const styles = StyleSheet.create({
|
|
95
|
-
paymentLogoSize: {
|
|
96
|
-
width: IOSelectionListItemVisualParams.iconSize,
|
|
97
|
-
height: IOSelectionListItemVisualParams.iconSize
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
78
|
export const ListItemNav = ({
|
|
102
79
|
value,
|
|
103
80
|
description,
|
|
@@ -114,15 +91,12 @@ export const ListItemNav = ({
|
|
|
114
91
|
loading,
|
|
115
92
|
numberOfLines
|
|
116
93
|
}: ListItemNav) => {
|
|
117
|
-
const
|
|
118
|
-
|
|
94
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
|
|
95
|
+
useListItemAnimation();
|
|
119
96
|
const theme = useIOTheme();
|
|
120
97
|
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
{GraphicalAsset}
|
|
124
|
-
</View>
|
|
125
|
-
);
|
|
98
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
99
|
+
useIOFontDynamicScale();
|
|
126
100
|
|
|
127
101
|
const listItemNavContent = (
|
|
128
102
|
<>
|
|
@@ -139,7 +113,12 @@ export const ListItemNav = ({
|
|
|
139
113
|
{topElement.dateValue && (
|
|
140
114
|
<>
|
|
141
115
|
<View style={{ alignSelf: "flex-start", flexDirection: "row" }}>
|
|
142
|
-
<Icon
|
|
116
|
+
<Icon
|
|
117
|
+
allowFontScaling
|
|
118
|
+
name="calendar"
|
|
119
|
+
size={16}
|
|
120
|
+
color="grey-300"
|
|
121
|
+
/>
|
|
143
122
|
<HSpacer size={4} />
|
|
144
123
|
<Caption color={theme["textBody-tertiary"]}>
|
|
145
124
|
{topElement.dateValue}
|
|
@@ -172,56 +151,7 @@ export const ListItemNav = ({
|
|
|
172
151
|
</>
|
|
173
152
|
);
|
|
174
153
|
|
|
175
|
-
const
|
|
176
|
-
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
177
|
-
pressed: IOColors[theme["listItem-pressed"]]
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const navIconColor = isExperimental
|
|
181
|
-
? theme["interactiveElem-default"]
|
|
182
|
-
: "blue";
|
|
183
|
-
|
|
184
|
-
// Scaling transformation applied when the button is pressed
|
|
185
|
-
const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
|
|
186
|
-
|
|
187
|
-
const progressPressed = useDerivedValue(() =>
|
|
188
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
// Interpolate animation values from `isPressed` values
|
|
192
|
-
const animatedScaleStyle = useAnimatedStyle(() => {
|
|
193
|
-
const scale = interpolate(
|
|
194
|
-
progressPressed.value,
|
|
195
|
-
[0, 1],
|
|
196
|
-
[1, animationScaleValue],
|
|
197
|
-
Extrapolate.CLAMP
|
|
198
|
-
);
|
|
199
|
-
|
|
200
|
-
return {
|
|
201
|
-
transform: [{ scale }]
|
|
202
|
-
};
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
206
|
-
const backgroundColor = interpolateColor(
|
|
207
|
-
progressPressed.value,
|
|
208
|
-
[0, 1],
|
|
209
|
-
[mapBackgroundStates.default, mapBackgroundStates.pressed]
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
return {
|
|
213
|
-
backgroundColor
|
|
214
|
-
};
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const handlePressIn = useCallback(() => {
|
|
218
|
-
// eslint-disable-next-line functional/immutable-data
|
|
219
|
-
isPressed.value = 1;
|
|
220
|
-
}, [isPressed]);
|
|
221
|
-
const handlePressOut = useCallback(() => {
|
|
222
|
-
// eslint-disable-next-line functional/immutable-data
|
|
223
|
-
isPressed.value = 0;
|
|
224
|
-
}, [isPressed]);
|
|
154
|
+
const interactiveColor = theme["interactiveElem-default"];
|
|
225
155
|
|
|
226
156
|
const handleOnPress = (event: GestureResponderEvent) => {
|
|
227
157
|
if (!loading) {
|
|
@@ -229,13 +159,12 @@ export const ListItemNav = ({
|
|
|
229
159
|
}
|
|
230
160
|
};
|
|
231
161
|
|
|
232
|
-
const primaryColor: IOColors = isExperimental ? "blueIO-500" : "blue";
|
|
233
|
-
|
|
234
162
|
return (
|
|
235
163
|
<Pressable
|
|
236
164
|
onPress={handleOnPress}
|
|
237
|
-
onPressIn={
|
|
238
|
-
onPressOut={
|
|
165
|
+
onPressIn={onPressIn}
|
|
166
|
+
onPressOut={onPressOut}
|
|
167
|
+
onTouchEnd={onPressOut}
|
|
239
168
|
accessible={true}
|
|
240
169
|
accessibilityState={{ busy: loading }}
|
|
241
170
|
accessibilityLabel={accessibilityLabel}
|
|
@@ -244,40 +173,54 @@ export const ListItemNav = ({
|
|
|
244
173
|
testID={testID}
|
|
245
174
|
>
|
|
246
175
|
<Animated.View
|
|
247
|
-
style={[IOListItemStyles.listItem,
|
|
176
|
+
style={[IOListItemStyles.listItem, backgroundAnimatedStyle]}
|
|
248
177
|
>
|
|
249
178
|
<Animated.View
|
|
250
|
-
style={[
|
|
179
|
+
style={[
|
|
180
|
+
IOListItemStyles.listItemInner,
|
|
181
|
+
{
|
|
182
|
+
columnGap:
|
|
183
|
+
IOListItemVisualParams.iconMargin *
|
|
184
|
+
dynamicFontScale *
|
|
185
|
+
spacingScaleMultiplier
|
|
186
|
+
},
|
|
187
|
+
scaleAnimatedStyle
|
|
188
|
+
]}
|
|
251
189
|
>
|
|
252
190
|
{/* Possibile graphical assets
|
|
253
191
|
- Icon
|
|
254
192
|
- Image URL (for payment logos)
|
|
255
193
|
- Avatar
|
|
256
194
|
*/}
|
|
257
|
-
{icon &&
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
{paymentLogoUri &&
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
195
|
+
{icon && !hugeFontEnabled && (
|
|
196
|
+
<Icon
|
|
197
|
+
allowFontScaling
|
|
198
|
+
name={icon}
|
|
199
|
+
color={iconColor}
|
|
200
|
+
size={IOListItemVisualParams.iconSize}
|
|
201
|
+
/>
|
|
202
|
+
)}
|
|
203
|
+
{paymentLogoUri && (
|
|
204
|
+
<Image
|
|
205
|
+
accessibilityIgnoresInvertColors
|
|
206
|
+
source={{ uri: paymentLogoUri }}
|
|
207
|
+
style={{
|
|
208
|
+
width:
|
|
209
|
+
IOSelectionListItemVisualParams.iconSize * dynamicFontScale,
|
|
210
|
+
height:
|
|
211
|
+
IOSelectionListItemVisualParams.iconSize * dynamicFontScale
|
|
212
|
+
}}
|
|
213
|
+
/>
|
|
214
|
+
)}
|
|
215
|
+
{avatar && <Avatar size="small" {...avatar} />}
|
|
274
216
|
|
|
275
217
|
<View style={IOStyles.flex}>{listItemNavContent}</View>
|
|
276
|
-
{loading && <LoadingSpinner color={
|
|
218
|
+
{loading && <LoadingSpinner color={interactiveColor} />}
|
|
277
219
|
{!loading && !hideChevron && (
|
|
278
220
|
<Icon
|
|
221
|
+
allowFontScaling
|
|
279
222
|
name="chevronRightListItem"
|
|
280
|
-
color={
|
|
223
|
+
color={interactiveColor}
|
|
281
224
|
size={IOListItemVisualParams.chevronSize}
|
|
282
225
|
/>
|
|
283
226
|
)}
|
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
import React, { ComponentProps
|
|
1
|
+
import React, { ComponentProps } from "react";
|
|
2
2
|
import { GestureResponderEvent, Pressable, View } from "react-native";
|
|
3
|
-
import Animated
|
|
4
|
-
Extrapolate,
|
|
5
|
-
interpolate,
|
|
6
|
-
interpolateColor,
|
|
7
|
-
useAnimatedStyle,
|
|
8
|
-
useDerivedValue,
|
|
9
|
-
useSharedValue,
|
|
10
|
-
withSpring
|
|
11
|
-
} from "react-native-reanimated";
|
|
3
|
+
import Animated from "react-native-reanimated";
|
|
12
4
|
import {
|
|
13
|
-
IOColors,
|
|
14
5
|
IOListItemStyles,
|
|
15
6
|
IOListItemVisualParams,
|
|
16
|
-
IOScaleValues,
|
|
17
|
-
IOSpringValues,
|
|
18
7
|
IOStyles,
|
|
19
|
-
hexToRgba,
|
|
20
8
|
useIOExperimentalDesign,
|
|
21
9
|
useIOTheme
|
|
22
10
|
} from "../../core";
|
|
11
|
+
import { useListItemAnimation } from "../../hooks";
|
|
12
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
23
13
|
import { WithTestID } from "../../utils/types";
|
|
24
14
|
import { Icon } from "../icons";
|
|
25
|
-
import {
|
|
15
|
+
import { BodySmall, H6 } from "../typography";
|
|
26
16
|
|
|
27
17
|
export type ListItemNavAlert = WithTestID<{
|
|
28
18
|
value: string | React.ReactNode;
|
|
@@ -44,31 +34,19 @@ export const ListItemNavAlert = ({
|
|
|
44
34
|
accessibilityHint,
|
|
45
35
|
testID
|
|
46
36
|
}: ListItemNavAlert) => {
|
|
47
|
-
const
|
|
37
|
+
const theme = useIOTheme();
|
|
38
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
|
|
39
|
+
useListItemAnimation();
|
|
40
|
+
const { dynamicFontScale, spacingScaleMultiplier } = useIOFontDynamicScale();
|
|
48
41
|
const { isExperimental } = useIOExperimentalDesign();
|
|
49
42
|
|
|
50
|
-
const componentValueToAccessibility =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
43
|
+
const componentValueToAccessibility = typeof value === "string" ? value : "";
|
|
44
|
+
const componentDescriptionToAccessibility =
|
|
45
|
+
typeof description === "string" ? description : "";
|
|
54
46
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const listItemAccessibilityLabel = useMemo(
|
|
61
|
-
() =>
|
|
62
|
-
accessibilityLabel
|
|
63
|
-
? accessibilityLabel
|
|
64
|
-
: `${componentValueToAccessibility}; ${componentDescriptionToAccessibility}`,
|
|
65
|
-
[
|
|
66
|
-
componentDescriptionToAccessibility,
|
|
67
|
-
componentValueToAccessibility,
|
|
68
|
-
accessibilityLabel
|
|
69
|
-
]
|
|
70
|
-
);
|
|
71
|
-
const theme = useIOTheme();
|
|
47
|
+
const listItemAccessibilityLabel =
|
|
48
|
+
accessibilityLabel ??
|
|
49
|
+
`${componentValueToAccessibility}; ${componentDescriptionToAccessibility}`;
|
|
72
50
|
|
|
73
51
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
74
52
|
const listItemNavAlertContent = (
|
|
@@ -95,58 +73,12 @@ export const ListItemNavAlert = ({
|
|
|
95
73
|
|
|
96
74
|
const iconColor = isExperimental ? theme["interactiveElem-default"] : "blue";
|
|
97
75
|
|
|
98
|
-
const mapBackgroundStates: Record<string, string> = {
|
|
99
|
-
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
100
|
-
pressed: IOColors[theme["listItem-pressed"]]
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// Scaling transformation applied when the button is pressed
|
|
104
|
-
const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
|
|
105
|
-
|
|
106
|
-
const progressPressed = useDerivedValue(() =>
|
|
107
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
// Interpolate animation values from `isPressed` values
|
|
111
|
-
const animatedScaleStyle = useAnimatedStyle(() => {
|
|
112
|
-
const scale = interpolate(
|
|
113
|
-
progressPressed.value,
|
|
114
|
-
[0, 1],
|
|
115
|
-
[1, animationScaleValue],
|
|
116
|
-
Extrapolate.CLAMP
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
transform: [{ scale }]
|
|
121
|
-
};
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
125
|
-
const backgroundColor = interpolateColor(
|
|
126
|
-
progressPressed.value,
|
|
127
|
-
[0, 1],
|
|
128
|
-
[mapBackgroundStates.default, mapBackgroundStates.pressed]
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
return {
|
|
132
|
-
backgroundColor
|
|
133
|
-
};
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
const handlePressIn = useCallback(() => {
|
|
137
|
-
// eslint-disable-next-line functional/immutable-data
|
|
138
|
-
isPressed.value = 1;
|
|
139
|
-
}, [isPressed]);
|
|
140
|
-
const handlePressOut = useCallback(() => {
|
|
141
|
-
// eslint-disable-next-line functional/immutable-data
|
|
142
|
-
isPressed.value = 0;
|
|
143
|
-
}, [isPressed]);
|
|
144
|
-
|
|
145
76
|
return (
|
|
146
77
|
<Pressable
|
|
147
78
|
onPress={onPress}
|
|
148
|
-
onPressIn={
|
|
149
|
-
onPressOut={
|
|
79
|
+
onPressIn={onPressIn}
|
|
80
|
+
onPressOut={onPressOut}
|
|
81
|
+
onTouchEnd={onPressOut}
|
|
150
82
|
accessible={true}
|
|
151
83
|
accessibilityLabel={listItemAccessibilityLabel}
|
|
152
84
|
accessibilityHint={accessibilityHint}
|
|
@@ -154,30 +86,38 @@ export const ListItemNavAlert = ({
|
|
|
154
86
|
testID={testID}
|
|
155
87
|
>
|
|
156
88
|
<Animated.View
|
|
157
|
-
style={[IOListItemStyles.listItem,
|
|
89
|
+
style={[IOListItemStyles.listItem, backgroundAnimatedStyle]}
|
|
158
90
|
importantForAccessibility="no-hide-descendants"
|
|
159
91
|
accessibilityElementsHidden
|
|
160
92
|
>
|
|
161
93
|
<Animated.View
|
|
162
|
-
style={[
|
|
94
|
+
style={[
|
|
95
|
+
IOListItemStyles.listItemInner,
|
|
96
|
+
{
|
|
97
|
+
columnGap:
|
|
98
|
+
IOListItemVisualParams.iconMargin *
|
|
99
|
+
dynamicFontScale *
|
|
100
|
+
spacingScaleMultiplier
|
|
101
|
+
},
|
|
102
|
+
scaleAnimatedStyle
|
|
103
|
+
]}
|
|
163
104
|
>
|
|
164
105
|
{!withoutIcon && (
|
|
165
|
-
<View style={{ marginRight: IOListItemVisualParams.iconMargin }}>
|
|
166
|
-
<Icon
|
|
167
|
-
name="errorFilled"
|
|
168
|
-
color={theme.errorIcon}
|
|
169
|
-
size={IOListItemVisualParams.iconSize}
|
|
170
|
-
/>
|
|
171
|
-
</View>
|
|
172
|
-
)}
|
|
173
|
-
<View style={IOStyles.flex}>{listItemNavAlertContent}</View>
|
|
174
|
-
<View style={{ marginLeft: IOListItemVisualParams.iconMargin }}>
|
|
175
106
|
<Icon
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
107
|
+
allowFontScaling
|
|
108
|
+
name="errorFilled"
|
|
109
|
+
color={theme.errorIcon}
|
|
110
|
+
size={IOListItemVisualParams.iconSize}
|
|
179
111
|
/>
|
|
180
|
-
|
|
112
|
+
)}
|
|
113
|
+
<View style={IOStyles.flex}>{listItemNavAlertContent}</View>
|
|
114
|
+
|
|
115
|
+
<Icon
|
|
116
|
+
allowFontScaling
|
|
117
|
+
name="chevronRightListItem"
|
|
118
|
+
color={iconColor}
|
|
119
|
+
size={IOListItemVisualParams.chevronSize}
|
|
120
|
+
/>
|
|
181
121
|
</Animated.View>
|
|
182
122
|
</Animated.View>
|
|
183
123
|
</Pressable>
|
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { Image, Pressable, StyleSheet, View } from "react-native";
|
|
4
4
|
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
5
|
-
import Animated
|
|
6
|
-
Extrapolate,
|
|
7
|
-
interpolate,
|
|
8
|
-
interpolateColor,
|
|
9
|
-
useAnimatedStyle,
|
|
10
|
-
useDerivedValue,
|
|
11
|
-
useSharedValue,
|
|
12
|
-
withSpring
|
|
13
|
-
} from "react-native-reanimated";
|
|
5
|
+
import Animated from "react-native-reanimated";
|
|
14
6
|
import Placeholder from "rn-placeholder";
|
|
15
7
|
import {
|
|
16
|
-
IOColors,
|
|
17
|
-
IOScaleValues,
|
|
18
8
|
IOSelectionListItemStyles,
|
|
19
9
|
IOSelectionListItemVisualParams,
|
|
20
|
-
|
|
10
|
+
IOSelectionTickVisualParams,
|
|
21
11
|
IOStyles,
|
|
22
|
-
hexToRgba,
|
|
23
12
|
useIOTheme
|
|
24
13
|
} from "../../core";
|
|
14
|
+
import { useListItemAnimation } from "../../hooks";
|
|
15
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
25
16
|
import { WithTestID } from "../../utils/types";
|
|
26
17
|
import { IOIcons, Icon } from "../icons";
|
|
27
18
|
import { IOLogoPaymentType, LogoPayment } from "../logos";
|
|
28
19
|
import { AnimatedRadio } from "../radio/AnimatedRadio";
|
|
29
20
|
import { HSpacer, VSpacer } from "../spacer";
|
|
30
|
-
import {
|
|
21
|
+
import { VStack } from "../stack";
|
|
22
|
+
import { BodySmall, H6 } from "../typography";
|
|
31
23
|
|
|
32
24
|
type ListItemRadioGraphicProps =
|
|
33
25
|
| { icon?: never; paymentLogo: IOLogoPaymentType; uri?: never }
|
|
@@ -91,58 +83,12 @@ export const ListItemRadio = ({
|
|
|
91
83
|
testID
|
|
92
84
|
}: ListItemRadioProps) => {
|
|
93
85
|
const [toggleValue, setToggleValue] = useState(selected ?? false);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const progressPressed = useDerivedValue(() =>
|
|
100
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
// Theme
|
|
86
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
87
|
+
useIOFontDynamicScale();
|
|
88
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
|
|
89
|
+
useListItemAnimation();
|
|
104
90
|
const theme = useIOTheme();
|
|
105
91
|
|
|
106
|
-
const mapBackgroundStates: Record<string, string> = {
|
|
107
|
-
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
108
|
-
pressed: IOColors[theme["listItem-pressed"]]
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// Interpolate animation values from `isPressed` values
|
|
112
|
-
const animatedScaleStyle = useAnimatedStyle(() => {
|
|
113
|
-
const scale = interpolate(
|
|
114
|
-
progressPressed.value,
|
|
115
|
-
[0, 1],
|
|
116
|
-
[1, animationScaleValue],
|
|
117
|
-
Extrapolate.CLAMP
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
return {
|
|
121
|
-
transform: [{ scale }]
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
const handlePressIn = useCallback(() => {
|
|
126
|
-
// eslint-disable-next-line functional/immutable-data
|
|
127
|
-
isPressed.value = 1;
|
|
128
|
-
}, [isPressed]);
|
|
129
|
-
const handlePressOut = useCallback(() => {
|
|
130
|
-
// eslint-disable-next-line functional/immutable-data
|
|
131
|
-
isPressed.value = 0;
|
|
132
|
-
}, [isPressed]);
|
|
133
|
-
|
|
134
|
-
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
135
|
-
const backgroundColor = interpolateColor(
|
|
136
|
-
progressPressed.value,
|
|
137
|
-
[0, 1],
|
|
138
|
-
[mapBackgroundStates.default, mapBackgroundStates.pressed]
|
|
139
|
-
);
|
|
140
|
-
|
|
141
|
-
return {
|
|
142
|
-
backgroundColor
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
|
-
|
|
146
92
|
const toggleRadioItem = () => {
|
|
147
93
|
ReactNativeHapticFeedback.trigger("impactLight");
|
|
148
94
|
setToggleValue(!toggleValue);
|
|
@@ -154,14 +100,11 @@ export const ListItemRadio = ({
|
|
|
154
100
|
const disabledStyle = { opacity: disabled ? DISABLED_OPACITY : 1 };
|
|
155
101
|
|
|
156
102
|
const SkeletonDescriptionLines = () => (
|
|
157
|
-
|
|
158
|
-
<VSpacer size={8} />
|
|
103
|
+
<VStack space={8}>
|
|
159
104
|
<Placeholder.Box animate="fade" radius={8} width={"100%"} height={8} />
|
|
160
|
-
<VSpacer size={8} />
|
|
161
105
|
<Placeholder.Box animate="fade" radius={8} width={"100%"} height={8} />
|
|
162
|
-
<VSpacer size={8} />
|
|
163
106
|
<Placeholder.Box animate="fade" radius={8} width={"100%"} height={8} />
|
|
164
|
-
|
|
107
|
+
</VStack>
|
|
165
108
|
);
|
|
166
109
|
|
|
167
110
|
const SkeletonIcon = () => (
|
|
@@ -180,7 +123,7 @@ export const ListItemRadio = ({
|
|
|
180
123
|
);
|
|
181
124
|
|
|
182
125
|
const SkeletonComponent = () => (
|
|
183
|
-
<View style={IOSelectionListItemStyles.listItem}>
|
|
126
|
+
<View style={[IOSelectionListItemStyles.listItem, { rowGap: 8 }]}>
|
|
184
127
|
<View style={IOSelectionListItemStyles.listItemInner}>
|
|
185
128
|
<View
|
|
186
129
|
style={[
|
|
@@ -200,7 +143,10 @@ export const ListItemRadio = ({
|
|
|
200
143
|
</View>
|
|
201
144
|
<HSpacer size={8} />
|
|
202
145
|
<View pointerEvents="none" style={disabledStyle}>
|
|
203
|
-
<AnimatedRadio
|
|
146
|
+
<AnimatedRadio
|
|
147
|
+
size={IOSelectionTickVisualParams.size * dynamicFontScale}
|
|
148
|
+
checked={toggleValue}
|
|
149
|
+
/>
|
|
204
150
|
</View>
|
|
205
151
|
</View>
|
|
206
152
|
</View>
|
|
@@ -220,55 +166,59 @@ export const ListItemRadio = ({
|
|
|
220
166
|
accessibilityLabel={accessibilityLabel}
|
|
221
167
|
accessibilityHint={accessibilityHint}
|
|
222
168
|
onPress={toggleRadioItem}
|
|
223
|
-
onPressIn={
|
|
224
|
-
onPressOut={
|
|
225
|
-
onTouchEnd={
|
|
169
|
+
onPressIn={onPressIn}
|
|
170
|
+
onPressOut={onPressOut}
|
|
171
|
+
onTouchEnd={onPressOut}
|
|
226
172
|
testID={testID}
|
|
227
173
|
disabled={disabled}
|
|
228
174
|
>
|
|
229
175
|
<Animated.View
|
|
230
176
|
style={[
|
|
231
177
|
IOSelectionListItemStyles.listItem,
|
|
232
|
-
|
|
178
|
+
backgroundAnimatedStyle,
|
|
233
179
|
disabledStyle
|
|
234
180
|
]}
|
|
235
181
|
// This is required to avoid opacity
|
|
236
182
|
// inheritance on Android
|
|
237
183
|
needsOffscreenAlphaCompositing={true}
|
|
238
184
|
>
|
|
239
|
-
<Animated.View style={
|
|
185
|
+
<Animated.View style={scaleAnimatedStyle}>
|
|
240
186
|
<View style={IOSelectionListItemStyles.listItemInner}>
|
|
241
|
-
<View
|
|
242
|
-
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
{
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
187
|
+
<View
|
|
188
|
+
style={{
|
|
189
|
+
flexDirection: "row",
|
|
190
|
+
flexShrink: 1,
|
|
191
|
+
columnGap:
|
|
192
|
+
IOSelectionListItemVisualParams.iconMargin *
|
|
193
|
+
dynamicFontScale *
|
|
194
|
+
spacingScaleMultiplier
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
{startImage?.icon && !hugeFontEnabled && (
|
|
198
|
+
<Icon
|
|
199
|
+
allowFontScaling
|
|
200
|
+
name={startImage.icon}
|
|
201
|
+
color="grey-300"
|
|
202
|
+
size={IOSelectionListItemVisualParams.iconSize}
|
|
203
|
+
/>
|
|
204
|
+
)}
|
|
205
|
+
{startImage?.uri && (
|
|
206
|
+
<View style={{ alignSelf: "center" }}>
|
|
207
|
+
<Image
|
|
208
|
+
accessibilityIgnoresInvertColors
|
|
209
|
+
source={startImage}
|
|
210
|
+
style={styles.imageSize}
|
|
211
|
+
/>
|
|
212
|
+
</View>
|
|
213
|
+
)}
|
|
214
|
+
{startImage?.paymentLogo && (
|
|
215
|
+
<View style={{ alignSelf: "center" }}>
|
|
216
|
+
<LogoPayment
|
|
217
|
+
name={startImage.paymentLogo}
|
|
218
|
+
size={IOSelectionListItemVisualParams.iconSize}
|
|
219
|
+
/>
|
|
269
220
|
</View>
|
|
270
221
|
)}
|
|
271
|
-
|
|
272
222
|
<H6 color={theme["textBody-default"]} style={{ flexShrink: 1 }}>
|
|
273
223
|
{value}
|
|
274
224
|
</H6>
|
|
@@ -279,7 +229,10 @@ export const ListItemRadio = ({
|
|
|
279
229
|
accessibilityElementsHidden
|
|
280
230
|
importantForAccessibility="no-hide-descendants"
|
|
281
231
|
>
|
|
282
|
-
<AnimatedRadio
|
|
232
|
+
<AnimatedRadio
|
|
233
|
+
size={IOSelectionTickVisualParams.size * dynamicFontScale}
|
|
234
|
+
checked={selected ?? toggleValue}
|
|
235
|
+
/>
|
|
283
236
|
</View>
|
|
284
237
|
</View>
|
|
285
238
|
{description && (
|