@pagopa/io-app-design-system 1.7.0 → 1.8.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/alert/Alert.js +9 -1
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/badge/Badge.js +11 -2
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +5 -3
- package/lib/commonjs/components/banner/Banner.js +0 -1
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +5 -5
- package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +1 -1
- package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js +3 -2
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +8 -48
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +5 -7
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +54 -29
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +23 -21
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +14 -2
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +11 -3
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/CheckboxLabel.js +31 -8
- package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/commonjs/components/icons/Icon.js +27 -15
- package/lib/commonjs/components/icons/Icon.js.map +1 -1
- package/lib/commonjs/components/icons/IconContained.js +59 -0
- package/lib/commonjs/components/icons/IconContained.js.map +1 -0
- package/lib/commonjs/components/icons/index.js +11 -0
- package/lib/commonjs/components/icons/index.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconChange.js +31 -0
- package/lib/commonjs/components/icons/svg/IconChange.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconDialpad.js +29 -0
- package/lib/commonjs/components/icons/svg/IconDialpad.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconKey.js +31 -0
- package/lib/commonjs/components/icons/svg/IconKey.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconNotification.js +31 -0
- package/lib/commonjs/components/icons/svg/IconNotification.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconOption.js +31 -0
- package/lib/commonjs/components/icons/svg/IconOption.js.map +1 -0
- package/lib/commonjs/components/icons/svg/IconTransactions.js +1 -1
- package/lib/commonjs/components/icons/svg/IconTransactions.js.map +1 -1
- package/lib/commonjs/components/icons/svg/IconTransactionsBoxed.js +31 -0
- package/lib/commonjs/components/icons/svg/IconTransactionsBoxed.js.map +1 -0
- package/lib/commonjs/components/icons/svg/originals/IconChange.svg +3 -0
- package/lib/commonjs/components/icons/svg/originals/IconDialpad.svg +5 -0
- package/lib/commonjs/components/icons/svg/originals/IconKey.svg +7 -0
- package/lib/commonjs/components/icons/svg/originals/IconNotification.svg +7 -0
- package/lib/commonjs/components/icons/svg/originals/IconOption.svg +7 -0
- package/lib/commonjs/components/icons/svg/originals/IconTransactions.svg +8 -0
- package/lib/commonjs/components/icons/svg/originals/IconTransactionsBoxed.svg +8 -0
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAction.js +38 -8
- package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +31 -7
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js +40 -10
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +30 -7
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +32 -7
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +75 -108
- package/lib/commonjs/components/listitems/__test__/listitem.test.js +2 -2
- package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/commonjs/components/listitems/index.js +4 -4
- package/lib/commonjs/components/listitems/index.js.map +1 -1
- package/lib/commonjs/components/{listitems/ListItemIDP.js → modules/ModuleIDP.js} +19 -12
- package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -0
- package/lib/commonjs/components/modules/index.js +17 -0
- package/lib/commonjs/components/modules/index.js.map +1 -0
- package/lib/commonjs/components/pictograms/Pictogram.js +13 -1
- package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
- package/lib/commonjs/components/pictograms/svg/PictogramBleedCie.js +47 -0
- package/lib/commonjs/components/pictograms/svg/PictogramBleedCie.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/PictogramBleedFeature.js +50 -0
- package/lib/commonjs/components/pictograms/svg/PictogramBleedFeature.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/PictogramBleedSecurity.js +44 -0
- package/lib/commonjs/components/pictograms/svg/PictogramBleedSecurity.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/PictogramCie.js +47 -0
- package/lib/commonjs/components/pictograms/svg/PictogramCie.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/PictogramFeature.js +50 -0
- package/lib/commonjs/components/pictograms/svg/PictogramFeature.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/PictogramSecurity.js +47 -0
- package/lib/commonjs/components/pictograms/svg/PictogramSecurity.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramBleedCie.svg +30 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramBleedFeature.svg +34 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramBleedSecurity.svg +26 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramCie.svg +30 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramFeature.svg +34 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramSecurity.svg +30 -0
- package/lib/commonjs/components/radio/AnimatedRadio.js +14 -2
- package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/commonjs/components/switch/NativeSwitch.js +19 -5
- package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
- package/lib/commonjs/components/switch/SwitchLabel.js +31 -8
- package/lib/commonjs/components/switch/SwitchLabel.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +16 -8
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +11 -2
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/typography/Body.js +1 -4
- package/lib/commonjs/components/typography/Body.js.map +1 -1
- package/lib/commonjs/components/typography/BodyMonospace.js +28 -0
- package/lib/commonjs/components/typography/BodyMonospace.js.map +1 -0
- package/lib/commonjs/components/typography/ButtonText.js +39 -0
- package/lib/commonjs/components/typography/ButtonText.js.map +1 -0
- package/lib/commonjs/components/typography/Caption.js +37 -0
- package/lib/commonjs/components/typography/Caption.js.map +1 -0
- package/lib/commonjs/components/typography/Chip.js +34 -0
- package/lib/commonjs/components/typography/Chip.js.map +1 -0
- package/lib/commonjs/components/typography/H1.js +18 -15
- package/lib/commonjs/components/typography/H1.js.map +1 -1
- package/lib/commonjs/components/typography/H2.js +18 -15
- package/lib/commonjs/components/typography/H2.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +24 -18
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H4.js +18 -14
- package/lib/commonjs/components/typography/H4.js.map +1 -1
- package/lib/commonjs/components/typography/H5.js +19 -33
- package/lib/commonjs/components/typography/H5.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js +15 -13
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/Hero.js +38 -0
- package/lib/commonjs/components/typography/Hero.js.map +1 -0
- package/lib/commonjs/components/typography/Label.js +13 -10
- package/lib/commonjs/components/typography/Label.js.map +1 -1
- package/lib/commonjs/components/typography/LabelHeader.js +19 -16
- package/lib/commonjs/components/typography/LabelHeader.js.map +1 -1
- package/lib/commonjs/components/typography/{Link.js → LabelLink.js} +9 -14
- package/lib/commonjs/components/typography/LabelLink.js.map +1 -0
- package/lib/commonjs/components/typography/LabelSmall.js +18 -22
- package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +195 -379
- package/lib/commonjs/components/typography/__test__/typography.test.js +10 -42
- package/lib/commonjs/components/typography/__test__/typography.test.js.map +1 -1
- package/lib/commonjs/components/typography/common.js +18 -1
- package/lib/commonjs/components/typography/common.js.map +1 -1
- package/lib/commonjs/components/typography/index.js +45 -12
- package/lib/commonjs/components/typography/index.js.map +1 -1
- package/lib/commonjs/core/IODSExperimentalContextProvider.js +3 -2
- package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/commonjs/core/IOShapes.js +3 -3
- package/lib/commonjs/core/IOShapes.js.map +1 -1
- package/lib/commonjs/core/IOSpacing.js +8 -8
- package/lib/commonjs/core/IOSpacing.js.map +1 -1
- package/lib/commonjs/core/IOStyles.js +2 -8
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/commonjs/stories/Link.stories.js +1 -1
- package/lib/commonjs/stories/Link.stories.js.map +1 -1
- package/lib/commonjs/stories/Monospace.stories.js +1 -1
- package/lib/commonjs/stories/Monospace.stories.js.map +1 -1
- package/lib/commonjs/utils/fonts.js +8 -6
- package/lib/commonjs/utils/fonts.js.map +1 -1
- package/lib/module/components/alert/Alert.js +9 -1
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/badge/Badge.js +12 -3
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +5 -3
- package/lib/module/components/banner/Banner.js +0 -1
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +5 -5
- package/lib/module/components/buttons/ButtonExtendedOutline.js +2 -2
- package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +3 -2
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +8 -48
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +5 -7
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +55 -30
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +23 -21
- package/lib/module/components/checkbox/AnimatedCheckbox.js +15 -3
- package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +13 -5
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/CheckboxLabel.js +32 -9
- package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/module/components/icons/Icon.js +27 -15
- package/lib/module/components/icons/Icon.js.map +1 -1
- package/lib/module/components/icons/IconContained.js +51 -0
- package/lib/module/components/icons/IconContained.js.map +1 -0
- package/lib/module/components/icons/index.js +1 -0
- package/lib/module/components/icons/index.js.map +1 -1
- package/lib/module/components/icons/svg/IconChange.js +23 -0
- package/lib/module/components/icons/svg/IconChange.js.map +1 -0
- package/lib/module/components/icons/svg/IconDialpad.js +21 -0
- package/lib/module/components/icons/svg/IconDialpad.js.map +1 -0
- package/lib/module/components/icons/svg/IconKey.js +23 -0
- package/lib/module/components/icons/svg/IconKey.js.map +1 -0
- package/lib/module/components/icons/svg/IconNotification.js +23 -0
- package/lib/module/components/icons/svg/IconNotification.js.map +1 -0
- package/lib/module/components/icons/svg/IconOption.js +23 -0
- package/lib/module/components/icons/svg/IconOption.js.map +1 -0
- package/lib/module/components/icons/svg/IconTransactions.js +1 -1
- package/lib/module/components/icons/svg/IconTransactions.js.map +1 -1
- package/lib/module/components/icons/svg/IconTransactionsBoxed.js +23 -0
- package/lib/module/components/icons/svg/IconTransactionsBoxed.js.map +1 -0
- package/lib/module/components/icons/svg/originals/IconChange.svg +3 -0
- package/lib/module/components/icons/svg/originals/IconDialpad.svg +5 -0
- package/lib/module/components/icons/svg/originals/IconKey.svg +7 -0
- package/lib/module/components/icons/svg/originals/IconNotification.svg +7 -0
- package/lib/module/components/icons/svg/originals/IconOption.svg +7 -0
- package/lib/module/components/icons/svg/originals/IconTransactions.svg +8 -0
- package/lib/module/components/icons/svg/originals/IconTransactionsBoxed.svg +8 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemAction.js +40 -10
- package/lib/module/components/listitems/ListItemAction.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +34 -10
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +43 -13
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +34 -10
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +35 -10
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemSwitch.js +2 -2
- package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +75 -108
- package/lib/module/components/listitems/__test__/listitem.test.js +1 -1
- package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/module/components/listitems/index.js +1 -1
- package/lib/module/components/listitems/index.js.map +1 -1
- package/lib/module/components/{listitems/ListItemIDP.js → modules/ModuleIDP.js} +18 -11
- package/lib/module/components/modules/ModuleIDP.js.map +1 -0
- package/lib/module/components/modules/index.js +2 -0
- package/lib/module/components/modules/index.js.map +1 -0
- package/lib/module/components/pictograms/Pictogram.js +13 -1
- package/lib/module/components/pictograms/Pictogram.js.map +1 -1
- package/lib/module/components/pictograms/svg/PictogramBleedCie.js +39 -0
- package/lib/module/components/pictograms/svg/PictogramBleedCie.js.map +1 -0
- package/lib/module/components/pictograms/svg/PictogramBleedFeature.js +42 -0
- package/lib/module/components/pictograms/svg/PictogramBleedFeature.js.map +1 -0
- package/lib/module/components/pictograms/svg/PictogramBleedSecurity.js +36 -0
- package/lib/module/components/pictograms/svg/PictogramBleedSecurity.js.map +1 -0
- package/lib/module/components/pictograms/svg/PictogramCie.js +39 -0
- package/lib/module/components/pictograms/svg/PictogramCie.js.map +1 -0
- package/lib/module/components/pictograms/svg/PictogramFeature.js +42 -0
- package/lib/module/components/pictograms/svg/PictogramFeature.js.map +1 -0
- package/lib/module/components/pictograms/svg/PictogramSecurity.js +39 -0
- package/lib/module/components/pictograms/svg/PictogramSecurity.js.map +1 -0
- package/lib/module/components/pictograms/svg/originals/PictogramBleedCie.svg +30 -0
- package/lib/module/components/pictograms/svg/originals/PictogramBleedFeature.svg +34 -0
- package/lib/module/components/pictograms/svg/originals/PictogramBleedSecurity.svg +26 -0
- package/lib/module/components/pictograms/svg/originals/PictogramCie.svg +30 -0
- package/lib/module/components/pictograms/svg/originals/PictogramFeature.svg +34 -0
- package/lib/module/components/pictograms/svg/originals/PictogramSecurity.svg +30 -0
- package/lib/module/components/radio/AnimatedRadio.js +15 -3
- package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/module/components/switch/NativeSwitch.js +20 -6
- package/lib/module/components/switch/NativeSwitch.js.map +1 -1
- package/lib/module/components/switch/SwitchLabel.js +32 -9
- package/lib/module/components/switch/SwitchLabel.js.map +1 -1
- package/lib/module/components/tag/Tag.js +12 -4
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +12 -3
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/typography/Body.js +1 -4
- package/lib/module/components/typography/Body.js.map +1 -1
- package/lib/module/components/typography/BodyMonospace.js +21 -0
- package/lib/module/components/typography/BodyMonospace.js.map +1 -0
- package/lib/module/components/typography/ButtonText.js +31 -0
- package/lib/module/components/typography/ButtonText.js.map +1 -0
- package/lib/module/components/typography/Caption.js +29 -0
- package/lib/module/components/typography/Caption.js.map +1 -0
- package/lib/module/components/typography/Chip.js +27 -0
- package/lib/module/components/typography/Chip.js.map +1 -0
- package/lib/module/components/typography/H1.js +17 -12
- package/lib/module/components/typography/H1.js.map +1 -1
- package/lib/module/components/typography/H2.js +17 -12
- package/lib/module/components/typography/H2.js.map +1 -1
- package/lib/module/components/typography/H3.js +24 -18
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H4.js +17 -13
- package/lib/module/components/typography/H4.js.map +1 -1
- package/lib/module/components/typography/H5.js +17 -31
- package/lib/module/components/typography/H5.js.map +1 -1
- package/lib/module/components/typography/H6.js +15 -11
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/Hero.js +29 -0
- package/lib/module/components/typography/Hero.js.map +1 -0
- package/lib/module/components/typography/Label.js +13 -10
- package/lib/module/components/typography/Label.js.map +1 -1
- package/lib/module/components/typography/LabelHeader.js +20 -17
- package/lib/module/components/typography/LabelHeader.js.map +1 -1
- package/lib/module/components/typography/{Link.js → LabelLink.js} +6 -11
- package/lib/module/components/typography/LabelLink.js.map +1 -0
- package/lib/module/components/typography/LabelSmall.js +18 -22
- package/lib/module/components/typography/LabelSmall.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +195 -379
- package/lib/module/components/typography/__test__/typography.test.js +10 -42
- package/lib/module/components/typography/__test__/typography.test.js.map +1 -1
- package/lib/module/components/typography/common.js +15 -0
- package/lib/module/components/typography/common.js.map +1 -1
- package/lib/module/components/typography/index.js +6 -3
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/core/IODSExperimentalContextProvider.js +3 -2
- package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
- package/lib/module/core/IOShapes.js +1 -1
- package/lib/module/core/IOShapes.js.map +1 -1
- package/lib/module/core/IOSpacing.js +4 -4
- package/lib/module/core/IOSpacing.js.map +1 -1
- package/lib/module/core/IOStyles.js +2 -8
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/module/stories/Link.stories.js +2 -2
- package/lib/module/stories/Link.stories.js.map +1 -1
- package/lib/module/stories/Monospace.stories.js +2 -2
- package/lib/module/stories/Monospace.stories.js.map +1 -1
- package/lib/module/utils/fonts.js +8 -6
- 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.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 +2 -3
- 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/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/checkbox/CheckboxLabel.d.ts.map +1 -1
- package/lib/typescript/components/icons/Icon.d.ts +7 -1
- package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
- package/lib/typescript/components/icons/IconContained.d.ts +10 -0
- package/lib/typescript/components/icons/IconContained.d.ts.map +1 -0
- package/lib/typescript/components/icons/index.d.ts +1 -0
- package/lib/typescript/components/icons/index.d.ts.map +1 -1
- package/lib/typescript/components/icons/svg/IconChange.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconChange.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconDialpad.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconDialpad.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconKey.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconKey.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconNotification.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconNotification.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconOption.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconOption.d.ts.map +1 -0
- package/lib/typescript/components/icons/svg/IconTransactionsBoxed.d.ts +5 -0
- package/lib/typescript/components/icons/svg/IconTransactionsBoxed.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemAction.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/ListItemSwitch.d.ts +1 -1
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
- package/lib/typescript/components/listitems/index.d.ts +1 -1
- package/lib/typescript/components/listitems/index.d.ts.map +1 -1
- package/lib/typescript/components/{listitems/ListItemIDP.d.ts → modules/ModuleIDP.d.ts} +4 -4
- package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -0
- package/lib/typescript/components/modules/index.d.ts +2 -0
- package/lib/typescript/components/modules/index.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/Pictogram.d.ts +4 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/svg/PictogramBleedCie.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramBleedCie.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/svg/PictogramBleedFeature.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramBleedFeature.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/svg/PictogramBleedSecurity.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramBleedSecurity.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/svg/PictogramCie.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramCie.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/svg/PictogramFeature.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramFeature.d.ts.map +1 -0
- package/lib/typescript/components/pictograms/svg/PictogramSecurity.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramSecurity.d.ts.map +1 -0
- package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
- package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
- package/lib/typescript/components/switch/SwitchLabel.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts +4 -7
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/BodyMonospace.d.ts +13 -0
- package/lib/typescript/components/typography/BodyMonospace.d.ts.map +1 -0
- package/lib/typescript/components/typography/ButtonText.d.ts +14 -0
- package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -0
- package/lib/typescript/components/typography/Caption.d.ts +14 -0
- package/lib/typescript/components/typography/Caption.d.ts.map +1 -0
- package/lib/typescript/components/typography/Chip.d.ts +13 -0
- package/lib/typescript/components/typography/Chip.d.ts.map +1 -0
- package/lib/typescript/components/typography/H1.d.ts +9 -15
- package/lib/typescript/components/typography/H1.d.ts.map +1 -1
- package/lib/typescript/components/typography/H2.d.ts +9 -15
- package/lib/typescript/components/typography/H2.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts +7 -10
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H4.d.ts +8 -11
- package/lib/typescript/components/typography/H4.d.ts.map +1 -1
- package/lib/typescript/components/typography/H5.d.ts +9 -24
- package/lib/typescript/components/typography/H5.d.ts.map +1 -1
- package/lib/typescript/components/typography/H6.d.ts +7 -12
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/Hero.d.ts +15 -0
- package/lib/typescript/components/typography/Hero.d.ts.map +1 -0
- package/lib/typescript/components/typography/Label.d.ts +8 -9
- package/lib/typescript/components/typography/Label.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelHeader.d.ts +4 -7
- package/lib/typescript/components/typography/LabelHeader.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelLink.d.ts +18 -0
- package/lib/typescript/components/typography/LabelLink.d.ts.map +1 -0
- package/lib/typescript/components/typography/LabelSmall.d.ts +4 -7
- package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
- package/lib/typescript/components/typography/common.d.ts +6 -0
- package/lib/typescript/components/typography/common.d.ts.map +1 -1
- package/lib/typescript/components/typography/index.d.ts +6 -3
- package/lib/typescript/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/core/IODSExperimentalContextProvider.d.ts +4 -1
- package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
- package/lib/typescript/core/IOShapes.d.ts +1 -1
- package/lib/typescript/core/IOShapes.d.ts.map +1 -1
- package/lib/typescript/core/IOSpacing.d.ts +5 -5
- package/lib/typescript/core/IOSpacing.d.ts.map +1 -1
- package/lib/typescript/core/IOStyles.d.ts +1 -6
- package/lib/typescript/core/IOStyles.d.ts.map +1 -1
- package/lib/typescript/stories/H1.stories.d.ts +2 -2
- package/lib/typescript/stories/H2.stories.d.ts +2 -2
- package/lib/typescript/stories/H3.stories.d.ts +2 -2
- package/lib/typescript/stories/H4.stories.d.ts +2 -2
- package/lib/typescript/stories/H5.stories.d.ts +2 -10
- package/lib/typescript/stories/H5.stories.d.ts.map +1 -1
- package/lib/typescript/stories/H6.stories.d.ts +2 -2
- package/lib/typescript/stories/Label.stories.d.ts +4 -2
- package/lib/typescript/stories/Label.stories.d.ts.map +1 -1
- package/lib/typescript/stories/LabelSmall.stories.d.ts +2 -2
- package/lib/typescript/stories/Link.stories.d.ts +3 -3
- package/lib/typescript/stories/Link.stories.d.ts.map +1 -1
- package/lib/typescript/stories/Monospace.stories.d.ts +2 -2
- package/lib/typescript/stories/Monospace.stories.d.ts.map +1 -1
- package/lib/typescript/utils/fonts.d.ts +3 -3
- package/lib/typescript/utils/fonts.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/alert/Alert.tsx +7 -1
- package/src/components/badge/Badge.tsx +30 -19
- package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +5 -3
- package/src/components/banner/Banner.tsx +1 -3
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +5 -5
- package/src/components/buttons/ButtonExtendedOutline.tsx +2 -2
- package/src/components/buttons/ButtonLink.tsx +3 -2
- package/src/components/buttons/ButtonOutline.tsx +6 -53
- package/src/components/buttons/ButtonSolid.tsx +8 -17
- package/src/components/buttons/IconButtonSolid.tsx +43 -13
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +23 -21
- package/src/components/checkbox/AnimatedCheckbox.tsx +26 -5
- package/src/components/checkbox/AnimatedMessageCheckbox.tsx +20 -10
- package/src/components/checkbox/CheckboxLabel.tsx +33 -6
- package/src/components/icons/Icon.tsx +27 -15
- package/src/components/icons/IconContained.tsx +76 -0
- package/src/components/icons/index.tsx +1 -0
- package/src/components/icons/svg/IconChange.tsx +16 -0
- package/src/components/icons/svg/IconDialpad.tsx +14 -0
- package/src/components/icons/svg/IconKey.tsx +16 -0
- package/src/components/icons/svg/IconNotification.tsx +16 -0
- package/src/components/icons/svg/IconOption.tsx +16 -0
- package/src/components/icons/svg/IconTransactions.tsx +1 -1
- package/src/components/icons/svg/IconTransactionsBoxed.tsx +16 -0
- package/src/components/icons/svg/originals/IconChange.svg +3 -0
- package/src/components/icons/svg/originals/IconDialpad.svg +5 -0
- package/src/components/icons/svg/originals/IconKey.svg +7 -0
- package/src/components/icons/svg/originals/IconNotification.svg +7 -0
- package/src/components/icons/svg/originals/IconOption.svg +7 -0
- package/src/components/icons/svg/originals/IconTransactions.svg +8 -0
- package/src/components/icons/svg/originals/IconTransactionsBoxed.svg +8 -0
- package/src/components/index.tsx +1 -0
- package/src/components/listitems/ListItemAction.tsx +53 -11
- package/src/components/listitems/ListItemInfo.tsx +55 -11
- package/src/components/listitems/ListItemInfoCopy.tsx +67 -18
- package/src/components/listitems/ListItemNav.tsx +60 -12
- package/src/components/listitems/ListItemNavAlert.tsx +50 -9
- package/src/components/listitems/ListItemSwitch.tsx +4 -4
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +75 -108
- package/src/components/listitems/__test__/listitem.test.tsx +1 -1
- package/src/components/listitems/index.tsx +1 -1
- package/src/components/{listitems/ListItemIDP.tsx → modules/ModuleIDP.tsx} +29 -16
- package/src/components/modules/index.tsx +1 -0
- package/src/components/pictograms/Pictogram.tsx +14 -2
- package/src/components/pictograms/svg/PictogramBleedCie.tsx +38 -0
- package/src/components/pictograms/svg/PictogramBleedFeature.tsx +46 -0
- package/src/components/pictograms/svg/PictogramBleedSecurity.tsx +38 -0
- package/src/components/pictograms/svg/PictogramCie.tsx +38 -0
- package/src/components/pictograms/svg/PictogramFeature.tsx +42 -0
- package/src/components/pictograms/svg/PictogramSecurity.tsx +38 -0
- package/src/components/pictograms/svg/originals/PictogramBleedCie.svg +30 -0
- package/src/components/pictograms/svg/originals/PictogramBleedFeature.svg +34 -0
- package/src/components/pictograms/svg/originals/PictogramBleedSecurity.svg +26 -0
- package/src/components/pictograms/svg/originals/PictogramCie.svg +30 -0
- package/src/components/pictograms/svg/originals/PictogramFeature.svg +34 -0
- package/src/components/pictograms/svg/originals/PictogramSecurity.svg +30 -0
- package/src/components/radio/AnimatedRadio.tsx +26 -5
- package/src/components/switch/NativeSwitch.tsx +35 -13
- package/src/components/switch/SwitchLabel.tsx +33 -6
- package/src/components/tag/Tag.tsx +39 -24
- package/src/components/textInput/TextInputBase.tsx +20 -3
- package/src/components/typography/Body.tsx +3 -7
- package/src/components/typography/BodyMonospace.tsx +29 -0
- package/src/components/typography/ButtonText.tsx +45 -0
- package/src/components/typography/Caption.tsx +37 -0
- package/src/components/typography/Chip.tsx +33 -0
- package/src/components/typography/H1.tsx +20 -29
- package/src/components/typography/H2.tsx +20 -29
- package/src/components/typography/H3.tsx +21 -20
- package/src/components/typography/H4.tsx +19 -20
- package/src/components/typography/H5.tsx +22 -54
- package/src/components/typography/H6.tsx +17 -15
- package/src/components/typography/Hero.tsx +34 -0
- package/src/components/typography/Label.tsx +23 -21
- package/src/components/typography/LabelHeader.tsx +12 -12
- package/src/components/typography/{Link.tsx → LabelLink.tsx} +15 -12
- package/src/components/typography/LabelSmall.tsx +13 -14
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +195 -379
- package/src/components/typography/__test__/typography.test.tsx +12 -50
- package/src/components/typography/common.tsx +16 -0
- package/src/components/typography/index.tsx +6 -3
- package/src/core/IODSExperimentalContextProvider.tsx +10 -3
- package/src/core/IOShapes.ts +1 -1
- package/src/core/IOSpacing.ts +6 -6
- package/src/core/IOStyles.ts +3 -8
- package/src/stories/Link.stories.ts +5 -5
- package/src/stories/Monospace.stories.ts +5 -5
- package/src/utils/fonts.ts +8 -6
- package/lib/commonjs/components/listitems/ListItemIDP.js.map +0 -1
- package/lib/commonjs/components/typography/CTA.js +0 -34
- package/lib/commonjs/components/typography/CTA.js.map +0 -1
- package/lib/commonjs/components/typography/Link.js.map +0 -1
- package/lib/commonjs/components/typography/Monospace.js +0 -30
- package/lib/commonjs/components/typography/Monospace.js.map +0 -1
- package/lib/module/components/listitems/ListItemIDP.js.map +0 -1
- package/lib/module/components/typography/CTA.js +0 -27
- package/lib/module/components/typography/CTA.js.map +0 -1
- package/lib/module/components/typography/Link.js.map +0 -1
- package/lib/module/components/typography/Monospace.js +0 -23
- package/lib/module/components/typography/Monospace.js.map +0 -1
- package/lib/typescript/components/listitems/ListItemIDP.d.ts.map +0 -1
- package/lib/typescript/components/typography/CTA.d.ts +0 -16
- package/lib/typescript/components/typography/CTA.d.ts.map +0 -1
- package/lib/typescript/components/typography/Link.d.ts +0 -22
- package/lib/typescript/components/typography/Link.d.ts.map +0 -1
- package/lib/typescript/components/typography/Monospace.d.ts +0 -16
- package/lib/typescript/components/typography/Monospace.d.ts.map +0 -1
- package/src/components/typography/CTA.tsx +0 -35
- package/src/components/typography/Monospace.tsx +0 -34
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { Pressable, View } from "react-native";
|
|
4
|
-
import {
|
|
5
|
-
import { HSpacer } from "../spacer/Spacer";
|
|
3
|
+
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import { IOColors, useIOExperimentalDesign } from "../../core";
|
|
6
5
|
import { IOStyles } from "../../core/IOStyles";
|
|
7
6
|
import { triggerHaptic } from "../../functions/haptic-feedback/hapticFeedback";
|
|
7
|
+
import { makeFontStyleObject } from "../../utils/fonts";
|
|
8
|
+
import { HSpacer } from "../spacer/Spacer";
|
|
9
|
+
import { H6 } from "../typography/H6";
|
|
8
10
|
import { AnimatedSwitch } from "./AnimatedSwitch";
|
|
9
11
|
|
|
10
12
|
type Props = {
|
|
@@ -21,6 +23,17 @@ type OwnProps = Props &
|
|
|
21
23
|
Pick<React.ComponentProps<typeof AnimatedSwitch>, "disabled" | "checked"> &
|
|
22
24
|
Pick<React.ComponentProps<typeof Pressable>, "onPress">;
|
|
23
25
|
|
|
26
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
legacyTextValue: {
|
|
29
|
+
fontSize: 16,
|
|
30
|
+
lineHeight: 24,
|
|
31
|
+
color: IOColors.bluegreyDark,
|
|
32
|
+
flexShrink: 1,
|
|
33
|
+
...makeFontStyleObject("SemiBold", undefined, "TitilliumWeb")
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
24
37
|
/**
|
|
25
38
|
* A checkbox with the automatic state management that uses a {@link AnimatedCheckBox}
|
|
26
39
|
* The toggleValue change when a `onPress` event is received and dispatch the `onValueChange`.
|
|
@@ -36,6 +49,22 @@ export const SwitchLabel = ({
|
|
|
36
49
|
}: OwnProps) => {
|
|
37
50
|
const [toggleValue, setToggleValue] = useState(checked ?? false);
|
|
38
51
|
|
|
52
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
53
|
+
const switchLabelText = (
|
|
54
|
+
<H6 style={{ flexShrink: 1 }} color={"black"}>
|
|
55
|
+
{label}
|
|
56
|
+
</H6>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
60
|
+
const legacySwitchlabelText = (
|
|
61
|
+
<Text style={styles.legacyTextValue}>{label}</Text>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const switchLabelTextComponent = isExperimental
|
|
65
|
+
? switchLabelText
|
|
66
|
+
: legacySwitchlabelText;
|
|
67
|
+
|
|
39
68
|
const toggleCheckbox = () => {
|
|
40
69
|
triggerHaptic("impactLight");
|
|
41
70
|
setToggleValue(!toggleValue);
|
|
@@ -64,9 +93,7 @@ export const SwitchLabel = ({
|
|
|
64
93
|
<AnimatedSwitch checked={checked ?? toggleValue} />
|
|
65
94
|
</View>
|
|
66
95
|
<HSpacer size={8} />
|
|
67
|
-
|
|
68
|
-
{label}
|
|
69
|
-
</H6>
|
|
96
|
+
{switchLabelTextComponent}
|
|
70
97
|
</View>
|
|
71
98
|
</Pressable>
|
|
72
99
|
);
|
|
@@ -4,9 +4,8 @@ import { pipe } from "fp-ts/lib/function";
|
|
|
4
4
|
import { View, Text, StyleSheet, Platform } from "react-native";
|
|
5
5
|
import { WithTestID } from "../../utils/types";
|
|
6
6
|
import { makeFontStyleObject } from "../../utils/fonts";
|
|
7
|
-
import { IOColors } from "../../core/IOColors";
|
|
8
7
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
9
|
-
import { IOTagRadius } from "../../core
|
|
8
|
+
import { IOColors, IOTagRadius, useIOExperimentalDesign } from "../../core";
|
|
10
9
|
import {
|
|
11
10
|
IOSpacingScale,
|
|
12
11
|
IOTagHSpacing,
|
|
@@ -99,33 +98,49 @@ const styles = StyleSheet.create({
|
|
|
99
98
|
alignSelf: "center",
|
|
100
99
|
textTransform: "uppercase",
|
|
101
100
|
color: IOColors["grey-700"],
|
|
102
|
-
flexShrink: 1
|
|
101
|
+
flexShrink: 1
|
|
102
|
+
},
|
|
103
|
+
labelFont: {
|
|
103
104
|
...makeFontStyleObject("Regular", false, "ReadexPro")
|
|
105
|
+
},
|
|
106
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
107
|
+
legacyLabelFont: {
|
|
108
|
+
...makeFontStyleObject("SemiBold", false, "TitilliumWeb")
|
|
104
109
|
}
|
|
105
110
|
});
|
|
106
111
|
|
|
107
112
|
/**
|
|
108
113
|
* Tag component, used mainly for message list and details
|
|
109
114
|
*/
|
|
110
|
-
export const Tag = ({ text, variant, testID }: Tag) =>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
export const Tag = ({ text, variant, testID }: Tag) => {
|
|
116
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
117
|
+
return (
|
|
118
|
+
<View testID={testID} style={styles.tag}>
|
|
119
|
+
{pipe(
|
|
120
|
+
mapVariants[variant],
|
|
121
|
+
O.fromNullable,
|
|
122
|
+
O.fold(
|
|
123
|
+
() => null,
|
|
124
|
+
({ iconColor, iconName }) => (
|
|
125
|
+
<View style={styles.iconWrapper}>
|
|
126
|
+
<Icon name={iconName} color={iconColor} size={IOTagIconSize} />
|
|
127
|
+
</View>
|
|
128
|
+
)
|
|
121
129
|
)
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
)}
|
|
131
|
+
{mapVariants[variant] && text && <View style={styles.spacer} />}
|
|
132
|
+
{text && (
|
|
133
|
+
<Text
|
|
134
|
+
numberOfLines={1}
|
|
135
|
+
ellipsizeMode="tail"
|
|
136
|
+
style={[
|
|
137
|
+
styles.label,
|
|
138
|
+
isExperimental ? styles.labelFont : styles.legacyLabelFont
|
|
139
|
+
]}
|
|
140
|
+
>
|
|
141
|
+
{text}
|
|
142
|
+
</Text>
|
|
143
|
+
)}
|
|
144
|
+
</View>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
@@ -13,7 +13,12 @@ import Animated, {
|
|
|
13
13
|
useSharedValue,
|
|
14
14
|
withTiming
|
|
15
15
|
} from "react-native-reanimated";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
IOColors,
|
|
18
|
+
IOSpacingScale,
|
|
19
|
+
IOStyles,
|
|
20
|
+
useIOExperimentalDesign
|
|
21
|
+
} from "../../core";
|
|
17
22
|
import { IOIcons, Icon } from "../icons";
|
|
18
23
|
import { HSpacer } from "../spacer";
|
|
19
24
|
import { LabelSmall } from "../typography";
|
|
@@ -58,12 +63,18 @@ const styles = StyleSheet.create({
|
|
|
58
63
|
},
|
|
59
64
|
textInputStyle: {
|
|
60
65
|
...IOStyles.flex,
|
|
61
|
-
...makeFontStyleObject("Regular", false, "ReadexPro"),
|
|
62
66
|
fontSize: 16,
|
|
63
67
|
marginTop: IOSpacingScale[2],
|
|
64
68
|
lineHeight: 24,
|
|
65
69
|
height: "100%"
|
|
66
70
|
},
|
|
71
|
+
textInputStyleFont: {
|
|
72
|
+
...makeFontStyleObject("Regular", false, "ReadexPro")
|
|
73
|
+
},
|
|
74
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
75
|
+
textInputStyleLegacyFont: {
|
|
76
|
+
...makeFontStyleObject("SemiBold", false, "TitilliumWeb")
|
|
77
|
+
},
|
|
67
78
|
textInputLabelWrapper: {
|
|
68
79
|
position: "absolute",
|
|
69
80
|
paddingHorizontal: 12,
|
|
@@ -247,6 +258,7 @@ export const TextInputBase = ({
|
|
|
247
258
|
[value, derivedInputProps]
|
|
248
259
|
);
|
|
249
260
|
|
|
261
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
250
262
|
return (
|
|
251
263
|
<>
|
|
252
264
|
<Pressable
|
|
@@ -286,7 +298,12 @@ export const TextInputBase = ({
|
|
|
286
298
|
onBlur={onBlurHandler}
|
|
287
299
|
value={inputValue}
|
|
288
300
|
onChangeText={onChangeTextHandler}
|
|
289
|
-
style={
|
|
301
|
+
style={[
|
|
302
|
+
styles.textInputStyle,
|
|
303
|
+
isExperimental
|
|
304
|
+
? styles.textInputStyleFont
|
|
305
|
+
: styles.textInputStyleLegacyFont
|
|
306
|
+
]}
|
|
290
307
|
/>
|
|
291
308
|
{/** Left value is due to the absolute position of the label in order to let it
|
|
292
309
|
* translate to top on focus
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { IOColors, IOTheme } from "../../core";
|
|
3
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
4
3
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -11,7 +10,7 @@ type PartialAllowedColors = Extract<
|
|
|
11
10
|
type AllowedColors = PartialAllowedColors | IOTheme["textBody-default"];
|
|
12
11
|
type AllowedWeight = IOFontWeight | "Regular" | "SemiBold";
|
|
13
12
|
|
|
14
|
-
type
|
|
13
|
+
type BodyProps = ExternalTypographyProps<
|
|
15
14
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
16
15
|
>;
|
|
17
16
|
|
|
@@ -22,12 +21,9 @@ export const bodyDefaultColor: AllowedColors = "bluegrey";
|
|
|
22
21
|
export const bodyDefaultWeight: AllowedWeight = "Regular";
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
26
|
-
* default values (if not defined) are weight: `Regular`, color: `bluegrey`
|
|
27
|
-
* @param props`
|
|
28
|
-
* @constructor
|
|
24
|
+
* `Body` typographic style
|
|
29
25
|
*/
|
|
30
|
-
export const Body
|
|
26
|
+
export const Body = (props: BodyProps) =>
|
|
31
27
|
useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
32
28
|
...props,
|
|
33
29
|
defaultWeight: bodyDefaultWeight,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IOColors } from "../../core/IOColors";
|
|
2
|
+
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
|
+
import { useTypographyFactory } from "./Factory";
|
|
4
|
+
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
5
|
+
|
|
6
|
+
type AllowedColors = Extract<IOColors, "bluegreyDark" | "bluegrey">;
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "Medium">;
|
|
8
|
+
|
|
9
|
+
type BodyMonospaceProps = ExternalTypographyProps<
|
|
10
|
+
TypographyProps<AllowedWeight, AllowedColors>
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
const fontName: FontFamily = "DMMono";
|
|
14
|
+
const fontSize = 16;
|
|
15
|
+
const lineHeight = 24;
|
|
16
|
+
const monospaceDefaultWeight = "Medium";
|
|
17
|
+
const monospaceDefaultcolor = "bluegrey";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* `BodyMonospace` typographic style
|
|
21
|
+
*/
|
|
22
|
+
export const BodyMonospace = (props: BodyMonospaceProps) =>
|
|
23
|
+
useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
24
|
+
...props,
|
|
25
|
+
defaultWeight: monospaceDefaultWeight,
|
|
26
|
+
defaultColor: monospaceDefaultcolor,
|
|
27
|
+
font: fontName,
|
|
28
|
+
fontStyle: { fontSize, lineHeight }
|
|
29
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IOColors } from "src/core/IOColors";
|
|
2
|
+
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
|
+
import { useIOExperimentalDesign } from "../../core";
|
|
4
|
+
import { useTypographyFactory } from "./Factory";
|
|
5
|
+
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
6
|
+
|
|
7
|
+
export type ButtonTextAllowedColors = Extract<
|
|
8
|
+
IOColors,
|
|
9
|
+
"white" | "blueIO-500" | "grey-700"
|
|
10
|
+
>;
|
|
11
|
+
type AllowedWeight = Extract<IOFontWeight, "SemiBold" | "Regular" | "Bold">;
|
|
12
|
+
|
|
13
|
+
type ButtonTextProps = ExternalTypographyProps<
|
|
14
|
+
TypographyProps<AllowedWeight, ButtonTextAllowedColors>
|
|
15
|
+
>;
|
|
16
|
+
|
|
17
|
+
export const buttonTextFontSize = 16;
|
|
18
|
+
/* Needed to render `ButtonOutline` and`ButtonLink` because they use
|
|
19
|
+
`AnimatedText` for color transition through Reanimated */
|
|
20
|
+
const buttonTextDefaultColor: ButtonTextAllowedColors = "white";
|
|
21
|
+
const buttonTextFontName: IOFontFamily = "ReadexPro";
|
|
22
|
+
const buttonTextDefaultWeight: AllowedWeight = "Regular";
|
|
23
|
+
|
|
24
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
25
|
+
const legacyTextFontName: IOFontFamily = "TitilliumWeb";
|
|
26
|
+
const legacyTextDefaultWeight: AllowedWeight = "Bold";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* `ButtonText` typographic style
|
|
30
|
+
*/
|
|
31
|
+
export const ButtonText = (props: ButtonTextProps) => {
|
|
32
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
33
|
+
|
|
34
|
+
return useTypographyFactory<AllowedWeight, ButtonTextAllowedColors>({
|
|
35
|
+
...props,
|
|
36
|
+
defaultWeight: isExperimental
|
|
37
|
+
? buttonTextDefaultWeight
|
|
38
|
+
: legacyTextDefaultWeight,
|
|
39
|
+
defaultColor: buttonTextDefaultColor,
|
|
40
|
+
font: isExperimental ? buttonTextFontName : legacyTextFontName,
|
|
41
|
+
fontStyle: {
|
|
42
|
+
fontSize: buttonTextFontSize
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
|
+
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
|
+
import { useTypographyFactory } from "./Factory";
|
|
4
|
+
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
5
|
+
|
|
6
|
+
type AllowedColors = IOTheme["textHeading-default"];
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "Regular">;
|
|
8
|
+
|
|
9
|
+
type CaptionProps = ExternalTypographyProps<
|
|
10
|
+
TypographyProps<AllowedWeight, AllowedColors>
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
export const captionFontSize = 12;
|
|
14
|
+
const font: FontFamily = "ReadexPro";
|
|
15
|
+
const defaultColor: AllowedColors = "black";
|
|
16
|
+
const defaultWeight: AllowedWeight = "Regular";
|
|
17
|
+
|
|
18
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
19
|
+
const legacyFont: FontFamily = "TitilliumWeb";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* `Caption` typographic style
|
|
23
|
+
*/
|
|
24
|
+
export const Caption = (props: CaptionProps) => {
|
|
25
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
26
|
+
|
|
27
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
28
|
+
...props,
|
|
29
|
+
defaultWeight,
|
|
30
|
+
defaultColor,
|
|
31
|
+
font: isExperimental ? font : legacyFont,
|
|
32
|
+
fontStyle: {
|
|
33
|
+
fontSize: captionFontSize,
|
|
34
|
+
textTransform: "uppercase"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IOColors, useIOExperimentalDesign } from "../../core";
|
|
2
|
+
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
|
+
import { useTypographyFactory } from "./Factory";
|
|
4
|
+
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
5
|
+
|
|
6
|
+
type AllowedColors = IOColors;
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "SemiBold" | "Regular">;
|
|
8
|
+
|
|
9
|
+
type ChipProps = ExternalTypographyProps<
|
|
10
|
+
TypographyProps<AllowedWeight, AllowedColors>
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
const chipFontSize = 12;
|
|
14
|
+
const font: FontFamily = "ReadexPro";
|
|
15
|
+
const defaultColor: AllowedColors = "black";
|
|
16
|
+
const defaultWeight: AllowedWeight = "Regular";
|
|
17
|
+
|
|
18
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
19
|
+
const legacyFont: FontFamily = "TitilliumWeb";
|
|
20
|
+
/**
|
|
21
|
+
* `Chip` typographic style
|
|
22
|
+
*/
|
|
23
|
+
export const Chip = (props: ChipProps) => {
|
|
24
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
25
|
+
|
|
26
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
27
|
+
...props,
|
|
28
|
+
defaultWeight,
|
|
29
|
+
defaultColor,
|
|
30
|
+
font: isExperimental ? font : legacyFont,
|
|
31
|
+
fontStyle: { fontSize: chipFontSize }
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -1,45 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
IOColors,
|
|
4
|
-
IOColorsStatusForeground,
|
|
5
|
-
IOTheme
|
|
6
|
-
} from "../../core/IOColors";
|
|
1
|
+
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
7
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
8
3
|
import { useTypographyFactory } from "./Factory";
|
|
9
4
|
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
10
5
|
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
"bluegreyDark" | "white" | "blue"
|
|
14
|
-
>;
|
|
15
|
-
type AllowedColors =
|
|
16
|
-
| PartialAllowedColors
|
|
17
|
-
| IOColorsStatusForeground
|
|
18
|
-
| IOTheme["textHeading-default"];
|
|
19
|
-
type AllowedWeight = Extract<IOFontWeight, "Bold">;
|
|
6
|
+
type AllowedColors = IOTheme["textHeading-default"];
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "Regular" | "Bold">;
|
|
20
8
|
|
|
21
|
-
type
|
|
9
|
+
type H1Props = ExternalTypographyProps<
|
|
22
10
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
23
11
|
>;
|
|
24
12
|
|
|
25
|
-
export const h1FontSize =
|
|
26
|
-
export const h1LineHeight =
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
export const h1FontSize = 28;
|
|
14
|
+
export const h1LineHeight = 42;
|
|
15
|
+
const font: FontFamily = "ReadexPro";
|
|
16
|
+
const defaultColor: AllowedColors = "black";
|
|
17
|
+
const defaultWeight: AllowedWeight = "Regular";
|
|
18
|
+
|
|
19
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
20
|
+
const legacyFont: FontFamily = "TitilliumWeb";
|
|
21
|
+
const legacyDefaultWeight: AllowedWeight = "Bold";
|
|
29
22
|
|
|
30
23
|
/**
|
|
31
|
-
*
|
|
32
|
-
* default values(if not defined) are weight: `Bold`, color: `bluegreyDark`
|
|
33
|
-
* @param props
|
|
34
|
-
* @constructor
|
|
24
|
+
* `H1` typographic style
|
|
35
25
|
*/
|
|
36
|
-
export const H1
|
|
37
|
-
const
|
|
26
|
+
export const H1 = (props: H1Props) => {
|
|
27
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
28
|
+
|
|
38
29
|
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
39
30
|
...props,
|
|
40
|
-
defaultWeight:
|
|
41
|
-
defaultColor
|
|
42
|
-
font:
|
|
31
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
32
|
+
defaultColor,
|
|
33
|
+
font: isExperimental ? font : legacyFont,
|
|
43
34
|
fontStyle: { fontSize: h1FontSize, lineHeight: h1LineHeight }
|
|
44
35
|
});
|
|
45
36
|
};
|
|
@@ -1,45 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
IOColors,
|
|
4
|
-
IOColorsStatusForeground,
|
|
5
|
-
IOTheme
|
|
6
|
-
} from "../../core/IOColors";
|
|
1
|
+
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
7
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
8
3
|
import { useTypographyFactory } from "./Factory";
|
|
9
4
|
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
10
5
|
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
"bluegreyDark" | "white" | "blue" | "bluegrey"
|
|
14
|
-
>;
|
|
15
|
-
type AllowedColors =
|
|
16
|
-
| PartialAllowedColors
|
|
17
|
-
| IOColorsStatusForeground
|
|
18
|
-
| IOTheme["textHeading-default"];
|
|
19
|
-
type AllowedWeight = Extract<IOFontWeight, "Bold" | "SemiBold">;
|
|
6
|
+
type AllowedColors = IOTheme["textHeading-default"];
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "SemiBold" | "Regular" | "Bold">;
|
|
20
8
|
|
|
21
|
-
type
|
|
9
|
+
type H2Props = ExternalTypographyProps<
|
|
22
10
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
23
11
|
>;
|
|
24
12
|
|
|
25
|
-
export const h2FontSize =
|
|
26
|
-
export const h2LineHeight =
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
export const h2FontSize = 26;
|
|
14
|
+
export const h2LineHeight = 39;
|
|
15
|
+
const font: FontFamily = "ReadexPro";
|
|
16
|
+
const defaultColor: AllowedColors = "black";
|
|
17
|
+
const defaultWeight: AllowedWeight = "Regular";
|
|
18
|
+
|
|
19
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
20
|
+
const legacyFont: FontFamily = "TitilliumWeb";
|
|
21
|
+
const legacyDefaultWeight: AllowedWeight = "Bold";
|
|
29
22
|
|
|
30
23
|
/**
|
|
31
|
-
*
|
|
32
|
-
* default values(if not defined) are weight: `Bold`, color: `bluegreyDark`
|
|
33
|
-
* @param props
|
|
34
|
-
* @constructor
|
|
24
|
+
* `H2` typographic style
|
|
35
25
|
*/
|
|
36
|
-
export const H2
|
|
37
|
-
const
|
|
26
|
+
export const H2 = (props: H2Props) => {
|
|
27
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
28
|
+
|
|
38
29
|
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
39
30
|
...props,
|
|
40
|
-
defaultWeight:
|
|
41
|
-
defaultColor
|
|
42
|
-
font:
|
|
31
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
32
|
+
defaultColor,
|
|
33
|
+
font: isExperimental ? font : legacyFont,
|
|
43
34
|
fontStyle: { fontSize: h2FontSize, lineHeight: h2LineHeight }
|
|
44
35
|
});
|
|
45
36
|
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { IOColorsStatusForeground, IOTheme } from "../../core";
|
|
4
|
-
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
1
|
+
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
|
+
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
5
3
|
import { useTypographyFactory } from "./Factory";
|
|
4
|
+
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
6
5
|
|
|
7
|
-
type AllowedColors =
|
|
8
|
-
type AllowedWeight = Extract<IOFontWeight, "
|
|
6
|
+
type AllowedColors = IOTheme["textHeading-default"];
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "SemiBold" | "Regular" | "Bold">;
|
|
9
8
|
|
|
10
|
-
type
|
|
9
|
+
type H3Props = ExternalTypographyProps<
|
|
11
10
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
12
11
|
>;
|
|
13
12
|
|
|
14
13
|
/* Common typographic styles */
|
|
15
14
|
export const h3FontSize = 22;
|
|
16
15
|
export const h3LineHeight = 33;
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const h3DefaultWeight: AllowedWeight = "Regular";
|
|
16
|
+
const font: FontFamily = "ReadexPro";
|
|
17
|
+
const defaultColor: AllowedColors = "black";
|
|
18
|
+
const defaultWeight: AllowedWeight = "Regular";
|
|
21
19
|
|
|
20
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
21
|
+
const legacyFontName: FontFamily = "TitilliumWeb";
|
|
22
|
+
const legacyDefaultColor: AllowedColors = "bluegreyDark";
|
|
23
|
+
const legacyDefaultWeight: AllowedWeight = "Bold";
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
* default values(if not defined) are weight: `Bold`, color: `bluegreyDark`
|
|
25
|
-
* @param props
|
|
26
|
-
* @constructor
|
|
25
|
+
* `H3` typographic style
|
|
27
26
|
*/
|
|
28
|
-
export const H3
|
|
29
|
-
|
|
27
|
+
export const H3 = (props: H3Props) => {
|
|
28
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
29
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
30
30
|
...props,
|
|
31
|
-
defaultWeight:
|
|
32
|
-
defaultColor:
|
|
33
|
-
font:
|
|
31
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
32
|
+
defaultColor: isExperimental ? defaultColor : legacyDefaultColor,
|
|
33
|
+
font: isExperimental ? font : legacyFontName,
|
|
34
34
|
fontStyle: { fontSize: h3FontSize, lineHeight: h3LineHeight }
|
|
35
35
|
});
|
|
36
|
+
};
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IOColorsStatusForeground, IOTheme } from "../../core/IOColors";
|
|
1
|
+
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
3
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
4
3
|
import { useTypographyFactory } from "./Factory";
|
|
5
4
|
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
6
5
|
|
|
7
|
-
type AllowedColors =
|
|
8
|
-
type AllowedWeight = Extract<IOFontWeight, "
|
|
6
|
+
type AllowedColors = IOTheme["textHeading-default"];
|
|
7
|
+
type AllowedWeight = Extract<IOFontWeight, "Regular" | "SemiBold">;
|
|
9
8
|
|
|
10
|
-
type
|
|
9
|
+
type H4Props = ExternalTypographyProps<
|
|
11
10
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
12
11
|
>;
|
|
13
12
|
|
|
14
|
-
/* Common typographic styles */
|
|
15
13
|
export const h4FontSize = 20;
|
|
16
|
-
export const h4LineHeight =
|
|
14
|
+
export const h4LineHeight = 30;
|
|
15
|
+
const font: FontFamily = "ReadexPro";
|
|
16
|
+
const defaultColor: AllowedColors = "black";
|
|
17
|
+
const defaultWeight: AllowedWeight = "Regular";
|
|
18
|
+
|
|
19
|
+
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
20
|
+
const legacyFontName: FontFamily = "TitilliumWeb";
|
|
21
|
+
const legacyDefaultColor: AllowedColors = "bluegreyDark";
|
|
22
|
+
const legacyDefaultWeight: AllowedWeight = "SemiBold";
|
|
17
23
|
|
|
18
24
|
/**
|
|
19
|
-
*
|
|
20
|
-
* default values(if not defined) are weight: `Regular/SemiBold`, color: `black/bluegreyDark` if design system is enabled or not
|
|
21
|
-
* @param props
|
|
22
|
-
* @constructor
|
|
25
|
+
* `H4` typographic style
|
|
23
26
|
*/
|
|
24
|
-
export const H4
|
|
25
|
-
|
|
26
|
-
const font: FontFamily = "ReadexPro";
|
|
27
|
-
const defaultColor: AllowedColors = "black";
|
|
28
|
-
const defaultWeight: AllowedWeight = "Regular";
|
|
29
|
-
|
|
27
|
+
export const H4 = (props: H4Props) => {
|
|
28
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
30
29
|
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
31
30
|
...props,
|
|
32
|
-
defaultWeight,
|
|
33
|
-
defaultColor,
|
|
34
|
-
font,
|
|
31
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
32
|
+
defaultColor: isExperimental ? defaultColor : legacyDefaultColor,
|
|
33
|
+
font: isExperimental ? font : legacyFontName,
|
|
35
34
|
fontStyle: { fontSize: h4FontSize, lineHeight: h4LineHeight }
|
|
36
35
|
});
|
|
37
36
|
};
|