@pagopa/io-app-design-system 3.1.0 → 4.0.1
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 +1 -2
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js +2 -2
- package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/commonjs/components/badge/Badge.js +95 -14
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/banner/Banner.js +1 -1
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
- package/lib/commonjs/components/buttons/ButtonLink.js +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
- package/lib/commonjs/components/featureInfo/FeatureInfo.js +3 -2
- package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderFirstLevel.js +1 -0
- package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -2
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.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/ListItemTransaction.js +2 -2
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
- package/lib/commonjs/components/modules/ModuleAttachment.js +1 -1
- package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js +1 -1
- package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleNavigation.js +3 -2
- package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/commonjs/components/modules/ModulePaymentNotice.js +2 -2
- package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleSummary.js +1 -1
- package/lib/commonjs/components/modules/ModuleSummary.js.map +1 -1
- package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +1 -1
- package/lib/commonjs/components/otpInput/BoxedInput.js +4 -6
- package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
- package/lib/commonjs/components/otpInput/OTPInput.js +5 -4
- package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
- package/lib/commonjs/components/stack/Stack.js +2 -2
- package/lib/commonjs/components/stack/Stack.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +1 -1
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +40 -26
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +2 -2
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/typography/{LabelSmall.js → BodySmall.js} +8 -10
- package/lib/commonjs/components/typography/BodySmall.js.map +1 -0
- package/lib/commonjs/components/typography/ButtonText.js +1 -3
- package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +3 -6
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js +4 -5
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/IOText.js.map +1 -1
- package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
- package/lib/commonjs/components/typography/__test__/typography.test.js +6 -18
- package/lib/commonjs/components/typography/__test__/typography.test.js.map +1 -1
- package/lib/commonjs/components/typography/index.js +28 -72
- package/lib/commonjs/components/typography/index.js.map +1 -1
- package/lib/commonjs/core/IOColors.js +9 -1
- package/lib/commonjs/core/IOColors.js.map +1 -1
- package/lib/commonjs/utils/fonts.js.map +1 -1
- package/lib/module/components/alert/Alert.js +2 -3
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/alert/AlertEdgeToEdge.js +2 -2
- package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
- package/lib/module/components/badge/Badge.js +96 -15
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/banner/Banner.js +2 -2
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
- package/lib/module/components/buttons/ButtonLink.js +1 -1
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +1 -1
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
- package/lib/module/components/featureInfo/FeatureInfo.js +4 -3
- package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/module/components/layout/HeaderFirstLevel.js +1 -0
- package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +2 -2
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +2 -2
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +2 -2
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +2 -2
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +2 -2
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +2 -2
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +3 -3
- package/lib/module/components/listitems/ListItemRadioWithAmount.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/ListItemTransaction.js +3 -3
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
- package/lib/module/components/modules/ModuleAttachment.js +2 -2
- package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
- package/lib/module/components/modules/ModuleCheckout.js +2 -2
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/components/modules/ModuleCredential.js +2 -2
- package/lib/module/components/modules/ModuleCredential.js.map +1 -1
- package/lib/module/components/modules/ModuleNavigation.js +4 -3
- package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
- package/lib/module/components/modules/ModulePaymentNotice.js +3 -3
- package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/module/components/modules/ModuleSummary.js +2 -2
- package/lib/module/components/modules/ModuleSummary.js.map +1 -1
- package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +1 -1
- package/lib/module/components/otpInput/BoxedInput.js +5 -7
- package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
- package/lib/module/components/otpInput/OTPInput.js +5 -4
- package/lib/module/components/otpInput/OTPInput.js.map +1 -1
- package/lib/module/components/stack/Stack.js +2 -2
- package/lib/module/components/stack/Stack.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +2 -2
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tag/Tag.js +41 -27
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +3 -3
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/typography/{LabelSmall.js → BodySmall.js} +6 -8
- package/lib/module/components/typography/BodySmall.js.map +1 -0
- package/lib/module/components/typography/ButtonText.js +1 -3
- package/lib/module/components/typography/ButtonText.js.map +1 -1
- package/lib/module/components/typography/H3.js +3 -6
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H6.js +4 -5
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/IOText.js.map +1 -1
- package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
- package/lib/module/components/typography/__test__/typography.test.js +6 -18
- package/lib/module/components/typography/__test__/typography.test.js.map +1 -1
- package/lib/module/components/typography/index.js +6 -10
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/core/IOColors.js +9 -1
- package/lib/module/core/IOColors.js.map +1 -1
- 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 +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
- package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
- package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts +13 -8
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts +1 -1
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/BodyMonospace.d.ts +1 -1
- package/lib/typescript/components/typography/BodySmall.d.ts +13 -0
- package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -0
- package/lib/typescript/components/typography/ButtonText.d.ts +1 -1
- package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
- package/lib/typescript/components/typography/Caption.d.ts +1 -1
- package/lib/typescript/components/typography/H1.d.ts +1 -1
- package/lib/typescript/components/typography/H2.d.ts +1 -1
- package/lib/typescript/components/typography/H3.d.ts +3 -1
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H4.d.ts +1 -1
- package/lib/typescript/components/typography/H5.d.ts +1 -1
- package/lib/typescript/components/typography/H6.d.ts +1 -1
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/Hero.d.ts +1 -1
- package/lib/typescript/components/typography/IOText.d.ts +2 -2
- package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelMini.d.ts +1 -1
- package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
- package/lib/typescript/components/typography/index.d.ts +6 -10
- package/lib/typescript/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/components/typography/markdown/MdH1.d.ts +1 -1
- package/lib/typescript/components/typography/markdown/MdH2.d.ts +1 -1
- package/lib/typescript/components/typography/markdown/MdH3.d.ts +1 -1
- package/lib/typescript/core/IOColors.d.ts +2 -1
- package/lib/typescript/core/IOColors.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 +3 -4
- package/src/components/alert/AlertEdgeToEdge.tsx +3 -3
- package/src/components/badge/Badge.tsx +109 -19
- package/src/components/banner/Banner.tsx +7 -5
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
- package/src/components/buttons/ButtonLink.tsx +1 -1
- package/src/components/buttons/ButtonOutline.tsx +1 -1
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
- package/src/components/featureInfo/FeatureInfo.tsx +6 -6
- package/src/components/layout/HeaderFirstLevel.tsx +1 -0
- package/src/components/listitems/ListItemCheckbox.tsx +3 -3
- package/src/components/listitems/ListItemInfo.tsx +3 -3
- package/src/components/listitems/ListItemInfoCopy.tsx +3 -3
- package/src/components/listitems/ListItemNav.tsx +3 -3
- package/src/components/listitems/ListItemNavAlert.tsx +3 -3
- package/src/components/listitems/ListItemRadio.tsx +3 -3
- package/src/components/listitems/ListItemRadioWithAmount.tsx +5 -5
- package/src/components/listitems/ListItemSwitch.tsx +4 -4
- package/src/components/listitems/ListItemTransaction.tsx +5 -5
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
- package/src/components/modules/ModuleAttachment.tsx +3 -3
- package/src/components/modules/ModuleCheckout.tsx +3 -3
- package/src/components/modules/ModuleCredential.tsx +3 -3
- package/src/components/modules/ModuleNavigation.tsx +6 -4
- package/src/components/modules/ModulePaymentNotice.tsx +5 -5
- package/src/components/modules/ModuleSummary.tsx +3 -3
- package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +1 -1
- package/src/components/otpInput/BoxedInput.tsx +6 -5
- package/src/components/otpInput/OTPInput.tsx +23 -8
- package/src/components/stack/Stack.tsx +2 -2
- package/src/components/tabs/TabItem.tsx +3 -3
- package/src/components/tag/Tag.tsx +66 -33
- package/src/components/textInput/TextInputBase.tsx +5 -5
- package/src/components/typography/Body.tsx +1 -1
- package/src/components/typography/{LabelSmall.tsx → BodySmall.tsx} +7 -14
- package/src/components/typography/ButtonText.tsx +2 -4
- package/src/components/typography/H3.tsx +11 -8
- package/src/components/typography/H6.tsx +5 -6
- package/src/components/typography/IOText.tsx +1 -2
- package/src/components/typography/LabelMini.tsx +1 -1
- package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
- package/src/components/typography/__test__/typography.test.tsx +8 -24
- package/src/components/typography/index.tsx +6 -10
- package/src/core/IOColors.ts +11 -0
- package/src/utils/fonts.ts +2 -2
- package/lib/commonjs/components/typography/BaseTypography.js +0 -52
- package/lib/commonjs/components/typography/BaseTypography.js.map +0 -1
- package/lib/commonjs/components/typography/Chip.js +0 -41
- package/lib/commonjs/components/typography/Chip.js.map +0 -1
- package/lib/commonjs/components/typography/Factory.js +0 -62
- package/lib/commonjs/components/typography/Factory.js.map +0 -1
- package/lib/commonjs/components/typography/Label.js +0 -51
- package/lib/commonjs/components/typography/Label.js.map +0 -1
- package/lib/commonjs/components/typography/LabelSmall.js.map +0 -1
- package/lib/module/components/typography/BaseTypography.js +0 -44
- package/lib/module/components/typography/BaseTypography.js.map +0 -1
- package/lib/module/components/typography/Chip.js +0 -32
- package/lib/module/components/typography/Chip.js.map +0 -1
- package/lib/module/components/typography/Factory.js +0 -55
- package/lib/module/components/typography/Factory.js.map +0 -1
- package/lib/module/components/typography/Label.js +0 -42
- package/lib/module/components/typography/Label.js.map +0 -1
- package/lib/module/components/typography/LabelSmall.js.map +0 -1
- package/lib/typescript/components/typography/BaseTypography.d.ts +0 -29
- package/lib/typescript/components/typography/BaseTypography.d.ts.map +0 -1
- package/lib/typescript/components/typography/Chip.d.ts +0 -13
- package/lib/typescript/components/typography/Chip.d.ts.map +0 -1
- package/lib/typescript/components/typography/Factory.d.ts +0 -43
- package/lib/typescript/components/typography/Factory.d.ts.map +0 -1
- package/lib/typescript/components/typography/Label.d.ts +0 -13
- package/lib/typescript/components/typography/Label.d.ts.map +0 -1
- package/lib/typescript/components/typography/LabelSmall.d.ts +0 -13
- package/lib/typescript/components/typography/LabelSmall.d.ts.map +0 -1
- package/src/components/typography/BaseTypography.tsx +0 -71
- package/src/components/typography/Chip.tsx +0 -33
- package/src/components/typography/Factory.tsx +0 -98
- package/src/components/typography/Label.tsx +0 -62
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React, { ForwardedRef, forwardRef } from "react";
|
|
2
2
|
import { View } from "react-native";
|
|
3
3
|
import { IOTheme, useIOExperimentalDesign, useIOTheme } from "../../core";
|
|
4
|
-
import { IOFontFamily, IOFontSize
|
|
4
|
+
import { IOFontFamily, IOFontSize } from "../../utils/fonts";
|
|
5
5
|
import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
|
|
6
6
|
|
|
7
7
|
const defaultColor: keyof IOTheme = "textHeading-default";
|
|
8
8
|
|
|
9
|
-
export const h6FontSize: IOFontSize =
|
|
9
|
+
export const h6FontSize: IOFontSize = 16;
|
|
10
10
|
export const h6LineHeight = 24;
|
|
11
11
|
const fontName: IOFontFamily = "Titillio";
|
|
12
|
-
const fontWeight: IOFontWeight = "Semibold";
|
|
13
12
|
|
|
14
13
|
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
14
|
+
const legacyFontSize: IOFontSize = 18;
|
|
15
15
|
const legacyFontName: IOFontFamily = "TitilliumSansPro";
|
|
16
|
-
const legacyFontWeight: IOFontWeight = "Semibold";
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* `H6` typographic style
|
|
@@ -27,9 +26,9 @@ export const H6 = forwardRef<View, TypographicStyleProps>(
|
|
|
27
26
|
...props,
|
|
28
27
|
dynamicTypeRamp: "headline", // iOS only
|
|
29
28
|
font: isExperimental ? fontName : legacyFontName,
|
|
30
|
-
size: h6FontSize,
|
|
29
|
+
size: isExperimental ? h6FontSize : legacyFontSize,
|
|
31
30
|
lineHeight: h6LineHeight,
|
|
32
|
-
weight:
|
|
31
|
+
weight: "Semibold",
|
|
33
32
|
color: customColor ?? theme[defaultColor]
|
|
34
33
|
};
|
|
35
34
|
|
|
@@ -10,7 +10,6 @@ import { IOColors, useIOExperimentalDesign, useIOTheme } from "../../core";
|
|
|
10
10
|
import { useBoldTextEnabled } from "../../utils/accessibility";
|
|
11
11
|
import {
|
|
12
12
|
IOFontFamily,
|
|
13
|
-
IOFontSize,
|
|
14
13
|
IOFontWeight,
|
|
15
14
|
makeFontStyleObject
|
|
16
15
|
} from "../../utils/fonts";
|
|
@@ -37,7 +36,7 @@ export type TypographicStyleProps = Omit<
|
|
|
37
36
|
* cannot be included in the default StyleProp<TextStyle>
|
|
38
37
|
*/
|
|
39
38
|
type IOTextBaseProps = {
|
|
40
|
-
size?:
|
|
39
|
+
size?: number;
|
|
41
40
|
weight?: IOFontWeight;
|
|
42
41
|
color?: IOColors;
|
|
43
42
|
font?: IOFontFamily;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./IOText";
|
|
11
11
|
|
|
12
12
|
type LabelMiniProps = TypographicStyleProps & {
|
|
13
|
-
weight?: Extract<IOFontWeight, "Regular" | "Semibold"
|
|
13
|
+
weight?: Extract<IOFontWeight, "Regular" | "Semibold">;
|
|
14
14
|
} & TypographicStyleAsLinkProps;
|
|
15
15
|
|
|
16
16
|
const fontName: IOFontFamily = "Titillio";
|
|
@@ -48,6 +48,121 @@ exports[`Test Typography Components BodyMonospace Snapshot 1`] = `
|
|
|
48
48
|
</Text>
|
|
49
49
|
`;
|
|
50
50
|
|
|
51
|
+
exports[`Test Typography Components BodySmall Snapshot 1`] = `
|
|
52
|
+
<Text
|
|
53
|
+
allowFontScaling={false}
|
|
54
|
+
dynamicTypeRamp="footnote"
|
|
55
|
+
maxFontSizeMultiplier={1.25}
|
|
56
|
+
style={
|
|
57
|
+
[
|
|
58
|
+
{},
|
|
59
|
+
{
|
|
60
|
+
"color": "#555C70",
|
|
61
|
+
"fontFamily": "Titillium Sans Pro",
|
|
62
|
+
"fontSize": 14,
|
|
63
|
+
"fontStyle": "normal",
|
|
64
|
+
"fontWeight": "400",
|
|
65
|
+
"lineHeight": 21,
|
|
66
|
+
},
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
Text
|
|
71
|
+
</Text>
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
exports[`Test Typography Components BodySmall Snapshot 2`] = `
|
|
75
|
+
<Text
|
|
76
|
+
allowFontScaling={false}
|
|
77
|
+
dynamicTypeRamp="footnote"
|
|
78
|
+
maxFontSizeMultiplier={1.25}
|
|
79
|
+
style={
|
|
80
|
+
[
|
|
81
|
+
{},
|
|
82
|
+
{
|
|
83
|
+
"color": "#0073E6",
|
|
84
|
+
"fontFamily": "Titillium Sans Pro",
|
|
85
|
+
"fontSize": 14,
|
|
86
|
+
"fontStyle": "normal",
|
|
87
|
+
"fontWeight": "400",
|
|
88
|
+
"lineHeight": 21,
|
|
89
|
+
},
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
>
|
|
93
|
+
Text
|
|
94
|
+
</Text>
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
exports[`Test Typography Components BodySmall Snapshot 3`] = `
|
|
98
|
+
<Text
|
|
99
|
+
allowFontScaling={false}
|
|
100
|
+
dynamicTypeRamp="footnote"
|
|
101
|
+
maxFontSizeMultiplier={1.25}
|
|
102
|
+
style={
|
|
103
|
+
[
|
|
104
|
+
{},
|
|
105
|
+
{
|
|
106
|
+
"color": "#475A6D",
|
|
107
|
+
"fontFamily": "Titillium Sans Pro",
|
|
108
|
+
"fontSize": 14,
|
|
109
|
+
"fontStyle": "normal",
|
|
110
|
+
"fontWeight": "400",
|
|
111
|
+
"lineHeight": 21,
|
|
112
|
+
},
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
>
|
|
116
|
+
Text
|
|
117
|
+
</Text>
|
|
118
|
+
`;
|
|
119
|
+
|
|
120
|
+
exports[`Test Typography Components BodySmall Snapshot 4`] = `
|
|
121
|
+
<Text
|
|
122
|
+
allowFontScaling={false}
|
|
123
|
+
dynamicTypeRamp="footnote"
|
|
124
|
+
maxFontSizeMultiplier={1.25}
|
|
125
|
+
style={
|
|
126
|
+
[
|
|
127
|
+
{},
|
|
128
|
+
{
|
|
129
|
+
"color": "#C02927",
|
|
130
|
+
"fontFamily": "Titillium Sans Pro",
|
|
131
|
+
"fontSize": 14,
|
|
132
|
+
"fontStyle": "normal",
|
|
133
|
+
"fontWeight": "400",
|
|
134
|
+
"lineHeight": 21,
|
|
135
|
+
},
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
>
|
|
139
|
+
Text
|
|
140
|
+
</Text>
|
|
141
|
+
`;
|
|
142
|
+
|
|
143
|
+
exports[`Test Typography Components BodySmall Snapshot 5`] = `
|
|
144
|
+
<Text
|
|
145
|
+
allowFontScaling={false}
|
|
146
|
+
dynamicTypeRamp="footnote"
|
|
147
|
+
maxFontSizeMultiplier={1.25}
|
|
148
|
+
style={
|
|
149
|
+
[
|
|
150
|
+
{},
|
|
151
|
+
{
|
|
152
|
+
"color": "#FFFFFF",
|
|
153
|
+
"fontFamily": "Titillium Sans Pro",
|
|
154
|
+
"fontSize": 14,
|
|
155
|
+
"fontStyle": "normal",
|
|
156
|
+
"fontWeight": "400",
|
|
157
|
+
"lineHeight": 21,
|
|
158
|
+
},
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
>
|
|
162
|
+
Text
|
|
163
|
+
</Text>
|
|
164
|
+
`;
|
|
165
|
+
|
|
51
166
|
exports[`Test Typography Components CTA Snapshot 1`] = `
|
|
52
167
|
<Text
|
|
53
168
|
allowFontScaling={false}
|
|
@@ -60,7 +175,7 @@ exports[`Test Typography Components CTA Snapshot 1`] = `
|
|
|
60
175
|
"fontFamily": "Titillium Sans Pro",
|
|
61
176
|
"fontSize": 16,
|
|
62
177
|
"fontStyle": "normal",
|
|
63
|
-
"fontWeight": "
|
|
178
|
+
"fontWeight": "600",
|
|
64
179
|
"lineHeight": 20,
|
|
65
180
|
},
|
|
66
181
|
]
|
|
@@ -450,169 +565,11 @@ exports[`Test Typography Components H6 Snapshot 1`] = `
|
|
|
450
565
|
</Text>
|
|
451
566
|
`;
|
|
452
567
|
|
|
453
|
-
exports[`Test Typography Components Label Snapshot 1`] = `
|
|
454
|
-
<Text
|
|
455
|
-
allowFontScaling={false}
|
|
456
|
-
maxFontSizeMultiplier={1.25}
|
|
457
|
-
style={
|
|
458
|
-
[
|
|
459
|
-
{},
|
|
460
|
-
{
|
|
461
|
-
"color": "#555C70",
|
|
462
|
-
"fontFamily": "Titillium Sans Pro",
|
|
463
|
-
"fontSize": 16,
|
|
464
|
-
"fontStyle": "normal",
|
|
465
|
-
"fontWeight": "600",
|
|
466
|
-
"lineHeight": 24,
|
|
467
|
-
},
|
|
468
|
-
]
|
|
469
|
-
}
|
|
470
|
-
>
|
|
471
|
-
Text
|
|
472
|
-
</Text>
|
|
473
|
-
`;
|
|
474
|
-
|
|
475
|
-
exports[`Test Typography Components Label Snapshot 2`] = `
|
|
476
|
-
<Text
|
|
477
|
-
allowFontScaling={false}
|
|
478
|
-
maxFontSizeMultiplier={1.25}
|
|
479
|
-
style={
|
|
480
|
-
[
|
|
481
|
-
{},
|
|
482
|
-
{
|
|
483
|
-
"color": "#0E0F13",
|
|
484
|
-
"fontFamily": "Titillium Sans Pro",
|
|
485
|
-
"fontSize": 16,
|
|
486
|
-
"fontStyle": "normal",
|
|
487
|
-
"fontWeight": "600",
|
|
488
|
-
"lineHeight": 24,
|
|
489
|
-
},
|
|
490
|
-
]
|
|
491
|
-
}
|
|
492
|
-
>
|
|
493
|
-
Text
|
|
494
|
-
</Text>
|
|
495
|
-
`;
|
|
496
|
-
|
|
497
|
-
exports[`Test Typography Components LabelSmall Snapshot 1`] = `
|
|
498
|
-
<Text
|
|
499
|
-
allowFontScaling={false}
|
|
500
|
-
dynamicTypeRamp="footnote"
|
|
501
|
-
maxFontSizeMultiplier={1.25}
|
|
502
|
-
style={
|
|
503
|
-
[
|
|
504
|
-
{},
|
|
505
|
-
{
|
|
506
|
-
"color": "#555C70",
|
|
507
|
-
"fontFamily": "Titillium Sans Pro",
|
|
508
|
-
"fontSize": 14,
|
|
509
|
-
"fontStyle": "normal",
|
|
510
|
-
"fontWeight": "600",
|
|
511
|
-
"lineHeight": 21,
|
|
512
|
-
},
|
|
513
|
-
]
|
|
514
|
-
}
|
|
515
|
-
>
|
|
516
|
-
Text
|
|
517
|
-
</Text>
|
|
518
|
-
`;
|
|
519
|
-
|
|
520
|
-
exports[`Test Typography Components LabelSmall Snapshot 2`] = `
|
|
521
|
-
<Text
|
|
522
|
-
allowFontScaling={false}
|
|
523
|
-
dynamicTypeRamp="footnote"
|
|
524
|
-
maxFontSizeMultiplier={1.25}
|
|
525
|
-
style={
|
|
526
|
-
[
|
|
527
|
-
{},
|
|
528
|
-
{
|
|
529
|
-
"color": "#0073E6",
|
|
530
|
-
"fontFamily": "Titillium Sans Pro",
|
|
531
|
-
"fontSize": 14,
|
|
532
|
-
"fontStyle": "normal",
|
|
533
|
-
"fontWeight": "600",
|
|
534
|
-
"lineHeight": 21,
|
|
535
|
-
},
|
|
536
|
-
]
|
|
537
|
-
}
|
|
538
|
-
>
|
|
539
|
-
Text
|
|
540
|
-
</Text>
|
|
541
|
-
`;
|
|
542
|
-
|
|
543
|
-
exports[`Test Typography Components LabelSmall Snapshot 3`] = `
|
|
544
|
-
<Text
|
|
545
|
-
allowFontScaling={false}
|
|
546
|
-
dynamicTypeRamp="footnote"
|
|
547
|
-
maxFontSizeMultiplier={1.25}
|
|
548
|
-
style={
|
|
549
|
-
[
|
|
550
|
-
{},
|
|
551
|
-
{
|
|
552
|
-
"color": "#475A6D",
|
|
553
|
-
"fontFamily": "Titillium Sans Pro",
|
|
554
|
-
"fontSize": 14,
|
|
555
|
-
"fontStyle": "normal",
|
|
556
|
-
"fontWeight": "600",
|
|
557
|
-
"lineHeight": 21,
|
|
558
|
-
},
|
|
559
|
-
]
|
|
560
|
-
}
|
|
561
|
-
>
|
|
562
|
-
Text
|
|
563
|
-
</Text>
|
|
564
|
-
`;
|
|
565
|
-
|
|
566
|
-
exports[`Test Typography Components LabelSmall Snapshot 4`] = `
|
|
567
|
-
<Text
|
|
568
|
-
allowFontScaling={false}
|
|
569
|
-
dynamicTypeRamp="footnote"
|
|
570
|
-
maxFontSizeMultiplier={1.25}
|
|
571
|
-
style={
|
|
572
|
-
[
|
|
573
|
-
{},
|
|
574
|
-
{
|
|
575
|
-
"color": "#C02927",
|
|
576
|
-
"fontFamily": "Titillium Sans Pro",
|
|
577
|
-
"fontSize": 14,
|
|
578
|
-
"fontStyle": "normal",
|
|
579
|
-
"fontWeight": "600",
|
|
580
|
-
"lineHeight": 21,
|
|
581
|
-
},
|
|
582
|
-
]
|
|
583
|
-
}
|
|
584
|
-
>
|
|
585
|
-
Text
|
|
586
|
-
</Text>
|
|
587
|
-
`;
|
|
588
|
-
|
|
589
|
-
exports[`Test Typography Components LabelSmall Snapshot 5`] = `
|
|
590
|
-
<Text
|
|
591
|
-
allowFontScaling={false}
|
|
592
|
-
dynamicTypeRamp="footnote"
|
|
593
|
-
maxFontSizeMultiplier={1.25}
|
|
594
|
-
style={
|
|
595
|
-
[
|
|
596
|
-
{},
|
|
597
|
-
{
|
|
598
|
-
"color": "#FFFFFF",
|
|
599
|
-
"fontFamily": "Titillium Sans Pro",
|
|
600
|
-
"fontSize": 14,
|
|
601
|
-
"fontStyle": "normal",
|
|
602
|
-
"fontWeight": "600",
|
|
603
|
-
"lineHeight": 21,
|
|
604
|
-
},
|
|
605
|
-
]
|
|
606
|
-
}
|
|
607
|
-
>
|
|
608
|
-
Text
|
|
609
|
-
</Text>
|
|
610
|
-
`;
|
|
611
|
-
|
|
612
568
|
exports[`Test Typography Components Link Snapshot 1`] = `
|
|
613
569
|
<Text
|
|
614
570
|
accessibilityRole="link"
|
|
615
571
|
allowFontScaling={false}
|
|
572
|
+
dynamicTypeRamp="body"
|
|
616
573
|
maxFontSizeMultiplier={1.25}
|
|
617
574
|
onPress={[Function]}
|
|
618
575
|
style={
|
|
@@ -625,7 +582,7 @@ exports[`Test Typography Components Link Snapshot 1`] = `
|
|
|
625
582
|
"fontFamily": "Titillium Sans Pro",
|
|
626
583
|
"fontSize": 16,
|
|
627
584
|
"fontStyle": "normal",
|
|
628
|
-
"fontWeight": "
|
|
585
|
+
"fontWeight": "400",
|
|
629
586
|
"lineHeight": 24,
|
|
630
587
|
},
|
|
631
588
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as TestRenderer from "react-test-renderer";
|
|
3
2
|
import { Alert } from "react-native";
|
|
3
|
+
import * as TestRenderer from "react-test-renderer";
|
|
4
4
|
import type { IOColors } from "../../../core/IOColors";
|
|
5
5
|
import { IOFontWeight } from "../../../utils/fonts";
|
|
6
6
|
import { Body } from "../Body";
|
|
@@ -12,8 +12,7 @@ import { H3 } from "../H3";
|
|
|
12
12
|
import { H4 } from "../H4";
|
|
13
13
|
import { H5 } from "../H5";
|
|
14
14
|
import { H6 } from "../H6";
|
|
15
|
-
import {
|
|
16
|
-
import { LabelSmall } from "../LabelSmall";
|
|
15
|
+
import { BodySmall } from "../BodySmall";
|
|
17
16
|
import { calculateWeightColor } from "../common";
|
|
18
17
|
|
|
19
18
|
describe("Test Typography Components", () => {
|
|
@@ -85,13 +84,13 @@ describe("Test Typography Components", () => {
|
|
|
85
84
|
const cta = TestRenderer.create(<ButtonText>Text</ButtonText>).toJSON();
|
|
86
85
|
expect(cta).toMatchSnapshot();
|
|
87
86
|
});
|
|
88
|
-
it("
|
|
87
|
+
it("BodySmall Snapshot", () => {
|
|
89
88
|
const labelSmallDefault = TestRenderer.create(
|
|
90
|
-
<
|
|
89
|
+
<BodySmall>Text</BodySmall>
|
|
91
90
|
).toJSON();
|
|
92
91
|
expect(labelSmallDefault).toMatchSnapshot();
|
|
93
92
|
|
|
94
|
-
type BodyColors = React.ComponentProps<typeof
|
|
93
|
+
type BodyColors = React.ComponentProps<typeof BodySmall>["color"];
|
|
95
94
|
|
|
96
95
|
const allowedColors: ReadonlyArray<BodyColors> = [
|
|
97
96
|
"blue",
|
|
@@ -102,31 +101,16 @@ describe("Test Typography Components", () => {
|
|
|
102
101
|
|
|
103
102
|
allowedColors.map(color => {
|
|
104
103
|
const labelSmall = TestRenderer.create(
|
|
105
|
-
<
|
|
104
|
+
<BodySmall color={color}>Text</BodySmall>
|
|
106
105
|
).toJSON();
|
|
107
106
|
expect(labelSmall).toMatchSnapshot();
|
|
108
107
|
});
|
|
109
108
|
});
|
|
110
|
-
it("Label Snapshot", () => {
|
|
111
|
-
const labelDefault = TestRenderer.create(<Label>Text</Label>).toJSON();
|
|
112
|
-
expect(labelDefault).toMatchSnapshot();
|
|
113
|
-
|
|
114
|
-
type BodyColors = React.ComponentProps<typeof Label>["color"];
|
|
115
|
-
|
|
116
|
-
const allowedColors: ReadonlyArray<BodyColors> = ["black"];
|
|
117
|
-
|
|
118
|
-
allowedColors.map(color => {
|
|
119
|
-
const label = TestRenderer.create(
|
|
120
|
-
<Label color={color}>Text</Label>
|
|
121
|
-
).toJSON();
|
|
122
|
-
expect(label).toMatchSnapshot();
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
109
|
it("Link Snapshot", () => {
|
|
126
110
|
const link = TestRenderer.create(
|
|
127
|
-
<
|
|
111
|
+
<Body asLink onPress={() => Alert.alert("Pressed")}>
|
|
128
112
|
Text
|
|
129
|
-
</
|
|
113
|
+
</Body>
|
|
130
114
|
).toJSON();
|
|
131
115
|
expect(link).toMatchSnapshot();
|
|
132
116
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export * from "./BaseTypography";
|
|
2
|
-
export * from "./IOText";
|
|
3
1
|
export * from "./Body";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./Chip";
|
|
2
|
+
export * from "./BodyMonospace";
|
|
3
|
+
export * from "./BodySmall";
|
|
7
4
|
export * from "./ButtonText";
|
|
8
|
-
export * from "./
|
|
5
|
+
export * from "./Caption";
|
|
6
|
+
export * from "./common";
|
|
7
|
+
export * from "./ComposedBodyFromArray";
|
|
9
8
|
export * from "./H1";
|
|
10
9
|
export * from "./H2";
|
|
11
10
|
export * from "./H3";
|
|
@@ -13,11 +12,8 @@ export * from "./H4";
|
|
|
13
12
|
export * from "./H5";
|
|
14
13
|
export * from "./H6";
|
|
15
14
|
export * from "./Hero";
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./LabelSmall";
|
|
15
|
+
export * from "./IOText";
|
|
18
16
|
export * from "./LabelMini";
|
|
19
|
-
export * from "./BodyMonospace";
|
|
20
|
-
export * from "./common";
|
|
21
17
|
export * from "./markdown/MdH1";
|
|
22
18
|
export * from "./markdown/MdH2";
|
|
23
19
|
export * from "./markdown/MdH3";
|
package/src/core/IOColors.ts
CHANGED
|
@@ -53,6 +53,7 @@ export const IOColors = asIOColors({
|
|
|
53
53
|
"turquoise-850": "#003B3D",
|
|
54
54
|
"turquoise-500": "#00C5CA",
|
|
55
55
|
"turquoise-450": "#19CBCF" /* Dark mode */,
|
|
56
|
+
"turquoise-300": "#61DCDF",
|
|
56
57
|
"turquoise-150": "#AAEEEF",
|
|
57
58
|
"turquoise-100": "#C2F3F4",
|
|
58
59
|
"turquoise-50": "#DBF9FA",
|
|
@@ -283,7 +284,10 @@ const themeKeys = [
|
|
|
283
284
|
// Status
|
|
284
285
|
"errorIcon",
|
|
285
286
|
"errorText",
|
|
287
|
+
"successIcon",
|
|
286
288
|
"successText",
|
|
289
|
+
"warningIcon",
|
|
290
|
+
"infoIcon",
|
|
287
291
|
// Pictograms
|
|
288
292
|
"pictogram-hands",
|
|
289
293
|
"pictogram-tint-main",
|
|
@@ -322,7 +326,10 @@ export const IOThemeLight: IOTheme = {
|
|
|
322
326
|
// Status
|
|
323
327
|
errorIcon: "error-600",
|
|
324
328
|
errorText: "error-600",
|
|
329
|
+
successIcon: "success-700",
|
|
325
330
|
successText: "success-700",
|
|
331
|
+
warningIcon: "warning-700",
|
|
332
|
+
infoIcon: "info-700",
|
|
326
333
|
// Pictograms
|
|
327
334
|
"pictogram-hands": "blueIO-500",
|
|
328
335
|
"pictogram-tint-main": "turquoise-150",
|
|
@@ -356,6 +363,7 @@ export const IOThemeDark: IOTheme = {
|
|
|
356
363
|
// Design System related
|
|
357
364
|
"cardBorder-default": "grey-850",
|
|
358
365
|
"icon-default": "grey-450",
|
|
366
|
+
"icon-decorative": "grey-650",
|
|
359
367
|
// Layout
|
|
360
368
|
"divider-header": "grey-850",
|
|
361
369
|
"divider-default": "grey-850",
|
|
@@ -364,6 +372,9 @@ export const IOThemeDark: IOTheme = {
|
|
|
364
372
|
errorIcon: "error-400",
|
|
365
373
|
errorText: "error-400",
|
|
366
374
|
successText: "success-400",
|
|
375
|
+
successIcon: "success-500",
|
|
376
|
+
warningIcon: "warning-500",
|
|
377
|
+
infoIcon: "info-500",
|
|
367
378
|
// Pictograms
|
|
368
379
|
"pictogram-hands": "white",
|
|
369
380
|
"pictogram-tint-main": "turquoise-150",
|
package/src/utils/fonts.ts
CHANGED
|
@@ -73,7 +73,7 @@ export const fontWeights: Record<IOFontWeight, IOFontWeightNumeric> = {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
type FontStyleObject = {
|
|
76
|
-
fontSize: IOFontSize;
|
|
76
|
+
fontSize: IOFontSize | number;
|
|
77
77
|
/* We also accept `string` because Android needs a composed
|
|
78
78
|
fontFamily name, like `TitilliumSansPro-Regular` */
|
|
79
79
|
fontFamily: string | IOFontFamily;
|
|
@@ -132,7 +132,7 @@ const defaultFontSize: IOFontSize = 16;
|
|
|
132
132
|
*/
|
|
133
133
|
|
|
134
134
|
export const makeFontStyleObject = (
|
|
135
|
-
size:
|
|
135
|
+
size: number = defaultFontSize,
|
|
136
136
|
font: IOFontFamily = defaultFont,
|
|
137
137
|
lineHeight: TextStyle["lineHeight"],
|
|
138
138
|
weight: IOFontWeight = defaultWeight,
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseTypography = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
var _IOColors = require("../../core/IOColors");
|
|
10
|
-
var _fonts = require("../../utils/fonts");
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
|
-
/**
|
|
15
|
-
* The specific properties needed to calculate the font style using {@link makeFontStyleObject} (these information
|
|
16
|
-
* cannot be included in the default StyleProp<TextStyle>
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Decorate the function {@link makeFontStyleObject} with the additional color calculation.
|
|
21
|
-
* @param color A value key from {@link IOColors}, transformed here in {@link ColorValue}
|
|
22
|
-
* @param args the args of the function {@link makeFontStyleObject}
|
|
23
|
-
*/
|
|
24
|
-
const calculateTextStyle = (color, ...args) => ({
|
|
25
|
-
...(0, _fonts.makeFontStyleObject)(...args),
|
|
26
|
-
color: _IOColors.IOColors[color]
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* `BaseTypography` is the core Typography component used to render a text.
|
|
31
|
-
* It accepts all the default text style `StyleProp<TextStyle>` in addition with {@link BaseTypographyProps}
|
|
32
|
-
* used to calculate at runtime the platform-dependent styles.
|
|
33
|
-
* This component shouldn't be used in the application but only to compose others `Typography elements`.
|
|
34
|
-
* @param props
|
|
35
|
-
* @deprecated Use {@link IOText} instead
|
|
36
|
-
* @constructor
|
|
37
|
-
*/
|
|
38
|
-
const BaseTypography = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
39
|
-
const fontStyle = (0, _react.useMemo)(() => {
|
|
40
|
-
var _props$fontStyle, _props$fontStyle2;
|
|
41
|
-
return calculateTextStyle(props.color, (_props$fontStyle = props.fontStyle) === null || _props$fontStyle === void 0 ? void 0 : _props$fontStyle.fontSize, props.font, (_props$fontStyle2 = props.fontStyle) === null || _props$fontStyle2 === void 0 ? void 0 : _props$fontStyle2.lineHeight, props.weight, props.isItalic ? "italic" : "normal");
|
|
42
|
-
}, [props.color, props.fontStyle, props.font, props.weight, props.isItalic]);
|
|
43
|
-
const style = props.style ? [props.style, props.fontStyle, fontStyle] : [props.fontStyle, fontStyle];
|
|
44
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, _extends({
|
|
45
|
-
allowFontScaling: false
|
|
46
|
-
}, props, {
|
|
47
|
-
ref: ref,
|
|
48
|
-
style: style
|
|
49
|
-
}), props.children);
|
|
50
|
-
});
|
|
51
|
-
exports.BaseTypography = BaseTypography;
|
|
52
|
-
//# sourceMappingURL=BaseTypography.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_IOColors","_fonts","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","calculateTextStyle","color","args","makeFontStyleObject","IOColors","BaseTypography","React","forwardRef","props","ref","fontStyle","useMemo","_props$fontStyle","_props$fontStyle2","fontSize","font","lineHeight","weight","isItalic","style","createElement","Text","allowFontScaling","children","exports"],"sourceRoot":"../../../../src","sources":["components/typography/BaseTypography.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAK2B,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAA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,CAAAnB,cAAA,GAAAA,cAAA"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Chip = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _core = require("../../core");
|
|
9
|
-
var _IOText = require("./IOText");
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
|
-
const fontName = "Titillio";
|
|
14
|
-
// TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
|
|
15
|
-
const legacyFontName = "TitilliumSansPro";
|
|
16
|
-
/**
|
|
17
|
-
* `Chip` typographic style
|
|
18
|
-
*/
|
|
19
|
-
const Chip = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
20
|
-
color: customColor,
|
|
21
|
-
...props
|
|
22
|
-
}, ref) => {
|
|
23
|
-
const theme = (0, _core.useIOTheme)();
|
|
24
|
-
const {
|
|
25
|
-
isExperimental
|
|
26
|
-
} = (0, _core.useIOExperimentalDesign)();
|
|
27
|
-
const ChipProps = {
|
|
28
|
-
...props,
|
|
29
|
-
dynamicTypeRamp: "caption2",
|
|
30
|
-
// iOS only
|
|
31
|
-
font: isExperimental ? fontName : legacyFontName,
|
|
32
|
-
weight: "Regular",
|
|
33
|
-
size: 12,
|
|
34
|
-
color: customColor ?? theme["textBody-default"]
|
|
35
|
-
};
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement(_IOText.IOText, _extends({
|
|
37
|
-
ref: ref
|
|
38
|
-
}, ChipProps), props.children);
|
|
39
|
-
});
|
|
40
|
-
exports.Chip = Chip;
|
|
41
|
-
//# sourceMappingURL=Chip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","fontName","legacyFontName","Chip","forwardRef","color","customColor","props","ref","theme","useIOTheme","isExperimental","useIOExperimentalDesign","ChipProps","dynamicTypeRamp","font","weight","size","createElement","IOText","children","exports"],"sourceRoot":"../../../../src","sources":["components/typography/Chip.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAAsE,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,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