@overmap-ai/blocks 0.0.1 → 0.0.2-alpha.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/dist/DropdownMenu/DropdownMenu.d.ts +12 -0
- package/dist/DropdownMenu/index.d.ts +2 -0
- package/dist/DropdownMenu/typings.d.ts +41 -0
- package/dist/Separator/Separator.d.ts +3 -0
- package/dist/Separator/index.d.ts +2 -0
- package/dist/Separator/typings.d.ts +19 -0
- package/dist/Toast/ToastProvider.d.ts +3 -1
- package/dist/blocks.js +516 -422
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +2 -2
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/package.json +2 -1
package/dist/blocks.js
CHANGED
|
@@ -1,371 +1,432 @@
|
|
|
1
1
|
import "@radix-ui/themes/styles.css";
|
|
2
2
|
export * from "@radix-ui/colors";
|
|
3
|
-
import { Cross1Icon as
|
|
3
|
+
import { Cross1Icon as me, InfoCircledIcon as fe, Cross2Icon as ge } from "@radix-ui/react-icons";
|
|
4
4
|
export * from "@radix-ui/react-icons";
|
|
5
|
-
import { useThemeContext as
|
|
6
|
-
import { AccessibleIcon as
|
|
7
|
-
import { jsx as o, jsxs as
|
|
8
|
-
import
|
|
9
|
-
import { Root as
|
|
10
|
-
import * as
|
|
11
|
-
import { ToastProvider as
|
|
12
|
-
function
|
|
13
|
-
return
|
|
5
|
+
import { useThemeContext as Ce, Badge as ve, Button as _e, IconButton as te, Flex as x, Dialog as E, AlertDialog as $, DropdownMenu as D, Select as k, Box as we, Checkbox as Se, Switch as ye, Portal as Te, TextField as V, Text as q, Popover as j, TextArea as xe, Callout as F, Theme as De, Separator as X } from "@radix-ui/themes";
|
|
6
|
+
import { AccessibleIcon as ro, AspectRatio as co, Avatar as so, Blockquote as io, Box as ao, Callout as lo, Card as uo, Checkbox as ho, Code as po, Container as mo, ContextMenu as fo, Em as go, Flex as Co, Grid as vo, Heading as _o, HoverCard as wo, Inset as So, Kbd as yo, Link as To, Portal as xo, Quote as Do, RadioGroup as bo, ScrollArea as Io, Section as ko, Slider as Ro, Slot as $o, Strong as Ao, Table as No, Tabs as Oo, TextField as Eo, Theme as Bo, Tooltip as zo, VisuallyHidden as Po, updateThemeAppearanceClass as Mo, useThemeContext as Lo } from "@radix-ui/themes";
|
|
7
|
+
import { jsx as o, jsxs as g, Fragment as P } from "react/jsx-runtime";
|
|
8
|
+
import M, { useMemo as L, forwardRef as w, memo as C, createContext as U, useContext as Q, useState as R, useCallback as I, createElement as oe, useEffect as ne, useRef as be, useLayoutEffect as Ie } from "react";
|
|
9
|
+
import { Root as ke, Item as Re } from "@radix-ui/react-toggle-group";
|
|
10
|
+
import * as W from "@radix-ui/react-toast";
|
|
11
|
+
import { ToastProvider as $e, ToastViewport as Ae } from "@radix-ui/react-toast";
|
|
12
|
+
function Ne(c) {
|
|
13
|
+
return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
|
|
14
14
|
}
|
|
15
|
-
var
|
|
15
|
+
var re = { exports: {} };
|
|
16
16
|
/*!
|
|
17
17
|
Copyright (c) 2018 Jed Watson.
|
|
18
18
|
Licensed under the MIT License (MIT), see
|
|
19
19
|
http://jedwatson.github.io/classnames
|
|
20
20
|
*/
|
|
21
|
-
(function(
|
|
21
|
+
(function(c) {
|
|
22
22
|
(function() {
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
for (var t = [],
|
|
26
|
-
var e = arguments[
|
|
23
|
+
var i = {}.hasOwnProperty;
|
|
24
|
+
function n() {
|
|
25
|
+
for (var t = [], r = 0; r < arguments.length; r++) {
|
|
26
|
+
var e = arguments[r];
|
|
27
27
|
if (e) {
|
|
28
|
-
var
|
|
29
|
-
if (
|
|
28
|
+
var a = typeof e;
|
|
29
|
+
if (a === "string" || a === "number")
|
|
30
30
|
t.push(e);
|
|
31
31
|
else if (Array.isArray(e)) {
|
|
32
32
|
if (e.length) {
|
|
33
|
-
var s =
|
|
33
|
+
var s = n.apply(null, e);
|
|
34
34
|
s && t.push(s);
|
|
35
35
|
}
|
|
36
|
-
} else if (
|
|
36
|
+
} else if (a === "object") {
|
|
37
37
|
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]")) {
|
|
38
38
|
t.push(e.toString());
|
|
39
39
|
continue;
|
|
40
40
|
}
|
|
41
|
-
for (var
|
|
42
|
-
|
|
41
|
+
for (var u in e)
|
|
42
|
+
i.call(e, u) && e[u] && t.push(u);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
return t.join(" ");
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
c.exports ? (n.default = n, c.exports = n) : window.classNames = n;
|
|
49
49
|
})();
|
|
50
|
-
})(
|
|
51
|
-
var
|
|
52
|
-
const T = /* @__PURE__ */
|
|
53
|
-
function
|
|
54
|
-
return
|
|
55
|
-
if (
|
|
56
|
-
if (typeof
|
|
57
|
-
if (!("initial" in
|
|
50
|
+
})(re);
|
|
51
|
+
var Oe = re.exports;
|
|
52
|
+
const T = /* @__PURE__ */ Ne(Oe);
|
|
53
|
+
function A(c, i) {
|
|
54
|
+
return L(() => {
|
|
55
|
+
if (c !== void 0)
|
|
56
|
+
if (typeof c == "object") {
|
|
57
|
+
if (!("initial" in c))
|
|
58
58
|
throw new Error("Expected initial property to be set in Responsive object");
|
|
59
|
-
return Object.fromEntries(Object.entries(
|
|
59
|
+
return Object.fromEntries(Object.entries(c).map(([n, t]) => [n, i[t]]));
|
|
60
60
|
} else
|
|
61
|
-
return c
|
|
62
|
-
}, [
|
|
61
|
+
return i[c];
|
|
62
|
+
}, [i, c]);
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const Ee = {
|
|
65
65
|
success: "green",
|
|
66
66
|
danger: "red",
|
|
67
67
|
info: "gray"
|
|
68
|
-
}, S = (
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
return
|
|
72
|
-
},
|
|
73
|
-
const s = S(
|
|
68
|
+
}, S = (c) => {
|
|
69
|
+
const i = Ce();
|
|
70
|
+
if (c)
|
|
71
|
+
return c === "primary" ? i.accentColor : Ee[c];
|
|
72
|
+
}, Be = w(function({ className: i, severity: n = "primary", color: t, children: r, ...e }, a) {
|
|
73
|
+
const s = S(n);
|
|
74
74
|
return /* @__PURE__ */ o(
|
|
75
|
-
|
|
75
|
+
ve,
|
|
76
76
|
{
|
|
77
|
-
className: T("overmap-badge",
|
|
78
|
-
ref:
|
|
77
|
+
className: T("overmap-badge", i),
|
|
78
|
+
ref: a,
|
|
79
79
|
color: t || s,
|
|
80
80
|
...e,
|
|
81
|
-
children:
|
|
81
|
+
children: r
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
}),
|
|
85
|
-
fluid:
|
|
86
|
-
hoverSpin90Clockwise:
|
|
87
|
-
hoverSpin180Clockwise:
|
|
88
|
-
hoverSpin360Clockwise:
|
|
89
|
-
},
|
|
90
|
-
spin90Clockwise:
|
|
91
|
-
spin180Clockwise:
|
|
92
|
-
spin360Clockwise:
|
|
93
|
-
},
|
|
84
|
+
}), Pt = C(Be), ze = "_fluid_r73gr_1", Pe = "_hoverSpin90Clockwise_r73gr_15", Me = "_hoverSpin180Clockwise_r73gr_25", Le = "_hoverSpin360Clockwise_r73gr_35", z = {
|
|
85
|
+
fluid: ze,
|
|
86
|
+
hoverSpin90Clockwise: Pe,
|
|
87
|
+
hoverSpin180Clockwise: Me,
|
|
88
|
+
hoverSpin360Clockwise: Le
|
|
89
|
+
}, ce = {
|
|
90
|
+
spin90Clockwise: z.hoverSpin90Clockwise,
|
|
91
|
+
spin180Clockwise: z.hoverSpin180Clockwise,
|
|
92
|
+
spin360Clockwise: z.hoverSpin360Clockwise
|
|
93
|
+
}, G = {
|
|
94
94
|
small: "1",
|
|
95
95
|
medium: "2",
|
|
96
96
|
large: "3"
|
|
97
|
-
},
|
|
98
|
-
const t =
|
|
99
|
-
className:
|
|
97
|
+
}, se = U({}), ie = () => Q(se), Ge = w(function(i, n) {
|
|
98
|
+
const t = ie(), {
|
|
99
|
+
className: r,
|
|
100
100
|
type: e = "button",
|
|
101
|
-
fluid:
|
|
101
|
+
fluid: a = t.fluid ?? !1,
|
|
102
102
|
size: s = t.size ?? "medium",
|
|
103
|
-
severity:
|
|
104
|
-
hoverEffects:
|
|
103
|
+
severity: u = t.severity ?? "primary",
|
|
104
|
+
hoverEffects: l = t.hoverEffects ?? [],
|
|
105
105
|
variant: d = t.variant,
|
|
106
|
-
...
|
|
107
|
-
} =
|
|
106
|
+
...p
|
|
107
|
+
} = i, m = S(u), f = l.map((h) => ce[h]);
|
|
108
108
|
return /* @__PURE__ */ o(
|
|
109
|
-
|
|
109
|
+
_e,
|
|
110
110
|
{
|
|
111
|
-
ref:
|
|
111
|
+
ref: n,
|
|
112
112
|
type: e,
|
|
113
|
-
className: T(
|
|
114
|
-
[
|
|
113
|
+
className: T(r, f, {
|
|
114
|
+
[z.fluid]: a
|
|
115
115
|
}),
|
|
116
116
|
color: m,
|
|
117
|
-
size:
|
|
117
|
+
size: A(s, G),
|
|
118
118
|
variant: d,
|
|
119
|
-
...
|
|
119
|
+
...p
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
|
-
}),
|
|
123
|
-
const t =
|
|
124
|
-
className:
|
|
122
|
+
}), Y = M.memo(Ge), Ve = w(function(i, n) {
|
|
123
|
+
const t = ie(), {
|
|
124
|
+
className: r,
|
|
125
125
|
children: e,
|
|
126
|
-
type:
|
|
126
|
+
type: a = "button",
|
|
127
127
|
fluid: s = t.fluid ?? !1,
|
|
128
|
-
size:
|
|
129
|
-
severity:
|
|
128
|
+
size: u = t.size ?? "medium",
|
|
129
|
+
severity: l = t.severity ?? "primary",
|
|
130
130
|
hoverEffects: d = t.hoverEffects ?? [],
|
|
131
|
-
variant:
|
|
131
|
+
variant: p = t.variant,
|
|
132
132
|
...m
|
|
133
|
-
} =
|
|
133
|
+
} = i, f = S(l), h = (d == null ? void 0 : d.map((v) => ce[v])) || [];
|
|
134
134
|
return /* @__PURE__ */ o(
|
|
135
|
-
|
|
135
|
+
te,
|
|
136
136
|
{
|
|
137
|
-
className: T(
|
|
138
|
-
[
|
|
137
|
+
className: T(r, h, {
|
|
138
|
+
[z.fluid]: s
|
|
139
139
|
}),
|
|
140
|
-
ref:
|
|
140
|
+
ref: n,
|
|
141
141
|
color: f,
|
|
142
|
-
size:
|
|
143
|
-
variant:
|
|
144
|
-
type:
|
|
142
|
+
size: A(u, G),
|
|
143
|
+
variant: p,
|
|
144
|
+
type: a,
|
|
145
145
|
...m,
|
|
146
146
|
children: e
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
|
-
}),
|
|
149
|
+
}), ae = M.memo(Ve), je = "_merged_f4366_1", Fe = {
|
|
150
150
|
merged: je
|
|
151
|
-
},
|
|
151
|
+
}, We = {
|
|
152
152
|
row: { small: "4", medium: "4", large: "5" },
|
|
153
153
|
column: { small: "2", medium: "3", large: "4" }
|
|
154
|
-
},
|
|
155
|
-
className:
|
|
156
|
-
merged:
|
|
154
|
+
}, He = w(function({
|
|
155
|
+
className: i,
|
|
156
|
+
merged: n = !1,
|
|
157
157
|
children: t,
|
|
158
|
-
gap:
|
|
158
|
+
gap: r,
|
|
159
159
|
direction: e = "row",
|
|
160
|
-
severity:
|
|
160
|
+
severity: a,
|
|
161
161
|
size: s = "medium",
|
|
162
|
-
variant:
|
|
163
|
-
hoverEffects:
|
|
162
|
+
variant: u,
|
|
163
|
+
hoverEffects: l,
|
|
164
164
|
fluid: d,
|
|
165
|
-
...
|
|
165
|
+
...p
|
|
166
166
|
}, m) {
|
|
167
|
-
const f =
|
|
167
|
+
const f = A(s, We[e]), h = u === "ghost" ? f : "0";
|
|
168
168
|
return /* @__PURE__ */ o(
|
|
169
169
|
x,
|
|
170
170
|
{
|
|
171
|
-
className: T("overmap-button-group",
|
|
172
|
-
[
|
|
171
|
+
className: T("overmap-button-group", i, {
|
|
172
|
+
[Fe.merged]: n
|
|
173
173
|
}),
|
|
174
174
|
ref: m,
|
|
175
|
-
gap:
|
|
175
|
+
gap: n ? r ?? h : r ?? "2",
|
|
176
176
|
direction: e,
|
|
177
177
|
"data-direction": e,
|
|
178
|
-
...
|
|
179
|
-
children: /* @__PURE__ */ o(
|
|
178
|
+
...p,
|
|
179
|
+
children: /* @__PURE__ */ o(se.Provider, { value: { size: s, severity: a, variant: u, hoverEffects: l, fluid: d }, children: t })
|
|
180
180
|
}
|
|
181
181
|
);
|
|
182
|
-
}),
|
|
183
|
-
const { title:
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */ o(
|
|
188
|
-
/* @__PURE__ */ o(
|
|
182
|
+
}), qe = C(He), Ke = C(function(i) {
|
|
183
|
+
const { title: n, description: t, content: r, closeDialog: e } = i;
|
|
184
|
+
return /* @__PURE__ */ g(x, { direction: "column", gap: "2", children: [
|
|
185
|
+
/* @__PURE__ */ g(x, { direction: "column", gap: "1", children: [
|
|
186
|
+
/* @__PURE__ */ g(x, { justify: "between", children: [
|
|
187
|
+
/* @__PURE__ */ o(E.Title, { mb: "0", children: n }),
|
|
188
|
+
/* @__PURE__ */ o(E.Close, { children: /* @__PURE__ */ o(te, { color: "gray", variant: "ghost", "aria-label": "Close", children: /* @__PURE__ */ o(me, {}) }) })
|
|
189
189
|
] }),
|
|
190
|
-
/* @__PURE__ */ o(
|
|
190
|
+
/* @__PURE__ */ o(E.Description, { children: t })
|
|
191
191
|
] }),
|
|
192
|
-
|
|
192
|
+
r(e)
|
|
193
193
|
] });
|
|
194
|
-
}),
|
|
195
|
-
const { children:
|
|
196
|
-
(
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
else if (!
|
|
200
|
-
return e(() =>
|
|
201
|
-
p
|
|
194
|
+
}), Mt = C(function(i) {
|
|
195
|
+
const { children: n, size: t, onOpen: r, onCloseInterrupt: e, ...a } = i, [s, u] = R(!1), l = I(
|
|
196
|
+
(p) => {
|
|
197
|
+
if (p && r)
|
|
198
|
+
r();
|
|
199
|
+
else if (!p && e)
|
|
200
|
+
return e(() => u(!1));
|
|
201
|
+
u(p);
|
|
202
202
|
},
|
|
203
|
-
[
|
|
204
|
-
), d =
|
|
205
|
-
(
|
|
206
|
-
if (
|
|
207
|
-
return
|
|
208
|
-
|
|
203
|
+
[r, e]
|
|
204
|
+
), d = I(
|
|
205
|
+
(p) => {
|
|
206
|
+
if (p != null && p.force)
|
|
207
|
+
return u(!1);
|
|
208
|
+
l(!1);
|
|
209
209
|
},
|
|
210
|
-
[
|
|
210
|
+
[l]
|
|
211
211
|
);
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */ o(
|
|
214
|
-
|
|
212
|
+
return /* @__PURE__ */ g(E.Root, { open: s, onOpenChange: l, children: [
|
|
213
|
+
/* @__PURE__ */ o(E.Content, { size: t, children: /* @__PURE__ */ o(Ke, { closeDialog: d, ...a }) }),
|
|
214
|
+
n(E.Trigger)
|
|
215
215
|
] });
|
|
216
|
-
}),
|
|
217
|
-
const { title:
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */ o(
|
|
221
|
-
/* @__PURE__ */ o(
|
|
216
|
+
}), le = (c) => /* @__PURE__ */ o($.Title, { mb: "0", ...c }), Ue = (c) => {
|
|
217
|
+
const { title: i, description: n, actionText: t = "Confirm", cancelText: r = "Cancel", onAction: e, onCancel: a, severity: s } = c;
|
|
218
|
+
return /* @__PURE__ */ g(x, { direction: "column", gap: "2", children: [
|
|
219
|
+
/* @__PURE__ */ g(x, { direction: "column", gap: "1", children: [
|
|
220
|
+
/* @__PURE__ */ o(le, { children: i }),
|
|
221
|
+
/* @__PURE__ */ o($.Description, { children: n })
|
|
222
222
|
] }),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */ o(
|
|
225
|
-
/* @__PURE__ */ o(
|
|
223
|
+
/* @__PURE__ */ g(x, { gap: "3", mt: "4", justify: "end", children: [
|
|
224
|
+
/* @__PURE__ */ o($.Cancel, { children: /* @__PURE__ */ o(Y, { variant: "soft", severity: "info", onClick: a, children: r }) }),
|
|
225
|
+
/* @__PURE__ */ o($.Action, { children: /* @__PURE__ */ o(Y, { variant: "solid", severity: s, onClick: e, children: t }) })
|
|
226
226
|
] })
|
|
227
227
|
] });
|
|
228
|
-
},
|
|
229
|
-
const { open:
|
|
228
|
+
}, Qe = C(function(i) {
|
|
229
|
+
const { open: n, setOpen: t, children: r, ...e } = i, a = L(() => ({
|
|
230
230
|
close: () => t(!1),
|
|
231
|
-
Title:
|
|
232
|
-
Description:
|
|
231
|
+
Title: le,
|
|
232
|
+
Description: $.Description
|
|
233
233
|
}), [t]);
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */ o(
|
|
236
|
-
|
|
234
|
+
return /* @__PURE__ */ g($.Root, { open: n, onOpenChange: t, children: [
|
|
235
|
+
/* @__PURE__ */ o($.Content, { children: "content" in e ? e.content(a) : /* @__PURE__ */ o(Ue, { ...e }) }),
|
|
236
|
+
r
|
|
237
237
|
] });
|
|
238
|
-
}),
|
|
238
|
+
}), ue = U(() => {
|
|
239
239
|
throw new Error("No AlertDialogProvider found");
|
|
240
|
-
}),
|
|
240
|
+
}), Je = {
|
|
241
241
|
content: () => null
|
|
242
|
-
},
|
|
243
|
-
const [
|
|
242
|
+
}, Lt = C(function({ children: i }) {
|
|
243
|
+
const [n, t] = R(!1), [r, e] = R(Je), a = I(
|
|
244
244
|
(s) => {
|
|
245
|
-
if (
|
|
245
|
+
if (n)
|
|
246
246
|
throw new Error("AlertDialog is already open");
|
|
247
247
|
e(s), t(!0);
|
|
248
248
|
},
|
|
249
|
-
[
|
|
249
|
+
[n]
|
|
250
250
|
);
|
|
251
|
-
return /* @__PURE__ */ o(
|
|
252
|
-
}),
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
251
|
+
return /* @__PURE__ */ o(Qe, { open: n, setOpen: t, ...r, children: /* @__PURE__ */ o(ue.Provider, { value: a, children: i }) });
|
|
252
|
+
}), Gt = () => Q(ue), Xe = C(function({
|
|
253
|
+
severity: i,
|
|
254
|
+
itemContent: n,
|
|
255
|
+
closeOnSelect: t = !0,
|
|
256
|
+
onSelect: r,
|
|
257
|
+
...e
|
|
258
|
+
}) {
|
|
259
|
+
const a = S(i), s = I(
|
|
260
|
+
(u) => {
|
|
261
|
+
t || u.preventDefault(), r && r(u);
|
|
262
|
+
},
|
|
263
|
+
[t, r]
|
|
264
|
+
);
|
|
265
|
+
return /* @__PURE__ */ o(D.Item, { onSelect: s, color: a, ...e, children: n });
|
|
266
|
+
}), Ye = C(function({
|
|
267
|
+
defaultOpen: i,
|
|
268
|
+
open: n,
|
|
269
|
+
onOpenChange: t,
|
|
270
|
+
modal: r,
|
|
271
|
+
trigger: e,
|
|
272
|
+
label: a,
|
|
273
|
+
severity: s = "info",
|
|
274
|
+
children: u,
|
|
275
|
+
...l
|
|
276
|
+
}) {
|
|
277
|
+
const d = S(s);
|
|
278
|
+
return /* @__PURE__ */ g(D.Root, { defaultOpen: i, open: n, onOpenChange: t, modal: r, children: [
|
|
279
|
+
/* @__PURE__ */ o(D.Trigger, { children: e }),
|
|
280
|
+
/* @__PURE__ */ g(D.Content, { color: d, ...l, children: [
|
|
281
|
+
a && /* @__PURE__ */ o(D.Label, { children: a }),
|
|
282
|
+
u
|
|
283
|
+
] })
|
|
284
|
+
] });
|
|
285
|
+
}), Ze = C(function({
|
|
286
|
+
separatorBelow: i = !1,
|
|
287
|
+
separatorAbove: n = !1,
|
|
288
|
+
children: t,
|
|
289
|
+
...r
|
|
290
|
+
}) {
|
|
291
|
+
return /* @__PURE__ */ g(P, { children: [
|
|
292
|
+
n && /* @__PURE__ */ o(D.Separator, {}),
|
|
293
|
+
/* @__PURE__ */ o(D.Group, { ...r, children: t }),
|
|
294
|
+
i && /* @__PURE__ */ o(D.Separator, {})
|
|
295
|
+
] });
|
|
296
|
+
}), et = C(function({
|
|
297
|
+
defaultOpen: i,
|
|
298
|
+
open: n,
|
|
299
|
+
onOpenChange: t,
|
|
300
|
+
trigger: r,
|
|
301
|
+
children: e,
|
|
302
|
+
...a
|
|
303
|
+
}) {
|
|
304
|
+
return /* @__PURE__ */ g(D.Sub, { defaultOpen: i, open: n, onOpenChange: t, children: [
|
|
305
|
+
/* @__PURE__ */ o(D.SubTrigger, { children: r }),
|
|
306
|
+
/* @__PURE__ */ o(D.SubContent, { ...a, children: e })
|
|
307
|
+
] });
|
|
308
|
+
}), Vt = {
|
|
309
|
+
Root: Ye,
|
|
310
|
+
ItemGroup: Ze,
|
|
311
|
+
Item: Xe,
|
|
312
|
+
SubMenu: et
|
|
313
|
+
}, tt = "_fluid_7n1wr_1", ot = {
|
|
314
|
+
fluid: tt
|
|
315
|
+
}, nt = w(function({
|
|
316
|
+
className: i,
|
|
317
|
+
fluid: n,
|
|
257
318
|
size: t = "medium",
|
|
258
|
-
variant:
|
|
319
|
+
variant: r = "surface",
|
|
259
320
|
severity: e = "primary",
|
|
260
|
-
itemSeverity:
|
|
321
|
+
itemSeverity: a = "info",
|
|
261
322
|
placeholder: s = "Select",
|
|
262
|
-
side:
|
|
263
|
-
items:
|
|
323
|
+
side: u,
|
|
324
|
+
items: l = [],
|
|
264
325
|
value: d,
|
|
265
|
-
id:
|
|
326
|
+
id: p,
|
|
266
327
|
...m
|
|
267
328
|
}, f) {
|
|
268
|
-
const
|
|
269
|
-
return /* @__PURE__ */
|
|
270
|
-
|
|
329
|
+
const h = A(t, G), v = S(e), y = S(a);
|
|
330
|
+
return /* @__PURE__ */ oe(k.Root, { size: h, ...m, key: d === void 0 ? 1 : 0, value: d }, /* @__PURE__ */ o(
|
|
331
|
+
k.Trigger,
|
|
271
332
|
{
|
|
272
|
-
className: T(
|
|
273
|
-
[
|
|
333
|
+
className: T(i, {
|
|
334
|
+
[ot.fluid]: n
|
|
274
335
|
}),
|
|
275
|
-
id:
|
|
336
|
+
id: p,
|
|
276
337
|
ref: f,
|
|
277
|
-
variant:
|
|
338
|
+
variant: r,
|
|
278
339
|
placeholder: s,
|
|
279
|
-
color:
|
|
340
|
+
color: v
|
|
280
341
|
}
|
|
281
342
|
), /* @__PURE__ */ o(
|
|
282
|
-
|
|
343
|
+
k.Content,
|
|
283
344
|
{
|
|
284
|
-
side:
|
|
345
|
+
side: u,
|
|
285
346
|
position: "popper",
|
|
286
|
-
variant:
|
|
347
|
+
variant: r !== "surface" ? "soft" : "solid",
|
|
287
348
|
color: y,
|
|
288
|
-
children:
|
|
349
|
+
children: l.map(({ itemContent: b, value: N, ...B }) => /* @__PURE__ */ o(k.Item, { className: "overmap-select-item", value: N, ...B, children: b }, N))
|
|
289
350
|
}
|
|
290
351
|
));
|
|
291
|
-
}),
|
|
292
|
-
|
|
293
|
-
const { checked:
|
|
294
|
-
return /* @__PURE__ */ o(
|
|
295
|
-
/* @__PURE__ */ o(
|
|
352
|
+
}), jt = M.memo(nt), Z = C(
|
|
353
|
+
w((c, i) => {
|
|
354
|
+
const { checked: n, label: t, value: r, size: e = "2" } = c;
|
|
355
|
+
return /* @__PURE__ */ o(we, { asChild: !0, px: e, children: /* @__PURE__ */ o(k.Item, { value: r, ref: i, children: /* @__PURE__ */ g(x, { gap: e, align: "center", children: [
|
|
356
|
+
/* @__PURE__ */ o(Se, { checked: n }),
|
|
296
357
|
t
|
|
297
358
|
] }) }) });
|
|
298
359
|
})
|
|
299
|
-
),
|
|
300
|
-
|
|
301
|
-
const [
|
|
360
|
+
), H = "__select_all__", Ft = C(
|
|
361
|
+
w((c, i) => {
|
|
362
|
+
const [n, t] = R(!1), { placeholder: r, value: e, onValueChange: a, options: s, disabled: u, id: l, radius: d, variant: p, name: m } = c, f = A(c.size, G), h = S(c.severity), v = L(() => new Map(s.map((_) => [_.value, _.label])), [s]), y = e.length > 4 ? (
|
|
302
363
|
// to ensure the width of the select doesn't get too big
|
|
303
364
|
`${e.length} options selected`
|
|
304
365
|
) : (
|
|
305
366
|
// convert the values to labels
|
|
306
|
-
e.map((
|
|
307
|
-
),
|
|
308
|
-
|
|
309
|
-
}, []),
|
|
310
|
-
(
|
|
311
|
-
let
|
|
312
|
-
|
|
367
|
+
e.map((_) => v.get(_)).join(", ")
|
|
368
|
+
), b = I(() => t(!1), []), N = I((_) => {
|
|
369
|
+
_ && t(!0);
|
|
370
|
+
}, []), B = I(
|
|
371
|
+
(_) => {
|
|
372
|
+
let K;
|
|
373
|
+
_ === H ? K = e.length === s.length ? [] : s.map((pe) => pe.value) : K = e.includes(_) ? e.filter((J) => J !== _) : [...e, _], a(K);
|
|
313
374
|
},
|
|
314
|
-
[
|
|
375
|
+
[a, s, e]
|
|
315
376
|
);
|
|
316
|
-
return
|
|
317
|
-
if (s.some(({ value:
|
|
318
|
-
throw new Error(`Cannot have an option with the value "${
|
|
319
|
-
}, [s]), /* @__PURE__ */
|
|
320
|
-
|
|
377
|
+
return ne(() => {
|
|
378
|
+
if (s.some(({ value: _ }) => _ === H))
|
|
379
|
+
throw new Error(`Cannot have an option with the value "${H}"`);
|
|
380
|
+
}, [s]), /* @__PURE__ */ g(
|
|
381
|
+
k.Root,
|
|
321
382
|
{
|
|
322
|
-
open:
|
|
383
|
+
open: n,
|
|
323
384
|
value: "",
|
|
324
|
-
onOpenChange:
|
|
325
|
-
onValueChange:
|
|
326
|
-
disabled:
|
|
385
|
+
onOpenChange: N,
|
|
386
|
+
onValueChange: B,
|
|
387
|
+
disabled: u,
|
|
327
388
|
size: f,
|
|
328
389
|
name: m,
|
|
329
390
|
autoComplete: "off",
|
|
330
391
|
children: [
|
|
331
392
|
/* @__PURE__ */ o(
|
|
332
|
-
|
|
393
|
+
k.Trigger,
|
|
333
394
|
{
|
|
334
|
-
ref:
|
|
335
|
-
id:
|
|
395
|
+
ref: i,
|
|
396
|
+
id: l,
|
|
336
397
|
radius: d,
|
|
337
|
-
variant:
|
|
338
|
-
color:
|
|
339
|
-
placeholder: e.length > 0 ? y :
|
|
398
|
+
variant: p,
|
|
399
|
+
color: h,
|
|
400
|
+
placeholder: e.length > 0 ? y : r,
|
|
340
401
|
"data-placeholder": e.length > 0 ? void 0 : !0
|
|
341
402
|
}
|
|
342
403
|
),
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
|
|
404
|
+
/* @__PURE__ */ g(
|
|
405
|
+
k.Content,
|
|
345
406
|
{
|
|
346
407
|
color: "gray",
|
|
347
408
|
variant: "soft",
|
|
348
409
|
position: "popper",
|
|
349
|
-
onEscapeKeyDown:
|
|
350
|
-
onPointerDownOutside:
|
|
410
|
+
onEscapeKeyDown: b,
|
|
411
|
+
onPointerDownOutside: b,
|
|
351
412
|
children: [
|
|
352
413
|
/* @__PURE__ */ o(
|
|
353
|
-
|
|
414
|
+
Z,
|
|
354
415
|
{
|
|
355
|
-
value:
|
|
416
|
+
value: H,
|
|
356
417
|
label: "Select all",
|
|
357
418
|
checked: e.length === s.length,
|
|
358
419
|
size: f
|
|
359
420
|
}
|
|
360
421
|
),
|
|
361
|
-
s.map((
|
|
362
|
-
|
|
422
|
+
s.map((_) => /* @__PURE__ */ o(
|
|
423
|
+
Z,
|
|
363
424
|
{
|
|
364
|
-
...
|
|
365
|
-
checked: e.includes(
|
|
425
|
+
..._,
|
|
426
|
+
checked: e.includes(_.value),
|
|
366
427
|
size: f
|
|
367
428
|
},
|
|
368
|
-
|
|
429
|
+
_.value
|
|
369
430
|
))
|
|
370
431
|
]
|
|
371
432
|
}
|
|
@@ -374,307 +435,340 @@ const Ne = {
|
|
|
374
435
|
}
|
|
375
436
|
);
|
|
376
437
|
})
|
|
377
|
-
),
|
|
438
|
+
), rt = {
|
|
378
439
|
default: "_default_u936h_1"
|
|
379
|
-
},
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
var
|
|
383
|
-
const y = s ||
|
|
384
|
-
"current" in y && y.current && m((
|
|
440
|
+
}, ct = w(function({ className: i, severity: n = "primary", icon: t, defaultChecked: r = !1, onCheckedChange: e, ...a }, s) {
|
|
441
|
+
const u = be(null), [l, d] = R(a.checked ? a.checked : r), [p, m] = R(), f = S(n);
|
|
442
|
+
Ie(() => {
|
|
443
|
+
var b;
|
|
444
|
+
const y = s || u;
|
|
445
|
+
"current" in y && y.current && m((b = y.current) == null ? void 0 : b.querySelector("span.rt-SwitchThumb"));
|
|
385
446
|
}, [s]);
|
|
386
|
-
const
|
|
447
|
+
const h = I(
|
|
387
448
|
(y) => {
|
|
388
449
|
d(y), e && e(y);
|
|
389
450
|
},
|
|
390
451
|
[e]
|
|
391
|
-
),
|
|
392
|
-
return /* @__PURE__ */
|
|
452
|
+
), v = a.checked ? a.checked : l;
|
|
453
|
+
return /* @__PURE__ */ g(P, { children: [
|
|
393
454
|
/* @__PURE__ */ o(
|
|
394
|
-
|
|
455
|
+
ye,
|
|
395
456
|
{
|
|
396
|
-
className: T("overmap-switch",
|
|
397
|
-
ref: s ||
|
|
457
|
+
className: T("overmap-switch", i, rt.default),
|
|
458
|
+
ref: s || u,
|
|
398
459
|
color: f,
|
|
399
460
|
radius: "full",
|
|
400
|
-
defaultChecked:
|
|
401
|
-
onCheckedChange:
|
|
402
|
-
...
|
|
461
|
+
defaultChecked: r,
|
|
462
|
+
onCheckedChange: h,
|
|
463
|
+
...a
|
|
403
464
|
}
|
|
404
465
|
),
|
|
405
|
-
/* @__PURE__ */ o(
|
|
466
|
+
/* @__PURE__ */ o(Te, { container: p, asChild: !0, children: t && "checked" in t ? v ? t.checked : t.unchecked : t })
|
|
406
467
|
] });
|
|
407
|
-
})
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
accommodateCharCount: et,
|
|
411
|
-
wrapper: tt,
|
|
468
|
+
}), Wt = C(ct), st = "_accommodateCharCount_sr18k_1", it = "_wrapper_sr18k_5", at = "_noLeftIcon_sr18k_13", lt = "_noRightIcon_sr18k_17", ut = "_charCount_sr18k_21", O = {
|
|
469
|
+
accommodateCharCount: st,
|
|
470
|
+
wrapper: it,
|
|
412
471
|
default: "_default_sr18k_9",
|
|
413
|
-
noLeftIcon:
|
|
414
|
-
noRightIcon:
|
|
415
|
-
charCount:
|
|
416
|
-
},
|
|
417
|
-
className:
|
|
418
|
-
leftSlot:
|
|
472
|
+
noLeftIcon: at,
|
|
473
|
+
noRightIcon: lt,
|
|
474
|
+
charCount: ut
|
|
475
|
+
}, dt = w(function({
|
|
476
|
+
className: i,
|
|
477
|
+
leftSlot: n,
|
|
419
478
|
rightSlot: t,
|
|
420
|
-
size:
|
|
479
|
+
size: r = "medium",
|
|
421
480
|
showInputLength: e,
|
|
422
|
-
value:
|
|
481
|
+
value: a,
|
|
423
482
|
variant: s,
|
|
424
|
-
severity:
|
|
425
|
-
...
|
|
483
|
+
severity: u = "primary",
|
|
484
|
+
...l
|
|
426
485
|
}, d) {
|
|
427
|
-
const
|
|
428
|
-
return /* @__PURE__ */
|
|
486
|
+
const p = A(r, G), m = S(u), f = e || e === void 0 && l.maxLength !== void 0, h = a !== void 0 ? a.toString() : void 0;
|
|
487
|
+
return /* @__PURE__ */ g(
|
|
429
488
|
V.Root,
|
|
430
489
|
{
|
|
431
|
-
className: T(
|
|
432
|
-
[
|
|
490
|
+
className: T(O.wrapper, {
|
|
491
|
+
[O.accommodateCharCount]: f
|
|
433
492
|
}),
|
|
434
|
-
size:
|
|
493
|
+
size: p,
|
|
435
494
|
variant: s,
|
|
436
495
|
color: m,
|
|
437
496
|
children: [
|
|
438
|
-
|
|
497
|
+
n && /* @__PURE__ */ o(V.Slot, { children: n }),
|
|
439
498
|
/* @__PURE__ */ o(
|
|
440
499
|
V.Input,
|
|
441
500
|
{
|
|
442
|
-
className: T(
|
|
443
|
-
[
|
|
444
|
-
[
|
|
501
|
+
className: T(O.default, i, {
|
|
502
|
+
[O.noLeftIcon]: !n,
|
|
503
|
+
[O.noRightIcon]: !t
|
|
445
504
|
}),
|
|
446
505
|
ref: d,
|
|
447
|
-
size:
|
|
506
|
+
size: p,
|
|
448
507
|
variant: s,
|
|
449
508
|
color: m,
|
|
450
|
-
...
|
|
509
|
+
...l
|
|
451
510
|
}
|
|
452
511
|
),
|
|
453
512
|
t && /* @__PURE__ */ o(V.Slot, { children: t }),
|
|
454
|
-
f && /* @__PURE__ */ o(
|
|
513
|
+
f && /* @__PURE__ */ o(q, { as: "p", className: O.charCount, size: "1", color: "gray", children: l.maxLength !== void 0 ? `${h == null ? void 0 : h.length}/${l.maxLength}` : `${h == null ? void 0 : h.length}` })
|
|
455
514
|
]
|
|
456
515
|
}
|
|
457
516
|
);
|
|
458
|
-
}),
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */ o(j.Trigger, { children:
|
|
461
|
-
/* @__PURE__ */ o(j.Content, { ref:
|
|
517
|
+
}), Ht = M.memo(dt), ht = w(function({ defaultOpen: i = !1, modal: n = !1, content: t, children: r, ...e }, a) {
|
|
518
|
+
return /* @__PURE__ */ g(j.Root, { defaultOpen: i, modal: n, children: [
|
|
519
|
+
/* @__PURE__ */ o(j.Trigger, { children: r }),
|
|
520
|
+
/* @__PURE__ */ o(j.Content, { ref: a, ...e, children: t(j.Close) })
|
|
462
521
|
] });
|
|
463
|
-
}),
|
|
464
|
-
charCount:
|
|
465
|
-
},
|
|
466
|
-
const
|
|
522
|
+
}), qt = M.memo(ht), pt = "_charCount_17uut_1", mt = {
|
|
523
|
+
charCount: pt
|
|
524
|
+
}, ft = w(function({ className: i, showInputLength: n, inputLengthTemplate: t, value: r, severity: e = "primary", resize: a, ...s }, u) {
|
|
525
|
+
const l = S(e), d = S("info"), p = n || n === void 0 && (s.maxLength !== void 0 || s.minLength !== void 0), m = r !== void 0 ? r.toString() : "", f = L(() => {
|
|
467
526
|
if (t) {
|
|
468
|
-
let
|
|
469
|
-
return s.minLength !== void 0 && (
|
|
527
|
+
let h = t.replace("{current}", m.length.toString());
|
|
528
|
+
return s.minLength !== void 0 && (h = h.replace("{min}", s.minLength.toString())), s.maxLength !== void 0 && (h = h.replace("{max}", s.maxLength.toString())), h;
|
|
470
529
|
}
|
|
471
530
|
return m.length;
|
|
472
531
|
}, [t, s.maxLength, s.minLength, m.length]);
|
|
473
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ g(P, { children: [
|
|
474
533
|
/* @__PURE__ */ o(
|
|
475
|
-
|
|
534
|
+
xe,
|
|
476
535
|
{
|
|
477
|
-
className: T("overmap-textarea",
|
|
478
|
-
style: { resize:
|
|
479
|
-
ref:
|
|
480
|
-
value:
|
|
481
|
-
color:
|
|
536
|
+
className: T("overmap-textarea", i),
|
|
537
|
+
style: { resize: a },
|
|
538
|
+
ref: u,
|
|
539
|
+
value: r,
|
|
540
|
+
color: l,
|
|
482
541
|
...s
|
|
483
542
|
}
|
|
484
543
|
),
|
|
485
|
-
|
|
544
|
+
p && /* @__PURE__ */ o(q, { as: "p", className: mt.charCount, color: d, align: "right", children: f })
|
|
486
545
|
] });
|
|
487
|
-
}),
|
|
546
|
+
}), Kt = C(ft), gt = w(function({
|
|
488
547
|
// ToggleGroup Primitive Props
|
|
489
|
-
loop:
|
|
490
|
-
type:
|
|
548
|
+
loop: i,
|
|
549
|
+
type: n,
|
|
491
550
|
rovingFocus: t,
|
|
492
|
-
value:
|
|
551
|
+
value: r,
|
|
493
552
|
onValueChange: e,
|
|
494
|
-
defaultValue:
|
|
553
|
+
defaultValue: a,
|
|
495
554
|
disabled: s,
|
|
496
|
-
items:
|
|
555
|
+
items: u,
|
|
497
556
|
// ButtonGroup Props
|
|
498
|
-
className:
|
|
557
|
+
className: l,
|
|
499
558
|
direction: d = "row",
|
|
500
|
-
...
|
|
559
|
+
...p
|
|
501
560
|
}, m) {
|
|
502
561
|
return /* @__PURE__ */ o(
|
|
503
|
-
|
|
562
|
+
ke,
|
|
504
563
|
{
|
|
505
|
-
type:
|
|
506
|
-
className: T("overmap-toggle-group",
|
|
564
|
+
type: n,
|
|
565
|
+
className: T("overmap-toggle-group", l),
|
|
507
566
|
ref: m,
|
|
508
|
-
value:
|
|
567
|
+
value: r,
|
|
509
568
|
onValueChange: e,
|
|
510
569
|
disabled: s,
|
|
511
570
|
orientation: d === "column" ? "vertical" : "horizontal",
|
|
512
|
-
loop:
|
|
571
|
+
loop: i,
|
|
513
572
|
rovingFocus: t,
|
|
514
|
-
defaultValue:
|
|
573
|
+
defaultValue: a,
|
|
515
574
|
asChild: !0,
|
|
516
|
-
children: /* @__PURE__ */ o(
|
|
517
|
-
|
|
575
|
+
children: /* @__PURE__ */ o(qe, { direction: d, ...p, children: u.map(({ children: f, ...h }) => /* @__PURE__ */ oe(Re, { asChild: !0, ...h, key: h.value }, /* @__PURE__ */ o(
|
|
576
|
+
ae,
|
|
518
577
|
{
|
|
519
578
|
className: T("overmap-toggle-group-button"),
|
|
520
|
-
"aria-label":
|
|
521
|
-
variant:
|
|
579
|
+
"aria-label": h.value,
|
|
580
|
+
variant: h.value === r ? "solid" : "soft",
|
|
522
581
|
children: f
|
|
523
582
|
}
|
|
524
583
|
))) })
|
|
525
584
|
}
|
|
526
585
|
);
|
|
527
|
-
}),
|
|
528
|
-
ToastViewport:
|
|
529
|
-
ToastRoot:
|
|
530
|
-
slideIn:
|
|
531
|
-
swipeOut:
|
|
532
|
-
},
|
|
533
|
-
const [d,
|
|
534
|
-
(
|
|
535
|
-
!
|
|
586
|
+
}), Ut = C(gt), Ct = "_ToastViewport_t8tlv_1", vt = "_ToastRoot_t8tlv_20", _t = "_slideIn_t8tlv_1", wt = "_swipeOut_t8tlv_1", de = {
|
|
587
|
+
ToastViewport: Ct,
|
|
588
|
+
ToastRoot: vt,
|
|
589
|
+
slideIn: _t,
|
|
590
|
+
swipeOut: wt
|
|
591
|
+
}, St = w(function({ title: i, description: n, icon: t, severity: r = "primary", size: e, onClose: a, sensitivity: s, ...u }, l) {
|
|
592
|
+
const [d, p] = R(!0), m = S(r), f = I(
|
|
593
|
+
(h) => {
|
|
594
|
+
!h && a && a(), p(h);
|
|
536
595
|
},
|
|
537
|
-
[
|
|
596
|
+
[a]
|
|
538
597
|
);
|
|
539
|
-
return /* @__PURE__ */ o(
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */ o(
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */ o(
|
|
544
|
-
/* @__PURE__ */ o(
|
|
598
|
+
return /* @__PURE__ */ o(W.Root, { asChild: !0, ref: l, ...u, open: d, type: s, onOpenChange: f, children: /* @__PURE__ */ o(F.Root, { className: de.ToastRoot, variant: "surface", color: m, size: e, children: /* @__PURE__ */ g(x, { width: "100%", align: "center", gap: "4", justify: "between", children: [
|
|
599
|
+
/* @__PURE__ */ g(x, { align: "center", gap: "4", children: [
|
|
600
|
+
/* @__PURE__ */ o(F.Icon, { children: t || /* @__PURE__ */ o(fe, {}) }),
|
|
601
|
+
/* @__PURE__ */ g(x, { direction: "column", gap: "0", children: [
|
|
602
|
+
/* @__PURE__ */ o(W.Title, { asChild: !0, children: /* @__PURE__ */ o(F.Text, { weight: "medium", children: i }) }),
|
|
603
|
+
/* @__PURE__ */ o(W.Description, { asChild: !0, children: /* @__PURE__ */ o(F.Text, { weight: "light", children: n }) })
|
|
545
604
|
] })
|
|
546
605
|
] }),
|
|
547
|
-
/* @__PURE__ */ o(
|
|
606
|
+
/* @__PURE__ */ o(W.Close, { asChild: !0, children: /* @__PURE__ */ o(ae, { "aria-label": "Close", variant: "ghost", size: "small", severity: r, children: /* @__PURE__ */ o(ge, {}) }) })
|
|
548
607
|
] }) }) });
|
|
549
|
-
}),
|
|
550
|
-
const
|
|
551
|
-
if (!
|
|
608
|
+
}), yt = C(St), he = U({}), Qt = () => {
|
|
609
|
+
const c = Q(he);
|
|
610
|
+
if (!c)
|
|
552
611
|
throw new Error("useToast must be used within a ToastProvider");
|
|
553
|
-
return
|
|
554
|
-
},
|
|
555
|
-
if (
|
|
556
|
-
return
|
|
557
|
-
const
|
|
558
|
-
return (
|
|
559
|
-
}
|
|
560
|
-
|
|
612
|
+
return c;
|
|
613
|
+
}, Tt = 240 / 60, ee = 5e3, xt = (c) => {
|
|
614
|
+
if (c.duration && c.duration >= ee)
|
|
615
|
+
return c.duration;
|
|
616
|
+
const i = c.severity === "danger" ? 1.5 : 1, n = c.description.split(" ").length + c.title.split(" ").length;
|
|
617
|
+
return (ee + n / Tt) * i;
|
|
618
|
+
};
|
|
619
|
+
let Dt;
|
|
620
|
+
const Jt = C(function({
|
|
621
|
+
children: i,
|
|
561
622
|
// Use this class to change where the viewport for the toasts should be
|
|
562
|
-
className:
|
|
623
|
+
className: n,
|
|
563
624
|
hotkey: t,
|
|
564
|
-
...
|
|
625
|
+
...r
|
|
565
626
|
}) {
|
|
566
|
-
const [e,
|
|
567
|
-
|
|
568
|
-
const f = m.find((
|
|
569
|
-
return f && d === 0 && clearTimeout(f.timeout), m.filter((
|
|
570
|
-
}),
|
|
571
|
-
}, []),
|
|
572
|
-
let
|
|
573
|
-
const d = (
|
|
574
|
-
const y =
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
};
|
|
579
|
-
return {
|
|
627
|
+
const [e, a] = R([]), s = I((l, d, p) => {
|
|
628
|
+
a((m) => {
|
|
629
|
+
const f = m.find((h) => h.id === l);
|
|
630
|
+
return f && d === 0 && clearTimeout(f.timeout), m.filter((h) => h.id !== l);
|
|
631
|
+
}), p && p();
|
|
632
|
+
}, []), u = L(() => {
|
|
633
|
+
let l = 0;
|
|
634
|
+
const d = (v) => {
|
|
635
|
+
const y = xt(v), b = l.toString();
|
|
636
|
+
l += 1;
|
|
637
|
+
const N = setTimeout(() => s(b, 1, v.onClose), y);
|
|
638
|
+
a((B) => [...B, { ...v, timeout: N, duration: y, id: b }]);
|
|
639
|
+
}, p = (v) => d({ ...v, severity: "primary" }), m = (v) => d({ ...v, severity: "success" }), f = (v) => d({ ...v, severity: "danger" }), h = (v) => d({ ...v, severity: "info" });
|
|
640
|
+
return Dt = d, {
|
|
580
641
|
showToast: d,
|
|
581
|
-
showPrimary:
|
|
582
|
-
showSuccess:
|
|
583
|
-
showError:
|
|
584
|
-
showInfo:
|
|
642
|
+
showPrimary: p,
|
|
643
|
+
showSuccess: m,
|
|
644
|
+
showError: f,
|
|
645
|
+
showInfo: h
|
|
585
646
|
};
|
|
586
647
|
}, [s]);
|
|
587
|
-
return
|
|
588
|
-
for (const { timeout:
|
|
589
|
-
clearTimeout(
|
|
590
|
-
}, []), /* @__PURE__ */ o(
|
|
591
|
-
|
|
592
|
-
/* @__PURE__ */ o(
|
|
593
|
-
e.map(({ id:
|
|
648
|
+
return ne(() => () => {
|
|
649
|
+
for (const { timeout: l } of e)
|
|
650
|
+
clearTimeout(l);
|
|
651
|
+
}, []), /* @__PURE__ */ o(he.Provider, { value: u, children: /* @__PURE__ */ g($e, { ...r, children: [
|
|
652
|
+
i,
|
|
653
|
+
/* @__PURE__ */ o(Ae, { className: T(n, de.ToastViewport), hotkey: t }),
|
|
654
|
+
e.map(({ id: l, onClose: d, ...p }) => /* @__PURE__ */ o(yt, { ...p, onClose: () => s(l, 0, d) }, l))
|
|
594
655
|
] }) });
|
|
595
|
-
}),
|
|
596
|
-
noWrap:
|
|
597
|
-
},
|
|
598
|
-
|
|
599
|
-
const
|
|
656
|
+
}), bt = "_noWrap_1wpa5_1", It = {
|
|
657
|
+
noWrap: bt
|
|
658
|
+
}, Xt = C(
|
|
659
|
+
w(({ className: c, noWrap: i, severity: n, as: t, ...r }, e) => {
|
|
660
|
+
const a = S(n);
|
|
600
661
|
return /* @__PURE__ */ o(
|
|
601
|
-
|
|
662
|
+
q,
|
|
602
663
|
{
|
|
603
664
|
ref: e,
|
|
604
665
|
as: t,
|
|
605
|
-
className: T(
|
|
606
|
-
color:
|
|
607
|
-
...
|
|
666
|
+
className: T(c, { [It.noWrap]: i }),
|
|
667
|
+
color: a,
|
|
668
|
+
...r
|
|
608
669
|
}
|
|
609
670
|
);
|
|
610
671
|
})
|
|
611
672
|
);
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
const { panelBackground:
|
|
615
|
-
return /* @__PURE__ */ o(
|
|
673
|
+
const Yt = C(
|
|
674
|
+
w((c, i) => {
|
|
675
|
+
const { panelBackground: n = "solid", radius: t = "full", ...r } = c;
|
|
676
|
+
return /* @__PURE__ */ o(De, { panelBackground: n, radius: t, ref: i, ...r });
|
|
616
677
|
})
|
|
617
|
-
)
|
|
678
|
+
), kt = {
|
|
679
|
+
1: "max-content",
|
|
680
|
+
2: "max-content",
|
|
681
|
+
3: "max-content",
|
|
682
|
+
4: "100%"
|
|
683
|
+
}, Rt = w(function({
|
|
684
|
+
severity: i = "info",
|
|
685
|
+
weight: n = "light",
|
|
686
|
+
gap: t = "1",
|
|
687
|
+
text: r,
|
|
688
|
+
orientation: e = "horizontal",
|
|
689
|
+
size: a,
|
|
690
|
+
...s
|
|
691
|
+
}) {
|
|
692
|
+
const u = A(a, kt), l = S(i);
|
|
693
|
+
return /* @__PURE__ */ o(P, { children: /* @__PURE__ */ g(
|
|
694
|
+
x,
|
|
695
|
+
{
|
|
696
|
+
width: e === "horizontal" ? u : "max-content",
|
|
697
|
+
height: e === "vertical" ? u : "max-content",
|
|
698
|
+
direction: e === "vertical" ? "column" : "row",
|
|
699
|
+
align: "center",
|
|
700
|
+
gap: t,
|
|
701
|
+
children: [
|
|
702
|
+
/* @__PURE__ */ o(X, { size: a, orientation: e, color: l, ...s }),
|
|
703
|
+
r && /* @__PURE__ */ g(P, { children: [
|
|
704
|
+
/* @__PURE__ */ o(q, { as: "span", size: "1", weight: n, color: l, children: r }),
|
|
705
|
+
/* @__PURE__ */ o(X, { size: a, orientation: e, color: l, ...s })
|
|
706
|
+
] })
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
) });
|
|
710
|
+
}), Zt = C(Rt);
|
|
618
711
|
export {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
712
|
+
ro as AccessibleIcon,
|
|
713
|
+
Qe as AlertDialog,
|
|
714
|
+
ue as AlertDialogContent,
|
|
715
|
+
Lt as AlertDialogProvider,
|
|
716
|
+
co as AspectRatio,
|
|
717
|
+
so as Avatar,
|
|
718
|
+
Pt as Badge,
|
|
719
|
+
io as Blockquote,
|
|
720
|
+
ao as Box,
|
|
721
|
+
Y as Button,
|
|
722
|
+
qe as ButtonGroup,
|
|
723
|
+
lo as Callout,
|
|
724
|
+
uo as Card,
|
|
725
|
+
ho as Checkbox,
|
|
726
|
+
po as Code,
|
|
727
|
+
mo as Container,
|
|
728
|
+
fo as ContextMenu,
|
|
729
|
+
Yt as DefaultTheme,
|
|
730
|
+
Mt as Dialog,
|
|
731
|
+
Vt as DropdownMenu,
|
|
732
|
+
go as Em,
|
|
733
|
+
Co as Flex,
|
|
734
|
+
vo as Grid,
|
|
735
|
+
_o as Heading,
|
|
736
|
+
wo as HoverCard,
|
|
737
|
+
ae as IconButton,
|
|
738
|
+
Ht as Input,
|
|
739
|
+
So as Inset,
|
|
740
|
+
yo as Kbd,
|
|
741
|
+
To as Link,
|
|
742
|
+
Ft as MultiSelect,
|
|
743
|
+
qt as Popover,
|
|
744
|
+
xo as Portal,
|
|
745
|
+
Do as Quote,
|
|
746
|
+
bo as RadioGroup,
|
|
747
|
+
Io as ScrollArea,
|
|
748
|
+
ko as Section,
|
|
749
|
+
jt as Select,
|
|
750
|
+
Zt as Separator,
|
|
751
|
+
Ro as Slider,
|
|
752
|
+
$o as Slot,
|
|
753
|
+
Ao as Strong,
|
|
754
|
+
Wt as Switch,
|
|
755
|
+
No as Table,
|
|
756
|
+
Oo as Tabs,
|
|
757
|
+
Xt as Text,
|
|
758
|
+
Kt as TextArea,
|
|
759
|
+
Eo as TextField,
|
|
760
|
+
Bo as Theme,
|
|
761
|
+
yt as Toast,
|
|
762
|
+
he as ToastContext,
|
|
763
|
+
Jt as ToastProvider,
|
|
764
|
+
Ut as ToggleGroup,
|
|
765
|
+
zo as Tooltip,
|
|
766
|
+
Po as VisuallyHidden,
|
|
767
|
+
Dt as unsafeShowToast,
|
|
768
|
+
Mo as updateThemeAppearanceClass,
|
|
769
|
+
Gt as useAlertDialog,
|
|
676
770
|
S as useSeverityColor,
|
|
677
|
-
|
|
678
|
-
|
|
771
|
+
Lo as useThemeContext,
|
|
772
|
+
Qt as useToast
|
|
679
773
|
};
|
|
680
774
|
//# sourceMappingURL=blocks.js.map
|