UNPKG

928 BJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.DayButton = DayButton;
7const react_1 = __importDefault(require("react"));
8/**
9 * Render the button for a day in the calendar.
10 *
11 * When not interactive, DayPicker will render a `DayContent` component instead
12 * of a `DayButton` component.
13 *
14 * @group Components
15 * @see https://daypicker.dev/guides/custom-components
16 */
17function DayButton(props) {
18 const { day, modifiers, ...buttonProps } = props;
19 const ref = react_1.default.useRef(null);
20 react_1.default.useEffect(() => {
21 if (modifiers.focused)
22 ref.current?.focus();
23 }, [modifiers.focused]);
24 return react_1.default.createElement("button", { ref: ref, ...buttonProps });
25}
26//# sourceMappingURL=DayButton.js.map
\No newline at end of file