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.
- package/dist/components/KCodeInput/KCodeInput.d.ts +2 -2
- package/dist/components/KTooltip/KTooltip.d.ts +1 -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/languages/index.d.ts +2 -2
- package/dist/types.d.ts +4 -3
- package/package.json +1 -1
- package/src/components/KCodeInput/KCodeInput.tsx +2 -2
- package/src/components/KSelectRangeDate/KSelectRangeDate.tsx +1 -1
- package/src/components/KTooltip/KTooltip.stories.tsx +4 -2
- package/src/components/KTooltip/KTooltip.tsx +20 -3
- package/src/languages/en.json +1 -1
- package/src/languages/tr.json +1 -1
|
@@ -23,7 +23,7 @@ export declare const getLanguageJson: () => {
|
|
|
23
23
|
yesterday: string;
|
|
24
24
|
last_three_days: string;
|
|
25
25
|
last_week: string;
|
|
26
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|
|
343
|
+
export { KButton, KCodeInput, KDropdown, KInput, KLogo, KSelectDate, KSelectRange, KSelectRangeDate, KSlider, KSliderLabel, KSpan, KTextArea, KTitleSpan, KTooltip };
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ export interface KCodeInputProps {
|
|
|
34
34
|
autoBlur?: boolean
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const
|
|
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
|
|
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.
|
|
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 = () =>
|
|
27
|
-
|
|
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"
|
package/src/languages/en.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"yesterday": "Yesterday",
|
|
22
22
|
"last_three_days": "Last 3 days",
|
|
23
23
|
"last_week": "Last week",
|
|
24
|
-
"
|
|
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",
|
package/src/languages/tr.json
CHANGED