kahuna-base-react-components 0.2.5 → 0.2.6
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/components/KDropdown/KDropdown.d.ts +1 -1
- package/dist/components/KInput/KInput.d.ts +2 -0
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/KDropdown/KDropdown.tsx +3 -3
- package/src/components/KInput/KInput.tsx +20 -2
- package/src/main.css +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ interface KInputProps {
|
|
|
78
78
|
gap?: string;
|
|
79
79
|
border?: string;
|
|
80
80
|
boxShadow?: string;
|
|
81
|
+
fontSize?: string;
|
|
82
|
+
iconSize?: string;
|
|
81
83
|
}
|
|
82
84
|
declare const KInput: React.FC<KInputProps>;
|
|
83
85
|
|
|
@@ -109,7 +111,7 @@ interface KDropdownProps {
|
|
|
109
111
|
menuBackground?: string;
|
|
110
112
|
padding?: string;
|
|
111
113
|
gap?: string;
|
|
112
|
-
|
|
114
|
+
hideChosenOptionIcon?: boolean;
|
|
113
115
|
}
|
|
114
116
|
declare const KDropdown: React.FC<KDropdownProps>;
|
|
115
117
|
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ export interface KDropdownProps {
|
|
|
34
34
|
menuBackground?: string
|
|
35
35
|
padding?:string
|
|
36
36
|
gap?: string
|
|
37
|
-
|
|
37
|
+
hideChosenOptionIcon?: boolean
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
@@ -58,7 +58,7 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
58
58
|
const menuBackground = props.menuBackground || "rgb(249, 249, 249)";
|
|
59
59
|
const padding = props.padding || "8px"
|
|
60
60
|
const gap = props.gap || "4px"
|
|
61
|
-
const
|
|
61
|
+
const hideIcon = props.hideChosenOptionIcon || false
|
|
62
62
|
|
|
63
63
|
const getOptionLabels = (option: KSelectOption) => {
|
|
64
64
|
return (
|
|
@@ -151,7 +151,7 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
151
151
|
DropdownIndicator: () => null,
|
|
152
152
|
SingleValue: ({ data, ...props }) => (
|
|
153
153
|
<div className="flex" style={{ position: "absolute" }}>
|
|
154
|
-
{data.icon &&
|
|
154
|
+
{data.icon && !hideIcon && <img src={data.icon} className="mr-2" width={20} alt={"data-icon"} />}
|
|
155
155
|
<KSpan text={data.label} color="#111" />
|
|
156
156
|
</div>
|
|
157
157
|
)
|
|
@@ -24,6 +24,8 @@ export interface KInputProps {
|
|
|
24
24
|
gap?: string
|
|
25
25
|
border?: string
|
|
26
26
|
boxShadow?: string
|
|
27
|
+
fontSize?: string
|
|
28
|
+
iconSize?: string
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
const KInput: React.FC<KInputProps> = (props) => {
|
|
@@ -39,7 +41,7 @@ const KInput: React.FC<KInputProps> = (props) => {
|
|
|
39
41
|
}, [props.value])
|
|
40
42
|
|
|
41
43
|
const width = props.width || "100%"
|
|
42
|
-
const height = props.height ||
|
|
44
|
+
const height = props.height || 20
|
|
43
45
|
const borderRadius = props.borderRadius || 10
|
|
44
46
|
const boxShadow = props.shadowDisabled ? "" : props.boxShadow ? props.boxShadow : "0 0 0 1px rgba(17, 17, 17, 0.04), 0 1px 1px 0 rgba(17, 17, 17, 0.04)"
|
|
45
47
|
const type = props.type || "text"
|
|
@@ -49,6 +51,8 @@ const KInput: React.FC<KInputProps> = (props) => {
|
|
|
49
51
|
const padding = props.padding || "8px"
|
|
50
52
|
const gap = props.gap || "12px"
|
|
51
53
|
const border = props.border || "none"
|
|
54
|
+
const fontSize = props.fontSize || "14px"
|
|
55
|
+
const iconSize = props.iconSize || "20px"
|
|
52
56
|
|
|
53
57
|
return (
|
|
54
58
|
<div
|
|
@@ -60,6 +64,10 @@ const KInput: React.FC<KInputProps> = (props) => {
|
|
|
60
64
|
{props.leftIcon && (
|
|
61
65
|
<img
|
|
62
66
|
src={props.leftIcon}
|
|
67
|
+
style={{
|
|
68
|
+
width: iconSize,
|
|
69
|
+
height: iconSize
|
|
70
|
+
}}
|
|
63
71
|
alt={"l-icon"}
|
|
64
72
|
className={props.leftIconClick && "cursor-pointer"}
|
|
65
73
|
onClick={() => {
|
|
@@ -71,7 +79,13 @@ const KInput: React.FC<KInputProps> = (props) => {
|
|
|
71
79
|
<input
|
|
72
80
|
type={type}
|
|
73
81
|
className={"k-input"}
|
|
74
|
-
style={{
|
|
82
|
+
style={{
|
|
83
|
+
background: hover ? hoverBackground : background,
|
|
84
|
+
width,
|
|
85
|
+
height,
|
|
86
|
+
accentColor,
|
|
87
|
+
fontSize,
|
|
88
|
+
}}
|
|
75
89
|
value={props.value}
|
|
76
90
|
placeholder={props.placeholder || ""}
|
|
77
91
|
disabled={disabled}
|
|
@@ -86,6 +100,10 @@ const KInput: React.FC<KInputProps> = (props) => {
|
|
|
86
100
|
{props.rightIcon && (
|
|
87
101
|
<img
|
|
88
102
|
src={props.rightIcon}
|
|
103
|
+
style={{
|
|
104
|
+
width: iconSize,
|
|
105
|
+
height: iconSize
|
|
106
|
+
}}
|
|
89
107
|
alt={"r-icon"}
|
|
90
108
|
className={props.rightIconClick && "cursor-pointer"}
|
|
91
109
|
onClick={() => {
|