@pagopa/io-app-design-system 1.4.0 → 1.5.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/README.md +10 -0
- package/lib/commonjs/components/alert/Alert.js +1 -1
- package/lib/commonjs/components/alert/Alert.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/buttons/ButtonExtendedOutline.js +1 -1
- package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonLink.js +6 -6
- package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +10 -10
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +5 -5
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButton.js +4 -4
- package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonContained.js +4 -4
- package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/commonjs/components/buttons/IconButtonSolid.js +5 -5
- package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/layout/BlockButtons.js +82 -0
- package/lib/commonjs/components/layout/BlockButtons.js.map +1 -0
- package/lib/commonjs/components/layout/FooterWithButtons.js +41 -0
- package/lib/commonjs/components/layout/FooterWithButtons.js.map +1 -0
- package/lib/commonjs/components/layout/index.js +11 -0
- package/lib/commonjs/components/layout/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAction.js +1 -1
- package/lib/commonjs/components/listitems/ListItemAction.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/ListItemIDP.js +1 -1
- package/lib/commonjs/components/listitems/ListItemIDP.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/hooks/useListItemSpringAnimation.js +1 -1
- package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.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/tabs/TabNavigation.js +2 -2
- package/lib/commonjs/components/tabs/TabNavigation.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +5 -5
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputPassword.js +1 -1
- package/lib/commonjs/components/textInput/TextInputPassword.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputValidation.js +2 -2
- package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/commonjs/stories/ButtonDS.stories.js +34 -0
- package/lib/commonjs/stories/ButtonDS.stories.js.map +1 -0
- package/lib/commonjs/stories/H1.stories.js +33 -0
- package/lib/commonjs/stories/H1.stories.js.map +1 -0
- package/lib/commonjs/stories/H2.stories.js +33 -0
- package/lib/commonjs/stories/H2.stories.js.map +1 -0
- package/lib/commonjs/stories/H3.stories.js +33 -0
- package/lib/commonjs/stories/H3.stories.js.map +1 -0
- package/lib/commonjs/stories/H4.stories.js +33 -0
- package/lib/commonjs/stories/H4.stories.js.map +1 -0
- package/lib/commonjs/stories/H5.stories.js +33 -0
- package/lib/commonjs/stories/H5.stories.js.map +1 -0
- package/lib/commonjs/stories/H6.stories.js +33 -0
- package/lib/commonjs/stories/H6.stories.js.map +1 -0
- package/lib/commonjs/stories/Label.stories.js +33 -0
- package/lib/commonjs/stories/Label.stories.js.map +1 -0
- package/lib/commonjs/stories/LabelSmall.stories.js +33 -0
- package/lib/commonjs/stories/LabelSmall.stories.js.map +1 -0
- package/lib/commonjs/stories/Link.stories.js +33 -0
- package/lib/commonjs/stories/Link.stories.js.map +1 -0
- package/lib/commonjs/stories/Monospace.stories.js +33 -0
- package/lib/commonjs/stories/Monospace.stories.js.map +1 -0
- package/lib/commonjs/utils/fonts.js +13 -4
- package/lib/commonjs/utils/fonts.js.map +1 -1
- package/lib/module/components/alert/Alert.js +1 -1
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/banner/Banner.js +1 -1
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/buttons/ButtonExtendedOutline.js +1 -1
- package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonLink.js +6 -6
- package/lib/module/components/buttons/ButtonLink.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +10 -10
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +5 -5
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButton.js +4 -4
- package/lib/module/components/buttons/IconButton.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js +4 -4
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js +5 -5
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/layout/BlockButtons.js +73 -0
- package/lib/module/components/layout/BlockButtons.js.map +1 -0
- package/lib/module/components/layout/FooterWithButtons.js +32 -0
- package/lib/module/components/layout/FooterWithButtons.js.map +1 -0
- package/lib/module/components/layout/index.js +1 -0
- package/lib/module/components/layout/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemAction.js +1 -1
- package/lib/module/components/listitems/ListItemAction.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemIDP.js +1 -1
- package/lib/module/components/listitems/ListItemIDP.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js +1 -1
- package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +1 -1
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +1 -1
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js +1 -1
- package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +1 -1
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tabs/TabNavigation.js +2 -2
- package/lib/module/components/tabs/TabNavigation.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +5 -5
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/textInput/TextInputPassword.js +1 -1
- package/lib/module/components/textInput/TextInputPassword.js.map +1 -1
- package/lib/module/components/textInput/TextInputValidation.js +2 -2
- package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/module/stories/ButtonDS.stories.js +27 -0
- package/lib/module/stories/ButtonDS.stories.js.map +1 -0
- package/lib/module/stories/H1.stories.js +26 -0
- package/lib/module/stories/H1.stories.js.map +1 -0
- package/lib/module/stories/H2.stories.js +26 -0
- package/lib/module/stories/H2.stories.js.map +1 -0
- package/lib/module/stories/H3.stories.js +26 -0
- package/lib/module/stories/H3.stories.js.map +1 -0
- package/lib/module/stories/H4.stories.js +26 -0
- package/lib/module/stories/H4.stories.js.map +1 -0
- package/lib/module/stories/H5.stories.js +26 -0
- package/lib/module/stories/H5.stories.js.map +1 -0
- package/lib/module/stories/H6.stories.js +26 -0
- package/lib/module/stories/H6.stories.js.map +1 -0
- package/lib/module/stories/Label.stories.js +26 -0
- package/lib/module/stories/Label.stories.js.map +1 -0
- package/lib/module/stories/LabelSmall.stories.js +26 -0
- package/lib/module/stories/LabelSmall.stories.js.map +1 -0
- package/lib/module/stories/Link.stories.js +26 -0
- package/lib/module/stories/Link.stories.js.map +1 -0
- package/lib/module/stories/Monospace.stories.js +26 -0
- package/lib/module/stories/Monospace.stories.js.map +1 -0
- package/lib/module/utils/fonts.js +13 -4
- package/lib/module/utils/fonts.js.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +16 -0
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/components/layout/BlockButtons.d.ts +53 -0
- package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -0
- package/lib/typescript/components/layout/FooterWithButtons.d.ts +9 -0
- package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +1 -0
- package/lib/typescript/components/layout/index.d.ts +1 -0
- package/lib/typescript/components/layout/index.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/stories/ButtonDS.stories.d.ts +14 -0
- package/lib/typescript/stories/ButtonDS.stories.d.ts.map +1 -0
- package/lib/typescript/stories/H1.stories.d.ts +19 -0
- package/lib/typescript/stories/H1.stories.d.ts.map +1 -0
- package/lib/typescript/stories/H2.stories.d.ts +19 -0
- package/lib/typescript/stories/H2.stories.d.ts.map +1 -0
- package/lib/typescript/stories/H3.stories.d.ts +19 -0
- package/lib/typescript/stories/H3.stories.d.ts.map +1 -0
- package/lib/typescript/stories/H4.stories.d.ts +19 -0
- package/lib/typescript/stories/H4.stories.d.ts.map +1 -0
- package/lib/typescript/stories/H5.stories.d.ts +27 -0
- package/lib/typescript/stories/H5.stories.d.ts.map +1 -0
- package/lib/typescript/stories/H6.stories.d.ts +19 -0
- package/lib/typescript/stories/H6.stories.d.ts.map +1 -0
- package/lib/typescript/stories/Label.stories.d.ts +19 -0
- package/lib/typescript/stories/Label.stories.d.ts.map +1 -0
- package/lib/typescript/stories/LabelSmall.stories.d.ts +21 -0
- package/lib/typescript/stories/LabelSmall.stories.d.ts.map +1 -0
- package/lib/typescript/stories/Link.stories.d.ts +21 -0
- package/lib/typescript/stories/Link.stories.d.ts.map +1 -0
- package/lib/typescript/stories/Monospace.stories.d.ts +19 -0
- package/lib/typescript/stories/Monospace.stories.d.ts.map +1 -0
- package/lib/typescript/utils/fonts.d.ts.map +1 -1
- package/package.json +25 -4
- package/src/components/buttons/ButtonSolid.tsx +16 -0
- package/src/components/index.tsx +1 -0
- package/src/components/layout/BlockButtons.tsx +142 -0
- package/src/components/layout/FooterWithButtons.tsx +37 -0
- package/src/components/layout/index.tsx +1 -0
- package/src/components/textInput/TextInputBase.tsx +2 -2
- package/src/stories/ButtonDS.stories.ts +31 -0
- package/src/stories/H1.stories.ts +28 -0
- package/src/stories/H2.stories.ts +28 -0
- package/src/stories/H3.stories.ts +28 -0
- package/src/stories/H4.stories.ts +28 -0
- package/src/stories/H5.stories.ts +28 -0
- package/src/stories/H6.stories.ts +28 -0
- package/src/stories/Label.stories.ts +28 -0
- package/src/stories/LabelSmall.stories.ts +28 -0
- package/src/stories/Link.stories.ts +28 -0
- package/src/stories/Monospace.stories.ts +28 -0
- package/src/utils/fonts.ts +12 -5
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import { Alert } from "react-native";
|
|
4
|
+
import { LabelSmall } from "../components";
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Example/LabelSmall",
|
|
9
|
+
component: LabelSmall,
|
|
10
|
+
parameters: {
|
|
11
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
12
|
+
layout: "centered",
|
|
13
|
+
actions: { argTypesRegex: "^on.*" }
|
|
14
|
+
},
|
|
15
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
16
|
+
tags: ["autodocs"],
|
|
17
|
+
} satisfies Meta<typeof LabelSmall>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Primary: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
accessibilityLabel: "Tap to trigger test alert",
|
|
25
|
+
onPress: () => Alert.alert("Alert", "Action triggered"),
|
|
26
|
+
children: "Hello World"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import { Alert } from "react-native";
|
|
4
|
+
import { Link } from "../components";
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Example/Link",
|
|
9
|
+
component: Link,
|
|
10
|
+
parameters: {
|
|
11
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
12
|
+
layout: "centered",
|
|
13
|
+
actions: { argTypesRegex: "^on.*" }
|
|
14
|
+
},
|
|
15
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
16
|
+
tags: ["autodocs"],
|
|
17
|
+
} satisfies Meta<typeof Link>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Primary: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
accessibilityLabel: "Tap to trigger test alert",
|
|
25
|
+
onPress: () => Alert.alert("Alert", "Action triggered"),
|
|
26
|
+
children: "Hello World"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import { Alert } from "react-native";
|
|
4
|
+
import { Monospace } from "../components";
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Example/Monospace",
|
|
9
|
+
component: Monospace,
|
|
10
|
+
parameters: {
|
|
11
|
+
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
|
|
12
|
+
layout: "centered",
|
|
13
|
+
actions: { argTypesRegex: "^on.*" }
|
|
14
|
+
},
|
|
15
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
16
|
+
tags: ["autodocs"],
|
|
17
|
+
} satisfies Meta<typeof Monospace>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Primary: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
accessibilityLabel: "Tap to trigger test alert",
|
|
25
|
+
onPress: () => Alert.alert("Alert", "Action triggered"),
|
|
26
|
+
children: "Hello World"
|
|
27
|
+
}
|
|
28
|
+
};
|
package/src/utils/fonts.ts
CHANGED
|
@@ -20,14 +20,17 @@ export type FontWeightValue = (typeof weightValues)[number];
|
|
|
20
20
|
const fonts = {
|
|
21
21
|
TitilliumWeb: Platform.select({
|
|
22
22
|
android: "TitilliumWeb",
|
|
23
|
+
web: "TitilliumWeb",
|
|
23
24
|
ios: "Titillium Web"
|
|
24
25
|
}),
|
|
25
26
|
ReadexPro: Platform.select({
|
|
26
27
|
android: "ReadexPro",
|
|
28
|
+
web: "ReadexPro",
|
|
27
29
|
ios: "Readex Pro"
|
|
28
30
|
}),
|
|
29
31
|
RobotoMono: Platform.select({
|
|
30
32
|
android: "RobotoMono",
|
|
33
|
+
web: "RobotoMono",
|
|
31
34
|
ios: "Roboto Mono"
|
|
32
35
|
})
|
|
33
36
|
};
|
|
@@ -80,9 +83,10 @@ export const makeFontFamilyName = (
|
|
|
80
83
|
isItalic: boolean = false
|
|
81
84
|
): string =>
|
|
82
85
|
Platform.select({
|
|
83
|
-
|
|
86
|
+
web: fonts[font],
|
|
84
87
|
android: `${fonts[font]}-${weight || "Regular"}${isItalic ? "Italic" : ""}`,
|
|
85
|
-
ios: fonts[font]
|
|
88
|
+
ios: fonts[font],
|
|
89
|
+
default: "undefined"
|
|
86
90
|
});
|
|
87
91
|
|
|
88
92
|
/**
|
|
@@ -97,8 +101,10 @@ export const makeFontStyleObject = (
|
|
|
97
101
|
font: FontFamily | undefined = "TitilliumWeb"
|
|
98
102
|
): FontStyleObject =>
|
|
99
103
|
Platform.select({
|
|
100
|
-
|
|
101
|
-
fontFamily:
|
|
104
|
+
web: {
|
|
105
|
+
fontFamily: makeFontFamilyName(font, weight, isItalic),
|
|
106
|
+
fontWeight: weight !== undefined ? fontWeightsMap[weight] : weight,
|
|
107
|
+
fontStyle: isItalic ? FontStyle.italic : FontStyle.normal
|
|
102
108
|
},
|
|
103
109
|
android: {
|
|
104
110
|
fontFamily: makeFontFamilyName(font, weight, isItalic)
|
|
@@ -107,5 +113,6 @@ export const makeFontStyleObject = (
|
|
|
107
113
|
fontFamily: makeFontFamilyName(font, weight, isItalic),
|
|
108
114
|
fontWeight: weight !== undefined ? fontWeightsMap[weight] : weight,
|
|
109
115
|
fontStyle: isItalic ? FontStyle.italic : FontStyle.normal
|
|
110
|
-
}
|
|
116
|
+
},
|
|
117
|
+
default: { fontFamily: "undefined" }
|
|
111
118
|
});
|