kahuna-base-react-components 1.2.2 → 1.2.3
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.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/KButton/KButton.stories.tsx +3 -4
- package/src/components/KInput/KInput.stories.tsx +2 -4
- package/src/components/KTextArea/KTextArea.stories.tsx +1 -1
- package/src/components/KTextArea/KTextArea.tsx +8 -2
- package/src/main.css +3 -3
package/package.json
CHANGED
|
@@ -24,11 +24,10 @@ KButtonText.args = {
|
|
|
24
24
|
borderRadius: 10,
|
|
25
25
|
width: "160px",
|
|
26
26
|
height: "44px",
|
|
27
|
-
hoverBackground: "
|
|
27
|
+
hoverBackground: "yellow",
|
|
28
28
|
textDecoration: "underline",
|
|
29
|
-
activeBackground: "
|
|
30
|
-
|
|
31
|
-
hoverBorder: "1px solid red",
|
|
29
|
+
activeBackground: "yellow",
|
|
30
|
+
hoverBorder: "1px solid yellow",
|
|
32
31
|
activeBorder: "1px solid transparent",
|
|
33
32
|
};
|
|
34
33
|
|
|
@@ -40,10 +40,8 @@ KInputPrimary.args = {
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
placeholder: "Placeholder...",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
border: "1px solid black",
|
|
46
|
-
hoverBorder: "1px solid red",
|
|
43
|
+
activeBackground: "yellow",
|
|
44
|
+
hoverBorder: "1px solid yellow",
|
|
47
45
|
activeBorder: "1px solid transparent",
|
|
48
46
|
}
|
|
49
47
|
|
|
@@ -68,7 +68,7 @@ const KTextArea: React.FC<KTextAreaProps> = (props) => {
|
|
|
68
68
|
const maxHeight = props.maxHeight || 200
|
|
69
69
|
const clearTextOnPressedEnter = props.clearTextOnPressedEnter || false
|
|
70
70
|
|
|
71
|
-
const handleInput = (
|
|
71
|
+
const handleInput = () => {
|
|
72
72
|
if (textAreaRef.current) {
|
|
73
73
|
const textarea = textAreaRef.current
|
|
74
74
|
textarea.style.height = "auto"
|
|
@@ -76,6 +76,12 @@ const KTextArea: React.FC<KTextAreaProps> = (props) => {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (autoResize) {
|
|
81
|
+
handleInput()
|
|
82
|
+
}
|
|
83
|
+
}, [])
|
|
84
|
+
|
|
79
85
|
return (
|
|
80
86
|
<div
|
|
81
87
|
onMouseEnter={() => setHover(true)}
|
|
@@ -121,7 +127,7 @@ const KTextArea: React.FC<KTextAreaProps> = (props) => {
|
|
|
121
127
|
}}
|
|
122
128
|
onChange={(event) => {
|
|
123
129
|
if (autoResize) {
|
|
124
|
-
handleInput(
|
|
130
|
+
handleInput()
|
|
125
131
|
}
|
|
126
132
|
|
|
127
133
|
props.onChange(event.target.value)
|
package/src/main.css
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
display: flex;
|
|
44
44
|
align-items: center;
|
|
45
45
|
align-self: stretch;
|
|
46
|
-
transition:
|
|
46
|
+
transition: all 0.3s, border 0s;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.k-input {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
line-height: 20px;
|
|
57
57
|
/* 142.857% */
|
|
58
58
|
letter-spacing: -0.084px;
|
|
59
|
-
transition: all 0.3s;
|
|
59
|
+
transition: all 0.3s, height 0s;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.k-input::placeholder {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
align-items: center;
|
|
74
74
|
gap: 4px;
|
|
75
75
|
align-self: stretch;
|
|
76
|
-
transition:
|
|
76
|
+
transition: all 0.3s, border 0s;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.k-button:focus {
|