kahuna-base-react-components 1.3.6 → 1.3.7

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/types.d.ts CHANGED
@@ -24,6 +24,7 @@ interface KButtonProps {
24
24
  border?: string;
25
25
  hoverBorder?: string;
26
26
  activeBorder?: string;
27
+ dataTestId?: string;
27
28
  }
28
29
  declare const KButton: React.FC<KButtonProps>;
29
30
 
@@ -38,6 +39,7 @@ interface KSpanProps {
38
39
  hoverStyle?: CSSProperties;
39
40
  textDecoration?: string;
40
41
  ellipsis?: boolean;
42
+ dataTestId?: string;
41
43
  }
42
44
  declare const KSpan: React.FC<KSpanProps>;
43
45
 
@@ -59,6 +61,7 @@ interface KTooltipProps {
59
61
  marginTop?: string;
60
62
  marginLeft?: string;
61
63
  hideDelay?: number;
64
+ dataTestId?: string;
62
65
  }
63
66
  declare const KTooltip: React.FC<KTooltipProps>;
64
67
 
@@ -73,6 +76,7 @@ interface KTitleSpanProps {
73
76
  bold?: boolean;
74
77
  ellipsis?: boolean;
75
78
  tooltipProps?: Partial<KTooltipProps>;
79
+ dataTestId?: string;
76
80
  }
77
81
  declare const KTitleSpan: React.FC<KTitleSpanProps>;
78
82
 
@@ -121,6 +125,7 @@ interface KInputProps {
121
125
  checked?: boolean;
122
126
  hoverBorder?: string;
123
127
  activeBorder?: string;
128
+ dataTestId?: string;
124
129
  }
125
130
  declare const KInput: React.FC<KInputProps>;
126
131
 
@@ -153,6 +158,7 @@ interface KTextAreaProps {
153
158
  checked?: boolean;
154
159
  maxHeight?: number;
155
160
  clearTextOnPressedEnter?: boolean;
161
+ dataTestId?: string;
156
162
  }
157
163
  declare const KTextArea: React.FC<KTextAreaProps>;
158
164
 
@@ -202,6 +208,7 @@ interface KDropdownProps {
202
208
  activeBorder?: string;
203
209
  onInputChange?: (text: string) => void;
204
210
  sortSelectedFirst?: boolean;
211
+ dataTestId?: string;
205
212
  }
206
213
  declare const KDropdown: React.FC<KDropdownProps>;
207
214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kahuna-base-react-components",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Kahuna Base React Components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -22,8 +22,9 @@ export interface KButtonProps {
22
22
  gap?: string
23
23
  activeBackground?: string
24
24
  border?: string
25
- hoverBorder?: string
26
- activeBorder?: string
25
+ hoverBorder?: string
26
+ activeBorder?: string
27
+ dataTestId?: string
27
28
  }
28
29
 
29
30
  const KButton: React.FC<KButtonProps> = (props) => {
@@ -49,6 +50,7 @@ const KButton: React.FC<KButtonProps> = (props) => {
49
50
 
50
51
  return (
51
52
  <button
53
+ data-testid={props.dataTestId}
52
54
  onMouseEnter={() => setHover(true)}
53
55
  onMouseLeave={() => setHover(false)}
54
56
  onMouseDown={() => setActive(true)}
@@ -55,7 +55,7 @@ export interface KDropdownProps {
55
55
  activeBorder?: string
56
56
  onInputChange?: (text: string) => void
57
57
  sortSelectedFirst?: boolean
58
-
58
+ dataTestId?: string
59
59
  }
60
60
 
61
61
  const KDropdown: React.FC<KDropdownProps> = (props) => {
@@ -233,6 +233,7 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
233
233
 
234
234
  return (
235
235
  <div
236
+ data-testid={props.dataTestId}
236
237
  className={"k-dropdown-container"}
237
238
  style={{
238
239
  background,
@@ -30,6 +30,7 @@ export interface KInputProps {
30
30
  checked?: boolean
31
31
  hoverBorder?: string
32
32
  activeBorder?: string
33
+ dataTestId?: string
33
34
  }
34
35
 
35
36
  const KInput: React.FC<KInputProps> = (props) => {
@@ -69,6 +70,7 @@ const KInput: React.FC<KInputProps> = (props) => {
69
70
 
70
71
  return (
71
72
  <div
73
+ data-testid={props.dataTestId}
72
74
  onMouseEnter={() => setHover(true)}
73
75
  onMouseLeave={() => setHover(false)}
74
76
  className={"k-input-container"}
@@ -12,6 +12,7 @@ export interface KSpanProps {
12
12
  hoverStyle?: CSSProperties
13
13
  textDecoration?: string
14
14
  ellipsis?: boolean
15
+ dataTestId?: string
15
16
  }
16
17
 
17
18
  const KSpan: React.FC<KSpanProps> = (props) => {
@@ -42,6 +43,7 @@ const KSpan: React.FC<KSpanProps> = (props) => {
42
43
 
43
44
  return (
44
45
  <span
46
+ data-testid={props.dataTestId}
45
47
  className={"k-span"}
46
48
  onMouseEnter={() => setOnHover(true)}
47
49
  onMouseLeave={() => setOnHover(false)}
@@ -30,6 +30,7 @@ export interface KTextAreaProps {
30
30
  checked?: boolean
31
31
  maxHeight?: number
32
32
  clearTextOnPressedEnter?: boolean
33
+ dataTestId?: string
33
34
  }
34
35
 
35
36
  const KTextArea: React.FC<KTextAreaProps> = (props) => {
@@ -78,6 +79,7 @@ const KTextArea: React.FC<KTextAreaProps> = (props) => {
78
79
 
79
80
  return (
80
81
  <div
82
+ data-testid={props.dataTestId}
81
83
  onMouseEnter={() => setHover(true)}
82
84
  onMouseLeave={() => setHover(false)}
83
85
  className={"k-input-container"}
@@ -15,6 +15,7 @@ export interface KTitleSpanProps {
15
15
  bold?: boolean
16
16
  ellipsis?: boolean
17
17
  tooltipProps?: Partial<KTooltipProps>
18
+ dataTestId?: string
18
19
  }
19
20
 
20
21
  const KTitleSpan: React.FC<KTitleSpanProps> = (props) => {
@@ -60,6 +61,7 @@ const KTitleSpan: React.FC<KTitleSpanProps> = (props) => {
60
61
  {...props.tooltipProps}
61
62
  >
62
63
  <span
64
+ data-testid={props.dataTestId}
63
65
  ref={textRef}
64
66
  className={`${titleClassName} ${ellipsis ? "block" : "flex items-center"}`}
65
67
  style={{
@@ -77,6 +79,7 @@ const KTitleSpan: React.FC<KTitleSpanProps> = (props) => {
77
79
  </KTooltip>
78
80
  ) : (
79
81
  <span
82
+ data-testid={props.dataTestId}
80
83
  ref={textRef}
81
84
  className={`${titleClassName} ${ellipsis ? "block" : "flex items-center"}`}
82
85
  style={{ fontSize, color, fontWeight, lineHeight, fontStyle, letterSpacing, ...(ellipsis && ellipsisStyle) }}
@@ -19,6 +19,7 @@ export interface KTooltipProps {
19
19
  marginTop?: string // position and align is used to position the tooltip. for additional changes in vertical positioning use this prop
20
20
  marginLeft?: string // position and align is used to position the tooltip. for minor changes in horizontal positioning use this prop
21
21
  hideDelay?: number
22
+ dataTestId?: string
22
23
  }
23
24
 
24
25
  const KTooltip: React.FC<KTooltipProps> = (props) => {
@@ -75,30 +76,39 @@ const KTooltip: React.FC<KTooltipProps> = (props) => {
75
76
  }
76
77
 
77
78
  return (
78
- <div className="relative box-border" onMouseEnter={showTooltip} onMouseLeave={hideTooltip}>
79
+ <div
80
+ className="relative box-border"
81
+ onMouseEnter={showTooltip}
82
+ onMouseLeave={hideTooltip}
83
+ data-testid={props.dataTestId}
84
+ >
79
85
  {props.children}
80
86
 
81
- {props.content !== null && <div
82
- className={`${absolutePositionClassName(position, align)} absolute ${
83
- isVisible ? "k-tooltip-enter" : "k-tooltip-exit"
84
- }`}
85
- style={{
86
- ...baseStyles,
87
- ...(props.marginTop && { marginTop: `${props.marginTop}` }),
88
- ...(props.marginLeft && { marginLeft: `${props.marginLeft}` })
89
- }}
90
- >
87
+ {props.content !== null && (
91
88
  <div
89
+ className={`${absolutePositionClassName(position, align)} absolute ${
90
+ isVisible ? "k-tooltip-enter" : "k-tooltip-exit"
91
+ }`}
92
92
  style={{
93
- padding,
94
- borderRadius,
95
- background
93
+ ...baseStyles,
94
+ ...(props.marginTop && { marginTop: `${props.marginTop}` }),
95
+ ...(props.marginLeft && { marginLeft: `${props.marginLeft}` })
96
96
  }}
97
97
  >
98
- {props.content}
98
+ <div
99
+ style={{
100
+ padding,
101
+ borderRadius,
102
+ background
103
+ }}
104
+ >
105
+ {props.content}
106
+ </div>
107
+ {showArrow && (
108
+ <div className={`arrow-${position}`} style={{ backgroundColor: arrowColor, zIndex: -200 }}></div>
109
+ )}
99
110
  </div>
100
- {showArrow && <div className={`arrow-${position}`} style={{ backgroundColor: arrowColor, zIndex: -200 }}></div>}
101
- </div>}
111
+ )}
102
112
  </div>
103
113
  )
104
114
  }