@zappie/foundations 0.1.3 → 0.1.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 +24 -0
- package/README.md +154 -7
- package/dist/branch-map/colors.js +27 -0
- package/dist/branch-map/colors.js.map +7 -0
- package/dist/branch-map/delivery-map.js +60 -0
- package/dist/branch-map/delivery-map.js.map +7 -0
- package/dist/branch-map/delivery-runtime.js +118 -0
- package/dist/branch-map/delivery-runtime.js.map +7 -0
- package/dist/branch-map/fit.js +123 -0
- package/dist/branch-map/fit.js.map +7 -0
- package/dist/branch-map/geometry.js +1 -27
- package/dist/branch-map/geometry.js.map +2 -2
- package/dist/branch-map/index.js +42 -36
- package/dist/branch-map/index.js.map +2 -2
- package/dist/branch-map/markers.js +143 -0
- package/dist/branch-map/markers.js.map +7 -0
- package/dist/branch-map/runtime.js +258 -53
- package/dist/branch-map/runtime.js.map +3 -3
- package/dist/branch-map/use-map-runtime.js +53 -0
- package/dist/branch-map/use-map-runtime.js.map +7 -0
- package/dist/deferred/index.js +111 -0
- package/dist/deferred/index.js.map +7 -0
- package/dist/index.d.ts +179 -8
- package/dist/index.js +5 -1
- package/dist/index.js.map +2 -2
- package/dist/item-form/index.js.map +1 -1
- package/dist/item-form/root.js +25 -8
- package/dist/item-form/root.js.map +2 -2
- package/dist/overlay/react.js +245 -24
- package/dist/overlay/react.js.map +3 -3
- package/dist/version.js +1 -1
- package/package.json +3 -2
package/dist/overlay/react.js
CHANGED
|
@@ -8,11 +8,13 @@ import {
|
|
|
8
8
|
useContext,
|
|
9
9
|
useEffect,
|
|
10
10
|
useId,
|
|
11
|
+
useLayoutEffect,
|
|
11
12
|
useMemo,
|
|
12
13
|
useRef,
|
|
13
14
|
useState,
|
|
14
15
|
useSyncExternalStore
|
|
15
16
|
} from "react";
|
|
17
|
+
import { createPortal, flushSync } from "react-dom";
|
|
16
18
|
import { composeRefs, part, partId } from "../internal/slot.js";
|
|
17
19
|
import {
|
|
18
20
|
closeOverlay,
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
openOverlay,
|
|
21
23
|
subscribeLocation
|
|
22
24
|
} from "./history.js";
|
|
23
|
-
import { jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
26
|
var engineModule;
|
|
25
27
|
var enginePromise;
|
|
26
28
|
function loadOverlayEngine() {
|
|
@@ -98,7 +100,6 @@ function usePresentation(value) {
|
|
|
98
100
|
);
|
|
99
101
|
}
|
|
100
102
|
var Context = createContext(null);
|
|
101
|
-
var EngineContext = createContext(null);
|
|
102
103
|
function useContextValue() {
|
|
103
104
|
const value = useContext(Context);
|
|
104
105
|
if (!value) {
|
|
@@ -108,6 +109,27 @@ function useContextValue() {
|
|
|
108
109
|
}
|
|
109
110
|
var prefetch = () => void loadOverlayEngine().catch(() => {
|
|
110
111
|
});
|
|
112
|
+
function prefetchWhenIdle() {
|
|
113
|
+
if (typeof window === "undefined") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const schedule = () => {
|
|
117
|
+
if (engineModule) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (typeof window.requestIdleCallback === "function") {
|
|
121
|
+
window.requestIdleCallback(prefetch);
|
|
122
|
+
} else {
|
|
123
|
+
window.setTimeout(prefetch, 1500);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
if (document.readyState === "complete") {
|
|
127
|
+
schedule();
|
|
128
|
+
} else {
|
|
129
|
+
window.addEventListener("load", schedule, { once: true });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
prefetchWhenIdle();
|
|
111
133
|
function Root({
|
|
112
134
|
param,
|
|
113
135
|
id,
|
|
@@ -124,17 +146,6 @@ function Root({
|
|
|
124
146
|
const generated = useId();
|
|
125
147
|
const [contentId, setContentId] = useState(`zappie-overlay-${generated}`);
|
|
126
148
|
const trigger = useRef(null);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
if (engineModule) {
|
|
129
|
-
return void 0;
|
|
130
|
-
}
|
|
131
|
-
if (typeof window.requestIdleCallback === "function") {
|
|
132
|
-
const handle2 = window.requestIdleCallback(prefetch);
|
|
133
|
-
return () => window.cancelIdleCallback(handle2);
|
|
134
|
-
}
|
|
135
|
-
const handle = window.setTimeout(prefetch, 1500);
|
|
136
|
-
return () => window.clearTimeout(handle);
|
|
137
|
-
}, []);
|
|
138
149
|
const context = useMemo(
|
|
139
150
|
() => ({
|
|
140
151
|
...overlay,
|
|
@@ -174,12 +185,175 @@ var Trigger = forwardRef(
|
|
|
174
185
|
);
|
|
175
186
|
}
|
|
176
187
|
);
|
|
188
|
+
var engineKind = (presentation) => presentation === "dialog" ? "dialog" : "drawer";
|
|
189
|
+
var warmed = /* @__PURE__ */ new Set();
|
|
190
|
+
var ContentContext = createContext(null);
|
|
191
|
+
var HELD_EVENTS = [
|
|
192
|
+
"pointerdown",
|
|
193
|
+
"mousedown",
|
|
194
|
+
"touchstart",
|
|
195
|
+
"click",
|
|
196
|
+
"keydown",
|
|
197
|
+
"wheel",
|
|
198
|
+
"touchmove"
|
|
199
|
+
];
|
|
200
|
+
var animationsOf = (node) => typeof node?.getAnimations === "function" ? node.getAnimations() : [];
|
|
201
|
+
function startTimes(node) {
|
|
202
|
+
const times = /* @__PURE__ */ new Map();
|
|
203
|
+
for (const animation of animationsOf(node)) {
|
|
204
|
+
if ("animationName" in animation) {
|
|
205
|
+
times.set(animation.animationName, animation.startTime);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return times;
|
|
209
|
+
}
|
|
210
|
+
function resume(node, times) {
|
|
211
|
+
for (const animation of animationsOf(node)) {
|
|
212
|
+
const start = "animationName" in animation ? times.get(animation.animationName) : void 0;
|
|
213
|
+
if (start !== void 0 && start !== null) {
|
|
214
|
+
animation.startTime = start;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function Frame({
|
|
219
|
+
ctx,
|
|
220
|
+
contentProps,
|
|
221
|
+
contentRef,
|
|
222
|
+
container,
|
|
223
|
+
onEscape,
|
|
224
|
+
onInteractOutside,
|
|
225
|
+
onAttach
|
|
226
|
+
}) {
|
|
227
|
+
const backdrop = useRef(null);
|
|
228
|
+
const popup = useRef(null);
|
|
229
|
+
const latest = useRef({ onEscape, onInteractOutside, onAttach, ctx });
|
|
230
|
+
latest.current = { onEscape, onInteractOutside, onAttach, ctx };
|
|
231
|
+
useLayoutEffect(() => {
|
|
232
|
+
const dismiss = (callback, event) => {
|
|
233
|
+
callback?.(event);
|
|
234
|
+
if (!(callback && event.defaultPrevented)) {
|
|
235
|
+
latest.current.ctx.close();
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
const hold = (event) => {
|
|
239
|
+
const inside = event.target instanceof Node && popup.current?.contains(event.target);
|
|
240
|
+
if (event.type === "keydown" && event.key === "Escape") {
|
|
241
|
+
dismiss(latest.current.onEscape, event);
|
|
242
|
+
} else if (event.type === "pointerdown" && !inside) {
|
|
243
|
+
dismiss(latest.current.onInteractOutside, event);
|
|
244
|
+
}
|
|
245
|
+
if (event.cancelable) {
|
|
246
|
+
event.preventDefault();
|
|
247
|
+
}
|
|
248
|
+
event.stopImmediatePropagation();
|
|
249
|
+
};
|
|
250
|
+
for (const type of HELD_EVENTS) {
|
|
251
|
+
window.addEventListener(type, hold, { capture: true, passive: false });
|
|
252
|
+
}
|
|
253
|
+
let live = true;
|
|
254
|
+
let frame = requestAnimationFrame(() => {
|
|
255
|
+
frame = requestAnimationFrame(() => {
|
|
256
|
+
if (live) {
|
|
257
|
+
latest.current.onAttach([
|
|
258
|
+
startTimes(backdrop.current),
|
|
259
|
+
startTimes(popup.current)
|
|
260
|
+
]);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
return () => {
|
|
265
|
+
live = false;
|
|
266
|
+
cancelAnimationFrame(frame);
|
|
267
|
+
for (const type of HELD_EVENTS) {
|
|
268
|
+
window.removeEventListener(type, hold, { capture: true });
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}, []);
|
|
272
|
+
const { presentation, swipeDirection } = ctx;
|
|
273
|
+
const drawer = presentation !== "dialog";
|
|
274
|
+
const { id: _ownId, ...rest } = contentProps;
|
|
275
|
+
const id = partId(contentProps);
|
|
276
|
+
const panel = part(
|
|
277
|
+
"div",
|
|
278
|
+
rest,
|
|
279
|
+
ctx,
|
|
280
|
+
{
|
|
281
|
+
"data-open": "",
|
|
282
|
+
...drawer ? { "data-swipe-direction": swipeDirection } : {},
|
|
283
|
+
id: id ?? ctx.contentId,
|
|
284
|
+
role: "dialog",
|
|
285
|
+
tabIndex: -1,
|
|
286
|
+
style: drawer ? {
|
|
287
|
+
"--drawer-swipe-movement-x": "0px",
|
|
288
|
+
"--drawer-swipe-movement-y": "0px",
|
|
289
|
+
"--drawer-swipe-progress": 0,
|
|
290
|
+
"--nested-drawers": 0,
|
|
291
|
+
"--drawer-snap-point-offset": "0px",
|
|
292
|
+
"--drawer-swipe-strength": 1
|
|
293
|
+
} : { "--nested-dialogs": 0 },
|
|
294
|
+
"aria-modal": true,
|
|
295
|
+
"data-presentation": presentation,
|
|
296
|
+
"data-state": "open",
|
|
297
|
+
// The engine's panel replaces this one on the next frame and is the one announced.
|
|
298
|
+
"aria-hidden": true
|
|
299
|
+
},
|
|
300
|
+
composeRefs(contentRef, (node) => {
|
|
301
|
+
popup.current = node;
|
|
302
|
+
})
|
|
303
|
+
);
|
|
304
|
+
return createPortal(
|
|
305
|
+
/* @__PURE__ */ jsxs("div", { "data-zappie-overlay-frame": "", children: [
|
|
306
|
+
/* @__PURE__ */ jsx(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
role: "presentation",
|
|
310
|
+
"aria-hidden": "true",
|
|
311
|
+
style: { position: "fixed", inset: 0, userSelect: "none" }
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ jsx(
|
|
315
|
+
"div",
|
|
316
|
+
{
|
|
317
|
+
ref: backdrop,
|
|
318
|
+
"data-open": "",
|
|
319
|
+
role: "presentation",
|
|
320
|
+
style: {
|
|
321
|
+
userSelect: "none",
|
|
322
|
+
...drawer ? { "--drawer-swipe-progress": 0, "--drawer-swipe-strength": 1 } : {}
|
|
323
|
+
},
|
|
324
|
+
"data-zappie-backdrop": "",
|
|
325
|
+
"data-presentation": presentation,
|
|
326
|
+
"data-state": "open",
|
|
327
|
+
"aria-hidden": "true"
|
|
328
|
+
}
|
|
329
|
+
),
|
|
330
|
+
drawer ? /* @__PURE__ */ jsx(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
"data-open": "",
|
|
334
|
+
role: "presentation",
|
|
335
|
+
style: { "--drawer-keyboard-inset": "0px" },
|
|
336
|
+
children: panel
|
|
337
|
+
}
|
|
338
|
+
) : panel
|
|
339
|
+
] }),
|
|
340
|
+
container ?? document.body
|
|
341
|
+
);
|
|
342
|
+
}
|
|
177
343
|
var Content = forwardRef(function Content2({ onEscape, onInteractOutside, forceMount, container, ...props }, ref) {
|
|
178
344
|
const ctx = useContextValue();
|
|
179
|
-
const
|
|
180
|
-
const [
|
|
181
|
-
|
|
182
|
-
|
|
345
|
+
const parent = useContext(ContentContext);
|
|
346
|
+
const [loaded, setEngine] = useState(engineModule);
|
|
347
|
+
const engine = loaded ?? engineModule;
|
|
348
|
+
const firstPhase = () => !forceMount && ctx.isOpen && !parent && !warmed.has(engineKind(ctx.presentation)) ? "frame" : "engine";
|
|
349
|
+
const [phase, setPhase] = useState(
|
|
350
|
+
() => engine && (ctx.isOpen || forceMount) ? firstPhase() : "closed"
|
|
351
|
+
);
|
|
352
|
+
if (phase === "closed" && engine && (ctx.isOpen || forceMount)) {
|
|
353
|
+
setPhase(firstPhase());
|
|
354
|
+
}
|
|
355
|
+
if (phase === "frame" && !ctx.isOpen) {
|
|
356
|
+
setPhase("closed");
|
|
183
357
|
}
|
|
184
358
|
const customId = partId(props);
|
|
185
359
|
const { setContentId } = ctx;
|
|
@@ -197,6 +371,7 @@ var Content = forwardRef(function Content2({ onEscape, onInteractOutside, forceM
|
|
|
197
371
|
(module) => {
|
|
198
372
|
if (live) {
|
|
199
373
|
setEngine(module);
|
|
374
|
+
setPhase((current) => current === "closed" ? "engine" : current);
|
|
200
375
|
}
|
|
201
376
|
},
|
|
202
377
|
() => {
|
|
@@ -206,10 +381,47 @@ var Content = forwardRef(function Content2({ onEscape, onInteractOutside, forceM
|
|
|
206
381
|
live = false;
|
|
207
382
|
};
|
|
208
383
|
}, [engine, ctx.isOpen, forceMount]);
|
|
209
|
-
|
|
384
|
+
const kind = engineKind(ctx.presentation);
|
|
385
|
+
useEffect(() => {
|
|
386
|
+
if (phase === "engine" && ctx.isOpen) {
|
|
387
|
+
warmed.add(kind);
|
|
388
|
+
}
|
|
389
|
+
}, [phase, ctx.isOpen, kind]);
|
|
390
|
+
const panel = useRef(null);
|
|
391
|
+
const engineRef = useMemo(
|
|
392
|
+
() => composeRefs(ref, (node) => {
|
|
393
|
+
panel.current = node;
|
|
394
|
+
}),
|
|
395
|
+
[ref]
|
|
396
|
+
);
|
|
397
|
+
const attach = useCallback(([backdrop, popup]) => {
|
|
398
|
+
flushSync(() => setPhase("engine"));
|
|
399
|
+
const node = panel.current;
|
|
400
|
+
resume(node, popup);
|
|
401
|
+
resume(
|
|
402
|
+
node?.closest("[data-base-ui-portal]")?.querySelector("[data-zappie-backdrop]"),
|
|
403
|
+
backdrop
|
|
404
|
+
);
|
|
405
|
+
}, []);
|
|
406
|
+
const attached = useMemo(() => ({ attached: phase === "engine" }), [phase]);
|
|
407
|
+
if (!engine || phase === "closed" || parent && !parent.attached) {
|
|
210
408
|
return null;
|
|
211
409
|
}
|
|
212
|
-
|
|
410
|
+
if (phase === "frame") {
|
|
411
|
+
return /* @__PURE__ */ jsx(ContentContext.Provider, { value: attached, children: /* @__PURE__ */ jsx(PartsContext.Provider, { value: frameParts, children: /* @__PURE__ */ jsx(
|
|
412
|
+
Frame,
|
|
413
|
+
{
|
|
414
|
+
ctx,
|
|
415
|
+
contentProps: props,
|
|
416
|
+
contentRef: ref,
|
|
417
|
+
container,
|
|
418
|
+
onEscape,
|
|
419
|
+
onInteractOutside,
|
|
420
|
+
onAttach: attach
|
|
421
|
+
}
|
|
422
|
+
) }) });
|
|
423
|
+
}
|
|
424
|
+
return /* @__PURE__ */ jsx(ContentContext.Provider, { value: attached, children: /* @__PURE__ */ jsx(PartsContext.Provider, { value: engine, children: /* @__PURE__ */ jsx(
|
|
213
425
|
engine.Surface,
|
|
214
426
|
{
|
|
215
427
|
open: ctx.isOpen,
|
|
@@ -225,18 +437,27 @@ var Content = forwardRef(function Content2({ onEscape, onInteractOutside, forceM
|
|
|
225
437
|
container,
|
|
226
438
|
state: ctx,
|
|
227
439
|
contentProps: props,
|
|
228
|
-
contentRef:
|
|
440
|
+
contentRef: engineRef
|
|
229
441
|
}
|
|
230
|
-
) });
|
|
442
|
+
) }) });
|
|
231
443
|
});
|
|
444
|
+
var PartsContext = createContext(null);
|
|
445
|
+
var frameParts = {
|
|
446
|
+
EngineTitle: forwardRef(function FrameTitle({ state, ...props }, ref) {
|
|
447
|
+
return part("h2", props, state, {}, ref);
|
|
448
|
+
}),
|
|
449
|
+
EngineClose: forwardRef(function FrameClose({ state, ...props }, ref) {
|
|
450
|
+
return part("button", props, state, { type: "button" }, ref);
|
|
451
|
+
})
|
|
452
|
+
};
|
|
232
453
|
function useEngine() {
|
|
233
|
-
const
|
|
234
|
-
if (!
|
|
454
|
+
const parts = useContext(PartsContext);
|
|
455
|
+
if (!parts) {
|
|
235
456
|
throw new Error(
|
|
236
457
|
"Overlay.Title and Overlay.Close must be inside Overlay.Content"
|
|
237
458
|
);
|
|
238
459
|
}
|
|
239
|
-
return
|
|
460
|
+
return parts;
|
|
240
461
|
}
|
|
241
462
|
var Title = forwardRef(
|
|
242
463
|
function Title2(props, ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/overlay/react.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\";\nimport { composeRefs, part, partId, type PartProps } from \"../internal/slot\";\nimport type { Presentation, SwipeDirection } from \"./engine\";\nimport {\n closeOverlay,\n locationSnapshot,\n openOverlay,\n subscribeLocation,\n type CloseOptions,\n type OverlayQuery,\n} from \"./history\";\n\ntype EngineModule = typeof import(\"./engine\");\nlet engineModule: EngineModule | undefined;\nlet enginePromise: Promise<EngineModule> | undefined;\n/**\n * Load the overlay engine (Base UI dialog and drawer). It is a separate chunk: Root prefetches\n * it when the browser is idle and on trigger hover/focus, so it is usually ready by first open.\n */\nexport function loadOverlayEngine(): Promise<EngineModule> {\n enginePromise ??= import(\"./engine\").then(\n (module) => (engineModule = module),\n (error: unknown) => {\n // A failed chunk load (e.g. offline) must not poison later opens.\n enginePromise = undefined;\n throw error;\n },\n );\n return enginePromise;\n}\n\n/**\n * Control an overlay whose open state is stored in a URL query parameter.\n *\n * @param param - The query parameter to read and update.\n * @param id - The value that identifies this overlay as open.\n * @param options - Fallback query values and query parameters to omit when closing.\n * @returns Reactive open state and history-backed open and close actions.\n */\nexport function useOverlay(param: string, id: string, options?: CloseOptions) {\n const search = useSyncExternalStore(\n subscribeLocation,\n locationSnapshot,\n () => \"\",\n );\n const optionsRef = useRef(options);\n optionsRef.current = options;\n const open = useCallback(\n (query?: OverlayQuery) => openOverlay(param, id, query),\n [param, id],\n );\n const close = useCallback(\n () => closeOverlay(param, id, optionsRef.current),\n [param, id],\n );\n return useMemo(\n () => ({\n isOpen: new URLSearchParams(search).get(param) === id,\n open,\n close,\n }),\n [search, param, id, open, close],\n );\n}\n\n/** Tailwind's default min-width breakpoints. */\nconst BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 } as const;\nexport type ResponsivePresentation =\n | Presentation\n | ({ base: Presentation } & Partial<\n Record<keyof typeof BREAKPOINTS, Presentation>\n >);\n/** Choose a presentation using media queries. The server renders `base`. */\nfunction usePresentation(value: ResponsivePresentation): Presentation {\n // Serialise so inline objects don't resubscribe on every render.\n const key = typeof value === \"string\" ? value : JSON.stringify(value);\n const resolve = useCallback((): Presentation => {\n const parsed = (\n key.startsWith(\"{\") ? JSON.parse(key) : key\n ) as ResponsivePresentation;\n if (typeof parsed === \"string\") {\n return parsed;\n }\n let current = parsed.base;\n for (const [name, width] of Object.entries(BREAKPOINTS)) {\n const at = parsed[name as keyof typeof BREAKPOINTS];\n if (at && window.matchMedia(`(min-width: ${width}px)`).matches) {\n current = at;\n }\n }\n return current;\n }, [key]);\n const subscribe = useCallback(\n (onChange: () => void) => {\n if (!key.startsWith(\"{\")) {\n return () => {};\n }\n const queries = Object.values(BREAKPOINTS).map((width) =>\n window.matchMedia(`(min-width: ${width}px)`),\n );\n queries.forEach((query) => query.addEventListener(\"change\", onChange));\n return () =>\n queries.forEach((query) =>\n query.removeEventListener(\"change\", onChange),\n );\n },\n [key],\n );\n return useSyncExternalStore(subscribe, resolve, () =>\n typeof value === \"string\" ? value : value.base,\n );\n}\n\ntype OverlayState = ReturnType<typeof useOverlay>;\ntype OverlayContext = OverlayState & {\n presentation: Presentation;\n swipeDirection: SwipeDirection;\n contentId: string;\n setContentId: (id: string) => void;\n trigger: { current: HTMLElement | null };\n};\nconst Context = createContext<OverlayContext | null>(null);\nconst EngineContext = createContext<EngineModule | null>(null);\nfunction useContextValue() {\n const value = useContext(Context);\n if (!value) {\n throw new Error(\"Overlay parts require Overlay.Root\");\n }\n return value;\n}\nconst prefetch = () => void loadOverlayEngine().catch(() => {});\n\n/**\n * The URL is the only open state. The engine (Base UI) supplies the modal mechanics: portal,\n * focus scope, scroll lock, outside and Escape dismissal, exit presence and, for drawers and\n * sheets, swipe-to-dismiss. Every open or close it requests goes through the history core.\n */\nfunction Root({\n param,\n id,\n presentation = \"dialog\",\n swipeDirection,\n fallback,\n omitParams,\n navigation,\n ...props\n}: PartProps<OverlayState> & {\n param: string;\n id: string;\n /** Your URL adapter for overlays whose open state lives in the path. */\n navigation?: OverlayState;\n /** A `dialog`, swipeable `drawer` or `sheet`. Use `{ base, sm, md, lg, xl }` for responsive layouts. */\n presentation?: ResponsivePresentation;\n /** Swipe direction to dismiss. Defaults to `down` for drawers and `right` for sheets. */\n swipeDirection?: SwipeDirection;\n} & CloseOptions) {\n const queryOverlay = useOverlay(param, id, { fallback, omitParams });\n const overlay = navigation ?? queryOverlay;\n const resolved = usePresentation(presentation);\n const generated = useId();\n const [contentId, setContentId] = useState(`zappie-overlay-${generated}`);\n const trigger = useRef<HTMLElement | null>(null);\n useEffect(() => {\n if (engineModule) {\n return undefined;\n }\n if (typeof window.requestIdleCallback === \"function\") {\n const handle = window.requestIdleCallback(prefetch);\n return () => window.cancelIdleCallback(handle);\n }\n const handle = window.setTimeout(prefetch, 1500);\n return () => window.clearTimeout(handle);\n }, []);\n const context = useMemo(\n () => ({\n ...overlay,\n presentation: resolved,\n swipeDirection:\n swipeDirection ?? (resolved === \"sheet\" ? \"right\" : \"down\"),\n contentId,\n setContentId,\n trigger,\n }),\n [overlay, resolved, swipeDirection, contentId],\n );\n return (\n <Context.Provider value={context}>\n {part(\"div\", props, overlay, {\n \"data-state\": overlay.isOpen ? \"open\" : \"closed\",\n \"data-presentation\": resolved,\n })}\n </Context.Provider>\n );\n}\nconst Trigger = forwardRef<HTMLElement, PartProps<OverlayState>>(\n function Trigger(props, ref) {\n const ctx = useContextValue();\n return part(\n \"button\",\n props,\n ctx,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": ctx.isOpen,\n \"aria-controls\": ctx.contentId,\n \"data-state\": ctx.isOpen ? \"open\" : \"closed\",\n onPointerEnter: prefetch,\n onFocus: prefetch,\n onClick: () => ctx.open(),\n },\n composeRefs(ref, (node: HTMLElement | null) => {\n ctx.trigger.current = node;\n }),\n );\n },\n);\nexport type OverlayContentProps = PartProps<OverlayState> & {\n /** Runs on Escape. Call `event.preventDefault()` to keep the overlay open. */\n onEscape?: (event: KeyboardEvent) => void;\n /** Runs on an outside pointer press or focus. Call `event.preventDefault()` to keep the overlay open. */\n onInteractOutside?: (event: Event) => void;\n /** Keep the content mounted while closed, for exit animations driven by `data-state`. */\n forceMount?: true;\n /** Where to mount the content. Defaults to `document.body`. */\n container?: HTMLElement | null;\n};\nconst Content = forwardRef<HTMLElement, OverlayContentProps>(function Content(\n { onEscape, onInteractOutside, forceMount, container, ...props },\n ref,\n) {\n const ctx = useContextValue();\n const [engine, setEngine] = useState(engineModule);\n // Once opened, the surface stays mounted so the engine can play exit transitions.\n const [opened, setOpened] = useState(ctx.isOpen);\n if (ctx.isOpen && !opened) {\n setOpened(true);\n }\n const customId = partId(props as Parameters<typeof partId>[0]);\n const { setContentId } = ctx;\n useEffect(() => {\n if (customId) {\n setContentId(customId);\n }\n }, [customId, setContentId]);\n useEffect(() => {\n if (engine || !(ctx.isOpen || forceMount)) {\n return undefined;\n }\n let live = true;\n void loadOverlayEngine().then(\n (module) => {\n if (live) {\n setEngine(module);\n }\n },\n () => {},\n );\n return () => {\n live = false;\n };\n }, [engine, ctx.isOpen, forceMount]);\n if (!engine || (!opened && !forceMount)) {\n return null;\n }\n return (\n <EngineContext.Provider value={engine}>\n <engine.Surface\n open={ctx.isOpen}\n presentation={ctx.presentation}\n swipeDirection={ctx.swipeDirection}\n contentId={ctx.contentId}\n trigger={ctx.trigger}\n onOpen={() => ctx.open()}\n onClose={ctx.close}\n onEscape={onEscape}\n onInteractOutside={onInteractOutside}\n forceMount={forceMount}\n container={container}\n state={ctx}\n contentProps={props as PartProps<never>}\n contentRef={ref}\n />\n </EngineContext.Provider>\n );\n});\nfunction useEngine() {\n const engine = useContext(EngineContext);\n if (!engine) {\n throw new Error(\n \"Overlay.Title and Overlay.Close must be inside Overlay.Content\",\n );\n }\n return engine;\n}\nconst Title = forwardRef<HTMLElement, PartProps<OverlayState>>(\n function Title(props, ref) {\n const ctx = useContextValue();\n const { EngineTitle } = useEngine();\n return (\n <EngineTitle {...(props as PartProps<unknown>)} state={ctx} ref={ref} />\n );\n },\n);\nconst Close = forwardRef<HTMLElement, PartProps<OverlayState>>(\n function Close(props, ref) {\n const ctx = useContextValue();\n const { EngineClose } = useEngine();\n return (\n <EngineClose {...(props as PartProps<unknown>)} state={ctx} ref={ref} />\n );\n },\n);\n/**\n * Composable dialog, drawer and sheet parts with URL-backed open state and a lazy modal engine.\n * Use Root, Trigger, Content, Title and Close to connect history, focus handling and dismissal.\n */\nexport const Overlay = { Root, Trigger, Content, Title, Close };\n"],
|
|
5
|
-
"mappings": ";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["\"use client\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n type CSSProperties,\n type Ref,\n} from \"react\";\nimport { createPortal, flushSync } from \"react-dom\";\nimport { composeRefs, part, partId, type PartProps } from \"../internal/slot\";\nimport type { Presentation, SwipeDirection } from \"./engine\";\nimport {\n closeOverlay,\n locationSnapshot,\n openOverlay,\n subscribeLocation,\n type CloseOptions,\n type OverlayQuery,\n} from \"./history\";\n\ntype EngineModule = typeof import(\"./engine\");\nlet engineModule: EngineModule | undefined;\nlet enginePromise: Promise<EngineModule> | undefined;\n/**\n * Load the overlay engine (Base UI dialog and drawer). It is a separate chunk, prefetched once\n * the page has loaded and the browser is idle, and on trigger hover/focus, so it is ready by\n * the first open.\n */\nexport function loadOverlayEngine(): Promise<EngineModule> {\n enginePromise ??= import(\"./engine\").then(\n (module) => (engineModule = module),\n (error: unknown) => {\n // A failed chunk load (e.g. offline) must not poison later opens.\n enginePromise = undefined;\n throw error;\n },\n );\n return enginePromise;\n}\n\n/**\n * Control an overlay whose open state is stored in a URL query parameter.\n *\n * @param param - The query parameter to read and update.\n * @param id - The value that identifies this overlay as open.\n * @param options - Fallback query values and query parameters to omit when closing.\n * @returns Reactive open state and history-backed open and close actions.\n */\nexport function useOverlay(param: string, id: string, options?: CloseOptions) {\n const search = useSyncExternalStore(\n subscribeLocation,\n locationSnapshot,\n () => \"\",\n );\n const optionsRef = useRef(options);\n optionsRef.current = options;\n const open = useCallback(\n (query?: OverlayQuery) => openOverlay(param, id, query),\n [param, id],\n );\n const close = useCallback(\n () => closeOverlay(param, id, optionsRef.current),\n [param, id],\n );\n return useMemo(\n () => ({\n isOpen: new URLSearchParams(search).get(param) === id,\n open,\n close,\n }),\n [search, param, id, open, close],\n );\n}\n\n/** Tailwind's default min-width breakpoints. */\nconst BREAKPOINTS = { sm: 640, md: 768, lg: 1024, xl: 1280 } as const;\nexport type ResponsivePresentation =\n | Presentation\n | ({ base: Presentation } & Partial<\n Record<keyof typeof BREAKPOINTS, Presentation>\n >);\n/** Choose a presentation using media queries. The server renders `base`. */\nfunction usePresentation(value: ResponsivePresentation): Presentation {\n // Serialise so inline objects don't resubscribe on every render.\n const key = typeof value === \"string\" ? value : JSON.stringify(value);\n const resolve = useCallback((): Presentation => {\n const parsed = (\n key.startsWith(\"{\") ? JSON.parse(key) : key\n ) as ResponsivePresentation;\n if (typeof parsed === \"string\") {\n return parsed;\n }\n let current = parsed.base;\n for (const [name, width] of Object.entries(BREAKPOINTS)) {\n const at = parsed[name as keyof typeof BREAKPOINTS];\n if (at && window.matchMedia(`(min-width: ${width}px)`).matches) {\n current = at;\n }\n }\n return current;\n }, [key]);\n const subscribe = useCallback(\n (onChange: () => void) => {\n if (!key.startsWith(\"{\")) {\n return () => {};\n }\n const queries = Object.values(BREAKPOINTS).map((width) =>\n window.matchMedia(`(min-width: ${width}px)`),\n );\n queries.forEach((query) => query.addEventListener(\"change\", onChange));\n return () =>\n queries.forEach((query) =>\n query.removeEventListener(\"change\", onChange),\n );\n },\n [key],\n );\n return useSyncExternalStore(subscribe, resolve, () =>\n typeof value === \"string\" ? value : value.base,\n );\n}\n\ntype OverlayState = ReturnType<typeof useOverlay>;\ntype OverlayContext = OverlayState & {\n presentation: Presentation;\n swipeDirection: SwipeDirection;\n contentId: string;\n setContentId: (id: string) => void;\n trigger: { current: HTMLElement | null };\n};\nconst Context = createContext<OverlayContext | null>(null);\nfunction useContextValue() {\n const value = useContext(Context);\n if (!value) {\n throw new Error(\"Overlay parts require Overlay.Root\");\n }\n return value;\n}\nconst prefetch = () => void loadOverlayEngine().catch(() => {});\n\n// The prefetch is scheduled when this module loads, not when an Overlay.Root mounts: a template\n// that loads its overlay with deferred() mounts the Root only on the tap, which would leave the\n// engine's download inside the open. Waiting for the load event keeps it out of the page load.\nfunction prefetchWhenIdle() {\n if (typeof window === \"undefined\") {\n return;\n }\n const schedule = () => {\n if (engineModule) {\n return;\n }\n if (typeof window.requestIdleCallback === \"function\") {\n window.requestIdleCallback(prefetch);\n } else {\n window.setTimeout(prefetch, 1500);\n }\n };\n if (document.readyState === \"complete\") {\n schedule();\n } else {\n window.addEventListener(\"load\", schedule, { once: true });\n }\n}\nprefetchWhenIdle();\n\n/**\n * The URL is the only open state. The engine (Base UI) supplies the modal mechanics: portal,\n * focus scope, scroll lock, outside and Escape dismissal, exit presence and, for drawers and\n * sheets, swipe-to-dismiss. Every open or close it requests goes through the history core.\n */\nfunction Root({\n param,\n id,\n presentation = \"dialog\",\n swipeDirection,\n fallback,\n omitParams,\n navigation,\n ...props\n}: PartProps<OverlayState> & {\n param: string;\n id: string;\n /** Your URL adapter for overlays whose open state lives in the path. */\n navigation?: OverlayState;\n /** A `dialog`, swipeable `drawer` or `sheet`. Use `{ base, sm, md, lg, xl }` for responsive layouts. */\n presentation?: ResponsivePresentation;\n /** Swipe direction to dismiss. Defaults to `down` for drawers and `right` for sheets. */\n swipeDirection?: SwipeDirection;\n} & CloseOptions) {\n const queryOverlay = useOverlay(param, id, { fallback, omitParams });\n const overlay = navigation ?? queryOverlay;\n const resolved = usePresentation(presentation);\n const generated = useId();\n const [contentId, setContentId] = useState(`zappie-overlay-${generated}`);\n const trigger = useRef<HTMLElement | null>(null);\n const context = useMemo(\n () => ({\n ...overlay,\n presentation: resolved,\n swipeDirection:\n swipeDirection ?? (resolved === \"sheet\" ? \"right\" : \"down\"),\n contentId,\n setContentId,\n trigger,\n }),\n [overlay, resolved, swipeDirection, contentId],\n );\n return (\n <Context.Provider value={context}>\n {part(\"div\", props, overlay, {\n \"data-state\": overlay.isOpen ? \"open\" : \"closed\",\n \"data-presentation\": resolved,\n })}\n </Context.Provider>\n );\n}\nconst Trigger = forwardRef<HTMLElement, PartProps<OverlayState>>(\n function Trigger(props, ref) {\n const ctx = useContextValue();\n return part(\n \"button\",\n props,\n ctx,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": ctx.isOpen,\n \"aria-controls\": ctx.contentId,\n \"data-state\": ctx.isOpen ? \"open\" : \"closed\",\n onPointerEnter: prefetch,\n onFocus: prefetch,\n onClick: () => ctx.open(),\n },\n composeRefs(ref, (node: HTMLElement | null) => {\n ctx.trigger.current = node;\n }),\n );\n },\n);\nexport type OverlayContentProps = PartProps<OverlayState> & {\n /** Runs on Escape. Call `event.preventDefault()` to keep the overlay open. */\n onEscape?: (event: KeyboardEvent) => void;\n /** Runs on an outside pointer press or focus. Call `event.preventDefault()` to keep the overlay open. */\n onInteractOutside?: (event: Event) => void;\n /** Keep the content mounted while closed, for exit animations driven by `data-state`. */\n forceMount?: true;\n /** Where to mount the content. Defaults to `document.body`. */\n container?: HTMLElement | null;\n};\n\ntype EngineKind = \"dialog\" | \"drawer\";\nconst engineKind = (presentation: Presentation): EngineKind =>\n presentation === \"dialog\" ? \"dialog\" : \"drawer\";\n/** The engine paths (Base UI's dialog, or its drawer) that have opened on this page. */\nconst warmed = new Set<EngineKind>();\n/** Whether the engine owns the content around a nested Root yet. */\nconst ContentContext = createContext<{ attached: boolean } | null>(null);\n// Everything a shopper can do to the page while the frame waits for the engine.\nconst HELD_EVENTS = [\n \"pointerdown\",\n \"mousedown\",\n \"touchstart\",\n \"click\",\n \"keydown\",\n \"wheel\",\n \"touchmove\",\n] as const;\ntype StartTimes = Map<string, CSSNumberish | null>;\nconst animationsOf = (node: Element | null | undefined) =>\n typeof node?.getAnimations === \"function\" ? node.getAnimations() : [];\n/** The start time of each CSS animation running on a node, by animation name. */\nfunction startTimes(node: Element | null | undefined): StartTimes {\n const times: StartTimes = new Map();\n for (const animation of animationsOf(node)) {\n if (\"animationName\" in animation) {\n times.set((animation as CSSAnimation).animationName, animation.startTime);\n }\n }\n return times;\n}\n/** Carry the frame's running animations over to the engine's nodes, so they don't restart. */\nfunction resume(node: Element | null | undefined, times: StartTimes) {\n for (const animation of animationsOf(node)) {\n const start =\n \"animationName\" in animation\n ? times.get((animation as CSSAnimation).animationName)\n : undefined;\n if (start !== undefined && start !== null) {\n animation.startTime = start;\n }\n }\n}\n\ntype FrameProps = {\n ctx: OverlayContext;\n contentProps: PartProps<never>;\n contentRef: Ref<HTMLElement>;\n container: HTMLElement | null | undefined;\n onEscape: ((event: KeyboardEvent) => void) | undefined;\n onInteractOutside: ((event: Event) => void) | undefined;\n onAttach: (times: [StartTimes, StartTimes]) => void;\n};\n/**\n * The overlay's first frame on a page: its backdrop and its panel with the content, in the\n * engine's markup, painted without the engine. The first open on a page runs Base UI's and\n * React DOM's modal code for the first time, and V8 compiles it then, which takes several\n * frames on a slow phone. The frame paints on the tap and the engine replaces it at the start\n * of the next frame, so that work lands after the overlay is on screen.\n *\n * Until the engine is in, the frame is hidden from assistive technology and takes no input:\n * every key, press and scroll is held, so focus stays on the trigger and nothing on the page\n * can be reached. Escape and an outside press still close it, through the same callbacks.\n */\nfunction Frame({\n ctx,\n contentProps,\n contentRef,\n container,\n onEscape,\n onInteractOutside,\n onAttach,\n}: FrameProps) {\n const backdrop = useRef<HTMLDivElement>(null);\n const popup = useRef<HTMLElement | null>(null);\n const latest = useRef({ onEscape, onInteractOutside, onAttach, ctx });\n latest.current = { onEscape, onInteractOutside, onAttach, ctx };\n useLayoutEffect(() => {\n const dismiss = (\n callback: ((event: never) => void) | undefined,\n event: Event,\n ) => {\n callback?.(event as never);\n if (!(callback && event.defaultPrevented)) {\n latest.current.ctx.close();\n }\n };\n const hold = (event: Event) => {\n const inside =\n event.target instanceof Node && popup.current?.contains(event.target);\n if (\n event.type === \"keydown\" &&\n (event as KeyboardEvent).key === \"Escape\"\n ) {\n dismiss(latest.current.onEscape, event);\n } else if (event.type === \"pointerdown\" && !inside) {\n dismiss(latest.current.onInteractOutside, event);\n }\n if (event.cancelable) {\n event.preventDefault();\n }\n event.stopImmediatePropagation();\n };\n for (const type of HELD_EVENTS) {\n window.addEventListener(type, hold, { capture: true, passive: false });\n }\n // The first callback runs before this frame paints; the second starts the next frame.\n let live = true;\n let frame = requestAnimationFrame(() => {\n frame = requestAnimationFrame(() => {\n if (live) {\n latest.current.onAttach([\n startTimes(backdrop.current),\n startTimes(popup.current),\n ]);\n }\n });\n });\n return () => {\n live = false;\n cancelAnimationFrame(frame);\n for (const type of HELD_EVENTS) {\n window.removeEventListener(type, hold, { capture: true });\n }\n };\n }, []);\n const { presentation, swipeDirection } = ctx;\n const drawer = presentation !== \"dialog\";\n const { id: _ownId, ...rest } = contentProps as PartProps<never> & {\n id?: string;\n };\n const id = partId(contentProps as Parameters<typeof partId>[0]);\n const panel = part(\n \"div\",\n rest as PartProps<unknown>,\n ctx,\n {\n \"data-open\": \"\",\n ...(drawer ? { \"data-swipe-direction\": swipeDirection } : {}),\n id: id ?? ctx.contentId,\n role: \"dialog\",\n tabIndex: -1,\n style: drawer\n ? {\n \"--drawer-swipe-movement-x\": \"0px\",\n \"--drawer-swipe-movement-y\": \"0px\",\n \"--drawer-swipe-progress\": 0,\n \"--nested-drawers\": 0,\n \"--drawer-snap-point-offset\": \"0px\",\n \"--drawer-swipe-strength\": 1,\n }\n : { \"--nested-dialogs\": 0 },\n \"aria-modal\": true,\n \"data-presentation\": presentation,\n \"data-state\": \"open\",\n // The engine's panel replaces this one on the next frame and is the one announced.\n \"aria-hidden\": true,\n },\n composeRefs(contentRef, (node: HTMLElement | null) => {\n popup.current = node;\n }),\n );\n return createPortal(\n <div data-zappie-overlay-frame=\"\">\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n style={{ position: \"fixed\", inset: 0, userSelect: \"none\" }}\n />\n <div\n ref={backdrop}\n data-open=\"\"\n role=\"presentation\"\n style={\n {\n userSelect: \"none\",\n ...(drawer\n ? { \"--drawer-swipe-progress\": 0, \"--drawer-swipe-strength\": 1 }\n : {}),\n } as CSSProperties\n }\n data-zappie-backdrop=\"\"\n data-presentation={presentation}\n data-state=\"open\"\n aria-hidden=\"true\"\n />\n {drawer ? (\n <div\n data-open=\"\"\n role=\"presentation\"\n style={{ \"--drawer-keyboard-inset\": \"0px\" } as CSSProperties}\n >\n {panel}\n </div>\n ) : (\n panel\n )}\n </div>,\n container ?? document.body,\n );\n}\n\ntype Phase = \"closed\" | \"frame\" | \"engine\";\nconst Content = forwardRef<HTMLElement, OverlayContentProps>(function Content(\n { onEscape, onInteractOutside, forceMount, container, ...props },\n ref,\n) {\n const ctx = useContextValue();\n const parent = useContext(ContentContext);\n const [loaded, setEngine] = useState(engineModule);\n // Content that mounted before the idle prefetch finished still sees the engine once it is in.\n const engine = loaded ?? engineModule;\n // A page's first open of each engine path paints a frame first; see Frame. Nested overlays\n // open inside an engine that is already running, and a forced mount has no tap to answer.\n const firstPhase = (): Phase =>\n !forceMount &&\n ctx.isOpen &&\n !parent &&\n !warmed.has(engineKind(ctx.presentation))\n ? \"frame\"\n : \"engine\";\n // Once the engine is in, the surface stays mounted so it can play exit transitions.\n const [phase, setPhase] = useState<Phase>(() =>\n engine && (ctx.isOpen || forceMount) ? firstPhase() : \"closed\",\n );\n if (phase === \"closed\" && engine && (ctx.isOpen || forceMount)) {\n setPhase(firstPhase());\n }\n if (phase === \"frame\" && !ctx.isOpen) {\n setPhase(\"closed\");\n }\n const customId = partId(props as Parameters<typeof partId>[0]);\n const { setContentId } = ctx;\n useEffect(() => {\n if (customId) {\n setContentId(customId);\n }\n }, [customId, setContentId]);\n useEffect(() => {\n if (engine || !(ctx.isOpen || forceMount)) {\n return undefined;\n }\n let live = true;\n void loadOverlayEngine().then(\n (module) => {\n if (live) {\n // The engine arrived after the open, so it paints the overlay itself.\n setEngine(module);\n setPhase((current) => (current === \"closed\" ? \"engine\" : current));\n }\n },\n () => {},\n );\n return () => {\n live = false;\n };\n }, [engine, ctx.isOpen, forceMount]);\n const kind = engineKind(ctx.presentation);\n useEffect(() => {\n if (phase === \"engine\" && ctx.isOpen) {\n warmed.add(kind);\n }\n }, [phase, ctx.isOpen, kind]);\n const panel = useRef<HTMLElement | null>(null);\n const engineRef = useMemo(\n () =>\n composeRefs(ref, (node: HTMLElement | null) => {\n panel.current = node;\n }),\n [ref],\n );\n const attach = useCallback(([backdrop, popup]: [StartTimes, StartTimes]) => {\n flushSync(() => setPhase(\"engine\"));\n const node = panel.current;\n resume(node, popup);\n resume(\n node\n ?.closest(\"[data-base-ui-portal]\")\n ?.querySelector(\"[data-zappie-backdrop]\"),\n backdrop,\n );\n }, []);\n const attached = useMemo(() => ({ attached: phase === \"engine\" }), [phase]);\n if (!engine || phase === \"closed\" || (parent && !parent.attached)) {\n return null;\n }\n if (phase === \"frame\") {\n return (\n <ContentContext.Provider value={attached}>\n <PartsContext.Provider value={frameParts}>\n <Frame\n ctx={ctx}\n contentProps={props as PartProps<never>}\n contentRef={ref}\n container={container}\n onEscape={onEscape}\n onInteractOutside={onInteractOutside}\n onAttach={attach}\n />\n </PartsContext.Provider>\n </ContentContext.Provider>\n );\n }\n return (\n <ContentContext.Provider value={attached}>\n <PartsContext.Provider value={engine}>\n <engine.Surface\n open={ctx.isOpen}\n presentation={ctx.presentation}\n swipeDirection={ctx.swipeDirection}\n contentId={ctx.contentId}\n trigger={ctx.trigger}\n onOpen={() => ctx.open()}\n onClose={ctx.close}\n onEscape={onEscape}\n onInteractOutside={onInteractOutside}\n forceMount={forceMount}\n container={container}\n state={ctx}\n contentProps={props as PartProps<never>}\n contentRef={engineRef}\n />\n </PartsContext.Provider>\n </ContentContext.Provider>\n );\n});\n\ntype PartComponent = EngineModule[\"EngineTitle\"];\ntype Parts = { EngineTitle: PartComponent; EngineClose: PartComponent };\ntype FramePartProps = PartProps<unknown> & { state: unknown };\n/** Title and Close for the content: the engine's, or the frame's inert stand-ins. */\nconst PartsContext = createContext<Parts | null>(null);\nconst frameParts: Parts = {\n EngineTitle: forwardRef<HTMLElement, FramePartProps>(function FrameTitle(\n { state, ...props },\n ref,\n ) {\n return part(\"h2\", props, state, {}, ref);\n }),\n EngineClose: forwardRef<HTMLElement, FramePartProps>(function FrameClose(\n { state, ...props },\n ref,\n ) {\n return part(\"button\", props, state, { type: \"button\" }, ref);\n }),\n};\nfunction useEngine() {\n const parts = useContext(PartsContext);\n if (!parts) {\n throw new Error(\n \"Overlay.Title and Overlay.Close must be inside Overlay.Content\",\n );\n }\n return parts;\n}\nconst Title = forwardRef<HTMLElement, PartProps<OverlayState>>(\n function Title(props, ref) {\n const ctx = useContextValue();\n const { EngineTitle } = useEngine();\n return (\n <EngineTitle {...(props as PartProps<unknown>)} state={ctx} ref={ref} />\n );\n },\n);\nconst Close = forwardRef<HTMLElement, PartProps<OverlayState>>(\n function Close(props, ref) {\n const ctx = useContextValue();\n const { EngineClose } = useEngine();\n return (\n <EngineClose {...(props as PartProps<unknown>)} state={ctx} ref={ref} />\n );\n },\n);\n/**\n * Composable dialog, drawer and sheet parts with URL-backed open state and a lazy modal engine.\n * Use Root, Trigger, Content, Title and Close to connect history, focus handling and dismissal.\n */\nexport const Overlay = { Root, Trigger, Content, Title, Close };\n"],
|
|
5
|
+
"mappings": ";;;AACA;AAAA,EACE;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-1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zappie/foundations",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "UI-less React primitives for Zappie storefronts: behaviour, state and accessibility without styles.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@base-ui/react": "^1.8.0",
|
|
35
|
-
"@
|
|
35
|
+
"@googlemaps/markerclusterer": "^2.6.2",
|
|
36
|
+
"@zappie/sdk": "^0.1.9"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": "^18.2.0 || ^19.0.0",
|