@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.
- package/dist/.js +150 -146
- package/dist/Accordion/AccordionBase.js +141 -150
- package/dist/ButtonIcon.d.ts +14 -0
- package/dist/ButtonIcon.js +119 -0
- package/dist/Checkbox/CheckboxBase.js +6 -5
- package/dist/Icons/AnnotationsIcon.js +6 -5
- package/dist/Icons/CalendarIcon.js +4 -3
- package/dist/Icons/CheckCircleIcon.js +6 -5
- package/dist/Icons/CheckSquareIcon.js +6 -5
- package/dist/Icons/ChevronDownIcon.js +6 -5
- package/dist/Icons/ChevronUpIcon.js +9 -8
- package/dist/Icons/ClockIcon.js +11 -10
- package/dist/Icons/CloseCircleIcon.js +12 -11
- package/dist/Icons/CloseIcon.js +10 -9
- package/dist/Icons/DashboardIcon.js +6 -5
- package/dist/Icons/DeleteIcon.js +10 -9
- package/dist/Icons/DurationIcon.js +3 -2
- package/dist/Icons/EraserIcon.js +12 -11
- package/dist/Icons/ErrorIcon.js +3 -2
- package/dist/Icons/EyeClosedIcon.js +9 -8
- package/dist/Icons/EyeClosedIcon2.js +6 -5
- package/dist/Icons/EyeOpenIcon.js +11 -10
- package/dist/Icons/GoToFirstIcon.js +5 -4
- package/dist/Icons/GoToLastIcon.js +6 -5
- package/dist/Icons/HarmonicCursorsIcon.js +10 -9
- package/dist/Icons/InfoIcon.js +9 -8
- package/dist/Icons/LabelIcon.js +6 -5
- package/dist/Icons/LassoIcon.js +8 -7
- package/dist/Icons/LineToolIcon.js +9 -8
- package/dist/Icons/LiveViewIcon.js +7 -6
- package/dist/Icons/LoaderIcon.js +6 -5
- package/dist/Icons/LocationIcon.js +12 -11
- package/dist/Icons/LogoutIcon.js +4 -3
- package/dist/Icons/MetadataIcon.js +6 -5
- package/dist/Icons/OntologyIcon.js +3 -2
- package/dist/Icons/PanelIcon.js +4 -3
- package/dist/Icons/PlayIcon.js +8 -7
- package/dist/Icons/PlusIcon.js +8 -7
- package/dist/Icons/ResetIcon.js +14 -13
- package/dist/Icons/ScissorsIcon.js +7 -6
- package/dist/Icons/SettingsIcon.js +3 -2
- package/dist/Icons/TrashIcon.js +9 -8
- package/dist/Icons/UndoIcon.js +6 -5
- package/dist/Icons/UserIcon.js +7 -6
- package/dist/Icons/WarningIcon.js +13 -12
- package/dist/Icons/ZoomAllIcon.js +7 -6
- package/dist/Icons/ZoomXIcon.js +9 -8
- package/dist/Icons/ZoomYIcon.js +9 -8
- package/dist/Input.d.ts +2 -0
- package/dist/Input.js +48 -46
- package/dist/RadioGroup/RadioGroupBase.js +130 -138
- package/dist/Switch/SwitchBase.js +22 -21
- package/dist/Toggle/ToggleBase.js +4 -4
- package/dist/ToggleGroup/ToggleGroupBase.js +6 -5
- package/dist/components/Accordion/AccordionBase.d.ts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.ts +14 -0
- package/dist/components/ButtonIcon/ButtonIcon.d.ts.map +1 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroupBase.d.ts.map +1 -1
- package/dist/components/Switch/SwitchBase.d.ts.map +1 -1
- package/dist/components/Toggle/ToggleBase.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupBase.d.ts.map +1 -1
- package/dist/hooks/useControllableState.d.ts +9 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +15 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/styles/main.css +1 -1
- package/dist/utils/sharedUtils.d.ts +2 -0
- package/dist/utils/sharedUtils.d.ts.map +1 -0
- package/dist/utils/sharedUtils.js +6 -0
- package/package.json +1 -1
- package/dist/hooks/useOutsideClick.d.ts +0 -8
- package/dist/hooks/useOutsideClick.d.ts.map +0 -1
- package/dist/hooks/useOutsideClick.js +0 -16
- package/dist/utils/shared.d.ts +0 -24
- package/dist/utils/shared.d.ts.map +0 -1
- 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
|
|
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
|
|
6
|
-
function
|
|
7
|
-
return
|
|
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
|
-
|
|
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:
|
|
22
|
-
children:
|
|
23
|
-
type:
|
|
24
|
-
value:
|
|
25
|
-
defaultValue:
|
|
26
|
-
onValueChange:
|
|
27
|
-
collapsible:
|
|
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:
|
|
30
|
-
rovingFocus:
|
|
31
|
-
...
|
|
32
|
-
},
|
|
33
|
-
const [
|
|
34
|
-
value: typeof
|
|
35
|
-
defaultValue: typeof
|
|
36
|
-
onChange: (
|
|
37
|
-
}), [A,
|
|
38
|
-
value: Array.isArray(
|
|
39
|
-
defaultValue: Array.isArray(
|
|
40
|
-
onChange: (
|
|
41
|
-
}),
|
|
42
|
-
(
|
|
43
|
-
[
|
|
44
|
-
), e =
|
|
45
|
-
(
|
|
46
|
-
if (!
|
|
47
|
-
if (
|
|
48
|
-
|
|
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
|
-
|
|
52
|
-
const
|
|
53
|
-
return
|
|
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
|
-
[
|
|
58
|
-
),
|
|
59
|
-
|
|
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
|
-
|
|
52
|
+
O(() => {
|
|
62
53
|
if (k) return;
|
|
63
|
-
const
|
|
64
|
-
|
|
54
|
+
const t = h.current.find((b) => !b.disabled);
|
|
55
|
+
t && p(t.value);
|
|
65
56
|
}, [k]);
|
|
66
|
-
const
|
|
67
|
-
type:
|
|
57
|
+
const w = {
|
|
58
|
+
type: i,
|
|
68
59
|
dir: o,
|
|
69
|
-
collapsible:
|
|
70
|
-
disabled:
|
|
71
|
-
itemsRef:
|
|
72
|
-
registerItem:
|
|
60
|
+
collapsible: s,
|
|
61
|
+
disabled: r,
|
|
62
|
+
itemsRef: h,
|
|
63
|
+
registerItem: m,
|
|
73
64
|
isItemOpen: F,
|
|
74
65
|
toggleItem: e,
|
|
75
|
-
focusValue:
|
|
76
|
-
setFocusValue: (
|
|
77
|
-
|
|
66
|
+
focusValue: n ? k : void 0,
|
|
67
|
+
setFocusValue: (t) => {
|
|
68
|
+
n && p(t);
|
|
78
69
|
}
|
|
79
70
|
};
|
|
80
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
84
|
-
const $ = j(null),
|
|
85
|
-
({ className:
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
const o =
|
|
89
|
-
return
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
}, [
|
|
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:
|
|
86
|
+
ref: a,
|
|
96
87
|
"data-state": o ? "open" : "closed",
|
|
97
|
-
"data-disabled":
|
|
98
|
-
className:
|
|
99
|
-
...
|
|
100
|
-
children:
|
|
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
|
-
|
|
106
|
-
const
|
|
107
|
-
({ asChild:
|
|
108
|
-
const
|
|
109
|
-
if (!
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
|
|
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
|
-
},
|
|
107
|
+
}, h = (r.focusValue === void 0 ? !0 : r.focusValue === n.value && !d) ? 0 : -1, k = R(
|
|
117
108
|
(e) => {
|
|
118
|
-
|
|
109
|
+
i?.(e), !e.defaultPrevented && (d || (r.toggleItem(n.value), r.setFocusValue(n.value)));
|
|
119
110
|
},
|
|
120
|
-
[
|
|
121
|
-
),
|
|
111
|
+
[d, n.value, i, r]
|
|
112
|
+
), p = R(
|
|
122
113
|
(e) => {
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
125
|
-
const
|
|
126
|
-
let
|
|
127
|
-
e === "first" ?
|
|
128
|
-
const
|
|
129
|
-
|
|
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
|
-
[
|
|
132
|
-
), F =
|
|
122
|
+
[n.value, r]
|
|
123
|
+
), F = R(
|
|
133
124
|
(e) => {
|
|
134
|
-
if (
|
|
125
|
+
if (f?.(e), !e.defaultPrevented) {
|
|
135
126
|
if (e.key === "Home") {
|
|
136
|
-
e.preventDefault(),
|
|
127
|
+
e.preventDefault(), p("first");
|
|
137
128
|
return;
|
|
138
129
|
}
|
|
139
130
|
if (e.key === "End") {
|
|
140
|
-
e.preventDefault(),
|
|
131
|
+
e.preventDefault(), p("last");
|
|
141
132
|
return;
|
|
142
133
|
}
|
|
143
134
|
if (e.key === "ArrowUp" || e.key === "ArrowLeft") {
|
|
144
|
-
e.preventDefault(),
|
|
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(),
|
|
139
|
+
e.preventDefault(), p(r.dir === "rtl" ? "prev" : "next");
|
|
149
140
|
return;
|
|
150
141
|
}
|
|
151
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
142
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), d || r.toggleItem(n.value));
|
|
152
143
|
}
|
|
153
144
|
},
|
|
154
|
-
[
|
|
145
|
+
[d, n.value, p, f, r]
|
|
155
146
|
);
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
|
|
147
|
+
return /* @__PURE__ */ x(
|
|
148
|
+
c,
|
|
158
149
|
{
|
|
159
|
-
id:
|
|
150
|
+
id: I,
|
|
160
151
|
ref: A,
|
|
161
152
|
type: "button",
|
|
162
|
-
"aria-expanded":
|
|
163
|
-
"aria-controls": `acc-content-${
|
|
164
|
-
"aria-disabled":
|
|
165
|
-
"data-state":
|
|
166
|
-
"data-disabled":
|
|
167
|
-
tabIndex:
|
|
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:
|
|
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
|
-
|
|
165
|
+
u
|
|
175
166
|
),
|
|
176
|
-
...
|
|
167
|
+
...s
|
|
177
168
|
}
|
|
178
169
|
);
|
|
179
170
|
}
|
|
180
171
|
);
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
({ asChild:
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
186
|
-
const
|
|
187
|
-
|
|
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
|
|
191
|
-
if (!
|
|
181
|
+
const c = I.current;
|
|
182
|
+
if (!c) return;
|
|
192
183
|
const A = () => {
|
|
193
|
-
|
|
184
|
+
c.style.setProperty("--radix-accordion-content-height", `${c.scrollHeight}px`);
|
|
194
185
|
};
|
|
195
186
|
A();
|
|
196
|
-
const
|
|
197
|
-
return
|
|
187
|
+
const C = new ResizeObserver(A);
|
|
188
|
+
return C.observe(c), () => C.disconnect();
|
|
198
189
|
}, []);
|
|
199
|
-
const
|
|
200
|
-
return !
|
|
201
|
-
|
|
190
|
+
const v = g ? M : "div";
|
|
191
|
+
return !r && !i ? /* @__PURE__ */ x(
|
|
192
|
+
v,
|
|
202
193
|
{
|
|
203
|
-
id:
|
|
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 ||
|
|
209
|
-
className:
|
|
210
|
-
ref:
|
|
211
|
-
...
|
|
199
|
+
"data-disabled": o.disabled || s.disabled ? "" : void 0,
|
|
200
|
+
className: N(u),
|
|
201
|
+
ref: d,
|
|
202
|
+
...l
|
|
212
203
|
}
|
|
213
|
-
) : /* @__PURE__ */
|
|
214
|
-
|
|
204
|
+
) : /* @__PURE__ */ x(
|
|
205
|
+
v,
|
|
215
206
|
{
|
|
216
|
-
id:
|
|
207
|
+
id: n,
|
|
217
208
|
role: "region",
|
|
218
209
|
"aria-labelledby": `act-${o.value}`,
|
|
219
|
-
"data-state":
|
|
220
|
-
"data-disabled": o.disabled ||
|
|
221
|
-
className:
|
|
222
|
-
ref:
|
|
223
|
-
...
|
|
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
|
-
|
|
219
|
+
U.displayName = "AccordionContent";
|
|
229
220
|
export {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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 {
|
|
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:
|
|
24
|
-
value:
|
|
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:
|
|
99
|
-
value:
|
|
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:
|
|
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:
|
|
9
|
+
size: e,
|
|
10
10
|
className: n,
|
|
11
11
|
title: t,
|
|
12
|
-
description:
|
|
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
|
-
),
|
|
27
|
+
), m = d(L);
|
|
28
|
+
m.displayName = "AnnotationsIcon";
|
|
28
29
|
export {
|
|
29
|
-
|
|
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
|
|
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
|
-
),
|
|
59
|
+
), u = c(p);
|
|
60
|
+
u.displayName = "CalendarIcon";
|
|
60
61
|
export {
|
|
61
|
-
|
|
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
|
|
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:
|
|
12
|
+
description: c,
|
|
13
13
|
"aria-hidden": e,
|
|
14
14
|
ref: a,
|
|
15
|
-
...
|
|
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
|
-
),
|
|
26
|
+
), k = h(l);
|
|
27
|
+
k.displayName = "CheckCircleIcon";
|
|
27
28
|
export {
|
|
28
|
-
|
|
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:
|
|
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:
|
|
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
|
-
...
|
|
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
|
-
),
|
|
26
|
+
), p = h(k);
|
|
27
|
+
p.displayName = "CheckSquareIcon";
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
p as CheckSquareIcon
|
|
29
30
|
};
|