@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.
Files changed (206) hide show
  1. package/README.md +10 -0
  2. package/lib/commonjs/components/alert/Alert.js +1 -1
  3. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  4. package/lib/commonjs/components/banner/Banner.js +1 -1
  5. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  6. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +1 -1
  7. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  8. package/lib/commonjs/components/buttons/ButtonLink.js +6 -6
  9. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  10. package/lib/commonjs/components/buttons/ButtonOutline.js +10 -10
  11. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonSolid.js +5 -5
  13. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  14. package/lib/commonjs/components/buttons/IconButton.js +4 -4
  15. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  16. package/lib/commonjs/components/buttons/IconButtonContained.js +4 -4
  17. package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
  18. package/lib/commonjs/components/buttons/IconButtonSolid.js +5 -5
  19. package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
  20. package/lib/commonjs/components/index.js +11 -0
  21. package/lib/commonjs/components/index.js.map +1 -1
  22. package/lib/commonjs/components/layout/BlockButtons.js +82 -0
  23. package/lib/commonjs/components/layout/BlockButtons.js.map +1 -0
  24. package/lib/commonjs/components/layout/FooterWithButtons.js +41 -0
  25. package/lib/commonjs/components/layout/FooterWithButtons.js.map +1 -0
  26. package/lib/commonjs/components/layout/index.js +11 -0
  27. package/lib/commonjs/components/layout/index.js.map +1 -1
  28. package/lib/commonjs/components/listitems/ListItemAction.js +1 -1
  29. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  30. package/lib/commonjs/components/listitems/ListItemCheckbox.js +1 -1
  31. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  32. package/lib/commonjs/components/listitems/ListItemIDP.js +1 -1
  33. package/lib/commonjs/components/listitems/ListItemIDP.js.map +1 -1
  34. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
  35. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  36. package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
  37. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  38. package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -1
  39. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  40. package/lib/commonjs/components/listitems/ListItemRadio.js +1 -1
  41. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  42. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js +1 -1
  43. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  44. package/lib/commonjs/components/tabs/TabItem.js +1 -1
  45. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  46. package/lib/commonjs/components/tabs/TabNavigation.js +2 -2
  47. package/lib/commonjs/components/tabs/TabNavigation.js.map +1 -1
  48. package/lib/commonjs/components/textInput/TextInputBase.js +5 -5
  49. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  50. package/lib/commonjs/components/textInput/TextInputPassword.js +1 -1
  51. package/lib/commonjs/components/textInput/TextInputPassword.js.map +1 -1
  52. package/lib/commonjs/components/textInput/TextInputValidation.js +2 -2
  53. package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
  54. package/lib/commonjs/stories/ButtonDS.stories.js +34 -0
  55. package/lib/commonjs/stories/ButtonDS.stories.js.map +1 -0
  56. package/lib/commonjs/stories/H1.stories.js +33 -0
  57. package/lib/commonjs/stories/H1.stories.js.map +1 -0
  58. package/lib/commonjs/stories/H2.stories.js +33 -0
  59. package/lib/commonjs/stories/H2.stories.js.map +1 -0
  60. package/lib/commonjs/stories/H3.stories.js +33 -0
  61. package/lib/commonjs/stories/H3.stories.js.map +1 -0
  62. package/lib/commonjs/stories/H4.stories.js +33 -0
  63. package/lib/commonjs/stories/H4.stories.js.map +1 -0
  64. package/lib/commonjs/stories/H5.stories.js +33 -0
  65. package/lib/commonjs/stories/H5.stories.js.map +1 -0
  66. package/lib/commonjs/stories/H6.stories.js +33 -0
  67. package/lib/commonjs/stories/H6.stories.js.map +1 -0
  68. package/lib/commonjs/stories/Label.stories.js +33 -0
  69. package/lib/commonjs/stories/Label.stories.js.map +1 -0
  70. package/lib/commonjs/stories/LabelSmall.stories.js +33 -0
  71. package/lib/commonjs/stories/LabelSmall.stories.js.map +1 -0
  72. package/lib/commonjs/stories/Link.stories.js +33 -0
  73. package/lib/commonjs/stories/Link.stories.js.map +1 -0
  74. package/lib/commonjs/stories/Monospace.stories.js +33 -0
  75. package/lib/commonjs/stories/Monospace.stories.js.map +1 -0
  76. package/lib/commonjs/utils/fonts.js +13 -4
  77. package/lib/commonjs/utils/fonts.js.map +1 -1
  78. package/lib/module/components/alert/Alert.js +1 -1
  79. package/lib/module/components/alert/Alert.js.map +1 -1
  80. package/lib/module/components/banner/Banner.js +1 -1
  81. package/lib/module/components/banner/Banner.js.map +1 -1
  82. package/lib/module/components/buttons/ButtonExtendedOutline.js +1 -1
  83. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  84. package/lib/module/components/buttons/ButtonLink.js +6 -6
  85. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  86. package/lib/module/components/buttons/ButtonOutline.js +10 -10
  87. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  88. package/lib/module/components/buttons/ButtonSolid.js +5 -5
  89. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  90. package/lib/module/components/buttons/IconButton.js +4 -4
  91. package/lib/module/components/buttons/IconButton.js.map +1 -1
  92. package/lib/module/components/buttons/IconButtonContained.js +4 -4
  93. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  94. package/lib/module/components/buttons/IconButtonSolid.js +5 -5
  95. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  96. package/lib/module/components/index.js +1 -0
  97. package/lib/module/components/index.js.map +1 -1
  98. package/lib/module/components/layout/BlockButtons.js +73 -0
  99. package/lib/module/components/layout/BlockButtons.js.map +1 -0
  100. package/lib/module/components/layout/FooterWithButtons.js +32 -0
  101. package/lib/module/components/layout/FooterWithButtons.js.map +1 -0
  102. package/lib/module/components/layout/index.js +1 -0
  103. package/lib/module/components/layout/index.js.map +1 -1
  104. package/lib/module/components/listitems/ListItemAction.js +1 -1
  105. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  106. package/lib/module/components/listitems/ListItemCheckbox.js +1 -1
  107. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  108. package/lib/module/components/listitems/ListItemIDP.js +1 -1
  109. package/lib/module/components/listitems/ListItemIDP.js.map +1 -1
  110. package/lib/module/components/listitems/ListItemInfoCopy.js +1 -1
  111. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  112. package/lib/module/components/listitems/ListItemNav.js +1 -1
  113. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  114. package/lib/module/components/listitems/ListItemNavAlert.js +1 -1
  115. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  116. package/lib/module/components/listitems/ListItemRadio.js +1 -1
  117. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  118. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js +1 -1
  119. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
  120. package/lib/module/components/tabs/TabItem.js +1 -1
  121. package/lib/module/components/tabs/TabItem.js.map +1 -1
  122. package/lib/module/components/tabs/TabNavigation.js +2 -2
  123. package/lib/module/components/tabs/TabNavigation.js.map +1 -1
  124. package/lib/module/components/textInput/TextInputBase.js +5 -5
  125. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  126. package/lib/module/components/textInput/TextInputPassword.js +1 -1
  127. package/lib/module/components/textInput/TextInputPassword.js.map +1 -1
  128. package/lib/module/components/textInput/TextInputValidation.js +2 -2
  129. package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
  130. package/lib/module/stories/ButtonDS.stories.js +27 -0
  131. package/lib/module/stories/ButtonDS.stories.js.map +1 -0
  132. package/lib/module/stories/H1.stories.js +26 -0
  133. package/lib/module/stories/H1.stories.js.map +1 -0
  134. package/lib/module/stories/H2.stories.js +26 -0
  135. package/lib/module/stories/H2.stories.js.map +1 -0
  136. package/lib/module/stories/H3.stories.js +26 -0
  137. package/lib/module/stories/H3.stories.js.map +1 -0
  138. package/lib/module/stories/H4.stories.js +26 -0
  139. package/lib/module/stories/H4.stories.js.map +1 -0
  140. package/lib/module/stories/H5.stories.js +26 -0
  141. package/lib/module/stories/H5.stories.js.map +1 -0
  142. package/lib/module/stories/H6.stories.js +26 -0
  143. package/lib/module/stories/H6.stories.js.map +1 -0
  144. package/lib/module/stories/Label.stories.js +26 -0
  145. package/lib/module/stories/Label.stories.js.map +1 -0
  146. package/lib/module/stories/LabelSmall.stories.js +26 -0
  147. package/lib/module/stories/LabelSmall.stories.js.map +1 -0
  148. package/lib/module/stories/Link.stories.js +26 -0
  149. package/lib/module/stories/Link.stories.js.map +1 -0
  150. package/lib/module/stories/Monospace.stories.js +26 -0
  151. package/lib/module/stories/Monospace.stories.js.map +1 -0
  152. package/lib/module/utils/fonts.js +13 -4
  153. package/lib/module/utils/fonts.js.map +1 -1
  154. package/lib/typescript/components/buttons/ButtonSolid.d.ts +16 -0
  155. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  156. package/lib/typescript/components/index.d.ts +1 -0
  157. package/lib/typescript/components/index.d.ts.map +1 -1
  158. package/lib/typescript/components/layout/BlockButtons.d.ts +53 -0
  159. package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -0
  160. package/lib/typescript/components/layout/FooterWithButtons.d.ts +9 -0
  161. package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +1 -0
  162. package/lib/typescript/components/layout/index.d.ts +1 -0
  163. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  164. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  165. package/lib/typescript/stories/ButtonDS.stories.d.ts +14 -0
  166. package/lib/typescript/stories/ButtonDS.stories.d.ts.map +1 -0
  167. package/lib/typescript/stories/H1.stories.d.ts +19 -0
  168. package/lib/typescript/stories/H1.stories.d.ts.map +1 -0
  169. package/lib/typescript/stories/H2.stories.d.ts +19 -0
  170. package/lib/typescript/stories/H2.stories.d.ts.map +1 -0
  171. package/lib/typescript/stories/H3.stories.d.ts +19 -0
  172. package/lib/typescript/stories/H3.stories.d.ts.map +1 -0
  173. package/lib/typescript/stories/H4.stories.d.ts +19 -0
  174. package/lib/typescript/stories/H4.stories.d.ts.map +1 -0
  175. package/lib/typescript/stories/H5.stories.d.ts +27 -0
  176. package/lib/typescript/stories/H5.stories.d.ts.map +1 -0
  177. package/lib/typescript/stories/H6.stories.d.ts +19 -0
  178. package/lib/typescript/stories/H6.stories.d.ts.map +1 -0
  179. package/lib/typescript/stories/Label.stories.d.ts +19 -0
  180. package/lib/typescript/stories/Label.stories.d.ts.map +1 -0
  181. package/lib/typescript/stories/LabelSmall.stories.d.ts +21 -0
  182. package/lib/typescript/stories/LabelSmall.stories.d.ts.map +1 -0
  183. package/lib/typescript/stories/Link.stories.d.ts +21 -0
  184. package/lib/typescript/stories/Link.stories.d.ts.map +1 -0
  185. package/lib/typescript/stories/Monospace.stories.d.ts +19 -0
  186. package/lib/typescript/stories/Monospace.stories.d.ts.map +1 -0
  187. package/lib/typescript/utils/fonts.d.ts.map +1 -1
  188. package/package.json +25 -4
  189. package/src/components/buttons/ButtonSolid.tsx +16 -0
  190. package/src/components/index.tsx +1 -0
  191. package/src/components/layout/BlockButtons.tsx +142 -0
  192. package/src/components/layout/FooterWithButtons.tsx +37 -0
  193. package/src/components/layout/index.tsx +1 -0
  194. package/src/components/textInput/TextInputBase.tsx +2 -2
  195. package/src/stories/ButtonDS.stories.ts +31 -0
  196. package/src/stories/H1.stories.ts +28 -0
  197. package/src/stories/H2.stories.ts +28 -0
  198. package/src/stories/H3.stories.ts +28 -0
  199. package/src/stories/H4.stories.ts +28 -0
  200. package/src/stories/H5.stories.ts +28 -0
  201. package/src/stories/H6.stories.ts +28 -0
  202. package/src/stories/Label.stories.ts +28 -0
  203. package/src/stories/LabelSmall.stories.ts +28 -0
  204. package/src/stories/Link.stories.ts +28 -0
  205. package/src/stories/Monospace.stories.ts +28 -0
  206. 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
+ };
@@ -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
- default: "undefined",
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
- default: {
101
- fontFamily: "undefined"
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
  });