sherick-ui 2.4.0 → 2.5.0
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/README.md +2 -0
- package/dist/cjs/components/DatePicker.cjs +1 -1
- package/dist/cjs/components/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/DateRangePicker.cjs +1 -1
- package/dist/cjs/components/DateRangePicker.cjs.map +1 -1
- package/dist/cjs/components/DateTimePicker.cjs +176 -0
- package/dist/cjs/components/DateTimePicker.cjs.map +1 -0
- package/dist/cjs/components/date-family.cjs +64 -2
- package/dist/cjs/components/date-family.cjs.map +1 -1
- package/dist/cjs/components/date-field.cjs +14 -4
- package/dist/cjs/components/date-field.cjs.map +1 -1
- package/dist/cjs/components/time-panel.cjs +125 -0
- package/dist/cjs/components/time-panel.cjs.map +1 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/components/DatePicker.js +2 -2
- package/dist/esm/components/DatePicker.js.map +1 -1
- package/dist/esm/components/DateRangePicker.js +2 -2
- package/dist/esm/components/DateRangePicker.js.map +1 -1
- package/dist/esm/components/DateTimePicker.js +172 -0
- package/dist/esm/components/DateTimePicker.js.map +1 -0
- package/dist/esm/components/date-family.js +58 -3
- package/dist/esm/components/date-family.js.map +1 -1
- package/dist/esm/components/date-field.js +14 -5
- package/dist/esm/components/date-field.js.map +1 -1
- package/dist/esm/components/time-panel.js +122 -0
- package/dist/esm/components/time-panel.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/styles.css +58 -0
- package/dist/types/index.d.cts +75 -2
- package/dist/types/index.d.ts +75 -2
- package/package.json +1 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var field = require('@base-ui/react/field');
|
|
8
|
+
var popover = require('@base-ui/react/popover');
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var utils = require('../libs/utils.cjs');
|
|
12
|
+
var Button = require('./Button.cjs');
|
|
13
|
+
var Calendar = require('./Calendar.cjs');
|
|
14
|
+
var Field = require('./Field.cjs');
|
|
15
|
+
var ui_common = require('./ui.common.cjs');
|
|
16
|
+
var dateField = require('./date-field.cjs');
|
|
17
|
+
var dateFamily = require('./date-family.cjs');
|
|
18
|
+
var timePanel = require('./time-panel.cjs');
|
|
19
|
+
|
|
20
|
+
const defaultDateTimeLabels = {
|
|
21
|
+
...dateFamily.defaultCalendarLabels,
|
|
22
|
+
time: "Time",
|
|
23
|
+
hour: "Hour",
|
|
24
|
+
minute: "Minute",
|
|
25
|
+
period: "AM/PM",
|
|
26
|
+
chooseTime: "Choose a time",
|
|
27
|
+
done: "Done",
|
|
28
|
+
unavailableDateTime: "That date and time is not available",
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A date and a time of day: a native `datetime-local` input, with a named control beside it that
|
|
32
|
+
* opens the shared `Calendar` and a column for each part of the clock in a popover.
|
|
33
|
+
*
|
|
34
|
+
* The native input stays the field's control, so the browser owns its entry, its mobile UI, its
|
|
35
|
+
* form submission and the `required` and `min`/`max` constraints; `isDateUnavailable` is reported
|
|
36
|
+
* through the field's own validation, and a value the popup would refuse is never accepted — the
|
|
37
|
+
* input keeps what was typed and the field says why. In the popup, a half-chosen value waits for
|
|
38
|
+
* its other half, a choice that crosses a bound settles on the bound, and Done closes the surface.
|
|
39
|
+
*
|
|
40
|
+
* Values are civil `YYYY-MM-DDTHH:mm` readings with no time zone, exactly as the native input
|
|
41
|
+
* submits them.
|
|
42
|
+
*/
|
|
43
|
+
const DateTimePicker = React.forwardRef(({ value, defaultValue, onValueChange, label, description, error, required = false, disabled = false, className, id, form, name, open, defaultOpen, onOpenChange, min, max, isDateUnavailable, minuteStep = 5, hourCycle, locale = "en-US", weekStartsOn = 1, today, labels: labelsProp, }, ref) => {
|
|
44
|
+
var _a, _b;
|
|
45
|
+
const labels = React.useMemo(() => ({ ...defaultDateTimeLabels, ...labelsProp }), [labelsProp]);
|
|
46
|
+
const timeFormat = React.useMemo(() => dateFamily.createTimeFormat(locale, hourCycle !== null && hourCycle !== void 0 ? hourCycle : dateFamily.resolveHourCycle(locale)), [locale, hourCycle]);
|
|
47
|
+
const step = Number.isFinite(minuteStep) ? Math.min(60, Math.max(1, Math.round(minuteStep))) : 5;
|
|
48
|
+
const isControlled = value !== undefined;
|
|
49
|
+
const [internalValue, setInternalValue] = React.useState(() => dateFamily.normalizeCalendarDateTime(defaultValue));
|
|
50
|
+
const currentValue = isControlled ? dateFamily.normalizeCalendarDateTime(value) : internalValue;
|
|
51
|
+
// Invalid native entry is an explicit draft, not a second writer of a valid controlled value.
|
|
52
|
+
const [draft, setDraft] = React.useState(null);
|
|
53
|
+
const [pending, setPending] = React.useState(null);
|
|
54
|
+
const minValue = dateFamily.normalizeCalendarDateTime(min);
|
|
55
|
+
const maxValue = dateFamily.normalizeCalendarDateTime(max);
|
|
56
|
+
const minParts = dateFamily.parseCalendarDateTime(minValue);
|
|
57
|
+
const maxParts = dateFamily.parseCalendarDateTime(maxValue);
|
|
58
|
+
const inputRef = React.useRef(null);
|
|
59
|
+
const fieldActionsRef = React.useRef(null);
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
setDraft(null);
|
|
62
|
+
setPending(null);
|
|
63
|
+
}, [currentValue]);
|
|
64
|
+
dateField.useDateFormReset(inputRef, form, () => {
|
|
65
|
+
const restored = isControlled ? currentValue : dateFamily.normalizeCalendarDateTime(defaultValue);
|
|
66
|
+
setDraft(null);
|
|
67
|
+
setPending(null);
|
|
68
|
+
if (!isControlled)
|
|
69
|
+
setInternalValue(restored);
|
|
70
|
+
// Native reset has already run and emits no React change event.
|
|
71
|
+
if (inputRef.current)
|
|
72
|
+
inputRef.current.value = restored !== null && restored !== void 0 ? restored : "";
|
|
73
|
+
});
|
|
74
|
+
const commitValue = (next) => {
|
|
75
|
+
if (!isControlled)
|
|
76
|
+
setInternalValue(next);
|
|
77
|
+
onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(next);
|
|
78
|
+
};
|
|
79
|
+
const isSelectable = (candidate) => {
|
|
80
|
+
if (minValue && candidate < minValue)
|
|
81
|
+
return false;
|
|
82
|
+
if (maxValue && candidate > maxValue)
|
|
83
|
+
return false;
|
|
84
|
+
const parts = dateFamily.parseCalendarDateTime(candidate);
|
|
85
|
+
return Boolean(parts) && !(isDateUnavailable === null || isDateUnavailable === void 0 ? void 0 : isDateUnavailable(parts.date));
|
|
86
|
+
};
|
|
87
|
+
const displayText = (_a = draft !== null && draft !== void 0 ? draft : currentValue) !== null && _a !== void 0 ? _a : "";
|
|
88
|
+
const displayedValue = dateFamily.normalizeCalendarDateTime(displayText);
|
|
89
|
+
const typedIssue = draft !== null || Boolean(displayText && (!displayedValue || !isSelectable(displayedValue)));
|
|
90
|
+
const fieldInvalid = Boolean(error) || typedIssue;
|
|
91
|
+
const validateValue = (candidate) => {
|
|
92
|
+
if (draft !== null)
|
|
93
|
+
return labels.unavailableDateTime;
|
|
94
|
+
if (typeof candidate !== "string" || !candidate)
|
|
95
|
+
return null;
|
|
96
|
+
const parts = dateFamily.parseCalendarDateTime(candidate);
|
|
97
|
+
return !parts || (isDateUnavailable === null || isDateUnavailable === void 0 ? void 0 : isDateUnavailable(parts.date)) ? labels.unavailableDateTime : null;
|
|
98
|
+
};
|
|
99
|
+
// Constraints can change while the native text stays the same. Base remains the
|
|
100
|
+
// validation owner; refresh its native custom validity as well as the field's visuals.
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
var _a;
|
|
103
|
+
(_a = fieldActionsRef.current) === null || _a === void 0 ? void 0 : _a.validate();
|
|
104
|
+
}, [displayText, typedIssue, minValue, maxValue, isDateUnavailable, disabled, labels.unavailableDateTime]);
|
|
105
|
+
const handleInputChange = (event) => {
|
|
106
|
+
const input = event.currentTarget;
|
|
107
|
+
const next = dateFamily.normalizeCalendarDateTime(input.value);
|
|
108
|
+
if (input.validity.badInput || (input.value && (!next || !isSelectable(next)))) {
|
|
109
|
+
setDraft(input.value);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
setDraft(null);
|
|
113
|
+
setPending(null);
|
|
114
|
+
commitValue(next);
|
|
115
|
+
};
|
|
116
|
+
const boundsOn = (date) => ({
|
|
117
|
+
min: minParts && date === minParts.date ? dateFamily.minuteOfDay(minParts.time) : null,
|
|
118
|
+
max: maxParts && date === maxParts.date ? dateFamily.minuteOfDay(maxParts.time) : null,
|
|
119
|
+
});
|
|
120
|
+
/* Whether any reading on a day is acceptable: the calendar's own rule, and a day whose bounds
|
|
121
|
+
leave room between them. */
|
|
122
|
+
const dayIsAcceptable = (date) => {
|
|
123
|
+
if (minParts && date < minParts.date)
|
|
124
|
+
return false;
|
|
125
|
+
if (maxParts && date > maxParts.date)
|
|
126
|
+
return false;
|
|
127
|
+
if (isDateUnavailable === null || isDateUnavailable === void 0 ? void 0 : isDateUnavailable(date))
|
|
128
|
+
return false;
|
|
129
|
+
const bounds = boundsOn(date);
|
|
130
|
+
return bounds.min === null || bounds.max === null || bounds.min <= bounds.max;
|
|
131
|
+
};
|
|
132
|
+
/* The popup works on the committed value, or on a half-chosen one waiting for its other half. A
|
|
133
|
+
held day the constraints refuse — a value from before they changed, or one the application
|
|
134
|
+
passed in — anchors nothing: the calendar shows no selection, and a reading waits for a day. */
|
|
135
|
+
const committed = dateFamily.parseCalendarDateTime(currentValue);
|
|
136
|
+
const held = pending !== null && pending !== void 0 ? pending : {
|
|
137
|
+
date: (_b = committed === null || committed === void 0 ? void 0 : committed.date) !== null && _b !== void 0 ? _b : null,
|
|
138
|
+
time: committed ? { ...committed.time, afternoon: committed.time.hour >= 12 } : timePanel.emptyTime,
|
|
139
|
+
};
|
|
140
|
+
const selection = { ...held, date: held.date && dayIsAcceptable(held.date) ? held.date : null };
|
|
141
|
+
const choose = (next) => {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
if (disabled)
|
|
144
|
+
return;
|
|
145
|
+
setDraft(null);
|
|
146
|
+
const { date, time } = next;
|
|
147
|
+
if (!date || time.hour === null || time.minute === null) {
|
|
148
|
+
setPending(next);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
/* A day with a bound on it can make the held reading unacceptable; it settles on the bound. */
|
|
152
|
+
const bounds = boundsOn(date);
|
|
153
|
+
const reading = dateFamily.minuteOfDay({ hour: time.hour, minute: time.minute });
|
|
154
|
+
const minutes = Math.min((_a = bounds.max) !== null && _a !== void 0 ? _a : Infinity, Math.max((_b = bounds.min) !== null && _b !== void 0 ? _b : -Infinity, reading));
|
|
155
|
+
const candidate = dateFamily.toCalendarDateTime(date, dateFamily.timeFromMinuteOfDay(minutes));
|
|
156
|
+
/* The popup never commits what the field would refuse. */
|
|
157
|
+
if (!isSelectable(candidate)) {
|
|
158
|
+
setPending({ date: null, time });
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
setPending(null);
|
|
162
|
+
commitValue(candidate);
|
|
163
|
+
};
|
|
164
|
+
const dayBounds = boundsOn(selection.date);
|
|
165
|
+
return (jsxRuntime.jsxs(popover.Popover.Root, { open: open, defaultOpen: defaultOpen, onOpenChange: onOpenChange,
|
|
166
|
+
/* Non-modal: the field, the page and the browser's own entry all stay reachable while the
|
|
167
|
+
popup is open. */
|
|
168
|
+
modal: false, children: [jsxRuntime.jsx(Field.Field, { label: label, description: description, error: error || (typedIssue ? labels.unavailableDateTime : undefined), required: required, disabled: disabled, invalid: typedIssue, validate: validateValue, validationMode: "onChange", actionsRef: fieldActionsRef, className: utils.cn(disabled && ui_common.state.disabled, className), children: jsxRuntime.jsxs("div", { "data-disabled": disabled || undefined, "data-invalid": fieldInvalid || undefined, className: utils.cn(dateField.dateFieldRowClassName(disabled)), children: [jsxRuntime.jsx("div", { dir: dateField.dateInputDirection, className: utils.cn("min-w-0 flex-1 overflow-hidden"), children: jsxRuntime.jsx(field.Field.Control, { ref: ref, render: jsxRuntime.jsx("input", { type: "datetime-local", ref: inputRef }), id: id, name: name, form: form, required: required, disabled: disabled, min: minValue !== null && minValue !== void 0 ? minValue : undefined, max: maxValue !== null && maxValue !== void 0 ? maxValue : undefined, value: displayText, onChange: handleInputChange, className: utils.cn(dateField.dateInputClassName) }) }), jsxRuntime.jsx(dateField.DateFieldTrigger, { label: `Open ${label}`, disabled: disabled, icon: jsxRuntime.jsx(lucideReact.CalendarClock, { "aria-hidden": "true" }) })] }) }), jsxRuntime.jsx(dateField.DateCalendarPopup, { title: label, anchor: () => { var _a, _b, _c; return (_c = (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) !== null && _c !== void 0 ? _c : null; }, className: utils.cn("max-w-[min(34rem,var(--available-width))]"), children: jsxRuntime.jsxs("div", { className: utils.cn("flex flex-col sm:grid sm:grid-cols-[auto_auto]"), children: [jsxRuntime.jsx(Calendar.default, { mode: "single", value: selection.date, onValueChange: (date) => {
|
|
169
|
+
if (date)
|
|
170
|
+
choose({ date, time: selection.time });
|
|
171
|
+
}, disabled: disabled, min: minParts === null || minParts === void 0 ? void 0 : minParts.date, max: maxParts === null || maxParts === void 0 ? void 0 : maxParts.date, isDateUnavailable: isDateUnavailable, locale: locale, weekStartsOn: weekStartsOn, today: today, labels: labelsProp, className: utils.cn("shrink-0") }), jsxRuntime.jsx(timePanel.TimePanel, { time: selection.time, onTimeChange: (time) => choose({ date: selection.date, time }), minMinute: dayBounds.min, maxMinute: dayBounds.max, format: timeFormat, minuteStep: step, labels: labels, disabled: disabled, className: utils.cn("mt-3 border-t pt-3 sm:ms-3 sm:mt-0 sm:h-0 sm:min-h-full sm:border-s sm:border-t-0 sm:ps-3 sm:pt-0", ui_common.edge.rule, disabled && ui_common.state.disabled), footer: jsxRuntime.jsx(popover.Popover.Close, { disabled: disabled, render: (props) => (jsxRuntime.jsx(Button.default, { ...props, size: "sm", disabled: disabled, children: labels.done })) }) })] }) })] }));
|
|
172
|
+
});
|
|
173
|
+
DateTimePicker.displayName = "DateTimePicker";
|
|
174
|
+
|
|
175
|
+
exports.default = DateTimePicker;
|
|
176
|
+
//# sourceMappingURL=DateTimePicker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateTimePicker.cjs","sources":["../../../src/components/DateTimePicker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { CalendarClock } from \"lucide-react\";\nimport React, {\n forwardRef,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"@/libs/utils\";\nimport Button from \"./Button\";\nimport Calendar from \"./Calendar\";\nimport Field from \"./Field\";\nimport { edge, state } from \"./ui.common\";\nimport {\n DateCalendarPopup,\n DateFieldTrigger,\n dateFieldRowClassName,\n dateInputClassName,\n dateInputDirection,\n useDateFormReset,\n} from \"./date-field\";\nimport {\n createTimeFormat,\n defaultCalendarLabels,\n minuteOfDay,\n normalizeCalendarDateTime,\n parseCalendarDateTime,\n resolveHourCycle,\n timeFromMinuteOfDay,\n toCalendarDateTime,\n type CalendarDate,\n type CalendarDateTime,\n type CalendarLabels,\n} from \"./date-family\";\nimport { TimePanel, emptyTime, type PartialTime, type TimePanelLabels } from \"./time-panel\";\n\nexport type { CalendarDateTime } from \"./date-family\";\n\nexport interface DateTimePickerLabels extends CalendarLabels, TimePanelLabels {\n /** The action that closes the popup. */\n done: string;\n /** Reported when the entered date and time cannot be accepted. */\n unavailableDateTime: string;\n}\n\nconst defaultDateTimeLabels: DateTimePickerLabels = {\n ...defaultCalendarLabels,\n time: \"Time\",\n hour: \"Hour\",\n minute: \"Minute\",\n period: \"AM/PM\",\n chooseTime: \"Choose a time\",\n done: \"Done\",\n unavailableDateTime: \"That date and time is not available\",\n};\n\nexport interface DateTimePickerProps {\n /** The selected date and time, `YYYY-MM-DDTHH:mm`, or `null` for none. Undefined makes the picker\n * uncontrolled. */\n value?: CalendarDateTime | null;\n defaultValue?: CalendarDateTime | null;\n /** Receives the next date and time, or `null` when the field is cleared. */\n onValueChange?: (value: CalendarDateTime | null) => void;\n /** The field's label. It names the native field, its control and the popup. */\n label: string;\n description?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n disabled?: boolean;\n /** Styles the field's own column. */\n className?: string;\n id?: string;\n /** The form that owns the field, when it renders outside it. */\n form?: string;\n /** Identifies the field when it is submitted. */\n name?: string;\n open?: boolean;\n defaultOpen?: boolean;\n /** Base's own open-change callback, event details included. */\n onOpenChange?: BasePopover.Root.Props[\"onOpenChange\"];\n /** The earliest acceptable date and time, inclusive. */\n min?: CalendarDateTime;\n /** The latest acceptable date and time, inclusive. */\n max?: CalendarDateTime;\n /** Whether a date cannot be chosen at any time. Unavailable dates stay visible and are never selected. */\n isDateUnavailable?: (date: CalendarDate) => boolean;\n /** The interval, in minutes, between the minutes the popup offers. Typed entry stays\n * minute-precise. Defaults to 5. */\n minuteStep?: number;\n /** Shows a twelve-hour clock with a day period, or a twenty-four-hour clock. Defaults to the\n * locale's own. */\n hourCycle?: 12 | 24;\n locale?: string;\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n today?: CalendarDate;\n labels?: Partial<DateTimePickerLabels>;\n}\n\n/* What the popup holds while it is being used. A date chosen before a time — or a time before a\n date — waits here rather than being committed with an invented other half. */\ninterface Selection {\n date: CalendarDate | null;\n time: PartialTime;\n}\n\n/**\n * A date and a time of day: a native `datetime-local` input, with a named control beside it that\n * opens the shared `Calendar` and a column for each part of the clock in a popover.\n *\n * The native input stays the field's control, so the browser owns its entry, its mobile UI, its\n * form submission and the `required` and `min`/`max` constraints; `isDateUnavailable` is reported\n * through the field's own validation, and a value the popup would refuse is never accepted — the\n * input keeps what was typed and the field says why. In the popup, a half-chosen value waits for\n * its other half, a choice that crosses a bound settles on the bound, and Done closes the surface.\n *\n * Values are civil `YYYY-MM-DDTHH:mm` readings with no time zone, exactly as the native input\n * submits them.\n */\nconst DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(({\n value,\n defaultValue,\n onValueChange,\n label,\n description,\n error,\n required = false,\n disabled = false,\n className,\n id,\n form,\n name,\n open,\n defaultOpen,\n onOpenChange,\n min,\n max,\n isDateUnavailable,\n minuteStep = 5,\n hourCycle,\n locale = \"en-US\",\n weekStartsOn = 1,\n today,\n labels: labelsProp,\n}, ref) => {\n const labels = useMemo(() => ({ ...defaultDateTimeLabels, ...labelsProp }), [labelsProp]);\n const timeFormat = useMemo(\n () => createTimeFormat(locale, hourCycle ?? resolveHourCycle(locale)),\n [locale, hourCycle]\n );\n const step = Number.isFinite(minuteStep) ? Math.min(60, Math.max(1, Math.round(minuteStep))) : 5;\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<CalendarDateTime | null>(() =>\n normalizeCalendarDateTime(defaultValue)\n );\n const currentValue = isControlled ? normalizeCalendarDateTime(value) : internalValue;\n // Invalid native entry is an explicit draft, not a second writer of a valid controlled value.\n const [draft, setDraft] = useState<string | null>(null);\n const [pending, setPending] = useState<Selection | null>(null);\n const minValue = normalizeCalendarDateTime(min);\n const maxValue = normalizeCalendarDateTime(max);\n const minParts = parseCalendarDateTime(minValue);\n const maxParts = parseCalendarDateTime(maxValue);\n const inputRef = useRef<HTMLInputElement | null>(null);\n const fieldActionsRef = useRef<BaseField.Root.Actions | null>(null);\n\n useEffect(() => {\n setDraft(null);\n setPending(null);\n }, [currentValue]);\n useDateFormReset(inputRef, form, () => {\n const restored = isControlled ? currentValue : normalizeCalendarDateTime(defaultValue);\n setDraft(null);\n setPending(null);\n if (!isControlled) setInternalValue(restored);\n // Native reset has already run and emits no React change event.\n if (inputRef.current) inputRef.current.value = restored ?? \"\";\n });\n\n const commitValue = (next: CalendarDateTime | null) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n };\n\n const isSelectable = (candidate: CalendarDateTime) => {\n if (minValue && candidate < minValue) return false;\n if (maxValue && candidate > maxValue) return false;\n const parts = parseCalendarDateTime(candidate);\n return Boolean(parts) && !isDateUnavailable?.(parts!.date);\n };\n\n const displayText = draft ?? currentValue ?? \"\";\n const displayedValue = normalizeCalendarDateTime(displayText);\n const typedIssue = draft !== null || Boolean(\n displayText && (!displayedValue || !isSelectable(displayedValue))\n );\n const fieldInvalid = Boolean(error) || typedIssue;\n const validateValue = (candidate: unknown) => {\n if (draft !== null) return labels.unavailableDateTime;\n if (typeof candidate !== \"string\" || !candidate) return null;\n const parts = parseCalendarDateTime(candidate);\n return !parts || isDateUnavailable?.(parts.date) ? labels.unavailableDateTime : null;\n };\n\n // Constraints can change while the native text stays the same. Base remains the\n // validation owner; refresh its native custom validity as well as the field's visuals.\n useEffect(() => {\n fieldActionsRef.current?.validate();\n }, [displayText, typedIssue, minValue, maxValue, isDateUnavailable, disabled, labels.unavailableDateTime]);\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n const next = normalizeCalendarDateTime(input.value);\n if (input.validity.badInput || (input.value && (!next || !isSelectable(next)))) {\n setDraft(input.value);\n return;\n }\n setDraft(null);\n setPending(null);\n commitValue(next);\n };\n\n const boundsOn = (date: CalendarDate | null) => ({\n min: minParts && date === minParts.date ? minuteOfDay(minParts.time) : null,\n max: maxParts && date === maxParts.date ? minuteOfDay(maxParts.time) : null,\n });\n\n /* Whether any reading on a day is acceptable: the calendar's own rule, and a day whose bounds\n leave room between them. */\n const dayIsAcceptable = (date: CalendarDate) => {\n if (minParts && date < minParts.date) return false;\n if (maxParts && date > maxParts.date) return false;\n if (isDateUnavailable?.(date)) return false;\n const bounds = boundsOn(date);\n return bounds.min === null || bounds.max === null || bounds.min <= bounds.max;\n };\n\n /* The popup works on the committed value, or on a half-chosen one waiting for its other half. A\n held day the constraints refuse — a value from before they changed, or one the application\n passed in — anchors nothing: the calendar shows no selection, and a reading waits for a day. */\n const committed = parseCalendarDateTime(currentValue);\n const held: Selection = pending ?? {\n date: committed?.date ?? null,\n time: committed ? { ...committed.time, afternoon: committed.time.hour >= 12 } : emptyTime,\n };\n const selection: Selection = { ...held, date: held.date && dayIsAcceptable(held.date) ? held.date : null };\n\n const choose = (next: Selection) => {\n if (disabled) return;\n setDraft(null);\n const { date, time } = next;\n if (!date || time.hour === null || time.minute === null) {\n setPending(next);\n return;\n }\n /* A day with a bound on it can make the held reading unacceptable; it settles on the bound. */\n const bounds = boundsOn(date);\n const reading = minuteOfDay({ hour: time.hour, minute: time.minute });\n const minutes = Math.min(bounds.max ?? Infinity, Math.max(bounds.min ?? -Infinity, reading));\n const candidate = toCalendarDateTime(date, timeFromMinuteOfDay(minutes));\n /* The popup never commits what the field would refuse. */\n if (!isSelectable(candidate)) {\n setPending({ date: null, time });\n return;\n }\n setPending(null);\n commitValue(candidate);\n };\n\n const dayBounds = boundsOn(selection.date);\n\n return (\n <BasePopover.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n /* Non-modal: the field, the page and the browser's own entry all stay reachable while the\n popup is open. */\n modal={false}\n >\n <Field\n label={label}\n description={description}\n error={error || (typedIssue ? labels.unavailableDateTime : undefined)}\n required={required}\n disabled={disabled}\n invalid={typedIssue}\n validate={validateValue}\n validationMode=\"onChange\"\n actionsRef={fieldActionsRef}\n className={cn(disabled && state.disabled, className)}\n >\n <div\n data-disabled={disabled || undefined}\n data-invalid={fieldInvalid || undefined}\n className={cn(dateFieldRowClassName(disabled))}\n >\n <div dir={dateInputDirection} className={cn(\"min-w-0 flex-1 overflow-hidden\")}>\n <BaseField.Control\n ref={ref}\n render={<input type=\"datetime-local\" ref={inputRef} />}\n id={id}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n min={minValue ?? undefined}\n max={maxValue ?? undefined}\n value={displayText}\n onChange={handleInputChange}\n className={cn(dateInputClassName)}\n />\n </div>\n <DateFieldTrigger\n label={`Open ${label}`}\n disabled={disabled}\n icon={<CalendarClock aria-hidden=\"true\" />}\n />\n </div>\n </Field>\n\n {/* The popup sits outside the field, so nothing in it can register with the field the\n native input owns. */}\n <DateCalendarPopup\n title={label}\n anchor={() => inputRef.current?.parentElement?.parentElement ?? null}\n className={cn(\"max-w-[min(34rem,var(--available-width))]\")}\n >\n {/* Side by side where there is room, the time beneath the month on a narrow screen. Beside\n the calendar the panel takes no height of its own, so the month decides the popup's\n height and the columns scroll within it. */}\n <div className={cn(\"flex flex-col sm:grid sm:grid-cols-[auto_auto]\")}>\n <Calendar\n mode=\"single\"\n value={selection.date}\n onValueChange={(date) => {\n if (date) choose({ date, time: selection.time });\n }}\n disabled={disabled}\n min={minParts?.date}\n max={maxParts?.date}\n isDateUnavailable={isDateUnavailable}\n locale={locale}\n weekStartsOn={weekStartsOn}\n today={today}\n labels={labelsProp}\n className={cn(\"shrink-0\")}\n />\n <TimePanel\n time={selection.time}\n onTimeChange={(time) => choose({ date: selection.date, time })}\n minMinute={dayBounds.min}\n maxMinute={dayBounds.max}\n format={timeFormat}\n minuteStep={step}\n labels={labels}\n disabled={disabled}\n className={cn(\n \"mt-3 border-t pt-3 sm:ms-3 sm:mt-0 sm:h-0 sm:min-h-full sm:border-s sm:border-t-0 sm:ps-3 sm:pt-0\",\n edge.rule,\n disabled && state.disabled\n )}\n footer={\n <BasePopover.Close\n disabled={disabled}\n render={(props) => (\n <Button {...props} size=\"sm\" disabled={disabled}>\n {labels.done}\n </Button>\n )}\n />\n }\n />\n </div>\n </DateCalendarPopup>\n </BasePopover.Root>\n );\n});\n\nDateTimePicker.displayName = \"DateTimePicker\";\n\nexport default DateTimePicker;\n"],"names":["defaultCalendarLabels","forwardRef","useMemo","createTimeFormat","resolveHourCycle","useState","normalizeCalendarDateTime","parseCalendarDateTime","useRef","useEffect","useDateFormReset","minuteOfDay","emptyTime","toCalendarDateTime","timeFromMinuteOfDay","_jsxs","BasePopover","_jsx","Field","cn","state","dateFieldRowClassName","dateInputDirection","BaseField","dateInputClassName","DateFieldTrigger","CalendarClock","DateCalendarPopup","Calendar","TimePanel","edge","Button"],"mappings":";;;;;;;;;;;;;;;;;;;AAmDA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,qBAAqB,CAAA,CAAA,CAAyB;AAClD,CAAA,CAAA,CAAA,CAAA,GAAGA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAqB;AACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;AACZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;AACZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ;AAChB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;AACf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe;AAC3B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM;AACZ,CAAA,CAAA,C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,CAACD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAW,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,GAChB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAE,QAAQ,CAAA,CAClB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,EAAE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,MACZC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAACc,cAAM,CAAA,CAAA,CAAA,CAAA,GAAK,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAE,CAAA,CAAA,CAAA,CAAI,CAAA,CAAC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAC,QAAQ,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,YAC5C,MAAM,CAAC,CAAA,CAAA,CAAA,CAAI,EAAA,CACL,CACV,EAAA,CACD,CAAA,CAAA,CAEJ,IACE,CAAA,CAAA,CACY,CAAA,CAAA,CAAA,CACH,CAAA;AAEvB,CAAC,CAAA;AAED,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
/* The date family's own calendar arithmetic, labels and Intl formatting.
|
|
4
4
|
====================================================================
|
|
5
|
-
`Calendar`, `DatePicker` and `
|
|
6
|
-
calendar grid, a native `type=date` input and a range span all agree.
|
|
5
|
+
`Calendar`, `DatePicker`, `DateRangePicker` and `DateTimePicker` share one definition of what a
|
|
6
|
+
date *is*, so a calendar grid, a native `type=date` input and a range span all agree.
|
|
7
7
|
|
|
8
8
|
A `CalendarDate` is a zero-padded Gregorian civil date (`YYYY-MM-DD`, years `0001`–`9999`) and
|
|
9
9
|
carries no time. Every arithmetic step below reads and writes calendar fields directly, through
|
|
@@ -170,6 +170,61 @@ const resolveCalendarLabels = (labels) => ({
|
|
|
170
170
|
...defaultCalendarLabels,
|
|
171
171
|
...labels,
|
|
172
172
|
});
|
|
173
|
+
const DATE_TIME_PATTERN = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})$/;
|
|
174
|
+
/** The only way a value becomes a date-time. Seconds are not part of the format, so a value that
|
|
175
|
+
* carries them is not one, rather than one whose seconds are silently dropped. */
|
|
176
|
+
const parseCalendarDateTime = (value) => {
|
|
177
|
+
if (typeof value !== "string")
|
|
178
|
+
return null;
|
|
179
|
+
const match = DATE_TIME_PATTERN.exec(value);
|
|
180
|
+
if (!match)
|
|
181
|
+
return null;
|
|
182
|
+
const date = normalizeCalendarDate(match[1]);
|
|
183
|
+
const hour = Number(match[2]);
|
|
184
|
+
const minute = Number(match[3]);
|
|
185
|
+
if (!date || hour > 23 || minute > 59)
|
|
186
|
+
return null;
|
|
187
|
+
return { date, time: { hour, minute } };
|
|
188
|
+
};
|
|
189
|
+
const toCalendarDateTime = (date, { hour, minute }) => `${date}T${pad(hour, 2)}:${pad(minute, 2)}`;
|
|
190
|
+
const normalizeCalendarDateTime = (value) => {
|
|
191
|
+
const parts = parseCalendarDateTime(value);
|
|
192
|
+
return parts ? toCalendarDateTime(parts.date, parts.time) : null;
|
|
193
|
+
};
|
|
194
|
+
/** Minutes since midnight, which is how two readings on the same day compare. */
|
|
195
|
+
const minuteOfDay = ({ hour, minute }) => hour * 60 + minute;
|
|
196
|
+
const timeFromMinuteOfDay = (minutes) => ({
|
|
197
|
+
hour: Math.floor(minutes / 60),
|
|
198
|
+
minute: minutes % 60,
|
|
199
|
+
});
|
|
200
|
+
/** Whether the locale reads a clock in twelve hours with a day period, or in twenty-four. */
|
|
201
|
+
const resolveHourCycle = (locale) => new Intl.DateTimeFormat(locale, { hour: "numeric", timeZone: "UTC" }).resolvedOptions().hour12 ? 12 : 24;
|
|
202
|
+
/* A `Date` only so `Intl` can write a clock reading; the day is fixed and the zone is UTC, so the
|
|
203
|
+
reading is never shifted by the visitor's own zone. */
|
|
204
|
+
const utcTime = ({ hour, minute }) => new Date(Date.UTC(2024, 0, 1, hour, minute));
|
|
205
|
+
/**
|
|
206
|
+
* The locale's way of writing a clock, in the hour cycle the picker shows. As with dates, the
|
|
207
|
+
* locale changes how a time is written and announced, never what it means: values stay
|
|
208
|
+
* twenty-four-hour `HH:mm` whatever the cycle on screen is.
|
|
209
|
+
*/
|
|
210
|
+
const createTimeFormat = (locale, hourCycle) => {
|
|
211
|
+
const twoDigits = new Intl.NumberFormat(locale, { minimumIntegerDigits: 2, useGrouping: false });
|
|
212
|
+
const plain = new Intl.NumberFormat(locale, { useGrouping: false });
|
|
213
|
+
const reading = new Intl.DateTimeFormat(locale, {
|
|
214
|
+
hour: "numeric",
|
|
215
|
+
minute: "2-digit",
|
|
216
|
+
hourCycle: hourCycle === 12 ? "h12" : "h23",
|
|
217
|
+
timeZone: "UTC",
|
|
218
|
+
});
|
|
219
|
+
const periodOf = (hour, fallback) => { var _a, _b; return (_b = (_a = reading.formatToParts(utcTime({ hour, minute: 0 })).find((part) => part.type === "dayPeriod")) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : fallback; };
|
|
220
|
+
return {
|
|
221
|
+
hourCycle,
|
|
222
|
+
formatHour: (hour) => (hourCycle === 12 ? plain.format(hour % 12 || 12) : twoDigits.format(hour)),
|
|
223
|
+
formatMinute: (minute) => twoDigits.format(minute),
|
|
224
|
+
periodNames: [periodOf(9, "AM"), periodOf(15, "PM")],
|
|
225
|
+
formatTime: (time) => reading.format(utcTime(time)),
|
|
226
|
+
};
|
|
227
|
+
};
|
|
173
228
|
|
|
174
229
|
exports.MAX_CALENDAR_YEAR = MAX_CALENDAR_YEAR;
|
|
175
230
|
exports.MIN_CALENDAR_YEAR = MIN_CALENDAR_YEAR;
|
|
@@ -177,15 +232,22 @@ exports.addCalendarDays = addCalendarDays;
|
|
|
177
232
|
exports.addCalendarMonths = addCalendarMonths;
|
|
178
233
|
exports.compareCalendarDates = compareCalendarDates;
|
|
179
234
|
exports.createCalendarFormat = createCalendarFormat;
|
|
235
|
+
exports.createTimeFormat = createTimeFormat;
|
|
180
236
|
exports.dayOfWeek = dayOfWeek;
|
|
181
237
|
exports.daysInMonth = daysInMonth;
|
|
182
238
|
exports.defaultCalendarLabels = defaultCalendarLabels;
|
|
183
239
|
exports.isLeapYear = isLeapYear;
|
|
240
|
+
exports.minuteOfDay = minuteOfDay;
|
|
184
241
|
exports.normalizeCalendarDate = normalizeCalendarDate;
|
|
242
|
+
exports.normalizeCalendarDateTime = normalizeCalendarDateTime;
|
|
185
243
|
exports.normalizeDateRange = normalizeDateRange;
|
|
186
244
|
exports.parseCalendarDate = parseCalendarDate;
|
|
245
|
+
exports.parseCalendarDateTime = parseCalendarDateTime;
|
|
187
246
|
exports.rangeIncludesDate = rangeIncludesDate;
|
|
188
247
|
exports.resolveCalendarLabels = resolveCalendarLabels;
|
|
248
|
+
exports.resolveHourCycle = resolveHourCycle;
|
|
249
|
+
exports.timeFromMinuteOfDay = timeFromMinuteOfDay;
|
|
189
250
|
exports.toCalendarDate = toCalendarDate;
|
|
251
|
+
exports.toCalendarDateTime = toCalendarDateTime;
|
|
190
252
|
exports.todayCalendarDate = todayCalendarDate;
|
|
191
253
|
//# sourceMappingURL=date-family.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-family.cjs","sources":["../../../src/components/date-family.ts"],"sourcesContent":["/* The date family's own calendar arithmetic, labels and Intl formatting.\n ====================================================================\n `Calendar`, `DatePicker` and `DateRangePicker` share one definition of what a date *is*, so a\n calendar grid, a native `type=date` input and a range span all agree.\n\n A `CalendarDate` is a zero-padded Gregorian civil date (`YYYY-MM-DD`, years `0001`–`9999`) and\n carries no time. Every arithmetic step below reads and writes calendar fields directly, through\n the pure helpers in this module, rather than going through a timestamp: a local-midnight\n `Date` would shift a day under a daylight-saving transition, and `Date.UTC` silently maps a\n year below 100 onto `1900 + year`. The only `Date` objects here are the ones `Intl` needs to\n *format* a value, and they are built through `setUTCFullYear` so year `0001` survives.\n\n This module is private to the date family. The public date types are re-exported from\n `Calendar.tsx`, which is the family's public entry. */\n\nexport type CalendarDate = string;\n\nexport interface DateRange {\n start: CalendarDate | null;\n end: CalendarDate | null;\n}\n\n/** A parsed civil date. `month` is 0-based, as every `Intl` and `Date` API expects. */\nexport interface DateParts {\n year: number;\n month: number;\n day: number;\n}\n\n/** Inclusive year bounds of the value format: `0001-01-01` through `9999-12-31`. */\nexport const MIN_CALENDAR_YEAR = 1;\nexport const MAX_CALENDAR_YEAR = 9999;\n\nconst DAYS_PER_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DATE_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\nconst pad = (value: number, length: number) => String(value).padStart(length, \"0\");\n\nexport const isLeapYear = (year: number) =>\n year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n\nexport const daysInMonth = (year: number, month: number) =>\n month === 1 && isLeapYear(year) ? 29 : DAYS_PER_MONTH[month];\n\n/**\n * The only way a value becomes a date. A value that is not zero-padded, not a real civil date\n * (including a day that does not exist in its month) or outside the year bounds is not a date at\n * all, so callers never have to reason about a half-valid value.\n */\nexport const parseCalendarDate = (value: CalendarDate | null | undefined): DateParts | null => {\n if (typeof value !== \"string\") return null;\n\n const match = DATE_PATTERN.exec(value);\n if (!match) return null;\n\n const year = Number(match[1]);\n const month = Number(match[2]) - 1;\n const day = Number(match[3]);\n\n if (year < MIN_CALENDAR_YEAR || year > MAX_CALENDAR_YEAR) return null;\n if (month < 0 || month > 11) return null;\n if (day < 1 || day > daysInMonth(year, month)) return null;\n\n return { year, month, day };\n};\n\nexport const isValidCalendarDate = (value: CalendarDate | null | undefined) =>\n parseCalendarDate(value) !== null;\n\nexport const toCalendarDate = ({ year, month, day }: DateParts): CalendarDate =>\n `${pad(year, 4)}-${pad(month + 1, 2)}-${pad(day, 2)}`;\n\n/** A calendar date, or `null` when the input is not one. */\nexport const normalizeCalendarDate = (value: CalendarDate | null | undefined): CalendarDate | null => {\n const parts = parseCalendarDate(value);\n return parts ? toCalendarDate(parts) : null;\n};\n\nexport const normalizeDateRange = (range: DateRange | null | undefined): DateRange => ({\n start: normalizeCalendarDate(range?.start),\n end: normalizeCalendarDate(range?.end),\n});\n\nexport const emptyDateRange = (): DateRange => ({ start: null, end: null });\n\n/* Zero-padded dates order lexicographically exactly as they order in time, so comparison needs no\n parsing. */\nexport const compareCalendarDates = (left: CalendarDate, right: CalendarDate) =>\n left === right ? 0 : left < right ? -1 : 1;\n\n/** Day of week, `0` for Sunday. Sakamoto's algorithm: pure integer arithmetic, so it is exact for\n * the whole year range rather than only for the years a `Date` round-trip happens to preserve. */\nexport const dayOfWeek = ({ year, month, day }: DateParts): number => {\n const offsets = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];\n const adjustedYear = month < 2 ? year - 1 : year;\n\n return (\n (adjustedYear +\n Math.floor(adjustedYear / 4) -\n Math.floor(adjustedYear / 100) +\n Math.floor(adjustedYear / 400) +\n offsets[month] +\n day) %\n 7\n );\n};\n\nexport const addCalendarDays = ({ year, month, day }: DateParts, delta: number): DateParts => {\n let nextYear = year;\n let nextMonth = month;\n let nextDay = day + delta;\n\n while (nextDay < 1) {\n nextMonth -= 1;\n if (nextMonth < 0) {\n nextMonth = 11;\n nextYear -= 1;\n }\n nextDay += daysInMonth(nextYear, nextMonth);\n }\n\n while (nextDay > daysInMonth(nextYear, nextMonth)) {\n nextDay -= daysInMonth(nextYear, nextMonth);\n nextMonth += 1;\n if (nextMonth > 11) {\n nextMonth = 0;\n nextYear += 1;\n }\n }\n\n return { year: nextYear, month: nextMonth, day: nextDay };\n};\n\n/** Moves by whole months and **clamps** the day to the target month, which is what keeps\n * `2024-01-31` a real date when the grid walks into February. The result never leaves the year\n * bounds, so month and year navigation cannot escape `0001`–`9999`. */\nexport const addCalendarMonths = ({ year, month, day }: DateParts, delta: number): DateParts => {\n const minIndex = MIN_CALENDAR_YEAR * 12;\n const maxIndex = MAX_CALENDAR_YEAR * 12 + 11;\n const index = Math.min(maxIndex, Math.max(minIndex, year * 12 + month + delta));\n const nextYear = Math.floor(index / 12);\n const nextMonth = index % 12;\n\n return { year: nextYear, month: nextMonth, day: Math.min(day, daysInMonth(nextYear, nextMonth)) };\n};\n\n/** Walks an inclusive span once and reports whether any date in it matches `predicate`. */\nexport const rangeIncludesDate = (\n from: DateParts,\n to: DateParts,\n predicate: (date: CalendarDate) => boolean\n): boolean => {\n const last = toCalendarDate(to);\n let cursor = from;\n\n while (!predicate(toCalendarDate(cursor))) {\n if (toCalendarDate(cursor) === last) return false;\n cursor = addCalendarDays(cursor, 1);\n }\n\n return true;\n};\n\n/** Today in UTC calendar fields — the value an application overrides through `today` when its own\n * civil day differs from UTC. */\nexport const todayCalendarDate = (): CalendarDate => {\n const now = new Date();\n return toCalendarDate({\n year: now.getUTCFullYear(),\n month: now.getUTCMonth(),\n day: now.getUTCDate(),\n });\n};\n\n/* A `Date` only so `Intl` can format; the calendar fields are set through `setUTCFullYear`, which\n keeps year `0001` intact instead of folding it into the 1900s. */\nconst utcDate = ({ year, month, day }: DateParts) => {\n const date = new Date(0);\n date.setUTCHours(0, 0, 0, 0);\n date.setUTCFullYear(year, month, day);\n return date;\n};\n\nexport interface CalendarFormat {\n /** The visible and announced month caption, e.g. `January 2024`. */\n formatMonthYear: (parts: DateParts) => string;\n /** The day number as the locale writes digits. */\n formatDayNumber: (day: number) => string;\n /** Weekday headings, indexed from Sunday. `short` is shown, `long` is the heading's name. */\n weekdayNames: { short: string; long: string }[];\n /** The day's full accessible name, e.g. `Monday, January 15, 2024`. */\n formatDate: (parts: DateParts) => string;\n}\n\n/* 2024-01-07 is a Sunday, which is what anchors the weekday headings: asking `Intl` for a weekday\n name needs a date, and a fixed one keeps the headings independent of the visitor's clock. */\nconst WEEKDAY_ANCHOR: DateParts = { year: 2024, month: 0, day: 7 };\n\n/**\n * The locale's month, weekday and full-date wording, with the Gregorian calendar and UTC fixed.\n * Values stay Gregorian and zero-padded whatever the locale is, so a locale changes how a date is\n * written and announced, never what it means.\n */\nexport const createCalendarFormat = (locale: string): CalendarFormat => {\n const shared = { timeZone: \"UTC\", calendar: \"gregory\" } as const;\n const monthYear = new Intl.DateTimeFormat(locale, { ...shared, month: \"long\", year: \"numeric\" });\n const fullDate = new Intl.DateTimeFormat(locale, { ...shared, dateStyle: \"full\" });\n const dayNumber = new Intl.NumberFormat(locale, { useGrouping: false });\n const shortWeekday = new Intl.DateTimeFormat(locale, { ...shared, weekday: \"short\" });\n const longWeekday = new Intl.DateTimeFormat(locale, { ...shared, weekday: \"long\" });\n\n const weekdayNames = Array.from({ length: 7 }, (_, index) => {\n const date = utcDate(addCalendarDays(WEEKDAY_ANCHOR, index));\n return { short: shortWeekday.format(date), long: longWeekday.format(date) };\n });\n\n return {\n formatMonthYear: (parts) => monthYear.format(utcDate(parts)),\n formatDayNumber: (day) => dayNumber.format(day),\n weekdayNames,\n formatDate: (parts) => fullDate.format(utcDate(parts)),\n };\n};\n\nexport interface CalendarLabels {\n /** The control that moves the grid to the previous month. */\n previousMonth: string;\n /** The control that moves the grid to the next month. */\n nextMonth: string;\n /** The control that navigates to today without selecting it. */\n today: string;\n /** Describes a single-date grid to assistive technology. */\n selectDate: string;\n /** Describes a range grid to assistive technology. */\n selectRange: string;\n /** Reported when a date — or a range — cannot be selected or is not acceptable. */\n unavailableRange: string;\n}\n\nexport const defaultCalendarLabels: CalendarLabels = {\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n today: \"Today\",\n selectDate: \"Select a date\",\n selectRange: \"Select a range\",\n unavailableRange: \"That range includes an unavailable date\",\n};\n\nexport const resolveCalendarLabels = (labels?: Partial<CalendarLabels>): CalendarLabels => ({\n ...defaultCalendarLabels,\n ...labels,\n});\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAayD;AAgBzD;AACO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,iBAAiB,GAAG;AAEjC,MAAM,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACvE,MAAM,YAAY,GAAG,2BAA2B;AAEhD,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,MAAc,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;AAE3E,MAAM,UAAU,GAAG,CAAC,IAAY,KACrC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC;AAElD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,KAAa,KACrD,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,CAAC,KAAK;AAE7D;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAsC,KAAsB;IAC5F,IAAI,OAAO,KAAK,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;IAE1C,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;AACtC,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,IAAI;IAEvB,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,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OAAO;AACd,IAAA,UAAU,EAAE,eAAe;AAC3B,IAAA,WAAW,EAAE,gBAAgB;AAC7B,IAAA,gBAAgB,EAAE,yCAAyC;;MAGhD,qBAAqB,GAAG,CAAC,MAAgC,MAAsB;AAC1F,IAAA,GAAG,qBAAqB;AACxB,IAAA,GAAG,MAAM;AACV,CAAA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-family.cjs","sources":["../../../src/components/date-family.ts"],"sourcesContent":["/* The date family's own calendar arithmetic, labels and Intl formatting.\n ====================================================================\n `Calendar`, `DatePicker`, `DateRangePicker` and `DateTimePicker` share one definition of what a\n date *is*, so a calendar grid, a native `type=date` input and a range span all agree.\n\n A `CalendarDate` is a zero-padded Gregorian civil date (`YYYY-MM-DD`, years `0001`–`9999`) and\n carries no time. Every arithmetic step below reads and writes calendar fields directly, through\n the pure helpers in this module, rather than going through a timestamp: a local-midnight\n `Date` would shift a day under a daylight-saving transition, and `Date.UTC` silently maps a\n year below 100 onto `1900 + year`. The only `Date` objects here are the ones `Intl` needs to\n *format* a value, and they are built through `setUTCFullYear` so year `0001` survives.\n\n This module is private to the date family. The public date types are re-exported from\n `Calendar.tsx`, which is the family's public entry. */\n\nexport type CalendarDate = string;\n\nexport interface DateRange {\n start: CalendarDate | null;\n end: CalendarDate | null;\n}\n\n/** A parsed civil date. `month` is 0-based, as every `Intl` and `Date` API expects. */\nexport interface DateParts {\n year: number;\n month: number;\n day: number;\n}\n\n/** Inclusive year bounds of the value format: `0001-01-01` through `9999-12-31`. */\nexport const MIN_CALENDAR_YEAR = 1;\nexport const MAX_CALENDAR_YEAR = 9999;\n\nconst DAYS_PER_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DATE_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n\nconst pad = (value: number, length: number) => String(value).padStart(length, \"0\");\n\nexport const isLeapYear = (year: number) =>\n year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n\nexport const daysInMonth = (year: number, month: number) =>\n month === 1 && isLeapYear(year) ? 29 : DAYS_PER_MONTH[month];\n\n/**\n * The only way a value becomes a date. A value that is not zero-padded, not a real civil date\n * (including a day that does not exist in its month) or outside the year bounds is not a date at\n * all, so callers never have to reason about a half-valid value.\n */\nexport const parseCalendarDate = (value: CalendarDate | null | undefined): DateParts | null => {\n if (typeof value !== \"string\") return null;\n\n const match = DATE_PATTERN.exec(value);\n if (!match) return null;\n\n const year = Number(match[1]);\n const month = Number(match[2]) - 1;\n const day = Number(match[3]);\n\n if (year < MIN_CALENDAR_YEAR || year > MAX_CALENDAR_YEAR) return null;\n if (month < 0 || month > 11) return null;\n if (day < 1 || day > daysInMonth(year, month)) return null;\n\n return { year, month, day };\n};\n\nexport const isValidCalendarDate = (value: CalendarDate | null | undefined) =>\n parseCalendarDate(value) !== null;\n\nexport const toCalendarDate = ({ year, month, day }: DateParts): CalendarDate =>\n `${pad(year, 4)}-${pad(month + 1, 2)}-${pad(day, 2)}`;\n\n/** A calendar date, or `null` when the input is not one. */\nexport const normalizeCalendarDate = (value: CalendarDate | null | undefined): CalendarDate | null => {\n const parts = parseCalendarDate(value);\n return parts ? toCalendarDate(parts) : null;\n};\n\nexport const normalizeDateRange = (range: DateRange | null | undefined): DateRange => ({\n start: normalizeCalendarDate(range?.start),\n end: normalizeCalendarDate(range?.end),\n});\n\nexport const emptyDateRange = (): DateRange => ({ start: null, end: null });\n\n/* Zero-padded dates order lexicographically exactly as they order in time, so comparison needs no\n parsing. */\nexport const compareCalendarDates = (left: CalendarDate, right: CalendarDate) =>\n left === right ? 0 : left < right ? -1 : 1;\n\n/** Day of week, `0` for Sunday. Sakamoto's algorithm: pure integer arithmetic, so it is exact for\n * the whole year range rather than only for the years a `Date` round-trip happens to preserve. */\nexport const dayOfWeek = ({ year, month, day }: DateParts): number => {\n const offsets = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];\n const adjustedYear = month < 2 ? year - 1 : year;\n\n return (\n (adjustedYear +\n Math.floor(adjustedYear / 4) -\n Math.floor(adjustedYear / 100) +\n Math.floor(adjustedYear / 400) +\n offsets[month] +\n day) %\n 7\n );\n};\n\nexport const addCalendarDays = ({ year, month, day }: DateParts, delta: number): DateParts => {\n let nextYear = year;\n let nextMonth = month;\n let nextDay = day + delta;\n\n while (nextDay < 1) {\n nextMonth -= 1;\n if (nextMonth < 0) {\n nextMonth = 11;\n nextYear -= 1;\n }\n nextDay += daysInMonth(nextYear, nextMonth);\n }\n\n while (nextDay > daysInMonth(nextYear, nextMonth)) {\n nextDay -= daysInMonth(nextYear, nextMonth);\n nextMonth += 1;\n if (nextMonth > 11) {\n nextMonth = 0;\n nextYear += 1;\n }\n }\n\n return { year: nextYear, month: nextMonth, day: nextDay };\n};\n\n/** Moves by whole months and **clamps** the day to the target month, which is what keeps\n * `2024-01-31` a real date when the grid walks into February. The result never leaves the year\n * bounds, so month and year navigation cannot escape `0001`–`9999`. */\nexport const addCalendarMonths = ({ year, month, day }: DateParts, delta: number): DateParts => {\n const minIndex = MIN_CALENDAR_YEAR * 12;\n const maxIndex = MAX_CALENDAR_YEAR * 12 + 11;\n const index = Math.min(maxIndex, Math.max(minIndex, year * 12 + month + delta));\n const nextYear = Math.floor(index / 12);\n const nextMonth = index % 12;\n\n return { year: nextYear, month: nextMonth, day: Math.min(day, daysInMonth(nextYear, nextMonth)) };\n};\n\n/** Walks an inclusive span once and reports whether any date in it matches `predicate`. */\nexport const rangeIncludesDate = (\n from: DateParts,\n to: DateParts,\n predicate: (date: CalendarDate) => boolean\n): boolean => {\n const last = toCalendarDate(to);\n let cursor = from;\n\n while (!predicate(toCalendarDate(cursor))) {\n if (toCalendarDate(cursor) === last) return false;\n cursor = addCalendarDays(cursor, 1);\n }\n\n return true;\n};\n\n/** Today in UTC calendar fields — the value an application overrides through `today` when its own\n * civil day differs from UTC. */\nexport const todayCalendarDate = (): CalendarDate => {\n const now = new Date();\n return toCalendarDate({\n year: now.getUTCFullYear(),\n month: now.getUTCMonth(),\n day: now.getUTCDate(),\n });\n};\n\n/* A `Date` only so `Intl` can format; the calendar fields are set through `setUTCFullYear`, which\n keeps year `0001` intact instead of folding it into the 1900s. */\nconst utcDate = ({ year, month, day }: DateParts) => {\n const date = new Date(0);\n date.setUTCHours(0, 0, 0, 0);\n date.setUTCFullYear(year, month, day);\n return date;\n};\n\nexport interface CalendarFormat {\n /** The visible and announced month caption, e.g. `January 2024`. */\n formatMonthYear: (parts: DateParts) => string;\n /** The day number as the locale writes digits. */\n formatDayNumber: (day: number) => string;\n /** Weekday headings, indexed from Sunday. `short` is shown, `long` is the heading's name. */\n weekdayNames: { short: string; long: string }[];\n /** The day's full accessible name, e.g. `Monday, January 15, 2024`. */\n formatDate: (parts: DateParts) => string;\n}\n\n/* 2024-01-07 is a Sunday, which is what anchors the weekday headings: asking `Intl` for a weekday\n name needs a date, and a fixed one keeps the headings independent of the visitor's clock. */\nconst WEEKDAY_ANCHOR: DateParts = { year: 2024, month: 0, day: 7 };\n\n/**\n * The locale's month, weekday and full-date wording, with the Gregorian calendar and UTC fixed.\n * Values stay Gregorian and zero-padded whatever the locale is, so a locale changes how a date is\n * written and announced, never what it means.\n */\nexport const createCalendarFormat = (locale: string): CalendarFormat => {\n const shared = { timeZone: \"UTC\", calendar: \"gregory\" } as const;\n const monthYear = new Intl.DateTimeFormat(locale, { ...shared, month: \"long\", year: \"numeric\" });\n const fullDate = new Intl.DateTimeFormat(locale, { ...shared, dateStyle: \"full\" });\n const dayNumber = new Intl.NumberFormat(locale, { useGrouping: false });\n const shortWeekday = new Intl.DateTimeFormat(locale, { ...shared, weekday: \"short\" });\n const longWeekday = new Intl.DateTimeFormat(locale, { ...shared, weekday: \"long\" });\n\n const weekdayNames = Array.from({ length: 7 }, (_, index) => {\n const date = utcDate(addCalendarDays(WEEKDAY_ANCHOR, index));\n return { short: shortWeekday.format(date), long: longWeekday.format(date) };\n });\n\n return {\n formatMonthYear: (parts) => monthYear.format(utcDate(parts)),\n formatDayNumber: (day) => dayNumber.format(day),\n weekdayNames,\n formatDate: (parts) => fullDate.format(utcDate(parts)),\n };\n};\n\nexport interface CalendarLabels {\n /** The control that moves the grid to the previous month. */\n previousMonth: string;\n /** The control that moves the grid to the next month. */\n nextMonth: string;\n /** The control that navigates to today without selecting it. */\n today: string;\n /** Describes a single-date grid to assistive technology. */\n selectDate: string;\n /** Describes a range grid to assistive technology. */\n selectRange: string;\n /** Reported when a date — or a range — cannot be selected or is not acceptable. */\n unavailableRange: string;\n}\n\nexport const defaultCalendarLabels: CalendarLabels = {\n previousMonth: \"Previous month\",\n nextMonth: \"Next month\",\n today: \"Today\",\n selectDate: \"Select a date\",\n selectRange: \"Select a range\",\n unavailableRange: \"That range includes an unavailable date\",\n};\n\nexport const resolveCalendarLabels = (labels?: Partial<CalendarLabels>): CalendarLabels => ({\n ...defaultCalendarLabels,\n ...labels,\n});\n\n/* Civil date-times.\n =================\n A `CalendarDateTime` is a `CalendarDate` and a wall-clock minute, `YYYY-MM-DDTHH:mm` — the\n exact value a native `datetime-local` input reads and submits. Like the date, it names a day on\n a calendar and a reading on a clock, not an instant: it carries no time zone and no offset, so\n nothing here converts it, and a daylight-saving change cannot move it. Zero-padded, it orders\n lexicographically exactly as it orders in time, just as a date does. */\n\nexport type CalendarDateTime = string;\n\n/** A wall-clock reading: `hour` is 0–23, `minute` 0–59. */\nexport interface TimeParts {\n hour: number;\n minute: number;\n}\n\nconst DATE_TIME_PATTERN = /^(\\d{4}-\\d{2}-\\d{2})T(\\d{2}):(\\d{2})$/;\n\n/** The only way a value becomes a date-time. Seconds are not part of the format, so a value that\n * carries them is not one, rather than one whose seconds are silently dropped. */\nexport const parseCalendarDateTime = (\n value: CalendarDateTime | null | undefined\n): { date: CalendarDate; time: TimeParts } | null => {\n if (typeof value !== \"string\") return null;\n\n const match = DATE_TIME_PATTERN.exec(value);\n if (!match) return null;\n\n const date = normalizeCalendarDate(match[1]);\n const hour = Number(match[2]);\n const minute = Number(match[3]);\n if (!date || hour > 23 || minute > 59) return null;\n\n return { date, time: { hour, minute } };\n};\n\nexport const toCalendarDateTime = (date: CalendarDate, { hour, minute }: TimeParts): CalendarDateTime =>\n `${date}T${pad(hour, 2)}:${pad(minute, 2)}`;\n\nexport const normalizeCalendarDateTime = (\n value: CalendarDateTime | null | undefined\n): CalendarDateTime | null => {\n const parts = parseCalendarDateTime(value);\n return parts ? toCalendarDateTime(parts.date, parts.time) : null;\n};\n\n/** Minutes since midnight, which is how two readings on the same day compare. */\nexport const minuteOfDay = ({ hour, minute }: TimeParts) => hour * 60 + minute;\n\nexport const timeFromMinuteOfDay = (minutes: number): TimeParts => ({\n hour: Math.floor(minutes / 60),\n minute: minutes % 60,\n});\n\n/** Whether the locale reads a clock in twelve hours with a day period, or in twenty-four. */\nexport const resolveHourCycle = (locale: string): 12 | 24 =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\", timeZone: \"UTC\" }).resolvedOptions().hour12 ? 12 : 24;\n\nexport interface TimeFormat {\n hourCycle: 12 | 24;\n /** An hour as its column writes it: `00`–`23`, or `12`, `1`–`11` beside a day period. */\n formatHour: (hour: number) => string;\n /** A minute as its column writes it, always two digits. */\n formatMinute: (minute: number) => string;\n /** The locale's own words for the morning and afternoon day periods. */\n periodNames: [string, string];\n /** The whole reading, as the locale writes a time, e.g. `2:30 PM` or `14:30`. */\n formatTime: (time: TimeParts) => string;\n}\n\n/* A `Date` only so `Intl` can write a clock reading; the day is fixed and the zone is UTC, so the\n reading is never shifted by the visitor's own zone. */\nconst utcTime = ({ hour, minute }: TimeParts) => new Date(Date.UTC(2024, 0, 1, hour, minute));\n\n/**\n * The locale's way of writing a clock, in the hour cycle the picker shows. As with dates, the\n * locale changes how a time is written and announced, never what it means: values stay\n * twenty-four-hour `HH:mm` whatever the cycle on screen is.\n */\nexport const createTimeFormat = (locale: string, hourCycle: 12 | 24): TimeFormat => {\n const twoDigits = new Intl.NumberFormat(locale, { minimumIntegerDigits: 2, useGrouping: false });\n const plain = new Intl.NumberFormat(locale, { useGrouping: false });\n const reading = new Intl.DateTimeFormat(locale, {\n hour: \"numeric\",\n minute: \"2-digit\",\n hourCycle: hourCycle === 12 ? \"h12\" : \"h23\",\n timeZone: \"UTC\",\n });\n const periodOf = (hour: number, fallback: string) =>\n reading.formatToParts(utcTime({ hour, minute: 0 })).find((part) => part.type === \"dayPeriod\")?.value ?? fallback;\n\n return {\n hourCycle,\n formatHour: (hour) => (hourCycle === 12 ? plain.format(hour % 12 || 12) : twoDigits.format(hour)),\n formatMinute: (minute) => twoDigits.format(minute),\n periodNames: [periodOf(9, \"AM\"), periodOf(15, \"PM\")],\n formatTime: (time) => reading.format(utcTime(time)),\n };\n};\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;AAayD;AAgBzD;AACO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,iBAAiB,GAAG;AAEjC,MAAM,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AACvE,MAAM,YAAY,GAAG,2BAA2B;AAEhD,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,MAAc,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;AAE3E,MAAM,UAAU,GAAG,CAAC,IAAY,KACrC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC;AAElD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,KAAa,KACrD,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,CAAC,KAAK;AAE7D;;;;AAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAsC,KAAsB;IAC5F,I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= require('./ui.motion.cjs');
|
|
|
29
29
|
const dateFieldRowClassName = (disabled) => utils.cn("group/field flex min-w-0 w-full items-center ps-5 pe-3", ui_common.density.normal, ui_common.shape.control, ui_common.material.control, ui_common.rim.field, ui_motion.motionFeedback, ui_common.focusRingWithin, ui_common.state.field.invalid, !disabled && ui_common.state.field.hover, !disabled && ui_common.state.field.focusWithin, !disabled && ui_common.state.field.invalidHover, !disabled && ui_common.state.field.invalidFocusWithin, disabled ? ui_common.state.disabledDescendant : ui_common.state.text);
|
|
30
30
|
/** Native date entry remains intact. Its trailing browser affordance sits outside the clipped
|
|
31
31
|
* input slot, leaving one visible calendar trigger in every engine (Firefox does not expose
|
|
32
|
-
* a picker-indicator pseudo-element). The composite row owns focus, not the clipped input.
|
|
32
|
+
* a picker-indicator pseudo-element). The composite row owns focus, not the clipped input.
|
|
33
|
+
* Its slot takes `dateInputDirection`: the clip only lands on the affordance if every engine puts
|
|
34
|
+
* the affordance on the same physical side. */
|
|
33
35
|
const dateInputClassName = "block w-[calc(100%+2.5rem)] min-w-0 bg-transparent py-2.5 text-inherit outline-none disabled:cursor-not-allowed";
|
|
36
|
+
/** A native date is a left-to-right run of figures in every page direction. Chromium lays its date
|
|
37
|
+
* inputs out left to right whatever `dir` says, with the affordance on the physical right, while
|
|
38
|
+
* Firefox mirrors them — and reorders a `datetime-local` value's parts under right-to-left bidi.
|
|
39
|
+
* Fixing the direction of the slot that clips the input gives every engine the same layout — the
|
|
40
|
+
* slot's direction, not the input's, decides which side an overflowing input spills from — so the
|
|
41
|
+
* clip above hides the affordance in a right-to-left page as it does in a left-to-right one. */
|
|
42
|
+
const dateInputDirection = "ltr";
|
|
34
43
|
/* The 36×44 target holds a concentric 32px hover surface, leaving air inside the 48px field.
|
|
35
44
|
Only the icon presses: the adjacent native text entry never activates this button. */
|
|
36
45
|
const datePartClassName = `group inline-flex shrink-0 items-center justify-center ${ui_common.density.part} ${ui_common.shape.circle} ${ui_common.text.medium} ${ui_motion.motionFeedback} ${ui_common.stateLayer.quiet} before:inset-x-0.5 before:inset-y-1.5 ${ui_common.state.enabled} ${ui_common.state.disabledPart} [&:not([data-disabled]):not(:disabled)]:hover:text-sherick-ink`;
|
|
@@ -40,7 +49,7 @@ const datePartClassName = `group inline-flex shrink-0 items-center justify-cente
|
|
|
40
49
|
* `aria-expanded`, `aria-controls`) and the pointer and keyboard activation that opens the
|
|
41
50
|
* surface; the button itself only carries the type it needs to stay out of form submission.
|
|
42
51
|
*/
|
|
43
|
-
const DateFieldTrigger = ({ label, disabled = false }) => (jsxRuntime.jsx(popover.Popover.Trigger, { disabled: disabled, render: jsxRuntime.jsx("button", { type: "button", "aria-label": label, disabled: disabled, className: utils.cn(datePartClassName) }), children: jsxRuntime.jsx("span", { className: utils.cn("inline-flex size-5 items-center justify-center [&>svg]:size-5", !disabled && ui_motion.motionInkPress), children:
|
|
52
|
+
const DateFieldTrigger = ({ label, disabled = false, icon = jsxRuntime.jsx(lucideReact.CalendarDays, { "aria-hidden": "true" }) }) => (jsxRuntime.jsx(popover.Popover.Trigger, { disabled: disabled, render: jsxRuntime.jsx("button", { type: "button", "aria-label": label, disabled: disabled, className: utils.cn(datePartClassName) }), children: jsxRuntime.jsx("span", { className: utils.cn("inline-flex size-5 items-center justify-center [&>svg]:size-5", !disabled && ui_motion.motionInkPress), children: icon }) }));
|
|
44
53
|
/**
|
|
45
54
|
* The calendar's popup: the same shell `Popover.Content` renders, composed straight from Base's
|
|
46
55
|
* public parts because the grid needs one thing the published shell does not offer — `initialFocus`
|
|
@@ -50,13 +59,13 @@ const DateFieldTrigger = ({ label, disabled = false }) => (jsxRuntime.jsx(popove
|
|
|
50
59
|
* dismissal and the focus restoration; the surface is non-modal, so the rest of the page stays
|
|
51
60
|
* reachable. Sherick owns only the sheet and its presence.
|
|
52
61
|
*/
|
|
53
|
-
const DateCalendarPopup = ({ title, children, anchor }) => {
|
|
62
|
+
const DateCalendarPopup = ({ title, children, anchor, className }) => {
|
|
54
63
|
const popupRef = React.useRef(null);
|
|
55
64
|
return (jsxRuntime.jsx(popover.Popover.Portal, { children: jsxRuntime.jsx(popover.Popover.Positioner, { anchor: anchor, side: "bottom", align: "start", sideOffset: 8, className: utils.cn(ui_common.stacking.float), children: jsxRuntime.jsxs(popover.Popover.Popup, { ref: popupRef,
|
|
56
65
|
/* The roving tab stop is the calendar's own active day, so this is exactly the cell a
|
|
57
66
|
keyboard reader would land on. `null` leaves Base's default focus behaviour in place
|
|
58
67
|
if the grid has no tab stop to give. */
|
|
59
|
-
initialFocus: () => { var _a, _b; return (_b = (_a = popupRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('[data-day][tabindex="0"]')) !== null && _b !== void 0 ? _b : null; }, className: utils.cn("w-max max-w-[min(24rem,var(--available-width))] max-h-[var(--available-height)] overflow-y-auto p-3 [overflow-wrap:anywhere]", ui_common.overlay.popup, ui_motion.motionPresenceAnchored), children: [jsxRuntime.jsx(popover.Popover.Title, { className: utils.cn("sr-only"), children: title }), children] }) }) }));
|
|
68
|
+
initialFocus: () => { var _a, _b; return (_b = (_a = popupRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('[data-day][tabindex="0"]')) !== null && _b !== void 0 ? _b : null; }, className: utils.cn("w-max max-w-[min(24rem,var(--available-width))] max-h-[var(--available-height)] overflow-y-auto p-3 [overflow-wrap:anywhere]", ui_common.overlay.popup, ui_motion.motionPresenceAnchored, className), children: [jsxRuntime.jsx(popover.Popover.Title, { className: utils.cn("sr-only"), children: title }), children] }) }) }));
|
|
60
69
|
};
|
|
61
70
|
/** Base Field controls entry and validity, but native reset emits no input/change event.
|
|
62
71
|
* Bridge only the date family's domain state, after the owning form's cancelable reset. */
|
|
@@ -86,5 +95,6 @@ exports.DateCalendarPopup = DateCalendarPopup;
|
|
|
86
95
|
exports.DateFieldTrigger = DateFieldTrigger;
|
|
87
96
|
exports.dateFieldRowClassName = dateFieldRowClassName;
|
|
88
97
|
exports.dateInputClassName = dateInputClassName;
|
|
98
|
+
exports.dateInputDirection = dateInputDirection;
|
|
89
99
|
exports.useDateFormReset = useDateFormReset;
|
|
90
100
|
//# sourceMappingURL=date-field.cjs.map
|