@astryxdesign/core 0.7.15-canary.gea16e8d → 0.7.15
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/CHANGELOG.md +72 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +5 -4
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +10 -23
- package/dist/DateInput/DateInput.d.ts +44 -0
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +7 -2
- package/dist/DateInput/NativeDateField.d.ts.map +1 -1
- package/dist/DateInput/NativeDateField.js +18 -8
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.d.ts +34 -3
- package/dist/DateInput/useTypedDate.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.js +178 -29
- package/dist/DateTimeInput/DateTimeInput.d.ts +28 -0
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +17 -6
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/Field/InputClearButton.d.ts +4 -1
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +4 -1
- package/dist/Item/Item.d.ts +11 -7
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +9 -7
- package/dist/Item/ItemSwipeLayer.d.ts.map +1 -1
- package/dist/Item/ItemSwipeLayer.js +60 -45
- package/dist/Item/useSwipeAction.d.ts +9 -5
- package/dist/Item/useSwipeAction.d.ts.map +1 -1
- package/dist/Item/useSwipeAction.js +27 -21
- package/dist/Layer/useLayer.d.ts +4 -9
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +6 -16
- package/dist/Layer/useTouchTrigger.d.ts +12 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +22 -3
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +22 -18
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +6 -32
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +5 -10
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +6 -5
- package/dist/Stepper/Step.js +8 -8
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +5 -25
- package/dist/Table/internByIdentity.d.ts +15 -0
- package/dist/Table/internByIdentity.d.ts.map +1 -0
- package/dist/Table/internByIdentity.js +38 -0
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +8 -4
- package/dist/Table/useBaseTablePlugins.d.ts +2 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +26 -54
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +10 -1
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +14 -13
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +31 -6
- package/dist/Token/Token.js +2 -2
- package/dist/Tokenizer/TokenizerBottomSheet.js +25 -12
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +1 -1
- package/dist/TreeList/TreeListItem.js +2 -2
- package/dist/gestures/GestureHost.d.ts +38 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +95 -1
- package/dist/gestures/contextRequest.d.ts +43 -0
- package/dist/gestures/contextRequest.d.ts.map +1 -0
- package/dist/gestures/contextRequest.js +167 -0
- package/dist/hooks/useClickableContainer.d.ts +1 -1
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +2 -2
- package/dist/hooks/useCommittedRef.d.ts +20 -0
- package/dist/hooks/useCommittedRef.d.ts.map +1 -0
- package/dist/hooks/useCommittedRef.js +38 -0
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +23 -27
- package/dist/hooks/usePager.d.ts +3 -1
- package/dist/hooks/usePager.d.ts.map +1 -1
- package/dist/hooks/usePager.js +231 -31
- package/dist/i18n/generated-english/Timestamp/TimestampHoverCard.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Timestamp/TimestampHoverCard.generated.js +1 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +3 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +3 -1
- package/dist/internal/committed-ref.d.ts +15 -0
- package/dist/internal/committed-ref.d.ts.map +1 -0
- package/dist/internal/committed-ref.js +15 -0
- package/dist/internal/touch.d.ts +2 -1
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +1 -0
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -1
- package/dist/keyboard/keyboardHeight.js +13 -9
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -1
- package/dist/keyboard/useMobileKeyboard.js +8 -7
- package/dist/privateAttributes/press.stylex.d.ts +40 -10
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +46 -10
- package/locales/en.json +8 -0
- package/locales/pseudo.json +6 -0
- package/package.json +10 -5
- package/src/BottomSheet/BottomSheetPanel.tsx +5 -4
- package/src/CheckboxInput/CheckboxInput.tsx +20 -60
- package/src/DateInput/DateInput.doc.mjs +19 -3
- package/src/DateInput/DateInput.tsx +54 -4
- package/src/DateInput/NativeDateField.tsx +28 -10
- package/src/DateInput/index.ts +1 -0
- package/src/DateInput/useTypedDate.ts +292 -42
- package/src/DateTimeInput/DateTimeInput.doc.mjs +19 -3
- package/src/DateTimeInput/DateTimeInput.tsx +45 -7
- package/src/DateTimeInput/index.ts +1 -0
- package/src/Field/InputClearButton.tsx +4 -1
- package/src/Item/Item.doc.mjs +1 -1
- package/src/Item/Item.tsx +16 -12
- package/src/Item/ItemSwipeLayer.tsx +65 -14
- package/src/Item/useSwipeAction.ts +56 -29
- package/src/Layer/useLayer.tsx +12 -37
- package/src/Layer/useTouchTrigger.ts +30 -1
- package/src/Outline/useScrollSpy.ts +22 -22
- package/src/RadioList/RadioListItem.tsx +19 -79
- package/src/Resizable/ResizeHandle.tsx +5 -6
- package/src/Resizable/useResizable.ts +5 -5
- package/src/Stepper/Step.tsx +6 -6
- package/src/Stepper/Stepper.doc.mjs +8 -2
- package/src/Table/BaseTable.tsx +4 -25
- package/src/Table/internByIdentity.ts +41 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +10 -4
- package/src/Table/useBaseTablePlugins.ts +31 -67
- package/src/Text/TruncationTooltip.tsx +16 -1
- package/src/Timestamp/Timestamp.doc.mjs +3 -2
- package/src/Timestamp/TimestampHoverCard.tsx +27 -16
- package/src/Toast/ToastViewport.tsx +31 -5
- package/src/Token/Token.tsx +2 -2
- package/src/Tokenizer/TokenizerBottomSheet.tsx +35 -12
- package/src/Tooltip/useTooltip.tsx +1 -0
- package/src/TreeList/TreeListItem.tsx +2 -2
- package/src/gestures/GestureHost.ts +125 -1
- package/src/gestures/README.md +21 -0
- package/src/gestures/contextRequest.ts +206 -0
- package/src/hooks/useClickableContainer.ts +2 -2
- package/src/hooks/useCommittedRef.ts +39 -0
- package/src/hooks/useMenuPress.ts +59 -62
- package/src/hooks/usePager.ts +281 -27
- package/src/i18n/generated-english/Timestamp/TimestampHoverCard.generated.ts +1 -0
- package/src/i18n/generated-locales/en.generated.ts +2 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +2 -0
- package/src/internal/committed-ref.ts +15 -0
- package/src/internal/touch.ts +3 -0
- package/src/keyboard/keyboardHeight.ts +15 -17
- package/src/keyboard/useMobileKeyboard.ts +8 -7
- package/src/privateAttributes/press.stylex.ts +109 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.7.15
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- DateInput, DateTimeInput: `onEntryErrorChange` reports why the field rejects typed text, so an app can word its own message. It receives a `DateInputEntryError` (exported from both components) with a `kind` that does not depend on the locale (`unreadable`, `incomplete`, `nonexistent`, `outOfRange` for a date before `min` or after `max`, or `unavailable` for a day that `dateConstraints` rules out), the typed `text`, and, for `outOfRange` and `unavailable`, the Gregorian ISO `date`. It runs each time the rejection changes, including when a new `min`, `max`, `dateConstraints`, or `value`, a calendar pick, disabling the field, or Enter or blur changes it, and with `null` when the rejection ends, or when the typed field leaves while its rejection stands, as when a presentation or pointer change shows the native or touch picker. With the callback, an `error` `status` that has a message is the message the field shows and announces, and the field's own message applies only without one; a `warning` or `success` status never replaces a rejection. When a rejection starts while that error message stays the same, the field announces the message once more for it. Without the callback, nothing else changes. For every DateTimeInput, while a native date control replaces the typed date field, kept typed text and its rejection wait for the typed field, so the field shows the caller's `status` meanwhile. The native and touch pickers take no typed text, so the callback never reports a rejection there. Fixes #10366. (#11311)
|
|
8
|
+
- SegmentedControl: under a finger, pressing the selected segment lifts its surface as UIKit's does, and it settles back when the finger lets go. A pen lifts it the same way on a touch device. With a mouse on a desktop, or with Reduce Motion, nothing lifts. (#9724)
|
|
9
|
+
- Where the primary pointer is fine, a mouse press on a CheckboxInput or a RadioList option paints at once on `pointerdown` and fades on release, as a finger's press does, instead of the browser's `:active`. A right click, or a press on a link or a button inside a RadioList option, does not paint the option. Other controls keep `:active` for a mouse. (#8696)
|
|
10
|
+
|
|
11
|
+
#### Fixes
|
|
12
|
+
|
|
13
|
+
- Calendar, DateRangeInput: a two-month calendar whose `max` falls in the month it would open on now opens with that month in the second pane. Before, with `max` set to today, or with a selected value starting in `max`'s month, it opened on that month and the next one, and every day of the next month was disabled while the previous month stayed hidden. The first pane still never goes before `min`'s month, an explicit `focusDate` is shown as given, and a one-month calendar is unchanged. (#11202)
|
|
14
|
+
- Calendar: with `hasWeekNumbers`, each row shows the ISO 8601 week number of its Thursday, the ISO week that holds most of its days. Before, most rows that start on Sunday or Saturday showed the previous ISO week, so the first two rows of a month could show the same number. Rows that start on Monday are unchanged. (#11271)
|
|
15
|
+
- DateInput, DateTimeInput: a typed date that the calendar does not have, such as February 30, shows "Enter a real date". The message names the calendar, as in "Enter a real date (Persian Calendar)", only when the field's calendar differs from the `InternationalizationProvider` calendar. A day that `dateConstraints` rules out shows "Enter an available date". (#11309)
|
|
16
|
+
- DateInput keeps its typed field's and native field's bookkeeping in state. A render React discards, as a suspended transition does, no longer drops typed text, clears a refused date, or reports the same date twice. (#10877)
|
|
17
|
+
- DateTimeInput keeps its native pickers' last value and commit epoch in state. A render React discards, as a suspended transition does, no longer drops a time chosen before the date, clears a refused date or time, or lets the same native edit commit twice. (#10861)
|
|
18
|
+
- Drawer keeps the side it exits to in state. A render React discards, as a suspended transition does, no longer changes the edge a closing drawer slides out to. (#10859)
|
|
19
|
+
- useLinkify and RichTextEditorAutoLinkPlugin: email detection now takes linear time. A long word with no email in it, such as a pasted hash or base64 string, no longer freezes the page for seconds. Valid email addresses link as before, with three exceptions. In the rich-text editor, an address directly after a period no longer links, and a quoted local part ends at the next quote. In useLinkify, a fragment glued to the end of an earlier address no longer links on its own. (#11306)
|
|
20
|
+
- Dialog, CommandPalette, BottomSheet, Lightbox, Drawer, MobileNav, Popover: a Tab pressed with Ctrl or Meta on the first or last control of a modal no longer moves focus to the other end, and the modal no longer cancels the press. A page or a host app that handles Ctrl+Tab or Meta+Tab itself, for example to switch its own tabs, now gets the press on every control, as it already did between the first and the last. Alt+Tab still wraps, because Safari moves focus to each item on Option+Tab. (#11247)
|
|
21
|
+
- Gestures in a same-origin iframe or a Picture-in-Picture window now time touches on that window's own clock. Before, a short tap there could start a long press, because the page's clock reads ahead of the window's. (#11155)
|
|
22
|
+
- `Item`'s swipe actions: under `reveal`, a fling opens the row at its actions; under either model a fling never fires an entry. On a side with two or more entries, only a drag that starts on the open row fires the outermost entry. The panel shows no entry's colour behind another. The entries fill it, and the entry that fires covers it until the row comes back or holds out. No API changes. (#11054)
|
|
23
|
+
- Keep disabled Item actions focusable (#11169)
|
|
24
|
+
- After the window loses focus during a finger's press, lifting that finger no longer acts on any menu (DropdownMenu, MoreMenu, ContextMenu, Selector, and menus built on the public `useMenuPress`), and a tap on a menu's trigger still opens it. Under a finger, a row lit by a press that is cancelled (a scroll, a second finger, the window losing focus) now clears, as on iOS. It clears in DropdownMenu and its sub-menus under any `presentation`, MoreMenu, ContextMenu, Selector's list and the bottom sheet's action list, and in a menu built on the public `useMenuPress` whose root can take focus. A mouse keeps its highlight. (#8508)
|
|
25
|
+
- The menu press model behind DropdownMenu, ContextMenu and their submenus syncs its option, step and trigger-context refs at commit. A press after a render React discards, as a suspended transition does, now uses the committed options. (#10901)
|
|
26
|
+
- The mobile keyboard hook syncs its enabled, expanded and open flags at commit. After a render React discards, as a suspended transition does, a dismissal and the keyboard's listeners follow the committed options. (#10914)
|
|
27
|
+
- Outline's scroll spy reads its items, its `onActiveIdChange` and its active item as committed. A render React discards, as a suspended transition does, no longer changes which item a scroll marks or which callback a landed navigation calls. (#10802)
|
|
28
|
+
- Carousel paging: a row that resizes while it settles no longer stops at once or runs back to an earlier page. The settle plays on at its speed, to the last page when it was heading there, and otherwise to the page nearest where it was heading. It ends on that page with no step when it goes back to native scrolling. A resize that leaves the row past its new last page, or that gives the row its first width, still lands it at once on the page it was heading for. (#10592)
|
|
29
|
+
- ResizeHandle reads its region, direction and disabled state as committed. A render React discards, as a suspended transition does, no longer makes a key press resize another region or refuse an enabled handle. (#10803)
|
|
30
|
+
- In a swizzled AppShell, the first Tab into the main region now stops on the region, as in the package's AppShell, when its first link or button sits inside a package scroll region that does not overflow (ScrollableArea, Table, CodeBlock, Tokenizer, BottomSheet), and the reverse. Arrow and Page keys are unchanged. No API changes. (#11225)
|
|
31
|
+
- A disabled `Step` now reflects `disabled` on the `step-indicator` theming target, beside `step-label`, so a theme can restyle a disabled step's indicator. In a compact horizontal `Stepper` with on-track indicators, where a disabled step's label is not shown, the indicator is the only target a theme can reach. The `step` and `step-description` targets do not gain the selector. (#8997) (#9192)
|
|
32
|
+
- `useStreamingText` keeps where its reveal restarts in state. A render React discards, as a suspended transition does, no longer restarts a streaming reveal from the start or jumps it to the end. (#10862)
|
|
33
|
+
- Table keeps one array for each list of columns, and for each list of plugins, compared by identity. A render React throws away, as a suspended transition does, can no longer replace the array the table last displayed. The next committed render reuses the array, so rows skip rendering when the columns and plugins match the committed ones. `useBaseTablePlugins` also keeps its array when the base plugins come in a new array of the same plugins. A column plugin with its own render-time cache, such as the tree plugin, still re-renders every row. (#10940)
|
|
34
|
+
- `useTableSortableState` sorts only when its data, sort or locale changes. It re-sorted every row on every render of its owner. (#10942)
|
|
35
|
+
- Table sorting with `useTableSortableState` calls the latest `onSortChange`. Before, a sort header kept the handler from the last time the sort changed, so a parent that passed a new handler without a sort change had its old handler called, and that handler saw out-of-date state. (#11349)
|
|
36
|
+
- Text and Heading: on Android, the first tap on a button or link inside truncated text opens the truncation tooltip, as on iOS. The tap focused the element first, and that focus took the tap; now only a keyboard focus counts. Tooltip: a tap on a text field inside a tooltip's trigger focuses the field and no longer opens or closes the tooltip. This includes a text field inside truncated text. (#11213)
|
|
37
|
+
- A Timestamp hover card's copy button now shows when the clipboard write fails, as CodeBlock's copy button does: the icon becomes a cross for 1.5 seconds, and the button is named, tooltipped and announces "Failed to copy value to clipboard." It used to do nothing. A theme that maps the `timestamp-copy` slot keeps its rest glyph during a failure (`copied` is false). The error itself is not shown. (#10434)
|
|
38
|
+
- ToastViewport syncs its committed list at commit. A toast that only a render React discards showed, such as a suspended transition, reports no `onHide` when a repeat replaces it and the same handler then dismisses it. (#10902)
|
|
39
|
+
- Tokenizer's sheet numbers its searches and its opens in state. A render React discards, as a suspended transition does, no longer makes a reopen announce a search that never ran. (#10886)
|
|
40
|
+
- In Tokenizer's inline field on a touch screen (a tablet, or `presentation="popover"` on a phone), removing a token with a finger no longer raises the touch keyboard. A tap on a token's own remove button (Token's ×) used to move focus to the field's input inside the tap, which makes iOS and Android show their keyboard; when the input was not focused before the tap (the keyboard was down), focus now stays where it was, unless the tapped × or another control in its token held focus, when focus moves to the input as before. A tap made while typing, a pen's tap, a mouse click, a key press on the remove button, and a remove control drawn by a custom `renderToken` still put focus in the input. PowerSearch's filter tokens, which render Token, get the same fix. (#8160)
|
|
41
|
+
|
|
42
|
+
#### Documentation
|
|
43
|
+
|
|
44
|
+
- Hook docs for `useThemeName`, so `astryx hook useThemeName` and `astryx search` return it, and a `useThemeName — Active theme` example block: the name of the theme wrapped around the caller. (#11235)
|
|
45
|
+
- List's anatomy now names its optional header and drops a description part that List does not render. The `ref` docs now say that the ref reaches the list element, with or without a header. (#11277)
|
|
46
|
+
- `DefinedTheme.__componentIcons` is now documented public API; its presence and shape follow the compatibility policy. (#11192)
|
|
47
|
+
|
|
48
|
+
#### Other Changes
|
|
49
|
+
|
|
50
|
+
- Internal: Core's internal touch entry re-exports UIKit's timing table and the motion engine's AnimateOptions and MotionHandle types for Lab's SearchField. Apps import nothing new. (#10956)
|
|
51
|
+
- Internal: the close button name of Lab's SearchField joins Core's message catalog. Apps import nothing new. (#10956)
|
|
52
|
+
- Internal: Core adds two internal hooks that keep a ref at the latest committed prop or callback for event and gesture callbacks, and an internal entry through which Lab reaches them. Outline's scroll spy, ResizeHandle and resizing logic, menu press handling, the mobile keyboard hook, and ToastViewport use them. Apps import nothing new. (#11352)
|
|
53
|
+
- Internal: one shared context request from a long press, a right click, or Shift+F10 and the context-menu key, reporting which input made it, one per gesture. A held finger's hold loses to a claim another gesture already made on that finger, and a control that keeps its press for a hold-repeat owns only its hold, so its right click and Shift+F10 still reach the request. A held pen's own context menu event is refused like a held finger's. The hold is UIKit's long press and requests as it begins. Not exported from the package entry point. (#8670)
|
|
54
|
+
- Internal: Core's internal layer hook drops a dismissal-check field that no component reads. The layer still refuses to reopen during the press that closed it. Apps see no change. (#11332)
|
|
55
|
+
- Internal: Markdown records its streaming fade-in refs as an exception to the runtime's ref rule, with tests that pin why it is harmless. (#10939)
|
|
56
|
+
- Internal: the rule that ends a container's press for a press on a nested control is named for every pointer it covers, and its comments and records say what it does. No change to any component's behavior or API. (#11304)
|
|
57
|
+
|
|
58
|
+
#### Contributors
|
|
59
|
+
|
|
60
|
+
Thanks to everyone who contributed to this release:
|
|
61
|
+
|
|
62
|
+
- @aashish254
|
|
63
|
+
- @ChenyangLi4288
|
|
64
|
+
- @cixzhang
|
|
65
|
+
- @duytbp
|
|
66
|
+
- @Geervan
|
|
67
|
+
- @nynexman4464
|
|
68
|
+
- @popsiclelmlm
|
|
69
|
+
- @Varshavia
|
|
70
|
+
- @vjeux
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
3
74
|
# 0.7.14
|
|
4
75
|
|
|
5
76
|
#### New Features
|
|
@@ -5022,7 +5093,6 @@ This release makes **bare component names canonical**: `Button`, `Stack`, `useTh
|
|
|
5022
5093
|
- **Un-prefix migration — bare names are canonical** — Every `XDS*` component, hook, and type now has a bare alias (`XDSButton` → `Button`, `useXDSTheme` → `useTheme`, ~634 identifiers across 100 barrels). The prefixed names still work as aliases during the compat window, so this is non-breaking if you do nothing — but bare names are the new default for docs, discovery, and new code. (#2941)
|
|
5023
5094
|
**Codemod:** `npx astryx upgrade --codemod drop-xds-prefix-imports`
|
|
5024
5095
|
- **`@xds/core` un-prefix** — `XDSMetaAppShell` → `MetaAppShell` and related meta-app exports drop the `XDS` prefix. (#2957)
|
|
5025
|
-
**Codemod:** `npx astryx upgrade --codemod drop-xds-meta-prefix`
|
|
5026
5096
|
- **DatePicker components renamed to Input** — `XDSDateTimePicker` → `XDSDateTimeInput` and `XDSDateRangePicker` → `XDSDateRangeInput` (plus their props, size, and hour-format types), for consistency with `DateInput`/`TextInput`/`NumberInput`. (#2276)
|
|
5027
5097
|
**Codemod:** `npx astryx upgrade --codemod rename-date-picker-to-input`
|
|
5028
5098
|
- **Stack `element` → `as`** — `XDSStack`, `XDSHStack`, `XDSVStack`, and `XDSStackItem` use `as` instead of `element`, matching other polymorphic components. (#2441)
|
|
@@ -5048,7 +5118,7 @@ This release makes **bare component names canonical**: `Button`, `Stack`, `useTh
|
|
|
5048
5118
|
npx astryx upgrade --apply
|
|
5049
5119
|
```
|
|
5050
5120
|
|
|
5051
|
-
This runs the release codemods in sequence. The bare-name migration (`drop-xds-prefix-imports
|
|
5121
|
+
This runs the release codemods in sequence. The bare-name migration (`drop-xds-prefix-imports`) and the theme data-attribute migration (`migrate-theme-selectors-to-data-attrs`) are optional — run them explicitly when you're ready, e.g.:
|
|
5052
5122
|
|
|
5053
5123
|
```bash
|
|
5054
5124
|
npx astryx upgrade --codemod drop-xds-prefix-imports --codemod-only --apply
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA+B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAYvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,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tB,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D;;;OAGG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CAC7D;AAyJD,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,KAAK,EACL,eAAe,EACf,MAAM,EACN,KAAK,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,cAAsB,EACtB,cAAc,EACd,eAAe,EACf,qBAA4B,EAC5B,kBAA0B,EAC1B,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,GAAG,KAAK,EACT,EAAE,qBAAqB,+BAgiBvB;yBA1jBe,gBAAgB"}
|
|
@@ -527,9 +527,9 @@ export function BottomSheetPanel({
|
|
|
527
527
|
|
|
528
528
|
// Everything derived from the snap points keys off their identity, not the
|
|
529
529
|
// array's: the resolver's identity is the hook's signal that the stops
|
|
530
|
-
// changed, so it must not churn on a re-render the drag caused. The
|
|
531
|
-
// reads the points through a ref, so
|
|
532
|
-
//
|
|
530
|
+
// changed, so it must not churn on a re-render the drag caused. The resolver
|
|
531
|
+
// reads the points through a ref, so it resolves them at call time —
|
|
532
|
+
// against whatever the viewport is then, not what it was at memo time.
|
|
533
533
|
const snapPointsKey = snapPointsKeyFor(snapPoints);
|
|
534
534
|
const snapPointsRef = useRef(snapPoints);
|
|
535
535
|
snapPointsRef.current = snapPoints;
|
|
@@ -543,11 +543,12 @@ export function BottomSheetPanel({
|
|
|
543
543
|
ignoredSnapPointsMessage: ''
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
|
-
const ignored = (
|
|
546
|
+
const ignored = (snapPoints ?? []).filter(point => !isValidSnapPoint(point));
|
|
547
547
|
return {
|
|
548
548
|
snapHeights: () => resolveSnapPoints(snapPointsRef.current ?? [], layoutViewportHeight()),
|
|
549
549
|
ignoredSnapPointsMessage: ignored.length === 0 ? '' : `snapPoints ignored ${JSON.stringify(ignored)}. A snap point is a viewport fraction above 0 and up to 1 (0.5 is half the screen), a px length ('320px'), or a percentage ('50%').`
|
|
550
550
|
};
|
|
551
|
+
// eslint-disable-next-line @eslint-react/exhaustive-deps -- keyed by the snap points' identity, not the array's
|
|
551
552
|
}, [snapPointsKey]);
|
|
552
553
|
useDevWarning('BottomSheet', ignoredSnapPointsMessage, ignoredSnapPointsMessage !== '');
|
|
553
554
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../../src/CheckboxInput/CheckboxInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,UAAU,EAGf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxInput.d.ts","sourceRoot":"","sources":["../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ergeProps } from "../utils/mergeProps.js";
|
|
28
28
|
import { rtlStyles } from "../utils/rtlStyles.js";
|
|
29
29
|
import { withholdCallerHandlers } from "../utils/disabledInteraction.js";
|
|
30
|
-
import "../Indicator/indicator.markers.stylex.js";
|
|
31
30
|
import { indicatorScope } from "../Indicator/indicator.markers.stylex.js";
|
|
32
31
|
import "../internal/indicatorPress.stylex.js";
|
|
33
32
|
import { indicatorPressScope } from "../internal/indicatorPress.stylex.js";
|
|
@@ -40,6 +39,7 @@ import { themeProps } from "../utils/themeProps.js";
|
|
|
40
39
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
41
40
|
import { useTouchHitArea } from "../utils/touchHitArea.js";
|
|
42
41
|
import { pressBoxProps } from "../privateAttributes/pressBox.stylex.js";
|
|
42
|
+
import { indicatorPressPaintStyles } from "../privateAttributes/press.stylex.js";
|
|
43
43
|
import { registerBoxHold } from "../utils/boxHold.js";
|
|
44
44
|
import { touchHitAreaStyles } from "../internal/touchHitArea.stylex.js";
|
|
45
45
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
@@ -50,19 +50,6 @@ registerEnglishFallback(english);
|
|
|
50
50
|
// Registered here, not in the press controller, so a page with no box carries
|
|
51
51
|
// none of its code.
|
|
52
52
|
registerBoxHold();
|
|
53
|
-
|
|
54
|
-
/** Written by the press controller while the row is pressed. */
|
|
55
|
-
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
56
|
-
/** Written by the press controller for the press's release. */
|
|
57
|
-
const PRESSED_FADING = '[data-astryx-press="fading"]';
|
|
58
|
-
/** The row is pressed, and the press controller does not paint the press. */
|
|
59
|
-
const ACTIVE_UNPAINTED = `:active:not(${PRESSED_ON},${PRESSED_FADING})`;
|
|
60
|
-
|
|
61
|
-
// The touch press's paint, declared by the shared overlay styles on the
|
|
62
|
-
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
63
|
-
// 1 while on and 1 → 0 over the release, and inherited resolved by the layer
|
|
64
|
-
// that paints it. See interactionOverlay.stylex.ts.
|
|
65
|
-
const pressedOverlayImage = 'var(--_press-paint-image)';
|
|
66
53
|
const styles = {
|
|
67
54
|
container: {
|
|
68
55
|
k1xSpc: "x78zum5",
|
|
@@ -78,11 +65,6 @@ const styles = {
|
|
|
78
65
|
kVAEAm: "xrxqdxo",
|
|
79
66
|
$$css: true
|
|
80
67
|
},
|
|
81
|
-
indicatorPressImage: {
|
|
82
|
-
"--_indicator-press-image": "x1dueop1 x189o2zt",
|
|
83
|
-
"--_indicator-active-press": "x1qwhovg x858ff1",
|
|
84
|
-
$$css: true
|
|
85
|
-
},
|
|
86
68
|
indicatorRowPressImage: {
|
|
87
69
|
"--_indicator-press-image": "x1y1g3jp",
|
|
88
70
|
"--_indicator-active-press": "x1bl9l2n",
|
|
@@ -103,8 +85,6 @@ const styles = {
|
|
|
103
85
|
kv0HGH: "xarstr8",
|
|
104
86
|
kUfP38: "xtb6wbx",
|
|
105
87
|
kloYau: "x2q1x1w",
|
|
106
|
-
ks3ayO: "xyhc2n1 xur6jaf xtawv5c",
|
|
107
|
-
kNctxI: "x178sc5r x1d4iov5",
|
|
108
88
|
$$css: true
|
|
109
89
|
},
|
|
110
90
|
indicatorRowPressOverlay: {
|
|
@@ -328,7 +308,11 @@ export function CheckboxInput({
|
|
|
328
308
|
...stylex.props(styles.container, isLabelHidden && styles.containerLabelHidden, hasHitArea && styles.hitAreaHost, hasHitArea && touchHitAreaStyles.layer,
|
|
329
309
|
// Hover and focus reach the checkbox visual through this ancestor
|
|
330
310
|
// marker rather than props, so the whole row drives it.
|
|
331
|
-
!isDisabled && indicatorScope,
|
|
311
|
+
!isDisabled && indicatorScope,
|
|
312
|
+
// An indicator in another package may not name the private press
|
|
313
|
+
// attribute. So the row hands its press image down to an indicator
|
|
314
|
+
// that paints its own press (`indicatorPressPaintStyles.handDown`).
|
|
315
|
+
!isDisabled && (isRowPressSurface ? styles.indicatorRowPressImage : indicatorPressPaintStyles.handDown),
|
|
332
316
|
// The touch press's strength and release live on the row the
|
|
333
317
|
// controller writes to; the layer over the checkbox box inherits
|
|
334
318
|
// and paints it. Under a row that owns the press, the box inherits
|
|
@@ -336,7 +320,10 @@ export function CheckboxInput({
|
|
|
336
320
|
ownsPress && interactionOverlayStyles.pressedAlpha),
|
|
337
321
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
338
322
|
...(isDisabled ? undefined : pressBoxProps),
|
|
339
|
-
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay,
|
|
323
|
+
...stylex.props(styles.checkboxWrapper, wrapperSizeStyles[size], !isDisabled && styles.indicatorPressOverlay,
|
|
324
|
+
// Under a row that owns the press, the row's own overlay paints
|
|
325
|
+
// instead of the owner's press paint.
|
|
326
|
+
!isDisabled && (isRowPressSurface ? styles.indicatorRowPressOverlay : [indicatorPressPaintStyles.activeFill, indicatorPressPaintStyles.image])),
|
|
340
327
|
...focusProps,
|
|
341
328
|
children: [/*#__PURE__*/_jsx("input", {
|
|
342
329
|
...withholdCallerHandlers(rest, isDisabled),
|
|
@@ -2,6 +2,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
2
2
|
import { type InputStatus } from '../Field/index.js';
|
|
3
3
|
import { type ISODateString, type DayOfWeek, type DayOfWeekName } from '../Calendar/index.js';
|
|
4
4
|
import type { CalendarSystem } from '../utils/calendarSystem.js';
|
|
5
|
+
import { type DateInputEntryError } from './useTypedDate.js';
|
|
5
6
|
import type { TimestampFormat } from '../Timestamp/index.js';
|
|
6
7
|
import { type PickerPresentation } from '../utils/inputPresentation.js';
|
|
7
8
|
declare const sizeStyles: Readonly<{
|
|
@@ -48,6 +49,7 @@ export type DateInputNativePicker = 'touch' | 'always' | 'never';
|
|
|
48
49
|
export type DateInputPresentation = PickerPresentation;
|
|
49
50
|
export type DateInputFormat = Extract<TimestampFormat, 'date' | 'date_long' | 'date_weekday' | 'system_date'>;
|
|
50
51
|
export type { InputStatus as DateInputStatus, InputStatusType as DateInputStatusType, } from '../Field/index.js';
|
|
52
|
+
export type { DateInputEntryError } from './useTypedDate.js';
|
|
51
53
|
import { type FieldInputBaseProps } from '../Field/fieldParts.js';
|
|
52
54
|
import type { SizeValue } from '../utils/types.js';
|
|
53
55
|
import type { FieldStatusPlacement } from '../Field/fieldStatusPlacement.js';
|
|
@@ -153,8 +155,50 @@ export interface DateInputProps extends Omit<FieldInputBaseProps<HTMLInputElemen
|
|
|
153
155
|
* Status indicator for the input.
|
|
154
156
|
* When set, displays a colored border and status icon.
|
|
155
157
|
* If message is provided, displays below the input.
|
|
158
|
+
*
|
|
159
|
+
* For a typed date the field rejects, and for unfinished text that Enter or
|
|
160
|
+
* blur keeps, the field shows its own error message in place of `status`.
|
|
161
|
+
* Unreadable text is announced, not shown. With `onEntryErrorChange`, an
|
|
162
|
+
* `error` status with a message shows instead, and the field's own message
|
|
163
|
+
* applies only without one. A `warning` or `success` status never replaces
|
|
164
|
+
* a rejection.
|
|
156
165
|
*/
|
|
157
166
|
status?: InputStatus;
|
|
167
|
+
/**
|
|
168
|
+
* Called each time the field's rejection of typed text changes, with `null`
|
|
169
|
+
* when the rejection ends. `kind` is `'unreadable'`, `'incomplete'`,
|
|
170
|
+
* `'nonexistent'` (a date the calendar does not have), `'outOfRange'` (before
|
|
171
|
+
* `min` or after `max`), or `'unavailable'` (a day `dateConstraints` rules
|
|
172
|
+
* out). `text` is the typed text, and `date` is the Gregorian ISO date the
|
|
173
|
+
* text names, for `'outOfRange'` and `'unavailable'`.
|
|
174
|
+
*
|
|
175
|
+
* It also runs when a new `min`, `max`, `dateConstraints`, or `value`, a
|
|
176
|
+
* calendar pick, disabling the field, or Enter or blur changes the
|
|
177
|
+
* rejection, and never twice for the same rejection. It reports `null` when
|
|
178
|
+
* the typed field leaves while its rejection stands, as when a presentation
|
|
179
|
+
* or pointer change shows the native or touch picker. Passing it lets an
|
|
180
|
+
* `error` `status` word the rejection (see `status`). A rejection that
|
|
181
|
+
* starts under an unchanged error message announces that message once. The
|
|
182
|
+
* native and touch pickers take no typed text, so they report no rejection.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```
|
|
186
|
+
* const [entryError, setEntryError] = useState<DateInputEntryError | null>(null);
|
|
187
|
+
* <DateInput
|
|
188
|
+
* label="Due"
|
|
189
|
+
* value={date}
|
|
190
|
+
* onChange={setDate}
|
|
191
|
+
* max="2026-12-31"
|
|
192
|
+
* onEntryErrorChange={setEntryError}
|
|
193
|
+
* status={
|
|
194
|
+
* entryError?.kind === 'outOfRange'
|
|
195
|
+
* ? {type: 'error', message: 'Pick a date this year'}
|
|
196
|
+
* : undefined
|
|
197
|
+
* }
|
|
198
|
+
* />
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
onEntryErrorChange?: (error: DateInputEntryError | null) => void;
|
|
158
202
|
/**
|
|
159
203
|
* How the status message is placed relative to the input.
|
|
160
204
|
* - 'attached': message overlaps directly below the input (bordered treatment)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAkBrB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,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;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;IAE9D;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC;AAujBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BA+C9C;yBA/Ce,SAAS"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DateInput.tsx
|
|
7
7
|
* @input Uses React, useId, useCallback, useRef, useTypedDateField, Field, Icon, Calendar, usePopover, InputGroupContext
|
|
8
|
-
* @output Exports DateInput component, DateInputProps
|
|
8
|
+
* @output Exports DateInput component, DateInputProps, and DateInputEntryError
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by DateInput.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -173,6 +173,7 @@ function PointerDateField({
|
|
|
173
173
|
placeholder: placeholderFromProps,
|
|
174
174
|
size: sizeProp,
|
|
175
175
|
status,
|
|
176
|
+
onEntryErrorChange,
|
|
176
177
|
statusVariant = 'attached',
|
|
177
178
|
labelTooltip,
|
|
178
179
|
hasClear = false,
|
|
@@ -305,6 +306,7 @@ function PointerDateField({
|
|
|
305
306
|
isDisabled: isEffectivelyDisabled,
|
|
306
307
|
status,
|
|
307
308
|
isStatusAnnounced: !inputGroup,
|
|
309
|
+
onEntryErrorChange,
|
|
308
310
|
hasPlaceholder: placeholderFromProps != null
|
|
309
311
|
});
|
|
310
312
|
const {
|
|
@@ -663,6 +665,8 @@ export function DateInput(props) {
|
|
|
663
665
|
presentation: _presentation,
|
|
664
666
|
nativePicker: _nativePicker,
|
|
665
667
|
calendar: _calendar,
|
|
668
|
+
// Only the pointer field takes typed text.
|
|
669
|
+
onEntryErrorChange,
|
|
666
670
|
...rest
|
|
667
671
|
} = props;
|
|
668
672
|
switch (surface) {
|
|
@@ -683,7 +687,8 @@ export function DateInput(props) {
|
|
|
683
687
|
return /*#__PURE__*/_jsx(PointerDateField, {
|
|
684
688
|
...rest,
|
|
685
689
|
calendar: calendar,
|
|
686
|
-
isDisabled: isDisabled
|
|
690
|
+
isDisabled: isDisabled,
|
|
691
|
+
onEntryErrorChange: onEntryErrorChange
|
|
687
692
|
});
|
|
688
693
|
}
|
|
689
694
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/NativeDateField.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAqNhD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,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,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAGhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,aAAa,EAC3B,MAAoB,EACpB,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,GAAG,SAAS,EACb,EAAE,cAAc,+
|
|
1
|
+
{"version":3,"file":"NativeDateField.d.ts","sourceRoot":"","sources":["../../src/DateInput/NativeDateField.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAqNhD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,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,WAAW,EAAE,oBAAoB,EACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,aAA0B,EAC1B,YAAY,EACZ,QAAgB,EAGhB,cAAc,EAAE,eAAe,EAC/B,YAAY,EAAE,aAAa,EAC3B,MAAoB,EACpB,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,GAAG,SAAS,EACb,EAAE,cAAc,+BA2chB;yBA9ee,eAAe"}
|
|
@@ -223,12 +223,18 @@ export function NativeDateField({
|
|
|
223
223
|
// probe touches the DOM, and unfocused the answer changes nothing.
|
|
224
224
|
const [isSegmentEditable, setIsSegmentEditable] = useState(false);
|
|
225
225
|
// The raw value the control last reported and we acted on, so the same edit
|
|
226
|
-
// arriving through both commit paths only fires one change.
|
|
226
|
+
// arriving through both commit paths only fires one change. Each entry
|
|
227
|
+
// belongs to the commit epoch it was made in.
|
|
227
228
|
const lastCommitRef = useRef(null);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
|
|
230
|
+
// The value as last rendered, and an epoch that a value change moves on,
|
|
231
|
+
// retiring the last commit. Both are state: refs written here would keep a
|
|
232
|
+
// value from a render React discards.
|
|
233
|
+
const [prevValue, setPrevValue] = useState(value);
|
|
234
|
+
const [commitEpoch, setCommitEpoch] = useState(0);
|
|
235
|
+
if (value !== prevValue) {
|
|
236
|
+
setPrevValue(value);
|
|
237
|
+
setCommitEpoch(epoch => epoch + 1);
|
|
232
238
|
if (rejectedValue !== null) {
|
|
233
239
|
setRejectedValue(null);
|
|
234
240
|
}
|
|
@@ -267,10 +273,14 @@ export function NativeDateField({
|
|
|
267
273
|
}
|
|
268
274
|
// The same edit can arrive twice — React's synthetic change and the
|
|
269
275
|
// native listener below both report it — so act on a raw value once.
|
|
270
|
-
|
|
276
|
+
const last = lastCommitRef.current;
|
|
277
|
+
if (last !== null && last.epoch === commitEpoch && last.text === newValue) {
|
|
271
278
|
return;
|
|
272
279
|
}
|
|
273
|
-
lastCommitRef.current =
|
|
280
|
+
lastCommitRef.current = {
|
|
281
|
+
text: newValue,
|
|
282
|
+
epoch: commitEpoch
|
|
283
|
+
};
|
|
274
284
|
if (!newValue) {
|
|
275
285
|
setRejectedValue(null);
|
|
276
286
|
if (value !== undefined) {
|
|
@@ -295,7 +305,7 @@ export function NativeDateField({
|
|
|
295
305
|
if (parsedISO !== value) {
|
|
296
306
|
fireChange(parsedISO);
|
|
297
307
|
}
|
|
298
|
-
}, [value, fireChange, isDateDisabled, isEffectivelyDisabled, isBusy, locale]);
|
|
308
|
+
}, [value, commitEpoch, fireChange, isDateDisabled, isEffectivelyDisabled, isBusy, locale]);
|
|
299
309
|
const handleChange = useCallback(e => {
|
|
300
310
|
commitValue(e.target.value);
|
|
301
311
|
}, [commitValue]);
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @position Package entry point for DateInput
|
|
6
6
|
*/
|
|
7
7
|
export { DateInput } from './DateInput.js';
|
|
8
|
-
export type { DateInputProps, DateInputSize, DateInputFormat, DateInputNativePicker, DateInputPresentation, DateInputStatus, DateInputStatusType, } from './DateInput.js';
|
|
8
|
+
export type { DateInputProps, DateInputSize, DateInputFormat, DateInputNativePicker, DateInputPresentation, DateInputStatus, DateInputStatusType, DateInputEntryError, } from './DateInput.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateInput/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateInput/index.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
|
@@ -5,6 +5,28 @@ import type { ISODateString, PlainDate } from '../utils/dateTypes.js';
|
|
|
5
5
|
import { type SharedDateFormat } from '../utils/plainDate.js';
|
|
6
6
|
/** A rejected typed date, by the message it announces. */
|
|
7
7
|
export type TypedDateError = 'unreadable' | 'nonexistent' | 'outOfRange';
|
|
8
|
+
/**
|
|
9
|
+
* Why a date field rejects the text that a person typed. The field reports it
|
|
10
|
+
* through `onEntryErrorChange`, so the app can word its own message.
|
|
11
|
+
*/
|
|
12
|
+
export interface DateInputEntryError {
|
|
13
|
+
/**
|
|
14
|
+
* The reason, independent of the locale and the calendar:
|
|
15
|
+
* - `'unreadable'`: text that is not a date
|
|
16
|
+
* - `'incomplete'`: part of a date that Enter or blur cannot finish
|
|
17
|
+
* - `'nonexistent'`: a date that the calendar does not have
|
|
18
|
+
* - `'outOfRange'`: a date before `min` or after `max`
|
|
19
|
+
* - `'unavailable'`: a date that `dateConstraints` rules out
|
|
20
|
+
*/
|
|
21
|
+
kind: 'unreadable' | 'incomplete' | 'nonexistent' | 'outOfRange' | 'unavailable';
|
|
22
|
+
/** The typed text. */
|
|
23
|
+
text: string;
|
|
24
|
+
/**
|
|
25
|
+
* The Gregorian ISO date that the text names. It is set for `outOfRange` and
|
|
26
|
+
* `unavailable`.
|
|
27
|
+
*/
|
|
28
|
+
date?: ISODateString;
|
|
29
|
+
}
|
|
8
30
|
export interface UseTypedDateOptions {
|
|
9
31
|
/** The component that names itself in development warnings. */
|
|
10
32
|
source: string;
|
|
@@ -59,10 +81,19 @@ export interface UseTypedDateFieldOptions extends UseTypedDateOptions {
|
|
|
59
81
|
* date typing already reported gives way to the field's value.
|
|
60
82
|
*/
|
|
61
83
|
isDisabled: boolean;
|
|
62
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* The caller's status. Rejected text that stays shows its own error instead,
|
|
86
|
+
* except that a caller with `onEntryErrorChange` words the error: its error
|
|
87
|
+
* status shows in place of the field's own message.
|
|
88
|
+
*/
|
|
63
89
|
status?: InputStatus;
|
|
64
90
|
/** Whether the shown status announces itself, as Field's status does. */
|
|
65
91
|
isStatusAnnounced: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Reports each change of the typed rejection, and null when it ends or when
|
|
94
|
+
* the field unmounts while it stands.
|
|
95
|
+
*/
|
|
96
|
+
onEntryErrorChange?: (error: DateInputEntryError | null) => void;
|
|
66
97
|
/** Whether the caller gave a placeholder, which replaces the format hint. */
|
|
67
98
|
hasPlaceholder: boolean;
|
|
68
99
|
}
|
|
@@ -77,7 +108,7 @@ export interface TypedDateField {
|
|
|
77
108
|
isInvalid: boolean;
|
|
78
109
|
/** The status the field shows. */
|
|
79
110
|
fieldStatus: InputStatus | undefined;
|
|
80
|
-
/**
|
|
111
|
+
/** The rejection message that the field status does not announce. */
|
|
81
112
|
alertMessage: string;
|
|
82
113
|
handleChange: (text: string) => void;
|
|
83
114
|
/** Commits typed text, on Enter or blur. */
|
|
@@ -88,5 +119,5 @@ export interface TypedDateField {
|
|
|
88
119
|
reset: () => void;
|
|
89
120
|
}
|
|
90
121
|
/** The typed entry of a date text field: its text, rejections, and commits. */
|
|
91
|
-
export declare function useTypedDateField({ value, shownValue, onChange, onClear, onTypedDate, isDisabled, status, isStatusAnnounced, hasPlaceholder, ...options }: UseTypedDateFieldOptions): TypedDateField;
|
|
122
|
+
export declare function useTypedDateField({ value, shownValue, onChange, onClear, onTypedDate, isDisabled, status, isStatusAnnounced, onEntryErrorChange, hasPlaceholder, ...options }: UseTypedDateFieldOptions): TypedDateField;
|
|
92
123
|
//# sourceMappingURL=useTypedDate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTypedDate.d.ts","sourceRoot":"","sources":["../../src/DateInput/useTypedDate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTypedDate.d.ts","sourceRoot":"","sources":["../../src/DateInput/useTypedDate.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAQhD,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,uBAAuB,EAM7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,oBAAoB,CAAC;AAI5B,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;OAOG;IACH,IAAI,EACF,YAAY,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,aAA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