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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kahuna-base-react-components",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Kahuna Base React Components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -24,11 +24,10 @@ KButtonText.args = {
24
24
  borderRadius: 10,
25
25
  width: "160px",
26
26
  height: "44px",
27
- hoverBackground: "#A2FE67",
27
+ hoverBackground: "yellow",
28
28
  textDecoration: "underline",
29
- activeBackground: "#F00",
30
- border: "1px solid black",
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
- hoverBackground: "white",
44
- activeBackground: "red",
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
 
@@ -35,7 +35,7 @@ KTextAreaPrimary.args = {
35
35
  leftIcon: TracksIcon,
36
36
  activeBackground: "#FFF",
37
37
  maxHeight: 200,
38
- clearTextOnPressedEnter: true
38
+ clearTextOnPressedEnter: true,
39
39
  }
40
40
 
41
41
  export const KTextAreaLeftIcon = Template.bind({})
@@ -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 = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
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(event)
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: all 0.3s;
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: all 0.3s;
76
+ transition: all 0.3s, border 0s;
77
77
  }
78
78
 
79
79
  .k-button:focus {