@rnwonder/react-date-picker
Version:
A lightweight, customizable, and accessible date picker component for React applications.
64 lines (63 loc) • 1.65 kB
JavaScript
"use client";
import { jsx as o, Fragment as f } from "react/jsx-runtime";
import { Y as n } from "./index-CpL40Car.js";
import { P as y } from "./index-D1g166JZ.js";
import { d as s, S as d } from "./index-C-0w3u6j.js";
import { R as u } from "./general-DZqASQRm-DXQPvh4C.js";
import { useState as a } from "react";
import { c as w } from "./class-DLUjLwnh.js";
const v = (e) => {
const [c, t] = a(!1), [m, r] = a(s), [l, i] = a(u);
return /* @__PURE__ */ o(f, { children: e.yearSelectorType === "compact-dropdown" ? /* @__PURE__ */ o(
n,
{
...e,
setSelectorTwoProps: r,
setShowSelectorTwo: t,
showSelectorTwo: c,
yearSelectorCount: e.yearSelectorCount || 20
}
) : /* @__PURE__ */ o(
y,
{
content: ({ close: S }) => /* @__PURE__ */ o(
"div",
{
className: w(`
rn-w-[17.5rem]
`),
children: /* @__PURE__ */ o(
d,
{
...m,
setShowSelectorTwo: t,
setSelectorTwoProps: r,
close: S,
year: e.year || l,
setOption: e.setYear || i,
option: e.year || l
}
)
}
),
width: "fit-content",
onClose: () => {
t(!1), r(s);
},
children: /* @__PURE__ */ o(
n,
{
...e,
setSelectorTwoProps: r,
setShowSelectorTwo: t,
showSelectorTwo: c,
yearSelectorType: "full-size",
yearSelectorCount: e.yearSelectorCount || 20
}
)
}
) });
};
export {
v as default
};