react-native-exp-fig 2.0.0 → 2.0.2

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 (68) hide show
  1. package/lib/commonjs/components/box/index.js +4 -4
  2. package/lib/commonjs/components/card-loading/index.js +26 -24
  3. package/lib/commonjs/components/card-loading/index.js.map +1 -1
  4. package/lib/commonjs/components/header-profile/index.js +69 -63
  5. package/lib/commonjs/components/header-profile/index.js.map +1 -1
  6. package/lib/commonjs/components/history-details/index.js +4 -4
  7. package/lib/commonjs/components/notification-card/index.js +12 -7
  8. package/lib/commonjs/components/notification-card/index.js.map +1 -1
  9. package/lib/commonjs/components/user-profile/index.js +9 -10
  10. package/lib/commonjs/components/user-profile/index.js.map +1 -1
  11. package/lib/commonjs/index.js +3 -3
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/stories/header-profile/header-profile.stories.js +7 -17
  14. package/lib/commonjs/stories/header-profile/header-profile.stories.js.map +1 -1
  15. package/lib/commonjs/stories/notification-card/notification-card.stories.js +200 -0
  16. package/lib/commonjs/stories/notification-card/notification-card.stories.js.map +1 -0
  17. package/lib/commonjs/stories/notification-loading/notification-loading.stories.js.map +1 -1
  18. package/lib/commonjs/styles/theme/theme.js +5 -5
  19. package/lib/commonjs/utils/status-color/return-color.js +2 -2
  20. package/lib/commonjs/utils/status-color/return-color.js.map +1 -1
  21. package/lib/module/components/box/index.js +4 -4
  22. package/lib/module/components/card-loading/index.js +27 -25
  23. package/lib/module/components/card-loading/index.js.map +1 -1
  24. package/lib/module/components/header-profile/index.js +68 -62
  25. package/lib/module/components/header-profile/index.js.map +1 -1
  26. package/lib/module/components/history-details/index.js +4 -4
  27. package/lib/module/components/notification-card/index.js +12 -7
  28. package/lib/module/components/notification-card/index.js.map +1 -1
  29. package/lib/module/components/user-profile/index.js +9 -10
  30. package/lib/module/components/user-profile/index.js.map +1 -1
  31. package/lib/module/index.js +3 -3
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/stories/header-profile/header-profile.stories.js +5 -16
  34. package/lib/module/stories/header-profile/header-profile.stories.js.map +1 -1
  35. package/lib/module/stories/notification-card/notification-card.stories.js +194 -0
  36. package/lib/module/stories/notification-card/notification-card.stories.js.map +1 -0
  37. package/lib/module/stories/notification-loading/notification-loading.stories.js.map +1 -1
  38. package/lib/module/styles/theme/theme.js +5 -5
  39. package/lib/module/utils/status-color/return-color.js +2 -2
  40. package/lib/module/utils/status-color/return-color.js.map +1 -1
  41. package/lib/typescript/src/components/card-loading/index.d.ts.map +1 -1
  42. package/lib/typescript/src/components/header-profile/index.d.ts +66 -5
  43. package/lib/typescript/src/components/header-profile/index.d.ts.map +1 -1
  44. package/lib/typescript/src/components/notification-card/index.d.ts.map +1 -1
  45. package/lib/typescript/src/components/notification-card/interface.d.ts +2 -1
  46. package/lib/typescript/src/components/notification-card/interface.d.ts.map +1 -1
  47. package/lib/typescript/src/components/user-profile/index.d.ts.map +1 -1
  48. package/lib/typescript/src/index.d.ts +1 -1
  49. package/lib/typescript/src/index.d.ts.map +1 -1
  50. package/lib/typescript/src/stories/header-profile/header-profile.stories.d.ts +1 -1
  51. package/lib/typescript/src/stories/header-profile/header-profile.stories.d.ts.map +1 -1
  52. package/lib/typescript/src/stories/notification-card/notification-card.stories.d.ts +14 -0
  53. package/lib/typescript/src/stories/notification-card/notification-card.stories.d.ts.map +1 -0
  54. package/package.json +1 -1
  55. package/src/components/box/index.tsx +49 -49
  56. package/src/components/card-loading/index.tsx +294 -290
  57. package/src/components/header-profile/index.tsx +148 -132
  58. package/src/components/header-profile/interface.d.ts +145 -57
  59. package/src/components/history-details/index.tsx +99 -99
  60. package/src/components/notification-card/index.tsx +127 -123
  61. package/src/components/notification-card/interface.ts +19 -18
  62. package/src/components/user-profile/index.tsx +206 -204
  63. package/src/index.ts +48 -48
  64. package/src/stories/header-profile/header-profile.stories.tsx +92 -103
  65. package/src/stories/notification-card/notification-card.stories.tsx +202 -0
  66. package/src/stories/notification-loading/notification-loading.stories.tsx +88 -88
  67. package/src/styles/theme/theme.ts +193 -193
  68. package/src/utils/status-color/return-color.ts +34 -34
@@ -1,132 +1,148 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import React from "react";
5
- import { Dimensions, TouchableOpacity } from "react-native";
6
-
7
- // components
8
- import { Box } from "../box";
9
- import { Typography } from "../typography";
10
-
11
- // typings
12
- import { IHeaderProps } from "./interface";
13
-
14
- // commons
15
- import { Icons } from "../../common/icons-svg";
16
-
17
- // styles
18
- import { theme } from "../../styles/theme/theme";
19
-
20
- /**
21
- * Componente Header para a interação do usuário com ui.
22
- */
23
- const Header: React.FC<IHeaderProps> = ({
24
- title,
25
- color,
26
- testID,
27
- arrow,
28
- // propsNav,
29
- permission,
30
- bluetoothIsConnected,
31
- isInternetReachable,
32
- handleNavigation,
33
- backgroundColor,
34
- isBluetooth = false,
35
- }) => {
36
- const { width: widthScreen } = Dimensions.get("window");
37
- const isMobile = widthScreen < 768;
38
-
39
- return (
40
- <Box
41
- testID={testID}
42
- width={"100%"}
43
- height={45}
44
- backgroundColor={backgroundColor ?? theme.colors.blue[400]}
45
- flexStyle={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center" }}
46
- >
47
- <Box
48
- width={"10%"}
49
- height={45}
50
- flexStyle={{ flexDirection: "column", justifyContent: "center", alignItems: "flex-start" }}
51
- paddingStyle={{ paddingLeft: theme.paddings.md }}
52
- >
53
- {arrow && title !== "Login" && (
54
- <TouchableOpacity
55
- disabled={!arrow}
56
- onPress={handleNavigation}
57
- style={{
58
- width: 50,
59
- height: 45,
60
- flexDirection: "column",
61
- alignItems: "flex-start",
62
- justifyContent: "center",
63
- }}
64
- >
65
- {title === "Controle de Jornada" || title === "Controle de Carregamento" ? (
66
- <>
67
- <Icons icon="LIST" color="#fff" />
68
- <Box marginStyle={{ marginBottom: 8 }} />
69
- </>
70
- ) : (
71
- arrow && <Icons icon="ARROW_LEFT" />
72
- )}
73
- </TouchableOpacity>
74
- )}
75
- </Box>
76
-
77
- <Box
78
- height={45}
79
- flexStyle={{
80
- flexDirection: "row",
81
- justifyContent: "center",
82
- alignItems: "center",
83
- flex: 0.9,
84
- }}
85
- >
86
- <Typography
87
- text={title ? title : "Login"}
88
- size={15.4}
89
- fontFamily={theme.fonts.inter_bold_700}
90
- color={color?.colorText ?? theme.colors.neutral[25]}
91
- fontWeight="700"
92
- align="center"
93
- lineHeight={theme.fontSizes.lg}
94
- letterSpacing={"regular"}
95
- marginLeft={theme.margins["2xl"]}
96
- />
97
- </Box>
98
-
99
- <Box
100
- marginStyle={{ marginRight: isMobile ? 10 : 60 }}
101
- borderStyled={{ borderRadius: 10 }}
102
- width={50}
103
- height={24}
104
- >
105
- {permission ? (
106
- <Box marginStyle={{ marginTop: 2 }} />
107
- ) : (
108
- <Box
109
- marginStyle={{ marginTop: 2 }}
110
- flexStyle={{ flexDirection: "row", justifyContent: "flex-end" }}
111
- >
112
- {isBluetooth && (
113
- <Icons
114
- icon={bluetoothIsConnected ? "BLUETOOTH_CONNECTED" : "BLUETOOTH"}
115
- color={bluetoothIsConnected ? theme.colors.green[400] : theme.colors.red[900]}
116
- />
117
- )}
118
- <Icons
119
- icon={isInternetReachable ? "WIFI_HIGH" : "WIFI_X"}
120
- color={isInternetReachable ? theme.colors.orange[150] : theme.colors.red[800]}
121
- />
122
- </Box>
123
- )}
124
- </Box>
125
- </Box>
126
- );
127
- };
128
-
129
- /**
130
- * EXPORTS
131
- */
132
- export { Header };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import React, { forwardRef } from "react";
5
+ import { TouchableOpacity } from "react-native";
6
+
7
+ // components
8
+ import { Box } from "../box";
9
+ import { Typography } from "../typography";
10
+
11
+ // typings
12
+ import { IHeaderProps } from "./interface";
13
+
14
+ // commons
15
+ import { Icons } from "../../common/icons-svg";
16
+
17
+ // styles
18
+ import { theme } from "../../styles/theme/theme";
19
+ import { asBaseComponent } from "../../@types/as-base-component";
20
+
21
+ /**
22
+ * Componente Header para a interação do usuário com ui.
23
+ */
24
+ const HeaderNavigation = forwardRef<any, IHeaderProps>((props, ref): React.ReactElement => {
25
+ const {
26
+ testID,
27
+ width = "100%",
28
+ height = 45,
29
+ title,
30
+ color,
31
+ arrow,
32
+
33
+ // propsNav,
34
+ bluetoothIsConnected = false,
35
+ isProduction = false,
36
+ isInternetReachable,
37
+ handleNavigation,
38
+ } = props;
39
+
40
+ return (
41
+ <Box
42
+ ref={ref as any}
43
+ testID={testID}
44
+ width={width}
45
+ height={height}
46
+ backgroundColor={theme.colors.blue[525]}
47
+ flexStyle={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center" }}
48
+ >
49
+ <Box
50
+ width={"20%"}
51
+ backgroundColor={theme.colors.blue[525]}
52
+ flexStyle={{ flexDirection: "column", justifyContent: "center", alignItems: "flex-start" }}
53
+ paddingStyle={{ paddingLeft: 16 }}
54
+ >
55
+ {arrow && title !== "Login" && (
56
+ <TouchableOpacity
57
+ accessibilityLabel="title"
58
+ disabled={!arrow}
59
+ onPress={handleNavigation}
60
+ style={{
61
+ width: 50,
62
+ height: 45,
63
+ flexDirection: "column",
64
+ alignItems: "flex-start",
65
+ justifyContent: "center",
66
+ }}
67
+ >
68
+ {title === "Controle de Jornada" ? (
69
+ <>
70
+ <Icons icon="LIST" color={theme.colors.neutral[25]} />
71
+ <Box marginStyle={{ marginBottom: 8 }} />
72
+ </>
73
+ ) : (
74
+ arrow && <Icons icon="ARROW_LEFT" />
75
+ )}
76
+ </TouchableOpacity>
77
+ )}
78
+ </Box>
79
+
80
+ <Box
81
+ flexStyle={{
82
+ flexDirection: "row",
83
+ justifyContent: "center",
84
+ alignItems: "center",
85
+ flex: 1,
86
+ }}
87
+ >
88
+ <Typography
89
+ text={title ? title : "Login"}
90
+ size={theme.fontSizes.md}
91
+ fontFamily="inter_bold"
92
+ fontWeight="700"
93
+ align="center"
94
+ color={color?.colorText ?? theme.colors.neutral[25]}
95
+ lineHeight={theme.fontSizes["2xl"]}
96
+ letterSpacing={"regular"}
97
+ />
98
+ </Box>
99
+
100
+ <Box
101
+ backgroundColor={theme.colors.blue[525]}
102
+ width={"20%"}
103
+ flexStyle={{
104
+ alignItems: "center",
105
+ justifyContent: "flex-end",
106
+ flexDirection: "row",
107
+ }}
108
+ paddingStyle={{
109
+ paddingLeft: 16,
110
+ paddingRight: 16,
111
+ }}
112
+ >
113
+ <Box
114
+ marginStyle={{ marginRight: 8 }}
115
+ flexStyle={{ flexDirection: "row", justifyContent: "space-between" }}
116
+ >
117
+ {bluetoothIsConnected && (
118
+ <Icons
119
+ icon="BLUETOOTH_CONNECTED"
120
+ color={bluetoothIsConnected ? theme.colors.green[400] : theme.colors.red[900]}
121
+ />
122
+ )}
123
+ </Box>
124
+
125
+ <Box flexStyle={{ flexDirection: "row", justifyContent: "space-between" }}>
126
+ <Icons
127
+ icon={isInternetReachable ? "WIFI_HIGH" : "WIFI_X"}
128
+ color={
129
+ isInternetReachable
130
+ ? isProduction
131
+ ? theme.colors.green[400]
132
+ : theme.colors.orange[150]
133
+ : theme.colors.red[800]
134
+ }
135
+ />
136
+ </Box>
137
+ </Box>
138
+ </Box>
139
+ );
140
+ });
141
+
142
+ /**
143
+ * EXPORTS
144
+ */
145
+ /**
146
+ * Componente HeaderNavigation para a interação da ui.
147
+ */
148
+ export default asBaseComponent(React.memo(HeaderNavigation));
@@ -1,57 +1,145 @@
1
- /**
2
- * IMPORTS
3
- */
4
- import { ViewProps } from "react-native";
5
-
6
- // typing
7
- import { IGlobalCss } from "../../styles/global/interface";
8
-
9
- interface IHeaderProps extends ViewProps, IGlobalCss {
10
- title: string;
11
-
12
- /**
13
- * TestID para testes automático e identificação
14
- */
15
- testID?: string;
16
-
17
- /**
18
- * prop de navegação
19
- */
20
- propsNav?: any;
21
-
22
- /**
23
- * arrow para coloca o ícone da flecha ou lista
24
- */
25
- arrow: boolean;
26
-
27
- /**
28
- * permission boolean
29
- */
30
- permission: boolean;
31
-
32
- /**
33
- * isInternetReachable boolean que consta se está conectado a internet
34
- */
35
- isInternetReachable: boolean;
36
-
37
- /**
38
- * verifica se o bluetooth esta conectado
39
- */
40
- bluetoothIsConnected: boolean;
41
-
42
- /**
43
- * direciona para navegação correspondente
44
- */
45
- // eslint-disable-next-line no-unused-vars
46
- handleNavigation: (propsNav: any) => void;
47
-
48
- /**
49
- * verifica se precisa do bluetooth na aplicação
50
- */
51
- isBluetooth: boolean;
52
- }
53
-
54
- /**
55
- * EXPORTS
56
- */
57
- export type { IHeaderProps };
1
+ /**
2
+ * IMPORTS
3
+ */
4
+ import type React from "react";
5
+ import { ViewProps, type DimensionValue } from "react-native";
6
+
7
+ type IHeaderProps = ViewProps & {
8
+ title: string;
9
+
10
+ /**
11
+ * prop de navegação
12
+ */
13
+ propsNav?: any;
14
+
15
+ /**
16
+ * prop para mostrar mostrar o ambiente de produção ou dev
17
+ */
18
+ isProduction?: boolean;
19
+
20
+ /**
21
+ * arrow para coloca o ícone da flecha ou lista
22
+ */
23
+ arrow: boolean;
24
+
25
+ /**
26
+ * isInternetReachable boolean que consta se está conectado a internet
27
+ */
28
+ isInternetReachable: boolean;
29
+
30
+ /**
31
+ * verifica se o bluetooth esta conectado
32
+ */
33
+ bluetoothIsConnected?: boolean;
34
+
35
+ /**
36
+ * direciona para navegação correspondente
37
+ */
38
+
39
+ handleNavigation: () => void;
40
+
41
+ children?: React.ReactNode;
42
+
43
+ height?: number | DimensionValue;
44
+
45
+ /**
46
+ * TestID para testes automático e identificação
47
+ */
48
+ testID?: string;
49
+
50
+ /**
51
+ * A propriedade CSS abreviada border define a borda de um elemento. Ele define os valores de largura da borda, estilo da borda e cor da borda.
52
+ */
53
+ borderStyled?: {
54
+ borderStyle?: "solid" | "dotted" | "dashed";
55
+
56
+ borderRadius?: number | DimensionValue;
57
+ borderTopRightRadius?: number | DimensionValue;
58
+ borderTopLeftRadius?: number | DimensionValue;
59
+ borderBottomRightRadius?: number | DimensionValue;
60
+ borderBottomLeftRadius?: number | DimensionValue;
61
+
62
+ borderWidth?: number | DimensionValue;
63
+ borderLeftWidth?: number | DimensionValue;
64
+ borderRightWidth?: number | DimensionValue;
65
+ borderTopWidth?: number | DimensionValue;
66
+ borderBottomWidth?: number | DimensionValue;
67
+
68
+ borderColor?: string;
69
+ borderBottomColor?: string;
70
+ borderLeftColor?: string;
71
+ borderRightColor?: string;
72
+ borderTopColor?: string;
73
+ };
74
+
75
+ /**
76
+ * Propriedades que define a orientação do button que é usada para representar uma página. Na maioria das vezes, esse valores corresponde ao posicionamento alvo da página impressa, se aplicável.
77
+ */
78
+ flexStyle?: {
79
+ alignItems?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
80
+ alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
81
+ flex?: string | number;
82
+ flexDirection?: "column" | "column-reverse" | "row" | "row-reverse";
83
+ flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
84
+ textAlign?: "auto" | "center" | "left" | "right" | "justify";
85
+ justifyContent?:
86
+ | "flex-start"
87
+ | "flex-end"
88
+ | "center"
89
+ | "space-between"
90
+ | "space-around"
91
+ | "space-evenly";
92
+ };
93
+
94
+ /**
95
+ * A propriedade margin do CSS define a área de margem nos quatro lados do elemento. É uma abreviação que define todas as margens individuais de uma só vez: margin-top, margin-right (en-US), margin-bottom, e margin-left (en-US).
96
+ */
97
+ marginStyle?: {
98
+ margin?: number | DimensionValue;
99
+ marginLeft?: number | DimensionValue;
100
+ marginRight?: number | DimensionValue;
101
+ marginTop?: number | DimensionValue;
102
+ marginBottom?: number | DimensionValue;
103
+ };
104
+
105
+ /**
106
+ * A propriedade padding define uma a distância entre o conteúdo de um elemento e suas bordas. É um atalho que evita definir uma distância para cada lado separadamente (padding-top, padding-right, padding-bottom, padding-left).
107
+ */
108
+ paddingStyle?: {
109
+ padding?: number | DimensionValue;
110
+ paddingLeft?: number | DimensionValue;
111
+ paddingRight?: number | DimensionValue;
112
+ paddingTop?: number | DimensionValue;
113
+ paddingBottom?: number | DimensionValue;
114
+ };
115
+
116
+ /**
117
+ * A propriedade CSS height define a altura de um elemento. A altura de um elemento é a distância do topo da borda superior do elemento ao fundo da borda inferior.
118
+ */
119
+ height?: number | DimensionValue;
120
+
121
+ /**
122
+ * A propriedade CSS width define a largura de um elemento. A largura de um elemento é a distância do topo da borda esquerda do elemento ao fundo da borda direita.
123
+ */
124
+ width?: number | DimensionValue;
125
+
126
+ /**
127
+ * O fundo abreviado CSS Propriedade define todas as propriedades do estilo de fundo de uma só vez, como cor, imagem, origem e tamanho ou método de repetição. As propriedades dos componentes não definidas no fundo da declaração de valor da propriedade abreviada são definidas como seus valores padrão..
128
+ */
129
+ backgroundColor?: string;
130
+
131
+ /**
132
+ * A propriedade CSS color define o valor da cor de primeiro plano do texto e das decorações de texto de um elemento e define o valor currentcolor. currentcolor pode ser usado como um valor indireto em outras propriedades e é o padrão para outras propriedades de cores, como border-color.
133
+ */
134
+ color?: {
135
+ colorSvg?: string;
136
+ colorText?: string;
137
+ colorTextBold?: string;
138
+ colorTextData?: string;
139
+ };
140
+ };
141
+
142
+ /**
143
+ * EXPORTS
144
+ */
145
+ export type { IHeaderProps };