@charlesgomes/leafcode-shared-lib-react 1.0.63 → 1.0.64
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -2
- package/dist/index.mjs +7 -2
- package/dist/styles/button.css +2 -2
- package/dist/styles/input.css +5 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -102,7 +102,7 @@ interface PaginatedResponse$1 {
|
|
|
102
102
|
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
103
103
|
name: string;
|
|
104
104
|
label?: string;
|
|
105
|
-
value?: string;
|
|
105
|
+
value?: string | number | readonly string[] | undefined;
|
|
106
106
|
onChange?: (value: any) => void;
|
|
107
107
|
onSelect: (item: any) => void;
|
|
108
108
|
error?: FieldError;
|
package/dist/index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ interface PaginatedResponse$1 {
|
|
|
102
102
|
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
103
103
|
name: string;
|
|
104
104
|
label?: string;
|
|
105
|
-
value?: string;
|
|
105
|
+
value?: string | number | readonly string[] | undefined;
|
|
106
106
|
onChange?: (value: any) => void;
|
|
107
107
|
onSelect: (item: any) => void;
|
|
108
108
|
error?: FieldError;
|
package/dist/index.js
CHANGED
|
@@ -325,6 +325,7 @@ var InputBase = ({
|
|
|
325
325
|
"--input-font-size": theme.components.input.fonts.inputSize,
|
|
326
326
|
// Colors
|
|
327
327
|
"--label-color": theme.components.input.colors.text,
|
|
328
|
+
"--label-line": theme.colors.light,
|
|
328
329
|
"--input-border": theme.components.input.colors.border,
|
|
329
330
|
"--input-bg": theme.components.input.colors.background,
|
|
330
331
|
"--input-text-color": theme.components.input.colors.text,
|
|
@@ -421,6 +422,7 @@ var TextAreaBase = ({
|
|
|
421
422
|
"--input-font-size": theme.components.input.fonts.inputSize,
|
|
422
423
|
// Colors
|
|
423
424
|
"--label-color": theme.components.input.colors.text,
|
|
425
|
+
"--label-line": theme.colors.light,
|
|
424
426
|
"--input-border": theme.components.input.colors.border,
|
|
425
427
|
"--input-bg": theme.components.input.colors.background,
|
|
426
428
|
"--input-text-color": theme.components.input.colors.text,
|
|
@@ -505,6 +507,7 @@ var InputBase2 = ({
|
|
|
505
507
|
"--label-color": theme.components.input.colors.text,
|
|
506
508
|
"--input-border": theme.components.input.colors.border,
|
|
507
509
|
"--input-bg": theme.components.input.colors.background,
|
|
510
|
+
"--label-line": theme.colors.light,
|
|
508
511
|
"--input-text-color": theme.colors.light,
|
|
509
512
|
"--input-placeholder": theme.components.input.colors.placeholder,
|
|
510
513
|
"--input-focus-border": theme.components.input.colors.focusBorder,
|
|
@@ -686,7 +689,7 @@ var import_react_query = require("@tanstack/react-query");
|
|
|
686
689
|
var import_react10 = require("react");
|
|
687
690
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
688
691
|
var LoadingSpinner = (0, import_react10.memo)(
|
|
689
|
-
({ size =
|
|
692
|
+
({ size = 20, color = "#00875F" }) => {
|
|
690
693
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
691
694
|
"span",
|
|
692
695
|
{
|
|
@@ -727,6 +730,7 @@ var InputBase3 = ({
|
|
|
727
730
|
}, ref) => {
|
|
728
731
|
const theme = useLeafcodeTheme();
|
|
729
732
|
const styleVars = {
|
|
733
|
+
"--label-line": theme.colors.light,
|
|
730
734
|
"--label-font-family": theme.components.input.fonts.label,
|
|
731
735
|
"--label-font-weight": theme.components.input.fonts.labelWeight,
|
|
732
736
|
"--label-font-size": theme.components.input.fonts.labelSize,
|
|
@@ -795,7 +799,7 @@ var InputBase3 = ({
|
|
|
795
799
|
},
|
|
796
800
|
item.id
|
|
797
801
|
)),
|
|
798
|
-
isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "dropdown-loading", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoadingSpinner, { size:
|
|
802
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "dropdown-loading", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoadingSpinner, { size: 20 }) }),
|
|
799
803
|
!isLoading && items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "dropdown-empty", children: "N\xE3o encontrado" })
|
|
800
804
|
] }) });
|
|
801
805
|
};
|
|
@@ -844,6 +848,7 @@ var InputBase3 = ({
|
|
|
844
848
|
setValue("");
|
|
845
849
|
setItems([]);
|
|
846
850
|
setPageNumber(1);
|
|
851
|
+
onChange?.(null);
|
|
847
852
|
onSelect(null);
|
|
848
853
|
},
|
|
849
854
|
className: "dropdown-clear",
|
package/dist/index.mjs
CHANGED
|
@@ -267,6 +267,7 @@ var InputBase = ({
|
|
|
267
267
|
"--input-font-size": theme.components.input.fonts.inputSize,
|
|
268
268
|
// Colors
|
|
269
269
|
"--label-color": theme.components.input.colors.text,
|
|
270
|
+
"--label-line": theme.colors.light,
|
|
270
271
|
"--input-border": theme.components.input.colors.border,
|
|
271
272
|
"--input-bg": theme.components.input.colors.background,
|
|
272
273
|
"--input-text-color": theme.components.input.colors.text,
|
|
@@ -363,6 +364,7 @@ var TextAreaBase = ({
|
|
|
363
364
|
"--input-font-size": theme.components.input.fonts.inputSize,
|
|
364
365
|
// Colors
|
|
365
366
|
"--label-color": theme.components.input.colors.text,
|
|
367
|
+
"--label-line": theme.colors.light,
|
|
366
368
|
"--input-border": theme.components.input.colors.border,
|
|
367
369
|
"--input-bg": theme.components.input.colors.background,
|
|
368
370
|
"--input-text-color": theme.components.input.colors.text,
|
|
@@ -451,6 +453,7 @@ var InputBase2 = ({
|
|
|
451
453
|
"--label-color": theme.components.input.colors.text,
|
|
452
454
|
"--input-border": theme.components.input.colors.border,
|
|
453
455
|
"--input-bg": theme.components.input.colors.background,
|
|
456
|
+
"--label-line": theme.colors.light,
|
|
454
457
|
"--input-text-color": theme.colors.light,
|
|
455
458
|
"--input-placeholder": theme.components.input.colors.placeholder,
|
|
456
459
|
"--input-focus-border": theme.components.input.colors.focusBorder,
|
|
@@ -637,7 +640,7 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
637
640
|
import { memo } from "react";
|
|
638
641
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
639
642
|
var LoadingSpinner = memo(
|
|
640
|
-
({ size =
|
|
643
|
+
({ size = 20, color = "#00875F" }) => {
|
|
641
644
|
return /* @__PURE__ */ jsx9(
|
|
642
645
|
"span",
|
|
643
646
|
{
|
|
@@ -678,6 +681,7 @@ var InputBase3 = ({
|
|
|
678
681
|
}, ref) => {
|
|
679
682
|
const theme = useLeafcodeTheme();
|
|
680
683
|
const styleVars = {
|
|
684
|
+
"--label-line": theme.colors.light,
|
|
681
685
|
"--label-font-family": theme.components.input.fonts.label,
|
|
682
686
|
"--label-font-weight": theme.components.input.fonts.labelWeight,
|
|
683
687
|
"--label-font-size": theme.components.input.fonts.labelSize,
|
|
@@ -746,7 +750,7 @@ var InputBase3 = ({
|
|
|
746
750
|
},
|
|
747
751
|
item.id
|
|
748
752
|
)),
|
|
749
|
-
isLoading && /* @__PURE__ */ jsx10("li", { className: "dropdown-loading", children: /* @__PURE__ */ jsx10(LoadingSpinner, { size:
|
|
753
|
+
isLoading && /* @__PURE__ */ jsx10("li", { className: "dropdown-loading", children: /* @__PURE__ */ jsx10(LoadingSpinner, { size: 20 }) }),
|
|
750
754
|
!isLoading && items.length === 0 && /* @__PURE__ */ jsx10("li", { className: "dropdown-empty", children: "N\xE3o encontrado" })
|
|
751
755
|
] }) });
|
|
752
756
|
};
|
|
@@ -795,6 +799,7 @@ var InputBase3 = ({
|
|
|
795
799
|
setValue("");
|
|
796
800
|
setItems([]);
|
|
797
801
|
setPageNumber(1);
|
|
802
|
+
onChange?.(null);
|
|
798
803
|
onSelect(null);
|
|
799
804
|
},
|
|
800
805
|
className: "dropdown-clear",
|
package/dist/styles/button.css
CHANGED
package/dist/styles/input.css
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.label-input::before {
|
|
17
17
|
content: "";
|
|
18
18
|
position: absolute;
|
|
19
|
-
background-color: var(--label-
|
|
19
|
+
background-color: var(--label-line, #ffffff);
|
|
20
20
|
width: 100%;
|
|
21
21
|
height: 4px;
|
|
22
22
|
left: 0;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
.label-input::after {
|
|
28
28
|
content: "";
|
|
29
29
|
position: absolute;
|
|
30
|
-
background-color: var(--label-
|
|
30
|
+
background-color: var(--label-line, #ffffff);
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 2px;
|
|
33
33
|
left: 0;
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
background-color: var(--input-bg, #ffffff);
|
|
49
49
|
color: var(--input-text-color, #070707);
|
|
50
50
|
position: relative;
|
|
51
|
+
outline: none;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.input:focus {
|
|
54
|
-
outline: none;
|
|
55
55
|
border-color: var(--input-focus-border, #60a5fa);
|
|
56
|
+
box-shadow: none;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
.input:hover {
|
|
59
|
-
outline: none;
|
|
60
60
|
border-color: var(--input-focus-border, #60a5fa);
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -174,7 +174,7 @@ input:-webkit-autofill:focus {
|
|
|
174
174
|
|
|
175
175
|
.react-select__option--is-focused {
|
|
176
176
|
background-color: var(--input-focus-border, #79bdd8) !important;
|
|
177
|
-
color: var(--input-text-color, #ffffff);
|
|
177
|
+
color: var(--input-text-color, #ffffff) !important;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
.react-select__option--is-selected {
|