@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,53 +1,28 @@
|
|
|
1
|
-
import React, { useCallback, useState } from "react";
|
|
1
|
+
import React, { forwardRef, useCallback, useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
ColorValue,
|
|
4
4
|
GestureResponderEvent,
|
|
5
5
|
NativeSyntheticEvent,
|
|
6
|
-
PixelRatio,
|
|
7
6
|
Pressable,
|
|
8
|
-
StyleSheet,
|
|
9
7
|
TextLayoutEventData,
|
|
10
8
|
View
|
|
11
9
|
} from "react-native";
|
|
12
|
-
import Animated
|
|
13
|
-
Extrapolation,
|
|
14
|
-
SharedValue,
|
|
15
|
-
interpolate,
|
|
16
|
-
useAnimatedStyle,
|
|
17
|
-
useDerivedValue,
|
|
18
|
-
useSharedValue,
|
|
19
|
-
withSpring
|
|
20
|
-
} from "react-native-reanimated";
|
|
10
|
+
import Animated from "react-native-reanimated";
|
|
21
11
|
import { IOVisualCostants, useIOThemeContext } from "../../core";
|
|
22
|
-
import { IOScaleValues, IOSpringValues } from "../../core/IOAnimations";
|
|
23
12
|
import { IOColors, hexToRgba } from "../../core/IOColors";
|
|
24
13
|
import { IOAlertRadius } from "../../core/IOShapes";
|
|
25
|
-
import { IOAlertSpacing } from "../../core/IOSpacing";
|
|
14
|
+
import { IOAlertSpacing, IOSpacer } from "../../core/IOSpacing";
|
|
15
|
+
import { useScaleAnimation } from "../../hooks";
|
|
16
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
26
17
|
import { WithTestID } from "../../utils/types";
|
|
27
18
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
28
|
-
import {
|
|
19
|
+
import { HStack, VStack } from "../stack";
|
|
29
20
|
import { Body, ButtonText } from "../typography";
|
|
30
21
|
import { H4 } from "../typography/H4";
|
|
31
22
|
|
|
32
|
-
const
|
|
23
|
+
const ICON_SIZE: IOIconSizeScale = 24;
|
|
33
24
|
|
|
34
|
-
const [
|
|
35
|
-
|
|
36
|
-
const styles = StyleSheet.create({
|
|
37
|
-
container: {
|
|
38
|
-
flexDirection: "row",
|
|
39
|
-
alignItems: "flex-start",
|
|
40
|
-
alignContent: "center"
|
|
41
|
-
},
|
|
42
|
-
spacingDefault: {
|
|
43
|
-
padding: spacingDefault,
|
|
44
|
-
borderRadius: IOAlertRadius,
|
|
45
|
-
borderCurve: "continuous"
|
|
46
|
-
},
|
|
47
|
-
spacingFullWidth: {
|
|
48
|
-
padding: spacingFullWidth
|
|
49
|
-
}
|
|
50
|
-
});
|
|
25
|
+
const [padding, paddingFullWidth] = IOAlertSpacing;
|
|
51
26
|
|
|
52
27
|
type AlertProps = WithTestID<{
|
|
53
28
|
variant: "error" | "warning" | "info" | "success";
|
|
@@ -132,7 +107,7 @@ const mapVariantStatesDarkMode: Record<
|
|
|
132
107
|
}
|
|
133
108
|
};
|
|
134
109
|
|
|
135
|
-
export const Alert =
|
|
110
|
+
export const Alert = forwardRef<View, AlertType>(
|
|
136
111
|
(
|
|
137
112
|
{
|
|
138
113
|
variant,
|
|
@@ -146,8 +121,11 @@ export const Alert = React.forwardRef<View, AlertType>(
|
|
|
146
121
|
}: AlertType,
|
|
147
122
|
viewRef
|
|
148
123
|
): JSX.Element => {
|
|
124
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle } =
|
|
125
|
+
useScaleAnimation("medium");
|
|
126
|
+
const { dynamicFontScale, spacingScaleMultiplier } =
|
|
127
|
+
useIOFontDynamicScale();
|
|
149
128
|
const { themeType } = useIOThemeContext();
|
|
150
|
-
const isPressed: SharedValue<number> = useSharedValue(0);
|
|
151
129
|
|
|
152
130
|
const [isMultiline, setIsMultiline] = useState(false);
|
|
153
131
|
|
|
@@ -158,37 +136,11 @@ export const Alert = React.forwardRef<View, AlertType>(
|
|
|
158
136
|
[]
|
|
159
137
|
);
|
|
160
138
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
// Interpolate animation values from `isPressed` values
|
|
170
|
-
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
171
|
-
// Scale down button slightly when pressed
|
|
172
|
-
const scale = interpolate(
|
|
173
|
-
progressPressed.value,
|
|
174
|
-
[0, 1],
|
|
175
|
-
[1, animationScaleValue],
|
|
176
|
-
Extrapolation.CLAMP
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
return {
|
|
180
|
-
transform: [{ scale }]
|
|
181
|
-
};
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
const onPressIn = useCallback(() => {
|
|
185
|
-
// eslint-disable-next-line functional/immutable-data
|
|
186
|
-
isPressed.value = 1;
|
|
187
|
-
}, [isPressed]);
|
|
188
|
-
const onPressOut = useCallback(() => {
|
|
189
|
-
// eslint-disable-next-line functional/immutable-data
|
|
190
|
-
isPressed.value = 0;
|
|
191
|
-
}, [isPressed]);
|
|
139
|
+
const paddingDefaultVariant = {
|
|
140
|
+
padding,
|
|
141
|
+
borderRadius: IOAlertRadius * dynamicFontScale * spacingScaleMultiplier,
|
|
142
|
+
borderCurve: "continuous"
|
|
143
|
+
};
|
|
192
144
|
|
|
193
145
|
const mapVariantStates =
|
|
194
146
|
themeType === "light"
|
|
@@ -196,48 +148,41 @@ export const Alert = React.forwardRef<View, AlertType>(
|
|
|
196
148
|
: mapVariantStatesDarkMode;
|
|
197
149
|
|
|
198
150
|
const renderMainBlock = () => (
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
/>
|
|
211
|
-
</View>
|
|
151
|
+
<HStack
|
|
152
|
+
space={IOVisualCostants.iconMargin as IOSpacer}
|
|
153
|
+
allowScaleSpacing
|
|
154
|
+
style={{ alignItems: isMultiline ? "flex-start" : "center" }}
|
|
155
|
+
>
|
|
156
|
+
<Icon
|
|
157
|
+
allowFontScaling
|
|
158
|
+
name={mapVariantStates[variant].icon}
|
|
159
|
+
size={ICON_SIZE}
|
|
160
|
+
color={mapVariantStates[variant].foreground}
|
|
161
|
+
/>
|
|
212
162
|
{/* Sadly we don't have specific alignments style for text
|
|
213
163
|
in React Native, like `text-box-trim` for CSS. So we
|
|
214
164
|
have to put these magic numbers after manual adjustments.
|
|
215
165
|
Tested on both Android and iOS. */}
|
|
216
166
|
<View
|
|
217
167
|
style={[
|
|
218
|
-
!title &&
|
|
219
|
-
|
|
220
|
-
isMultiline && { marginBottom: -3 * PixelRatio.getFontScale() },
|
|
168
|
+
!title && isMultiline && { marginTop: -6 * dynamicFontScale },
|
|
169
|
+
isMultiline && { marginBottom: -4 * dynamicFontScale },
|
|
221
170
|
{ flex: 1 }
|
|
222
171
|
]}
|
|
223
172
|
>
|
|
224
|
-
{
|
|
225
|
-
|
|
173
|
+
<VStack space={8} allowScaleSpacing>
|
|
174
|
+
{title && (
|
|
226
175
|
<H4 color={mapVariantStates[variant].foreground}>{title}</H4>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
{
|
|
237
|
-
</Body>
|
|
238
|
-
{action && (
|
|
239
|
-
<>
|
|
240
|
-
<VSpacer size={8} />
|
|
176
|
+
)}
|
|
177
|
+
<Body
|
|
178
|
+
color={mapVariantStates[variant].foreground}
|
|
179
|
+
weight={"Regular"}
|
|
180
|
+
accessibilityRole="text"
|
|
181
|
+
onTextLayout={onTextLayout}
|
|
182
|
+
>
|
|
183
|
+
{content}
|
|
184
|
+
</Body>
|
|
185
|
+
{action && (
|
|
241
186
|
<ButtonText
|
|
242
187
|
color={mapVariantStates[variant].foreground}
|
|
243
188
|
numberOfLines={1}
|
|
@@ -245,18 +190,17 @@ export const Alert = React.forwardRef<View, AlertType>(
|
|
|
245
190
|
>
|
|
246
191
|
{action}
|
|
247
192
|
</ButtonText>
|
|
248
|
-
|
|
249
|
-
|
|
193
|
+
)}
|
|
194
|
+
</VStack>
|
|
250
195
|
</View>
|
|
251
|
-
|
|
196
|
+
</HStack>
|
|
252
197
|
);
|
|
253
198
|
|
|
254
199
|
const StaticComponent = () => (
|
|
255
200
|
<View
|
|
256
201
|
ref={viewRef}
|
|
257
202
|
style={[
|
|
258
|
-
|
|
259
|
-
fullWidth ? styles.spacingFullWidth : styles.spacingDefault,
|
|
203
|
+
fullWidth ? { padding } : paddingDefaultVariant,
|
|
260
204
|
{ backgroundColor: mapVariantStates[variant].background }
|
|
261
205
|
]}
|
|
262
206
|
testID={testID}
|
|
@@ -283,11 +227,10 @@ export const Alert = React.forwardRef<View, AlertType>(
|
|
|
283
227
|
>
|
|
284
228
|
<Animated.View
|
|
285
229
|
style={[
|
|
286
|
-
|
|
287
|
-
fullWidth ? styles.spacingFullWidth : styles.spacingDefault,
|
|
230
|
+
fullWidth ? { padding: paddingFullWidth } : paddingDefaultVariant,
|
|
288
231
|
{ backgroundColor: mapVariantStates[variant].background },
|
|
289
232
|
// Disable pressed animation when component is full width
|
|
290
|
-
!fullWidth &&
|
|
233
|
+
!fullWidth && scaleAnimatedStyle
|
|
291
234
|
]}
|
|
292
235
|
>
|
|
293
236
|
{renderMainBlock()}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
2
|
import {
|
|
3
3
|
GestureResponderEvent,
|
|
4
4
|
Pressable,
|
|
@@ -6,18 +6,9 @@ import {
|
|
|
6
6
|
Text,
|
|
7
7
|
View
|
|
8
8
|
} from "react-native";
|
|
9
|
-
import Animated
|
|
10
|
-
Extrapolate,
|
|
11
|
-
interpolate,
|
|
12
|
-
useAnimatedStyle,
|
|
13
|
-
useDerivedValue,
|
|
14
|
-
useSharedValue,
|
|
15
|
-
withSpring
|
|
16
|
-
} from "react-native-reanimated";
|
|
9
|
+
import Animated from "react-native-reanimated";
|
|
17
10
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
18
11
|
import {
|
|
19
|
-
IOScaleValues,
|
|
20
|
-
IOSpringValues,
|
|
21
12
|
IOVisualCostants,
|
|
22
13
|
enterTransitionAlertEdgeToEdge,
|
|
23
14
|
enterTransitionAlertEdgeToEdgeContent,
|
|
@@ -30,6 +21,7 @@ import {
|
|
|
30
21
|
} from "../../core/IOColors";
|
|
31
22
|
import { IOAlertSpacing } from "../../core/IOSpacing";
|
|
32
23
|
import { IOStyles } from "../../core/IOStyles";
|
|
24
|
+
import { useScaleAnimation } from "../../hooks";
|
|
33
25
|
import { makeFontStyleObject } from "../../utils/fonts";
|
|
34
26
|
import { WithTestID } from "../../utils/types";
|
|
35
27
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
@@ -105,42 +97,10 @@ export const AlertEdgeToEdge = ({
|
|
|
105
97
|
accessibilityHint,
|
|
106
98
|
testID
|
|
107
99
|
}: AlertEdgeToEdgeProps) => {
|
|
108
|
-
const
|
|
109
|
-
|
|
100
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle } =
|
|
101
|
+
useScaleAnimation("slight");
|
|
110
102
|
const insets = useSafeAreaInsets();
|
|
111
103
|
|
|
112
|
-
// Scaling transformation applied when the button is pressed
|
|
113
|
-
const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
|
|
114
|
-
|
|
115
|
-
// Using a spring-based animation for our interpolations
|
|
116
|
-
const progressPressed = useDerivedValue(() =>
|
|
117
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
// Interpolate animation values from `isPressed` values
|
|
121
|
-
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
122
|
-
// Scale down button slightly when pressed
|
|
123
|
-
const scale = interpolate(
|
|
124
|
-
progressPressed.value,
|
|
125
|
-
[0, 1],
|
|
126
|
-
[1, animationScaleValue],
|
|
127
|
-
Extrapolate.CLAMP
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
transform: [{ scale }]
|
|
132
|
-
};
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
const onPressIn = useCallback(() => {
|
|
136
|
-
// eslint-disable-next-line functional/immutable-data
|
|
137
|
-
isPressed.value = 1;
|
|
138
|
-
}, [isPressed]);
|
|
139
|
-
const onPressOut = useCallback(() => {
|
|
140
|
-
// eslint-disable-next-line functional/immutable-data
|
|
141
|
-
isPressed.value = 0;
|
|
142
|
-
}, [isPressed]);
|
|
143
|
-
|
|
144
104
|
const backgroundColor = useMemo(
|
|
145
105
|
() => IOColors[mapVariantStates[variant].background],
|
|
146
106
|
[variant]
|
|
@@ -201,7 +161,7 @@ export const AlertEdgeToEdge = ({
|
|
|
201
161
|
>
|
|
202
162
|
<Animated.View
|
|
203
163
|
entering={enterTransitionAlertEdgeToEdgeContent}
|
|
204
|
-
style={[styles.alert,
|
|
164
|
+
style={[styles.alert, scaleAnimatedStyle]}
|
|
205
165
|
>
|
|
206
166
|
{renderMainBlock()}
|
|
207
167
|
</Animated.View>
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ColorValue,
|
|
4
|
+
Platform,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle
|
|
8
|
+
} from "react-native";
|
|
3
9
|
import {
|
|
4
10
|
hexToRgba,
|
|
5
11
|
IOBadgeHSpacing,
|
|
@@ -10,12 +16,14 @@ import {
|
|
|
10
16
|
useIOTheme,
|
|
11
17
|
useIOThemeContext
|
|
12
18
|
} from "../../core";
|
|
19
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
13
20
|
import { WithTestID } from "../../utils/types";
|
|
14
21
|
import { IOText } from "../typography";
|
|
15
22
|
|
|
16
23
|
export type Badge = WithTestID<{
|
|
17
24
|
outline?: boolean;
|
|
18
25
|
text: string;
|
|
26
|
+
allowFontScaling?: boolean;
|
|
19
27
|
variant:
|
|
20
28
|
| "default"
|
|
21
29
|
| "info"
|
|
@@ -44,12 +52,14 @@ const styles = StyleSheet.create({
|
|
|
44
52
|
flexDirection: "row",
|
|
45
53
|
alignItems: "center",
|
|
46
54
|
justifyContent: "center",
|
|
55
|
+
borderCurve: "continuous",
|
|
47
56
|
...Platform.select({
|
|
48
57
|
android: {
|
|
49
58
|
textAlignVertical: "center"
|
|
50
59
|
}
|
|
51
|
-
})
|
|
52
|
-
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
badgeStaticStyle: {
|
|
53
63
|
borderRadius: IOBadgeRadius,
|
|
54
64
|
paddingHorizontal: IOBadgeHSpacing,
|
|
55
65
|
paddingVertical: IOBadgeVSpacing
|
|
@@ -59,9 +69,16 @@ const styles = StyleSheet.create({
|
|
|
59
69
|
/**
|
|
60
70
|
* Official badge component
|
|
61
71
|
*/
|
|
62
|
-
export const Badge = ({
|
|
72
|
+
export const Badge = ({
|
|
73
|
+
text,
|
|
74
|
+
outline = false,
|
|
75
|
+
allowFontScaling = true,
|
|
76
|
+
variant,
|
|
77
|
+
testID
|
|
78
|
+
}: Badge) => {
|
|
63
79
|
const { isExperimental } = useIOExperimentalDesign();
|
|
64
80
|
const theme = useIOTheme();
|
|
81
|
+
const { dynamicFontScale } = useIOFontDynamicScale();
|
|
65
82
|
const { themeType } = useIOThemeContext();
|
|
66
83
|
|
|
67
84
|
const bgOpacityDarkMode = 0.2;
|
|
@@ -237,12 +254,19 @@ export const Badge = ({ text, outline = false, variant, testID }: Badge) => {
|
|
|
237
254
|
|
|
238
255
|
const { background, foreground } = variantMap[variant];
|
|
239
256
|
|
|
257
|
+
const dynamicStyle: ViewStyle = {
|
|
258
|
+
borderRadius: IOBadgeRadius * dynamicFontScale,
|
|
259
|
+
paddingHorizontal: IOBadgeHSpacing * dynamicFontScale,
|
|
260
|
+
paddingVertical: IOBadgeVSpacing * dynamicFontScale
|
|
261
|
+
};
|
|
262
|
+
|
|
240
263
|
return (
|
|
241
264
|
<View
|
|
242
265
|
accessible={true}
|
|
243
266
|
testID={testID}
|
|
244
267
|
style={[
|
|
245
268
|
styles.badge,
|
|
269
|
+
allowFontScaling ? dynamicStyle : styles.badgeStaticStyle,
|
|
246
270
|
outline
|
|
247
271
|
? {
|
|
248
272
|
borderWidth: 1,
|
|
@@ -254,6 +278,7 @@ export const Badge = ({ text, outline = false, variant, testID }: Badge) => {
|
|
|
254
278
|
]}
|
|
255
279
|
>
|
|
256
280
|
<IOText
|
|
281
|
+
allowFontScaling={allowFontScaling}
|
|
257
282
|
font={isExperimental ? "Titillio" : "TitilliumSansPro"}
|
|
258
283
|
weight={"Semibold"}
|
|
259
284
|
size={12}
|
|
@@ -8,9 +8,11 @@ exports[`Test Badge Components - Experimental Enabled Badge Snapshot 1`] = `
|
|
|
8
8
|
{
|
|
9
9
|
"alignItems": "center",
|
|
10
10
|
"borderCurve": "continuous",
|
|
11
|
-
"borderRadius": 24,
|
|
12
11
|
"flexDirection": "row",
|
|
13
12
|
"justifyContent": "center",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"borderRadius": 24,
|
|
14
16
|
"paddingHorizontal": 8,
|
|
15
17
|
"paddingVertical": 4,
|
|
16
18
|
},
|
|
@@ -23,7 +25,7 @@ exports[`Test Badge Components - Experimental Enabled Badge Snapshot 1`] = `
|
|
|
23
25
|
<Text
|
|
24
26
|
allowFontScaling={true}
|
|
25
27
|
ellipsizeMode="tail"
|
|
26
|
-
maxFontSizeMultiplier={1.
|
|
28
|
+
maxFontSizeMultiplier={1.5}
|
|
27
29
|
numberOfLines={1}
|
|
28
30
|
style={
|
|
29
31
|
[
|
|
@@ -58,9 +60,11 @@ exports[`Test Badge Components Badge Snapshot 1`] = `
|
|
|
58
60
|
{
|
|
59
61
|
"alignItems": "center",
|
|
60
62
|
"borderCurve": "continuous",
|
|
61
|
-
"borderRadius": 24,
|
|
62
63
|
"flexDirection": "row",
|
|
63
64
|
"justifyContent": "center",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"borderRadius": 24,
|
|
64
68
|
"paddingHorizontal": 8,
|
|
65
69
|
"paddingVertical": 4,
|
|
66
70
|
},
|
|
@@ -71,9 +75,9 @@ exports[`Test Badge Components Badge Snapshot 1`] = `
|
|
|
71
75
|
}
|
|
72
76
|
>
|
|
73
77
|
<Text
|
|
74
|
-
allowFontScaling={
|
|
78
|
+
allowFontScaling={true}
|
|
75
79
|
ellipsizeMode="tail"
|
|
76
|
-
maxFontSizeMultiplier={1.
|
|
80
|
+
maxFontSizeMultiplier={1.5}
|
|
77
81
|
numberOfLines={1}
|
|
78
82
|
style={
|
|
79
83
|
[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import {
|
|
3
3
|
AccessibilityRole,
|
|
4
4
|
GestureResponderEvent,
|
|
@@ -7,28 +7,19 @@ import {
|
|
|
7
7
|
View,
|
|
8
8
|
ViewStyle
|
|
9
9
|
} from "react-native";
|
|
10
|
-
import Animated
|
|
11
|
-
Extrapolation,
|
|
12
|
-
interpolate,
|
|
13
|
-
SharedValue,
|
|
14
|
-
useAnimatedStyle,
|
|
15
|
-
useDerivedValue,
|
|
16
|
-
useSharedValue,
|
|
17
|
-
withSpring
|
|
18
|
-
} from "react-native-reanimated";
|
|
10
|
+
import Animated from "react-native-reanimated";
|
|
19
11
|
import {
|
|
20
12
|
IOBannerBigSpacing,
|
|
21
13
|
IOBannerRadius,
|
|
22
14
|
IOBannerSmallHSpacing,
|
|
23
15
|
IOBannerSmallVSpacing,
|
|
24
|
-
IOScaleValues,
|
|
25
|
-
IOSpringValues,
|
|
26
16
|
IOStyles,
|
|
27
17
|
useIOExperimentalDesign,
|
|
28
18
|
useIOTheme,
|
|
29
19
|
useIOThemeContext
|
|
30
20
|
} from "../../core";
|
|
31
21
|
import { hexToRgba, IOColors } from "../../core/IOColors";
|
|
22
|
+
import { useScaleAnimation } from "../../hooks";
|
|
32
23
|
import { WithTestID } from "../../utils/types";
|
|
33
24
|
import { IconButton } from "../buttons";
|
|
34
25
|
import {
|
|
@@ -159,7 +150,8 @@ export const Banner = ({
|
|
|
159
150
|
accessibilityLabel,
|
|
160
151
|
testID
|
|
161
152
|
}: Banner) => {
|
|
162
|
-
const
|
|
153
|
+
const { onPressIn, onPressOut, scaleAnimatedStyle } =
|
|
154
|
+
useScaleAnimation("medium");
|
|
163
155
|
|
|
164
156
|
const { isExperimental } = useIOExperimentalDesign();
|
|
165
157
|
const { themeType } = useIOThemeContext();
|
|
@@ -181,40 +173,6 @@ export const Banner = ({
|
|
|
181
173
|
paddingHorizontal: size === "big" ? sizeBigPadding : sizeSmallHPadding
|
|
182
174
|
};
|
|
183
175
|
|
|
184
|
-
// Scaling transformation applied when the button is pressed
|
|
185
|
-
const animationScaleValue = IOScaleValues?.magnifiedButton?.pressedState;
|
|
186
|
-
|
|
187
|
-
// Using a spring-based animation for our interpolations
|
|
188
|
-
const progressPressed = useDerivedValue(() =>
|
|
189
|
-
withSpring(isPressed.value, IOSpringValues.button)
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
// Interpolate animation values from `isPressed` values
|
|
193
|
-
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
194
|
-
// Link color states to the pressed states
|
|
195
|
-
|
|
196
|
-
// Scale down button slightly when pressed
|
|
197
|
-
const scale = interpolate(
|
|
198
|
-
progressPressed.value,
|
|
199
|
-
[0, 1],
|
|
200
|
-
[1, animationScaleValue],
|
|
201
|
-
Extrapolation.CLAMP
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
return {
|
|
205
|
-
transform: [{ scale }]
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
const onPressIn = useCallback(() => {
|
|
210
|
-
// eslint-disable-next-line functional/immutable-data
|
|
211
|
-
isPressed.value = 1;
|
|
212
|
-
}, [isPressed]);
|
|
213
|
-
const onPressOut = useCallback(() => {
|
|
214
|
-
// eslint-disable-next-line functional/immutable-data
|
|
215
|
-
isPressed.value = 0;
|
|
216
|
-
}, [isPressed]);
|
|
217
|
-
|
|
218
176
|
/* Generates a complete fallbackAccessibilityLabel by concatenating the title, content, and action
|
|
219
177
|
if they are present. */
|
|
220
178
|
const fallbackAccessibilityLabel = [title, content, action]
|
|
@@ -233,8 +191,6 @@ export const Banner = ({
|
|
|
233
191
|
>
|
|
234
192
|
{title && (
|
|
235
193
|
<>
|
|
236
|
-
{/* Once we get 'gap' property, we can get rid of
|
|
237
|
-
these <VSpacer> components */}
|
|
238
194
|
<H6 color={colorTitle}>{title}</H6>
|
|
239
195
|
<VSpacer size={4} />
|
|
240
196
|
</>
|
|
@@ -305,11 +261,7 @@ export const Banner = ({
|
|
|
305
261
|
accessible={false}
|
|
306
262
|
>
|
|
307
263
|
<Animated.View
|
|
308
|
-
style={[
|
|
309
|
-
styles.container,
|
|
310
|
-
dynamicContainerStyles,
|
|
311
|
-
pressedAnimationStyle
|
|
312
|
-
]}
|
|
264
|
+
style={[styles.container, dynamicContainerStyles, scaleAnimatedStyle]}
|
|
313
265
|
>
|
|
314
266
|
{renderMainBlock()}
|
|
315
267
|
</Animated.View>
|
|
@@ -75,7 +75,7 @@ exports[`Test Banner Components - Experimental Enabled Banner Snapshot 1`] = `
|
|
|
75
75
|
<Text
|
|
76
76
|
allowFontScaling={true}
|
|
77
77
|
dynamicTypeRamp="headline"
|
|
78
|
-
maxFontSizeMultiplier={1.
|
|
78
|
+
maxFontSizeMultiplier={1.5}
|
|
79
79
|
style={
|
|
80
80
|
[
|
|
81
81
|
{},
|
|
@@ -120,7 +120,7 @@ exports[`Test Banner Components - Experimental Enabled Banner Snapshot 1`] = `
|
|
|
120
120
|
allowFontScaling={true}
|
|
121
121
|
ellipsizeMode="tail"
|
|
122
122
|
importantForAccessibility="no-hide-descendants"
|
|
123
|
-
maxFontSizeMultiplier={1.
|
|
123
|
+
maxFontSizeMultiplier={1.5}
|
|
124
124
|
numberOfLines={1}
|
|
125
125
|
style={
|
|
126
126
|
[
|
|
@@ -352,9 +352,9 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
|
|
|
352
352
|
}
|
|
353
353
|
>
|
|
354
354
|
<Text
|
|
355
|
-
allowFontScaling={
|
|
355
|
+
allowFontScaling={true}
|
|
356
356
|
dynamicTypeRamp="headline"
|
|
357
|
-
maxFontSizeMultiplier={1.
|
|
357
|
+
maxFontSizeMultiplier={1.5}
|
|
358
358
|
style={
|
|
359
359
|
[
|
|
360
360
|
{},
|
|
@@ -396,10 +396,10 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
|
|
|
396
396
|
<Text
|
|
397
397
|
accessibilityElementsHidden={true}
|
|
398
398
|
accessible={false}
|
|
399
|
-
allowFontScaling={
|
|
399
|
+
allowFontScaling={true}
|
|
400
400
|
ellipsizeMode="tail"
|
|
401
401
|
importantForAccessibility="no-hide-descendants"
|
|
402
|
-
maxFontSizeMultiplier={1.
|
|
402
|
+
maxFontSizeMultiplier={1.5}
|
|
403
403
|
numberOfLines={1}
|
|
404
404
|
style={
|
|
405
405
|
[
|