@gustavo-valsechi/client 1.4.222 → 1.4.224

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.
@@ -40,8 +40,7 @@ var import_label = require("../label");
40
40
  var import_error = require("../error");
41
41
  var import_lodash = __toESM(require("lodash"));
42
42
  function InputDateTime(props) {
43
- var _a;
44
- const inputRef = (0, import_react.useRef)({});
43
+ const inputRef = (0, import_react.useRef)();
45
44
  const register = (props.register || ((name) => ({})))(props.name || "");
46
45
  const onChange = (event) => {
47
46
  const value = event.target.value || "";
@@ -49,7 +48,7 @@ function InputDateTime(props) {
49
48
  if (register.onChange) register.onChange(event);
50
49
  if (props.onChange) props.onChange(event);
51
50
  };
52
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, children: [
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, disabled: props.disabled, children: [
53
52
  !!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.InputLabel, { optional: props.optional, children: props.label }),
54
53
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "input-content", children: [
55
54
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -65,7 +64,14 @@ function InputDateTime(props) {
65
64
  onChange
66
65
  }
67
66
  ),
68
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "input-icon", onClick: (_a = inputRef.current) == null ? void 0 : _a.showPicker, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-calendar" }) })
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
+ "div",
69
+ {
70
+ className: "input-icon",
71
+ onClick: () => inputRef.current && inputRef.current.focus(),
72
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: "fa-solid fa-calendar" })
73
+ }
74
+ )
69
75
  ] }),
70
76
  !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { children: props.error })
71
77
  ] });
@@ -7,8 +7,7 @@ import { InputLabel } from "../label";
7
7
  import { InputError } from "../error";
8
8
  import _ from "lodash";
9
9
  function InputDateTime(props) {
10
- var _a;
11
- const inputRef = useRef({});
10
+ const inputRef = useRef();
12
11
  const register = (props.register || ((name) => ({})))(props.name || "");
13
12
  const onChange = (event) => {
14
13
  const value = event.target.value || "";
@@ -16,7 +15,7 @@ function InputDateTime(props) {
16
15
  if (register.onChange) register.onChange(event);
17
16
  if (props.onChange) props.onChange(event);
18
17
  };
19
- return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, children: [
18
+ return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, disabled: props.disabled, children: [
20
19
  !!props.label && /* @__PURE__ */ jsx(InputLabel, { optional: props.optional, children: props.label }),
21
20
  /* @__PURE__ */ jsxs("div", { className: "input-content", children: [
22
21
  /* @__PURE__ */ jsx(
@@ -32,7 +31,14 @@ function InputDateTime(props) {
32
31
  onChange
33
32
  }
34
33
  ),
35
- /* @__PURE__ */ jsx("div", { className: "input-icon", onClick: (_a = inputRef.current) == null ? void 0 : _a.showPicker, children: /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-calendar" }) })
34
+ /* @__PURE__ */ jsx(
35
+ "div",
36
+ {
37
+ className: "input-icon",
38
+ onClick: () => inputRef.current && inputRef.current.focus(),
39
+ children: /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: "fa-solid fa-calendar" })
40
+ }
41
+ )
36
42
  ] }),
37
43
  !!props.error && /* @__PURE__ */ jsx(InputError, { children: props.error })
38
44
  ] });
@@ -44,7 +44,9 @@ const Container = import_styled_components.default.div`
44
44
  border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
45
45
  border-radius: 5px;
46
46
  overflow: hidden;
47
- background-color: ${({ theme }) => theme.primary};
47
+ background-color: ${({ theme, disabled }) => disabled ? theme.t2 : theme.primary};
48
+ opacity: ${({ disabled }) => disabled ? ".7" : "1"};
49
+ pointer-events: ${({ disabled }) => disabled ? "none" : "all"};
48
50
  position: relative;
49
51
 
50
52
  input {
@@ -58,9 +60,8 @@ const Container = import_styled_components.default.div`
58
60
  appearance: textfield;
59
61
 
60
62
  &:disabled {
61
- background-color: ${({ theme }) => theme.t2};
63
+ background-color: ${({ theme }) => theme.primary};
62
64
  color: ${({ theme }) => theme.t6};
63
- opacity: .7;
64
65
  }
65
66
 
66
67
  &:focus-visible {
@@ -11,7 +11,9 @@ const Container = styled.div`
11
11
  border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
12
12
  border-radius: 5px;
13
13
  overflow: hidden;
14
- background-color: ${({ theme }) => theme.primary};
14
+ background-color: ${({ theme, disabled }) => disabled ? theme.t2 : theme.primary};
15
+ opacity: ${({ disabled }) => disabled ? ".7" : "1"};
16
+ pointer-events: ${({ disabled }) => disabled ? "none" : "all"};
15
17
  position: relative;
16
18
 
17
19
  input {
@@ -25,9 +27,8 @@ const Container = styled.div`
25
27
  appearance: textfield;
26
28
 
27
29
  &:disabled {
28
- background-color: ${({ theme }) => theme.t2};
30
+ background-color: ${({ theme }) => theme.primary};
29
31
  color: ${({ theme }) => theme.t6};
30
- opacity: .7;
31
32
  }
32
33
 
33
34
  &:focus-visible {
@@ -94,7 +94,7 @@ function InputSelect(props) {
94
94
  inputRef.current.focus();
95
95
  if (register.onClick) register.onClick(event);
96
96
  };
97
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, children: [
97
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, disabled: props.disabled, children: [
98
98
  !!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.InputLabel, { optional: props.optional, children: props.label }),
99
99
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
100
100
  "div",
@@ -61,7 +61,7 @@ function InputSelect(props) {
61
61
  inputRef.current.focus();
62
62
  if (register.onClick) register.onClick(event);
63
63
  };
64
- return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, children: [
64
+ return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, disabled: props.disabled, children: [
65
65
  !!props.label && /* @__PURE__ */ jsx(InputLabel, { optional: props.optional, children: props.label }),
66
66
  /* @__PURE__ */ jsxs(
67
67
  "div",
@@ -44,7 +44,9 @@ const Container = import_styled_components.default.div`
44
44
  border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
45
45
  border-radius: 5px;
46
46
  overflow: hidden;
47
- background-color: ${({ theme }) => theme.primary};
47
+ background-color: ${({ theme, disabled }) => disabled ? theme.t2 : theme.primary};
48
+ opacity: ${({ disabled }) => disabled ? ".7" : "1"};
49
+ pointer-events: ${({ disabled }) => disabled ? "none" : "all"};
48
50
  position: relative;
49
51
 
50
52
  input {
@@ -65,9 +67,8 @@ const Container = import_styled_components.default.div`
65
67
  }
66
68
 
67
69
  &:disabled {
68
- background-color: ${({ theme }) => theme.t2};
70
+ background-color: ${({ theme }) => theme.primary};
69
71
  color: ${({ theme }) => theme.t6};
70
- opacity: .7;
71
72
  }
72
73
 
73
74
  &:focus-visible {
@@ -11,7 +11,9 @@ const Container = styled.div`
11
11
  border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
12
12
  border-radius: 5px;
13
13
  overflow: hidden;
14
- background-color: ${({ theme }) => theme.primary};
14
+ background-color: ${({ theme, disabled }) => disabled ? theme.t2 : theme.primary};
15
+ opacity: ${({ disabled }) => disabled ? ".7" : "1"};
16
+ pointer-events: ${({ disabled }) => disabled ? "none" : "all"};
15
17
  position: relative;
16
18
 
17
19
  input {
@@ -32,9 +34,8 @@ const Container = styled.div`
32
34
  }
33
35
 
34
36
  &:disabled {
35
- background-color: ${({ theme }) => theme.t2};
37
+ background-color: ${({ theme }) => theme.primary};
36
38
  color: ${({ theme }) => theme.t6};
37
- opacity: .7;
38
39
  }
39
40
 
40
41
  &:focus-visible {
@@ -48,7 +48,7 @@ function InputText(props) {
48
48
  if (register.onChange) register.onChange(event);
49
49
  if (props.onChange) props.onChange(value);
50
50
  };
51
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, password: props.type === "password", children: [
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, error: props.error, password: props.type === "password", disabled: props.disabled, children: [
52
52
  !!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.InputLabel, { optional: props.optional, children: props.label }),
53
53
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "input-content", children: [
54
54
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -15,7 +15,7 @@ function InputText(props) {
15
15
  if (register.onChange) register.onChange(event);
16
16
  if (props.onChange) props.onChange(value);
17
17
  };
18
- return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, password: props.type === "password", children: [
18
+ return /* @__PURE__ */ jsxs(Container, { className: props.className, error: props.error, password: props.type === "password", disabled: props.disabled, children: [
19
19
  !!props.label && /* @__PURE__ */ jsx(InputLabel, { optional: props.optional, children: props.label }),
20
20
  /* @__PURE__ */ jsxs("div", { className: "input-content", children: [
21
21
  /* @__PURE__ */ jsx(
@@ -45,7 +45,9 @@ const Container = import_styled_components.default.div`
45
45
  border-radius: 5px;
46
46
  overflow: hidden;
47
47
  padding-right: ${({ password }) => password ? ".6rem" : "0rem"};
48
- background-color: ${({ theme }) => theme.primary};
48
+ background-color: ${({ theme, disabled }) => disabled ? theme.t2 : theme.primary};
49
+ opacity: ${({ disabled }) => disabled ? ".7" : "1"};
50
+ pointer-events: ${({ disabled }) => disabled ? "none" : "all"};
49
51
 
50
52
  input {
51
53
  border: 0;
@@ -56,9 +58,8 @@ const Container = import_styled_components.default.div`
56
58
  color: ${({ theme }) => theme.t6};
57
59
 
58
60
  &:disabled {
59
- background-color: ${({ theme }) => theme.t2};
61
+ background-color: ${({ theme }) => theme.primary};
60
62
  color: ${({ theme }) => theme.t6};
61
- opacity: .7;
62
63
  }
63
64
 
64
65
  &:focus-visible {
@@ -12,7 +12,9 @@ const Container = styled.div`
12
12
  border-radius: 5px;
13
13
  overflow: hidden;
14
14
  padding-right: ${({ password }) => password ? ".6rem" : "0rem"};
15
- background-color: ${({ theme }) => theme.primary};
15
+ background-color: ${({ theme, disabled }) => disabled ? theme.t2 : theme.primary};
16
+ opacity: ${({ disabled }) => disabled ? ".7" : "1"};
17
+ pointer-events: ${({ disabled }) => disabled ? "none" : "all"};
16
18
 
17
19
  input {
18
20
  border: 0;
@@ -23,9 +25,8 @@ const Container = styled.div`
23
25
  color: ${({ theme }) => theme.t6};
24
26
 
25
27
  &:disabled {
26
- background-color: ${({ theme }) => theme.t2};
28
+ background-color: ${({ theme }) => theme.primary};
27
29
  color: ${({ theme }) => theme.t6};
28
- opacity: .7;
29
30
  }
30
31
 
31
32
  &:focus-visible {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.222",
3
+ "version": "1.4.224",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",