jornada-ui 2.0.7 → 2.0.8
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/common/icons-svg/check-box/index.js +44 -0
- package/lib/commonjs/common/icons-svg/check-box/index.js.map +1 -0
- package/lib/commonjs/common/icons-svg/constants/index.js +1 -0
- package/lib/commonjs/common/icons-svg/constants/index.js.map +1 -1
- package/lib/commonjs/common/icons-svg/index.js +7 -0
- package/lib/commonjs/common/icons-svg/index.js.map +1 -1
- package/lib/commonjs/components/check-box/index.js +88 -0
- package/lib/commonjs/components/check-box/index.js.map +1 -0
- package/lib/commonjs/components/check-box/interface.js +6 -0
- package/lib/commonjs/components/check-box/interface.js.map +1 -0
- package/lib/commonjs/index.js +11 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stories/check-box/check-box.stories.js +81 -0
- package/lib/commonjs/stories/check-box/check-box.stories.js.map +1 -0
- package/lib/module/common/icons-svg/check-box/index.js +37 -0
- package/lib/module/common/icons-svg/check-box/index.js.map +1 -0
- package/lib/module/common/icons-svg/constants/index.js +1 -0
- package/lib/module/common/icons-svg/constants/index.js.map +1 -1
- package/lib/module/common/icons-svg/index.js +7 -0
- package/lib/module/common/icons-svg/index.js.map +1 -1
- package/lib/module/components/check-box/index.js +82 -0
- package/lib/module/components/check-box/index.js.map +1 -0
- package/lib/module/components/check-box/interface.js +4 -0
- package/lib/module/components/check-box/interface.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stories/check-box/check-box.stories.js +75 -0
- package/lib/module/stories/check-box/check-box.stories.js.map +1 -0
- package/lib/typescript/commonjs/src/common/icons-svg/check-box/index.d.ts +14 -0
- package/lib/typescript/commonjs/src/common/icons-svg/check-box/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/common/icons-svg/constants/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/common/icons-svg/constants/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/common/icons-svg/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/card-scheduled-journey/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/check-box/index.d.ts +11 -0
- package/lib/typescript/commonjs/src/components/check-box/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/check-box/interface.d.ts +25 -0
- package/lib/typescript/commonjs/src/components/check-box/interface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/selects/select-date-and-hours/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/stories/check-box/check-box.stories.d.ts +12 -0
- package/lib/typescript/commonjs/src/stories/check-box/check-box.stories.d.ts.map +1 -0
- package/lib/typescript/module/src/common/icons-svg/check-box/index.d.ts +14 -0
- package/lib/typescript/module/src/common/icons-svg/check-box/index.d.ts.map +1 -0
- package/lib/typescript/module/src/common/icons-svg/constants/index.d.ts +1 -0
- package/lib/typescript/module/src/common/icons-svg/constants/index.d.ts.map +1 -1
- package/lib/typescript/module/src/common/icons-svg/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/card-scheduled-journey/index.d.ts +1 -1
- package/lib/typescript/module/src/components/check-box/index.d.ts +11 -0
- package/lib/typescript/module/src/components/check-box/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/check-box/interface.d.ts +25 -0
- package/lib/typescript/module/src/components/check-box/interface.d.ts.map +1 -0
- package/lib/typescript/module/src/components/selects/select-date-and-hours/index.d.ts +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/stories/check-box/check-box.stories.d.ts +12 -0
- package/lib/typescript/module/src/stories/check-box/check-box.stories.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/common/icons-svg/check-box/index.tsx +28 -0
- package/src/common/icons-svg/constants/index.ts +1 -0
- package/src/common/icons-svg/index.tsx +4 -0
- package/src/common/icons-svg/interface.d.ts +19 -19
- package/src/components/check-box/index.tsx +94 -0
- package/src/components/check-box/interface.ts +31 -0
- package/src/index.tsx +1 -0
- package/src/stories/check-box/check-box.stories.tsx +84 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IMPORTS
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { SvgProps } from "react-native-svg";
|
|
6
|
-
import { SVG_NAME } from "./constants";
|
|
7
|
-
|
|
8
|
-
interface ISvgProps extends SvgProps {
|
|
9
|
-
width?: number;
|
|
10
|
-
height?: number;
|
|
11
|
-
color?: string;
|
|
12
|
-
size?: number;
|
|
13
|
-
icon: keyof typeof SVG_NAME;
|
|
14
|
-
background?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* EXPORTS
|
|
18
|
-
*/
|
|
19
|
-
export { ISvgProps };
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SvgProps } from "react-native-svg";
|
|
6
|
+
import { SVG_NAME } from "./constants";
|
|
7
|
+
|
|
8
|
+
interface ISvgProps extends SvgProps {
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
color?: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
icon: keyof typeof SVG_NAME;
|
|
14
|
+
background?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* EXPORTS
|
|
18
|
+
*/
|
|
19
|
+
export { ISvgProps };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { TouchableOpacity } from "react-native";
|
|
6
|
+
|
|
7
|
+
// components
|
|
8
|
+
import Typography from "../../components/typography";
|
|
9
|
+
import Box from "../../components/box";
|
|
10
|
+
|
|
11
|
+
// commons icons-svg
|
|
12
|
+
import { Icons } from "../../common/icons-svg";
|
|
13
|
+
|
|
14
|
+
// typings
|
|
15
|
+
import { asBaseComponent } from "../../@types/as-base-component";
|
|
16
|
+
import type { ICheckBoxProps } from "./interface";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Componente CheckBox para interação da UI.
|
|
20
|
+
*/
|
|
21
|
+
const CheckBox: React.FC<ICheckBoxProps> = ({
|
|
22
|
+
width_box_check_icon,
|
|
23
|
+
is_checked,
|
|
24
|
+
background_color_check,
|
|
25
|
+
background_box_check_icon,
|
|
26
|
+
text_label,
|
|
27
|
+
text_size_label,
|
|
28
|
+
color_text_label,
|
|
29
|
+
onPress,
|
|
30
|
+
...res
|
|
31
|
+
}) => {
|
|
32
|
+
|
|
33
|
+
const iconName = is_checked ? "CHECK_BOX_OUTLINE" : "CHECK_BOX";
|
|
34
|
+
const iconSize = is_checked ? 24 : 19;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<TouchableOpacity
|
|
38
|
+
testID="checkbox-button"
|
|
39
|
+
onPress={onPress}
|
|
40
|
+
{...res}
|
|
41
|
+
>
|
|
42
|
+
<Box
|
|
43
|
+
width="100%"
|
|
44
|
+
paddingStyle={{
|
|
45
|
+
paddingLeft: 16,
|
|
46
|
+
paddingRight: 16,
|
|
47
|
+
}}
|
|
48
|
+
flexStyle={{
|
|
49
|
+
flexDirection: "row",
|
|
50
|
+
alignItems: "center",
|
|
51
|
+
justifyContent: "flex-start",
|
|
52
|
+
}}
|
|
53
|
+
testID={is_checked ? "check-box-true" : "check-box-false"}
|
|
54
|
+
>
|
|
55
|
+
<Box
|
|
56
|
+
width={width_box_check_icon ?? 30}
|
|
57
|
+
height={40}
|
|
58
|
+
backgroundColor={
|
|
59
|
+
background_box_check_icon ?? "transparent"
|
|
60
|
+
}
|
|
61
|
+
flexStyle={{
|
|
62
|
+
flexDirection: "row",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "flex-start",
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
<Icons
|
|
68
|
+
size={iconSize}
|
|
69
|
+
color={background_color_check}
|
|
70
|
+
background={background_color_check}
|
|
71
|
+
icon={iconName}
|
|
72
|
+
/>
|
|
73
|
+
</Box>
|
|
74
|
+
|
|
75
|
+
{!!text_label && (
|
|
76
|
+
<Typography
|
|
77
|
+
text={text_label}
|
|
78
|
+
color={color_text_label ?? "white"}
|
|
79
|
+
size={text_size_label ?? 16}
|
|
80
|
+
lineHeight={18}
|
|
81
|
+
letterSpacing="regular"
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
</Box>
|
|
85
|
+
</TouchableOpacity>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
CheckBox.displayName = "CheckBox";
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* EXPORT
|
|
93
|
+
*/
|
|
94
|
+
export default asBaseComponent(CheckBox);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import type { TouchableOpacityProps } from "react-native";
|
|
5
|
+
|
|
6
|
+
interface ICheckBoxProps extends TouchableOpacityProps {
|
|
7
|
+
/**Propriedade do tamanho do box do icon-check-outline */
|
|
8
|
+
width_box_check_icon?: number;
|
|
9
|
+
|
|
10
|
+
/**Propriedade para saber se o checkbox esta marcado */
|
|
11
|
+
is_checked: boolean;
|
|
12
|
+
|
|
13
|
+
/**Propriedade para mudar a cor do icon quando for marcado */
|
|
14
|
+
background_color_check?: string;
|
|
15
|
+
|
|
16
|
+
/**Propriedade para mudar a cor do icon quando for marcado */
|
|
17
|
+
background_box_check_icon?: string;
|
|
18
|
+
|
|
19
|
+
/**Propriedade do textLabel */
|
|
20
|
+
text_label?: string;
|
|
21
|
+
|
|
22
|
+
/**Propriedade do tamanho do textLabel */
|
|
23
|
+
text_size_label?: number;
|
|
24
|
+
|
|
25
|
+
/**Propriedade da cor do textLabel */
|
|
26
|
+
color_text_label?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* EXPORTS
|
|
30
|
+
*/
|
|
31
|
+
export type { ICheckBoxProps };
|
package/src/index.tsx
CHANGED
|
@@ -49,6 +49,7 @@ export { default as ModalToConfirmations } from "./components/modals/modal-to-co
|
|
|
49
49
|
export { default as ActivityTimeline } from "./components/activity-step";
|
|
50
50
|
export { default as NotificationCard } from "./components/notification-card";
|
|
51
51
|
export { default as NotificationDetailCard } from "./components/notification-details-card";
|
|
52
|
+
export { default as CheckBox } from "./components/check-box";
|
|
52
53
|
|
|
53
54
|
// adicionar o storybook + teste
|
|
54
55
|
export { default as WeeklyHoursBalance } from "./components/weekly-hours-balance";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type React from "react";
|
|
6
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
7
|
+
|
|
8
|
+
// components
|
|
9
|
+
import CheckBox from "../../components/check-box";
|
|
10
|
+
|
|
11
|
+
// styles
|
|
12
|
+
import { theme } from "../../styles/theme/theme";
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof CheckBox> = {
|
|
15
|
+
title: "componente/CheckBox",
|
|
16
|
+
component: CheckBox as React.FC,
|
|
17
|
+
args: {
|
|
18
|
+
onPress: () => { },
|
|
19
|
+
},
|
|
20
|
+
parameters: {
|
|
21
|
+
notes: `
|
|
22
|
+
# CheckBox
|
|
23
|
+
|
|
24
|
+
Este é um componente de CheckBox.
|
|
25
|
+
|
|
26
|
+
Você usa assim:
|
|
27
|
+
|
|
28
|
+
\`\`\`tsx
|
|
29
|
+
<CheckBox
|
|
30
|
+
is_checked={true}
|
|
31
|
+
width_box_check_icon={28}
|
|
32
|
+
background_color_check={theme.colors.orange[150]}
|
|
33
|
+
text_size_label={16}
|
|
34
|
+
text_label="Confirmo que este abastecimento pertence à minha viagem e autorizo seu lançamento."
|
|
35
|
+
color_text_label={theme.colors.gray[700]}
|
|
36
|
+
background_box_check_icon="transparent"
|
|
37
|
+
onPress={() => {}}
|
|
38
|
+
/>
|
|
39
|
+
\`\`\`
|
|
40
|
+
`,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default meta;
|
|
45
|
+
|
|
46
|
+
type Story = StoryObj<typeof meta>;
|
|
47
|
+
|
|
48
|
+
export const CheckBoxChecked: Story = {
|
|
49
|
+
name: "checkbox-checked",
|
|
50
|
+
args: {
|
|
51
|
+
is_checked: true,
|
|
52
|
+
width_box_check_icon: 28,
|
|
53
|
+
background_color_check: theme.colors.orange[150],
|
|
54
|
+
text_size_label: 16,
|
|
55
|
+
text_label:
|
|
56
|
+
"Confirmo que este abastecimento pertence à minha viagem e autorizo seu lançamento.",
|
|
57
|
+
color_text_label: theme.colors.gray[700],
|
|
58
|
+
background_box_check_icon: "transparent",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const CheckBoxUnchecked: Story = {
|
|
63
|
+
name: "checkbox-unchecked",
|
|
64
|
+
args: {
|
|
65
|
+
is_checked: false,
|
|
66
|
+
width_box_check_icon: 28,
|
|
67
|
+
background_color_check: theme.colors.gray[850],
|
|
68
|
+
text_size_label: 16,
|
|
69
|
+
text_label:
|
|
70
|
+
"Confirmo que este abastecimento pertence à minha viagem e autorizo seu lançamento.",
|
|
71
|
+
color_text_label: theme.colors.gray[700],
|
|
72
|
+
background_box_check_icon: "transparent",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const CheckBoxWithoutLabel: Story = {
|
|
77
|
+
name: "checkbox-without-label",
|
|
78
|
+
args: {
|
|
79
|
+
is_checked: true,
|
|
80
|
+
width_box_check_icon: 28,
|
|
81
|
+
background_color_check: theme.colors.orange[150],
|
|
82
|
+
background_box_check_icon: "transparent",
|
|
83
|
+
},
|
|
84
|
+
};
|