@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
|
@@ -28,7 +28,7 @@ export declare const IOStyles: {
|
|
|
28
28
|
alignItems: "center";
|
|
29
29
|
};
|
|
30
30
|
horizontalContentPadding: {
|
|
31
|
-
paddingHorizontal: 16 | 24 | 32 | 48
|
|
31
|
+
paddingHorizontal: 16 | 8 | 24 | 32 | 48;
|
|
32
32
|
};
|
|
33
33
|
row: {
|
|
34
34
|
flexDirection: "row";
|
|
@@ -46,7 +46,7 @@ export declare const IOStyles: {
|
|
|
46
46
|
footer: {
|
|
47
47
|
backgroundColor: string;
|
|
48
48
|
paddingBottom: number;
|
|
49
|
-
paddingHorizontal: 16 | 24 | 32 | 48
|
|
49
|
+
paddingHorizontal: 16 | 8 | 24 | 32 | 48;
|
|
50
50
|
paddingTop: number;
|
|
51
51
|
shadowColor: string;
|
|
52
52
|
shadowOffset: {
|
|
@@ -183,8 +183,8 @@ interface IOListItemVisualParams {
|
|
|
183
183
|
export declare const IOListItemVisualParams: IOListItemVisualParams;
|
|
184
184
|
export declare const IOListItemStyles: {
|
|
185
185
|
listItem: {
|
|
186
|
-
paddingVertical: 16 | 4 | 6 |
|
|
187
|
-
paddingHorizontal: 16 | 24 | 32 | 48
|
|
186
|
+
paddingVertical: 16 | 4 | 6 | 20 | 8 | 24 | 12 | 28 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 96;
|
|
187
|
+
paddingHorizontal: 16 | 8 | 24 | 32 | 48;
|
|
188
188
|
marginHorizontal: number;
|
|
189
189
|
};
|
|
190
190
|
listItemInner: {
|
|
@@ -197,7 +197,7 @@ export declare const IOModuleStyles: {
|
|
|
197
197
|
button: {
|
|
198
198
|
borderWidth: number;
|
|
199
199
|
borderColor: string;
|
|
200
|
-
borderRadius: 16 | 6 |
|
|
200
|
+
borderRadius: 16 | 6 | 8 | 24;
|
|
201
201
|
borderCurve: string;
|
|
202
202
|
flexDirection: "row";
|
|
203
203
|
justifyContent: "space-between";
|
|
@@ -243,8 +243,8 @@ interface IOSelectionListItemVisualParams {
|
|
|
243
243
|
export declare const IOSelectionListItemVisualParams: IOSelectionListItemVisualParams;
|
|
244
244
|
export declare const IOSelectionListItemStyles: {
|
|
245
245
|
listItem: {
|
|
246
|
-
paddingVertical: 16 | 4 | 6 |
|
|
247
|
-
paddingHorizontal: 16 | 24 | 32 | 48
|
|
246
|
+
paddingVertical: 16 | 4 | 6 | 20 | 8 | 24 | 12 | 28 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 96;
|
|
247
|
+
paddingHorizontal: 16 | 8 | 24 | 32 | 48;
|
|
248
248
|
marginHorizontal: number;
|
|
249
249
|
};
|
|
250
250
|
listItemInner: {
|
|
@@ -3,4 +3,14 @@
|
|
|
3
3
|
* when bold text is enabled and false otherwise.
|
|
4
4
|
*/
|
|
5
5
|
export declare const useBoldTextEnabled: () => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a font size multiplier based on the font scale of the device,
|
|
8
|
+
* but limited to the `IOFontSizeMultiplier` value.
|
|
9
|
+
* @returns number
|
|
10
|
+
*/
|
|
11
|
+
export declare const useIOFontDynamicScale: () => {
|
|
12
|
+
dynamicFontScale: number;
|
|
13
|
+
spacingScaleMultiplier: number;
|
|
14
|
+
hugeFontEnabled: boolean;
|
|
15
|
+
};
|
|
6
16
|
//# sourceMappingURL=accessibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,eA0B9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;CAmB1B,CAAC"}
|
|
@@ -13,7 +13,7 @@ declare const fonts: {
|
|
|
13
13
|
readonly DMMono: string;
|
|
14
14
|
};
|
|
15
15
|
export type IOFontFamily = keyof typeof fonts;
|
|
16
|
-
declare const allFontSizes: (16 | 12 |
|
|
16
|
+
declare const allFontSizes: (16 | 20 | 12 | 28 | 32 | 14 | 22 | 26 | 17 | 31 | 35)[];
|
|
17
17
|
export type IOFontSize = (typeof allFontSizes)[number];
|
|
18
18
|
declare const weights: readonly ["Thin", "Light", "Regular", "Medium", "Semibold", "Bold", "Black"];
|
|
19
19
|
export type IOFontWeight = (typeof weights)[number];
|
|
@@ -39,6 +39,7 @@ type FontStyleObject = {
|
|
|
39
39
|
* @param isItalic
|
|
40
40
|
*/
|
|
41
41
|
export declare const makeFontFamilyName: (font: IOFontFamily, weight?: IOFontWeight, fontStyle?: TextStyle["fontStyle"]) => string;
|
|
42
|
+
export declare const IOFontSizeMultiplier = 1.5;
|
|
42
43
|
/**
|
|
43
44
|
* Return a {@link FontStyleObject} with the fields filled based on the platform (iOS or Android).
|
|
44
45
|
* @param size
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnD;;GAEG;AACH,QAAA,MAAM,KAAK;;;;CAmBD,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAO9C,QAAA,MAAM,YAAY,0DAAmD,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAMvD,QAAA,MAAM,OAAO,8EAQH,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,QAAA,MAAM,YAAY,4DAA6D,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,mBAAmB,CAQjE,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC;IAG9B,UAAU,EAAE,MAAM,GAAG,YAAY,CAAC;IAClC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAeF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,YAAY,WACV,YAAY,cACT,SAAS,CAAC,WAAW,CAAC,KAChC,MAQC,CAAC;
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnD;;GAEG;AACH,QAAA,MAAM,KAAK;;;;CAmBD,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAO9C,QAAA,MAAM,YAAY,0DAAmD,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAMvD,QAAA,MAAM,OAAO,8EAQH,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,QAAA,MAAM,YAAY,4DAA6D,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,mBAAmB,CAQjE,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC;IAG9B,UAAU,EAAE,MAAM,GAAG,YAAY,CAAC;IAClC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAeF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,YAAY,WACV,YAAY,cACT,SAAS,CAAC,WAAW,CAAC,KAChC,MAQC,CAAC;AAQL,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;;;GAMG;AAEH,eAAO,MAAM,mBAAmB,uGAGlB,SAAS,CAAC,YAAY,CAAC,WAC3B,YAAY,cACT,SAAS,CAAC,WAAW,CAAC,gBACpB,OAAO,KACnB,eAkCF,CAAC"}
|
package/package.json
CHANGED
|
@@ -86,7 +86,7 @@ exports[`Test Advice Components - Experimental Enabled Advice Snapshot 1`] = `
|
|
|
86
86
|
<Text
|
|
87
87
|
allowFontScaling={true}
|
|
88
88
|
dynamicTypeRamp="body"
|
|
89
|
-
maxFontSizeMultiplier={1.
|
|
89
|
+
maxFontSizeMultiplier={1.5}
|
|
90
90
|
style={
|
|
91
91
|
[
|
|
92
92
|
{},
|
|
@@ -190,9 +190,9 @@ exports[`Test Advice Components Advice Snapshot 1`] = `
|
|
|
190
190
|
}
|
|
191
191
|
/>
|
|
192
192
|
<Text
|
|
193
|
-
allowFontScaling={
|
|
193
|
+
allowFontScaling={true}
|
|
194
194
|
dynamicTypeRamp="body"
|
|
195
|
-
maxFontSizeMultiplier={1.
|
|
195
|
+
maxFontSizeMultiplier={1.5}
|
|
196
196
|
style={
|
|
197
197
|
[
|
|
198
198
|
{},
|
|
@@ -3,9 +3,7 @@ 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";
|
|
@@ -13,33 +11,18 @@ import Animated from "react-native-reanimated";
|
|
|
13
11
|
import { IOVisualCostants, useIOThemeContext } from "../../core";
|
|
14
12
|
import { IOColors, hexToRgba } from "../../core/IOColors";
|
|
15
13
|
import { IOAlertRadius } from "../../core/IOShapes";
|
|
16
|
-
import { IOAlertSpacing } from "../../core/IOSpacing";
|
|
14
|
+
import { IOAlertSpacing, IOSpacer } from "../../core/IOSpacing";
|
|
17
15
|
import { useScaleAnimation } from "../../hooks";
|
|
16
|
+
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
18
17
|
import { WithTestID } from "../../utils/types";
|
|
19
18
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
20
|
-
import {
|
|
19
|
+
import { HStack, VStack } from "../stack";
|
|
21
20
|
import { Body, ButtonText } from "../typography";
|
|
22
21
|
import { H4 } from "../typography/H4";
|
|
23
22
|
|
|
24
|
-
const
|
|
23
|
+
const ICON_SIZE: IOIconSizeScale = 24;
|
|
25
24
|
|
|
26
|
-
const [
|
|
27
|
-
|
|
28
|
-
const styles = StyleSheet.create({
|
|
29
|
-
container: {
|
|
30
|
-
flexDirection: "row",
|
|
31
|
-
alignItems: "flex-start",
|
|
32
|
-
alignContent: "center"
|
|
33
|
-
},
|
|
34
|
-
spacingDefault: {
|
|
35
|
-
padding: spacingDefault,
|
|
36
|
-
borderRadius: IOAlertRadius,
|
|
37
|
-
borderCurve: "continuous"
|
|
38
|
-
},
|
|
39
|
-
spacingFullWidth: {
|
|
40
|
-
padding: spacingFullWidth
|
|
41
|
-
}
|
|
42
|
-
});
|
|
25
|
+
const [padding, paddingFullWidth] = IOAlertSpacing;
|
|
43
26
|
|
|
44
27
|
type AlertProps = WithTestID<{
|
|
45
28
|
variant: "error" | "warning" | "info" | "success";
|
|
@@ -140,6 +123,8 @@ export const Alert = forwardRef<View, AlertType>(
|
|
|
140
123
|
): JSX.Element => {
|
|
141
124
|
const { onPressIn, onPressOut, scaleAnimatedStyle } =
|
|
142
125
|
useScaleAnimation("medium");
|
|
126
|
+
const { dynamicFontScale, spacingScaleMultiplier } =
|
|
127
|
+
useIOFontDynamicScale();
|
|
143
128
|
const { themeType } = useIOThemeContext();
|
|
144
129
|
|
|
145
130
|
const [isMultiline, setIsMultiline] = useState(false);
|
|
@@ -151,54 +136,53 @@ export const Alert = forwardRef<View, AlertType>(
|
|
|
151
136
|
[]
|
|
152
137
|
);
|
|
153
138
|
|
|
139
|
+
const paddingDefaultVariant = {
|
|
140
|
+
padding,
|
|
141
|
+
borderRadius: IOAlertRadius * dynamicFontScale * spacingScaleMultiplier,
|
|
142
|
+
borderCurve: "continuous"
|
|
143
|
+
};
|
|
144
|
+
|
|
154
145
|
const mapVariantStates =
|
|
155
146
|
themeType === "light"
|
|
156
147
|
? mapVariantStatesLightMode
|
|
157
148
|
: mapVariantStatesDarkMode;
|
|
158
149
|
|
|
159
150
|
const renderMainBlock = () => (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/>
|
|
172
|
-
</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
|
+
/>
|
|
173
162
|
{/* Sadly we don't have specific alignments style for text
|
|
174
163
|
in React Native, like `text-box-trim` for CSS. So we
|
|
175
164
|
have to put these magic numbers after manual adjustments.
|
|
176
165
|
Tested on both Android and iOS. */}
|
|
177
166
|
<View
|
|
178
167
|
style={[
|
|
179
|
-
!title &&
|
|
180
|
-
|
|
181
|
-
isMultiline && { marginBottom: -3 * PixelRatio.getFontScale() },
|
|
168
|
+
!title && isMultiline && { marginTop: -6 * dynamicFontScale },
|
|
169
|
+
isMultiline && { marginBottom: -4 * dynamicFontScale },
|
|
182
170
|
{ flex: 1 }
|
|
183
171
|
]}
|
|
184
172
|
>
|
|
185
|
-
{
|
|
186
|
-
|
|
173
|
+
<VStack space={8} allowScaleSpacing>
|
|
174
|
+
{title && (
|
|
187
175
|
<H4 color={mapVariantStates[variant].foreground}>{title}</H4>
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
{
|
|
198
|
-
</Body>
|
|
199
|
-
{action && (
|
|
200
|
-
<>
|
|
201
|
-
<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 && (
|
|
202
186
|
<ButtonText
|
|
203
187
|
color={mapVariantStates[variant].foreground}
|
|
204
188
|
numberOfLines={1}
|
|
@@ -206,18 +190,17 @@ export const Alert = forwardRef<View, AlertType>(
|
|
|
206
190
|
>
|
|
207
191
|
{action}
|
|
208
192
|
</ButtonText>
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
)}
|
|
194
|
+
</VStack>
|
|
211
195
|
</View>
|
|
212
|
-
|
|
196
|
+
</HStack>
|
|
213
197
|
);
|
|
214
198
|
|
|
215
199
|
const StaticComponent = () => (
|
|
216
200
|
<View
|
|
217
201
|
ref={viewRef}
|
|
218
202
|
style={[
|
|
219
|
-
|
|
220
|
-
fullWidth ? styles.spacingFullWidth : styles.spacingDefault,
|
|
203
|
+
fullWidth ? { padding } : paddingDefaultVariant,
|
|
221
204
|
{ backgroundColor: mapVariantStates[variant].background }
|
|
222
205
|
]}
|
|
223
206
|
testID={testID}
|
|
@@ -244,8 +227,7 @@ export const Alert = forwardRef<View, AlertType>(
|
|
|
244
227
|
>
|
|
245
228
|
<Animated.View
|
|
246
229
|
style={[
|
|
247
|
-
|
|
248
|
-
fullWidth ? styles.spacingFullWidth : styles.spacingDefault,
|
|
230
|
+
fullWidth ? { padding: paddingFullWidth } : paddingDefaultVariant,
|
|
249
231
|
{ backgroundColor: mapVariantStates[variant].background },
|
|
250
232
|
// Disable pressed animation when component is full width
|
|
251
233
|
!fullWidth && scaleAnimatedStyle
|
|
@@ -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
|
[
|
|
@@ -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
|
[
|
|
@@ -90,6 +90,7 @@ const mapLegacyColorStates: Record<
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
const DISABLED_OPACITY = 0.5;
|
|
93
|
+
const ICON_MARGIN = 8;
|
|
93
94
|
|
|
94
95
|
export const ButtonLink = forwardRef<View, ButtonLinkProps>(
|
|
95
96
|
(
|
|
@@ -156,6 +157,7 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
|
|
|
156
157
|
iconPosition === "end" && { flexDirection: "row-reverse" },
|
|
157
158
|
{ columnGap: iconMargin },
|
|
158
159
|
disabled ? { opacity: DISABLED_OPACITY } : {},
|
|
160
|
+
{ columnGap: ICON_MARGIN },
|
|
159
161
|
/* Prevent Reanimated from overriding background colors
|
|
160
162
|
if button is disabled */
|
|
161
163
|
!disabled && !reducedMotion && scaleAnimatedStyle
|
|
@@ -164,6 +166,7 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
|
|
|
164
166
|
{icon &&
|
|
165
167
|
(!disabled ? (
|
|
166
168
|
<AnimatedIconClassComponent
|
|
169
|
+
allowFontScaling
|
|
167
170
|
name={icon}
|
|
168
171
|
animatedProps={pressedColorAnimationStyle}
|
|
169
172
|
color={colorMap[color]?.label?.default}
|
|
@@ -171,6 +174,7 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
|
|
|
171
174
|
/>
|
|
172
175
|
) : (
|
|
173
176
|
<AnimatedIcon
|
|
177
|
+
allowFontScaling
|
|
174
178
|
name={icon}
|
|
175
179
|
color={colorMap[color]?.label?.disabled}
|
|
176
180
|
size={iconSize}
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
IOIcons,
|
|
27
27
|
IconClassComponent
|
|
28
28
|
} from "../icons";
|
|
29
|
-
import { HSpacer } from "../spacer/Spacer";
|
|
30
29
|
import { IOText, buttonTextFontSize } from "../typography";
|
|
31
30
|
|
|
32
31
|
type ColorButtonOutline = "primary" | "contrast" | "danger";
|
|
@@ -185,11 +184,6 @@ const mapLegacyColorStates: Record<
|
|
|
185
184
|
}
|
|
186
185
|
};
|
|
187
186
|
|
|
188
|
-
// Icon size
|
|
189
|
-
const iconSize: IOIconSizeScale = 20;
|
|
190
|
-
|
|
191
|
-
const DISABLED_OPACITY = 0.5;
|
|
192
|
-
|
|
193
187
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
194
188
|
const IOButtonLegacyStylesLocal = StyleSheet.create({
|
|
195
189
|
buttonWithBorder: {
|
|
@@ -197,6 +191,12 @@ const IOButtonLegacyStylesLocal = StyleSheet.create({
|
|
|
197
191
|
}
|
|
198
192
|
});
|
|
199
193
|
|
|
194
|
+
// Icon size
|
|
195
|
+
const iconSize: IOIconSizeScale = 20;
|
|
196
|
+
|
|
197
|
+
const DISABLED_OPACITY = 0.5;
|
|
198
|
+
const ICON_MARGIN = 8;
|
|
199
|
+
|
|
200
200
|
const IOButtonStylesLocal = StyleSheet.create({
|
|
201
201
|
buttonWithBorder: {
|
|
202
202
|
borderWidth: 2
|
|
@@ -303,6 +303,7 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
|
|
|
303
303
|
isExperimental && fullWidth && { paddingHorizontal: 16 },
|
|
304
304
|
buttonStylesLocal.buttonWithBorder,
|
|
305
305
|
buttonStyles.buttonSizeDefault,
|
|
306
|
+
{ columnGap: ICON_MARGIN },
|
|
306
307
|
iconPosition === "end" && { flexDirection: "row-reverse" },
|
|
307
308
|
disabled
|
|
308
309
|
? {
|
|
@@ -320,25 +321,23 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
|
|
|
320
321
|
!disabled && pressedAnimationStyle
|
|
321
322
|
]}
|
|
322
323
|
>
|
|
323
|
-
{icon &&
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
</>
|
|
341
|
-
)}
|
|
324
|
+
{icon &&
|
|
325
|
+
(!disabled ? (
|
|
326
|
+
<AnimatedIconClassComponent
|
|
327
|
+
allowFontScaling
|
|
328
|
+
name={icon}
|
|
329
|
+
animatedProps={pressedColorIconAnimationStyle}
|
|
330
|
+
color={colorMap[color]?.label?.default}
|
|
331
|
+
size={iconSize}
|
|
332
|
+
/>
|
|
333
|
+
) : (
|
|
334
|
+
<AnimatedIcon
|
|
335
|
+
allowFontScaling
|
|
336
|
+
name={icon}
|
|
337
|
+
color={colorMap[color]?.label?.disabled}
|
|
338
|
+
size={iconSize}
|
|
339
|
+
/>
|
|
340
|
+
))}
|
|
342
341
|
<AnimatedIOText
|
|
343
342
|
font={isExperimental ? "Titillio" : "TitilliumSansPro"}
|
|
344
343
|
weight={"Semibold"}
|
|
@@ -24,7 +24,6 @@ import { useScaleAnimation } from "../../hooks";
|
|
|
24
24
|
import { WithTestID } from "../../utils/types";
|
|
25
25
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
26
26
|
import { LoadingSpinner } from "../loadingSpinner";
|
|
27
|
-
import { HSpacer } from "../spacer/Spacer";
|
|
28
27
|
import { ButtonText } from "../typography/ButtonText";
|
|
29
28
|
|
|
30
29
|
export type ButtonSolidColor = "primary" | "danger" | "contrast";
|
|
@@ -48,6 +47,7 @@ const legacyStyles = StyleSheet.create({
|
|
|
48
47
|
});
|
|
49
48
|
|
|
50
49
|
const colorPrimaryButtonDisabled: IOColors = "grey-200";
|
|
50
|
+
const ICON_MARGIN = 8;
|
|
51
51
|
const DISABLED_OPACITY = 0.5;
|
|
52
52
|
|
|
53
53
|
// Icon size
|
|
@@ -266,19 +266,20 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
|
|
|
266
266
|
<Animated.View
|
|
267
267
|
style={[
|
|
268
268
|
buttonStyles.buttonInner,
|
|
269
|
+
{ columnGap: ICON_MARGIN },
|
|
270
|
+
/* If 'iconPosition' is set to 'end', we use
|
|
271
|
+
reverse flex property to invert the position */
|
|
269
272
|
iconPosition === "end" && { flexDirection: "row-reverse" }
|
|
270
273
|
]}
|
|
271
274
|
entering={enterTransitionInnerContent}
|
|
272
275
|
>
|
|
273
276
|
{icon && (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
{
|
|
279
|
-
|
|
280
|
-
<HSpacer size={8} />
|
|
281
|
-
</>
|
|
277
|
+
<Icon
|
|
278
|
+
allowFontScaling
|
|
279
|
+
name={icon}
|
|
280
|
+
size={iconSize}
|
|
281
|
+
color={foregroundColor}
|
|
282
|
+
/>
|
|
282
283
|
)}
|
|
283
284
|
<ButtonText
|
|
284
285
|
color={foregroundColor}
|
|
@@ -160,6 +160,7 @@ export const IconButton = ({
|
|
|
160
160
|
>
|
|
161
161
|
{!disabled ? (
|
|
162
162
|
<AnimatedIconClassComponent
|
|
163
|
+
allowFontScaling
|
|
163
164
|
name={icon}
|
|
164
165
|
size={iconSize}
|
|
165
166
|
animatedProps={animatedColor}
|
|
@@ -167,6 +168,7 @@ export const IconButton = ({
|
|
|
167
168
|
/>
|
|
168
169
|
) : (
|
|
169
170
|
<AnimatedIcon
|
|
171
|
+
allowFontScaling
|
|
170
172
|
name={icon}
|
|
171
173
|
size={iconSize}
|
|
172
174
|
color={colorMap[color]?.icon?.disabled}
|