@charlesgomes/leafcode-shared-lib-react 1.0.62 → 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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -2
- package/dist/index.mjs +9 -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,8 +102,10 @@ interface PaginatedResponse$1 {
|
|
|
102
102
|
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
103
103
|
name: string;
|
|
104
104
|
label?: string;
|
|
105
|
-
|
|
105
|
+
value?: string | number | readonly string[] | undefined;
|
|
106
|
+
onChange?: (value: any) => void;
|
|
106
107
|
onSelect: (item: any) => void;
|
|
108
|
+
error?: FieldError;
|
|
107
109
|
defaultValue?: any;
|
|
108
110
|
inputAutocompleteActive?: string;
|
|
109
111
|
queryKey: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -102,8 +102,10 @@ interface PaginatedResponse$1 {
|
|
|
102
102
|
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
103
103
|
name: string;
|
|
104
104
|
label?: string;
|
|
105
|
-
|
|
105
|
+
value?: string | number | readonly string[] | undefined;
|
|
106
|
+
onChange?: (value: any) => void;
|
|
106
107
|
onSelect: (item: any) => void;
|
|
108
|
+
error?: FieldError;
|
|
107
109
|
defaultValue?: any;
|
|
108
110
|
inputAutocompleteActive?: string;
|
|
109
111
|
queryKey: string;
|
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
|
{
|
|
@@ -713,6 +716,7 @@ var InputBase3 = ({
|
|
|
713
716
|
name,
|
|
714
717
|
label,
|
|
715
718
|
error,
|
|
719
|
+
onChange,
|
|
716
720
|
onSelect,
|
|
717
721
|
defaultValue,
|
|
718
722
|
inputAutocompleteActive,
|
|
@@ -726,6 +730,7 @@ var InputBase3 = ({
|
|
|
726
730
|
}, ref) => {
|
|
727
731
|
const theme = useLeafcodeTheme();
|
|
728
732
|
const styleVars = {
|
|
733
|
+
"--label-line": theme.colors.light,
|
|
729
734
|
"--label-font-family": theme.components.input.fonts.label,
|
|
730
735
|
"--label-font-weight": theme.components.input.fonts.labelWeight,
|
|
731
736
|
"--label-font-size": theme.components.input.fonts.labelSize,
|
|
@@ -794,7 +799,7 @@ var InputBase3 = ({
|
|
|
794
799
|
},
|
|
795
800
|
item.id
|
|
796
801
|
)),
|
|
797
|
-
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 }) }),
|
|
798
803
|
!isLoading && items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "dropdown-empty", children: "N\xE3o encontrado" })
|
|
799
804
|
] }) });
|
|
800
805
|
};
|
|
@@ -828,6 +833,7 @@ var InputBase3 = ({
|
|
|
828
833
|
value,
|
|
829
834
|
onChange: (e) => {
|
|
830
835
|
setValue(e.target.value);
|
|
836
|
+
onChange?.(e.target.value);
|
|
831
837
|
setIsOpen(true);
|
|
832
838
|
},
|
|
833
839
|
onFocus: () => setIsOpen(true),
|
|
@@ -842,6 +848,7 @@ var InputBase3 = ({
|
|
|
842
848
|
setValue("");
|
|
843
849
|
setItems([]);
|
|
844
850
|
setPageNumber(1);
|
|
851
|
+
onChange?.(null);
|
|
845
852
|
onSelect(null);
|
|
846
853
|
},
|
|
847
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
|
{
|
|
@@ -664,6 +667,7 @@ var InputBase3 = ({
|
|
|
664
667
|
name,
|
|
665
668
|
label,
|
|
666
669
|
error,
|
|
670
|
+
onChange,
|
|
667
671
|
onSelect,
|
|
668
672
|
defaultValue,
|
|
669
673
|
inputAutocompleteActive,
|
|
@@ -677,6 +681,7 @@ var InputBase3 = ({
|
|
|
677
681
|
}, ref) => {
|
|
678
682
|
const theme = useLeafcodeTheme();
|
|
679
683
|
const styleVars = {
|
|
684
|
+
"--label-line": theme.colors.light,
|
|
680
685
|
"--label-font-family": theme.components.input.fonts.label,
|
|
681
686
|
"--label-font-weight": theme.components.input.fonts.labelWeight,
|
|
682
687
|
"--label-font-size": theme.components.input.fonts.labelSize,
|
|
@@ -745,7 +750,7 @@ var InputBase3 = ({
|
|
|
745
750
|
},
|
|
746
751
|
item.id
|
|
747
752
|
)),
|
|
748
|
-
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 }) }),
|
|
749
754
|
!isLoading && items.length === 0 && /* @__PURE__ */ jsx10("li", { className: "dropdown-empty", children: "N\xE3o encontrado" })
|
|
750
755
|
] }) });
|
|
751
756
|
};
|
|
@@ -779,6 +784,7 @@ var InputBase3 = ({
|
|
|
779
784
|
value,
|
|
780
785
|
onChange: (e) => {
|
|
781
786
|
setValue(e.target.value);
|
|
787
|
+
onChange?.(e.target.value);
|
|
782
788
|
setIsOpen(true);
|
|
783
789
|
},
|
|
784
790
|
onFocus: () => setIsOpen(true),
|
|
@@ -793,6 +799,7 @@ var InputBase3 = ({
|
|
|
793
799
|
setValue("");
|
|
794
800
|
setItems([]);
|
|
795
801
|
setPageNumber(1);
|
|
802
|
+
onChange?.(null);
|
|
796
803
|
onSelect(null);
|
|
797
804
|
},
|
|
798
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 {
|