@spear-ai/spectral 1.3.20 → 1.3.22

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.
Files changed (78) hide show
  1. package/dist/.js +84 -77
  2. package/dist/Button.js +1 -1
  3. package/dist/Card.js +4 -4
  4. package/dist/Drawer.js +15 -8
  5. package/dist/Icons/AnnotationsIcon.js +3 -3
  6. package/dist/Icons/CalendarIcon.js +8 -8
  7. package/dist/Icons/DeleteIcon.js +10 -10
  8. package/dist/Icons/DurationIcon.js +9 -9
  9. package/dist/Icons/EraserIcon.js +7 -7
  10. package/dist/Icons/GoToFirstIcon.js +10 -10
  11. package/dist/Icons/GoToLastIcon.js +8 -8
  12. package/dist/Icons/IconBase.js +8 -7
  13. package/dist/Icons/InfoIcon.js +32 -0
  14. package/dist/Icons/LabelIcon.js +6 -6
  15. package/dist/Icons/LassoIcon.js +3 -3
  16. package/dist/Icons/LineToolIcon.js +14 -14
  17. package/dist/Icons/LiveViewIcon.js +30 -30
  18. package/dist/Icons/LocationIcon.js +6 -6
  19. package/dist/Icons/MetadataIcon.js +8 -8
  20. package/dist/Icons/OntologyIcon.js +5 -5
  21. package/dist/Icons/PlayIcon.js +11 -11
  22. package/dist/Icons/PlusIcon.js +9 -9
  23. package/dist/Icons/ResetIcon.js +8 -8
  24. package/dist/Icons/ScissorsIcon.js +15 -15
  25. package/dist/Icons/SettingsIcon.js +42 -0
  26. package/dist/Icons/TrashIcon.js +1 -1
  27. package/dist/Icons/UndoIcon.js +5 -5
  28. package/dist/Icons/ZoomAllIcon.js +57 -25
  29. package/dist/Icons/ZoomXIcon.js +7 -7
  30. package/dist/Icons.js +38 -34
  31. package/dist/Popover.js +48 -42
  32. package/dist/RadioGroup/RadioGroupBase.js +120 -118
  33. package/dist/RadioGroup.js +41 -0
  34. package/dist/Slider/SliderBase.js +98 -99
  35. package/dist/Slider.js +3 -3
  36. package/dist/ToggleGroup.js +9 -9
  37. package/dist/assets/main.css +1 -1
  38. package/dist/components/Drawer/Drawer.d.ts +2 -0
  39. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  40. package/dist/components/Icons/IconBase.d.ts +5 -5
  41. package/dist/components/Icons/IconBase.d.ts.map +1 -1
  42. package/dist/components/Icons/InfoIcon.d.ts +3 -0
  43. package/dist/components/Icons/InfoIcon.d.ts.map +1 -0
  44. package/dist/components/Icons/SettingsIcon.d.ts +3 -0
  45. package/dist/components/Icons/SettingsIcon.d.ts.map +1 -0
  46. package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
  47. package/dist/components/Icons/index.d.ts +2 -0
  48. package/dist/components/Icons/index.d.ts.map +1 -1
  49. package/dist/components/Popover/Popover.d.ts +1 -1
  50. package/dist/components/Popover/Popover.d.ts.map +1 -1
  51. package/dist/components/RadioGroup/RadioGroup.d.ts +11 -0
  52. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
  53. package/dist/components/RadioGroup/RadioGroupBase.d.ts +2 -0
  54. package/dist/components/RadioGroup/RadioGroupBase.d.ts.map +1 -1
  55. package/dist/components/Slider/Slider.d.ts +1 -1
  56. package/dist/components/Slider/Slider.d.ts.map +1 -1
  57. package/dist/components/Slider/SliderBase.d.ts +2 -2
  58. package/dist/components/Slider/SliderBase.d.ts.map +1 -1
  59. package/dist/{loader-circle-Btf6jOd5.js → createLucideIcon-CI1yJrZf.js} +9 -16
  60. package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts +3 -0
  61. package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts.map +1 -0
  62. package/dist/features/HorizonColorGrid.js +70 -0
  63. package/dist/features/LabelingTools.js +4 -2
  64. package/dist/features/SensorMetadata/SensorMetadata.d.ts +2 -0
  65. package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +1 -0
  66. package/dist/features/SensorMetadata.js +85 -0
  67. package/dist/features/SettingsPopover/SettingsPopover.d.ts +2 -0
  68. package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +1 -0
  69. package/dist/features/SettingsPopover.js +194 -0
  70. package/dist/index.d.ts +1 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/loader-circle-CvdzOiQ_.js +11 -0
  73. package/dist/themes/grayscale-theme.webp +0 -0
  74. package/dist/themes/green-black-theme.webp +0 -0
  75. package/dist/themes/reverse-grayscale-theme.webp +0 -0
  76. package/dist/themes/viridis-theme.webp +0 -0
  77. package/package.json +5 -2
  78. package/src/styles/main.css +1 -0
@@ -1,21 +1,21 @@
1
1
  "use client";
2
- import { jsx as j, jsxs as M } from "react/jsx-runtime";
3
- import { Slot as S } from "../primitives/slot.js";
4
- import { createContext as T, forwardRef as L, useId as U, useState as P, useRef as E, useEffect as I, useCallback as C, useContext as $, useImperativeHandle as B } from "react";
2
+ import { jsx as A, jsxs as T } from "react/jsx-runtime";
3
+ import { Slot as L } from "../primitives/slot.js";
4
+ import { createContext as z, forwardRef as P, useId as $, useState as U, useRef as G, useEffect as C, useCallback as E, useContext as B, useImperativeHandle as K } from "react";
5
5
  function q(...s) {
6
6
  return s.filter(Boolean).join(" ");
7
7
  }
8
- const H = T(null);
9
- function z(s) {
10
- const { value: i, defaultValue: t, onChange: r } = s, [d, n] = P(t), u = i !== void 0, R = u ? i : d, l = C(
8
+ const H = z(null);
9
+ function J(s) {
10
+ const { value: i, defaultValue: t, onChange: r } = s, [d, n] = U(t), u = i !== void 0, g = u ? i : d, l = E(
11
11
  (e) => {
12
12
  u || n(e), r?.(e);
13
13
  },
14
14
  [u, r]
15
15
  );
16
- return [R, l];
16
+ return [g, l];
17
17
  }
18
- function J(s, i, t, r) {
18
+ function Q(s, i, t, r) {
19
19
  const d = s.length;
20
20
  let n = i;
21
21
  for (let u = 0; u < d; u += 1) {
@@ -24,11 +24,11 @@ function J(s, i, t, r) {
24
24
  }
25
25
  return i;
26
26
  }
27
- function Q(s, i, t) {
27
+ function W(s, i, t) {
28
28
  const { key: r } = s;
29
29
  return r === "Home" ? "first" : r === "End" ? "last" : i === "vertical" ? r === "ArrowDown" ? "next" : r === "ArrowUp" ? "prev" : null : r === "ArrowRight" ? t === "rtl" ? "prev" : "next" : r === "ArrowLeft" ? t === "rtl" ? "next" : "prev" : null;
30
30
  }
31
- const W = L(
31
+ const X = P(
32
32
  ({
33
33
  asChild: s,
34
34
  className: i,
@@ -37,154 +37,156 @@ const W = L(
37
37
  onValueChange: d,
38
38
  name: n,
39
39
  required: u = !1,
40
- form: R,
40
+ form: g,
41
41
  disabled: l = !1,
42
42
  orientation: e = "vertical",
43
- dir: V = "ltr",
44
- loop: b = !0,
45
- id: v,
46
- ...f
47
- }, p) => {
48
- const m = U(), O = v ?? `rg-${m}`, [x, y] = z({
43
+ dir: N = "ltr",
44
+ loop: p = !0,
45
+ variant: m = "default",
46
+ id: f,
47
+ ...b
48
+ }, v) => {
49
+ const O = $(), F = f ?? `rg-${O}`, [R, x] = J({
49
50
  value: t,
50
51
  defaultValue: r ?? void 0,
51
52
  onChange: d
52
- }), [A, g] = P(x), k = E([]), G = E(null);
53
- I(() => {
54
- x !== void 0 && g(x);
55
- }, [x]), I(() => {
56
- const c = G.current;
53
+ }), [w, V] = U(R), y = G([]), I = G(null);
54
+ C(() => {
55
+ R !== void 0 && V(R);
56
+ }, [R]), C(() => {
57
+ const c = I.current;
57
58
  if (!c) return;
58
59
  const a = () => {
59
- y(r ?? void 0);
60
+ x(r ?? void 0);
60
61
  };
61
62
  return c.addEventListener("reset", a), () => c.removeEventListener("reset", a);
62
- }, [r, y]);
63
- const o = C((c) => (k.current.push(c), () => {
64
- k.current = k.current.filter((a) => a.value !== c.value);
65
- }), []), h = C(
63
+ }, [r, x]);
64
+ const o = E((c) => (y.current.push(c), () => {
65
+ y.current = y.current.filter((a) => a.value !== c.value);
66
+ }), []), h = E(
66
67
  (c, a) => {
67
- l || (y(c), a?.focus && (g(c), k.current.find((K) => K.value === c)?.ref.current?.focus()));
68
+ l || (x(c), a?.focus && (V(c), y.current.find((M) => M.value === c)?.ref.current?.focus()));
68
69
  },
69
- [l, y]
70
- ), w = {
71
- value: x,
70
+ [l, x]
71
+ ), k = {
72
+ value: R,
72
73
  setValue: h,
73
74
  name: n,
74
75
  required: u,
75
- form: R,
76
+ form: g,
76
77
  disabled: l,
77
78
  orientation: e,
78
- dir: V,
79
- loop: b,
79
+ dir: N,
80
+ loop: p,
80
81
  registerItem: o,
81
- focusableValue: A,
82
- setFocusableValue: g,
83
- formElRef: G,
84
- itemsRef: k
85
- }, N = s ? S : "div", F = p;
86
- return /* @__PURE__ */ j(H.Provider, { value: w, children: /* @__PURE__ */ j(
87
- N,
82
+ focusableValue: w,
83
+ setFocusableValue: V,
84
+ formElRef: I,
85
+ itemsRef: y,
86
+ variant: m
87
+ }, D = s ? L : "div", S = v;
88
+ return /* @__PURE__ */ A(H.Provider, { value: k, children: /* @__PURE__ */ A(
89
+ D,
88
90
  {
89
- id: O,
90
- ref: F,
91
+ id: F,
92
+ ref: S,
91
93
  role: "radiogroup",
92
94
  "aria-orientation": e,
93
95
  "data-disabled": l ? "" : void 0,
94
96
  className: q(i),
95
- ...f
97
+ ...b
96
98
  }
97
99
  ) });
98
100
  }
99
101
  );
100
- W.displayName = "RadioGroup";
101
- const X = L(
102
- ({ asChild: s, className: i, value: t, disabled: r, id: d, onKeyDown: n, onClick: u, ...R }, l) => {
103
- const e = $(H);
102
+ X.displayName = "RadioGroup";
103
+ const Y = P(
104
+ ({ asChild: s, className: i, value: t, disabled: r, id: d, onKeyDown: n, onClick: u, ...g }, l) => {
105
+ const e = B(H);
104
106
  if (!e) throw new Error("RadioGroupItem must be used within RadioGroup");
105
- const V = U(), b = d ?? `rgi-${V}`, v = E(null), f = E(null);
106
- B(
107
+ const N = $(), p = d ?? `rgi-${N}`, m = G(null), f = G(null);
108
+ K(
107
109
  l,
108
- () => v.current,
110
+ () => m.current,
109
111
  []
110
112
  );
111
- const p = e.value === t, m = !!r || e.disabled;
112
- I(() => {
113
- const o = { value: t, ref: v, disabled: !!m, id: b };
113
+ const b = e.value === t, v = !!r || e.disabled;
114
+ C(() => {
115
+ const o = { value: t, ref: m, disabled: !!v, id: p };
114
116
  return e.registerItem(o);
115
- }, [t, m, b]), I(() => {
117
+ }, [t, v, p]), C(() => {
116
118
  !e.formElRef.current && f.current?.form && (e.formElRef.current = f.current.form);
117
- }, [e.formElRef]), I(() => {
118
- f.current && (f.current.checked = p);
119
- }, [p]);
120
- const x = (e.focusableValue ? e.focusableValue === t : p) && !m ? 0 : -1, y = s ? S : "button", A = (o) => {
121
- v.current = o;
122
- }, g = C(
119
+ }, [e.formElRef]), C(() => {
120
+ f.current && (f.current.checked = b);
121
+ }, [b]);
122
+ const F = (e.focusableValue ? e.focusableValue === t : b) && !v ? 0 : -1, R = s ? L : "button", x = (o) => {
123
+ m.current = o;
124
+ }, w = E(
123
125
  (o) => {
124
- if (!m && (e.setValue(t, { focus: !0, user: o }), f.current)) {
126
+ if (!v && (e.setValue(t, { focus: !0, user: o }), f.current)) {
125
127
  const h = new Event("change", { bubbles: !0 });
126
128
  f.current.dispatchEvent(h);
127
129
  }
128
130
  },
129
- [e, m, t]
130
- ), k = C(
131
+ [e, v, t]
132
+ ), V = E(
131
133
  (o) => {
132
- u?.(o), !o.defaultPrevented && g(!0);
134
+ u?.(o), !o.defaultPrevented && w(!0);
133
135
  },
134
- [u, g]
135
- ), G = C(
136
+ [u, w]
137
+ ), y = E(
136
138
  (o) => {
137
139
  if (n?.(o), o.defaultPrevented) return;
138
140
  if (o.key === " " || o.key === "Enter") {
139
- o.preventDefault(), g(!0);
141
+ o.preventDefault(), w(!0);
140
142
  return;
141
143
  }
142
- const h = Q(o, e.orientation, e.dir);
144
+ const h = W(o, e.orientation, e.dir);
143
145
  if (h) {
144
146
  o.preventDefault();
145
- const w = [...e.itemsRef.current], N = w.findIndex((a) => a.value === t);
146
- if (N === -1) return;
147
+ const k = [...e.itemsRef.current], D = k.findIndex((a) => a.value === t);
148
+ if (D === -1) return;
147
149
  if (h === "first") {
148
- const a = w.find((D) => !D.disabled);
150
+ const a = k.find((j) => !j.disabled);
149
151
  a && e.setValue(a.value, { focus: !0, user: !0 });
150
152
  return;
151
153
  }
152
154
  if (h === "last") {
153
- const a = [...w].reverse().find((D) => !D.disabled);
155
+ const a = [...k].reverse().find((j) => !j.disabled);
154
156
  a && e.setValue(a.value, { focus: !0, user: !0 });
155
157
  return;
156
158
  }
157
- const F = J(w, N, h, e.loop), c = w[F];
159
+ const S = Q(k, D, h, e.loop), c = k[S];
158
160
  c && !c.disabled && e.setValue(c.value, { focus: !0, user: !0 });
159
161
  }
160
162
  },
161
- [e, n, g, t]
162
- );
163
- return /* @__PURE__ */ M(
164
- y,
163
+ [e, n, w, t]
164
+ ), I = e.variant === "unstyled";
165
+ return /* @__PURE__ */ T(
166
+ R,
165
167
  {
166
- id: b,
167
- ref: A,
168
+ id: p,
169
+ ref: x,
168
170
  type: "button",
169
171
  role: "radio",
170
- "aria-checked": p,
171
- "aria-disabled": m || void 0,
172
- "data-state": p ? "checked" : "unchecked",
173
- "data-disabled": m ? "" : void 0,
174
- tabIndex: x,
175
- onClick: k,
176
- onKeyDown: G,
172
+ "aria-checked": b,
173
+ "aria-disabled": v || void 0,
174
+ "data-state": b ? "checked" : "unchecked",
175
+ "data-disabled": v ? "" : void 0,
176
+ tabIndex: F,
177
+ onClick: V,
178
+ onKeyDown: y,
177
179
  className: q(
178
- "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full",
179
- "border-input bg-background border",
180
- "focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
181
- "data-[state=checked]:border-primary data-[state=checked]:bg-primary/10",
182
- "disabled:cursor-not-allowed disabled:opacity-50",
180
+ // Only apply default styles when not unstyled
181
+ !I && "border-input bg-background focus-visible:ring-ring inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border focus-visible:ring-2 focus-visible:ring-offset-2",
182
+ !I && "data-[state=checked]:border-primary data-[state=checked]:bg-primary/10 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
183
+ // Always preserve basic accessibility for unstyled variant
184
+ I && "border-sm focus-visible:ring-ring data-[state=checked]:border-selected-primary cursor-pointer rounded-sm border-2 border-transparent transition-opacity hover:opacity-70 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
183
185
  i
184
186
  ),
185
- ...R,
187
+ ...g,
186
188
  children: [
187
- /* @__PURE__ */ j(
189
+ /* @__PURE__ */ A(
188
190
  "input",
189
191
  {
190
192
  ref: f,
@@ -192,9 +194,9 @@ const X = L(
192
194
  name: e.name,
193
195
  value: t,
194
196
  required: e.required,
195
- disabled: m,
197
+ disabled: v,
196
198
  form: e.form,
197
- checked: p,
199
+ checked: b,
198
200
  readOnly: !0,
199
201
  tabIndex: -1,
200
202
  "aria-hidden": "true",
@@ -207,37 +209,37 @@ const X = L(
207
209
  }
208
210
  }
209
211
  ),
210
- R.children
212
+ g.children
211
213
  ]
212
214
  }
213
215
  );
214
216
  }
215
217
  );
216
- X.displayName = "RadioGroupItem";
217
- const Y = L(
218
+ Y.displayName = "RadioGroupItem";
219
+ const Z = P(
218
220
  ({ asChild: s, className: i, forceMount: t, ...r }, d) => {
219
- if (!$(H)) return null;
220
- const [u, R] = P(!1), l = E(null);
221
- return B(
221
+ if (!B(H)) return null;
222
+ const [u, g] = U(!1), l = G(null);
223
+ return K(
222
224
  d,
223
225
  () => l.current,
224
226
  []
225
- ), I(() => {
226
- const b = l.current;
227
- if (!b) return;
228
- const v = b.closest('[role="radio"]');
229
- if (!v) return;
227
+ ), C(() => {
228
+ const p = l.current;
229
+ if (!p) return;
230
+ const m = p.closest('[role="radio"]');
231
+ if (!m) return;
230
232
  const f = () => {
231
- R(v.getAttribute("aria-checked") === "true");
233
+ g(m.getAttribute("aria-checked") === "true");
232
234
  };
233
235
  f();
234
- const p = new MutationObserver(f);
235
- return p.observe(v, { attributes: !0, attributeFilter: ["aria-checked"] }), () => p.disconnect();
236
- }, []), !u && !t ? null : /* @__PURE__ */ j(
237
- s ? S : "span",
236
+ const b = new MutationObserver(f);
237
+ return b.observe(m, { attributes: !0, attributeFilter: ["aria-checked"] }), () => b.disconnect();
238
+ }, []), !u && !t ? null : /* @__PURE__ */ A(
239
+ s ? L : "span",
238
240
  {
239
- ref: (b) => {
240
- l.current = b;
241
+ ref: (p) => {
242
+ l.current = p;
241
243
  },
242
244
  "data-state": u ? "checked" : "unchecked",
243
245
  className: q("flex items-center justify-center text-current", i),
@@ -246,9 +248,9 @@ const Y = L(
246
248
  );
247
249
  }
248
250
  );
249
- Y.displayName = "RadioGroupIndicator";
251
+ Z.displayName = "RadioGroupIndicator";
250
252
  export {
251
- W as RadioGroup,
252
- Y as RadioGroupIndicator,
253
- X as RadioGroupItem
253
+ X as RadioGroup,
254
+ Z as RadioGroupIndicator,
255
+ Y as RadioGroupItem
254
256
  };
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import './assets/main.css';
3
+ import { jsx as t, jsxs as d } from "react/jsx-runtime";
4
+ import { RadioGroup as l, RadioGroupItem as n, RadioGroupIndicator as m } from "./RadioGroup/RadioGroupBase.js";
5
+ import { c as e } from "./twUtils-CRiPKpXj.js";
6
+ import { createContext as u, useContext as p } from "react";
7
+ import { c as f } from "./createLucideIcon-CI1yJrZf.js";
8
+ /**
9
+ * @license lucide-react v0.542.0 - ISC
10
+ *
11
+ * This source code is licensed under the ISC license.
12
+ * See the LICENSE file in the root directory of this source tree.
13
+ */
14
+ const x = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], y = f("circle", x), i = u({
15
+ variant: "default"
16
+ }), v = ({ className: r, variant: o = "default", ...a }) => /* @__PURE__ */ t(i.Provider, { value: { variant: o }, children: /* @__PURE__ */ t(
17
+ l,
18
+ {
19
+ "data-slot": "radio-group",
20
+ className: e("grid gap-3", r),
21
+ variant: o,
22
+ ...a
23
+ }
24
+ ) }), C = ({ className: r, children: o, ...a }) => {
25
+ const { variant: s } = p(i), c = s === "unstyled";
26
+ return /* @__PURE__ */ d(n, { "data-slot": "radio-group-item", className: e(r), ...a, children: [
27
+ !c && /* @__PURE__ */ t(
28
+ m,
29
+ {
30
+ "data-slot": "radio-group-indicator",
31
+ className: "relative flex items-center justify-center",
32
+ children: /* @__PURE__ */ t(y, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
33
+ }
34
+ ),
35
+ o
36
+ ] });
37
+ };
38
+ export {
39
+ v as RadioGroup,
40
+ C as RadioGroupItem
41
+ };