@brett_lamy/ui 4.0.0 → 5.1.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/README.md +1 -1
- package/dist/components/animated-height.d.ts +3 -1
- package/dist/components/animated-height.d.ts.map +1 -1
- package/dist/components/animated-height.js +11 -11
- package/dist/components/artifact-chat-container.d.ts.map +1 -1
- package/dist/components/artifact-chat-container.js +81 -82
- package/dist/components/button.d.ts +4 -3
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +22 -9
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +97 -0
- package/dist/components/canvas.d.ts +91 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +296 -0
- package/dist/components/color-field.d.ts +22 -0
- package/dist/components/color-field.d.ts.map +1 -0
- package/dist/components/color-field.js +60 -0
- package/dist/components/color-picker.d.ts +49 -0
- package/dist/components/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker.js +121 -0
- package/dist/components/composer/composer-cards.d.ts +55 -0
- package/dist/components/composer/composer-cards.d.ts.map +1 -0
- package/dist/components/composer/composer-cards.js +351 -0
- package/dist/components/composer/composer.d.ts +9 -1
- package/dist/components/composer/composer.d.ts.map +1 -1
- package/dist/components/composer/composer.js +179 -154
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +127 -0
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +52 -92
- package/dist/components/cron-editor.d.ts +47 -0
- package/dist/components/cron-editor.d.ts.map +1 -0
- package/dist/components/cron-editor.js +297 -0
- package/dist/components/date-field.d.ts +19 -0
- package/dist/components/date-field.d.ts.map +1 -0
- package/dist/components/date-field.js +79 -0
- package/dist/components/date-picker.d.ts +38 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +110 -0
- package/dist/components/dropdown-menu.d.ts +3 -1
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +5 -5
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +1 -0
- package/dist/components/file-upload.d.ts +121 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +405 -0
- package/dist/components/filter-input.d.ts +22 -0
- package/dist/components/filter-input.d.ts.map +1 -0
- package/dist/components/filter-input.js +126 -0
- package/dist/components/filter.d.ts +154 -0
- package/dist/components/filter.d.ts.map +1 -0
- package/dist/components/filter.js +815 -0
- package/dist/components/floating-chat.d.ts.map +1 -1
- package/dist/components/floating-chat.js +71 -88
- package/dist/components/floating-sheet.d.ts.map +1 -1
- package/dist/components/floating-sheet.js +93 -104
- package/dist/components/markdown-editor.d.ts +2 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +46 -45
- package/dist/components/markdown-view.d.ts +6 -1
- package/dist/components/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view.js +13 -11
- package/dist/components/navigation-stack.d.ts +3 -5
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +212 -382
- package/dist/components/passkey-enroll-dialog.d.ts +36 -0
- package/dist/components/passkey-enroll-dialog.d.ts.map +1 -0
- package/dist/components/passkey-enroll-dialog.js +234 -0
- package/dist/components/result-table.d.ts +38 -0
- package/dist/components/result-table.d.ts.map +1 -0
- package/dist/components/result-table.js +161 -0
- package/dist/components/schema-tree.d.ts +19 -0
- package/dist/components/schema-tree.d.ts.map +1 -0
- package/dist/components/schema-tree.js +172 -0
- package/dist/components/side-drawer.d.ts.map +1 -1
- package/dist/components/side-drawer.js +117 -143
- package/dist/components/slider.d.ts.map +1 -1
- package/dist/components/slider.js +4 -1
- package/dist/components/spinner-shapes.d.ts +299 -0
- package/dist/components/spinner-shapes.d.ts.map +1 -0
- package/dist/components/spinner-shapes.js +876 -0
- package/dist/components/spinner.d.ts +133 -3
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/spinner.js +445 -29
- package/dist/components/sql-console.d.ts +28 -0
- package/dist/components/sql-console.d.ts.map +1 -0
- package/dist/components/sql-console.js +348 -0
- package/dist/components/sql-editor.d.ts +47 -0
- package/dist/components/sql-editor.d.ts.map +1 -0
- package/dist/components/sql-editor.js +170 -0
- package/dist/components/tab-view.d.ts +2 -2
- package/dist/components/tab-view.d.ts.map +1 -1
- package/dist/components/tab-view.js +63 -49
- package/dist/components/tailscale-login-button.d.ts +53 -0
- package/dist/components/tailscale-login-button.d.ts.map +1 -0
- package/dist/components/tailscale-login-button.js +197 -0
- package/dist/components/time-input.d.ts +46 -0
- package/dist/components/time-input.d.ts.map +1 -0
- package/dist/components/time-input.js +258 -0
- package/dist/components/toast.d.ts +5 -2
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +249 -125
- package/dist/components/vault-gate.d.ts +60 -0
- package/dist/components/vault-gate.d.ts.map +1 -0
- package/dist/components/vault-gate.js +382 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +90 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +134 -83
- package/dist/lib/back-history.d.ts +5 -0
- package/dist/lib/back-history.d.ts.map +1 -0
- package/dist/lib/back-history.js +44 -0
- package/dist/lib/canvas-math.d.ts +82 -0
- package/dist/lib/canvas-math.d.ts.map +1 -0
- package/dist/lib/canvas-math.js +226 -0
- package/dist/lib/controllable-state.d.ts +4 -0
- package/dist/lib/controllable-state.d.ts.map +1 -0
- package/dist/lib/controllable-state.js +11 -0
- package/dist/lib/cron.d.ts +55 -0
- package/dist/lib/cron.d.ts.map +1 -0
- package/dist/lib/cron.js +269 -0
- package/dist/lib/edge-swipe.d.ts +36 -0
- package/dist/lib/edge-swipe.d.ts.map +1 -0
- package/dist/lib/edge-swipe.js +73 -0
- package/dist/lib/file-upload.d.ts +187 -0
- package/dist/lib/file-upload.d.ts.map +1 -0
- package/dist/lib/file-upload.js +349 -0
- package/dist/lib/filter-query.d.ts +90 -0
- package/dist/lib/filter-query.d.ts.map +1 -0
- package/dist/lib/filter-query.js +459 -0
- package/dist/lib/filter.d.ts +120 -0
- package/dist/lib/filter.d.ts.map +1 -0
- package/dist/lib/filter.js +399 -0
- package/dist/lib/format-bytes.d.ts +3 -0
- package/dist/lib/format-bytes.d.ts.map +1 -0
- package/dist/lib/format-bytes.js +16 -0
- package/dist/lib/gpu-cron.d.ts +51 -0
- package/dist/lib/gpu-cron.d.ts.map +1 -0
- package/dist/lib/gpu-cron.js +81 -0
- package/dist/lib/gpu-query/featurize.d.ts +19 -0
- package/dist/lib/gpu-query/featurize.d.ts.map +1 -0
- package/dist/lib/gpu-query/featurize.js +88 -0
- package/dist/lib/gpu-query/index.d.ts +73 -0
- package/dist/lib/gpu-query/index.d.ts.map +1 -0
- package/dist/lib/gpu-query/index.js +117 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts +30 -0
- package/dist/lib/gpu-query/kernel.wgsl.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.d.ts +8 -0
- package/dist/lib/gpu-query/model.d.ts.map +1 -0
- package/dist/lib/gpu-query/model.js +91 -0
- package/dist/lib/gpu-query/schema.d.ts +40 -0
- package/dist/lib/gpu-query/schema.d.ts.map +1 -0
- package/dist/lib/gpu-query/schema.js +0 -0
- package/dist/lib/gpu-query/webgpu.d.ts +12 -0
- package/dist/lib/gpu-query/webgpu.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.d.ts +17 -0
- package/dist/lib/gpu-query/weights.d.ts.map +1 -0
- package/dist/lib/gpu-query/weights.js +40 -0
- package/dist/lib/gpu-query/weights.json.d.ts +3 -0
- package/dist/lib/gpu-query/weights2.js +25 -0
- package/dist/lib/gpu-time.d.ts +77 -0
- package/dist/lib/gpu-time.d.ts.map +1 -0
- package/dist/lib/gpu-time.js +260 -0
- package/dist/lib/morph-path.d.ts +22 -0
- package/dist/lib/morph-path.d.ts.map +1 -0
- package/dist/lib/morph-path.js +42 -0
- package/dist/lib/passkey.d.ts +120 -0
- package/dist/lib/passkey.d.ts.map +1 -0
- package/dist/lib/passkey.js +186 -0
- package/dist/lib/persistent-state.d.ts +9 -0
- package/dist/lib/persistent-state.d.ts.map +1 -0
- package/dist/lib/persistent-state.js +37 -0
- package/dist/lib/pglite-core.d.ts +219 -0
- package/dist/lib/pglite-core.d.ts.map +1 -0
- package/dist/lib/pglite-core.js +273 -0
- package/dist/lib/pglite-files.d.ts +7 -0
- package/dist/lib/pglite-files.d.ts.map +1 -0
- package/dist/lib/pglite-files.js +17 -0
- package/dist/lib/pglite-schema.d.ts +58 -0
- package/dist/lib/pglite-schema.d.ts.map +1 -0
- package/dist/lib/pglite-schema.js +105 -0
- package/dist/lib/pglite-storage.d.ts +33 -0
- package/dist/lib/pglite-storage.d.ts.map +1 -0
- package/dist/lib/pglite-storage.js +55 -0
- package/dist/lib/pglite-transfer.d.ts +53 -0
- package/dist/lib/pglite-transfer.d.ts.map +1 -0
- package/dist/lib/pglite-transfer.js +126 -0
- package/dist/lib/pglite.d.ts +106 -0
- package/dist/lib/pglite.d.ts.map +1 -0
- package/dist/lib/pglite.js +298 -0
- package/dist/lib/pull-to-refresh.d.ts +24 -0
- package/dist/lib/pull-to-refresh.d.ts.map +1 -0
- package/dist/lib/pull-to-refresh.js +74 -0
- package/dist/lib/scroll-hidden.d.ts +6 -0
- package/dist/lib/scroll-hidden.d.ts.map +1 -0
- package/dist/lib/scroll-hidden.js +21 -0
- package/dist/lib/sql-format.d.ts +62 -0
- package/dist/lib/sql-format.d.ts.map +1 -0
- package/dist/lib/sql-format.js +175 -0
- package/dist/lib/sql-lex.d.ts +25 -0
- package/dist/lib/sql-lex.d.ts.map +1 -0
- package/dist/lib/sql-lex.js +135 -0
- package/dist/lib/tab-lock.d.ts +28 -0
- package/dist/lib/tab-lock.d.ts.map +1 -0
- package/dist/lib/tab-lock.js +80 -0
- package/dist/lib/tailscale-connect.d.ts +56 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -0
- package/dist/lib/tailscale-connect.js +99 -0
- package/dist/lib/tailscale-fake.d.ts +33 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -0
- package/dist/lib/tailscale-fake.js +80 -0
- package/dist/lib/tailscale-policy.d.ts +71 -0
- package/dist/lib/tailscale-policy.d.ts.map +1 -0
- package/dist/lib/tailscale-policy.js +244 -0
- package/dist/lib/tailscale-react.d.ts +20 -0
- package/dist/lib/tailscale-react.d.ts.map +1 -0
- package/dist/lib/tailscale-react.js +37 -0
- package/dist/lib/tailscale-router/bridge.d.ts +60 -0
- package/dist/lib/tailscale-router/bridge.d.ts.map +1 -0
- package/dist/lib/tailscale-router/bridge.js +198 -0
- package/dist/lib/tailscale-router/react.d.ts +19 -0
- package/dist/lib/tailscale-router/react.d.ts.map +1 -0
- package/dist/lib/tailscale-router/react.js +52 -0
- package/dist/lib/tailscale.d.ts +204 -0
- package/dist/lib/tailscale.d.ts.map +1 -0
- package/dist/lib/tailscale.js +443 -0
- package/dist/lib/title-flight.d.ts +34 -0
- package/dist/lib/title-flight.d.ts.map +1 -0
- package/dist/lib/title-flight.js +123 -0
- package/dist/lib/vault-react.d.ts +49 -0
- package/dist/lib/vault-react.d.ts.map +1 -0
- package/dist/lib/vault-react.js +196 -0
- package/dist/lib/vault-storage.d.ts +30 -0
- package/dist/lib/vault-storage.d.ts.map +1 -0
- package/dist/lib/vault-storage.js +105 -0
- package/dist/lib/vault.d.ts +200 -0
- package/dist/lib/vault.d.ts.map +1 -0
- package/dist/lib/vault.js +641 -0
- package/dist/tailscale-sw.js +332 -0
- package/package.json +35 -4
- package/dist/components/icon-button.d.ts +0 -19
- package/dist/components/icon-button.d.ts.map +0 -1
- package/dist/components/icon-button.js +0 -31
- package/dist/components/measure-h.d.ts +0 -7
- package/dist/components/measure-h.d.ts.map +0 -1
- package/dist/components/measure-h.js +0 -20
package/dist/components/toast.js
CHANGED
|
@@ -4,21 +4,21 @@ import { fades as t, springs as n } from "../lib/motion.js";
|
|
|
4
4
|
import { TextMorph as r } from "./text-morph.js";
|
|
5
5
|
import { Icon as i } from "../lib/icon.js";
|
|
6
6
|
import { AnimatePresence as a, motion as o, useReducedMotion as s } from "framer-motion";
|
|
7
|
-
import { createContext as c,
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { cva as
|
|
11
|
-
import { createPortal as
|
|
12
|
-
import { useToast as
|
|
7
|
+
import { createContext as c, useCallback as l, useContext as u, useEffect as d, useLayoutEffect as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
|
|
8
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
|
+
import { Button as v, UNSTABLE_ToastQueue as y } from "react-aria-components";
|
|
10
|
+
import { cva as b } from "class-variance-authority";
|
|
11
|
+
import { createPortal as x } from "react-dom";
|
|
12
|
+
import { mergeProps as S, useFocusWithin as C, useHover as w, useToast as T, useToastRegion as E } from "react-aria";
|
|
13
13
|
//#region src/components/toast.tsx
|
|
14
|
-
var
|
|
14
|
+
var D = {
|
|
15
15
|
hud: 1600,
|
|
16
16
|
banner: 5e3
|
|
17
|
-
},
|
|
17
|
+
}, O = 0, k = class {
|
|
18
18
|
aria;
|
|
19
19
|
listeners = /* @__PURE__ */ new Set();
|
|
20
20
|
constructor(e = {}) {
|
|
21
|
-
this.aria = new
|
|
21
|
+
this.aria = new y({ maxVisibleToasts: e.maxVisibleToasts ?? 5 });
|
|
22
22
|
}
|
|
23
23
|
find(e) {
|
|
24
24
|
return this.aria.visibleToasts.find((t) => t.content.data.id === e);
|
|
@@ -32,11 +32,11 @@ var S = {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
show(e, t = {}) {
|
|
35
|
-
let n = e.variant ?? "banner", r = e.id ?? (n === "hud" ? this.aria.visibleToasts.find((e) => e.content.data.variant === "hud")?.content.data.id : void 0) ?? `t${++
|
|
35
|
+
let n = e.variant ?? "banner", r = e.id ?? (n === "hud" ? this.aria.visibleToasts.find((e) => e.content.data.variant === "hud")?.content.data.id : void 0) ?? `t${++O}`, i = {
|
|
36
36
|
...e,
|
|
37
37
|
variant: n,
|
|
38
38
|
id: r
|
|
39
|
-
}, a = i.loading ? 0 : t.timeout ??
|
|
39
|
+
}, a = i.loading ? 0 : t.timeout ?? D[n], o = this.find(r);
|
|
40
40
|
return o ? (o.content = {
|
|
41
41
|
data: i,
|
|
42
42
|
rev: o.content.rev + 1
|
|
@@ -50,13 +50,16 @@ var S = {
|
|
|
50
50
|
}
|
|
51
51
|
update(e, t, n = {}) {
|
|
52
52
|
let r = this.find(e);
|
|
53
|
-
r
|
|
53
|
+
if (!r) return;
|
|
54
|
+
let i = r.content.data.loading ? void 0 : r.timeout ?? 0;
|
|
55
|
+
this.show({
|
|
54
56
|
...r.content.data,
|
|
55
57
|
loading: !1,
|
|
56
58
|
...t,
|
|
57
59
|
id: e
|
|
58
60
|
}, {
|
|
59
61
|
...n,
|
|
62
|
+
timeout: n.timeout ?? i,
|
|
60
63
|
onClose: r.onClose
|
|
61
64
|
});
|
|
62
65
|
}
|
|
@@ -68,20 +71,20 @@ var S = {
|
|
|
68
71
|
let t = this.find(e);
|
|
69
72
|
t && this.aria.close(t.key);
|
|
70
73
|
}
|
|
71
|
-
},
|
|
72
|
-
function
|
|
73
|
-
return new
|
|
74
|
+
}, A = new k();
|
|
75
|
+
function j(e) {
|
|
76
|
+
return new k(e);
|
|
74
77
|
}
|
|
75
|
-
function
|
|
78
|
+
function M(e) {
|
|
76
79
|
let { timeout: t, onClose: n, ...r } = e ?? {};
|
|
77
80
|
return [r, {
|
|
78
81
|
timeout: t,
|
|
79
82
|
onClose: n
|
|
80
83
|
}];
|
|
81
84
|
}
|
|
82
|
-
function
|
|
85
|
+
function N(e) {
|
|
83
86
|
let t = (t) => (n, r) => {
|
|
84
|
-
let [i, a] =
|
|
87
|
+
let [i, a] = M(r);
|
|
85
88
|
return e.show({
|
|
86
89
|
...t,
|
|
87
90
|
...i,
|
|
@@ -90,23 +93,23 @@ function O(e) {
|
|
|
90
93
|
}, n = t({});
|
|
91
94
|
return n.hud = t({ variant: "hud" }), n.success = t({ tone: "success" }), n.warning = t({ tone: "warning" }), n.error = t({ tone: "destructive" }), n.loading = t({ loading: !0 }), n.update = (t, n, r) => e.update(t, n, r), n.dismiss = (t) => e.dismiss(t), n.queue = e, n;
|
|
92
95
|
}
|
|
93
|
-
var
|
|
94
|
-
function
|
|
95
|
-
let e =
|
|
96
|
+
var P = N(A), F = c(null);
|
|
97
|
+
function I() {
|
|
98
|
+
let e = u(F) ?? A, t = p(null);
|
|
96
99
|
return (!t.current || t.current.q !== e) && (t.current = {
|
|
97
100
|
q: e,
|
|
98
|
-
api:
|
|
101
|
+
api: N(e)
|
|
99
102
|
}), t.current.api;
|
|
100
103
|
}
|
|
101
|
-
function
|
|
102
|
-
return /* @__PURE__ */
|
|
104
|
+
function L({ queue: e, children: t }) {
|
|
105
|
+
return /* @__PURE__ */ g(F.Provider, {
|
|
103
106
|
value: e,
|
|
104
107
|
children: t
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
|
-
function
|
|
108
|
-
let t = e.aria, n =
|
|
109
|
-
return
|
|
110
|
+
function R(e) {
|
|
111
|
+
let t = e.aria, n = h((e) => t.subscribe(e), () => t.visibleToasts, () => t.visibleToasts);
|
|
112
|
+
return h((t) => e.subscribe(t), () => n.map((e) => e.content.rev).join(","), () => ""), {
|
|
110
113
|
visibleToasts: n,
|
|
111
114
|
add: (e, n) => t.add(e, n),
|
|
112
115
|
close: (e) => t.close(e),
|
|
@@ -114,67 +117,114 @@ function N(e) {
|
|
|
114
117
|
resumeAll: () => t.resumeAll()
|
|
115
118
|
};
|
|
116
119
|
}
|
|
117
|
-
var
|
|
120
|
+
var z = {
|
|
118
121
|
top: "top-(--bl-toast-offset) left-1/2 -translate-x-1/2 items-center flex-col",
|
|
119
122
|
bottom: "bottom-(--bl-toast-offset) left-1/2 -translate-x-1/2 items-center flex-col-reverse",
|
|
120
123
|
center: "top-1/2 left-1/2 -translate-1/2 items-center flex-col",
|
|
121
124
|
"top-end": "top-(--bl-toast-offset) right-(--bl-toast-offset) items-end flex-col",
|
|
122
125
|
"bottom-end": "bottom-(--bl-toast-offset) right-(--bl-toast-offset) items-end flex-col-reverse"
|
|
123
126
|
};
|
|
124
|
-
function
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
p &&
|
|
127
|
+
function B({ queue: e = A, placement: t = "bottom", inline: n, offset: r = 24, expand: i, className: a, style: o, children: s, ...c }) {
|
|
128
|
+
let l = R(e), [u, f] = m(!1), p = l.visibleToasts.length > 0;
|
|
129
|
+
d(() => {
|
|
130
|
+
p && f(!0);
|
|
128
131
|
}, [p]);
|
|
129
|
-
let [
|
|
130
|
-
|
|
131
|
-
let
|
|
132
|
-
state:
|
|
132
|
+
let [h, v] = m(!1);
|
|
133
|
+
d(() => v(!0), []);
|
|
134
|
+
let y = p || u ? /* @__PURE__ */ g(K, {
|
|
135
|
+
state: l,
|
|
133
136
|
placement: t,
|
|
134
137
|
inline: n,
|
|
135
138
|
offset: r,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
expand: i,
|
|
140
|
+
className: a,
|
|
141
|
+
style: o,
|
|
142
|
+
"aria-label": c["aria-label"],
|
|
139
143
|
onSettled: () => {
|
|
140
|
-
e.aria.visibleToasts.length ||
|
|
144
|
+
e.aria.visibleToasts.length || f(!1);
|
|
141
145
|
}
|
|
142
146
|
}) : null;
|
|
143
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ _(F.Provider, {
|
|
144
148
|
value: e,
|
|
145
|
-
children: [
|
|
149
|
+
children: [s, n ? y : h && y ? x(y, document.body) : null]
|
|
146
150
|
});
|
|
147
151
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
152
|
+
var V = 10, H = 14, U = .05, W = 3, G = 64;
|
|
153
|
+
function K({ state: t, placement: r, inline: i, offset: c, expand: u, className: f, style: h, onSettled: v, ...y }) {
|
|
154
|
+
let b = p(null), { regionProps: x } = E(y, t, b), T = s(), D = r === "bottom" || r === "bottom-end" ? "bottom" : "top", O = t.visibleToasts.filter((e) => e.content.data.variant === "hud"), k = t.visibleToasts.filter((e) => e.content.data.variant !== "hud"), { hoverProps: A, isHovered: j } = w({}), [M, N] = m(!1), { focusWithinProps: P } = C({ onFocusWithinChange: N }), [F, I] = m(!1);
|
|
155
|
+
d(() => {
|
|
156
|
+
if (!F) return;
|
|
157
|
+
t.pauseAll();
|
|
158
|
+
let e = (e) => {
|
|
159
|
+
b.current?.contains(e.target) || I(!1);
|
|
160
|
+
};
|
|
161
|
+
return document.addEventListener("pointerdown", e, !0), () => {
|
|
162
|
+
document.removeEventListener("pointerdown", e, !0), t.resumeAll();
|
|
163
|
+
};
|
|
164
|
+
}, [F]);
|
|
165
|
+
let L = !!u || j || M || F, [R, B] = m({}), U = l((e, t) => B((n) => n[e] === t ? n : {
|
|
166
|
+
...n,
|
|
167
|
+
[e]: t
|
|
168
|
+
}), []), W = (e) => R[e] ?? G, K = k[0] ? W(k[0].key) : 0, q = 0, J = k.map((e) => {
|
|
169
|
+
let t = q;
|
|
170
|
+
return q += W(e.key) + V, t;
|
|
171
|
+
}), Y = Math.max(0, q - V), X = K + Math.min(Math.max(0, k.length - 1), 2) * H, [Z, $] = m(!1);
|
|
172
|
+
return d(() => {
|
|
173
|
+
k.length && $(!0);
|
|
174
|
+
}, [k.length]), /* @__PURE__ */ _("div", {
|
|
175
|
+
...S(x, A, P, { onPointerDownCapture: (e) => {
|
|
176
|
+
e.pointerType === "touch" && k.length > 1 && I(!0);
|
|
177
|
+
} }),
|
|
178
|
+
ref: b,
|
|
153
179
|
"data-slot": "toaster",
|
|
154
|
-
"data-placement":
|
|
155
|
-
className: e("pointer-events-none z-[1000] flex w-max max-w-[calc(100%-32px)] gap-2 outline-none",
|
|
180
|
+
"data-placement": r,
|
|
181
|
+
className: e("pointer-events-none z-[1000] flex w-max max-w-[calc(100%-32px)] gap-2 outline-none", i ? "absolute" : "fixed", z[r], f),
|
|
156
182
|
style: {
|
|
157
|
-
"--bl-toast-offset": `${
|
|
158
|
-
...
|
|
183
|
+
"--bl-toast-offset": `${c}px`,
|
|
184
|
+
...h
|
|
159
185
|
},
|
|
160
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ g(a, {
|
|
161
187
|
initial: !0,
|
|
162
|
-
onExitComplete:
|
|
163
|
-
children:
|
|
188
|
+
onExitComplete: v,
|
|
189
|
+
children: O.map((e) => /* @__PURE__ */ g(Q, {
|
|
164
190
|
toast: e,
|
|
165
191
|
state: t,
|
|
166
|
-
fromTop:
|
|
192
|
+
fromTop: D === "top"
|
|
167
193
|
}, e.key))
|
|
168
|
-
})
|
|
194
|
+
}), Z ? /* @__PURE__ */ g(o.div, {
|
|
195
|
+
"data-slot": "toast-stack",
|
|
196
|
+
"data-expanded": L || void 0,
|
|
197
|
+
className: "pointer-events-auto relative w-[min(360px,calc(100vw-32px))]",
|
|
198
|
+
initial: !1,
|
|
199
|
+
animate: { height: L ? Y : X },
|
|
200
|
+
transition: T ? { duration: .15 } : n.smooth,
|
|
201
|
+
children: /* @__PURE__ */ g(a, {
|
|
202
|
+
initial: !0,
|
|
203
|
+
onExitComplete: () => {
|
|
204
|
+
t.visibleToasts.some((e) => e.content.data.variant !== "hud") || $(!1), v();
|
|
205
|
+
},
|
|
206
|
+
children: k.map((e, n) => /* @__PURE__ */ g(ee, {
|
|
207
|
+
toast: e,
|
|
208
|
+
state: t,
|
|
209
|
+
edge: D,
|
|
210
|
+
index: n,
|
|
211
|
+
spread: L,
|
|
212
|
+
offset: J[n],
|
|
213
|
+
frontHeight: K,
|
|
214
|
+
height: R[e.key],
|
|
215
|
+
onHeight: U
|
|
216
|
+
}, e.key))
|
|
217
|
+
})
|
|
218
|
+
}) : null]
|
|
169
219
|
});
|
|
170
220
|
}
|
|
171
|
-
var
|
|
221
|
+
var q = b("outline-none data-[focus-visible]:ring-2 focus-visible:ring-2 focus-visible:ring-[var(--primary)]", {
|
|
172
222
|
variants: { variant: {
|
|
173
223
|
hud: "flex items-center gap-2 rounded-full bg-[rgba(30,30,32,.86)] px-4 py-2.5 text-detail font-semibold text-white shadow-[0_8px_30px_black] shadow-black/25 backdrop-blur-xl backdrop-saturate-150",
|
|
174
224
|
banner: "flex w-[min(360px,calc(100vw-32px))] items-start gap-3 rounded-2xl bg-card px-3.5 py-3 text-foreground shadow-[0_10px_34px_--alpha(black/16%),0_0_0_.5px_var(--border)]"
|
|
175
225
|
} },
|
|
176
226
|
defaultVariants: { variant: "banner" }
|
|
177
|
-
}),
|
|
227
|
+
}), J = b("grid shrink-0 place-items-center", {
|
|
178
228
|
variants: { tone: {
|
|
179
229
|
default: "text-primary",
|
|
180
230
|
success: "text-success",
|
|
@@ -182,7 +232,7 @@ var L = v("outline-none data-[focus-visible]:ring-2 focus-visible:ring-2 focus-v
|
|
|
182
232
|
destructive: "text-destructive"
|
|
183
233
|
} },
|
|
184
234
|
defaultVariants: { tone: "default" }
|
|
185
|
-
}),
|
|
235
|
+
}), Y = {
|
|
186
236
|
hud: {
|
|
187
237
|
default: null,
|
|
188
238
|
success: "check",
|
|
@@ -196,35 +246,81 @@ var L = v("outline-none data-[focus-visible]:ring-2 focus-visible:ring-2 focus-v
|
|
|
196
246
|
destructive: "xmark-circle-fill"
|
|
197
247
|
}
|
|
198
248
|
};
|
|
199
|
-
function
|
|
249
|
+
function X({ data: t, size: n }) {
|
|
200
250
|
let r = t.tone ?? "default";
|
|
201
|
-
if (t.loading) return /* @__PURE__ */
|
|
251
|
+
if (t.loading) return /* @__PURE__ */ g("span", {
|
|
202
252
|
"aria-hidden": "true",
|
|
203
253
|
className: e("inline-block shrink-0 animate-spin rounded-full border-2 border-current border-r-transparent opacity-80 motion-reduce:animate-[spin_2s_linear_infinite]", n === 16 ? "size-[14px]" : "size-[18px]")
|
|
204
254
|
});
|
|
205
|
-
let a = t.icon ??
|
|
206
|
-
return a == null ? null : /* @__PURE__ */
|
|
255
|
+
let a = t.icon ?? Y[t.variant ?? "banner"][r];
|
|
256
|
+
return a == null ? null : /* @__PURE__ */ g("span", {
|
|
207
257
|
"aria-hidden": "true",
|
|
208
|
-
className:
|
|
209
|
-
children: typeof a == "string" ? /* @__PURE__ */
|
|
258
|
+
className: J({ tone: r }),
|
|
259
|
+
children: typeof a == "string" ? /* @__PURE__ */ g(i, {
|
|
210
260
|
name: a,
|
|
211
261
|
size: n,
|
|
212
262
|
sw: t.variant === "hud" ? 2.6 : 2.2
|
|
213
263
|
}) : a
|
|
214
264
|
});
|
|
215
265
|
}
|
|
216
|
-
function
|
|
217
|
-
let
|
|
266
|
+
function Z({ toast: t, state: n, aria: a, cardRef: o, className: s, behind: c }) {
|
|
267
|
+
let { toastProps: l, contentProps: u, titleProps: d, descriptionProps: f, closeButtonProps: p } = a, m = t.content.data, h = m.variant === "hud", { onPress: y, ...b } = p;
|
|
268
|
+
return /* @__PURE__ */ _("div", {
|
|
269
|
+
...l,
|
|
270
|
+
ref: o,
|
|
271
|
+
"data-slot": "toast",
|
|
272
|
+
"data-variant": m.variant,
|
|
273
|
+
"data-tone": m.tone ?? "default",
|
|
274
|
+
"data-behind": c || void 0,
|
|
275
|
+
className: e(q({ variant: h ? "hud" : "banner" }), s),
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ g(X, {
|
|
278
|
+
data: m,
|
|
279
|
+
size: h ? 16 : 20
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ _("div", {
|
|
282
|
+
...u,
|
|
283
|
+
className: e("min-w-0", !h && "flex-1 pt-px"),
|
|
284
|
+
children: [/* @__PURE__ */ g("div", {
|
|
285
|
+
...d,
|
|
286
|
+
className: e(h ? "whitespace-nowrap" : "text-subhead font-semibold leading-snug"),
|
|
287
|
+
children: h ? /* @__PURE__ */ g(r, { children: m.title }) : m.title
|
|
288
|
+
}), !h && m.description ? /* @__PURE__ */ g("div", {
|
|
289
|
+
...f,
|
|
290
|
+
className: "mt-0.5 text-[13.5px] leading-snug text-muted-foreground",
|
|
291
|
+
children: m.description
|
|
292
|
+
}) : null]
|
|
293
|
+
}),
|
|
294
|
+
!h && m.action ? /* @__PURE__ */ g(v, {
|
|
295
|
+
onPress: () => {
|
|
296
|
+
m.action.onAction() !== !1 && n.close(t.key);
|
|
297
|
+
},
|
|
298
|
+
className: "bl-btn shrink-0 cursor-pointer self-center rounded-full border-0 bg-secondary px-3 py-1.5 text-[13.5px] font-semibold text-primary outline-none transition-[background-color,scale] duration-spring-snappy ease-spring-snappy hover:bg-secondary-strong active:scale-95 data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--primary)]",
|
|
299
|
+
children: m.action.label
|
|
300
|
+
}) : null,
|
|
301
|
+
!h && m.dismissible !== !1 ? /* @__PURE__ */ g(v, {
|
|
302
|
+
...b,
|
|
303
|
+
onPress: y,
|
|
304
|
+
className: "bl-btn -mt-0.5 -mr-1 grid size-7 shrink-0 cursor-pointer place-items-center rounded-full border-0 bg-transparent text-muted-foreground outline-none transition-colors hover:bg-secondary hover:text-foreground data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--primary)]",
|
|
305
|
+
children: /* @__PURE__ */ g(i, {
|
|
306
|
+
name: "x",
|
|
307
|
+
size: 14,
|
|
308
|
+
sw: 2.2
|
|
309
|
+
})
|
|
310
|
+
}) : null
|
|
311
|
+
]
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
function Q({ toast: e, state: r, fromTop: i }) {
|
|
315
|
+
let a = p(null), c = T({ toast: e }, r, a), l = s(), u = l ? { opacity: 0 } : {
|
|
218
316
|
opacity: 0,
|
|
219
|
-
y:
|
|
220
|
-
scale:
|
|
317
|
+
y: i ? -16 : 16,
|
|
318
|
+
scale: .85,
|
|
221
319
|
filter: "blur(4px)"
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
layout: !x && "position",
|
|
227
|
-
initial: w,
|
|
320
|
+
};
|
|
321
|
+
return /* @__PURE__ */ g(o.div, {
|
|
322
|
+
layout: !l && "position",
|
|
323
|
+
initial: u,
|
|
228
324
|
animate: {
|
|
229
325
|
opacity: 1,
|
|
230
326
|
y: 0,
|
|
@@ -232,71 +328,99 @@ function V({ toast: a, state: c, fromTop: l }) {
|
|
|
232
328
|
filter: "blur(0px)"
|
|
233
329
|
},
|
|
234
330
|
exit: {
|
|
235
|
-
...
|
|
236
|
-
transition:
|
|
331
|
+
...u,
|
|
332
|
+
transition: l ? { duration: .12 } : {
|
|
237
333
|
...t.out,
|
|
238
334
|
y: n.snappy,
|
|
239
335
|
scale: n.snappy
|
|
240
336
|
}
|
|
241
337
|
},
|
|
242
|
-
transition:
|
|
338
|
+
transition: l ? { duration: .15 } : {
|
|
243
339
|
default: t.in,
|
|
244
340
|
y: n.snappy,
|
|
245
341
|
scale: n.bouncy,
|
|
246
342
|
layout: n.smooth
|
|
247
343
|
},
|
|
248
|
-
|
|
344
|
+
className: "pointer-events-auto",
|
|
345
|
+
children: /* @__PURE__ */ g(Z, {
|
|
346
|
+
toast: e,
|
|
347
|
+
state: r,
|
|
348
|
+
aria: c,
|
|
349
|
+
cardRef: a
|
|
350
|
+
})
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
function ee({ toast: r, state: i, edge: a, index: c, spread: l, offset: u, frontHeight: d, height: m, onHeight: h }) {
|
|
354
|
+
let _ = p(null), v = T({ toast: r }, i, _), y = s();
|
|
355
|
+
f(() => {
|
|
356
|
+
let e = _.current;
|
|
357
|
+
if (!e) return;
|
|
358
|
+
let t = () => h(r.key, e.offsetHeight);
|
|
359
|
+
if (t(), typeof ResizeObserver > "u") return;
|
|
360
|
+
let n = new ResizeObserver(t);
|
|
361
|
+
return n.observe(e), () => n.disconnect();
|
|
362
|
+
}, [r.key, h]);
|
|
363
|
+
let b = a === "bottom" ? -1 : 1, x = !l && c > 0, S = Math.min(c, 2), C = y ? { opacity: 0 } : {
|
|
364
|
+
opacity: 0,
|
|
365
|
+
y: -b * 28,
|
|
366
|
+
scale: .96,
|
|
367
|
+
filter: "blur(4px)"
|
|
368
|
+
}, w = y ? {
|
|
369
|
+
opacity: 0,
|
|
370
|
+
transition: { duration: .12 }
|
|
371
|
+
} : c === 0 ? {
|
|
372
|
+
opacity: 0,
|
|
373
|
+
y: -b * 20,
|
|
374
|
+
scale: .96,
|
|
375
|
+
filter: "blur(4px)",
|
|
376
|
+
transition: {
|
|
377
|
+
...t.out,
|
|
378
|
+
y: n.snappy,
|
|
379
|
+
scale: n.snappy
|
|
380
|
+
}
|
|
381
|
+
} : {
|
|
382
|
+
opacity: 0,
|
|
383
|
+
scale: .92,
|
|
384
|
+
transition: t.out
|
|
385
|
+
};
|
|
386
|
+
return /* @__PURE__ */ g(o.div, {
|
|
387
|
+
"data-slot": "toast-layer",
|
|
388
|
+
"data-index": c,
|
|
389
|
+
className: e("absolute inset-x-0 flex flex-col", a === "bottom" ? "bottom-0 justify-start origin-top" : "top-0 justify-end origin-bottom", x ? "pointer-events-none overflow-hidden rounded-2xl" : "pointer-events-auto"),
|
|
390
|
+
style: { zIndex: 100 - c },
|
|
391
|
+
initial: C,
|
|
392
|
+
animate: {
|
|
393
|
+
opacity: !l && c >= W ? 0 : 1,
|
|
394
|
+
y: b * (l ? u : S * H),
|
|
395
|
+
scale: l || y ? 1 : 1 - S * U,
|
|
396
|
+
filter: "blur(0px)",
|
|
397
|
+
height: x ? d : m ?? "auto"
|
|
398
|
+
},
|
|
399
|
+
exit: w,
|
|
400
|
+
transition: y ? { duration: .15 } : {
|
|
401
|
+
default: n.smooth,
|
|
402
|
+
y: n.snappy,
|
|
403
|
+
scale: n.snappy,
|
|
404
|
+
opacity: t.in,
|
|
405
|
+
filter: t.in
|
|
406
|
+
},
|
|
407
|
+
...!x && !y ? {
|
|
249
408
|
drag: "x",
|
|
250
409
|
dragSnapToOrigin: !0,
|
|
251
410
|
dragElastic: .6,
|
|
252
|
-
onDragEnd:
|
|
411
|
+
onDragEnd: (e, t) => {
|
|
412
|
+
(Math.abs(t.offset.x) > 90 || Math.abs(t.velocity.x) > 600) && i.close(r.key);
|
|
413
|
+
}
|
|
253
414
|
} : null,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
"data-
|
|
261
|
-
className: L({ variant: C ? "hud" : "banner" }),
|
|
262
|
-
children: [
|
|
263
|
-
/* @__PURE__ */ m(B, {
|
|
264
|
-
data: S,
|
|
265
|
-
size: C ? 16 : 20
|
|
266
|
-
}),
|
|
267
|
-
/* @__PURE__ */ h("div", {
|
|
268
|
-
...p,
|
|
269
|
-
className: e("min-w-0", !C && "flex-1 pt-px"),
|
|
270
|
-
children: [/* @__PURE__ */ m("div", {
|
|
271
|
-
..._,
|
|
272
|
-
className: e(C ? "whitespace-nowrap" : "text-subhead font-semibold leading-snug"),
|
|
273
|
-
children: C ? /* @__PURE__ */ m(r, { children: S.title }) : S.title
|
|
274
|
-
}), !C && S.description ? /* @__PURE__ */ m("div", {
|
|
275
|
-
...v,
|
|
276
|
-
className: "mt-0.5 text-[13.5px] leading-snug text-muted-foreground",
|
|
277
|
-
children: S.description
|
|
278
|
-
}) : null]
|
|
279
|
-
}),
|
|
280
|
-
!C && S.action ? /* @__PURE__ */ m(g, {
|
|
281
|
-
onPress: () => {
|
|
282
|
-
S.action.onAction() !== !1 && c.close(a.key);
|
|
283
|
-
},
|
|
284
|
-
className: "bl-btn shrink-0 cursor-pointer self-center rounded-full border-0 bg-secondary px-3 py-1.5 text-[13.5px] font-semibold text-primary outline-none transition-[background-color,scale] duration-spring-snappy ease-spring-snappy hover:bg-secondary-strong active:scale-95 data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--primary)]",
|
|
285
|
-
children: S.action.label
|
|
286
|
-
}) : null,
|
|
287
|
-
!C && S.dismissible !== !1 ? /* @__PURE__ */ m(g, {
|
|
288
|
-
...D,
|
|
289
|
-
onPress: E,
|
|
290
|
-
className: "bl-btn -mt-0.5 -mr-1 grid size-7 shrink-0 cursor-pointer place-items-center rounded-full border-0 bg-transparent text-muted-foreground outline-none transition-colors hover:bg-secondary hover:text-foreground data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--primary)]",
|
|
291
|
-
children: /* @__PURE__ */ m(i, {
|
|
292
|
-
name: "x",
|
|
293
|
-
size: 14,
|
|
294
|
-
sw: 2.2
|
|
295
|
-
})
|
|
296
|
-
}) : null
|
|
297
|
-
]
|
|
415
|
+
children: /* @__PURE__ */ g(Z, {
|
|
416
|
+
toast: r,
|
|
417
|
+
state: i,
|
|
418
|
+
aria: v,
|
|
419
|
+
cardRef: _,
|
|
420
|
+
behind: x,
|
|
421
|
+
className: "shrink-0 *:transition-opacity *:duration-150 data-behind:shadow-[inset_0_0_0_.5px_var(--border)] data-behind:*:opacity-0"
|
|
298
422
|
})
|
|
299
423
|
});
|
|
300
424
|
}
|
|
301
425
|
//#endregion
|
|
302
|
-
export {
|
|
426
|
+
export { L as ToastProvider, k as ToastQueue, B as Toaster, j as createToastQueue, A as defaultToastQueue, P as toast, N as toastApi, J as toastIconVariants, q as toastVariants, I as useToast };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Badge } from './badge';
|
|
3
|
+
import { Vault, VaultState, VaultUnsupportedReason } from '../lib/vault';
|
|
4
|
+
/** Why a passkey vault is unavailable, in plain words, with what the person can do about it. */
|
|
5
|
+
export declare function unsupportedMessage(reason: VaultUnsupportedReason | null): {
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
};
|
|
9
|
+
export interface VaultStatusBadgeProps extends Omit<ComponentProps<typeof Badge>, 'variant' | 'children'> {
|
|
10
|
+
vault?: Vault;
|
|
11
|
+
}
|
|
12
|
+
/** A small pill with the vault's status: icon and word, never colour alone. */
|
|
13
|
+
export declare function VaultStatusBadge({ vault, className, ...props }: VaultStatusBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export interface VaultUnsupportedProps extends Omit<ComponentProps<'section'>, 'title'> {
|
|
15
|
+
vault?: Vault;
|
|
16
|
+
}
|
|
17
|
+
/** The honest screen for a browser that cannot do this: what is missing, and that nothing was saved. */
|
|
18
|
+
export declare function VaultUnsupported({ vault, className, ...props }: VaultUnsupportedProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export interface VaultSetupProps extends Omit<ComponentProps<'section'>, 'title'> {
|
|
20
|
+
vault?: Vault;
|
|
21
|
+
appName?: string;
|
|
22
|
+
protects?: ReactNode;
|
|
23
|
+
requireVerification?: boolean;
|
|
24
|
+
/** Called when the button is pressed. Pass it when a parent owns the `PasskeyEnrollDialog` (as `VaultGate` does): the
|
|
25
|
+
* vault becomes `unlocked` the moment the passkey exists, which unmounts this screen, and a dialog rendered inside it
|
|
26
|
+
* would vanish before showing the recovery key. Without it, the screen renders its own dialog. */
|
|
27
|
+
onSetup?: () => void;
|
|
28
|
+
}
|
|
29
|
+
/** The first-run screen: what a passkey vault is, and the button that starts enrollment. */
|
|
30
|
+
export declare function VaultSetup({ vault, appName, protects, requireVerification, onSetup, className, ...props }: VaultSetupProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export interface VaultUnlockProps extends Omit<ComponentProps<'section'>, 'title'> {
|
|
32
|
+
vault?: Vault;
|
|
33
|
+
appName?: string;
|
|
34
|
+
title?: ReactNode;
|
|
35
|
+
description?: ReactNode;
|
|
36
|
+
/** Focus the unlock button when the screen appears (default true: this screen replaces whatever had focus). */
|
|
37
|
+
autoFocus?: boolean;
|
|
38
|
+
onUnlocked?: () => void;
|
|
39
|
+
}
|
|
40
|
+
/** The locked screen: unlock with a passkey, or with the recovery key; and, behind a confirmation, erase the vault. */
|
|
41
|
+
export declare function VaultUnlock({ vault, appName, title, description, autoFocus, onUnlocked, className, ...props }: VaultUnlockProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export interface VaultGateProps {
|
|
43
|
+
vault?: Vault;
|
|
44
|
+
appName?: string;
|
|
45
|
+
/** What the vault protects, for the set-up screen's wording. */
|
|
46
|
+
protects?: ReactNode;
|
|
47
|
+
requireVerification?: boolean;
|
|
48
|
+
/** Replace the screen for a given status. `unsupported` can render `children` to carry on without protection: your call, made visible. */
|
|
49
|
+
loading?: ReactNode;
|
|
50
|
+
unsupported?: ReactNode | ((state: VaultState) => ReactNode);
|
|
51
|
+
empty?: ReactNode;
|
|
52
|
+
locked?: ReactNode;
|
|
53
|
+
/** While unlocked and the recovery key was never confirmed, show a notice with a button to replace it (default true). */
|
|
54
|
+
recoveryNotice?: boolean;
|
|
55
|
+
className?: string;
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
/** Renders `children` only while the vault is unlocked; otherwise the screen the status calls for. */
|
|
59
|
+
export declare function VaultGate({ vault, appName, protects, requireVerification, loading, unsupported, empty, locked, recoveryNotice, className, children, }: VaultGateProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
//# sourceMappingURL=vault-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vault-gate.d.ts","sourceRoot":"","sources":["../../src/components/vault-gate.tsx"],"names":[],"mappings":"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"}
|