@astryxdesign/core 0.7.5-canary.fd0aba8 → 0.7.5
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 +201 -0
- package/dist/BottomSheet/useSheetGestures.d.ts +0 -12
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +3 -30
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +8 -33
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +1 -10
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +2 -16
- package/dist/NumberInput/NumberInput.d.ts +1 -3
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +3 -3
- package/dist/astryx.css +0 -2
- package/dist/utils/focusReturn.d.ts +1 -17
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +4 -11
- package/dist/utils/interactionModality.d.ts +2 -11
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +5 -58
- package/package.json +4 -4
- package/src/BottomSheet/BottomSheet.test.tsx +0 -46
- package/src/BottomSheet/useSheetGestures.test.ts +0 -52
- package/src/BottomSheet/useSheetGestures.ts +6 -37
- package/src/DateTimeInput/DateTimeInput.spec.md +48 -71
- package/src/Dialog/Dialog.test.tsx +2 -216
- package/src/Dialog/Dialog.tsx +8 -41
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +6 -23
- package/src/NumberInput/NumberInput.doc.mjs +7 -13
- package/src/NumberInput/NumberInput.spec.md +37 -59
- package/src/NumberInput/NumberInput.tsx +3 -13
- package/src/utils/focusReturn.ts +6 -17
- package/src/utils/interactionModality.test.ts +1 -45
- package/src/utils/interactionModality.ts +5 -64
- package/src/Dialog/__tests__/DialogSecondDocument.a11y.browser.spec.ts +0 -202
- package/src/DropdownMenu/lazyMenuBottomSheet.test.ts +0 -53
- package/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts +0 -102
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,206 @@
|
|
|
1
1
|
# @xds/core
|
|
2
2
|
|
|
3
|
+
# 0.7.5
|
|
4
|
+
|
|
5
|
+
#### New Features
|
|
6
|
+
|
|
7
|
+
- Status colors are readable everywhere they appear, and Info is a status of its own. Each status (info, success, warning, error) now has a strong fill (`--color-<status>`) with content on it (`--color-on-<status>`, at least 4.5:1), a pale fill (`--color-<status>-muted`) with its content (`--color-on-<status>-muted`), and readable text for the page and cards (`--color-text-<status>`). Status icons (`--color-icon-<status>`) and borders (`--color-border-<status>`) default to the readable text color. The Info roles (`--color-info`, `--color-on-info`, `--color-info-muted`, …) are new and no longer borrow your accent color.
|
|
8
|
+
|
|
9
|
+
`--color-success`, `--color-warning`, and `--color-error` and `bg-<status>` keep their meaning as the strong fills. In Tailwind, `bg-info`, `bg-info-muted`, `text-on-<status>`, `text-on-<status>-muted`, and `text-status-<status>` are new; `text-`, `decoration-`, `placeholder-`, and `caret-<status>` now use the readable text shade, and `border-`, `divide-`, `outline-`, and `ring-<status>` use the border shade, while `bg-`, `accent-`, `fill-`, `stroke-<status>`, shadows, and gradients keep the strong fill. For example, Core's light `text-warning` is now `#753F07` instead of `#E9AF08`. To keep the fill color on text, write `text-[var(--color-warning)]`.
|
|
10
|
+
|
|
11
|
+
What changes on screen:
|
|
12
|
+
|
|
13
|
+
- Core's dark Error content (`--color-on-error`) is now `#0A1317` instead of white, so text on dark-mode error fills reaches 4.5:1. Core's Info Badge uses `#0064E0` instead of the accent (`#2694FE` in dark mode).
|
|
14
|
+
- Status icons (Icon `color="info|success|warning|error"`), Stepper status glyphs, and Chat tool-call status icons use the readable shades. Core's light success icon is now `#09441F` instead of `#0D8626`.
|
|
15
|
+
- Input and FileInput status borders use the border shades. Core's light warning border is now `#753F07` instead of `#E9AF08`, and Butter's light success and warning input borders reach 3:1.
|
|
16
|
+
- Banner draws its title, description, icon, and controls in the on-muted colors, and fills Info with `--color-info-muted`.
|
|
17
|
+
- Status fills keep a visible edge in forced-colors mode.
|
|
18
|
+
- Content on Chocolate and Matcha success and error fills, and on Stone success, warning, and error fills, now reaches 4.5:1.
|
|
19
|
+
- Every first-party theme sets a blue Info. Chocolate and Matcha Info Badges move from the accent to that blue; Butter keeps its own Info Badge colors.
|
|
20
|
+
- Neutral's `--color-success`, `--color-warning`, and `--color-error` are now the fills its Badges already showed, and its `--color-info` is `#0074E2` (`#6D9CFE` in dark mode). Its Badges, StatusDots, progress fills, and Stepper badges look the same; its accent ProgressBar, StatusDot, and Stepper now use Neutral's accent instead of blue.
|
|
21
|
+
- Neutral no longer defines its undocumented local status tokens. Use the standard roles instead: `--astryx-theme-neutral-color-status-fill-success`, `-status-fill-warning`, and `-status-fill-error` → `--color-success`, `--color-warning`, `--color-error`; `-status-muted-accent` → `--color-info-muted`; `-on-tint-neutral` → `--color-neutral`; the `-on-tint-overlay-*` and `-destructive-overlay-*` tokens → `--color-overlay-hover` and `--color-overlay-pressed`. `--astryx-theme-neutral-color-status-fill-accent` keeps its value but is deprecated.
|
|
22
|
+
|
|
23
|
+
Custom themes get the content and text roles they don't set: they are derived from the theme's status fills. To keep a component's previous color, set the matching role, for example `--color-icon-success` to your old `--color-success`.
|
|
24
|
+
|
|
25
|
+
- BottomSheets stack in the order they open. A modal sheet opened over another now sits on top of it: the sheet underneath keeps its state, moves back slightly, and can't be used until it is on top again; only one backdrop dims the page; and Escape, a backdrop tap, a swipe, or the system close gesture closes only the top sheet. Closing the top sheet returns focus to the sheet below, and closing a whole stack returns focus once, to where the flow started. A sheet inside another sheet's content now closes with it. Non-modal sheets (`hasScrim={false}`) never stack. No props change, and a single sheet behaves as before.
|
|
26
|
+
- Multi-step sheet flows no longer need a wrapper. When the top BottomSheet closes and another opens in the same update, for example from one state value that names the open step, the new sheet replaces the old one: it rises into place, the backdrop stays steady, focus moves into the new sheet, and closing the flow later returns focus to whatever opened it. This happens when the step change comes from inside the closing sheet, such as its own Continue or Back button. Non-modal sheets (`hasScrim={false}`) replace each other the same way, and now open above all page content in the browser's top layer instead of relying on a `z-index`.
|
|
27
|
+
- `BottomSheetSwitcher` and BottomSheet's `sheetId` prop are deprecated and keep working until a future minor release. Write each step as its own `BottomSheet` instead:
|
|
28
|
+
1. Replace `activeSheet` / `onActiveSheetChange` with one `step` state value.
|
|
29
|
+
2. On each step, replace `sheetId="id"` with `isOpen={step === 'id'}` and `onOpenChange={isOpen => !isOpen && setStep(current => (current === 'id' ? null : current))}`.
|
|
30
|
+
3. Remove the `BottomSheetSwitcher` wrapper and move its `hasScrim` onto every step.
|
|
31
|
+
4. Keep your step buttons as they are, for example `setStep('next')`.
|
|
32
|
+
|
|
33
|
+
To keep a step open, ignore `false` in its `onOpenChange` (this replaces `onCancel`); to keep Escape but block the backdrop tap and swipe, use `purpose="form"`. A consumer `aria-label` becomes each step's `label`. Dialog-level `ref`, `id`, `className`, and styling props have no direct replacement: a standalone sheet's `ref` and props reach its panel. Flows that keep the switcher work as before, now with toasts above the flow and reduced-motion support.
|
|
34
|
+
|
|
35
|
+
- Popover takes `presentation`, like DropdownMenu and Selector: `'popover'` (the default) anchors it to its trigger, `'bottom-sheet'` shows its content in a modal BottomSheet named by `label`, and `'adaptive'` uses the sheet on phones and the anchored popover elsewhere. In a sheet, positioning props such as `placement` and `width` don't apply, and `xstyle`, `className`, and `style` style the sheet's panel. The sheet code loads only when it can be used.
|
|
36
|
+
- Menus and selectors with `presentation="adaptive"` (DropdownMenu, ContextMenu, MoreMenu, Selector, MultiSelector) and sub-menus that drill in on phones now switch to a bottom sheet by the shared phone-size rule on touch screens. A touch screen exactly 768px wide now keeps the anchored popover, and a phone in landscape (wider than 768px but shorter than 500px) now gets the sheet. A theme that moves its `md` breakpoint moves this edge too. To keep a fixed presentation, pass `presentation="popover"` or `"bottom-sheet"`, or `presentation="flyout"` on `DropdownMenuSubMenu`. Desktop mouse and keyboard users see no change.
|
|
37
|
+
- `@astryxdesign/core/theme` exports `compactDefinition(widthBreakpoints?)` and `DEFAULT_COMPACT_DEFINITION`: one shared rule for a phone-sized screen, narrower than the theme's `md` breakpoint (768px by default) or shorter than 500px, with ready-made media queries.
|
|
38
|
+
- `CodeBlock` highlights C, C++, SQL, Rust, Kotlin, Swift, and Go with no setup, so you only ship the languages you use.
|
|
39
|
+
|
|
40
|
+
Every other language is opt in, one at a time:
|
|
41
|
+
|
|
42
|
+
- Import that language on its own and pass it as `language`, for example `graphql` from `@astryxdesign/core/CodeBlock/languages/graphql`.
|
|
43
|
+
- Modules ship for `graphql`, `java`, `thrift`, `objectiveC` (path `languages/objective-c`), `toml`, `powershell`, `ruby`, `lua`, and `dockerfile`.
|
|
44
|
+
- A string such as `language="graphql"` still selects only a built-in language.
|
|
45
|
+
|
|
46
|
+
Your own languages work the same way. `createCodeLanguage({name, identifiers, fileExtensions, fileNames, tokenize})` makes a language from your own tokenize function.
|
|
47
|
+
|
|
48
|
+
The built-in tokenizer stays within 4,608 bytes gzipped. Each module adds at most 512 bytes, and only when you import it.
|
|
49
|
+
|
|
50
|
+
- `CodeBlock` takes `endContent` for your own controls, such as a "Run in terminal" button. They sit just before Copy, in the header when there is one, otherwise beside the code, never over it. For a one-line command, leave out the title and pass `hasLanguageLabel={false}` to get a single row with its controls beside it.
|
|
51
|
+
- CodeBlock's `tokenizer` prop is deprecated in favor of a custom language: pass `language={createCodeLanguage({name, identifiers, tokenize})}` with the same function. The prop still works. `astryx upgrade` rewrites it when the block has a fixed `language`, and leaves a TODO comment where it can't safely rewrite it.
|
|
52
|
+
- `Markdown` takes `codeLanguages`, a list of CodeBlock languages, so fenced code in Markdown can use the extra or custom languages too. A listed language wins over a built-in language of the same name, and `diff-<name>` fences get diff coloring on top.
|
|
53
|
+
- Expanding and collapsing can glide instead of jump. Create a handle with `useAnimatedLayout({containerRef})` and pass it to Collapsible or TreeList as `animatedLayout`: when one opens or closes, the content around it inside that container glides to its new place, revealed content fades in, and the chevron turns, all as one motion. Fixed and sticky elements stay put and the container never scrolls. Under Reduce Motion the change cross-fades on touch and is immediate with a mouse. Without the prop, nothing changes.
|
|
54
|
+
- Table: `useTableRowExpansion` accepts the same `animatedLayout` handle, so opening or closing a row's panel glides the rows after it, dividers included, instead of jumping. Under Reduce Motion rows fade on touch and change at once with a mouse; tables with column lines change at once.
|
|
55
|
+
- TreeList chevrons and guide lines sit 4px closer to the start of the row, and the gap between chevron and label widens from 4px to 8px. Labels stay where they were.
|
|
56
|
+
- `Icon` takes an optional `variant` to ask the active theme for alternate artwork, for example `<Icon icon="info" variant="filled" />`. The theme's icon receives the variant only when the theme lists it in `iconVariants`; otherwise it draws its normal artwork. Icons you pass as components never receive `variant`, and it is never written to the page. Icons without `variant` render as before.
|
|
57
|
+
- A theme icon can now pick its artwork by size: an entry in `defineTheme({icons})` or `registerIcons()` can be a function of `{size, variant}`, and `Icon` calls it with the size it renders at. Returning `null` draws no icon. `getIcon`, `getExtendedIcon`, `getIconRegistry`, `useIcon`, and a theme's `icons` field still return nodes, reading a function at `{size: 'md'}`. Existing icon entries are unchanged.
|
|
58
|
+
- A theme can list the icon variants it supports, such as `filled`, with `defineTheme({iconVariants})`, and read them back from `theme.iconVariants`. Child themes inherit the list unless they set their own. `@astryxdesign/core/Icon` exports `IconVariantMap` and `IconVariant` for typing variants. Themes without `iconVariants` are unchanged.
|
|
59
|
+
- `astryx theme build` keeps function icons and icon variant lists, so a built theme draws each icon at the same size and variant as the live theme, including icons inherited from another theme. A theme that lists `iconVariants` gets matching types in `<theme>.variants.d.ts`. Themes without these features build exactly as before.
|
|
60
|
+
- Themes can set the real size of each Icon size: `width` and `height` in `px` or `rem` on `components.icon['size:sm']` (or `xsm`, `md`, `lg`) now resize the glyph itself, for named icons and SVG components, in live and built themes. Before, they sized only the box around the icon. Sizes a theme does not style still render at 12, 16, 20, or 24px at a 16px root. `astryx docs theme` gains an Icon sizes section.
|
|
61
|
+
- `useCombobox` (from `@astryxdesign/core/Selector`) can now build an accessible search-with-results on your own text field, such as a search box whose results replace part of the page, or an "add people" field in a dialog. Spread `getFieldProps` on your input, `getListboxProps` on your list, and `getOptionProps` on each option. Focus stays in the field, arrow keys move through results, Enter picks, and Escape hides the list without closing a surrounding dialog. Announce result counts yourself with `useAnnounce`. Existing uses behave as before.
|
|
62
|
+
- Navigation menus support press-and-slide, as DropdownMenu does: in NavHeadingMenu, TopNavMenu, SideNavHeading's menu, TopNavHeading's product menu, BreadcrumbItem's menu, and TabMenu, a press that slides across the items picks the one it lifts on, with the highlight following the pointer. Link items are no longer draggable. Keyboard and screen-reader behavior is unchanged.
|
|
63
|
+
- On touch screens, `ScrollableArea` shows the phone's own scroll indicator, which is easier to see than the faint bar it drew before. Mouse and trackpad scrollbars keep the neutral color. To keep the neutral color on touch screens too, set `scrollbarColor` through `xstyle`.
|
|
64
|
+
- New `--ease-exit` motion token for things leaving the screen, beside `--ease-standard` for things arriving. BottomSheet already closes on it, so nothing looks different, but a theme can now tune the exit. `astryx docs motion` and the theme template list it.
|
|
65
|
+
|
|
66
|
+
#### Fixes
|
|
67
|
+
|
|
68
|
+
- With an `animatedLayout` handle, content before a Collapsible or TreeList change now glides too when the layout moves it, for example items in a centered or end-aligned row.
|
|
69
|
+
- With an `animatedLayout` handle, content after a change now glides even when it carries a resting transform, such as a Button or a swipeable row at rest, instead of jumping.
|
|
70
|
+
- With an `animatedLayout` handle in a right-to-left container, content after a Collapsible or TreeList change now glides instead of jumping.
|
|
71
|
+
- Screen readers now hear announcements made inside an open Dialog, modal BottomSheet, modal Drawer, Lightbox, MobileNav, or CommandPalette. Before, `useAnnounce` messages went to a page region the open dialog hid. Messages sent as a dialog closes are spoken once it has closed. Your code needs no change. Not yet covered: CommandPalette's result counts, Lightbox's position and zoom messages, and Selector's and MultiSelector's sheet messages.
|
|
72
|
+
- `useAnnounce`: messages announced at the same moment are now read together, in order, instead of the last one replacing the others, and an identical repeat is read once. A screen reader no longer misses a result count announced next to a confirmation.
|
|
73
|
+
- A disabled ChatComposerInput keeps focus and its place in the tab order instead of sending focus to the page, and blocks editing and sending while keeping the draft.
|
|
74
|
+
- A disabled ComplexSelector ignores selections from a popup that was already open.
|
|
75
|
+
- Disabling an InputGroup now disables the inputs and Button addons inside it, unless a child sets its own state.
|
|
76
|
+
- A disabled Tokenizer blocks adding, creating, and removing tokens, and leaves its values out of form submission.
|
|
77
|
+
- Banner's status text color no longer leaks into your `endContent`, including dialogs opened from it.
|
|
78
|
+
- BottomSheet renders fewer page elements, with no visual change.
|
|
79
|
+
- With Reduce Motion on, BottomSheets (including `BottomSheetSwitcher` steps) no longer slide or scale: on touch screens they fade in place within 200 ms, and with a mouse or keyboard they change at once. A swipe-to-dismiss fades out in place.
|
|
80
|
+
- When a shorter BottomSheet replaces a taller one, the taller sheet moves down to meet it before fading, so the switch looks like one sheet changing height.
|
|
81
|
+
- Toasts shown from a `BottomSheetSwitcher` step appear above the flow and can be pressed. Before, the step covered them.
|
|
82
|
+
- Toasts appear above an open BottomSheet and can be pressed. Before, the sheet covered them, and pressing a toast's action could dismiss the sheet instead.
|
|
83
|
+
- Typeahead and CommandPalette no longer announce "Loading" after the results have already arrived.
|
|
84
|
+
- ClickableCard, SelectableCard, and interactive Thumbnails show their pressed state under a finger in apps that compile Astryx from source (the Vite and PostCSS integrations, and Storybook). Mouse hover and press, and the precompiled stylesheet, are unchanged.
|
|
85
|
+
- `ChatComposer`'s status bar announces each error and warning once, without its decorative icon, and no longer announces a status that is already showing when the page loads.
|
|
86
|
+
- Tapping the clear button of an unfocused TextInput or NumberInput now brings up the iPhone keyboard, without scrolling the page.
|
|
87
|
+
- In a CodeBlock with no title or language label, the Copy button no longer covers code. It sits in its own column beside the first line, so long lines stop before it, whether scrolled, wrapped, or right-to-left. Blocks with a header are unchanged.
|
|
88
|
+
- A long unbroken word, such as a URL or file path, in CommandPalette's empty message now wraps instead of spilling past both edges.
|
|
89
|
+
- ComplexSelector's trigger is now a combobox, so screen readers hear when the field is required. A custom `renderTrigger` control gets the same role and states, and a disabled one keeps its tab stop without opening. Tests that find the trigger with `getByRole('button')` should use `getByRole('combobox')`.
|
|
90
|
+
- ComplexSelector: your `aria-label` or `aria-labelledby` now names the built-in trigger instead of being ignored.
|
|
91
|
+
- A ContextMenu opened by a long press stays open when the finger lifts.
|
|
92
|
+
- With Reduce Motion on a touch screen, Dialog fades in within 200 ms instead of appearing abruptly. With a mouse it still appears at once.
|
|
93
|
+
- `DropdownMenuRadioItem` now runs your `onClick` and `onPointerMove` handlers, after it selects its value. Disabled rows still select nothing and don't call `onClick`. Its docs now mark `value` and `label` as required.
|
|
94
|
+
- EmptyState announces reliably: it no longer uses `role="status"`, which screen readers read inconsistently. An EmptyState that appears or changes after the page loads announces its title and description once; one present at load announces nothing. A `role` you pass now reaches it. Your code needs no change.
|
|
95
|
+
- Clearing a FileInput returns focus to its visible button, so screen readers announce the field again.
|
|
96
|
+
- On touch screens, Tooltip and HoverCard open only on a real tap. Starting a scroll on an info icon no longer pops them open.
|
|
97
|
+
- Rows with `swipeActions` no longer block pinch-zoom, and a second finger hands the gesture to the browser.
|
|
98
|
+
- With Reduce Motion on, tooltips, popovers, menus, and other layers opened by a finger fade in within 200 ms instead of appearing abruptly. With a mouse they still appear at once.
|
|
99
|
+
- `Layout` no longer uses a selector that could make the browser restyle the whole layout on every change, which slowed long documents. It looks the same.
|
|
100
|
+
- Lightbox fills the visible screen, so Safari's toolbar on iPhone no longer covers the caption.
|
|
101
|
+
- A Lightbox opened before its first item arrives now opens when the item does.
|
|
102
|
+
- In right-to-left pages, Lightbox's arrow keys now match its Next and Previous buttons.
|
|
103
|
+
- Multi-digit numbers in List and Markdown stay on one line in a shared number column, so text and nested lists stay aligned. Bullet lists keep their spacing.
|
|
104
|
+
- Numbered List and Markdown markers end on the same edge with even-width digits, so every period lines up.
|
|
105
|
+
- Pasted-text counts, spoken shortcut names, Ctrl and Esc key caps, and file-size limits are now translated and use local number formats.
|
|
106
|
+
- DropdownMenu and ContextMenu rows under the mouse no longer show a keyboard focus ring after a click.
|
|
107
|
+
- DropdownMenu, MoreMenu, and ContextMenu shown as bottom sheets no longer keep the sheet and every item on the page while closed.
|
|
108
|
+
- `MobileNav` is never wider than 85% of the screen, as documented, so even a 320px phone keeps a strip of page to tap to close it.
|
|
109
|
+
- MultiSelector keeps your `aria-labelledby`, read after the field's label.
|
|
110
|
+
- A disabled `NavHeadingMenuItem` with `href` no longer navigates when clicked or activated.
|
|
111
|
+
- Sliding the mouse across NavHeadingMenu or TabMenu items no longer selects their text.
|
|
112
|
+
- NumberInput keeps your `aria-labelledby`, read after the field's label.
|
|
113
|
+
- A disabled NumberInput stays in the tab order, so keyboard and screen-reader users can reach it and hear that it is unavailable. It is read-only and marked `aria-disabled="true"` instead of using the native `disabled` attribute. Part of #7814.
|
|
114
|
+
- `Overlay`, `DropdownMenuGroup`, and `MobileNavToggle` pass `id`, `data-*`, `aria-*`, and event handlers through to the page, so test ids and analytics attributes work on them.
|
|
115
|
+
- Pressing Escape right after opening a Popover or a collapsed SideNav submenu leaves focus on the trigger instead of moving it into hidden content.
|
|
116
|
+
- An open Popover no longer captures Tab presses made elsewhere on the page. Tab inside the popover still cycles, and Escape still closes it.
|
|
117
|
+
- A Popover rendered into an iframe or a picture-in-picture window now focuses, keeps Tab inside, closes on Escape, and returns focus as it does on the page.
|
|
118
|
+
- PowerSearch no longer announces its starting result count when it mounts in React StrictMode.
|
|
119
|
+
- On phones and tablets, presses made with a mouse, trackpad, or the Space key now show the pressed state.
|
|
120
|
+
- Type declarations resolve in projects that use `moduleResolution: NodeNext`.
|
|
121
|
+
- `RadioList` no longer makes large pages restyle every row's contents on each change. It looks and behaves the same.
|
|
122
|
+
- Scrollable areas (`ScrollableArea`, and Table, CodeBlock, BottomSheet, and Schedule viewports) join the tab order as soon as their content overflows, including content that loads already overflowing.
|
|
123
|
+
- SegmentedControl keeps your `aria-describedby`, read before the disabled reason.
|
|
124
|
+
- Selector keeps your `aria-labelledby`, read after the field's label.
|
|
125
|
+
- Selector's phone sheet no longer points screen readers at an option that hasn't appeared yet.
|
|
126
|
+
- A collapsed SideNav item's tooltip now belongs to the link or button itself, so keyboard focus shows the label and screen readers read it.
|
|
127
|
+
- SideNavHeading: `headerEndContent` now sits beside the heading link instead of inside it, so pressing a button there no longer also follows the link.
|
|
128
|
+
- SideNav's rail collapses and expands smoothly instead of snapping, and the page content inside AppShell moves with it. Under Reduce Motion it cross-fades on touch and changes at once otherwise.
|
|
129
|
+
- Skeleton keeps pulsing in Safari while the page runs JavaScript. It looks and times the same.
|
|
130
|
+
- Slider keeps your `aria-labelledby`, read after its label.
|
|
131
|
+
- An idle Slider no longer keeps a page-wide listener running.
|
|
132
|
+
- A Slider drag belongs to the finger that started it: a second finger can't take it over or end it, and two fingers can still drag two sliders at once.
|
|
133
|
+
- A clickable Step reads as "1 Account" instead of "1Account". Nothing changes on screen. Fixes #7966.
|
|
134
|
+
- A Switch with long content in its row no longer makes the row restyle on every change. Its focus ring looks the same; a link inside the label or description keeps its own focus ring.
|
|
135
|
+
- Tabs and TabMenu triggers no longer shrink below their labels on pages that reset `min-width`; the tab strip scrolls instead.
|
|
136
|
+
- Pinned Table columns keep their row dividers while the table scrolls sideways, including theme and custom border colors.
|
|
137
|
+
- A disabled TextInput or TextArea stays in the tab order, so keyboard and screen-reader users can reach it and hear that it is unavailable. It is read-only and marked `aria-disabled="true"` instead of using the native `disabled` attribute. Part of #7814.
|
|
138
|
+
- TextInput keeps your `aria-labelledby`, read after the field's label.
|
|
139
|
+
- Thumbnail's Open and Remove buttons stay in place, focusable and announced as disabled, while they can't act, so keyboard focus no longer drops to the page.
|
|
140
|
+
- A toast dismissed while hidden, or before it first appeared, now really leaves the stack instead of taking an empty slot later.
|
|
141
|
+
- Tokenizer and PowerSearch put the text cursor right after the last token, on the last row.
|
|
142
|
+
- Tokenizer and PowerSearch tokens wrap before the clear-all button and loading indicator instead of running under them, and rows don't shift when a search starts or ends.
|
|
143
|
+
- A Tooltip that moved clear of its trigger stays clear when the trigger moves or the page scrolls.
|
|
144
|
+
- A Tooltip taller than the space above and below its trigger no longer covers the trigger: it opens beside it, or on the side with more room and scrolls.
|
|
145
|
+
- With Reduce Motion on, TopNav's mega menu fades on touch screens and opens at once with a mouse, instead of rising.
|
|
146
|
+
- Sliding the mouse across TopNavMenu action items no longer selects their text.
|
|
147
|
+
- Typeahead and Tokenizer hide an old "no results" row while the next search is running.
|
|
148
|
+
- Tapping a Typeahead's selected value to edit it, or the clear button in a Selector or MultiSelector search row, now brings up the phone keyboard on the first tap.
|
|
149
|
+
- In Typeahead, Tokenizer, and PowerSearch menus, an option is highlighted only when the pointer moves over it, not when it slides under a resting mouse, so Enter no longer picks an option you didn't point at.
|
|
150
|
+
- `VisuallyHidden` content can no longer be made visible by accident: `xstyle`, `className`, and `style` no longer reach the element.
|
|
151
|
+
|
|
152
|
+
Measured prop by prop against `main`'s implementation, before and after this change:
|
|
153
|
+
|
|
154
|
+
- `xstyle` arrived as the attribute only — the `style` attribute was unaffected — so passing it left a stray attribute on the page and changed nothing you could see.
|
|
155
|
+
- `className` never reached the element, before or after.
|
|
156
|
+
- `style` did reach the element, and an inline style could un-hide the content. It no longer does; this is the one visible change.
|
|
157
|
+
|
|
158
|
+
None of the three is styling surface on `VisuallyHiddenProps`: `className` and `style` reach the element only through a cast or an untyped spread, and `xstyle` is documented as ignored, so typed code loses nothing.
|
|
159
|
+
|
|
160
|
+
`xstyle` stays declared on `VisuallyHiddenProps`, documented as ignored, so existing code keeps compiling.
|
|
161
|
+
|
|
162
|
+
- Pinch-zoom works again over the TimeInput, DateTimeInput, and DateInput picker wheels.
|
|
163
|
+
|
|
164
|
+
#### Performance
|
|
165
|
+
|
|
166
|
+
- With an `animatedLayout` handle, a change in a long Collapsible or TreeList measures the page once instead of once per row.
|
|
167
|
+
- Pages with many closed popovers, tooltips, and menus load faster.
|
|
168
|
+
- Closed Tooltips, Selectors, and ComplexSelectors render once when they mount, and Popovers and DropdownMenus render less.
|
|
169
|
+
- Scrolling a `ScrollableArea`, Table, CodeBlock, or BottomSheet body does less work on each frame, so scrolling stays smooth on busy pages.
|
|
170
|
+
|
|
171
|
+
#### Documentation
|
|
172
|
+
|
|
173
|
+
- EmptyState now announces through the page's shared announcer regions. In tests, `getByRole('status')` or `getByRole('alert')` may match those regions; scope the query with `within(container)`.
|
|
174
|
+
- Badge's docs mark `label` as required, matching its types.
|
|
175
|
+
- `DropdownMenuSubMenu`'s docs mark `label` and `children` as required, document `menuDataTestId`, and state that `presentation` defaults to `'adaptive'`.
|
|
176
|
+
- `ListItem`'s docs now say that `isSelected` marks the row as the current item with `aria-current="true"`.
|
|
177
|
+
- Package links now point to the project's GitHub home, `meta/astryx`.
|
|
178
|
+
- SelectableCard's guidance no longer recommends it for single-choice groups, since each card is a checkbox.
|
|
179
|
+
- TabList's description no longer promises a built-in "more" menu (a narrow tab strip scrolls), and the library page template describes `MobileNav` as the slide-out drawer it is.
|
|
180
|
+
|
|
181
|
+
#### Contributors
|
|
182
|
+
|
|
183
|
+
Thanks to everyone who contributed to this release:
|
|
184
|
+
|
|
185
|
+
- @aashish254
|
|
186
|
+
- @cixzhang
|
|
187
|
+
- @ejhammond
|
|
188
|
+
- @ernestt
|
|
189
|
+
- @harjothkhara
|
|
190
|
+
- @HelloOjasMutreja
|
|
191
|
+
- @imdreamrunner
|
|
192
|
+
- @kentonquatman
|
|
193
|
+
- @korkt-kim
|
|
194
|
+
- @kyu-rong
|
|
195
|
+
- @light-merlin-dark
|
|
196
|
+
- @nynexman4464
|
|
197
|
+
- @parinith-web
|
|
198
|
+
- @rubyycheung
|
|
199
|
+
- @thewebartisan7
|
|
200
|
+
- @vjeux
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
3
204
|
# 0.7.4
|
|
4
205
|
|
|
5
206
|
#### New Features
|
|
@@ -66,18 +66,6 @@
|
|
|
66
66
|
* - /packages/core/src/BottomSheet/useSheetGestures.test.ts
|
|
67
67
|
*/
|
|
68
68
|
import { type CSSProperties, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type RefObject, type TouchEvent as ReactTouchEvent, type UIEvent as ReactUIEvent } from 'react';
|
|
69
|
-
/**
|
|
70
|
-
* Whether a gesture that lands on `target` began inside another layer
|
|
71
|
-
* rendered in this sheet's content — a `<dialog>` between the target and the
|
|
72
|
-
* body. A sheet opened from inside a sheet's content, a Dialog opened there,
|
|
73
|
-
* renders its dialog as a descendant of the host's body, so its pointer and
|
|
74
|
-
* touch events bubble through the host's gesture listeners. That gesture is
|
|
75
|
-
* the layer's own: the host must neither arm a drag on it nor take pointer
|
|
76
|
-
* capture for it, which would cancel the drag the layer's own handle began
|
|
77
|
-
* (`component:BottomSheet` FR7: a swipe reaches only the top sheet of a
|
|
78
|
-
* stack; FR6: a covered sheet is blocked).
|
|
79
|
-
*/
|
|
80
|
-
export declare function isInsideNestedLayer(target: EventTarget | null, body: HTMLElement): boolean;
|
|
81
69
|
/**
|
|
82
70
|
* The scrollers a gesture that lands on `target` can scroll, innermost first
|
|
83
71
|
* and the body last: every scrollable box between the target and the body,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,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;AAwJf
|
|
1
|
+
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"A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;;;;;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;;;;;;;;OAQG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;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,cAAc,GACf,EAAE,uBAAuB,GAAG,sBAAsB,CA4yClD"}
|
|
@@ -200,26 +200,6 @@ function isBlockScroller(element) {
|
|
|
200
200
|
return overflowY === 'auto' || overflowY === 'scroll';
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
/**
|
|
204
|
-
* Whether a gesture that lands on `target` began inside another layer
|
|
205
|
-
* rendered in this sheet's content — a `<dialog>` between the target and the
|
|
206
|
-
* body. A sheet opened from inside a sheet's content, a Dialog opened there,
|
|
207
|
-
* renders its dialog as a descendant of the host's body, so its pointer and
|
|
208
|
-
* touch events bubble through the host's gesture listeners. That gesture is
|
|
209
|
-
* the layer's own: the host must neither arm a drag on it nor take pointer
|
|
210
|
-
* capture for it, which would cancel the drag the layer's own handle began
|
|
211
|
-
* (`component:BottomSheet` FR7: a swipe reaches only the top sheet of a
|
|
212
|
-
* stack; FR6: a covered sheet is blocked).
|
|
213
|
-
*/
|
|
214
|
-
export function isInsideNestedLayer(target, body) {
|
|
215
|
-
for (let element = target instanceof Element ? target : null; element != null && element !== body; element = element.parentElement) {
|
|
216
|
-
if (element.localName === 'dialog') {
|
|
217
|
-
return true;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
203
|
/**
|
|
224
204
|
* The scrollers a gesture that lands on `target` can scroll, innermost first
|
|
225
205
|
* and the body last: every scrollable box between the target and the body,
|
|
@@ -917,13 +897,7 @@ export function useSheetGestures({
|
|
|
917
897
|
if (event.button !== 0 || !event.isPrimary) {
|
|
918
898
|
return;
|
|
919
899
|
}
|
|
920
|
-
const
|
|
921
|
-
// A gesture inside a layer this sheet hosts belongs to that layer.
|
|
922
|
-
if (isInsideNestedLayer(event.target, body)) {
|
|
923
|
-
armedBodyRef.current = null;
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
const scrollers = scrollChainUnder(event.target, body);
|
|
900
|
+
const scrollers = scrollChainUnder(event.target, event.currentTarget);
|
|
927
901
|
if (!chainAtTop(scrollers)) {
|
|
928
902
|
armedBodyRef.current = null;
|
|
929
903
|
return;
|
|
@@ -1021,9 +995,8 @@ export function useSheetGestures({
|
|
|
1021
995
|
// At the top, a pull DOWN hands off (collapse); at the bottom, a pull UP
|
|
1022
996
|
// hands off (expand). A gesture that starts mid-content is an ordinary
|
|
1023
997
|
// scroll, but it is tracked all the same: the scroller can run out of
|
|
1024
|
-
// content while the finger is still down (see onTouchMove).
|
|
1025
|
-
|
|
1026
|
-
if (!touch || isInsideNestedLayer(event.target, body)) {
|
|
998
|
+
// content while the finger is still down (see onTouchMove).
|
|
999
|
+
if (!touch) {
|
|
1027
1000
|
touchDragRef.current = null;
|
|
1028
1001
|
return;
|
|
1029
1002
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sour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;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc;;;;;EAUpE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAmB,EACnB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCAiWb;yBAjXe,MAAM"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -50,7 +50,7 @@ import { devWarn } from "../utils/devWarning.js";
|
|
|
50
50
|
import { DialogContext } from "./DialogContext.js";
|
|
51
51
|
import { themeProps } from "../utils/themeProps.js";
|
|
52
52
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
53
|
-
import {
|
|
53
|
+
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
54
54
|
import { focusForLastInput } from "../utils/focusReturn.js";
|
|
55
55
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
56
56
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
@@ -62,11 +62,8 @@ import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
|
62
62
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
63
63
|
function getDialogDirection(triggerEl, distance = 16) {
|
|
64
64
|
const rect = triggerEl.getBoundingClientRect();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const view = triggerEl.ownerDocument.defaultView ?? window;
|
|
68
|
-
const dx = rect.left + rect.width / 2 - view.innerWidth / 2;
|
|
69
|
-
const dy = rect.top + rect.height / 2 - view.innerHeight / 2;
|
|
65
|
+
const dx = rect.left + rect.width / 2 - window.innerWidth / 2;
|
|
66
|
+
const dy = rect.top + rect.height / 2 - window.innerHeight / 2;
|
|
70
67
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
71
68
|
return {
|
|
72
69
|
x: Math.round(dx / dist * distance),
|
|
@@ -361,18 +358,6 @@ export function Dialog({
|
|
|
361
358
|
const triggerElementRef = useRef(null);
|
|
362
359
|
useInteractionModalityTracking();
|
|
363
360
|
|
|
364
|
-
// Input in a second document (a same-origin iframe, a Document
|
|
365
|
-
// Picture-in-Picture window) never reaches the page's listeners, so the
|
|
366
|
-
// dialog's own document keeps its own last input for the focus return while
|
|
367
|
-
// this Dialog is mounted, from before it opens until it unmounts.
|
|
368
|
-
useEffect(() => {
|
|
369
|
-
const ownerDocument = dialogRef.current?.ownerDocument;
|
|
370
|
-
if (ownerDocument == null || ownerDocument === document) {
|
|
371
|
-
return undefined;
|
|
372
|
-
}
|
|
373
|
-
return trackInteractionModalityIn(ownerDocument);
|
|
374
|
-
}, [isInline]);
|
|
375
|
-
|
|
376
361
|
// This runs in a layout effect so the capture lands before any descendant's
|
|
377
362
|
// passive mount effect: all layout effects run before any passive effect,
|
|
378
363
|
// while a child's passive effect runs before this parent's passive effect.
|
|
@@ -384,15 +369,7 @@ export function Dialog({
|
|
|
384
369
|
if (isInline || !isOpen) {
|
|
385
370
|
return;
|
|
386
371
|
}
|
|
387
|
-
|
|
388
|
-
// dialog into a second document (a same-origin iframe, a Document
|
|
389
|
-
// Picture-in-Picture window) through a portal, and a control there that
|
|
390
|
-
// opens it is focused in that document, which the page's document reports
|
|
391
|
-
// only as the iframe element, or not at all. A control in the page that
|
|
392
|
-
// opens such a dialog leaves focus in the page.
|
|
393
|
-
const dialogDocument = dialogRef.current?.ownerDocument ?? document;
|
|
394
|
-
const doc = dialogDocument.hasFocus() ? dialogDocument : document;
|
|
395
|
-
triggerElementRef.current = doc.activeElement;
|
|
372
|
+
triggerElementRef.current = document.activeElement;
|
|
396
373
|
}, [isOpen, isInline]);
|
|
397
374
|
|
|
398
375
|
// Derive dismissal behavior from purpose
|
|
@@ -413,7 +390,7 @@ export function Dialog({
|
|
|
413
390
|
// captured by the layout effect above, before any descendant effect
|
|
414
391
|
// could move focus.
|
|
415
392
|
const trigger = triggerElementRef.current;
|
|
416
|
-
if (trigger && trigger !==
|
|
393
|
+
if (trigger && trigger !== document.body) {
|
|
417
394
|
const dir = getDialogDirection(trigger);
|
|
418
395
|
dialog.style.setProperty('--dialog-dir-x', `${dir.x}px`);
|
|
419
396
|
dialog.style.setProperty('--dialog-dir-y', `${dir.y}px`);
|
|
@@ -435,11 +412,9 @@ export function Dialog({
|
|
|
435
412
|
if (dialog.open) {
|
|
436
413
|
dialog.close();
|
|
437
414
|
}
|
|
438
|
-
// Return focus to the element that opened the dialog
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
if (trigger) {
|
|
442
|
-
focusForLastInput(trigger, undefined, getInteractionModality(trigger.ownerDocument));
|
|
415
|
+
// Return focus to the element that opened the dialog
|
|
416
|
+
if (triggerElementRef.current) {
|
|
417
|
+
focusForLastInput(triggerElementRef.current);
|
|
443
418
|
}
|
|
444
419
|
triggerElementRef.current = null;
|
|
445
420
|
}
|
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
* of pages whose dropdowns only open as anchored popovers. Each wrapper keeps
|
|
12
12
|
* the wrapped component's props and renders nothing until its module loads.
|
|
13
13
|
*
|
|
14
|
-
* The action list preloads at rest; a failed load is not kept, so the next
|
|
15
|
-
* preload or open asks the module loader again (a loader that retries then
|
|
16
|
-
* loads it; a browser does not fetch a native module again once its import
|
|
17
|
-
* failed).
|
|
18
|
-
*
|
|
19
14
|
* Neither wrapper renders on the server or in the render that hydrates server
|
|
20
15
|
* HTML (spec:AST-013 FR9): a lazy component that has not loaded yet would
|
|
21
16
|
* leave server markup incomplete and abort hydration. The closed sheet has no
|
|
@@ -24,11 +19,7 @@
|
|
|
24
19
|
import { type ComponentProps, type ReactElement } from 'react';
|
|
25
20
|
import type { MenuBottomSheet as EagerMenuBottomSheet } from './MenuBottomSheet.js';
|
|
26
21
|
import type { MenuBottomSheetActionList as EagerMenuBottomSheetActionList } from './MenuBottomSheetActionList.js';
|
|
27
|
-
/**
|
|
28
|
-
* Starts loading the action list; a sheet menu calls it at rest. A preload
|
|
29
|
-
* that fails is dropped, never an unhandled rejection: the first open asks the
|
|
30
|
-
* module loader again.
|
|
31
|
-
*/
|
|
22
|
+
/** Starts loading the action list; a sheet menu calls it at rest. */
|
|
32
23
|
export declare function preloadMenuBottomSheetActionList(): void;
|
|
33
24
|
export declare function MenuBottomSheet(props: ComponentProps<typeof EagerMenuBottomSheet>): ReactElement | null;
|
|
34
25
|
export declare function MenuBottomSheetActionList(props: ComponentProps<typeof EagerMenuBottomSheetActionList>): ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyMenuBottomSheet.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/lazyMenuBottomSheet.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"lazyMenuBottomSheet.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/lazyMenuBottomSheet.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,eAAe,IAAI,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EAAC,yBAAyB,IAAI,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAuB7G,qEAAqE;AACrE,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAQD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACjD,YAAY,GAAG,IAAI,CASrB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,cAAc,CAAC,OAAO,8BAA8B,CAAC,GAC3D,YAAY,GAAG,IAAI,CAcrB"}
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
* of pages whose dropdowns only open as anchored popovers. Each wrapper keeps
|
|
16
16
|
* the wrapped component's props and renders nothing until its module loads.
|
|
17
17
|
*
|
|
18
|
-
* The action list preloads at rest; a failed load is not kept, so the next
|
|
19
|
-
* preload or open asks the module loader again (a loader that retries then
|
|
20
|
-
* loads it; a browser does not fetch a native module again once its import
|
|
21
|
-
* failed).
|
|
22
|
-
*
|
|
23
18
|
* Neither wrapper renders on the server or in the render that hydrates server
|
|
24
19
|
* HTML (spec:AST-013 FR9): a lazy component that has not loaded yet would
|
|
25
20
|
* leave server markup incomplete and abort hydration. The closed sheet has no
|
|
@@ -41,22 +36,13 @@ async function loadActionList() {
|
|
|
41
36
|
actionListLoad ??= import("./MenuBottomSheetActionList.js").then(module => {
|
|
42
37
|
actionListModule = module;
|
|
43
38
|
return module;
|
|
44
|
-
}, error => {
|
|
45
|
-
// A failed load (a dropped connection) is not kept: the next caller
|
|
46
|
-
// asks the module loader again.
|
|
47
|
-
actionListLoad = null;
|
|
48
|
-
throw error;
|
|
49
39
|
});
|
|
50
40
|
return actionListLoad;
|
|
51
41
|
}
|
|
52
42
|
|
|
53
|
-
/**
|
|
54
|
-
* Starts loading the action list; a sheet menu calls it at rest. A preload
|
|
55
|
-
* that fails is dropped, never an unhandled rejection: the first open asks the
|
|
56
|
-
* module loader again.
|
|
57
|
-
*/
|
|
43
|
+
/** Starts loading the action list; a sheet menu calls it at rest. */
|
|
58
44
|
export function preloadMenuBottomSheetActionList() {
|
|
59
|
-
loadActionList()
|
|
45
|
+
void loadActionList();
|
|
60
46
|
}
|
|
61
47
|
const LazyMenuBottomSheetActionList = /*#__PURE__*/lazy(async () => loadActionList().then(module => ({
|
|
62
48
|
default: module.MenuBottomSheetActionList
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file NumberInput.tsx
|
|
3
3
|
* @input Uses React, useId, useState, useMemo, useCallback, Field, Icon, InputGroupContext
|
|
4
|
-
* @output Exports NumberInput component, NumberInputProps
|
|
4
|
+
* @output Exports NumberInput component, NumberInputProps
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by NumberInput.test.tsx
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -186,8 +186,6 @@ interface NumberInputPropsBase extends Omit<FieldInputBaseProps, 'onChange' | 'd
|
|
|
186
186
|
isWheelEnabled?: boolean;
|
|
187
187
|
/**
|
|
188
188
|
* Whether to show increment and decrement buttons at the end of the input.
|
|
189
|
-
* The buttons are hidden on coarse pointers (such as touch screens).
|
|
190
|
-
* Direct text entry and keyboard stepping remain available.
|
|
191
189
|
* @default false
|
|
192
190
|
*/
|
|
193
191
|
hasNumberSteppers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../src/NumberInput/N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AAQ,EACd,QAAQ,EACR,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,WAAW,EACX,cAAqB,EACrB,iBAAyB,EACzB,KAAK,EACL,aAAqB,EACrB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EAAE,MAAM,EACV,kBAAkB,EAAE,mBAAmB,EACvC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,SAAS,EACb,EAAE,gBAAgB,+BA8iBlB;yBA5lBe,WAAW"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file NumberInput.tsx
|
|
7
7
|
* @input Uses React, useId, useState, useMemo, useCallback, Field, Icon, InputGroupContext
|
|
8
|
-
* @output Exports NumberInput component, NumberInputProps
|
|
8
|
+
* @output Exports NumberInput component, NumberInputProps
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by NumberInput.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -70,7 +70,7 @@ const styles = {
|
|
|
70
70
|
$$css: true
|
|
71
71
|
},
|
|
72
72
|
wrapperWithNumberSteppers: {
|
|
73
|
-
kwRFfy: "xyri2b
|
|
73
|
+
kwRFfy: "xyri2b",
|
|
74
74
|
$$css: true
|
|
75
75
|
},
|
|
76
76
|
numberStepperButton: {
|
|
@@ -617,7 +617,7 @@ export function NumberInput({
|
|
|
617
617
|
onClick: handleClear
|
|
618
618
|
}), statusIcon, hasNumberSteppers && /*#__PURE__*/_jsxs("div", {
|
|
619
619
|
...{
|
|
620
|
-
className: "xkh2ocl x78zum5
|
|
620
|
+
className: "xkh2ocl x78zum5 xdt5ytf x2lah0s x12xnipv x5j3pgv x13i4uq0 xgbv0en x1t7ytsu x14ydlgx xb3r6kr x1g2gkjz xoao14b"
|
|
621
621
|
},
|
|
622
622
|
children: [/*#__PURE__*/_jsx("button", {
|
|
623
623
|
type: "button",
|
package/dist/astryx.css
CHANGED
|
@@ -1652,7 +1652,6 @@
|
|
|
1652
1652
|
@media (hover: hover){.x2dt3px.x2dt3px:not(#\#):not(#\#):not(#\#){cursor:zoom-in}}
|
|
1653
1653
|
@media (hover: hover){.xqwu39o.xqwu39o:not(#\#):not(#\#):not(#\#){display:flex}}
|
|
1654
1654
|
@media (max-width: 480px){.xedohl4.xedohl4:not(#\#):not(#\#):not(#\#){display:flex}}
|
|
1655
|
-
@media (pointer: coarse){.xhj50sb.xhj50sb:not(#\#):not(#\#):not(#\#){display:none}}
|
|
1656
1655
|
@media (max-width: 480px){.x1rpgqan.x1rpgqan:not(#\#):not(#\#):not(#\#){flex-direction:column}}
|
|
1657
1656
|
@media (pointer: coarse){.x1jymrmb.x1jymrmb:not(#\#):not(#\#):not(#\#){margin-inline-start:auto}}
|
|
1658
1657
|
@media (prefers-reduced-motion: reduce) and (pointer: coarse){.x1m67veq.x1m67veq:not(#\#):not(#\#):not(#\#){opacity:0}}
|
|
@@ -1664,7 +1663,6 @@
|
|
|
1664
1663
|
@media (forced-colors: active){.x815t2r.x815t2r:not(#\#):not(#\#):not(#\#){outline-style:solid}}
|
|
1665
1664
|
@media (forced-colors: active){.xcthrzx.xcthrzx:not(#\#):not(#\#):not(#\#){outline-width:1px}}
|
|
1666
1665
|
@media (forced-colors: active){.x1xvue0r.x1xvue0r:not(#\#):not(#\#):not(#\#){outline-width:var(--border-width)}}
|
|
1667
|
-
@media (pointer: coarse){.x1r3kph8.x1r3kph8:not(#\#):not(#\#):not(#\#){padding-inline-end:var(--astryx-number-input-padding-inline-end,var(--astryx-number-input-padding-inline,var(--astryx-number-input-padding,var(--spacing-2))))}}
|
|
1668
1666
|
@media (pointer: coarse){.x1bjav06.x1bjav06:not(#\#):not(#\#):not(#\#){pointer-events:none}}
|
|
1669
1667
|
@media (prefers-reduced-motion: reduce){.xg83hb1.xg83hb1:not(#\#):not(#\#):not(#\#){scroll-behavior:auto}}
|
|
1670
1668
|
@media (forced-colors: active){.xrih18v.xrih18v:not(#\#):not(#\#):not(#\#){scrollbar-color:auto}}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file focusReturn.ts
|
|
3
|
-
* @input The document's current active element and the shared interaction
|
|
4
|
-
* modality.
|
|
5
|
-
* @output Whether focus is currently "detached" — on nothing in particular —
|
|
6
|
-
* and a focus move whose ring follows the last input.
|
|
7
|
-
* @position Utility; used by overlay triggers (e.g. DateInput, DateTimeInput)
|
|
8
|
-
* that return focus to their control when the overlay closes, but only when
|
|
9
|
-
* the dismiss did not already move focus somewhere the user chose, and by
|
|
10
|
-
* overlays (Dialog, DropdownMenu) that move focus programmatically.
|
|
11
|
-
*/
|
|
12
|
-
import { type InteractionModality } from './interactionModality.js';
|
|
13
1
|
/**
|
|
14
2
|
* True when focus rests on nothing in particular — no active element, or the
|
|
15
3
|
* document body / root element.
|
|
@@ -33,12 +21,8 @@ export declare function isFocusDetached(doc?: Document): boolean;
|
|
|
33
21
|
* autofocus target, the control that opened a Dialog, or a menu trigger the
|
|
34
22
|
* caller renders. Pass `options` (for example `preventScroll`) as to `focus()`.
|
|
35
23
|
*
|
|
36
|
-
* `modality` defaults to the page's last input. A caller moving focus inside a
|
|
37
|
-
* second document (a same-origin iframe, a Document Picture-in-Picture window)
|
|
38
|
-
* passes that document's, which it tracks with `trackInteractionModalityIn`.
|
|
39
|
-
*
|
|
40
24
|
* Make sure modality tracking is active (`useInteractionModalityTracking()`)
|
|
41
25
|
* in the component that calls this.
|
|
42
26
|
*/
|
|
43
|
-
export declare function focusForLastInput(element: HTMLElement, options?: FocusOptions
|
|
27
|
+
export declare function focusForLastInput(element: HTMLElement, options?: FocusOptions): void;
|
|
44
28
|
//# sourceMappingURL=focusReturn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusReturn.d.ts","sourceRoot":"","sources":["../../src/utils/focusReturn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"focusReturn.d.ts","sourceRoot":"","sources":["../../src/utils/focusReturn.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,QAAmB,GAAG,OAAO,CAKjE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,IAAI,CAwBN"}
|