kahuna-base-react-components 1.0.7 → 1.1.0
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/.prettierrc +8 -0
- package/README.md +23 -0
- package/dist/components/KButton/KButton.d.ts +17 -3
- package/dist/components/KCodeInput/KCodeInput.d.ts +36 -0
- package/dist/components/KCodeInput/index.d.ts +1 -0
- package/dist/components/KDropdown/KDropdown.d.ts +38 -0
- package/dist/components/KDropdown/index.d.ts +1 -0
- package/dist/components/KDropdownToggle/KDropdownToggle.d.ts +35 -0
- package/dist/components/KDropdownToggle/index.d.ts +1 -0
- package/dist/components/KInput/KInput.d.ts +32 -0
- package/dist/components/KInput/index.d.ts +1 -0
- package/dist/components/KLogo/KLogo.d.ts +18 -0
- package/dist/components/KLogo/index.d.ts +1 -0
- package/dist/components/KSelectDate/KSelectDate.d.ts +9 -0
- package/dist/components/KSelectDate/index.d.ts +1 -0
- package/dist/components/KSlider/KSlider.d.ts +15 -0
- package/dist/components/KSlider/index.d.ts +1 -0
- package/dist/components/KSliderLabel/KSliderLabel.d.ts +19 -0
- package/dist/components/KSliderLabel/index.d.ts +1 -0
- package/dist/components/KSpan/KSpan.d.ts +14 -4
- package/dist/components/KTextArea/KTextArea.d.ts +32 -0
- package/dist/components/KTextArea/index.d.ts +1 -0
- package/dist/components/KTitleSpan/KTitleSpan.d.ts +14 -0
- package/dist/components/KTitleSpan/index.d.ts +1 -0
- package/dist/components/KTooltip/KTooltip.d.ts +19 -0
- package/dist/components/KTooltip/index.d.ts +1 -0
- package/dist/fonts/AeonikPro-Bold/AeonikPro-Bold.otf +0 -0
- package/dist/fonts/AeonikPro-Bold/CoType EULA Desktop.pdf +1388 -3
- package/dist/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/dist/fonts/Inter/OFL.txt +93 -0
- package/dist/fonts/Inter/README.txt +72 -0
- package/dist/fonts/Inter/static/Inter-Black.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-Bold.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-Light.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-Medium.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-Regular.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
- package/dist/fonts/Inter/static/Inter-Thin.ttf +0 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.esm.js +9 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +241 -8
- package/package.json +14 -3
- package/postcss.config.js +6 -0
- package/removeUseClient.js +22 -0
- package/rollup.config.js +9 -3
- package/src/assets/calendar-hovered.svg +3 -0
- package/src/assets/calendar.svg +3 -0
- package/src/assets/check.svg +3 -0
- package/src/assets/chevron-left.svg +7 -0
- package/src/assets/chevron-right.svg +7 -0
- package/src/assets/fonts/AeonikPro/AeonikPro-Bold.otf +0 -0
- package/src/assets/fonts/AeonikPro/AeonikPro-Medium.otf +0 -0
- package/src/assets/fonts/AeonikPro/CoType EULA Desktop.pdf +1388 -3
- package/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/src/assets/fonts/Inter/OFL.txt +93 -0
- package/src/assets/fonts/Inter/README.txt +72 -0
- package/src/assets/fonts/Inter/static/Inter-Black.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-Light.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
- package/src/assets/fonts/Inter/static/Inter-Thin.ttf +0 -0
- package/src/assets/kahuna-text.svg +3 -0
- package/src/assets/logo-gray.svg +10 -0
- package/src/assets/logo-small-hovered.svg +4 -0
- package/src/assets/logo-small.svg +11 -0
- package/src/assets/logo.svg +11 -0
- package/src/assets/progress.svg +37 -0
- package/src/assets/separator.svg +3 -0
- package/src/assets/slider-dots.svg +7 -0
- package/src/assets/slider-step.svg +3 -0
- package/src/assets/slider-thumb.svg +3 -0
- package/src/assets/tracks.svg +5 -0
- package/src/assets/union.svg +3 -0
- package/src/assets/vector.svg +3 -0
- package/src/components/KButton/KButton.stories.tsx +69 -12
- package/src/components/KButton/KButton.tsx +51 -14
- package/src/components/KCodeInput/KCodeInput.stories.tsx +84 -0
- package/src/components/KCodeInput/KCodeInput.tsx +260 -0
- package/src/components/KCodeInput/index.ts +1 -0
- package/src/components/KDropdown/KDropdown.stories.tsx +90 -0
- package/src/components/KDropdown/KDropdown.tsx +201 -0
- package/src/components/KDropdown/index.ts +1 -0
- package/src/components/KInput/KInput.stories.tsx +84 -0
- package/src/components/KInput/KInput.tsx +128 -0
- package/src/components/KInput/index.ts +1 -0
- package/src/components/KLogo/KLogo.stories.tsx +24 -0
- package/src/components/KLogo/KLogo.tsx +79 -0
- package/src/components/KLogo/index.ts +1 -0
- package/src/components/KSelectDate/CalendarCustom.css +235 -0
- package/src/components/KSelectDate/KSelectDate.stories.tsx +54 -0
- package/src/components/KSelectDate/KSelectDate.tsx +314 -0
- package/src/components/KSelectDate/index.ts +1 -0
- package/src/components/KSlider/KSlider.stories.tsx +19 -0
- package/src/components/KSlider/KSlider.tsx +67 -0
- package/src/components/KSlider/index.ts +1 -0
- package/src/components/KSliderLabel/KSliderLabel.stories.tsx +61 -0
- package/src/components/KSliderLabel/KSliderLabel.tsx +137 -0
- package/src/components/KSliderLabel/index.ts +1 -0
- package/src/components/KSpan/KSpan.stories.tsx +31 -11
- package/src/components/KSpan/KSpan.tsx +65 -9
- package/src/components/KTextArea/KTextArea.stories.tsx +65 -0
- package/src/components/KTextArea/KTextArea.tsx +130 -0
- package/src/components/KTextArea/index.ts +1 -0
- package/src/components/KTitleSpan/KTitleSpan.stories.tsx +23 -0
- package/src/components/KTitleSpan/KTitleSpan.tsx +33 -0
- package/src/components/KTitleSpan/index.ts +1 -0
- package/src/components/KTooltip/KTooltip.stories.tsx +94 -0
- package/src/components/KTooltip/KTooltip.tsx +67 -0
- package/src/components/KTooltip/index.ts +1 -0
- package/src/index.ts +12 -1
- package/src/main.css +251 -0
- package/tailwind.config.js +9 -0
- package/dist/components/KButton/KButton.stories.d.ts +0 -4
- package/dist/components/KSpan/KSpan.stories.d.ts +0 -3
- package/src/stories/Button.stories.ts +0 -50
- package/src/stories/Button.tsx +0 -48
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -27
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -69
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React, { useEffect, useState, KeyboardEvent } from "react"
|
|
2
|
+
import "../../main.css"
|
|
3
|
+
|
|
4
|
+
export interface KInputProps {
|
|
5
|
+
value: string
|
|
6
|
+
onChange: (value: string) => void
|
|
7
|
+
onBlur?: (value: string) => void
|
|
8
|
+
onKeyDown?: (event: KeyboardEvent) => void
|
|
9
|
+
width?: number
|
|
10
|
+
height?: number
|
|
11
|
+
leftIcon?: string
|
|
12
|
+
rightIcon?: string
|
|
13
|
+
background?: string
|
|
14
|
+
activeBackground?: string
|
|
15
|
+
borderRadius?: number
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
placeholder?: string
|
|
18
|
+
shadowDisabled?: boolean
|
|
19
|
+
type?: string
|
|
20
|
+
leftIconClick?: () => void
|
|
21
|
+
rightIconClick?: () => void
|
|
22
|
+
accentColor?: string
|
|
23
|
+
hoverBackground?: string
|
|
24
|
+
padding?: string
|
|
25
|
+
gap?: string
|
|
26
|
+
border?: string
|
|
27
|
+
boxShadow?: string
|
|
28
|
+
fontSize?: string
|
|
29
|
+
iconSize?: string
|
|
30
|
+
checked?: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const KInput: React.FC<KInputProps> = (props) => {
|
|
34
|
+
const [background, setBackground] = useState("#F5F5F5")
|
|
35
|
+
const [hover, setHover] = useState(false)
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const emptyBackground = props.background || "#F5F5F5"
|
|
39
|
+
const activeBackground = props.activeBackground || "#FFF"
|
|
40
|
+
|
|
41
|
+
const background = props.value ? activeBackground : emptyBackground
|
|
42
|
+
setBackground(background)
|
|
43
|
+
}, [props.value])
|
|
44
|
+
|
|
45
|
+
const width = props.width || "100%"
|
|
46
|
+
const height = props.height || 20
|
|
47
|
+
const borderRadius = props.borderRadius || 10
|
|
48
|
+
const boxShadow = props.shadowDisabled
|
|
49
|
+
? ""
|
|
50
|
+
: props.boxShadow
|
|
51
|
+
? props.boxShadow
|
|
52
|
+
: "0 0 0 1px rgba(17, 17, 17, 0.04), 0 1px 1px 0 rgba(17, 17, 17, 0.04)"
|
|
53
|
+
const type = props.type || "text"
|
|
54
|
+
const accentColor = props.accentColor || ""
|
|
55
|
+
const disabled = props.disabled || false
|
|
56
|
+
const hoverBackground = props.hoverBackground || background
|
|
57
|
+
const padding = props.padding || "8px"
|
|
58
|
+
const gap = props.gap || "12px"
|
|
59
|
+
const border = props.border || "none"
|
|
60
|
+
const fontSize = props.fontSize || "14px"
|
|
61
|
+
const iconSize = props.iconSize || "20px"
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
onMouseEnter={() => setHover(true)}
|
|
66
|
+
onMouseLeave={() => setHover(false)}
|
|
67
|
+
className={"k-input-container"}
|
|
68
|
+
style={{ background: hover ? hoverBackground : background, borderRadius, boxShadow, padding, gap, border }}
|
|
69
|
+
>
|
|
70
|
+
{props.leftIcon && (
|
|
71
|
+
<img
|
|
72
|
+
src={props.leftIcon}
|
|
73
|
+
style={{
|
|
74
|
+
width: iconSize,
|
|
75
|
+
height: iconSize
|
|
76
|
+
}}
|
|
77
|
+
alt={"l-icon"}
|
|
78
|
+
className={props.leftIconClick && "cursor-pointer"}
|
|
79
|
+
onClick={() => {
|
|
80
|
+
if (props.leftIconClick) props.leftIconClick()
|
|
81
|
+
}}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
<input
|
|
86
|
+
type={type}
|
|
87
|
+
className={"k-input"}
|
|
88
|
+
style={{
|
|
89
|
+
background: hover ? hoverBackground : background,
|
|
90
|
+
width,
|
|
91
|
+
height,
|
|
92
|
+
accentColor,
|
|
93
|
+
fontSize
|
|
94
|
+
}}
|
|
95
|
+
{...(props.checked && (type === "checkbox" || type === "radio") && { checked: props.checked })}
|
|
96
|
+
value={props.value}
|
|
97
|
+
placeholder={props.placeholder || ""}
|
|
98
|
+
disabled={disabled}
|
|
99
|
+
onBlur={(event) => {
|
|
100
|
+
if (props.onBlur) props.onBlur(event.target.value)
|
|
101
|
+
}}
|
|
102
|
+
onChange={(event) => {
|
|
103
|
+
props.onChange(event.target.value)
|
|
104
|
+
}}
|
|
105
|
+
onKeyDown={(event) => {
|
|
106
|
+
if (props.onKeyDown) props.onKeyDown(event)
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
{props.rightIcon && (
|
|
111
|
+
<img
|
|
112
|
+
src={props.rightIcon}
|
|
113
|
+
style={{
|
|
114
|
+
width: iconSize,
|
|
115
|
+
height: iconSize
|
|
116
|
+
}}
|
|
117
|
+
alt={"r-icon"}
|
|
118
|
+
className={props.rightIconClick && "cursor-pointer"}
|
|
119
|
+
onClick={() => {
|
|
120
|
+
if (props.rightIconClick) props.rightIconClick()
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export default KInput
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './KInput';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {Meta, StoryFn} from "@storybook/react";
|
|
2
|
+
import KLogo from "./KLogo";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "ReactComponentLibrary/KLogo",
|
|
6
|
+
component: KLogo,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
} as Meta<typeof KLogo>;
|
|
11
|
+
|
|
12
|
+
const Template: StoryFn<typeof KLogo> = (args) => <KLogo {...args} />;
|
|
13
|
+
|
|
14
|
+
export const KLogoText = Template.bind({});
|
|
15
|
+
KLogoText.args = {
|
|
16
|
+
logoColor: "white",
|
|
17
|
+
width: 77,
|
|
18
|
+
height: 77
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const KLogoHover = Template.bind({});
|
|
22
|
+
KLogoHover.args = {
|
|
23
|
+
hoverEnabled: true,logoColor:"gray"
|
|
24
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import "../../main.css"
|
|
3
|
+
//@ts-ignore
|
|
4
|
+
import Logo from "../../assets/logo.svg"
|
|
5
|
+
//@ts-ignore
|
|
6
|
+
import KahunaIcon from "../../assets/kahuna-text.svg"
|
|
7
|
+
//@ts-ignore
|
|
8
|
+
import VectorIcon from "../../assets/vector.svg"
|
|
9
|
+
//@ts-ignore
|
|
10
|
+
import LogoWhite from "../../assets/logo-small.svg"
|
|
11
|
+
//@ts-ignore
|
|
12
|
+
import LogoWhiteHovered from "../../assets/logo-small-hovered.svg"
|
|
13
|
+
//@ts-ignore
|
|
14
|
+
import UnionSvg from "../../assets/union.svg"
|
|
15
|
+
//@ts-ignore
|
|
16
|
+
import LogoGray from "../../assets/logo-gray.svg"
|
|
17
|
+
import KTitleSpan from "../KTitleSpan"
|
|
18
|
+
import KSpan from "../KSpan"
|
|
19
|
+
|
|
20
|
+
export interface KLogoProps {
|
|
21
|
+
width?: number
|
|
22
|
+
height?: number
|
|
23
|
+
borderRadius?: number
|
|
24
|
+
primaryTextVisible?: boolean
|
|
25
|
+
secondaryText?: string
|
|
26
|
+
logoColor?: string
|
|
27
|
+
hoverEnabled?: boolean
|
|
28
|
+
secondaryTextColor?: string
|
|
29
|
+
secondaryTextFontSize?: number
|
|
30
|
+
hideIcon?: boolean
|
|
31
|
+
primaryTextWidth?: number
|
|
32
|
+
primaryTextHeight?: number
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const KLogo: React.FC<KLogoProps> = (props) => {
|
|
36
|
+
const width = props.width || 88
|
|
37
|
+
const height = props.height || 88
|
|
38
|
+
const borderRadius = props.borderRadius !== undefined ? props.borderRadius : 10
|
|
39
|
+
const logoColor = props.logoColor || "black"
|
|
40
|
+
|
|
41
|
+
const logoIcon = logoColor === "black" ? Logo : logoColor === "white" ? LogoWhite : LogoGray
|
|
42
|
+
const hoverEnabled = props.hoverEnabled || false
|
|
43
|
+
const hideIcon = props.hideIcon || false
|
|
44
|
+
|
|
45
|
+
const primaryTextVisible = props.primaryTextVisible || false
|
|
46
|
+
const primaryTextWidth = props.primaryTextWidth || 76
|
|
47
|
+
const primaryTextHeight = props.primaryTextHeight || 16
|
|
48
|
+
const secondaryTextColor = props.secondaryTextColor || "#000"
|
|
49
|
+
const secondaryTextFontSize = props.secondaryTextFontSize || 14
|
|
50
|
+
|
|
51
|
+
const [onHover, setOnHover] = useState(false)
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className={"flex items-center"}>
|
|
55
|
+
{!hideIcon && (
|
|
56
|
+
<img
|
|
57
|
+
src={onHover && hoverEnabled ? LogoWhiteHovered : logoIcon}
|
|
58
|
+
alt={"kahuna-logo"}
|
|
59
|
+
style={{ borderRadius, width, height }}
|
|
60
|
+
onMouseEnter={() => setOnHover(true)}
|
|
61
|
+
onMouseLeave={() => setOnHover(false)}
|
|
62
|
+
/>
|
|
63
|
+
)}
|
|
64
|
+
{primaryTextVisible && (
|
|
65
|
+
<div className={"mr-2 flex items-center"}>
|
|
66
|
+
<img src={UnionSvg} alt={"kahuna-union"} style={{ width: primaryTextWidth, height: primaryTextHeight }} />
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
{primaryTextVisible && props.secondaryText && <img src={VectorIcon} alt="vector" />}
|
|
70
|
+
{props.secondaryText && (
|
|
71
|
+
<div className={"pl-2 flex items-center"}>
|
|
72
|
+
<KSpan fontSize={secondaryTextFontSize} text={props.secondaryText} color={secondaryTextColor} />
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default KLogo
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default} from './KLogo';
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
.react-calendar {
|
|
2
|
+
width: 350px;
|
|
3
|
+
max-width: 100%;
|
|
4
|
+
background: white;
|
|
5
|
+
border: 1px solid #E7E7E7;
|
|
6
|
+
font-family: Inter;
|
|
7
|
+
line-height: 1.125em;
|
|
8
|
+
border-top-left-radius: 16px;
|
|
9
|
+
border-top-right-radius: 16px;
|
|
10
|
+
padding: 20px;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
color: #1F1F1F;
|
|
13
|
+
font-weight: 500;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.react-calendar--doubleView {
|
|
17
|
+
width: 700px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.react-calendar--doubleView .react-calendar__viewContainer {
|
|
21
|
+
display: flex;
|
|
22
|
+
margin: -0.5em;
|
|
23
|
+
border-radius: 16px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.react-calendar--doubleView .react-calendar__viewContainer>* {
|
|
27
|
+
width: 50%;
|
|
28
|
+
margin: 0.5em;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.react-calendar,
|
|
32
|
+
.react-calendar *,
|
|
33
|
+
.react-calendar *:before,
|
|
34
|
+
.react-calendar *:after {
|
|
35
|
+
-moz-box-sizing: border-box;
|
|
36
|
+
-webkit-box-sizing: border-box;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.react-calendar button {
|
|
41
|
+
margin: 0;
|
|
42
|
+
border: 0;
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.react-calendar button:enabled:hover {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.react-calendar__navigation {
|
|
51
|
+
display: flex;
|
|
52
|
+
height: 36px;
|
|
53
|
+
align-items: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.react-calendar__navigation button {
|
|
57
|
+
width: 44px;
|
|
58
|
+
color: #111;
|
|
59
|
+
font-weight: 500;
|
|
60
|
+
line-height: 24px;
|
|
61
|
+
letter-spacing: -0.176px;
|
|
62
|
+
background: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
.react-calendar__navigation button:disabled {
|
|
67
|
+
background-color: #f0f0f0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.react-calendar__navigation button:enabled:hover,
|
|
71
|
+
.react-calendar__navigation button:enabled:focus {
|
|
72
|
+
background-color: #F0F0F0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.react-calendar__month-view__weekdays {
|
|
76
|
+
text-align: center;
|
|
77
|
+
text-transform: uppercase;
|
|
78
|
+
font: inherit;
|
|
79
|
+
font-size: 0.75em;
|
|
80
|
+
font-weight: bold;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.react-calendar__month-view__weekdays__weekday {
|
|
84
|
+
font-family: Inter;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-weight: 500;
|
|
88
|
+
line-height: 20px;
|
|
89
|
+
letter-spacing: -0.084px;
|
|
90
|
+
width: 40px;
|
|
91
|
+
height: 40px;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.react-calendar__month-view__weekNumbers .react-calendar__tile {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
font: inherit;
|
|
102
|
+
font-size: 0.75em;
|
|
103
|
+
font-weight: bold;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.react-calendar__month-view__days {
|
|
107
|
+
justify-content: space-between;
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.react-calendar__month-view__days__day {
|
|
112
|
+
flex-basis: auto !important;
|
|
113
|
+
border-radius: 20px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.react-calendar__month-view__days__day--weekend {
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
font-style: normal;
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
line-height: 20px;
|
|
121
|
+
/* 142.857% */
|
|
122
|
+
letter-spacing: -0.084px;
|
|
123
|
+
color: #1F1F1F;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.react-calendar__month-view__days__day--neighboringMonth,
|
|
127
|
+
.react-calendar__decade-view__years__year--neighboringDecade,
|
|
128
|
+
.react-calendar__century-view__decades__decade--neighboringCentury {
|
|
129
|
+
color: #D6D6D6;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.react-calendar__year-view .react-calendar__tile,
|
|
133
|
+
.react-calendar__decade-view .react-calendar__tile,
|
|
134
|
+
.react-calendar__century-view .react-calendar__tile {
|
|
135
|
+
padding: 0;
|
|
136
|
+
/*old value : 2em 0.5em*/
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.react-calendar__navigation__arrow {
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
justify-content: center;
|
|
143
|
+
width: 24px !important;
|
|
144
|
+
height: 24px;
|
|
145
|
+
border-radius: 12px;
|
|
146
|
+
;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.react-calendar__tile {
|
|
150
|
+
height: 40px;
|
|
151
|
+
width: 40px !important;
|
|
152
|
+
background: none;
|
|
153
|
+
text-align: center;
|
|
154
|
+
font: inherit;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.react-calendar__tile:disabled {
|
|
158
|
+
background-color: #f0f0f0;
|
|
159
|
+
color: #ababab;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.react-calendar__month-view__days__day--neighboringMonth:disabled,
|
|
163
|
+
.react-calendar__decade-view__years__year--neighboringDecade:disabled,
|
|
164
|
+
.react-calendar__century-view__decades__decade--neighboringCentury:disabled {
|
|
165
|
+
color: #cdcdcd;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.react-calendar__tile:enabled:hover,
|
|
169
|
+
.react-calendar__tile:enabled:focus {
|
|
170
|
+
background-color: #F0F0F0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.react-calendar__tile--now {
|
|
174
|
+
background: #F2FE67
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.react-calendar__tile--now:enabled:hover,
|
|
178
|
+
.react-calendar__tile--now:enabled:focus {
|
|
179
|
+
background: #ffffa9;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.react-calendar__tile--hasActive {
|
|
183
|
+
background: #111111;
|
|
184
|
+
/*76baff*/
|
|
185
|
+
color: #FFFFFF;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.react-calendar__tile--hasActive:enabled:hover,
|
|
189
|
+
.react-calendar__tile--hasActive:enabled:focus {
|
|
190
|
+
background: #111111;
|
|
191
|
+
/*old value: #a9d4ff*/
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.react-calendar__tile--active {
|
|
195
|
+
background: #111;
|
|
196
|
+
color: white;
|
|
197
|
+
border-radius: 999px;
|
|
198
|
+
height: 40px;
|
|
199
|
+
width: 40px !important;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.react-calendar__tile--active:enabled:hover,
|
|
203
|
+
.react-calendar__tile--active:enabled:focus {
|
|
204
|
+
background: #111111;
|
|
205
|
+
/*old value: 1087ff*/
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.react-calendar--selectRange .react-calendar__tile--hover {
|
|
209
|
+
background-color: #F0F0F0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.react-calendar__month-view__weekdays__weekday {
|
|
213
|
+
text-decoration: none !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.react-calendar__month-view__weekdays__weekday--weekend {
|
|
217
|
+
text-decoration: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
abbr:where([title]) {
|
|
221
|
+
text-decoration: none !important;
|
|
222
|
+
color: #3D3D3D;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.react-calendar__navigation__label__labelText {
|
|
226
|
+
color: #111;
|
|
227
|
+
font-size: 16px;
|
|
228
|
+
font-weight: 500 !important;
|
|
229
|
+
line-height: 24px;
|
|
230
|
+
letter-spacing: -0.176px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.react-calendar__year-view__months__month {
|
|
234
|
+
padding: 0 !important;
|
|
235
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Meta, StoryFn } from "@storybook/react"
|
|
2
|
+
import KSelectDate, { KSelectDateProps } from "./KSelectDate"
|
|
3
|
+
import { useEffect, useState } from "react"
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "ReactComponentLibrary/KSelectDate",
|
|
7
|
+
component: KSelectDate,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered"
|
|
10
|
+
}
|
|
11
|
+
} as Meta<typeof KSelectDate>
|
|
12
|
+
|
|
13
|
+
const KSelectDateWrapper: React.FC<KSelectDateProps> = (args) => {
|
|
14
|
+
|
|
15
|
+
const [selectedDate, setSelectedDate] = useState<Date | undefined>(undefined)
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
console.log("selectedDate: ", selectedDate)
|
|
18
|
+
}, [selectedDate])
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<KSelectDate
|
|
22
|
+
{...args}
|
|
23
|
+
value={selectedDate}
|
|
24
|
+
onChange={(date) => {
|
|
25
|
+
console.log("date: ", date)
|
|
26
|
+
if (date) {
|
|
27
|
+
setSelectedDate(date)
|
|
28
|
+
console.log("updating is completed: ", date)
|
|
29
|
+
console.log("updating is completed date.toISOString(): ", date?.toISOString())
|
|
30
|
+
} else {
|
|
31
|
+
setSelectedDate(undefined)
|
|
32
|
+
console.log("Deleting is completed")
|
|
33
|
+
}
|
|
34
|
+
}}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const Template: StoryFn<typeof KSelectDateWrapper> = (args) => <KSelectDateWrapper {...args} />
|
|
40
|
+
|
|
41
|
+
export const KSelectDatePrimary = Template.bind({})
|
|
42
|
+
KSelectDatePrimary.args = {
|
|
43
|
+
value: undefined,
|
|
44
|
+
onChange: (value) => {
|
|
45
|
+
if (value) {
|
|
46
|
+
console.log("value is updated using this value:", value)
|
|
47
|
+
} else {
|
|
48
|
+
console.log("value is deleted, because it is: ", value)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const KSelectDateHoverText = Template.bind({})
|
|
54
|
+
KSelectDateHoverText.args = {}
|