@zappie/foundations 0.14.0 → 0.16.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 +35 -0
- package/README.md +68 -0
- package/dist/account/index.js +1 -48
- package/dist/account/index.js.map +1 -1
- package/dist/account/zappie-account.js +1 -38
- package/dist/account/zappie-account.js.map +1 -1
- package/dist/attribution/powered-by-zappie.js +2 -0
- package/dist/attribution/powered-by-zappie.js.map +6 -0
- package/dist/branch-map/colors.js +1 -26
- package/dist/branch-map/colors.js.map +1 -1
- package/dist/branch-map/delivery-map.js +1 -59
- package/dist/branch-map/delivery-map.js.map +1 -1
- package/dist/branch-map/delivery-runtime.js +1 -117
- package/dist/branch-map/delivery-runtime.js.map +1 -1
- package/dist/branch-map/fit.js +1 -107
- package/dist/branch-map/fit.js.map +1 -1
- package/dist/branch-map/geometry.js +1 -11
- package/dist/branch-map/geometry.js.map +1 -1
- package/dist/branch-map/index.js +1 -94
- package/dist/branch-map/index.js.map +1 -1
- package/dist/branch-map/loader.js +1 -38
- package/dist/branch-map/loader.js.map +1 -1
- package/dist/branch-map/markers.js +1 -182
- package/dist/branch-map/markers.js.map +1 -1
- package/dist/branch-map/runtime.js +1 -294
- package/dist/branch-map/runtime.js.map +1 -1
- package/dist/branch-map/use-map-runtime.js +1 -52
- package/dist/branch-map/use-map-runtime.js.map +1 -1
- package/dist/branch-switch/index.js +1 -125
- package/dist/branch-switch/index.js.map +1 -1
- package/dist/cart/index.js +1 -170
- package/dist/cart/index.js.map +1 -1
- package/dist/checkout/attempt.js +1 -48
- package/dist/checkout/attempt.js.map +1 -1
- package/dist/checkout/contact.js +1 -35
- package/dist/checkout/contact.js.map +1 -1
- package/dist/checkout/index.js +1 -33
- package/dist/checkout/index.js.map +1 -1
- package/dist/checkout/markers.js +1 -25
- package/dist/checkout/markers.js.map +1 -1
- package/dist/checkout/offers.js +1 -12
- package/dist/checkout/offers.js.map +1 -1
- package/dist/checkout/pay-after-sign-in.js +1 -77
- package/dist/checkout/pay-after-sign-in.js.map +1 -1
- package/dist/checkout/sign-in.js +1 -25
- package/dist/checkout/sign-in.js.map +1 -1
- package/dist/checkout/status.js +1 -72
- package/dist/checkout/status.js.map +1 -1
- package/dist/checkout/timing.js +1 -38
- package/dist/checkout/timing.js.map +1 -1
- package/dist/checkout/use-checkout-flow.js +1 -598
- package/dist/checkout/use-checkout-flow.js.map +1 -1
- package/dist/deferred/index.js +1 -141
- package/dist/deferred/index.js.map +1 -1
- package/dist/fulfilment/address-picker.js +1 -165
- package/dist/fulfilment/address-picker.js.map +1 -1
- package/dist/fulfilment/branch-picker.js +1 -53
- package/dist/fulfilment/branch-picker.js.map +1 -1
- package/dist/fulfilment/schedule.js +1 -126
- package/dist/fulfilment/schedule.js.map +1 -1
- package/dist/fulfilment/switch.js +1 -53
- package/dist/fulfilment/switch.js.map +1 -1
- package/dist/fulfilment/window.js +1 -154
- package/dist/fulfilment/window.js.map +1 -1
- package/dist/index.d.ts +31 -110
- package/dist/index.js +1 -76
- package/dist/index.js.map +1 -1
- package/dist/internal/combobox.js +1 -130
- package/dist/internal/combobox.js.map +1 -1
- package/dist/internal/data-attrs.js +1 -7
- package/dist/internal/data-attrs.js.map +1 -1
- package/dist/internal/ids.js +1 -9
- package/dist/internal/ids.js.map +1 -1
- package/dist/internal/slot.js +1 -87
- package/dist/internal/slot.js.map +1 -1
- package/dist/internal/use-controllable-state.js +1 -28
- package/dist/internal/use-controllable-state.js.map +1 -1
- package/dist/item-form/index.js +1 -14
- package/dist/item-form/index.js.map +1 -1
- package/dist/item-form/option-group.js +1 -331
- package/dist/item-form/option-group.js.map +1 -1
- package/dist/item-form/options.js +1 -64
- package/dist/item-form/options.js.map +1 -1
- package/dist/item-form/quantity.js +1 -130
- package/dist/item-form/quantity.js.map +1 -1
- package/dist/item-form/root.js +1 -182
- package/dist/item-form/root.js.map +1 -1
- package/dist/item-sheet/index.d.ts +137 -0
- package/dist/item-sheet/index.js +2 -0
- package/dist/item-sheet/index.js.map +6 -0
- package/dist/loyalty/index.js +1 -278
- package/dist/loyalty/index.js.map +1 -1
- package/dist/media/image.js +1 -58
- package/dist/media/image.js.map +1 -1
- package/dist/money.js +1 -19
- package/dist/money.js.map +1 -1
- package/dist/next.js +1 -57
- package/dist/next.js.map +1 -1
- package/dist/order/index.js +1 -575
- package/dist/order/index.js.map +1 -1
- package/dist/order/model.js +1 -83
- package/dist/order/model.js.map +1 -1
- package/dist/order/use-customer-order.js +1 -55
- package/dist/order/use-customer-order.js.map +1 -1
- package/dist/otp/input.js +1 -109
- package/dist/otp/input.js.map +1 -1
- package/dist/overlay/drag-to-close.js +1 -50
- package/dist/overlay/drag-to-close.js.map +1 -1
- package/dist/overlay/drag.js +1 -209
- package/dist/overlay/drag.js.map +1 -1
- package/dist/overlay/engine.js +1 -184
- package/dist/overlay/engine.js.map +1 -1
- package/dist/overlay/history.js +1 -101
- package/dist/overlay/history.js.map +1 -1
- package/dist/overlay/load.js +1 -28
- package/dist/overlay/load.js.map +1 -1
- package/dist/overlay/react.js +1 -481
- package/dist/overlay/react.js.map +1 -1
- package/dist/payment/methods.js +1 -102
- package/dist/payment/methods.js.map +1 -1
- package/dist/phone/combobox.js +1 -295
- package/dist/phone/combobox.js.map +1 -1
- package/dist/phone/core.js +1 -162
- package/dist/phone/core.js.map +1 -1
- package/dist/phone/countries.js +1 -56
- package/dist/phone/countries.js.map +1 -1
- package/dist/phone/country-data.js +1 -272
- package/dist/phone/country-data.js.map +1 -1
- package/dist/phone/index.js +1 -42
- package/dist/phone/index.js.map +1 -1
- package/dist/phone/load.js +1 -12
- package/dist/phone/load.js.map +1 -1
- package/dist/phone/picker.js +1 -142
- package/dist/phone/picker.js.map +1 -1
- package/dist/phone/use-phone-field.js +1 -183
- package/dist/phone/use-phone-field.js.map +1 -1
- package/dist/react-CFPTPzAO.d.ts +120 -0
- package/dist/rich-text/banners.js +1 -8
- package/dist/rich-text/banners.js.map +1 -1
- package/dist/rich-text/browser.js +1 -23
- package/dist/rich-text/browser.js.map +1 -1
- package/dist/rich-text/core.js +1 -74
- package/dist/rich-text/core.js.map +1 -1
- package/dist/rich-text/index.js +1 -3
- package/dist/rich-text/index.js.map +1 -1
- package/dist/schedule/index.js +1 -36
- package/dist/schedule/index.js.map +1 -1
- package/dist/search/engine.js +1 -92
- package/dist/search/engine.js.map +1 -1
- package/dist/search/index.js +1 -174
- package/dist/search/index.js.map +1 -1
- package/dist/status/contact.js +1 -41
- package/dist/status/contact.js.map +1 -1
- package/dist/status/hours.js +1 -185
- package/dist/status/hours.js.map +1 -1
- package/dist/status/open-status.js +1 -47
- package/dist/status/open-status.js.map +1 -1
- package/dist/version.js +1 -5
- package/dist/version.js.map +1 -1
- package/package.json +14 -3
package/dist/overlay/react.js
CHANGED
|
@@ -1,482 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/overlay/react.tsx
|
|
4
|
-
import {
|
|
5
|
-
createContext,
|
|
6
|
-
forwardRef,
|
|
7
|
-
useCallback,
|
|
8
|
-
useContext,
|
|
9
|
-
useEffect,
|
|
10
|
-
useId,
|
|
11
|
-
useLayoutEffect,
|
|
12
|
-
useMemo,
|
|
13
|
-
useRef,
|
|
14
|
-
useState,
|
|
15
|
-
useSyncExternalStore
|
|
16
|
-
} from "react";
|
|
17
|
-
import { createPortal, flushSync } from "react-dom";
|
|
18
|
-
import { composeRefs, part, partId } from "../internal/slot.js";
|
|
19
|
-
import {
|
|
20
|
-
closeOverlay,
|
|
21
|
-
locationSnapshot,
|
|
22
|
-
openOverlay,
|
|
23
|
-
subscribeLocation
|
|
24
|
-
} from "./history.js";
|
|
25
|
-
import { loadedOverlayEngine, loadOverlayEngine, preloadOverlay } from "./load.js";
|
|
26
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
-
function useOverlay(param, id, options) {
|
|
28
|
-
const search = useSyncExternalStore(
|
|
29
|
-
subscribeLocation,
|
|
30
|
-
locationSnapshot,
|
|
31
|
-
() => ""
|
|
32
|
-
);
|
|
33
|
-
const optionsRef = useRef(options);
|
|
34
|
-
optionsRef.current = options;
|
|
35
|
-
const open = useCallback(
|
|
36
|
-
(query) => openOverlay(param, id, query),
|
|
37
|
-
[param, id]
|
|
38
|
-
);
|
|
39
|
-
const close = useCallback(
|
|
40
|
-
() => closeOverlay(param, id, optionsRef.current),
|
|
41
|
-
[param, id]
|
|
42
|
-
);
|
|
43
|
-
return useMemo(
|
|
44
|
-
() => ({
|
|
45
|
-
isOpen: new URLSearchParams(search).get(param) === id,
|
|
46
|
-
open,
|
|
47
|
-
close
|
|
48
|
-
}),
|
|
49
|
-
[search, param, id, open, close]
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
var BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
53
|
-
function usePresentation(value) {
|
|
54
|
-
const key = typeof value === "string" ? value : JSON.stringify(value);
|
|
55
|
-
const resolve = useCallback(() => {
|
|
56
|
-
const parsed = key.startsWith("{") ? JSON.parse(key) : key;
|
|
57
|
-
if (typeof parsed === "string") {
|
|
58
|
-
return parsed;
|
|
59
|
-
}
|
|
60
|
-
let current = parsed.base;
|
|
61
|
-
for (const [name, width] of Object.entries(BREAKPOINTS)) {
|
|
62
|
-
const at = parsed[name];
|
|
63
|
-
if (at && window.matchMedia(`(min-width: ${width}px)`).matches) {
|
|
64
|
-
current = at;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return current;
|
|
68
|
-
}, [key]);
|
|
69
|
-
const subscribe = useCallback(
|
|
70
|
-
(onChange) => {
|
|
71
|
-
if (!key.startsWith("{")) {
|
|
72
|
-
return () => {
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
const queries = Object.values(BREAKPOINTS).map(
|
|
76
|
-
(width) => window.matchMedia(`(min-width: ${width}px)`)
|
|
77
|
-
);
|
|
78
|
-
queries.forEach((query) => query.addEventListener("change", onChange));
|
|
79
|
-
return () => queries.forEach(
|
|
80
|
-
(query) => query.removeEventListener("change", onChange)
|
|
81
|
-
);
|
|
82
|
-
},
|
|
83
|
-
[key]
|
|
84
|
-
);
|
|
85
|
-
return useSyncExternalStore(
|
|
86
|
-
subscribe,
|
|
87
|
-
resolve,
|
|
88
|
-
() => typeof value === "string" ? value : value.base
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
var Context = /* @__PURE__ */ createContext(null);
|
|
92
|
-
function useContextValue() {
|
|
93
|
-
const value = useContext(Context);
|
|
94
|
-
if (!value) {
|
|
95
|
-
throw new Error("Overlay parts require Overlay.Root");
|
|
96
|
-
}
|
|
97
|
-
return value;
|
|
98
|
-
}
|
|
99
|
-
var prefetch = preloadOverlay;
|
|
100
|
-
function prefetchWhenIdle() {
|
|
101
|
-
if (typeof window === "undefined") {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const schedule = () => {
|
|
105
|
-
if (loadedOverlayEngine()) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (typeof window.requestIdleCallback === "function") {
|
|
109
|
-
window.requestIdleCallback(prefetch);
|
|
110
|
-
} else {
|
|
111
|
-
window.setTimeout(prefetch, 1500);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
if (document.readyState === "complete") {
|
|
115
|
-
schedule();
|
|
116
|
-
} else {
|
|
117
|
-
window.addEventListener("load", schedule, { once: true });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
prefetchWhenIdle();
|
|
121
|
-
function Root({
|
|
122
|
-
param,
|
|
123
|
-
id,
|
|
124
|
-
presentation = "dialog",
|
|
125
|
-
swipeDirection,
|
|
126
|
-
fallback,
|
|
127
|
-
omitParams,
|
|
128
|
-
navigation,
|
|
129
|
-
...props
|
|
130
|
-
}) {
|
|
131
|
-
const queryOverlay = useOverlay(param, id, { fallback, omitParams });
|
|
132
|
-
const overlay = navigation ?? queryOverlay;
|
|
133
|
-
const resolved = usePresentation(presentation);
|
|
134
|
-
const generated = useId();
|
|
135
|
-
const [contentId, setContentId] = useState(`zappie-overlay-${generated}`);
|
|
136
|
-
const trigger = useRef(null);
|
|
137
|
-
const context = useMemo(
|
|
138
|
-
() => ({
|
|
139
|
-
...overlay,
|
|
140
|
-
presentation: resolved,
|
|
141
|
-
swipeDirection: swipeDirection ?? (resolved === "sheet" ? "right" : "down"),
|
|
142
|
-
dragDirection: swipeDirection,
|
|
143
|
-
contentId,
|
|
144
|
-
setContentId,
|
|
145
|
-
trigger
|
|
146
|
-
}),
|
|
147
|
-
[overlay, resolved, swipeDirection, contentId]
|
|
148
|
-
);
|
|
149
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value: context, children: part("div", props, overlay, {
|
|
150
|
-
"data-state": overlay.isOpen ? "open" : "closed",
|
|
151
|
-
"data-presentation": resolved
|
|
152
|
-
}) });
|
|
153
|
-
}
|
|
154
|
-
var Trigger = /* @__PURE__ */ forwardRef(function Trigger2(props, ref) {
|
|
155
|
-
const ctx = useContextValue();
|
|
156
|
-
return part(
|
|
157
|
-
"button",
|
|
158
|
-
props,
|
|
159
|
-
ctx,
|
|
160
|
-
{
|
|
161
|
-
type: "button",
|
|
162
|
-
"aria-haspopup": "dialog",
|
|
163
|
-
"aria-expanded": ctx.isOpen,
|
|
164
|
-
"aria-controls": ctx.contentId,
|
|
165
|
-
"data-state": ctx.isOpen ? "open" : "closed",
|
|
166
|
-
onPointerEnter: prefetch,
|
|
167
|
-
onFocus: prefetch,
|
|
168
|
-
onClick: () => ctx.open()
|
|
169
|
-
},
|
|
170
|
-
composeRefs(ref, (node) => {
|
|
171
|
-
ctx.trigger.current = node;
|
|
172
|
-
})
|
|
173
|
-
);
|
|
174
|
-
});
|
|
175
|
-
var engineKind = (presentation) => presentation === "dialog" ? "dialog" : "drawer";
|
|
176
|
-
var warmed = /* @__PURE__ */ new Set();
|
|
177
|
-
var ContentContext = /* @__PURE__ */ createContext(null);
|
|
178
|
-
var HELD_EVENTS = [
|
|
179
|
-
"pointerdown",
|
|
180
|
-
"mousedown",
|
|
181
|
-
"touchstart",
|
|
182
|
-
"click",
|
|
183
|
-
"keydown",
|
|
184
|
-
"wheel",
|
|
185
|
-
"touchmove"
|
|
186
|
-
];
|
|
187
|
-
var animationsOf = (node) => typeof node?.getAnimations === "function" ? node.getAnimations() : [];
|
|
188
|
-
function startTimes(node) {
|
|
189
|
-
const times = /* @__PURE__ */ new Map();
|
|
190
|
-
for (const animation of animationsOf(node)) {
|
|
191
|
-
if ("animationName" in animation) {
|
|
192
|
-
times.set(animation.animationName, animation.startTime);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
return times;
|
|
196
|
-
}
|
|
197
|
-
function resume(node, times) {
|
|
198
|
-
for (const animation of animationsOf(node)) {
|
|
199
|
-
const start = "animationName" in animation ? times.get(animation.animationName) : void 0;
|
|
200
|
-
if (start !== void 0 && start !== null) {
|
|
201
|
-
animation.startTime = start;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
function Frame({
|
|
206
|
-
ctx,
|
|
207
|
-
contentProps,
|
|
208
|
-
contentRef,
|
|
209
|
-
container,
|
|
210
|
-
onEscape,
|
|
211
|
-
onInteractOutside,
|
|
212
|
-
onAttach
|
|
213
|
-
}) {
|
|
214
|
-
const backdrop = useRef(null);
|
|
215
|
-
const popup = useRef(null);
|
|
216
|
-
const latest = useRef({ onEscape, onInteractOutside, onAttach, ctx });
|
|
217
|
-
latest.current = { onEscape, onInteractOutside, onAttach, ctx };
|
|
218
|
-
useLayoutEffect(() => {
|
|
219
|
-
const dismiss = (callback, event) => {
|
|
220
|
-
callback?.(event);
|
|
221
|
-
if (!(callback && event.defaultPrevented)) {
|
|
222
|
-
latest.current.ctx.close();
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
const hold = (event) => {
|
|
226
|
-
const inside = event.target instanceof Node && popup.current?.contains(event.target);
|
|
227
|
-
if (event.type === "keydown" && event.key === "Escape") {
|
|
228
|
-
dismiss(latest.current.onEscape, event);
|
|
229
|
-
} else if (event.type === "pointerdown" && !inside) {
|
|
230
|
-
dismiss(latest.current.onInteractOutside, event);
|
|
231
|
-
}
|
|
232
|
-
if (event.cancelable) {
|
|
233
|
-
event.preventDefault();
|
|
234
|
-
}
|
|
235
|
-
event.stopImmediatePropagation();
|
|
236
|
-
};
|
|
237
|
-
for (const type of HELD_EVENTS) {
|
|
238
|
-
window.addEventListener(type, hold, { capture: true, passive: false });
|
|
239
|
-
}
|
|
240
|
-
let live = true;
|
|
241
|
-
let frame = requestAnimationFrame(() => {
|
|
242
|
-
frame = requestAnimationFrame(() => {
|
|
243
|
-
if (live) {
|
|
244
|
-
latest.current.onAttach([
|
|
245
|
-
startTimes(backdrop.current),
|
|
246
|
-
startTimes(popup.current)
|
|
247
|
-
]);
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
return () => {
|
|
252
|
-
live = false;
|
|
253
|
-
cancelAnimationFrame(frame);
|
|
254
|
-
for (const type of HELD_EVENTS) {
|
|
255
|
-
window.removeEventListener(type, hold, { capture: true });
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
}, []);
|
|
259
|
-
const { presentation, swipeDirection } = ctx;
|
|
260
|
-
const drawer = presentation !== "dialog";
|
|
261
|
-
const { id: _ownId, ...rest } = contentProps;
|
|
262
|
-
const id = partId(contentProps);
|
|
263
|
-
const panel = part(
|
|
264
|
-
"div",
|
|
265
|
-
rest,
|
|
266
|
-
ctx,
|
|
267
|
-
{
|
|
268
|
-
"data-open": "",
|
|
269
|
-
...drawer ? { "data-swipe-direction": swipeDirection } : {},
|
|
270
|
-
id: id ?? ctx.contentId,
|
|
271
|
-
role: "dialog",
|
|
272
|
-
tabIndex: -1,
|
|
273
|
-
style: drawer ? {
|
|
274
|
-
"--drawer-swipe-movement-x": "0px",
|
|
275
|
-
"--drawer-swipe-movement-y": "0px",
|
|
276
|
-
"--drawer-swipe-progress": 0,
|
|
277
|
-
"--nested-drawers": 0,
|
|
278
|
-
"--drawer-snap-point-offset": "0px",
|
|
279
|
-
"--drawer-swipe-strength": 1
|
|
280
|
-
} : { "--nested-dialogs": 0 },
|
|
281
|
-
"aria-modal": true,
|
|
282
|
-
"data-presentation": presentation,
|
|
283
|
-
"data-state": "open",
|
|
284
|
-
// The engine's panel replaces this one on the next frame and is the one announced.
|
|
285
|
-
"aria-hidden": true
|
|
286
|
-
},
|
|
287
|
-
composeRefs(contentRef, (node) => {
|
|
288
|
-
popup.current = node;
|
|
289
|
-
})
|
|
290
|
-
);
|
|
291
|
-
return createPortal(
|
|
292
|
-
/* @__PURE__ */ jsxs("div", { "data-zappie-overlay-frame": "", children: [
|
|
293
|
-
/* @__PURE__ */ jsx(
|
|
294
|
-
"div",
|
|
295
|
-
{
|
|
296
|
-
role: "presentation",
|
|
297
|
-
"aria-hidden": "true",
|
|
298
|
-
style: { position: "fixed", inset: 0, userSelect: "none" }
|
|
299
|
-
}
|
|
300
|
-
),
|
|
301
|
-
/* @__PURE__ */ jsx(
|
|
302
|
-
"div",
|
|
303
|
-
{
|
|
304
|
-
ref: backdrop,
|
|
305
|
-
"data-open": "",
|
|
306
|
-
role: "presentation",
|
|
307
|
-
style: {
|
|
308
|
-
userSelect: "none",
|
|
309
|
-
...drawer ? { "--drawer-swipe-progress": 0, "--drawer-swipe-strength": 1 } : {}
|
|
310
|
-
},
|
|
311
|
-
"data-zappie-backdrop": "",
|
|
312
|
-
"data-presentation": presentation,
|
|
313
|
-
"data-state": "open",
|
|
314
|
-
"aria-hidden": "true"
|
|
315
|
-
}
|
|
316
|
-
),
|
|
317
|
-
drawer ? /* @__PURE__ */ jsx(
|
|
318
|
-
"div",
|
|
319
|
-
{
|
|
320
|
-
"data-open": "",
|
|
321
|
-
role: "presentation",
|
|
322
|
-
style: { "--drawer-keyboard-inset": "0px" },
|
|
323
|
-
children: panel
|
|
324
|
-
}
|
|
325
|
-
) : panel
|
|
326
|
-
] }),
|
|
327
|
-
container ?? document.body
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
var Content = /* @__PURE__ */ forwardRef(
|
|
331
|
-
function Content2({
|
|
332
|
-
onEscape,
|
|
333
|
-
onInteractOutside,
|
|
334
|
-
forceMount,
|
|
335
|
-
container,
|
|
336
|
-
dragToClose = true,
|
|
337
|
-
...props
|
|
338
|
-
}, ref) {
|
|
339
|
-
const ctx = useContextValue();
|
|
340
|
-
const parent = useContext(ContentContext);
|
|
341
|
-
const [loaded, setEngine] = useState(loadedOverlayEngine);
|
|
342
|
-
const engine = loaded ?? loadedOverlayEngine();
|
|
343
|
-
const firstPhase = () => !forceMount && ctx.isOpen && !parent && !warmed.has(engineKind(ctx.presentation)) ? "frame" : "engine";
|
|
344
|
-
const [phase, setPhase] = useState(
|
|
345
|
-
() => engine && (ctx.isOpen || forceMount) ? firstPhase() : "closed"
|
|
346
|
-
);
|
|
347
|
-
if (phase === "closed" && engine && (ctx.isOpen || forceMount)) {
|
|
348
|
-
setPhase(firstPhase());
|
|
349
|
-
}
|
|
350
|
-
if (phase === "frame" && !ctx.isOpen) {
|
|
351
|
-
setPhase("closed");
|
|
352
|
-
}
|
|
353
|
-
const customId = partId(props);
|
|
354
|
-
const { setContentId } = ctx;
|
|
355
|
-
useEffect(() => {
|
|
356
|
-
if (customId) {
|
|
357
|
-
setContentId(customId);
|
|
358
|
-
}
|
|
359
|
-
}, [customId, setContentId]);
|
|
360
|
-
useEffect(() => {
|
|
361
|
-
if (engine || !(ctx.isOpen || forceMount)) {
|
|
362
|
-
return void 0;
|
|
363
|
-
}
|
|
364
|
-
let live = true;
|
|
365
|
-
void loadOverlayEngine().then(
|
|
366
|
-
(module) => {
|
|
367
|
-
if (live) {
|
|
368
|
-
setEngine(module);
|
|
369
|
-
setPhase((current) => current === "closed" ? "engine" : current);
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
() => {
|
|
373
|
-
}
|
|
374
|
-
);
|
|
375
|
-
return () => {
|
|
376
|
-
live = false;
|
|
377
|
-
};
|
|
378
|
-
}, [engine, ctx.isOpen, forceMount]);
|
|
379
|
-
const kind = engineKind(ctx.presentation);
|
|
380
|
-
useEffect(() => {
|
|
381
|
-
if (phase === "engine" && ctx.isOpen) {
|
|
382
|
-
warmed.add(kind);
|
|
383
|
-
}
|
|
384
|
-
}, [phase, ctx.isOpen, kind]);
|
|
385
|
-
const panel = useRef(null);
|
|
386
|
-
const engineRef = useMemo(
|
|
387
|
-
() => composeRefs(ref, (node) => {
|
|
388
|
-
panel.current = node;
|
|
389
|
-
}),
|
|
390
|
-
[ref]
|
|
391
|
-
);
|
|
392
|
-
const attach = useCallback(
|
|
393
|
-
([backdrop, popup]) => {
|
|
394
|
-
flushSync(() => setPhase("engine"));
|
|
395
|
-
const node = panel.current;
|
|
396
|
-
resume(node, popup);
|
|
397
|
-
resume(
|
|
398
|
-
node?.closest("[data-base-ui-portal]")?.querySelector("[data-zappie-backdrop]"),
|
|
399
|
-
backdrop
|
|
400
|
-
);
|
|
401
|
-
},
|
|
402
|
-
[]
|
|
403
|
-
);
|
|
404
|
-
const attached = useMemo(() => ({ attached: phase === "engine" }), [phase]);
|
|
405
|
-
if (!engine || phase === "closed" || parent && !parent.attached) {
|
|
406
|
-
return null;
|
|
407
|
-
}
|
|
408
|
-
if (phase === "frame") {
|
|
409
|
-
return /* @__PURE__ */ jsx(ContentContext.Provider, { value: attached, children: /* @__PURE__ */ jsx(PartsContext.Provider, { value: frameParts, children: /* @__PURE__ */ jsx(
|
|
410
|
-
Frame,
|
|
411
|
-
{
|
|
412
|
-
ctx,
|
|
413
|
-
contentProps: props,
|
|
414
|
-
contentRef: ref,
|
|
415
|
-
container,
|
|
416
|
-
onEscape,
|
|
417
|
-
onInteractOutside,
|
|
418
|
-
onAttach: attach
|
|
419
|
-
}
|
|
420
|
-
) }) });
|
|
421
|
-
}
|
|
422
|
-
return /* @__PURE__ */ jsx(ContentContext.Provider, { value: attached, children: /* @__PURE__ */ jsx(PartsContext.Provider, { value: engine, children: /* @__PURE__ */ jsx(
|
|
423
|
-
engine.Surface,
|
|
424
|
-
{
|
|
425
|
-
open: ctx.isOpen,
|
|
426
|
-
presentation: ctx.presentation,
|
|
427
|
-
swipeDirection: ctx.swipeDirection,
|
|
428
|
-
dragToClose,
|
|
429
|
-
dragDirection: ctx.dragDirection,
|
|
430
|
-
contentId: ctx.contentId,
|
|
431
|
-
trigger: ctx.trigger,
|
|
432
|
-
onOpen: () => ctx.open(),
|
|
433
|
-
onClose: ctx.close,
|
|
434
|
-
onEscape,
|
|
435
|
-
onInteractOutside,
|
|
436
|
-
forceMount,
|
|
437
|
-
container,
|
|
438
|
-
state: ctx,
|
|
439
|
-
contentProps: props,
|
|
440
|
-
contentRef: engineRef
|
|
441
|
-
}
|
|
442
|
-
) }) });
|
|
443
|
-
}
|
|
444
|
-
);
|
|
445
|
-
var PartsContext = /* @__PURE__ */ createContext(null);
|
|
446
|
-
var frameParts = {
|
|
447
|
-
EngineTitle: forwardRef(function FrameTitle({ state, ...props }, ref) {
|
|
448
|
-
return part("h2", props, state, {}, ref);
|
|
449
|
-
}),
|
|
450
|
-
EngineClose: forwardRef(function FrameClose({ state, ...props }, ref) {
|
|
451
|
-
return part("button", props, state, { type: "button" }, ref);
|
|
452
|
-
})
|
|
453
|
-
};
|
|
454
|
-
function useEngine() {
|
|
455
|
-
const parts = useContext(PartsContext);
|
|
456
|
-
if (!parts) {
|
|
457
|
-
throw new Error(
|
|
458
|
-
"Overlay.Title and Overlay.Close must be inside Overlay.Content"
|
|
459
|
-
);
|
|
460
|
-
}
|
|
461
|
-
return parts;
|
|
462
|
-
}
|
|
463
|
-
var Title = /* @__PURE__ */ forwardRef(
|
|
464
|
-
function Title2(props, ref) {
|
|
465
|
-
const ctx = useContextValue();
|
|
466
|
-
const { EngineTitle } = useEngine();
|
|
467
|
-
return /* @__PURE__ */ jsx(EngineTitle, { ...props, state: ctx, ref });
|
|
468
|
-
}
|
|
469
|
-
);
|
|
470
|
-
var Close = /* @__PURE__ */ forwardRef(
|
|
471
|
-
function Close2(props, ref) {
|
|
472
|
-
const ctx = useContextValue();
|
|
473
|
-
const { EngineClose } = useEngine();
|
|
474
|
-
return /* @__PURE__ */ jsx(EngineClose, { ...props, state: ctx, ref });
|
|
475
|
-
}
|
|
476
|
-
);
|
|
477
|
-
var Overlay = { Root, Trigger, Content, Title, Close };
|
|
478
|
-
export {
|
|
479
|
-
Overlay,
|
|
480
|
-
useOverlay
|
|
481
|
-
};
|
|
1
|
+
"use client";import{createContext,forwardRef,useCallback,useContext,useEffect,useId,useLayoutEffect,useMemo,useRef,useState,useSyncExternalStore}from"react";import{createPortal,flushSync}from"react-dom";import{composeRefs,part,partId}from"../internal/slot.js";import{closeOverlay,locationSnapshot,openOverlay,subscribeLocation}from"./history.js";import{loadedOverlayEngine,loadOverlayEngine,preloadOverlay}from"./load.js";import{jsx,jsxs}from"react/jsx-runtime";function useOverlay(param,id,options){const search=useSyncExternalStore(subscribeLocation,locationSnapshot,()=>"");const optionsRef=useRef(options);optionsRef.current=options;const open=useCallback(query=>openOverlay(param,id,query),[param,id]);const close=useCallback(()=>closeOverlay(param,id,optionsRef.current),[param,id]);return useMemo(()=>({isOpen:new URLSearchParams(search).get(param)===id,open,close}),[search,param,id,open,close])}var BREAKPOINTS={sm:640,md:768,lg:1024,xl:1280};function usePresentation(value){const key=typeof value==="string"?value:JSON.stringify(value);const resolve=useCallback(()=>{const parsed=key.startsWith("{")?JSON.parse(key):key;if(typeof parsed==="string"){return parsed}let current=parsed.base;for(const[name,width]of Object.entries(BREAKPOINTS)){const at=parsed[name];if(at&&window.matchMedia(`(min-width: ${width}px)`).matches){current=at}}return current},[key]);const subscribe=useCallback(onChange=>{if(!key.startsWith("{")){return()=>{}}const queries=Object.values(BREAKPOINTS).map(width=>window.matchMedia(`(min-width: ${width}px)`));queries.forEach(query=>query.addEventListener("change",onChange));return()=>queries.forEach(query=>query.removeEventListener("change",onChange))},[key]);return useSyncExternalStore(subscribe,resolve,()=>typeof value==="string"?value:value.base)}var Context=/*@__PURE__ */createContext(null);function useContextValue(){const value=useContext(Context);if(!value){throw new Error("Overlay parts require Overlay.Root")}return value}var prefetch=preloadOverlay;function prefetchWhenIdle(){if(typeof window==="undefined"){return}const schedule=()=>{if(loadedOverlayEngine()){return}if(typeof window.requestIdleCallback==="function"){window.requestIdleCallback(prefetch)}else{window.setTimeout(prefetch,1500)}};if(document.readyState==="complete"){schedule()}else{window.addEventListener("load",schedule,{once:true})}}prefetchWhenIdle();function Root({param,id,presentation="dialog",swipeDirection,fallback,omitParams,navigation,...props}){const queryOverlay=useOverlay(param,id,{fallback,omitParams});const overlay=navigation??queryOverlay;const resolved=usePresentation(presentation);const generated=useId();const[contentId,setContentId]=useState(`zappie-overlay-${generated}`);const own=useRef(null);const trigger=navigation?.trigger??own;const context=useMemo(()=>({...overlay,presentation:resolved,swipeDirection:swipeDirection??(resolved==="sheet"?"right":"down"),dragDirection:swipeDirection,contentId,setContentId,trigger}),[overlay,resolved,swipeDirection,contentId,trigger]);return jsx(Context.Provider,{value:context,children:part("div",props,overlay,{"data-state":overlay.isOpen?"open":"closed","data-presentation":resolved})})}var Trigger=/*@__PURE__ */forwardRef(function Trigger2(props,ref){const ctx=useContextValue();return part("button",props,ctx,{type:"button","aria-haspopup":"dialog","aria-expanded":ctx.isOpen,"aria-controls":ctx.contentId,"data-state":ctx.isOpen?"open":"closed",onPointerEnter:prefetch,onFocus:prefetch,onClick:()=>ctx.open()},composeRefs(ref,node=>{ctx.trigger.current=node}))});var engineKind=presentation=>presentation==="dialog"?"dialog":"drawer";var warmed=new Set;var ContentContext=/*@__PURE__ */createContext(null);var HELD_EVENTS=["pointerdown","mousedown","touchstart","click","keydown","wheel","touchmove"];var animationsOf=node=>typeof node?.getAnimations==="function"?node.getAnimations():[];function startTimes(node){const times=new Map;for(const animation of animationsOf(node)){if("animationName"in animation){times.set(animation.animationName,animation.startTime)}}return times}function resume(node,times){for(const animation of animationsOf(node)){const start="animationName"in animation?times.get(animation.animationName):void 0;if(start!==void 0&&start!==null){animation.startTime=start}}}function Frame({ctx,contentProps,contentRef,container,onEscape,onInteractOutside,onAttach}){const backdrop=useRef(null);const popup=useRef(null);const latest=useRef({onEscape,onInteractOutside,onAttach,ctx});latest.current={onEscape,onInteractOutside,onAttach,ctx};useLayoutEffect(()=>{const dismiss=(callback,event)=>{callback?.(event);if(!(callback&&event.defaultPrevented)){latest.current.ctx.close()}};const hold=event=>{const inside=event.target instanceof Node&&popup.current?.contains(event.target);if(event.type==="keydown"&&event.key==="Escape"){dismiss(latest.current.onEscape,event)}else if(event.type==="pointerdown"&&!inside){dismiss(latest.current.onInteractOutside,event)}if(event.cancelable){event.preventDefault()}event.stopImmediatePropagation()};for(const type of HELD_EVENTS){window.addEventListener(type,hold,{capture:true,passive:false})}let live=true;let frame=requestAnimationFrame(()=>{frame=requestAnimationFrame(()=>{if(live){latest.current.onAttach([startTimes(backdrop.current),startTimes(popup.current)])}})});return()=>{live=false;cancelAnimationFrame(frame);for(const type of HELD_EVENTS){window.removeEventListener(type,hold,{capture:true})}}},[]);const{presentation,swipeDirection}=ctx;const drawer=presentation!=="dialog";const{id:_ownId,...rest}=contentProps;const id=partId(contentProps);const panel=part("div",rest,ctx,{"data-open":"",...drawer?{"data-swipe-direction":swipeDirection}:{},id:id??ctx.contentId,role:"dialog",tabIndex:-1,style:drawer?{"--drawer-swipe-movement-x":"0px","--drawer-swipe-movement-y":"0px","--drawer-swipe-progress":0,"--nested-drawers":0,"--drawer-snap-point-offset":"0px","--drawer-swipe-strength":1}:{"--nested-dialogs":0},"aria-modal":true,"data-presentation":presentation,"data-state":"open","aria-hidden":true},composeRefs(contentRef,node=>{popup.current=node}));return createPortal(jsxs("div",{"data-zappie-overlay-frame":"",children:[jsx("div",{role:"presentation","aria-hidden":"true",style:{position:"fixed",inset:0,userSelect:"none"}}),jsx("div",{ref:backdrop,"data-open":"",role:"presentation",style:{userSelect:"none",...drawer?{"--drawer-swipe-progress":0,"--drawer-swipe-strength":1}:{}},"data-zappie-backdrop":"","data-presentation":presentation,"data-state":"open","aria-hidden":"true"}),drawer?jsx("div",{"data-open":"",role:"presentation",style:{"--drawer-keyboard-inset":"0px"},children:panel}):panel]}),container??document.body)}var Content=/*@__PURE__ */forwardRef(function Content2({onEscape,onInteractOutside,forceMount,container,dragToClose=true,...props},ref){const ctx=useContextValue();const parent=useContext(ContentContext);const[loaded,setEngine]=useState(loadedOverlayEngine);const engine=loaded??loadedOverlayEngine();const firstPhase=()=>!forceMount&&ctx.isOpen&&!parent&&!warmed.has(engineKind(ctx.presentation))?"frame":"engine";const[phase,setPhase]=useState(()=>engine&&(ctx.isOpen||forceMount)?firstPhase():"closed");if(phase==="closed"&&engine&&(ctx.isOpen||forceMount)){setPhase(firstPhase())}if(phase==="frame"&&!ctx.isOpen){setPhase("closed")}const customId=partId(props);const{setContentId}=ctx;useEffect(()=>{if(customId){setContentId(customId)}},[customId,setContentId]);useEffect(()=>{if(engine||!(ctx.isOpen||forceMount)){return void 0}let live=true;void loadOverlayEngine().then(module=>{if(live){setEngine(module);setPhase(current=>current==="closed"?"engine":current)}},()=>{});return()=>{live=false}},[engine,ctx.isOpen,forceMount]);const kind=engineKind(ctx.presentation);useEffect(()=>{if(phase==="engine"&&ctx.isOpen){warmed.add(kind)}},[phase,ctx.isOpen,kind]);const panel=useRef(null);const engineRef=useMemo(()=>composeRefs(ref,node=>{panel.current=node}),[ref]);const attach=useCallback(([backdrop,popup])=>{flushSync(()=>setPhase("engine"));const node=panel.current;resume(node,popup);resume(node?.closest("[data-base-ui-portal]")?.querySelector("[data-zappie-backdrop]"),backdrop)},[]);const attached=useMemo(()=>({attached:phase==="engine"}),[phase]);if(!engine||phase==="closed"||parent&&!parent.attached){return null}if(phase==="frame"){return jsx(ContentContext.Provider,{value:attached,children:jsx(PartsContext.Provider,{value:frameParts,children:jsx(Frame,{ctx,contentProps:props,contentRef:ref,container,onEscape,onInteractOutside,onAttach:attach})})})}return jsx(ContentContext.Provider,{value:attached,children:jsx(PartsContext.Provider,{value:engine,children:jsx(engine.Surface,{open:ctx.isOpen,presentation:ctx.presentation,swipeDirection:ctx.swipeDirection,dragToClose,dragDirection:ctx.dragDirection,contentId:ctx.contentId,trigger:ctx.trigger,onOpen:()=>ctx.open(),onClose:ctx.close,onEscape,onInteractOutside,forceMount,container,state:ctx,contentProps:props,contentRef:engineRef})})})});var PartsContext=/*@__PURE__ */createContext(null);var frameParts={EngineTitle:forwardRef(function FrameTitle({state,...props},ref){return part("h2",props,state,{},ref)}),EngineClose:forwardRef(function FrameClose({state,...props},ref){return part("button",props,state,{type:"button"},ref)})};function useEngine(){const parts=useContext(PartsContext);if(!parts){throw new Error("Overlay.Title and Overlay.Close must be inside Overlay.Content")}return parts}var Title=/*@__PURE__ */forwardRef(function Title2(props,ref){const ctx=useContextValue();const{EngineTitle}=useEngine();return jsx(EngineTitle,{...props,state:ctx,ref})});var Close=/*@__PURE__ */forwardRef(function Close2(props,ref){const ctx=useContextValue();const{EngineClose}=useEngine();return jsx(EngineClose,{...props,state:ctx,ref})});var Overlay={Root,Trigger,Content,Title,Close};export{Overlay,useOverlay};
|
|
482
2
|
//# sourceMappingURL=react.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/overlay/react.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "aACA,OACE,cACA,WACA,YACA,WACA,UACA,MACA,gBACA,QACA,OACA,SACA,yBAGK,QACP,OAAS,aAAc,cAAiB,YACxC,OAAS,YAAa,KAAM,WAA8B,sBAE1D,OACE,aACA,iBACA,YACA,sBAGK,eACP,OAAS,oBAAqB,kBAAmB,mBAAsB,YAmLnE,WAqNA,SArNA,oBAzKG,SAAS,WAAW,MAAe,GAAY,QAAwB,CAC5E,MAAM,OAAS,qBACb,kBACA,iBACA,IAAM,EACR,EACA,MAAM,WAAa,OAAO,OAAO,EACjC,WAAW,QAA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