@zappie/foundations 0.9.3 → 0.10.0
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 +8 -0
- package/README.md +42 -0
- package/dist/{engine-D2iRshfW.d.ts → engine-TxMNPD2g.d.ts} +4 -0
- package/dist/index.d.ts +53 -5
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/overlay/drag-to-close.js +51 -0
- package/dist/overlay/drag-to-close.js.map +6 -0
- package/dist/overlay/drag.js +210 -0
- package/dist/overlay/drag.js.map +6 -0
- package/dist/overlay/engine.d.ts +1 -1
- package/dist/overlay/engine.js +11 -2
- package/dist/overlay/engine.js.map +1 -1
- package/dist/overlay/react.js +11 -1
- package/dist/overlay/react.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @zappie/foundations
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5edf72a: Drawers and sheets from `Overlay` drag to close on phones and touch screens. A sheet moves the way it is attached, down for a bottom sheet and towards its side for a side sheet, follows the finger, fades the backdrop, and closes past a quarter of its size or on a flick, the way the close button does. It springs back otherwise. A list inside scrolls first, a sideways swipe stays with a carousel, and a sheet that fills the screen in the direction it would move, a dialog, and a side drawer under a mouse on a wide screen never drag. Under reduced motion the sheet stays still until it closes. `dragToClose={false}` on `Overlay.Content` turns it off.
|
|
8
|
+
|
|
9
|
+
The sheet has `data-drag-to-close` while it can be dragged and `data-swiping` during a drag, for styling a handle. `useDragToClose` gives a sheet you build yourself the same gesture. The gesture loads with the overlay engine, so the initial entry grows by about 0.3 KB gzip.
|
|
10
|
+
|
|
3
11
|
## 0.9.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -111,6 +111,48 @@ then the panel is hidden from assistive technology and takes no keys, presses or
|
|
|
111
111
|
scrolls, apart from Escape and an outside press, which close it. Style the panel
|
|
112
112
|
and `[data-zappie-backdrop]` as usual: both frames match them.
|
|
113
113
|
|
|
114
|
+
## Drag to close
|
|
115
|
+
|
|
116
|
+
On a phone or touch screen, a drawer or sheet from `Overlay` closes when it is
|
|
117
|
+
dragged off the screen. It moves the way it is attached: a sheet at the bottom
|
|
118
|
+
of the screen drags down, a sheet at a side drags towards that side. It follows
|
|
119
|
+
the finger and the backdrop fades. Let go past a quarter of the sheet, or flick
|
|
120
|
+
it, and it closes the way the close button does. Otherwise it springs back.
|
|
121
|
+
|
|
122
|
+
- A list inside the sheet scrolls first, and the sheet drags only once the list
|
|
123
|
+
is back at the top. A sideways swipe, such as on a carousel, stays with the
|
|
124
|
+
carousel. Fields and anything marked `data-no-drag` never start a drag.
|
|
125
|
+
- A sheet that fills the screen in the direction it would move, such as a
|
|
126
|
+
full-height sheet, does not drag. Neither does a dialog, nor a side drawer
|
|
127
|
+
under a mouse on a wide screen.
|
|
128
|
+
- Under reduced motion the sheet stays still while the finger moves and still
|
|
129
|
+
closes when it is let go.
|
|
130
|
+
- `dragToClose={false}` on `Overlay.Content` turns it off. `swipeDirection` on
|
|
131
|
+
`Overlay.Root` fixes the direction.
|
|
132
|
+
|
|
133
|
+
The sheet has `data-drag-to-close` (its direction) while it can be dragged and
|
|
134
|
+
`data-swiping` during a drag, so you can show a handle only when it works:
|
|
135
|
+
|
|
136
|
+
```css
|
|
137
|
+
.sheet-handle {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
[data-drag-to-close="down"] .sheet-handle {
|
|
141
|
+
display: block;
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
For a sheet you build yourself, `useDragToClose` does the same:
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
const dragRef = useDragToClose({ onClose: close, enabled: isOpen });
|
|
149
|
+
return isOpen ? (
|
|
150
|
+
<div ref={dragRef} role="dialog" aria-modal>
|
|
151
|
+
…
|
|
152
|
+
</div>
|
|
153
|
+
) : null;
|
|
154
|
+
```
|
|
155
|
+
|
|
114
156
|
## Branch switch
|
|
115
157
|
|
|
116
158
|
Choosing a branch shows that branch's menu without waiting for the server. A
|
|
@@ -18,6 +18,10 @@ type SurfaceProps = {
|
|
|
18
18
|
open: boolean;
|
|
19
19
|
presentation: Presentation;
|
|
20
20
|
swipeDirection: SwipeDirection;
|
|
21
|
+
/** Drag drawers and sheets off the screen to close them, on phones. */
|
|
22
|
+
dragToClose: boolean;
|
|
23
|
+
/** The drag's direction, when the Root names one. Otherwise the edge the panel is attached to. */
|
|
24
|
+
dragDirection?: SwipeDirection | undefined;
|
|
21
25
|
/** Ids the trigger points at; caller-supplied ids win. */
|
|
22
26
|
contentId: string;
|
|
23
27
|
titleId?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PartOwnedAttributes, a as PartProps } from './engine-
|
|
1
|
+
import { P as PartOwnedAttributes, a as PartProps } from './engine-TxMNPD2g.js';
|
|
2
2
|
import { Presentation, SwipeDirection } from './overlay/engine.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode, KeyboardEvent as KeyboardEvent$1, ImgHTMLAttributes, ChangeEvent, ClipboardEvent } from 'react';
|
|
@@ -787,6 +787,45 @@ declare const Otp: {
|
|
|
787
787
|
} & react.RefAttributes<HTMLElement>>;
|
|
788
788
|
};
|
|
789
789
|
|
|
790
|
+
/** The way a sheet leaves the screen when it is dragged. */
|
|
791
|
+
type DragDirection = "down" | "up" | "left" | "right";
|
|
792
|
+
|
|
793
|
+
/** Options for `useDragToClose`. */
|
|
794
|
+
type DragToCloseOptions = {
|
|
795
|
+
/** Closes the sheet. Pass the same close the sheet's close button uses. */
|
|
796
|
+
onClose: () => void;
|
|
797
|
+
/** Set `false` to keep the sheet still under a drag. Pass the sheet's open state here too. Defaults to `true`. */
|
|
798
|
+
enabled?: boolean;
|
|
799
|
+
/** The way the sheet leaves. Defaults to the viewport edge the sheet is attached to. */
|
|
800
|
+
direction?: DragDirection;
|
|
801
|
+
/** Finds the backdrop to fade as the sheet moves. */
|
|
802
|
+
backdrop?: (panel: HTMLElement) => Element | null | undefined;
|
|
803
|
+
};
|
|
804
|
+
/**
|
|
805
|
+
* Drag a bottom or side sheet off the screen to close it, on phones and touch screens.
|
|
806
|
+
* `Overlay.Content` does this for drawers and sheets. Use the hook for a sheet you build yourself.
|
|
807
|
+
*
|
|
808
|
+
* The sheet follows the finger with `translate` and the backdrop fades. On release it closes past
|
|
809
|
+
* a quarter of its size or on a flick, and otherwise springs back. A scroller inside keeps the
|
|
810
|
+
* gesture until its content is back at the top, and a sideways swipe, such as on a carousel, is
|
|
811
|
+
* never taken. A sheet that fills the viewport along the drag, such as a full-height sheet, and a
|
|
812
|
+
* centred dialog never drag. Under reduced motion the sheet stays still until it closes. Add
|
|
813
|
+
* `data-no-drag` to an element to keep drags that start on it.
|
|
814
|
+
*
|
|
815
|
+
* The sheet gets `data-drag-to-close` (its direction) while it can be dragged, so a handle can be
|
|
816
|
+
* shown only then, and `data-swiping` during a drag.
|
|
817
|
+
*
|
|
818
|
+
* @param options - The close action and, optionally, the direction and the backdrop.
|
|
819
|
+
* @returns A ref for the sheet's panel element.
|
|
820
|
+
*
|
|
821
|
+
* @example
|
|
822
|
+
* ```tsx
|
|
823
|
+
* const dragRef = useDragToClose({ onClose: close, enabled: isOpen });
|
|
824
|
+
* return isOpen ? <div ref={dragRef} role="dialog" aria-modal>…</div> : null;
|
|
825
|
+
* ```
|
|
826
|
+
*/
|
|
827
|
+
declare function useDragToClose<T extends HTMLElement = HTMLElement>(options: DragToCloseOptions): (node: T | null) => void;
|
|
828
|
+
|
|
790
829
|
/**
|
|
791
830
|
* Start downloading the overlay engine now, so the next overlay to open doesn't wait for it.
|
|
792
831
|
*
|
|
@@ -837,9 +876,12 @@ declare function Root$2({ param, id, presentation, swipeDirection, fallback, omi
|
|
|
837
876
|
id: string;
|
|
838
877
|
/** Your URL adapter for overlays whose open state lives in the path. */
|
|
839
878
|
navigation?: OverlayState;
|
|
840
|
-
/** A `dialog`,
|
|
879
|
+
/** A `dialog`, or a `drawer` or `sheet` that drags to close on phones. Use `{ base, sm, md, lg, xl }` for responsive layouts. */
|
|
841
880
|
presentation?: ResponsivePresentation;
|
|
842
|
-
/**
|
|
881
|
+
/**
|
|
882
|
+
* The way a drawer or sheet is dragged to close it on a phone. Defaults to the viewport edge
|
|
883
|
+
* the panel is attached to: down for a bottom sheet, towards its side for a side sheet.
|
|
884
|
+
*/
|
|
843
885
|
swipeDirection?: SwipeDirection;
|
|
844
886
|
} & CloseOptions): react.JSX.Element;
|
|
845
887
|
/**
|
|
@@ -872,6 +914,12 @@ declare const Overlay: {
|
|
|
872
914
|
forceMount?: true;
|
|
873
915
|
/** Where to mount the content. Defaults to `document.body`. */
|
|
874
916
|
container?: HTMLElement | null;
|
|
917
|
+
/**
|
|
918
|
+
* Drag a drawer or sheet off the screen to close it, on phones and touch screens. Set `false`
|
|
919
|
+
* to turn it off. A panel that fills the viewport along the drag, and a dialog, never drag.
|
|
920
|
+
* Defaults to `true`.
|
|
921
|
+
*/
|
|
922
|
+
dragToClose?: boolean;
|
|
875
923
|
} & react.RefAttributes<HTMLElement>>;
|
|
876
924
|
Title: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttributes<HTMLElement>, PartOwnedAttributes> & {
|
|
877
925
|
asChild?: boolean;
|
|
@@ -1115,5 +1163,5 @@ declare const OpenStatus: react.ForwardRefExoticComponent<Omit<react.AllHTMLAttr
|
|
|
1115
1163
|
/** The installed @zappie/foundations version. */
|
|
1116
1164
|
declare const FOUNDATIONS_VERSION: string;
|
|
1117
1165
|
|
|
1118
|
-
export { Account, AccountNotConfiguredError, Address, Branch, BranchMap, Cart, Choice, DeliveryMap, FOUNDATIONS_VERSION, Fulfilment, Image, ItemForm, ItemNote, Money, OpenStatus, OptionGroup, Otp, Overlay, PartProps, PaymentMethods, Quantity, Schedule, Search, Totals, ZappieAccountLink, canOrderAhead, contactLinks, createSearchIndex, formatOpeningHours, formatWallClock, getOpenStatus, parseWallClock, preloadOverlay, scheduleSlots, useControllableState, useOverlay, useZappieAccountUrl, zappieAccountUrl, zappieEnvironment, zappieSupportUrl };
|
|
1119
|
-
export type { ActiveGroup, AddressState, AddressSuggestion, BranchMapLoadErrorState, BranchMapProps, ContactLink, Customer, DeliveryMapProps, ImageProps, ItemFormContext, ItemFormInvalidGroup, ItemFormProps, MapLoadErrorState, NoteState, PaymentMethod, QuantityProps, QuantityState, ScheduleSlot, ScheduleState, ScheduleStatus, SearchResult, SearchSource, SearchState, SignInOptions, TotalsState, ZappieSupportContext };
|
|
1166
|
+
export { Account, AccountNotConfiguredError, Address, Branch, BranchMap, Cart, Choice, DeliveryMap, FOUNDATIONS_VERSION, Fulfilment, Image, ItemForm, ItemNote, Money, OpenStatus, OptionGroup, Otp, Overlay, PartProps, PaymentMethods, Quantity, Schedule, Search, Totals, ZappieAccountLink, canOrderAhead, contactLinks, createSearchIndex, formatOpeningHours, formatWallClock, getOpenStatus, parseWallClock, preloadOverlay, scheduleSlots, useControllableState, useDragToClose, useOverlay, useZappieAccountUrl, zappieAccountUrl, zappieEnvironment, zappieSupportUrl };
|
|
1167
|
+
export type { ActiveGroup, AddressState, AddressSuggestion, BranchMapLoadErrorState, BranchMapProps, ContactLink, Customer, DeliveryMapProps, DragDirection, DragToCloseOptions, ImageProps, ItemFormContext, ItemFormInvalidGroup, ItemFormProps, MapLoadErrorState, NoteState, PaymentMethod, QuantityProps, QuantityState, ScheduleSlot, ScheduleState, ScheduleStatus, SearchResult, SearchSource, SearchState, SignInOptions, TotalsState, ZappieSupportContext };
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export * from "./item-form/index.js";
|
|
|
21
21
|
import { Image } from "./media/image.js";
|
|
22
22
|
import { Money } from "./money.js";
|
|
23
23
|
import { Otp } from "./otp/input.js";
|
|
24
|
+
import { useDragToClose } from "./overlay/drag-to-close.js";
|
|
24
25
|
import { preloadOverlay } from "./overlay/load.js";
|
|
25
26
|
import { Overlay, useOverlay } from "./overlay/react.js";
|
|
26
27
|
import { PaymentMethods } from "./payment/methods.js";
|
|
@@ -66,6 +67,7 @@ export {
|
|
|
66
67
|
preloadOverlay,
|
|
67
68
|
scheduleSlots,
|
|
68
69
|
useControllableState,
|
|
70
|
+
useDragToClose,
|
|
69
71
|
useIntentPreload,
|
|
70
72
|
useOverlay,
|
|
71
73
|
useZappieAccountUrl,
|
package/dist/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"mappings": ";;;AACA,SAAS,uBAAuB;AAIhC,SAAS,SAAS,iCAAiC;AAEnD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,mBAAmB;AAOvC,SAAS,MAAM,cAAc;AAE7B,SAAS,UAAU,wBAAwB;AAO3C,SAAS,eAAe;AAKxB,SAAS,cAAc;AACvB,SAAS,UAAU,qBAAqB;AAMxC,SAAS,kBAAkB;AAE3B,SAAS,4BAA4B;AACrC,cAAc;AACd,SAAS,aAAa;AAEtB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,sBAAsB;AAC/B,SAAS,SAAS,kBAAkB;AACpC,SAAS,sBAAsB;AAE/B,SAAS,mBAAmB,cAAc;AAE1C,SAAS,cAAc,wBAAwB;AAE/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;
|
|
4
|
+
"mappings": ";;;AACA,SAAS,uBAAuB;AAIhC,SAAS,SAAS,iCAAiC;AAEnD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,mBAAmB;AAOvC,SAAS,MAAM,cAAc;AAE7B,SAAS,UAAU,wBAAwB;AAO3C,SAAS,eAAe;AAKxB,SAAS,cAAc;AACvB,SAAS,UAAU,qBAAqB;AAMxC,SAAS,kBAAkB;AAE3B,SAAS,4BAA4B;AACrC,cAAc;AACd,SAAS,aAAa;AAEtB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,sBAAsB;AAK/B,SAAS,sBAAsB;AAC/B,SAAS,SAAS,kBAAkB;AACpC,SAAS,sBAAsB;AAE/B,SAAS,mBAAmB,cAAc;AAE1C,SAAS,cAAc,wBAAwB;AAE/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAjEpB,IAAM,sBAA8B;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/overlay/drag-to-close.ts
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
var attach;
|
|
6
|
+
var gesture;
|
|
7
|
+
var loadGesture = () => gesture ?? (gesture = import("./drag.js").then(
|
|
8
|
+
(module) => attach = module.attachDragToClose,
|
|
9
|
+
(error) => {
|
|
10
|
+
gesture = void 0;
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
));
|
|
14
|
+
function provideGesture(gestureAttach) {
|
|
15
|
+
attach = gestureAttach;
|
|
16
|
+
}
|
|
17
|
+
function useDragToClose(options) {
|
|
18
|
+
const [panel, setPanel] = useState(null);
|
|
19
|
+
const latest = useRef(options);
|
|
20
|
+
latest.current = options;
|
|
21
|
+
const enabled = options.enabled ?? true;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!enabled || !panel) {
|
|
24
|
+
return void 0;
|
|
25
|
+
}
|
|
26
|
+
const options2 = () => latest.current;
|
|
27
|
+
let detach = attach?.(panel, options2);
|
|
28
|
+
let live = true;
|
|
29
|
+
if (!detach) {
|
|
30
|
+
loadGesture().then(
|
|
31
|
+
(loaded) => {
|
|
32
|
+
if (live) {
|
|
33
|
+
detach = loaded(panel, options2);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
() => {
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
return () => {
|
|
41
|
+
live = false;
|
|
42
|
+
detach?.();
|
|
43
|
+
};
|
|
44
|
+
}, [enabled, panel]);
|
|
45
|
+
return setPanel;
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
provideGesture,
|
|
49
|
+
useDragToClose
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=drag-to-close.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/overlay/drag-to-close.ts"],
|
|
4
|
+
"mappings": ";;;AACA,SAAS,WAAW,QAAQ,gBAAgB;AAkB5C,IAAI;AACJ,IAAI;AAEJ,IAAM,cAAc,MACjB,sBAAY,OAAO,WAAQ,EAAE;AAAA,EAC5B,CAAC,WAAY,SAAS,OAAO;AAAA,EAC7B,CAAC,UAAmB;AAClB,cAAU;AACV,UAAM;AAAA,EACR;AACF;AAEK,SAAS,eAAe,eAA6B;AAC1D,WAAS;AACX;AAyBO,SAAS,eACd,SAC0B;AAC1B,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAmB,IAAI;AACjD,QAAM,SAAS,OAAO,OAAO;AAC7B,SAAO,UAAU;AACjB,QAAM,UAAU,QAAQ,WAAW;AACnC,YAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,OAAO;AACtB,aAAO;AAAA,IACT;AACA,UAAMA,WAAU,MAAM,OAAO;AAC7B,QAAI,SAAS,SAAS,OAAOA,QAAO;AACpC,QAAI,OAAO;AACX,QAAI,CAAC,QAAQ;AACX,kBAAY,EAAE;AAAA,QACZ,CAAC,WAAW;AACV,cAAI,MAAM;AACR,qBAAS,OAAO,OAAOA,QAAO;AAAA,UAChC;AAAA,QACF;AAAA,QACA,MAAM;AAAA,QAAC;AAAA,MACT;AAAA,IACF;AACA,WAAO,MAAM;AACX,aAAO;AACP,eAAS;AAAA,IACX;AAAA,EACF,GAAG,CAAC,SAAS,KAAK,CAAC;AACnB,SAAO;AACT;",
|
|
5
|
+
"names": ["options"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// src/overlay/drag.ts
|
|
2
|
+
var EASE = "cubic-bezier(0.32, 0.72, 0, 1)";
|
|
3
|
+
var SETTLE_MS = 500;
|
|
4
|
+
var CLOSE_FRACTION = 0.25;
|
|
5
|
+
var CLOSE_VELOCITY = 0.4;
|
|
6
|
+
var SLOP = 4;
|
|
7
|
+
var EDGE = 2;
|
|
8
|
+
var NO_DRAG = "input, textarea, select, [contenteditable], [data-no-drag]";
|
|
9
|
+
var PHONE = "(pointer: coarse), (max-width: 639.98px)";
|
|
10
|
+
var STILL = "(prefers-reduced-motion: reduce)";
|
|
11
|
+
var matches = (query) => window.matchMedia(query).matches;
|
|
12
|
+
var vertical = (side) => side === "down" || side === "up";
|
|
13
|
+
function dragDirection(panel, preferred) {
|
|
14
|
+
if (!matches(PHONE)) {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
const box = panel.getBoundingClientRect();
|
|
18
|
+
const top = box.top <= EDGE;
|
|
19
|
+
const bottom = box.bottom >= window.innerHeight - EDGE;
|
|
20
|
+
const left = box.left <= EDGE;
|
|
21
|
+
const right = box.right >= window.innerWidth - EDGE;
|
|
22
|
+
if (preferred) {
|
|
23
|
+
const spans = vertical(preferred) ? top && bottom : left && right;
|
|
24
|
+
return spans ? void 0 : preferred;
|
|
25
|
+
}
|
|
26
|
+
return bottom && !top ? "down" : right && !left ? "right" : left && !right ? "left" : void 0;
|
|
27
|
+
}
|
|
28
|
+
function scrolls(target, panel, side) {
|
|
29
|
+
for (let node = target; node && node !== panel.parentElement; node = node.parentElement) {
|
|
30
|
+
const style = getComputedStyle(node);
|
|
31
|
+
if (vertical(side)) {
|
|
32
|
+
const room = node.scrollHeight - node.clientHeight;
|
|
33
|
+
if (/(auto|scroll)/.test(style.overflowY) && room > 0 && (side === "down" ? node.scrollTop > 0 : node.scrollTop < room - 1)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
} else if (/(auto|scroll)/.test(style.overflowX) && node.scrollWidth > node.clientWidth) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
function attachDragToClose(panel, options) {
|
|
43
|
+
let side;
|
|
44
|
+
let start;
|
|
45
|
+
let dragging = false;
|
|
46
|
+
let still = false;
|
|
47
|
+
let offset = 0;
|
|
48
|
+
let settle;
|
|
49
|
+
const shade = () => options().backdrop?.(panel);
|
|
50
|
+
const paint = (distance, spring) => {
|
|
51
|
+
const sign = side === "up" || side === "left" ? -1 : 1;
|
|
52
|
+
const transition = spring ? `${SETTLE_MS}ms ${EASE}` : "none";
|
|
53
|
+
panel.style.transition = spring ? `translate ${transition}` : transition;
|
|
54
|
+
panel.style.translate = side && vertical(side) ? `0 ${sign * distance}px` : `${sign * distance}px 0`;
|
|
55
|
+
const backdrop = shade();
|
|
56
|
+
if (backdrop) {
|
|
57
|
+
backdrop.style.transition = spring ? `filter ${transition}` : transition;
|
|
58
|
+
backdrop.style.filter = `opacity(${Math.max(0, 1 - distance / extent())})`;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const rest = () => {
|
|
62
|
+
window.clearTimeout(settle);
|
|
63
|
+
panel.style.translate = panel.style.transition = "";
|
|
64
|
+
const backdrop = shade();
|
|
65
|
+
if (backdrop) {
|
|
66
|
+
backdrop.style.filter = backdrop.style.transition = "";
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const extent = () => (side && vertical(side) ? panel.offsetHeight : panel.offsetWidth) || 1;
|
|
70
|
+
const mark = () => {
|
|
71
|
+
const direction = dragDirection(panel, options().direction);
|
|
72
|
+
if (direction) {
|
|
73
|
+
panel.setAttribute("data-drag-to-close", direction);
|
|
74
|
+
} else {
|
|
75
|
+
panel.removeAttribute("data-drag-to-close");
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const begin = (x, y, target) => {
|
|
79
|
+
side = dragDirection(panel, options().direction);
|
|
80
|
+
still = matches(STILL);
|
|
81
|
+
dragging = false;
|
|
82
|
+
offset = 0;
|
|
83
|
+
start = side && target instanceof Element && !target.closest(NO_DRAG) ? { x, y, at: performance.now() } : void 0;
|
|
84
|
+
};
|
|
85
|
+
const move = (x, y, target) => {
|
|
86
|
+
if (!start || !side) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const dx = x - start.x;
|
|
90
|
+
const dy = y - start.y;
|
|
91
|
+
const along = side === "down" ? dy : side === "up" ? -dy : side === "right" ? dx : -dx;
|
|
92
|
+
const across = vertical(side) ? dx : dy;
|
|
93
|
+
if (!dragging) {
|
|
94
|
+
if (Math.abs(along) < SLOP && Math.abs(across) < SLOP) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
if (along <= 0 || Math.abs(across) > Math.abs(along) || target instanceof Element && scrolls(target, panel, side)) {
|
|
98
|
+
start = void 0;
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
dragging = true;
|
|
102
|
+
window.clearTimeout(settle);
|
|
103
|
+
panel.setAttribute("data-swiping", "");
|
|
104
|
+
}
|
|
105
|
+
offset = Math.max(0, along);
|
|
106
|
+
if (!still) {
|
|
107
|
+
paint(offset, false);
|
|
108
|
+
}
|
|
109
|
+
return true;
|
|
110
|
+
};
|
|
111
|
+
const end = () => {
|
|
112
|
+
const began = start;
|
|
113
|
+
const dragged = dragging;
|
|
114
|
+
start = void 0;
|
|
115
|
+
dragging = false;
|
|
116
|
+
if (!began || !dragged) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
panel.removeAttribute("data-swiping");
|
|
120
|
+
const velocity = offset / Math.max(1, performance.now() - began.at);
|
|
121
|
+
if (offset > extent() * CLOSE_FRACTION || velocity > CLOSE_VELOCITY) {
|
|
122
|
+
options().onClose();
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
if (!still) {
|
|
126
|
+
paint(0, true);
|
|
127
|
+
settle = window.setTimeout(rest, SETTLE_MS);
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
};
|
|
131
|
+
const touch = (event) => event.touches.length === 1 ? event.touches[0] : void 0;
|
|
132
|
+
const onTouchStart = (event) => {
|
|
133
|
+
const point = touch(event);
|
|
134
|
+
if (point) {
|
|
135
|
+
begin(point.clientX, point.clientY, event.target);
|
|
136
|
+
} else {
|
|
137
|
+
start = void 0;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const onTouchMove = (event) => {
|
|
141
|
+
const point = touch(event);
|
|
142
|
+
if (point && move(point.clientX, point.clientY, event.target) && event.cancelable) {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const onTouchEnd = () => {
|
|
147
|
+
end();
|
|
148
|
+
};
|
|
149
|
+
const mouse = (event) => event.pointerType === "mouse";
|
|
150
|
+
const onPointerDown = (event) => {
|
|
151
|
+
if (mouse(event) && event.button === 0) {
|
|
152
|
+
begin(event.clientX, event.clientY, event.target);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const onPointerMove = (event) => {
|
|
156
|
+
if (mouse(event) && move(event.clientX, event.clientY, event.target)) {
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const swallow = (event) => {
|
|
161
|
+
event.preventDefault();
|
|
162
|
+
event.stopPropagation();
|
|
163
|
+
};
|
|
164
|
+
const onPointerUp = (event) => {
|
|
165
|
+
if (mouse(event) && end()) {
|
|
166
|
+
window.addEventListener("click", swallow, { capture: true, once: true });
|
|
167
|
+
window.setTimeout(
|
|
168
|
+
() => window.removeEventListener("click", swallow, { capture: true })
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const phone = window.matchMedia(PHONE);
|
|
173
|
+
const observer = typeof ResizeObserver === "function" ? new ResizeObserver(mark) : void 0;
|
|
174
|
+
rest();
|
|
175
|
+
mark();
|
|
176
|
+
observer?.observe(panel);
|
|
177
|
+
phone.addEventListener("change", mark);
|
|
178
|
+
window.addEventListener("resize", mark);
|
|
179
|
+
panel.addEventListener("animationend", mark);
|
|
180
|
+
panel.addEventListener("transitionend", mark);
|
|
181
|
+
panel.addEventListener("touchstart", onTouchStart, { passive: true });
|
|
182
|
+
panel.addEventListener("touchmove", onTouchMove, { passive: false });
|
|
183
|
+
panel.addEventListener("touchend", onTouchEnd);
|
|
184
|
+
panel.addEventListener("touchcancel", onTouchEnd);
|
|
185
|
+
panel.addEventListener("pointerdown", onPointerDown);
|
|
186
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
187
|
+
window.addEventListener("pointerup", onPointerUp);
|
|
188
|
+
return () => {
|
|
189
|
+
window.clearTimeout(settle);
|
|
190
|
+
observer?.disconnect();
|
|
191
|
+
phone.removeEventListener("change", mark);
|
|
192
|
+
window.removeEventListener("resize", mark);
|
|
193
|
+
panel.removeEventListener("animationend", mark);
|
|
194
|
+
panel.removeEventListener("transitionend", mark);
|
|
195
|
+
panel.removeEventListener("touchstart", onTouchStart);
|
|
196
|
+
panel.removeEventListener("touchmove", onTouchMove);
|
|
197
|
+
panel.removeEventListener("touchend", onTouchEnd);
|
|
198
|
+
panel.removeEventListener("touchcancel", onTouchEnd);
|
|
199
|
+
panel.removeEventListener("pointerdown", onPointerDown);
|
|
200
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
201
|
+
window.removeEventListener("pointerup", onPointerUp);
|
|
202
|
+
panel.removeAttribute("data-drag-to-close");
|
|
203
|
+
panel.removeAttribute("data-swiping");
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
attachDragToClose,
|
|
208
|
+
dragDirection
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=drag.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/overlay/drag.ts"],
|
|
4
|
+
"mappings": ";AAaA,IAAM,OAAO;AACb,IAAM,YAAY;AAElB,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AAEvB,IAAM,OAAO;AAEb,IAAM,OAAO;AACb,IAAM,UAAU;AAEhB,IAAM,QAAQ;AACd,IAAM,QAAQ;AACd,IAAM,UAAU,CAAC,UAAkB,OAAO,WAAW,KAAK,EAAE;AAC5D,IAAM,WAAW,CAAC,SAAwB,SAAS,UAAU,SAAS;AAS/D,SAAS,cACd,OACA,WAC2B;AAC3B,MAAI,CAAC,QAAQ,KAAK,GAAG;AACnB,WAAO;AAAA,EACT;AACA,QAAM,MAAM,MAAM,sBAAsB;AACxC,QAAM,MAAM,IAAI,OAAO;AACvB,QAAM,SAAS,IAAI,UAAU,OAAO,cAAc;AAClD,QAAM,OAAO,IAAI,QAAQ;AACzB,QAAM,QAAQ,IAAI,SAAS,OAAO,aAAa;AAC/C,MAAI,WAAW;AACb,UAAM,QAAQ,SAAS,SAAS,IAAI,OAAO,SAAS,QAAQ;AAC5D,WAAO,QAAQ,SAAY;AAAA,EAC7B;AACA,SAAO,UAAU,CAAC,MACd,SACA,SAAS,CAAC,OACR,UACA,QAAQ,CAAC,QACP,SACA;AACV;AAGA,SAAS,QAAQ,QAAiB,OAAoB,MAAqB;AACzE,WACM,OAAuB,QAC3B,QAAQ,SAAS,MAAM,eACvB,OAAO,KAAK,eACZ;AACA,UAAM,QAAQ,iBAAiB,IAAI;AACnC,QAAI,SAAS,IAAI,GAAG;AAClB,YAAM,OAAO,KAAK,eAAe,KAAK;AACtC,UACE,gBA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oBAAoB,eAAe,aAAa;AACvD,WAAO,oBAAoB,aAAa,WAAW;AACnD,UAAM,gBAAgB,oBAAoB;AAC1C,UAAM,gBAAgB,cAAc;AAAA,EACtC;AACF;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/overlay/engine.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { E as EngineClose, c as EngineTitle, b as Presentation, d as Surface, e as SurfaceProps, S as SwipeDirection, u as useEngineParts } from '../engine-
|
|
1
|
+
export { E as EngineClose, c as EngineTitle, b as Presentation, d as Surface, e as SurfaceProps, S as SwipeDirection, u as useEngineParts } from '../engine-TxMNPD2g.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@base-ui/react/dialog';
|
package/dist/overlay/engine.js
CHANGED
|
@@ -9,7 +9,10 @@ import {
|
|
|
9
9
|
useContext
|
|
10
10
|
} from "react";
|
|
11
11
|
import { composeRefs, part, partId } from "../internal/slot.js";
|
|
12
|
+
import { attachDragToClose } from "./drag.js";
|
|
13
|
+
import { provideGesture, useDragToClose } from "./drag-to-close.js";
|
|
12
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
provideGesture(attachDragToClose);
|
|
13
16
|
var PartsContext = /* @__PURE__ */ createContext(null);
|
|
14
17
|
function useEngineParts() {
|
|
15
18
|
const parts = useContext(PartsContext);
|
|
@@ -43,6 +46,12 @@ function Popup({
|
|
|
43
46
|
const { contentProps, contentRef, presentation, state } = props;
|
|
44
47
|
const { id: _ownId, ...rest } = contentProps;
|
|
45
48
|
const id = partId(contentProps);
|
|
49
|
+
const dragRef = useDragToClose({
|
|
50
|
+
onClose: props.onClose,
|
|
51
|
+
enabled: props.open && props.dragToClose && presentation !== "dialog",
|
|
52
|
+
...props.dragDirection ? { direction: props.dragDirection } : {},
|
|
53
|
+
backdrop: (panel) => panel.closest("[data-base-ui-portal]")?.querySelector("[data-zappie-backdrop]")
|
|
54
|
+
});
|
|
46
55
|
return /* @__PURE__ */ jsx(
|
|
47
56
|
Component,
|
|
48
57
|
{
|
|
@@ -61,7 +70,7 @@ function Popup({
|
|
|
61
70
|
"data-presentation": presentation,
|
|
62
71
|
"data-state": props.open ? "open" : "closed"
|
|
63
72
|
},
|
|
64
|
-
composeRefs(baseRef, contentRef)
|
|
73
|
+
composeRefs(baseRef, contentRef, dragRef)
|
|
65
74
|
);
|
|
66
75
|
}
|
|
67
76
|
}
|
|
@@ -121,7 +130,7 @@ function Surface(props) {
|
|
|
121
130
|
"data-state": props.open ? "open" : "closed"
|
|
122
131
|
}
|
|
123
132
|
),
|
|
124
|
-
/* @__PURE__ */ jsx(Drawer.VirtualKeyboardProvider, { children: /* @__PURE__ */ jsx(Drawer.Viewport, { children: /* @__PURE__ */ jsx(
|
|
133
|
+
/* @__PURE__ */ jsx(Drawer.VirtualKeyboardProvider, { children: /* @__PURE__ */ jsx(Drawer.Viewport, { "data-base-ui-swipe-ignore": "", children: /* @__PURE__ */ jsx(
|
|
125
134
|
Popup,
|
|
126
135
|
{
|
|
127
136
|
props,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/overlay/engine.tsx"],
|
|
4
|
-
"mappings": ";;;AAGA,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,aAAa,MAAM,cAA8B;
|
|
4
|
+
"mappings": ";;;AAGA,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,aAAa,MAAM,cAA8B;AAC1D,SAAS,yBAAyB;AAClC,SAAS,gBAAgB,sBAAsB;AAyF3C,cAiDM,YAjDN;AAvFJ,eAAe,iBAAiB;AAgChC,IAAM,eAA+B,8BAA4B,IAAI;AAC9D,SAAS,iBAAiB;AAC/B,QAAM,QAAQ,WAAW,YAAY;AACrC,MAAI,C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({
|
|
|
139
139
|
...overlay,
|
|
140
140
|
presentation: resolved,
|
|
141
141
|
swipeDirection: swipeDirection ?? (resolved === "sheet" ? "right" : "down"),
|
|
142
|
+
dragDirection: swipeDirection,
|
|
142
143
|
contentId,
|
|
143
144
|
setContentId,
|
|
144
145
|
trigger
|
|
@@ -327,7 +328,14 @@ function Frame({
|
|
|
327
328
|
);
|
|
328
329
|
}
|
|
329
330
|
var Content = /* @__PURE__ */ forwardRef(
|
|
330
|
-
function Content2({
|
|
331
|
+
function Content2({
|
|
332
|
+
onEscape,
|
|
333
|
+
onInteractOutside,
|
|
334
|
+
forceMount,
|
|
335
|
+
container,
|
|
336
|
+
dragToClose = true,
|
|
337
|
+
...props
|
|
338
|
+
}, ref) {
|
|
331
339
|
const ctx = useContextValue();
|
|
332
340
|
const parent = useContext(ContentContext);
|
|
333
341
|
const [loaded, setEngine] = useState(loadedOverlayEngine);
|
|
@@ -417,6 +425,8 @@ var Content = /* @__PURE__ */ forwardRef(
|
|
|
417
425
|
open: ctx.isOpen,
|
|
418
426
|
presentation: ctx.presentation,
|
|
419
427
|
swipeDirection: ctx.swipeDirection,
|
|
428
|
+
dragToClose,
|
|
429
|
+
dragDirection: ctx.dragDirection,
|
|
420
430
|
contentId: ctx.contentId,
|
|
421
431
|
trigger: ctx.trigger,
|
|
422
432
|
onOpen: () => ctx.open(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/overlay/react.tsx"],
|
|
4
|
-
"mappings": ";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,cAAc,iBAAiB;AACxC,SAAS,aAAa,MAAM,cAA8B;AAE1D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,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ACb,QAAQ,MAAM,IAAI,KAAK;AAAA,QACvB,SAAS,IAAI;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,cAAc;AAAA,QACd,YAAY;AAAA;AAAA,IACd,GACF,GACF;AAAA,EAEJ;AACF;AAMA,IAAM,eAA+B,8BAA4B,IAAI;AACrE,IAAM,aAAoB;AAAA,EACxB,aAAa,WAAwC,SAAS,WAC5D,EAAE,OAAO,GAAG,MAAM,GAClB,KACA;AACA,WAAO,KAAK,MAAM,OAAO,OAAO,CAAC,GAAG,GAAG;AAAA,EACzC,CAAC;AAAA,EACD,aAAa,WAAwC,SAAS,WAC5D,EAAE,OAAO,GAAG,MAAM,GAClB,KACA;AACA,WAAO,KAAK,UAAU,OAAO,OAAO,EAAE,MAAM,SAAS,GAAG,GAAG;AAAA,EAC7D,CAAC;AACH;AACA,SAAS,YAAY;AACnB,QAAM,QAAQ,WAAW,YAAY;AACrC,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AACA,IAAM,QAAwB;AAAA,EAC5B,SAASC,OAAM,OAAO,KAAK;AACzB,UAAM,MAAM,gBAAgB;AAC5B,UAAM,EAAE,YAAY,IAAI,UAAU;AAClC,WACE,oBAAC,eAAa,GAAI,OAA8B,OAAO,KAAK,KAAU;AAAA,EAE1E;AACF;AACA,IAAM,QAAwB;AAAA,EAC5B,SAASC,OAAM,OAAO,KAAK;AACzB,UAAM,MAAM,gBAAgB;AAC5B,UAAM,EAAE,YAAY,IAAI,UAAU;AAClC,WACE,oBAAC,eAAa,GAAI,OAA8B,OAAO,KAAK,KAAU;AAAA,EAE1E;AACF;AAKO,IAAM,UAAU,EAAE,MAAM,SAAS,SAAS,OAAO,MAAM;",
|
|
5
5
|
"names": ["Trigger", "Content", "Title", "Close"]
|
|
6
6
|
}
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
package/package.json
CHANGED