@pagopa/io-app-design-system 4.3.0 → 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 +34 -34
- package/lib/commonjs/components/alert/Alert.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.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
- package/lib/commonjs/components/buttons/ButtonLink.js +6 -1
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +11 -9
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +10 -6
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +2 -0
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +1 -0
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +27 -9
- 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/listitems/ListItemAction.js +11 -7
- 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 +12 -7
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js +9 -2
- 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 +15 -13
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +20 -17
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +19 -14
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +24 -9
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +5 -0
- 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 +2 -0
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +435 -429
- 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/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -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/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/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/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
- package/lib/module/components/alert/Alert.js +35 -35
- package/lib/module/components/alert/Alert.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.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
- package/lib/module/components/buttons/ButtonLink.js +6 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +11 -9
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +10 -6
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +2 -0
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +1 -0
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +27 -9
- 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/listitems/ListItemAction.js +11 -7
- 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 +14 -9
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemHeader.js +9 -2
- 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 +15 -13
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +22 -19
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +21 -16
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +25 -10
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +6 -1
- 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 +2 -0
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +435 -429
- 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/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -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/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/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/typescript/components/alert/Alert.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/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/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.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/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/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/IOStyles.d.ts +7 -7
- 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/package.json +1 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +3 -3
- package/src/components/alert/Alert.tsx +43 -61
- 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 +0 -2
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
- package/src/components/buttons/ButtonLink.tsx +4 -0
- package/src/components/buttons/ButtonOutline.tsx +24 -25
- package/src/components/buttons/ButtonSolid.tsx +10 -9
- package/src/components/buttons/IconButton.tsx +2 -0
- package/src/components/buttons/IconButtonSolid.tsx +1 -0
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +27 -9
- 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/listitems/ListItemAction.tsx +19 -8
- package/src/components/listitems/ListItemAmount.tsx +16 -11
- package/src/components/listitems/ListItemCheckbox.tsx +29 -15
- package/src/components/listitems/ListItemHeader.tsx +12 -2
- package/src/components/listitems/ListItemInfo.tsx +27 -20
- package/src/components/listitems/ListItemInfoCopy.tsx +27 -16
- package/src/components/listitems/ListItemNav.tsx +44 -40
- package/src/components/listitems/ListItemNavAlert.tsx +30 -16
- package/src/components/listitems/ListItemRadio.tsx +46 -32
- package/src/components/listitems/ListItemRadioWithAmount.tsx +7 -2
- package/src/components/listitems/ListItemSwitch.tsx +21 -27
- package/src/components/listitems/ListItemTransaction.tsx +3 -0
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +435 -429
- package/src/components/modules/ModuleCredential.tsx +5 -2
- package/src/components/modules/ModuleNavigation.tsx +3 -1
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -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/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/utils/accessibility.ts +32 -1
- package/src/utils/fonts.ts +1 -0
|
@@ -63,6 +63,9 @@ exports[`Test Buttons Components - Experimental Enabled ButtonLink Snapshot 1`]
|
|
|
63
63
|
"columnGap": 8,
|
|
64
64
|
},
|
|
65
65
|
{},
|
|
66
|
+
{
|
|
67
|
+
"columnGap": 8,
|
|
68
|
+
},
|
|
66
69
|
{
|
|
67
70
|
"transform": [
|
|
68
71
|
{
|
|
@@ -79,7 +82,7 @@ exports[`Test Buttons Components - Experimental Enabled ButtonLink Snapshot 1`]
|
|
|
79
82
|
allowFontScaling={true}
|
|
80
83
|
ellipsizeMode="tail"
|
|
81
84
|
importantForAccessibility="no-hide-descendants"
|
|
82
|
-
maxFontSizeMultiplier={1.
|
|
85
|
+
maxFontSizeMultiplier={1.5}
|
|
83
86
|
numberOfLines={1}
|
|
84
87
|
style={
|
|
85
88
|
[
|
|
@@ -163,6 +166,9 @@ exports[`Test Buttons Components - Experimental Enabled ButtonOutline Snapshot 1
|
|
|
163
166
|
{
|
|
164
167
|
"height": 48,
|
|
165
168
|
},
|
|
169
|
+
{
|
|
170
|
+
"columnGap": 8,
|
|
171
|
+
},
|
|
166
172
|
false,
|
|
167
173
|
{
|
|
168
174
|
"backgroundColor": "rgba(231,236,252,0)",
|
|
@@ -188,7 +194,7 @@ exports[`Test Buttons Components - Experimental Enabled ButtonOutline Snapshot 1
|
|
|
188
194
|
allowFontScaling={true}
|
|
189
195
|
ellipsizeMode="tail"
|
|
190
196
|
importantForAccessibility="no-hide-descendants"
|
|
191
|
-
maxFontSizeMultiplier={1.
|
|
197
|
+
maxFontSizeMultiplier={1.5}
|
|
192
198
|
numberOfLines={1}
|
|
193
199
|
style={
|
|
194
200
|
[
|
|
@@ -302,6 +308,9 @@ exports[`Test Buttons Components - Experimental Enabled ButtonSolid Snapshot 1`]
|
|
|
302
308
|
"flexDirection": "row",
|
|
303
309
|
"justifyContent": "center",
|
|
304
310
|
},
|
|
311
|
+
{
|
|
312
|
+
"columnGap": 8,
|
|
313
|
+
},
|
|
305
314
|
false,
|
|
306
315
|
]
|
|
307
316
|
}
|
|
@@ -312,7 +321,7 @@ exports[`Test Buttons Components - Experimental Enabled ButtonSolid Snapshot 1`]
|
|
|
312
321
|
allowFontScaling={true}
|
|
313
322
|
ellipsizeMode="tail"
|
|
314
323
|
importantForAccessibility="no-hide-descendants"
|
|
315
|
-
maxFontSizeMultiplier={1.
|
|
324
|
+
maxFontSizeMultiplier={1.5}
|
|
316
325
|
numberOfLines={1}
|
|
317
326
|
style={
|
|
318
327
|
[
|
|
@@ -794,6 +803,9 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
|
|
|
794
803
|
"columnGap": 8,
|
|
795
804
|
},
|
|
796
805
|
{},
|
|
806
|
+
{
|
|
807
|
+
"columnGap": 8,
|
|
808
|
+
},
|
|
797
809
|
{
|
|
798
810
|
"transform": [
|
|
799
811
|
{
|
|
@@ -807,10 +819,10 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
|
|
|
807
819
|
<Text
|
|
808
820
|
accessibilityElementsHidden={true}
|
|
809
821
|
accessible={false}
|
|
810
|
-
allowFontScaling={
|
|
822
|
+
allowFontScaling={true}
|
|
811
823
|
ellipsizeMode="tail"
|
|
812
824
|
importantForAccessibility="no-hide-descendants"
|
|
813
|
-
maxFontSizeMultiplier={1.
|
|
825
|
+
maxFontSizeMultiplier={1.5}
|
|
814
826
|
numberOfLines={1}
|
|
815
827
|
style={
|
|
816
828
|
[
|
|
@@ -893,6 +905,9 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
|
|
|
893
905
|
{
|
|
894
906
|
"height": 40,
|
|
895
907
|
},
|
|
908
|
+
{
|
|
909
|
+
"columnGap": 8,
|
|
910
|
+
},
|
|
896
911
|
false,
|
|
897
912
|
{
|
|
898
913
|
"backgroundColor": "rgba(0,115,230,0)",
|
|
@@ -915,10 +930,10 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
|
|
|
915
930
|
<Text
|
|
916
931
|
accessibilityElementsHidden={true}
|
|
917
932
|
accessible={false}
|
|
918
|
-
allowFontScaling={
|
|
933
|
+
allowFontScaling={true}
|
|
919
934
|
ellipsizeMode="tail"
|
|
920
935
|
importantForAccessibility="no-hide-descendants"
|
|
921
|
-
maxFontSizeMultiplier={1.
|
|
936
|
+
maxFontSizeMultiplier={1.5}
|
|
922
937
|
numberOfLines={1}
|
|
923
938
|
style={
|
|
924
939
|
[
|
|
@@ -1031,6 +1046,9 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
|
|
|
1031
1046
|
"flexDirection": "row",
|
|
1032
1047
|
"justifyContent": "center",
|
|
1033
1048
|
},
|
|
1049
|
+
{
|
|
1050
|
+
"columnGap": 8,
|
|
1051
|
+
},
|
|
1034
1052
|
false,
|
|
1035
1053
|
]
|
|
1036
1054
|
}
|
|
@@ -1038,10 +1056,10 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
|
|
|
1038
1056
|
<Text
|
|
1039
1057
|
accessibilityElementsHidden={true}
|
|
1040
1058
|
accessible={false}
|
|
1041
|
-
allowFontScaling={
|
|
1059
|
+
allowFontScaling={true}
|
|
1042
1060
|
ellipsizeMode="tail"
|
|
1043
1061
|
importantForAccessibility="no-hide-descendants"
|
|
1044
|
-
maxFontSizeMultiplier={1.
|
|
1062
|
+
maxFontSizeMultiplier={1.5}
|
|
1045
1063
|
numberOfLines={1}
|
|
1046
1064
|
style={
|
|
1047
1065
|
[
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
PressableProps,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle
|
|
8
|
+
} from "react-native";
|
|
3
9
|
import Animated, {
|
|
4
10
|
Easing,
|
|
5
11
|
interpolate,
|
|
@@ -8,6 +14,7 @@ import Animated, {
|
|
|
8
14
|
withSpring,
|
|
9
15
|
withTiming
|
|
10
16
|
} from "react-native-reanimated";
|
|
17
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
11
18
|
import { useIOExperimentalDesign } from "../../core";
|
|
12
19
|
import { IOSpringValues } from "../../core/IOAnimations";
|
|
13
20
|
import { IOColors } from "../../core/IOColors";
|
|
@@ -18,6 +25,7 @@ import {
|
|
|
18
25
|
import { AnimatedTick } from "../common/AnimatedTick";
|
|
19
26
|
|
|
20
27
|
type Props = {
|
|
28
|
+
size: number;
|
|
21
29
|
checked?: boolean;
|
|
22
30
|
};
|
|
23
31
|
|
|
@@ -26,28 +34,18 @@ type OwnProps = Props & Pick<PressableProps, "disabled" | "onPress">;
|
|
|
26
34
|
const checkBoxRadius: number = 5;
|
|
27
35
|
|
|
28
36
|
const styles = StyleSheet.create({
|
|
29
|
-
checkBoxWrapper: {
|
|
30
|
-
width: IOSelectionTickVisualParams.size,
|
|
31
|
-
height: IOSelectionTickVisualParams.size
|
|
32
|
-
},
|
|
33
37
|
checkboxBorder: {
|
|
38
|
+
borderWidth: IOSelectionTickVisualParams.borderWidth,
|
|
39
|
+
borderCurve: "continuous",
|
|
34
40
|
position: "absolute",
|
|
35
41
|
left: 0,
|
|
36
|
-
top: 0
|
|
37
|
-
width: IOSelectionTickVisualParams.size,
|
|
38
|
-
height: IOSelectionTickVisualParams.size,
|
|
39
|
-
borderWidth: IOSelectionTickVisualParams.borderWidth,
|
|
40
|
-
borderRadius: checkBoxRadius,
|
|
41
|
-
borderCurve: "continuous"
|
|
42
|
+
top: 0
|
|
42
43
|
},
|
|
43
44
|
checkBoxSquare: {
|
|
45
|
+
borderCurve: "continuous",
|
|
44
46
|
position: "absolute",
|
|
45
47
|
left: 0,
|
|
46
|
-
top: 0
|
|
47
|
-
width: IOSelectionTickVisualParams.size,
|
|
48
|
-
height: IOSelectionTickVisualParams.size,
|
|
49
|
-
borderRadius: checkBoxRadius,
|
|
50
|
-
borderCurve: "continuous"
|
|
48
|
+
top: 0
|
|
51
49
|
}
|
|
52
50
|
});
|
|
53
51
|
|
|
@@ -55,7 +53,13 @@ const styles = StyleSheet.create({
|
|
|
55
53
|
* An animated checkbox. This can be used to implement a
|
|
56
54
|
* standard {@link CheckBox} or other composite components.
|
|
57
55
|
*/
|
|
58
|
-
export const AnimatedCheckbox = ({
|
|
56
|
+
export const AnimatedCheckbox = ({
|
|
57
|
+
size,
|
|
58
|
+
checked,
|
|
59
|
+
onPress,
|
|
60
|
+
disabled
|
|
61
|
+
}: OwnProps) => {
|
|
62
|
+
const { dynamicFontScale } = useIOFontDynamicScale();
|
|
59
63
|
const isChecked = checked ?? false;
|
|
60
64
|
|
|
61
65
|
const { isExperimental } = useIOExperimentalDesign();
|
|
@@ -80,6 +84,17 @@ export const AnimatedCheckbox = ({ checked, onPress, disabled }: OwnProps) => {
|
|
|
80
84
|
const squareAnimationProgress = useSharedValue(checked ? 1 : 0);
|
|
81
85
|
const tickAnimationProgress = useSharedValue(checked ? 1 : 0);
|
|
82
86
|
|
|
87
|
+
const checkboxSizeStyle: ViewStyle = {
|
|
88
|
+
width: size,
|
|
89
|
+
height: size,
|
|
90
|
+
borderRadius: checkBoxRadius * dynamicFontScale
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const checkboxWrapperSizeStyle: ViewStyle = {
|
|
94
|
+
width: size,
|
|
95
|
+
height: size
|
|
96
|
+
};
|
|
97
|
+
|
|
83
98
|
useEffect(() => {
|
|
84
99
|
// eslint-disable-next-line functional/immutable-data
|
|
85
100
|
squareAnimationProgress.value = withSpring(
|
|
@@ -108,12 +123,13 @@ export const AnimatedCheckbox = ({ checked, onPress, disabled }: OwnProps) => {
|
|
|
108
123
|
accessible={false}
|
|
109
124
|
disabled={disabled}
|
|
110
125
|
onPress={onPress}
|
|
111
|
-
style={
|
|
126
|
+
style={checkboxWrapperSizeStyle}
|
|
112
127
|
testID="AnimatedCheckboxInput"
|
|
113
128
|
>
|
|
114
129
|
<View
|
|
115
130
|
style={[
|
|
116
131
|
styles.checkboxBorder,
|
|
132
|
+
checkboxSizeStyle,
|
|
117
133
|
{
|
|
118
134
|
borderColor: borderColorProp
|
|
119
135
|
}
|
|
@@ -122,6 +138,7 @@ export const AnimatedCheckbox = ({ checked, onPress, disabled }: OwnProps) => {
|
|
|
122
138
|
<Animated.View
|
|
123
139
|
style={[
|
|
124
140
|
styles.checkBoxSquare,
|
|
141
|
+
checkboxSizeStyle,
|
|
125
142
|
{
|
|
126
143
|
backgroundColor: backgroundColorProp
|
|
127
144
|
},
|
|
@@ -131,6 +148,7 @@ export const AnimatedCheckbox = ({ checked, onPress, disabled }: OwnProps) => {
|
|
|
131
148
|
{isChecked && (
|
|
132
149
|
<View style={{ zIndex: 1 }}>
|
|
133
150
|
<AnimatedTick
|
|
151
|
+
size={size}
|
|
134
152
|
progress={tickAnimationProgress}
|
|
135
153
|
stroke={IOColors[IOSelectionTickVisualParams.tickColor]}
|
|
136
154
|
/>
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { ComponentProps, useState } from "react";
|
|
3
3
|
import { Pressable, View } from "react-native";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
IOSelectionTickVisualParams,
|
|
6
|
+
IOSpacingScale,
|
|
7
|
+
useIOTheme
|
|
8
|
+
} from "../../core";
|
|
6
9
|
import { triggerHaptic } from "../../functions/haptic-feedback/hapticFeedback";
|
|
7
|
-
import {
|
|
10
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
11
|
+
import { HStack } from "../stack";
|
|
8
12
|
import { H6 } from "../typography/H6";
|
|
9
13
|
import { AnimatedCheckbox } from "./AnimatedCheckbox";
|
|
10
14
|
|
|
@@ -15,12 +19,13 @@ type Props = {
|
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
const DISABLED_OPACITY = 0.5;
|
|
22
|
+
const CHECKBOX_MARGIN: IOSpacingScale = 8;
|
|
18
23
|
|
|
19
24
|
// disabled: the component is no longer touchable
|
|
20
25
|
// onPress:
|
|
21
26
|
type OwnProps = Props &
|
|
22
|
-
Pick<
|
|
23
|
-
Pick<
|
|
27
|
+
Pick<ComponentProps<typeof AnimatedCheckbox>, "disabled" | "checked"> &
|
|
28
|
+
Pick<ComponentProps<typeof Pressable>, "onPress">;
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
31
|
* A checkbox with the automatic state management that uses a {@link AnimatedCheckBox}
|
|
@@ -36,6 +41,7 @@ export const CheckboxLabel = ({
|
|
|
36
41
|
onValueChange
|
|
37
42
|
}: OwnProps) => {
|
|
38
43
|
const theme = useIOTheme();
|
|
44
|
+
const { dynamicFontScale } = useIOFontDynamicScale();
|
|
39
45
|
|
|
40
46
|
const [toggleValue, setToggleValue] = useState(checked ?? false);
|
|
41
47
|
|
|
@@ -65,7 +71,11 @@ export const CheckboxLabel = ({
|
|
|
65
71
|
// inheritance on Android
|
|
66
72
|
needsOffscreenAlphaCompositing={true}
|
|
67
73
|
>
|
|
68
|
-
<
|
|
74
|
+
<HStack
|
|
75
|
+
allowScaleSpacing
|
|
76
|
+
style={{ alignItems: "center", width: "100%" }}
|
|
77
|
+
space={CHECKBOX_MARGIN}
|
|
78
|
+
>
|
|
69
79
|
<View
|
|
70
80
|
pointerEvents="none"
|
|
71
81
|
accessibilityElementsHidden
|
|
@@ -74,13 +84,15 @@ export const CheckboxLabel = ({
|
|
|
74
84
|
alignSelf: "flex-start"
|
|
75
85
|
}}
|
|
76
86
|
>
|
|
77
|
-
<AnimatedCheckbox
|
|
87
|
+
<AnimatedCheckbox
|
|
88
|
+
size={IOSelectionTickVisualParams.size * dynamicFontScale}
|
|
89
|
+
checked={checked ?? toggleValue}
|
|
90
|
+
/>
|
|
78
91
|
</View>
|
|
79
|
-
<HSpacer size={8} />
|
|
80
92
|
<H6 style={{ flexShrink: 1 }} color={theme["textBody-default"]}>
|
|
81
93
|
{label}
|
|
82
94
|
</H6>
|
|
83
|
-
</
|
|
95
|
+
</HStack>
|
|
84
96
|
</Pressable>
|
|
85
97
|
);
|
|
86
98
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import Animated, {
|
|
3
|
+
SharedValue,
|
|
3
4
|
useAnimatedProps,
|
|
4
5
|
useAnimatedRef
|
|
5
6
|
} from "react-native-reanimated";
|
|
@@ -8,7 +9,8 @@ import Svg, { Path, PathProps } from "react-native-svg";
|
|
|
8
9
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
9
10
|
|
|
10
11
|
interface AnimatedTickProps extends PathProps {
|
|
11
|
-
|
|
12
|
+
size?: number;
|
|
13
|
+
progress: SharedValue<number>;
|
|
12
14
|
onLayout?: () => void;
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -20,7 +22,11 @@ const TickSVGPath = "m7 12 4 4 7-7";
|
|
|
20
22
|
* It comes without any state logic.
|
|
21
23
|
*
|
|
22
24
|
*/
|
|
23
|
-
export const AnimatedTick = ({
|
|
25
|
+
export const AnimatedTick = ({
|
|
26
|
+
size,
|
|
27
|
+
progress,
|
|
28
|
+
...pathProps
|
|
29
|
+
}: AnimatedTickProps) => {
|
|
24
30
|
const [length, setLength] = useState(0);
|
|
25
31
|
const ref = useAnimatedRef();
|
|
26
32
|
|
|
@@ -38,7 +44,7 @@ export const AnimatedTick = ({ progress, ...pathProps }: AnimatedTickProps) => {
|
|
|
38
44
|
};
|
|
39
45
|
|
|
40
46
|
return (
|
|
41
|
-
<Svg viewBox=
|
|
47
|
+
<Svg viewBox={`0 0 24 24`} {...(size ? { width: size, height: size } : {})}>
|
|
42
48
|
<AnimatedPath
|
|
43
49
|
ref={ref}
|
|
44
50
|
onLayout={onLayout}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IOColors } from "../../core";
|
|
3
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
4
|
+
import { findFirstCaseInsensitive } from "../../utils/object";
|
|
3
5
|
import { IOIconSizeScale, Icon } from "../icons";
|
|
4
6
|
import {
|
|
5
7
|
IOLogoPaymentExtType,
|
|
@@ -9,7 +11,6 @@ import {
|
|
|
9
11
|
LogoPayment,
|
|
10
12
|
LogoPaymentExt
|
|
11
13
|
} from "../logos";
|
|
12
|
-
import { findFirstCaseInsensitive } from "../../utils/object";
|
|
13
14
|
|
|
14
15
|
export type LogoPaymentWithFallback = {
|
|
15
16
|
brand?: string;
|
|
@@ -38,21 +39,42 @@ export const LogoPaymentWithFallback = ({
|
|
|
38
39
|
isExtended = false,
|
|
39
40
|
size = isExtended ? 48 : 24
|
|
40
41
|
}: LogoPaymentWithFallback) => {
|
|
42
|
+
const { dynamicFontScale } = useIOFontDynamicScale();
|
|
41
43
|
const logos = isExtended ? IOPaymentExtLogos : IOPaymentLogos;
|
|
42
44
|
|
|
43
45
|
if (!brand) {
|
|
44
|
-
return
|
|
46
|
+
return (
|
|
47
|
+
<Icon
|
|
48
|
+
allowFontScaling
|
|
49
|
+
name="creditCard"
|
|
50
|
+
size={size}
|
|
51
|
+
color={fallbackIconColor}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
const findCase = findFirstCaseInsensitive(logos, brand);
|
|
48
57
|
|
|
49
58
|
if (!findCase) {
|
|
50
|
-
return
|
|
59
|
+
return (
|
|
60
|
+
<Icon
|
|
61
|
+
allowFontScaling
|
|
62
|
+
name="creditCard"
|
|
63
|
+
size={size}
|
|
64
|
+
color={fallbackIconColor}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
return isExtended ? (
|
|
54
|
-
<LogoPaymentExt
|
|
70
|
+
<LogoPaymentExt
|
|
71
|
+
name={findCase as IOLogoPaymentExtType}
|
|
72
|
+
size={size * dynamicFontScale}
|
|
73
|
+
/>
|
|
55
74
|
) : (
|
|
56
|
-
<LogoPayment
|
|
75
|
+
<LogoPayment
|
|
76
|
+
name={findCase as IOLogoPaymentType}
|
|
77
|
+
size={size * dynamicFontScale}
|
|
78
|
+
/>
|
|
57
79
|
);
|
|
58
80
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import { GestureResponderEvent
|
|
2
|
+
import { GestureResponderEvent } from "react-native";
|
|
3
3
|
import {
|
|
4
4
|
BodySmall,
|
|
5
|
-
|
|
5
|
+
HStack,
|
|
6
6
|
IOIconSizeScale,
|
|
7
7
|
IOIcons,
|
|
8
8
|
IOPictogramSizeScale,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Pictogram,
|
|
12
12
|
VStack
|
|
13
13
|
} from "../../components";
|
|
14
|
-
import {
|
|
14
|
+
import { useIOTheme } from "../../core";
|
|
15
15
|
|
|
16
16
|
type PartialFeatureInfo = {
|
|
17
17
|
// Necessary to render main body with different formatting
|
|
@@ -57,24 +57,28 @@ export const FeatureInfo = ({
|
|
|
57
57
|
const theme = useIOTheme();
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<
|
|
60
|
+
<HStack style={{ alignItems: "center" }} space={24}>
|
|
61
61
|
{iconName && (
|
|
62
62
|
<Icon
|
|
63
|
+
allowFontScaling
|
|
63
64
|
name={iconName}
|
|
64
65
|
size={DEFAULT_ICON_SIZE}
|
|
65
66
|
color={theme["icon-decorative"]}
|
|
66
67
|
/>
|
|
67
68
|
)}
|
|
68
69
|
{pictogramName && (
|
|
69
|
-
<Pictogram
|
|
70
|
+
<Pictogram
|
|
71
|
+
allowFontScaling
|
|
72
|
+
name={pictogramName}
|
|
73
|
+
size={DEFAULT_PICTOGRAM_SIZE}
|
|
74
|
+
/>
|
|
70
75
|
)}
|
|
71
|
-
<
|
|
72
|
-
<VStack space={4} style={{ flexShrink: 1 }}>
|
|
76
|
+
<VStack allowScaleSpacing space={4} style={{ flexShrink: 1 }}>
|
|
73
77
|
{renderNode(body)}
|
|
74
78
|
{action && (
|
|
75
79
|
<BodySmall
|
|
76
|
-
weight="Semibold"
|
|
77
80
|
asLink
|
|
81
|
+
weight="Semibold"
|
|
78
82
|
onPress={action.onPress}
|
|
79
83
|
accessible
|
|
80
84
|
importantForAccessibility={"yes"}
|
|
@@ -84,6 +88,6 @@ export const FeatureInfo = ({
|
|
|
84
88
|
</BodySmall>
|
|
85
89
|
)}
|
|
86
90
|
</VStack>
|
|
87
|
-
</
|
|
91
|
+
</HStack>
|
|
88
92
|
);
|
|
89
93
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ColorValue } from "react-native";
|
|
3
3
|
import { IOColors } from "../../core/IOColors";
|
|
4
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
4
5
|
|
|
5
6
|
/* Icons */
|
|
6
7
|
import IconAbacus from "./svg/IconAbacus";
|
|
@@ -51,6 +52,7 @@ import IconChevronRight from "./svg/IconChevronRight";
|
|
|
51
52
|
import IconChevronRightListItem from "./svg/IconChevronRightListItem";
|
|
52
53
|
import IconChevronTop from "./svg/IconChevronTop";
|
|
53
54
|
import IconCie from "./svg/IconCie";
|
|
55
|
+
import IconCieLetter from "./svg/IconCieLetter";
|
|
54
56
|
import IconCloseLarge from "./svg/IconCloseLarge";
|
|
55
57
|
import IconCloseMedium from "./svg/IconCloseMedium";
|
|
56
58
|
import IconCloseSmall from "./svg/IconCloseSmall";
|
|
@@ -200,7 +202,6 @@ import LegIconCheckOff from "./svg/LegIconCheckOff";
|
|
|
200
202
|
import LegIconCheckOn from "./svg/LegIconCheckOn";
|
|
201
203
|
import LegIconRadioOff from "./svg/LegIconRadioOff";
|
|
202
204
|
import LegIconRadioOn from "./svg/LegIconRadioOn";
|
|
203
|
-
import IconCieLetter from "./svg/IconCieLetter";
|
|
204
205
|
|
|
205
206
|
export const IOIcons = {
|
|
206
207
|
spid: IconSpid,
|
|
@@ -406,10 +407,7 @@ export const IOIcons = {
|
|
|
406
407
|
|
|
407
408
|
export type IOIcons = keyof typeof IOIcons;
|
|
408
409
|
|
|
409
|
-
|
|
410
|
-
/* 96 is too big for an icon, it should be replaced
|
|
411
|
-
with a Pictogram instead */
|
|
412
|
-
export type IOIconSizeScale = 12 | 16 | 20 | 24 | 30 | 32 | 48 | 96;
|
|
410
|
+
export type IOIconSizeScale = 16 | 20 | 24 | 32 | 48;
|
|
413
411
|
/* Sizes used exclusively for the Checkbox component */
|
|
414
412
|
export type IOIconSizeScaleCheckbox = 14 | 18;
|
|
415
413
|
|
|
@@ -420,6 +418,7 @@ export type IOIconsProps = {
|
|
|
420
418
|
testID?: string;
|
|
421
419
|
accessible?: boolean;
|
|
422
420
|
accessibilityLabel?: string;
|
|
421
|
+
allowFontScaling?: boolean;
|
|
423
422
|
};
|
|
424
423
|
|
|
425
424
|
/*
|
|
@@ -432,15 +431,23 @@ export const Icon = ({
|
|
|
432
431
|
size = 24,
|
|
433
432
|
accessible = false,
|
|
434
433
|
accessibilityLabel = "",
|
|
434
|
+
allowFontScaling = false,
|
|
435
435
|
...props
|
|
436
436
|
}: IOIconsProps) => {
|
|
437
|
+
const { dynamicFontScale } = useIOFontDynamicScale();
|
|
438
|
+
|
|
437
439
|
const IconElement = IOIcons[name];
|
|
438
440
|
const isAccessible = accessible && accessibilityLabel.trim().length > 0;
|
|
441
|
+
const iconSize =
|
|
442
|
+
allowFontScaling && typeof size === "number"
|
|
443
|
+
? size * dynamicFontScale
|
|
444
|
+
: size;
|
|
445
|
+
|
|
439
446
|
return (
|
|
440
447
|
<IconElement
|
|
441
448
|
{...props}
|
|
442
449
|
style={{ color: IOColors[color] }}
|
|
443
|
-
size={
|
|
450
|
+
size={iconSize}
|
|
444
451
|
accessible={isAccessible}
|
|
445
452
|
accessibilityElementsHidden={!isAccessible}
|
|
446
453
|
accessibilityLabel={accessibilityLabel}
|
|
@@ -459,6 +466,7 @@ type IOAnimatedIconsProps = {
|
|
|
459
466
|
color?: ColorValue;
|
|
460
467
|
size?: IOIconSizeScale | "100%";
|
|
461
468
|
accessible?: boolean;
|
|
469
|
+
allowFontScaling?: boolean;
|
|
462
470
|
};
|
|
463
471
|
|
|
464
472
|
export const AnimatedIcon = ({
|
|
@@ -466,14 +474,22 @@ export const AnimatedIcon = ({
|
|
|
466
474
|
color = IOColors.bluegrey,
|
|
467
475
|
size = 24,
|
|
468
476
|
accessible = false,
|
|
477
|
+
allowFontScaling = false,
|
|
469
478
|
...props
|
|
470
479
|
}: IOAnimatedIconsProps) => {
|
|
480
|
+
const { dynamicFontScale } = useIOFontDynamicScale();
|
|
481
|
+
|
|
471
482
|
const IconElement = IOIcons[name];
|
|
483
|
+
const iconSize =
|
|
484
|
+
allowFontScaling && typeof size === "number"
|
|
485
|
+
? size * dynamicFontScale
|
|
486
|
+
: size;
|
|
487
|
+
|
|
472
488
|
return (
|
|
473
489
|
<IconElement
|
|
474
490
|
{...props}
|
|
475
491
|
style={{ color }}
|
|
476
|
-
size={
|
|
492
|
+
size={iconSize}
|
|
477
493
|
accessible={accessible}
|
|
478
494
|
accessibilityElementsHidden={true}
|
|
479
495
|
accessibilityLabel={""}
|
|
@@ -15,13 +15,12 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
|
15
15
|
import {
|
|
16
16
|
alertEdgeToEdgeInsetTransitionConfig,
|
|
17
17
|
IOColors,
|
|
18
|
-
IOStyles,
|
|
19
18
|
IOVisualCostants,
|
|
20
19
|
useIOTheme
|
|
21
20
|
} from "../../core";
|
|
22
21
|
import { WithTestID } from "../../utils/types";
|
|
23
22
|
import { IconButton } from "../buttons";
|
|
24
|
-
import {
|
|
23
|
+
import { HStack } from "../stack";
|
|
25
24
|
import { H3 } from "../typography";
|
|
26
25
|
import { HeaderActionProps } from "./common";
|
|
27
26
|
|
|
@@ -136,27 +135,18 @@ export const HeaderFirstLevel = ({
|
|
|
136
135
|
{title}
|
|
137
136
|
</H3>
|
|
138
137
|
</View>
|
|
139
|
-
<
|
|
138
|
+
<HStack space={16} style={{ flexShrink: 0 }}>
|
|
140
139
|
{type === "threeActions" && (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
/>
|
|
146
|
-
{/* Ideally, with the "gap" flex property,
|
|
147
|
-
we can get rid of these ugly constructs */}
|
|
148
|
-
<HSpacer size={16} />
|
|
149
|
-
</>
|
|
140
|
+
<IconButton
|
|
141
|
+
{...thirdAction}
|
|
142
|
+
color={backgroundColor === "dark" ? "contrast" : "primary"}
|
|
143
|
+
/>
|
|
150
144
|
)}
|
|
151
145
|
{(type === "twoActions" || type === "threeActions") && (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/>
|
|
157
|
-
{/* Same as above */}
|
|
158
|
-
<HSpacer size={16} />
|
|
159
|
-
</>
|
|
146
|
+
<IconButton
|
|
147
|
+
{...secondAction}
|
|
148
|
+
color={backgroundColor === "dark" ? "contrast" : "primary"}
|
|
149
|
+
/>
|
|
160
150
|
)}
|
|
161
151
|
{type !== "base" && (
|
|
162
152
|
<IconButton
|
|
@@ -164,7 +154,7 @@ export const HeaderFirstLevel = ({
|
|
|
164
154
|
color={backgroundColor === "dark" ? "contrast" : "primary"}
|
|
165
155
|
/>
|
|
166
156
|
)}
|
|
167
|
-
</
|
|
157
|
+
</HStack>
|
|
168
158
|
</View>
|
|
169
159
|
</Animated.View>
|
|
170
160
|
);
|