@spear-ai/spectral 1.10.3 → 1.11.1
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 +105 -97
- package/dist/Icons/Crosshairs2Icon.d.ts +5 -0
- package/dist/Icons/Crosshairs2Icon.js +51 -0
- package/dist/Icons/CrosshairsIcon.d.ts +5 -0
- package/dist/Icons/CrosshairsIcon.js +20 -0
- package/dist/Icons/MaximizeIcon.d.ts +5 -0
- package/dist/Icons/MaximizeIcon.js +44 -0
- package/dist/Icons/MinimizeIcon.d.ts +5 -0
- package/dist/Icons/MinimizeIcon.js +44 -0
- package/dist/Icons/PauseIcon.d.ts +5 -0
- package/dist/Icons/PauseIcon.js +27 -0
- package/dist/Icons/PrinterIcon.d.ts +5 -0
- package/dist/Icons/PrinterIcon.js +21 -0
- package/dist/Icons/SparklesIcon.d.ts +5 -0
- package/dist/Icons/SparklesIcon.js +21 -0
- package/dist/Icons/UploadIcon.d.ts +5 -0
- package/dist/Icons/UploadIcon.js +37 -0
- package/dist/Icons/index.d.ts +8 -0
- package/dist/Icons.js +63 -55
- package/dist/Input.d.ts +2 -1
- package/dist/Input.js +97 -83
- package/dist/Textarea.js +1 -1
- package/dist/styles/spectral.css +2 -2
- package/dist/utils/formFieldUtils.d.ts +9 -3
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +19 -7
- package/package.json +1 -1
package/dist/Icons.js
CHANGED
|
@@ -13,58 +13,66 @@ import { ChevronUpIcon as d } from "./Icons/ChevronUpIcon.js";
|
|
|
13
13
|
import { ClockIcon as f } from "./Icons/ClockIcon.js";
|
|
14
14
|
import { CloseCircleIcon as p } from "./Icons/CloseCircleIcon.js";
|
|
15
15
|
import { CloseIcon as m } from "./Icons/CloseIcon.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
|
|
16
|
+
import { Crosshairs2Icon as h } from "./Icons/Crosshairs2Icon.js";
|
|
17
|
+
import { CrosshairsIcon as g } from "./Icons/CrosshairsIcon.js";
|
|
18
|
+
import { DashboardIcon as _ } from "./Icons/DashboardIcon.js";
|
|
19
|
+
import { DatabaseIcon as v } from "./Icons/DatabaseIcon.js";
|
|
20
|
+
import { DeleteIcon as y } from "./Icons/DeleteIcon.js";
|
|
21
|
+
import { DurationIcon as b } from "./Icons/DurationIcon.js";
|
|
22
|
+
import { EditIcon as x } from "./Icons/EditIcon.js";
|
|
23
|
+
import { EmailIcon as S } from "./Icons/EmailIcon.js";
|
|
24
|
+
import { EraserIcon as C } from "./Icons/EraserIcon.js";
|
|
25
|
+
import { ErrorIcon as w } from "./Icons/ErrorIcon.js";
|
|
26
|
+
import { EyeClosedIcon as T } from "./Icons/EyeClosedIcon.js";
|
|
27
|
+
import { EyeClosedIcon2 as E } from "./Icons/EyeClosedIcon2.js";
|
|
28
|
+
import { EyeOpenIcon as D } from "./Icons/EyeOpenIcon.js";
|
|
29
|
+
import { FileDownloadIcon as O } from "./Icons/FileDownloadIcon.js";
|
|
30
|
+
import { GoToFirstIcon as k } from "./Icons/GoToFirstIcon.js";
|
|
31
|
+
import { GoToLastIcon as A } from "./Icons/GoToLastIcon.js";
|
|
32
|
+
import { HarmonicCursorsIcon as j } from "./Icons/HarmonicCursorsIcon.js";
|
|
33
|
+
import { InfoIcon as M } from "./Icons/InfoIcon.js";
|
|
34
|
+
import { KeyboardIcon as N } from "./Icons/KeyboardIcon.js";
|
|
35
|
+
import { LabelIcon as P } from "./Icons/LabelIcon.js";
|
|
36
|
+
import { LassoIcon as F } from "./Icons/LassoIcon.js";
|
|
37
|
+
import { LineToolIcon as I } from "./Icons/LineToolIcon.js";
|
|
38
|
+
import { LiveViewIcon as L } from "./Icons/LiveViewIcon.js";
|
|
39
|
+
import { LoaderIcon as R } from "./Icons/LoaderIcon.js";
|
|
40
|
+
import { LocationIcon as z } from "./Icons/LocationIcon.js";
|
|
41
|
+
import { LogoutIcon as B } from "./Icons/LogoutIcon.js";
|
|
42
|
+
import { MaximizeIcon as V } from "./Icons/MaximizeIcon.js";
|
|
43
|
+
import { MeasureIcon as H } from "./Icons/MeasureIcon.js";
|
|
44
|
+
import { MessagesIcon as U } from "./Icons/MessagesIcon.js";
|
|
45
|
+
import { MetadataIcon as W } from "./Icons/MetadataIcon.js";
|
|
46
|
+
import { MinimizeIcon as G } from "./Icons/MinimizeIcon.js";
|
|
47
|
+
import { MinusIcon as K } from "./Icons/MinusIcon.js";
|
|
48
|
+
import { OntologyIcon as q } from "./Icons/OntologyIcon.js";
|
|
49
|
+
import { PanelIconClose as J } from "./Icons/PanelIconClose.js";
|
|
50
|
+
import { PanelIconOpen as Y } from "./Icons/PanelIconOpen.js";
|
|
51
|
+
import { PauseIcon as X } from "./Icons/PauseIcon.js";
|
|
52
|
+
import { PlayIcon as Z } from "./Icons/PlayIcon.js";
|
|
53
|
+
import { PlusIcon as Q } from "./Icons/PlusIcon.js";
|
|
54
|
+
import { PolygonIcon as $ } from "./Icons/PolygonIcon.js";
|
|
55
|
+
import { PrinterIcon as ee } from "./Icons/PrinterIcon.js";
|
|
56
|
+
import { ProgressCheckIcon as te } from "./Icons/ProgressCheckIcon.js";
|
|
57
|
+
import { ResetIcon as ne } from "./Icons/ResetIcon.js";
|
|
58
|
+
import { ReviewedIcon as re } from "./Icons/ReviewedIcon.js";
|
|
59
|
+
import { ScissorsIcon as ie } from "./Icons/ScissorsIcon.js";
|
|
60
|
+
import { SearchIcon as ae } from "./Icons/SearchIcon.js";
|
|
61
|
+
import { SettingsIcon as oe } from "./Icons/SettingsIcon.js";
|
|
62
|
+
import { SortAscendingIcon as se } from "./Icons/SortAscendingIcon.js";
|
|
63
|
+
import { SortAtoZIcon as ce } from "./Icons/SortAtoZIcon.js";
|
|
64
|
+
import { SortDescendingIcon as le } from "./Icons/SortDescendingIcon.js";
|
|
65
|
+
import { SortZtoAIcon as ue } from "./Icons/SortZtoAIcon.js";
|
|
66
|
+
import { SparklesIcon as de } from "./Icons/SparklesIcon.js";
|
|
67
|
+
import { StackIcon as fe } from "./Icons/StackIcon.js";
|
|
68
|
+
import { StarIcon as pe } from "./Icons/StarIcon.js";
|
|
69
|
+
import { TrashIcon as me } from "./Icons/TrashIcon.js";
|
|
70
|
+
import { UndoIcon as he } from "./Icons/UndoIcon.js";
|
|
71
|
+
import { UploadIcon as ge } from "./Icons/UploadIcon.js";
|
|
72
|
+
import { User2Icon as _e } from "./Icons/User2Icon.js";
|
|
73
|
+
import { UserIcon as ve } from "./Icons/UserIcon.js";
|
|
74
|
+
import { WarningIcon as ye } from "./Icons/WarningIcon.js";
|
|
75
|
+
import { ZoomAllIcon as be } from "./Icons/ZoomAllIcon.js";
|
|
76
|
+
import { ZoomXIcon as xe } from "./Icons/ZoomXIcon.js";
|
|
77
|
+
import { ZoomYIcon as Se } from "./Icons/ZoomYIcon.js";
|
|
78
|
+
export { e as AnalyzeIcon, t as AnnotationsIcon, n as ApprovedIcon, r as ArrowDownIcon, i as ArrowUpIcon, a as BoxToolIcon, o as CalendarIcon, s as CheckCircleIcon, c as CheckSquareIcon, l as CheckmarkIcon, u as ChevronDownIcon, d as ChevronUpIcon, f as ClockIcon, p as CloseCircleIcon, m as CloseIcon, h as Crosshairs2Icon, g as CrosshairsIcon, _ as DashboardIcon, v as DatabaseIcon, y as DeleteIcon, b as DurationIcon, x as EditIcon, S as EmailIcon, C as EraserIcon, w as ErrorIcon, T as EyeClosedIcon, E as EyeClosedIcon2, D as EyeOpenIcon, O as FileDownloadIcon, k as GoToFirstIcon, A as GoToLastIcon, j as HarmonicCursorsIcon, M as InfoIcon, N as KeyboardIcon, P as LabelIcon, F as LassoIcon, I as LineToolIcon, L as LiveViewIcon, R as LoaderIcon, z as LocationIcon, B as LogoutIcon, V as MaximizeIcon, H as MeasureIcon, U as MessagesIcon, W as MetadataIcon, G as MinimizeIcon, K as MinusIcon, q as OntologyIcon, J as PanelIconClose, Y as PanelIconOpen, X as PauseIcon, Z as PlayIcon, Q as PlusIcon, $ as PolygonIcon, ee as PrinterIcon, te as ProgressCheckIcon, ne as ResetIcon, re as ReviewedIcon, ie as ScissorsIcon, ae as SearchIcon, oe as SettingsIcon, se as SortAscendingIcon, ce as SortAtoZIcon, le as SortDescendingIcon, ue as SortZtoAIcon, de as SparklesIcon, fe as StackIcon, pe as StarIcon, me as TrashIcon, he as UndoIcon, ge as UploadIcon, _e as User2Icon, ve as UserIcon, ye as WarningIcon, be as ZoomAllIcon, xe as ZoomXIcon, Se as ZoomYIcon };
|
package/dist/Input.d.ts
CHANGED
|
@@ -16,9 +16,10 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'onC
|
|
|
16
16
|
suppressHydrationWarning?: boolean;
|
|
17
17
|
type?: InputType;
|
|
18
18
|
value?: string;
|
|
19
|
+
warningMessage?: BaseFormFieldProps['errorMessage'];
|
|
19
20
|
};
|
|
20
21
|
export declare const Input: {
|
|
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
|
+
({ className, clearOnFocus, disabled, endIcon, errorMessage, id, label, labelClassName, name, onBlur, onChange, onFocus, placeholder, prefix, ref, required, showClearButton, startIcon, state, suppressHydrationWarning, type, value, warningMessage, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, ...props }: InputProps & {
|
|
22
23
|
ref?: Ref<HTMLInputElement>;
|
|
23
24
|
}): ReactElement;
|
|
24
25
|
displayName: string;
|
package/dist/Input.js
CHANGED
|
@@ -4,20 +4,21 @@ import { CheckCircleIcon as e } from "./Icons/CheckCircleIcon.js";
|
|
|
4
4
|
import { CloseCircleIcon as t } from "./Icons/CloseCircleIcon.js";
|
|
5
5
|
import { ErrorIcon as n } from "./Icons/ErrorIcon.js";
|
|
6
6
|
import { EyeClosedIcon as r } from "./Icons/EyeClosedIcon.js";
|
|
7
|
-
import { EyeOpenIcon as
|
|
8
|
-
import { LoaderIcon as
|
|
7
|
+
import { EyeOpenIcon as ee } from "./Icons/EyeOpenIcon.js";
|
|
8
|
+
import { LoaderIcon as i } from "./Icons/LoaderIcon.js";
|
|
9
|
+
import { WarningIcon as a } from "./Icons/WarningIcon.js";
|
|
9
10
|
import { t as o } from "./twUtils-VNWgstKL.js";
|
|
10
|
-
import { ErrorMessage as s,
|
|
11
|
-
import { Label as
|
|
12
|
-
import { useClearOnFocus as te, usePasswordVisibility as
|
|
13
|
-
import { useCallback as
|
|
14
|
-
import { jsx as
|
|
11
|
+
import { ErrorMessage as s, WarningMessage as c, getAriaProps as l, getFormFieldCSSProperties as u, getInputClasses as d, useFormFieldId as f, useFormFieldState as p } from "./utils/formFieldUtils.js";
|
|
12
|
+
import { Label as m } from "./Label.js";
|
|
13
|
+
import { useClearOnFocus as te, usePasswordVisibility as h, usePrefixWidth as g } from "./Input/InputUtils.js";
|
|
14
|
+
import { useCallback as _, useRef as ne } from "react";
|
|
15
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
16
|
//#region src/components/Input/Input.tsx
|
|
16
|
-
var
|
|
17
|
+
var b = (...e) => (t) => {
|
|
17
18
|
e.forEach((e) => {
|
|
18
19
|
e && (typeof e == "function" ? e(t) : e.current = t);
|
|
19
20
|
});
|
|
20
|
-
},
|
|
21
|
+
}, x = (e) => ({
|
|
21
22
|
date: "off",
|
|
22
23
|
email: "email",
|
|
23
24
|
number: "off",
|
|
@@ -26,110 +27,123 @@ var y = (...e) => (t) => {
|
|
|
26
27
|
text: "off",
|
|
27
28
|
url: "url",
|
|
28
29
|
"datetime-local": "off"
|
|
29
|
-
})[e] || "off",
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
Q(e,
|
|
34
|
-
}, [Q,
|
|
30
|
+
})[e] || "off", S = ({ className: S, clearOnFocus: C = !1, disabled: w, endIcon: T, errorMessage: E, id: re, label: D, labelClassName: O, name: k, onBlur: A, onChange: j, onFocus: M, placeholder: N, prefix: P, ref: F, required: I, showClearButton: L = !1, startIcon: R, state: z = "default", suppressHydrationWarning: B = !0, type: V = "text", value: H = "", warningMessage: U, "aria-label": W, "aria-describedby": G, ...ie }) => {
|
|
31
|
+
let K = f(re, k), q = `${K}-error`, J = `${K}-warning`, { isDisabled: Y, isLoading: ae, isInvalid: oe } = p(w, z), se = l(z, G, I, z === "error" ? q : z === "warning" && U ? J : void 0), X = ne(null), ce = b(F, X), { isVisible: Z, toggleVisibility: le, inputType: ue } = h(), { prefixWidth: de, prefixRef: fe } = g(P), { handleFocus: Q } = te(C, j ? (e) => j(e.target.value) : void 0), pe = _((e) => {
|
|
32
|
+
A?.(e);
|
|
33
|
+
}, [A]), me = _((e) => {
|
|
34
|
+
Q(e, M);
|
|
35
|
+
}, [Q, M]), he = _((e) => {
|
|
35
36
|
let t = e.target.value;
|
|
36
|
-
|
|
37
|
-
}, [
|
|
37
|
+
j?.(t);
|
|
38
|
+
}, [j]), ge = _(() => {
|
|
38
39
|
let e = X.current;
|
|
39
40
|
e && (e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
|
|
40
|
-
}, []), $ =
|
|
41
|
+
}, []), $ = L && H.length > 0, _e = () => {
|
|
41
42
|
let o = "absolute right-4 top-1/2 -translate-y-1/2 text-input-icon hover:text-input-icon--hover focus:outline-none cursor-pointer", s = {
|
|
42
|
-
password: () => /* @__PURE__ */
|
|
43
|
-
"aria-controls":
|
|
44
|
-
"aria-label": Z ? `Hide ${
|
|
43
|
+
password: () => /* @__PURE__ */ v("button", {
|
|
44
|
+
"aria-controls": K,
|
|
45
|
+
"aria-label": Z ? `Hide ${D ?? "password"}` : `Show ${D ?? "password"}`,
|
|
45
46
|
"aria-pressed": Z,
|
|
46
47
|
className: o,
|
|
47
48
|
"data-testid": "spectral-input-password-toggle",
|
|
48
|
-
onClick:
|
|
49
|
+
onClick: le,
|
|
49
50
|
type: "button",
|
|
50
|
-
children:
|
|
51
|
+
children: v(Z ? r : ee, { size: 22 })
|
|
51
52
|
}),
|
|
52
|
-
clear: () => /* @__PURE__ */
|
|
53
|
-
"aria-label": String(`Clear ${
|
|
53
|
+
clear: () => /* @__PURE__ */ v("button", {
|
|
54
|
+
"aria-label": String(`Clear ${D ?? "input"}`),
|
|
54
55
|
className: o,
|
|
55
56
|
"data-testid": "spectral-input-clear-button",
|
|
56
|
-
onClick:
|
|
57
|
+
onClick: ge,
|
|
57
58
|
type: "button",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ v(t, { size: 24 })
|
|
59
60
|
}),
|
|
60
|
-
loading: () => /* @__PURE__ */
|
|
61
|
+
loading: () => /* @__PURE__ */ v("div", {
|
|
61
62
|
className: "right-4 text-input-icon absolute top-1/2 -translate-y-1/2",
|
|
62
63
|
"data-testid": "spectral-input-loading-icon",
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ v(i, { size: 24 })
|
|
64
65
|
}),
|
|
65
|
-
error: () => /* @__PURE__ */
|
|
66
|
+
error: () => /* @__PURE__ */ v("div", {
|
|
66
67
|
className: "right-4 absolute top-1/2 -translate-y-1/2 text-danger-400",
|
|
67
68
|
"data-testid": "spectral-input-error-icon",
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ v(n, { size: 24 })
|
|
69
70
|
}),
|
|
70
|
-
success: () => /* @__PURE__ */
|
|
71
|
+
success: () => /* @__PURE__ */ v("div", {
|
|
71
72
|
className: "right-4 absolute top-1/2 -translate-y-1/2 text-success-400",
|
|
72
73
|
"data-testid": "spectral-input-success-icon",
|
|
73
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ v(e, { size: 24 })
|
|
75
|
+
}),
|
|
76
|
+
warning: () => /* @__PURE__ */ v("div", {
|
|
77
|
+
className: "right-4 absolute top-1/2 -translate-y-1/2 text-warning-400",
|
|
78
|
+
"data-testid": "spectral-input-warning-icon",
|
|
79
|
+
children: /* @__PURE__ */ v(a, { size: 24 })
|
|
74
80
|
})
|
|
75
81
|
};
|
|
76
|
-
return
|
|
82
|
+
return T ? /* @__PURE__ */ v("div", {
|
|
77
83
|
className: "right-4 text-input-icon absolute top-1/2 -translate-y-1/2",
|
|
78
|
-
children:
|
|
79
|
-
}) :
|
|
80
|
-
},
|
|
81
|
-
return /* @__PURE__ */
|
|
84
|
+
children: T
|
|
85
|
+
}) : V === "password" ? s.password() : $ ? s.clear() : ae ? s.loading() : z === "success" ? s.success() : z === "warning" ? s.warning() : z === "error" ? s.error() : null;
|
|
86
|
+
}, ve = () => R || null, ye = V === "number" || V === "date" || V === "datetime-local", be = o(d(z, S), "[text-indent:var(--prefix-width)]", $ && "pr-10", ye && "tabular-nums"), xe = o("inset-y-0 left-4 text-base pointer-events-none absolute flex items-center text-input-text-prefix opacity-100 peer-disabled:opacity-50");
|
|
87
|
+
return /* @__PURE__ */ y("div", {
|
|
82
88
|
className: "space-y-1.5 w-full",
|
|
83
89
|
"data-testid": "spectral-input-container",
|
|
84
|
-
children: [
|
|
85
|
-
className: o("mb-2 block",
|
|
90
|
+
children: [D && /* @__PURE__ */ v(m, {
|
|
91
|
+
className: o("mb-2 block", O, Y && "cursor-not-allowed text-input-text--disabled placeholder:text-input-text-placeholder"),
|
|
86
92
|
"data-testid": "spectral-input-label",
|
|
87
|
-
htmlFor:
|
|
88
|
-
children:
|
|
89
|
-
}), /* @__PURE__ */
|
|
93
|
+
htmlFor: K,
|
|
94
|
+
children: D
|
|
95
|
+
}), /* @__PURE__ */ y("div", {
|
|
90
96
|
className: "relative",
|
|
91
97
|
"data-testid": "spectral-input-wrapper",
|
|
92
|
-
children: [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ y("div", {
|
|
100
|
+
className: "relative",
|
|
101
|
+
children: [
|
|
102
|
+
ve(),
|
|
103
|
+
P && /* @__PURE__ */ v("span", {
|
|
104
|
+
ref: fe,
|
|
105
|
+
className: xe,
|
|
106
|
+
children: P
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ v("input", {
|
|
109
|
+
"aria-label": W ?? D,
|
|
110
|
+
autoComplete: x(V),
|
|
111
|
+
className: be,
|
|
112
|
+
"data-state": z,
|
|
113
|
+
"data-testid": "spectral-input",
|
|
114
|
+
disabled: Y,
|
|
115
|
+
id: K,
|
|
116
|
+
name: k,
|
|
117
|
+
onBlur: pe,
|
|
118
|
+
onChange: he,
|
|
119
|
+
onFocus: me,
|
|
120
|
+
placeholder: N ?? D,
|
|
121
|
+
ref: ce,
|
|
122
|
+
required: I,
|
|
123
|
+
style: u({ "--prefix-width": P ? `${de}px` : "0" }),
|
|
124
|
+
suppressHydrationWarning: B,
|
|
125
|
+
type: V === "password" ? ue : V,
|
|
126
|
+
value: H,
|
|
127
|
+
...se,
|
|
128
|
+
...ie
|
|
129
|
+
}),
|
|
130
|
+
_e()
|
|
131
|
+
]
|
|
132
|
+
}),
|
|
133
|
+
oe && E && /* @__PURE__ */ v(s, {
|
|
134
|
+
dataTestId: "spectral-input-error-message",
|
|
135
|
+
id: q,
|
|
136
|
+
message: E
|
|
137
|
+
}),
|
|
138
|
+
z === "warning" && U && /* @__PURE__ */ v(c, {
|
|
139
|
+
dataTestId: "spectral-input-warning-message",
|
|
140
|
+
id: J,
|
|
141
|
+
message: U
|
|
142
|
+
})
|
|
143
|
+
]
|
|
130
144
|
})]
|
|
131
145
|
});
|
|
132
146
|
};
|
|
133
|
-
|
|
147
|
+
S.displayName = "Input";
|
|
134
148
|
//#endregion
|
|
135
|
-
export {
|
|
149
|
+
export { S as Input };
|
package/dist/Textarea.js
CHANGED
|
@@ -15,7 +15,7 @@ var p = "absolute right-4 top-4", m = (e) => e || "off", h = (e, n) => t("absolu
|
|
|
15
15
|
onChange: D ?? (() => {}),
|
|
16
16
|
onFocus: O,
|
|
17
17
|
onBlur: E
|
|
18
|
-
}), { isDisabled: H, isLoading: U } = s(y, j), W = r(j,
|
|
18
|
+
}), { isDisabled: H, isLoading: U } = s(y, j), W = r(j, N["aria-describedby"], A, F), G = M?.length || 0, K = a(j, v), q = () => ({
|
|
19
19
|
"--textarea-min-height": "6rem",
|
|
20
20
|
"--textarea-max-height": "12rem",
|
|
21
21
|
"--textarea-border-radius": "0.5rem"
|