@pagopa/io-app-design-system 4.0.1 → 4.1.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/alert/Alert.js +34 -7
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/banner/Banner.js +35 -20
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +36 -190
- package/lib/commonjs/components/featureInfo/FeatureInfo.js +27 -26
- package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/commonjs/components/spacer/Spacer.js +1 -1
- package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
- package/lib/commonjs/components/stack/Stack.js +17 -14
- package/lib/commonjs/components/stack/Stack.js.map +1 -1
- package/lib/commonjs/core/IOColors.js.map +1 -1
- package/lib/module/components/alert/Alert.js +36 -9
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/banner/Banner.js +40 -25
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +36 -190
- package/lib/module/components/featureInfo/FeatureInfo.js +29 -28
- package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/module/components/spacer/Spacer.js +1 -1
- package/lib/module/components/spacer/Spacer.js.map +1 -1
- package/lib/module/components/stack/Stack.js +17 -14
- package/lib/module/components/stack/Stack.js.map +1 -1
- package/lib/module/core/IOColors.js.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts.map +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/spacer/Spacer.d.ts +0 -1
- package/lib/typescript/components/spacer/Spacer.d.ts.map +1 -1
- package/lib/typescript/components/stack/Stack.d.ts +9 -6
- package/lib/typescript/components/stack/Stack.d.ts.map +1 -1
- package/lib/typescript/core/IOColors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/alert/Alert.tsx +46 -15
- package/src/components/banner/Banner.tsx +55 -27
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +36 -190
- package/src/components/featureInfo/FeatureInfo.tsx +26 -28
- package/src/components/spacer/Spacer.tsx +2 -4
- package/src/components/stack/Stack.tsx +24 -16
- package/src/core/IOColors.ts +1 -0
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
2
|
import { View, ViewStyle } from "react-native";
|
|
3
3
|
import { IOSpacer } from "../../core";
|
|
4
4
|
|
|
5
5
|
type AllowedStyleProps = Pick<
|
|
6
6
|
ViewStyle,
|
|
7
|
-
"alignItems" | "flexShrink" | "flexGrow" | "flex" | "flexWrap"
|
|
7
|
+
"alignItems" | "flexShrink" | "flexGrow" | "flex" | "flexWrap" | "width"
|
|
8
8
|
>;
|
|
9
9
|
|
|
10
|
-
type Stack = {
|
|
10
|
+
type Stack = PropsWithChildren<{
|
|
11
11
|
space?: IOSpacer;
|
|
12
|
-
children: ReactNode;
|
|
13
12
|
style?: AllowedStyleProps;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
type BaseStack = Stack & {
|
|
16
|
+
orientation: "vertical" | "horizontal";
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
Horizontal Stack component
|
|
18
21
|
@param {IOSpacer} space
|
|
19
22
|
*/
|
|
20
|
-
|
|
23
|
+
|
|
24
|
+
const Stack = ({
|
|
25
|
+
space,
|
|
26
|
+
style,
|
|
27
|
+
orientation = "vertical",
|
|
28
|
+
children
|
|
29
|
+
}: BaseStack) => (
|
|
21
30
|
<View
|
|
22
31
|
style={{
|
|
23
32
|
display: "flex",
|
|
24
|
-
flexDirection: "row",
|
|
33
|
+
flexDirection: orientation === "horizontal" ? "row" : "column",
|
|
25
34
|
gap: space,
|
|
26
35
|
...style
|
|
27
36
|
}}
|
|
@@ -30,20 +39,19 @@ export const HStack = ({ space, children, style }: Stack) => (
|
|
|
30
39
|
</View>
|
|
31
40
|
);
|
|
32
41
|
|
|
42
|
+
export const HStack = ({ children, ...props }: Stack) => (
|
|
43
|
+
<Stack orientation="horizontal" {...props}>
|
|
44
|
+
{children}
|
|
45
|
+
</Stack>
|
|
46
|
+
);
|
|
47
|
+
|
|
33
48
|
/**
|
|
34
49
|
Vertical Stack component
|
|
35
50
|
@param {IOSpacer} space
|
|
36
51
|
*/
|
|
37
52
|
|
|
38
|
-
export const VStack = ({
|
|
39
|
-
<
|
|
40
|
-
style={{
|
|
41
|
-
display: "flex",
|
|
42
|
-
flexDirection: "column",
|
|
43
|
-
gap: space,
|
|
44
|
-
...style
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
53
|
+
export const VStack = ({ children, ...props }: Stack) => (
|
|
54
|
+
<Stack orientation="vertical" {...props}>
|
|
47
55
|
{children}
|
|
48
|
-
</
|
|
56
|
+
</Stack>
|
|
49
57
|
);
|
package/src/core/IOColors.ts
CHANGED