@pagopa/io-app-design-system 4.4.2 → 5.0.0-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 +1 -1
- package/lib/commonjs/components/accordion/index.js +0 -11
- package/lib/commonjs/components/accordion/index.js.map +1 -1
- package/lib/commonjs/components/badge/Badge.js +4 -4
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
- package/lib/commonjs/components/banner/Banner.js +4 -4
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
- package/lib/commonjs/components/buttons/ButtonLink.js +25 -32
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +18 -86
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +9 -53
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +6 -36
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +5 -50
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +5 -36
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +5 -15
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +2 -9
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/commonjs/components/layout/FooterActions.js +1 -5
- package/lib/commonjs/components/layout/FooterActions.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +3 -3
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/layout/ModalBSHeader.js +3 -15
- package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -4
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js +1 -4
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
- package/lib/commonjs/components/modules/ModuleIDP.js +4 -5
- package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
- package/lib/commonjs/components/numberpad/NumberButton.js +3 -18
- package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
- package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
- package/lib/commonjs/components/radio/AnimatedRadio.js +4 -14
- package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/commonjs/components/searchInput/SearchInput.js +6 -10
- package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
- package/lib/commonjs/components/stepper/Stepper.js +1 -10
- package/lib/commonjs/components/stepper/Stepper.js.map +1 -1
- package/lib/commonjs/components/switch/NativeSwitch.js +2 -15
- package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +6 -46
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +4 -4
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +10 -20
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/typography/Body.js +4 -6
- package/lib/commonjs/components/typography/Body.js.map +1 -1
- package/lib/commonjs/components/typography/BodySmall.js +3 -3
- package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
- package/lib/commonjs/components/typography/ButtonText.js +6 -7
- package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
- package/lib/commonjs/components/typography/Caption.js +6 -12
- package/lib/commonjs/components/typography/Caption.js.map +1 -1
- package/lib/commonjs/components/typography/H1.js +6 -13
- package/lib/commonjs/components/typography/H1.js.map +1 -1
- package/lib/commonjs/components/typography/H2.js +8 -17
- package/lib/commonjs/components/typography/H2.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +4 -8
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H4.js +7 -14
- package/lib/commonjs/components/typography/H4.js.map +1 -1
- package/lib/commonjs/components/typography/H5.js +5 -10
- package/lib/commonjs/components/typography/H5.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js +7 -10
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/Hero.js +8 -17
- package/lib/commonjs/components/typography/Hero.js.map +1 -1
- package/lib/commonjs/components/typography/LabelMini.js +4 -6
- package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
- package/lib/commonjs/components/typography/markdown/MdH1.js +3 -3
- package/lib/commonjs/components/typography/markdown/MdH1.js.map +1 -1
- package/lib/commonjs/components/typography/markdown/MdH2.js +3 -3
- package/lib/commonjs/components/typography/markdown/MdH2.js.map +1 -1
- package/lib/commonjs/components/typography/markdown/MdH3.js +3 -3
- package/lib/commonjs/components/typography/markdown/MdH3.js.map +1 -1
- package/lib/commonjs/core/IOColors.js +1 -8
- package/lib/commonjs/core/IOColors.js.map +1 -1
- package/lib/commonjs/core/IODSExperimentalContextProvider.js +4 -3
- package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/commonjs/core/IONewTypefaceContextProvider.js +33 -0
- package/lib/commonjs/core/IONewTypefaceContextProvider.js.map +1 -0
- package/lib/commonjs/core/IOStyles.js +1 -49
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/commonjs/core/IOThemeContextProvider.js +4 -15
- package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -1
- package/lib/commonjs/core/index.js +11 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
- package/lib/module/components/accordion/index.js +0 -1
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/badge/Badge.js +5 -5
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
- package/lib/module/components/banner/Banner.js +5 -5
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
- package/lib/module/components/buttons/ButtonLink.js +28 -35
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +19 -87
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +10 -54
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +6 -37
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +6 -51
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +6 -37
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
- package/lib/module/components/checkbox/AnimatedCheckbox.js +6 -16
- package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +3 -10
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/module/components/layout/FooterActions.js +2 -6
- package/lib/module/components/layout/FooterActions.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +4 -4
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/layout/ModalBSHeader.js +5 -17
- package/lib/module/components/layout/ModalBSHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +2 -5
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js +2 -5
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
- package/lib/module/components/modules/ModuleIDP.js +4 -5
- package/lib/module/components/modules/ModuleIDP.js.map +1 -1
- package/lib/module/components/numberpad/NumberButton.js +5 -20
- package/lib/module/components/numberpad/NumberButton.js.map +1 -1
- package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
- package/lib/module/components/radio/AnimatedRadio.js +5 -15
- package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/module/components/searchInput/SearchInput.js +7 -11
- package/lib/module/components/searchInput/SearchInput.js.map +1 -1
- package/lib/module/components/stepper/Stepper.js +2 -11
- package/lib/module/components/stepper/Stepper.js.map +1 -1
- package/lib/module/components/switch/NativeSwitch.js +3 -16
- package/lib/module/components/switch/NativeSwitch.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +7 -47
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tag/Tag.js +5 -5
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +11 -21
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/typography/Body.js +5 -7
- package/lib/module/components/typography/Body.js.map +1 -1
- package/lib/module/components/typography/BodySmall.js +4 -4
- package/lib/module/components/typography/BodySmall.js.map +1 -1
- package/lib/module/components/typography/ButtonText.js +7 -8
- package/lib/module/components/typography/ButtonText.js.map +1 -1
- package/lib/module/components/typography/Caption.js +6 -12
- package/lib/module/components/typography/Caption.js.map +1 -1
- package/lib/module/components/typography/H1.js +6 -13
- package/lib/module/components/typography/H1.js.map +1 -1
- package/lib/module/components/typography/H2.js +8 -17
- package/lib/module/components/typography/H2.js.map +1 -1
- package/lib/module/components/typography/H3.js +4 -8
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H4.js +7 -14
- package/lib/module/components/typography/H4.js.map +1 -1
- package/lib/module/components/typography/H5.js +6 -11
- package/lib/module/components/typography/H5.js.map +1 -1
- package/lib/module/components/typography/H6.js +7 -10
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/Hero.js +8 -17
- package/lib/module/components/typography/Hero.js.map +1 -1
- package/lib/module/components/typography/LabelMini.js +5 -7
- package/lib/module/components/typography/LabelMini.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
- package/lib/module/components/typography/markdown/MdH1.js +4 -4
- package/lib/module/components/typography/markdown/MdH1.js.map +1 -1
- package/lib/module/components/typography/markdown/MdH2.js +4 -4
- package/lib/module/components/typography/markdown/MdH2.js.map +1 -1
- package/lib/module/components/typography/markdown/MdH3.js +4 -4
- package/lib/module/components/typography/markdown/MdH3.js.map +1 -1
- package/lib/module/core/IOColors.js +0 -6
- package/lib/module/core/IOColors.js.map +1 -1
- package/lib/module/core/IODSExperimentalContextProvider.js +2 -2
- package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/module/core/IONewTypefaceContextProvider.js +22 -0
- package/lib/module/core/IONewTypefaceContextProvider.js.map +1 -0
- package/lib/module/core/IOStyles.js +0 -46
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/module/core/IOThemeContextProvider.js +3 -12
- package/lib/module/core/IOThemeContextProvider.js.map +1 -1
- package/lib/module/core/index.js +1 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/typescript/components/accordion/index.d.ts +0 -1
- package/lib/typescript/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +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.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/layout/FooterActions.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
- package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
- package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
- package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
- package/lib/typescript/components/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
- package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
- package/lib/typescript/components/typography/H1.d.ts.map +1 -1
- package/lib/typescript/components/typography/H2.d.ts +0 -3
- package/lib/typescript/components/typography/H2.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H4.d.ts.map +1 -1
- package/lib/typescript/components/typography/H5.d.ts.map +1 -1
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
- package/lib/typescript/core/IOColors.d.ts +0 -1
- package/lib/typescript/core/IOColors.d.ts.map +1 -1
- package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
- package/lib/typescript/core/IONewTypefaceContextProvider.d.ts +16 -0
- package/lib/typescript/core/IONewTypefaceContextProvider.d.ts.map +1 -0
- package/lib/typescript/core/IOStyles.d.ts +2 -32
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/lib/typescript/core/IOThemeContextProvider.d.ts +0 -4
- package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +1 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/utils/fonts.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
- package/src/components/accordion/index.tsx +0 -1
- package/src/components/badge/Badge.tsx +3 -3
- package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
- package/src/components/banner/Banner.tsx +3 -4
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
- package/src/components/buttons/ButtonLink.tsx +38 -41
- package/src/components/buttons/ButtonOutline.tsx +31 -103
- package/src/components/buttons/ButtonSolid.tsx +11 -69
- package/src/components/buttons/IconButton.tsx +5 -49
- package/src/components/buttons/IconButtonContained.tsx +11 -58
- package/src/components/buttons/IconButtonSolid.tsx +9 -47
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
- package/src/components/checkbox/AnimatedCheckbox.tsx +6 -34
- package/src/components/checkbox/AnimatedMessageCheckbox.tsx +3 -14
- package/src/components/layout/FooterActions.tsx +1 -4
- package/src/components/layout/HeaderSecondLevel.tsx +4 -3
- package/src/components/layout/ModalBSHeader.tsx +11 -29
- package/src/components/listitems/ListItemNavAlert.tsx +1 -4
- package/src/components/listitems/ListItemTransaction.tsx +1 -5
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
- package/src/components/modules/ModuleIDP.tsx +3 -8
- package/src/components/numberpad/NumberButton.tsx +4 -27
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
- package/src/components/radio/AnimatedRadio.tsx +5 -33
- package/src/components/searchInput/SearchInput.tsx +11 -20
- package/src/components/stepper/Stepper.tsx +2 -20
- package/src/components/switch/NativeSwitch.tsx +3 -21
- package/src/components/tabs/TabItem.tsx +14 -61
- package/src/components/tag/Tag.tsx +3 -3
- package/src/components/textInput/TextInputBase.tsx +19 -34
- package/src/components/typography/Body.tsx +4 -11
- package/src/components/typography/BodySmall.tsx +3 -3
- package/src/components/typography/ButtonText.tsx +6 -8
- package/src/components/typography/Caption.tsx +6 -13
- package/src/components/typography/H1.tsx +6 -14
- package/src/components/typography/H2.tsx +8 -18
- package/src/components/typography/H3.tsx +4 -8
- package/src/components/typography/H4.tsx +7 -15
- package/src/components/typography/H5.tsx +6 -14
- package/src/components/typography/H6.tsx +7 -11
- package/src/components/typography/Hero.tsx +8 -18
- package/src/components/typography/LabelMini.tsx +4 -11
- package/src/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
- package/src/components/typography/markdown/MdH1.tsx +3 -3
- package/src/components/typography/markdown/MdH2.tsx +3 -3
- package/src/components/typography/markdown/MdH3.tsx +3 -3
- package/src/core/IOColors.ts +0 -7
- package/src/core/IODSExperimentalContextProvider.tsx +2 -2
- package/src/core/IONewTypefaceContextProvider.tsx +37 -0
- package/src/core/IOStyles.ts +0 -52
- package/src/core/IOThemeContextProvider.tsx +3 -16
- package/src/core/index.ts +1 -0
- package/lib/commonjs/components/accordion/RawAccordion.js +0 -93
- package/lib/commonjs/components/accordion/RawAccordion.js.map +0 -1
- package/lib/module/components/accordion/RawAccordion.js +0 -86
- package/lib/module/components/accordion/RawAccordion.js.map +0 -1
- package/lib/typescript/components/accordion/RawAccordion.d.ts +0 -17
- package/lib/typescript/components/accordion/RawAccordion.d.ts.map +0 -1
- package/src/components/accordion/RawAccordion.tsx +0 -116
|
@@ -9,12 +9,7 @@ import Animated, {
|
|
|
9
9
|
useSharedValue,
|
|
10
10
|
withSpring
|
|
11
11
|
} from "react-native-reanimated";
|
|
12
|
-
import {
|
|
13
|
-
IOColors,
|
|
14
|
-
IOSpringValues,
|
|
15
|
-
hexToRgba,
|
|
16
|
-
useIOExperimentalDesign
|
|
17
|
-
} from "../../core";
|
|
12
|
+
import { IOColors, IOSpringValues, hexToRgba } from "../../core";
|
|
18
13
|
import { useScaleAnimation } from "../../hooks";
|
|
19
14
|
import { WithTestID } from "../../utils/types";
|
|
20
15
|
import { IOIcons, Icon } from "../icons";
|
|
@@ -93,46 +88,6 @@ const mapColorStates: Record<NonNullable<TabItem["color"]>, ColorStates> = {
|
|
|
93
88
|
}
|
|
94
89
|
};
|
|
95
90
|
|
|
96
|
-
const mapLegacyColorStates: Record<
|
|
97
|
-
NonNullable<TabItem["color"]>,
|
|
98
|
-
ColorStates
|
|
99
|
-
> = {
|
|
100
|
-
light: {
|
|
101
|
-
border: {
|
|
102
|
-
default: IOColors["grey-300"],
|
|
103
|
-
selected: IOColors.blue,
|
|
104
|
-
disabled: hexToRgba(IOColors.white)
|
|
105
|
-
},
|
|
106
|
-
background: {
|
|
107
|
-
default: IOColors.white,
|
|
108
|
-
selected: hexToRgba(IOColors.blue, 0.1),
|
|
109
|
-
pressed: IOColors.white
|
|
110
|
-
},
|
|
111
|
-
foreground: {
|
|
112
|
-
default: "black",
|
|
113
|
-
selected: "blue",
|
|
114
|
-
disabled: "grey-700"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
dark: {
|
|
118
|
-
border: {
|
|
119
|
-
default: hexToRgba(IOColors.white, 0),
|
|
120
|
-
selected: IOColors.white,
|
|
121
|
-
disabled: hexToRgba(IOColors.white, 0.5)
|
|
122
|
-
},
|
|
123
|
-
background: {
|
|
124
|
-
default: "#ffffff00",
|
|
125
|
-
selected: IOColors.white,
|
|
126
|
-
pressed: IOColors.white
|
|
127
|
-
},
|
|
128
|
-
foreground: {
|
|
129
|
-
default: "white",
|
|
130
|
-
selected: "black",
|
|
131
|
-
disabled: "white"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
91
|
const TabItem = ({
|
|
137
92
|
label,
|
|
138
93
|
color = "light",
|
|
@@ -150,29 +105,24 @@ const TabItem = ({
|
|
|
150
105
|
useScaleAnimation();
|
|
151
106
|
const reducedMotion = useReducedMotion();
|
|
152
107
|
|
|
153
|
-
const { isExperimental } = useIOExperimentalDesign();
|
|
154
|
-
const colors = useMemo(
|
|
155
|
-
() =>
|
|
156
|
-
isExperimental ? mapColorStates[color] : mapLegacyColorStates[color],
|
|
157
|
-
[isExperimental, color]
|
|
158
|
-
);
|
|
159
|
-
|
|
160
108
|
const foregroundColor = useMemo(
|
|
161
109
|
() =>
|
|
162
|
-
|
|
110
|
+
mapColorStates[color].foreground[
|
|
163
111
|
selected ? "selected" : disabled ? "disabled" : "default"
|
|
164
112
|
],
|
|
165
|
-
[
|
|
113
|
+
[color, selected, disabled]
|
|
166
114
|
);
|
|
167
115
|
|
|
168
116
|
const borderColor = useMemo(
|
|
169
117
|
() =>
|
|
170
|
-
|
|
171
|
-
|
|
118
|
+
mapColorStates[color].border[
|
|
119
|
+
selected ? "selected" : disabled ? "disabled" : "default"
|
|
120
|
+
],
|
|
121
|
+
[color, selected, disabled]
|
|
172
122
|
);
|
|
173
123
|
|
|
174
124
|
const opaquePressedBackgroundColor = hexToRgba(
|
|
175
|
-
|
|
125
|
+
mapColorStates[color].background.pressed,
|
|
176
126
|
0.1
|
|
177
127
|
);
|
|
178
128
|
|
|
@@ -192,19 +142,22 @@ const TabItem = ({
|
|
|
192
142
|
const pressedBackgroundColor = interpolateColor(
|
|
193
143
|
progress.value,
|
|
194
144
|
[0, 1],
|
|
195
|
-
[
|
|
145
|
+
[mapColorStates[color].background.default, opaquePressedBackgroundColor]
|
|
196
146
|
);
|
|
197
147
|
|
|
198
148
|
const selectedBackgroundColor = interpolateColor(
|
|
199
149
|
progressSelected.value,
|
|
200
150
|
[0, 1],
|
|
201
|
-
[opaquePressedBackgroundColor,
|
|
151
|
+
[opaquePressedBackgroundColor, mapColorStates[color].background.selected]
|
|
202
152
|
);
|
|
203
153
|
|
|
204
154
|
const selectedBorderColor = interpolateColor(
|
|
205
155
|
progressSelected.value,
|
|
206
156
|
[0, 1],
|
|
207
|
-
[
|
|
157
|
+
[
|
|
158
|
+
mapColorStates[color].border.default,
|
|
159
|
+
mapColorStates[color].border.selected
|
|
160
|
+
]
|
|
208
161
|
);
|
|
209
162
|
|
|
210
163
|
return {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
IOTagRadius,
|
|
6
6
|
IOTheme,
|
|
7
7
|
IOThemeLight,
|
|
8
|
-
|
|
8
|
+
useIONewTypeface,
|
|
9
9
|
useIOTheme
|
|
10
10
|
} from "../../core";
|
|
11
11
|
import {
|
|
@@ -159,8 +159,8 @@ export const Tag = ({
|
|
|
159
159
|
forceLightMode = false
|
|
160
160
|
}: Tag) => {
|
|
161
161
|
const theme = useIOTheme();
|
|
162
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
162
163
|
const { dynamicFontScale, spacingScaleMultiplier } = useIOFontDynamicScale();
|
|
163
|
-
const { isExperimental } = useIOExperimentalDesign();
|
|
164
164
|
|
|
165
165
|
const variantProps = getVariantProps(variant, icon);
|
|
166
166
|
|
|
@@ -207,7 +207,7 @@ export const Tag = ({
|
|
|
207
207
|
{text && (
|
|
208
208
|
<IOText
|
|
209
209
|
allowFontScaling={allowFontScaling}
|
|
210
|
-
font={
|
|
210
|
+
font={newTypefaceEnabled ? "Titillio" : "TitilliumSansPro"}
|
|
211
211
|
weight={"Semibold"}
|
|
212
212
|
size={12}
|
|
213
213
|
lineHeight={16}
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
IOColors,
|
|
24
24
|
IOSpacingScale,
|
|
25
25
|
hexToRgba,
|
|
26
|
-
|
|
26
|
+
useIONewTypeface,
|
|
27
27
|
useIOTheme
|
|
28
28
|
} from "../../core";
|
|
29
29
|
import { useIOFontDynamicScale } from "../../utils/accessibility";
|
|
@@ -106,37 +106,12 @@ const styles = StyleSheet.create({
|
|
|
106
106
|
to align to the label */
|
|
107
107
|
...(Platform.OS === "android" && { marginLeft: -4 })
|
|
108
108
|
},
|
|
109
|
-
textInputStyleFont: {
|
|
110
|
-
...makeFontStyleObject(inputLabelFontSize, "Titillio", undefined, "Medium")
|
|
111
|
-
},
|
|
112
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
113
|
-
textInputStyleLegacyFont: {
|
|
114
|
-
...makeFontStyleObject(
|
|
115
|
-
inputLabelFontSize,
|
|
116
|
-
"TitilliumSansPro",
|
|
117
|
-
undefined,
|
|
118
|
-
"Semibold"
|
|
119
|
-
)
|
|
120
|
-
},
|
|
121
109
|
textInputLabelWrapper: {
|
|
122
110
|
position: "absolute",
|
|
123
111
|
zIndex: 10,
|
|
124
112
|
bottom: 0,
|
|
125
113
|
top: 0,
|
|
126
114
|
justifyContent: "center"
|
|
127
|
-
},
|
|
128
|
-
textInputLabel: {
|
|
129
|
-
color: inputLabelColor,
|
|
130
|
-
...makeFontStyleObject(inputLabelFontSize, "Titillio", undefined, "Regular")
|
|
131
|
-
},
|
|
132
|
-
textInputLabelLegacyFont: {
|
|
133
|
-
color: inputLabelColor,
|
|
134
|
-
...makeFontStyleObject(
|
|
135
|
-
inputLabelFontSize,
|
|
136
|
-
"TitilliumSansPro",
|
|
137
|
-
undefined,
|
|
138
|
-
"Regular"
|
|
139
|
-
)
|
|
140
115
|
}
|
|
141
116
|
});
|
|
142
117
|
|
|
@@ -234,6 +209,7 @@ export const TextInputBase = ({
|
|
|
234
209
|
const { dynamicFontScale, spacingScaleMultiplier } = useIOFontDynamicScale();
|
|
235
210
|
|
|
236
211
|
const theme = useIOTheme();
|
|
212
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
237
213
|
|
|
238
214
|
/* Get the label width to enable the correct translation */
|
|
239
215
|
const [labelWidth, setLabelWidth] = React.useState<number>(0);
|
|
@@ -359,8 +335,6 @@ export const TextInputBase = ({
|
|
|
359
335
|
[value, derivedInputProps]
|
|
360
336
|
);
|
|
361
337
|
|
|
362
|
-
const { isExperimental } = useIOExperimentalDesign();
|
|
363
|
-
|
|
364
338
|
return (
|
|
365
339
|
<>
|
|
366
340
|
<Pressable
|
|
@@ -426,10 +400,15 @@ export const TextInputBase = ({
|
|
|
426
400
|
blurOnSubmit={true}
|
|
427
401
|
onChangeText={onChangeTextHandler}
|
|
428
402
|
style={[
|
|
403
|
+
{
|
|
404
|
+
...makeFontStyleObject(
|
|
405
|
+
inputLabelFontSize,
|
|
406
|
+
newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
407
|
+
undefined,
|
|
408
|
+
"Regular"
|
|
409
|
+
)
|
|
410
|
+
},
|
|
429
411
|
styles.textInputStyle,
|
|
430
|
-
isExperimental
|
|
431
|
-
? styles.textInputStyleFont
|
|
432
|
-
: styles.textInputStyleLegacyFont,
|
|
433
412
|
!disabled
|
|
434
413
|
? { color: inputTextColor }
|
|
435
414
|
: { color: inputDisabledTextColor }
|
|
@@ -464,9 +443,15 @@ export const TextInputBase = ({
|
|
|
464
443
|
numberOfLines={1}
|
|
465
444
|
accessible={false}
|
|
466
445
|
style={[
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
446
|
+
{
|
|
447
|
+
...makeFontStyleObject(
|
|
448
|
+
inputLabelFontSize,
|
|
449
|
+
newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
450
|
+
undefined,
|
|
451
|
+
"Regular"
|
|
452
|
+
),
|
|
453
|
+
color: inputLabelColor
|
|
454
|
+
},
|
|
470
455
|
animatedLabelStyle
|
|
471
456
|
]}
|
|
472
457
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
4
|
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
5
5
|
import {
|
|
6
6
|
IOText,
|
|
@@ -17,10 +17,7 @@ export const bodyFontSize = 16;
|
|
|
17
17
|
export const bodyLineHeight = 24;
|
|
18
18
|
|
|
19
19
|
const fontName: IOFontFamily = "Titillio";
|
|
20
|
-
const fontWeight: IOFontWeight = "Regular";
|
|
21
|
-
|
|
22
20
|
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
23
|
-
const legacyFontWeight: IOFontWeight = "Regular";
|
|
24
21
|
|
|
25
22
|
/**
|
|
26
23
|
* `Body` typographic style
|
|
@@ -31,7 +28,7 @@ export const Body = forwardRef<View, BodyStyleProps>(
|
|
|
31
28
|
ref?: ForwardedRef<View>
|
|
32
29
|
) => {
|
|
33
30
|
const theme = useIOTheme();
|
|
34
|
-
const {
|
|
31
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
35
32
|
|
|
36
33
|
const defaultColor = asLink
|
|
37
34
|
? theme["interactiveElem-default"]
|
|
@@ -40,12 +37,8 @@ export const Body = forwardRef<View, BodyStyleProps>(
|
|
|
40
37
|
const BodyProps: IOTextProps = {
|
|
41
38
|
...props,
|
|
42
39
|
dynamicTypeRamp: "body", // iOS only
|
|
43
|
-
font:
|
|
44
|
-
weight: customWeight
|
|
45
|
-
? customWeight
|
|
46
|
-
: isExperimental
|
|
47
|
-
? fontWeight
|
|
48
|
-
: legacyFontWeight,
|
|
40
|
+
font: newTypefaceEnabled ? fontName : legacyFontName,
|
|
41
|
+
weight: customWeight ? customWeight : "Regular",
|
|
49
42
|
size: bodyFontSize,
|
|
50
43
|
lineHeight: bodyLineHeight,
|
|
51
44
|
color: customColor ?? defaultColor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
4
|
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
5
5
|
import {
|
|
6
6
|
IOText,
|
|
@@ -25,7 +25,7 @@ export const BodySmall = forwardRef<View, BodySmallProps>(
|
|
|
25
25
|
ref?: ForwardedRef<View>
|
|
26
26
|
) => {
|
|
27
27
|
const theme = useIOTheme();
|
|
28
|
-
const {
|
|
28
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
29
29
|
|
|
30
30
|
const defaultColor = asLink
|
|
31
31
|
? theme["interactiveElem-default"]
|
|
@@ -34,7 +34,7 @@ export const BodySmall = forwardRef<View, BodySmallProps>(
|
|
|
34
34
|
const BodySmallProps: IOTextProps = {
|
|
35
35
|
...props,
|
|
36
36
|
dynamicTypeRamp: "footnote" /* iOS only */,
|
|
37
|
-
font:
|
|
37
|
+
font: newTypefaceEnabled ? fontName : legacyFontName,
|
|
38
38
|
weight: customWeight ?? "Regular",
|
|
39
39
|
size: 14,
|
|
40
40
|
lineHeight: 21,
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import { IOColors } from "../../core/IOColors";
|
|
3
|
+
import { useIONewTypeface } from "../../core";
|
|
5
4
|
import { IOFontFamily, IOFontSize } from "../../utils/fonts";
|
|
6
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
7
6
|
|
|
8
7
|
export const buttonTextFontSize: IOFontSize = 16;
|
|
9
8
|
/* Needed to render `ButtonOutline` and`ButtonLink` because they use
|
|
10
9
|
`AnimatedText` for color transition through Reanimated */
|
|
11
|
-
const defaultColor: IOColors = "white";
|
|
12
10
|
const fontName: IOFontFamily = "Titillio";
|
|
13
|
-
|
|
14
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
15
11
|
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
16
12
|
|
|
17
13
|
/**
|
|
@@ -19,15 +15,17 @@ const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
|
19
15
|
*/
|
|
20
16
|
export const ButtonText = forwardRef<View, TypographicStyleProps>(
|
|
21
17
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
22
|
-
const {
|
|
18
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
23
19
|
|
|
24
20
|
const ButtonTextProps: IOTextProps = {
|
|
25
21
|
...props,
|
|
26
|
-
font:
|
|
22
|
+
font: newTypefaceEnabled ? fontName : legacyFontName,
|
|
27
23
|
weight: "Semibold",
|
|
28
24
|
size: buttonTextFontSize,
|
|
29
25
|
lineHeight: 20,
|
|
30
|
-
|
|
26
|
+
/* Needed to render `ButtonOutline` and`ButtonLink` because they use
|
|
27
|
+
`AnimatedText` for color transition through Reanimated */
|
|
28
|
+
color: customColor ?? "white"
|
|
31
29
|
};
|
|
32
30
|
|
|
33
31
|
return (
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
const defaultColor: keyof IOTheme = "textBody-default";
|
|
8
|
-
|
|
9
7
|
export const captionFontSize: IOFontSize = 12;
|
|
10
|
-
const fontName: IOFontFamily = "Titillio";
|
|
11
|
-
const fontWeight: IOFontWeight = "Regular";
|
|
12
|
-
|
|
13
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
14
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
15
8
|
|
|
16
9
|
/**
|
|
17
10
|
* `Caption` typographic style
|
|
@@ -19,15 +12,15 @@ const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
|
19
12
|
export const Caption = forwardRef<View, TypographicStyleProps>(
|
|
20
13
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
21
14
|
const theme = useIOTheme();
|
|
22
|
-
const {
|
|
15
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
23
16
|
|
|
24
17
|
const CaptionProps: IOTextProps = {
|
|
25
18
|
...props,
|
|
26
19
|
dynamicTypeRamp: "caption1", // iOS only
|
|
27
|
-
font:
|
|
20
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
21
|
+
weight: "Regular",
|
|
28
22
|
size: captionFontSize,
|
|
29
|
-
|
|
30
|
-
color: customColor ?? theme[defaultColor],
|
|
23
|
+
color: customColor ?? theme["textBody-default"],
|
|
31
24
|
textStyle: {
|
|
32
25
|
textTransform: "uppercase",
|
|
33
26
|
letterSpacing: 0.5
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
const defaultColor: keyof IOTheme = "textHeading-default";
|
|
8
|
-
|
|
9
7
|
export const h1FontSize: IOFontSize = 28;
|
|
10
8
|
export const h1LineHeight = 42;
|
|
11
|
-
const fontName: IOFontFamily = "Titillio";
|
|
12
|
-
const fontWeight: IOFontWeight = "Semibold";
|
|
13
|
-
|
|
14
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
15
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
16
|
-
const legacyFontWeight: IOFontWeight = "Semibold";
|
|
17
9
|
|
|
18
10
|
/**
|
|
19
11
|
* `H1` typographic style
|
|
@@ -21,16 +13,16 @@ const legacyFontWeight: IOFontWeight = "Semibold";
|
|
|
21
13
|
export const H1 = forwardRef<View, TypographicStyleProps>(
|
|
22
14
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
23
15
|
const theme = useIOTheme();
|
|
24
|
-
const {
|
|
16
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
25
17
|
|
|
26
18
|
const H1Props: IOTextProps = {
|
|
27
19
|
...props,
|
|
28
20
|
dynamicTypeRamp: "largeTitle", // iOS only
|
|
29
|
-
font:
|
|
30
|
-
weight:
|
|
21
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
22
|
+
weight: "Semibold",
|
|
31
23
|
size: h1FontSize,
|
|
32
24
|
lineHeight: h1LineHeight,
|
|
33
|
-
color: customColor ?? theme[
|
|
25
|
+
color: customColor ?? theme["textHeading-default"]
|
|
34
26
|
};
|
|
35
27
|
|
|
36
28
|
return (
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
const defaultColor: keyof IOTheme = "textHeading-default";
|
|
8
|
-
|
|
9
7
|
export const h2FontSize: IOFontSize = 26;
|
|
10
8
|
export const h2LineHeight = 34;
|
|
11
|
-
const fontName: IOFontFamily = "Titillio";
|
|
12
|
-
const fontWeight: IOFontWeight = "Semibold";
|
|
13
|
-
|
|
14
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
15
|
-
const legacyH2FontSize: IOFontSize = 28;
|
|
16
|
-
const legacyH2LineHeight = 34;
|
|
17
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
18
|
-
const legacyFontWeight: IOFontWeight = "Semibold";
|
|
19
9
|
|
|
20
10
|
/**
|
|
21
11
|
* `H2` typographic style
|
|
@@ -23,16 +13,16 @@ const legacyFontWeight: IOFontWeight = "Semibold";
|
|
|
23
13
|
export const H2 = forwardRef<View, TypographicStyleProps>(
|
|
24
14
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
25
15
|
const theme = useIOTheme();
|
|
26
|
-
const {
|
|
16
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
27
17
|
|
|
28
18
|
const H2Props: IOTextProps = {
|
|
29
19
|
...props,
|
|
30
20
|
dynamicTypeRamp: "title1", // iOS only
|
|
31
|
-
font:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
22
|
+
weight: "Semibold",
|
|
23
|
+
size: h2FontSize,
|
|
24
|
+
lineHeight: h2LineHeight,
|
|
25
|
+
color: customColor ?? theme["textHeading-default"]
|
|
36
26
|
};
|
|
37
27
|
|
|
38
28
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize, IOFontWeight } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
7
|
type H3StyleProps = TypographicStyleProps & {
|
|
@@ -11,10 +11,6 @@ type H3StyleProps = TypographicStyleProps & {
|
|
|
11
11
|
/* Common typographic styles */
|
|
12
12
|
export const h3FontSize: IOFontSize = 22;
|
|
13
13
|
export const h3LineHeight = 33;
|
|
14
|
-
const fontName: IOFontFamily = "Titillio";
|
|
15
|
-
|
|
16
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
17
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
18
14
|
|
|
19
15
|
/**
|
|
20
16
|
* `H3` typographic style
|
|
@@ -25,12 +21,12 @@ export const H3 = forwardRef<View, H3StyleProps>(
|
|
|
25
21
|
ref?: ForwardedRef<View>
|
|
26
22
|
) => {
|
|
27
23
|
const theme = useIOTheme();
|
|
28
|
-
const {
|
|
24
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
29
25
|
|
|
30
26
|
const H3Props: IOTextProps = {
|
|
31
27
|
...props,
|
|
32
28
|
dynamicTypeRamp: "title2", // iOS only
|
|
33
|
-
font:
|
|
29
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
34
30
|
weight: customWeight ?? "Semibold",
|
|
35
31
|
size: h3FontSize,
|
|
36
32
|
lineHeight: h3LineHeight,
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
const defaultColor: keyof IOTheme = "textHeading-default";
|
|
8
|
-
|
|
9
7
|
export const h4FontSize: IOFontSize = 20;
|
|
10
8
|
export const h4LineHeight = 24;
|
|
11
|
-
const fontName: IOFontFamily = "Titillio";
|
|
12
|
-
const fontWeight: IOFontWeight = "Semibold";
|
|
13
|
-
|
|
14
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
15
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
16
|
-
const legacyFontWeight: IOFontWeight = "Semibold";
|
|
17
9
|
|
|
18
10
|
/**
|
|
19
11
|
* `H4` typographic style
|
|
@@ -21,16 +13,16 @@ const legacyFontWeight: IOFontWeight = "Semibold";
|
|
|
21
13
|
export const H4 = forwardRef<View, TypographicStyleProps>(
|
|
22
14
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
23
15
|
const theme = useIOTheme();
|
|
24
|
-
const {
|
|
16
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
25
17
|
|
|
26
18
|
const H4Props: IOTextProps = {
|
|
27
19
|
...props,
|
|
28
20
|
dynamicTypeRamp: "title3", // iOS only
|
|
29
|
-
font:
|
|
21
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
22
|
+
weight: "Semibold",
|
|
30
23
|
size: h4FontSize,
|
|
31
|
-
|
|
32
|
-
color: customColor ?? theme[
|
|
33
|
-
lineHeight: h4LineHeight
|
|
24
|
+
lineHeight: h4LineHeight,
|
|
25
|
+
color: customColor ?? theme["textHeading-default"]
|
|
34
26
|
};
|
|
35
27
|
|
|
36
28
|
return (
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
const defaultColor: keyof IOTheme = "textHeading-default";
|
|
8
|
-
|
|
9
|
-
const fontName: IOFontFamily = "Titillio";
|
|
10
|
-
const fontWeight: IOFontWeight = "Semibold";
|
|
11
|
-
|
|
12
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
13
|
-
const legacyFontWeight: IOFontWeight = "Semibold";
|
|
14
|
-
|
|
15
7
|
export const h5FontSize: IOFontSize = 14;
|
|
16
8
|
export const h5LineHeight = 16;
|
|
17
9
|
|
|
@@ -21,16 +13,16 @@ export const h5LineHeight = 16;
|
|
|
21
13
|
export const H5 = forwardRef<View, TypographicStyleProps>(
|
|
22
14
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
23
15
|
const theme = useIOTheme();
|
|
24
|
-
const {
|
|
16
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
25
17
|
|
|
26
18
|
const H5Props: IOTextProps = {
|
|
27
19
|
...props,
|
|
28
20
|
dynamicTypeRamp: "subheadline", // iOS only
|
|
29
|
-
font:
|
|
30
|
-
weight:
|
|
21
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
22
|
+
weight: "Semibold",
|
|
31
23
|
size: h5FontSize,
|
|
32
24
|
lineHeight: h5LineHeight,
|
|
33
|
-
color: customColor ?? theme[
|
|
25
|
+
color: customColor ?? theme["textHeading-default"],
|
|
34
26
|
textStyle: {
|
|
35
27
|
textTransform: "uppercase",
|
|
36
28
|
letterSpacing: 0.5
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useIONewTypeface, useIOTheme } from "../../core";
|
|
4
|
+
import { IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
|
-
const defaultColor: keyof IOTheme = "textHeading-default";
|
|
8
|
-
|
|
9
7
|
export const h6FontSize: IOFontSize = 16;
|
|
10
8
|
export const h6LineHeight = 24;
|
|
11
|
-
const fontName: IOFontFamily = "Titillio";
|
|
12
9
|
|
|
13
10
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
14
11
|
const legacyFontSize: IOFontSize = 17;
|
|
15
|
-
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* `H6` typographic style
|
|
@@ -20,16 +16,16 @@ const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
|
20
16
|
export const H6 = forwardRef<View, TypographicStyleProps>(
|
|
21
17
|
({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
|
|
22
18
|
const theme = useIOTheme();
|
|
23
|
-
const {
|
|
19
|
+
const { newTypefaceEnabled } = useIONewTypeface();
|
|
24
20
|
|
|
25
21
|
const H6Props: IOTextProps = {
|
|
26
22
|
...props,
|
|
27
23
|
dynamicTypeRamp: "headline", // iOS only
|
|
28
|
-
font:
|
|
29
|
-
size: isExperimental ? h6FontSize : legacyFontSize,
|
|
30
|
-
lineHeight: h6LineHeight,
|
|
24
|
+
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
31
25
|
weight: "Semibold",
|
|
32
|
-
|
|
26
|
+
size: newTypefaceEnabled ? h6FontSize : legacyFontSize,
|
|
27
|
+
lineHeight: h6LineHeight,
|
|
28
|
+
color: customColor ?? theme["textHeading-default"]
|
|
33
29
|
};
|
|
34
30
|
|
|
35
31
|
return (
|