@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.
- package/dist/.js +84 -77
- package/dist/Button.js +1 -1
- package/dist/Card.js +4 -4
- package/dist/Drawer.js +15 -8
- package/dist/Icons/AnnotationsIcon.js +3 -3
- package/dist/Icons/CalendarIcon.js +8 -8
- package/dist/Icons/DeleteIcon.js +10 -10
- package/dist/Icons/DurationIcon.js +9 -9
- package/dist/Icons/EraserIcon.js +7 -7
- package/dist/Icons/GoToFirstIcon.js +10 -10
- package/dist/Icons/GoToLastIcon.js +8 -8
- package/dist/Icons/IconBase.js +8 -7
- package/dist/Icons/InfoIcon.js +32 -0
- package/dist/Icons/LabelIcon.js +6 -6
- package/dist/Icons/LassoIcon.js +3 -3
- package/dist/Icons/LineToolIcon.js +14 -14
- package/dist/Icons/LiveViewIcon.js +30 -30
- package/dist/Icons/LocationIcon.js +6 -6
- package/dist/Icons/MetadataIcon.js +8 -8
- package/dist/Icons/OntologyIcon.js +5 -5
- package/dist/Icons/PlayIcon.js +11 -11
- package/dist/Icons/PlusIcon.js +9 -9
- package/dist/Icons/ResetIcon.js +8 -8
- package/dist/Icons/ScissorsIcon.js +15 -15
- package/dist/Icons/SettingsIcon.js +42 -0
- package/dist/Icons/TrashIcon.js +1 -1
- package/dist/Icons/UndoIcon.js +5 -5
- package/dist/Icons/ZoomAllIcon.js +57 -25
- package/dist/Icons/ZoomXIcon.js +7 -7
- package/dist/Icons.js +38 -34
- package/dist/Popover.js +48 -42
- package/dist/RadioGroup/RadioGroupBase.js +120 -118
- package/dist/RadioGroup.js +41 -0
- package/dist/Slider/SliderBase.js +98 -99
- package/dist/Slider.js +3 -3
- package/dist/ToggleGroup.js +9 -9
- package/dist/assets/main.css +1 -1
- package/dist/components/Drawer/Drawer.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Icons/IconBase.d.ts +5 -5
- package/dist/components/Icons/IconBase.d.ts.map +1 -1
- package/dist/components/Icons/InfoIcon.d.ts +3 -0
- package/dist/components/Icons/InfoIcon.d.ts.map +1 -0
- package/dist/components/Icons/SettingsIcon.d.ts +3 -0
- package/dist/components/Icons/SettingsIcon.d.ts.map +1 -0
- package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
- package/dist/components/Icons/index.d.ts +2 -0
- package/dist/components/Icons/index.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +11 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroupBase.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroupBase.d.ts.map +1 -1
- package/dist/components/Slider/Slider.d.ts +1 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/SliderBase.d.ts +2 -2
- package/dist/components/Slider/SliderBase.d.ts.map +1 -1
- package/dist/{loader-circle-Btf6jOd5.js → createLucideIcon-CI1yJrZf.js} +9 -16
- package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts +3 -0
- package/dist/features/HorizonColorGrid/HorizonColorGrid.d.ts.map +1 -0
- package/dist/features/HorizonColorGrid.js +70 -0
- package/dist/features/LabelingTools.js +4 -2
- package/dist/features/SensorMetadata/SensorMetadata.d.ts +2 -0
- package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +1 -0
- package/dist/features/SensorMetadata.js +85 -0
- package/dist/features/SettingsPopover/SettingsPopover.d.ts +2 -0
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +1 -0
- package/dist/features/SettingsPopover.js +194 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/loader-circle-CvdzOiQ_.js +11 -0
- package/dist/themes/grayscale-theme.webp +0 -0
- package/dist/themes/green-black-theme.webp +0 -0
- package/dist/themes/reverse-grayscale-theme.webp +0 -0
- package/dist/themes/viridis-theme.webp +0 -0
- package/package.json +5 -2
- package/src/styles/main.css +1 -0
|
@@ -1,80 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as k, jsxs as Q } from "react/jsx-runtime";
|
|
3
3
|
import { Slot as P } from "../primitives/slot.js";
|
|
4
|
-
import { createContext as W, forwardRef as
|
|
5
|
-
function
|
|
4
|
+
import { createContext as W, forwardRef as E, useEffect as Z, useRef as G, useState as B, useCallback as A, useContext as F, createRef as _ } from "react";
|
|
5
|
+
function x(...r) {
|
|
6
6
|
return r.filter(Boolean).join(" ");
|
|
7
7
|
}
|
|
8
|
-
function I(r,
|
|
9
|
-
return Math.min(e, Math.max(
|
|
8
|
+
function I(r, i, e) {
|
|
9
|
+
return Math.min(e, Math.max(i, r));
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const a = Math.round((r - e) /
|
|
11
|
+
function U(r, i, e) {
|
|
12
|
+
const a = Math.round((r - e) / i), l = e + a * i;
|
|
13
13
|
return Number(l.toFixed(10));
|
|
14
14
|
}
|
|
15
|
-
function L(r,
|
|
16
|
-
return (r -
|
|
15
|
+
function L(r, i, e) {
|
|
16
|
+
return (r - i) * 100 / (e - i);
|
|
17
17
|
}
|
|
18
|
-
function tt(r,
|
|
19
|
-
return
|
|
18
|
+
function tt(r, i, e) {
|
|
19
|
+
return i + r / 100 * (e - i);
|
|
20
20
|
}
|
|
21
|
-
function et(r,
|
|
21
|
+
function et(r, i) {
|
|
22
22
|
let e = 0, a = 1 / 0;
|
|
23
23
|
for (let l = 0; l < r.length; l += 1) {
|
|
24
|
-
const n = Math.abs(r[l] -
|
|
24
|
+
const n = Math.abs(r[l] - i);
|
|
25
25
|
n < a && (a = n, e = l);
|
|
26
26
|
}
|
|
27
27
|
return e;
|
|
28
28
|
}
|
|
29
29
|
function nt(r) {
|
|
30
|
-
const { value:
|
|
30
|
+
const { value: i, defaultValue: e, onChange: a } = r, [l, n] = B(e), s = Array.isArray(i), t = s ? i : l, o = A(
|
|
31
31
|
(u) => {
|
|
32
32
|
const d = typeof u == "function" ? u(t) : u;
|
|
33
33
|
s || n(d), a?.(d);
|
|
34
34
|
},
|
|
35
35
|
[s, a, t]
|
|
36
36
|
);
|
|
37
|
-
return [t,
|
|
37
|
+
return [t, o];
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const z = W(null), rt = E(
|
|
40
40
|
({
|
|
41
41
|
asChild: r,
|
|
42
|
-
className:
|
|
42
|
+
className: i,
|
|
43
43
|
value: e,
|
|
44
44
|
defaultValue: a,
|
|
45
45
|
onValueChange: l,
|
|
46
46
|
onValueCommit: n,
|
|
47
47
|
min: s = 0,
|
|
48
48
|
max: t = 100,
|
|
49
|
-
step:
|
|
49
|
+
step: o = 1,
|
|
50
50
|
minStepsBetweenThumbs: u = 0,
|
|
51
51
|
orientation: d = "horizontal",
|
|
52
52
|
dir: S = "ltr",
|
|
53
53
|
disabled: b = !1,
|
|
54
|
-
name:
|
|
54
|
+
name: h,
|
|
55
55
|
form: N,
|
|
56
56
|
required: T,
|
|
57
57
|
children: V,
|
|
58
58
|
...$
|
|
59
59
|
}, c) => {
|
|
60
|
-
const [m,
|
|
60
|
+
const [m, p] = nt({
|
|
61
61
|
value: e,
|
|
62
62
|
defaultValue: a && a.length > 0 ? a : [s],
|
|
63
63
|
onChange: l
|
|
64
64
|
});
|
|
65
65
|
Z(() => {
|
|
66
|
-
|
|
67
|
-
}, [s, t,
|
|
68
|
-
const v =
|
|
66
|
+
p((g) => X(g, { min: s, max: t, step: o, minStepsBetweenThumbs: u }));
|
|
67
|
+
}, [s, t, o, u]);
|
|
68
|
+
const v = G(null), f = G([]), [y, C] = B(null), w = A(
|
|
69
69
|
(g, R) => {
|
|
70
|
-
const D = X(g, { min: s, max: t, step:
|
|
71
|
-
|
|
70
|
+
const D = X(g, { min: s, max: t, step: o, minStepsBetweenThumbs: u });
|
|
71
|
+
p(D), R?.commit && n?.(D);
|
|
72
72
|
},
|
|
73
|
-
[t, s, u, n,
|
|
73
|
+
[t, s, u, n, p, o]
|
|
74
74
|
), K = A(
|
|
75
75
|
(g, R, D) => {
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const j = [...m];
|
|
77
|
+
j[g] = R, w(j, D);
|
|
78
78
|
},
|
|
79
79
|
[w, m]
|
|
80
80
|
), M = {
|
|
@@ -82,36 +82,36 @@ const x = W(null), rt = z(
|
|
|
82
82
|
setValues: w,
|
|
83
83
|
min: s,
|
|
84
84
|
max: t,
|
|
85
|
-
step:
|
|
85
|
+
step: o,
|
|
86
86
|
minStepsBetweenThumbs: u,
|
|
87
87
|
orientation: d,
|
|
88
88
|
dir: S,
|
|
89
89
|
disabled: b,
|
|
90
90
|
trackRef: v,
|
|
91
|
-
thumbsRef:
|
|
91
|
+
thumbsRef: f,
|
|
92
92
|
activeIndex: y,
|
|
93
93
|
setActiveIndex: C,
|
|
94
94
|
updateAtIndex: K
|
|
95
95
|
}, J = r ? P : "div", O = c;
|
|
96
|
-
return /* @__PURE__ */ k(
|
|
96
|
+
return /* @__PURE__ */ k(z.Provider, { value: M, children: /* @__PURE__ */ Q(
|
|
97
97
|
J,
|
|
98
98
|
{
|
|
99
99
|
ref: O,
|
|
100
100
|
role: "presentation",
|
|
101
101
|
"data-orientation": d,
|
|
102
102
|
"data-disabled": b ? "" : void 0,
|
|
103
|
-
className:
|
|
103
|
+
className: x(
|
|
104
104
|
"relative touch-none select-none",
|
|
105
105
|
d === "horizontal" ? "h-6 w-full" : "h-full w-6",
|
|
106
|
-
|
|
106
|
+
i
|
|
107
107
|
),
|
|
108
108
|
...$,
|
|
109
109
|
children: [
|
|
110
|
-
|
|
110
|
+
h && M.values.map((g, R) => /* @__PURE__ */ k(
|
|
111
111
|
"input",
|
|
112
112
|
{
|
|
113
113
|
type: "hidden",
|
|
114
|
-
name: M.values.length > 1 ? `${
|
|
114
|
+
name: M.values.length > 1 ? `${h}[]` : h,
|
|
115
115
|
value: String(g),
|
|
116
116
|
form: N,
|
|
117
117
|
required: T && R === 0,
|
|
@@ -125,29 +125,29 @@ const x = W(null), rt = z(
|
|
|
125
125
|
) });
|
|
126
126
|
}
|
|
127
127
|
);
|
|
128
|
-
rt.displayName = "
|
|
129
|
-
function X(r,
|
|
130
|
-
const { min: e, max: a, step: l, minStepsBetweenThumbs: n } =
|
|
131
|
-
if (s.sort((
|
|
128
|
+
rt.displayName = "SliderBase";
|
|
129
|
+
function X(r, i) {
|
|
130
|
+
const { min: e, max: a, step: l, minStepsBetweenThumbs: n } = i, s = r.map((o) => I(U(o, l, e), e, a));
|
|
131
|
+
if (s.sort((o, u) => o - u), s.length <= 1 || n <= 0) return s;
|
|
132
132
|
const t = l * n;
|
|
133
|
-
for (let
|
|
134
|
-
s[
|
|
133
|
+
for (let o = 1; o < s.length; o += 1)
|
|
134
|
+
s[o] - s[o - 1] < t && (s[o] = I(s[o - 1] + t, e, a));
|
|
135
135
|
return s;
|
|
136
136
|
}
|
|
137
|
-
const ot =
|
|
138
|
-
({ asChild: r, className:
|
|
139
|
-
const n =
|
|
137
|
+
const ot = E(
|
|
138
|
+
({ asChild: r, className: i, onPointerDown: e, ...a }, l) => {
|
|
139
|
+
const n = F(z);
|
|
140
140
|
if (!n) throw new Error("SliderTrack must be used within Slider");
|
|
141
141
|
const s = r ? P : "div", t = (u) => {
|
|
142
142
|
n.trackRef.current = u, typeof l == "function" ? l(u) : l && "current" in l && (l.current = u);
|
|
143
|
-
},
|
|
143
|
+
}, o = A(
|
|
144
144
|
(u) => {
|
|
145
145
|
if (e?.(u), u.defaultPrevented || n.disabled) return;
|
|
146
146
|
const d = n.trackRef.current;
|
|
147
147
|
if (!d) return;
|
|
148
148
|
d.setPointerCapture?.(u.pointerId), u.preventDefault();
|
|
149
|
-
const S = d.getBoundingClientRect(), b = Y(u.clientX, u.clientY, S, n),
|
|
150
|
-
n.setActiveIndex(
|
|
149
|
+
const S = d.getBoundingClientRect(), b = Y(u.clientX, u.clientY, S, n), h = et(n.values, b);
|
|
150
|
+
n.setActiveIndex(h), n.updateAtIndex(h, b), H(h, n);
|
|
151
151
|
},
|
|
152
152
|
[n, e]
|
|
153
153
|
);
|
|
@@ -156,30 +156,30 @@ const ot = z(
|
|
|
156
156
|
{
|
|
157
157
|
ref: t,
|
|
158
158
|
"data-orientation": n.orientation,
|
|
159
|
-
className:
|
|
159
|
+
className: x(
|
|
160
160
|
"bg-secondary relative grow rounded-full",
|
|
161
161
|
n.orientation === "horizontal" ? "h-2" : "w-2",
|
|
162
|
-
|
|
162
|
+
i
|
|
163
163
|
),
|
|
164
164
|
style: { touchAction: "none" },
|
|
165
|
-
onPointerDown:
|
|
165
|
+
onPointerDown: o,
|
|
166
166
|
...a
|
|
167
167
|
}
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
);
|
|
171
171
|
ot.displayName = "SliderTrack";
|
|
172
|
-
const it =
|
|
173
|
-
({ asChild: r, className:
|
|
174
|
-
const n =
|
|
172
|
+
const it = E(
|
|
173
|
+
({ asChild: r, className: i, style: e, ...a }, l) => {
|
|
174
|
+
const n = F(z);
|
|
175
175
|
if (!n) throw new Error("SliderRange must be used within Slider");
|
|
176
|
-
const s = r ? P : "div", t = L(n.values[0], n.min, n.max),
|
|
176
|
+
const s = r ? P : "div", t = L(n.values[0], n.min, n.max), o = L(n.values[n.values.length - 1], n.min, n.max), u = n.orientation === "horizontal" ? { left: `${t}%`, width: `${o - t}%` } : { bottom: `${t}%`, height: `${o - t}%` };
|
|
177
177
|
return /* @__PURE__ */ k(
|
|
178
178
|
s,
|
|
179
179
|
{
|
|
180
180
|
ref: l,
|
|
181
181
|
"data-orientation": n.orientation,
|
|
182
|
-
className:
|
|
182
|
+
className: x("bg-primary absolute rounded-full", n.orientation === "horizontal" ? "h-2" : "w-2", i),
|
|
183
183
|
style: { ...u, ...e },
|
|
184
184
|
...a
|
|
185
185
|
}
|
|
@@ -187,61 +187,61 @@ const it = z(
|
|
|
187
187
|
}
|
|
188
188
|
);
|
|
189
189
|
it.displayName = "SliderRange";
|
|
190
|
-
const at =
|
|
191
|
-
({ asChild: r, className:
|
|
192
|
-
const t =
|
|
190
|
+
const at = E(
|
|
191
|
+
({ asChild: r, className: i, index: e, onKeyDown: a, onPointerDown: l, ...n }, s) => {
|
|
192
|
+
const t = F(z);
|
|
193
193
|
if (!t) throw new Error("SliderThumb must be used within Slider");
|
|
194
|
-
const [
|
|
194
|
+
const [o] = B(() => {
|
|
195
195
|
const c = typeof e == "number" ? e : t.thumbsRef.current.length;
|
|
196
196
|
return t.thumbsRef.current[c] || (t.thumbsRef.current[c] = _()), c;
|
|
197
|
-
}), u = t.values[
|
|
198
|
-
t.thumbsRef.current[
|
|
199
|
-
}, N = (t.activeIndex === null || t.activeIndex ===
|
|
197
|
+
}), u = t.values[o] ?? t.values[t.values.length - 1], d = L(u, t.min, t.max), S = r ? P : "button", b = (c) => {
|
|
198
|
+
t.thumbsRef.current[o].current = c, typeof s == "function" ? s(c) : s && "current" in s && (s.current = c);
|
|
199
|
+
}, N = (t.activeIndex === null || t.activeIndex === o) && !t.disabled ? 0 : -1, T = A(
|
|
200
200
|
(c) => {
|
|
201
201
|
if (a?.(c), c.defaultPrevented || t.disabled) return;
|
|
202
|
-
const m = Math.max(t.step * 10, t.step),
|
|
203
|
-
if (
|
|
204
|
-
c.preventDefault(), t.updateAtIndex(
|
|
202
|
+
const m = Math.max(t.step * 10, t.step), p = (w) => w === "inc" ? 1 : -1, v = (w) => st(o, w, t), f = c.key;
|
|
203
|
+
if (f === "Home") {
|
|
204
|
+
c.preventDefault(), t.updateAtIndex(o, t.min, { commit: !0 });
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
if (
|
|
208
|
-
c.preventDefault(), t.updateAtIndex(
|
|
207
|
+
if (f === "End") {
|
|
208
|
+
c.preventDefault(), t.updateAtIndex(o, t.max, { commit: !0 });
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
const y = t.orientation === "horizontal", C = t.dir === "rtl";
|
|
212
|
-
if (
|
|
212
|
+
if (f === "ArrowRight" && y) {
|
|
213
213
|
c.preventDefault(), v(t.step * (C ? -1 : 1));
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
if (
|
|
216
|
+
if (f === "ArrowLeft" && y) {
|
|
217
217
|
c.preventDefault(), v(t.step * (C ? 1 : -1));
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
if (
|
|
220
|
+
if (f === "ArrowUp" && !y) {
|
|
221
221
|
c.preventDefault(), v(t.step);
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
if (
|
|
224
|
+
if (f === "ArrowDown" && !y) {
|
|
225
225
|
c.preventDefault(), v(-t.step);
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
if (
|
|
229
|
-
c.preventDefault(), v(
|
|
228
|
+
if (f === "PageUp") {
|
|
229
|
+
c.preventDefault(), v(p("inc") * m);
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
if (
|
|
233
|
-
c.preventDefault(), v(
|
|
232
|
+
if (f === "PageDown") {
|
|
233
|
+
c.preventDefault(), v(p("dec") * m);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
|
-
[t,
|
|
237
|
+
[t, o, a]
|
|
238
238
|
), V = A(
|
|
239
239
|
(c) => {
|
|
240
240
|
if (l?.(c), c.defaultPrevented || t.disabled) return;
|
|
241
|
-
const m = t.trackRef.current,
|
|
242
|
-
!m || !
|
|
241
|
+
const m = t.trackRef.current, p = t.thumbsRef.current[o].current;
|
|
242
|
+
!m || !p || (p.setPointerCapture?.(c.pointerId), c.preventDefault(), t.setActiveIndex(o), H(o, t));
|
|
243
243
|
},
|
|
244
|
-
[t,
|
|
244
|
+
[t, o, l]
|
|
245
245
|
), $ = t.orientation === "horizontal" ? { left: `${d}%`, transform: "translate(-50%, -50%)" } : { bottom: `${d}%`, transform: "translate(-50%, 50%)" };
|
|
246
246
|
return /* @__PURE__ */ k(
|
|
247
247
|
S,
|
|
@@ -256,17 +256,16 @@ const at = z(
|
|
|
256
256
|
"aria-disabled": t.disabled || void 0,
|
|
257
257
|
"data-orientation": t.orientation,
|
|
258
258
|
"data-disabled": t.disabled ? "" : void 0,
|
|
259
|
-
className:
|
|
260
|
-
"
|
|
259
|
+
className: x(
|
|
260
|
+
"absolute grid place-items-center rounded-full shadow",
|
|
261
261
|
"border-input border outline-none",
|
|
262
262
|
"focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
263
263
|
"h-5 w-5",
|
|
264
|
-
|
|
264
|
+
i
|
|
265
265
|
),
|
|
266
266
|
style: {
|
|
267
267
|
...$,
|
|
268
|
-
|
|
269
|
-
left: t.orientation === "horizontal" ? void 0 : "50%",
|
|
268
|
+
...t.orientation === "horizontal" ? { top: "50%" } : { left: "50%" },
|
|
270
269
|
touchAction: "none"
|
|
271
270
|
},
|
|
272
271
|
onKeyDown: T,
|
|
@@ -277,38 +276,38 @@ const at = z(
|
|
|
277
276
|
}
|
|
278
277
|
);
|
|
279
278
|
at.displayName = "SliderThumb";
|
|
280
|
-
function Y(r,
|
|
279
|
+
function Y(r, i, e, a) {
|
|
281
280
|
let l;
|
|
282
281
|
if (a.orientation === "horizontal") {
|
|
283
|
-
const
|
|
284
|
-
l = a.dir === "rtl" ? 100 -
|
|
282
|
+
const o = I(r - e.left, 0, e.width) / e.width * 100;
|
|
283
|
+
l = a.dir === "rtl" ? 100 - o : o;
|
|
285
284
|
} else
|
|
286
|
-
l = 100 - I(
|
|
287
|
-
const n = tt(l, a.min, a.max), s =
|
|
285
|
+
l = 100 - I(i - e.top, 0, e.height) / e.height * 100;
|
|
286
|
+
const n = tt(l, a.min, a.max), s = U(n, a.step, a.min);
|
|
288
287
|
return I(s, a.min, a.max);
|
|
289
288
|
}
|
|
290
|
-
function q(r,
|
|
289
|
+
function q(r, i, e) {
|
|
291
290
|
const a = e.step * e.minStepsBetweenThumbs, l = r > 0 ? e.values[r - 1] : e.min, n = r < e.values.length - 1 ? e.values[r + 1] : e.max, s = l + (r > 0 ? a : 0), t = n - (r < e.values.length - 1 ? a : 0);
|
|
292
|
-
return I(
|
|
291
|
+
return I(i, s, t);
|
|
293
292
|
}
|
|
294
|
-
function st(r,
|
|
295
|
-
const a = e.values[r], l = q(r,
|
|
293
|
+
function st(r, i, e) {
|
|
294
|
+
const a = e.values[r], l = q(r, U(a + i, e.step, e.min), e);
|
|
296
295
|
e.updateAtIndex(r, l, { commit: !0 });
|
|
297
296
|
}
|
|
298
|
-
function H(r,
|
|
299
|
-
const e =
|
|
297
|
+
function H(r, i) {
|
|
298
|
+
const e = i.trackRef.current;
|
|
300
299
|
if (!e) return;
|
|
301
300
|
const a = () => e.getBoundingClientRect(), l = (s) => {
|
|
302
|
-
if (
|
|
303
|
-
const t = Y(s.clientX, s.clientY, a(),
|
|
304
|
-
|
|
301
|
+
if (i.disabled) return;
|
|
302
|
+
const t = Y(s.clientX, s.clientY, a(), i), o = q(r, t, i);
|
|
303
|
+
i.updateAtIndex(r, o);
|
|
305
304
|
}, n = () => {
|
|
306
|
-
|
|
305
|
+
i.setActiveIndex(null), window.removeEventListener("pointermove", l, !0), window.removeEventListener("pointerup", n, !0);
|
|
307
306
|
};
|
|
308
307
|
window.addEventListener("pointermove", l, !0), window.addEventListener("pointerup", n, !0);
|
|
309
308
|
}
|
|
310
309
|
export {
|
|
311
|
-
rt as
|
|
310
|
+
rt as SliderBase,
|
|
312
311
|
it as SliderRange,
|
|
313
312
|
at as SliderThumb,
|
|
314
313
|
ot as SliderTrack
|
package/dist/Slider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './assets/main.css';
|
|
3
3
|
import { jsxs as v, jsx as t } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { SliderBase as w, SliderTrack as p, SliderRange as x, SliderThumb as k } from "./Slider/SliderBase.js";
|
|
5
5
|
import { c as a } from "./twUtils-CRiPKpXj.js";
|
|
6
6
|
const j = ({
|
|
7
7
|
className: o,
|
|
@@ -58,8 +58,8 @@ const j = ({
|
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
Array.from({ length: f.length }, (
|
|
62
|
-
|
|
61
|
+
Array.from({ length: f.length }, (z, g) => /* @__PURE__ */ t(
|
|
62
|
+
k,
|
|
63
63
|
{
|
|
64
64
|
"data-slot": "slider-thumb",
|
|
65
65
|
className: "border-slider-thumb-border bg-slider-thumb-bg ring-slider-thumb-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
package/dist/ToggleGroup.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './assets/main.css';
|
|
3
3
|
import { jsx as d } from "react/jsx-runtime";
|
|
4
|
-
import { ToggleGroupItemBase as p, ToggleGroupBase as
|
|
5
|
-
import { toggleVariants as
|
|
4
|
+
import { ToggleGroupItemBase as p, ToggleGroupBase as f } from "./ToggleGroup/ToggleGroupBase.js";
|
|
5
|
+
import { toggleVariants as m } from "./Toggle.js";
|
|
6
6
|
import { c as l } from "./twUtils-CRiPKpXj.js";
|
|
7
7
|
import { createContext as c, forwardRef as v, useContext as b } from "react";
|
|
8
8
|
const g = c({
|
|
9
9
|
size: "default",
|
|
10
10
|
variant: "default",
|
|
11
11
|
layout: "default"
|
|
12
|
-
}),
|
|
13
|
-
|
|
12
|
+
}), w = ({ className: n, variant: e, size: o, layout: a, children: u, ...r }) => /* @__PURE__ */ d(
|
|
13
|
+
f,
|
|
14
14
|
{
|
|
15
15
|
"data-slot": "toggle-group",
|
|
16
16
|
"data-variant": e,
|
|
17
17
|
"data-size": o,
|
|
18
18
|
"data-layout": a,
|
|
19
19
|
className: l(
|
|
20
|
-
"group/toggle-group [&[data-variant='outline']]:bg-toggle-group-bg flex h-fit w-fit items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md [&[data-variant='outline']]:gap-0.25",
|
|
20
|
+
"group/toggle-group [&[data-variant='outline']]:bg-toggle-group-bg flex h-fit w-fit items-center rounded-md [&_button:first-of-type]:rounded-l-md [&_button:last-of-type]:rounded-r-md [&[data-layout='expanded']]:w-full [&[data-variant='outline']]:gap-0.25",
|
|
21
21
|
n
|
|
22
22
|
),
|
|
23
23
|
...r,
|
|
24
24
|
children: /* @__PURE__ */ d(g.Provider, { value: { variant: e, size: o, layout: a }, children: u })
|
|
25
25
|
}
|
|
26
|
-
),
|
|
26
|
+
), h = v(({ className: n, children: e, variant: o, size: a, value: u, layout: r, ...i }, s) => {
|
|
27
27
|
const t = b(g);
|
|
28
28
|
return /* @__PURE__ */ d(
|
|
29
29
|
p,
|
|
@@ -35,7 +35,7 @@ const g = c({
|
|
|
35
35
|
"data-layout": t.layout || r,
|
|
36
36
|
value: u,
|
|
37
37
|
className: l(
|
|
38
|
-
|
|
38
|
+
m({
|
|
39
39
|
variant: t.variant || o,
|
|
40
40
|
size: t.size || a,
|
|
41
41
|
layout: t.layout || r
|
|
@@ -49,6 +49,6 @@ const g = c({
|
|
|
49
49
|
);
|
|
50
50
|
});
|
|
51
51
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
w as ToggleGroup,
|
|
53
|
+
h as ToggleGroupItem
|
|
54
54
|
};
|