@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/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 { DashboardIcon as h } from "./Icons/DashboardIcon.js";
17
- import { DatabaseIcon as g } from "./Icons/DatabaseIcon.js";
18
- import { DeleteIcon as _ } from "./Icons/DeleteIcon.js";
19
- import { DurationIcon as v } from "./Icons/DurationIcon.js";
20
- import { EditIcon as y } from "./Icons/EditIcon.js";
21
- import { EmailIcon as b } from "./Icons/EmailIcon.js";
22
- import { EraserIcon as x } from "./Icons/EraserIcon.js";
23
- import { ErrorIcon as S } from "./Icons/ErrorIcon.js";
24
- import { EyeClosedIcon as C } from "./Icons/EyeClosedIcon.js";
25
- import { EyeClosedIcon2 as w } from "./Icons/EyeClosedIcon2.js";
26
- import { EyeOpenIcon as T } from "./Icons/EyeOpenIcon.js";
27
- import { FileDownloadIcon as E } from "./Icons/FileDownloadIcon.js";
28
- import { GoToFirstIcon as D } from "./Icons/GoToFirstIcon.js";
29
- import { GoToLastIcon as O } from "./Icons/GoToLastIcon.js";
30
- import { HarmonicCursorsIcon as k } from "./Icons/HarmonicCursorsIcon.js";
31
- import { InfoIcon as A } from "./Icons/InfoIcon.js";
32
- import { KeyboardIcon as j } from "./Icons/KeyboardIcon.js";
33
- import { LabelIcon as M } from "./Icons/LabelIcon.js";
34
- import { LassoIcon as N } from "./Icons/LassoIcon.js";
35
- import { LineToolIcon as P } from "./Icons/LineToolIcon.js";
36
- import { LiveViewIcon as F } from "./Icons/LiveViewIcon.js";
37
- import { LoaderIcon as I } from "./Icons/LoaderIcon.js";
38
- import { LocationIcon as L } from "./Icons/LocationIcon.js";
39
- import { LogoutIcon as R } from "./Icons/LogoutIcon.js";
40
- import { MeasureIcon as z } from "./Icons/MeasureIcon.js";
41
- import { MessagesIcon as B } from "./Icons/MessagesIcon.js";
42
- import { MetadataIcon as V } from "./Icons/MetadataIcon.js";
43
- import { MinusIcon as H } from "./Icons/MinusIcon.js";
44
- import { OntologyIcon as U } from "./Icons/OntologyIcon.js";
45
- import { PanelIconClose as W } from "./Icons/PanelIconClose.js";
46
- import { PanelIconOpen as G } from "./Icons/PanelIconOpen.js";
47
- import { PlayIcon as K } from "./Icons/PlayIcon.js";
48
- import { PlusIcon as q } from "./Icons/PlusIcon.js";
49
- import { PolygonIcon as J } from "./Icons/PolygonIcon.js";
50
- import { ProgressCheckIcon as Y } from "./Icons/ProgressCheckIcon.js";
51
- import { ResetIcon as X } from "./Icons/ResetIcon.js";
52
- import { ReviewedIcon as Z } from "./Icons/ReviewedIcon.js";
53
- import { ScissorsIcon as Q } from "./Icons/ScissorsIcon.js";
54
- import { SearchIcon as $ } from "./Icons/SearchIcon.js";
55
- import { SettingsIcon as ee } from "./Icons/SettingsIcon.js";
56
- import { SortAscendingIcon as te } from "./Icons/SortAscendingIcon.js";
57
- import { SortAtoZIcon as ne } from "./Icons/SortAtoZIcon.js";
58
- import { SortDescendingIcon as re } from "./Icons/SortDescendingIcon.js";
59
- import { SortZtoAIcon as ie } from "./Icons/SortZtoAIcon.js";
60
- import { StackIcon as ae } from "./Icons/StackIcon.js";
61
- import { StarIcon as oe } from "./Icons/StarIcon.js";
62
- import { TrashIcon as se } from "./Icons/TrashIcon.js";
63
- import { UndoIcon as ce } from "./Icons/UndoIcon.js";
64
- import { User2Icon as le } from "./Icons/User2Icon.js";
65
- import { UserIcon as ue } from "./Icons/UserIcon.js";
66
- import { WarningIcon as de } from "./Icons/WarningIcon.js";
67
- import { ZoomAllIcon as fe } from "./Icons/ZoomAllIcon.js";
68
- import { ZoomXIcon as pe } from "./Icons/ZoomXIcon.js";
69
- import { ZoomYIcon as me } from "./Icons/ZoomYIcon.js";
70
- 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 DashboardIcon, g as DatabaseIcon, _ as DeleteIcon, v as DurationIcon, y as EditIcon, b as EmailIcon, x as EraserIcon, S as ErrorIcon, C as EyeClosedIcon, w as EyeClosedIcon2, T as EyeOpenIcon, E as FileDownloadIcon, D as GoToFirstIcon, O as GoToLastIcon, k as HarmonicCursorsIcon, A as InfoIcon, j as KeyboardIcon, M as LabelIcon, N as LassoIcon, P as LineToolIcon, F as LiveViewIcon, I as LoaderIcon, L as LocationIcon, R as LogoutIcon, z as MeasureIcon, B as MessagesIcon, V as MetadataIcon, H as MinusIcon, U as OntologyIcon, W as PanelIconClose, G as PanelIconOpen, K as PlayIcon, q as PlusIcon, J as PolygonIcon, Y as ProgressCheckIcon, X as ResetIcon, Z as ReviewedIcon, Q as ScissorsIcon, $ as SearchIcon, ee as SettingsIcon, te as SortAscendingIcon, ne as SortAtoZIcon, re as SortDescendingIcon, ie as SortZtoAIcon, ae as StackIcon, oe as StarIcon, se as TrashIcon, ce as UndoIcon, le as User2Icon, ue as UserIcon, de as WarningIcon, fe as ZoomAllIcon, pe as ZoomXIcon, me as ZoomYIcon };
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 i } from "./Icons/EyeOpenIcon.js";
8
- import { LoaderIcon as a } from "./Icons/LoaderIcon.js";
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, getAriaProps as c, getFormFieldCSSProperties as l, getInputClasses as u, useFormFieldId as d, useFormFieldState as f } from "./utils/formFieldUtils.js";
11
- import { Label as ee } from "./Label.js";
12
- import { useClearOnFocus as te, usePasswordVisibility as p, usePrefixWidth as m } from "./Input/InputUtils.js";
13
- import { useCallback as h, useRef as g } from "react";
14
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
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 y = (...e) => (t) => {
17
+ var b = (...e) => (t) => {
17
18
  e.forEach((e) => {
18
19
  e && (typeof e == "function" ? e(t) : e.current = t);
19
20
  });
20
- }, ne = (e) => ({
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", b = ({ className: b, clearOnFocus: x = !1, disabled: S, endIcon: C, errorMessage: w, id: re, label: T, labelClassName: E, name: D, onBlur: O, onChange: k, onFocus: A, placeholder: j, prefix: M, ref: N, required: P, showClearButton: F = !1, startIcon: I, state: L = "default", suppressHydrationWarning: R = !0, type: z = "text", value: B = "", "aria-label": V, "aria-describedby": H, ...U }) => {
30
- let W = d(re, D), G = `${W}-error`, { isDisabled: K, isLoading: q, isInvalid: J } = f(S, L), Y = c(L, H, P, G), X = g(null), ie = y(N, X), { isVisible: Z, toggleVisibility: ae, inputType: oe } = p(), { prefixWidth: se, prefixRef: ce } = m(M), { handleFocus: Q } = te(x, k ? (e) => k(e.target.value) : void 0), le = h((e) => {
31
- O?.(e);
32
- }, [O]), ue = h((e) => {
33
- Q(e, A);
34
- }, [Q, A]), de = h((e) => {
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
- k?.(t);
37
- }, [k]), fe = h(() => {
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
- }, []), $ = F && B.length > 0, pe = () => {
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__ */ _("button", {
43
- "aria-controls": W,
44
- "aria-label": Z ? `Hide ${T ?? "password"}` : `Show ${T ?? "password"}`,
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: ae,
49
+ onClick: le,
49
50
  type: "button",
50
- children: _(Z ? r : i, { size: 22 })
51
+ children: v(Z ? r : ee, { size: 22 })
51
52
  }),
52
- clear: () => /* @__PURE__ */ _("button", {
53
- "aria-label": String(`Clear ${T ?? "input"}`),
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: fe,
57
+ onClick: ge,
57
58
  type: "button",
58
- children: /* @__PURE__ */ _(t, { size: 24 })
59
+ children: /* @__PURE__ */ v(t, { size: 24 })
59
60
  }),
60
- loading: () => /* @__PURE__ */ _("div", {
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__ */ _(a, { size: 24 })
64
+ children: /* @__PURE__ */ v(i, { size: 24 })
64
65
  }),
65
- error: () => /* @__PURE__ */ _("div", {
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__ */ _(n, { size: 24 })
69
+ children: /* @__PURE__ */ v(n, { size: 24 })
69
70
  }),
70
- success: () => /* @__PURE__ */ _("div", {
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__ */ _(e, { size: 24 })
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 C ? /* @__PURE__ */ _("div", {
82
+ return T ? /* @__PURE__ */ v("div", {
77
83
  className: "right-4 text-input-icon absolute top-1/2 -translate-y-1/2",
78
- children: C
79
- }) : z === "password" ? s.password() : $ ? s.clear() : q ? s.loading() : L === "success" ? s.success() : L === "error" ? s.error() : null;
80
- }, me = () => I || null, he = z === "number" || z === "date" || z === "datetime-local", ge = o(u(L, b), "[text-indent:var(--prefix-width)]", $ && "pr-10", he && "tabular-nums"), _e = 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");
81
- return /* @__PURE__ */ v("div", {
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: [T && /* @__PURE__ */ _(ee, {
85
- className: o("mb-2 block", E, K && "cursor-not-allowed text-input-text--disabled placeholder:text-input-text-placeholder"),
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: W,
88
- children: T
89
- }), /* @__PURE__ */ v("div", {
93
+ htmlFor: K,
94
+ children: D
95
+ }), /* @__PURE__ */ y("div", {
90
96
  className: "relative",
91
97
  "data-testid": "spectral-input-wrapper",
92
- children: [/* @__PURE__ */ v("div", {
93
- className: "relative",
94
- children: [
95
- me(),
96
- M && /* @__PURE__ */ _("span", {
97
- ref: ce,
98
- className: _e,
99
- children: M
100
- }),
101
- /* @__PURE__ */ _("input", {
102
- "aria-label": V ?? T,
103
- autoComplete: ne(z),
104
- className: ge,
105
- "data-state": L,
106
- "data-testid": "spectral-input",
107
- disabled: K,
108
- id: W,
109
- name: D,
110
- onBlur: le,
111
- onChange: de,
112
- onFocus: ue,
113
- placeholder: j ?? T,
114
- ref: ie,
115
- required: P,
116
- style: l({ "--prefix-width": M ? `${se}px` : "0" }),
117
- suppressHydrationWarning: R,
118
- type: z === "password" ? oe : z,
119
- value: B,
120
- ...Y,
121
- ...U
122
- }),
123
- pe()
124
- ]
125
- }), J && w && /* @__PURE__ */ _(s, {
126
- dataTestId: "spectral-input-error-message",
127
- id: G,
128
- message: w
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
- b.displayName = "Input";
147
+ S.displayName = "Input";
134
148
  //#endregion
135
- export { b as Input };
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, F, A, N["aria-describedby"]), G = M?.length || 0, K = a(j, v), q = () => ({
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"