@spear-ai/spectral 1.3.44 → 1.3.46

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 (80) hide show
  1. package/dist/.js +150 -146
  2. package/dist/Accordion/AccordionBase.js +141 -150
  3. package/dist/ButtonIcon.d.ts +14 -0
  4. package/dist/ButtonIcon.js +119 -0
  5. package/dist/Checkbox/CheckboxBase.js +6 -5
  6. package/dist/Icons/AnnotationsIcon.js +6 -5
  7. package/dist/Icons/CalendarIcon.js +4 -3
  8. package/dist/Icons/CheckCircleIcon.js +6 -5
  9. package/dist/Icons/CheckSquareIcon.js +6 -5
  10. package/dist/Icons/ChevronDownIcon.js +6 -5
  11. package/dist/Icons/ChevronUpIcon.js +9 -8
  12. package/dist/Icons/ClockIcon.js +11 -10
  13. package/dist/Icons/CloseCircleIcon.js +12 -11
  14. package/dist/Icons/CloseIcon.js +10 -9
  15. package/dist/Icons/DashboardIcon.js +6 -5
  16. package/dist/Icons/DeleteIcon.js +10 -9
  17. package/dist/Icons/DurationIcon.js +3 -2
  18. package/dist/Icons/EraserIcon.js +12 -11
  19. package/dist/Icons/ErrorIcon.js +3 -2
  20. package/dist/Icons/EyeClosedIcon.js +9 -8
  21. package/dist/Icons/EyeClosedIcon2.js +6 -5
  22. package/dist/Icons/EyeOpenIcon.js +11 -10
  23. package/dist/Icons/GoToFirstIcon.js +5 -4
  24. package/dist/Icons/GoToLastIcon.js +6 -5
  25. package/dist/Icons/HarmonicCursorsIcon.js +10 -9
  26. package/dist/Icons/InfoIcon.js +9 -8
  27. package/dist/Icons/LabelIcon.js +6 -5
  28. package/dist/Icons/LassoIcon.js +8 -7
  29. package/dist/Icons/LineToolIcon.js +9 -8
  30. package/dist/Icons/LiveViewIcon.js +7 -6
  31. package/dist/Icons/LoaderIcon.js +6 -5
  32. package/dist/Icons/LocationIcon.js +12 -11
  33. package/dist/Icons/LogoutIcon.js +4 -3
  34. package/dist/Icons/MetadataIcon.js +6 -5
  35. package/dist/Icons/OntologyIcon.js +3 -2
  36. package/dist/Icons/PanelIcon.js +4 -3
  37. package/dist/Icons/PlayIcon.js +8 -7
  38. package/dist/Icons/PlusIcon.js +8 -7
  39. package/dist/Icons/ResetIcon.js +14 -13
  40. package/dist/Icons/ScissorsIcon.js +7 -6
  41. package/dist/Icons/SettingsIcon.js +3 -2
  42. package/dist/Icons/TrashIcon.js +9 -8
  43. package/dist/Icons/UndoIcon.js +6 -5
  44. package/dist/Icons/UserIcon.js +7 -6
  45. package/dist/Icons/WarningIcon.js +13 -12
  46. package/dist/Icons/ZoomAllIcon.js +7 -6
  47. package/dist/Icons/ZoomXIcon.js +9 -8
  48. package/dist/Icons/ZoomYIcon.js +9 -8
  49. package/dist/Input.d.ts +2 -0
  50. package/dist/Input.js +48 -46
  51. package/dist/RadioGroup/RadioGroupBase.js +130 -138
  52. package/dist/Switch/SwitchBase.js +22 -21
  53. package/dist/Toggle/ToggleBase.js +4 -4
  54. package/dist/ToggleGroup/ToggleGroupBase.js +6 -5
  55. package/dist/components/Accordion/AccordionBase.d.ts.map +1 -1
  56. package/dist/components/ButtonIcon/ButtonIcon.d.ts +14 -0
  57. package/dist/components/ButtonIcon/ButtonIcon.d.ts.map +1 -0
  58. package/dist/components/Checkbox/CheckboxBase.d.ts.map +1 -1
  59. package/dist/components/Input/Input.d.ts +2 -0
  60. package/dist/components/Input/Input.d.ts.map +1 -1
  61. package/dist/components/RadioGroup/RadioGroupBase.d.ts.map +1 -1
  62. package/dist/components/Switch/SwitchBase.d.ts.map +1 -1
  63. package/dist/components/Toggle/ToggleBase.d.ts.map +1 -1
  64. package/dist/components/ToggleGroup/ToggleGroupBase.d.ts.map +1 -1
  65. package/dist/hooks/useControllableState.d.ts +9 -0
  66. package/dist/hooks/useControllableState.d.ts.map +1 -0
  67. package/dist/hooks/useControllableState.js +15 -0
  68. package/dist/index.d.ts +2 -0
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/styles/main.css +1 -1
  71. package/dist/utils/sharedUtils.d.ts +2 -0
  72. package/dist/utils/sharedUtils.d.ts.map +1 -0
  73. package/dist/utils/sharedUtils.js +6 -0
  74. package/package.json +1 -1
  75. package/dist/hooks/useOutsideClick.d.ts +0 -8
  76. package/dist/hooks/useOutsideClick.d.ts.map +0 -1
  77. package/dist/hooks/useOutsideClick.js +0 -16
  78. package/dist/utils/shared.d.ts +0 -24
  79. package/dist/utils/shared.d.ts.map +0 -1
  80. package/dist/utils/shared.js +0 -29
@@ -1,234 +1,225 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
- import { jsx as C } from "react/jsx-runtime";
3
+ import { jsx as x } from "react/jsx-runtime";
4
+ import { useControllableState as P } from "../hooks/useControllableState.js";
4
5
  import { Slot as M } from "../primitives/slot.js";
5
- import { createContext as j, forwardRef as V, useRef as S, useState as O, useCallback as I, useEffect as T, useContext as N, useId as H, useLayoutEffect as L } from "react";
6
- function D(...v) {
7
- return v.filter(Boolean).join(" ");
6
+ import { createContext as j, forwardRef as E, useRef as S, useState as T, useCallback as R, useEffect as O, useContext as D, useId as H, useLayoutEffect as L } from "react";
7
+ function N(...g) {
8
+ return g.filter(Boolean).join(" ");
8
9
  }
9
- function P(v) {
10
- const { value: l, defaultValue: s, onChange: a } = v, [c, d] = O(s), i = l !== void 0, o = i ? l : c, n = I(
11
- (t) => {
12
- const b = typeof t == "function" ? t(o) : t;
13
- i || d(b), a?.(b);
14
- },
15
- [i, a, o]
16
- );
17
- return [o, n];
18
- }
19
- const E = j(null), U = V(
10
+ const V = j(null), z = E(
20
11
  ({
21
- className: v,
22
- children: l,
23
- type: s = "single",
24
- value: a,
25
- defaultValue: c,
26
- onValueChange: d,
27
- collapsible: i = !1,
12
+ className: g,
13
+ children: u,
14
+ type: i = "single",
15
+ value: f,
16
+ defaultValue: l,
17
+ onValueChange: a,
18
+ collapsible: s = !1,
28
19
  dir: o = "ltr",
29
- disabled: n = !1,
30
- rovingFocus: t = !0,
31
- ...b
32
- }, f) => {
33
- const [m, u] = P({
34
- value: typeof a == "string" ? a : void 0,
35
- defaultValue: typeof c == "string" ? c : (Array.isArray(c) && c.length > 0, void 0),
36
- onChange: (r) => d?.(s === "single" ? r ?? "" : [])
37
- }), [A, R] = P({
38
- value: Array.isArray(a) ? a : void 0,
39
- defaultValue: Array.isArray(c) ? c : [],
40
- onChange: (r) => d?.(s === "multiple" ? r : "")
41
- }), w = S([]), [k, y] = O(void 0), F = I(
42
- (r) => s === "single" ? m === r : A.includes(r),
43
- [s, m, A]
44
- ), e = I(
45
- (r) => {
46
- if (!n) {
47
- if (s === "single") {
48
- m === r ? i && u(void 0) : u(r);
20
+ disabled: r = !1,
21
+ rovingFocus: n = !0,
22
+ ...I
23
+ }, d) => {
24
+ const [v, c] = P({
25
+ value: typeof f == "string" ? f : void 0,
26
+ defaultValue: typeof l == "string" ? l : (Array.isArray(l) && l.length > 0, void 0),
27
+ onChange: (t) => a?.(i === "single" ? t ?? "" : [])
28
+ }), [A, C] = P({
29
+ value: Array.isArray(f) ? f : void 0,
30
+ defaultValue: Array.isArray(l) ? l : [],
31
+ onChange: (t) => a?.(i === "multiple" ? t : "")
32
+ }), h = S([]), [k, p] = T(void 0), F = R(
33
+ (t) => i === "single" ? v === t : A.includes(t),
34
+ [i, v, A]
35
+ ), e = R(
36
+ (t) => {
37
+ if (!r) {
38
+ if (i === "single") {
39
+ v === t ? s && c(void 0) : c(t);
49
40
  return;
50
41
  }
51
- R((p) => {
52
- const h = new Set(p);
53
- return h.has(r) ? h.delete(r) : h.add(r), Array.from(h);
42
+ C((b) => {
43
+ const y = new Set(b);
44
+ return y.has(t) ? y.delete(t) : y.add(t), Array.from(y);
54
45
  });
55
46
  }
56
47
  },
57
- [i, n, R, u, s, m]
58
- ), g = I((r) => (w.current.push(r), () => {
59
- w.current = w.current.filter((p) => p.value !== r.value);
48
+ [s, r, C, c, i, v]
49
+ ), m = R((t) => (h.current.push(t), () => {
50
+ h.current = h.current.filter((b) => b.value !== t.value);
60
51
  }), []);
61
- T(() => {
52
+ O(() => {
62
53
  if (k) return;
63
- const r = w.current.find((p) => !p.disabled);
64
- r && y(r.value);
54
+ const t = h.current.find((b) => !b.disabled);
55
+ t && p(t.value);
65
56
  }, [k]);
66
- const x = {
67
- type: s,
57
+ const w = {
58
+ type: i,
68
59
  dir: o,
69
- collapsible: i,
70
- disabled: n,
71
- itemsRef: w,
72
- registerItem: g,
60
+ collapsible: s,
61
+ disabled: r,
62
+ itemsRef: h,
63
+ registerItem: m,
73
64
  isItemOpen: F,
74
65
  toggleItem: e,
75
- focusValue: t ? k : void 0,
76
- setFocusValue: (r) => {
77
- t && y(r);
66
+ focusValue: n ? k : void 0,
67
+ setFocusValue: (t) => {
68
+ n && p(t);
78
69
  }
79
70
  };
80
- return /* @__PURE__ */ C(E.Provider, { value: x, children: /* @__PURE__ */ C("div", { ref: f, className: D("divide-border divide-y", v), ...b, children: l }) });
71
+ return /* @__PURE__ */ x(V.Provider, { value: w, children: /* @__PURE__ */ x("div", { ref: d, className: N("divide-border divide-y", g), ...I, children: u }) });
81
72
  }
82
73
  );
83
- U.displayName = "Accordion";
84
- const $ = j(null), z = V(
85
- ({ className: v, value: l, disabled: s = !1, children: a, ...c }, d) => {
86
- const i = N(E);
87
- if (!i) throw new Error("AccordionItem must be used within Accordion");
88
- const o = i.isItemOpen(l), n = S(null);
89
- return T(() => {
90
- const t = { value: l, disabled: s, triggerRef: n };
91
- return i.registerItem(t);
92
- }, [i, l, s]), /* @__PURE__ */ C($.Provider, { value: { value: l, open: o, disabled: s || i.disabled }, children: /* @__PURE__ */ C(
74
+ z.displayName = "Accordion";
75
+ const $ = j(null), B = E(
76
+ ({ className: g, value: u, disabled: i = !1, children: f, ...l }, a) => {
77
+ const s = D(V);
78
+ if (!s) throw new Error("AccordionItem must be used within Accordion");
79
+ const o = s.isItemOpen(u), r = S(null);
80
+ return O(() => {
81
+ const n = { value: u, disabled: i, triggerRef: r };
82
+ return s.registerItem(n);
83
+ }, [s, u, i]), /* @__PURE__ */ x($.Provider, { value: { value: u, open: o, disabled: i || s.disabled }, children: /* @__PURE__ */ x(
93
84
  "div",
94
85
  {
95
- ref: d,
86
+ ref: a,
96
87
  "data-state": o ? "open" : "closed",
97
- "data-disabled": s || i.disabled ? "" : void 0,
98
- className: D("outline-none", v),
99
- ...c,
100
- children: a
88
+ "data-disabled": i || s.disabled ? "" : void 0,
89
+ className: N("outline-none", g),
90
+ ...l,
91
+ children: f
101
92
  }
102
93
  ) });
103
94
  }
104
95
  );
105
- z.displayName = "AccordionItem";
106
- const B = V(
107
- ({ asChild: v, className: l, onClick: s, onKeyDown: a, disabled: c, id: d, ...i }, o) => {
108
- const n = N(E), t = N($);
109
- if (!n || !t) throw new Error("AccordionTrigger must be used within AccordionItem");
110
- const b = d ?? `act-${H()}`, f = c || t.disabled || n.disabled, m = t.open, u = v ? M : "button", A = (e) => {
111
- if (t && "value" in t) {
112
- const g = n.itemsRef.current.find((x) => x.value === t.value);
113
- g && (g.triggerRef.current = e);
96
+ B.displayName = "AccordionItem";
97
+ const K = E(
98
+ ({ asChild: g, className: u, onClick: i, onKeyDown: f, disabled: l, id: a, ...s }, o) => {
99
+ const r = D(V), n = D($);
100
+ if (!r || !n) throw new Error("AccordionTrigger must be used within AccordionItem");
101
+ const I = a ?? `act-${H()}`, d = l || n.disabled || r.disabled, v = n.open, c = g ? M : "button", A = (e) => {
102
+ if (n && "value" in n) {
103
+ const m = r.itemsRef.current.find((w) => w.value === n.value);
104
+ m && (m.triggerRef.current = e);
114
105
  }
115
106
  typeof o == "function" ? o(e) : o && "current" in o && (o.current = e);
116
- }, w = (n.focusValue === void 0 ? !0 : n.focusValue === t.value && !f) ? 0 : -1, k = I(
107
+ }, h = (r.focusValue === void 0 ? !0 : r.focusValue === n.value && !d) ? 0 : -1, k = R(
117
108
  (e) => {
118
- s?.(e), !e.defaultPrevented && (f || (n.toggleItem(t.value), n.setFocusValue(t.value)));
109
+ i?.(e), !e.defaultPrevented && (d || (r.toggleItem(n.value), r.setFocusValue(n.value)));
119
110
  },
120
- [f, t.value, s, n]
121
- ), y = I(
111
+ [d, n.value, i, r]
112
+ ), p = R(
122
113
  (e) => {
123
- const g = n.itemsRef.current.filter((h) => !h.disabled);
124
- if (!g.length) return;
125
- const x = g.findIndex((h) => h.value === t.value);
126
- let r = x;
127
- e === "first" ? r = 0 : e === "last" ? r = g.length - 1 : e === "prev" ? r = Math.max(0, x - 1) : r = Math.min(g.length - 1, x + 1);
128
- const p = g[r];
129
- p && (n.setFocusValue(p.value), p.triggerRef.current?.focus());
114
+ const m = r.itemsRef.current.filter((y) => !y.disabled);
115
+ if (!m.length) return;
116
+ const w = m.findIndex((y) => y.value === n.value);
117
+ let t = w;
118
+ e === "first" ? t = 0 : e === "last" ? t = m.length - 1 : e === "prev" ? t = Math.max(0, w - 1) : t = Math.min(m.length - 1, w + 1);
119
+ const b = m[t];
120
+ b && (r.setFocusValue(b.value), b.triggerRef.current?.focus());
130
121
  },
131
- [t.value, n]
132
- ), F = I(
122
+ [n.value, r]
123
+ ), F = R(
133
124
  (e) => {
134
- if (a?.(e), !e.defaultPrevented) {
125
+ if (f?.(e), !e.defaultPrevented) {
135
126
  if (e.key === "Home") {
136
- e.preventDefault(), y("first");
127
+ e.preventDefault(), p("first");
137
128
  return;
138
129
  }
139
130
  if (e.key === "End") {
140
- e.preventDefault(), y("last");
131
+ e.preventDefault(), p("last");
141
132
  return;
142
133
  }
143
134
  if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
144
- e.preventDefault(), y(n.dir === "rtl" ? "next" : "prev");
135
+ e.preventDefault(), p(r.dir === "rtl" ? "next" : "prev");
145
136
  return;
146
137
  }
147
138
  if (e.key === "ArrowDown" || e.key === "ArrowRight") {
148
- e.preventDefault(), y(n.dir === "rtl" ? "prev" : "next");
139
+ e.preventDefault(), p(r.dir === "rtl" ? "prev" : "next");
149
140
  return;
150
141
  }
151
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), f || n.toggleItem(t.value));
142
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d || r.toggleItem(n.value));
152
143
  }
153
144
  },
154
- [f, t.value, y, a, n]
145
+ [d, n.value, p, f, r]
155
146
  );
156
- return /* @__PURE__ */ C(
157
- u,
147
+ return /* @__PURE__ */ x(
148
+ c,
158
149
  {
159
- id: b,
150
+ id: I,
160
151
  ref: A,
161
152
  type: "button",
162
- "aria-expanded": m,
163
- "aria-controls": `acc-content-${t.value}`,
164
- "aria-disabled": f || void 0,
165
- "data-state": m ? "open" : "closed",
166
- "data-disabled": f ? "" : void 0,
167
- tabIndex: w,
153
+ "aria-expanded": v,
154
+ "aria-controls": `acc-content-${n.value}`,
155
+ "aria-disabled": d || void 0,
156
+ "data-state": v ? "open" : "closed",
157
+ "data-disabled": d ? "" : void 0,
158
+ tabIndex: h,
168
159
  onClick: k,
169
160
  onKeyDown: F,
170
- className: D(
161
+ className: N(
171
162
  "flex w-full items-center justify-between py-3 text-left",
172
163
  "focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
173
164
  "disabled:cursor-not-allowed disabled:opacity-50",
174
- l
165
+ u
175
166
  ),
176
- ...i
167
+ ...s
177
168
  }
178
169
  );
179
170
  }
180
171
  );
181
- B.displayName = "AccordionTrigger";
182
- const K = V(
183
- ({ asChild: v, className: l, forceMount: s, id: a, ...c }, d) => {
184
- const i = N(E), o = N($);
185
- if (!i || !o) throw new Error("AccordionContent must be used within AccordionItem");
186
- const n = o.open, t = a ?? `acc-content-${o.value}`, b = S(null), f = (u) => {
187
- b.current = u, typeof d == "function" ? d(u) : d && "current" in d && (d.current = u);
172
+ K.displayName = "AccordionTrigger";
173
+ const U = E(
174
+ ({ asChild: g, className: u, forceMount: i, id: f, ...l }, a) => {
175
+ const s = D(V), o = D($);
176
+ if (!s || !o) throw new Error("AccordionContent must be used within AccordionItem");
177
+ const r = o.open, n = f ?? `acc-content-${o.value}`, I = S(null), d = (c) => {
178
+ I.current = c, typeof a == "function" ? a(c) : a && "current" in a && (a.current = c);
188
179
  };
189
180
  L(() => {
190
- const u = b.current;
191
- if (!u) return;
181
+ const c = I.current;
182
+ if (!c) return;
192
183
  const A = () => {
193
- u.style.setProperty("--radix-accordion-content-height", `${u.scrollHeight}px`);
184
+ c.style.setProperty("--radix-accordion-content-height", `${c.scrollHeight}px`);
194
185
  };
195
186
  A();
196
- const R = new ResizeObserver(A);
197
- return R.observe(u), () => R.disconnect();
187
+ const C = new ResizeObserver(A);
188
+ return C.observe(c), () => C.disconnect();
198
189
  }, []);
199
- const m = v ? M : "div";
200
- return !n && !s ? /* @__PURE__ */ C(
201
- m,
190
+ const v = g ? M : "div";
191
+ return !r && !i ? /* @__PURE__ */ x(
192
+ v,
202
193
  {
203
- id: t,
194
+ id: n,
204
195
  role: "region",
205
196
  "aria-labelledby": `act-${o.value}`,
206
197
  hidden: !0,
207
198
  "data-state": "closed",
208
- "data-disabled": o.disabled || i.disabled ? "" : void 0,
209
- className: D(l),
210
- ref: f,
211
- ...c
199
+ "data-disabled": o.disabled || s.disabled ? "" : void 0,
200
+ className: N(u),
201
+ ref: d,
202
+ ...l
212
203
  }
213
- ) : /* @__PURE__ */ C(
214
- m,
204
+ ) : /* @__PURE__ */ x(
205
+ v,
215
206
  {
216
- id: t,
207
+ id: n,
217
208
  role: "region",
218
209
  "aria-labelledby": `act-${o.value}`,
219
- "data-state": n ? "open" : "closed",
220
- "data-disabled": o.disabled || i.disabled ? "" : void 0,
221
- className: D("overflow-hidden", l),
222
- ref: f,
223
- ...c
210
+ "data-state": r ? "open" : "closed",
211
+ "data-disabled": o.disabled || s.disabled ? "" : void 0,
212
+ className: N("overflow-hidden", u),
213
+ ref: d,
214
+ ...l
224
215
  }
225
216
  );
226
217
  }
227
218
  );
228
- K.displayName = "AccordionContent";
219
+ U.displayName = "AccordionContent";
229
220
  export {
230
- U as Accordion,
231
- K as AccordionContent,
232
- z as AccordionItem,
233
- B as AccordionTrigger
221
+ z as Accordion,
222
+ U as AccordionContent,
223
+ B as AccordionItem,
224
+ K as AccordionTrigger
234
225
  };
@@ -0,0 +1,14 @@
1
+ import { ButtonHTMLAttributes, MouseEvent, ReactElement } from 'react';
2
+ type IconOrSVG = ReactElement | (() => ReactElement);
3
+ export interface ButtonIconProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> {
4
+ icon: IconOrSVG;
5
+ className?: string;
6
+ isLoading?: boolean;
7
+ label: string;
8
+ onClick?: (event: MouseEvent<HTMLButtonElement>, isSelected?: boolean) => void;
9
+ shape?: 'circle' | 'square';
10
+ size?: 'small' | 'default' | 'large';
11
+ }
12
+ export declare const ButtonIcon: import('react').ForwardRefExoticComponent<ButtonIconProps & import('react').RefAttributes<HTMLButtonElement>>;
13
+ export {};
14
+ //# sourceMappingURL=ButtonIcon.d.ts.map
@@ -0,0 +1,119 @@
1
+ "use client";
2
+ import "./styles/main.css";
3
+ import { jsx as f } from "react/jsx-runtime";
4
+ import "./Icons/AnnotationsIcon.js";
5
+ import "./Icons/CalendarIcon.js";
6
+ import "./Icons/CheckCircleIcon.js";
7
+ import "./Icons/CheckSquareIcon.js";
8
+ import "./Icons/ChevronDownIcon.js";
9
+ import "./Icons/ChevronUpIcon.js";
10
+ import "./Icons/ClockIcon.js";
11
+ import "./Icons/CloseCircleIcon.js";
12
+ import "./Icons/CloseIcon.js";
13
+ import "./Icons/DashboardIcon.js";
14
+ import "./Icons/DeleteIcon.js";
15
+ import "./Icons/DurationIcon.js";
16
+ import "./Icons/EraserIcon.js";
17
+ import "./Icons/ErrorIcon.js";
18
+ import "./Icons/EyeClosedIcon.js";
19
+ import "./Icons/EyeClosedIcon2.js";
20
+ import "./Icons/EyeOpenIcon.js";
21
+ import "./Icons/GoToFirstIcon.js";
22
+ import "./Icons/GoToLastIcon.js";
23
+ import "./Icons/HarmonicCursorsIcon.js";
24
+ import "./Icons/InfoIcon.js";
25
+ import "./Icons/LabelIcon.js";
26
+ import "./Icons/LassoIcon.js";
27
+ import "./Icons/LineToolIcon.js";
28
+ import "./Icons/LiveViewIcon.js";
29
+ import { LoaderIcon as S } from "./Icons/LoaderIcon.js";
30
+ import "./Icons/LocationIcon.js";
31
+ import "./Icons/LogoutIcon.js";
32
+ import "./Icons/MetadataIcon.js";
33
+ import "./Icons/OntologyIcon.js";
34
+ import "./Icons/PanelIcon.js";
35
+ import "./Icons/PlayIcon.js";
36
+ import "./Icons/PlusIcon.js";
37
+ import "./Icons/ResetIcon.js";
38
+ import "./Icons/ScissorsIcon.js";
39
+ import "./Icons/SettingsIcon.js";
40
+ import "./Icons/TrashIcon.js";
41
+ import "./Icons/UndoIcon.js";
42
+ import "./Icons/UserIcon.js";
43
+ import "./Icons/WarningIcon.js";
44
+ import "./Icons/ZoomAllIcon.js";
45
+ import "./Icons/ZoomXIcon.js";
46
+ import "./Icons/ZoomYIcon.js";
47
+ import { c as s } from "./twUtils-CRiPKpXj.js";
48
+ import { forwardRef as x, useState as k, useCallback as C, isValidElement as z, cloneElement as p } from "react";
49
+ const E = `bg-transparent hover:bg-level-one text-text-primary inline-flex items-center justify-center whitespace-nowrap transition-colors focus:outline-none focus-visible:outline-2
50
+ focus-visible:outline-offset-2 focus-visible:outline-level-two cursor-pointer [&_svg]:pointer-events-none [&_svg]:shrink-0`, m = {
51
+ small: { button: "h-8 w-8", icon: 16 },
52
+ default: { button: "h-12 w-12", icon: 24 },
53
+ large: { button: "h-16 w-16", icon: 32 }
54
+ }, j = x(
55
+ ({ className: d, onClick: c, label: l, icon: i, shape: h = "square", size: n = "default", isLoading: e = !1, disabled: a, ...b }, v) => {
56
+ const [r, y] = k(!1), w = C(
57
+ (t) => {
58
+ const o = !r;
59
+ y(o), c?.(t, o);
60
+ },
61
+ [r, c]
62
+ ), I = e ? `${l} - Loading` : l, g = () => {
63
+ if (e)
64
+ return /* @__PURE__ */ f(S, { size: m[n].icon, "aria-hidden": "true" });
65
+ const t = typeof i == "function" ? i() : i;
66
+ if (z(t)) {
67
+ const o = m[n].icon;
68
+ if (t.type === "svg")
69
+ return p(t, {
70
+ width: o,
71
+ height: o,
72
+ className: s("shrink-0", t.props.className),
73
+ "aria-hidden": "true"
74
+ });
75
+ {
76
+ const u = {
77
+ className: s("shrink-0", t.props.className),
78
+ "aria-hidden": "true"
79
+ };
80
+ if (t.type.displayName?.includes("Icon") ?? !1) {
81
+ const N = {
82
+ ...u,
83
+ size: o
84
+ };
85
+ return p(t, N);
86
+ }
87
+ return p(t, u);
88
+ }
89
+ }
90
+ return t;
91
+ };
92
+ return /* @__PURE__ */ f(
93
+ "button",
94
+ {
95
+ className: s(
96
+ E,
97
+ h === "circle" ? "rounded-full" : "rounded-[0.75rem]",
98
+ m[n].button,
99
+ r && "bg-level-one text-primary-400",
100
+ e && "cursor-wait",
101
+ a && "cursor-not-allowed opacity-50",
102
+ d
103
+ ),
104
+ ref: v,
105
+ disabled: a || e,
106
+ "aria-label": I,
107
+ "aria-pressed": r,
108
+ "data-testid": "button-icon",
109
+ onClick: w,
110
+ ...b,
111
+ children: g()
112
+ }
113
+ );
114
+ }
115
+ );
116
+ j.displayName = "ButtonIcon";
117
+ export {
118
+ j as ButtonIcon
119
+ };
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import "../styles/main.css";
3
3
  import { jsx as m, jsxs as M } from "react/jsx-runtime";
4
+ import { useControllableState as O } from "../hooks/useControllableState.js";
4
5
  import { Slot as C } from "../primitives/slot.js";
5
- import { useControllableState as O, cn as w } from "../utils/shared.js";
6
+ import { c as w } from "../twUtils-CRiPKpXj.js";
6
7
  import { createContext as T, forwardRef as E, useRef as V, useId as $, useEffect as y, useCallback as u, useContext as z } from "react";
7
8
  const R = T(null);
8
9
  function I(r) {
@@ -20,8 +21,8 @@ const B = E(
20
21
  onCheckedChange: f,
21
22
  disabled: n,
22
23
  required: h,
23
- name: b,
24
- value: p = "on",
24
+ name: p,
25
+ value: b = "on",
25
26
  form: N,
26
27
  id: j,
27
28
  onClick: v,
@@ -95,8 +96,8 @@ const B = E(
95
96
  {
96
97
  ref: o,
97
98
  type: "checkbox",
98
- name: b,
99
- value: p,
99
+ name: p,
100
+ value: b,
100
101
  required: h,
101
102
  disabled: n,
102
103
  form: N,
@@ -3,13 +3,13 @@ import "../styles/main.css";
3
3
  import { jsx as o } from "react/jsx-runtime";
4
4
  import c from "./IconBase.js";
5
5
  import { forwardRef as d } from "react";
6
- const L = ({ className: n, ariaHidden: r, title: t = "Annotations", description: e, size: i = 24, ...s }, a) => /* @__PURE__ */ o(
6
+ const L = ({ className: n, ariaHidden: r, title: t = "Annotations", description: i, size: e = 24, ...s }, a) => /* @__PURE__ */ o(
7
7
  c,
8
8
  {
9
- size: i,
9
+ size: e,
10
10
  className: n,
11
11
  title: t,
12
- description: e,
12
+ description: i,
13
13
  "aria-hidden": r,
14
14
  ref: a,
15
15
  ...s,
@@ -24,7 +24,8 @@ const L = ({ className: n, ariaHidden: r, title: t = "Annotations", description:
24
24
  }
25
25
  )
26
26
  }
27
- ), C = d(L);
27
+ ), m = d(L);
28
+ m.displayName = "AnnotationsIcon";
28
29
  export {
29
- C as AnnotationsIcon
30
+ m as AnnotationsIcon
30
31
  };
@@ -3,7 +3,7 @@ import "../styles/main.css";
3
3
  import { jsxs as a, jsx as r } from "react/jsx-runtime";
4
4
  import k from "./IconBase.js";
5
5
  import { forwardRef as c } from "react";
6
- const u = ({ className: o, ariaHidden: e, title: n = "Calendar", description: t, size: d = 24, ...i }, s) => /* @__PURE__ */ a(
6
+ const p = ({ className: o, ariaHidden: e, title: n = "Calendar", description: t, size: d = 24, ...i }, s) => /* @__PURE__ */ a(
7
7
  k,
8
8
  {
9
9
  size: d,
@@ -56,7 +56,8 @@ const u = ({ className: o, ariaHidden: e, title: n = "Calendar", description: t,
56
56
  )
57
57
  ]
58
58
  }
59
- ), l = c(u);
59
+ ), u = c(p);
60
+ u.displayName = "CalendarIcon";
60
61
  export {
61
- l as CalendarIcon
62
+ u as CalendarIcon
62
63
  };
@@ -3,16 +3,16 @@ import "../styles/main.css";
3
3
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
4
4
  import d from "./IconBase.js";
5
5
  import { forwardRef as h } from "react";
6
- const k = ({ className: o, ariaHidden: e, title: n = "Checkmark in Circle", description: t, size: i = 24, ...c }, a) => /* @__PURE__ */ s(
6
+ const l = ({ className: o, ariaHidden: e, title: n = "Checkmark in Circle", description: c, size: i = 24, ...t }, a) => /* @__PURE__ */ s(
7
7
  d,
8
8
  {
9
9
  size: i,
10
10
  className: o,
11
11
  title: n,
12
- description: t,
12
+ description: c,
13
13
  "aria-hidden": e,
14
14
  ref: a,
15
- ...c,
15
+ ...t,
16
16
  stroke: "currentColor",
17
17
  strokeWidth: "2",
18
18
  strokeLinecap: "round",
@@ -23,7 +23,8 @@ const k = ({ className: o, ariaHidden: e, title: n = "Checkmark in Circle", desc
23
23
  /* @__PURE__ */ r("path", { d: "M9 12l2 2l4 -4" })
24
24
  ]
25
25
  }
26
- ), C = h(k);
26
+ ), k = h(l);
27
+ k.displayName = "CheckCircleIcon";
27
28
  export {
28
- C as CheckCircleIcon
29
+ k as CheckCircleIcon
29
30
  };
@@ -3,16 +3,16 @@ import "../styles/main.css";
3
3
  import { jsxs as i, jsx as r } from "react/jsx-runtime";
4
4
  import d from "./IconBase.js";
5
5
  import { forwardRef as h } from "react";
6
- const k = ({ className: o, ariaHidden: e, title: n = "Checkmark in Square", description: t, size: s = 24, ...a }, c) => /* @__PURE__ */ i(
6
+ const k = ({ className: o, ariaHidden: e, title: n = "Checkmark in Square", description: t, size: a = 24, ...s }, c) => /* @__PURE__ */ i(
7
7
  d,
8
8
  {
9
- size: s,
9
+ size: a,
10
10
  className: o,
11
11
  title: n,
12
12
  description: t,
13
13
  "aria-hidden": e,
14
14
  ref: c,
15
- ...a,
15
+ ...s,
16
16
  stroke: "currentColor",
17
17
  strokeWidth: "2",
18
18
  strokeLinecap: "round",
@@ -23,7 +23,8 @@ const k = ({ className: o, ariaHidden: e, title: n = "Checkmark in Square", desc
23
23
  /* @__PURE__ */ r("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" })
24
24
  ]
25
25
  }
26
- ), f = h(k);
26
+ ), p = h(k);
27
+ p.displayName = "CheckSquareIcon";
27
28
  export {
28
- f as CheckSquareIcon
29
+ p as CheckSquareIcon
29
30
  };