@refraction-ui/react 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +34 -422
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -408
- package/dist/index.js.map +1 -1
- package/dist/internal/date-picker/index.d.cts +3 -1
- package/dist/internal/date-picker/index.d.ts +3 -1
- package/dist/internal/react-date-picker/index.d.cts +2 -10
- package/dist/internal/react-date-picker/index.d.ts +2 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1140,14 +1140,14 @@ function createCalendar(props = {}) {
|
|
|
1140
1140
|
const gridId = generateId("rfr-calendar");
|
|
1141
1141
|
const labelId = generateId("rfr-calendar-label");
|
|
1142
1142
|
function isDateDisabled(date) {
|
|
1143
|
-
if (minDate && date <
|
|
1144
|
-
if (maxDate && date >
|
|
1143
|
+
if (minDate && date < startOfDay(minDate)) return true;
|
|
1144
|
+
if (maxDate && date > endOfDay(maxDate)) return true;
|
|
1145
1145
|
return disabledDates.some((d) => isSameDay(d, date));
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function startOfDay(date) {
|
|
1148
1148
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function endOfDay(date) {
|
|
1151
1151
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
|
|
1152
1152
|
}
|
|
1153
1153
|
function buildDays() {
|
|
@@ -12109,214 +12109,8 @@ var Checkbox = React11.forwardRef(
|
|
|
12109
12109
|
Checkbox.displayName = "Checkbox";
|
|
12110
12110
|
|
|
12111
12111
|
// ../date-picker/dist/index.js
|
|
12112
|
-
function isSameDay2(a, b) {
|
|
12113
|
-
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
12114
|
-
}
|
|
12115
|
-
function startOfMonth2(date) {
|
|
12116
|
-
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
12117
|
-
}
|
|
12118
|
-
function startOfDay(date) {
|
|
12119
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
12120
|
-
}
|
|
12121
|
-
function endOfDay(date) {
|
|
12122
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
|
|
12123
|
-
}
|
|
12124
|
-
var DAY_NAMES2 = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
12125
|
-
function padZero(n) {
|
|
12126
|
-
return n < 10 ? `0${n}` : `${n}`;
|
|
12127
|
-
}
|
|
12128
|
-
function formatDate(date, format, showTime) {
|
|
12129
|
-
if (!date) return "";
|
|
12130
|
-
const year = date.getFullYear();
|
|
12131
|
-
const month = padZero(date.getMonth() + 1);
|
|
12132
|
-
const day = padZero(date.getDate());
|
|
12133
|
-
const hours = padZero(date.getHours());
|
|
12134
|
-
const minutes = padZero(date.getMinutes());
|
|
12135
|
-
let result = format.replace("YYYY", String(year)).replace("MM", month).replace("DD", day);
|
|
12136
|
-
if (showTime) {
|
|
12137
|
-
result = result.replace("HH", hours).replace("mm", minutes);
|
|
12138
|
-
}
|
|
12139
|
-
return result;
|
|
12140
|
-
}
|
|
12141
|
-
function createDatePicker(props = {}) {
|
|
12142
|
-
const {
|
|
12143
|
-
value,
|
|
12144
|
-
onChange,
|
|
12145
|
-
minDate,
|
|
12146
|
-
maxDate,
|
|
12147
|
-
showTime = false,
|
|
12148
|
-
format = showTime ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD",
|
|
12149
|
-
placeholder = "Select date...",
|
|
12150
|
-
open: controlledOpen,
|
|
12151
|
-
defaultOpen = false,
|
|
12152
|
-
onOpenChange
|
|
12153
|
-
} = props;
|
|
12154
|
-
const today = /* @__PURE__ */ new Date();
|
|
12155
|
-
let internalOpen = controlledOpen ?? defaultOpen;
|
|
12156
|
-
let currentMonth = value ? startOfMonth2(value) : startOfMonth2(today);
|
|
12157
|
-
let view = "calendar";
|
|
12158
|
-
const hours = value ? value.getHours() : 0;
|
|
12159
|
-
const minutes = value ? value.getMinutes() : 0;
|
|
12160
|
-
const triggerId = generateId("rfr-datepicker-trigger");
|
|
12161
|
-
const dropdownId = generateId("rfr-datepicker-dropdown");
|
|
12162
|
-
const gridId = generateId("rfr-datepicker-grid");
|
|
12163
|
-
const labelId = generateId("rfr-datepicker-label");
|
|
12164
|
-
function isOpen() {
|
|
12165
|
-
if (controlledOpen !== void 0) return controlledOpen;
|
|
12166
|
-
return internalOpen;
|
|
12167
|
-
}
|
|
12168
|
-
function isDateDisabled(date) {
|
|
12169
|
-
if (minDate && date < startOfDay(minDate)) return true;
|
|
12170
|
-
if (maxDate && date > endOfDay(maxDate)) return true;
|
|
12171
|
-
return false;
|
|
12172
|
-
}
|
|
12173
|
-
function buildDays() {
|
|
12174
|
-
const year = currentMonth.getFullYear();
|
|
12175
|
-
const month = currentMonth.getMonth();
|
|
12176
|
-
const first = new Date(year, month, 1);
|
|
12177
|
-
const startDow = first.getDay();
|
|
12178
|
-
const gridStart = new Date(year, month, 1 - startDow);
|
|
12179
|
-
const days = [];
|
|
12180
|
-
for (let i = 0; i < 42; i++) {
|
|
12181
|
-
const date = new Date(
|
|
12182
|
-
gridStart.getFullYear(),
|
|
12183
|
-
gridStart.getMonth(),
|
|
12184
|
-
gridStart.getDate() + i
|
|
12185
|
-
);
|
|
12186
|
-
days.push({
|
|
12187
|
-
date,
|
|
12188
|
-
isToday: isSameDay2(date, today),
|
|
12189
|
-
isSelected: value ? isSameDay2(date, value) : false,
|
|
12190
|
-
isCurrentMonth: date.getMonth() === month,
|
|
12191
|
-
isDisabled: isDateDisabled(date)
|
|
12192
|
-
});
|
|
12193
|
-
}
|
|
12194
|
-
return days;
|
|
12195
|
-
}
|
|
12196
|
-
function openPicker() {
|
|
12197
|
-
internalOpen = true;
|
|
12198
|
-
onOpenChange?.(true);
|
|
12199
|
-
}
|
|
12200
|
-
function closePicker() {
|
|
12201
|
-
internalOpen = false;
|
|
12202
|
-
onOpenChange?.(false);
|
|
12203
|
-
}
|
|
12204
|
-
function togglePicker() {
|
|
12205
|
-
if (isOpen()) {
|
|
12206
|
-
closePicker();
|
|
12207
|
-
} else {
|
|
12208
|
-
openPicker();
|
|
12209
|
-
}
|
|
12210
|
-
}
|
|
12211
|
-
function selectDate(date) {
|
|
12212
|
-
if (isDateDisabled(date)) return;
|
|
12213
|
-
const newDate = new Date(date);
|
|
12214
|
-
if (value) {
|
|
12215
|
-
newDate.setHours(value.getHours());
|
|
12216
|
-
newDate.setMinutes(value.getMinutes());
|
|
12217
|
-
}
|
|
12218
|
-
onChange?.(newDate);
|
|
12219
|
-
if (!showTime) {
|
|
12220
|
-
closePicker();
|
|
12221
|
-
}
|
|
12222
|
-
}
|
|
12223
|
-
function setHours(h4) {
|
|
12224
|
-
if (h4 < 0 || h4 > 23) return;
|
|
12225
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
12226
|
-
newDate.setHours(h4);
|
|
12227
|
-
onChange?.(newDate);
|
|
12228
|
-
}
|
|
12229
|
-
function setMinutes(m) {
|
|
12230
|
-
if (m < 0 || m > 59) return;
|
|
12231
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
12232
|
-
newDate.setMinutes(m);
|
|
12233
|
-
onChange?.(newDate);
|
|
12234
|
-
}
|
|
12235
|
-
function prevMonth() {
|
|
12236
|
-
currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1);
|
|
12237
|
-
}
|
|
12238
|
-
function nextMonth() {
|
|
12239
|
-
currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1);
|
|
12240
|
-
}
|
|
12241
|
-
function setView(v) {
|
|
12242
|
-
view = v;
|
|
12243
|
-
}
|
|
12244
|
-
function formatDisplay() {
|
|
12245
|
-
return value ? formatDate(value, format, showTime) : placeholder;
|
|
12246
|
-
}
|
|
12247
|
-
const keyboardHandlers = {
|
|
12248
|
-
[Keys.Escape]: (e) => {
|
|
12249
|
-
e.preventDefault();
|
|
12250
|
-
closePicker();
|
|
12251
|
-
}
|
|
12252
|
-
};
|
|
12253
|
-
const triggerProps = {
|
|
12254
|
-
"aria-expanded": isOpen(),
|
|
12255
|
-
"aria-controls": dropdownId,
|
|
12256
|
-
"aria-haspopup": "dialog",
|
|
12257
|
-
id: triggerId,
|
|
12258
|
-
role: "combobox"
|
|
12259
|
-
};
|
|
12260
|
-
const dropdownProps = {
|
|
12261
|
-
role: "dialog",
|
|
12262
|
-
"aria-modal": true,
|
|
12263
|
-
"aria-labelledby": labelId,
|
|
12264
|
-
id: dropdownId
|
|
12265
|
-
};
|
|
12266
|
-
const gridProps = {
|
|
12267
|
-
role: "grid",
|
|
12268
|
-
"aria-labelledby": labelId,
|
|
12269
|
-
id: gridId
|
|
12270
|
-
};
|
|
12271
|
-
function getDayAriaProps(day) {
|
|
12272
|
-
return {
|
|
12273
|
-
role: "gridcell",
|
|
12274
|
-
"aria-selected": day.isSelected,
|
|
12275
|
-
"aria-disabled": day.isDisabled,
|
|
12276
|
-
"aria-current": day.isToday ? "date" : void 0,
|
|
12277
|
-
"aria-label": `${DAY_NAMES2[day.date.getDay()]}, ${day.date.toLocaleDateString("en-US", {
|
|
12278
|
-
month: "long",
|
|
12279
|
-
day: "numeric",
|
|
12280
|
-
year: "numeric"
|
|
12281
|
-
})}`
|
|
12282
|
-
};
|
|
12283
|
-
}
|
|
12284
|
-
return {
|
|
12285
|
-
state: {
|
|
12286
|
-
open: isOpen(),
|
|
12287
|
-
selectedDate: value,
|
|
12288
|
-
view,
|
|
12289
|
-
hours,
|
|
12290
|
-
minutes,
|
|
12291
|
-
currentMonth
|
|
12292
|
-
},
|
|
12293
|
-
days: buildDays(),
|
|
12294
|
-
openPicker,
|
|
12295
|
-
closePicker,
|
|
12296
|
-
togglePicker,
|
|
12297
|
-
selectDate,
|
|
12298
|
-
setHours,
|
|
12299
|
-
setMinutes,
|
|
12300
|
-
prevMonth,
|
|
12301
|
-
nextMonth,
|
|
12302
|
-
setView,
|
|
12303
|
-
formatDisplay,
|
|
12304
|
-
triggerProps,
|
|
12305
|
-
dropdownProps,
|
|
12306
|
-
gridProps,
|
|
12307
|
-
getDayAriaProps,
|
|
12308
|
-
keyboardHandlers,
|
|
12309
|
-
ids: {
|
|
12310
|
-
trigger: triggerId,
|
|
12311
|
-
dropdown: dropdownId,
|
|
12312
|
-
grid: gridId,
|
|
12313
|
-
label: labelId
|
|
12314
|
-
}
|
|
12315
|
-
};
|
|
12316
|
-
}
|
|
12317
12112
|
var datePickerTriggerStyles = "inline-flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer";
|
|
12318
|
-
|
|
12319
|
-
var datePickerDayVariants = cva({
|
|
12113
|
+
cva({
|
|
12320
12114
|
base: "inline-flex h-8 w-8 items-center justify-center rounded-md text-sm cursor-pointer hover:bg-accent hover:text-accent-foreground",
|
|
12321
12115
|
variants: {
|
|
12322
12116
|
state: {
|
|
@@ -12331,205 +12125,38 @@ var datePickerDayVariants = cva({
|
|
|
12331
12125
|
state: "default"
|
|
12332
12126
|
}
|
|
12333
12127
|
});
|
|
12334
|
-
var
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
disabled = false
|
|
12348
|
-
}) {
|
|
12349
|
-
const [open, setOpen] = React11.useState(false);
|
|
12350
|
-
const [currentMonth, setCurrentMonth] = React11.useState(
|
|
12351
|
-
() => value ? new Date(value.getFullYear(), value.getMonth(), 1) : new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)
|
|
12352
|
-
);
|
|
12353
|
-
const [view, setView] = React11.useState("calendar");
|
|
12354
|
-
const containerRef = React11.useRef(null);
|
|
12355
|
-
const api = React11.useMemo(
|
|
12356
|
-
() => createDatePicker({
|
|
12357
|
-
value,
|
|
12358
|
-
onChange,
|
|
12359
|
-
minDate,
|
|
12360
|
-
maxDate,
|
|
12361
|
-
showTime,
|
|
12362
|
-
format,
|
|
12363
|
-
placeholder,
|
|
12364
|
-
open,
|
|
12365
|
-
onOpenChange: setOpen
|
|
12366
|
-
}),
|
|
12367
|
-
[value, onChange, minDate, maxDate, showTime, format, placeholder, open]
|
|
12368
|
-
);
|
|
12369
|
-
React11.useMemo(() => {
|
|
12370
|
-
createDatePicker({
|
|
12371
|
-
value,
|
|
12372
|
-
minDate,
|
|
12373
|
-
maxDate,
|
|
12374
|
-
open: true
|
|
12375
|
-
});
|
|
12376
|
-
const tempApi = createDatePicker({
|
|
12377
|
-
value,
|
|
12378
|
-
minDate,
|
|
12379
|
-
maxDate,
|
|
12380
|
-
open: true
|
|
12381
|
-
});
|
|
12382
|
-
return tempApi.days;
|
|
12383
|
-
}, [value, minDate, maxDate, currentMonth]);
|
|
12384
|
-
React11.useEffect(() => {
|
|
12385
|
-
if (!open) return;
|
|
12386
|
-
function handleClick(e) {
|
|
12387
|
-
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
12388
|
-
setOpen(false);
|
|
12389
|
-
}
|
|
12390
|
-
}
|
|
12391
|
-
document.addEventListener("mousedown", handleClick);
|
|
12392
|
-
return () => document.removeEventListener("mousedown", handleClick);
|
|
12393
|
-
}, [open]);
|
|
12394
|
-
React11.useEffect(() => {
|
|
12395
|
-
if (!open) return;
|
|
12396
|
-
function handleKeyDown(e) {
|
|
12397
|
-
if (e.key === "Escape") {
|
|
12398
|
-
e.preventDefault();
|
|
12399
|
-
setOpen(false);
|
|
12128
|
+
var DatePicker = React11.forwardRef(
|
|
12129
|
+
({ value, onChange, minDate, maxDate, showTime = false, format, placeholder, className, disabled = false, ...props }, ref) => {
|
|
12130
|
+
const dateToString = (date) => {
|
|
12131
|
+
if (!date) return "";
|
|
12132
|
+
const offset = date.getTimezoneOffset() * 6e4;
|
|
12133
|
+
const localDate = new Date(date.getTime() - offset);
|
|
12134
|
+
const iso = localDate.toISOString();
|
|
12135
|
+
return showTime ? iso.slice(0, 16) : iso.slice(0, 10);
|
|
12136
|
+
};
|
|
12137
|
+
const handleChange = (e) => {
|
|
12138
|
+
if (!onChange) return;
|
|
12139
|
+
if (e.target.value) {
|
|
12140
|
+
onChange(new Date(e.target.value));
|
|
12400
12141
|
}
|
|
12401
|
-
}
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
}, [open]);
|
|
12405
|
-
const displayValue = api.formatDisplay();
|
|
12406
|
-
const handleSelectDate = (date) => {
|
|
12407
|
-
const newDate = new Date(date);
|
|
12408
|
-
if (value) {
|
|
12409
|
-
newDate.setHours(value.getHours());
|
|
12410
|
-
newDate.setMinutes(value.getMinutes());
|
|
12411
|
-
}
|
|
12412
|
-
onChange?.(newDate);
|
|
12413
|
-
if (!showTime) {
|
|
12414
|
-
setOpen(false);
|
|
12415
|
-
}
|
|
12416
|
-
};
|
|
12417
|
-
const handleHoursChange = (e) => {
|
|
12418
|
-
const h4 = parseInt(e.target.value, 10);
|
|
12419
|
-
if (isNaN(h4) || h4 < 0 || h4 > 23) return;
|
|
12420
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
12421
|
-
newDate.setHours(h4);
|
|
12422
|
-
onChange?.(newDate);
|
|
12423
|
-
};
|
|
12424
|
-
const handleMinutesChange = (e) => {
|
|
12425
|
-
const m = parseInt(e.target.value, 10);
|
|
12426
|
-
if (isNaN(m) || m < 0 || m > 59) return;
|
|
12427
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
12428
|
-
newDate.setMinutes(m);
|
|
12429
|
-
onChange?.(newDate);
|
|
12430
|
-
};
|
|
12431
|
-
const monthLabel = currentMonth.toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
|
12432
|
-
return React11.createElement(
|
|
12433
|
-
"div",
|
|
12434
|
-
{ ref: containerRef, className: cn("relative inline-block", className) },
|
|
12435
|
-
React11.createElement(
|
|
12436
|
-
"button",
|
|
12437
|
-
{
|
|
12438
|
-
type: "button",
|
|
12439
|
-
className: cn(datePickerTriggerStyles, disabled && "opacity-50 cursor-not-allowed"),
|
|
12440
|
-
onClick: () => !disabled && setOpen(!open),
|
|
12441
|
-
"aria-expanded": open,
|
|
12442
|
-
"aria-haspopup": "dialog",
|
|
12443
|
-
disabled
|
|
12444
|
-
},
|
|
12445
|
-
displayValue
|
|
12446
|
-
),
|
|
12447
|
-
open && React11.createElement(
|
|
12448
|
-
"div",
|
|
12142
|
+
};
|
|
12143
|
+
return /* @__PURE__ */ jsx(
|
|
12144
|
+
"input",
|
|
12449
12145
|
{
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
"
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
},
|
|
12465
|
-
"\u2039"
|
|
12466
|
-
),
|
|
12467
|
-
React11.createElement("span", { className: "text-sm font-medium" }, monthLabel),
|
|
12468
|
-
React11.createElement(
|
|
12469
|
-
"button",
|
|
12470
|
-
{
|
|
12471
|
-
type: "button",
|
|
12472
|
-
className: "p-1 hover:bg-accent rounded cursor-pointer",
|
|
12473
|
-
onClick: () => setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1)),
|
|
12474
|
-
"aria-label": "Next month"
|
|
12475
|
-
},
|
|
12476
|
-
"\u203A"
|
|
12477
|
-
)
|
|
12478
|
-
),
|
|
12479
|
-
React11.createElement(
|
|
12480
|
-
"div",
|
|
12481
|
-
{ className: "grid grid-cols-7 gap-0 text-center", role: "grid" },
|
|
12482
|
-
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
12483
|
-
(d) => React11.createElement("div", { key: d, className: "text-xs text-muted-foreground py-1 font-medium" }, d)
|
|
12484
|
-
),
|
|
12485
|
-
api.days.map((day, i) => {
|
|
12486
|
-
let state = "default";
|
|
12487
|
-
if (day.isDisabled) state = "disabled";
|
|
12488
|
-
else if (day.isSelected) state = "selected";
|
|
12489
|
-
else if (day.isToday) state = "today";
|
|
12490
|
-
else if (!day.isCurrentMonth) state = "outside";
|
|
12491
|
-
return React11.createElement(
|
|
12492
|
-
"button",
|
|
12493
|
-
{
|
|
12494
|
-
key: i,
|
|
12495
|
-
type: "button",
|
|
12496
|
-
className: datePickerDayVariants({ state }),
|
|
12497
|
-
onClick: () => !day.isDisabled && handleSelectDate(day.date),
|
|
12498
|
-
disabled: day.isDisabled,
|
|
12499
|
-
"aria-selected": day.isSelected,
|
|
12500
|
-
"aria-disabled": day.isDisabled
|
|
12501
|
-
},
|
|
12502
|
-
day.date.getDate()
|
|
12503
|
-
);
|
|
12504
|
-
})
|
|
12505
|
-
),
|
|
12506
|
-
showTime && React11.createElement(
|
|
12507
|
-
"div",
|
|
12508
|
-
{ className: datePickerTimeStyles },
|
|
12509
|
-
React11.createElement("span", { className: "text-sm text-muted-foreground" }, "Time:"),
|
|
12510
|
-
React11.createElement("input", {
|
|
12511
|
-
type: "number",
|
|
12512
|
-
min: 0,
|
|
12513
|
-
max: 23,
|
|
12514
|
-
value: value ? value.getHours() : 0,
|
|
12515
|
-
onChange: handleHoursChange,
|
|
12516
|
-
className: datePickerTimeInputStyles,
|
|
12517
|
-
"aria-label": "Hours"
|
|
12518
|
-
}),
|
|
12519
|
-
React11.createElement("span", { className: "text-muted-foreground" }, ":"),
|
|
12520
|
-
React11.createElement("input", {
|
|
12521
|
-
type: "number",
|
|
12522
|
-
min: 0,
|
|
12523
|
-
max: 59,
|
|
12524
|
-
value: value ? value.getMinutes() : 0,
|
|
12525
|
-
onChange: handleMinutesChange,
|
|
12526
|
-
className: datePickerTimeInputStyles,
|
|
12527
|
-
"aria-label": "Minutes"
|
|
12528
|
-
})
|
|
12529
|
-
)
|
|
12530
|
-
)
|
|
12531
|
-
);
|
|
12532
|
-
}
|
|
12146
|
+
ref,
|
|
12147
|
+
type: showTime ? "datetime-local" : "date",
|
|
12148
|
+
className: cn(datePickerTriggerStyles, "justify-start text-left font-normal w-[280px]", className),
|
|
12149
|
+
value: dateToString(value),
|
|
12150
|
+
min: dateToString(minDate),
|
|
12151
|
+
max: dateToString(maxDate),
|
|
12152
|
+
onChange: handleChange,
|
|
12153
|
+
disabled,
|
|
12154
|
+
placeholder,
|
|
12155
|
+
...props
|
|
12156
|
+
}
|
|
12157
|
+
);
|
|
12158
|
+
}
|
|
12159
|
+
);
|
|
12533
12160
|
DatePicker.displayName = "DatePicker";
|
|
12534
12161
|
|
|
12535
12162
|
// ../emoji-picker/dist/index.js
|