kahuna-base-react-components 1.3.5 → 1.3.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.
@@ -23,7 +23,7 @@ export declare const getLanguageJson: () => {
23
23
  yesterday: string;
24
24
  last_three_days: string;
25
25
  last_week: string;
26
- last_two_week: string;
26
+ last_two_weeks: string;
27
27
  last_month: string;
28
28
  last_three_months: string;
29
29
  last_six_months: string;
@@ -59,7 +59,7 @@ export declare const lang: {
59
59
  yesterday: string;
60
60
  last_three_days: string;
61
61
  last_week: string;
62
- last_two_week: string;
62
+ last_two_weeks: string;
63
63
  last_month: string;
64
64
  last_three_months: string;
65
65
  last_six_months: string;
package/dist/types.d.ts CHANGED
@@ -58,6 +58,7 @@ interface KTooltipProps {
58
58
  padding?: string;
59
59
  marginTop?: string;
60
60
  marginLeft?: string;
61
+ hideDelay?: number;
61
62
  }
62
63
  declare const KTooltip: React.FC<KTooltipProps>;
63
64
 
@@ -121,7 +122,7 @@ interface KInputProps {
121
122
  hoverBorder?: string;
122
123
  activeBorder?: string;
123
124
  }
124
- declare const KInput$1: React.FC<KInputProps>;
125
+ declare const KInput: React.FC<KInputProps>;
125
126
 
126
127
  interface KTextAreaProps {
127
128
  value: string;
@@ -291,7 +292,7 @@ interface KCodeInputProps {
291
292
  isCodeCorrect?: boolean;
292
293
  autoBlur?: boolean;
293
294
  }
294
- declare const KInput: React.FC<KCodeInputProps>;
295
+ declare const KCodeInput: React.FC<KCodeInputProps>;
295
296
 
296
297
  interface KSelectRangeProps {
297
298
  value: DateRangeType$1;
@@ -339,4 +340,4 @@ interface KSelectRangeDateProps {
339
340
  type DateRangeType = Date | null | [Date | null, Date | null];
340
341
  declare const KSelectRangeDate: React.FC<KSelectRangeDateProps>;
341
342
 
342
- export { KButton, KInput as KCodeInput, KDropdown, KInput$1 as KInput, KLogo, KSelectDate, KSelectRange, KSelectRangeDate, KSlider, KSliderLabel, KSpan, KTextArea, KTitleSpan, KTooltip };
343
+ export { KButton, KCodeInput, KDropdown, KInput, KLogo, KSelectDate, KSelectRange, KSelectRangeDate, KSlider, KSliderLabel, KSpan, KTextArea, KTitleSpan, KTooltip };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kahuna-base-react-components",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "Kahuna Base React Components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -34,7 +34,7 @@ export interface KCodeInputProps {
34
34
  autoBlur?: boolean
35
35
  }
36
36
 
37
- const KInput: React.FC<KCodeInputProps> = (props) => {
37
+ const KCodeInput: React.FC<KCodeInputProps> = (props) => {
38
38
  const autoFocus = props.autoFocus || false
39
39
  const autoBlur = props.autoBlur || false
40
40
  const borderRadius = props.borderRadius || 10
@@ -257,4 +257,4 @@ const KInput: React.FC<KCodeInputProps> = (props) => {
257
257
  )
258
258
  }
259
259
 
260
- export default KInput
260
+ export default KCodeInput
@@ -279,7 +279,7 @@ const KSelectRangeDate: React.FC<KSelectRangeDateProps> = (props) => {
279
279
  width="140px"
280
280
  background={shorthandIndex.current === 3 ? "#F7F7F7" : "#FFF"}
281
281
  textColor={shorthandIndex.current === 3 ? "#000" : "#999"}
282
- text={lang.button_text.last_two_week}
282
+ text={lang.button_text.last_two_weeks}
283
283
  borderRadius={8}
284
284
  shadowDisabled
285
285
  hoverBackground="#F0F0F0"
@@ -28,7 +28,8 @@ KTooltipPrimary.args = {
28
28
  arrowColor: "green",
29
29
  showArrow: true,
30
30
  padding: "10px",
31
- border: "1px solid red"
31
+ border: "1px solid red",
32
+ marginLeft: "200px",
32
33
  //boxShadow: "3px 3px 10px #000",
33
34
  //borderRadius: "100px",
34
35
  }
@@ -85,7 +86,8 @@ KTooltipSecondary.args = {
85
86
  </div>
86
87
  ),
87
88
  arrowColor: "red",
88
- padding: "0px"
89
+ padding: "0px",
90
+ hideDelay: 200
89
91
  //boxShadow: "3px 3px 10px #000",
90
92
  //borderRadius: "100px",
91
93
  }
@@ -1,4 +1,4 @@
1
- import React, { useState } from "react"
1
+ import React, { useRef, useState } from "react"
2
2
  import "../../main.css"
3
3
 
4
4
  export interface KTooltipProps {
@@ -18,13 +18,30 @@ export interface KTooltipProps {
18
18
  padding?: string
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
+ hideDelay?: number
21
22
  }
22
23
 
23
24
  const KTooltip: React.FC<KTooltipProps> = (props) => {
24
25
  const [isVisible, setIsVisible] = useState(false)
26
+ const timeoutRef = useRef<NodeJS.Timeout | null>(null)
25
27
 
26
- const showTooltip = () => setIsVisible(true)
27
- const hideTooltip = () => setIsVisible(false)
28
+ const showTooltip = () => {
29
+ if (timeoutRef.current) {
30
+ clearTimeout(timeoutRef.current)
31
+ timeoutRef.current = null
32
+ }
33
+ setIsVisible(true)
34
+ }
35
+
36
+ const hideTooltip = () => {
37
+ if (props.hideDelay && props.hideDelay > 0) {
38
+ timeoutRef.current = setTimeout(() => {
39
+ setIsVisible(false)
40
+ }, props.hideDelay)
41
+ } else {
42
+ setIsVisible(false)
43
+ }
44
+ }
28
45
 
29
46
  const position = props.position || "top"
30
47
  const align = props.align || "center"
@@ -21,7 +21,7 @@
21
21
  "yesterday": "Yesterday",
22
22
  "last_three_days": "Last 3 days",
23
23
  "last_week": "Last week",
24
- "last_two_week": "Last 2 week",
24
+ "last_two_weeks": "Last 2 weeks",
25
25
  "last_month": "Last Month",
26
26
  "last_three_months": "Last 3 months",
27
27
  "last_six_months": "Last 6 months",
@@ -21,7 +21,7 @@
21
21
  "yesterday": "Dün",
22
22
  "last_three_days": "Son 3 gün",
23
23
  "last_week": "Son hafta",
24
- "last_two_week": "Son 2 hafta",
24
+ "last_two_weeks": "Son 2 hafta",
25
25
  "last_month": "Son ay",
26
26
  "last_three_months": "Son 3 ay",
27
27
  "last_six_months": "Son 6 ay",