@explita/daily-toolset-components
Version:
A lightweight and versatile collection of TypeScript utility functions and form components, inspired by ShadCN UI, designed for seamless everyday development. Enhance your Node.js, React, and Next.js projects with a well-structured suite of helpers for st
44 lines (43 loc) • 2.12 kB
JavaScript
"use client";
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Calendar = Calendar;
const react_1 = __importDefault(require("react"));
const lu_1 = require("react-icons/lu");
const react_day_picker_1 = require("react-day-picker");
const button_1 = require("../ui/button");
function Calendar({ className, classNames, showOutsideDays = true, captionLabelRenderer, ...props }) {
return (react_1.default.createElement(react_day_picker_1.DayPicker, { showOutsideDays: showOutsideDays, classNames: {
months: "months",
month: "month",
caption: "caption",
caption_label: "caption-label",
nav: "nav",
nav_button: `${(0, button_1.buttonVariants)({ variant: "outline" })} nav-button`,
nav_button_previous: "nav-prev",
nav_button_next: "nav-next",
table: "calendar-table",
head_row: "head-row",
head_cell: "head-cell",
row: "row",
cell: `cell ${props.mode === "range" ? "range-cell" : "single"}`,
day: `${(0, button_1.buttonVariants)({ variant: "ghost" })} day`,
day_range_start: "day-range-start",
day_range_end: "day-range-end",
day_selected: "day-selected",
day_today: "day-today",
day_outside: "dayoutside day-outside",
day_disabled: "day-disabled",
day_range_middle: "day-range-middle",
day_hidden: "day-hidden",
...classNames,
}, components: {
IconLeft: ({ className, ...props }) => (react_1.default.createElement(lu_1.LuChevronLeft, { className: `icon-size ${className}`, ...props })),
IconRight: ({ className, ...props }) => (react_1.default.createElement(lu_1.LuChevronRight, { className: `icon-size ${className}`, ...props })),
CaptionLabel: captionLabelRenderer,
}, ...props }));
}
Calendar.displayName = "Calendar";