@ahrowe/ui 0.41.1 → 0.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs-types/common/hooks/useAnchorTracking.d.ts +4 -3
- package/dist/cjs-types/common/popover/usePopoverPosition.d.ts +6 -1
- package/dist/esm/common/fab/fab.module.mjs.map +1 -1
- package/dist/esm/common/hooks/useAnchorTracking.mjs +1 -1
- package/dist/esm/common/hooks/useAnchorTracking.mjs.map +1 -1
- package/dist/esm/common/hooks/useFocusBoundary.mjs +1 -1
- package/dist/esm/common/hooks/useFocusBoundary.mjs.map +1 -1
- package/dist/esm/common/hooks/useOverlay.mjs +1 -1
- package/dist/esm/common/hooks/useOverlay.mjs.map +1 -1
- package/dist/esm/common/modal/modal.module.mjs.map +1 -1
- package/dist/esm/common/popover/popover.mjs +1 -1
- package/dist/esm/common/popover/popover.mjs.map +1 -1
- package/dist/esm/common/popover/popover.module.mjs.map +1 -1
- package/dist/esm/common/popover/usePopoverPosition.mjs +1 -1
- package/dist/esm/common/popover/usePopoverPosition.mjs.map +1 -1
- package/dist/esm/common/styles/sheet.module.mjs.map +1 -1
- package/dist/esm/common/tooltip/tooltip.module.mjs.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/common/hooks/useAnchorTracking.d.ts +4 -3
- package/dist/types/common/popover/usePopoverPosition.d.ts +6 -1
- package/docs/Modal.md +1 -1
- package/package.json +1 -1
|
@@ -9,10 +9,11 @@ export interface UseAnchorTrackingArgs {
|
|
|
9
9
|
*/
|
|
10
10
|
elementRefs: RefObject<HTMLElement | null>[];
|
|
11
11
|
/**
|
|
12
|
-
* Positions the popup. Called once on setup and then on every scroll, resize
|
|
13
|
-
* change
|
|
12
|
+
* Positions the popup. Called once on setup and then on every scroll, resize, tracked size
|
|
13
|
+
* change and end of a CSS animation that moved the trigger, plus whenever it calls `rerun` for
|
|
14
|
+
* an end none of those report. Reads the caller's own refs for everything else.
|
|
14
15
|
*/
|
|
15
|
-
update: (trigger: HTMLElement, ancestors: HTMLElement[]) => void;
|
|
16
|
+
update: (trigger: HTMLElement, ancestors: HTMLElement[], rerun: () => void) => void;
|
|
16
17
|
/**
|
|
17
18
|
* Elements whose own size changes must re-run `update`: a popup whose content changes size
|
|
18
19
|
* while open (a filtered list shrinking, an async list loading in) otherwise keeps coordinates
|
|
@@ -32,6 +32,11 @@ export interface UsePopoverPositionArgs {
|
|
|
32
32
|
* panel that overhangs it.
|
|
33
33
|
*/
|
|
34
34
|
shrinkToFit?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Called when a newly opened panel first becomes visible. Focus has to wait for it: a panel
|
|
37
|
+
* still hidden, waiting out an ancestor's animation, takes none.
|
|
38
|
+
*/
|
|
39
|
+
onShown?: () => void;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
42
|
* Positions a portaled, `position: fixed` popover on any of the four sides of its trigger with
|
|
@@ -42,4 +47,4 @@ export interface UsePopoverPositionArgs {
|
|
|
42
47
|
* `useAnchorTracking` supplies the lifecycle around this: mount wait, ancestor resolution, and
|
|
43
48
|
* re-running on scroll, viewport resize and panel size changes.
|
|
44
49
|
*/
|
|
45
|
-
export declare function usePopoverPosition({ isOpen, placement, align, offset, triggerRef, floatingRef, panelRef, arrowRef, matchTriggerWidth, shrinkToFit, }: UsePopoverPositionArgs): void;
|
|
50
|
+
export declare function usePopoverPosition({ isOpen, placement, align, offset, triggerRef, floatingRef, panelRef, arrowRef, matchTriggerWidth, shrinkToFit, onShown, }: UsePopoverPositionArgs): void;
|
package/docs/Modal.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
The panel itself never scrolls: the header is fixed and the children scroll inside the `body` slot, so the title and close button stay visible no matter how long the content is. Pass `footer` for anything that should stay put below the content, typically the action buttons.
|
|
10
10
|
|
|
11
|
-
While open, the modal traps focus (focus moves into the panel and returns to whatever was focused before on close), locks scrolling on the page behind it, and closes on Escape. A key already held down when it opens does not repeat into it, so holding Enter on the button that opens it does not go on to press whatever the modal focused first. Modals nest correctly: Escape closes only the topmost one, and the page stays locked until the last one closes. The same applies to anything opened from inside a modal — a `Menu`, `Dropdown` or `Popover` counts as the layer above it, so Escape closes that first, and the modal's focus trap leaves focus alone while it's open (all three render through the same portal, so their DOM sits beside the modal's panel rather than inside it).
|
|
11
|
+
While open, the modal traps focus (focus moves into the panel and returns to whatever was focused before on close), locks scrolling on the page behind it, and closes on Escape. A key already held down when it opens does not repeat into it, so holding Enter on the button that opens it does not go on to press whatever the modal focused first. Modals nest correctly: Escape closes only the topmost one, and the page stays locked until the last one closes. Modal, Popover and Tooltip share one `z-index`, so whichever opened last paints on top, a Modal opened from a Popover included. The same applies to anything opened from inside a modal — a `Menu`, `Dropdown` or `Popover` counts as the layer above it, so Escape closes that first, and the modal's focus trap leaves focus alone while it's open (all three render through the same portal, so their DOM sits beside the modal's panel rather than inside it).
|
|
12
12
|
|
|
13
13
|
```tsx
|
|
14
14
|
import { Modal, ActionButtons } from '@ahrowe/ui';
|