@spear-ai/spectral 1.6.17 → 1.8.0
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 +201 -200
- package/dist/Accordion.d.ts +13 -15
- package/dist/Accordion.js +184 -179
- package/dist/Alert/AlertBase.d.ts +7 -7
- package/dist/Alert/AlertBase.js +21 -21
- package/dist/Alert.d.ts +2 -2
- package/dist/Alert.js +31 -31
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +30 -22
- package/dist/Badge.d.ts +1 -1
- package/dist/Badge.js +3 -2
- package/dist/Button.d.ts +3 -3
- package/dist/Button.js +108 -46
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
- package/dist/ButtonGroup.d.ts +5 -5
- package/dist/ButtonGroup.js +21 -21
- package/dist/ButtonIcon.d.ts +2 -2
- package/dist/ButtonIcon.js +30 -31
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +50 -57
- package/dist/Checkbox.js +15 -19
- package/dist/DataCard/Card.d.ts +1 -1
- package/dist/DataCard/Card.js +1 -1
- package/dist/DataCard.js +1 -1
- package/dist/DateTimePicker/Calendar.d.ts +4 -4
- package/dist/DateTimePicker/Calendar.js +3 -3
- package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
- package/dist/DateTimePicker/DateTimeInput.js +4 -4
- package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
- package/dist/DateTimePicker/DateTimeUtils.js +139 -197
- package/dist/DateTimePicker/TimePicker.d.ts +4 -4
- package/dist/DateTimePicker/TimePicker.js +3 -3
- package/dist/DateTimePicker.d.ts +5 -5
- package/dist/DateTimePicker.js +90 -70
- package/dist/Dialog.d.ts +13 -13
- package/dist/Dialog.js +57 -84
- package/dist/Drawer.d.ts +2 -2
- package/dist/Drawer.js +8 -8
- package/dist/HoverCard.d.ts +6 -5
- package/dist/HoverCard.js +64 -64
- package/dist/Icons/PolygonIcon.d.ts +5 -0
- package/dist/Icons/PolygonIcon.js +40 -0
- package/dist/Icons/index.d.ts +1 -1
- package/dist/Icons.js +34 -34
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
- package/dist/Input/InputUtils.d.ts +2 -2
- package/dist/Input/InputUtils.js +4 -4
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +19 -19
- package/dist/InputOTP.d.ts +10 -10
- package/dist/InputOTP.js +114 -114
- package/dist/Kbd.d.ts +8 -5
- package/dist/Kbd.js +85 -20
- package/dist/Label.d.ts +4 -2
- package/dist/Label.js +3 -3
- package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +278 -202
- package/dist/MultiSelect.d.ts +6 -6
- package/dist/MultiSelect.js +9 -9
- package/dist/Popover.js +22 -237
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioGroup.d.ts +15 -15
- package/dist/RadioGroup.js +253 -236
- package/dist/Select.d.ts +3 -1
- package/dist/Select.js +91 -88
- package/dist/Separator.js +4 -4
- package/dist/Skeleton.d.ts +1 -2
- package/dist/Skeleton.js +2 -4
- package/dist/Slider.d.ts +6 -6
- package/dist/Slider.js +78 -78
- package/dist/Switch/SwitchBase.d.ts +4 -4
- package/dist/Switch/SwitchBase.js +75 -111
- package/dist/Switch.d.ts +4 -4
- package/dist/Switch.js +122 -33
- package/dist/Tabs/TabsBase.js +39 -38
- package/dist/Tabs/tabsUtils.js +7 -7
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.js +62 -66
- package/dist/Textarea/TextareaUtils.d.ts +7 -7
- package/dist/Textarea/TextareaUtils.js +13 -13
- package/dist/Textarea.js +28 -18
- package/dist/Toast.d.ts +43 -0
- package/dist/Toast.js +883 -0
- package/dist/Toggle/ToggleBase.d.ts +4 -4
- package/dist/Toggle/ToggleBase.js +32 -33
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +7 -12
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
- package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +27 -30
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +97 -97
- package/dist/Tray.d.ts +9 -9
- package/dist/Tray.js +71 -70
- package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
- package/dist/hooks/useAccordionAutoScroll.js +42 -39
- package/dist/hooks/useControllableState.d.ts +2 -2
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +2 -2
- package/dist/index-C12FUuIW.js +13 -0
- package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
- package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
- package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
- package/dist/index-DEYs15GP.js +66 -0
- package/dist/index-DdFoGvON.js +146 -0
- package/dist/index-Q3N6lgwg.js +225 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +4 -4
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +8 -5
- package/dist/primitives/select.d.ts +12 -13
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +59 -88
- package/dist/primitives/slot.d.ts +5 -5
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +24 -33
- package/dist/primitives/textarea.d.ts.map +1 -1
- package/dist/primitives/textarea.js +4 -3
- package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
- package/dist/styles/base-colors.css +30 -30
- package/dist/styles/horizon/base-colors.css +30 -30
- package/dist/styles/horizon/colors.css +43 -13
- package/dist/styles/horizon/utilities.css +26 -3
- package/dist/styles/main.css +1 -1
- package/dist/styles/spectral.css +2 -2
- package/dist/styles/theme.css +99 -46
- package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
- package/dist/utils/formFieldUtils.d.ts +2 -2
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +14 -11
- package/dist/utils/sharedUtils.d.ts +3 -3
- package/dist/utils/sharedUtils.d.ts.map +1 -1
- package/dist/utils/sharedUtils.js +1 -4
- package/dist/utils/twUtils.d.ts +1 -1
- package/dist/utils/twUtils.d.ts.map +1 -1
- package/dist/utils/twUtils.js +1 -4
- package/package.json +6 -1
- package/dist/Icons/LineToolIcon2.d.ts +0 -5
- package/dist/Icons/LineToolIcon2.js +0 -49
- package/dist/createLucideIcon-D4r5Phnh.js +0 -70
- package/dist/index-CeP1E2kK.js +0 -209
- package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/HoverCard.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import "./styles/main.css";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
import * as s from "react";
|
|
5
|
-
import { createContext as
|
|
6
|
-
import { e as
|
|
7
|
-
import { c as O, R as
|
|
8
|
-
import { P as
|
|
5
|
+
import { createContext as I, useContext as B } from "react";
|
|
6
|
+
import { e as U, c as $, b as m, P as W, u as z } from "./index-OnYbwQjk.js";
|
|
7
|
+
import { c as O, R as G, A as K, C as j, a as V } from "./index-B3FZpM60.js";
|
|
8
|
+
import { P as q, D as J } from "./index-u1k2AYWy.js";
|
|
9
9
|
import { P as T } from "./index-D6HcSXrq.js";
|
|
10
|
-
import { cn as
|
|
11
|
-
var H,
|
|
10
|
+
import { cn as E } from "./utils/twUtils.js";
|
|
11
|
+
var H, b = "HoverCard", [N] = $(b, [
|
|
12
12
|
O
|
|
13
|
-
]),
|
|
13
|
+
]), x = O(), [Q, R] = N(b), _ = (e) => {
|
|
14
14
|
const {
|
|
15
15
|
__scopeHoverCard: o,
|
|
16
16
|
children: r,
|
|
@@ -18,77 +18,77 @@ var H, x = "HoverCard", [E] = U(x, [
|
|
|
18
18
|
defaultOpen: n,
|
|
19
19
|
onOpenChange: c,
|
|
20
20
|
openDelay: u = 700,
|
|
21
|
-
closeDelay:
|
|
22
|
-
} = e, d =
|
|
21
|
+
closeDelay: f = 300
|
|
22
|
+
} = e, d = x(o), l = s.useRef(0), p = s.useRef(0), C = s.useRef(!1), v = s.useRef(!1), [h, t] = U({
|
|
23
23
|
prop: a,
|
|
24
24
|
defaultProp: n ?? !1,
|
|
25
25
|
onChange: c,
|
|
26
|
-
caller:
|
|
26
|
+
caller: b
|
|
27
27
|
}), g = s.useCallback(() => {
|
|
28
|
-
clearTimeout(
|
|
28
|
+
clearTimeout(p.current), l.current = window.setTimeout(() => t(!0), u);
|
|
29
29
|
}, [u, t]), S = s.useCallback(() => {
|
|
30
|
-
clearTimeout(l.current), !
|
|
31
|
-
}, [
|
|
30
|
+
clearTimeout(l.current), !C.current && !v.current && (p.current = window.setTimeout(() => t(!1), f));
|
|
31
|
+
}, [f, t]), F = s.useCallback(() => t(!1), [t]);
|
|
32
32
|
return s.useEffect(() => () => {
|
|
33
|
-
clearTimeout(l.current), clearTimeout(
|
|
33
|
+
clearTimeout(l.current), clearTimeout(p.current);
|
|
34
34
|
}, []), /* @__PURE__ */ i(
|
|
35
35
|
Q,
|
|
36
36
|
{
|
|
37
37
|
scope: o,
|
|
38
|
-
open:
|
|
38
|
+
open: h,
|
|
39
39
|
onOpenChange: t,
|
|
40
40
|
onOpen: g,
|
|
41
41
|
onClose: S,
|
|
42
|
-
onDismiss:
|
|
43
|
-
hasSelectionRef:
|
|
42
|
+
onDismiss: F,
|
|
43
|
+
hasSelectionRef: C,
|
|
44
44
|
isPointerDownOnContentRef: v,
|
|
45
|
-
children: /* @__PURE__ */ i(
|
|
45
|
+
children: /* @__PURE__ */ i(G, { ...d, children: r })
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
};
|
|
49
|
-
|
|
50
|
-
var
|
|
49
|
+
_.displayName = b;
|
|
50
|
+
var D = "HoverCardTrigger", A = s.forwardRef(
|
|
51
51
|
(e, o) => {
|
|
52
|
-
const { __scopeHoverCard: r, ...a } = e, n =
|
|
53
|
-
return /* @__PURE__ */ i(
|
|
54
|
-
|
|
52
|
+
const { __scopeHoverCard: r, ...a } = e, n = R(D, r), c = x(r);
|
|
53
|
+
return /* @__PURE__ */ i(K, { asChild: !0, ...c, children: /* @__PURE__ */ i(
|
|
54
|
+
W.a,
|
|
55
55
|
{
|
|
56
56
|
"data-state": n.open ? "open" : "closed",
|
|
57
57
|
...a,
|
|
58
58
|
ref: o,
|
|
59
|
-
onPointerEnter:
|
|
60
|
-
onPointerLeave:
|
|
61
|
-
onFocus:
|
|
62
|
-
onBlur:
|
|
63
|
-
onTouchStart:
|
|
59
|
+
onPointerEnter: m(e.onPointerEnter, w(n.onOpen)),
|
|
60
|
+
onPointerLeave: m(e.onPointerLeave, w(n.onClose)),
|
|
61
|
+
onFocus: m(e.onFocus, n.onOpen),
|
|
62
|
+
onBlur: m(e.onBlur, n.onClose),
|
|
63
|
+
onTouchStart: m(e.onTouchStart, (u) => u.preventDefault())
|
|
64
64
|
}
|
|
65
65
|
) });
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
|
-
|
|
69
|
-
var y = "HoverCardPortal", [X, Y] =
|
|
68
|
+
A.displayName = D;
|
|
69
|
+
var y = "HoverCardPortal", [X, Y] = N(y, {
|
|
70
70
|
forceMount: void 0
|
|
71
|
-
}),
|
|
72
|
-
const { __scopeHoverCard: o, forceMount: r, children: a, container: n } = e, c =
|
|
73
|
-
return /* @__PURE__ */ i(X, { scope: o, forceMount: r, children: /* @__PURE__ */ i(T, { present: r || c.open, children: /* @__PURE__ */ i(
|
|
71
|
+
}), L = (e) => {
|
|
72
|
+
const { __scopeHoverCard: o, forceMount: r, children: a, container: n } = e, c = R(y, o);
|
|
73
|
+
return /* @__PURE__ */ i(X, { scope: o, forceMount: r, children: /* @__PURE__ */ i(T, { present: r || c.open, children: /* @__PURE__ */ i(q, { asChild: !0, container: n, children: a }) }) });
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
var P = "HoverCardContent",
|
|
75
|
+
L.displayName = y;
|
|
76
|
+
var P = "HoverCardContent", M = s.forwardRef(
|
|
77
77
|
(e, o) => {
|
|
78
|
-
const r = Y(P, e.__scopeHoverCard), { forceMount: a = r.forceMount, ...n } = e, c =
|
|
78
|
+
const r = Y(P, e.__scopeHoverCard), { forceMount: a = r.forceMount, ...n } = e, c = R(P, e.__scopeHoverCard);
|
|
79
79
|
return /* @__PURE__ */ i(T, { present: a || c.open, children: /* @__PURE__ */ i(
|
|
80
80
|
Z,
|
|
81
81
|
{
|
|
82
82
|
"data-state": c.open ? "open" : "closed",
|
|
83
83
|
...n,
|
|
84
|
-
onPointerEnter:
|
|
85
|
-
onPointerLeave:
|
|
84
|
+
onPointerEnter: m(e.onPointerEnter, w(c.onOpen)),
|
|
85
|
+
onPointerLeave: m(e.onPointerLeave, w(c.onClose)),
|
|
86
86
|
ref: o
|
|
87
87
|
}
|
|
88
88
|
) });
|
|
89
89
|
}
|
|
90
90
|
);
|
|
91
|
-
|
|
91
|
+
M.displayName = P;
|
|
92
92
|
var Z = s.forwardRef((e, o) => {
|
|
93
93
|
const {
|
|
94
94
|
__scopeHoverCard: r,
|
|
@@ -96,8 +96,8 @@ var Z = s.forwardRef((e, o) => {
|
|
|
96
96
|
onPointerDownOutside: n,
|
|
97
97
|
onFocusOutside: c,
|
|
98
98
|
onInteractOutside: u,
|
|
99
|
-
...
|
|
100
|
-
} = e, d =
|
|
99
|
+
...f
|
|
100
|
+
} = e, d = R(P, r), l = x(r), p = s.useRef(null), C = z(o, p), [v, h] = s.useState(!1);
|
|
101
101
|
return s.useEffect(() => {
|
|
102
102
|
if (v) {
|
|
103
103
|
const t = document.body;
|
|
@@ -106,9 +106,9 @@ var Z = s.forwardRef((e, o) => {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
}, [v]), s.useEffect(() => {
|
|
109
|
-
if (
|
|
109
|
+
if (p.current) {
|
|
110
110
|
const t = () => {
|
|
111
|
-
|
|
111
|
+
h(!1), d.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
112
112
|
document.getSelection()?.toString() !== "" && (d.hasSelectionRef.current = !0);
|
|
113
113
|
});
|
|
114
114
|
};
|
|
@@ -117,30 +117,30 @@ var Z = s.forwardRef((e, o) => {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
}, [d.isPointerDownOnContentRef, d.hasSelectionRef]), s.useEffect(() => {
|
|
120
|
-
|
|
120
|
+
p.current && oe(p.current).forEach((g) => g.setAttribute("tabindex", "-1"));
|
|
121
121
|
}), /* @__PURE__ */ i(
|
|
122
|
-
|
|
122
|
+
J,
|
|
123
123
|
{
|
|
124
124
|
asChild: !0,
|
|
125
125
|
disableOutsidePointerEvents: !1,
|
|
126
126
|
onInteractOutside: u,
|
|
127
127
|
onEscapeKeyDown: a,
|
|
128
128
|
onPointerDownOutside: n,
|
|
129
|
-
onFocusOutside:
|
|
129
|
+
onFocusOutside: m(c, (t) => {
|
|
130
130
|
t.preventDefault();
|
|
131
131
|
}),
|
|
132
132
|
onDismiss: d.onDismiss,
|
|
133
133
|
children: /* @__PURE__ */ i(
|
|
134
|
-
|
|
134
|
+
j,
|
|
135
135
|
{
|
|
136
136
|
...l,
|
|
137
|
-
...
|
|
138
|
-
onPointerDown:
|
|
139
|
-
t.currentTarget.contains(t.target) &&
|
|
137
|
+
...f,
|
|
138
|
+
onPointerDown: m(f.onPointerDown, (t) => {
|
|
139
|
+
t.currentTarget.contains(t.target) && h(!0), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !0;
|
|
140
140
|
}),
|
|
141
|
-
ref:
|
|
141
|
+
ref: C,
|
|
142
142
|
style: {
|
|
143
|
-
...
|
|
143
|
+
...f.style,
|
|
144
144
|
userSelect: v ? "text" : void 0,
|
|
145
145
|
// Safari requires prefix
|
|
146
146
|
WebkitUserSelect: v ? "text" : void 0,
|
|
@@ -156,8 +156,8 @@ var Z = s.forwardRef((e, o) => {
|
|
|
156
156
|
);
|
|
157
157
|
}), ee = "HoverCardArrow", te = s.forwardRef(
|
|
158
158
|
(e, o) => {
|
|
159
|
-
const { __scopeHoverCard: r, ...a } = e, n =
|
|
160
|
-
return /* @__PURE__ */ i(
|
|
159
|
+
const { __scopeHoverCard: r, ...a } = e, n = x(r);
|
|
160
|
+
return /* @__PURE__ */ i(V, { ...n, ...a, ref: o });
|
|
161
161
|
}
|
|
162
162
|
);
|
|
163
163
|
te.displayName = ee;
|
|
@@ -171,10 +171,10 @@ function oe(e) {
|
|
|
171
171
|
for (; r.nextNode(); ) o.push(r.currentNode);
|
|
172
172
|
return o;
|
|
173
173
|
}
|
|
174
|
-
var re =
|
|
175
|
-
const
|
|
174
|
+
var re = _, ne = A, ae = L, se = M;
|
|
175
|
+
const k = I({}), ie = ({ align: e, alignOffset: o, collisionBoundary: r, collisionPadding: a, side: n, sideOffset: c, width: u, ...f }) => /* @__PURE__ */ i(k.Provider, { value: { side: n, sideOffset: c, align: e, alignOffset: o, collisionBoundary: r, collisionPadding: a, width: u }, children: /* @__PURE__ */ i(re, { "data-slot": "hover-card", "data-testid": "spectral-hover-card", ...f }) });
|
|
176
176
|
ie.displayName = "HoverCard";
|
|
177
|
-
const ce = ({
|
|
177
|
+
const ce = ({ className: e, ...o }) => /* @__PURE__ */ i(ne, { className: E("font-base", e), "data-slot": "hover-card-trigger", "data-testid": "spectral-hover-card-trigger", ...o });
|
|
178
178
|
ce.displayName = "HoverCardTrigger";
|
|
179
179
|
const de = ({
|
|
180
180
|
align: e,
|
|
@@ -184,17 +184,17 @@ const de = ({
|
|
|
184
184
|
collisionPadding: n,
|
|
185
185
|
side: c,
|
|
186
186
|
sideOffset: u,
|
|
187
|
-
width:
|
|
187
|
+
width: f,
|
|
188
188
|
...d
|
|
189
189
|
}) => {
|
|
190
|
-
const l =
|
|
190
|
+
const l = B(k), p = e ?? l.align ?? "center", C = u ?? l.sideOffset ?? 4, v = c ?? l.side ?? "bottom", h = f ?? l.width ?? 380, t = o ?? l.alignOffset, g = a ?? l.collisionBoundary, S = n ?? l.collisionPadding;
|
|
191
191
|
return /* @__PURE__ */ i(ae, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ i(
|
|
192
192
|
se,
|
|
193
193
|
{
|
|
194
|
-
align:
|
|
194
|
+
align: p,
|
|
195
195
|
alignOffset: t,
|
|
196
|
-
className:
|
|
197
|
-
"bg-popover-bg text-text-primary data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 origin-[--radix-hover-card-content-transform-origin] rounded-lg p-5 shadow-lg outline-none",
|
|
196
|
+
className: E(
|
|
197
|
+
"bg-popover-bg text-text-primary motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 origin-[--radix-hover-card-content-transform-origin] rounded-lg p-5 shadow-lg outline-none",
|
|
198
198
|
r
|
|
199
199
|
),
|
|
200
200
|
collisionBoundary: g,
|
|
@@ -202,9 +202,9 @@ const de = ({
|
|
|
202
202
|
"data-slot": "hover-card-content",
|
|
203
203
|
"data-testid": "spectral-hover-card-content",
|
|
204
204
|
side: v,
|
|
205
|
-
sideOffset:
|
|
205
|
+
sideOffset: C,
|
|
206
206
|
style: {
|
|
207
|
-
width: typeof
|
|
207
|
+
width: typeof h == "number" ? `${h}px` : h === "trigger-width" ? "var(--radix-hover-card-trigger-width)" : "fit-content"
|
|
208
208
|
},
|
|
209
209
|
...d
|
|
210
210
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IconProps } from './iconTypes';
|
|
2
|
+
export declare const PolygonIcon: (({ ref, className, ariaHidden, title, description, size, strokeWidth: _strokeWidth, ...rest }: IconProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
3
|
+
displayName: string;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=PolygonIcon.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "../styles/main.css";
|
|
2
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import a from "./IconBase.js";
|
|
4
|
+
const k = ({ ref: r, className: C, ariaHidden: t, title: e, description: n, size: s = 24, strokeWidth: l, ...c }) => /* @__PURE__ */ d(a, { ...c, size: s, className: C, title: e, description: n, ariaHidden: t, ref: r, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5
|
+
/* @__PURE__ */ o(
|
|
6
|
+
"path",
|
|
7
|
+
{
|
|
8
|
+
d: "M10 5C10 5.53043 10.2107 6.03914 10.5858 6.41421C10.9609 6.78929 11.4696 7 12 7C12.5304 7 13.0391 6.78929 13.4142 6.41421C13.7893 6.03914 14 5.53043 14 5C14 4.46957 13.7893 3.96086 13.4142 3.58579C13.0391 3.21071 12.5304 3 12 3C11.4696 3 10.9609 3.21071 10.5858 3.58579C10.2107 3.96086 10 4.46957 10 5Z",
|
|
9
|
+
stroke: "currentColor"
|
|
10
|
+
}
|
|
11
|
+
),
|
|
12
|
+
/* @__PURE__ */ o(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
d: "M17 8C17 8.53043 17.2107 9.03914 17.5858 9.41421C17.9609 9.78929 18.4696 10 19 10C19.5304 10 20.0391 9.78929 20.4142 9.41421C20.7893 9.03914 21 8.53043 21 8C21 7.46957 20.7893 6.96086 20.4142 6.58579C20.0391 6.21071 19.5304 6 19 6C18.4696 6 17.9609 6.21071 17.5858 6.58579C17.2107 6.96086 17 7.46957 17 8Z",
|
|
16
|
+
stroke: "currentColor"
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
/* @__PURE__ */ o(
|
|
20
|
+
"path",
|
|
21
|
+
{
|
|
22
|
+
d: "M3 11C3 11.5304 3.21071 12.0391 3.58579 12.4142C3.96086 12.7893 4.46957 13 5 13C5.53043 13 6.03914 12.7893 6.41421 12.4142C6.78929 12.0391 7 11.5304 7 11C7 10.4696 6.78929 9.96086 6.41421 9.58579C6.03914 9.21071 5.53043 9 5 9C4.46957 9 3.96086 9.21071 3.58579 9.58579C3.21071 9.96086 3 10.4696 3 11Z",
|
|
23
|
+
stroke: "currentColor"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ o(
|
|
27
|
+
"path",
|
|
28
|
+
{
|
|
29
|
+
d: "M13 19C13 19.5304 13.2107 20.0391 13.5858 20.4142C13.9609 20.7893 14.4696 21 15 21C15.5304 21 16.0391 20.7893 16.4142 20.4142C16.7893 20.0391 17 19.5304 17 19C17 18.4696 16.7893 17.9609 16.4142 17.5858C16.0391 17.2107 15.5304 17 15 17C14.4696 17 13.9609 17.2107 13.5858 17.5858C13.2107 17.9609 13 18.4696 13 19Z",
|
|
30
|
+
stroke: "currentColor"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ o("path", { d: "M6.5 9.5L10 6.5", stroke: "currentColor" }),
|
|
34
|
+
/* @__PURE__ */ o("path", { d: "M14 5.5L17 7", stroke: "currentColor" }),
|
|
35
|
+
/* @__PURE__ */ o("path", { d: "M18.5 10L16 17", stroke: "currentColor" }),
|
|
36
|
+
/* @__PURE__ */ o("path", { d: "M13.5 17.5L6.5 12.5", stroke: "currentColor" })
|
|
37
|
+
] }), i = Object.assign(k, { displayName: "PolygonIcon" });
|
|
38
|
+
export {
|
|
39
|
+
i as PolygonIcon
|
|
40
|
+
};
|
package/dist/Icons/index.d.ts
CHANGED
|
@@ -31,7 +31,6 @@ export { KeyboardIcon } from './KeyboardIcon';
|
|
|
31
31
|
export { LabelIcon } from './LabelIcon';
|
|
32
32
|
export { LassoIcon } from './LassoIcon';
|
|
33
33
|
export { LineToolIcon } from './LineToolIcon';
|
|
34
|
-
export { LineToolIcon2 } from './LineToolIcon2';
|
|
35
34
|
export { LiveViewIcon } from './LiveViewIcon';
|
|
36
35
|
export { LoaderIcon } from './LoaderIcon';
|
|
37
36
|
export { LocationIcon } from './LocationIcon';
|
|
@@ -45,6 +44,7 @@ export { PanelIconClose } from './PanelIconClose';
|
|
|
45
44
|
export { PanelIconOpen } from './PanelIconOpen';
|
|
46
45
|
export { PlayIcon } from './PlayIcon';
|
|
47
46
|
export { PlusIcon } from './PlusIcon';
|
|
47
|
+
export { PolygonIcon } from './PolygonIcon';
|
|
48
48
|
export { ResetIcon } from './ResetIcon';
|
|
49
49
|
export { ReviewedIcon } from './ReviewedIcon';
|
|
50
50
|
export { ScissorsIcon } from './ScissorsIcon';
|
package/dist/Icons.js
CHANGED
|
@@ -8,13 +8,13 @@ import { CheckCircleIcon as i } from "./Icons/CheckCircleIcon.js";
|
|
|
8
8
|
import { CheckSquareIcon as d } from "./Icons/CheckSquareIcon.js";
|
|
9
9
|
import { CheckmarkIcon as A } from "./Icons/CheckmarkIcon.js";
|
|
10
10
|
import { ChevronDownIcon as h } from "./Icons/ChevronDownIcon.js";
|
|
11
|
-
import { ChevronUpIcon as
|
|
11
|
+
import { ChevronUpIcon as L } from "./Icons/ChevronUpIcon.js";
|
|
12
12
|
import { ClockIcon as D } from "./Icons/ClockIcon.js";
|
|
13
13
|
import { CloseCircleIcon as k } from "./Icons/CloseCircleIcon.js";
|
|
14
14
|
import { CloseIcon as v } from "./Icons/CloseIcon.js";
|
|
15
15
|
import { DashboardIcon as U } from "./Icons/DashboardIcon.js";
|
|
16
16
|
import { DatabaseIcon as b } from "./Icons/DatabaseIcon.js";
|
|
17
|
-
import { DeleteIcon as
|
|
17
|
+
import { DeleteIcon as T } from "./Icons/DeleteIcon.js";
|
|
18
18
|
import { DurationIcon as G } from "./Icons/DurationIcon.js";
|
|
19
19
|
import { EditIcon as q } from "./Icons/EditIcon.js";
|
|
20
20
|
import { EmailIcon as F } from "./Icons/EmailIcon.js";
|
|
@@ -31,20 +31,20 @@ import { KeyboardIcon as mo } from "./Icons/KeyboardIcon.js";
|
|
|
31
31
|
import { LabelIcon as fo } from "./Icons/LabelIcon.js";
|
|
32
32
|
import { LassoIcon as xo } from "./Icons/LassoIcon.js";
|
|
33
33
|
import { LineToolIcon as so } from "./Icons/LineToolIcon.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import { LoaderIcon as Lo } from "./Icons/LoaderIcon.js";
|
|
34
|
+
import { LiveViewIcon as io } from "./Icons/LiveViewIcon.js";
|
|
35
|
+
import { LoaderIcon as So } from "./Icons/LoaderIcon.js";
|
|
37
36
|
import { LocationIcon as go } from "./Icons/LocationIcon.js";
|
|
38
37
|
import { LogoutIcon as yo } from "./Icons/LogoutIcon.js";
|
|
39
|
-
import { MeasureIcon as
|
|
40
|
-
import { MessagesIcon as
|
|
41
|
-
import { MetadataIcon as
|
|
42
|
-
import { MinusIcon as
|
|
43
|
-
import { OntologyIcon as
|
|
44
|
-
import { PanelIconClose as
|
|
45
|
-
import { PanelIconOpen as
|
|
46
|
-
import { PlayIcon as
|
|
47
|
-
import { PlusIcon as
|
|
38
|
+
import { MeasureIcon as uo } from "./Icons/MeasureIcon.js";
|
|
39
|
+
import { MessagesIcon as Eo } from "./Icons/MessagesIcon.js";
|
|
40
|
+
import { MetadataIcon as wo } from "./Icons/MetadataIcon.js";
|
|
41
|
+
import { MinusIcon as Po } from "./Icons/MinusIcon.js";
|
|
42
|
+
import { OntologyIcon as Zo } from "./Icons/OntologyIcon.js";
|
|
43
|
+
import { PanelIconClose as Mo } from "./Icons/PanelIconClose.js";
|
|
44
|
+
import { PanelIconOpen as Oo } from "./Icons/PanelIconOpen.js";
|
|
45
|
+
import { PlayIcon as Ro } from "./Icons/PlayIcon.js";
|
|
46
|
+
import { PlusIcon as zo } from "./Icons/PlusIcon.js";
|
|
47
|
+
import { PolygonIcon as Ho } from "./Icons/PolygonIcon.js";
|
|
48
48
|
import { ResetIcon as Vo } from "./Icons/ResetIcon.js";
|
|
49
49
|
import { ReviewedIcon as Xo } from "./Icons/ReviewedIcon.js";
|
|
50
50
|
import { ScissorsIcon as jo } from "./Icons/ScissorsIcon.js";
|
|
@@ -60,9 +60,9 @@ import { TrashIcon as ar } from "./Icons/TrashIcon.js";
|
|
|
60
60
|
import { UndoIcon as lr } from "./Icons/UndoIcon.js";
|
|
61
61
|
import { User2Icon as Cr } from "./Icons/User2Icon.js";
|
|
62
62
|
import { UserIcon as Sr } from "./Icons/UserIcon.js";
|
|
63
|
-
import { WarningIcon as
|
|
64
|
-
import { ZoomAllIcon as
|
|
65
|
-
import { ZoomXIcon as
|
|
63
|
+
import { WarningIcon as gr } from "./Icons/WarningIcon.js";
|
|
64
|
+
import { ZoomAllIcon as yr } from "./Icons/ZoomAllIcon.js";
|
|
65
|
+
import { ZoomXIcon as ur } from "./Icons/ZoomXIcon.js";
|
|
66
66
|
import { ZoomYIcon as Er } from "./Icons/ZoomYIcon.js";
|
|
67
67
|
export {
|
|
68
68
|
e as AnalyzeIcon,
|
|
@@ -75,13 +75,13 @@ export {
|
|
|
75
75
|
d as CheckSquareIcon,
|
|
76
76
|
A as CheckmarkIcon,
|
|
77
77
|
h as ChevronDownIcon,
|
|
78
|
-
|
|
78
|
+
L as ChevronUpIcon,
|
|
79
79
|
D as ClockIcon,
|
|
80
80
|
k as CloseCircleIcon,
|
|
81
81
|
v as CloseIcon,
|
|
82
82
|
U as DashboardIcon,
|
|
83
83
|
b as DatabaseIcon,
|
|
84
|
-
|
|
84
|
+
T as DeleteIcon,
|
|
85
85
|
G as DurationIcon,
|
|
86
86
|
q as EditIcon,
|
|
87
87
|
F as EmailIcon,
|
|
@@ -98,20 +98,20 @@ export {
|
|
|
98
98
|
fo as LabelIcon,
|
|
99
99
|
xo as LassoIcon,
|
|
100
100
|
so as LineToolIcon,
|
|
101
|
-
io as
|
|
102
|
-
So as
|
|
103
|
-
Lo as LoaderIcon,
|
|
101
|
+
io as LiveViewIcon,
|
|
102
|
+
So as LoaderIcon,
|
|
104
103
|
go as LocationIcon,
|
|
105
104
|
yo as LogoutIcon,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
uo as MeasureIcon,
|
|
106
|
+
Eo as MessagesIcon,
|
|
107
|
+
wo as MetadataIcon,
|
|
108
|
+
Po as MinusIcon,
|
|
109
|
+
Zo as OntologyIcon,
|
|
110
|
+
Mo as PanelIconClose,
|
|
111
|
+
Oo as PanelIconOpen,
|
|
112
|
+
Ro as PlayIcon,
|
|
113
|
+
zo as PlusIcon,
|
|
114
|
+
Ho as PolygonIcon,
|
|
115
115
|
Vo as ResetIcon,
|
|
116
116
|
Xo as ReviewedIcon,
|
|
117
117
|
jo as ScissorsIcon,
|
|
@@ -127,8 +127,8 @@ export {
|
|
|
127
127
|
lr as UndoIcon,
|
|
128
128
|
Cr as User2Icon,
|
|
129
129
|
Sr as UserIcon,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
gr as WarningIcon,
|
|
131
|
+
yr as ZoomAllIcon,
|
|
132
|
+
ur as ZoomXIcon,
|
|
133
133
|
Er as ZoomYIcon
|
|
134
134
|
};
|
|
@@ -3,8 +3,8 @@ import "../styles/main.css";
|
|
|
3
3
|
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
4
4
|
import { cn as f } from "../utils/twUtils.js";
|
|
5
5
|
import { useRef as p, useImperativeHandle as x, useCallback as i } from "react";
|
|
6
|
-
import { u as v } from "../use-animation-
|
|
7
|
-
import { m as A } from "../proxy-
|
|
6
|
+
import { u as v } from "../use-animation-CR-SdV2l.js";
|
|
7
|
+
import { m as A } from "../proxy-CgaCj1WQ.js";
|
|
8
8
|
const w = {
|
|
9
9
|
times: [0, 0.4, 1],
|
|
10
10
|
duration: 0.5
|
|
@@ -3,8 +3,8 @@ import "../styles/main.css";
|
|
|
3
3
|
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
4
4
|
import { cn as p } from "../utils/twUtils.js";
|
|
5
5
|
import { useRef as f, useImperativeHandle as x, useCallback as i } from "react";
|
|
6
|
-
import { u as v } from "../use-animation-
|
|
7
|
-
import { m as A } from "../proxy-
|
|
6
|
+
import { u as v } from "../use-animation-CR-SdV2l.js";
|
|
7
|
+
import { m as A } from "../proxy-CgaCj1WQ.js";
|
|
8
8
|
const w = {
|
|
9
9
|
times: [0, 0.4, 1],
|
|
10
10
|
duration: 0.5
|
|
@@ -4,12 +4,12 @@ export declare const usePrefixWidth: (prefix?: string) => {
|
|
|
4
4
|
prefixRef: Ref<HTMLSpanElement | null>;
|
|
5
5
|
};
|
|
6
6
|
export declare const usePasswordVisibility: () => {
|
|
7
|
+
inputType: "text" | "password";
|
|
7
8
|
isVisible: boolean;
|
|
8
9
|
toggleVisibility: () => void;
|
|
9
|
-
inputType: "text" | "password";
|
|
10
10
|
};
|
|
11
11
|
export declare const useClearOnFocus: (clearOnFocus: boolean, onChange?: (e: ChangeEvent<HTMLInputElement>) => void) => {
|
|
12
|
-
hasBeenFocused: boolean;
|
|
13
12
|
handleFocus: (e: FocusEvent<HTMLInputElement>, originalOnFocus?: (e: FocusEvent<HTMLInputElement>) => void) => void;
|
|
13
|
+
hasBeenFocused: boolean;
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=InputUtils.d.ts.map
|
package/dist/Input/InputUtils.js
CHANGED
|
@@ -12,17 +12,17 @@ const h = (t) => {
|
|
|
12
12
|
return i.observe(e.current), () => {
|
|
13
13
|
i.disconnect();
|
|
14
14
|
};
|
|
15
|
-
}
|
|
16
|
-
|
|
15
|
+
}
|
|
16
|
+
s(0);
|
|
17
17
|
}, [t]), { prefixWidth: r, prefixRef: e };
|
|
18
18
|
}, p = () => {
|
|
19
19
|
const [t, r] = u(!1), s = f(() => {
|
|
20
20
|
r((e) => !e);
|
|
21
21
|
}, []);
|
|
22
22
|
return {
|
|
23
|
+
inputType: t ? "text" : "password",
|
|
23
24
|
isVisible: t,
|
|
24
|
-
toggleVisibility: s
|
|
25
|
-
inputType: t ? "text" : "password"
|
|
25
|
+
toggleVisibility: s
|
|
26
26
|
};
|
|
27
27
|
}, v = (t, r) => {
|
|
28
28
|
const [s, e] = u(!1), n = f(
|
package/dist/Input.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'onC
|
|
|
18
18
|
value?: string;
|
|
19
19
|
};
|
|
20
20
|
export declare const Input: {
|
|
21
|
-
({
|
|
21
|
+
({ className, clearOnFocus, disabled, endIcon, errorMessage, id, label, labelClassName, name, onBlur, onChange, onFocus, placeholder, prefix, ref, required, showClearButton, startIcon, state, suppressHydrationWarning, type, value, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, ...props }: InputProps & {
|
|
22
22
|
ref?: Ref<HTMLInputElement>;
|
|
23
23
|
}): ReactElement;
|
|
24
24
|
displayName: string;
|
package/dist/Input.js
CHANGED
|
@@ -35,7 +35,6 @@ import "./Icons/KeyboardIcon.js";
|
|
|
35
35
|
import "./Icons/LabelIcon.js";
|
|
36
36
|
import "./Icons/LassoIcon.js";
|
|
37
37
|
import "./Icons/LineToolIcon.js";
|
|
38
|
-
import "./Icons/LineToolIcon2.js";
|
|
39
38
|
import "./Icons/LiveViewIcon.js";
|
|
40
39
|
import { LoaderIcon as nt } from "./Icons/LoaderIcon.js";
|
|
41
40
|
import "./Icons/LocationIcon.js";
|
|
@@ -49,6 +48,7 @@ import "./Icons/PanelIconClose.js";
|
|
|
49
48
|
import "./Icons/PanelIconOpen.js";
|
|
50
49
|
import "./Icons/PlayIcon.js";
|
|
51
50
|
import "./Icons/PlusIcon.js";
|
|
51
|
+
import "./Icons/PolygonIcon.js";
|
|
52
52
|
import "./Icons/ResetIcon.js";
|
|
53
53
|
import "./Icons/ReviewedIcon.js";
|
|
54
54
|
import "./Icons/ScissorsIcon.js";
|
|
@@ -77,30 +77,30 @@ const gt = (...a) => (p) => {
|
|
|
77
77
|
i && (typeof i == "function" ? i(p) : i.current = p);
|
|
78
78
|
});
|
|
79
79
|
}, xt = (a) => ({
|
|
80
|
+
date: "off",
|
|
80
81
|
email: "email",
|
|
82
|
+
number: "off",
|
|
81
83
|
password: "current-password",
|
|
82
84
|
tel: "tel",
|
|
83
|
-
url: "url",
|
|
84
85
|
text: "off",
|
|
85
|
-
|
|
86
|
-
date: "off",
|
|
86
|
+
url: "url",
|
|
87
87
|
"datetime-local": "off"
|
|
88
88
|
})[a] || "off", Ct = ({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
disabled: k,
|
|
89
|
+
className: a,
|
|
90
|
+
clearOnFocus: p = !1,
|
|
91
|
+
disabled: i,
|
|
93
92
|
endIcon: b,
|
|
94
93
|
errorMessage: g,
|
|
95
|
-
id:
|
|
94
|
+
id: k,
|
|
96
95
|
label: e,
|
|
97
|
-
labelClassName:
|
|
96
|
+
labelClassName: P,
|
|
98
97
|
name: x,
|
|
99
98
|
onBlur: C,
|
|
100
99
|
onChange: n,
|
|
101
100
|
onFocus: w,
|
|
102
|
-
placeholder:
|
|
101
|
+
placeholder: R,
|
|
103
102
|
prefix: l,
|
|
103
|
+
ref: V,
|
|
104
104
|
required: v,
|
|
105
105
|
showClearButton: $ = !1,
|
|
106
106
|
startIcon: y,
|
|
@@ -112,7 +112,7 @@ const gt = (...a) => (p) => {
|
|
|
112
112
|
"aria-describedby": O,
|
|
113
113
|
...j
|
|
114
114
|
}) => {
|
|
115
|
-
const m = ct(
|
|
115
|
+
const m = ct(k, x), N = `${m}-error`, { isDisabled: F, isLoading: A, isInvalid: B } = mt(i, s), H = dt(s, O, v, N), E = bt(null), T = gt(V, E), { isVisible: u, toggleVisibility: W, inputType: D } = tt(), { prefixWidth: G, prefixRef: J } = rt(l), { handleFocus: z } = et(p, n ? (r) => n(r.target.value) : void 0), K = d(
|
|
116
116
|
(r) => {
|
|
117
117
|
C?.(r);
|
|
118
118
|
},
|
|
@@ -133,16 +133,16 @@ const gt = (...a) => (p) => {
|
|
|
133
133
|
r && (r.value = "", r.dispatchEvent(new Event("input", { bubbles: !0 })), r.focus());
|
|
134
134
|
}, []), S = $ && I.length > 0, Y = () => {
|
|
135
135
|
const r = "absolute right-4 top-1/2 -translate-y-1/2 text-input-icon hover:text-input-icon--hover focus:outline-none cursor-pointer", o = {
|
|
136
|
-
password: () => /* @__PURE__ */ t("button", { "aria-controls": m, "aria-label": u ? `Hide ${e
|
|
137
|
-
clear: () => /* @__PURE__ */ t("button", { "aria-label": `Clear ${e
|
|
136
|
+
password: () => /* @__PURE__ */ t("button", { "aria-controls": m, "aria-label": u ? `Hide ${e ?? "password"}` : `Show ${e ?? "password"}`, "aria-pressed": u, className: r, "data-testid": "spectral-input-password-toggle", onClick: W, type: "button", children: u ? /* @__PURE__ */ t(at, { size: 22 }) : /* @__PURE__ */ t(pt, { size: 22 }) }),
|
|
137
|
+
clear: () => /* @__PURE__ */ t("button", { "aria-label": `Clear ${e ?? "input"}`, className: r, "data-testid": "spectral-input-clear-button", onClick: X, type: "button", children: /* @__PURE__ */ t(it, { size: 24 }) }),
|
|
138
138
|
loading: () => /* @__PURE__ */ t("div", { className: "text-input-icon absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "spectral-input-loading-icon", children: /* @__PURE__ */ t(nt, { size: 24 }) }),
|
|
139
139
|
error: () => /* @__PURE__ */ t("div", { className: "text-danger-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "spectral-input-error-icon", children: /* @__PURE__ */ t(st, { size: 24 }) }),
|
|
140
140
|
success: () => /* @__PURE__ */ t("div", { className: "text-success-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "spectral-input-success-icon", children: /* @__PURE__ */ t(ot, { size: 24 }) })
|
|
141
141
|
};
|
|
142
142
|
return b ? /* @__PURE__ */ t("div", { className: "text-input-icon absolute top-1/2 right-4 -translate-y-1/2", children: b }) : c === "password" ? o.password() : S ? o.clear() : A ? o.loading() : s === "success" ? o.success() : s === "error" ? o.error() : null;
|
|
143
|
-
}, Z = () => y || null, _ = h(ut(s,
|
|
143
|
+
}, Z = () => y || null, _ = h(ut(s, a), "[text-indent:var(--prefix-width)]", S && "pr-10"), q = h("pointer-events-none absolute inset-y-0 left-4 flex items-center text-base text-input-text-prefix opacity-100 peer-disabled:opacity-50");
|
|
144
144
|
return /* @__PURE__ */ f("div", { className: "w-full space-y-1.5", "data-testid": "spectral-input-container", children: [
|
|
145
|
-
e && /* @__PURE__ */ t(lt, { className: h("mb-2 block",
|
|
145
|
+
e && /* @__PURE__ */ t(lt, { className: h("mb-2 block", P, F && "text-input-text--disabled placeholder:text-input-text-placeholder cursor-not-allowed"), "data-testid": "spectral-input-label", htmlFor: m, children: e }),
|
|
146
146
|
/* @__PURE__ */ f("div", { className: "relative", "data-testid": "spectral-input-wrapper", children: [
|
|
147
147
|
/* @__PURE__ */ f("div", { className: "relative", children: [
|
|
148
148
|
Z(),
|
|
@@ -150,7 +150,7 @@ const gt = (...a) => (p) => {
|
|
|
150
150
|
/* @__PURE__ */ t(
|
|
151
151
|
"input",
|
|
152
152
|
{
|
|
153
|
-
"aria-label": M
|
|
153
|
+
"aria-label": M ?? e,
|
|
154
154
|
autoComplete: xt(c),
|
|
155
155
|
className: _,
|
|
156
156
|
"data-state": s,
|
|
@@ -161,11 +161,11 @@ const gt = (...a) => (p) => {
|
|
|
161
161
|
onBlur: K,
|
|
162
162
|
onChange: U,
|
|
163
163
|
onFocus: Q,
|
|
164
|
-
placeholder:
|
|
164
|
+
placeholder: R ?? e,
|
|
165
165
|
ref: T,
|
|
166
166
|
required: v,
|
|
167
167
|
style: ft({
|
|
168
|
-
"--prefix-width": l ? `${G}px` : "
|
|
168
|
+
"--prefix-width": l ? `${G}px` : "0"
|
|
169
169
|
}),
|
|
170
170
|
suppressHydrationWarning: L,
|
|
171
171
|
type: c === "password" ? D : c,
|