myoperator-mcp 0.2.382 → 0.2.383
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.js +136 -101
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3473,12 +3473,23 @@ import {
|
|
|
3473
3473
|
type Strategy,
|
|
3474
3474
|
} from "@floating-ui/react-dom";
|
|
3475
3475
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3476
|
-
import {
|
|
3476
|
+
import {
|
|
3477
|
+
ChevronDown,
|
|
3478
|
+
ChevronLeft,
|
|
3479
|
+
ChevronRight,
|
|
3480
|
+
Clock2,
|
|
3481
|
+
X,
|
|
3482
|
+
} from "lucide-react";
|
|
3477
3483
|
|
|
3478
3484
|
import { cn } from "@/lib/utils";
|
|
3479
3485
|
|
|
3480
3486
|
const DEFAULT_START_TIME = "10:30:00";
|
|
3481
|
-
|
|
3487
|
+
/**
|
|
3488
|
+
* What the time columns show while no time is selected. Clearing the value
|
|
3489
|
+
* returns the picker to this state, so an unset time always reads 12:00 AM
|
|
3490
|
+
* rather than re-proposing the sample default.
|
|
3491
|
+
*/
|
|
3492
|
+
const UNSET_TIME = "00:00:00";
|
|
3482
3493
|
const DEFAULT_MINUTE_STEP = 5;
|
|
3483
3494
|
const DEFAULT_SECOND_STEP = 5;
|
|
3484
3495
|
const TIME_COLUMN_MAX_HEIGHT = 168;
|
|
@@ -3553,8 +3564,10 @@ const dateTimePickerTriggerVariants = cva(
|
|
|
3553
3564
|
|
|
3554
3565
|
export interface DateTimePickerValue {
|
|
3555
3566
|
date?: Date;
|
|
3556
|
-
|
|
3557
|
-
|
|
3567
|
+
/** Undefined until a time is explicitly selected */
|
|
3568
|
+
startTime?: string;
|
|
3569
|
+
/** Undefined until a time is explicitly selected */
|
|
3570
|
+
endTime?: string;
|
|
3558
3571
|
}
|
|
3559
3572
|
|
|
3560
3573
|
export interface DateTimePickerProps
|
|
@@ -3608,8 +3621,8 @@ function normalizeValue(
|
|
|
3608
3621
|
): DateTimePickerValue {
|
|
3609
3622
|
return {
|
|
3610
3623
|
date: value?.date,
|
|
3611
|
-
startTime: value?.startTime
|
|
3612
|
-
endTime: value?.endTime
|
|
3624
|
+
startTime: value?.startTime,
|
|
3625
|
+
endTime: value?.endTime,
|
|
3613
3626
|
};
|
|
3614
3627
|
}
|
|
3615
3628
|
|
|
@@ -3886,7 +3899,6 @@ function formatValueForDisplay(
|
|
|
3886
3899
|
value: DateTimePickerValue,
|
|
3887
3900
|
variant: DateTimePickerVariant,
|
|
3888
3901
|
showEndTime: boolean,
|
|
3889
|
-
hasTimeValue: boolean,
|
|
3890
3902
|
showSeconds: boolean
|
|
3891
3903
|
) {
|
|
3892
3904
|
if (variant === "date-only") {
|
|
@@ -3894,14 +3906,21 @@ function formatValueForDisplay(
|
|
|
3894
3906
|
}
|
|
3895
3907
|
|
|
3896
3908
|
if (variant === "time-only") {
|
|
3897
|
-
if (!
|
|
3909
|
+
if (!value.startTime && !value.endTime) return "";
|
|
3898
3910
|
|
|
3899
3911
|
return showEndTime
|
|
3900
|
-
? \`\${formatTimeForDisplay(value.startTime, showSeconds)} - \${formatTimeForDisplay(value.endTime, showSeconds)}\`
|
|
3901
|
-
: formatTimeForDisplay(value.startTime, showSeconds);
|
|
3912
|
+
? \`\${formatTimeForDisplay(value.startTime ?? UNSET_TIME, showSeconds)} - \${formatTimeForDisplay(value.endTime ?? UNSET_TIME, showSeconds)}\`
|
|
3913
|
+
: formatTimeForDisplay(value.startTime ?? UNSET_TIME, showSeconds);
|
|
3902
3914
|
}
|
|
3903
3915
|
|
|
3904
|
-
|
|
3916
|
+
const datePart = formatDateOnlyForDisplay(value.date);
|
|
3917
|
+
const timePart = value.startTime
|
|
3918
|
+
? formatTimeForDisplay(value.startTime, showSeconds)
|
|
3919
|
+
: "";
|
|
3920
|
+
|
|
3921
|
+
if (!datePart && !timePart) return "";
|
|
3922
|
+
|
|
3923
|
+
return [datePart, timePart].filter(Boolean).join(" ");
|
|
3905
3924
|
}
|
|
3906
3925
|
|
|
3907
3926
|
function getDefaultPlaceholder(
|
|
@@ -4088,10 +4107,7 @@ function splitTypedDateInput(value: string) {
|
|
|
4088
4107
|
dateSource.split(/[/-]/);
|
|
4089
4108
|
const dayResult = consumeDigits(dayPart, 2);
|
|
4090
4109
|
const monthResult = consumeDigits(\`\${dayResult.rest}\${monthPart}\`, 2);
|
|
4091
|
-
const yearResult = consumeDigits(
|
|
4092
|
-
\`\${monthResult.rest}\${yearPart}\`,
|
|
4093
|
-
4
|
|
4094
|
-
);
|
|
4110
|
+
const yearResult = consumeDigits(\`\${monthResult.rest}\${yearPart}\`, 4);
|
|
4095
4111
|
const day = dayResult.digits;
|
|
4096
4112
|
const month = monthResult.digits;
|
|
4097
4113
|
const year = yearResult.digits;
|
|
@@ -4129,7 +4145,10 @@ function splitTypedDateInput(value: string) {
|
|
|
4129
4145
|
};
|
|
4130
4146
|
}
|
|
4131
4147
|
|
|
4132
|
-
function isPotentiallyValidTimeDigits(
|
|
4148
|
+
function isPotentiallyValidTimeDigits(
|
|
4149
|
+
timeDigits: string,
|
|
4150
|
+
showSeconds: boolean
|
|
4151
|
+
) {
|
|
4133
4152
|
const hourValue = timeDigits.slice(0, 2);
|
|
4134
4153
|
const minuteValue = timeDigits.slice(2, 4);
|
|
4135
4154
|
const secondValue = showSeconds ? timeDigits.slice(4, 6) : "";
|
|
@@ -4163,7 +4182,10 @@ function formatTimeInput(restValue: string, showSeconds: boolean) {
|
|
|
4163
4182
|
const meridiem = formatMeridiemInput(meridiemLetters.slice(0, 2));
|
|
4164
4183
|
|
|
4165
4184
|
if (!timeDigits && !meridiem) return "";
|
|
4166
|
-
if (
|
|
4185
|
+
if (
|
|
4186
|
+
!isPotentiallyValidTimeDigits(timeDigits, showSeconds) ||
|
|
4187
|
+
meridiem === null
|
|
4188
|
+
) {
|
|
4167
4189
|
return null;
|
|
4168
4190
|
}
|
|
4169
4191
|
|
|
@@ -4183,7 +4205,8 @@ function sanitizeTypedDateInput(value: string, previousValue: string) {
|
|
|
4183
4205
|
if (/^[A-Za-z]/.test(trimmedValue)) return previousValue;
|
|
4184
4206
|
|
|
4185
4207
|
const normalizedValue = value.toUpperCase().replace(/[^0-9\\s/-]/g, "");
|
|
4186
|
-
const { dateDigits, dateValue, isValid } =
|
|
4208
|
+
const { dateDigits, dateValue, isValid } =
|
|
4209
|
+
splitTypedDateInput(normalizedValue);
|
|
4187
4210
|
const limitedDateDigits = dateDigits.slice(0, 8);
|
|
4188
4211
|
|
|
4189
4212
|
if (!limitedDateDigits) return "";
|
|
@@ -4217,9 +4240,7 @@ function sanitizeTypedDateTimeInput(
|
|
|
4217
4240
|
const trimmedValue = value.trimStart();
|
|
4218
4241
|
if (/^[A-Za-z]/.test(trimmedValue)) return previousValue;
|
|
4219
4242
|
|
|
4220
|
-
const normalizedValue = value
|
|
4221
|
-
.toUpperCase()
|
|
4222
|
-
.replace(/[^0-9\\s/:APM-]/g, "");
|
|
4243
|
+
const normalizedValue = value.toUpperCase().replace(/[^0-9\\s/:APM-]/g, "");
|
|
4223
4244
|
const { dateDigits, dateValue, isComplete, isValid, restValue } =
|
|
4224
4245
|
splitTypedDateInput(normalizedValue);
|
|
4225
4246
|
const limitedDateDigits = dateDigits.slice(0, 8);
|
|
@@ -4227,7 +4248,9 @@ function sanitizeTypedDateTimeInput(
|
|
|
4227
4248
|
if (!limitedDateDigits) return "";
|
|
4228
4249
|
if (!isValid) return previousValue;
|
|
4229
4250
|
|
|
4230
|
-
const formattedTime = isComplete
|
|
4251
|
+
const formattedTime = isComplete
|
|
4252
|
+
? formatTimeInput(restValue, showSeconds)
|
|
4253
|
+
: "";
|
|
4231
4254
|
if (formattedTime === null) return previousValue;
|
|
4232
4255
|
|
|
4233
4256
|
return [dateValue, formattedTime].filter(Boolean).join(" ");
|
|
@@ -4303,7 +4326,11 @@ function stepDateTimeInputValue(
|
|
|
4303
4326
|
const [hourValue = "0", minuteValue = "0", secondValue = "00"] = (
|
|
4304
4327
|
typedDateTime.startTime ?? fallbackTime
|
|
4305
4328
|
).split(":");
|
|
4306
|
-
nextDate.setHours(
|
|
4329
|
+
nextDate.setHours(
|
|
4330
|
+
Number(hourValue),
|
|
4331
|
+
Number(minuteValue),
|
|
4332
|
+
Number(secondValue)
|
|
4333
|
+
);
|
|
4307
4334
|
|
|
4308
4335
|
if (segment === "day") {
|
|
4309
4336
|
nextDate.setDate(nextDate.getDate() + direction);
|
|
@@ -4347,10 +4374,7 @@ function stepDateTimeInputValue(
|
|
|
4347
4374
|
.padStart(2, "0")}:\${nextDate
|
|
4348
4375
|
.getMinutes()
|
|
4349
4376
|
.toString()
|
|
4350
|
-
.padStart(2, "0")}:\${nextDate
|
|
4351
|
-
.getSeconds()
|
|
4352
|
-
.toString()
|
|
4353
|
-
.padStart(2, "0")}\`;
|
|
4377
|
+
.padStart(2, "0")}:\${nextDate.getSeconds().toString().padStart(2, "0")}\`;
|
|
4354
4378
|
|
|
4355
4379
|
return {
|
|
4356
4380
|
date: startOfDay(nextDate),
|
|
@@ -4433,13 +4457,15 @@ function parseTypedDate(value: string) {
|
|
|
4433
4457
|
function formatHiddenValue(
|
|
4434
4458
|
value: DateTimePickerValue,
|
|
4435
4459
|
variant: DateTimePickerVariant,
|
|
4436
|
-
showEndTime: boolean
|
|
4437
|
-
hasTimeValue: boolean
|
|
4460
|
+
showEndTime: boolean
|
|
4438
4461
|
) {
|
|
4462
|
+
const startTime = value.startTime ?? UNSET_TIME;
|
|
4463
|
+
const endTime = value.endTime ?? UNSET_TIME;
|
|
4464
|
+
|
|
4439
4465
|
if (variant === "time-only") {
|
|
4440
|
-
if (!
|
|
4466
|
+
if (!value.startTime && !value.endTime) return "";
|
|
4441
4467
|
|
|
4442
|
-
return showEndTime ? \`\${
|
|
4468
|
+
return showEndTime ? \`\${startTime}/\${endTime}\` : startTime;
|
|
4443
4469
|
}
|
|
4444
4470
|
|
|
4445
4471
|
if (!value.date) return "";
|
|
@@ -4456,6 +4482,8 @@ function formatHiddenValue(
|
|
|
4456
4482
|
const day = value.date.getDate().toString().padStart(2, "0");
|
|
4457
4483
|
const year = value.date.getFullYear();
|
|
4458
4484
|
|
|
4485
|
+
if (!value.startTime) return \`\${year}-\${month}-\${day}\`;
|
|
4486
|
+
|
|
4459
4487
|
return \`\${year}-\${month}-\${day}T\${value.startTime}\`;
|
|
4460
4488
|
}
|
|
4461
4489
|
|
|
@@ -4479,6 +4507,26 @@ function FigmaCalendarIcon({ className }: { className?: string }) {
|
|
|
4479
4507
|
);
|
|
4480
4508
|
}
|
|
4481
4509
|
|
|
4510
|
+
function FigmaClockIcon({ className }: { className?: string }) {
|
|
4511
|
+
return (
|
|
4512
|
+
<svg
|
|
4513
|
+
viewBox="0 0 18 18"
|
|
4514
|
+
fill="none"
|
|
4515
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
4516
|
+
className={className}
|
|
4517
|
+
aria-hidden="true"
|
|
4518
|
+
>
|
|
4519
|
+
<path
|
|
4520
|
+
d="M9 4.5V9L11.25 11.25M15.75 9C15.75 12.7279 12.7279 15.75 9 15.75C5.27208 15.75 2.25 12.7279 2.25 9C2.25 5.27208 5.27208 2.25 9 2.25C12.7279 2.25 15.75 5.27208 15.75 9Z"
|
|
4521
|
+
stroke="currentColor"
|
|
4522
|
+
strokeWidth="1.5"
|
|
4523
|
+
strokeLinecap="round"
|
|
4524
|
+
strokeLinejoin="round"
|
|
4525
|
+
/>
|
|
4526
|
+
</svg>
|
|
4527
|
+
);
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4482
4530
|
function CalendarDropdown({
|
|
4483
4531
|
id,
|
|
4484
4532
|
label,
|
|
@@ -4775,7 +4823,9 @@ function TimeField({
|
|
|
4775
4823
|
ariaLabel={\`\${label} hours\`}
|
|
4776
4824
|
options={hourOptions}
|
|
4777
4825
|
onSelect={(key) =>
|
|
4778
|
-
onChange(
|
|
4826
|
+
onChange(
|
|
4827
|
+
composeTime(Number(key), minute, effectiveSecond, meridiem)
|
|
4828
|
+
)
|
|
4779
4829
|
}
|
|
4780
4830
|
/>
|
|
4781
4831
|
<TimeColumn
|
|
@@ -4783,7 +4833,9 @@ function TimeField({
|
|
|
4783
4833
|
ariaLabel={\`\${label} minutes\`}
|
|
4784
4834
|
options={minuteOptions}
|
|
4785
4835
|
onSelect={(key) =>
|
|
4786
|
-
onChange(
|
|
4836
|
+
onChange(
|
|
4837
|
+
composeTime(hour12, Number(key), effectiveSecond, meridiem)
|
|
4838
|
+
)
|
|
4787
4839
|
}
|
|
4788
4840
|
/>
|
|
4789
4841
|
{showSeconds && (
|
|
@@ -4861,22 +4913,19 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
4861
4913
|
const [internalValue, setInternalValue] = React.useState(() =>
|
|
4862
4914
|
normalizeValue(defaultValue)
|
|
4863
4915
|
);
|
|
4864
|
-
const [internalHasTimeValue, setInternalHasTimeValue] = React.useState(() =>
|
|
4865
|
-
Boolean(defaultValue?.date || defaultValue?.startTime || defaultValue?.endTime)
|
|
4866
|
-
);
|
|
4867
4916
|
const [internalOpen, setInternalOpen] = React.useState(defaultOpen);
|
|
4868
4917
|
const currentValue = normalizeValue(
|
|
4869
4918
|
isValueControlled ? value : internalValue
|
|
4870
4919
|
);
|
|
4871
|
-
const
|
|
4872
|
-
|
|
4873
|
-
: internalHasTimeValue;
|
|
4920
|
+
const resolvedStartTime = currentValue.startTime ?? UNSET_TIME;
|
|
4921
|
+
const resolvedEndTime = currentValue.endTime ?? UNSET_TIME;
|
|
4874
4922
|
const resolvedShowSeconds =
|
|
4875
4923
|
showSeconds ??
|
|
4876
4924
|
(timeHasVisibleSeconds(currentValue.startTime) ||
|
|
4877
4925
|
(resolvedShowEndTime && timeHasVisibleSeconds(currentValue.endTime)));
|
|
4878
4926
|
const placeholder =
|
|
4879
|
-
placeholderProp ??
|
|
4927
|
+
placeholderProp ??
|
|
4928
|
+
getDefaultPlaceholder(pickerVariant, resolvedShowSeconds);
|
|
4880
4929
|
const open = isOpenControlled ? controlledOpen : internalOpen;
|
|
4881
4930
|
const [visibleMonth, setVisibleMonth] = React.useState(() =>
|
|
4882
4931
|
startOfMonth(currentValue.date ?? new Date())
|
|
@@ -4886,7 +4935,6 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
4886
4935
|
currentValue,
|
|
4887
4936
|
pickerVariant,
|
|
4888
4937
|
resolvedShowEndTime,
|
|
4889
|
-
hasTimeValue,
|
|
4890
4938
|
resolvedShowSeconds
|
|
4891
4939
|
)
|
|
4892
4940
|
);
|
|
@@ -4918,7 +4966,10 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
4918
4966
|
const maxWidth = Math.min(MAX_POPOVER_WIDTH, availableWidth);
|
|
4919
4967
|
const width = Math.max(
|
|
4920
4968
|
1,
|
|
4921
|
-
Math.min(
|
|
4969
|
+
Math.min(
|
|
4970
|
+
Math.max(rects.reference.width, MIN_POPOVER_WIDTH),
|
|
4971
|
+
maxWidth
|
|
4972
|
+
)
|
|
4922
4973
|
);
|
|
4923
4974
|
elements.floating.style.setProperty(
|
|
4924
4975
|
POPOVER_SCROLL_HEIGHT_VAR,
|
|
@@ -4950,7 +5001,6 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
4950
5001
|
currentValue,
|
|
4951
5002
|
pickerVariant,
|
|
4952
5003
|
resolvedShowEndTime,
|
|
4953
|
-
hasTimeValue,
|
|
4954
5004
|
resolvedShowSeconds
|
|
4955
5005
|
);
|
|
4956
5006
|
const effectiveMinDate = React.useMemo(() => {
|
|
@@ -5041,15 +5091,9 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5041
5091
|
}, [open, setOpen]);
|
|
5042
5092
|
|
|
5043
5093
|
const updateValue = React.useCallback(
|
|
5044
|
-
(
|
|
5045
|
-
nextValue: DateTimePickerValue,
|
|
5046
|
-
options?: { hasTimeValue?: boolean }
|
|
5047
|
-
) => {
|
|
5094
|
+
(nextValue: DateTimePickerValue) => {
|
|
5048
5095
|
if (!isValueControlled) {
|
|
5049
5096
|
setInternalValue(nextValue);
|
|
5050
|
-
if (options?.hasTimeValue !== undefined) {
|
|
5051
|
-
setInternalHasTimeValue(options.hasTimeValue);
|
|
5052
|
-
}
|
|
5053
5097
|
}
|
|
5054
5098
|
|
|
5055
5099
|
onValueChange?.(nextValue);
|
|
@@ -5062,11 +5106,14 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5062
5106
|
if (readOnly) return;
|
|
5063
5107
|
|
|
5064
5108
|
setDateInputValue("");
|
|
5109
|
+
setOpenTimeField(null);
|
|
5110
|
+
setOpenCalendarDropdown(null);
|
|
5111
|
+
setVisibleMonth(startOfMonth(new Date()));
|
|
5065
5112
|
updateValue({
|
|
5066
5113
|
date: undefined,
|
|
5067
|
-
startTime:
|
|
5068
|
-
endTime:
|
|
5069
|
-
}
|
|
5114
|
+
startTime: undefined,
|
|
5115
|
+
endTime: undefined,
|
|
5116
|
+
});
|
|
5070
5117
|
};
|
|
5071
5118
|
|
|
5072
5119
|
const yearOptions = React.useMemo(
|
|
@@ -5125,13 +5172,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5125
5172
|
updateValue({ ...currentValue, date: nextSelectedDate });
|
|
5126
5173
|
}
|
|
5127
5174
|
},
|
|
5128
|
-
[
|
|
5129
|
-
currentValue,
|
|
5130
|
-
effectiveMinDate,
|
|
5131
|
-
maxDate,
|
|
5132
|
-
pickerVariant,
|
|
5133
|
-
updateValue,
|
|
5134
|
-
]
|
|
5175
|
+
[currentValue, effectiveMinDate, maxDate, pickerVariant, updateValue]
|
|
5135
5176
|
);
|
|
5136
5177
|
|
|
5137
5178
|
const handleTypedDateChange = (
|
|
@@ -5155,18 +5196,12 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5155
5196
|
|
|
5156
5197
|
const typedTime = parseTimePart(nextInputValue);
|
|
5157
5198
|
if (typedTime === undefined) {
|
|
5158
|
-
updateValue({ ...currentValue,
|
|
5199
|
+
updateValue({ ...currentValue, startTime: undefined });
|
|
5159
5200
|
return;
|
|
5160
5201
|
}
|
|
5161
5202
|
|
|
5162
5203
|
if (typedTime) {
|
|
5163
|
-
updateValue(
|
|
5164
|
-
{
|
|
5165
|
-
...currentValue,
|
|
5166
|
-
startTime: typedTime,
|
|
5167
|
-
},
|
|
5168
|
-
{ hasTimeValue: true }
|
|
5169
|
-
);
|
|
5204
|
+
updateValue({ ...currentValue, startTime: typedTime });
|
|
5170
5205
|
}
|
|
5171
5206
|
|
|
5172
5207
|
return;
|
|
@@ -5256,7 +5291,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5256
5291
|
dateInputValue,
|
|
5257
5292
|
cursorPosition,
|
|
5258
5293
|
direction,
|
|
5259
|
-
|
|
5294
|
+
resolvedStartTime,
|
|
5260
5295
|
resolvedShowSeconds
|
|
5261
5296
|
);
|
|
5262
5297
|
|
|
@@ -5308,7 +5343,6 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5308
5343
|
currentValue,
|
|
5309
5344
|
pickerVariant,
|
|
5310
5345
|
resolvedShowEndTime,
|
|
5311
|
-
hasTimeValue,
|
|
5312
5346
|
resolvedShowSeconds
|
|
5313
5347
|
)
|
|
5314
5348
|
);
|
|
@@ -5324,7 +5358,9 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5324
5358
|
ref={setPopoverRef}
|
|
5325
5359
|
role="dialog"
|
|
5326
5360
|
aria-modal="false"
|
|
5327
|
-
aria-labelledby={
|
|
5361
|
+
aria-labelledby={
|
|
5362
|
+
showCalendar ? \`\${triggerId}-calendar-heading\` : undefined
|
|
5363
|
+
}
|
|
5328
5364
|
aria-label={showCalendar ? undefined : "Time picker"}
|
|
5329
5365
|
className={cn(
|
|
5330
5366
|
"rounded-lg border border-solid border-semantic-border-layout bg-semantic-bg-primary shadow-lg flex flex-col min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain pointer-events-auto",
|
|
@@ -5414,11 +5450,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5414
5450
|
}))}
|
|
5415
5451
|
onValueChange={(nextYear) => {
|
|
5416
5452
|
syncCalendarMonthAndValue(
|
|
5417
|
-
new Date(
|
|
5418
|
-
Number(nextYear),
|
|
5419
|
-
visibleMonth.getMonth(),
|
|
5420
|
-
1
|
|
5421
|
-
)
|
|
5453
|
+
new Date(Number(nextYear), visibleMonth.getMonth(), 1)
|
|
5422
5454
|
);
|
|
5423
5455
|
}}
|
|
5424
5456
|
/>
|
|
@@ -5510,7 +5542,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5510
5542
|
<TimeField
|
|
5511
5543
|
id={\`\${triggerId}-start-time\`}
|
|
5512
5544
|
label={startTimeLabel}
|
|
5513
|
-
value={
|
|
5545
|
+
value={resolvedStartTime}
|
|
5514
5546
|
showSeconds={resolvedShowSeconds}
|
|
5515
5547
|
minuteStep={minuteStep}
|
|
5516
5548
|
secondStep={secondStep}
|
|
@@ -5521,10 +5553,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5521
5553
|
setOpenTimeField(nextOpen ? "start" : null)
|
|
5522
5554
|
}
|
|
5523
5555
|
onChange={(startTime) =>
|
|
5524
|
-
updateValue(
|
|
5525
|
-
{ ...currentValue, startTime },
|
|
5526
|
-
{ hasTimeValue: true }
|
|
5527
|
-
)
|
|
5556
|
+
updateValue({ ...currentValue, startTime })
|
|
5528
5557
|
}
|
|
5529
5558
|
/>
|
|
5530
5559
|
|
|
@@ -5532,7 +5561,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5532
5561
|
<TimeField
|
|
5533
5562
|
id={\`\${triggerId}-end-time\`}
|
|
5534
5563
|
label={endTimeLabel}
|
|
5535
|
-
value={
|
|
5564
|
+
value={resolvedEndTime}
|
|
5536
5565
|
showSeconds={resolvedShowSeconds}
|
|
5537
5566
|
minuteStep={minuteStep}
|
|
5538
5567
|
secondStep={secondStep}
|
|
@@ -5543,15 +5572,13 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5543
5572
|
setOpenTimeField(nextOpen ? "end" : null)
|
|
5544
5573
|
}
|
|
5545
5574
|
onChange={(endTime) =>
|
|
5546
|
-
updateValue(
|
|
5547
|
-
{ ...currentValue, endTime },
|
|
5548
|
-
{ hasTimeValue: true }
|
|
5549
|
-
)
|
|
5575
|
+
updateValue({ ...currentValue, endTime })
|
|
5550
5576
|
}
|
|
5551
5577
|
/>
|
|
5552
5578
|
)}
|
|
5553
5579
|
</div>
|
|
5554
5580
|
)}
|
|
5581
|
+
|
|
5555
5582
|
</div>,
|
|
5556
5583
|
portalMount
|
|
5557
5584
|
);
|
|
@@ -5578,8 +5605,7 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5578
5605
|
value={formatHiddenValue(
|
|
5579
5606
|
currentValue,
|
|
5580
5607
|
pickerVariant,
|
|
5581
|
-
resolvedShowEndTime
|
|
5582
|
-
hasTimeValue
|
|
5608
|
+
resolvedShowEndTime
|
|
5583
5609
|
)}
|
|
5584
5610
|
/>
|
|
5585
5611
|
)}
|
|
@@ -5635,16 +5661,19 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5635
5661
|
onKeyDown={handleTypedDateKeyDown}
|
|
5636
5662
|
onBlur={handleTypedDateBlur}
|
|
5637
5663
|
/>
|
|
5638
|
-
{showClear &&
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5664
|
+
{showClear &&
|
|
5665
|
+
(displayValue || dateInputValue) &&
|
|
5666
|
+
!disabled &&
|
|
5667
|
+
!readOnly && (
|
|
5668
|
+
<button
|
|
5669
|
+
type="button"
|
|
5670
|
+
aria-label="Clear date"
|
|
5671
|
+
className="inline-flex size-5 items-center justify-center rounded text-semantic-text-muted hover:bg-semantic-bg-hover hover:text-semantic-text-primary"
|
|
5672
|
+
onClick={clearValue}
|
|
5673
|
+
>
|
|
5674
|
+
<X className="size-4" aria-hidden="true" />
|
|
5675
|
+
</button>
|
|
5676
|
+
)}
|
|
5648
5677
|
<button
|
|
5649
5678
|
type="button"
|
|
5650
5679
|
disabled={disabled || readOnly}
|
|
@@ -5652,9 +5681,15 @@ const DateTimePicker = React.forwardRef<HTMLDivElement, DateTimePickerProps>(
|
|
|
5652
5681
|
className="inline-flex shrink-0 items-center justify-center rounded text-semantic-text-muted hover:bg-semantic-bg-hover hover:text-semantic-text-primary disabled:cursor-not-allowed"
|
|
5653
5682
|
onClick={() => setOpen(!open)}
|
|
5654
5683
|
>
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5684
|
+
{showCalendar ? (
|
|
5685
|
+
<FigmaCalendarIcon
|
|
5686
|
+
className={cn(size === "sm" ? "size-4" : "size-[18px]")}
|
|
5687
|
+
/>
|
|
5688
|
+
) : (
|
|
5689
|
+
<FigmaClockIcon
|
|
5690
|
+
className={cn(size === "sm" ? "size-4" : "size-[18px]")}
|
|
5691
|
+
/>
|
|
5692
|
+
)}
|
|
5658
5693
|
</button>
|
|
5659
5694
|
</div>
|
|
5660
5695
|
|
package/package.json
CHANGED