@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,23 +1,14 @@
|
|
|
1
|
-
import React, { ComponentProps,
|
|
1
|
+
import React, { ComponentProps, useMemo } 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
5
|
IOColors,
|
|
14
6
|
IOListItemStyles,
|
|
15
7
|
IOListItemVisualParams,
|
|
16
|
-
IOScaleValues,
|
|
17
|
-
IOSpringValues,
|
|
18
|
-
hexToRgba,
|
|
19
8
|
useIOTheme
|
|
20
9
|
} from "../../core";
|
|
10
|
+
import { useListItemAnimation } from "../../hooks";
|
|
11
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
21
12
|
import { WithTestID } from "../../utils/types";
|
|
22
13
|
import { AnimatedIcon, IOIcons } from "../icons";
|
|
23
14
|
import { ButtonText } from "../typography/ButtonText";
|
|
@@ -42,20 +33,18 @@ export const ListItemAction = ({
|
|
|
42
33
|
accessibilityHint,
|
|
43
34
|
testID
|
|
44
35
|
}: ListItemAction) => {
|
|
45
|
-
const
|
|
36
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
|
|
37
|
+
useListItemAnimation();
|
|
46
38
|
|
|
47
39
|
const theme = useIOTheme();
|
|
48
40
|
|
|
41
|
+
const { dynamicFontScale, spacingScaleMultiplier } = useIOFontDynamicScale();
|
|
42
|
+
|
|
49
43
|
const listItemAccessibilityLabel = useMemo(
|
|
50
44
|
() => (accessibilityLabel ? accessibilityLabel : `${label}`),
|
|
51
45
|
[label, accessibilityLabel]
|
|
52
46
|
);
|
|
53
47
|
|
|
54
|
-
const mapBackgroundStates: Record<string, string> = {
|
|
55
|
-
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
56
|
-
pressed: IOColors[theme["listItem-pressed"]]
|
|
57
|
-
};
|
|
58
|
-
|
|
59
48
|
const mapForegroundColor: Record<
|
|
60
49
|
NonNullable<ListItemAction["variant"]>,
|
|
61
50
|
IOColors
|
|
@@ -64,54 +53,12 @@ export const ListItemAction = ({
|
|
|
64
53
|
danger: theme.errorText
|
|
65
54
|
};
|
|
66
55
|
|
|
67
|
-
// Scaling transformation applied when the button is pressed
|
|
68
|
-
const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
|
|
69
|
-
|
|
70
|
-
const progressPressed = useDerivedValue(() =>
|
|
71
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
// Interpolate animation values from `isPressed` values
|
|
75
|
-
const animatedScaleStyle = useAnimatedStyle(() => {
|
|
76
|
-
const scale = interpolate(
|
|
77
|
-
progressPressed.value,
|
|
78
|
-
[0, 1],
|
|
79
|
-
[1, animationScaleValue],
|
|
80
|
-
Extrapolate.CLAMP
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
transform: [{ scale }]
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
89
|
-
const backgroundColor = interpolateColor(
|
|
90
|
-
progressPressed.value,
|
|
91
|
-
[0, 1],
|
|
92
|
-
[mapBackgroundStates.default, mapBackgroundStates.pressed]
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
backgroundColor
|
|
97
|
-
};
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
const handlePressIn = useCallback(() => {
|
|
101
|
-
// eslint-disable-next-line functional/immutable-data
|
|
102
|
-
isPressed.value = 1;
|
|
103
|
-
}, [isPressed]);
|
|
104
|
-
const handlePressOut = useCallback(() => {
|
|
105
|
-
// eslint-disable-next-line functional/immutable-data
|
|
106
|
-
isPressed.value = 0;
|
|
107
|
-
}, [isPressed]);
|
|
108
|
-
|
|
109
56
|
return (
|
|
110
57
|
<Pressable
|
|
111
58
|
onPress={onPress}
|
|
112
|
-
onPressIn={
|
|
113
|
-
onPressOut={
|
|
114
|
-
onTouchEnd={
|
|
59
|
+
onPressIn={onPressIn}
|
|
60
|
+
onPressOut={onPressOut}
|
|
61
|
+
onTouchEnd={onPressOut}
|
|
115
62
|
accessible={true}
|
|
116
63
|
accessibilityLabel={listItemAccessibilityLabel}
|
|
117
64
|
accessibilityHint={accessibilityHint}
|
|
@@ -119,21 +66,29 @@ export const ListItemAction = ({
|
|
|
119
66
|
testID={testID}
|
|
120
67
|
>
|
|
121
68
|
<Animated.View
|
|
122
|
-
style={[IOListItemStyles.listItem,
|
|
69
|
+
style={[IOListItemStyles.listItem, backgroundAnimatedStyle]}
|
|
123
70
|
importantForAccessibility="no-hide-descendants"
|
|
124
71
|
accessibilityElementsHidden
|
|
125
72
|
>
|
|
126
73
|
<Animated.View
|
|
127
|
-
style={[
|
|
74
|
+
style={[
|
|
75
|
+
IOListItemStyles.listItemInner,
|
|
76
|
+
{
|
|
77
|
+
columnGap:
|
|
78
|
+
IOListItemVisualParams.iconMargin *
|
|
79
|
+
dynamicFontScale *
|
|
80
|
+
spacingScaleMultiplier
|
|
81
|
+
},
|
|
82
|
+
scaleAnimatedStyle
|
|
83
|
+
]}
|
|
128
84
|
>
|
|
129
85
|
{icon && (
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</View>
|
|
86
|
+
<AnimatedIcon
|
|
87
|
+
allowFontScaling
|
|
88
|
+
name={icon}
|
|
89
|
+
color={IOColors[mapForegroundColor[variant]]}
|
|
90
|
+
size={IOListItemVisualParams.iconSize}
|
|
91
|
+
/>
|
|
137
92
|
)}
|
|
138
93
|
<View style={{ flexGrow: 1, flexShrink: 1 }}>
|
|
139
94
|
<ButtonText color={mapForegroundColor[variant]}>{label}</ButtonText>
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
IOStyles,
|
|
8
8
|
useIOTheme
|
|
9
9
|
} from "../../core";
|
|
10
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
10
11
|
import { WithTestID } from "../../utils/types";
|
|
11
12
|
import { IOIcons, Icon } from "../icons";
|
|
12
|
-
import { HSpacer } from "../spacer";
|
|
13
13
|
import { H3, H6 } from "../typography";
|
|
14
14
|
|
|
15
15
|
type ValueProps = ComponentProps<typeof H3>;
|
|
@@ -42,6 +42,8 @@ export const ListItemAmount = ({
|
|
|
42
42
|
testID
|
|
43
43
|
}: ListItemAmount) => {
|
|
44
44
|
const theme = useIOTheme();
|
|
45
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
46
|
+
useIOFontDynamicScale();
|
|
45
47
|
|
|
46
48
|
const listItemAccessibilityLabel = useMemo(
|
|
47
49
|
() => (accessibilityLabel ? accessibilityLabel : `${label}`),
|
|
@@ -65,18 +67,21 @@ export const ListItemAmount = ({
|
|
|
65
67
|
accessible
|
|
66
68
|
accessibilityLabel={listItemAccessibilityLabel}
|
|
67
69
|
>
|
|
68
|
-
<View
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
<View
|
|
71
|
+
style={[
|
|
72
|
+
IOListItemStyles.listItemInner,
|
|
73
|
+
{ columnGap: iconMargin * dynamicFontScale * spacingScaleMultiplier }
|
|
74
|
+
]}
|
|
75
|
+
>
|
|
76
|
+
{iconName && !hugeFontEnabled && (
|
|
77
|
+
<Icon
|
|
78
|
+
allowFontScaling
|
|
79
|
+
name={iconName}
|
|
80
|
+
color={iconColor ?? theme["icon-decorative"]}
|
|
81
|
+
size={IOListItemVisualParams.iconSize}
|
|
82
|
+
/>
|
|
77
83
|
)}
|
|
78
84
|
<View style={IOStyles.flex}>{itemInfoTextComponent}</View>
|
|
79
|
-
<HSpacer size={4} />
|
|
80
85
|
<H3
|
|
81
86
|
{...valueElementProps}
|
|
82
87
|
color={theme["textBody-default"]}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { Pressable, 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 {
|
|
15
|
-
IOColors,
|
|
16
|
-
IOScaleValues,
|
|
17
7
|
IOSelectionListItemStyles,
|
|
18
8
|
IOSelectionListItemVisualParams,
|
|
19
|
-
|
|
9
|
+
IOSelectionTickVisualParams,
|
|
20
10
|
IOStyles,
|
|
21
|
-
hexToRgba,
|
|
22
11
|
useIOTheme
|
|
23
12
|
} from "../../core";
|
|
13
|
+
import { useListItemAnimation } from "../../hooks";
|
|
14
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
24
15
|
import { AnimatedCheckbox } from "../checkbox/AnimatedCheckbox";
|
|
25
16
|
import { IOIcons, Icon } from "../icons";
|
|
26
17
|
import { HSpacer, VSpacer } from "../spacer";
|
|
27
|
-
import {
|
|
18
|
+
import { BodySmall, H6 } from "../typography";
|
|
28
19
|
|
|
29
20
|
type Props = {
|
|
30
21
|
value: string;
|
|
@@ -59,16 +50,12 @@ export const ListItemCheckbox = ({
|
|
|
59
50
|
disabled,
|
|
60
51
|
onValueChange
|
|
61
52
|
}: ListItemCheckboxProps) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const isPressed: Animated.SharedValue<number> = useSharedValue(0);
|
|
65
|
-
|
|
66
|
-
// Scaling transformation applied when the button is pressed
|
|
67
|
-
const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
|
|
53
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
54
|
+
useIOFontDynamicScale();
|
|
68
55
|
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
56
|
+
const [toggleValue, setToggleValue] = useState(selected ?? false);
|
|
57
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
|
|
58
|
+
useListItemAnimation();
|
|
72
59
|
|
|
73
60
|
// Theme
|
|
74
61
|
const theme = useIOTheme();
|
|
@@ -79,46 +66,6 @@ export const ListItemCheckbox = ({
|
|
|
79
66
|
? `${value}, ${description}`
|
|
80
67
|
: value;
|
|
81
68
|
|
|
82
|
-
const mapBackgroundStates: Record<string, string> = {
|
|
83
|
-
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
84
|
-
pressed: IOColors[theme["listItem-pressed"]]
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
// Interpolate animation values from `isPressed` values
|
|
88
|
-
const animatedScaleStyle = useAnimatedStyle(() => {
|
|
89
|
-
const scale = interpolate(
|
|
90
|
-
progressPressed.value,
|
|
91
|
-
[0, 1],
|
|
92
|
-
[1, animationScaleValue],
|
|
93
|
-
Extrapolate.CLAMP
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
return {
|
|
97
|
-
transform: [{ scale }]
|
|
98
|
-
};
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const handlePressIn = useCallback(() => {
|
|
102
|
-
// eslint-disable-next-line functional/immutable-data
|
|
103
|
-
isPressed.value = 1;
|
|
104
|
-
}, [isPressed]);
|
|
105
|
-
const handlePressOut = useCallback(() => {
|
|
106
|
-
// eslint-disable-next-line functional/immutable-data
|
|
107
|
-
isPressed.value = 0;
|
|
108
|
-
}, [isPressed]);
|
|
109
|
-
|
|
110
|
-
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
111
|
-
const backgroundColor = interpolateColor(
|
|
112
|
-
progressPressed.value,
|
|
113
|
-
[0, 1],
|
|
114
|
-
[mapBackgroundStates.default, mapBackgroundStates.pressed]
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
return {
|
|
118
|
-
backgroundColor
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
|
|
122
69
|
const toggleCheckbox = () => {
|
|
123
70
|
ReactNativeHapticFeedback.trigger("impactLight");
|
|
124
71
|
setToggleValue(!toggleValue);
|
|
@@ -130,9 +77,9 @@ export const ListItemCheckbox = ({
|
|
|
130
77
|
return (
|
|
131
78
|
<Pressable
|
|
132
79
|
onPress={toggleCheckbox}
|
|
133
|
-
onPressIn={
|
|
134
|
-
onPressOut={
|
|
135
|
-
onTouchEnd={
|
|
80
|
+
onPressIn={onPressIn}
|
|
81
|
+
onPressOut={onPressOut}
|
|
82
|
+
onTouchEnd={onPressOut}
|
|
136
83
|
testID="ListItemCheckbox"
|
|
137
84
|
accessible={true}
|
|
138
85
|
accessibilityLabel={accessibilityLabel || fallbackAccessibilityLabel}
|
|
@@ -147,28 +94,34 @@ export const ListItemCheckbox = ({
|
|
|
147
94
|
<Animated.View
|
|
148
95
|
style={[
|
|
149
96
|
IOSelectionListItemStyles.listItem,
|
|
150
|
-
|
|
97
|
+
backgroundAnimatedStyle,
|
|
151
98
|
{ opacity: disabled ? DISABLED_OPACITY : 1 }
|
|
152
99
|
]}
|
|
153
100
|
// This is required to avoid opacity
|
|
154
101
|
// inheritance on Android
|
|
155
102
|
needsOffscreenAlphaCompositing={true}
|
|
156
103
|
>
|
|
157
|
-
<Animated.View style={
|
|
104
|
+
<Animated.View style={scaleAnimatedStyle}>
|
|
158
105
|
<View style={IOSelectionListItemStyles.listItemInner}>
|
|
159
|
-
<View
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
106
|
+
<View
|
|
107
|
+
style={[
|
|
108
|
+
IOStyles.row,
|
|
109
|
+
{
|
|
110
|
+
flexShrink: 1,
|
|
111
|
+
columnGap:
|
|
112
|
+
IOSelectionListItemVisualParams.iconMargin *
|
|
113
|
+
dynamicFontScale *
|
|
114
|
+
spacingScaleMultiplier
|
|
115
|
+
}
|
|
116
|
+
]}
|
|
117
|
+
>
|
|
118
|
+
{icon && !hugeFontEnabled && (
|
|
119
|
+
<Icon
|
|
120
|
+
allowFontScaling
|
|
121
|
+
name={icon}
|
|
122
|
+
color="grey-300"
|
|
123
|
+
size={IOSelectionListItemVisualParams.iconSize}
|
|
124
|
+
/>
|
|
172
125
|
)}
|
|
173
126
|
<H6 color={theme["textBody-default"]} style={{ flexShrink: 1 }}>
|
|
174
127
|
{value}
|
|
@@ -180,7 +133,10 @@ export const ListItemCheckbox = ({
|
|
|
180
133
|
accessibilityElementsHidden
|
|
181
134
|
importantForAccessibility="no-hide-descendants"
|
|
182
135
|
>
|
|
183
|
-
<AnimatedCheckbox
|
|
136
|
+
<AnimatedCheckbox
|
|
137
|
+
size={IOSelectionTickVisualParams.size * dynamicFontScale}
|
|
138
|
+
checked={selected ?? toggleValue}
|
|
139
|
+
/>
|
|
184
140
|
</View>
|
|
185
141
|
</View>
|
|
186
142
|
{description && (
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
IOStyles,
|
|
8
8
|
useIOTheme
|
|
9
9
|
} from "../../core";
|
|
10
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
10
11
|
import { WithTestID } from "../../utils/types";
|
|
11
12
|
import { Badge } from "../badge";
|
|
12
13
|
import { ButtonLink, IconButton } from "../buttons";
|
|
@@ -61,6 +62,9 @@ export const ListItemHeader = ({
|
|
|
61
62
|
}: ListItemHeader) => {
|
|
62
63
|
const theme = useIOTheme();
|
|
63
64
|
|
|
65
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
66
|
+
useIOFontDynamicScale();
|
|
67
|
+
|
|
64
68
|
const listItemAccessibilityLabel = useMemo(
|
|
65
69
|
() => (accessibilityLabel ? accessibilityLabel : `${label}`),
|
|
66
70
|
[label, accessibilityLabel]
|
|
@@ -87,7 +91,7 @@ export const ListItemHeader = ({
|
|
|
87
91
|
[label, theme, endElement]
|
|
88
92
|
);
|
|
89
93
|
|
|
90
|
-
const
|
|
94
|
+
const listItemAction = useCallback(() => {
|
|
91
95
|
if (endElement) {
|
|
92
96
|
const { type, componentProps } = endElement;
|
|
93
97
|
|
|
@@ -129,9 +133,15 @@ export const ListItemHeader = ({
|
|
|
129
133
|
style={IOListItemStyles.listItemInner}
|
|
130
134
|
importantForAccessibility={endElement ? "auto" : "no-hide-descendants"}
|
|
131
135
|
>
|
|
132
|
-
{iconName && (
|
|
133
|
-
<View
|
|
136
|
+
{iconName && !hugeFontEnabled && (
|
|
137
|
+
<View
|
|
138
|
+
style={{
|
|
139
|
+
marginRight:
|
|
140
|
+
iconMargin * dynamicFontScale * spacingScaleMultiplier
|
|
141
|
+
}}
|
|
142
|
+
>
|
|
134
143
|
<Icon
|
|
144
|
+
allowFontScaling
|
|
135
145
|
name={iconName}
|
|
136
146
|
color={iconColor ?? theme["icon-decorative"]}
|
|
137
147
|
size={IOListItemVisualParams.iconSize}
|
|
@@ -141,7 +151,7 @@ export const ListItemHeader = ({
|
|
|
141
151
|
<View style={IOStyles.flex}>{itemInfoTextComponent}</View>
|
|
142
152
|
{endElement && (
|
|
143
153
|
<View style={{ marginLeft: IOListItemVisualParams.actionMargin }}>
|
|
144
|
-
{
|
|
154
|
+
{listItemAction()}
|
|
145
155
|
</View>
|
|
146
156
|
)}
|
|
147
157
|
</View>
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
IOStyles,
|
|
7
7
|
useIOTheme
|
|
8
8
|
} from "../../core";
|
|
9
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
9
10
|
import { WithTestID } from "../../utils/types";
|
|
10
11
|
import { Badge } from "../badge";
|
|
11
12
|
import { ButtonLink, IconButton } from "../buttons";
|
|
@@ -68,6 +69,9 @@ export const ListItemInfo = ({
|
|
|
68
69
|
testID
|
|
69
70
|
}: ListItemInfo) => {
|
|
70
71
|
const theme = useIOTheme();
|
|
72
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
73
|
+
useIOFontDynamicScale();
|
|
74
|
+
|
|
71
75
|
const componentValueToAccessibility = useMemo(
|
|
72
76
|
() => (typeof value === "string" ? value : ""),
|
|
73
77
|
[value]
|
|
@@ -140,30 +144,33 @@ export const ListItemInfo = ({
|
|
|
140
144
|
accessibilityLabel={listItemAccessibilityLabel}
|
|
141
145
|
accessibilityRole={accessibilityRole}
|
|
142
146
|
>
|
|
143
|
-
<View
|
|
144
|
-
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
<View
|
|
148
|
+
style={[
|
|
149
|
+
IOListItemStyles.listItemInner,
|
|
150
|
+
{
|
|
151
|
+
columnGap:
|
|
152
|
+
IOListItemVisualParams.iconMargin *
|
|
153
|
+
dynamicFontScale *
|
|
154
|
+
spacingScaleMultiplier
|
|
155
|
+
}
|
|
156
|
+
]}
|
|
157
|
+
>
|
|
158
|
+
{icon && !hugeFontEnabled && (
|
|
159
|
+
<Icon
|
|
160
|
+
allowFontScaling
|
|
161
|
+
name={icon}
|
|
162
|
+
color="grey-450"
|
|
163
|
+
size={IOListItemVisualParams.iconSize}
|
|
164
|
+
/>
|
|
152
165
|
)}
|
|
153
166
|
{paymentLogoIcon && (
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
/>
|
|
159
|
-
</View>
|
|
167
|
+
<LogoPaymentWithFallback
|
|
168
|
+
brand={paymentLogoIcon}
|
|
169
|
+
size={PAYMENT_LOGO_SIZE}
|
|
170
|
+
/>
|
|
160
171
|
)}
|
|
161
172
|
<View style={IOStyles.flex}>{itemInfoTextComponent}</View>
|
|
162
|
-
{endElement && (
|
|
163
|
-
<View style={{ marginLeft: IOListItemVisualParams.actionMargin }}>
|
|
164
|
-
{listItemInfoAction()}
|
|
165
|
-
</View>
|
|
166
|
-
)}
|
|
173
|
+
{endElement && <View>{listItemInfoAction()}</View>}
|
|
167
174
|
</View>
|
|
168
175
|
</View>
|
|
169
176
|
);
|
|
@@ -1,25 +1,14 @@
|
|
|
1
|
-
import React, { ComponentProps,
|
|
1
|
+
import React, { ComponentProps, useMemo } 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
|
-
useIOExperimentalDesign,
|
|
21
8
|
useIOTheme
|
|
22
9
|
} from "../../core";
|
|
10
|
+
import { useListItemAnimation } from "../../hooks";
|
|
11
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
23
12
|
import { WithTestID } from "../../utils/types";
|
|
24
13
|
import { IOIcons, Icon } from "../icons";
|
|
25
14
|
import { BodySmall, H6 } from "../typography";
|
|
@@ -46,9 +35,12 @@ export const ListItemInfoCopy = ({
|
|
|
46
35
|
accessibilityHint,
|
|
47
36
|
testID
|
|
48
37
|
}: ListItemInfoCopy) => {
|
|
49
|
-
const isPressed = useSharedValue(0);
|
|
50
|
-
const { isExperimental } = useIOExperimentalDesign();
|
|
51
38
|
const theme = useIOTheme();
|
|
39
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
|
|
40
|
+
useListItemAnimation();
|
|
41
|
+
|
|
42
|
+
const { dynamicFontScale, spacingScaleMultiplier, hugeFontEnabled } =
|
|
43
|
+
useIOFontDynamicScale();
|
|
52
44
|
|
|
53
45
|
const componentValueToAccessibility = useMemo(
|
|
54
46
|
() => (typeof value === "string" ? value : ""),
|
|
@@ -63,9 +55,7 @@ export const ListItemInfoCopy = ({
|
|
|
63
55
|
[label, componentValueToAccessibility, accessibilityLabel]
|
|
64
56
|
);
|
|
65
57
|
|
|
66
|
-
const foregroundColor =
|
|
67
|
-
? theme["interactiveElem-default"]
|
|
68
|
-
: "blue";
|
|
58
|
+
const foregroundColor = theme["interactiveElem-default"];
|
|
69
59
|
|
|
70
60
|
const listItemInfoCopyContent = (
|
|
71
61
|
<>
|
|
@@ -83,58 +73,12 @@ export const ListItemInfoCopy = ({
|
|
|
83
73
|
</>
|
|
84
74
|
);
|
|
85
75
|
|
|
86
|
-
const mapBackgroundStates: Record<string, string> = {
|
|
87
|
-
default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
|
|
88
|
-
pressed: IOColors[theme["listItem-pressed"]]
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// Scaling transformation applied when the button is pressed
|
|
92
|
-
const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
|
|
93
|
-
|
|
94
|
-
const progressPressed = useDerivedValue(() =>
|
|
95
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
// Interpolate animation values from `isPressed` values
|
|
99
|
-
const animatedScaleStyle = useAnimatedStyle(() => {
|
|
100
|
-
const scale = interpolate(
|
|
101
|
-
progressPressed.value,
|
|
102
|
-
[0, 1],
|
|
103
|
-
[1, animationScaleValue],
|
|
104
|
-
Extrapolate.CLAMP
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
transform: [{ scale }]
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
113
|
-
const backgroundColor = interpolateColor(
|
|
114
|
-
progressPressed.value,
|
|
115
|
-
[0, 1],
|
|
116
|
-
[mapBackgroundStates.default, mapBackgroundStates.pressed]
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
return {
|
|
120
|
-
backgroundColor
|
|
121
|
-
};
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
const handlePressIn = useCallback(() => {
|
|
125
|
-
// eslint-disable-next-line functional/immutable-data
|
|
126
|
-
isPressed.value = 1;
|
|
127
|
-
}, [isPressed]);
|
|
128
|
-
const handlePressOut = useCallback(() => {
|
|
129
|
-
// eslint-disable-next-line functional/immutable-data
|
|
130
|
-
isPressed.value = 0;
|
|
131
|
-
}, [isPressed]);
|
|
132
|
-
|
|
133
76
|
return (
|
|
134
77
|
<Pressable
|
|
135
78
|
onPress={onPress}
|
|
136
|
-
onPressIn={
|
|
137
|
-
onPressOut={
|
|
79
|
+
onPressIn={onPressIn}
|
|
80
|
+
onPressOut={onPressOut}
|
|
81
|
+
onTouchEnd={onPressOut}
|
|
138
82
|
accessible={true}
|
|
139
83
|
accessibilityLabel={listItemAccessibilityLabel}
|
|
140
84
|
accessibilityHint={accessibilityHint}
|
|
@@ -144,28 +88,35 @@ export const ListItemInfoCopy = ({
|
|
|
144
88
|
<Animated.View
|
|
145
89
|
importantForAccessibility="no-hide-descendants"
|
|
146
90
|
accessibilityElementsHidden
|
|
147
|
-
style={[IOListItemStyles.listItem,
|
|
91
|
+
style={[IOListItemStyles.listItem, backgroundAnimatedStyle]}
|
|
148
92
|
>
|
|
149
93
|
<Animated.View
|
|
150
|
-
style={[
|
|
94
|
+
style={[
|
|
95
|
+
IOListItemStyles.listItemInner,
|
|
96
|
+
{
|
|
97
|
+
columnGap:
|
|
98
|
+
IOListItemVisualParams.iconMargin *
|
|
99
|
+
dynamicFontScale *
|
|
100
|
+
spacingScaleMultiplier
|
|
101
|
+
},
|
|
102
|
+
scaleAnimatedStyle
|
|
103
|
+
]}
|
|
151
104
|
>
|
|
152
|
-
{icon && (
|
|
153
|
-
<View style={{ marginRight: IOListItemVisualParams.iconMargin }}>
|
|
154
|
-
<Icon
|
|
155
|
-
name={icon}
|
|
156
|
-
color="grey-450"
|
|
157
|
-
size={IOListItemVisualParams.iconSize}
|
|
158
|
-
/>
|
|
159
|
-
</View>
|
|
160
|
-
)}
|
|
161
|
-
<View style={IOStyles.flex}>{listItemInfoCopyContent}</View>
|
|
162
|
-
<View style={{ marginLeft: IOListItemVisualParams.iconMargin }}>
|
|
105
|
+
{icon && !hugeFontEnabled && (
|
|
163
106
|
<Icon
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
107
|
+
allowFontScaling
|
|
108
|
+
name={icon}
|
|
109
|
+
color="grey-450"
|
|
110
|
+
size={IOListItemVisualParams.iconSize}
|
|
167
111
|
/>
|
|
168
|
-
|
|
112
|
+
)}
|
|
113
|
+
<View style={IOStyles.flex}>{listItemInfoCopyContent}</View>
|
|
114
|
+
<Icon
|
|
115
|
+
allowFontScaling
|
|
116
|
+
name="copy"
|
|
117
|
+
color={foregroundColor}
|
|
118
|
+
size={IOListItemVisualParams.chevronSize}
|
|
119
|
+
/>
|
|
169
120
|
</Animated.View>
|
|
170
121
|
</Animated.View>
|
|
171
122
|
</Pressable>
|