@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.cjs
CHANGED
|
@@ -31204,14 +31204,14 @@ function createCalendar(props = {}) {
|
|
|
31204
31204
|
const gridId = generateId("rfr-calendar");
|
|
31205
31205
|
const labelId = generateId("rfr-calendar-label");
|
|
31206
31206
|
function isDateDisabled(date) {
|
|
31207
|
-
if (minDate && date <
|
|
31208
|
-
if (maxDate && date >
|
|
31207
|
+
if (minDate && date < startOfDay(minDate)) return true;
|
|
31208
|
+
if (maxDate && date > endOfDay(maxDate)) return true;
|
|
31209
31209
|
return disabledDates.some((d2) => isSameDay(d2, date));
|
|
31210
31210
|
}
|
|
31211
|
-
function
|
|
31211
|
+
function startOfDay(date) {
|
|
31212
31212
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
31213
31213
|
}
|
|
31214
|
-
function
|
|
31214
|
+
function endOfDay(date) {
|
|
31215
31215
|
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
|
|
31216
31216
|
}
|
|
31217
31217
|
function buildDays() {
|
|
@@ -42173,427 +42173,39 @@ var Checkbox = React11__namespace.forwardRef(
|
|
|
42173
42173
|
Checkbox.displayName = "Checkbox";
|
|
42174
42174
|
|
|
42175
42175
|
// ../date-picker/dist/index.js
|
|
42176
|
-
function isSameDay2(a2, b2) {
|
|
42177
|
-
return a2.getFullYear() === b2.getFullYear() && a2.getMonth() === b2.getMonth() && a2.getDate() === b2.getDate();
|
|
42178
|
-
}
|
|
42179
|
-
function startOfMonth2(date) {
|
|
42180
|
-
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
42181
|
-
}
|
|
42182
|
-
function startOfDay(date) {
|
|
42183
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
42184
|
-
}
|
|
42185
|
-
function endOfDay(date) {
|
|
42186
|
-
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59, 999);
|
|
42187
|
-
}
|
|
42188
|
-
var DAY_NAMES2 = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
42189
|
-
function padZero(n2) {
|
|
42190
|
-
return n2 < 10 ? `0${n2}` : `${n2}`;
|
|
42191
|
-
}
|
|
42192
|
-
function formatDate(date, format, showTime) {
|
|
42193
|
-
if (!date) return "";
|
|
42194
|
-
const year = date.getFullYear();
|
|
42195
|
-
const month = padZero(date.getMonth() + 1);
|
|
42196
|
-
const day = padZero(date.getDate());
|
|
42197
|
-
const hours = padZero(date.getHours());
|
|
42198
|
-
const minutes = padZero(date.getMinutes());
|
|
42199
|
-
let result = format.replace("YYYY", String(year)).replace("MM", month).replace("DD", day);
|
|
42200
|
-
if (showTime) {
|
|
42201
|
-
result = result.replace("HH", hours).replace("mm", minutes);
|
|
42202
|
-
}
|
|
42203
|
-
return result;
|
|
42204
|
-
}
|
|
42205
|
-
function createDatePicker(props = {}) {
|
|
42206
|
-
const {
|
|
42207
|
-
value,
|
|
42208
|
-
onChange,
|
|
42209
|
-
minDate,
|
|
42210
|
-
maxDate,
|
|
42211
|
-
showTime = false,
|
|
42212
|
-
format = showTime ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD",
|
|
42213
|
-
placeholder = "Select date...",
|
|
42214
|
-
open: controlledOpen,
|
|
42215
|
-
defaultOpen = false,
|
|
42216
|
-
onOpenChange
|
|
42217
|
-
} = props;
|
|
42218
|
-
const today = /* @__PURE__ */ new Date();
|
|
42219
|
-
let internalOpen = controlledOpen ?? defaultOpen;
|
|
42220
|
-
let currentMonth = value ? startOfMonth2(value) : startOfMonth2(today);
|
|
42221
|
-
let view = "calendar";
|
|
42222
|
-
const hours = value ? value.getHours() : 0;
|
|
42223
|
-
const minutes = value ? value.getMinutes() : 0;
|
|
42224
|
-
const triggerId = generateId("rfr-datepicker-trigger");
|
|
42225
|
-
const dropdownId = generateId("rfr-datepicker-dropdown");
|
|
42226
|
-
const gridId = generateId("rfr-datepicker-grid");
|
|
42227
|
-
const labelId = generateId("rfr-datepicker-label");
|
|
42228
|
-
function isOpen() {
|
|
42229
|
-
if (controlledOpen !== void 0) return controlledOpen;
|
|
42230
|
-
return internalOpen;
|
|
42231
|
-
}
|
|
42232
|
-
function isDateDisabled(date) {
|
|
42233
|
-
if (minDate && date < startOfDay(minDate)) return true;
|
|
42234
|
-
if (maxDate && date > endOfDay(maxDate)) return true;
|
|
42235
|
-
return false;
|
|
42236
|
-
}
|
|
42237
|
-
function buildDays() {
|
|
42238
|
-
const year = currentMonth.getFullYear();
|
|
42239
|
-
const month = currentMonth.getMonth();
|
|
42240
|
-
const first = new Date(year, month, 1);
|
|
42241
|
-
const startDow = first.getDay();
|
|
42242
|
-
const gridStart = new Date(year, month, 1 - startDow);
|
|
42243
|
-
const days = [];
|
|
42244
|
-
for (let i2 = 0; i2 < 42; i2++) {
|
|
42245
|
-
const date = new Date(
|
|
42246
|
-
gridStart.getFullYear(),
|
|
42247
|
-
gridStart.getMonth(),
|
|
42248
|
-
gridStart.getDate() + i2
|
|
42249
|
-
);
|
|
42250
|
-
days.push({
|
|
42251
|
-
date,
|
|
42252
|
-
isToday: isSameDay2(date, today),
|
|
42253
|
-
isSelected: value ? isSameDay2(date, value) : false,
|
|
42254
|
-
isCurrentMonth: date.getMonth() === month,
|
|
42255
|
-
isDisabled: isDateDisabled(date)
|
|
42256
|
-
});
|
|
42257
|
-
}
|
|
42258
|
-
return days;
|
|
42259
|
-
}
|
|
42260
|
-
function openPicker() {
|
|
42261
|
-
internalOpen = true;
|
|
42262
|
-
onOpenChange?.(true);
|
|
42263
|
-
}
|
|
42264
|
-
function closePicker() {
|
|
42265
|
-
internalOpen = false;
|
|
42266
|
-
onOpenChange?.(false);
|
|
42267
|
-
}
|
|
42268
|
-
function togglePicker() {
|
|
42269
|
-
if (isOpen()) {
|
|
42270
|
-
closePicker();
|
|
42271
|
-
} else {
|
|
42272
|
-
openPicker();
|
|
42273
|
-
}
|
|
42274
|
-
}
|
|
42275
|
-
function selectDate(date) {
|
|
42276
|
-
if (isDateDisabled(date)) return;
|
|
42277
|
-
const newDate = new Date(date);
|
|
42278
|
-
if (value) {
|
|
42279
|
-
newDate.setHours(value.getHours());
|
|
42280
|
-
newDate.setMinutes(value.getMinutes());
|
|
42281
|
-
}
|
|
42282
|
-
onChange?.(newDate);
|
|
42283
|
-
if (!showTime) {
|
|
42284
|
-
closePicker();
|
|
42285
|
-
}
|
|
42286
|
-
}
|
|
42287
|
-
function setHours(h5) {
|
|
42288
|
-
if (h5 < 0 || h5 > 23) return;
|
|
42289
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
42290
|
-
newDate.setHours(h5);
|
|
42291
|
-
onChange?.(newDate);
|
|
42292
|
-
}
|
|
42293
|
-
function setMinutes(m2) {
|
|
42294
|
-
if (m2 < 0 || m2 > 59) return;
|
|
42295
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
42296
|
-
newDate.setMinutes(m2);
|
|
42297
|
-
onChange?.(newDate);
|
|
42298
|
-
}
|
|
42299
|
-
function prevMonth() {
|
|
42300
|
-
currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1);
|
|
42301
|
-
}
|
|
42302
|
-
function nextMonth() {
|
|
42303
|
-
currentMonth = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1);
|
|
42304
|
-
}
|
|
42305
|
-
function setView(v2) {
|
|
42306
|
-
view = v2;
|
|
42307
|
-
}
|
|
42308
|
-
function formatDisplay() {
|
|
42309
|
-
return value ? formatDate(value, format, showTime) : placeholder;
|
|
42310
|
-
}
|
|
42311
|
-
const keyboardHandlers = {
|
|
42312
|
-
[Keys.Escape]: (e2) => {
|
|
42313
|
-
e2.preventDefault();
|
|
42314
|
-
closePicker();
|
|
42315
|
-
}
|
|
42316
|
-
};
|
|
42317
|
-
const triggerProps = {
|
|
42318
|
-
"aria-expanded": isOpen(),
|
|
42319
|
-
"aria-controls": dropdownId,
|
|
42320
|
-
"aria-haspopup": "dialog",
|
|
42321
|
-
id: triggerId,
|
|
42322
|
-
role: "combobox"
|
|
42323
|
-
};
|
|
42324
|
-
const dropdownProps = {
|
|
42325
|
-
role: "dialog",
|
|
42326
|
-
"aria-modal": true,
|
|
42327
|
-
"aria-labelledby": labelId,
|
|
42328
|
-
id: dropdownId
|
|
42329
|
-
};
|
|
42330
|
-
const gridProps = {
|
|
42331
|
-
role: "grid",
|
|
42332
|
-
"aria-labelledby": labelId,
|
|
42333
|
-
id: gridId
|
|
42334
|
-
};
|
|
42335
|
-
function getDayAriaProps(day) {
|
|
42336
|
-
return {
|
|
42337
|
-
role: "gridcell",
|
|
42338
|
-
"aria-selected": day.isSelected,
|
|
42339
|
-
"aria-disabled": day.isDisabled,
|
|
42340
|
-
"aria-current": day.isToday ? "date" : void 0,
|
|
42341
|
-
"aria-label": `${DAY_NAMES2[day.date.getDay()]}, ${day.date.toLocaleDateString("en-US", {
|
|
42342
|
-
month: "long",
|
|
42343
|
-
day: "numeric",
|
|
42344
|
-
year: "numeric"
|
|
42345
|
-
})}`
|
|
42346
|
-
};
|
|
42347
|
-
}
|
|
42348
|
-
return {
|
|
42349
|
-
state: {
|
|
42350
|
-
open: isOpen(),
|
|
42351
|
-
selectedDate: value,
|
|
42352
|
-
view,
|
|
42353
|
-
hours,
|
|
42354
|
-
minutes,
|
|
42355
|
-
currentMonth
|
|
42356
|
-
},
|
|
42357
|
-
days: buildDays(),
|
|
42358
|
-
openPicker,
|
|
42359
|
-
closePicker,
|
|
42360
|
-
togglePicker,
|
|
42361
|
-
selectDate,
|
|
42362
|
-
setHours,
|
|
42363
|
-
setMinutes,
|
|
42364
|
-
prevMonth,
|
|
42365
|
-
nextMonth,
|
|
42366
|
-
setView,
|
|
42367
|
-
formatDisplay,
|
|
42368
|
-
triggerProps,
|
|
42369
|
-
dropdownProps,
|
|
42370
|
-
gridProps,
|
|
42371
|
-
getDayAriaProps,
|
|
42372
|
-
keyboardHandlers,
|
|
42373
|
-
ids: {
|
|
42374
|
-
trigger: triggerId,
|
|
42375
|
-
dropdown: dropdownId,
|
|
42376
|
-
grid: gridId,
|
|
42377
|
-
label: labelId
|
|
42378
|
-
}
|
|
42379
|
-
};
|
|
42380
|
-
}
|
|
42381
42176
|
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";
|
|
42382
|
-
var
|
|
42383
|
-
|
|
42384
|
-
|
|
42385
|
-
|
|
42386
|
-
|
|
42387
|
-
|
|
42388
|
-
|
|
42389
|
-
|
|
42390
|
-
|
|
42391
|
-
|
|
42392
|
-
|
|
42393
|
-
|
|
42394
|
-
|
|
42395
|
-
state: "default"
|
|
42396
|
-
}
|
|
42397
|
-
});
|
|
42398
|
-
var datePickerTimeStyles = "flex items-center gap-2 mt-3 pt-3 border-t";
|
|
42399
|
-
var datePickerTimeInputStyles = "w-14 rounded-md border border-input bg-background px-2 py-1 text-sm text-center";
|
|
42400
|
-
|
|
42401
|
-
// ../react-date-picker/dist/index.js
|
|
42402
|
-
function DatePicker({
|
|
42403
|
-
value,
|
|
42404
|
-
onChange,
|
|
42405
|
-
minDate,
|
|
42406
|
-
maxDate,
|
|
42407
|
-
showTime = false,
|
|
42408
|
-
format,
|
|
42409
|
-
placeholder,
|
|
42410
|
-
className,
|
|
42411
|
-
disabled = false
|
|
42412
|
-
}) {
|
|
42413
|
-
const [open, setOpen] = React11__namespace.useState(false);
|
|
42414
|
-
const [currentMonth, setCurrentMonth] = React11__namespace.useState(
|
|
42415
|
-
() => value ? new Date(value.getFullYear(), value.getMonth(), 1) : new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)
|
|
42416
|
-
);
|
|
42417
|
-
const [view, setView] = React11__namespace.useState("calendar");
|
|
42418
|
-
const containerRef = React11__namespace.useRef(null);
|
|
42419
|
-
const api = React11__namespace.useMemo(
|
|
42420
|
-
() => createDatePicker({
|
|
42421
|
-
value,
|
|
42422
|
-
onChange,
|
|
42423
|
-
minDate,
|
|
42424
|
-
maxDate,
|
|
42425
|
-
showTime,
|
|
42426
|
-
format,
|
|
42427
|
-
placeholder,
|
|
42428
|
-
open,
|
|
42429
|
-
onOpenChange: setOpen
|
|
42430
|
-
}),
|
|
42431
|
-
[value, onChange, minDate, maxDate, showTime, format, placeholder, open]
|
|
42432
|
-
);
|
|
42433
|
-
React11__namespace.useMemo(() => {
|
|
42434
|
-
createDatePicker({
|
|
42435
|
-
value,
|
|
42436
|
-
minDate,
|
|
42437
|
-
maxDate,
|
|
42438
|
-
open: true
|
|
42439
|
-
});
|
|
42440
|
-
const tempApi = createDatePicker({
|
|
42441
|
-
value,
|
|
42442
|
-
minDate,
|
|
42443
|
-
maxDate,
|
|
42444
|
-
open: true
|
|
42445
|
-
});
|
|
42446
|
-
return tempApi.days;
|
|
42447
|
-
}, [value, minDate, maxDate, currentMonth]);
|
|
42448
|
-
React11__namespace.useEffect(() => {
|
|
42449
|
-
if (!open) return;
|
|
42450
|
-
function handleClick(e2) {
|
|
42451
|
-
if (containerRef.current && !containerRef.current.contains(e2.target)) {
|
|
42452
|
-
setOpen(false);
|
|
42453
|
-
}
|
|
42454
|
-
}
|
|
42455
|
-
document.addEventListener("mousedown", handleClick);
|
|
42456
|
-
return () => document.removeEventListener("mousedown", handleClick);
|
|
42457
|
-
}, [open]);
|
|
42458
|
-
React11__namespace.useEffect(() => {
|
|
42459
|
-
if (!open) return;
|
|
42460
|
-
function handleKeyDown(e2) {
|
|
42461
|
-
if (e2.key === "Escape") {
|
|
42462
|
-
e2.preventDefault();
|
|
42463
|
-
setOpen(false);
|
|
42177
|
+
var DatePicker = React11__namespace.forwardRef(
|
|
42178
|
+
({ value, onChange, minDate, maxDate, showTime = false, format, placeholder, className, disabled = false, ...props }, ref) => {
|
|
42179
|
+
const dateToString = (date) => {
|
|
42180
|
+
if (!date) return "";
|
|
42181
|
+
const offset = date.getTimezoneOffset() * 6e4;
|
|
42182
|
+
const localDate = new Date(date.getTime() - offset);
|
|
42183
|
+
const iso = localDate.toISOString();
|
|
42184
|
+
return showTime ? iso.slice(0, 16) : iso.slice(0, 10);
|
|
42185
|
+
};
|
|
42186
|
+
const handleChange = (e2) => {
|
|
42187
|
+
if (!onChange) return;
|
|
42188
|
+
if (e2.target.value) {
|
|
42189
|
+
onChange(new Date(e2.target.value));
|
|
42464
42190
|
}
|
|
42465
|
-
}
|
|
42466
|
-
|
|
42467
|
-
|
|
42468
|
-
}, [open]);
|
|
42469
|
-
const displayValue = api.formatDisplay();
|
|
42470
|
-
const handleSelectDate = (date) => {
|
|
42471
|
-
const newDate = new Date(date);
|
|
42472
|
-
if (value) {
|
|
42473
|
-
newDate.setHours(value.getHours());
|
|
42474
|
-
newDate.setMinutes(value.getMinutes());
|
|
42475
|
-
}
|
|
42476
|
-
onChange?.(newDate);
|
|
42477
|
-
if (!showTime) {
|
|
42478
|
-
setOpen(false);
|
|
42479
|
-
}
|
|
42480
|
-
};
|
|
42481
|
-
const handleHoursChange = (e2) => {
|
|
42482
|
-
const h5 = parseInt(e2.target.value, 10);
|
|
42483
|
-
if (isNaN(h5) || h5 < 0 || h5 > 23) return;
|
|
42484
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
42485
|
-
newDate.setHours(h5);
|
|
42486
|
-
onChange?.(newDate);
|
|
42487
|
-
};
|
|
42488
|
-
const handleMinutesChange = (e2) => {
|
|
42489
|
-
const m2 = parseInt(e2.target.value, 10);
|
|
42490
|
-
if (isNaN(m2) || m2 < 0 || m2 > 59) return;
|
|
42491
|
-
const newDate = value ? new Date(value) : /* @__PURE__ */ new Date();
|
|
42492
|
-
newDate.setMinutes(m2);
|
|
42493
|
-
onChange?.(newDate);
|
|
42494
|
-
};
|
|
42495
|
-
const monthLabel = currentMonth.toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
|
42496
|
-
return React11__namespace.createElement(
|
|
42497
|
-
"div",
|
|
42498
|
-
{ ref: containerRef, className: cn("relative inline-block", className) },
|
|
42499
|
-
React11__namespace.createElement(
|
|
42500
|
-
"button",
|
|
42501
|
-
{
|
|
42502
|
-
type: "button",
|
|
42503
|
-
className: cn(datePickerTriggerStyles, disabled && "opacity-50 cursor-not-allowed"),
|
|
42504
|
-
onClick: () => !disabled && setOpen(!open),
|
|
42505
|
-
"aria-expanded": open,
|
|
42506
|
-
"aria-haspopup": "dialog",
|
|
42507
|
-
disabled
|
|
42508
|
-
},
|
|
42509
|
-
displayValue
|
|
42510
|
-
),
|
|
42511
|
-
open && React11__namespace.createElement(
|
|
42512
|
-
"div",
|
|
42191
|
+
};
|
|
42192
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42193
|
+
"input",
|
|
42513
42194
|
{
|
|
42514
|
-
|
|
42515
|
-
|
|
42516
|
-
"
|
|
42517
|
-
|
|
42518
|
-
|
|
42519
|
-
|
|
42520
|
-
|
|
42521
|
-
|
|
42522
|
-
|
|
42523
|
-
|
|
42524
|
-
|
|
42525
|
-
|
|
42526
|
-
|
|
42527
|
-
|
|
42528
|
-
},
|
|
42529
|
-
"\u2039"
|
|
42530
|
-
),
|
|
42531
|
-
React11__namespace.createElement("span", { className: "text-sm font-medium" }, monthLabel),
|
|
42532
|
-
React11__namespace.createElement(
|
|
42533
|
-
"button",
|
|
42534
|
-
{
|
|
42535
|
-
type: "button",
|
|
42536
|
-
className: "p-1 hover:bg-accent rounded cursor-pointer",
|
|
42537
|
-
onClick: () => setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 1)),
|
|
42538
|
-
"aria-label": "Next month"
|
|
42539
|
-
},
|
|
42540
|
-
"\u203A"
|
|
42541
|
-
)
|
|
42542
|
-
),
|
|
42543
|
-
React11__namespace.createElement(
|
|
42544
|
-
"div",
|
|
42545
|
-
{ className: "grid grid-cols-7 gap-0 text-center", role: "grid" },
|
|
42546
|
-
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
42547
|
-
(d2) => React11__namespace.createElement("div", { key: d2, className: "text-xs text-muted-foreground py-1 font-medium" }, d2)
|
|
42548
|
-
),
|
|
42549
|
-
api.days.map((day, i2) => {
|
|
42550
|
-
let state = "default";
|
|
42551
|
-
if (day.isDisabled) state = "disabled";
|
|
42552
|
-
else if (day.isSelected) state = "selected";
|
|
42553
|
-
else if (day.isToday) state = "today";
|
|
42554
|
-
else if (!day.isCurrentMonth) state = "outside";
|
|
42555
|
-
return React11__namespace.createElement(
|
|
42556
|
-
"button",
|
|
42557
|
-
{
|
|
42558
|
-
key: i2,
|
|
42559
|
-
type: "button",
|
|
42560
|
-
className: datePickerDayVariants({ state }),
|
|
42561
|
-
onClick: () => !day.isDisabled && handleSelectDate(day.date),
|
|
42562
|
-
disabled: day.isDisabled,
|
|
42563
|
-
"aria-selected": day.isSelected,
|
|
42564
|
-
"aria-disabled": day.isDisabled
|
|
42565
|
-
},
|
|
42566
|
-
day.date.getDate()
|
|
42567
|
-
);
|
|
42568
|
-
})
|
|
42569
|
-
),
|
|
42570
|
-
showTime && React11__namespace.createElement(
|
|
42571
|
-
"div",
|
|
42572
|
-
{ className: datePickerTimeStyles },
|
|
42573
|
-
React11__namespace.createElement("span", { className: "text-sm text-muted-foreground" }, "Time:"),
|
|
42574
|
-
React11__namespace.createElement("input", {
|
|
42575
|
-
type: "number",
|
|
42576
|
-
min: 0,
|
|
42577
|
-
max: 23,
|
|
42578
|
-
value: value ? value.getHours() : 0,
|
|
42579
|
-
onChange: handleHoursChange,
|
|
42580
|
-
className: datePickerTimeInputStyles,
|
|
42581
|
-
"aria-label": "Hours"
|
|
42582
|
-
}),
|
|
42583
|
-
React11__namespace.createElement("span", { className: "text-muted-foreground" }, ":"),
|
|
42584
|
-
React11__namespace.createElement("input", {
|
|
42585
|
-
type: "number",
|
|
42586
|
-
min: 0,
|
|
42587
|
-
max: 59,
|
|
42588
|
-
value: value ? value.getMinutes() : 0,
|
|
42589
|
-
onChange: handleMinutesChange,
|
|
42590
|
-
className: datePickerTimeInputStyles,
|
|
42591
|
-
"aria-label": "Minutes"
|
|
42592
|
-
})
|
|
42593
|
-
)
|
|
42594
|
-
)
|
|
42595
|
-
);
|
|
42596
|
-
}
|
|
42195
|
+
ref,
|
|
42196
|
+
type: showTime ? "datetime-local" : "date",
|
|
42197
|
+
className: cn(datePickerTriggerStyles, "justify-start text-left font-normal w-[280px]", className),
|
|
42198
|
+
value: dateToString(value),
|
|
42199
|
+
min: dateToString(minDate),
|
|
42200
|
+
max: dateToString(maxDate),
|
|
42201
|
+
onChange: handleChange,
|
|
42202
|
+
disabled,
|
|
42203
|
+
placeholder,
|
|
42204
|
+
...props
|
|
42205
|
+
}
|
|
42206
|
+
);
|
|
42207
|
+
}
|
|
42208
|
+
);
|
|
42597
42209
|
DatePicker.displayName = "DatePicker";
|
|
42598
42210
|
|
|
42599
42211
|
// ../emoji-picker/dist/index.js
|