@pagopa/io-app-design-system 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +2 -2
- package/lib/commonjs/components/accordion/AccordionItem.js +1 -1
- package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -6
- package/lib/commonjs/components/modules/ModulePaymentNotice.js +7 -5
- package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js +5 -2
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/toast/ToastNotification.js +7 -3
- package/lib/commonjs/components/toast/ToastNotification.js.map +1 -1
- package/lib/commonjs/components/typography/Body.js +18 -11
- package/lib/commonjs/components/typography/Body.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H5.js +20 -13
- package/lib/commonjs/components/typography/H5.js.map +1 -1
- package/lib/commonjs/components/typography/Label.js +7 -2
- package/lib/commonjs/components/typography/Label.js.map +1 -1
- package/lib/commonjs/components/typography/LabelLink.js +4 -3
- package/lib/commonjs/components/typography/LabelLink.js.map +1 -1
- package/lib/commonjs/components/typography/LabelSmall.js +3 -2
- package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
- package/lib/commonjs/utils/fonts.js +5 -0
- package/lib/commonjs/utils/fonts.js.map +1 -1
- package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +2 -2
- package/lib/module/components/accordion/AccordionItem.js +1 -1
- package/lib/module/components/accordion/AccordionItem.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -6
- package/lib/module/components/modules/ModulePaymentNotice.js +7 -5
- package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/module/components/tag/Tag.js +5 -2
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/toast/ToastNotification.js +7 -3
- package/lib/module/components/toast/ToastNotification.js.map +1 -1
- package/lib/module/components/typography/Body.js +18 -11
- package/lib/module/components/typography/Body.js.map +1 -1
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H5.js +20 -13
- package/lib/module/components/typography/H5.js.map +1 -1
- package/lib/module/components/typography/Label.js +7 -2
- package/lib/module/components/typography/Label.js.map +1 -1
- package/lib/module/components/typography/LabelLink.js +4 -3
- package/lib/module/components/typography/LabelLink.js.map +1 -1
- package/lib/module/components/typography/LabelSmall.js +3 -2
- package/lib/module/components/typography/LabelSmall.js.map +1 -1
- package/lib/module/utils/fonts.js +5 -0
- package/lib/module/utils/fonts.js.map +1 -1
- package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts +2 -1
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H5.d.ts +1 -1
- package/lib/typescript/components/typography/H5.d.ts.map +1 -1
- package/lib/typescript/components/typography/Label.d.ts +1 -1
- package/lib/typescript/components/typography/Label.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelLink.d.ts +1 -1
- package/lib/typescript/components/typography/LabelLink.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelSmall.d.ts +1 -1
- package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
- package/lib/typescript/utils/fonts.d.ts +1 -0
- package/lib/typescript/utils/fonts.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +2 -2
- package/src/components/accordion/AccordionItem.tsx +1 -1
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -6
- package/src/components/modules/ModulePaymentNotice.tsx +14 -13
- package/src/components/tag/Tag.tsx +9 -2
- package/src/components/toast/ToastNotification.tsx +9 -2
- package/src/components/typography/Body.tsx +10 -5
- package/src/components/typography/H3.tsx +1 -0
- package/src/components/typography/H5.tsx +9 -5
- package/src/components/typography/Label.tsx +13 -5
- package/src/components/typography/LabelLink.tsx +5 -4
- package/src/components/typography/LabelSmall.tsx +4 -5
- package/src/utils/fonts.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelSmall.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/LabelSmall.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"LabelSmall.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/LabelSmall.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA2B,MAAM,YAAY,CAAC;AACxE,OAAO,EAAc,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E,KAAK,oBAAoB,GAAG,OAAO,CACjC,QAAQ,EACN,MAAM,GACN,UAAU,GACV,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,GACV,UAAU,CACb,CAAC;AACF,KAAK,aAAa,GAAG,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACzE,KAAK,aAAa,GAAG,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAE5E,KAAK,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AACpC,KAAK,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE/C,KAAK,eAAe,GAAG,uBAAuB,CAC5C,eAAe,CAAC,aAAa,EAAE,aAAa,CAAC,CAC9C,GACC,eAAe,GACf,QAAQ,CAAC;AAeX;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW,eAAe,gCAiBhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,QAAA,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../../src/utils/fonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,QAAA,MAAM,KAAK;;;;;CAqBV,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAE9C,QAAA,MAAM,OAAO,6DAA8D,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpD,QAAA,MAAM,YAAY,8CAA+C,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAM7D,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,KAAK,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,YAAY,EAAE,eAAe,CAMhE,CAAC;AAEF,oBAAY,SAAS;IACnB,QAAQ,WAAW;IACnB,QAAQ,WAAW;CACpB;AAED,KAAK,eAAe,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,UAAU,WACP,YAAY,aACX,OAAO,KAChB,MAMC,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YACtB,YAAY,GAAG,SAAS,aACtB,OAAO,GAAG,SAAS,SACvB,UAAU,GAAG,SAAS,KAC3B,eAgBC,CAAC"}
|
package/package.json
CHANGED
|
@@ -82,7 +82,7 @@ exports[`Test Advice Components - Experimental Enabled Advice Snapshot 1`] = `
|
|
|
82
82
|
color="bluegrey"
|
|
83
83
|
defaultColor="bluegrey"
|
|
84
84
|
defaultWeight="Regular"
|
|
85
|
-
font="
|
|
85
|
+
font="TitilliumSansPro"
|
|
86
86
|
fontStyle={
|
|
87
87
|
{
|
|
88
88
|
"fontSize": 16,
|
|
@@ -97,7 +97,7 @@ exports[`Test Advice Components - Experimental Enabled Advice Snapshot 1`] = `
|
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"color": "#475A6D",
|
|
100
|
-
"fontFamily": "Titillium
|
|
100
|
+
"fontFamily": "Titillium Sans Pro",
|
|
101
101
|
"fontStyle": "normal",
|
|
102
102
|
"fontWeight": "400",
|
|
103
103
|
},
|
|
@@ -174,7 +174,7 @@ const styles = StyleSheet.create({
|
|
|
174
174
|
fontSize: 14,
|
|
175
175
|
lineHeight: 21,
|
|
176
176
|
color: IOColors["grey-700"],
|
|
177
|
-
...makeFontStyleObject("Regular", undefined, "
|
|
177
|
+
...makeFontStyleObject("Regular", undefined, "TitilliumSansPro")
|
|
178
178
|
},
|
|
179
179
|
textContainer: {
|
|
180
180
|
padding: accordionBodySpacing,
|
|
@@ -233,7 +233,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfo Snapshot
|
|
|
233
233
|
color="grey-700"
|
|
234
234
|
defaultColor="blue"
|
|
235
235
|
defaultWeight="Bold"
|
|
236
|
-
font="
|
|
236
|
+
font="TitilliumSansPro"
|
|
237
237
|
fontStyle={
|
|
238
238
|
{
|
|
239
239
|
"fontSize": 14,
|
|
@@ -248,7 +248,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfo Snapshot
|
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
"color": "#555C70",
|
|
251
|
-
"fontFamily": "Titillium
|
|
251
|
+
"fontFamily": "Titillium Sans Pro",
|
|
252
252
|
"fontStyle": "normal",
|
|
253
253
|
"fontWeight": "400",
|
|
254
254
|
},
|
|
@@ -373,7 +373,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfoCopy Snap
|
|
|
373
373
|
color="grey-700"
|
|
374
374
|
defaultColor="blue"
|
|
375
375
|
defaultWeight="Bold"
|
|
376
|
-
font="
|
|
376
|
+
font="TitilliumSansPro"
|
|
377
377
|
fontStyle={
|
|
378
378
|
{
|
|
379
379
|
"fontSize": 14,
|
|
@@ -388,7 +388,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfoCopy Snap
|
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
390
|
"color": "#555C70",
|
|
391
|
-
"fontFamily": "Titillium
|
|
391
|
+
"fontFamily": "Titillium Sans Pro",
|
|
392
392
|
"fontStyle": "normal",
|
|
393
393
|
"fontWeight": "400",
|
|
394
394
|
},
|
|
@@ -1076,7 +1076,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmou
|
|
|
1076
1076
|
color="hanPurple-500"
|
|
1077
1077
|
defaultColor="blue"
|
|
1078
1078
|
defaultWeight="Bold"
|
|
1079
|
-
font="
|
|
1079
|
+
font="TitilliumSansPro"
|
|
1080
1080
|
fontStyle={
|
|
1081
1081
|
{
|
|
1082
1082
|
"fontSize": 14,
|
|
@@ -1091,7 +1091,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmou
|
|
|
1091
1091
|
},
|
|
1092
1092
|
{
|
|
1093
1093
|
"color": "#5517E3",
|
|
1094
|
-
"fontFamily": "Titillium
|
|
1094
|
+
"fontFamily": "Titillium Sans Pro",
|
|
1095
1095
|
"fontStyle": "normal",
|
|
1096
1096
|
"fontWeight": "400",
|
|
1097
1097
|
},
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { GestureResponderEvent, StyleSheet, View } from "react-native";
|
|
3
3
|
import Placeholder from "rn-placeholder";
|
|
4
|
-
import { WithTestID } from "../../utils/types";
|
|
5
|
-
import { getAccessibleAmountText } from "../../utils/accessibility";
|
|
6
|
-
import { H6, LabelSmall } from "../typography";
|
|
7
|
-
import { Badge } from "../badge";
|
|
8
|
-
import { Icon } from "../icons";
|
|
9
4
|
import {
|
|
10
5
|
IOListItemVisualParams,
|
|
11
6
|
IOModuleStyles,
|
|
12
7
|
IOStyles,
|
|
13
8
|
useIOExperimentalDesign
|
|
14
9
|
} from "../../core";
|
|
10
|
+
import { getAccessibleAmountText } from "../../utils/accessibility";
|
|
11
|
+
import { WithTestID } from "../../utils/types";
|
|
12
|
+
import { Badge } from "../badge";
|
|
13
|
+
import { Icon } from "../icons";
|
|
15
14
|
import { VSpacer } from "../spacer";
|
|
15
|
+
import { H6, LabelSmall, LabelSmallAlt } from "../typography";
|
|
16
16
|
import { PressableModuleBase } from "./PressableModuleBase";
|
|
17
17
|
|
|
18
18
|
export type PaymentNoticeStatus =
|
|
@@ -97,14 +97,15 @@ const ModulePaymentNoticeContent = ({
|
|
|
97
97
|
{title}
|
|
98
98
|
</LabelSmall>
|
|
99
99
|
)}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
{isExperimental ? (
|
|
101
|
+
<LabelSmallAlt color={"blueIO-500"} numberOfLines={2}>
|
|
102
|
+
{subtitle}
|
|
103
|
+
</LabelSmallAlt>
|
|
104
|
+
) : (
|
|
105
|
+
<LabelSmall weight="SemiBold" color={"bluegrey"} numberOfLines={2}>
|
|
106
|
+
{subtitle}
|
|
107
|
+
</LabelSmall>
|
|
108
|
+
)}
|
|
108
109
|
</View>
|
|
109
110
|
<View style={[styles.rightSection, { flexShrink: 1 }]}>
|
|
110
111
|
<AmountOrBadgeComponent />
|
|
@@ -23,6 +23,7 @@ export type Tag = WithTestID<{
|
|
|
23
23
|
| "success"
|
|
24
24
|
| "attachment"
|
|
25
25
|
| "noIcon";
|
|
26
|
+
iconAccessibilityLabel?: string;
|
|
26
27
|
}>;
|
|
27
28
|
|
|
28
29
|
type VariantProps = {
|
|
@@ -112,7 +113,7 @@ const styles = StyleSheet.create({
|
|
|
112
113
|
/**
|
|
113
114
|
* Tag component, used mainly for message list and details
|
|
114
115
|
*/
|
|
115
|
-
export const Tag = ({ text, variant, testID }: Tag) => {
|
|
116
|
+
export const Tag = ({ text, variant, testID, iconAccessibilityLabel }: Tag) => {
|
|
116
117
|
const { isExperimental } = useIOExperimentalDesign();
|
|
117
118
|
return (
|
|
118
119
|
<View testID={testID} style={styles.tag}>
|
|
@@ -123,7 +124,13 @@ export const Tag = ({ text, variant, testID }: Tag) => {
|
|
|
123
124
|
() => null,
|
|
124
125
|
({ iconColor, iconName }) => (
|
|
125
126
|
<View style={styles.iconWrapper}>
|
|
126
|
-
<Icon
|
|
127
|
+
<Icon
|
|
128
|
+
name={iconName}
|
|
129
|
+
color={iconColor}
|
|
130
|
+
size={IOTagIconSize}
|
|
131
|
+
accessible={!!iconAccessibilityLabel}
|
|
132
|
+
accessibilityLabel={iconAccessibilityLabel}
|
|
133
|
+
/>
|
|
127
134
|
</View>
|
|
128
135
|
)
|
|
129
136
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { IOAlertRadius, IOColors } from "../../core";
|
|
3
4
|
import { Icon } from "../icons";
|
|
4
|
-
import {
|
|
5
|
+
import { HSpacer } from "../spacer";
|
|
5
6
|
import { ButtonText } from "../typography";
|
|
6
7
|
import { Toast, ToastVariant } from "./types";
|
|
7
8
|
|
|
@@ -54,7 +55,12 @@ const ToastNotification = ({ message, variant = "neutral", icon }: Props) => {
|
|
|
54
55
|
<ButtonText color={colors.stroke} style={styles.content}>
|
|
55
56
|
{message}
|
|
56
57
|
</ButtonText>
|
|
57
|
-
{icon &&
|
|
58
|
+
{icon && (
|
|
59
|
+
<>
|
|
60
|
+
<HSpacer size={16} />
|
|
61
|
+
<Icon name={icon} size={24} color={colors.stroke} />
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
58
64
|
</View>
|
|
59
65
|
);
|
|
60
66
|
};
|
|
@@ -69,6 +75,7 @@ const styles = StyleSheet.create({
|
|
|
69
75
|
justifyContent: "space-between"
|
|
70
76
|
},
|
|
71
77
|
content: {
|
|
78
|
+
flexShrink: 1,
|
|
72
79
|
paddingVertical: 2
|
|
73
80
|
}
|
|
74
81
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IOColors, IOTheme } from "../../core";
|
|
1
|
+
import { IOColors, IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
3
|
import { useTypographyFactory } from "./Factory";
|
|
4
4
|
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
@@ -14,7 +14,9 @@ type BodyProps = ExternalTypographyProps<
|
|
|
14
14
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
15
15
|
>;
|
|
16
16
|
|
|
17
|
-
const fontName: FontFamily = "
|
|
17
|
+
const fontName: FontFamily = "TitilliumSansPro";
|
|
18
|
+
const legacyFontName: FontFamily = "TitilliumWeb";
|
|
19
|
+
|
|
18
20
|
export const bodyFontSize = 16;
|
|
19
21
|
export const bodyLineHeight = 24;
|
|
20
22
|
export const bodyDefaultColor: AllowedColors = "bluegrey";
|
|
@@ -23,11 +25,14 @@ export const bodyDefaultWeight: AllowedWeight = "Regular";
|
|
|
23
25
|
/**
|
|
24
26
|
* `Body` typographic style
|
|
25
27
|
*/
|
|
26
|
-
export const Body = (props: BodyProps) =>
|
|
27
|
-
|
|
28
|
+
export const Body = (props: BodyProps) => {
|
|
29
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
30
|
+
|
|
31
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
28
32
|
...props,
|
|
29
33
|
defaultWeight: bodyDefaultWeight,
|
|
30
34
|
defaultColor: bodyDefaultColor,
|
|
31
|
-
font: fontName,
|
|
35
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
32
36
|
fontStyle: { fontSize: bodyFontSize, lineHeight: bodyLineHeight }
|
|
33
37
|
});
|
|
38
|
+
};
|
|
@@ -28,6 +28,7 @@ const legacyH3LineHeight = 34;
|
|
|
28
28
|
*/
|
|
29
29
|
export const H3 = (props: H3Props) => {
|
|
30
30
|
const { isExperimental } = useIOExperimentalDesign();
|
|
31
|
+
|
|
31
32
|
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
32
33
|
...props,
|
|
33
34
|
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IOTheme } from "../../core
|
|
1
|
+
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
3
|
import { useTypographyFactory } from "./Factory";
|
|
4
4
|
import { ExternalTypographyProps, TypographyProps } from "./common";
|
|
@@ -12,19 +12,22 @@ type H5Props = ExternalTypographyProps<
|
|
|
12
12
|
|
|
13
13
|
export const h5FontSize = 14;
|
|
14
14
|
export const h5LineHeight = 16;
|
|
15
|
-
const font: FontFamily = "
|
|
15
|
+
const font: FontFamily = "TitilliumSansPro";
|
|
16
|
+
const legacyFont: FontFamily = "TitilliumWeb";
|
|
16
17
|
const defaultColor: AllowedColors = "black";
|
|
17
18
|
const defaultWeight: AllowedWeight = "SemiBold";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* `H5` typographic style
|
|
21
22
|
*/
|
|
22
|
-
export const H5 = (props: H5Props) =>
|
|
23
|
-
|
|
23
|
+
export const H5 = (props: H5Props) => {
|
|
24
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
25
|
+
|
|
26
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
24
27
|
...props,
|
|
25
28
|
defaultWeight,
|
|
26
29
|
defaultColor,
|
|
27
|
-
font,
|
|
30
|
+
font: isExperimental ? font : legacyFont,
|
|
28
31
|
fontStyle: {
|
|
29
32
|
fontSize: h5FontSize,
|
|
30
33
|
lineHeight: h5LineHeight,
|
|
@@ -32,3 +35,4 @@ export const H5 = (props: H5Props) =>
|
|
|
32
35
|
letterSpacing: 0.5
|
|
33
36
|
}
|
|
34
37
|
});
|
|
38
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
IOColors,
|
|
3
|
+
IOColorsStatusForeground,
|
|
4
|
+
useIOExperimentalDesign
|
|
5
|
+
} from "../../core";
|
|
2
6
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
7
|
import { useTypographyFactory } from "./Factory";
|
|
4
8
|
import {
|
|
@@ -16,19 +20,22 @@ type LabelProps = ExternalTypographyProps<
|
|
|
16
20
|
TypographyProps<AllowedWeight, AllowedColors>
|
|
17
21
|
> & { fontSize?: FontSize };
|
|
18
22
|
|
|
19
|
-
const fontName: FontFamily = "
|
|
23
|
+
const fontName: FontFamily = "TitilliumSansPro";
|
|
24
|
+
const legacyFontName: FontFamily = "TitilliumWeb";
|
|
20
25
|
const labelDefaultWeight = "Bold";
|
|
21
26
|
const labelDefaultcolor = "black";
|
|
22
27
|
|
|
23
28
|
/**
|
|
24
29
|
* `Label` typographic style
|
|
25
30
|
*/
|
|
26
|
-
export const Label = ({ fontSize, ...props }: LabelProps) =>
|
|
27
|
-
|
|
31
|
+
export const Label = ({ fontSize, ...props }: LabelProps) => {
|
|
32
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
33
|
+
|
|
34
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>({
|
|
28
35
|
...props,
|
|
29
36
|
defaultWeight: labelDefaultWeight,
|
|
30
37
|
defaultColor: labelDefaultcolor,
|
|
31
|
-
font: fontName,
|
|
38
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
32
39
|
fontStyle: {
|
|
33
40
|
fontSize: fontSize ? fontSizeMapping[fontSize] : fontSizeMapping.regular,
|
|
34
41
|
lineHeight: fontSize
|
|
@@ -36,3 +43,4 @@ export const Label = ({ fontSize, ...props }: LabelProps) =>
|
|
|
36
43
|
: lineHeightMapping.regular
|
|
37
44
|
}
|
|
38
45
|
});
|
|
46
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
2
1
|
import { useIOExperimentalDesign, type IOColors } from "../../core";
|
|
2
|
+
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
|
+
import { useTypographyFactory } from "./Factory";
|
|
3
4
|
import {
|
|
4
5
|
ExternalTypographyProps,
|
|
5
6
|
FontSize,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
fontSizeMapping,
|
|
8
9
|
lineHeightMapping
|
|
9
10
|
} from "./common";
|
|
10
|
-
import { useTypographyFactory } from "./Factory";
|
|
11
11
|
|
|
12
12
|
type AllowedColors = IOColors;
|
|
13
13
|
type AllowedWeight = Extract<IOFontWeight, "SemiBold">;
|
|
@@ -18,7 +18,8 @@ type LinkProps = ExternalTypographyProps<
|
|
|
18
18
|
> &
|
|
19
19
|
AllowedFontSize;
|
|
20
20
|
|
|
21
|
-
const fontName: IOFontFamily = "
|
|
21
|
+
const fontName: IOFontFamily = "TitilliumSansPro";
|
|
22
|
+
const legacyFontName: IOFontFamily = "TitilliumWeb";
|
|
22
23
|
|
|
23
24
|
export const linkLegacyDefaultColor: AllowedColors = "blue";
|
|
24
25
|
|
|
@@ -36,7 +37,7 @@ export const LabelLink = (props: LinkProps) => {
|
|
|
36
37
|
...props,
|
|
37
38
|
defaultWeight: linkDefaultWeight,
|
|
38
39
|
defaultColor: isExperimental ? linkDefaultColor : linkLegacyDefaultColor,
|
|
39
|
-
font: fontName,
|
|
40
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
40
41
|
fontStyle: {
|
|
41
42
|
fontSize: props.fontSize
|
|
42
43
|
? fontSizeMapping[props.fontSize]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { useIOExperimentalDesign } from "../../core";
|
|
2
|
-
import type { IOColors, IOTheme } from "../../core/IOColors";
|
|
1
|
+
import { IOColors, IOTheme, useIOExperimentalDesign } from "../../core";
|
|
3
2
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
4
3
|
import { useTypographyFactory } from "./Factory";
|
|
5
4
|
import { ExternalTypographyProps, FontType, TypographyProps } from "./common";
|
|
@@ -26,7 +25,8 @@ type LabelSmallProps = ExternalTypographyProps<
|
|
|
26
25
|
AllowedFontSize &
|
|
27
26
|
FontType;
|
|
28
27
|
|
|
29
|
-
const
|
|
28
|
+
const fontName: FontFamily = "TitilliumSansPro";
|
|
29
|
+
const legacyFontName: FontFamily = "TitilliumWeb";
|
|
30
30
|
const fontSizeMapping: Record<FontSize, number> = {
|
|
31
31
|
regular: 14,
|
|
32
32
|
small: 12
|
|
@@ -48,8 +48,7 @@ export const LabelSmall = (props: LabelSmallProps) => {
|
|
|
48
48
|
...props,
|
|
49
49
|
defaultWeight: labelDefaultWeight,
|
|
50
50
|
defaultColor: labelDefaultcolor,
|
|
51
|
-
font:
|
|
52
|
-
isExperimental && props.font !== undefined ? props.font : defaultFontName,
|
|
51
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
53
52
|
fontStyle: {
|
|
54
53
|
fontSize: props.fontSize
|
|
55
54
|
? fontSizeMapping[props.fontSize]
|
package/src/utils/fonts.ts
CHANGED
|
@@ -15,6 +15,11 @@ const fonts = {
|
|
|
15
15
|
web: "TitilliumWeb",
|
|
16
16
|
ios: "Titillium Web"
|
|
17
17
|
}),
|
|
18
|
+
TitilliumSansPro: Platform.select({
|
|
19
|
+
android: "TitilliumSansPro",
|
|
20
|
+
web: "TitilliumSansPro",
|
|
21
|
+
ios: "Titillium Sans Pro"
|
|
22
|
+
}),
|
|
18
23
|
ReadexPro: Platform.select({
|
|
19
24
|
android: "ReadexPro",
|
|
20
25
|
web: "ReadexPro",
|