import {
  Heading
} from "./chunk-HK224ADT.js";
import {
  IconButton
} from "./chunk-O3DNDMV3.js";
import {
  Flex
} from "./chunk-25HMMI7R.js";
import {
  ChevronLeftIcon,
  ChevronRightIcon
} from "./chunk-OAUNSXK7.js";
import {
  __objRest,
  __spreadProps,
  __spreadValues
} from "./chunk-N552FDTV.js";

// src/molecules/date-picker/index.tsx
import { forwardRef } from "react";
import * as RDP from "react-datepicker";
import { registerLocale, setDefaultLocale } from "react-datepicker";
import { ko as fnKo } from "date-fns/locale";
import { jsx, jsxs } from "react/jsx-runtime";
registerLocale("ko", fnKo);
setDefaultLocale("ko");
var ReactDatePicker = RDP.default.default || RDP.default || RDP;
var DatePicker = forwardRef(
  (props, ref) => {
    const _a = props, { fullWidth } = _a, rest = __objRest(_a, ["fullWidth"]);
    const fullWidthClassName = fullWidth ? "full-width" : "";
    return /* @__PURE__ */ jsx(Flex, { p: "0", width: "100%", children: /* @__PURE__ */ jsx(
      ReactDatePicker,
      __spreadProps(__spreadValues({
        dateFormat: "YYYY/MM/dd",
        nextMonthButtonLabel: "\uB2E4\uC74C \uB2EC",
        placeholderText: "YYYY/mm/dd",
        popperProps: { strategy: "fixed" },
        previousMonthButtonLabel: "\uC774\uC804 \uB2EC",
        ref,
        renderCustomHeader,
        showPopperArrow: false,
        timeIntervals: 10
      }, rest), {
        calendarClassName: `tipp_datePicker_calendar ${rest.calendarClassName || ""}`,
        timeCaption: "\uC2DC\uAC04",
        wrapperClassName: `tipp_datePicker ${fullWidthClassName} ${rest.wrapperClassName || ""}`
      })
    ) });
  }
);
DatePicker.displayName = "DatePicker";
var renderCustomHeader = (props) => {
  const {
    date,
    decreaseMonth,
    increaseMonth,
    prevMonthButtonDisabled,
    nextMonthButtonDisabled
  } = props;
  const year = date ? date.getFullYear() : "-";
  const month = date ? date.getMonth() + 1 : "-";
  return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", pb: "2", pl: "2", pr: "2", children: [
    /* @__PURE__ */ jsx(
      IconButton,
      {
        disabled: prevMonthButtonDisabled,
        onClick: decreaseMonth,
        type: "button",
        variant: "ghost",
        children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
      }
    ),
    /* @__PURE__ */ jsxs(Flex, { gap: "3", children: [
      /* @__PURE__ */ jsxs(Heading, { variant: "heading4", weight: "regular", children: [
        year,
        "\uB144"
      ] }),
      /* @__PURE__ */ jsxs(Heading, { variant: "heading4", weight: "regular", children: [
        month,
        "\uC6D4"
      ] })
    ] }),
    /* @__PURE__ */ jsx(
      IconButton,
      {
        disabled: nextMonthButtonDisabled,
        onClick: increaseMonth,
        type: "button",
        variant: "ghost",
        children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
      }
    )
  ] });
};

export {
  DatePicker
};
//# sourceMappingURL=chunk-7JJPPIIN.js.map