Socket
Socket
Sign inDemoInstall

react-date-picker

Package Overview
Dependencies
26
Maintainers
1
Versions
259
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.3.0 to 10.4.0

dist/cjs/package.json

33

dist/cjs/DateInput.d.ts
/// <reference types="react" />
import PropTypes from 'prop-types';
import type { Detail, LooseValuePiece, Value } from './shared/types';
import type { Detail, LooseValuePiece, Value } from './shared/types.js';
type DateInputProps = {

@@ -29,29 +28,3 @@ autoFocus?: boolean;

};
declare function DateInput({ autoFocus, className, dayAriaLabel, dayPlaceholder, disabled, format, isCalendarOpen: isCalendarOpenProps, locale, maxDate, maxDetail, minDate, monthAriaLabel, monthPlaceholder, name, nativeInputAriaLabel, onChange: onChangeProps, onInvalidChange, required, returnValue, showLeadingZeros, value: valueProps, yearAriaLabel, yearPlaceholder, }: DateInputProps): JSX.Element;
declare namespace DateInput {
var propTypes: {
autoFocus: PropTypes.Requireable<boolean>;
className: PropTypes.Validator<string>;
dayAriaLabel: PropTypes.Requireable<string>;
dayPlaceholder: PropTypes.Requireable<string>;
disabled: PropTypes.Requireable<boolean>;
format: PropTypes.Requireable<string>;
isCalendarOpen: PropTypes.Requireable<boolean>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Validator<Date | null | undefined>;
maxDetail: PropTypes.Requireable<"month" | "year" | "century" | "decade">;
minDate: PropTypes.Validator<Date | null | undefined>;
monthAriaLabel: PropTypes.Requireable<string>;
monthPlaceholder: PropTypes.Requireable<string>;
name: PropTypes.Requireable<string>;
nativeInputAriaLabel: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
required: PropTypes.Requireable<boolean>;
returnValue: PropTypes.Requireable<string>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<NonNullable<string | Date | null | undefined>>;
yearAriaLabel: PropTypes.Requireable<string>;
yearPlaceholder: PropTypes.Requireable<string>;
};
}
export default DateInput;
export default function DateInput({ autoFocus, className, dayAriaLabel, dayPlaceholder, disabled, format, isCalendarOpen: isCalendarOpenProps, locale, maxDate, maxDetail, minDate, monthAriaLabel, monthPlaceholder, name, nativeInputAriaLabel, onChange: onChangeProps, onInvalidChange, required, returnValue, showLeadingZeros, value: valueProps, yearAriaLabel, yearPlaceholder, }: DateInputProps): JSX.Element;
export {};

@@ -51,14 +51,12 @@ "use strict";

var react_1 = __importStar(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var date_utils_1 = require("@wojtekmaj/date-utils");
var Divider_1 = __importDefault(require("./Divider"));
var DayInput_1 = __importDefault(require("./DateInput/DayInput"));
var MonthInput_1 = __importDefault(require("./DateInput/MonthInput"));
var MonthSelect_1 = __importDefault(require("./DateInput/MonthSelect"));
var YearInput_1 = __importDefault(require("./DateInput/YearInput"));
var NativeInput_1 = __importDefault(require("./DateInput/NativeInput"));
var dateFormatter_1 = require("./shared/dateFormatter");
var dates_1 = require("./shared/dates");
var propTypes_1 = require("./shared/propTypes");
var utils_1 = require("./shared/utils");
var Divider_js_1 = __importDefault(require("./Divider.js"));
var DayInput_js_1 = __importDefault(require("./DateInput/DayInput.js"));
var MonthInput_js_1 = __importDefault(require("./DateInput/MonthInput.js"));
var MonthSelect_js_1 = __importDefault(require("./DateInput/MonthSelect.js"));
var YearInput_js_1 = __importDefault(require("./DateInput/YearInput.js"));
var NativeInput_js_1 = __importDefault(require("./DateInput/NativeInput.js"));
var dateFormatter_js_1 = require("./shared/dateFormatter.js");
var dates_js_1 = require("./shared/dates.js");
var utils_js_1 = require("./shared/utils.js");
var getFormatterOptionsCache = {};

@@ -105,5 +103,5 @@ var defaultMinDate = new Date();

case 0:
return (0, dates_1.getBegin)(valueType, valuePiece);
return (0, dates_js_1.getBegin)(valueType, valuePiece);
case 1:
return (0, dates_1.getEnd)(valueType, valuePiece);
return (0, dates_js_1.getEnd)(valueType, valuePiece);
default:

@@ -113,3 +111,3 @@ throw new Error("Invalid index value: ".concat(index));

})();
return (0, utils_1.between)(detailValueFrom, minDate, maxDate);
return (0, utils_js_1.between)(detailValueFrom, minDate, maxDate);
}

@@ -145,3 +143,3 @@ var getDetailValueFrom = function (args) { return getDetailValue(args, 0); };

// eslint-disable-next-line react/no-array-index-key
react_1.default.createElement(Divider_1.default, { key: "separator_".concat(index) }, element));
react_1.default.createElement(Divider_js_1.default, { key: "separator_".concat(index) }, element));
var res = __spreadArray(__spreadArray([], arr, true), [divider], false);

@@ -225,3 +223,3 @@ var currentMatch = matches && matches[index];

})();
return (0, dateFormatter_1.getFormatter)(formatterOptions);
return (0, dateFormatter_js_1.getFormatter)(formatterOptions);
})();

@@ -268,3 +266,3 @@ /**

})();
return (0, dateFormatter_1.getFormatter)(formatterOptions)(locale, dateToFormat).match(/\d{1,}/);
return (0, dateFormatter_js_1.getFormatter)(formatterOptions)(locale, dateToFormat).match(/\d{1,}/);
}

@@ -442,3 +440,3 @@ var placeholder = formattedDate;

var showLeadingZerosFromFormat = currentMatch && currentMatch.length === 2;
return (react_1.default.createElement(DayInput_1.default, __assign({ key: "day" }, commonInputProps, { ariaLabel: dayAriaLabel,
return (react_1.default.createElement(DayInput_js_1.default, __assign({ key: "day" }, commonInputProps, { ariaLabel: dayAriaLabel,
// eslint-disable-next-line jsx-a11y/no-autofocus

@@ -452,3 +450,3 @@ autoFocus: index === 0 && autoFocus, inputRef: dayInput, month: month, placeholder: dayPlaceholder, showLeadingZeros: showLeadingZerosFromFormat || showLeadingZeros, value: day, year: year })));

if (currentMatch.length > 2) {
return (react_1.default.createElement(MonthSelect_1.default, __assign({ key: "month" }, commonInputProps, { ariaLabel: monthAriaLabel,
return (react_1.default.createElement(MonthSelect_js_1.default, __assign({ key: "month" }, commonInputProps, { ariaLabel: monthAriaLabel,
// eslint-disable-next-line jsx-a11y/no-autofocus

@@ -458,3 +456,3 @@ autoFocus: index === 0 && autoFocus, inputRef: monthSelect, locale: locale, placeholder: monthPlaceholder, short: currentMatch.length === 3, value: month, year: year })));

var showLeadingZerosFromFormat = currentMatch && currentMatch.length === 2;
return (react_1.default.createElement(MonthInput_1.default, __assign({ key: "month" }, commonInputProps, { ariaLabel: monthAriaLabel,
return (react_1.default.createElement(MonthInput_js_1.default, __assign({ key: "month" }, commonInputProps, { ariaLabel: monthAriaLabel,
// eslint-disable-next-line jsx-a11y/no-autofocus

@@ -464,3 +462,3 @@ autoFocus: index === 0 && autoFocus, inputRef: monthInput, placeholder: monthPlaceholder, showLeadingZeros: showLeadingZerosFromFormat || showLeadingZeros, value: month, year: year })));

function renderYear(currentMatch, index) {
return (react_1.default.createElement(YearInput_1.default, __assign({ key: "year" }, commonInputProps, { ariaLabel: yearAriaLabel,
return (react_1.default.createElement(YearInput_js_1.default, __assign({ key: "year" }, commonInputProps, { ariaLabel: yearAriaLabel,
// eslint-disable-next-line jsx-a11y/no-autofocus

@@ -479,3 +477,3 @@ autoFocus: index === 0 && autoFocus, inputRef: yearInput, placeholder: yearPlaceholder, value: year, valueType: valueType })));

function renderNativeInput() {
return (react_1.default.createElement(NativeInput_1.default, { key: "date", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxDate: maxDate || defaultMaxDate, minDate: minDate || defaultMinDate, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
return (react_1.default.createElement(NativeInput_js_1.default, { key: "date", ariaLabel: nativeInputAriaLabel, disabled: disabled, maxDate: maxDate || defaultMaxDate, minDate: minDate || defaultMinDate, name: name, onChange: onChangeNative, required: required, value: value, valueType: valueType }));
}

@@ -489,26 +487,1 @@ return (

exports.default = DateInput;
var isValue = prop_types_1.default.oneOfType([prop_types_1.default.string, prop_types_1.default.instanceOf(Date)]);
DateInput.propTypes = {
autoFocus: prop_types_1.default.bool,
className: prop_types_1.default.string.isRequired,
dayAriaLabel: prop_types_1.default.string,
dayPlaceholder: prop_types_1.default.string,
disabled: prop_types_1.default.bool,
format: prop_types_1.default.string,
isCalendarOpen: prop_types_1.default.bool,
locale: prop_types_1.default.string,
maxDate: propTypes_1.isMaxDate,
maxDetail: prop_types_1.default.oneOf(allViews),
minDate: propTypes_1.isMinDate,
monthAriaLabel: prop_types_1.default.string,
monthPlaceholder: prop_types_1.default.string,
name: prop_types_1.default.string,
nativeInputAriaLabel: prop_types_1.default.string,
onChange: prop_types_1.default.func,
required: prop_types_1.default.bool,
returnValue: prop_types_1.default.oneOf(['start', 'end', 'range']),
showLeadingZeros: prop_types_1.default.bool,
value: isValue,
yearAriaLabel: prop_types_1.default.string,
yearPlaceholder: prop_types_1.default.string,
};
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
import Input from './Input.js';
type DayInputProps = {

@@ -10,24 +9,3 @@ maxDate?: Date;

} & Omit<React.ComponentProps<typeof Input>, 'max' | 'min' | 'name'>;
declare function DayInput({ maxDate, minDate, month, year, ...otherProps }: DayInputProps): JSX.Element;
declare namespace DayInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
month: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
year: PropTypes.Requireable<string>;
};
}
export default DayInput;
export default function DayInput({ maxDate, minDate, month, year, ...otherProps }: DayInputProps): JSX.Element;
export {};

@@ -29,7 +29,5 @@ "use strict";

var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var date_utils_1 = require("@wojtekmaj/date-utils");
var Input_1 = __importDefault(require("./Input"));
var propTypes_1 = require("../shared/propTypes");
var utils_1 = require("../shared/utils");
var Input_js_1 = __importDefault(require("./Input.js"));
var utils_js_1 = require("../shared/utils.js");
function DayInput(_a) {

@@ -46,23 +44,6 @@ var maxDate = _a.maxDate, minDate = _a.minDate, month = _a.month, year = _a.year, otherProps = __rest(_a, ["maxDate", "minDate", "month", "year"]);

}
var maxDay = (0, utils_1.safeMin)(currentMonthMaxDays, maxDate && isSameMonth(maxDate) && (0, date_utils_1.getDate)(maxDate));
var minDay = (0, utils_1.safeMax)(1, minDate && isSameMonth(minDate) && (0, date_utils_1.getDate)(minDate));
return react_1.default.createElement(Input_1.default, __assign({ max: maxDay, min: minDay, name: "day" }, otherProps));
var maxDay = (0, utils_js_1.safeMin)(currentMonthMaxDays, maxDate && isSameMonth(maxDate) && (0, date_utils_1.getDate)(maxDate));
var minDay = (0, utils_js_1.safeMax)(1, minDate && isSameMonth(minDate) && (0, date_utils_1.getDate)(minDate));
return react_1.default.createElement(Input_js_1.default, __assign({ max: maxDay, min: minDay, name: "day" }, otherProps));
}
exports.default = DayInput;
DayInput.propTypes = {
ariaLabel: prop_types_1.default.string,
className: prop_types_1.default.string.isRequired,
disabled: prop_types_1.default.bool,
inputRef: propTypes_1.isRef,
maxDate: propTypes_1.isMaxDate,
minDate: propTypes_1.isMinDate,
month: prop_types_1.default.string,
onChange: prop_types_1.default.func,
onKeyDown: prop_types_1.default.func,
onKeyUp: prop_types_1.default.func,
placeholder: prop_types_1.default.string,
required: prop_types_1.default.bool,
showLeadingZeros: prop_types_1.default.bool,
value: prop_types_1.default.string,
year: prop_types_1.default.string,
};
import React from 'react';
import PropTypes from 'prop-types';
type InputProps = {

@@ -28,26 +27,3 @@ ariaLabel?: string;

};
declare function Input({ ariaLabel, autoFocus, className, disabled, inputRef, max, min, name, nameForClass, onChange, onKeyDown, onKeyUp, placeholder, required, showLeadingZeros, step, value, }: InputProps): JSX.Element;
declare namespace Input {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
autoFocus: PropTypes.Requireable<boolean>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
max: PropTypes.Requireable<number>;
min: PropTypes.Requireable<number>;
name: PropTypes.Requireable<string>;
nameForClass: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
showLeadingZeros: PropTypes.Requireable<boolean>;
step: PropTypes.Requireable<number>;
value: PropTypes.Requireable<string>;
};
}
export default Input;
export default function Input({ ariaLabel, autoFocus, className, disabled, inputRef, max, min, name, nameForClass, onChange, onKeyDown, onKeyUp, placeholder, required, showLeadingZeros, step, value, }: InputProps): JSX.Element;
export {};

@@ -30,6 +30,4 @@ "use strict";

var react_1 = __importStar(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var clsx_1 = __importDefault(require("clsx"));
var update_input_width_1 = __importStar(require("update-input-width"));
var propTypes_1 = require("../shared/propTypes");
var isBrowser = typeof document !== 'undefined';

@@ -139,20 +137,1 @@ var useIsomorphicLayoutEffect = isBrowser ? react_1.useLayoutEffect : react_1.useEffect;

exports.default = Input;
Input.propTypes = {
ariaLabel: prop_types_1.default.string,
autoFocus: prop_types_1.default.bool,
className: prop_types_1.default.string.isRequired,
disabled: prop_types_1.default.bool,
inputRef: propTypes_1.isRef,
max: prop_types_1.default.number,
min: prop_types_1.default.number,
name: prop_types_1.default.string,
nameForClass: prop_types_1.default.string,
onChange: prop_types_1.default.func,
onKeyDown: prop_types_1.default.func,
onKeyUp: prop_types_1.default.func,
placeholder: prop_types_1.default.string,
required: prop_types_1.default.bool,
showLeadingZeros: prop_types_1.default.bool,
step: prop_types_1.default.number,
value: prop_types_1.default.string,
};
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
import Input from './Input.js';
type MonthInputProps = {

@@ -9,23 +8,3 @@ maxDate?: Date;

} & Omit<React.ComponentProps<typeof Input>, 'max' | 'min' | 'name'>;
declare function MonthInput({ maxDate, minDate, year, ...otherProps }: MonthInputProps): JSX.Element;
declare namespace MonthInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
year: PropTypes.Requireable<string>;
};
}
export default MonthInput;
export default function MonthInput({ maxDate, minDate, year, ...otherProps }: MonthInputProps): JSX.Element;
export {};

@@ -29,7 +29,5 @@ "use strict";

var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var date_utils_1 = require("@wojtekmaj/date-utils");
var Input_1 = __importDefault(require("./Input"));
var propTypes_1 = require("../shared/propTypes");
var utils_1 = require("../shared/utils");
var Input_js_1 = __importDefault(require("./Input.js"));
var utils_js_1 = require("../shared/utils.js");
function MonthInput(_a) {

@@ -40,22 +38,6 @@ var maxDate = _a.maxDate, minDate = _a.minDate, year = _a.year, otherProps = __rest(_a, ["maxDate", "minDate", "year"]);

}
var maxMonth = (0, utils_1.safeMin)(12, maxDate && isSameYear(maxDate) && (0, date_utils_1.getMonthHuman)(maxDate));
var minMonth = (0, utils_1.safeMax)(1, minDate && isSameYear(minDate) && (0, date_utils_1.getMonthHuman)(minDate));
return react_1.default.createElement(Input_1.default, __assign({ max: maxMonth, min: minMonth, name: "month" }, otherProps));
var maxMonth = (0, utils_js_1.safeMin)(12, maxDate && isSameYear(maxDate) && (0, date_utils_1.getMonthHuman)(maxDate));
var minMonth = (0, utils_js_1.safeMax)(1, minDate && isSameYear(minDate) && (0, date_utils_1.getMonthHuman)(minDate));
return react_1.default.createElement(Input_js_1.default, __assign({ max: maxMonth, min: minMonth, name: "month" }, otherProps));
}
exports.default = MonthInput;
MonthInput.propTypes = {
ariaLabel: prop_types_1.default.string,
className: prop_types_1.default.string.isRequired,
disabled: prop_types_1.default.bool,
inputRef: propTypes_1.isRef,
maxDate: propTypes_1.isMaxDate,
minDate: propTypes_1.isMinDate,
onChange: prop_types_1.default.func,
onKeyDown: prop_types_1.default.func,
onKeyUp: prop_types_1.default.func,
placeholder: prop_types_1.default.string,
required: prop_types_1.default.bool,
showLeadingZeros: prop_types_1.default.bool,
value: prop_types_1.default.string,
year: prop_types_1.default.string,
};
import React from 'react';
import PropTypes from 'prop-types';
type MonthSelectProps = {

@@ -24,24 +23,3 @@ ariaLabel?: string;

};
declare function MonthSelect({ ariaLabel, autoFocus, className, disabled, inputRef, locale, maxDate, minDate, onChange, onKeyDown, placeholder, required, short, value, year, }: MonthSelectProps): JSX.Element;
declare namespace MonthSelect {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
autoFocus: PropTypes.Requireable<boolean>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
short: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
year: PropTypes.Requireable<string>;
};
}
export default MonthSelect;
export default function MonthSelect({ ariaLabel, autoFocus, className, disabled, inputRef, locale, maxDate, minDate, onChange, onKeyDown, placeholder, required, short, value, year, }: MonthSelectProps): JSX.Element;
export {};

@@ -16,8 +16,6 @@ "use strict";

var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var clsx_1 = __importDefault(require("clsx"));
var date_utils_1 = require("@wojtekmaj/date-utils");
var dateFormatter_1 = require("../shared/dateFormatter");
var propTypes_1 = require("../shared/propTypes");
var utils_1 = require("../shared/utils");
var dateFormatter_js_1 = require("../shared/dateFormatter.js");
var utils_js_1 = require("../shared/utils.js");
function MonthSelect(_a) {

@@ -28,7 +26,7 @@ var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, locale = _a.locale, maxDate = _a.maxDate, minDate = _a.minDate, onChange = _a.onChange, onKeyDown = _a.onKeyDown, _b = _a.placeholder, placeholder = _b === void 0 ? '--' : _b, required = _a.required, short = _a.short, value = _a.value, year = _a.year;

}
var maxMonth = (0, utils_1.safeMin)(12, maxDate && isSameYear(maxDate) && (0, date_utils_1.getMonthHuman)(maxDate));
var minMonth = (0, utils_1.safeMax)(1, minDate && isSameYear(minDate) && (0, date_utils_1.getMonthHuman)(minDate));
var maxMonth = (0, utils_js_1.safeMin)(12, maxDate && isSameYear(maxDate) && (0, date_utils_1.getMonthHuman)(maxDate));
var minMonth = (0, utils_js_1.safeMax)(1, minDate && isSameYear(minDate) && (0, date_utils_1.getMonthHuman)(minDate));
var dates = __spreadArray([], Array(12), true).map(function (el, index) { return new Date(2019, index, 1); });
var name = 'month';
var formatter = short ? dateFormatter_1.formatShortMonth : dateFormatter_1.formatMonth;
var formatter = short ? dateFormatter_js_1.formatShortMonth : dateFormatter_js_1.formatMonth;
return (react_1.default.createElement("select", { "aria-label": ariaLabel, autoFocus: autoFocus, className: (0, clsx_1.default)("".concat(className, "__input"), "".concat(className, "__").concat(name)), "data-input": "true", "data-select": "true", disabled: disabled, name: name, onChange: onChange, onKeyDown: onKeyDown, ref: inputRef, required: required, value: value !== null ? value : '' },

@@ -43,18 +41,1 @@ !value && react_1.default.createElement("option", { value: "" }, placeholder),

exports.default = MonthSelect;
MonthSelect.propTypes = {
ariaLabel: prop_types_1.default.string,
autoFocus: prop_types_1.default.bool,
className: prop_types_1.default.string.isRequired,
disabled: prop_types_1.default.bool,
inputRef: propTypes_1.isRef,
locale: prop_types_1.default.string,
maxDate: propTypes_1.isMaxDate,
minDate: propTypes_1.isMinDate,
onChange: prop_types_1.default.func,
onKeyDown: prop_types_1.default.func,
placeholder: prop_types_1.default.string,
required: prop_types_1.default.bool,
short: prop_types_1.default.bool,
value: prop_types_1.default.string,
year: prop_types_1.default.string,
};
import React from 'react';
import PropTypes from 'prop-types';
type NativeInputProps = {

@@ -14,16 +13,3 @@ ariaLabel?: string;

};
declare function NativeInput({ ariaLabel, disabled, maxDate, minDate, name, onChange, required, value, valueType, }: NativeInputProps): JSX.Element;
declare namespace NativeInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
disabled: PropTypes.Requireable<boolean>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
name: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
required: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<Date>;
valueType: PropTypes.Requireable<string>;
};
}
export default NativeInput;
export default function NativeInput({ ariaLabel, disabled, maxDate, minDate, name, onChange, required, value, valueType, }: NativeInputProps): JSX.Element;
export {};

@@ -7,5 +7,3 @@ "use strict";

var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var date_utils_1 = require("@wojtekmaj/date-utils");
var propTypes_1 = require("../shared/propTypes");
function NativeInput(_a) {

@@ -49,12 +47,1 @@ var ariaLabel = _a.ariaLabel, disabled = _a.disabled, maxDate = _a.maxDate, minDate = _a.minDate, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, valueType = _a.valueType;

exports.default = NativeInput;
NativeInput.propTypes = {
ariaLabel: prop_types_1.default.string,
disabled: prop_types_1.default.bool,
maxDate: propTypes_1.isMaxDate,
minDate: propTypes_1.isMinDate,
name: prop_types_1.default.string,
onChange: prop_types_1.default.func,
required: prop_types_1.default.bool,
value: prop_types_1.default.instanceOf(Date),
valueType: propTypes_1.isValueType,
};
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
import Input from './Input.js';
type YearInputProps = {

@@ -10,22 +9,3 @@ maxDate?: Date;

} & Omit<React.ComponentProps<typeof Input>, 'max' | 'min' | 'name'>;
declare function YearInput({ maxDate, minDate, placeholder, valueType, ...otherProps }: YearInputProps): JSX.Element;
declare namespace YearInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
valueType: PropTypes.Requireable<string>;
};
}
export default YearInput;
export default function YearInput({ maxDate, minDate, placeholder, valueType, ...otherProps }: YearInputProps): JSX.Element;
export {};

@@ -29,11 +29,9 @@ "use strict";

var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
var date_utils_1 = require("@wojtekmaj/date-utils");
var Input_1 = __importDefault(require("./Input"));
var propTypes_1 = require("../shared/propTypes");
var utils_1 = require("../shared/utils");
var Input_js_1 = __importDefault(require("./Input.js"));
var utils_js_1 = require("../shared/utils.js");
function YearInput(_a) {
var maxDate = _a.maxDate, minDate = _a.minDate, _b = _a.placeholder, placeholder = _b === void 0 ? '----' : _b, valueType = _a.valueType, otherProps = __rest(_a, ["maxDate", "minDate", "placeholder", "valueType"]);
var maxYear = (0, utils_1.safeMin)(275760, maxDate && (0, date_utils_1.getYear)(maxDate));
var minYear = (0, utils_1.safeMax)(1, minDate && (0, date_utils_1.getYear)(minDate));
var maxYear = (0, utils_js_1.safeMin)(275760, maxDate && (0, date_utils_1.getYear)(maxDate));
var minYear = (0, utils_js_1.safeMax)(1, minDate && (0, date_utils_1.getYear)(minDate));
var yearStep = (function () {

@@ -45,19 +43,4 @@ if (valueType === 'century') {

})();
return (react_1.default.createElement(Input_1.default, __assign({ max: maxYear, min: minYear, name: "year", placeholder: placeholder, step: yearStep }, otherProps)));
return (react_1.default.createElement(Input_js_1.default, __assign({ max: maxYear, min: minYear, name: "year", placeholder: placeholder, step: yearStep }, otherProps)));
}
exports.default = YearInput;
YearInput.propTypes = {
ariaLabel: prop_types_1.default.string,
className: prop_types_1.default.string.isRequired,
disabled: prop_types_1.default.bool,
inputRef: propTypes_1.isRef,
maxDate: propTypes_1.isMaxDate,
minDate: propTypes_1.isMinDate,
onChange: prop_types_1.default.func,
onKeyDown: prop_types_1.default.func,
onKeyUp: prop_types_1.default.func,
placeholder: prop_types_1.default.string,
required: prop_types_1.default.bool,
value: prop_types_1.default.string,
valueType: propTypes_1.isValueType,
};
import React from 'react';
import PropTypes from 'prop-types';
import makeEventProps from 'make-event-props';
import Calendar from 'react-calendar';
import type { ClassName, CloseReason, Detail, LooseValue, OpenReason, Value } from './shared/types';
type Icon = React.ReactElement | string;
import type { ReactNodeArray } from 'prop-types';
import type { ClassName, CloseReason, Detail, LooseValue, OpenReason, Value } from './shared/types.js';
type Icon = React.ReactElement | ReactNodeArray | null | string | number | boolean;
type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement;

@@ -55,43 +55,3 @@ type CalendarProps = Omit<React.ComponentPropsWithoutRef<typeof Calendar>, 'className' | 'maxDetail' | 'onChange'>;

} & CalendarProps & Omit<EventProps, 'onChange' | 'onFocus'>;
declare function DatePicker(props: DatePickerProps): JSX.Element;
declare namespace DatePicker {
var propTypes: {
autoFocus: PropTypes.Requireable<boolean>;
calendarAriaLabel: PropTypes.Requireable<string>;
calendarClassName: PropTypes.Requireable<NonNullable<string | (string | null | undefined)[] | null | undefined>>;
calendarIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
className: PropTypes.Requireable<NonNullable<string | (string | null | undefined)[] | null | undefined>>;
clearAriaLabel: PropTypes.Requireable<string>;
clearIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
closeCalendar: PropTypes.Requireable<boolean>;
'data-testid': PropTypes.Requireable<string>;
dayAriaLabel: PropTypes.Requireable<string>;
dayPlaceholder: PropTypes.Requireable<string>;
disableCalendar: PropTypes.Requireable<boolean>;
disabled: PropTypes.Requireable<boolean>;
format: PropTypes.Requireable<string>;
id: PropTypes.Requireable<string>;
isOpen: PropTypes.Requireable<boolean>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Validator<Date | null | undefined>;
maxDetail: PropTypes.Requireable<"month" | "year" | "century" | "decade">;
minDate: PropTypes.Validator<Date | null | undefined>;
monthAriaLabel: PropTypes.Requireable<string>;
monthPlaceholder: PropTypes.Requireable<string>;
name: PropTypes.Requireable<string>;
nativeInputAriaLabel: PropTypes.Requireable<string>;
onCalendarClose: PropTypes.Requireable<(...args: any[]) => any>;
onCalendarOpen: PropTypes.Requireable<(...args: any[]) => any>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
openCalendarOnFocus: PropTypes.Requireable<boolean>;
portalContainer: PropTypes.Requireable<object>;
required: PropTypes.Requireable<boolean>;
returnValue: PropTypes.Requireable<string>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<NonNullable<NonNullable<string | Date | null | undefined> | import("./shared/types").Range<NonNullable<string | Date | null | undefined>> | null | undefined>>;
yearAriaLabel: PropTypes.Requireable<string>;
yearPlaceholder: PropTypes.Requireable<string>;
};
}
declare const DatePicker: React.FC<DatePickerProps>;
export default DatePicker;

@@ -59,4 +59,4 @@ "use strict";

var react_fit_1 = __importDefault(require("react-fit"));
var DateInput_1 = __importDefault(require("./DateInput"));
var propTypes_1 = require("./shared/propTypes");
var DateInput_js_1 = __importDefault(require("./DateInput.js"));
var propTypes_js_1 = require("./shared/propTypes.js");
var baseClassName = 'react-date-picker';

@@ -80,3 +80,3 @@ var outsideActionEvents = ['mousedown', 'focusin', 'touchstart'];

react_1.default.createElement("line", { x1: "15", x2: "4", y1: "4", y2: "15" })));
function DatePicker(props) {
var DatePicker = function DatePicker(props) {
var autoFocus = props.autoFocus, calendarAriaLabel = props.calendarAriaLabel, _a = props.calendarIcon, calendarIcon = _a === void 0 ? CalendarIcon : _a, className = props.className, clearAriaLabel = props.clearAriaLabel, _b = props.clearIcon, clearIcon = _b === void 0 ? ClearIcon : _b, _c = props.closeCalendar, shouldCloseCalendarOnSelect = _c === void 0 ? true : _c, dataTestid = props["data-testid"], dayAriaLabel = props.dayAriaLabel, dayPlaceholder = props.dayPlaceholder, disableCalendar = props.disableCalendar, disabled = props.disabled, format = props.format, id = props.id, _d = props.isOpen, isOpenProps = _d === void 0 ? null : _d, locale = props.locale, maxDate = props.maxDate, _e = props.maxDetail, maxDetail = _e === void 0 ? 'month' : _e, minDate = props.minDate, monthAriaLabel = props.monthAriaLabel, monthPlaceholder = props.monthPlaceholder, _f = props.name, name = _f === void 0 ? 'date' : _f, nativeInputAriaLabel = props.nativeInputAriaLabel, onCalendarClose = props.onCalendarClose, onCalendarOpen = props.onCalendarOpen, onChangeProps = props.onChange, onFocusProps = props.onFocus, onInvalidChange = props.onInvalidChange, _g = props.openCalendarOnFocus, openCalendarOnFocus = _g === void 0 ? true : _g, required = props.required, _h = props.returnValue, returnValue = _h === void 0 ? 'start' : _h, shouldCloseCalendar = props.shouldCloseCalendar, shouldOpenCalendar = props.shouldOpenCalendar, showLeadingZeros = props.showLeadingZeros, value = props.value, yearAriaLabel = props.yearAriaLabel, yearPlaceholder = props.yearPlaceholder, otherProps = __rest(props, ["autoFocus", "calendarAriaLabel", "calendarIcon", "className", "clearAriaLabel", "clearIcon", "closeCalendar", 'data-testid', "dayAriaLabel", "dayPlaceholder", "disableCalendar", "disabled", "format", "id", "isOpen", "locale", "maxDate", "maxDetail", "minDate", "monthAriaLabel", "monthPlaceholder", "name", "nativeInputAriaLabel", "onCalendarClose", "onCalendarOpen", "onChange", "onFocus", "onInvalidChange", "openCalendarOnFocus", "required", "returnValue", "shouldCloseCalendar", "shouldOpenCalendar", "showLeadingZeros", "value", "yearAriaLabel", "yearPlaceholder"]);

@@ -204,3 +204,3 @@ var _j = (0, react_1.useState)(isOpenProps), isOpen = _j[0], setIsOpen = _j[1];

return (react_1.default.createElement("div", { className: "".concat(baseClassName, "__wrapper") },
react_1.default.createElement(DateInput_1.default, __assign({}, ariaLabelProps, placeholderProps, {
react_1.default.createElement(DateInput_js_1.default, __assign({}, ariaLabelProps, placeholderProps, {
// eslint-disable-next-line jsx-a11y/no-autofocus

@@ -232,6 +232,5 @@ autoFocus: autoFocus, className: "".concat(baseClassName, "__inputGroup"), disabled: disabled, format: format, isCalendarOpen: isOpen, locale: locale, maxDate: maxDate, maxDetail: maxDetail, minDate: minDate, name: name, onChange: onChange, onInvalidChange: onInvalidChange, required: required, returnValue: returnValue, showLeadingZeros: showLeadingZeros, value: valueFrom })),

renderCalendar()));
}
exports.default = DatePicker;
};
var isValue = prop_types_1.default.oneOfType([prop_types_1.default.string, prop_types_1.default.instanceOf(Date)]);
var isValueOrValueArray = prop_types_1.default.oneOfType([isValue, (0, propTypes_1.rangeOf)(isValue)]);
var isValueOrValueArray = prop_types_1.default.oneOfType([isValue, (0, propTypes_js_1.rangeOf)(isValue)]);
DatePicker.propTypes = {

@@ -255,5 +254,5 @@ autoFocus: prop_types_1.default.bool,

locale: prop_types_1.default.string,
maxDate: propTypes_1.isMaxDate,
maxDate: propTypes_js_1.isMaxDate,
maxDetail: prop_types_1.default.oneOf(allViews),
minDate: propTypes_1.isMinDate,
minDate: propTypes_js_1.isMinDate,
monthAriaLabel: prop_types_1.default.string,

@@ -268,3 +267,3 @@ monthPlaceholder: prop_types_1.default.string,

openCalendarOnFocus: prop_types_1.default.bool,
portalContainer: prop_types_1.default.object,
portalContainer: prop_types_1.default.instanceOf(HTMLElement),
required: prop_types_1.default.bool,

@@ -277,1 +276,2 @@ returnValue: prop_types_1.default.oneOf(['start', 'end', 'range']),

};
exports.default = DatePicker;
import React from 'react';
import PropTypes from 'prop-types';
type DividerProps = {
children: React.ReactNode;
children?: React.ReactNode;
};
declare function Divider({ children }: DividerProps): JSX.Element;
declare namespace Divider {
var propTypes: {
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
};
}
export default Divider;
export default function Divider({ children }: DividerProps): JSX.Element;
export {};

@@ -7,3 +7,2 @@ "use strict";

var react_1 = __importDefault(require("react"));
var prop_types_1 = __importDefault(require("prop-types"));
function Divider(_a) {

@@ -14,4 +13,1 @@ var children = _a.children;

exports.default = Divider;
Divider.propTypes = {
children: prop_types_1.default.node,
};

@@ -1,4 +0,4 @@

import DatePicker from './DatePicker';
export type { DatePickerProps } from './DatePicker';
import DatePicker from './DatePicker.js';
export type { DatePickerProps } from './DatePicker.js';
export { DatePicker };
export default DatePicker;

@@ -7,4 +7,4 @@ "use strict";

exports.DatePicker = void 0;
var DatePicker_1 = __importDefault(require("./DatePicker"));
exports.DatePicker = DatePicker_1.default;
exports.default = DatePicker_1.default;
var DatePicker_js_1 = __importDefault(require("./DatePicker.js"));
exports.DatePicker = DatePicker_js_1.default;
exports.default = DatePicker_js_1.default;

@@ -1,2 +0,2 @@

import type { RangeType } from './types';
import type { RangeType } from './types.js';
/**

@@ -3,0 +3,0 @@ * Returns the beginning of a given range.

import PropTypes from 'prop-types';
import type { Requireable, Validator } from 'prop-types';
import type { Range } from './types';
import type { Range } from './types.js';
export declare const isValueType: PropTypes.Requireable<string>;

@@ -5,0 +5,0 @@ export declare const isMinDate: Validator<Date | null | undefined>;

/// <reference types="react" />
import PropTypes from 'prop-types';
import type { Detail, LooseValuePiece, Value } from './shared/types';
import type { Detail, LooseValuePiece, Value } from './shared/types.js';
type DateInputProps = {

@@ -29,29 +28,3 @@ autoFocus?: boolean;

};
declare function DateInput({ autoFocus, className, dayAriaLabel, dayPlaceholder, disabled, format, isCalendarOpen: isCalendarOpenProps, locale, maxDate, maxDetail, minDate, monthAriaLabel, monthPlaceholder, name, nativeInputAriaLabel, onChange: onChangeProps, onInvalidChange, required, returnValue, showLeadingZeros, value: valueProps, yearAriaLabel, yearPlaceholder, }: DateInputProps): JSX.Element;
declare namespace DateInput {
var propTypes: {
autoFocus: PropTypes.Requireable<boolean>;
className: PropTypes.Validator<string>;
dayAriaLabel: PropTypes.Requireable<string>;
dayPlaceholder: PropTypes.Requireable<string>;
disabled: PropTypes.Requireable<boolean>;
format: PropTypes.Requireable<string>;
isCalendarOpen: PropTypes.Requireable<boolean>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Validator<Date | null | undefined>;
maxDetail: PropTypes.Requireable<"month" | "year" | "century" | "decade">;
minDate: PropTypes.Validator<Date | null | undefined>;
monthAriaLabel: PropTypes.Requireable<string>;
monthPlaceholder: PropTypes.Requireable<string>;
name: PropTypes.Requireable<string>;
nativeInputAriaLabel: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
required: PropTypes.Requireable<boolean>;
returnValue: PropTypes.Requireable<string>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<NonNullable<string | Date | null | undefined>>;
yearAriaLabel: PropTypes.Requireable<string>;
yearPlaceholder: PropTypes.Requireable<string>;
};
}
export default DateInput;
export default function DateInput({ autoFocus, className, dayAriaLabel, dayPlaceholder, disabled, format, isCalendarOpen: isCalendarOpenProps, locale, maxDate, maxDetail, minDate, monthAriaLabel, monthPlaceholder, name, nativeInputAriaLabel, onChange: onChangeProps, onInvalidChange, required, returnValue, showLeadingZeros, value: valueProps, yearAriaLabel, yearPlaceholder, }: DateInputProps): JSX.Element;
export {};

@@ -23,14 +23,12 @@ 'use client';

import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { getYear, getMonthHuman, getDate } from '@wojtekmaj/date-utils';
import Divider from './Divider';
import DayInput from './DateInput/DayInput';
import MonthInput from './DateInput/MonthInput';
import MonthSelect from './DateInput/MonthSelect';
import YearInput from './DateInput/YearInput';
import NativeInput from './DateInput/NativeInput';
import { getFormatter } from './shared/dateFormatter';
import { getBegin, getEnd } from './shared/dates';
import { isMaxDate, isMinDate } from './shared/propTypes';
import { between } from './shared/utils';
import Divider from './Divider.js';
import DayInput from './DateInput/DayInput.js';
import MonthInput from './DateInput/MonthInput.js';
import MonthSelect from './DateInput/MonthSelect.js';
import YearInput from './DateInput/YearInput.js';
import NativeInput from './DateInput/NativeInput.js';
import { getFormatter } from './shared/dateFormatter.js';
import { getBegin, getEnd } from './shared/dates.js';
import { between } from './shared/utils.js';
var getFormatterOptionsCache = {};

@@ -450,26 +448,1 @@ var defaultMinDate = new Date();

}
var isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);
DateInput.propTypes = {
autoFocus: PropTypes.bool,
className: PropTypes.string.isRequired,
dayAriaLabel: PropTypes.string,
dayPlaceholder: PropTypes.string,
disabled: PropTypes.bool,
format: PropTypes.string,
isCalendarOpen: PropTypes.bool,
locale: PropTypes.string,
maxDate: isMaxDate,
maxDetail: PropTypes.oneOf(allViews),
minDate: isMinDate,
monthAriaLabel: PropTypes.string,
monthPlaceholder: PropTypes.string,
name: PropTypes.string,
nativeInputAriaLabel: PropTypes.string,
onChange: PropTypes.func,
required: PropTypes.bool,
returnValue: PropTypes.oneOf(['start', 'end', 'range']),
showLeadingZeros: PropTypes.bool,
value: isValue,
yearAriaLabel: PropTypes.string,
yearPlaceholder: PropTypes.string,
};
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
import Input from './Input.js';
type DayInputProps = {

@@ -10,24 +9,3 @@ maxDate?: Date;

} & Omit<React.ComponentProps<typeof Input>, 'max' | 'min' | 'name'>;
declare function DayInput({ maxDate, minDate, month, year, ...otherProps }: DayInputProps): JSX.Element;
declare namespace DayInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
month: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
year: PropTypes.Requireable<string>;
};
}
export default DayInput;
export default function DayInput({ maxDate, minDate, month, year, ...otherProps }: DayInputProps): JSX.Element;
export {};

@@ -24,7 +24,5 @@ var __assign = (this && this.__assign) || function () {

import React from 'react';
import PropTypes from 'prop-types';
import { getYear, getMonthHuman, getDate, getDaysInMonth } from '@wojtekmaj/date-utils';
import Input from './Input';
import { isMaxDate, isMinDate, isRef } from '../shared/propTypes';
import { safeMin, safeMax } from '../shared/utils';
import Input from './Input.js';
import { safeMin, safeMax } from '../shared/utils.js';
export default function DayInput(_a) {

@@ -45,18 +43,1 @@ var maxDate = _a.maxDate, minDate = _a.minDate, month = _a.month, year = _a.year, otherProps = __rest(_a, ["maxDate", "minDate", "month", "year"]);

}
DayInput.propTypes = {
ariaLabel: PropTypes.string,
className: PropTypes.string.isRequired,
disabled: PropTypes.bool,
inputRef: isRef,
maxDate: isMaxDate,
minDate: isMinDate,
month: PropTypes.string,
onChange: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyUp: PropTypes.func,
placeholder: PropTypes.string,
required: PropTypes.bool,
showLeadingZeros: PropTypes.bool,
value: PropTypes.string,
year: PropTypes.string,
};
import React from 'react';
import PropTypes from 'prop-types';
type InputProps = {

@@ -28,26 +27,3 @@ ariaLabel?: string;

};
declare function Input({ ariaLabel, autoFocus, className, disabled, inputRef, max, min, name, nameForClass, onChange, onKeyDown, onKeyUp, placeholder, required, showLeadingZeros, step, value, }: InputProps): JSX.Element;
declare namespace Input {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
autoFocus: PropTypes.Requireable<boolean>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
max: PropTypes.Requireable<number>;
min: PropTypes.Requireable<number>;
name: PropTypes.Requireable<string>;
nameForClass: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
showLeadingZeros: PropTypes.Requireable<boolean>;
step: PropTypes.Requireable<number>;
value: PropTypes.Requireable<string>;
};
}
export default Input;
export default function Input({ ariaLabel, autoFocus, className, disabled, inputRef, max, min, name, nameForClass, onChange, onKeyDown, onKeyUp, placeholder, required, showLeadingZeros, step, value, }: InputProps): JSX.Element;
export {};
import React, { useEffect, useLayoutEffect } from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import updateInputWidth, { getFontShorthand } from 'update-input-width';
import { isRef } from '../shared/propTypes';
var isBrowser = typeof document !== 'undefined';

@@ -109,20 +107,1 @@ var useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;

}
Input.propTypes = {
ariaLabel: PropTypes.string,
autoFocus: PropTypes.bool,
className: PropTypes.string.isRequired,
disabled: PropTypes.bool,
inputRef: isRef,
max: PropTypes.number,
min: PropTypes.number,
name: PropTypes.string,
nameForClass: PropTypes.string,
onChange: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyUp: PropTypes.func,
placeholder: PropTypes.string,
required: PropTypes.bool,
showLeadingZeros: PropTypes.bool,
step: PropTypes.number,
value: PropTypes.string,
};
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
import Input from './Input.js';
type MonthInputProps = {

@@ -9,23 +8,3 @@ maxDate?: Date;

} & Omit<React.ComponentProps<typeof Input>, 'max' | 'min' | 'name'>;
declare function MonthInput({ maxDate, minDate, year, ...otherProps }: MonthInputProps): JSX.Element;
declare namespace MonthInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
year: PropTypes.Requireable<string>;
};
}
export default MonthInput;
export default function MonthInput({ maxDate, minDate, year, ...otherProps }: MonthInputProps): JSX.Element;
export {};

@@ -24,7 +24,5 @@ var __assign = (this && this.__assign) || function () {

import React from 'react';
import PropTypes from 'prop-types';
import { getYear, getMonthHuman } from '@wojtekmaj/date-utils';
import Input from './Input';
import { isMaxDate, isMinDate, isRef } from '../shared/propTypes';
import { safeMin, safeMax } from '../shared/utils';
import Input from './Input.js';
import { safeMin, safeMax } from '../shared/utils.js';
export default function MonthInput(_a) {

@@ -39,17 +37,1 @@ var maxDate = _a.maxDate, minDate = _a.minDate, year = _a.year, otherProps = __rest(_a, ["maxDate", "minDate", "year"]);

}
MonthInput.propTypes = {
ariaLabel: PropTypes.string,
className: PropTypes.string.isRequired,
disabled: PropTypes.bool,
inputRef: isRef,
maxDate: isMaxDate,
minDate: isMinDate,
onChange: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyUp: PropTypes.func,
placeholder: PropTypes.string,
required: PropTypes.bool,
showLeadingZeros: PropTypes.bool,
value: PropTypes.string,
year: PropTypes.string,
};
import React from 'react';
import PropTypes from 'prop-types';
type MonthSelectProps = {

@@ -24,24 +23,3 @@ ariaLabel?: string;

};
declare function MonthSelect({ ariaLabel, autoFocus, className, disabled, inputRef, locale, maxDate, minDate, onChange, onKeyDown, placeholder, required, short, value, year, }: MonthSelectProps): JSX.Element;
declare namespace MonthSelect {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
autoFocus: PropTypes.Requireable<boolean>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
short: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
year: PropTypes.Requireable<string>;
};
}
export default MonthSelect;
export default function MonthSelect({ ariaLabel, autoFocus, className, disabled, inputRef, locale, maxDate, minDate, onChange, onKeyDown, placeholder, required, short, value, year, }: MonthSelectProps): JSX.Element;
export {};

@@ -11,8 +11,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {

import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { getYear, getMonthHuman } from '@wojtekmaj/date-utils';
import { formatMonth, formatShortMonth } from '../shared/dateFormatter';
import { isMaxDate, isMinDate, isRef } from '../shared/propTypes';
import { safeMin, safeMax } from '../shared/utils';
import { formatMonth, formatShortMonth } from '../shared/dateFormatter.js';
import { safeMin, safeMax } from '../shared/utils.js';
export default function MonthSelect(_a) {

@@ -36,18 +34,1 @@ var ariaLabel = _a.ariaLabel, autoFocus = _a.autoFocus, className = _a.className, disabled = _a.disabled, inputRef = _a.inputRef, locale = _a.locale, maxDate = _a.maxDate, minDate = _a.minDate, onChange = _a.onChange, onKeyDown = _a.onKeyDown, _b = _a.placeholder, placeholder = _b === void 0 ? '--' : _b, required = _a.required, short = _a.short, value = _a.value, year = _a.year;

}
MonthSelect.propTypes = {
ariaLabel: PropTypes.string,
autoFocus: PropTypes.bool,
className: PropTypes.string.isRequired,
disabled: PropTypes.bool,
inputRef: isRef,
locale: PropTypes.string,
maxDate: isMaxDate,
minDate: isMinDate,
onChange: PropTypes.func,
onKeyDown: PropTypes.func,
placeholder: PropTypes.string,
required: PropTypes.bool,
short: PropTypes.bool,
value: PropTypes.string,
year: PropTypes.string,
};
import React from 'react';
import PropTypes from 'prop-types';
type NativeInputProps = {

@@ -14,16 +13,3 @@ ariaLabel?: string;

};
declare function NativeInput({ ariaLabel, disabled, maxDate, minDate, name, onChange, required, value, valueType, }: NativeInputProps): JSX.Element;
declare namespace NativeInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
disabled: PropTypes.Requireable<boolean>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
name: PropTypes.Requireable<string>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
required: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<Date>;
valueType: PropTypes.Requireable<string>;
};
}
export default NativeInput;
export default function NativeInput({ ariaLabel, disabled, maxDate, minDate, name, onChange, required, value, valueType, }: NativeInputProps): JSX.Element;
export {};
import React from 'react';
import PropTypes from 'prop-types';
import { getYear, getISOLocalDate, getISOLocalMonth } from '@wojtekmaj/date-utils';
import { isMaxDate, isMinDate, isValueType } from '../shared/propTypes';
export default function NativeInput(_a) {

@@ -42,12 +40,1 @@ var ariaLabel = _a.ariaLabel, disabled = _a.disabled, maxDate = _a.maxDate, minDate = _a.minDate, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, valueType = _a.valueType;

}
NativeInput.propTypes = {
ariaLabel: PropTypes.string,
disabled: PropTypes.bool,
maxDate: isMaxDate,
minDate: isMinDate,
name: PropTypes.string,
onChange: PropTypes.func,
required: PropTypes.bool,
value: PropTypes.instanceOf(Date),
valueType: isValueType,
};
import React from 'react';
import PropTypes from 'prop-types';
import Input from './Input';
import Input from './Input.js';
type YearInputProps = {

@@ -10,22 +9,3 @@ maxDate?: Date;

} & Omit<React.ComponentProps<typeof Input>, 'max' | 'min' | 'name'>;
declare function YearInput({ maxDate, minDate, placeholder, valueType, ...otherProps }: YearInputProps): JSX.Element;
declare namespace YearInput {
var propTypes: {
ariaLabel: PropTypes.Requireable<string>;
className: PropTypes.Validator<string>;
disabled: PropTypes.Requireable<boolean>;
inputRef: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | Required<PropTypes.InferProps<{
current: PropTypes.Requireable<any>;
}>> | null | undefined>>;
maxDate: PropTypes.Validator<Date | null | undefined>;
minDate: PropTypes.Validator<Date | null | undefined>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
placeholder: PropTypes.Requireable<string>;
required: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<string>;
valueType: PropTypes.Requireable<string>;
};
}
export default YearInput;
export default function YearInput({ maxDate, minDate, placeholder, valueType, ...otherProps }: YearInputProps): JSX.Element;
export {};

@@ -24,7 +24,5 @@ var __assign = (this && this.__assign) || function () {

import React from 'react';
import PropTypes from 'prop-types';
import { getYear } from '@wojtekmaj/date-utils';
import Input from './Input';
import { isMaxDate, isMinDate, isRef, isValueType } from '../shared/propTypes';
import { safeMax, safeMin } from '../shared/utils';
import Input from './Input.js';
import { safeMax, safeMin } from '../shared/utils.js';
export default function YearInput(_a) {

@@ -42,16 +40,1 @@ var maxDate = _a.maxDate, minDate = _a.minDate, _b = _a.placeholder, placeholder = _b === void 0 ? '----' : _b, valueType = _a.valueType, otherProps = __rest(_a, ["maxDate", "minDate", "placeholder", "valueType"]);

}
YearInput.propTypes = {
ariaLabel: PropTypes.string,
className: PropTypes.string.isRequired,
disabled: PropTypes.bool,
inputRef: isRef,
maxDate: isMaxDate,
minDate: isMinDate,
onChange: PropTypes.func,
onKeyDown: PropTypes.func,
onKeyUp: PropTypes.func,
placeholder: PropTypes.string,
required: PropTypes.bool,
value: PropTypes.string,
valueType: isValueType,
};
import React from 'react';
import PropTypes from 'prop-types';
import makeEventProps from 'make-event-props';
import Calendar from 'react-calendar';
import type { ClassName, CloseReason, Detail, LooseValue, OpenReason, Value } from './shared/types';
type Icon = React.ReactElement | string;
import type { ReactNodeArray } from 'prop-types';
import type { ClassName, CloseReason, Detail, LooseValue, OpenReason, Value } from './shared/types.js';
type Icon = React.ReactElement | ReactNodeArray | null | string | number | boolean;
type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement;

@@ -55,43 +55,3 @@ type CalendarProps = Omit<React.ComponentPropsWithoutRef<typeof Calendar>, 'className' | 'maxDetail' | 'onChange'>;

} & CalendarProps & Omit<EventProps, 'onChange' | 'onFocus'>;
declare function DatePicker(props: DatePickerProps): JSX.Element;
declare namespace DatePicker {
var propTypes: {
autoFocus: PropTypes.Requireable<boolean>;
calendarAriaLabel: PropTypes.Requireable<string>;
calendarClassName: PropTypes.Requireable<NonNullable<string | (string | null | undefined)[] | null | undefined>>;
calendarIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
className: PropTypes.Requireable<NonNullable<string | (string | null | undefined)[] | null | undefined>>;
clearAriaLabel: PropTypes.Requireable<string>;
clearIcon: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
closeCalendar: PropTypes.Requireable<boolean>;
'data-testid': PropTypes.Requireable<string>;
dayAriaLabel: PropTypes.Requireable<string>;
dayPlaceholder: PropTypes.Requireable<string>;
disableCalendar: PropTypes.Requireable<boolean>;
disabled: PropTypes.Requireable<boolean>;
format: PropTypes.Requireable<string>;
id: PropTypes.Requireable<string>;
isOpen: PropTypes.Requireable<boolean>;
locale: PropTypes.Requireable<string>;
maxDate: PropTypes.Validator<Date | null | undefined>;
maxDetail: PropTypes.Requireable<"month" | "year" | "century" | "decade">;
minDate: PropTypes.Validator<Date | null | undefined>;
monthAriaLabel: PropTypes.Requireable<string>;
monthPlaceholder: PropTypes.Requireable<string>;
name: PropTypes.Requireable<string>;
nativeInputAriaLabel: PropTypes.Requireable<string>;
onCalendarClose: PropTypes.Requireable<(...args: any[]) => any>;
onCalendarOpen: PropTypes.Requireable<(...args: any[]) => any>;
onChange: PropTypes.Requireable<(...args: any[]) => any>;
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
openCalendarOnFocus: PropTypes.Requireable<boolean>;
portalContainer: PropTypes.Requireable<object>;
required: PropTypes.Requireable<boolean>;
returnValue: PropTypes.Requireable<string>;
showLeadingZeros: PropTypes.Requireable<boolean>;
value: PropTypes.Requireable<NonNullable<NonNullable<string | Date | null | undefined> | import("./shared/types").Range<NonNullable<string | Date | null | undefined>> | null | undefined>>;
yearAriaLabel: PropTypes.Requireable<string>;
yearPlaceholder: PropTypes.Requireable<string>;
};
}
declare const DatePicker: React.FC<DatePickerProps>;
export default DatePicker;

@@ -31,4 +31,4 @@ 'use client';

import Fit from 'react-fit';
import DateInput from './DateInput';
import { isMaxDate, isMinDate, rangeOf } from './shared/propTypes';
import DateInput from './DateInput.js';
import { isMaxDate, isMinDate, rangeOf } from './shared/propTypes.js';
var baseClassName = 'react-date-picker';

@@ -52,3 +52,3 @@ var outsideActionEvents = ['mousedown', 'focusin', 'touchstart'];

React.createElement("line", { x1: "15", x2: "4", y1: "4", y2: "15" })));
export default function DatePicker(props) {
var DatePicker = function DatePicker(props) {
var autoFocus = props.autoFocus, calendarAriaLabel = props.calendarAriaLabel, _a = props.calendarIcon, calendarIcon = _a === void 0 ? CalendarIcon : _a, className = props.className, clearAriaLabel = props.clearAriaLabel, _b = props.clearIcon, clearIcon = _b === void 0 ? ClearIcon : _b, _c = props.closeCalendar, shouldCloseCalendarOnSelect = _c === void 0 ? true : _c, dataTestid = props["data-testid"], dayAriaLabel = props.dayAriaLabel, dayPlaceholder = props.dayPlaceholder, disableCalendar = props.disableCalendar, disabled = props.disabled, format = props.format, id = props.id, _d = props.isOpen, isOpenProps = _d === void 0 ? null : _d, locale = props.locale, maxDate = props.maxDate, _e = props.maxDetail, maxDetail = _e === void 0 ? 'month' : _e, minDate = props.minDate, monthAriaLabel = props.monthAriaLabel, monthPlaceholder = props.monthPlaceholder, _f = props.name, name = _f === void 0 ? 'date' : _f, nativeInputAriaLabel = props.nativeInputAriaLabel, onCalendarClose = props.onCalendarClose, onCalendarOpen = props.onCalendarOpen, onChangeProps = props.onChange, onFocusProps = props.onFocus, onInvalidChange = props.onInvalidChange, _g = props.openCalendarOnFocus, openCalendarOnFocus = _g === void 0 ? true : _g, required = props.required, _h = props.returnValue, returnValue = _h === void 0 ? 'start' : _h, shouldCloseCalendar = props.shouldCloseCalendar, shouldOpenCalendar = props.shouldOpenCalendar, showLeadingZeros = props.showLeadingZeros, value = props.value, yearAriaLabel = props.yearAriaLabel, yearPlaceholder = props.yearPlaceholder, otherProps = __rest(props, ["autoFocus", "calendarAriaLabel", "calendarIcon", "className", "clearAriaLabel", "clearIcon", "closeCalendar", 'data-testid', "dayAriaLabel", "dayPlaceholder", "disableCalendar", "disabled", "format", "id", "isOpen", "locale", "maxDate", "maxDetail", "minDate", "monthAriaLabel", "monthPlaceholder", "name", "nativeInputAriaLabel", "onCalendarClose", "onCalendarOpen", "onChange", "onFocus", "onInvalidChange", "openCalendarOnFocus", "required", "returnValue", "shouldCloseCalendar", "shouldOpenCalendar", "showLeadingZeros", "value", "yearAriaLabel", "yearPlaceholder"]);

@@ -203,3 +203,3 @@ var _j = useState(isOpenProps), isOpen = _j[0], setIsOpen = _j[1];

renderCalendar()));
}
};
var isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]);

@@ -237,3 +237,3 @@ var isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]);

openCalendarOnFocus: PropTypes.bool,
portalContainer: PropTypes.object,
portalContainer: PropTypes.instanceOf(HTMLElement),
required: PropTypes.bool,

@@ -246,1 +246,2 @@ returnValue: PropTypes.oneOf(['start', 'end', 'range']),

};
export default DatePicker;
import React from 'react';
import PropTypes from 'prop-types';
type DividerProps = {
children: React.ReactNode;
children?: React.ReactNode;
};
declare function Divider({ children }: DividerProps): JSX.Element;
declare namespace Divider {
var propTypes: {
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
};
}
export default Divider;
export default function Divider({ children }: DividerProps): JSX.Element;
export {};
import React from 'react';
import PropTypes from 'prop-types';
export default function Divider(_a) {

@@ -7,4 +6,1 @@ var children = _a.children;

}
Divider.propTypes = {
children: PropTypes.node,
};

@@ -1,4 +0,4 @@

import DatePicker from './DatePicker';
export type { DatePickerProps } from './DatePicker';
import DatePicker from './DatePicker.js';
export type { DatePickerProps } from './DatePicker.js';
export { DatePicker };
export default DatePicker;

@@ -1,3 +0,3 @@

import DatePicker from './DatePicker';
import DatePicker from './DatePicker.js';
export { DatePicker };
export default DatePicker;

@@ -1,2 +0,2 @@

import type { RangeType } from './types';
import type { RangeType } from './types.js';
/**

@@ -3,0 +3,0 @@ * Returns the beginning of a given range.

import PropTypes from 'prop-types';
import type { Requireable, Validator } from 'prop-types';
import type { Range } from './types';
import type { Range } from './types.js';
export declare const isValueType: PropTypes.Requireable<string>;

@@ -5,0 +5,0 @@ export declare const isMinDate: Validator<Date | null | undefined>;

{
"name": "react-date-picker",
"version": "10.3.0",
"version": "10.4.0",
"description": "A date picker for your React app.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"source": "src/index.ts",
"types": "dist/cjs/index.d.ts",
"type": "module",
"sideEffects": [
"*.css"
],
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"source": "./src/index.ts",
"types": "./dist/cjs/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./dist/cjs/DateInput.js": "./dist/cjs/DateInput.js",
"./dist/cjs/DateInput/DayInput.js": "./dist/cjs/DateInput/DayInput.js",
"./dist/cjs/DateInput/MonthInput.js": "./dist/cjs/DateInput/MonthInput.js",
"./dist/cjs/DateInput/MonthSelect.js": "./dist/cjs/DateInput/MonthSelect.js",
"./dist/cjs/DateInput/YearInput.js": "./dist/cjs/DateInput/YearInput.js",
"./dist/esm/DateInput.js": "./dist/esm/DateInput.js",
"./dist/esm/DateInput/DayInput.js": "./dist/esm/DateInput/DayInput.js",
"./dist/esm/DateInput/MonthInput.js": "./dist/esm/DateInput/MonthInput.js",
"./dist/esm/DateInput/MonthSelect.js": "./dist/esm/DateInput/MonthSelect.js",
"./dist/esm/DateInput/YearInput.js": "./dist/esm/DateInput/YearInput.js",
"./dist/DatePicker.css": "./dist/DatePicker.css"
},
"scripts": {
"build": "yarn build-js && yarn copy-styles",
"build-js": "yarn build-js-esm && yarn build-js-cjs",
"build-js": "yarn build-js-esm && yarn build-js-cjs && yarn build-js-cjs-package",
"build-js-esm": "tsc --project tsconfig.build.json --outDir dist/esm --module esnext",
"build-js-cjs": "tsc --project tsconfig.build.json --outDir dist/cjs --module commonjs",
"build-js-cjs-package": "echo '{\n \"type\": \"commonjs\"\n}' > dist/cjs/package.json",
"clean": "rimraf dist",
"copy-styles": "node --loader ts-node/esm ./copy-styles.ts",
"copy-styles": "cpy 'src/**/*.css' dist",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",

@@ -24,3 +43,4 @@ "prepack": "yarn clean && yarn build",

"tsc": "tsc --noEmit",
"unit": "vitest"
"unit": "vitest",
"watch": "yarn build-js-esm --watch & yarn build-js-cjs --watch & yarn build-js-cjs-package & nodemon --watch src --ext css --exec \"yarn copy-styles\""
},

@@ -43,7 +63,7 @@ "keywords": [

"get-user-locale": "^2.2.1",
"make-event-props": "^1.4.2",
"make-event-props": "^1.6.0",
"prop-types": "^15.6.0",
"react-calendar": "^4.5.0",
"react-fit": "^1.6.0",
"update-input-width": "^1.3.1"
"react-calendar": "^4.6.0",
"react-fit": "^1.7.0",
"update-input-width": "^1.4.0"
},

@@ -57,2 +77,3 @@ "devDependencies": {

"@types/react": "*",
"cpy-cli": "^5.0.0",
"eslint": "^8.26.0",

@@ -62,2 +83,3 @@ "eslint-config-wojtekmaj": "^0.9.0",

"jsdom": "^21.1.0",
"nodemon": "^3.0.0",
"prettier": "^2.7.0",

@@ -68,3 +90,2 @@ "pretty-quick": "^3.1.0",

"rimraf": "^3.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.0",

@@ -71,0 +92,0 @@ "vitest": "^0.30.1",

@@ -1,4 +0,4 @@

import DatePicker from './DatePicker';
import DatePicker from './DatePicker.js';
export type { DatePickerProps } from './DatePicker';
export type { DatePickerProps } from './DatePicker.js';

@@ -5,0 +5,0 @@ export { DatePicker };

import { describe, expect, it } from 'vitest';
import { getBegin, getEnd } from './dates';
import { getBegin, getEnd } from './dates.js';

@@ -4,0 +4,0 @@ describe('getBegin', () => {

@@ -12,3 +12,3 @@ import {

import type { RangeType } from './types';
import type { RangeType } from './types.js';

@@ -15,0 +15,0 @@ /**

import PropTypes from 'prop-types';
import type { Requireable, Validator } from 'prop-types';
import type { Range } from './types';
import type { Range } from './types.js';

@@ -6,0 +6,0 @@ const allViews = ['century', 'decade', 'year', 'month'];

import { describe, expect, it } from 'vitest';
import { between, safeMin, safeMax } from './utils';
import { between, safeMin, safeMax } from './utils.js';

@@ -4,0 +4,0 @@ describe('between', () => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc