@spear-ai/spectral 1.4.13 → 1.4.15

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.
@@ -0,0 +1,240 @@
1
+ import "./styles/main.css";
2
+ import * as i from "react";
3
+ import { c as V, a as q, P as p, u as _, b as g, d as K, e as U } from "./index-CfypDjr2.js";
4
+ import { u as R } from "./index-CDYW5LDR.js";
5
+ import { D as Y, P as Z } from "./index-D-PVGGln.js";
6
+ import { R as z, h as J, u as Q, F as X } from "./index-CpUJ8sN0.js";
7
+ import { P as h } from "./index-DdOwqCfb.js";
8
+ import { jsx as s, jsxs as N, Fragment as O } from "react/jsx-runtime";
9
+ var v = "Dialog", [I] = V(v), [ee, u] = I(v), x = (e) => {
10
+ const {
11
+ __scopeDialog: o,
12
+ children: r,
13
+ open: a,
14
+ defaultOpen: n,
15
+ onOpenChange: t,
16
+ modal: l = !0
17
+ } = e, c = i.useRef(null), f = i.useRef(null), [m, C] = U({
18
+ prop: a,
19
+ defaultProp: n ?? !1,
20
+ onChange: t,
21
+ caller: v
22
+ });
23
+ return /* @__PURE__ */ s(
24
+ ee,
25
+ {
26
+ scope: o,
27
+ triggerRef: c,
28
+ contentRef: f,
29
+ contentId: R(),
30
+ titleId: R(),
31
+ descriptionId: R(),
32
+ open: m,
33
+ onOpenChange: C,
34
+ onOpenToggle: i.useCallback(() => C((H) => !H), [C]),
35
+ modal: l,
36
+ children: r
37
+ }
38
+ );
39
+ };
40
+ x.displayName = v;
41
+ var A = "DialogTrigger", T = i.forwardRef(
42
+ (e, o) => {
43
+ const { __scopeDialog: r, ...a } = e, n = u(A, r), t = _(o, n.triggerRef);
44
+ return /* @__PURE__ */ s(
45
+ p.button,
46
+ {
47
+ type: "button",
48
+ "aria-haspopup": "dialog",
49
+ "aria-expanded": n.open,
50
+ "aria-controls": n.contentId,
51
+ "data-state": y(n.open),
52
+ ...a,
53
+ ref: t,
54
+ onClick: g(e.onClick, n.onOpenToggle)
55
+ }
56
+ );
57
+ }
58
+ );
59
+ T.displayName = A;
60
+ var P = "DialogPortal", [te, b] = I(P, {
61
+ forceMount: void 0
62
+ }), M = (e) => {
63
+ const { __scopeDialog: o, forceMount: r, children: a, container: n } = e, t = u(P, o);
64
+ return /* @__PURE__ */ s(te, { scope: o, forceMount: r, children: i.Children.map(a, (l) => /* @__PURE__ */ s(h, { present: r || t.open, children: /* @__PURE__ */ s(Z, { asChild: !0, container: n, children: l }) })) });
65
+ };
66
+ M.displayName = P;
67
+ var D = "DialogOverlay", w = i.forwardRef(
68
+ (e, o) => {
69
+ const r = b(D, e.__scopeDialog), { forceMount: a = r.forceMount, ...n } = e, t = u(D, e.__scopeDialog);
70
+ return t.modal ? /* @__PURE__ */ s(h, { present: a || t.open, children: /* @__PURE__ */ s(ne, { ...n, ref: o }) }) : null;
71
+ }
72
+ );
73
+ w.displayName = D;
74
+ var oe = q("DialogOverlay.RemoveScroll"), ne = i.forwardRef(
75
+ (e, o) => {
76
+ const { __scopeDialog: r, ...a } = e, n = u(D, r);
77
+ return (
78
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
79
+ // ie. when `Overlay` and `Content` are siblings
80
+ /* @__PURE__ */ s(z, { as: oe, allowPinchZoom: !0, shards: [n.contentRef], children: /* @__PURE__ */ s(
81
+ p.div,
82
+ {
83
+ "data-state": y(n.open),
84
+ ...a,
85
+ ref: o,
86
+ style: { pointerEvents: "auto", ...a.style }
87
+ }
88
+ ) })
89
+ );
90
+ }
91
+ ), d = "DialogContent", F = i.forwardRef(
92
+ (e, o) => {
93
+ const r = b(d, e.__scopeDialog), { forceMount: a = r.forceMount, ...n } = e, t = u(d, e.__scopeDialog);
94
+ return /* @__PURE__ */ s(h, { present: a || t.open, children: t.modal ? /* @__PURE__ */ s(re, { ...n, ref: o }) : /* @__PURE__ */ s(ae, { ...n, ref: o }) });
95
+ }
96
+ );
97
+ F.displayName = d;
98
+ var re = i.forwardRef(
99
+ (e, o) => {
100
+ const r = u(d, e.__scopeDialog), a = i.useRef(null), n = _(o, r.contentRef, a);
101
+ return i.useEffect(() => {
102
+ const t = a.current;
103
+ if (t) return J(t);
104
+ }, []), /* @__PURE__ */ s(
105
+ S,
106
+ {
107
+ ...e,
108
+ ref: n,
109
+ trapFocus: r.open,
110
+ disableOutsidePointerEvents: !0,
111
+ onCloseAutoFocus: g(e.onCloseAutoFocus, (t) => {
112
+ t.preventDefault(), r.triggerRef.current?.focus();
113
+ }),
114
+ onPointerDownOutside: g(e.onPointerDownOutside, (t) => {
115
+ const l = t.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
116
+ (l.button === 2 || c) && t.preventDefault();
117
+ }),
118
+ onFocusOutside: g(
119
+ e.onFocusOutside,
120
+ (t) => t.preventDefault()
121
+ )
122
+ }
123
+ );
124
+ }
125
+ ), ae = i.forwardRef(
126
+ (e, o) => {
127
+ const r = u(d, e.__scopeDialog), a = i.useRef(!1), n = i.useRef(!1);
128
+ return /* @__PURE__ */ s(
129
+ S,
130
+ {
131
+ ...e,
132
+ ref: o,
133
+ trapFocus: !1,
134
+ disableOutsidePointerEvents: !1,
135
+ onCloseAutoFocus: (t) => {
136
+ e.onCloseAutoFocus?.(t), t.defaultPrevented || (a.current || r.triggerRef.current?.focus(), t.preventDefault()), a.current = !1, n.current = !1;
137
+ },
138
+ onInteractOutside: (t) => {
139
+ e.onInteractOutside?.(t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (n.current = !0));
140
+ const l = t.target;
141
+ r.triggerRef.current?.contains(l) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && n.current && t.preventDefault();
142
+ }
143
+ }
144
+ );
145
+ }
146
+ ), S = i.forwardRef(
147
+ (e, o) => {
148
+ const { __scopeDialog: r, trapFocus: a, onOpenAutoFocus: n, onCloseAutoFocus: t, ...l } = e, c = u(d, r), f = i.useRef(null), m = _(o, f);
149
+ return Q(), /* @__PURE__ */ N(O, { children: [
150
+ /* @__PURE__ */ s(
151
+ X,
152
+ {
153
+ asChild: !0,
154
+ loop: !0,
155
+ trapped: a,
156
+ onMountAutoFocus: n,
157
+ onUnmountAutoFocus: t,
158
+ children: /* @__PURE__ */ s(
159
+ Y,
160
+ {
161
+ role: "dialog",
162
+ id: c.contentId,
163
+ "aria-describedby": c.descriptionId,
164
+ "aria-labelledby": c.titleId,
165
+ "data-state": y(c.open),
166
+ ...l,
167
+ ref: m,
168
+ onDismiss: () => c.onOpenChange(!1)
169
+ }
170
+ )
171
+ }
172
+ ),
173
+ /* @__PURE__ */ N(O, { children: [
174
+ /* @__PURE__ */ s(se, { titleId: c.titleId }),
175
+ /* @__PURE__ */ s(ce, { contentRef: f, descriptionId: c.descriptionId })
176
+ ] })
177
+ ] });
178
+ }
179
+ ), E = "DialogTitle", W = i.forwardRef(
180
+ (e, o) => {
181
+ const { __scopeDialog: r, ...a } = e, n = u(E, r);
182
+ return /* @__PURE__ */ s(p.h2, { id: n.titleId, ...a, ref: o });
183
+ }
184
+ );
185
+ W.displayName = E;
186
+ var k = "DialogDescription", G = i.forwardRef(
187
+ (e, o) => {
188
+ const { __scopeDialog: r, ...a } = e, n = u(k, r);
189
+ return /* @__PURE__ */ s(p.p, { id: n.descriptionId, ...a, ref: o });
190
+ }
191
+ );
192
+ G.displayName = k;
193
+ var L = "DialogClose", $ = i.forwardRef(
194
+ (e, o) => {
195
+ const { __scopeDialog: r, ...a } = e, n = u(L, r);
196
+ return /* @__PURE__ */ s(
197
+ p.button,
198
+ {
199
+ type: "button",
200
+ ...a,
201
+ ref: o,
202
+ onClick: g(e.onClick, () => n.onOpenChange(!1))
203
+ }
204
+ );
205
+ }
206
+ );
207
+ $.displayName = L;
208
+ function y(e) {
209
+ return e ? "open" : "closed";
210
+ }
211
+ var B = "DialogTitleWarning", [De, j] = K(B, {
212
+ contentName: d,
213
+ titleName: E,
214
+ docsSlug: "dialog"
215
+ }), se = ({ titleId: e }) => {
216
+ const o = j(B), r = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
217
+
218
+ If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
219
+
220
+ For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
221
+ return i.useEffect(() => {
222
+ e && (document.getElementById(e) || console.error(r));
223
+ }, [r, e]), null;
224
+ }, ie = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: o }) => {
225
+ const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j(ie).contentName}}.`;
226
+ return i.useEffect(() => {
227
+ const n = e.current?.getAttribute("aria-describedby");
228
+ o && n && (document.getElementById(o) || console.warn(a));
229
+ }, [a, e, o]), null;
230
+ }, ve = x, me = T, Ce = M, Re = w, _e = F, he = W, Pe = G, Ee = $;
231
+ export {
232
+ Ee as C,
233
+ Pe as D,
234
+ Re as O,
235
+ Ce as P,
236
+ ve as R,
237
+ he as T,
238
+ _e as a,
239
+ me as b
240
+ };
@@ -1,5 +1,5 @@
1
1
  import * as u from "react";
2
- import { d as z } from "./index-BhufZRa2.js";
2
+ import { f as z } from "./index-CfypDjr2.js";
3
3
  function n(r) {
4
4
  const [h, e] = u.useState(void 0);
5
5
  return z(() => {
@@ -2,16 +2,15 @@ import "./styles/main.css";
2
2
  import * as t from "react";
3
3
  import * as be from "react-dom";
4
4
  import { c as Re } from "./index-rKs9bXHr.js";
5
- import { u as Ee, c as st, a as k, P as M, b as R, d as Y, e as ct } from "./index-BhufZRa2.js";
6
- import { u as lt, c as at } from "./index-UEFPWH8U.js";
7
- import { D as it, P as dt } from "./index-B2oBi8ng.js";
8
- import { h as ut, u as pt, F as ft } from "./index-MZS7zxk4.js";
9
- import { u as Ie } from "./index-CVSxKOPp.js";
10
- import { c as _e, R as mt, A as ht, C as vt, a as gt } from "./index-NzygPVvJ.js";
11
- import { u as St } from "./index-0ioNhtNM.js";
12
- import { u as wt } from "./index-BZPx6jYI.js";
13
- import { V as Ct } from "./index-CGALWSq_.js";
14
- import { R as xt } from "./Combination-BtmnusWq.js";
5
+ import { e as Ee, c as st, u as k, P as M, b as R, f as Y, a as ct } from "./index-CfypDjr2.js";
6
+ import { u as lt, c as at } from "./index-DvqEQspb.js";
7
+ import { D as it, P as dt } from "./index-D-PVGGln.js";
8
+ import { h as ut, u as pt, R as ft, F as mt } from "./index-CpUJ8sN0.js";
9
+ import { u as Ie } from "./index-CDYW5LDR.js";
10
+ import { c as _e, R as ht, A as vt, C as gt, a as St } from "./index-DMDsy0y2.js";
11
+ import { u as wt } from "./index-0ioNhtNM.js";
12
+ import { u as Ct } from "./index-BZPx6jYI.js";
13
+ import { V as xt } from "./index-bcth-MVh.js";
15
14
  import { jsx as p, jsxs as le, Fragment as Te } from "react/jsx-runtime";
16
15
  var yt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], J = "Select", [ie, de, Tt] = at(J), [te] = st(J, [
17
16
  Tt,
@@ -43,7 +42,7 @@ var yt = [" ", "Enter", "ArrowUp", "ArrowDown"], It = [" ", "Enter"], J = "Selec
43
42
  onChange: c,
44
43
  caller: J
45
44
  }), V = t.useRef(null), B = h ? y || !!h.closest("form") : !0, [G, H] = t.useState(/* @__PURE__ */ new Set()), F = Array.from(G).map((_) => _.props.value).join(";");
46
- return /* @__PURE__ */ p(mt, { ...i, children: /* @__PURE__ */ le(
45
+ return /* @__PURE__ */ p(ht, { ...i, children: /* @__PURE__ */ le(
47
46
  Pt,
48
47
  {
49
48
  required: T,
@@ -114,7 +113,7 @@ var Me = "SelectTrigger", Ae = t.forwardRef(
114
113
  y: Math.round(i.pageY)
115
114
  });
116
115
  };
117
- return /* @__PURE__ */ p(ht, { asChild: !0, ...d, children: /* @__PURE__ */ p(
116
+ return /* @__PURE__ */ p(vt, { asChild: !0, ...d, children: /* @__PURE__ */ p(
118
117
  M.button,
119
118
  {
120
119
  type: "button",
@@ -296,8 +295,8 @@ var O = 10, [Be, q] = te(Q), Nt = "SelectContentImpl", Mt = ct("SelectContent.Re
296
295
  position: a,
297
296
  isPositioned: G,
298
297
  searchRef: pe,
299
- children: /* @__PURE__ */ p(xt, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ p(
300
- ft,
298
+ children: /* @__PURE__ */ p(ft, { as: Mt, allowPinchZoom: !0, children: /* @__PURE__ */ p(
299
+ mt,
301
300
  {
302
301
  asChild: !0,
303
302
  trapped: m.open,
@@ -471,7 +470,7 @@ var Ot = "SelectPopperPosition", Se = t.forwardRef((o, l) => {
471
470
  ...d
472
471
  } = o, n = ue(e);
473
472
  return /* @__PURE__ */ p(
474
- vt,
473
+ gt,
475
474
  {
476
475
  ...n,
477
476
  ...d,
@@ -744,13 +743,13 @@ et.displayName = Bt;
744
743
  var ye = "SelectArrow", Ht = t.forwardRef(
745
744
  (o, l) => {
746
745
  const { __scopeSelect: e, ...a } = o, s = ue(e), d = j(ye, e), n = q(ye, e);
747
- return d.open && n.position === "popper" ? /* @__PURE__ */ p(gt, { ...s, ...a, ref: l }) : null;
746
+ return d.open && n.position === "popper" ? /* @__PURE__ */ p(St, { ...s, ...a, ref: l }) : null;
748
747
  }
749
748
  );
750
749
  Ht.displayName = ye;
751
750
  var Ft = "SelectBubbleInput", tt = t.forwardRef(
752
751
  ({ __scopeSelect: o, value: l, ...e }, a) => {
753
- const s = t.useRef(null), d = k(a, s), n = wt(l);
752
+ const s = t.useRef(null), d = k(a, s), n = Ct(l);
754
753
  return t.useEffect(() => {
755
754
  const r = s.current;
756
755
  if (!r) return;
@@ -766,7 +765,7 @@ var Ft = "SelectBubbleInput", tt = t.forwardRef(
766
765
  M.select,
767
766
  {
768
767
  ...e,
769
- style: { ...Ct, ...e.style },
768
+ style: { ...xt, ...e.style },
770
769
  ref: d,
771
770
  defaultValue: l
772
771
  }
@@ -778,7 +777,7 @@ function ot(o) {
778
777
  return o === "" || o === void 0;
779
778
  }
780
779
  function nt(o) {
781
- const l = St(o), e = t.useRef(""), a = t.useRef(0), s = t.useCallback(
780
+ const l = wt(o), e = t.useRef(""), a = t.useRef(0), s = t.useCallback(
782
781
  (n) => {
783
782
  const r = e.current + n;
784
783
  l(r), (function c(f) {
@@ -803,21 +802,21 @@ function rt(o, l, e) {
803
802
  function Ut(o, l) {
804
803
  return o.map((e, a) => o[(l + a) % o.length]);
805
804
  }
806
- var eo = Ne, to = Ae, oo = De, no = Le, ro = ke, so = Ve, co = Ue, lo = Ke, ao = ze, io = je, uo = qe, po = Ze, fo = $e, mo = Je, ho = et;
805
+ var Qt = Ne, eo = Ae, to = De, oo = Le, no = ke, ro = Ve, so = Ue, co = Ke, lo = ze, ao = je, io = qe, uo = Ze, po = $e, fo = Je, mo = et;
807
806
  export {
808
- so as C,
809
- lo as G,
810
- io as I,
811
- ao as L,
812
- ro as P,
813
- eo as R,
814
- mo as S,
815
- to as T,
816
- co as V,
817
- po as a,
818
- uo as b,
819
- fo as c,
820
- ho as d,
821
- no as e,
822
- oo as f
807
+ ro as C,
808
+ co as G,
809
+ ao as I,
810
+ lo as L,
811
+ no as P,
812
+ Qt as R,
813
+ fo as S,
814
+ eo as T,
815
+ so as V,
816
+ uo as a,
817
+ io as b,
818
+ po as c,
819
+ mo as d,
820
+ oo as e,
821
+ to as f
823
822
  };
@@ -1,5 +1,5 @@
1
1
  import * as r from "react";
2
- import { d as s } from "./index-BhufZRa2.js";
2
+ import { f as s } from "./index-CfypDjr2.js";
3
3
  var u = r[" useId ".trim().toString()] || (() => {
4
4
  }), i = 0;
5
5
  function n(e) {
@@ -220,13 +220,13 @@ function B(e, t) {
220
220
  }
221
221
  export {
222
222
  k as P,
223
- F as a,
223
+ R as a,
224
224
  L as b,
225
225
  A as c,
226
- O as d,
227
- R as e,
228
- H as f,
229
- W as g,
226
+ W as d,
227
+ T as e,
228
+ O as f,
229
+ H as g,
230
230
  B as h,
231
- T as u
231
+ F as u
232
232
  };