@astryxdesign/core 0.7.14-canary.gfdb9213 → 0.7.15-canary.g79b95eb
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 +84 -0
- package/dist/AppShell/useAppShellMainId.d.ts.map +1 -1
- package/dist/AppShell/useAppShellMainId.js +14 -8
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +4 -8
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +11 -2
- package/dist/Calendar/getInitialFocusDate.d.ts +8 -3
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -1
- package/dist/Calendar/getInitialFocusDate.js +42 -7
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +9 -4
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +3 -8
- package/dist/DateInput/useTypedDate.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.js +3 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +6 -3
- package/dist/DateTimeInput/NativeDateSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeDateSegment.js +23 -9
- package/dist/DateTimeInput/NativeTimeSegment.d.ts.map +1 -1
- package/dist/DateTimeInput/NativeTimeSegment.js +22 -8
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +7 -5
- package/dist/DropdownMenu/DropdownMenu.d.ts +10 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +5 -5
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +5 -1
- package/dist/FileInput/FileInput.d.ts +5 -4
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +5 -1
- package/dist/Item/Item.d.ts +1 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -2
- package/dist/Link/useLinkify.d.ts.map +1 -1
- package/dist/Link/useLinkify.js +3 -2
- package/dist/List/List.d.ts +4 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/listLayoutUpdates.d.ts.map +1 -1
- package/dist/List/listLayoutUpdates.js +7 -2
- package/dist/List/listReorderContext.d.ts +16 -2
- package/dist/List/listReorderContext.d.ts.map +1 -1
- package/dist/List/listReorderContext.js +2 -0
- package/dist/List/listReorderEngine.d.ts +8 -4
- package/dist/List/listReorderEngine.d.ts.map +1 -1
- package/dist/List/listReorderEngine.js +30 -19
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +8 -0
- package/dist/MoreMenu/MoreMenu.d.ts +3 -3
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +19 -4
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts +43 -15
- package/dist/SegmentedControl/useSegmentedSelectionMotion.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedSelectionMotion.js +108 -18
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +5 -0
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +7 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +2 -0
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +85 -12
- package/dist/astryx.css +11 -10
- package/dist/gestures/GestureHost.d.ts +5 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +54 -28
- package/dist/gestures/PanGestureRecognizer.d.ts +6 -6
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/PanGestureRecognizer.js +14 -7
- package/dist/gestures/tapWobble.d.ts +20 -0
- package/dist/gestures/tapWobble.d.ts.map +1 -0
- package/dist/gestures/tapWobble.js +22 -0
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +4 -1
- package/dist/hooks/menuPressGesture.d.ts +44 -8
- package/dist/hooks/menuPressGesture.d.ts.map +1 -1
- package/dist/hooks/menuPressGesture.js +99 -12
- package/dist/hooks/scrollOwnerRegistry.d.ts +0 -1
- package/dist/hooks/scrollOwnerRegistry.d.ts.map +1 -1
- package/dist/hooks/scrollOwnerRegistry.js +4 -1
- package/dist/hooks/useClickableContainer.d.ts +6 -4
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +11 -8
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +6 -0
- package/dist/hooks/useMenuPress.d.ts +34 -50
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +240 -136
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +38 -23
- package/dist/i18n/generated-english/DateInput/useTypedDate.generated.js +2 -2
- package/dist/i18n/generated-locales/en.generated.js +2 -2
- package/dist/i18n/generated-locales/pseudo.generated.js +2 -2
- package/dist/motion/uikit/gestures.d.ts +37 -3
- package/dist/motion/uikit/gestures.d.ts.map +1 -1
- package/dist/motion/uikit/gestures.js +21 -3
- package/dist/motion/uikit/segmented.d.ts +35 -7
- package/dist/motion/uikit/segmented.d.ts.map +1 -1
- package/dist/motion/uikit/segmented.js +39 -11
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +1 -1
- package/dist/privateAttributes/pressBox.stylex.d.ts +12 -4
- package/dist/privateAttributes/pressBox.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressBox.stylex.js +21 -4
- package/dist/privateAttributes/tokenRemove.stylex.d.ts +5 -0
- package/dist/privateAttributes/tokenRemove.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/tokenRemove.stylex.js +25 -0
- package/dist/theme/defineTheme.d.ts +0 -1
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/utils/inputAge.d.ts +5 -2
- package/dist/utils/inputAge.d.ts.map +1 -1
- package/dist/utils/inputAge.js +4 -1
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +60 -9
- package/locales/en.json +3 -3
- package/locales/pseudo.json +2 -2
- package/package.json +4 -4
- package/src/AppShell/useAppShellMainId.ts +17 -8
- package/src/BottomSheet/useSheetGestures.ts +4 -12
- package/src/Calendar/Calendar.tsx +11 -1
- package/src/Calendar/getInitialFocusDate.ts +70 -8
- package/src/CheckboxInput/CheckboxInput.doc.mjs +16 -2
- package/src/CheckboxInput/CheckboxInput.tsx +32 -23
- package/src/CheckboxList/CheckboxList.doc.mjs +1 -1
- package/src/CheckboxList/CheckboxListItem.tsx +3 -6
- package/src/DateInput/useTypedDate.ts +9 -6
- package/src/DateTimeInput/DateTimeInput.tsx +7 -3
- package/src/DateTimeInput/NativeDateSegment.tsx +28 -10
- package/src/DateTimeInput/NativeTimeSegment.tsx +19 -9
- package/src/Drawer/Drawer.tsx +7 -5
- package/src/DropdownMenu/DropdownMenu.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenu.tsx +16 -12
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +3 -0
- package/src/FileInput/FileInput.doc.mjs +5 -5
- package/src/FileInput/FileInput.tsx +10 -4
- package/src/Item/Item.doc.mjs +2 -1
- package/src/Item/Item.tsx +7 -3
- package/src/Link/useLinkify.tsx +7 -9
- package/src/List/List.doc.mjs +9 -21
- package/src/List/List.tsx +4 -1
- package/src/List/ListItem.doc.mjs +4 -2
- package/src/List/listLayoutUpdates.ts +11 -3
- package/src/List/listReorderContext.ts +17 -1
- package/src/List/listReorderEngine.tsx +33 -19
- package/src/Markdown/Markdown.tsx +7 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -2
- package/src/MoreMenu/MoreMenu.tsx +3 -3
- package/src/RadioList/RadioListItem.tsx +60 -30
- package/src/SegmentedControl/SegmentedControl.doc.mjs +3 -3
- package/src/SegmentedControl/useSegmentedSelectionMotion.ts +115 -19
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +5 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +5 -1
- package/src/Token/Token.tsx +2 -0
- package/src/Tokenizer/Tokenizer.tsx +102 -7
- package/src/gestures/GestureHost.ts +62 -32
- package/src/gestures/PanGestureRecognizer.ts +18 -7
- package/src/gestures/README.md +12 -7
- package/src/gestures/tapWobble.ts +22 -0
- package/src/hooks/focusableSelector.ts +7 -2
- package/src/hooks/menuPressGesture.ts +123 -16
- package/src/hooks/scrollOwnerRegistry.ts +8 -1
- package/src/hooks/useClickableContainer.ts +11 -8
- package/src/hooks/useFocusTrap.ts +6 -0
- package/src/hooks/useMenuPress.doc.mjs +14 -12
- package/src/hooks/useMenuPress.ts +321 -164
- package/src/hooks/useStreamingText.ts +30 -25
- package/src/i18n/generated-english/DateInput/useTypedDate.generated.ts +2 -2
- package/src/i18n/generated-locales/en.generated.ts +2 -2
- package/src/i18n/generated-locales/pseudo.generated.ts +2 -2
- package/src/motion/MEASUREMENTS.md +7 -6
- package/src/motion/uikit/gestures.ts +18 -3
- package/src/motion/uikit/segmented.ts +35 -10
- package/src/privateAttributes/press.stylex.ts +2 -8
- package/src/privateAttributes/pressBox.stylex.ts +23 -4
- package/src/privateAttributes/tokenRemove.stylex.ts +27 -0
- package/src/theme/defineTheme.ts +0 -1
- package/src/theme/useThemeName.doc.mjs +69 -0
- package/src/utils/inputAge.ts +5 -2
- package/src/utils/pressFeedback.ts +80 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.7.14
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- ComplexSelector: `disabledMessage` explains why a disabled selector is disabled. With `isDisabled`, a tooltip shows the reason on hover and keyboard focus, and the reason describes the trigger through `aria-describedby`. The disabled trigger keeps its tab stop, and pointer, keyboard and the imperative handle still cannot open the popup. With `renderTrigger`, the caller owns the control, and `disabledMessage` works with it too: the tooltip and the description go to that control. Drop the control's own tooltip while the selector is disabled, for example `tooltip={isDisabled ? undefined : 'Filter'}`, so it never shows two. Separately, a caller's own `aria-disabled` now reaches an enabled built-in trigger. (#5984)
|
|
8
|
+
- An anchored layer's entrance now slides from, and scales about, the side the layer lands on. Before, a layer that flipped because its requested side had no room still slid from that requested side, onto its trigger. The entrance also scales about the point where the layer meets its trigger, not the center of its box. A Selector list that opens over its selected item scales about the trigger's center and does not slide. This applies to Popover, DropdownMenu and its submenus, ContextMenu, Selector, ComplexSelector, Tooltip, HoverCard, Breadcrumbs and PowerSearch menus, and any layer that uses the shared entrance. Built-in layers have no option that keeps the old entrance. The public `layerAnimations` styles now also set `transform-origin`; a caller's own `transformOrigin` listed after them still wins. (#10771)
|
|
9
|
+
- `useMenuPress` with no `longPressDelayMs` now follows DropdownMenu's finger rules on every device: a finger or a pen opens the menu as it presses (inside a scroll view, once the 150 ms content-touch delay has passed), and the finger that opened it picks a row only after moving 10 px. To keep the previous behavior, a 500 ms hold and a pick at the opening finger's lift, pass `longPressDelayMs: 500`. (#8078)
|
|
10
|
+
- Under a finger or a pen, on every device, the trigger of an anchored DropdownMenu or MoreMenu now opens its menu as it is pressed, instead of after a 500 ms hold. Inside a scroll view it opens once the 150 ms content-touch delay has passed with no scroll, so a scroll that starts on it still scrolls. To keep the previous behavior, a tap that opens at the lift and a 500 ms hold, pass `presentation="popover"`. A menu shown as a bottom sheet, and a mouse, are unchanged. (#8078)
|
|
11
|
+
- SegmentedControl: a drag that drifts off the control keeps choosing by its horizontal position, clamped to the end segments, and the lift commits that segment. A mouse or a pen drags the same way. Escape or a browser cancel takes the press back, and the highlight returns at once. (#10978)
|
|
12
|
+
- Tokenizer is now an InputGroup-compatible control (#3520). Inside an `InputGroup` it consumes `InputGroupContext` instead of rendering its own `Field`, so the group owns the single label, description, and status chrome — no more duplicated label or nested field wrapper. The typeahead input is named by the group label plus the Tokenizer's own label (composed with `getInputARIA`, so `aria-describedby` merges the group's description/status with the input-local disabled reason rather than replacing it), and the control adopts the shared `groupStyles.inGroup` border/radius treatment so it joins the group's seam. The group also owns size, the disabled state, and validation: a disabled group disables its Tokenizer, a grouped Tokenizer takes the group's `size` (an explicit larger `size` no longer escapes the row), and its local `description`/`status` are neither referenced from `aria-describedby` nor painted beside the group's status. Because the group is a fixed-height single-line surface, a grouped Tokenizer keeps its tokens on one scrolling row instead of wrapping past the shared border — cap selections with `maxEntries` or summarize them with `tokenOverflowBehavior`. Its end controls (the clear button, `endContent`, and the busy indicator) hold the end of that row: tokens scroll beside them, never underneath. The row hides its native scrollbar and fades whichever edge hides tokens instead; forced colors bring back a thin native scrollbar. Keyboard users reach hidden tokens through their remove buttons (Shift+Tab from the input), and a disabled Tokenizer's row becomes its own Tab stop while it overflows, named by the Tokenizer's label, so the arrow keys can scroll it. (#4405)
|
|
13
|
+
- TimeInput, DateTimeInput: under a finger, the bottom sheet's minute wheel loops, as UIDatePicker's does: past 59 comes 00, and the hour stays, as on iOS. A drag, a fling, a tap or an arrow key passes the seam. Home, End and a click on a minute never pass it. The hour wheel does not loop yet. Each minute is still listed once for assistive technology. (#10953)
|
|
14
|
+
|
|
15
|
+
#### Fixes
|
|
16
|
+
|
|
17
|
+
- When a page mounts both the package's AppShell and a swizzled AppShell as outermost shells, only the first now keeps the fixed main-region id; the other takes a generated id, as two package shells already did. Before, each copy kept its own claim list, so both shells used `astryx-app-shell-main` and the page had a duplicate id. No API changes. (#11208)
|
|
18
|
+
- BottomSheet: a finger's pull down on the sheet's content is handled by the sheet's touch listeners alone, and it releases at the speed of the whole pull. Before, the content's pointer handlers, which serve a mouse or a pen, began the same drag first and took pointer capture, and the capture change cancelled that drag one move later. The touch listeners then began the drag again, or, in Chromium, the content's own pan could start under it. The release speed counted only the moves after the drag began, so a fast flick on the content that the page received as two or three moves read as no speed and sprang back, where the same flick on the grab handle closed the sheet. A flick on the content now closes the sheet as a flick on the grab handle does. This also applies to the sheets that Tokenizer and PowerSearch open. A mouse or pen pull from the content also releases at the speed of the whole pull. No release threshold changes. (#11145)
|
|
19
|
+
- BottomSheet: a move of a touch drag no longer restyles the sheet's content. Each move writes the scrim's opacity on the dialog as a custom property, and the property inherited into the sheet, so the browser restyled every element in the sheet on every move: 51 elements a move in a Tall sheet with a short list, 84 in PowerSearch's Filters sheet with three filters, and more with more content. The sheet's panel now ends that inheritance, and a move restyles the dialog, its backdrop, the panel and the edge tint. The scrim follows the drag as before. This applies to the sheet that owns the scrim: a single BottomSheet, or the first sheet of a stack, such as PowerSearch's Filters sheet and Tokenizer's sheet. (#11154)
|
|
20
|
+
- BottomSheet: in Safari, and in every browser on iPhone and iPad, a swipe on the sheet's content that starts slowly now moves the sheet, so a slow swipe down can close it. Before, on content that fits, when the finger's first move was 8 px or less, in either direction, the sheet stopped answering that swipe: it stayed open, or moved a few pixels and fell back. Fast swipes and swipes on the grab bar already worked, and Chromium browsers were not affected. The fix applies wherever the touched content has nothing to scroll: a sheet whose content fits, and the fixed header or footer around a list. That includes the PowerSearch and Tokenizer sheets. At the top of a list that scrolls, a pull down now also moves the sheet when the finger first wobbles up by less than 5 px; a move up of 5 px or more still scrolls the list. In every browser, the sheet now decides who owns a touch on its content once, at the first move past 8 px. A mostly vertical pull at a scroll edge is the sheet's. A mostly sideways move, such as a swipe along a row of chips, is not the sheet's for the rest of that touch. Before, at the top of a list, a sideways swipe that drifted more than 8 px down, or a pull that began more sideways than down, also moved the sheet. (#11140)
|
|
21
|
+
- Button: a disabled or loading submit or reset Button, including one in a disabled ButtonGroup or InputGroup, no longer submits or resets its form when clicked in server-rendered HTML before the page hydrates or when JavaScript fails to load. It renders as a plain button until hydration, then takes its own type again, with no change to what people see or hear. (#11107)
|
|
22
|
+
- A Carousel's scroll buttons no longer cover the scroller's keyboard focus ring. Each button now sits just inside the ring instead of straddling the carousel's edge, so the whole ring stays visible while the scroller has focus (#10722). (#10726)
|
|
23
|
+
- A transient copy that carries an animation still waiting for its first frame now runs it in step with the original. On a busy page, the SideNav rail's leaving copy could start the toggle's press fade a frame or more after the toggle's own. (#10983)
|
|
24
|
+
- `CommandPalette`: refresh results when its `searchSource` changes while it is open. (#9679)
|
|
25
|
+
- createISOTimeString answers null unless the trimmed string is H:M or H:M:S with one or two digits per field (a seconds fraction is still accepted and dropped), instead of reading "2:30 PM" as 02:30 (12 hours off) and "14:30abc" as 14:30 (#11023)
|
|
26
|
+
- FileInput's dropzone shows its status message below the drop area by default, so it no longer covers the drop area; an explicit `statusVariant="attached"` still renders as before. (#11195)
|
|
27
|
+
- A pan over the page that the browser doesn't take as a scroll no longer closes an open popover or selector list, and no longer taps the page element under the finger. (#11038)
|
|
28
|
+
- A swizzled overlay and the package's components now share one set of focus regions and one mobile keyboard model: nested focus regions from the package and a copy no longer both answer the same Tab, and package and copied fields agree on the keyboard's height, its layout guide and which elements ride it. No API changes. (#10831)
|
|
29
|
+
- On a phone, a press on a control at rest no longer measures the page, so a scroll that starts there does not wait. Hit areas no longer measure while the page scrolls or while a parent's animation moves them, such as a screen that slides in. A press on a control that a parent moves still measures the page. When a parent starts to move after the last measurement, the browser's own hit test decides the tap. No API changes. (#11083)
|
|
30
|
+
- The arrow-key hint that Toolbar, TabList and SegmentedControl show on first keyboard focus now stays until you press an arrow key or Escape, or move focus out of the group (WCAG 2.2 SC 1.4.13 Content on Hover or Focus). It used to disappear after 3 seconds, sometimes before it could be read, and Escape did not close it. Escape now closes only the hint, through the shared layer dismissal stack, and keeps focus where it is. `useKeyboardHint`'s `dismissAfterMs` no longer defaults to 3000; leave it unset. (#10564)
|
|
31
|
+
- Closing a Lightbox stops a video that was playing. The viewer stays mounted, so the picture and its sound would otherwise continue after Close, Escape, or a tap outside. A viewer that is already closed does not start playback either. Opening it again plays the current video when `hasAutoPlay` is set. A video inside the caption stays stopped. (#10692)
|
|
32
|
+
- A swizzled ListItem inside the package's List (or a package ListItem inside a swizzled List) now leaves the way a package row does: it keeps what it showed on screen, such as a swipe's travel, for its exit. Before, the List and the ListItem kept separate records of the rows the List reported and of the presentation a leaving row kept, so the row's exit lost that presentation. No API changes. (#11214)
|
|
33
|
+
- Make onClick-only TopNav items keyboard accessible (#9334)
|
|
34
|
+
Previously, onClick-only TopNav actions could be skipped by Tab or could not be activated from the keyboard. TopNavItem now provides button semantics and Enter/Space activation while preserving its anchor ref/event types and custom link rendering. Desktop TopNavMegaMenuItem actions and drawer TopNavMenu actions now use non-submitting native buttons.
|
|
35
|
+
|
|
36
|
+
This restores keyboard operation and action semantics for WCAG 2.2 A criteria 2.1.1 and 4.1.2. Disabled TopNavItem actions remain focusable but cannot activate; href navigation and the existing desktop menu keyboard model are unchanged.
|
|
37
|
+
|
|
38
|
+
- A fence plugin made with the package's `createMarkdownFenceTransform` now renders its node in a swizzled Markdown, and the reverse. Before, the copy described the plugin to its transform under its own keys, so the package's fence transform refused to run and the fence fell back to a plain code block. No new props, exports or defaults. (#11167)
|
|
39
|
+
- Under right-to-left, plain text in `InputGroupText`, a `Badge` label and a `Token` label keeps the character order it was written in. Text with no right-to-left letter, such as a URL scheme (`https://`), a domain suffix (`.com`), a count (`+3`), `C++`, a handle (`@alice`) or a tag (`#design`), used to show reordered (`//:https`, `com.`, `3+`); it now lays out left to right. Text that contains a right-to-left letter keeps the page's direction, isolated from its neighbours, so `iPhone جديد` still reads right to left. A rich (non-string) label or child is isolated but keeps the page's direction: mark mixed directions on your own content. Plain `InputGroupText` text with no right-to-left letter sits in an inner `span`. Left-to-right pages are unchanged. (#10114)
|
|
40
|
+
- A swizzled component that carries its own copy of Core's layout motion, spinner rotor or gesture sync now shares the package's: a layout change in one copy starts at the frame the other copy's change started in, so their glides land together; spinners from both copies are pinned to the timeline in one batch, so rings mounted together cost one style recalculation instead of one per copy; and a gesture sync running in one copy holds the other copy's gesture callbacks too. No API changes. (#11027)
|
|
41
|
+
- Popover: initial focus takes the first content control in document order everywhere. This changes the focused control only where `querySelectorAll` does not return document order, as in jsdom; browsers focus the same control as before. (#11177)
|
|
42
|
+
- Icons registered with `registerIcons()` now reach swizzled `Icon`, `CodeBlock`, `Table` and `Timestamp` copies on the same React. Themes registered by name are now shared by every Core bundle loaded on one React. Each registry is one per React, so a second React on the page never renders the first one's elements. No API changes. (#11096)
|
|
43
|
+
- A swizzled ResizeHandle or LayoutPanel now finds the package's panel or handle beside it, and the reverse. When the region collapses, focus inside the panel moves to the handle and the panel goes inert. Before, each copy kept its own records of lent panels and handles, so the panel resized, but focus could drop to the page as it collapsed. No API changes. (#11131)
|
|
44
|
+
- The package root and the component barrels no longer carry `'use client'`. Inside a React Server Component, `import {Card, Stack, Badge, Code} from '@astryxdesign/core'` now renders the components that need no client code on the server, as their own modules intend; components that need the client stay client references. A Server Component that imports from the package root now builds with Next.js webpack. Client code renders the same as before. No API changes. To pass one of these components itself as a prop to a Client Component (for example `components={{inlineCode: Code}}` on `Markdown`), pass it from a `'use client'` module. (#11106)
|
|
45
|
+
- In iOS Safari, a tap that wobbles less than 5 px on content under a scroll-edge pan keeps its click. The pan now holds the finger only once it has moved 5 px along its axis. In Lab, in iOS Safari, a tap on a pushed NavigationStack screen that drifts less than 5 px toward the back swipe now runs; one that drifts 5 px or more toward it still loses its click. (#10829)
|
|
46
|
+
- A component built on useScrollableArea, such as ScrollableArea or BottomSheet, no longer renders again when focus moves between two descendants of a fitting viewport just after the component's own update. (#11135)
|
|
47
|
+
- Toast ids are now one sequence across the package and a swizzled copy of `useToast`. Before, each copy counted from 1, so a toast from a swizzled Toast and a toast from the package could share an id in the same queue, and dismissing one removed the other. No API changes. (#11092)
|
|
48
|
+
- A windowed Table keeps windowing when a text-size, zoom or theme change makes every row taller than `rowHeight`. It windows at the height the rows measure, instead of rendering every row, and warns in development. Rows of unequal height still render every row. (#11000)
|
|
49
|
+
- Without a `LayerProvider`, toasts from a swizzled `useToast` and from the package now show in one fallback stack. Before, each copy mounted its own fallback container, so the page showed two toast stacks that overlapped. No API changes. (#11161)
|
|
50
|
+
- Tokenizer: with `hasEntriesOnFocus`, picking a choice from the list shown on focus keeps the input focused and the list open, with the next choice active, so you can pick several in a row. The list closes when no choice remains, at `maxEntries`, or when you press elsewhere, Tab away or press Escape. A pick from typed search results still closes the list. (#11031)
|
|
51
|
+
- Typeahead and Tokenizer keep a dismissed menu closed when a search or focus bootstrap that was still running answers afterwards. Closing the menu with Escape, an outside click, Tab, or moving focus away also clears the busy indicator and drops a search still waiting on its debounce. A late answer for the same text is kept and shown the next time the menu opens, without searching again (reopening while that search still runs waits for its answer); an answer for text the person has since changed is dropped. Previously the late answer reopened the menu after it had been dismissed. (#8778)
|
|
52
|
+
|
|
53
|
+
#### Documentation
|
|
54
|
+
|
|
55
|
+
- AppShell's guidance on naming its navigation landmarks now says to pass `label` to TopNav and `aria-label` to SideNav. SideNav has no `label` prop; it has a translated default name, and `aria-label` renames it. (#11151)
|
|
56
|
+
- Add hook documentation and interactive table cell truncation example block for `useTruncation`, demonstrating responsive string truncation and accessibility tooltips. (#10555)
|
|
57
|
+
- InternationalizationProvider shows its examples in reading order: load a shipped locale, mirror the layout for right-to-left text (a new code example), override one string, then the calendar examples. Each live example is titled after its code example, so the two lists match. (#11094)
|
|
58
|
+
- `LinkProvider` docs say what `component` receives, including the `to` prop that router components read, that a link's own `as` or a nearer provider wins over it, and that a disabled Link does not use it. (#11065)
|
|
59
|
+
|
|
60
|
+
#### Other Changes
|
|
61
|
+
|
|
62
|
+
- Internal: Core's internal finger-scroll reader accepts a ref that names the document, so Lab's ChatVirtualizer can watch the page's own scroll when it attaches to `document.scrollingElement`. Apps import nothing new. (#10883)
|
|
63
|
+
- Internal: MobileNav keeps its dialog rendered from the open until its delayed close has run through the layer runtime's presentation hold (Layer/presentationHold.ts). No behavior change. (#8590)
|
|
64
|
+
- Internal: `useChatStreamScroll`'s page-scroller rules move to one owner module: whether a container scrolls the page, where its visible area starts, and where its scroll events fire. The hook behaves as before, and the undocumented `@astryxdesign/core/internal/page-scroller` entry gives the same rules to Lab's ChatVirtualizer. Internal entries are outside the public API and its compatibility promise. (#11160)
|
|
65
|
+
- Internal: Core's reorder controller finds a collection's rows through an internal rows reader, so a later change can reorder plain elements. List behaves as before, and apps import nothing new. (#11199)
|
|
66
|
+
|
|
67
|
+
#### Contributors
|
|
68
|
+
|
|
69
|
+
Thanks to everyone who contributed to this release:
|
|
70
|
+
|
|
71
|
+
- @AKnassa
|
|
72
|
+
- @bstcoc
|
|
73
|
+
- @cixzhang
|
|
74
|
+
- @fullstackhacker
|
|
75
|
+
- @humbertovirtudes
|
|
76
|
+
- @hurrymaplelad
|
|
77
|
+
- @imdreamrunner
|
|
78
|
+
- @korkt-kim
|
|
79
|
+
- @nynexman4464
|
|
80
|
+
- @SebTardif
|
|
81
|
+
- @utkarshpatwa393-sys
|
|
82
|
+
- @vjeux
|
|
83
|
+
- @whispering3
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
3
87
|
# 0.7.13
|
|
4
88
|
|
|
5
89
|
#### New Features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppShellMainId.d.ts","sourceRoot":"","sources":["../../src/AppShell/useAppShellMainId.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAppShellMainId.d.ts","sourceRoot":"","sources":["../../src/AppShell/useAppShellMainId.ts"],"names":[],"mappings":"AAkBA,6EAA6E;AAC7E,eAAO,MAAM,eAAe,0BAA0B,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,kCAIlC,CAAC;AA2BF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CA0B1C"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { use, useId, useState, useSyncExternalStore } from 'react';
|
|
14
14
|
import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js";
|
|
15
15
|
import { createSharedContext } from "../utils/sharedContext.js";
|
|
16
|
+
import { sharedState } from "../utils/sharedRealm.js";
|
|
16
17
|
|
|
17
18
|
/** The id of the first mounted shell's main region. Consumers link to it. */
|
|
18
19
|
export const MAIN_CONTENT_ID = 'astryx-app-shell-main';
|
|
@@ -23,16 +24,21 @@ export const MAIN_CONTENT_ID = 'astryx-app-shell-main';
|
|
|
23
24
|
*/
|
|
24
25
|
export const AppShellNestingContext = createSharedContext('AppShellNestingContext', 1, false);
|
|
25
26
|
AppShellNestingContext.displayName = 'AppShellNestingContext';
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
// One claim list for every copy of Core, so a swizzled AppShell and the
|
|
29
|
+
// package's AppShell never both keep the fixed id.
|
|
30
|
+
const mainIdClaims = sharedState('app-shell/use-app-shell-main-id/claims', 1, () => ({
|
|
31
|
+
claims: [],
|
|
32
|
+
listeners: new Set()
|
|
33
|
+
}));
|
|
28
34
|
function subscribe(listener) {
|
|
29
|
-
listeners.add(listener);
|
|
35
|
+
mainIdClaims.listeners.add(listener);
|
|
30
36
|
return () => {
|
|
31
|
-
listeners.delete(listener);
|
|
37
|
+
mainIdClaims.listeners.delete(listener);
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
function notify() {
|
|
35
|
-
for (const listener of listeners) {
|
|
41
|
+
for (const listener of mainIdClaims.listeners) {
|
|
36
42
|
listener();
|
|
37
43
|
}
|
|
38
44
|
}
|
|
@@ -49,17 +55,17 @@ export function useAppShellMainId() {
|
|
|
49
55
|
const generatedId = useId();
|
|
50
56
|
const isNested = use(AppShellNestingContext);
|
|
51
57
|
const [claim] = useState(() => ({}));
|
|
52
|
-
const isFirst = useSyncExternalStore(subscribe, () => claims.length === 0 || claims[0] === claim, () => true);
|
|
58
|
+
const isFirst = useSyncExternalStore(subscribe, () => mainIdClaims.claims.length === 0 || mainIdClaims.claims[0] === claim, () => true);
|
|
53
59
|
|
|
54
60
|
// Syncs this shell's claim in the page-wide claim list with its mount.
|
|
55
61
|
useIsomorphicLayoutEffect(() => {
|
|
56
62
|
if (isNested) {
|
|
57
63
|
return;
|
|
58
64
|
}
|
|
59
|
-
claims.push(claim);
|
|
65
|
+
mainIdClaims.claims.push(claim);
|
|
60
66
|
notify();
|
|
61
67
|
return () => {
|
|
62
|
-
claims.splice(claims.indexOf(claim), 1);
|
|
68
|
+
mainIdClaims.claims.splice(mainIdClaims.claims.indexOf(claim), 1);
|
|
63
69
|
notify();
|
|
64
70
|
};
|
|
65
71
|
}, [claim, isNested]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAoCH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;AA4Hf;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CA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A8H;IAC9H,YAAY,EAAE,iBAAiB,CAAC;IAChC,gEAAgE;IAChE,WAAW,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;OAGG;IACH,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAsB,GACvB,EAAE,uBAAuB,GAAG,sBAAsB,CA8+ClD"}
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
// finger ends any drag (yieldToPinch). There is no module-scope DOM access,
|
|
50
50
|
// so the hook is SSR-safe. Reduced motion skips the settle transition.
|
|
51
51
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
52
|
+
import { TAP_WOBBLE } from "../gestures/tapWobble.js";
|
|
52
53
|
import { VelocityTracker } from "../gestures/VelocityTracker.js";
|
|
53
54
|
import { resolveSnapPoint } from "../motion/resolveSnapPoint.js";
|
|
54
55
|
import { rubberBand } from "../motion/rubberBand.js";
|
|
@@ -110,11 +111,6 @@ const CONTENT_END_HANDOFF_SLOP = 4;
|
|
|
110
111
|
// the tap caused cut instead of animating. 8px is the usual tap slop and is
|
|
111
112
|
// well under what a real pull covers in its first frames.
|
|
112
113
|
const DRAG_PROMOTION_SLOP = 8;
|
|
113
|
-
// A cancelled touchmove ends the touch's click in WebKit. A tap's wobble stays
|
|
114
|
-
// under this distance, so the tap keeps its click. A kept first touchmove of
|
|
115
|
-
// this distance already commits iOS Safari to the scroller's pan, so the
|
|
116
|
-
// cancel starts at it.
|
|
117
|
-
const PAN_CANCEL_SLOP = 5;
|
|
118
114
|
|
|
119
115
|
// Short haptic tick on detent settle where supported. iOS Safari doesn't
|
|
120
116
|
// expose navigator.vibrate, so this is a no-op there; skipped under
|
|
@@ -1242,7 +1238,7 @@ export function useSheetGestures({
|
|
|
1242
1238
|
const opposesBottom = armed.bottom && delta < 0 && chainAtBottom(armed.scrollers);
|
|
1243
1239
|
const sideways = Math.abs(t.clientX - armed.startX);
|
|
1244
1240
|
const isMostlyVertical = Math.abs(delta) > sideways;
|
|
1245
|
-
if ((opposesTop || opposesBottom) && Math.abs(delta) >=
|
|
1241
|
+
if ((opposesTop || opposesBottom) && Math.abs(delta) >= TAP_WOBBLE && isMostlyVertical && event.cancelable) {
|
|
1246
1242
|
event.preventDefault();
|
|
1247
1243
|
}
|
|
1248
1244
|
// Promote to a sheet drag on a pull that opposes the armed edge and can
|
|
@@ -1282,10 +1278,10 @@ export function useSheetGestures({
|
|
|
1282
1278
|
// commits no native pan. The touch stays tracked, because this swipe can
|
|
1283
1279
|
// reach the far edge. Content that fits has nothing to scroll, so both
|
|
1284
1280
|
// edges stay armed.
|
|
1285
|
-
if (armed.top && delta <= -
|
|
1281
|
+
if (armed.top && delta <= -TAP_WOBBLE && !chainAtBottom(armed.scrollers)) {
|
|
1286
1282
|
armed.top = false;
|
|
1287
1283
|
}
|
|
1288
|
-
if (armed.bottom && delta >=
|
|
1284
|
+
if (armed.bottom && delta >= TAP_WOBBLE && !chainAtTop(armed.scrollers)) {
|
|
1289
1285
|
armed.bottom = false;
|
|
1290
1286
|
}
|
|
1291
1287
|
// Reaching the end of the content mid-gesture. Arming at `touchstart`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,OAAO,EAEL,KAAK,cAAc,EASpB,MAAM,yBAAyB,CAAC;AAqBjC,YAAY,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACV,MAAM,oBAAoB,CAAC;AAqB5B,+CAA+C;AAC/C,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,UAAU,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAID,UAAU,iBAAkB,SAAQ,IAAI,CACtC,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,cAAc,CAC5B;IACC,kDAAkD;IAClD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,qDAAqD;IACrD,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACtC,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SAAS,GAAG,IAAI,CAAC;IAEzB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAqCrE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAC,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,aAAa,+BAqiBtD;yBAriBe,QAAQ"}
|
|
@@ -25,7 +25,7 @@ import { useAnnounce, useGridFocus } from "../hooks/index.js";
|
|
|
25
25
|
import { useCalendarConstraints } from "./hooks/index.js";
|
|
26
26
|
import { useCalendarDays } from "./hooks/useCalendarDays.js";
|
|
27
27
|
import { calendarStyles, monthGridStyles, dayCellStyles, dayCellTheme } from "./styles.js";
|
|
28
|
-
import { plainDateFromISO, plainDateToISO, plainDateToDate, plainDateAddDays, plainDateDiffDays, plainDateIsAfter, plainDateIsBefore, plainDateIsEqual, plainDateGetWeekNumber, plainDateWeekFieldName, plainDateFormatDayNumber, DATE_FORMAT_WITH_WEEKDAY } from "../utils/plainDate.js";
|
|
28
|
+
import { plainDateFromISO, plainDateToISO, plainDateToDate, plainDateAddDays, plainDateDayOfWeek, plainDateDiffDays, plainDateIsAfter, plainDateIsBefore, plainDateIsEqual, plainDateGetWeekNumber, plainDateWeekFieldName, plainDateFormatDayNumber, DATE_FORMAT_WITH_WEEKDAY } from "../utils/plainDate.js";
|
|
29
29
|
import { calendarAddMonths, calendarMonthOf, calendarShiftMonths, calendarShiftYears, calendarYearMonthOf, formatCalendarDate, formatCalendarMonthLabel, isInCalendarMonth } from "../utils/calendarSystem.js";
|
|
30
30
|
import { mergeProps, composeEventHandlers, rtlStyles } from "../utils/index.js";
|
|
31
31
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
@@ -77,6 +77,15 @@ function formatDateLabel(date, calendar, locale) {
|
|
|
77
77
|
return formatCalendarDate(calendar, date, DATE_FORMAT_WITH_WEEKDAY, locale);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* ISO 8601 numbers a week by its Thursday. For any week start, the row's
|
|
82
|
+
* Thursday is in the ISO week that holds most of the row's days.
|
|
83
|
+
*/
|
|
84
|
+
function rowThursday(week) {
|
|
85
|
+
const first = week[0].date;
|
|
86
|
+
return plainDateAddDays(first, (4 - plainDateDayOfWeek(first) + 7) % 7);
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
// =============================================================================
|
|
81
90
|
// Main Component
|
|
82
91
|
// =============================================================================
|
|
@@ -790,7 +799,7 @@ function MonthGrid({
|
|
|
790
799
|
}, dayOfWeek))]
|
|
791
800
|
}), weeks.map(week => {
|
|
792
801
|
const weekDate = week.find(d => !d.isOutside)?.date || week[0].date;
|
|
793
|
-
const weekNum = plainDateGetWeekNumber(
|
|
802
|
+
const weekNum = plainDateGetWeekNumber(rowThursday(week));
|
|
794
803
|
return /*#__PURE__*/_jsxs("div", {
|
|
795
804
|
role: "row",
|
|
796
805
|
...stylex.props(monthGridStyles.weekRow),
|
|
@@ -33,9 +33,9 @@ export interface InitialFocusDateOptions {
|
|
|
33
33
|
/**
|
|
34
34
|
* Picks the date whose month the calendar opens on.
|
|
35
35
|
*
|
|
36
|
-
* An explicit `focusDate` wins
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* An explicit `focusDate` wins and is never second-guessed: it names the first
|
|
37
|
+
* pane outright. Then the selected value — its month is shown even when it lies
|
|
38
|
+
* outside `min`/`max`.
|
|
39
39
|
*
|
|
40
40
|
* Otherwise the calendar opens on today, clamped into the `min`/`max` window,
|
|
41
41
|
* or returns `null` while today is not known yet.
|
|
@@ -48,6 +48,11 @@ export interface InitialFocusDateOptions {
|
|
|
48
48
|
* month instead — with `numberOfMonths={2}` opening on `[max, max + 1]` would
|
|
49
49
|
* spend half the calendar on a month that is entirely out of bounds. That
|
|
50
50
|
* shift never crosses `min`'s month.
|
|
51
|
+
*
|
|
52
|
+
* The same shift applies when the value or today is inside the window but in
|
|
53
|
+
* `max`'s month (`max` set to today is the common case): the month stays in
|
|
54
|
+
* view, in the last pane, and the panes before it show months that still have
|
|
55
|
+
* selectable days.
|
|
51
56
|
*/
|
|
52
57
|
export declare function getInitialFocusDate(options: InitialFocusDateOptions): PlainDate | null;
|
|
53
58
|
//# sourceMappingURL=getInitialFocusDate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInitialFocusDate.d.ts","sourceRoot":"","sources":["../../src/Calendar/getInitialFocusDate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,gCAAgC;IAChC,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED
|
|
1
|
+
{"version":3,"file":"getInitialFocusDate.d.ts","sourceRoot":"","sources":["../../src/Calendar/getInitialFocusDate.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,uBAAuB;IACtC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,gCAAgC;IAChC,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,0DAA0D;IAC1D,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,uBAAuB,GAC/B,SAAS,GAAG,IAAI,CA6DlB"}
|
|
@@ -16,9 +16,9 @@ import { calendarAddMonths, calendarMonthOf } from "../utils/calendarSystem.js";
|
|
|
16
16
|
/**
|
|
17
17
|
* Picks the date whose month the calendar opens on.
|
|
18
18
|
*
|
|
19
|
-
* An explicit `focusDate` wins
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* An explicit `focusDate` wins and is never second-guessed: it names the first
|
|
20
|
+
* pane outright. Then the selected value — its month is shown even when it lies
|
|
21
|
+
* outside `min`/`max`.
|
|
22
22
|
*
|
|
23
23
|
* Otherwise the calendar opens on today, clamped into the `min`/`max` window,
|
|
24
24
|
* or returns `null` while today is not known yet.
|
|
@@ -31,6 +31,11 @@ import { calendarAddMonths, calendarMonthOf } from "../utils/calendarSystem.js";
|
|
|
31
31
|
* month instead — with `numberOfMonths={2}` opening on `[max, max + 1]` would
|
|
32
32
|
* spend half the calendar on a month that is entirely out of bounds. That
|
|
33
33
|
* shift never crosses `min`'s month.
|
|
34
|
+
*
|
|
35
|
+
* The same shift applies when the value or today is inside the window but in
|
|
36
|
+
* `max`'s month (`max` set to today is the common case): the month stays in
|
|
37
|
+
* view, in the last pane, and the panes before it show months that still have
|
|
38
|
+
* selectable days.
|
|
34
39
|
*/
|
|
35
40
|
export function getInitialFocusDate(options) {
|
|
36
41
|
const {
|
|
@@ -45,8 +50,10 @@ export function getInitialFocusDate(options) {
|
|
|
45
50
|
if (focusDate) {
|
|
46
51
|
return plainDateFromISO(focusDate);
|
|
47
52
|
}
|
|
53
|
+
const minDate = min ? plainDateFromISO(min) : null;
|
|
54
|
+
const maxDate = max ? plainDateFromISO(max) : null;
|
|
48
55
|
if (value) {
|
|
49
|
-
return plainDateFromISO(typeof value === 'string' ? value : value.start);
|
|
56
|
+
return keepLastPaneWithinMax(plainDateFromISO(typeof value === 'string' ? value : value.start), minDate, maxDate, numberOfMonths, calendar);
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
// Without a focus date or a value the month follows today, which is not
|
|
@@ -54,8 +61,6 @@ export function getInitialFocusDate(options) {
|
|
|
54
61
|
if (today == null) {
|
|
55
62
|
return null;
|
|
56
63
|
}
|
|
57
|
-
const minDate = min ? plainDateFromISO(min) : null;
|
|
58
|
-
const maxDate = max ? plainDateFromISO(max) : null;
|
|
59
64
|
if (minDate && plainDateIsBefore(today, minDate)) {
|
|
60
65
|
return minDate;
|
|
61
66
|
}
|
|
@@ -67,5 +72,35 @@ export function getInitialFocusDate(options) {
|
|
|
67
72
|
}
|
|
68
73
|
return shifted;
|
|
69
74
|
}
|
|
70
|
-
return today;
|
|
75
|
+
return keepLastPaneWithinMax(today, minDate, maxDate, numberOfMonths, calendar);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Moves the opening month back when `date`'s month is shown but a later pane
|
|
80
|
+
* would lie wholly past `max`: the last pane lands on `max`'s month, and the
|
|
81
|
+
* first pane never goes before `min`'s month. A date whose panes already end
|
|
82
|
+
* by `max`'s month, or whose own month is past `max`'s, is returned unchanged,
|
|
83
|
+
* so its month always stays in view.
|
|
84
|
+
*/
|
|
85
|
+
function keepLastPaneWithinMax(date, minDate, maxDate, numberOfMonths, calendar) {
|
|
86
|
+
const lastPaneOffset = Math.max(0, numberOfMonths - 1);
|
|
87
|
+
if (maxDate == null || lastPaneOffset === 0) {
|
|
88
|
+
return date;
|
|
89
|
+
}
|
|
90
|
+
const month = calendarMonthOf(calendar, date).start;
|
|
91
|
+
const maxMonth = calendarMonthOf(calendar, maxDate);
|
|
92
|
+
const latestFirstPane = calendarAddMonths(calendar, maxMonth, -lastPaneOffset).start;
|
|
93
|
+
if (!plainDateIsAfter(month, latestFirstPane) || plainDateIsAfter(month, maxMonth.start)) {
|
|
94
|
+
return date;
|
|
95
|
+
}
|
|
96
|
+
if (minDate == null) {
|
|
97
|
+
return latestFirstPane;
|
|
98
|
+
}
|
|
99
|
+
const minMonth = calendarMonthOf(calendar, minDate).start;
|
|
100
|
+
if (!plainDateIsBefore(latestFirstPane, minMonth)) {
|
|
101
|
+
return latestFirstPane;
|
|
102
|
+
}
|
|
103
|
+
// `min` is closer than the full shift: go back only as far as its month,
|
|
104
|
+
// and not at all when the date's own month is already there or earlier.
|
|
105
|
+
return plainDateIsAfter(month, minMonth) ? minDate : date;
|
|
71
106
|
}
|
|
@@ -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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,mBAAmB,EACvC,GAAG,IAAI,EACR,EAAE,kBAAkB,+BA6RpB;yBAxTe,aAAa"}
|
|
@@ -51,10 +51,12 @@ registerEnglishFallback(english);
|
|
|
51
51
|
// none of its code.
|
|
52
52
|
registerBoxHold();
|
|
53
53
|
|
|
54
|
-
/** Written by the
|
|
54
|
+
/** Written by the press controller while the row is pressed. */
|
|
55
55
|
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
56
|
-
/** Written by the
|
|
56
|
+
/** Written by the press controller for the press's release. */
|
|
57
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})`;
|
|
58
60
|
|
|
59
61
|
// The touch press's paint, declared by the shared overlay styles on the
|
|
60
62
|
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
@@ -78,10 +80,12 @@ const styles = {
|
|
|
78
80
|
},
|
|
79
81
|
indicatorPressImage: {
|
|
80
82
|
"--_indicator-press-image": "x1dueop1 x189o2zt",
|
|
83
|
+
"--_indicator-active-press": "x1qwhovg x858ff1",
|
|
81
84
|
$$css: true
|
|
82
85
|
},
|
|
83
86
|
indicatorRowPressImage: {
|
|
84
87
|
"--_indicator-press-image": "x1y1g3jp",
|
|
88
|
+
"--_indicator-active-press": "x1bl9l2n",
|
|
85
89
|
$$css: true
|
|
86
90
|
},
|
|
87
91
|
checkboxWrapper: {
|
|
@@ -99,11 +103,12 @@ const styles = {
|
|
|
99
103
|
kv0HGH: "xarstr8",
|
|
100
104
|
kUfP38: "xtb6wbx",
|
|
101
105
|
kloYau: "x2q1x1w",
|
|
102
|
-
ks3ayO: "xyhc2n1
|
|
103
|
-
kNctxI: "
|
|
106
|
+
ks3ayO: "xyhc2n1 xur6jaf xtawv5c",
|
|
107
|
+
kNctxI: "x178sc5r x1d4iov5",
|
|
104
108
|
$$css: true
|
|
105
109
|
},
|
|
106
110
|
indicatorRowPressOverlay: {
|
|
111
|
+
ks3ayO: "xyhc2n1",
|
|
107
112
|
kNctxI: "xlvbopx",
|
|
108
113
|
$$css: true
|
|
109
114
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAItE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxListItem.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAkC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAItE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAc5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,SAAS,CAAC;AAuBvC,MAAM,WAAW,qBAAsB,SAAQ,SAAS,CAAC,aAAa,CAAC;IACrE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;;OAaG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAChC;AAyCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EACV,UAAU,EAAE,cAAsB,EAClC,SAAS,EAAE,aAAqB,EAChC,SAAS,EACT,OAAO,EACP,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EAAE,WAAW,EACpB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,qBAAqB,+BAiLvB;yBAlMe,gBAAgB"}
|
|
@@ -25,7 +25,6 @@ import { CheckboxInput } from "../CheckboxInput/CheckboxInput.js";
|
|
|
25
25
|
import { CheckboxRowPressContext } from "../CheckboxInput/CheckboxRowPressContext.js";
|
|
26
26
|
import { rowPressPaintStyles } from "../privateAttributes/press.stylex.js";
|
|
27
27
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
28
|
-
import { useTouchPresentation } from "../utils/touchPresentation.js";
|
|
29
28
|
import { ListItem } from "../List/ListItem.js";
|
|
30
29
|
import { ListContext } from "../List/ListContext.js";
|
|
31
30
|
import { CheckboxListContext } from "./CheckboxListContext.js";
|
|
@@ -190,13 +189,9 @@ export function CheckboxListItem({
|
|
|
190
189
|
}) : undefined, [requiredGroup, isBoxChecked, isBoxEnabled]);
|
|
191
190
|
const checkboxInputRef = useMergedRefs(checkboxRef, registerWithRequiredGroup);
|
|
192
191
|
|
|
193
|
-
//
|
|
194
|
-
//
|
|
195
|
-
|
|
196
|
-
const {
|
|
197
|
-
isTouch
|
|
198
|
-
} = useTouchPresentation();
|
|
199
|
-
const rowOwnsPress = isTouch && hasRowInteraction && !effectiveDisabled;
|
|
192
|
+
// A delegating row is the option's only press surface, for every pointer. A
|
|
193
|
+
// press anywhere on it presses the row.
|
|
194
|
+
const rowOwnsPress = hasRowInteraction && !effectiveDisabled;
|
|
200
195
|
|
|
201
196
|
// A read-only checkbox carries aria-readonly, which the row's clickable
|
|
202
197
|
// container treats as a non-interactive target, so a click on it would be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTypedDate.d.ts","sourceRoot":"","sources":["../../src/DateInput/useTypedDate.ts"],"names":[],"mappings":"AAeA,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,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,oCAAoC;IACpC,MAAM,EAAE,gBAAgB,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;IAC9D,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;CAC9C;AAED,MAAM,WAAW,SAAS;IACxB,uDAAuD;IACvD,QAAQ,EAAE,cAAc,CAAC;IACzB,uDAAuD;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,u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,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC7C;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yEAAyE;IACzE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,6EAA6E;IAC7E,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,4CAA4C;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,QAAQ,EACR,OAAO,EACP,WAAW,EACX,UAAU,EACV,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,GAAG,OAAO,EACX,EAAE,wBAAwB,GAAG,cAAc,CAsK3C"}
|
|
@@ -99,9 +99,11 @@ export function useTypedDate({
|
|
|
99
99
|
});
|
|
100
100
|
}, [isGregorian, t, locale, calendar, min, max, isDateDisabled]);
|
|
101
101
|
const calendarName = useMemo(() => calendarDisplayName(calendar, locale), [calendar, locale]);
|
|
102
|
+
const isProviderCalendar = isGregorian ? isGregorianCalendar(providerCalendar) : calendar === providerCalendar;
|
|
102
103
|
const errorMessage = useCallback(result => {
|
|
103
104
|
if (result.kind === 'nonexistent') {
|
|
104
105
|
return t('@astryx.dateInput.nonexistentDate', {
|
|
106
|
+
named: isProviderCalendar ? 'no' : 'yes',
|
|
105
107
|
calendar: calendarName
|
|
106
108
|
});
|
|
107
109
|
}
|
|
@@ -118,8 +120,7 @@ export function useTypedDate({
|
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
122
|
return t('@astryx.dateInput.invalidDate');
|
|
121
|
-
}, [t, calendarName, format, locale, calendar, min, max]);
|
|
122
|
-
const isProviderCalendar = isGregorian ? isGregorianCalendar(providerCalendar) : calendar === providerCalendar;
|
|
123
|
+
}, [t, isProviderCalendar, calendarName, format, locale, calendar, min, max]);
|
|
123
124
|
return {
|
|
124
125
|
calendar,
|
|
125
126
|
prepare,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AA6CA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAyBrB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAmB9C,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAUpC,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErE,uGAAuG;AACvG,MA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,0BAA0B,CAAC;IAE3C;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;IAErD;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;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;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAw8CD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,+BAgDtD;yBAhDe,aAAa"}
|
|
@@ -385,9 +385,12 @@ function PointerDateTimeField({
|
|
|
385
385
|
// Native date and time are separate OS pickers. Hold a time chosen before the
|
|
386
386
|
// date exists, then combine it when the date picker commits.
|
|
387
387
|
const [nativeTimeDraft, setNativeTimeDraft] = useState(undefined);
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
// The value the draft was held against. It is state: a ref written here
|
|
389
|
+
// would keep a value from a render React discards, and drop the draft on
|
|
390
|
+
// the next render.
|
|
391
|
+
const [previousNativeValue, setPreviousNativeValue] = useState(optimisticValue);
|
|
392
|
+
if (optimisticValue !== previousNativeValue) {
|
|
393
|
+
setPreviousNativeValue(optimisticValue);
|
|
391
394
|
if (nativeTimeDraft !== undefined) {
|
|
392
395
|
setNativeTimeDraft(undefined);
|
|
393
396
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeDateSegment.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/NativeDateSegment.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAIL,gBAAgB,EAGhB,KAAK,aAAa,EACnB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAC;AAY9C,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,cAAc,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,KAAK,OAAO,CAAC;IACvE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kFAAkF;IAClF,mBAAmB,EAAE,OAAO,CAAC;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,YAAY,CAAC,EAAE,IAAI,CACjB,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