@astryxdesign/core 0.5.0-canary.d42f87a → 0.5.0-canary.d51dbad
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/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +1 -0
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -1
- package/dist/DateInput/MonthYearWheels.js +1 -0
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +1 -0
- package/dist/DateTimeInput/DateTimeInput.d.ts +23 -24
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +24 -3
- package/dist/DateTimeInput/TouchDateTimeField.d.ts +6 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -0
- package/dist/DateTimeInput/TouchDateTimeField.js +1019 -0
- package/locales/en.json +46 -2
- package/locales/pseudo.json +34 -1
- package/package.json +4 -5
- package/src/DateInput/MonthScroller.tsx +1 -0
- package/src/DateInput/MonthYearWheels.tsx +1 -0
- package/src/DateInput/Wheel.tsx +1 -0
- package/src/DateTimeInput/DateTimeInput.doc.mjs +38 -21
- package/src/DateTimeInput/DateTimeInput.tsx +43 -15
- package/src/DateTimeInput/DateTimeInputTouch.test.tsx +949 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +1434 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthScroller.d.ts","sourceRoot":"","sources":["../../src/DateInput/MonthScroller.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MonthScroller.d.ts","sourceRoot":"","sources":["../../src/DateInput/MonthScroller.tsx"],"names":[],"mappings":"AAoDA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EAQf,MAAM,UAAU,CAAC;AA6MlB,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;CACxE;AAED,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACxD,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,oBAAoB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,+BAA+B;IAC/B,YAAY,EAAE,SAAS,GAAG,IAAI,CAAC;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,SAAS,CAAC;IACjB,2DAA2D;IAC3D,cAAc,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;IAC7C,gCAAgC;IAChC,YAAY,EAAE,SAAS,CAAC;IACxB,kCAAkC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,KAAK,EACL,cAAc,EACd,YAAY,EACZ,QAAQ,GACT,EAAE,kBAAkB,+BAkapB;yBA7ae,aAAa"}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
* SYNC: When modified, update:
|
|
27
27
|
* - /packages/core/src/DateInput/TouchDateField.tsx
|
|
28
|
+
* - /packages/core/src/DateTimeInput/TouchDateTimeField.tsx
|
|
28
29
|
* - /packages/core/src/DateInput/DateInput.doc.mjs
|
|
29
30
|
* - /packages/core/src/DateInput/DateInputTouch.test.tsx
|
|
30
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonthYearWheels.d.ts","sourceRoot":"","sources":["../../src/DateInput/MonthYearWheels.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MonthYearWheels.d.ts","sourceRoot":"","sources":["../../src/DateInput/MonthYearWheels.tsx"],"names":[],"mappings":"AAyCA,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAe,GAChB,EAAE,oBAAoB,+BA8EtB;yBAtFe,eAAe"}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* SYNC: When modified, update:
|
|
19
19
|
* - /packages/core/src/DateInput/TouchDateField.tsx
|
|
20
|
+
* - /packages/core/src/DateTimeInput/TouchDateTimeField.tsx
|
|
20
21
|
* - /packages/core/src/DateInput/DateInput.doc.mjs
|
|
21
22
|
* - /packages/core/src/DateInput/DateInputTouch.test.tsx
|
|
22
23
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../src/DateInput/Wheel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../src/DateInput/Wheel.tsx"],"names":[],"mappings":"AA2MA,MAAM,WAAW,WAAW;IAC1B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACpC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAe,GAChB,EAAE,UAAU,+BAgOZ;yBAtOe,KAAK"}
|
package/dist/DateInput/Wheel.js
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*
|
|
29
29
|
* SYNC: When modified, update:
|
|
30
30
|
* - /packages/core/src/DateInput/TouchDateField.tsx
|
|
31
|
+
* - /packages/core/src/DateTimeInput/TouchDateTimeField.tsx
|
|
31
32
|
* - /packages/core/src/DateInput/DateInput.doc.mjs
|
|
32
33
|
* - /packages/core/src/DateInput/DateInputTouch.test.tsx
|
|
33
34
|
*/
|
|
@@ -112,24 +112,27 @@ export interface DateTimeInputProps extends Omit<BaseProps, 'onChange' | 'defaul
|
|
|
112
112
|
*/
|
|
113
113
|
hourFormat?: DateTimeInputHourFormat;
|
|
114
114
|
/**
|
|
115
|
-
* Minutes added or subtracted when stepping the time field with the
|
|
116
|
-
* keys.
|
|
115
|
+
* Minutes added or subtracted when stepping the desktop time field with the
|
|
116
|
+
* arrow keys. Ignored on the mobile touch sheet, where time is changed with
|
|
117
|
+
* wheels. Constrained to a set of sensible increments.
|
|
117
118
|
* @default 1
|
|
118
119
|
*/
|
|
119
120
|
timeIncrement?: DateTimeInputTimeIncrement;
|
|
120
121
|
/**
|
|
121
|
-
* Minute cadence for a dropdown of preset times on the time field. Set
|
|
122
|
-
* turn the time field into a combobox listing every valid time at that
|
|
122
|
+
* Minute cadence for a dropdown of preset times on the desktop time field. Set
|
|
123
|
+
* it to turn the time field into a combobox listing every valid time at that
|
|
123
124
|
* cadence (`60` gives the 12 AM - 11 PM list, `15` a quarter-hour list).
|
|
124
125
|
*
|
|
125
|
-
* Omitted, the time field stays a plain text input: typed entry and
|
|
126
|
+
* Omitted, the desktop time field stays a plain text input: typed entry and
|
|
126
127
|
* arrow-key stepping only, with no combobox semantics added to the
|
|
127
|
-
* accessibility tree. Typed entry keeps working when the dropdown is on —
|
|
128
|
-
*
|
|
129
|
-
*
|
|
128
|
+
* accessibility tree. Typed entry keeps working when the dropdown is on — the
|
|
129
|
+
* list is a shortcut, not a restriction, so a time between two options can
|
|
130
|
+
* still be typed.
|
|
130
131
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
132
|
+
* Ignored on the mobile touch sheet, where the wheels expose every
|
|
133
|
+
* hour/minute/second. Independent of `timeIncrement`, which governs desktop
|
|
134
|
+
* arrow-key stepping. Setting both to the same value is the usual choice for
|
|
135
|
+
* scheduling flows on desktop.
|
|
133
136
|
*/
|
|
134
137
|
timeOptionInterval?: DateTimeInputTimeOptionInterval;
|
|
135
138
|
/**
|
|
@@ -144,6 +147,7 @@ export interface DateTimeInputProps extends Omit<BaseProps, 'onChange' | 'defaul
|
|
|
144
147
|
placeholder?: string;
|
|
145
148
|
/**
|
|
146
149
|
* Placeholder text shown in the time portion when no time is selected.
|
|
150
|
+
* On touch, this appears in the closed time segment before a time is chosen.
|
|
147
151
|
* @default "Select a time"
|
|
148
152
|
*/
|
|
149
153
|
timePlaceholder?: string;
|
|
@@ -173,7 +177,9 @@ export interface DateTimeInputProps extends Omit<BaseProps, 'onChange' | 'defaul
|
|
|
173
177
|
*/
|
|
174
178
|
labelTooltip?: string;
|
|
175
179
|
/**
|
|
176
|
-
* Number of months to display in the calendar.
|
|
180
|
+
* Number of months to display in the desktop calendar popover. Ignored on the
|
|
181
|
+
* mobile touch sheet, whose Date panel always shows one swipe-paged month at a
|
|
182
|
+
* time.
|
|
177
183
|
* @default 1
|
|
178
184
|
*/
|
|
179
185
|
numberOfMonths?: 1 | 2;
|
|
@@ -186,20 +192,13 @@ export interface DateTimeInputProps extends Omit<BaseProps, 'onChange' | 'defaul
|
|
|
186
192
|
weekStartsOn?: DayOfWeek | DayOfWeekName;
|
|
187
193
|
}
|
|
188
194
|
/**
|
|
189
|
-
* A combined date and time picker
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* ```
|
|
195
|
-
* <DateTimeInput
|
|
196
|
-
* label="Meeting time"
|
|
197
|
-
* value={dateTime}
|
|
198
|
-
* onChange={setDateTime}
|
|
199
|
-
* />
|
|
200
|
-
* ```
|
|
195
|
+
* A combined date and time picker that keeps the desktop text-entry surface on
|
|
196
|
+
* mouse/trackpad devices and uses Astryx's custom bottom-sheet picker on coarse
|
|
197
|
+
* pointers. Unlike DateInput, this never hands touch picking to the browser/OS:
|
|
198
|
+
* the mobile flow has to coordinate date and time together, preserve drafted
|
|
199
|
+
* time before a date exists, and enforce datetime min/max across both panels.
|
|
201
200
|
*/
|
|
202
|
-
export declare function DateTimeInput(
|
|
201
|
+
export declare function DateTimeInput(props: DateTimeInputProps): import("react").JSX.Element;
|
|
203
202
|
export declare namespace DateTimeInput {
|
|
204
203
|
var displayName: string;
|
|
205
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AAyCA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,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IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CAC1C;AAkuCD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAOtD;yBAPe,aAAa"}
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DateTimeInput.tsx
|
|
7
|
-
* @input Uses React, Field, Calendar, usePopover, useAnnounce, time parsing utilities
|
|
7
|
+
* @input Uses React, Field, Calendar, usePopover, useAnnounce, time parsing utilities, TouchDateTimeField
|
|
8
8
|
* @output Exports DateTimeInput component, DateTimeInputProps
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by DateTimeInput.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
12
|
* - /packages/core/src/DateTimeInput/DateTimeInput.doc.mjs (props table, features, implementation notes)
|
|
13
|
-
* - /packages/core/src/DateTimeInput/DateTimeInput.test.tsx (tests for new/changed behavior)
|
|
13
|
+
* - /packages/core/src/DateTimeInput/DateTimeInput.test.tsx (desktop tests for new/changed behavior)
|
|
14
|
+
* - /packages/core/src/DateTimeInput/DateTimeInputTouch.test.tsx (touch-surface tests)
|
|
14
15
|
* - /packages/core/src/DateTimeInput/index.ts (exports if types change)
|
|
15
16
|
* - /apps/storybook/stories/DateTimeInput.stories.tsx (storybook stories)
|
|
16
17
|
* - /packages/cli/assets/templates/blocks/components/DateTimeInput/ (showcase blocks)
|
|
@@ -32,12 +33,14 @@ import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
|
32
33
|
import { parseDateInput, parseISOTime, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, isImeKeyEvent, mergeProps, isFocusDetached } from "../utils/index.js";
|
|
33
34
|
import { plainDateFromISO, plainDateToISO, plainDateFormat, DATE_FORMAT_LONG } from "../utils/plainDate.js";
|
|
34
35
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
36
|
+
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
35
37
|
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
36
38
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
37
39
|
import { themeProps } from "../utils/themeProps.js";
|
|
38
40
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
39
41
|
import { useLocale, useTranslator } from "../i18n/index.js";
|
|
40
42
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
43
|
+
import { TouchDateTimeField } from "./TouchDateTimeField.js";
|
|
41
44
|
|
|
42
45
|
/** Supported minute increments for arrow-key stepping of the time field. */
|
|
43
46
|
|
|
@@ -188,7 +191,7 @@ function getDefaultTime(hasSeconds) {
|
|
|
188
191
|
* />
|
|
189
192
|
* ```
|
|
190
193
|
*/
|
|
191
|
-
|
|
194
|
+
function PointerDateTimeField({
|
|
192
195
|
label,
|
|
193
196
|
isLabelHidden = false,
|
|
194
197
|
description,
|
|
@@ -1116,4 +1119,22 @@ export function DateTimeInput({
|
|
|
1116
1119
|
}), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
1117
1120
|
});
|
|
1118
1121
|
}
|
|
1122
|
+
PointerDateTimeField.displayName = 'PointerDateTimeField';
|
|
1123
|
+
const TOUCH_POINTER_QUERY = '(pointer: coarse)';
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* A combined date and time picker that keeps the desktop text-entry surface on
|
|
1127
|
+
* mouse/trackpad devices and uses Astryx's custom bottom-sheet picker on coarse
|
|
1128
|
+
* pointers. Unlike DateInput, this never hands touch picking to the browser/OS:
|
|
1129
|
+
* the mobile flow has to coordinate date and time together, preserve drafted
|
|
1130
|
+
* time before a date exists, and enforce datetime min/max across both panels.
|
|
1131
|
+
*/
|
|
1132
|
+
export function DateTimeInput(props) {
|
|
1133
|
+
const isTouch = useMediaQuery(TOUCH_POINTER_QUERY);
|
|
1134
|
+
return isTouch ? /*#__PURE__*/_jsx(TouchDateTimeField, {
|
|
1135
|
+
...props
|
|
1136
|
+
}) : /*#__PURE__*/_jsx(PointerDateTimeField, {
|
|
1137
|
+
...props
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1119
1140
|
DateTimeInput.displayName = 'DateTimeInput';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DateTimeInputProps } from './DateTimeInput';
|
|
2
|
+
export declare function TouchDateTimeField({ label, isLabelHidden, description, isOptional, isRequired, isDisabled, disabledMessage, value, onChange, changeAction, isLoading, min, max, dateConstraints, hasSeconds, hourFormat, timeIncrement: _timeIncrement, timeOptionInterval: _timeOptionInterval, hasClear, placeholder: placeholderFromProps, timePlaceholder: timePlaceholderFromProps, timeLabel, size: sizeProp, status, labelTooltip, numberOfMonths: _numberOfMonths, weekStartsOn: weekStartsOnProp, width, xstyle, className, style, ref, ...rest }: DateTimeInputProps): import("react").JSX.Element;
|
|
3
|
+
export declare namespace TouchDateTimeField {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=TouchDateTimeField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TouchDateTimeField.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/TouchDateTimeField.tsx"],"names":[],"mappings":"AA0GA,OAAO,KAAK,EAAC,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AAoU3E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,UAAkB,EAClB,UAAkB,EAElB,aAAa,EAAE,cAAc,EAC7B,kBAAkB,EAAE,mBAAmB,EACvC,QAAgB,EAChB,WAAW,EAAE,oBAAoB,EACjC,eAAe,EAAE,wBAAwB,EACzC,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EAEZ,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,gBAAoB,EAClC,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAq8BpB;yBAz+Be,kBAAkB"}
|