@protobase/ui 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-gate.js +9 -0
- package/dist/package.js +1 -1
- package/dist/primitives/responsive-dialog.d.ts +2 -1
- package/dist/primitives/responsive-dialog.js +13 -11
- package/dist/primitives/sheet.js +39 -39
- package/dist/shell/assets/app-CyW0VzOi.js +66 -0
- package/dist/shell/assets/{index-Ddh359yv.js → index-DhgTXlZ3.js} +1 -1
- package/dist/shell/assets/index-DthLyPYI.css +2 -0
- package/dist/shell/assets/{maplibre-gl-Du00jL_c.js → maplibre-gl-CKQN3M1I.js} +1 -1
- package/dist/shell/assets/{record-map-82NQGiUy.js → record-map-CzJ60-ux.js} +2 -2
- package/dist/shell/assets/{records-map-BC0FGfLG.js → records-map-dch_o1ug.js} +1 -1
- package/dist/shell/assets/{shared-protobase-ui-CVi8JFzf.js → shared-protobase-ui-C-qDEeIK.js} +1 -1
- package/dist/shell/index.html +4 -4
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +5 -4
- package/dist/shell/assets/app-BkySvmpb.js +0 -66
- package/dist/shell/assets/index-BXYHpFoe.css +0 -2
package/dist/auth/auth-gate.js
CHANGED
|
@@ -69,6 +69,15 @@ const AuthGate = ({ workspace, children }) => {
|
|
|
69
69
|
useEffect(() => {
|
|
70
70
|
if (state.kind === "signed-out" && page.kind === "sign-in" && page.providerError) forgetSignInLink();
|
|
71
71
|
}, [state.kind, page]);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (state.kind !== "signed-out" || !browse) return;
|
|
74
|
+
const leave = () => {
|
|
75
|
+
setPage({ kind: "sign-in" });
|
|
76
|
+
browse();
|
|
77
|
+
};
|
|
78
|
+
window.addEventListener("popstate", leave);
|
|
79
|
+
return () => window.removeEventListener("popstate", leave);
|
|
80
|
+
}, [state.kind, browse]);
|
|
72
81
|
const signInFailed = useCallback((error) => setPage({
|
|
73
82
|
kind: "sign-in",
|
|
74
83
|
error
|
package/dist/package.js
CHANGED
|
@@ -11,7 +11,8 @@ export type ResponsiveDialogProps = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A modal centred on the screen from the `md` breakpoint up, and a sheet rising from the bottom on a phone, switching as
|
|
14
|
-
* the viewport does. Both close on Escape and on a press outside, and keep focus inside while open
|
|
14
|
+
* the viewport does. Both close on Escape and on a press outside, and keep focus inside while open; the sheet also
|
|
15
|
+
* closes when swiped down.
|
|
15
16
|
*/
|
|
16
17
|
export declare const ResponsiveDialog: ({ title, description, open, onClose, actions, children }: ResponsiveDialogProps) => import("react").JSX.Element | null;
|
|
17
18
|
//#endregion
|
|
@@ -5,21 +5,23 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
//#region src/primitives/responsive-dialog.tsx
|
|
6
6
|
/**
|
|
7
7
|
* A modal centred on the screen from the `md` breakpoint up, and a sheet rising from the bottom on a phone, switching as
|
|
8
|
-
* the viewport does. Both close on Escape and on a press outside, and keep focus inside while open
|
|
8
|
+
* the viewport does. Both close on Escape and on a press outside, and keep focus inside while open; the sheet also
|
|
9
|
+
* closes when swiped down.
|
|
9
10
|
*/
|
|
10
11
|
const ResponsiveDialog = ({ title, description, open, onClose, actions, children }) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
if (useIsDesktop()) {
|
|
13
|
+
if (!open) return null;
|
|
14
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
15
|
+
title,
|
|
16
|
+
description,
|
|
17
|
+
onClose,
|
|
18
|
+
actions,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
20
22
|
return /* @__PURE__ */ jsx(Sheet, {
|
|
21
23
|
title,
|
|
22
|
-
open
|
|
24
|
+
open,
|
|
23
25
|
onClose,
|
|
24
26
|
children: /* @__PURE__ */ jsxs("div", {
|
|
25
27
|
className: "pt-3 text-[13px]",
|
package/dist/primitives/sheet.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { useFocusTrap } from "../lib/use-focus-trap.js";
|
|
2
|
-
import { useRef } from "react";
|
|
3
1
|
import { X } from "lucide-react";
|
|
4
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Drawer } from "@base-ui/react/drawer";
|
|
5
4
|
//#region src/primitives/sheet.tsx
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
5
|
+
const motion = "transition-[transform,opacity] duration-[400ms] ease-[cubic-bezier(0.32,0.72,0,1)] data-swiping:duration-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] motion-reduce:duration-0";
|
|
6
|
+
/**
|
|
7
|
+
* A panel that rises from the bottom of the screen, for the filter panel and `ResponsiveDialog` on phones. It closes
|
|
8
|
+
* when swiped down, on its close button, on a press outside and on Escape, and keeps focus inside while open (Base UI's
|
|
9
|
+
* `Drawer`).
|
|
10
|
+
*/
|
|
11
|
+
const Sheet = ({ title, open, onClose, children }) => /* @__PURE__ */ jsx(Drawer.Root, {
|
|
12
|
+
open,
|
|
13
|
+
onOpenChange: (next) => !next && onClose(),
|
|
14
|
+
children: /* @__PURE__ */ jsxs(Drawer.Portal, { children: [/* @__PURE__ */ jsx(Drawer.Backdrop, { className: `fixed inset-0 z-[80] bg-foreground/40 opacity-[calc(1-var(--drawer-swipe-progress))] data-starting-style:opacity-0 data-ending-style:opacity-0 ${motion}` }), /* @__PURE__ */ jsx(Drawer.Viewport, {
|
|
15
|
+
className: "fixed inset-0 z-[80] flex items-end",
|
|
16
|
+
children: /* @__PURE__ */ jsxs(Drawer.Popup, {
|
|
17
|
+
className: `flex max-h-[85vh] w-full flex-col rounded-t-xl border-t bg-background shadow-pop outline-none [transform:translateY(var(--drawer-swipe-movement-y))] data-starting-style:[transform:translateY(100%)] data-ending-style:[transform:translateY(100%)] data-swiping:select-none ${motion}`,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "flex shrink-0 justify-center pt-2",
|
|
21
|
+
"aria-hidden": true,
|
|
22
|
+
children: /* @__PURE__ */ jsx("div", { className: "h-1 w-10 rounded-full bg-border-strong" })
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsxs("header", {
|
|
25
|
+
className: "flex shrink-0 items-center justify-between border-b px-4",
|
|
26
|
+
children: [/* @__PURE__ */ jsx(Drawer.Title, {
|
|
27
|
+
className: "text-[15px] font-semibold",
|
|
28
|
+
children: title
|
|
29
|
+
}), /* @__PURE__ */ jsx(Drawer.Close, {
|
|
30
|
+
"aria-label": "Close",
|
|
31
|
+
className: "-mr-2 inline-flex size-11 items-center justify-center rounded-md text-muted-foreground hover:bg-muted",
|
|
32
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-5" })
|
|
33
|
+
})]
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx(Drawer.Content, {
|
|
36
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-6",
|
|
37
|
+
children
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
})] })
|
|
42
|
+
});
|
|
43
43
|
//#endregion
|
|
44
44
|
export { Sheet };
|