@zauru-sdk/components 1.0.54 → 1.0.60
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/CHANGELOG.md +48 -0
- package/LICENCE.md +11 -11
- package/package.json +7 -7
- package/src/Alerts/ErrorBoundaryAlert/ErrorBoundaryAlert.tsx +66 -66
- package/src/Alerts/StaticAlert.tsx +121 -121
- package/src/Alerts/index.ts +2 -2
- package/src/BlockUI/BlockUI.tsx +50 -50
- package/src/BlockUI/index.tsx +1 -1
- package/src/Buttons/Button.tsx +90 -90
- package/src/Buttons/index.ts +1 -1
- package/src/Card/Card.tsx +24 -24
- package/src/Card/index.ts +1 -1
- package/src/Chat/ChatLayout.tsx +131 -131
- package/src/Chat/ChatMessageHistory.tsx +142 -142
- package/src/Chat/index.ts +2 -2
- package/src/ConnectionState/ConnectionState.tsx +27 -27
- package/src/ConnectionState/index.tsx +1 -1
- package/src/Containers/BodyContainer.tsx +14 -14
- package/src/Containers/ButtonSectionContainer.tsx +21 -21
- package/src/Containers/Container.tsx +39 -39
- package/src/Containers/DoubleContainer.tsx +48 -48
- package/src/Containers/MainContainer.tsx +17 -17
- package/src/Containers/OutletContainer.tsx +14 -14
- package/src/Containers/SubContainer.tsx +37 -37
- package/src/Containers/index.ts +7 -7
- package/src/DynamicTable/BasicPrintDynamicTable.tsx +73 -73
- package/src/DynamicTable/DynamicPrintTable.tsx +288 -288
- package/src/DynamicTable/DynamicTable.tsx +405 -405
- package/src/DynamicTable/GenericDynamicTable.tsx +456 -456
- package/src/DynamicTable/index.tsx +4 -4
- package/src/Footer/Footer.tsx +50 -50
- package/src/Footer/index.tsx +1 -1
- package/src/Form/Checkbox/index.tsx +96 -96
- package/src/Form/Checklist/index.tsx +35 -35
- package/src/Form/DatePicker/index.tsx +132 -132
- package/src/Form/DynamicBaculoForm/index.tsx +361 -361
- package/src/Form/FieldContainer/DoubleFieldContainer.tsx +35 -35
- package/src/Form/FieldContainer/QuadrupleFieldContainer.tsx +36 -36
- package/src/Form/FieldContainer/TripleFieldContainer.tsx +35 -35
- package/src/Form/FieldContainer/index.ts +3 -3
- package/src/Form/FileUpload/index.tsx +184 -184
- package/src/Form/FormButtons/index.tsx +78 -78
- package/src/Form/FormLayout/index.tsx +37 -37
- package/src/Form/SelectField/index.tsx +237 -237
- package/src/Form/TextArea/index.tsx +125 -125
- package/src/Form/TextField/index.tsx +194 -194
- package/src/Form/TimePicker/index.tsx +127 -127
- package/src/Form/YesNo/index.tsx +77 -77
- package/src/Form/index.ts +13 -13
- package/src/Labels/InfoLabel/index.tsx +21 -21
- package/src/Labels/index.tsx +1 -1
- package/src/Layouts/homeLayout/index.tsx +34 -34
- package/src/Layouts/index.ts +1 -1
- package/src/LineSeparator/LineSeparator.tsx +3 -3
- package/src/LineSeparator/index.tsx +1 -1
- package/src/Modal/Modal.tsx +104 -104
- package/src/Modal/index.tsx +1 -1
- package/src/NavBar/NavBar.tsx +223 -223
- package/src/NavBar/NavBar.types.ts +64 -64
- package/src/NavBar/NavBar.utils.ts +58 -58
- package/src/NavBar/index.tsx +5 -5
- package/src/ProgressBar/ProgressBar.tsx +25 -25
- package/src/ProgressBar/ProgressCircle.tsx +75 -75
- package/src/ProgressBar/index.tsx +2 -2
- package/src/Skeletons/LoadingInputSkeleton.tsx +12 -12
- package/src/Skeletons/index.ts +1 -1
- package/src/Tab/Tab.tsx +63 -63
- package/src/Tab/index.ts +1 -1
- package/src/Table/ZauruTable.tsx +265 -265
- package/src/Table/index.tsx +1 -1
- package/src/TaskList/TaskList.tsx +88 -88
- package/src/TaskList/index.ts +1 -1
- package/src/Titles/LabelArray.tsx +17 -17
- package/src/Titles/TableColumnTitle.tsx +9 -9
- package/src/Titles/TitleH1.tsx +10 -10
- package/src/Titles/TitleH2.tsx +10 -10
- package/src/Titles/TitleH3.tsx +10 -10
- package/src/Titles/index.ts +5 -5
- package/src/Tooltip/Tooltip.tsx +42 -42
- package/src/Tooltip/index.ts +1 -1
- package/src/WithTooltip/WithTooltip.tsx +21 -21
- package/src/WithTooltip/index.tsx +1 -1
- package/src/Wizards/StepWizard.tsx +88 -88
- package/src/Wizards/index.ts +1 -1
- package/src/Zendesk/Chat.tsx +83 -83
- package/src/Zendesk/index.ts +2 -2
- package/src/Zendesk/zendesk.config.ts +40 -40
- package/src/index.ts +24 -24
- package/src/postcss.config.mjs +5 -5
- package/src/tailwind.config.ts +10 -10
- package/src/tailwind.css +3 -3
- package/tsconfig.cjs.json +8 -8
- package/tsconfig.esm.json +11 -11
- package/tsconfig.json +17 -17
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { ClockIconSVG, CloseSvgIcon, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
2
|
-
import { useAppSelector } from "@zauru-sdk/redux";
|
|
3
|
-
import React, { useEffect, useState } from "react";
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
6
|
-
id?: string;
|
|
7
|
-
name: string;
|
|
8
|
-
formName?: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
hint?: string;
|
|
11
|
-
helpText?: string;
|
|
12
|
-
defaultValue?: string;
|
|
13
|
-
onChange?: (value: string) => void;
|
|
14
|
-
tabIndex?: number;
|
|
15
|
-
error?: string;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const FormTimePickerWithoutValidation = (props: Props) => {
|
|
20
|
-
const {
|
|
21
|
-
id,
|
|
22
|
-
name,
|
|
23
|
-
title,
|
|
24
|
-
defaultValue = "",
|
|
25
|
-
hint,
|
|
26
|
-
helpText,
|
|
27
|
-
onChange,
|
|
28
|
-
tabIndex,
|
|
29
|
-
error,
|
|
30
|
-
disabled = false,
|
|
31
|
-
} = props;
|
|
32
|
-
|
|
33
|
-
const [value, setValue] = useState<string>(defaultValue);
|
|
34
|
-
const [showTooltip, setShowTooltip] = useState<boolean>(false);
|
|
35
|
-
|
|
36
|
-
const color = error ? "red" : "gray";
|
|
37
|
-
|
|
38
|
-
const isReadOnly = disabled;
|
|
39
|
-
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
40
|
-
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-500`;
|
|
41
|
-
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-200`;
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
setValue(defaultValue);
|
|
45
|
-
}, [defaultValue]);
|
|
46
|
-
|
|
47
|
-
const clearValue = () => {
|
|
48
|
-
setValue("");
|
|
49
|
-
onChange && onChange("");
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<>
|
|
54
|
-
{title && (
|
|
55
|
-
<label
|
|
56
|
-
htmlFor={error ? `${name}-error` : `${name}-success`}
|
|
57
|
-
className={`block text-sm font-medium ${textColor}`}
|
|
58
|
-
>
|
|
59
|
-
{title}
|
|
60
|
-
</label>
|
|
61
|
-
)}
|
|
62
|
-
<div className="flex relative items-center">
|
|
63
|
-
<div className="absolute left-0 flex items-center pl-3 pointer-events-none">
|
|
64
|
-
<ClockIconSVG />
|
|
65
|
-
</div>
|
|
66
|
-
<input
|
|
67
|
-
id={id}
|
|
68
|
-
name={name}
|
|
69
|
-
tabIndex={tabIndex}
|
|
70
|
-
type="time"
|
|
71
|
-
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
72
|
-
setValue(e.target.value);
|
|
73
|
-
onChange && onChange(e.target.value);
|
|
74
|
-
}}
|
|
75
|
-
value={value}
|
|
76
|
-
pattern="\d{2}:\d{2}"
|
|
77
|
-
className={`${bgColor} ${borderColor} ${textColor} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5`}
|
|
78
|
-
/>
|
|
79
|
-
{value && (
|
|
80
|
-
<button
|
|
81
|
-
type="button"
|
|
82
|
-
onClick={clearValue}
|
|
83
|
-
className="absolute right-0 mr-10"
|
|
84
|
-
>
|
|
85
|
-
<CloseSvgIcon />
|
|
86
|
-
</button>
|
|
87
|
-
)}
|
|
88
|
-
{helpText && (
|
|
89
|
-
<div className="flex items-center relative ml-3">
|
|
90
|
-
<div
|
|
91
|
-
className="relative cursor-pointer"
|
|
92
|
-
onMouseEnter={() => setShowTooltip(true)}
|
|
93
|
-
onMouseLeave={() => setShowTooltip(false)}
|
|
94
|
-
>
|
|
95
|
-
<IdeaIconSVG />
|
|
96
|
-
{showTooltip && (
|
|
97
|
-
<div className="absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black">
|
|
98
|
-
{helpText}
|
|
99
|
-
</div>
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
)}
|
|
104
|
-
</div>
|
|
105
|
-
{error && (
|
|
106
|
-
<p className={`mt-2 text-sm text-${color}-600 dark:text-${color}-500`}>
|
|
107
|
-
<span className="font-medium">Oops!</span> {error}
|
|
108
|
-
</p>
|
|
109
|
-
)}
|
|
110
|
-
{!error && hint && (
|
|
111
|
-
<p
|
|
112
|
-
className={`mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`}
|
|
113
|
-
>
|
|
114
|
-
{hint}
|
|
115
|
-
</p>
|
|
116
|
-
)}
|
|
117
|
-
</>
|
|
118
|
-
);
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const FormTimePicker = (props: Props) => {
|
|
122
|
-
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
123
|
-
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
124
|
-
props = { ...props, error };
|
|
125
|
-
|
|
126
|
-
return <FormTimePickerWithoutValidation {...props} />;
|
|
127
|
-
};
|
|
1
|
+
import { ClockIconSVG, CloseSvgIcon, IdeaIconSVG } from "@zauru-sdk/icons";
|
|
2
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
3
|
+
import React, { useEffect, useState } from "react";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
id?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
formName?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
helpText?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
tabIndex?: number;
|
|
15
|
+
error?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const FormTimePickerWithoutValidation = (props: Props) => {
|
|
20
|
+
const {
|
|
21
|
+
id,
|
|
22
|
+
name,
|
|
23
|
+
title,
|
|
24
|
+
defaultValue = "",
|
|
25
|
+
hint,
|
|
26
|
+
helpText,
|
|
27
|
+
onChange,
|
|
28
|
+
tabIndex,
|
|
29
|
+
error,
|
|
30
|
+
disabled = false,
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
const [value, setValue] = useState<string>(defaultValue);
|
|
34
|
+
const [showTooltip, setShowTooltip] = useState<boolean>(false);
|
|
35
|
+
|
|
36
|
+
const color = error ? "red" : "gray";
|
|
37
|
+
|
|
38
|
+
const isReadOnly = disabled;
|
|
39
|
+
const bgColor = isReadOnly ? "bg-gray-200" : `bg-${color}-50`;
|
|
40
|
+
const textColor = isReadOnly ? "text-gray-500" : `text-${color}-500`;
|
|
41
|
+
const borderColor = isReadOnly ? "border-gray-300" : `border-${color}-200`;
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setValue(defaultValue);
|
|
45
|
+
}, [defaultValue]);
|
|
46
|
+
|
|
47
|
+
const clearValue = () => {
|
|
48
|
+
setValue("");
|
|
49
|
+
onChange && onChange("");
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{title && (
|
|
55
|
+
<label
|
|
56
|
+
htmlFor={error ? `${name}-error` : `${name}-success`}
|
|
57
|
+
className={`block text-sm font-medium ${textColor}`}
|
|
58
|
+
>
|
|
59
|
+
{title}
|
|
60
|
+
</label>
|
|
61
|
+
)}
|
|
62
|
+
<div className="flex relative items-center">
|
|
63
|
+
<div className="absolute left-0 flex items-center pl-3 pointer-events-none">
|
|
64
|
+
<ClockIconSVG />
|
|
65
|
+
</div>
|
|
66
|
+
<input
|
|
67
|
+
id={id}
|
|
68
|
+
name={name}
|
|
69
|
+
tabIndex={tabIndex}
|
|
70
|
+
type="time"
|
|
71
|
+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
72
|
+
setValue(e.target.value);
|
|
73
|
+
onChange && onChange(e.target.value);
|
|
74
|
+
}}
|
|
75
|
+
value={value}
|
|
76
|
+
pattern="\d{2}:\d{2}"
|
|
77
|
+
className={`${bgColor} ${borderColor} ${textColor} text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5`}
|
|
78
|
+
/>
|
|
79
|
+
{value && (
|
|
80
|
+
<button
|
|
81
|
+
type="button"
|
|
82
|
+
onClick={clearValue}
|
|
83
|
+
className="absolute right-0 mr-10"
|
|
84
|
+
>
|
|
85
|
+
<CloseSvgIcon />
|
|
86
|
+
</button>
|
|
87
|
+
)}
|
|
88
|
+
{helpText && (
|
|
89
|
+
<div className="flex items-center relative ml-3">
|
|
90
|
+
<div
|
|
91
|
+
className="relative cursor-pointer"
|
|
92
|
+
onMouseEnter={() => setShowTooltip(true)}
|
|
93
|
+
onMouseLeave={() => setShowTooltip(false)}
|
|
94
|
+
>
|
|
95
|
+
<IdeaIconSVG />
|
|
96
|
+
{showTooltip && (
|
|
97
|
+
<div className="absolute -left-48 top-0 mt-8 p-2 bg-white border rounded shadow text-black">
|
|
98
|
+
{helpText}
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
{error && (
|
|
106
|
+
<p className={`mt-2 text-sm text-${color}-600 dark:text-${color}-500`}>
|
|
107
|
+
<span className="font-medium">Oops!</span> {error}
|
|
108
|
+
</p>
|
|
109
|
+
)}
|
|
110
|
+
{!error && hint && (
|
|
111
|
+
<p
|
|
112
|
+
className={`mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`}
|
|
113
|
+
>
|
|
114
|
+
{hint}
|
|
115
|
+
</p>
|
|
116
|
+
)}
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const FormTimePicker = (props: Props) => {
|
|
122
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
123
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
124
|
+
props = { ...props, error };
|
|
125
|
+
|
|
126
|
+
return <FormTimePickerWithoutValidation {...props} />;
|
|
127
|
+
};
|
package/src/Form/YesNo/index.tsx
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { useAppSelector } from "@zauru-sdk/redux";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
id?: string;
|
|
6
|
-
name: string;
|
|
7
|
-
formName?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
defaultValue?: boolean;
|
|
10
|
-
helpText?: string;
|
|
11
|
-
onChange?: (value: boolean) => void;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const YesNo = (props: Props) => {
|
|
16
|
-
const {
|
|
17
|
-
id,
|
|
18
|
-
name,
|
|
19
|
-
title,
|
|
20
|
-
defaultValue = false,
|
|
21
|
-
helpText,
|
|
22
|
-
onChange,
|
|
23
|
-
disabled,
|
|
24
|
-
} = props;
|
|
25
|
-
|
|
26
|
-
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
27
|
-
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
28
|
-
|
|
29
|
-
const [value, setValue] = useState(defaultValue);
|
|
30
|
-
|
|
31
|
-
const color = error ? "red" : "gray";
|
|
32
|
-
|
|
33
|
-
const handleOnChange = () => {
|
|
34
|
-
if (disabled) return; // No hacer nada si está deshabilitado
|
|
35
|
-
const newValue = !value;
|
|
36
|
-
setValue(newValue);
|
|
37
|
-
onChange && onChange(newValue);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<>
|
|
42
|
-
<label
|
|
43
|
-
className={`relative inline-flex items-center cursor-pointer ${
|
|
44
|
-
disabled ? "opacity-50" : ""
|
|
45
|
-
}`}
|
|
46
|
-
>
|
|
47
|
-
<input
|
|
48
|
-
type="checkbox"
|
|
49
|
-
id={id ?? name}
|
|
50
|
-
name={name}
|
|
51
|
-
checked={value}
|
|
52
|
-
value={value.toString()}
|
|
53
|
-
className="sr-only peer"
|
|
54
|
-
onChange={handleOnChange}
|
|
55
|
-
disabled={disabled}
|
|
56
|
-
/>
|
|
57
|
-
{value.toString() === "false" && (
|
|
58
|
-
<input type="hidden" name={name} value="false" />
|
|
59
|
-
)}
|
|
60
|
-
<div className="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
|
|
61
|
-
<span className="ml-3 text-sm font-medium text-gray-900">{title}</span>
|
|
62
|
-
</label>
|
|
63
|
-
{error && (
|
|
64
|
-
<p className={`mt-2 text-sm text-${color}-600 dark:text-${color}-500`}>
|
|
65
|
-
<span className="font-medium">Oops!</span> {error}
|
|
66
|
-
</p>
|
|
67
|
-
)}
|
|
68
|
-
{!error && helpText && (
|
|
69
|
-
<p
|
|
70
|
-
className={`mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`}
|
|
71
|
-
>
|
|
72
|
-
{helpText}
|
|
73
|
-
</p>
|
|
74
|
-
)}
|
|
75
|
-
</>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
1
|
+
import { useAppSelector } from "@zauru-sdk/redux";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
type Props = {
|
|
5
|
+
id?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
formName?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
defaultValue?: boolean;
|
|
10
|
+
helpText?: string;
|
|
11
|
+
onChange?: (value: boolean) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const YesNo = (props: Props) => {
|
|
16
|
+
const {
|
|
17
|
+
id,
|
|
18
|
+
name,
|
|
19
|
+
title,
|
|
20
|
+
defaultValue = false,
|
|
21
|
+
helpText,
|
|
22
|
+
onChange,
|
|
23
|
+
disabled,
|
|
24
|
+
} = props;
|
|
25
|
+
|
|
26
|
+
const { formValidations } = useAppSelector((state) => state.formValidation);
|
|
27
|
+
const error = formValidations[props.formName ?? "-1"]?.[props.name ?? "-1"];
|
|
28
|
+
|
|
29
|
+
const [value, setValue] = useState(defaultValue);
|
|
30
|
+
|
|
31
|
+
const color = error ? "red" : "gray";
|
|
32
|
+
|
|
33
|
+
const handleOnChange = () => {
|
|
34
|
+
if (disabled) return; // No hacer nada si está deshabilitado
|
|
35
|
+
const newValue = !value;
|
|
36
|
+
setValue(newValue);
|
|
37
|
+
onChange && onChange(newValue);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<label
|
|
43
|
+
className={`relative inline-flex items-center cursor-pointer ${
|
|
44
|
+
disabled ? "opacity-50" : ""
|
|
45
|
+
}`}
|
|
46
|
+
>
|
|
47
|
+
<input
|
|
48
|
+
type="checkbox"
|
|
49
|
+
id={id ?? name}
|
|
50
|
+
name={name}
|
|
51
|
+
checked={value}
|
|
52
|
+
value={value.toString()}
|
|
53
|
+
className="sr-only peer"
|
|
54
|
+
onChange={handleOnChange}
|
|
55
|
+
disabled={disabled}
|
|
56
|
+
/>
|
|
57
|
+
{value.toString() === "false" && (
|
|
58
|
+
<input type="hidden" name={name} value="false" />
|
|
59
|
+
)}
|
|
60
|
+
<div className="w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
|
|
61
|
+
<span className="ml-3 text-sm font-medium text-gray-900">{title}</span>
|
|
62
|
+
</label>
|
|
63
|
+
{error && (
|
|
64
|
+
<p className={`mt-2 text-sm text-${color}-600 dark:text-${color}-500`}>
|
|
65
|
+
<span className="font-medium">Oops!</span> {error}
|
|
66
|
+
</p>
|
|
67
|
+
)}
|
|
68
|
+
{!error && helpText && (
|
|
69
|
+
<p
|
|
70
|
+
className={`mt-2 italic text-sm text-${color}-500 dark:text-${color}-400`}
|
|
71
|
+
>
|
|
72
|
+
{helpText}
|
|
73
|
+
</p>
|
|
74
|
+
)}
|
|
75
|
+
</>
|
|
76
|
+
);
|
|
77
|
+
};
|
package/src/Form/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from "./Checkbox/index.js";
|
|
2
|
-
export * from "./Checklist/index.js";
|
|
3
|
-
export * from "./DatePicker/index.js";
|
|
4
|
-
export * from "./DynamicBaculoForm/index.js";
|
|
5
|
-
export * from "./FieldContainer/index.js";
|
|
6
|
-
export * from "./FileUpload/index.js";
|
|
7
|
-
export * from "./FormButtons/index.js";
|
|
8
|
-
export * from "./FormLayout/index.js";
|
|
9
|
-
export * from "./SelectField/index.js";
|
|
10
|
-
export * from "./TextArea/index.js";
|
|
11
|
-
export * from "./TextField/index.js";
|
|
12
|
-
export * from "./TimePicker/index.js";
|
|
13
|
-
export * from "./YesNo/index.js";
|
|
1
|
+
export * from "./Checkbox/index.js";
|
|
2
|
+
export * from "./Checklist/index.js";
|
|
3
|
+
export * from "./DatePicker/index.js";
|
|
4
|
+
export * from "./DynamicBaculoForm/index.js";
|
|
5
|
+
export * from "./FieldContainer/index.js";
|
|
6
|
+
export * from "./FileUpload/index.js";
|
|
7
|
+
export * from "./FormButtons/index.js";
|
|
8
|
+
export * from "./FormLayout/index.js";
|
|
9
|
+
export * from "./SelectField/index.js";
|
|
10
|
+
export * from "./TextArea/index.js";
|
|
11
|
+
export * from "./TextField/index.js";
|
|
12
|
+
export * from "./TimePicker/index.js";
|
|
13
|
+
export * from "./YesNo/index.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
type Props = {
|
|
4
|
-
description: string;
|
|
5
|
-
title: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const InfoLabel = (props: Props) => {
|
|
10
|
-
const { description, title, className } = props;
|
|
11
|
-
return (
|
|
12
|
-
<div className={`block ${className}`}>
|
|
13
|
-
<label className="inline text-sm font-medium text-gray-700">
|
|
14
|
-
{`${title.toUpperCase()} `}
|
|
15
|
-
</label>
|
|
16
|
-
<label className="inline text-sm font-medium text-gray-500">
|
|
17
|
-
{description}
|
|
18
|
-
</label>
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
description: string;
|
|
5
|
+
title: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const InfoLabel = (props: Props) => {
|
|
10
|
+
const { description, title, className } = props;
|
|
11
|
+
return (
|
|
12
|
+
<div className={`block ${className}`}>
|
|
13
|
+
<label className="inline text-sm font-medium text-gray-700">
|
|
14
|
+
{`${title.toUpperCase()} `}
|
|
15
|
+
</label>
|
|
16
|
+
<label className="inline text-sm font-medium text-gray-500">
|
|
17
|
+
{description}
|
|
18
|
+
</label>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
package/src/Labels/index.tsx
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./InfoLabel/index.js";
|
|
1
|
+
export * from "./InfoLabel/index.js";
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
title?: string;
|
|
3
|
-
description?: string;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export const HomeLayout = ({ title, description }: Props) => {
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
className="bg-cover bg-center h-screen"
|
|
10
|
-
style={{ backgroundImage: 'url("/wallpaper.webp")' }}
|
|
11
|
-
>
|
|
12
|
-
<div className="flex flex-col h-screen justify-center items-center">
|
|
13
|
-
<h1
|
|
14
|
-
className="text-6xl md:text-7xl lg:text-8xl text-white font-bold mb-6 text-center"
|
|
15
|
-
style={{
|
|
16
|
-
textShadow: "0.5px 0.5px 1px #000000",
|
|
17
|
-
WebkitTextStroke: "2px #000000",
|
|
18
|
-
}}
|
|
19
|
-
>
|
|
20
|
-
{title ?? <>Bienvenido, inicie sesión para continuar.</>}
|
|
21
|
-
</h1>
|
|
22
|
-
<p
|
|
23
|
-
className="text-xl md:text-2xl lg:text-3xl text-white text-center max-w-md mb-12"
|
|
24
|
-
style={{
|
|
25
|
-
textShadow: "0.5px 0.5px 1px #000000",
|
|
26
|
-
WebkitTextStroke: "1px #000000",
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
{description ?? <>Web app, realizada en Zauru.</>}
|
|
30
|
-
</p>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
1
|
+
type Props = {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export const HomeLayout = ({ title, description }: Props) => {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className="bg-cover bg-center h-screen"
|
|
10
|
+
style={{ backgroundImage: 'url("/wallpaper.webp")' }}
|
|
11
|
+
>
|
|
12
|
+
<div className="flex flex-col h-screen justify-center items-center">
|
|
13
|
+
<h1
|
|
14
|
+
className="text-6xl md:text-7xl lg:text-8xl text-white font-bold mb-6 text-center"
|
|
15
|
+
style={{
|
|
16
|
+
textShadow: "0.5px 0.5px 1px #000000",
|
|
17
|
+
WebkitTextStroke: "2px #000000",
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
{title ?? <>Bienvenido, inicie sesión para continuar.</>}
|
|
21
|
+
</h1>
|
|
22
|
+
<p
|
|
23
|
+
className="text-xl md:text-2xl lg:text-3xl text-white text-center max-w-md mb-12"
|
|
24
|
+
style={{
|
|
25
|
+
textShadow: "0.5px 0.5px 1px #000000",
|
|
26
|
+
WebkitTextStroke: "1px #000000",
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{description ?? <>Web app, realizada en Zauru.</>}
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
package/src/Layouts/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./homeLayout/index.js";
|
|
1
|
+
export * from "./homeLayout/index.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const LineSeparator = () => {
|
|
2
|
-
return <hr className="h-px my-8 bg-gray-200 border-0 dark:bg-gray-400"></hr>;
|
|
3
|
-
};
|
|
1
|
+
export const LineSeparator = () => {
|
|
2
|
+
return <hr className="h-px my-8 bg-gray-200 border-0 dark:bg-gray-400"></hr>;
|
|
3
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./LineSeparator.js";
|
|
1
|
+
export * from "./LineSeparator.js";
|