Skip to content

Commit

Permalink
(#0) npm publish (0.0.88)
Browse files Browse the repository at this point in the history
  • Loading branch information
baegofda committed Dec 7, 2023
1 parent 9b06680 commit 3a8057b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bbodek-ui",
"version": "0.0.87",
"version": "0.0.88",
"type": "module",
"author": "Bbodek",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meta } from "@storybook/react";

import { OverlayProvider, useOverlay } from "@toss/use-overlay";
import { PeriodDates } from "../../Calendar/DatePickerCalendar/types/CalendarComponentProps";
import ModalPopUp from "../../Modal/ModalPopUp";
import InputDatePicker from "./index";

Expand All @@ -16,11 +17,12 @@ export default meta;

const DefaultLayout = () => {
const overlay = useOverlay();
const getDate = (periodDates: PeriodDates) => console.log(periodDates);

return (
<div className = "flex gap-2">
<div className = "w-[500px]">
<InputDatePicker overlay = {overlay} useTab />
<InputDatePicker overlay = {overlay} useTab getPeriodDates = {getDate}/>
</div>
</div>
);
Expand All @@ -38,11 +40,13 @@ export const Default = () => {
const InputDatePickerInModalPopUpLayout = () => {
const overlay = useOverlay();
const inputDatePickerOverlay = useOverlay();
const getDate = (periodDates: PeriodDates) => console.log(periodDates);

const onOverlay = () => {
overlay.open(({ isOpen }) => {
return (
<ModalPopUp isOpen = {isOpen}>
<InputDatePicker overlay = {inputDatePickerOverlay} useTab = {false} />
<InputDatePicker overlay = {inputDatePickerOverlay} useTab = {false} getPeriodDates = {getDate}/>
</ModalPopUp>
);
});
Expand Down
2 changes: 2 additions & 0 deletions src/core/components/Input/InputDatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { InputDatePickerProps } from "./types";
const InputDatePicker = ({
overlay,
disabledDates,
getPeriodDates,
currentMonth,
useTab = false,
disabled = false,
Expand All @@ -30,6 +31,7 @@ const InputDatePicker = ({
currentMonth = {currentMonth}
close = {(periodDates: PeriodDates) => {
resolve(periodDates);
getPeriodDates(periodDates);
close();
}}
useTab = {useTab}
Expand Down
1 change: 1 addition & 0 deletions src/core/components/Input/InputDatePicker/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type CreateOverlayElement = (props: {
}) => JSX.Element;

export interface InputDatePickerProps extends Omit<DatePickerProps, "isOpen"| "close"> {
getPeriodDates: (periodDates: PeriodDates) => void;
overlay: {
open: (overlayElement: CreateOverlayElement) => void;
close: () => void;
Expand Down

0 comments on commit 3a8057b

Please sign in to comment.