@pagopa/io-app-design-system 1.21.0 → 1.23.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/avatar/Avatar.js +21 -8
- package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/layout/HeaderSecondLevel.js +2 -0
- package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js +2 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +13 -3
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -6
- package/lib/commonjs/components/modules/ModuleAttachment.js +196 -0
- package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -0
- package/lib/commonjs/components/modules/ModulePaymentNotice.js +7 -5
- package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/commonjs/components/modules/index.js +11 -0
- package/lib/commonjs/components/modules/index.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/avatar/Avatar.js +22 -8
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/layout/HeaderSecondLevel.js +2 -0
- package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
- package/lib/module/components/listitems/ListItemHeader.js +2 -1
- package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +13 -3
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -6
- package/lib/module/components/modules/ModuleAttachment.js +186 -0
- package/lib/module/components/modules/ModuleAttachment.js.map +1 -0
- package/lib/module/components/modules/ModulePaymentNotice.js +7 -5
- package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
- package/lib/module/components/modules/index.js +1 -0
- package/lib/module/components/modules/index.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/avatar/Avatar.d.ts +9 -1
- package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts +2 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleAttachment.d.ts +32 -0
- package/lib/typescript/components/modules/ModuleAttachment.d.ts.map +1 -0
- package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
- package/lib/typescript/components/modules/index.d.ts +1 -0
- package/lib/typescript/components/modules/index.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/avatar/Avatar.tsx +31 -13
- package/src/components/layout/HeaderSecondLevel.tsx +2 -0
- package/src/components/listitems/ListItemHeader.tsx +4 -1
- package/src/components/listitems/ListItemNav.tsx +15 -3
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -6
- package/src/components/modules/ModuleAttachment.tsx +254 -0
- package/src/components/modules/ModulePaymentNotice.tsx +14 -13
- package/src/components/modules/index.tsx +1 -0
- 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,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",
|