kahuna-base-react-components 0.2.11 → 0.2.13
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/KButton/KButton.stories.d.ts +8 -0
- package/dist/components/KDropdown/KDropdown.d.ts +2 -1
- package/dist/components/KDropdown/KDropdown.stories.d.ts +7 -0
- package/dist/components/KInput/KInput.stories.d.ts +8 -0
- package/dist/components/KLogo/KLogo.stories.d.ts +5 -0
- package/dist/components/KSelectDate/KSelectDate.d.ts +9 -0
- package/dist/components/KSelectDate/KSelectDate.stories.d.ts +5 -0
- package/dist/components/KSelectDate/index.d.ts +1 -0
- package/dist/components/KSlider/KSlider.stories.d.ts +3 -0
- package/dist/components/KSpan/KSpan.d.ts +1 -0
- package/dist/components/KSpan/KSpan.stories.d.ts +4 -0
- package/dist/components/KTitleSpan/KTitleSpan.stories.d.ts +3 -0
- package/dist/components/KTooltip/KTooltip.d.ts +19 -0
- package/dist/components/KTooltip/KTooltip.stories.d.ts +5 -0
- package/dist/components/KTooltip/index.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- 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 +27 -2
- package/package.json +4 -2
- package/removeUseClient.js +22 -0
- package/rollup.config.js +2 -0
- package/src/assets/calendar-hovered.svg +3 -0
- package/src/assets/calendar.svg +3 -0
- package/src/assets/separator.svg +3 -0
- package/src/components/KDropdown/KDropdown.stories.tsx +17 -7
- package/src/components/KDropdown/KDropdown.tsx +6 -3
- 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/KSpan/KSpan.tsx +6 -2
- 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 +3 -1
- package/src/main.css +94 -4
package/dist/types.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ interface KSpanProps {
|
|
|
33
33
|
hoverTextColor?: string;
|
|
34
34
|
hoverStyle?: CSSProperties;
|
|
35
35
|
textDecoration?: string;
|
|
36
|
+
ellipsis?: boolean;
|
|
36
37
|
}
|
|
37
38
|
declare const KSpan: React.FC<KSpanProps>;
|
|
38
39
|
|
|
@@ -98,7 +99,7 @@ interface KDropdownProps {
|
|
|
98
99
|
defaultValue?: KSelectOption | MultiValue<KSelectOption>;
|
|
99
100
|
defaultValuePrimitive?: string | number;
|
|
100
101
|
selected?: KSelectOption | MultiValue<KSelectOption>;
|
|
101
|
-
onSelect: (selected: KSelectOption | MultiValue<KSelectOption>) => void;
|
|
102
|
+
onSelect: (selected: KSelectOption | MultiValue<KSelectOption> | undefined) => void;
|
|
102
103
|
options: KSelectOption[];
|
|
103
104
|
width?: number;
|
|
104
105
|
height?: number;
|
|
@@ -117,6 +118,7 @@ interface KDropdownProps {
|
|
|
117
118
|
gap?: string;
|
|
118
119
|
hideChosenOptionIcon?: boolean;
|
|
119
120
|
isClearable?: boolean;
|
|
121
|
+
isEllipsis?: boolean;
|
|
120
122
|
}
|
|
121
123
|
declare const KDropdown: React.FC<KDropdownProps>;
|
|
122
124
|
|
|
@@ -133,4 +135,27 @@ interface KSliderProps {
|
|
|
133
135
|
}
|
|
134
136
|
declare const KSlider: React.FC<KSliderProps>;
|
|
135
137
|
|
|
136
|
-
|
|
138
|
+
interface KSelectDateProps {
|
|
139
|
+
value: Date | undefined;
|
|
140
|
+
onChange: (date: Date | undefined) => void;
|
|
141
|
+
}
|
|
142
|
+
declare const KSelectDate: React.FC<KSelectDateProps>;
|
|
143
|
+
|
|
144
|
+
interface KTooltipProps {
|
|
145
|
+
children: React.ReactNode;
|
|
146
|
+
content: React.ReactNode;
|
|
147
|
+
position?: string;
|
|
148
|
+
backgroundColor?: string;
|
|
149
|
+
width?: string;
|
|
150
|
+
height?: string;
|
|
151
|
+
zIndex?: number;
|
|
152
|
+
border?: string;
|
|
153
|
+
borderRadius?: string;
|
|
154
|
+
boxShadow?: string;
|
|
155
|
+
showArrow?: boolean;
|
|
156
|
+
arrowColor?: string;
|
|
157
|
+
padding?: string;
|
|
158
|
+
}
|
|
159
|
+
declare const KTooltip: React.FC<KTooltipProps>;
|
|
160
|
+
|
|
161
|
+
export { KButton, KDropdown, KInput, KLogo, KSelectDate, KSlider, KSpan, KTitleSpan, KTooltip };
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kahuna-base-react-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Kahuna Base React Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"prebuild": "node removeUseClient.js",
|
|
10
11
|
"build": "rollup -c --bundleConfigAsCjs && npm run remove-stories",
|
|
11
12
|
"remove-stories": "find dist/ -name '*.stories.*' -type f -delete",
|
|
12
13
|
"storybook": "storybook dev -p 6006",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"typescript": "^5.4.2"
|
|
65
66
|
},
|
|
66
67
|
"dependencies": {
|
|
68
|
+
"react-date-picker": "^11.0.0",
|
|
67
69
|
"react-select": "^5.8.0"
|
|
68
70
|
}
|
|
69
|
-
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
// Function to remove "use client" directive from a file
|
|
5
|
+
const removeUseClientDirective = (filePath) => {
|
|
6
|
+
const content = fs.readFileSync(filePath, 'utf8')
|
|
7
|
+
const updatedContent = content.replace(/^['"]use client['"];/, '')
|
|
8
|
+
fs.writeFileSync(filePath, updatedContent, 'utf8')
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Specify the paths to the files that contain "use client"
|
|
12
|
+
const reactCalendarPath = path.resolve(__dirname, 'node_modules', 'react-calendar', 'dist', 'esm')
|
|
13
|
+
const filesToUpdate = [
|
|
14
|
+
path.join(reactCalendarPath, 'Calendar.js'),
|
|
15
|
+
path.join(reactCalendarPath, 'Calendar', 'Navigation.js'),
|
|
16
|
+
// Add any other necessary files
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
// Remove the directive from each file
|
|
20
|
+
filesToUpdate.forEach(removeUseClientDirective)
|
|
21
|
+
|
|
22
|
+
console.log('Removed "use client" directives from react-calendar.')
|
package/rollup.config.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
2
|
+
<path d="M13.75 3.25H16.75C16.9489 3.25 17.1397 3.32902 17.2803 3.46967C17.421 3.61032 17.5 3.80109 17.5 4V16C17.5 16.1989 17.421 16.3897 17.2803 16.5303C17.1397 16.671 16.9489 16.75 16.75 16.75H3.25C3.05109 16.75 2.86032 16.671 2.71967 16.5303C2.57902 16.3897 2.5 16.1989 2.5 16V4C2.5 3.80109 2.57902 3.61032 2.71967 3.46967C2.86032 3.32902 3.05109 3.25 3.25 3.25H6.25V1.75H7.75V3.25H12.25V1.75H13.75V3.25ZM12.25 4.75H7.75V6.25H6.25V4.75H4V7.75H16V4.75H13.75V6.25H12.25V4.75ZM16 9.25H4V15.25H16V9.25Z" fill="#434345"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
2
|
+
<path d="M13.75 3.25H16.75C16.9489 3.25 17.1397 3.32902 17.2803 3.46967C17.421 3.61032 17.5 3.80109 17.5 4V16C17.5 16.1989 17.421 16.3897 17.2803 16.5303C17.1397 16.671 16.9489 16.75 16.75 16.75H3.25C3.05109 16.75 2.86032 16.671 2.71967 16.5303C2.57902 16.3897 2.5 16.1989 2.5 16V4C2.5 3.80109 2.57902 3.61032 2.71967 3.46967C2.86032 3.32902 3.05109 3.25 3.25 3.25H6.25V1.75H7.75V3.25H12.25V1.75H13.75V3.25ZM12.25 4.75H7.75V6.25H6.25V4.75H4V7.75H16V4.75H13.75V6.25H12.25V4.75ZM16 9.25H4V15.25H16V9.25Z" fill="#111111"/>
|
|
3
|
+
</svg>
|
|
@@ -16,11 +16,19 @@ const Template: StoryFn<typeof KDropdown> = (args) => <KDropdown {...args} />
|
|
|
16
16
|
|
|
17
17
|
export const KDropdownSingle = Template.bind({})
|
|
18
18
|
KDropdownSingle.args = {
|
|
19
|
-
onSelect: (value: KSelectOption | MultiValue<KSelectOption>) => {
|
|
19
|
+
onSelect: (value: KSelectOption | MultiValue<KSelectOption> | undefined) => {
|
|
20
|
+
if (value === undefined) {
|
|
21
|
+
console.log("our value is undefined, deleting process can be performed")
|
|
22
|
+
} else {
|
|
23
|
+
console.log("update process can be performed")
|
|
24
|
+
}
|
|
25
|
+
},
|
|
20
26
|
width: 250,
|
|
21
27
|
placeholder: "Select single...",
|
|
28
|
+
isClearable: true,
|
|
29
|
+
isEllipsis: true,
|
|
22
30
|
// defaultValue: { label: "Label 1", value: 1, icon: TracksIcon },
|
|
23
|
-
|
|
31
|
+
defaultValuePrimitive: 7,
|
|
24
32
|
options: [
|
|
25
33
|
{ label: "Label 1", value: 1, icon: TracksIcon },
|
|
26
34
|
{ label: "Label 4", value: 2, icon: TracksIcon },
|
|
@@ -29,13 +37,15 @@ KDropdownSingle.args = {
|
|
|
29
37
|
{ label: "R&B", value: 5 },
|
|
30
38
|
{ label: "Çınar", value: 6 },
|
|
31
39
|
{ label: "ELEKTRONIC ", value: 7 },
|
|
32
|
-
{ label: "TANIK", value: 8 }
|
|
40
|
+
{ label: "TANIK", value: 8 },
|
|
41
|
+
{ label: "Very very very very very long content.", value: 9 },
|
|
42
|
+
{ label: "TANIK", value: 10 }
|
|
33
43
|
]
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
export const KDropdownMulti = Template.bind({})
|
|
37
47
|
KDropdownMulti.args = {
|
|
38
|
-
onSelect: (value: KSelectOption | MultiValue<KSelectOption>) => {},
|
|
48
|
+
onSelect: (value: KSelectOption | MultiValue<KSelectOption> | undefined) => {},
|
|
39
49
|
width: 250,
|
|
40
50
|
placeholder: "Multi...",
|
|
41
51
|
options: [
|
|
@@ -48,14 +58,14 @@ KDropdownMulti.args = {
|
|
|
48
58
|
|
|
49
59
|
export const KDropdownLeftIcon = Template.bind({})
|
|
50
60
|
KDropdownLeftIcon.args = {
|
|
51
|
-
onSelect: (value: KSelectOption | MultiValue<KSelectOption>) => {},
|
|
61
|
+
onSelect: (value: KSelectOption | MultiValue<KSelectOption> | undefined) => {},
|
|
52
62
|
placeholder: "Placeholder...",
|
|
53
63
|
leftIcon: TracksIcon
|
|
54
64
|
}
|
|
55
65
|
|
|
56
66
|
export const KDropdownRightIcon = Template.bind({})
|
|
57
67
|
KDropdownRightIcon.args = {
|
|
58
|
-
onSelect: (value: KSelectOption | MultiValue<KSelectOption>) => {},
|
|
68
|
+
onSelect: (value: KSelectOption | MultiValue<KSelectOption> | undefined) => {},
|
|
59
69
|
placeholder: "Placeholder...",
|
|
60
70
|
rightIcon: TracksIcon,
|
|
61
71
|
width: 250,
|
|
@@ -73,7 +83,7 @@ KDropdownRightIcon.args = {
|
|
|
73
83
|
|
|
74
84
|
export const KDropdownLeftRightIcon = Template.bind({})
|
|
75
85
|
KDropdownLeftRightIcon.args = {
|
|
76
|
-
onSelect: (value: KSelectOption | MultiValue<KSelectOption>) => {},
|
|
86
|
+
onSelect: (value: KSelectOption | MultiValue<KSelectOption> | undefined) => {},
|
|
77
87
|
placeholder: "Placeholder...",
|
|
78
88
|
leftIcon: TracksIcon,
|
|
79
89
|
rightIcon: TracksIcon
|
|
@@ -19,7 +19,7 @@ export interface KDropdownProps {
|
|
|
19
19
|
defaultValue?: KSelectOption | MultiValue<KSelectOption>
|
|
20
20
|
defaultValuePrimitive?: string | number
|
|
21
21
|
selected?: KSelectOption | MultiValue<KSelectOption>
|
|
22
|
-
onSelect: (selected: KSelectOption | MultiValue<KSelectOption>) => void
|
|
22
|
+
onSelect: (selected: KSelectOption | MultiValue<KSelectOption> | undefined) => void
|
|
23
23
|
options: KSelectOption[]
|
|
24
24
|
width?: number
|
|
25
25
|
height?: number
|
|
@@ -38,6 +38,7 @@ export interface KDropdownProps {
|
|
|
38
38
|
gap?: string
|
|
39
39
|
hideChosenOptionIcon?: boolean
|
|
40
40
|
isClearable?: boolean
|
|
41
|
+
isEllipsis?: boolean
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
@@ -63,6 +64,7 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
63
64
|
const gap = props.gap || "4px"
|
|
64
65
|
const hideIcon = props.hideChosenOptionIcon || false
|
|
65
66
|
const isClearable = props.isClearable || false
|
|
67
|
+
const isEllipsis = props.isEllipsis || false
|
|
66
68
|
|
|
67
69
|
let defaultValue = props.defaultValue
|
|
68
70
|
if (!defaultValue && props.defaultValuePrimitive) {
|
|
@@ -170,9 +172,9 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
170
172
|
IndicatorSeparator: () => null,
|
|
171
173
|
DropdownIndicator: () => null,
|
|
172
174
|
SingleValue: ({ data, ...props }) => (
|
|
173
|
-
<div className=
|
|
175
|
+
<div className={`flex ${isEllipsis ? "w-full" : ""}`} style={{ position: "absolute" }}>
|
|
174
176
|
{data.icon && !hideIcon && <img src={data.icon} className="mr-2" width={20} alt={"data-icon"} />}
|
|
175
|
-
<KSpan text={data.label} color="#111" />
|
|
177
|
+
<KSpan text={data.label} color="#111" ellipsis={isEllipsis} />
|
|
176
178
|
</div>
|
|
177
179
|
)
|
|
178
180
|
}}
|
|
@@ -180,6 +182,7 @@ const KDropdown: React.FC<KDropdownProps> = (props) => {
|
|
|
180
182
|
if (!event) {
|
|
181
183
|
if (props.isClearable) {
|
|
182
184
|
setSelectedOption(undefined)
|
|
185
|
+
props.onSelect(undefined)
|
|
183
186
|
}
|
|
184
187
|
return
|
|
185
188
|
}
|
|
@@ -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 = {}
|