@overmap-ai/blocks 0.0.1-alpha.44 → 0.0.1-alpha.45

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